@abgov/adsp-sdk-mcp-server 1.35.1 → 1.35.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"openapi":"3.0.0","info":{"title":"Value service","version":"0.0.0","description":"The Value service provides a time-series append only store for json documents."},"paths":{"/value/v1/definitions":{"get":{"tags":["Value definition"],"description":"Retrieves the tenant and core value definitions, grouped by namespace. Requires the value-reader or value-writer role. Tenant users receive the definitions of their own tenant; core users with the role receive those of the tenant set by tenantId, or only core definitions (with an empty tenant) when it is not set.\n","parameters":[{"$ref":"#/components/parameters/ValueTenantId"}],"responses":{"200":{"description":"Value definitions successfully retrieved.","content":{"application/json":{"example":{"tenant":{"test-service":{"name":"test-service","definitions":{"response-time":{"name":"response-time","description":"Response time of the test service.","jsonSchema":{"type":"number"}}}}},"core":{}},"schema":{"type":"object","properties":{"tenant":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ValueNamespace"}},"core":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ValueNamespace"}}}}}}},"400":{"description":"tenantId is not a valid tenant URN.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValueError"},"example":{"errorMessage":"ADSP ID (not-a-tenant) must begin with: urn:ads:"}}}},"401":{"$ref":"#/components/responses/ValueUnauthorized"},"403":{"$ref":"#/components/responses/ValueForbidden"}}},"post":{"tags":["Value definition"],"description":"Creates a value definition in the tenant configuration, adding the namespace if it does not exist. Requires the value-writer role and a tenant context: tenant users create definitions in their own tenant, and core users must set tenantId. The JSON schema must be a valid JSON schema. Responds 409 if a tenant or core definition with the same namespace and name already exists.\n","parameters":[{"$ref":"#/components/parameters/ValueTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"example":{"namespace":"test-service","name":"response-time","description":"Response time of the test service.","jsonSchema":{"type":"number"},"sendWriteEvent":false},"schema":{"allOf":[{"$ref":"#/components/schemas/ValueDefinition"},{"type":"object","properties":{"namespace":{"type":"string","pattern":"^[a-zA-Z0-9-_ ]{1,50}$"}},"required":["namespace","name","jsonSchema"]}]}}}},"responses":{"201":{"description":"Value definition successfully created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValueDefinitionResponse"}}}},"400":{"$ref":"#/components/responses/ValueBadRequest"},"401":{"$ref":"#/components/responses/ValueUnauthorized"},"403":{"$ref":"#/components/responses/ValueForbidden"},"409":{"$ref":"#/components/responses/ValueDefinitionConflict"}}}},"/value/v1/definitions/{namespace}/{name}":{"parameters":[{"name":"namespace","description":"Namespace of the value definition.","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-zA-Z0-9-_ ]{1,50}$"},"example":"test-service"},{"name":"name","description":"Name of the value definition.","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-zA-Z0-9-_ ]{1,50}$"},"example":"response-time"},{"$ref":"#/components/parameters/ValueTenantId"}],"get":{"tags":["Value definition"],"description":"Retrieves a value definition. The tenant definition is returned if it exists, otherwise the core definition. Requires the value-reader or value-writer role. Tenant users read their own tenant's definitions; core users read those of the tenant set by tenantId, or only core definitions when it is not set. Definitions of other tenants respond 404.\n","responses":{"200":{"description":"Value definition successfully retrieved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValueDefinitionResponse"}}}},"400":{"$ref":"#/components/responses/ValueBadRequest"},"401":{"$ref":"#/components/responses/ValueUnauthorized"},"403":{"$ref":"#/components/responses/ValueForbidden"},"404":{"$ref":"#/components/responses/ValueDefinitionNotFound"}}},"patch":{"tags":["Value definition"],"description":"Updates a tenant value definition. Properties not included in the request are left unchanged. Requires the value-writer role and a tenant context: tenant users update their own tenant's definitions, and core users must set tenantId. Core definitions and definitions of other tenants respond 404. The JSON schema must be a valid JSON schema.\n","requestBody":{"required":true,"content":{"application/json":{"example":{"description":"Response time of the test service in milliseconds."},"schema":{"$ref":"#/components/schemas/ValueDefinitionUpdate"}}}},"responses":{"200":{"description":"Value definition successfully updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValueDefinitionResponse"}}}},"400":{"$ref":"#/components/responses/ValueBadRequest"},"401":{"$ref":"#/components/responses/ValueUnauthorized"},"403":{"$ref":"#/components/responses/ValueForbidden"},"404":{"$ref":"#/components/responses/ValueDefinitionNotFound"}}},"delete":{"tags":["Value definition"],"description":"Deletes a tenant value definition. The namespace is removed when its last definition is deleted. Requires the value-writer role and a tenant context: tenant users delete their own tenant's definitions, and core users must set tenantId. Core definitions and definitions of other tenants respond 404.\n","responses":{"200":{"description":"Value definition successfully deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}}},"example":{"deleted":true}}}},"400":{"$ref":"#/components/responses/ValueBadRequest"},"401":{"$ref":"#/components/responses/ValueUnauthorized"},"403":{"$ref":"#/components/responses/ValueForbidden"},"404":{"$ref":"#/components/responses/ValueDefinitionNotFound"}}}},"/value/v1/event-resources/distinct-count":{"get":{"tags":["Value"],"description":"Counts the distinct resources a tenant's events named over a period, for example the PDF templates used by pdf-service events. Answered from a daily rollup of the event log; the current day, and any history the rollup has not reached yet, are read from the event log for that span only. Only the resources the rollup maintains are accepted: templateId for pdf-service and definitionId for form-service events. Requires the value-reader role and a tenant context: tenant users count their own tenant, and core users must set tenantId.\n","parameters":[{"$ref":"#/components/parameters/ValueTenantId"},{"name":"namespace","description":"Namespace of the events, which is the service that sends them.","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":50},"example":"pdf-service"},{"name":"contextKey","description":"Event log context property that names the resource.","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":50},"example":"templateId"},{"name":"names","description":"Comma separated event names to count across. Defaults to every event the rollup maintains for the namespace, and responds 400 if it names any other.\n","in":"query","required":false,"schema":{"type":"string"},"example":"pdf-generation-queued,pdf-generated,pdf-generation-failed"},{"name":"intervalMin","description":"Inclusive start of the period (ISO 8601).","in":"query","required":true,"schema":{"type":"string","format":"date-time"},"example":"2025-11-01T00:00:00.000Z"},{"name":"intervalMax","description":"Exclusive end of the period (ISO 8601). The period can be at most 731 days.","in":"query","required":true,"schema":{"type":"string","format":"date-time"},"example":"2026-11-01T00:00:00.000Z"}],"responses":{"200":{"description":"Distinct resources counted.","content":{"application/json":{"example":{"namespace":"pdf-service","contextKey":"templateId","names":["pdf-generation-queued","pdf-generated","pdf-generation-failed"],"intervalMin":"2025-11-01T00:00:00.000Z","intervalMax":"2026-11-01T00:00:00.000Z","count":12},"schema":{"type":"object","properties":{"namespace":{"type":"string"},"contextKey":{"type":"string"},"names":{"type":"array","items":{"type":"string"}},"intervalMin":{"type":"string","format":"date-time"},"intervalMax":{"type":"string","format":"date-time"},"count":{"type":"integer","description":"Number of distinct resources named by the events in the period."}}}}}},"400":{"description":"A parameter failed validation, tenant context is missing, the namespace and contextKey are not rolled up, names includes an event that is not rolled up, or the period is empty or longer than 731 days.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValueError"},"example":{"errorMessage":"Distinct templateId is not rolled up for test-service events."}}}},"401":{"$ref":"#/components/responses/ValueUnauthorized"},"403":{"$ref":"#/components/responses/ValueForbidden"}}}},"/value/v1/service-metric-rollups/run":{"post":{"tags":["Value"],"description":"Manually triggers service metric rollup processing for completed days. Requires the value-writer role. Core users with the role can roll up a specific tenant by setting tenantId in the body, or all tenants by leaving it out; tenant users are always restricted to their own tenant and tenantId is ignored. The current partial day and future days cannot be rolled up.\n","requestBody":{"required":false,"content":{"application/json":{"example":{"start":"2026-09-01","end":"2026-09-07","tenantId":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7"},"schema":{"type":"object","properties":{"start":{"type":"string","format":"date","description":"First completed day to roll up (ISO 8601). Defaults to end when only end is supplied, and to the configured trailing window when neither is supplied.\n"},"end":{"type":"string","format":"date","description":"Last completed day to roll up (ISO 8601). Defaults to start when only start is supplied."},"tenantId":{"type":"string","description":"Tenant ID to roll up. Only used for core users."}}}}}},"responses":{"200":{"description":"Service metric rollup completed.","content":{"application/json":{"example":{"start":"2026-09-01","end":"2026-09-07","tenant":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7","rollups":42},"schema":{"type":"object","properties":{"start":{"type":"string","format":"date"},"end":{"type":"string","format":"date"},"tenant":{"type":"string","nullable":true,"description":"Tenant ID that was rolled up, or null when all tenants were rolled up."},"rollups":{"type":"integer","description":"Number of rollup rows written."}}}}}},"400":{"description":"start or end is not an ISO 8601 date, start is after end, or the range includes the current partial day or a future day.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValueError"},"example":{"errorMessage":"Cannot roll up the current partial day or a future day."}}}},"401":{"$ref":"#/components/responses/ValueUnauthorized"},"403":{"$ref":"#/components/responses/ValueForbidden"}}}},"/value/v1/{namespace}/values":{"get":{"tags":["Value"],"description":"Reads the latest record of each value definition in a namespace. Requires the value-reader role. Only values with a tenant or core value definition are returned. Acts on the tenant of the caller's token; core users reading a tenant's values should read each value with GET /value/v1/{namespace}/values/{name} and tenantId.\n","parameters":[{"$ref":"#/components/parameters/ValueNamespaceParam"},{"name":"names","in":"query","description":"Comma-separated names of the values to read. Defaults to every value defined in the namespace.","required":false,"style":"form","explode":false,"schema":{"type":"array","items":{"type":"string"}},"example":["response-time","error-count"]}],"responses":{"200":{"description":"Values successfully read, keyed by namespace and then value name.","content":{"application/json":{"example":{"test-service":{"response-time":{"correlationId":"request-1","context":{"endpoint":"/api/v1/items"},"timestamp":"2026-09-24T17:00:00.000Z","value":120}}},"schema":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/Value"}}}}}},"400":{"$ref":"#/components/responses/ValueBadRequest"},"401":{"$ref":"#/components/responses/ValueUnauthorized"},"403":{"$ref":"#/components/responses/ValueForbidden"},"404":{"description":"The namespace has no value definitions, or none of the requested names has a value definition.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValueError"},"example":{"errorMessage":"namespace with ID 'test-service' could not be found."}}}}}}},"/value/v1/{namespace}/values/{name}":{"parameters":[{"name":"namespace","description":"Namespace of the stored value. This path value is always event-service for event log records; it is not the optional event namespace filter exposed by the event service.\n","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":50},"example":"test-service"},{"name":"name","description":"Name of the stored value. This path value is always event for event log records; it is not the optional event name filter exposed by the event service.\n","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":50},"example":"response-time"}],"get":{"tags":["Value"],"description":"Reads records of a namespace value, newest first unless order is asc. Requires the value-reader role, or the export-service export-job role. Only records of the tenant are returned; tenant users read their own tenant and core users with the role read the tenant set by tenantId. Core users can also leave out tenantId to read the records of all tenants, which is how the event service reads the event log. Tenant users without a tenant context get 400. A value that has no records responds 200 with an empty array. Event log consumers should use the event service API, where event namespace and name are optional query filters.\n","parameters":[{"$ref":"#/components/parameters/ValueTenantId"},{"name":"top","description":"Number of results to read. Defaults to 10.","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":5000,"default":10}},{"name":"after","description":"Cursor for the next set of results; set it to page.next of the previous response.","in":"query","required":false,"schema":{"type":"string","description":"Base64 encoded number of records to skip."},"example":"MTA="},{"name":"order","description":"Timestamp order of the results; asc reads oldest first. Defaults to desc. Reading the oldest end of a large result set in asc order avoids skipping over the newer records.\n","in":"query","required":false,"schema":{"type":"string","enum":["asc","desc"],"default":"desc"}},{"name":"correlationId","description":"Correlation ID associated with the values.","in":"query","required":false,"schema":{"type":"string"},"example":"request-1"},{"name":"context","description":"JSON object of context values the records must contain. Must be valid JSON. Every supplied property must match (AND). For event log records, namespace and name identify the event definition.\n","in":"query","required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"oneOf":[{"type":"string"},{"type":"boolean"},{"type":"number"}]},"example":{"namespace":"support-program","name":"application-submitted"}}}}},{"name":"timestampMin","description":"Inclusive min value of timestamp (ISO 8601).","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"example":"2026-09-01T00:00:00.000Z"},{"name":"timestampMax","description":"Inclusive max value of timestamp (ISO 8601).","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"example":"2026-10-01T00:00:00.000Z"},{"name":"payloadPath","description":"Dot-separated property path within an event payload. Must be supplied with payloadValue and with both timestampMin and timestampMax. Cannot be combined with payload.\n","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_-]*(\\.[A-Za-z_][A-Za-z0-9_-]*)*$","example":"applicant.contact.email"}},{"name":"payloadValue","description":"Exact JSON scalar at payloadPath. JSON numbers, booleans, null, and quoted strings are parsed as their JSON types; other input is treated as a string. Must be supplied with payloadPath.\n","in":"query","required":false,"schema":{"type":"string","example":"test.user@gov.ab.ca"}},{"name":"payload","description":"JSON object that the event payload must contain. Nested objects and multiple properties are supported, and every supplied property must match (AND). Additional event payload properties are ignored. Requires both timestampMin and timestampMax and cannot be combined with payloadPath or payloadValue.\n","in":"query","required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"example":{"applicationId":"12345","status":"submitted"}}}}},{"name":"value","description":"Filter to records with a payload targetId equal to this value (used for event log records). Must not contain double quotes.\n","in":"query","required":false,"schema":{"type":"string"},"example":"61f2e3a8c9b1d2e3f4a5b6c7"},{"name":"url","description":"Filter to records with a payload URL equal to this value (used for event log records). Must not contain double quotes.\n","in":"query","required":false,"schema":{"type":"string"},"example":"https://my-application.alberta.ca/applications"}],"responses":{"200":{"description":"Value successfully read.","content":{"application/json":{"example":{"test-service":{"response-time":[{"correlationId":"request-1","context":{"endpoint":"/api/v1/items"},"timestamp":"2026-09-24T17:00:00.000Z","value":120}]},"page":{"after":null,"next":"MTA=","size":1}},"schema":{"type":"object","properties":{"page":{"$ref":"#/components/schemas/ValuePage"}},"additionalProperties":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/Value"}}}}}}},"400":{"$ref":"#/components/responses/ValueBadRequest"},"401":{"$ref":"#/components/responses/ValueUnauthorized"},"403":{"$ref":"#/components/responses/ValueForbidden"}}},"post":{"tags":["Value"],"description":"Writes one or more records of a namespace value. Requires the value-writer role. Tenant users write to their own tenant; core users with the role write to the tenant set by tenantId in the body or query, and get 400 without one. A tenant user who sets a tenantId other than their own gets 403. The body can be a value envelope (with value, context, correlationId, timestamp and metrics), a bare JSON object which is written as the value, or an array of either. A value does not need a definition. If the value has a definition, records that fail its schema are skipped, and a value-written event is sent for each record when the definition has sendWriteEvent set. Responds with an array when the request body is an array.\n","parameters":[{"$ref":"#/components/parameters/ValueTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"examples":{"envelope":{"summary":"Value with envelope","value":{"correlationId":"request-1","context":{"endpoint":"/api/v1/items"},"timestamp":"2026-09-24T17:00:00.000Z","value":120,"metrics":{"response-time":120}}},"bare":{"summary":"Bare value object","value":{"responseTime":120}},"batch":{"summary":"Batch of values","value":[{"value":120},{"value":95}]},"core":{"summary":"Core user writing to a tenant","value":{"tenantId":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7","value":120}}},"schema":{"oneOf":[{"allOf":[{"$ref":"#/components/schemas/Value"},{"type":"object","properties":{"tenantId":{"type":"string","description":"Tenant to write to. Only core users can write to a tenant other than their own."}}}]},{"type":"object"},{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/Value"},{"type":"object"}]}}]}}}},"responses":{"200":{"description":"Value successfully written.","content":{"application/json":{"example":{"correlationId":"request-1","context":{"endpoint":"/api/v1/items"},"timestamp":"2026-09-24T17:00:00.000Z","value":120},"schema":{"oneOf":[{"$ref":"#/components/schemas/Value"},{"type":"array","items":{"$ref":"#/components/schemas/Value"}}]}}}},"400":{"$ref":"#/components/responses/ValueBadRequest"},"401":{"$ref":"#/components/responses/ValueUnauthorized"},"403":{"$ref":"#/components/responses/ValueForbidden"}}}},"/value/v1/{namespace}/values/{name}/count":{"parameters":[{"$ref":"#/components/parameters/ValueNamespaceParam"},{"$ref":"#/components/parameters/ValueNameParam"}],"get":{"tags":["Value"],"description":"Counts records of a namespace value in a tenant. Requires the value-reader role and a tenant context: tenant users count their own tenant, and core users must set tenantId.\n","parameters":[{"$ref":"#/components/parameters/ValueTenantId"},{"name":"correlationId","description":"Correlation ID associated with the values.","in":"query","required":false,"schema":{"type":"string"},"example":"request-1"},{"name":"context","description":"JSON object of context values the records must contain. Must be valid JSON. Every supplied property must match (AND). For event log records, namespace and name identify the event definition.\n","in":"query","required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"oneOf":[{"type":"string"},{"type":"boolean"},{"type":"number"}]},"example":{"namespace":"support-program","name":"application-submitted"}}}}},{"name":"timestampMin","description":"Inclusive min value of timestamp (ISO 8601).","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"example":"2026-09-01T00:00:00.000Z"},{"name":"timestampMax","description":"Inclusive max value of timestamp (ISO 8601).","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"example":"2026-10-01T00:00:00.000Z"}],"responses":{"200":{"description":"Value successfully read.","content":{"application/json":{"schema":{"type":"object","properties":{"namespace":{"type":"string"},"name":{"type":"string"},"count":{"type":"integer"}}},"example":{"namespace":"test-service","name":"response-time","count":1024}}}},"400":{"$ref":"#/components/responses/ValueBadRequest"},"401":{"$ref":"#/components/responses/ValueUnauthorized"},"403":{"$ref":"#/components/responses/ValueForbidden"}}}},"/value/v1/{namespace}/values/{name}/metrics":{"get":{"tags":["Value"],"description":"Retrieves interval aggregates of every metric of a value, keyed by metric name. Requires the value-reader role and a tenant context: tenant users read their own tenant, and core users must set tenantId. Paging is over metric interval rows, newest first.\n","parameters":[{"$ref":"#/components/parameters/ValueNamespaceParam"},{"$ref":"#/components/parameters/ValueNameParam"},{"$ref":"#/components/parameters/ValueTenantId"},{"$ref":"#/components/parameters/MetricInterval"},{"$ref":"#/components/parameters/MetricTop"},{"$ref":"#/components/parameters/MetricAfter"},{"name":"criteria","description":"JSON criteria for the read. Must be valid JSON.","in":"query","required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricCriteria"}}}}],"responses":{"200":{"description":"Metrics successfully read.","content":{"application/json":{"schema":{"type":"object","properties":{"page":{"$ref":"#/components/schemas/MetricPage"}},"additionalProperties":{"$ref":"#/components/schemas/Metric"}},"example":{"response-time:avg":{"name":"response-time:avg","values":[{"interval":"2026-09-23T00:00:00.000Z","avg":118.5,"sum":1185,"min":80,"max":240,"count":10}]},"page":{"after":null,"next":"MQ==","size":1,"intervalMax":"2026-09-24T00:00:00.000Z"}}}}},"400":{"$ref":"#/components/responses/ValueBadRequest"},"401":{"$ref":"#/components/responses/ValueUnauthorized"},"403":{"$ref":"#/components/responses/ValueForbidden"}}}},"/value/v1/{namespace}/values/{name}/metrics/{metric}":{"get":{"tags":["Value"],"description":"Retrieves interval aggregates of a single metric of a value. Requires the value-reader role and a tenant context: tenant users read their own tenant, and core users must set tenantId. A metric without records responds 200 with no values.\n","parameters":[{"$ref":"#/components/parameters/ValueNamespaceParam"},{"$ref":"#/components/parameters/ValueNameParam"},{"name":"metric","description":"Name of the metric to read.","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100},"example":"response-time:avg"},{"$ref":"#/components/parameters/ValueTenantId"},{"$ref":"#/components/parameters/MetricInterval"},{"$ref":"#/components/parameters/MetricTop"},{"$ref":"#/components/parameters/MetricAfter"},{"name":"criteria","description":"JSON criteria for the read; metricLike is not used. Must be valid JSON.","in":"query","required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricCriteria"}}}}],"responses":{"200":{"description":"Metric successfully read.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Metric"},{"type":"object","properties":{"page":{"$ref":"#/components/schemas/MetricPage"}}}]},"example":{"name":"response-time:avg","values":[{"interval":"2026-09-23T00:00:00.000Z","avg":118.5,"sum":1185,"min":80,"max":240,"count":10}],"page":{"after":null,"next":"MQ==","size":1,"intervalMax":"2026-09-24T00:00:00.000Z"}}}}},"400":{"$ref":"#/components/responses/ValueBadRequest"},"401":{"$ref":"#/components/responses/ValueUnauthorized"},"403":{"$ref":"#/components/responses/ValueForbidden"}}}},"/value/v1/{namespace}/values/{name}/platform-metrics":{"get":{"tags":["Value"],"description":"Retrieves interval aggregates of a value's metrics across all tenants, labelled by tenant. Requires the value-platform-metrics-reader role and is only accessible to core users; tenant users get 403 even with the role. Always reads the materialised metric rollups and is not paginated.\n","parameters":[{"$ref":"#/components/parameters/ValueNamespaceParam"},{"$ref":"#/components/parameters/ValueNameParam"},{"$ref":"#/components/parameters/MetricInterval"},{"name":"criteria","description":"JSON criteria for the read. Must be valid JSON.","in":"query","required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricCriteria"}}}}],"responses":{"200":{"description":"Platform metrics successfully read.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/PlatformMetric"}},"example":{"response-time:avg":{"name":"response-time:avg","values":[{"interval":"2026-09-23T00:00:00.000Z","tenantId":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7","avg":118.5,"sum":1185,"min":80,"max":240,"count":10}]}}}}},"400":{"$ref":"#/components/responses/ValueBadRequest"},"401":{"$ref":"#/components/responses/ValueUnauthorized"},"403":{"description":"User is not a core user with the value-platform-metrics-reader role.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValueError"},"example":{"errorMessage":"User Test User (ID: 1234) not permitted to read platform metrics."}}}}}}}},"components":{"securitySchemes":{"accessToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"responses":{"ValueBadRequest":{"description":"Request is invalid, for example a path or query parameter failed validation or tenant context is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValueError"},"example":{"errorMessage":"Tenant context is required for operation."}}}},"ValueDefinitionConflict":{"description":"Value definition already exists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValueError"},"example":{"errorMessage":"Value definition 'test-service:response-time' already exists."}}}},"ValueDefinitionNotFound":{"description":"Value definition not found in the tenant (or, for reads, in the core definitions).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValueError"},"example":{"errorMessage":"value definition with ID 'test-service:response-time' could not be found."}}}},"ValueForbidden":{"description":"User does not have the role required for the operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValueError"},"example":{"errorMessage":"User Test User (ID: 1234) not permitted to read values."}}}},"ValueNotFound":{"description":"Namespace or value definition not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValueError"},"example":{"errorMessage":"namespace with ID 'test-service' could not be found."}}}},"ValueUnauthorized":{"description":"Request does not include a valid bearer token."}},"schemas":{"Metric":{"type":"object","properties":{"name":{"type":"string"},"values":{"type":"array","description":"Interval aggregates, newest first.","items":{"$ref":"#/components/schemas/MetricIntervalValue"}}},"example":{"name":"response-time:avg","values":[{"interval":"2026-09-23T00:00:00.000Z","avg":118.5,"sum":1185,"min":80,"max":240,"count":10}]}},"MetricCriteria":{"type":"object","description":"Must be valid JSON. Without intervalMin and intervalMax, the last month is read. intervalMin and intervalMax must be ISO 8601 date-times.\n","properties":{"metricLike":{"type":"string","description":"Only read metrics whose name contains this text. Not used when reading a single metric."},"intervalMax":{"type":"string","format":"date-time"},"intervalMin":{"type":"string","format":"date-time"}},"example":{"metricLike":"response-time","intervalMin":"2026-09-01T00:00:00.000Z","intervalMax":"2026-10-01T00:00:00.000Z"}},"MetricIntervalValue":{"type":"object","properties":{"interval":{"type":"string","format":"date-time","description":"Start of the interval."},"avg":{"type":"number","nullable":true},"sum":{"type":"number"},"min":{"type":"number"},"max":{"type":"number"},"count":{"type":"number"}},"example":{"interval":"2026-09-23T00:00:00.000Z","avg":118.5,"sum":1185,"min":80,"max":240,"count":10}},"MetricPage":{"allOf":[{"$ref":"#/components/schemas/ValuePage"},{"type":"object","properties":{"intervalMax":{"type":"string","format":"date-time","readOnly":true,"description":"End of the window actually read. It is snapped back to the start of the interval in progress, so only whole intervals are returned.\n"}}}],"example":{"after":null,"next":"MQ==","size":1,"intervalMax":"2026-09-24T00:00:00.000Z"}},"PlatformMetric":{"type":"object","properties":{"name":{"type":"string"},"values":{"type":"array","items":{"$ref":"#/components/schemas/PlatformMetricIntervalValue"}}},"example":{"name":"response-time:avg","values":[{"interval":"2026-09-23T00:00:00.000Z","tenantId":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7","avg":118.5,"sum":1185,"min":80,"max":240,"count":10}]}},"PlatformMetricIntervalValue":{"allOf":[{"$ref":"#/components/schemas/MetricIntervalValue"},{"type":"object","properties":{"tenantId":{"type":"string"}}}],"example":{"interval":"2026-09-23T00:00:00.000Z","tenantId":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7","avg":118.5,"sum":1185,"min":80,"max":240,"count":10}},"Value":{"type":"object","properties":{"correlationId":{"type":"string","nullable":true,"description":"Correlation ID that links related records, for example the records of one request."},"context":{"type":"object","description":"Context of the record, used to filter reads.","additionalProperties":{"oneOf":[{"type":"string"},{"type":"boolean"},{"type":"number"}]}},"timestamp":{"type":"string","format":"date-time","description":"Time of the record. Defaults to the time of the write."},"value":{"description":"The recorded value; any JSON value. Validated against the value definition schema, if there is one."},"metrics":{"type":"object","writeOnly":true,"description":"Metric name to number. Numeric entries are recorded as metrics of the value and aggregated into intervals; other entries are ignored. Not returned with the record.\n","additionalProperties":{"type":"number"}}},"example":{"correlationId":"request-1","context":{"endpoint":"/api/v1/items"},"timestamp":"2026-09-24T17:00:00.000Z","value":120}},"ValueDefinition":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-zA-Z0-9-_ ]{1,50}$"},"displayName":{"type":"string"},"description":{"type":"string"},"jsonSchema":{"type":"object","description":"JSON schema that written values are validated against."},"sendWriteEvent":{"type":"boolean","description":"Whether a value-written event is sent when a value is written."}},"example":{"name":"response-time","displayName":"Response time","description":"Response time of the test service.","jsonSchema":{"type":"number"},"sendWriteEvent":false}},"ValueDefinitionResponse":{"allOf":[{"$ref":"#/components/schemas/ValueDefinition"},{"type":"object","properties":{"namespace":{"type":"string"},"isCore":{"type":"boolean","description":"Whether the definition is a core (platform) definition rather than a tenant definition."}}}],"example":{"namespace":"test-service","name":"response-time","displayName":"Response time","description":"Response time of the test service.","jsonSchema":{"type":"number"},"sendWriteEvent":false,"isCore":false}},"ValueDefinitionUpdate":{"type":"object","properties":{"displayName":{"type":"string"},"description":{"type":"string"},"jsonSchema":{"type":"object"},"sendWriteEvent":{"type":"boolean"}},"example":{"description":"Response time of the test service in milliseconds."}},"ValueError":{"type":"object","properties":{"errorMessage":{"type":"string"}},"example":{"errorMessage":"Tenant context is required for operation."}},"ValueNamespace":{"type":"object","properties":{"name":{"type":"string"},"definitions":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ValueDefinition"}}},"example":{"name":"test-service","definitions":{"response-time":{"name":"response-time","description":"Response time of the test service.","jsonSchema":{"type":"number"}}}}},"ValuePage":{"type":"object","properties":{"after":{"type":"string","nullable":true,"description":"Cursor the page was read after."},"next":{"type":"string","description":"Cursor for the next page; absent when there are no more results."},"size":{"type":"number","description":"Number of results in the page."}},"example":{"after":null,"next":"MTA=","size":10}}},"parameters":{"MetricAfter":{"name":"after","description":"Cursor for the next set of results; set it to page.next of the previous response.","in":"query","required":false,"schema":{"type":"string","description":"Base64 encoded number of rows to skip."},"example":"MTAw"},"MetricInterval":{"name":"interval","description":"Interval to aggregate metrics into. Defaults to daily. Any other value responds 400 with \"Interval value is not recognized.\"\n","in":"query","required":false,"schema":{"type":"string","default":"daily","enum":["one_minute","five_minutes","hourly","daily","weekly","monthly"]}},"MetricTop":{"name":"top","description":"Number of metric interval rows to read. Defaults to 100.","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":5000,"default":100}},"ValueNameParam":{"name":"name","description":"Name of the value within the namespace.","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":50},"example":"response-time"},"ValueNamespaceParam":{"name":"namespace","description":"Namespace of the value, for example the name of the service that writes it.","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":50},"example":"test-service"},"ValueTenantId":{"name":"tenantId","description":"ID of the tenant to act on. Only used for core (platform) users; tenant users always act on the tenant of their token and this parameter is ignored. Responds 400 if it is not a valid tenant URN.\n","in":"query","required":false,"schema":{"type":"string"},"example":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7"}}},"security":[{"accessToken":[]}],"tags":[{"name":"Value","description":"API to store and retrieve values."},{"name":"Value definition","description":"API to manage value definitions."}]}
|
|
1
|
+
{"openapi":"3.0.0","info":{"title":"Value service","version":"0.0.0","description":"The Value service provides a time-series append only store for json documents."},"paths":{"/value/v1/definitions":{"get":{"tags":["Value definition"],"description":"Retrieves the tenant and core value definitions, grouped by namespace. Requires the value-reader or value-writer role. Tenant users receive the definitions of their own tenant; core users with the role receive those of the tenant set by tenantId, or only core definitions (with an empty tenant) when it is not set.\n","parameters":[{"$ref":"#/components/parameters/ValueTenantId"}],"responses":{"200":{"description":"Value definitions successfully retrieved.","content":{"application/json":{"example":{"tenant":{"test-service":{"name":"test-service","definitions":{"response-time":{"name":"response-time","description":"Response time of the test service.","jsonSchema":{"type":"number"}}}}},"core":{}},"schema":{"type":"object","properties":{"tenant":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ValueNamespace"}},"core":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ValueNamespace"}}}}}}},"400":{"description":"tenantId is not a valid tenant URN.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValueError"},"example":{"errorMessage":"ADSP ID (not-a-tenant) must begin with: urn:ads:"}}}},"401":{"$ref":"#/components/responses/ValueUnauthorized"},"403":{"$ref":"#/components/responses/ValueForbidden"}}},"post":{"tags":["Value definition"],"description":"Creates a value definition in the tenant configuration, adding the namespace if it does not exist. Requires the value-writer role and a tenant context: tenant users create definitions in their own tenant, and core users must set tenantId. The JSON schema must be a valid JSON schema. Responds 409 if a tenant or core definition with the same namespace and name already exists.\n","parameters":[{"$ref":"#/components/parameters/ValueTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"example":{"namespace":"test-service","name":"response-time","description":"Response time of the test service.","jsonSchema":{"type":"number"},"sendWriteEvent":false},"schema":{"allOf":[{"$ref":"#/components/schemas/ValueDefinition"},{"type":"object","properties":{"namespace":{"type":"string","pattern":"^[a-zA-Z0-9-_ ]{1,50}$"}},"required":["namespace","name","jsonSchema"]}]}}}},"responses":{"201":{"description":"Value definition successfully created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValueDefinitionResponse"}}}},"400":{"$ref":"#/components/responses/ValueBadRequest"},"401":{"$ref":"#/components/responses/ValueUnauthorized"},"403":{"$ref":"#/components/responses/ValueForbidden"},"409":{"$ref":"#/components/responses/ValueDefinitionConflict"}}}},"/value/v1/definitions/{namespace}/{name}":{"parameters":[{"name":"namespace","description":"Namespace of the value definition.","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-zA-Z0-9-_ ]{1,50}$"},"example":"test-service"},{"name":"name","description":"Name of the value definition.","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-zA-Z0-9-_ ]{1,50}$"},"example":"response-time"},{"$ref":"#/components/parameters/ValueTenantId"}],"get":{"tags":["Value definition"],"description":"Retrieves a value definition. The tenant definition is returned if it exists, otherwise the core definition. Requires the value-reader or value-writer role. Tenant users read their own tenant's definitions; core users read those of the tenant set by tenantId, or only core definitions when it is not set. Definitions of other tenants respond 404.\n","responses":{"200":{"description":"Value definition successfully retrieved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValueDefinitionResponse"}}}},"400":{"$ref":"#/components/responses/ValueBadRequest"},"401":{"$ref":"#/components/responses/ValueUnauthorized"},"403":{"$ref":"#/components/responses/ValueForbidden"},"404":{"$ref":"#/components/responses/ValueDefinitionNotFound"}}},"patch":{"tags":["Value definition"],"description":"Updates a tenant value definition. Properties not included in the request are left unchanged. Requires the value-writer role and a tenant context: tenant users update their own tenant's definitions, and core users must set tenantId. Core definitions and definitions of other tenants respond 404. The JSON schema must be a valid JSON schema.\n","requestBody":{"required":true,"content":{"application/json":{"example":{"description":"Response time of the test service in milliseconds."},"schema":{"$ref":"#/components/schemas/ValueDefinitionUpdate"}}}},"responses":{"200":{"description":"Value definition successfully updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValueDefinitionResponse"}}}},"400":{"$ref":"#/components/responses/ValueBadRequest"},"401":{"$ref":"#/components/responses/ValueUnauthorized"},"403":{"$ref":"#/components/responses/ValueForbidden"},"404":{"$ref":"#/components/responses/ValueDefinitionNotFound"}}},"delete":{"tags":["Value definition"],"description":"Deletes a tenant value definition. The namespace is removed when its last definition is deleted. Requires the value-writer role and a tenant context: tenant users delete their own tenant's definitions, and core users must set tenantId. Core definitions and definitions of other tenants respond 404.\n","responses":{"200":{"description":"Value definition successfully deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}}},"example":{"deleted":true}}}},"400":{"$ref":"#/components/responses/ValueBadRequest"},"401":{"$ref":"#/components/responses/ValueUnauthorized"},"403":{"$ref":"#/components/responses/ValueForbidden"},"404":{"$ref":"#/components/responses/ValueDefinitionNotFound"}}}},"/value/v1/event-resources/distinct-count":{"get":{"tags":["Value"],"description":"Counts the distinct resources a tenant's events named over a period, for example the PDF templates used by pdf-service events. Answered from a daily rollup of the event log; the current day, and any history the rollup has not reached yet, are read from the event log for that span only. Only the resources the rollup maintains are accepted: templateId for pdf-service and definitionId for form-service events. Requires the value-reader role and a tenant context: tenant users count their own tenant, and core users must set tenantId.\n","parameters":[{"$ref":"#/components/parameters/ValueTenantId"},{"name":"namespace","description":"Namespace of the events, which is the service that sends them.","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":50},"example":"pdf-service"},{"name":"contextKey","description":"Event log context property that names the resource.","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":50},"example":"templateId"},{"name":"names","description":"Comma separated event names to count across. Defaults to every event the rollup maintains for the namespace, and responds 400 if it names any other.\n","in":"query","required":false,"schema":{"type":"string"},"example":"pdf-generation-queued,pdf-generated,pdf-generation-failed"},{"name":"intervalMin","description":"Inclusive start of the period (ISO 8601).","in":"query","required":true,"schema":{"type":"string","format":"date-time"},"example":"2025-11-01T00:00:00.000Z"},{"name":"intervalMax","description":"Exclusive end of the period (ISO 8601).","in":"query","required":true,"schema":{"type":"string","format":"date-time"},"example":"2026-11-01T00:00:00.000Z"}],"responses":{"200":{"description":"Distinct resources counted.","content":{"application/json":{"example":{"namespace":"pdf-service","contextKey":"templateId","names":["pdf-generation-queued","pdf-generated","pdf-generation-failed"],"intervalMin":"2025-11-01T00:00:00.000Z","intervalMax":"2026-11-01T00:00:00.000Z","count":12},"schema":{"type":"object","properties":{"namespace":{"type":"string"},"contextKey":{"type":"string"},"names":{"type":"array","items":{"type":"string"}},"intervalMin":{"type":"string","format":"date-time"},"intervalMax":{"type":"string","format":"date-time"},"count":{"type":"integer","description":"Number of distinct resources named by the events in the period."}}}}}},"400":{"description":"A parameter failed validation, tenant context is missing, the namespace and contextKey are not rolled up, names includes an event that is not rolled up, or the period is not valid timestamps or is empty.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValueError"},"example":{"errorMessage":"Distinct templateId is not rolled up for test-service events."}}}},"401":{"$ref":"#/components/responses/ValueUnauthorized"},"403":{"$ref":"#/components/responses/ValueForbidden"}}}},"/value/v1/service-metric-rollups/run":{"post":{"tags":["Value"],"description":"Manually triggers service metric rollup processing for completed days. Requires the value-writer role. Core users with the role can roll up a specific tenant by setting tenantId in the body, or all tenants by leaving it out; tenant users are always restricted to their own tenant and tenantId is ignored. The current partial day and future days cannot be rolled up.\n","requestBody":{"required":false,"content":{"application/json":{"example":{"start":"2026-09-01","end":"2026-09-07","tenantId":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7"},"schema":{"type":"object","properties":{"start":{"type":"string","format":"date","description":"First completed day to roll up (ISO 8601). Defaults to end when only end is supplied, and to the configured trailing window when neither is supplied.\n"},"end":{"type":"string","format":"date","description":"Last completed day to roll up (ISO 8601). Defaults to start when only start is supplied."},"tenantId":{"type":"string","description":"Tenant ID to roll up. Only used for core users."}}}}}},"responses":{"200":{"description":"Service metric rollup completed.","content":{"application/json":{"example":{"start":"2026-09-01","end":"2026-09-07","tenant":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7","rollups":42},"schema":{"type":"object","properties":{"start":{"type":"string","format":"date"},"end":{"type":"string","format":"date"},"tenant":{"type":"string","nullable":true,"description":"Tenant ID that was rolled up, or null when all tenants were rolled up."},"rollups":{"type":"integer","description":"Number of rollup rows written."}}}}}},"400":{"description":"start or end is not an ISO 8601 date, start is after end, or the range includes the current partial day or a future day.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValueError"},"example":{"errorMessage":"Cannot roll up the current partial day or a future day."}}}},"401":{"$ref":"#/components/responses/ValueUnauthorized"},"403":{"$ref":"#/components/responses/ValueForbidden"}}}},"/value/v1/{namespace}/values":{"get":{"tags":["Value"],"description":"Reads the latest record of each value definition in a namespace. Requires the value-reader role. Only values with a tenant or core value definition are returned. Acts on the tenant of the caller's token; core users reading a tenant's values should read each value with GET /value/v1/{namespace}/values/{name} and tenantId.\n","parameters":[{"$ref":"#/components/parameters/ValueNamespaceParam"},{"name":"names","in":"query","description":"Comma-separated names of the values to read. Defaults to every value defined in the namespace.","required":false,"style":"form","explode":false,"schema":{"type":"array","items":{"type":"string"}},"example":["response-time","error-count"]}],"responses":{"200":{"description":"Values successfully read, keyed by namespace and then value name.","content":{"application/json":{"example":{"test-service":{"response-time":{"correlationId":"request-1","context":{"endpoint":"/api/v1/items"},"timestamp":"2026-09-24T17:00:00.000Z","value":120}}},"schema":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/Value"}}}}}},"400":{"$ref":"#/components/responses/ValueBadRequest"},"401":{"$ref":"#/components/responses/ValueUnauthorized"},"403":{"$ref":"#/components/responses/ValueForbidden"},"404":{"description":"The namespace has no value definitions, or none of the requested names has a value definition.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValueError"},"example":{"errorMessage":"namespace with ID 'test-service' could not be found."}}}}}}},"/value/v1/{namespace}/values/{name}":{"parameters":[{"name":"namespace","description":"Namespace of the stored value. This path value is always event-service for event log records; it is not the optional event namespace filter exposed by the event service.\n","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":50},"example":"test-service"},{"name":"name","description":"Name of the stored value. This path value is always event for event log records; it is not the optional event name filter exposed by the event service.\n","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":50},"example":"response-time"}],"get":{"tags":["Value"],"description":"Reads records of a namespace value, newest first unless order is asc. Requires the value-reader role, or the export-service export-job role. Only records of the tenant are returned; tenant users read their own tenant and core users with the role read the tenant set by tenantId. Core users can also leave out tenantId to read the records of all tenants, which is how the event service reads the event log. Tenant users without a tenant context get 400. A value that has no records responds 200 with an empty array. Event log consumers should use the event service API, where event namespace and name are optional query filters.\n","parameters":[{"$ref":"#/components/parameters/ValueTenantId"},{"name":"top","description":"Number of results to read. Defaults to 10.","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":5000,"default":10}},{"name":"after","description":"Cursor for the next set of results; set it to page.next of the previous response.","in":"query","required":false,"schema":{"type":"string","description":"Base64 encoded number of records to skip."},"example":"MTA="},{"name":"order","description":"Timestamp order of the results; asc reads oldest first. Defaults to desc. Reading the oldest end of a large result set in asc order avoids skipping over the newer records.\n","in":"query","required":false,"schema":{"type":"string","enum":["asc","desc"],"default":"desc"}},{"name":"correlationId","description":"Correlation ID associated with the values.","in":"query","required":false,"schema":{"type":"string"},"example":"request-1"},{"name":"context","description":"JSON object of context values the records must contain. Must be valid JSON. Every supplied property must match (AND). For event log records, namespace and name identify the event definition.\n","in":"query","required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"oneOf":[{"type":"string"},{"type":"boolean"},{"type":"number"}]},"example":{"namespace":"support-program","name":"application-submitted"}}}}},{"name":"timestampMin","description":"Inclusive min value of timestamp (ISO 8601).","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"example":"2026-09-01T00:00:00.000Z"},{"name":"timestampMax","description":"Inclusive max value of timestamp (ISO 8601).","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"example":"2026-10-01T00:00:00.000Z"},{"name":"payloadPath","description":"Dot-separated property path within an event payload. Must be supplied with payloadValue and with both timestampMin and timestampMax. Cannot be combined with payload.\n","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_-]*(\\.[A-Za-z_][A-Za-z0-9_-]*)*$","example":"applicant.contact.email"}},{"name":"payloadValue","description":"Exact JSON scalar at payloadPath. JSON numbers, booleans, null, and quoted strings are parsed as their JSON types; other input is treated as a string. Must be supplied with payloadPath.\n","in":"query","required":false,"schema":{"type":"string","example":"test.user@gov.ab.ca"}},{"name":"payload","description":"JSON object that the event payload must contain. Nested objects and multiple properties are supported, and every supplied property must match (AND). Additional event payload properties are ignored. Requires both timestampMin and timestampMax and cannot be combined with payloadPath or payloadValue.\n","in":"query","required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"example":{"applicationId":"12345","status":"submitted"}}}}},{"name":"value","description":"Filter to records with a payload targetId equal to this value (used for event log records). Must not contain double quotes.\n","in":"query","required":false,"schema":{"type":"string"},"example":"61f2e3a8c9b1d2e3f4a5b6c7"},{"name":"url","description":"Filter to records with a payload URL equal to this value (used for event log records). Must not contain double quotes.\n","in":"query","required":false,"schema":{"type":"string"},"example":"https://my-application.alberta.ca/applications"}],"responses":{"200":{"description":"Value successfully read.","content":{"application/json":{"example":{"test-service":{"response-time":[{"correlationId":"request-1","context":{"endpoint":"/api/v1/items"},"timestamp":"2026-09-24T17:00:00.000Z","value":120}]},"page":{"after":null,"next":"MTA=","size":1}},"schema":{"type":"object","properties":{"page":{"$ref":"#/components/schemas/ValuePage"}},"additionalProperties":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/Value"}}}}}}},"400":{"$ref":"#/components/responses/ValueBadRequest"},"401":{"$ref":"#/components/responses/ValueUnauthorized"},"403":{"$ref":"#/components/responses/ValueForbidden"}}},"post":{"tags":["Value"],"description":"Writes one or more records of a namespace value. Requires the value-writer role. Tenant users write to their own tenant; core users with the role write to the tenant set by tenantId in the body or query, and get 400 without one. A tenant user who sets a tenantId other than their own gets 403. The body can be a value envelope (with value, context, correlationId, timestamp and metrics), a bare JSON object which is written as the value, or an array of either. A value does not need a definition. If the value has a definition, records that fail its schema are skipped, and a value-written event is sent for each record when the definition has sendWriteEvent set. Responds with an array when the request body is an array.\n","parameters":[{"$ref":"#/components/parameters/ValueTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"examples":{"envelope":{"summary":"Value with envelope","value":{"correlationId":"request-1","context":{"endpoint":"/api/v1/items"},"timestamp":"2026-09-24T17:00:00.000Z","value":120,"metrics":{"response-time":120}}},"bare":{"summary":"Bare value object","value":{"responseTime":120}},"batch":{"summary":"Batch of values","value":[{"value":120},{"value":95}]},"core":{"summary":"Core user writing to a tenant","value":{"tenantId":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7","value":120}}},"schema":{"oneOf":[{"allOf":[{"$ref":"#/components/schemas/Value"},{"type":"object","properties":{"tenantId":{"type":"string","description":"Tenant to write to. Only core users can write to a tenant other than their own."}}}]},{"type":"object"},{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/Value"},{"type":"object"}]}}]}}}},"responses":{"200":{"description":"Value successfully written.","content":{"application/json":{"example":{"correlationId":"request-1","context":{"endpoint":"/api/v1/items"},"timestamp":"2026-09-24T17:00:00.000Z","value":120},"schema":{"oneOf":[{"$ref":"#/components/schemas/Value"},{"type":"array","items":{"$ref":"#/components/schemas/Value"}}]}}}},"400":{"$ref":"#/components/responses/ValueBadRequest"},"401":{"$ref":"#/components/responses/ValueUnauthorized"},"403":{"$ref":"#/components/responses/ValueForbidden"}}}},"/value/v1/{namespace}/values/{name}/count":{"parameters":[{"$ref":"#/components/parameters/ValueNamespaceParam"},{"$ref":"#/components/parameters/ValueNameParam"}],"get":{"tags":["Value"],"description":"Counts records of a namespace value in a tenant. Requires the value-reader role and a tenant context: tenant users count their own tenant, and core users must set tenantId.\n","parameters":[{"$ref":"#/components/parameters/ValueTenantId"},{"name":"correlationId","description":"Correlation ID associated with the values.","in":"query","required":false,"schema":{"type":"string"},"example":"request-1"},{"name":"context","description":"JSON object of context values the records must contain. Must be valid JSON. Every supplied property must match (AND). For event log records, namespace and name identify the event definition.\n","in":"query","required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"oneOf":[{"type":"string"},{"type":"boolean"},{"type":"number"}]},"example":{"namespace":"support-program","name":"application-submitted"}}}}},{"name":"timestampMin","description":"Inclusive min value of timestamp (ISO 8601).","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"example":"2026-09-01T00:00:00.000Z"},{"name":"timestampMax","description":"Inclusive max value of timestamp (ISO 8601).","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"example":"2026-10-01T00:00:00.000Z"}],"responses":{"200":{"description":"Value successfully read.","content":{"application/json":{"schema":{"type":"object","properties":{"namespace":{"type":"string"},"name":{"type":"string"},"count":{"type":"integer"}}},"example":{"namespace":"test-service","name":"response-time","count":1024}}}},"400":{"$ref":"#/components/responses/ValueBadRequest"},"401":{"$ref":"#/components/responses/ValueUnauthorized"},"403":{"$ref":"#/components/responses/ValueForbidden"}}}},"/value/v1/{namespace}/values/{name}/metrics":{"get":{"tags":["Value"],"description":"Retrieves interval aggregates of every metric of a value, keyed by metric name. Requires the value-reader role and a tenant context: tenant users read their own tenant, and core users must set tenantId. Paging is over metric interval rows, newest first.\n","parameters":[{"$ref":"#/components/parameters/ValueNamespaceParam"},{"$ref":"#/components/parameters/ValueNameParam"},{"$ref":"#/components/parameters/ValueTenantId"},{"$ref":"#/components/parameters/MetricInterval"},{"$ref":"#/components/parameters/MetricTop"},{"$ref":"#/components/parameters/MetricAfter"},{"name":"criteria","description":"JSON criteria for the read. Must be valid JSON.","in":"query","required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricCriteria"}}}}],"responses":{"200":{"description":"Metrics successfully read.","content":{"application/json":{"schema":{"type":"object","properties":{"page":{"$ref":"#/components/schemas/MetricPage"}},"additionalProperties":{"$ref":"#/components/schemas/Metric"}},"example":{"response-time:avg":{"name":"response-time:avg","values":[{"interval":"2026-09-23T00:00:00.000Z","avg":118.5,"sum":1185,"min":80,"max":240,"count":10}]},"page":{"after":null,"next":"MQ==","size":1,"intervalMax":"2026-09-24T00:00:00.000Z"}}}}},"400":{"$ref":"#/components/responses/ValueBadRequest"},"401":{"$ref":"#/components/responses/ValueUnauthorized"},"403":{"$ref":"#/components/responses/ValueForbidden"}}}},"/value/v1/{namespace}/values/{name}/metrics/{metric}":{"get":{"tags":["Value"],"description":"Retrieves interval aggregates of a single metric of a value. Requires the value-reader role and a tenant context: tenant users read their own tenant, and core users must set tenantId. A metric without records responds 200 with no values.\n","parameters":[{"$ref":"#/components/parameters/ValueNamespaceParam"},{"$ref":"#/components/parameters/ValueNameParam"},{"name":"metric","description":"Name of the metric to read.","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100},"example":"response-time:avg"},{"$ref":"#/components/parameters/ValueTenantId"},{"$ref":"#/components/parameters/MetricInterval"},{"$ref":"#/components/parameters/MetricTop"},{"$ref":"#/components/parameters/MetricAfter"},{"name":"criteria","description":"JSON criteria for the read; metricLike is not used. Must be valid JSON.","in":"query","required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricCriteria"}}}}],"responses":{"200":{"description":"Metric successfully read.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Metric"},{"type":"object","properties":{"page":{"$ref":"#/components/schemas/MetricPage"}}}]},"example":{"name":"response-time:avg","values":[{"interval":"2026-09-23T00:00:00.000Z","avg":118.5,"sum":1185,"min":80,"max":240,"count":10}],"page":{"after":null,"next":"MQ==","size":1,"intervalMax":"2026-09-24T00:00:00.000Z"}}}}},"400":{"$ref":"#/components/responses/ValueBadRequest"},"401":{"$ref":"#/components/responses/ValueUnauthorized"},"403":{"$ref":"#/components/responses/ValueForbidden"}}}},"/value/v1/{namespace}/values/{name}/platform-metrics":{"get":{"tags":["Value"],"description":"Retrieves interval aggregates of a value's metrics across all tenants, labelled by tenant. Requires the value-platform-metrics-reader role and is only accessible to core users; tenant users get 403 even with the role. Always reads the materialised metric rollups and is not paginated.\n","parameters":[{"$ref":"#/components/parameters/ValueNamespaceParam"},{"$ref":"#/components/parameters/ValueNameParam"},{"$ref":"#/components/parameters/MetricInterval"},{"name":"criteria","description":"JSON criteria for the read. Must be valid JSON.","in":"query","required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricCriteria"}}}}],"responses":{"200":{"description":"Platform metrics successfully read.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/PlatformMetric"}},"example":{"response-time:avg":{"name":"response-time:avg","values":[{"interval":"2026-09-23T00:00:00.000Z","tenantId":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7","avg":118.5,"sum":1185,"min":80,"max":240,"count":10}]}}}}},"400":{"$ref":"#/components/responses/ValueBadRequest"},"401":{"$ref":"#/components/responses/ValueUnauthorized"},"403":{"description":"User is not a core user with the value-platform-metrics-reader role.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValueError"},"example":{"errorMessage":"User Test User (ID: 1234) not permitted to read platform metrics."}}}}}}}},"components":{"securitySchemes":{"accessToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"responses":{"ValueBadRequest":{"description":"Request is invalid, for example a path or query parameter failed validation or tenant context is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValueError"},"example":{"errorMessage":"Tenant context is required for operation."}}}},"ValueDefinitionConflict":{"description":"Value definition already exists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValueError"},"example":{"errorMessage":"Value definition 'test-service:response-time' already exists."}}}},"ValueDefinitionNotFound":{"description":"Value definition not found in the tenant (or, for reads, in the core definitions).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValueError"},"example":{"errorMessage":"value definition with ID 'test-service:response-time' could not be found."}}}},"ValueForbidden":{"description":"User does not have the role required for the operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValueError"},"example":{"errorMessage":"User Test User (ID: 1234) not permitted to read values."}}}},"ValueNotFound":{"description":"Namespace or value definition not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValueError"},"example":{"errorMessage":"namespace with ID 'test-service' could not be found."}}}},"ValueUnauthorized":{"description":"Request does not include a valid bearer token."}},"schemas":{"Metric":{"type":"object","properties":{"name":{"type":"string"},"values":{"type":"array","description":"Interval aggregates, newest first.","items":{"$ref":"#/components/schemas/MetricIntervalValue"}}},"example":{"name":"response-time:avg","values":[{"interval":"2026-09-23T00:00:00.000Z","avg":118.5,"sum":1185,"min":80,"max":240,"count":10}]}},"MetricCriteria":{"type":"object","description":"Must be valid JSON. Without intervalMin and intervalMax, the last month is read. intervalMin and intervalMax must be ISO 8601 date-times.\n","properties":{"metricLike":{"type":"string","description":"Only read metrics whose name contains this text. Not used when reading a single metric."},"intervalMax":{"type":"string","format":"date-time"},"intervalMin":{"type":"string","format":"date-time"}},"example":{"metricLike":"response-time","intervalMin":"2026-09-01T00:00:00.000Z","intervalMax":"2026-10-01T00:00:00.000Z"}},"MetricIntervalValue":{"type":"object","properties":{"interval":{"type":"string","format":"date-time","description":"Start of the interval."},"avg":{"type":"number","nullable":true},"sum":{"type":"number"},"min":{"type":"number"},"max":{"type":"number"},"count":{"type":"number"}},"example":{"interval":"2026-09-23T00:00:00.000Z","avg":118.5,"sum":1185,"min":80,"max":240,"count":10}},"MetricPage":{"allOf":[{"$ref":"#/components/schemas/ValuePage"},{"type":"object","properties":{"intervalMax":{"type":"string","format":"date-time","readOnly":true,"description":"End of the window actually read. It is snapped back to the start of the interval in progress, so only whole intervals are returned.\n"}}}],"example":{"after":null,"next":"MQ==","size":1,"intervalMax":"2026-09-24T00:00:00.000Z"}},"PlatformMetric":{"type":"object","properties":{"name":{"type":"string"},"values":{"type":"array","items":{"$ref":"#/components/schemas/PlatformMetricIntervalValue"}}},"example":{"name":"response-time:avg","values":[{"interval":"2026-09-23T00:00:00.000Z","tenantId":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7","avg":118.5,"sum":1185,"min":80,"max":240,"count":10}]}},"PlatformMetricIntervalValue":{"allOf":[{"$ref":"#/components/schemas/MetricIntervalValue"},{"type":"object","properties":{"tenantId":{"type":"string"}}}],"example":{"interval":"2026-09-23T00:00:00.000Z","tenantId":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7","avg":118.5,"sum":1185,"min":80,"max":240,"count":10}},"Value":{"type":"object","properties":{"correlationId":{"type":"string","nullable":true,"description":"Correlation ID that links related records, for example the records of one request."},"context":{"type":"object","description":"Context of the record, used to filter reads.","additionalProperties":{"oneOf":[{"type":"string"},{"type":"boolean"},{"type":"number"}]}},"timestamp":{"type":"string","format":"date-time","description":"Time of the record. Defaults to the time of the write."},"value":{"description":"The recorded value; any JSON value. Validated against the value definition schema, if there is one."},"metrics":{"type":"object","writeOnly":true,"description":"Metric name to number. Numeric entries are recorded as metrics of the value and aggregated into intervals; other entries are ignored. Not returned with the record.\n","additionalProperties":{"type":"number"}}},"example":{"correlationId":"request-1","context":{"endpoint":"/api/v1/items"},"timestamp":"2026-09-24T17:00:00.000Z","value":120}},"ValueDefinition":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-zA-Z0-9-_ ]{1,50}$"},"displayName":{"type":"string"},"description":{"type":"string"},"jsonSchema":{"type":"object","description":"JSON schema that written values are validated against."},"sendWriteEvent":{"type":"boolean","description":"Whether a value-written event is sent when a value is written."}},"example":{"name":"response-time","displayName":"Response time","description":"Response time of the test service.","jsonSchema":{"type":"number"},"sendWriteEvent":false}},"ValueDefinitionResponse":{"allOf":[{"$ref":"#/components/schemas/ValueDefinition"},{"type":"object","properties":{"namespace":{"type":"string"},"isCore":{"type":"boolean","description":"Whether the definition is a core (platform) definition rather than a tenant definition."}}}],"example":{"namespace":"test-service","name":"response-time","displayName":"Response time","description":"Response time of the test service.","jsonSchema":{"type":"number"},"sendWriteEvent":false,"isCore":false}},"ValueDefinitionUpdate":{"type":"object","properties":{"displayName":{"type":"string"},"description":{"type":"string"},"jsonSchema":{"type":"object"},"sendWriteEvent":{"type":"boolean"}},"example":{"description":"Response time of the test service in milliseconds."}},"ValueError":{"type":"object","properties":{"errorMessage":{"type":"string"}},"example":{"errorMessage":"Tenant context is required for operation."}},"ValueNamespace":{"type":"object","properties":{"name":{"type":"string"},"definitions":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ValueDefinition"}}},"example":{"name":"test-service","definitions":{"response-time":{"name":"response-time","description":"Response time of the test service.","jsonSchema":{"type":"number"}}}}},"ValuePage":{"type":"object","properties":{"after":{"type":"string","nullable":true,"description":"Cursor the page was read after."},"next":{"type":"string","description":"Cursor for the next page; absent when there are no more results."},"size":{"type":"number","description":"Number of results in the page."}},"example":{"after":null,"next":"MTA=","size":10}}},"parameters":{"MetricAfter":{"name":"after","description":"Cursor for the next set of results; set it to page.next of the previous response.","in":"query","required":false,"schema":{"type":"string","description":"Base64 encoded number of rows to skip."},"example":"MTAw"},"MetricInterval":{"name":"interval","description":"Interval to aggregate metrics into. Defaults to daily. Any other value responds 400 with \"Interval value is not recognized.\"\n","in":"query","required":false,"schema":{"type":"string","default":"daily","enum":["one_minute","five_minutes","hourly","daily","weekly","monthly"]}},"MetricTop":{"name":"top","description":"Number of metric interval rows to read. Defaults to 100.","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":5000,"default":100}},"ValueNameParam":{"name":"name","description":"Name of the value within the namespace.","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":50},"example":"response-time"},"ValueNamespaceParam":{"name":"namespace","description":"Namespace of the value, for example the name of the service that writes it.","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":50},"example":"test-service"},"ValueTenantId":{"name":"tenantId","description":"ID of the tenant to act on. Only used for core (platform) users; tenant users always act on the tenant of their token and this parameter is ignored. Responds 400 if it is not a valid tenant URN.\n","in":"query","required":false,"schema":{"type":"string"},"example":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7"}}},"security":[{"accessToken":[]}],"tags":[{"name":"Value","description":"API to store and retrieve values."},{"name":"Value definition","description":"API to manage value definitions."}]}
|
|
@@ -135,7 +135,7 @@ The resources rolled up are the `resource` entries of the service metric rollup
|
|
|
135
135
|
|
|
136
136
|
The job runs alongside the metric interval rollups, under `METRIC_INTERVAL_ROLLUP_JOB_ENABLED`, `METRIC_INTERVAL_ROLLUP_MAX_CHUNK_HOURS` (bounded to between a day and a week) and `METRIC_INTERVAL_ROLLUP_STATEMENT_TIMEOUT_MS`, on ticks offset two minutes from theirs and under its own advisory lock. It moves each source's coverage forward over closed days — a day is rolled up an hour after it ends, so events timestamped just before midnight land in it — and backward through history, recorded in `event_resource_rollup_coverage`. Walking back starts from the newest event log chunk below coverage, read from chunk metadata, so a span of years with no data at all, such as between a stray old event and the rest of the log, is crossed in a single step.
|
|
137
137
|
|
|
138
|
-
`GET /value/v1/event-resources/distinct-count` reads the count for a `namespace`, `contextKey`, optional comma separated `names` (defaulting to every event rolled up for the namespace) and a period from `intervalMin` (inclusive) to `intervalMax` (exclusive),
|
|
138
|
+
`GET /value/v1/event-resources/distinct-count` reads the count for a `namespace`, `contextKey`, optional comma separated `names` (defaulting to every event rolled up for the namespace) and a period from `intervalMin` (inclusive) to `intervalMax` (exclusive), of any length. Whole days inside coverage come from the rollup; the current day, and any history the backfill has not reached yet, are read from the event log for that span alone, and the two are combined before counting. The read is bounded by `EVENT_RESOURCE_READ_STATEMENT_TIMEOUT_MS` (default 60000) rather than by the length of the period. Only the sources above and their own events are accepted, since the rollup has no rows for anything else and would undercount.
|
|
139
139
|
|
|
140
140
|
```sql
|
|
141
141
|
SELECT namespace, context_key, covered_from, covered_to, updated_at
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/adsp-sdk-mcp-server",
|
|
3
|
-
"version": "1.35.
|
|
3
|
+
"version": "1.35.2",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Government of Alberta - MCP server for ADSP documentation and Node SDK reference lookup.",
|
|
6
6
|
"repository": "https://github.com/GovAlta/adsp-monorepo",
|
package/provenance.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"kind": "release",
|
|
3
|
-
"builtAt": "2026-11-
|
|
4
|
-
"sourceCommit": "
|
|
5
|
-
"latestRelease": "1.35.
|
|
6
|
-
"docsCommit": "
|
|
3
|
+
"builtAt": "2026-11-17T19:55:21.424Z",
|
|
4
|
+
"sourceCommit": "a4f8cd4f675199b445c3cedb2dc41dc3d1473bbe",
|
|
5
|
+
"latestRelease": "1.35.1",
|
|
6
|
+
"docsCommit": "7d598d35f78054bdf81b2ebd03a4abf216c33fea",
|
|
7
7
|
"sdk": {
|
|
8
8
|
"version": "2.36.1",
|
|
9
9
|
"commit": "dd58a2b854c4406b42c0604dba3fa4b941038d6c",
|