@openvtc/trust-tasks 0.21.4 → 0.21.5

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.
Files changed (192) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/_shared/components.d.ts +210 -2
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/auth/_shared/0.1/passkey-invite.d.ts +16 -0
  5. package/dist/auth/_shared/0.1/passkey-invite.d.ts.map +1 -0
  6. package/dist/auth/_shared/0.1/passkey-invite.js +6 -0
  7. package/dist/auth/_shared/0.1/passkey-invite.js.map +1 -0
  8. package/dist/auth/passkey/enroll/invite/list/0.1/payload.d.ts +393 -0
  9. package/dist/auth/passkey/enroll/invite/list/0.1/payload.d.ts.map +1 -0
  10. package/dist/auth/passkey/enroll/invite/list/0.1/payload.js +234 -0
  11. package/dist/auth/passkey/enroll/invite/list/0.1/payload.js.map +1 -0
  12. package/dist/auth/passkey/enroll/invite/revoke/0.1/payload.d.ts +228 -0
  13. package/dist/auth/passkey/enroll/invite/revoke/0.1/payload.d.ts.map +1 -0
  14. package/dist/auth/passkey/enroll/invite/revoke/0.1/payload.js +138 -0
  15. package/dist/auth/passkey/enroll/invite/revoke/0.1/payload.js.map +1 -0
  16. package/dist/auth/passkey/enroll/invite/update/0.1/payload.d.ts +459 -0
  17. package/dist/auth/passkey/enroll/invite/update/0.1/payload.d.ts.map +1 -0
  18. package/dist/auth/passkey/enroll/invite/update/0.1/payload.js +286 -0
  19. package/dist/auth/passkey/enroll/invite/update/0.1/payload.js.map +1 -0
  20. package/dist/auth/step-up/start/0.1/payload.d.ts +420 -0
  21. package/dist/auth/step-up/start/0.1/payload.d.ts.map +1 -0
  22. package/dist/auth/step-up/start/0.1/payload.js +232 -0
  23. package/dist/auth/step-up/start/0.1/payload.js.map +1 -0
  24. package/dist/did-management/_shared/0.1/service-instance.d.ts +1 -1
  25. package/dist/did-management/_shared/0.1/service-instance.d.ts.map +1 -1
  26. package/dist/did-management/_shared/0.2/metrics-snapshot.d.ts +16 -0
  27. package/dist/did-management/_shared/0.2/metrics-snapshot.d.ts.map +1 -0
  28. package/dist/did-management/_shared/0.2/metrics-snapshot.js +6 -0
  29. package/dist/did-management/_shared/0.2/metrics-snapshot.js.map +1 -0
  30. package/dist/did-management/_shared/0.2/service-instance.d.ts +16 -0
  31. package/dist/did-management/_shared/0.2/service-instance.d.ts.map +1 -0
  32. package/dist/did-management/_shared/0.2/service-instance.js +6 -0
  33. package/dist/did-management/_shared/0.2/service-instance.js.map +1 -0
  34. package/dist/did-management/agent-name/resolve/0.1/payload.d.ts +318 -0
  35. package/dist/did-management/agent-name/resolve/0.1/payload.d.ts.map +1 -0
  36. package/dist/did-management/agent-name/resolve/0.1/payload.js +179 -0
  37. package/dist/did-management/agent-name/resolve/0.1/payload.js.map +1 -0
  38. package/dist/did-management/did/log/0.1/payload.d.ts +436 -0
  39. package/dist/did-management/did/log/0.1/payload.d.ts.map +1 -0
  40. package/dist/did-management/did/log/0.1/payload.js +228 -0
  41. package/dist/did-management/did/log/0.1/payload.js.map +1 -0
  42. package/dist/did-management/domain/list/0.1/payload.d.ts +423 -0
  43. package/dist/did-management/domain/list/0.1/payload.d.ts.map +1 -0
  44. package/dist/did-management/domain/list/0.1/payload.js +244 -0
  45. package/dist/did-management/domain/list/0.1/payload.js.map +1 -0
  46. package/dist/did-management/identity/list/0.1/payload.d.ts +494 -0
  47. package/dist/did-management/identity/list/0.1/payload.d.ts.map +1 -0
  48. package/dist/did-management/identity/list/0.1/payload.js +274 -0
  49. package/dist/did-management/identity/list/0.1/payload.js.map +1 -0
  50. package/dist/did-management/identity/retire/0.1/payload.d.ts +242 -0
  51. package/dist/did-management/identity/retire/0.1/payload.d.ts.map +1 -0
  52. package/dist/did-management/identity/retire/0.1/payload.js +142 -0
  53. package/dist/did-management/identity/retire/0.1/payload.js.map +1 -0
  54. package/dist/did-management/registry/admin-register/0.1/payload.d.ts +1 -1
  55. package/dist/did-management/registry/admin-register/0.1/payload.d.ts.map +1 -1
  56. package/dist/did-management/registry/check/0.1/payload.d.ts +639 -0
  57. package/dist/did-management/registry/check/0.1/payload.d.ts.map +1 -0
  58. package/dist/did-management/registry/check/0.1/payload.js +383 -0
  59. package/dist/did-management/registry/check/0.1/payload.js.map +1 -0
  60. package/dist/did-management/registry/get/0.1/payload.d.ts +632 -0
  61. package/dist/did-management/registry/get/0.1/payload.d.ts.map +1 -0
  62. package/dist/did-management/registry/get/0.1/payload.js +381 -0
  63. package/dist/did-management/registry/get/0.1/payload.js.map +1 -0
  64. package/dist/did-management/registry/list/0.1/payload.d.ts +661 -0
  65. package/dist/did-management/registry/list/0.1/payload.d.ts.map +1 -0
  66. package/dist/did-management/registry/list/0.1/payload.js +398 -0
  67. package/dist/did-management/registry/list/0.1/payload.js.map +1 -0
  68. package/dist/did-management/registry/purge-domain/0.1/payload.d.ts +269 -0
  69. package/dist/did-management/registry/purge-domain/0.1/payload.d.ts.map +1 -0
  70. package/dist/did-management/registry/purge-domain/0.1/payload.js +160 -0
  71. package/dist/did-management/registry/purge-domain/0.1/payload.js.map +1 -0
  72. package/dist/did-management/replica/domain/assign/0.1/payload.d.ts +233 -0
  73. package/dist/did-management/replica/domain/assign/0.1/payload.d.ts.map +1 -0
  74. package/dist/did-management/replica/domain/assign/0.1/payload.js +143 -0
  75. package/dist/did-management/replica/domain/assign/0.1/payload.js.map +1 -0
  76. package/dist/did-management/replica/domain/purge/0.1/payload.d.ts +257 -0
  77. package/dist/did-management/replica/domain/purge/0.1/payload.d.ts.map +1 -0
  78. package/dist/did-management/replica/domain/purge/0.1/payload.js +155 -0
  79. package/dist/did-management/replica/domain/purge/0.1/payload.js.map +1 -0
  80. package/dist/did-management/replica/domain/unassign/0.1/payload.d.ts +257 -0
  81. package/dist/did-management/replica/domain/unassign/0.1/payload.d.ts.map +1 -0
  82. package/dist/did-management/replica/domain/unassign/0.1/payload.js +155 -0
  83. package/dist/did-management/replica/domain/unassign/0.1/payload.js.map +1 -0
  84. package/dist/did-management/replica/domain/upsert/0.1/payload.d.ts +401 -0
  85. package/dist/did-management/replica/domain/upsert/0.1/payload.d.ts.map +1 -0
  86. package/dist/did-management/replica/domain/upsert/0.1/payload.js +241 -0
  87. package/dist/did-management/replica/domain/upsert/0.1/payload.js.map +1 -0
  88. package/dist/did-management/server/config/0.1/payload.d.ts +838 -0
  89. package/dist/did-management/server/config/0.1/payload.d.ts.map +1 -0
  90. package/dist/did-management/server/config/0.1/payload.js +444 -0
  91. package/dist/did-management/server/config/0.1/payload.js.map +1 -0
  92. package/dist/did-management/server/info/0.1/payload.d.ts +285 -0
  93. package/dist/did-management/server/info/0.1/payload.d.ts.map +1 -0
  94. package/dist/did-management/server/info/0.1/payload.js +160 -0
  95. package/dist/did-management/server/info/0.1/payload.js.map +1 -0
  96. package/dist/did-management/server/metrics/0.1/payload.d.ts +674 -0
  97. package/dist/did-management/server/metrics/0.1/payload.d.ts.map +1 -0
  98. package/dist/did-management/server/metrics/0.1/payload.js +387 -0
  99. package/dist/did-management/server/metrics/0.1/payload.js.map +1 -0
  100. package/dist/did-management/stats/get/0.1/payload.d.ts +349 -0
  101. package/dist/did-management/stats/get/0.1/payload.d.ts.map +1 -0
  102. package/dist/did-management/stats/get/0.1/payload.js +187 -0
  103. package/dist/did-management/stats/get/0.1/payload.js.map +1 -0
  104. package/dist/did-management/stats/timeseries/0.1/payload.d.ts +381 -0
  105. package/dist/did-management/stats/timeseries/0.1/payload.d.ts.map +1 -0
  106. package/dist/did-management/stats/timeseries/0.1/payload.js +227 -0
  107. package/dist/did-management/stats/timeseries/0.1/payload.js.map +1 -0
  108. package/dist/index.d.ts +34 -0
  109. package/dist/index.d.ts.map +1 -1
  110. package/dist/index.js +34 -0
  111. package/dist/index.js.map +1 -1
  112. package/dist/vtc/_shared/0.1/invite.d.ts +1 -1
  113. package/dist/vtc/_shared/0.1/invite.d.ts.map +1 -1
  114. package/dist/vtc/admin/invites/list/0.1/payload.d.ts +1 -1
  115. package/dist/vtc/admin/invites/list/0.1/payload.d.ts.map +1 -1
  116. package/dist/webvh/_shared/0.1/sync-update.d.ts +16 -0
  117. package/dist/webvh/_shared/0.1/sync-update.d.ts.map +1 -0
  118. package/dist/webvh/_shared/0.1/sync-update.js +6 -0
  119. package/dist/webvh/_shared/0.1/sync-update.js.map +1 -0
  120. package/dist/webvh/_shared/0.1/witness-key.d.ts +16 -0
  121. package/dist/webvh/_shared/0.1/witness-key.d.ts.map +1 -0
  122. package/dist/webvh/_shared/0.1/witness-key.js +6 -0
  123. package/dist/webvh/_shared/0.1/witness-key.js.map +1 -0
  124. package/dist/webvh/sync/batch/0.1/payload.d.ts +503 -0
  125. package/dist/webvh/sync/batch/0.1/payload.d.ts.map +1 -0
  126. package/dist/webvh/sync/batch/0.1/payload.js +290 -0
  127. package/dist/webvh/sync/batch/0.1/payload.js.map +1 -0
  128. package/dist/webvh/sync/delete/0.2/payload.d.ts +242 -0
  129. package/dist/webvh/sync/delete/0.2/payload.d.ts.map +1 -0
  130. package/dist/webvh/sync/delete/0.2/payload.js +148 -0
  131. package/dist/webvh/sync/delete/0.2/payload.js.map +1 -0
  132. package/dist/webvh/sync/update/0.2/payload.d.ts +315 -0
  133. package/dist/webvh/sync/update/0.2/payload.d.ts.map +1 -0
  134. package/dist/webvh/sync/update/0.2/payload.js +177 -0
  135. package/dist/webvh/sync/update/0.2/payload.js.map +1 -0
  136. package/dist/webvh/witness/key/create/0.1/payload.d.ts +346 -0
  137. package/dist/webvh/witness/key/create/0.1/payload.d.ts.map +1 -0
  138. package/dist/webvh/witness/key/create/0.1/payload.js +202 -0
  139. package/dist/webvh/witness/key/create/0.1/payload.js.map +1 -0
  140. package/dist/webvh/witness/key/delete/0.1/payload.d.ts +237 -0
  141. package/dist/webvh/witness/key/delete/0.1/payload.d.ts.map +1 -0
  142. package/dist/webvh/witness/key/delete/0.1/payload.js +141 -0
  143. package/dist/webvh/witness/key/delete/0.1/payload.js.map +1 -0
  144. package/dist/webvh/witness/key/list/0.1/payload.d.ts +349 -0
  145. package/dist/webvh/witness/key/list/0.1/payload.d.ts.map +1 -0
  146. package/dist/webvh/witness/key/list/0.1/payload.js +204 -0
  147. package/dist/webvh/witness/key/list/0.1/payload.js.map +1 -0
  148. package/dist/webvh/witness/sign/0.1/payload.d.ts +401 -0
  149. package/dist/webvh/witness/sign/0.1/payload.d.ts.map +1 -0
  150. package/dist/webvh/witness/sign/0.1/payload.js +229 -0
  151. package/dist/webvh/witness/sign/0.1/payload.js.map +1 -0
  152. package/package.json +1 -1
  153. package/src/_shared/components.ts +210 -2
  154. package/src/auth/_shared/0.1/passkey-invite.ts +17 -0
  155. package/src/auth/passkey/enroll/invite/list/0.1/payload.ts +266 -0
  156. package/src/auth/passkey/enroll/invite/revoke/0.1/payload.ts +165 -0
  157. package/src/auth/passkey/enroll/invite/update/0.1/payload.ts +327 -0
  158. package/src/auth/step-up/start/0.1/payload.ts +287 -0
  159. package/src/did-management/_shared/0.1/service-instance.ts +1 -1
  160. package/src/did-management/_shared/0.2/metrics-snapshot.ts +17 -0
  161. package/src/did-management/_shared/0.2/service-instance.ts +17 -0
  162. package/src/did-management/agent-name/resolve/0.1/payload.ts +222 -0
  163. package/src/did-management/did/log/0.1/payload.ts +295 -0
  164. package/src/did-management/domain/list/0.1/payload.ts +280 -0
  165. package/src/did-management/identity/list/0.1/payload.ts +335 -0
  166. package/src/did-management/identity/retire/0.1/payload.ts +175 -0
  167. package/src/did-management/registry/admin-register/0.1/payload.ts +1 -1
  168. package/src/did-management/registry/check/0.1/payload.ts +415 -0
  169. package/src/did-management/registry/get/0.1/payload.ts +410 -0
  170. package/src/did-management/registry/list/0.1/payload.ts +434 -0
  171. package/src/did-management/registry/purge-domain/0.1/payload.ts +198 -0
  172. package/src/did-management/replica/domain/assign/0.1/payload.ts +173 -0
  173. package/src/did-management/replica/domain/purge/0.1/payload.ts +189 -0
  174. package/src/did-management/replica/domain/unassign/0.1/payload.ts +189 -0
  175. package/src/did-management/replica/domain/upsert/0.1/payload.ts +271 -0
  176. package/src/did-management/server/config/0.1/payload.ts +545 -0
  177. package/src/did-management/server/info/0.1/payload.ts +200 -0
  178. package/src/did-management/server/metrics/0.1/payload.ts +418 -0
  179. package/src/did-management/stats/get/0.1/payload.ts +237 -0
  180. package/src/did-management/stats/timeseries/0.1/payload.ts +279 -0
  181. package/src/index.ts +34 -0
  182. package/src/vtc/_shared/0.1/invite.ts +1 -1
  183. package/src/vtc/admin/invites/list/0.1/payload.ts +1 -1
  184. package/src/webvh/_shared/0.1/sync-update.ts +17 -0
  185. package/src/webvh/_shared/0.1/witness-key.ts +17 -0
  186. package/src/webvh/sync/batch/0.1/payload.ts +336 -0
  187. package/src/webvh/sync/delete/0.2/payload.ts +181 -0
  188. package/src/webvh/sync/update/0.2/payload.ts +233 -0
  189. package/src/webvh/witness/key/create/0.1/payload.ts +231 -0
  190. package/src/webvh/witness/key/delete/0.1/payload.ts +171 -0
  191. package/src/webvh/witness/key/list/0.1/payload.ts +232 -0
  192. package/src/webvh/witness/sign/0.1/payload.ts +279 -0
@@ -0,0 +1,200 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/did-management/server/info/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { Ext } from "../../../../_shared/components.js";
7
+
8
+
9
+ export interface ServerInfoPayload {
10
+ ext?: Ext;
11
+ }
12
+ export interface ServerInfoResponsePayload {
13
+ /**
14
+ * The service's own DID: the recipient a client addresses every other Trust Task to, and the issuer of this response.
15
+ */
16
+ serviceDid: string;
17
+ /**
18
+ * Whether the service serves agent-name redirects. A client cannot detect it otherwise: with the feature off a name answers exactly as an unknown one.
19
+ */
20
+ agentNames: boolean;
21
+ /**
22
+ * The agent names the service's own DID serves, as local parts. The community name of a service that owns its domain is the empty string. Empty when it serves none.
23
+ */
24
+ serviceNames: string[];
25
+ /**
26
+ * How long a disabled domain keeps serving before its content becomes eligible for purge. Absent when the service cannot state it.
27
+ */
28
+ domainPurgeGraceSeconds?: number;
29
+ ext?: Ext;
30
+ }
31
+
32
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
33
+ export type { Ext };
34
+
35
+ /** Trust Task type URI. */
36
+ export const TYPE_URI = "https://trusttasks.org/spec/did-management/server/info/0.1" as const;
37
+
38
+ /** Stable alias for this specification's request payload shape. */
39
+ export type Payload = ServerInfoPayload;
40
+
41
+ /** Trust Task response type URI (request type URI + "#response"). */
42
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/did-management/server/info/0.1#response" as const;
43
+
44
+ /** Stable alias for this specification's success-response payload shape. */
45
+ export type Response = ServerInfoResponsePayload;
46
+
47
+ /**
48
+ * This specification's payload schema, as a value.
49
+ *
50
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
51
+ * rather than only as a `.json` file because TypeScript types are erased
52
+ * at runtime: without a schema a consumer has nothing to validate, and
53
+ * every REQUIRED payload member is optional in practice. Cross-file
54
+ * `$ref`s are already inlined, so it needs no resolver.
55
+ */
56
+ export const PAYLOAD_SCHEMA = {
57
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
58
+ "$id": "https://trusttasks.org/spec/did-management/server/info/0.1",
59
+ "title": "Server Info — payload",
60
+ "type": "object",
61
+ "additionalProperties": false,
62
+ "properties": {
63
+ "ext": {
64
+ "$ref": "#/$defs/Ext"
65
+ }
66
+ },
67
+ "$defs": {
68
+ "Response": {
69
+ "$anchor": "response",
70
+ "title": "Server Info — response payload",
71
+ "type": "object",
72
+ "additionalProperties": false,
73
+ "required": [
74
+ "serviceDid",
75
+ "agentNames",
76
+ "serviceNames"
77
+ ],
78
+ "properties": {
79
+ "serviceDid": {
80
+ "type": "string",
81
+ "minLength": 1,
82
+ "description": "The service's own DID: the recipient a client addresses every other Trust Task to, and the issuer of this response."
83
+ },
84
+ "agentNames": {
85
+ "type": "boolean",
86
+ "description": "Whether the service serves agent-name redirects. A client cannot detect it otherwise: with the feature off a name answers exactly as an unknown one."
87
+ },
88
+ "serviceNames": {
89
+ "type": "array",
90
+ "items": {
91
+ "type": "string"
92
+ },
93
+ "description": "The agent names the service's own DID serves, as local parts. The community name of a service that owns its domain is the empty string. Empty when it serves none."
94
+ },
95
+ "domainPurgeGraceSeconds": {
96
+ "type": "integer",
97
+ "minimum": 0,
98
+ "description": "How long a disabled domain keeps serving before its content becomes eligible for purge. Absent when the service cannot state it."
99
+ },
100
+ "ext": {
101
+ "$ref": "#/$defs/Ext"
102
+ }
103
+ }
104
+ },
105
+ "Ext": {
106
+ "title": "Ext",
107
+ "description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
108
+ "type": "object",
109
+ "minProperties": 1,
110
+ "additionalProperties": true,
111
+ "propertyNames": {
112
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
113
+ }
114
+ }
115
+ }
116
+ } as const;
117
+
118
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
119
+ export const RESPONSE_PAYLOAD_SCHEMA = {
120
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
121
+ "$ref": "#/$defs/Response",
122
+ "$defs": {
123
+ "Response": {
124
+ "$anchor": "response",
125
+ "title": "Server Info — response payload",
126
+ "type": "object",
127
+ "additionalProperties": false,
128
+ "required": [
129
+ "serviceDid",
130
+ "agentNames",
131
+ "serviceNames"
132
+ ],
133
+ "properties": {
134
+ "serviceDid": {
135
+ "type": "string",
136
+ "minLength": 1,
137
+ "description": "The service's own DID: the recipient a client addresses every other Trust Task to, and the issuer of this response."
138
+ },
139
+ "agentNames": {
140
+ "type": "boolean",
141
+ "description": "Whether the service serves agent-name redirects. A client cannot detect it otherwise: with the feature off a name answers exactly as an unknown one."
142
+ },
143
+ "serviceNames": {
144
+ "type": "array",
145
+ "items": {
146
+ "type": "string"
147
+ },
148
+ "description": "The agent names the service's own DID serves, as local parts. The community name of a service that owns its domain is the empty string. Empty when it serves none."
149
+ },
150
+ "domainPurgeGraceSeconds": {
151
+ "type": "integer",
152
+ "minimum": 0,
153
+ "description": "How long a disabled domain keeps serving before its content becomes eligible for purge. Absent when the service cannot state it."
154
+ },
155
+ "ext": {
156
+ "$ref": "#/$defs/Ext"
157
+ }
158
+ }
159
+ },
160
+ "Ext": {
161
+ "title": "Ext",
162
+ "description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
163
+ "type": "object",
164
+ "minProperties": 1,
165
+ "additionalProperties": true,
166
+ "propertyNames": {
167
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
168
+ }
169
+ }
170
+ }
171
+ } as const;
172
+
173
+ /**
174
+ * SPEC.md §7.2 policy for the request variant, from this specification's
175
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
176
+ * per-specification and cannot be derived from the document alone, and
177
+ * item 2 needs the schema this carries.
178
+ */
179
+ export const SPEC = {
180
+ typeUri: TYPE_URI,
181
+ isBearer: true,
182
+ isProofRequired: false,
183
+ isRecipientRequired: false,
184
+ isIssuedAtRequired: false,
185
+ payloadSchema: PAYLOAD_SCHEMA,
186
+ } as const;
187
+
188
+ /**
189
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
190
+ * tracks the *issuer* party's requirement because a response swaps the
191
+ * parties (§7.3 item 5).
192
+ */
193
+ export const RESPONSE_SPEC = {
194
+ typeUri: RESPONSE_TYPE_URI,
195
+ isBearer: true,
196
+ isProofRequired: true,
197
+ isRecipientRequired: false,
198
+ isIssuedAtRequired: false,
199
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
200
+ } as const;
@@ -0,0 +1,418 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/did-management/server/metrics/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { Ext, Histogram, HistogramBucket, Metric, MetricsSnapshot } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * The read takes no selector — the whole snapshot is returned. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.
11
+ */
12
+ export interface DIDManagementServerMetricsPayload {
13
+ ext?: Ext;
14
+ }
15
+ /**
16
+ * The service's current metrics snapshot. Carried in a Trust Task document whose type is https://trusttasks.org/spec/did-management/server/metrics/0.1#response.
17
+ */
18
+ export interface DIDManagementServerMetricsResponsePayload {
19
+ snapshot: MetricsSnapshot;
20
+ ext?: Ext;
21
+ }
22
+
23
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
24
+ export type { Ext, Histogram, HistogramBucket, Metric, MetricsSnapshot };
25
+
26
+ /** Trust Task type URI. */
27
+ export const TYPE_URI = "https://trusttasks.org/spec/did-management/server/metrics/0.1" as const;
28
+
29
+ /** Stable alias for this specification's request payload shape. */
30
+ export type Payload = DIDManagementServerMetricsPayload;
31
+
32
+ /** Trust Task response type URI (request type URI + "#response"). */
33
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/did-management/server/metrics/0.1#response" as const;
34
+
35
+ /** Stable alias for this specification's success-response payload shape. */
36
+ export type Response = DIDManagementServerMetricsResponsePayload;
37
+
38
+ /**
39
+ * This specification's payload schema, as a value.
40
+ *
41
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
42
+ * rather than only as a `.json` file because TypeScript types are erased
43
+ * at runtime: without a schema a consumer has nothing to validate, and
44
+ * every REQUIRED payload member is optional in practice. Cross-file
45
+ * `$ref`s are already inlined, so it needs no resolver.
46
+ */
47
+ export const PAYLOAD_SCHEMA = {
48
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
49
+ "$id": "https://trusttasks.org/spec/did-management/server/metrics/0.1",
50
+ "title": "DID Management — Server Metrics — payload",
51
+ "description": "The read takes no selector — the whole snapshot is returned. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.",
52
+ "type": "object",
53
+ "additionalProperties": false,
54
+ "properties": {
55
+ "ext": {
56
+ "$ref": "#/$defs/Ext"
57
+ }
58
+ },
59
+ "$defs": {
60
+ "Response": {
61
+ "$anchor": "response",
62
+ "title": "DID Management — Server Metrics — response payload",
63
+ "description": "The service's current metrics snapshot. Carried in a Trust Task document whose type is https://trusttasks.org/spec/did-management/server/metrics/0.1#response.",
64
+ "type": "object",
65
+ "additionalProperties": false,
66
+ "required": [
67
+ "snapshot"
68
+ ],
69
+ "properties": {
70
+ "snapshot": {
71
+ "$ref": "#/$defs/MetricsSnapshot"
72
+ },
73
+ "ext": {
74
+ "$ref": "#/$defs/Ext"
75
+ }
76
+ }
77
+ },
78
+ "Ext": {
79
+ "title": "Ext",
80
+ "description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
81
+ "type": "object",
82
+ "minProperties": 1,
83
+ "additionalProperties": true,
84
+ "propertyNames": {
85
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
86
+ }
87
+ },
88
+ "MetricsSnapshot": {
89
+ "title": "MetricsSnapshot",
90
+ "type": "object",
91
+ "additionalProperties": false,
92
+ "required": [
93
+ "takenAt",
94
+ "counters",
95
+ "gauges",
96
+ "histograms"
97
+ ],
98
+ "properties": {
99
+ "takenAt": {
100
+ "type": "string",
101
+ "format": "date-time",
102
+ "description": "When the service read these values from its own instrumentation. Not the same as the envelope's issuedAt when a snapshot is cached briefly before answering."
103
+ },
104
+ "counters": {
105
+ "type": "array",
106
+ "items": {
107
+ "$ref": "#/$defs/Metric"
108
+ },
109
+ "description": "Monotonically increasing totals (e.g. requests served, errors raised). Empty when the service exposes none. Always present, so a collector can tell \"no counters\" from \"the field was dropped\"."
110
+ },
111
+ "gauges": {
112
+ "type": "array",
113
+ "items": {
114
+ "$ref": "#/$defs/Metric"
115
+ },
116
+ "description": "Point-in-time values that can rise or fall (e.g. open connections, queue depth). Empty when the service exposes none. Always present, for the same reason as counters."
117
+ },
118
+ "histograms": {
119
+ "type": "array",
120
+ "items": {
121
+ "$ref": "#/$defs/Histogram"
122
+ },
123
+ "description": "Distributions of observed values (e.g. request latency). Empty when the service exposes none. Always present, for the same reason as counters."
124
+ },
125
+ "ext": {
126
+ "$ref": "#/$defs/Ext"
127
+ }
128
+ }
129
+ },
130
+ "Histogram": {
131
+ "title": "Histogram",
132
+ "description": "One histogram's distribution, in the Prometheus cumulative-bucket convention: each bucket's `count` includes every observation at or below its `le`.",
133
+ "type": "object",
134
+ "additionalProperties": false,
135
+ "required": [
136
+ "name",
137
+ "count",
138
+ "sum",
139
+ "buckets"
140
+ ],
141
+ "properties": {
142
+ "name": {
143
+ "type": "string",
144
+ "minLength": 1,
145
+ "description": "The histogram's stable name (e.g. `did_hosting_resolve_seconds`)."
146
+ },
147
+ "labels": {
148
+ "type": "object",
149
+ "additionalProperties": {
150
+ "type": "string"
151
+ },
152
+ "description": "Dimensions the distribution is broken down by. Absent or empty when the histogram carries none."
153
+ },
154
+ "count": {
155
+ "type": "integer",
156
+ "minimum": 0,
157
+ "description": "Total number of observations."
158
+ },
159
+ "sum": {
160
+ "type": "number",
161
+ "description": "Sum of all observed values."
162
+ },
163
+ "buckets": {
164
+ "type": "array",
165
+ "items": {
166
+ "$ref": "#/$defs/HistogramBucket"
167
+ },
168
+ "description": "Cumulative buckets, ordered by ascending `le`. Empty when the service exposes no bucket breakdown for this histogram — count and sum still apply. Always present, for the same reason as the snapshot's own arrays."
169
+ }
170
+ }
171
+ },
172
+ "HistogramBucket": {
173
+ "title": "HistogramBucket",
174
+ "type": "object",
175
+ "additionalProperties": false,
176
+ "required": [
177
+ "le",
178
+ "count"
179
+ ],
180
+ "properties": {
181
+ "le": {
182
+ "type": "number",
183
+ "description": "Upper bound of this bucket, inclusive. The final bucket conventionally reports the same value as the histogram's own `count` at whatever `le` the service treats as its ceiling."
184
+ },
185
+ "count": {
186
+ "type": "integer",
187
+ "minimum": 0,
188
+ "description": "Number of observations at or below `le`."
189
+ }
190
+ }
191
+ },
192
+ "Metric": {
193
+ "title": "Metric",
194
+ "description": "One counter or gauge reading.",
195
+ "type": "object",
196
+ "additionalProperties": false,
197
+ "required": [
198
+ "name",
199
+ "value"
200
+ ],
201
+ "properties": {
202
+ "name": {
203
+ "type": "string",
204
+ "minLength": 1,
205
+ "description": "The metric's stable name (e.g. `did_hosting_requests_total`). Implementation-defined; the framework imposes no vocabulary."
206
+ },
207
+ "value": {
208
+ "type": "number",
209
+ "description": "The current reading."
210
+ },
211
+ "labels": {
212
+ "type": "object",
213
+ "additionalProperties": {
214
+ "type": "string"
215
+ },
216
+ "description": "Dimensions the value is broken down by (e.g. `{\"method\": \"resolve\"}`). Absent or empty when the metric carries none."
217
+ }
218
+ }
219
+ }
220
+ }
221
+ } as const;
222
+
223
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
224
+ export const RESPONSE_PAYLOAD_SCHEMA = {
225
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
226
+ "$ref": "#/$defs/Response",
227
+ "$defs": {
228
+ "Response": {
229
+ "$anchor": "response",
230
+ "title": "DID Management — Server Metrics — response payload",
231
+ "description": "The service's current metrics snapshot. Carried in a Trust Task document whose type is https://trusttasks.org/spec/did-management/server/metrics/0.1#response.",
232
+ "type": "object",
233
+ "additionalProperties": false,
234
+ "required": [
235
+ "snapshot"
236
+ ],
237
+ "properties": {
238
+ "snapshot": {
239
+ "$ref": "#/$defs/MetricsSnapshot"
240
+ },
241
+ "ext": {
242
+ "$ref": "#/$defs/Ext"
243
+ }
244
+ }
245
+ },
246
+ "Ext": {
247
+ "title": "Ext",
248
+ "description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
249
+ "type": "object",
250
+ "minProperties": 1,
251
+ "additionalProperties": true,
252
+ "propertyNames": {
253
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
254
+ }
255
+ },
256
+ "MetricsSnapshot": {
257
+ "title": "MetricsSnapshot",
258
+ "type": "object",
259
+ "additionalProperties": false,
260
+ "required": [
261
+ "takenAt",
262
+ "counters",
263
+ "gauges",
264
+ "histograms"
265
+ ],
266
+ "properties": {
267
+ "takenAt": {
268
+ "type": "string",
269
+ "format": "date-time",
270
+ "description": "When the service read these values from its own instrumentation. Not the same as the envelope's issuedAt when a snapshot is cached briefly before answering."
271
+ },
272
+ "counters": {
273
+ "type": "array",
274
+ "items": {
275
+ "$ref": "#/$defs/Metric"
276
+ },
277
+ "description": "Monotonically increasing totals (e.g. requests served, errors raised). Empty when the service exposes none. Always present, so a collector can tell \"no counters\" from \"the field was dropped\"."
278
+ },
279
+ "gauges": {
280
+ "type": "array",
281
+ "items": {
282
+ "$ref": "#/$defs/Metric"
283
+ },
284
+ "description": "Point-in-time values that can rise or fall (e.g. open connections, queue depth). Empty when the service exposes none. Always present, for the same reason as counters."
285
+ },
286
+ "histograms": {
287
+ "type": "array",
288
+ "items": {
289
+ "$ref": "#/$defs/Histogram"
290
+ },
291
+ "description": "Distributions of observed values (e.g. request latency). Empty when the service exposes none. Always present, for the same reason as counters."
292
+ },
293
+ "ext": {
294
+ "$ref": "#/$defs/Ext"
295
+ }
296
+ }
297
+ },
298
+ "Histogram": {
299
+ "title": "Histogram",
300
+ "description": "One histogram's distribution, in the Prometheus cumulative-bucket convention: each bucket's `count` includes every observation at or below its `le`.",
301
+ "type": "object",
302
+ "additionalProperties": false,
303
+ "required": [
304
+ "name",
305
+ "count",
306
+ "sum",
307
+ "buckets"
308
+ ],
309
+ "properties": {
310
+ "name": {
311
+ "type": "string",
312
+ "minLength": 1,
313
+ "description": "The histogram's stable name (e.g. `did_hosting_resolve_seconds`)."
314
+ },
315
+ "labels": {
316
+ "type": "object",
317
+ "additionalProperties": {
318
+ "type": "string"
319
+ },
320
+ "description": "Dimensions the distribution is broken down by. Absent or empty when the histogram carries none."
321
+ },
322
+ "count": {
323
+ "type": "integer",
324
+ "minimum": 0,
325
+ "description": "Total number of observations."
326
+ },
327
+ "sum": {
328
+ "type": "number",
329
+ "description": "Sum of all observed values."
330
+ },
331
+ "buckets": {
332
+ "type": "array",
333
+ "items": {
334
+ "$ref": "#/$defs/HistogramBucket"
335
+ },
336
+ "description": "Cumulative buckets, ordered by ascending `le`. Empty when the service exposes no bucket breakdown for this histogram — count and sum still apply. Always present, for the same reason as the snapshot's own arrays."
337
+ }
338
+ }
339
+ },
340
+ "HistogramBucket": {
341
+ "title": "HistogramBucket",
342
+ "type": "object",
343
+ "additionalProperties": false,
344
+ "required": [
345
+ "le",
346
+ "count"
347
+ ],
348
+ "properties": {
349
+ "le": {
350
+ "type": "number",
351
+ "description": "Upper bound of this bucket, inclusive. The final bucket conventionally reports the same value as the histogram's own `count` at whatever `le` the service treats as its ceiling."
352
+ },
353
+ "count": {
354
+ "type": "integer",
355
+ "minimum": 0,
356
+ "description": "Number of observations at or below `le`."
357
+ }
358
+ }
359
+ },
360
+ "Metric": {
361
+ "title": "Metric",
362
+ "description": "One counter or gauge reading.",
363
+ "type": "object",
364
+ "additionalProperties": false,
365
+ "required": [
366
+ "name",
367
+ "value"
368
+ ],
369
+ "properties": {
370
+ "name": {
371
+ "type": "string",
372
+ "minLength": 1,
373
+ "description": "The metric's stable name (e.g. `did_hosting_requests_total`). Implementation-defined; the framework imposes no vocabulary."
374
+ },
375
+ "value": {
376
+ "type": "number",
377
+ "description": "The current reading."
378
+ },
379
+ "labels": {
380
+ "type": "object",
381
+ "additionalProperties": {
382
+ "type": "string"
383
+ },
384
+ "description": "Dimensions the value is broken down by (e.g. `{\"method\": \"resolve\"}`). Absent or empty when the metric carries none."
385
+ }
386
+ }
387
+ }
388
+ }
389
+ } as const;
390
+
391
+ /**
392
+ * SPEC.md §7.2 policy for the request variant, from this specification's
393
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
394
+ * per-specification and cannot be derived from the document alone, and
395
+ * item 2 needs the schema this carries.
396
+ */
397
+ export const SPEC = {
398
+ typeUri: TYPE_URI,
399
+ isBearer: false,
400
+ isProofRequired: true,
401
+ isRecipientRequired: true,
402
+ isIssuedAtRequired: false,
403
+ payloadSchema: PAYLOAD_SCHEMA,
404
+ } as const;
405
+
406
+ /**
407
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
408
+ * tracks the *issuer* party's requirement because a response swaps the
409
+ * parties (§7.3 item 5).
410
+ */
411
+ export const RESPONSE_SPEC = {
412
+ typeUri: RESPONSE_TYPE_URI,
413
+ isBearer: false,
414
+ isProofRequired: true,
415
+ isRecipientRequired: true,
416
+ isIssuedAtRequired: false,
417
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
418
+ } as const;