// ----------------------------------------------------------------------------- // Enum Typedefs // ----------------------------------------------------------------------------- /** * Type of an error source. * @typedef {"pointer" | "parameter" | "header"} ErrorSourceType */ /** * The status of a service. * @typedef {"running" | "starting" | "unhealthy"} HealthStatus */ /** * The direction in which to sort by a property. * @typedef {"asc" | "desc"} SortDirection */ // ----------------------------------------------------------------------------- // Model Typedefs // ----------------------------------------------------------------------------- /** * Basic audit information for a resource. * @typedef {Object} Audit * @property {string} created_at * @property {string} created_by * @property {string} updated_at * @property {string} updated_by */ /** * Links to further information about the occurred error. * @typedef {Object} ErrorLinks * @property {Link} [about] A link that leads to further details about this particular occurrence of the problem. * @property {Link} [type] A link that identifies the type of the error that this particular error is an instance of. */ /** * Reference to the primary source of an error. * @typedef {Object} ErrorSource * @property {ErrorSourceType} type * @property {string} source The source of the problem in the form specified by `type`. */ /** * An error returned on failed API requests. * @typedef {Object} GenericError * @property {ErrorLinks} [links] * @property {string} code An app specific error code. * @property {string} title A short human readable summary of the problem. * @property {string} detail A human readable explanation of the problem. * @property {ErrorSource} [source] * @property {Object} [meta] Non-standard meta-information about the error. */ /** * Indicating the health of a service. * @typedef {Object} HealthCheck * @property {HealthStatus} status * @property {string} [message] An optional message giving more detailed information about the current health. */ /** * Represents a link with some meta information. * @typedef {Object} LinkObject * @property {string} href An URI-reference pointing to the links target. * @property {string} [title] A human-readable label for the link. * @property {string} [type] Optional media type of the link's target. */ /** * Paging information returned from a paged request. * @typedef {Object} PageResponse * @property {number} offset * @property {number} limit * @property {Sort[]} sort * @property {number} total_results Total number of results that can potentially be returned. * @property {number} total_pages Total number of pages that can potentially be returned. */ /** * Form containing paging information. * @typedef {Object} PagingForm * @property {number} offset Offset of the current page. The pages are 0-indexed, meaning the first page starts at 0. * @property {number} limit The number of results to be returned by the api. * @property {Sort[]} [sort] Defines multiple properties for the results to be sorted by. The order of the definition defines the priority. If omitted, the service will use an implementation dependent default sort. */ /** * Information about a deployed service. * @typedef {Object} ServiceInfo * @property {string} name * @property {string} version * @property {string} uri URI under which this service is deployed. * @property {string} [title] A human-readable title of the service. * @property {string} [description] A human-readable description of the service. */ /** * Single property to sort by. * @typedef {Object} Sort * @property {string} property The property by which the results should be sorted. * @property {SortDirection} direction The direction in which the results should be sorted. */ // ----------------------------------------------------------------------------- // Union Typedefs // ----------------------------------------------------------------------------- /** * Represents a link to a resource. * @typedef {(string & { discriminator: "string" } | LinkObject & { discriminator: "link_object" })} Link */