// ----------------------------------------------------------------------------- // Enum Typedefs // ----------------------------------------------------------------------------- /** * The current state of a single service. * @typedef {"unavailable" | "available" | "error"} ServiceState */ /** * Indicates where a service is reachable. * @typedef {"public" | "internal"} ServiceType */ // ----------------------------------------------------------------------------- // Model Typedefs // ----------------------------------------------------------------------------- /** * A single available service. * @typedef {Object} Service * @property {string} name * @property {string} version * @property {ServiceState} state * @property {ServiceType} type * @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. */ /** * A service has been undeployed is not reachable anymore. * @typedef {Object} ServiceDeletedEvent * @property {string} name Name of the service that has been undeployed. * @property {string} timestamp */ /** * A service has been newly deployed or updated. * @typedef {Object} ServiceUpsertedEvent * @property {Service} service * @property {string} timestamp */ // ----------------------------------------------------------------------------- // Union Typedefs // ----------------------------------------------------------------------------- /** * @typedef {(ServiceUpsertedEvent & { type: "service_upserted_event" } | ServiceDeletedEvent & { type: "service_deleted_event" })} ServiceEvent */