@openvtc/trust-tasks 0.19.15 → 0.19.17

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 (65) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/_shared/components.d.ts +314 -0
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/index.d.ts +11 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +11 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/messaging/_shared/0.1/mediator-ops.d.ts +16 -0
  9. package/dist/messaging/_shared/0.1/mediator-ops.d.ts.map +1 -0
  10. package/dist/messaging/_shared/0.1/mediator-ops.js +6 -0
  11. package/dist/messaging/_shared/0.1/mediator-ops.js.map +1 -0
  12. package/dist/messaging/message/delete/0.1/payload.d.ts +370 -0
  13. package/dist/messaging/message/delete/0.1/payload.d.ts.map +1 -0
  14. package/dist/messaging/message/delete/0.1/payload.js +206 -0
  15. package/dist/messaging/message/delete/0.1/payload.js.map +1 -0
  16. package/dist/messaging/message/get/0.1/payload.d.ts +568 -0
  17. package/dist/messaging/message/get/0.1/payload.d.ts.map +1 -0
  18. package/dist/messaging/message/get/0.1/payload.js +332 -0
  19. package/dist/messaging/message/get/0.1/payload.js.map +1 -0
  20. package/dist/messaging/message/list/0.1/payload.d.ts +627 -0
  21. package/dist/messaging/message/list/0.1/payload.d.ts.map +1 -0
  22. package/dist/messaging/message/list/0.1/payload.js +352 -0
  23. package/dist/messaging/message/list/0.1/payload.js.map +1 -0
  24. package/dist/messaging/monitor/event/0.1/payload.d.ts +385 -0
  25. package/dist/messaging/monitor/event/0.1/payload.d.ts.map +1 -0
  26. package/dist/messaging/monitor/event/0.1/payload.js +230 -0
  27. package/dist/messaging/monitor/event/0.1/payload.js.map +1 -0
  28. package/dist/messaging/monitor/subscribe/0.1/payload.d.ts +719 -0
  29. package/dist/messaging/monitor/subscribe/0.1/payload.d.ts.map +1 -0
  30. package/dist/messaging/monitor/subscribe/0.1/payload.js +417 -0
  31. package/dist/messaging/monitor/subscribe/0.1/payload.js.map +1 -0
  32. package/dist/messaging/monitor/unsubscribe/0.1/payload.d.ts +245 -0
  33. package/dist/messaging/monitor/unsubscribe/0.1/payload.d.ts.map +1 -0
  34. package/dist/messaging/monitor/unsubscribe/0.1/payload.js +136 -0
  35. package/dist/messaging/monitor/unsubscribe/0.1/payload.js.map +1 -0
  36. package/dist/messaging/queue/list/0.1/payload.d.ts +679 -0
  37. package/dist/messaging/queue/list/0.1/payload.d.ts.map +1 -0
  38. package/dist/messaging/queue/list/0.1/payload.js +377 -0
  39. package/dist/messaging/queue/list/0.1/payload.js.map +1 -0
  40. package/dist/messaging/queue/purge/0.1/payload.d.ts +389 -0
  41. package/dist/messaging/queue/purge/0.1/payload.d.ts.map +1 -0
  42. package/dist/messaging/queue/purge/0.1/payload.js +210 -0
  43. package/dist/messaging/queue/purge/0.1/payload.js.map +1 -0
  44. package/dist/messaging/queue/status/0.1/payload.d.ts +697 -0
  45. package/dist/messaging/queue/status/0.1/payload.d.ts.map +1 -0
  46. package/dist/messaging/queue/status/0.1/payload.js +389 -0
  47. package/dist/messaging/queue/status/0.1/payload.js.map +1 -0
  48. package/dist/messaging/stats/show/0.1/payload.d.ts +963 -0
  49. package/dist/messaging/stats/show/0.1/payload.d.ts.map +1 -0
  50. package/dist/messaging/stats/show/0.1/payload.js +515 -0
  51. package/dist/messaging/stats/show/0.1/payload.js.map +1 -0
  52. package/package.json +1 -1
  53. package/src/_shared/components.ts +342 -0
  54. package/src/index.ts +11 -0
  55. package/src/messaging/_shared/0.1/mediator-ops.ts +17 -0
  56. package/src/messaging/message/delete/0.1/payload.ts +259 -0
  57. package/src/messaging/message/get/0.1/payload.ts +375 -0
  58. package/src/messaging/message/list/0.1/payload.ts +410 -0
  59. package/src/messaging/monitor/event/0.1/payload.ts +267 -0
  60. package/src/messaging/monitor/subscribe/0.1/payload.ts +473 -0
  61. package/src/messaging/monitor/unsubscribe/0.1/payload.ts +172 -0
  62. package/src/messaging/queue/list/0.1/payload.ts +443 -0
  63. package/src/messaging/queue/purge/0.1/payload.ts +270 -0
  64. package/src/messaging/queue/status/0.1/payload.ts +439 -0
  65. package/src/messaging/stats/show/0.1/payload.ts +611 -0
@@ -0,0 +1,443 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/messaging/queue/list/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { AccountType, Ext, Queue, QueueDepth, QueueSummary, Vid } from "../../../../_shared/components.js";
7
+
8
+
9
+ export interface MessagingListQueuesPayload {
10
+ /**
11
+ * Which queue to rank by. Default `receive`.
12
+ */
13
+ queue?: Queue;
14
+ /**
15
+ * Ranking key, descending. Default `count`.
16
+ */
17
+ sort?: "count" | "bytes" | "oldest" | "saturation";
18
+ /**
19
+ * Omit accounts whose ranked queue holds fewer messages than this. Default 1 (skip empty queues).
20
+ */
21
+ minCount?: number;
22
+ /**
23
+ * Opaque continuation token from a prior page's nextCursor. Echoed verbatim; treated as unstructured by the requester.
24
+ */
25
+ cursor?: string;
26
+ /**
27
+ * Maximum accounts per page. The mediator chooses a default when omitted.
28
+ */
29
+ limit?: number;
30
+ /**
31
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
32
+ */
33
+ ext?: Ext;
34
+ }
35
+ /**
36
+ * The success response to a messaging/queue/list request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/messaging/queue/list/0.1#response.
37
+ */
38
+ export interface MessagingListQueuesResponsePayload {
39
+ queues: QueueSummary[];
40
+ /**
41
+ * When the ranking was computed. A mediator MAY serve the ranking from a periodic survey rather than a live scan.
42
+ */
43
+ snapshotAt: string;
44
+ /**
45
+ * The ranking did not cover every account.
46
+ */
47
+ truncated?: boolean;
48
+ /**
49
+ * Opaque continuation token. Present only when further items remain beyond this page; omitted on the final page.
50
+ */
51
+ nextCursor?: string;
52
+ /**
53
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
54
+ */
55
+ ext?: Ext;
56
+ }
57
+
58
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
59
+ export type { AccountType, Ext, Queue, QueueDepth, QueueSummary, Vid };
60
+
61
+ /** Trust Task type URI. */
62
+ export const TYPE_URI = "https://trusttasks.org/spec/messaging/queue/list/0.1" as const;
63
+
64
+ /** Stable alias for this specification's request payload shape. */
65
+ export type Payload = MessagingListQueuesPayload;
66
+
67
+ /** Trust Task response type URI (request type URI + "#response"). */
68
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/messaging/queue/list/0.1#response" as const;
69
+
70
+ /** Stable alias for this specification's success-response payload shape. */
71
+ export type Response = MessagingListQueuesResponsePayload;
72
+
73
+ /**
74
+ * This specification's payload schema, as a value.
75
+ *
76
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
77
+ * rather than only as a `.json` file because TypeScript types are erased
78
+ * at runtime: without a schema a consumer has nothing to validate, and
79
+ * every REQUIRED payload member is optional in practice. Cross-file
80
+ * `$ref`s are already inlined, so it needs no resolver.
81
+ */
82
+ export const PAYLOAD_SCHEMA = {
83
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
84
+ "$id": "https://trusttasks.org/spec/messaging/queue/list/0.1",
85
+ "title": "Messaging — List Queues — payload",
86
+ "type": "object",
87
+ "additionalProperties": false,
88
+ "properties": {
89
+ "queue": {
90
+ "$ref": "#/$defs/Queue",
91
+ "description": "Which queue to rank by. Default `receive`."
92
+ },
93
+ "sort": {
94
+ "type": "string",
95
+ "enum": [
96
+ "count",
97
+ "bytes",
98
+ "oldest",
99
+ "saturation"
100
+ ],
101
+ "description": "Ranking key, descending. Default `count`."
102
+ },
103
+ "minCount": {
104
+ "type": "integer",
105
+ "minimum": 0,
106
+ "description": "Omit accounts whose ranked queue holds fewer messages than this. Default 1 (skip empty queues)."
107
+ },
108
+ "cursor": {
109
+ "type": "string",
110
+ "minLength": 1,
111
+ "description": "Opaque continuation token from a prior page's nextCursor. Echoed verbatim; treated as unstructured by the requester."
112
+ },
113
+ "limit": {
114
+ "type": "integer",
115
+ "minimum": 1,
116
+ "maximum": 500,
117
+ "description": "Maximum accounts per page. The mediator chooses a default when omitted."
118
+ },
119
+ "ext": {
120
+ "$ref": "#/$defs/Ext",
121
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
122
+ }
123
+ },
124
+ "$defs": {
125
+ "Response": {
126
+ "$anchor": "response",
127
+ "title": "Messaging — List Queues — response payload",
128
+ "description": "The success response to a messaging/queue/list request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/messaging/queue/list/0.1#response.",
129
+ "type": "object",
130
+ "additionalProperties": false,
131
+ "properties": {
132
+ "queues": {
133
+ "type": "array",
134
+ "items": {
135
+ "$ref": "#/$defs/QueueSummary"
136
+ }
137
+ },
138
+ "snapshotAt": {
139
+ "type": "string",
140
+ "format": "date-time",
141
+ "description": "When the ranking was computed. A mediator MAY serve the ranking from a periodic survey rather than a live scan."
142
+ },
143
+ "truncated": {
144
+ "type": "boolean",
145
+ "description": "The ranking did not cover every account."
146
+ },
147
+ "nextCursor": {
148
+ "type": "string",
149
+ "minLength": 1,
150
+ "description": "Opaque continuation token. Present only when further items remain beyond this page; omitted on the final page."
151
+ },
152
+ "ext": {
153
+ "$ref": "#/$defs/Ext",
154
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
155
+ }
156
+ },
157
+ "required": [
158
+ "queues",
159
+ "snapshotAt"
160
+ ]
161
+ },
162
+ "Ext": {
163
+ "title": "Ext",
164
+ "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.",
165
+ "type": "object",
166
+ "minProperties": 1,
167
+ "additionalProperties": true,
168
+ "propertyNames": {
169
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
170
+ }
171
+ },
172
+ "QueueSummary": {
173
+ "title": "QueueSummary",
174
+ "type": "object",
175
+ "additionalProperties": false,
176
+ "required": [
177
+ "did",
178
+ "receive",
179
+ "send"
180
+ ],
181
+ "description": "Both queues of one account.",
182
+ "properties": {
183
+ "did": {
184
+ "$ref": "#/$defs/Vid"
185
+ },
186
+ "accountType": {
187
+ "$ref": "#/$defs/AccountType"
188
+ },
189
+ "receive": {
190
+ "$ref": "#/$defs/QueueDepth"
191
+ },
192
+ "send": {
193
+ "$ref": "#/$defs/QueueDepth"
194
+ }
195
+ }
196
+ },
197
+ "QueueDepth": {
198
+ "title": "QueueDepth",
199
+ "type": "object",
200
+ "additionalProperties": false,
201
+ "required": [
202
+ "count",
203
+ "bytes"
204
+ ],
205
+ "description": "The depth of one queue and its effective limit.",
206
+ "properties": {
207
+ "count": {
208
+ "type": "integer",
209
+ "minimum": 0,
210
+ "description": "Messages currently in the queue."
211
+ },
212
+ "bytes": {
213
+ "type": "integer",
214
+ "minimum": 0,
215
+ "description": "Total stored size of those messages, in bytes."
216
+ },
217
+ "limit": {
218
+ "type": "integer",
219
+ "minimum": -1,
220
+ "description": "The effective message-count limit for this queue after account overrides and mediator defaults are applied; -1 = unlimited."
221
+ },
222
+ "saturation": {
223
+ "type": "number",
224
+ "minimum": 0,
225
+ "description": "count ÷ limit. Absent when the limit is unlimited. May exceed 1 when a limit was lowered below the current depth."
226
+ },
227
+ "oldestAgeSeconds": {
228
+ "type": "integer",
229
+ "minimum": 0,
230
+ "description": "Age of the oldest message in the queue, in seconds. Absent when the queue is empty or the mediator did not measure it."
231
+ },
232
+ "deliveredUnacked": {
233
+ "type": "integer",
234
+ "minimum": 0,
235
+ "description": "Messages in the queue whose state is `delivered` — handed out but not yet deleted by the recipient. Absent when the mediator did not measure it."
236
+ }
237
+ }
238
+ },
239
+ "AccountType": {
240
+ "title": "AccountType",
241
+ "type": "string",
242
+ "enum": [
243
+ "standard",
244
+ "admin",
245
+ "rootAdmin",
246
+ "mediator"
247
+ ],
248
+ "description": "The account's role at the mediator. `standard` is an ordinary served account; `admin`/`rootAdmin` may administer other accounts; `mediator` is the mediator's own account. Only a rootAdmin may assign or modify the rootAdmin role."
249
+ },
250
+ "Vid": {
251
+ "title": "Vid",
252
+ "type": "string",
253
+ "minLength": 1,
254
+ "description": "A Verifiable Identifier (SPEC §4.8). For a mediator-served account this is the account's controlling DID, carried verbatim and compared by exact string equality. For privacy — and because some mediators key accounts by a one-way hash and never hold the full DID — a stable hash of the DID (e.g. its SHA-256 digest) is an equally valid value here: producer and consumer simply agree on the same opaque identifier and compare by exact string equality. The field carries whichever form the issuing mediator uses."
255
+ },
256
+ "Queue": {
257
+ "title": "Queue",
258
+ "type": "string",
259
+ "enum": [
260
+ "receive",
261
+ "send"
262
+ ],
263
+ "description": "Which of an account's two queues. `receive` holds messages addressed to the account awaiting its pickup. `send` holds messages the account sent that are still held against it until their recipient deletes them — so a stalled recipient fills its senders' send queues."
264
+ }
265
+ }
266
+ } as const;
267
+
268
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
269
+ export const RESPONSE_PAYLOAD_SCHEMA = {
270
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
271
+ "$ref": "#/$defs/Response",
272
+ "$defs": {
273
+ "Response": {
274
+ "$anchor": "response",
275
+ "title": "Messaging — List Queues — response payload",
276
+ "description": "The success response to a messaging/queue/list request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/messaging/queue/list/0.1#response.",
277
+ "type": "object",
278
+ "additionalProperties": false,
279
+ "properties": {
280
+ "queues": {
281
+ "type": "array",
282
+ "items": {
283
+ "$ref": "#/$defs/QueueSummary"
284
+ }
285
+ },
286
+ "snapshotAt": {
287
+ "type": "string",
288
+ "format": "date-time",
289
+ "description": "When the ranking was computed. A mediator MAY serve the ranking from a periodic survey rather than a live scan."
290
+ },
291
+ "truncated": {
292
+ "type": "boolean",
293
+ "description": "The ranking did not cover every account."
294
+ },
295
+ "nextCursor": {
296
+ "type": "string",
297
+ "minLength": 1,
298
+ "description": "Opaque continuation token. Present only when further items remain beyond this page; omitted on the final page."
299
+ },
300
+ "ext": {
301
+ "$ref": "#/$defs/Ext",
302
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
303
+ }
304
+ },
305
+ "required": [
306
+ "queues",
307
+ "snapshotAt"
308
+ ]
309
+ },
310
+ "Ext": {
311
+ "title": "Ext",
312
+ "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.",
313
+ "type": "object",
314
+ "minProperties": 1,
315
+ "additionalProperties": true,
316
+ "propertyNames": {
317
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
318
+ }
319
+ },
320
+ "QueueSummary": {
321
+ "title": "QueueSummary",
322
+ "type": "object",
323
+ "additionalProperties": false,
324
+ "required": [
325
+ "did",
326
+ "receive",
327
+ "send"
328
+ ],
329
+ "description": "Both queues of one account.",
330
+ "properties": {
331
+ "did": {
332
+ "$ref": "#/$defs/Vid"
333
+ },
334
+ "accountType": {
335
+ "$ref": "#/$defs/AccountType"
336
+ },
337
+ "receive": {
338
+ "$ref": "#/$defs/QueueDepth"
339
+ },
340
+ "send": {
341
+ "$ref": "#/$defs/QueueDepth"
342
+ }
343
+ }
344
+ },
345
+ "QueueDepth": {
346
+ "title": "QueueDepth",
347
+ "type": "object",
348
+ "additionalProperties": false,
349
+ "required": [
350
+ "count",
351
+ "bytes"
352
+ ],
353
+ "description": "The depth of one queue and its effective limit.",
354
+ "properties": {
355
+ "count": {
356
+ "type": "integer",
357
+ "minimum": 0,
358
+ "description": "Messages currently in the queue."
359
+ },
360
+ "bytes": {
361
+ "type": "integer",
362
+ "minimum": 0,
363
+ "description": "Total stored size of those messages, in bytes."
364
+ },
365
+ "limit": {
366
+ "type": "integer",
367
+ "minimum": -1,
368
+ "description": "The effective message-count limit for this queue after account overrides and mediator defaults are applied; -1 = unlimited."
369
+ },
370
+ "saturation": {
371
+ "type": "number",
372
+ "minimum": 0,
373
+ "description": "count ÷ limit. Absent when the limit is unlimited. May exceed 1 when a limit was lowered below the current depth."
374
+ },
375
+ "oldestAgeSeconds": {
376
+ "type": "integer",
377
+ "minimum": 0,
378
+ "description": "Age of the oldest message in the queue, in seconds. Absent when the queue is empty or the mediator did not measure it."
379
+ },
380
+ "deliveredUnacked": {
381
+ "type": "integer",
382
+ "minimum": 0,
383
+ "description": "Messages in the queue whose state is `delivered` — handed out but not yet deleted by the recipient. Absent when the mediator did not measure it."
384
+ }
385
+ }
386
+ },
387
+ "AccountType": {
388
+ "title": "AccountType",
389
+ "type": "string",
390
+ "enum": [
391
+ "standard",
392
+ "admin",
393
+ "rootAdmin",
394
+ "mediator"
395
+ ],
396
+ "description": "The account's role at the mediator. `standard` is an ordinary served account; `admin`/`rootAdmin` may administer other accounts; `mediator` is the mediator's own account. Only a rootAdmin may assign or modify the rootAdmin role."
397
+ },
398
+ "Vid": {
399
+ "title": "Vid",
400
+ "type": "string",
401
+ "minLength": 1,
402
+ "description": "A Verifiable Identifier (SPEC §4.8). For a mediator-served account this is the account's controlling DID, carried verbatim and compared by exact string equality. For privacy — and because some mediators key accounts by a one-way hash and never hold the full DID — a stable hash of the DID (e.g. its SHA-256 digest) is an equally valid value here: producer and consumer simply agree on the same opaque identifier and compare by exact string equality. The field carries whichever form the issuing mediator uses."
403
+ },
404
+ "Queue": {
405
+ "title": "Queue",
406
+ "type": "string",
407
+ "enum": [
408
+ "receive",
409
+ "send"
410
+ ],
411
+ "description": "Which of an account's two queues. `receive` holds messages addressed to the account awaiting its pickup. `send` holds messages the account sent that are still held against it until their recipient deletes them — so a stalled recipient fills its senders' send queues."
412
+ }
413
+ }
414
+ } as const;
415
+
416
+ /**
417
+ * SPEC.md §7.2 policy for the request variant, from this specification's
418
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
419
+ * per-specification and cannot be derived from the document alone, and
420
+ * item 2 needs the schema this carries.
421
+ */
422
+ export const SPEC = {
423
+ typeUri: TYPE_URI,
424
+ isBearer: false,
425
+ isProofRequired: true,
426
+ isRecipientRequired: true,
427
+ isIssuedAtRequired: true,
428
+ payloadSchema: PAYLOAD_SCHEMA,
429
+ } as const;
430
+
431
+ /**
432
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
433
+ * tracks the *issuer* party's requirement because a response swaps the
434
+ * parties (§7.3 item 5).
435
+ */
436
+ export const RESPONSE_SPEC = {
437
+ typeUri: RESPONSE_TYPE_URI,
438
+ isBearer: false,
439
+ isProofRequired: false,
440
+ isRecipientRequired: true,
441
+ isIssuedAtRequired: true,
442
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
443
+ } as const;