@openvtc/trust-tasks 0.19.14 → 0.19.16

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 (85) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/_shared/components.d.ts +331 -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/dist/vtc/join-requests/list/0.1/payload.d.ts +88 -0
  53. package/dist/vtc/join-requests/list/0.1/payload.d.ts.map +1 -1
  54. package/dist/vtc/join-requests/list/0.1/payload.js +50 -0
  55. package/dist/vtc/join-requests/list/0.1/payload.js.map +1 -1
  56. package/dist/vtc/join-requests/manifest/0.2/payload.d.ts +135 -0
  57. package/dist/vtc/join-requests/manifest/0.2/payload.d.ts.map +1 -1
  58. package/dist/vtc/join-requests/manifest/0.2/payload.js +62 -0
  59. package/dist/vtc/join-requests/manifest/0.2/payload.js.map +1 -1
  60. package/dist/vtc/join-requests/show/0.1/payload.d.ts +88 -0
  61. package/dist/vtc/join-requests/show/0.1/payload.d.ts.map +1 -1
  62. package/dist/vtc/join-requests/show/0.1/payload.js +50 -0
  63. package/dist/vtc/join-requests/show/0.1/payload.js.map +1 -1
  64. package/dist/vtc/join-requests/submit/0.2/payload.d.ts +61 -0
  65. package/dist/vtc/join-requests/submit/0.2/payload.d.ts.map +1 -1
  66. package/dist/vtc/join-requests/submit/0.2/payload.js +25 -0
  67. package/dist/vtc/join-requests/submit/0.2/payload.js.map +1 -1
  68. package/package.json +1 -1
  69. package/src/_shared/components.ts +359 -0
  70. package/src/index.ts +11 -0
  71. package/src/messaging/_shared/0.1/mediator-ops.ts +17 -0
  72. package/src/messaging/message/delete/0.1/payload.ts +259 -0
  73. package/src/messaging/message/get/0.1/payload.ts +375 -0
  74. package/src/messaging/message/list/0.1/payload.ts +410 -0
  75. package/src/messaging/monitor/event/0.1/payload.ts +267 -0
  76. package/src/messaging/monitor/subscribe/0.1/payload.ts +473 -0
  77. package/src/messaging/monitor/unsubscribe/0.1/payload.ts +172 -0
  78. package/src/messaging/queue/list/0.1/payload.ts +443 -0
  79. package/src/messaging/queue/purge/0.1/payload.ts +270 -0
  80. package/src/messaging/queue/status/0.1/payload.ts +439 -0
  81. package/src/messaging/stats/show/0.1/payload.ts +611 -0
  82. package/src/vtc/join-requests/list/0.1/payload.ts +50 -0
  83. package/src/vtc/join-requests/manifest/0.2/payload.ts +81 -0
  84. package/src/vtc/join-requests/show/0.1/payload.ts +50 -0
  85. package/src/vtc/join-requests/submit/0.2/payload.ts +42 -0
@@ -0,0 +1,385 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/messaging/monitor/event/0.1/payload.schema.json
4
+ */
5
+ import type { Ext, MonitorEvent, TrafficChannel, TrafficDirection, TrafficOutcome, TrafficStage, Vid, WireProtocol } from "../../../../_shared/components.js";
6
+ export interface MessagingTrafficMonitorEventPayload {
7
+ subscriptionId: string;
8
+ /**
9
+ * Batch sequence number, starting at 1 and increasing by exactly 1 per batch within a subscription. A gap means batches were lost in transit.
10
+ */
11
+ seq: number;
12
+ /**
13
+ * Events in the order the mediator observed them. May be empty on a heartbeat batch.
14
+ *
15
+ * @maxItems 500
16
+ */
17
+ events: MonitorEvent[];
18
+ /**
19
+ * Events that matched the filter but were discarded since the previous batch — rate ceiling exceeded or subscriber not connected.
20
+ */
21
+ dropped: number;
22
+ /**
23
+ * The subscription's current expiry, so the subscriber can renew before it lapses.
24
+ */
25
+ expiresAt: string;
26
+ /**
27
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
28
+ */
29
+ ext?: Ext;
30
+ }
31
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
32
+ export type { Ext, MonitorEvent, TrafficChannel, TrafficDirection, TrafficOutcome, TrafficStage, Vid, WireProtocol };
33
+ /** Trust Task type URI. */
34
+ export declare const TYPE_URI: "https://trusttasks.org/spec/messaging/monitor/event/0.1";
35
+ /** Stable alias for this specification's request payload shape. */
36
+ export type Payload = MessagingTrafficMonitorEventPayload;
37
+ /**
38
+ * This specification's payload schema, as a value.
39
+ *
40
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
41
+ * rather than only as a `.json` file because TypeScript types are erased
42
+ * at runtime: without a schema a consumer has nothing to validate, and
43
+ * every REQUIRED payload member is optional in practice. Cross-file
44
+ * `$ref`s are already inlined, so it needs no resolver.
45
+ */
46
+ export declare const PAYLOAD_SCHEMA: {
47
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
48
+ readonly $id: "https://trusttasks.org/spec/messaging/monitor/event/0.1";
49
+ readonly title: "Messaging — Traffic Monitor Event — payload";
50
+ readonly type: "object";
51
+ readonly additionalProperties: false;
52
+ readonly required: readonly ["subscriptionId", "seq", "events", "dropped", "expiresAt"];
53
+ readonly properties: {
54
+ readonly subscriptionId: {
55
+ readonly type: "string";
56
+ readonly minLength: 1;
57
+ };
58
+ readonly seq: {
59
+ readonly type: "integer";
60
+ readonly minimum: 1;
61
+ readonly description: "Batch sequence number, starting at 1 and increasing by exactly 1 per batch within a subscription. A gap means batches were lost in transit.";
62
+ };
63
+ readonly events: {
64
+ readonly type: "array";
65
+ readonly maxItems: 500;
66
+ readonly items: {
67
+ readonly $ref: "#/$defs/MonitorEvent";
68
+ };
69
+ readonly description: "Events in the order the mediator observed them. May be empty on a heartbeat batch.";
70
+ };
71
+ readonly dropped: {
72
+ readonly type: "integer";
73
+ readonly minimum: 0;
74
+ readonly description: "Events that matched the filter but were discarded since the previous batch — rate ceiling exceeded or subscriber not connected.";
75
+ };
76
+ readonly expiresAt: {
77
+ readonly type: "string";
78
+ readonly format: "date-time";
79
+ readonly description: "The subscription's current expiry, so the subscriber can renew before it lapses.";
80
+ };
81
+ readonly ext: {
82
+ readonly $ref: "#/$defs/Ext";
83
+ readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
84
+ };
85
+ };
86
+ readonly $defs: {
87
+ readonly Ext: {
88
+ readonly title: "Ext";
89
+ readonly 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.";
90
+ readonly type: "object";
91
+ readonly minProperties: 1;
92
+ readonly additionalProperties: true;
93
+ readonly propertyNames: {
94
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
95
+ };
96
+ };
97
+ readonly MonitorEvent: {
98
+ readonly title: "MonitorEvent";
99
+ readonly type: "object";
100
+ readonly additionalProperties: false;
101
+ readonly required: readonly ["at", "direction", "stage", "channel", "protocol"];
102
+ readonly description: "One observed step in the life of one message at the mediator. Carries metadata only — never a message body.";
103
+ readonly properties: {
104
+ readonly at: {
105
+ readonly type: "string";
106
+ readonly format: "date-time";
107
+ readonly description: "When the step happened, with sub-second precision where the mediator has it.";
108
+ };
109
+ readonly direction: {
110
+ readonly $ref: "#/$defs/TrafficDirection";
111
+ };
112
+ readonly stage: {
113
+ readonly $ref: "#/$defs/TrafficStage";
114
+ };
115
+ readonly channel: {
116
+ readonly $ref: "#/$defs/TrafficChannel";
117
+ };
118
+ readonly protocol: {
119
+ readonly $ref: "#/$defs/WireProtocol";
120
+ };
121
+ readonly msgId: {
122
+ readonly type: "string";
123
+ readonly minLength: 1;
124
+ readonly description: "The stored message's identifier, once it has one; correlates the events of one message and matches MessageMeta.msgId.";
125
+ readonly maxLength: 256;
126
+ };
127
+ readonly from: {
128
+ readonly $ref: "#/$defs/Vid";
129
+ readonly description: "The sender, where the mediator knows it.";
130
+ };
131
+ readonly to: {
132
+ readonly $ref: "#/$defs/Vid";
133
+ readonly description: "The recipient, where the mediator knows it.";
134
+ };
135
+ readonly size: {
136
+ readonly type: "integer";
137
+ readonly minimum: 0;
138
+ readonly description: "Frame size in bytes.";
139
+ };
140
+ readonly messageType: {
141
+ readonly type: "string";
142
+ readonly minLength: 1;
143
+ readonly description: "The plaintext message type, present only when the mediator itself was the addressee and read it (a routing forward, a pickup request, a trust-task type URI, a trust ping). Absent for end-to-end-encrypted traffic the mediator only relays.";
144
+ readonly maxLength: 512;
145
+ };
146
+ readonly outcome: {
147
+ readonly $ref: "#/$defs/TrafficOutcome";
148
+ readonly description: "Present when stage is `refused`, and on any other stage that failed.";
149
+ };
150
+ readonly latencyMs: {
151
+ readonly type: "integer";
152
+ readonly minimum: 0;
153
+ readonly description: "For `delivered` and `forwarded`: milliseconds since the message was stored.";
154
+ };
155
+ };
156
+ };
157
+ readonly TrafficOutcome: {
158
+ readonly title: "TrafficOutcome";
159
+ readonly type: "object";
160
+ readonly additionalProperties: false;
161
+ readonly required: readonly ["code"];
162
+ readonly description: "Why a frame was refused or failed.";
163
+ readonly properties: {
164
+ readonly code: {
165
+ readonly type: "string";
166
+ readonly minLength: 1;
167
+ readonly description: "The stable error code the mediator returned to the sender (a trust-task-error or problem-report code).";
168
+ readonly maxLength: 256;
169
+ };
170
+ readonly detail: {
171
+ readonly type: "string";
172
+ readonly description: "Short human-readable explanation. Not machine-parsed.";
173
+ readonly maxLength: 1024;
174
+ };
175
+ };
176
+ };
177
+ readonly WireProtocol: {
178
+ readonly title: "WireProtocol";
179
+ readonly type: "string";
180
+ readonly enum: readonly ["didcomm", "didcommV1", "tsp", "other"];
181
+ readonly description: "The protocol a message travelled in, as the mediator detected it from the wire form. `didcomm` is DIDComm v2 (JWE/JWS); `didcommV1` is a DIDComm v1 envelope; `tsp` is a Trust Spanning Protocol message; `other` is anything the mediator could not classify.";
182
+ };
183
+ readonly TrafficChannel: {
184
+ readonly title: "TrafficChannel";
185
+ readonly type: "string";
186
+ readonly enum: readonly ["websocket", "rest", "peerMediator", "internal"];
187
+ readonly description: "How the traffic reached or left the mediator. `peerMediator` is mediator-to-mediator forwarding.";
188
+ };
189
+ readonly TrafficStage: {
190
+ readonly title: "TrafficStage";
191
+ readonly type: "string";
192
+ readonly enum: readonly ["received", "stored", "delivered", "forwarded", "refused", "deleted", "expired", "purged"];
193
+ readonly description: "What happened. `received`: a frame arrived. `stored`: it was queued for a local account. `delivered`: handed to its recipient. `forwarded`: relayed to another mediator. `refused`: rejected (see the event's `outcome`). `deleted`: removed by its recipient or an administrator. `expired`: removed by expiry. `purged`: removed by a queue purge.";
194
+ };
195
+ readonly TrafficDirection: {
196
+ readonly title: "TrafficDirection";
197
+ readonly type: "string";
198
+ readonly enum: readonly ["inbound", "outbound", "internal"];
199
+ readonly description: "`inbound`: arriving at the mediator. `outbound`: leaving it (delivery to a recipient, or a forward to another mediator). `internal`: a state change with no wire traffic (expiry, deletion, purge).";
200
+ };
201
+ readonly Vid: {
202
+ readonly title: "Vid";
203
+ readonly type: "string";
204
+ readonly minLength: 1;
205
+ readonly 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.";
206
+ };
207
+ };
208
+ };
209
+ /**
210
+ * SPEC.md §7.2 policy for the request variant, from this specification's
211
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
212
+ * per-specification and cannot be derived from the document alone, and
213
+ * item 2 needs the schema this carries.
214
+ */
215
+ export declare const SPEC: {
216
+ readonly typeUri: "https://trusttasks.org/spec/messaging/monitor/event/0.1";
217
+ readonly isBearer: false;
218
+ readonly isProofRequired: false;
219
+ readonly isRecipientRequired: true;
220
+ readonly isIssuedAtRequired: true;
221
+ readonly payloadSchema: {
222
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
223
+ readonly $id: "https://trusttasks.org/spec/messaging/monitor/event/0.1";
224
+ readonly title: "Messaging — Traffic Monitor Event — payload";
225
+ readonly type: "object";
226
+ readonly additionalProperties: false;
227
+ readonly required: readonly ["subscriptionId", "seq", "events", "dropped", "expiresAt"];
228
+ readonly properties: {
229
+ readonly subscriptionId: {
230
+ readonly type: "string";
231
+ readonly minLength: 1;
232
+ };
233
+ readonly seq: {
234
+ readonly type: "integer";
235
+ readonly minimum: 1;
236
+ readonly description: "Batch sequence number, starting at 1 and increasing by exactly 1 per batch within a subscription. A gap means batches were lost in transit.";
237
+ };
238
+ readonly events: {
239
+ readonly type: "array";
240
+ readonly maxItems: 500;
241
+ readonly items: {
242
+ readonly $ref: "#/$defs/MonitorEvent";
243
+ };
244
+ readonly description: "Events in the order the mediator observed them. May be empty on a heartbeat batch.";
245
+ };
246
+ readonly dropped: {
247
+ readonly type: "integer";
248
+ readonly minimum: 0;
249
+ readonly description: "Events that matched the filter but were discarded since the previous batch — rate ceiling exceeded or subscriber not connected.";
250
+ };
251
+ readonly expiresAt: {
252
+ readonly type: "string";
253
+ readonly format: "date-time";
254
+ readonly description: "The subscription's current expiry, so the subscriber can renew before it lapses.";
255
+ };
256
+ readonly ext: {
257
+ readonly $ref: "#/$defs/Ext";
258
+ readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
259
+ };
260
+ };
261
+ readonly $defs: {
262
+ readonly Ext: {
263
+ readonly title: "Ext";
264
+ readonly 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.";
265
+ readonly type: "object";
266
+ readonly minProperties: 1;
267
+ readonly additionalProperties: true;
268
+ readonly propertyNames: {
269
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
270
+ };
271
+ };
272
+ readonly MonitorEvent: {
273
+ readonly title: "MonitorEvent";
274
+ readonly type: "object";
275
+ readonly additionalProperties: false;
276
+ readonly required: readonly ["at", "direction", "stage", "channel", "protocol"];
277
+ readonly description: "One observed step in the life of one message at the mediator. Carries metadata only — never a message body.";
278
+ readonly properties: {
279
+ readonly at: {
280
+ readonly type: "string";
281
+ readonly format: "date-time";
282
+ readonly description: "When the step happened, with sub-second precision where the mediator has it.";
283
+ };
284
+ readonly direction: {
285
+ readonly $ref: "#/$defs/TrafficDirection";
286
+ };
287
+ readonly stage: {
288
+ readonly $ref: "#/$defs/TrafficStage";
289
+ };
290
+ readonly channel: {
291
+ readonly $ref: "#/$defs/TrafficChannel";
292
+ };
293
+ readonly protocol: {
294
+ readonly $ref: "#/$defs/WireProtocol";
295
+ };
296
+ readonly msgId: {
297
+ readonly type: "string";
298
+ readonly minLength: 1;
299
+ readonly description: "The stored message's identifier, once it has one; correlates the events of one message and matches MessageMeta.msgId.";
300
+ readonly maxLength: 256;
301
+ };
302
+ readonly from: {
303
+ readonly $ref: "#/$defs/Vid";
304
+ readonly description: "The sender, where the mediator knows it.";
305
+ };
306
+ readonly to: {
307
+ readonly $ref: "#/$defs/Vid";
308
+ readonly description: "The recipient, where the mediator knows it.";
309
+ };
310
+ readonly size: {
311
+ readonly type: "integer";
312
+ readonly minimum: 0;
313
+ readonly description: "Frame size in bytes.";
314
+ };
315
+ readonly messageType: {
316
+ readonly type: "string";
317
+ readonly minLength: 1;
318
+ readonly description: "The plaintext message type, present only when the mediator itself was the addressee and read it (a routing forward, a pickup request, a trust-task type URI, a trust ping). Absent for end-to-end-encrypted traffic the mediator only relays.";
319
+ readonly maxLength: 512;
320
+ };
321
+ readonly outcome: {
322
+ readonly $ref: "#/$defs/TrafficOutcome";
323
+ readonly description: "Present when stage is `refused`, and on any other stage that failed.";
324
+ };
325
+ readonly latencyMs: {
326
+ readonly type: "integer";
327
+ readonly minimum: 0;
328
+ readonly description: "For `delivered` and `forwarded`: milliseconds since the message was stored.";
329
+ };
330
+ };
331
+ };
332
+ readonly TrafficOutcome: {
333
+ readonly title: "TrafficOutcome";
334
+ readonly type: "object";
335
+ readonly additionalProperties: false;
336
+ readonly required: readonly ["code"];
337
+ readonly description: "Why a frame was refused or failed.";
338
+ readonly properties: {
339
+ readonly code: {
340
+ readonly type: "string";
341
+ readonly minLength: 1;
342
+ readonly description: "The stable error code the mediator returned to the sender (a trust-task-error or problem-report code).";
343
+ readonly maxLength: 256;
344
+ };
345
+ readonly detail: {
346
+ readonly type: "string";
347
+ readonly description: "Short human-readable explanation. Not machine-parsed.";
348
+ readonly maxLength: 1024;
349
+ };
350
+ };
351
+ };
352
+ readonly WireProtocol: {
353
+ readonly title: "WireProtocol";
354
+ readonly type: "string";
355
+ readonly enum: readonly ["didcomm", "didcommV1", "tsp", "other"];
356
+ readonly description: "The protocol a message travelled in, as the mediator detected it from the wire form. `didcomm` is DIDComm v2 (JWE/JWS); `didcommV1` is a DIDComm v1 envelope; `tsp` is a Trust Spanning Protocol message; `other` is anything the mediator could not classify.";
357
+ };
358
+ readonly TrafficChannel: {
359
+ readonly title: "TrafficChannel";
360
+ readonly type: "string";
361
+ readonly enum: readonly ["websocket", "rest", "peerMediator", "internal"];
362
+ readonly description: "How the traffic reached or left the mediator. `peerMediator` is mediator-to-mediator forwarding.";
363
+ };
364
+ readonly TrafficStage: {
365
+ readonly title: "TrafficStage";
366
+ readonly type: "string";
367
+ readonly enum: readonly ["received", "stored", "delivered", "forwarded", "refused", "deleted", "expired", "purged"];
368
+ readonly description: "What happened. `received`: a frame arrived. `stored`: it was queued for a local account. `delivered`: handed to its recipient. `forwarded`: relayed to another mediator. `refused`: rejected (see the event's `outcome`). `deleted`: removed by its recipient or an administrator. `expired`: removed by expiry. `purged`: removed by a queue purge.";
369
+ };
370
+ readonly TrafficDirection: {
371
+ readonly title: "TrafficDirection";
372
+ readonly type: "string";
373
+ readonly enum: readonly ["inbound", "outbound", "internal"];
374
+ readonly description: "`inbound`: arriving at the mediator. `outbound`: leaving it (delivery to a recipient, or a forward to another mediator). `internal`: a state change with no wire traffic (expiry, deletion, purge).";
375
+ };
376
+ readonly Vid: {
377
+ readonly title: "Vid";
378
+ readonly type: "string";
379
+ readonly minLength: 1;
380
+ readonly 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.";
381
+ };
382
+ };
383
+ };
384
+ };
385
+ //# sourceMappingURL=payload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../../../src/messaging/monitor/event/0.1/payload.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAG9J,MAAM,WAAW,mCAAmC;IAClD,cAAc,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;;;OAIG;IACH,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,GAAG,CAAC,EAAE,GAAG,CAAC;CACX;AAED,kHAAkH;AAClH,YAAY,EAAE,GAAG,EAAE,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,EAAE,YAAY,EAAE,CAAC;AAErH,2BAA2B;AAC3B,eAAO,MAAM,QAAQ,EAAG,yDAAkE,CAAC;AAE3F,mEAAmE;AACnE,MAAM,MAAM,OAAO,GAAG,mCAAmC,CAAC;AAE1D;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuMjB,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOP,CAAC"}
@@ -0,0 +1,230 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/messaging/monitor/event/0.1/payload.schema.json
4
+ */
5
+ /** Trust Task type URI. */
6
+ export const TYPE_URI = "https://trusttasks.org/spec/messaging/monitor/event/0.1";
7
+ /**
8
+ * This specification's payload schema, as a value.
9
+ *
10
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
11
+ * rather than only as a `.json` file because TypeScript types are erased
12
+ * at runtime: without a schema a consumer has nothing to validate, and
13
+ * every REQUIRED payload member is optional in practice. Cross-file
14
+ * `$ref`s are already inlined, so it needs no resolver.
15
+ */
16
+ export const PAYLOAD_SCHEMA = {
17
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
18
+ "$id": "https://trusttasks.org/spec/messaging/monitor/event/0.1",
19
+ "title": "Messaging — Traffic Monitor Event — payload",
20
+ "type": "object",
21
+ "additionalProperties": false,
22
+ "required": [
23
+ "subscriptionId",
24
+ "seq",
25
+ "events",
26
+ "dropped",
27
+ "expiresAt"
28
+ ],
29
+ "properties": {
30
+ "subscriptionId": {
31
+ "type": "string",
32
+ "minLength": 1
33
+ },
34
+ "seq": {
35
+ "type": "integer",
36
+ "minimum": 1,
37
+ "description": "Batch sequence number, starting at 1 and increasing by exactly 1 per batch within a subscription. A gap means batches were lost in transit."
38
+ },
39
+ "events": {
40
+ "type": "array",
41
+ "maxItems": 500,
42
+ "items": {
43
+ "$ref": "#/$defs/MonitorEvent"
44
+ },
45
+ "description": "Events in the order the mediator observed them. May be empty on a heartbeat batch."
46
+ },
47
+ "dropped": {
48
+ "type": "integer",
49
+ "minimum": 0,
50
+ "description": "Events that matched the filter but were discarded since the previous batch — rate ceiling exceeded or subscriber not connected."
51
+ },
52
+ "expiresAt": {
53
+ "type": "string",
54
+ "format": "date-time",
55
+ "description": "The subscription's current expiry, so the subscriber can renew before it lapses."
56
+ },
57
+ "ext": {
58
+ "$ref": "#/$defs/Ext",
59
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
60
+ }
61
+ },
62
+ "$defs": {
63
+ "Ext": {
64
+ "title": "Ext",
65
+ "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.",
66
+ "type": "object",
67
+ "minProperties": 1,
68
+ "additionalProperties": true,
69
+ "propertyNames": {
70
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
71
+ }
72
+ },
73
+ "MonitorEvent": {
74
+ "title": "MonitorEvent",
75
+ "type": "object",
76
+ "additionalProperties": false,
77
+ "required": [
78
+ "at",
79
+ "direction",
80
+ "stage",
81
+ "channel",
82
+ "protocol"
83
+ ],
84
+ "description": "One observed step in the life of one message at the mediator. Carries metadata only — never a message body.",
85
+ "properties": {
86
+ "at": {
87
+ "type": "string",
88
+ "format": "date-time",
89
+ "description": "When the step happened, with sub-second precision where the mediator has it."
90
+ },
91
+ "direction": {
92
+ "$ref": "#/$defs/TrafficDirection"
93
+ },
94
+ "stage": {
95
+ "$ref": "#/$defs/TrafficStage"
96
+ },
97
+ "channel": {
98
+ "$ref": "#/$defs/TrafficChannel"
99
+ },
100
+ "protocol": {
101
+ "$ref": "#/$defs/WireProtocol"
102
+ },
103
+ "msgId": {
104
+ "type": "string",
105
+ "minLength": 1,
106
+ "description": "The stored message's identifier, once it has one; correlates the events of one message and matches MessageMeta.msgId.",
107
+ "maxLength": 256
108
+ },
109
+ "from": {
110
+ "$ref": "#/$defs/Vid",
111
+ "description": "The sender, where the mediator knows it."
112
+ },
113
+ "to": {
114
+ "$ref": "#/$defs/Vid",
115
+ "description": "The recipient, where the mediator knows it."
116
+ },
117
+ "size": {
118
+ "type": "integer",
119
+ "minimum": 0,
120
+ "description": "Frame size in bytes."
121
+ },
122
+ "messageType": {
123
+ "type": "string",
124
+ "minLength": 1,
125
+ "description": "The plaintext message type, present only when the mediator itself was the addressee and read it (a routing forward, a pickup request, a trust-task type URI, a trust ping). Absent for end-to-end-encrypted traffic the mediator only relays.",
126
+ "maxLength": 512
127
+ },
128
+ "outcome": {
129
+ "$ref": "#/$defs/TrafficOutcome",
130
+ "description": "Present when stage is `refused`, and on any other stage that failed."
131
+ },
132
+ "latencyMs": {
133
+ "type": "integer",
134
+ "minimum": 0,
135
+ "description": "For `delivered` and `forwarded`: milliseconds since the message was stored."
136
+ }
137
+ }
138
+ },
139
+ "TrafficOutcome": {
140
+ "title": "TrafficOutcome",
141
+ "type": "object",
142
+ "additionalProperties": false,
143
+ "required": [
144
+ "code"
145
+ ],
146
+ "description": "Why a frame was refused or failed.",
147
+ "properties": {
148
+ "code": {
149
+ "type": "string",
150
+ "minLength": 1,
151
+ "description": "The stable error code the mediator returned to the sender (a trust-task-error or problem-report code).",
152
+ "maxLength": 256
153
+ },
154
+ "detail": {
155
+ "type": "string",
156
+ "description": "Short human-readable explanation. Not machine-parsed.",
157
+ "maxLength": 1024
158
+ }
159
+ }
160
+ },
161
+ "WireProtocol": {
162
+ "title": "WireProtocol",
163
+ "type": "string",
164
+ "enum": [
165
+ "didcomm",
166
+ "didcommV1",
167
+ "tsp",
168
+ "other"
169
+ ],
170
+ "description": "The protocol a message travelled in, as the mediator detected it from the wire form. `didcomm` is DIDComm v2 (JWE/JWS); `didcommV1` is a DIDComm v1 envelope; `tsp` is a Trust Spanning Protocol message; `other` is anything the mediator could not classify."
171
+ },
172
+ "TrafficChannel": {
173
+ "title": "TrafficChannel",
174
+ "type": "string",
175
+ "enum": [
176
+ "websocket",
177
+ "rest",
178
+ "peerMediator",
179
+ "internal"
180
+ ],
181
+ "description": "How the traffic reached or left the mediator. `peerMediator` is mediator-to-mediator forwarding."
182
+ },
183
+ "TrafficStage": {
184
+ "title": "TrafficStage",
185
+ "type": "string",
186
+ "enum": [
187
+ "received",
188
+ "stored",
189
+ "delivered",
190
+ "forwarded",
191
+ "refused",
192
+ "deleted",
193
+ "expired",
194
+ "purged"
195
+ ],
196
+ "description": "What happened. `received`: a frame arrived. `stored`: it was queued for a local account. `delivered`: handed to its recipient. `forwarded`: relayed to another mediator. `refused`: rejected (see the event's `outcome`). `deleted`: removed by its recipient or an administrator. `expired`: removed by expiry. `purged`: removed by a queue purge."
197
+ },
198
+ "TrafficDirection": {
199
+ "title": "TrafficDirection",
200
+ "type": "string",
201
+ "enum": [
202
+ "inbound",
203
+ "outbound",
204
+ "internal"
205
+ ],
206
+ "description": "`inbound`: arriving at the mediator. `outbound`: leaving it (delivery to a recipient, or a forward to another mediator). `internal`: a state change with no wire traffic (expiry, deletion, purge)."
207
+ },
208
+ "Vid": {
209
+ "title": "Vid",
210
+ "type": "string",
211
+ "minLength": 1,
212
+ "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."
213
+ }
214
+ }
215
+ };
216
+ /**
217
+ * SPEC.md §7.2 policy for the request variant, from this specification's
218
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
219
+ * per-specification and cannot be derived from the document alone, and
220
+ * item 2 needs the schema this carries.
221
+ */
222
+ export const SPEC = {
223
+ typeUri: TYPE_URI,
224
+ isBearer: false,
225
+ isProofRequired: false,
226
+ isRecipientRequired: true,
227
+ isIssuedAtRequired: true,
228
+ payloadSchema: PAYLOAD_SCHEMA,
229
+ };
230
+ //# sourceMappingURL=payload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payload.js","sourceRoot":"","sources":["../../../../../src/messaging/monitor/event/0.1/payload.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAkCH,2BAA2B;AAC3B,MAAM,CAAC,MAAM,QAAQ,GAAG,yDAAkE,CAAC;AAK3F;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,SAAS,EAAE,8CAA8C;IACzD,KAAK,EAAE,yDAAyD;IAChE,OAAO,EAAE,6CAA6C;IACtD,MAAM,EAAE,QAAQ;IAChB,sBAAsB,EAAE,KAAK;IAC7B,UAAU,EAAE;QACV,gBAAgB;QAChB,KAAK;QACL,QAAQ;QACR,SAAS;QACT,WAAW;KACZ;IACD,YAAY,EAAE;QACZ,gBAAgB,EAAE;YAChB,MAAM,EAAE,QAAQ;YAChB,WAAW,EAAE,CAAC;SACf;QACD,KAAK,EAAE;YACL,MAAM,EAAE,SAAS;YACjB,SAAS,EAAE,CAAC;YACZ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