@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.
- package/CHANGELOG.md +4 -0
- package/dist/_shared/components.d.ts +314 -0
- package/dist/_shared/components.d.ts.map +1 -1
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -1
- package/dist/messaging/_shared/0.1/mediator-ops.d.ts +16 -0
- package/dist/messaging/_shared/0.1/mediator-ops.d.ts.map +1 -0
- package/dist/messaging/_shared/0.1/mediator-ops.js +6 -0
- package/dist/messaging/_shared/0.1/mediator-ops.js.map +1 -0
- package/dist/messaging/message/delete/0.1/payload.d.ts +370 -0
- package/dist/messaging/message/delete/0.1/payload.d.ts.map +1 -0
- package/dist/messaging/message/delete/0.1/payload.js +206 -0
- package/dist/messaging/message/delete/0.1/payload.js.map +1 -0
- package/dist/messaging/message/get/0.1/payload.d.ts +568 -0
- package/dist/messaging/message/get/0.1/payload.d.ts.map +1 -0
- package/dist/messaging/message/get/0.1/payload.js +332 -0
- package/dist/messaging/message/get/0.1/payload.js.map +1 -0
- package/dist/messaging/message/list/0.1/payload.d.ts +627 -0
- package/dist/messaging/message/list/0.1/payload.d.ts.map +1 -0
- package/dist/messaging/message/list/0.1/payload.js +352 -0
- package/dist/messaging/message/list/0.1/payload.js.map +1 -0
- package/dist/messaging/monitor/event/0.1/payload.d.ts +385 -0
- package/dist/messaging/monitor/event/0.1/payload.d.ts.map +1 -0
- package/dist/messaging/monitor/event/0.1/payload.js +230 -0
- package/dist/messaging/monitor/event/0.1/payload.js.map +1 -0
- package/dist/messaging/monitor/subscribe/0.1/payload.d.ts +719 -0
- package/dist/messaging/monitor/subscribe/0.1/payload.d.ts.map +1 -0
- package/dist/messaging/monitor/subscribe/0.1/payload.js +417 -0
- package/dist/messaging/monitor/subscribe/0.1/payload.js.map +1 -0
- package/dist/messaging/monitor/unsubscribe/0.1/payload.d.ts +245 -0
- package/dist/messaging/monitor/unsubscribe/0.1/payload.d.ts.map +1 -0
- package/dist/messaging/monitor/unsubscribe/0.1/payload.js +136 -0
- package/dist/messaging/monitor/unsubscribe/0.1/payload.js.map +1 -0
- package/dist/messaging/queue/list/0.1/payload.d.ts +679 -0
- package/dist/messaging/queue/list/0.1/payload.d.ts.map +1 -0
- package/dist/messaging/queue/list/0.1/payload.js +377 -0
- package/dist/messaging/queue/list/0.1/payload.js.map +1 -0
- package/dist/messaging/queue/purge/0.1/payload.d.ts +389 -0
- package/dist/messaging/queue/purge/0.1/payload.d.ts.map +1 -0
- package/dist/messaging/queue/purge/0.1/payload.js +210 -0
- package/dist/messaging/queue/purge/0.1/payload.js.map +1 -0
- package/dist/messaging/queue/status/0.1/payload.d.ts +697 -0
- package/dist/messaging/queue/status/0.1/payload.d.ts.map +1 -0
- package/dist/messaging/queue/status/0.1/payload.js +389 -0
- package/dist/messaging/queue/status/0.1/payload.js.map +1 -0
- package/dist/messaging/stats/show/0.1/payload.d.ts +963 -0
- package/dist/messaging/stats/show/0.1/payload.d.ts.map +1 -0
- package/dist/messaging/stats/show/0.1/payload.js +515 -0
- package/dist/messaging/stats/show/0.1/payload.js.map +1 -0
- package/package.json +1 -1
- package/src/_shared/components.ts +342 -0
- package/src/index.ts +11 -0
- package/src/messaging/_shared/0.1/mediator-ops.ts +17 -0
- package/src/messaging/message/delete/0.1/payload.ts +259 -0
- package/src/messaging/message/get/0.1/payload.ts +375 -0
- package/src/messaging/message/list/0.1/payload.ts +410 -0
- package/src/messaging/monitor/event/0.1/payload.ts +267 -0
- package/src/messaging/monitor/subscribe/0.1/payload.ts +473 -0
- package/src/messaging/monitor/unsubscribe/0.1/payload.ts +172 -0
- package/src/messaging/queue/list/0.1/payload.ts +443 -0
- package/src/messaging/queue/purge/0.1/payload.ts +270 -0
- package/src/messaging/queue/status/0.1/payload.ts +439 -0
- package/src/messaging/stats/show/0.1/payload.ts +611 -0
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/messaging/message/list/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { DeliveryState, Ext, MessageMeta, Queue, Vid, WireProtocol } from "../../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export interface MessagingListMessagesPayload {
|
|
10
|
+
/**
|
|
11
|
+
* The account whose queue to list. Omitted = the requester's own account. A requester without administrative standing may name only itself.
|
|
12
|
+
*/
|
|
13
|
+
did?: Vid;
|
|
14
|
+
queue: Queue;
|
|
15
|
+
/**
|
|
16
|
+
* Only messages exchanged with this counterparty.
|
|
17
|
+
*/
|
|
18
|
+
peer?: Vid;
|
|
19
|
+
/**
|
|
20
|
+
* Opaque continuation token from a prior page's nextCursor. Echoed verbatim; treated as unstructured by the requester.
|
|
21
|
+
*/
|
|
22
|
+
cursor?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Maximum messages per page. The mediator chooses a default when omitted.
|
|
25
|
+
*/
|
|
26
|
+
limit?: number;
|
|
27
|
+
/**
|
|
28
|
+
* Ecosystem-defined extension members per SPEC.md §4.5.1.
|
|
29
|
+
*/
|
|
30
|
+
ext?: Ext;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The success response to a messaging/message/list request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/messaging/message/list/0.1#response.
|
|
34
|
+
*/
|
|
35
|
+
export interface MessagingListMessagesResponsePayload {
|
|
36
|
+
/**
|
|
37
|
+
* The page, oldest first.
|
|
38
|
+
*/
|
|
39
|
+
messages: MessageMeta[];
|
|
40
|
+
/**
|
|
41
|
+
* Opaque continuation token. Present only when further items remain beyond this page; omitted on the final page.
|
|
42
|
+
*/
|
|
43
|
+
nextCursor?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Ecosystem-defined extension members per SPEC.md §4.5.1.
|
|
46
|
+
*/
|
|
47
|
+
ext?: Ext;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
51
|
+
export type { DeliveryState, Ext, MessageMeta, Queue, Vid, WireProtocol };
|
|
52
|
+
|
|
53
|
+
/** Trust Task type URI. */
|
|
54
|
+
export const TYPE_URI = "https://trusttasks.org/spec/messaging/message/list/0.1" as const;
|
|
55
|
+
|
|
56
|
+
/** Stable alias for this specification's request payload shape. */
|
|
57
|
+
export type Payload = MessagingListMessagesPayload;
|
|
58
|
+
|
|
59
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
60
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/messaging/message/list/0.1#response" as const;
|
|
61
|
+
|
|
62
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
63
|
+
export type Response = MessagingListMessagesResponsePayload;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* This specification's payload schema, as a value.
|
|
67
|
+
*
|
|
68
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
69
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
70
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
71
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
72
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
73
|
+
*/
|
|
74
|
+
export const PAYLOAD_SCHEMA = {
|
|
75
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
76
|
+
"$id": "https://trusttasks.org/spec/messaging/message/list/0.1",
|
|
77
|
+
"title": "Messaging — List Messages — payload",
|
|
78
|
+
"type": "object",
|
|
79
|
+
"additionalProperties": false,
|
|
80
|
+
"required": [
|
|
81
|
+
"queue"
|
|
82
|
+
],
|
|
83
|
+
"properties": {
|
|
84
|
+
"did": {
|
|
85
|
+
"$ref": "#/$defs/Vid",
|
|
86
|
+
"description": "The account whose queue to list. Omitted = the requester's own account. A requester without administrative standing may name only itself."
|
|
87
|
+
},
|
|
88
|
+
"queue": {
|
|
89
|
+
"$ref": "#/$defs/Queue"
|
|
90
|
+
},
|
|
91
|
+
"peer": {
|
|
92
|
+
"$ref": "#/$defs/Vid",
|
|
93
|
+
"description": "Only messages exchanged with this counterparty."
|
|
94
|
+
},
|
|
95
|
+
"cursor": {
|
|
96
|
+
"type": "string",
|
|
97
|
+
"minLength": 1,
|
|
98
|
+
"description": "Opaque continuation token from a prior page's nextCursor. Echoed verbatim; treated as unstructured by the requester."
|
|
99
|
+
},
|
|
100
|
+
"limit": {
|
|
101
|
+
"type": "integer",
|
|
102
|
+
"minimum": 1,
|
|
103
|
+
"maximum": 500,
|
|
104
|
+
"description": "Maximum messages per page. The mediator chooses a default when omitted."
|
|
105
|
+
},
|
|
106
|
+
"ext": {
|
|
107
|
+
"$ref": "#/$defs/Ext",
|
|
108
|
+
"description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"$defs": {
|
|
112
|
+
"Response": {
|
|
113
|
+
"$anchor": "response",
|
|
114
|
+
"title": "Messaging — List Messages — response payload",
|
|
115
|
+
"description": "The success response to a messaging/message/list request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/messaging/message/list/0.1#response.",
|
|
116
|
+
"type": "object",
|
|
117
|
+
"additionalProperties": false,
|
|
118
|
+
"properties": {
|
|
119
|
+
"messages": {
|
|
120
|
+
"type": "array",
|
|
121
|
+
"items": {
|
|
122
|
+
"$ref": "#/$defs/MessageMeta"
|
|
123
|
+
},
|
|
124
|
+
"description": "The page, oldest first."
|
|
125
|
+
},
|
|
126
|
+
"nextCursor": {
|
|
127
|
+
"type": "string",
|
|
128
|
+
"minLength": 1,
|
|
129
|
+
"description": "Opaque continuation token. Present only when further items remain beyond this page; omitted on the final page."
|
|
130
|
+
},
|
|
131
|
+
"ext": {
|
|
132
|
+
"$ref": "#/$defs/Ext",
|
|
133
|
+
"description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"required": [
|
|
137
|
+
"messages"
|
|
138
|
+
]
|
|
139
|
+
},
|
|
140
|
+
"Ext": {
|
|
141
|
+
"title": "Ext",
|
|
142
|
+
"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.",
|
|
143
|
+
"type": "object",
|
|
144
|
+
"minProperties": 1,
|
|
145
|
+
"additionalProperties": true,
|
|
146
|
+
"propertyNames": {
|
|
147
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"MessageMeta": {
|
|
151
|
+
"title": "MessageMeta",
|
|
152
|
+
"type": "object",
|
|
153
|
+
"additionalProperties": false,
|
|
154
|
+
"required": [
|
|
155
|
+
"msgId",
|
|
156
|
+
"queue",
|
|
157
|
+
"size",
|
|
158
|
+
"receivedAt"
|
|
159
|
+
],
|
|
160
|
+
"description": "Metadata of one stored message. Never carries the message body.",
|
|
161
|
+
"properties": {
|
|
162
|
+
"msgId": {
|
|
163
|
+
"type": "string",
|
|
164
|
+
"minLength": 1,
|
|
165
|
+
"description": "The mediator's identifier for the stored message; the handle messaging/message/get and messaging/message/delete accept.",
|
|
166
|
+
"maxLength": 256
|
|
167
|
+
},
|
|
168
|
+
"queue": {
|
|
169
|
+
"$ref": "#/$defs/Queue"
|
|
170
|
+
},
|
|
171
|
+
"size": {
|
|
172
|
+
"type": "integer",
|
|
173
|
+
"minimum": 0,
|
|
174
|
+
"description": "Stored size in bytes."
|
|
175
|
+
},
|
|
176
|
+
"receivedAt": {
|
|
177
|
+
"type": "string",
|
|
178
|
+
"format": "date-time",
|
|
179
|
+
"description": "When the mediator stored the message."
|
|
180
|
+
},
|
|
181
|
+
"expiresAt": {
|
|
182
|
+
"type": "string",
|
|
183
|
+
"format": "date-time",
|
|
184
|
+
"description": "When the mediator will expire the message if it is not deleted first."
|
|
185
|
+
},
|
|
186
|
+
"from": {
|
|
187
|
+
"$ref": "#/$defs/Vid",
|
|
188
|
+
"description": "The sender, where the mediator knows it. Absent for anonymous messages."
|
|
189
|
+
},
|
|
190
|
+
"to": {
|
|
191
|
+
"$ref": "#/$defs/Vid",
|
|
192
|
+
"description": "The recipient account."
|
|
193
|
+
},
|
|
194
|
+
"protocol": {
|
|
195
|
+
"$ref": "#/$defs/WireProtocol"
|
|
196
|
+
},
|
|
197
|
+
"deliveryState": {
|
|
198
|
+
"$ref": "#/$defs/DeliveryState"
|
|
199
|
+
},
|
|
200
|
+
"deliveredAt": {
|
|
201
|
+
"type": "string",
|
|
202
|
+
"format": "date-time",
|
|
203
|
+
"description": "When the message was first handed to the recipient. Present only when deliveryState is `delivered`."
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
"DeliveryState": {
|
|
208
|
+
"title": "DeliveryState",
|
|
209
|
+
"type": "string",
|
|
210
|
+
"enum": [
|
|
211
|
+
"queued",
|
|
212
|
+
"delivered"
|
|
213
|
+
],
|
|
214
|
+
"description": "`queued`: stored and not yet handed to the recipient. `delivered`: handed to the recipient (pickup or live stream) but not yet deleted by it — the recipient has not acknowledged it."
|
|
215
|
+
},
|
|
216
|
+
"WireProtocol": {
|
|
217
|
+
"title": "WireProtocol",
|
|
218
|
+
"type": "string",
|
|
219
|
+
"enum": [
|
|
220
|
+
"didcomm",
|
|
221
|
+
"didcommV1",
|
|
222
|
+
"tsp",
|
|
223
|
+
"other"
|
|
224
|
+
],
|
|
225
|
+
"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."
|
|
226
|
+
},
|
|
227
|
+
"Queue": {
|
|
228
|
+
"title": "Queue",
|
|
229
|
+
"type": "string",
|
|
230
|
+
"enum": [
|
|
231
|
+
"receive",
|
|
232
|
+
"send"
|
|
233
|
+
],
|
|
234
|
+
"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."
|
|
235
|
+
},
|
|
236
|
+
"Vid": {
|
|
237
|
+
"title": "Vid",
|
|
238
|
+
"type": "string",
|
|
239
|
+
"minLength": 1,
|
|
240
|
+
"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."
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
} as const;
|
|
244
|
+
|
|
245
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
246
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
247
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
248
|
+
"$ref": "#/$defs/Response",
|
|
249
|
+
"$defs": {
|
|
250
|
+
"Response": {
|
|
251
|
+
"$anchor": "response",
|
|
252
|
+
"title": "Messaging — List Messages — response payload",
|
|
253
|
+
"description": "The success response to a messaging/message/list request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/messaging/message/list/0.1#response.",
|
|
254
|
+
"type": "object",
|
|
255
|
+
"additionalProperties": false,
|
|
256
|
+
"properties": {
|
|
257
|
+
"messages": {
|
|
258
|
+
"type": "array",
|
|
259
|
+
"items": {
|
|
260
|
+
"$ref": "#/$defs/MessageMeta"
|
|
261
|
+
},
|
|
262
|
+
"description": "The page, oldest first."
|
|
263
|
+
},
|
|
264
|
+
"nextCursor": {
|
|
265
|
+
"type": "string",
|
|
266
|
+
"minLength": 1,
|
|
267
|
+
"description": "Opaque continuation token. Present only when further items remain beyond this page; omitted on the final page."
|
|
268
|
+
},
|
|
269
|
+
"ext": {
|
|
270
|
+
"$ref": "#/$defs/Ext",
|
|
271
|
+
"description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
"required": [
|
|
275
|
+
"messages"
|
|
276
|
+
]
|
|
277
|
+
},
|
|
278
|
+
"Ext": {
|
|
279
|
+
"title": "Ext",
|
|
280
|
+
"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.",
|
|
281
|
+
"type": "object",
|
|
282
|
+
"minProperties": 1,
|
|
283
|
+
"additionalProperties": true,
|
|
284
|
+
"propertyNames": {
|
|
285
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
"MessageMeta": {
|
|
289
|
+
"title": "MessageMeta",
|
|
290
|
+
"type": "object",
|
|
291
|
+
"additionalProperties": false,
|
|
292
|
+
"required": [
|
|
293
|
+
"msgId",
|
|
294
|
+
"queue",
|
|
295
|
+
"size",
|
|
296
|
+
"receivedAt"
|
|
297
|
+
],
|
|
298
|
+
"description": "Metadata of one stored message. Never carries the message body.",
|
|
299
|
+
"properties": {
|
|
300
|
+
"msgId": {
|
|
301
|
+
"type": "string",
|
|
302
|
+
"minLength": 1,
|
|
303
|
+
"description": "The mediator's identifier for the stored message; the handle messaging/message/get and messaging/message/delete accept.",
|
|
304
|
+
"maxLength": 256
|
|
305
|
+
},
|
|
306
|
+
"queue": {
|
|
307
|
+
"$ref": "#/$defs/Queue"
|
|
308
|
+
},
|
|
309
|
+
"size": {
|
|
310
|
+
"type": "integer",
|
|
311
|
+
"minimum": 0,
|
|
312
|
+
"description": "Stored size in bytes."
|
|
313
|
+
},
|
|
314
|
+
"receivedAt": {
|
|
315
|
+
"type": "string",
|
|
316
|
+
"format": "date-time",
|
|
317
|
+
"description": "When the mediator stored the message."
|
|
318
|
+
},
|
|
319
|
+
"expiresAt": {
|
|
320
|
+
"type": "string",
|
|
321
|
+
"format": "date-time",
|
|
322
|
+
"description": "When the mediator will expire the message if it is not deleted first."
|
|
323
|
+
},
|
|
324
|
+
"from": {
|
|
325
|
+
"$ref": "#/$defs/Vid",
|
|
326
|
+
"description": "The sender, where the mediator knows it. Absent for anonymous messages."
|
|
327
|
+
},
|
|
328
|
+
"to": {
|
|
329
|
+
"$ref": "#/$defs/Vid",
|
|
330
|
+
"description": "The recipient account."
|
|
331
|
+
},
|
|
332
|
+
"protocol": {
|
|
333
|
+
"$ref": "#/$defs/WireProtocol"
|
|
334
|
+
},
|
|
335
|
+
"deliveryState": {
|
|
336
|
+
"$ref": "#/$defs/DeliveryState"
|
|
337
|
+
},
|
|
338
|
+
"deliveredAt": {
|
|
339
|
+
"type": "string",
|
|
340
|
+
"format": "date-time",
|
|
341
|
+
"description": "When the message was first handed to the recipient. Present only when deliveryState is `delivered`."
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
"DeliveryState": {
|
|
346
|
+
"title": "DeliveryState",
|
|
347
|
+
"type": "string",
|
|
348
|
+
"enum": [
|
|
349
|
+
"queued",
|
|
350
|
+
"delivered"
|
|
351
|
+
],
|
|
352
|
+
"description": "`queued`: stored and not yet handed to the recipient. `delivered`: handed to the recipient (pickup or live stream) but not yet deleted by it — the recipient has not acknowledged it."
|
|
353
|
+
},
|
|
354
|
+
"WireProtocol": {
|
|
355
|
+
"title": "WireProtocol",
|
|
356
|
+
"type": "string",
|
|
357
|
+
"enum": [
|
|
358
|
+
"didcomm",
|
|
359
|
+
"didcommV1",
|
|
360
|
+
"tsp",
|
|
361
|
+
"other"
|
|
362
|
+
],
|
|
363
|
+
"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."
|
|
364
|
+
},
|
|
365
|
+
"Queue": {
|
|
366
|
+
"title": "Queue",
|
|
367
|
+
"type": "string",
|
|
368
|
+
"enum": [
|
|
369
|
+
"receive",
|
|
370
|
+
"send"
|
|
371
|
+
],
|
|
372
|
+
"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."
|
|
373
|
+
},
|
|
374
|
+
"Vid": {
|
|
375
|
+
"title": "Vid",
|
|
376
|
+
"type": "string",
|
|
377
|
+
"minLength": 1,
|
|
378
|
+
"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."
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
} as const;
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
385
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
386
|
+
* per-specification and cannot be derived from the document alone, and
|
|
387
|
+
* item 2 needs the schema this carries.
|
|
388
|
+
*/
|
|
389
|
+
export const SPEC = {
|
|
390
|
+
typeUri: TYPE_URI,
|
|
391
|
+
isBearer: false,
|
|
392
|
+
isProofRequired: true,
|
|
393
|
+
isRecipientRequired: true,
|
|
394
|
+
isIssuedAtRequired: true,
|
|
395
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
396
|
+
} as const;
|
|
397
|
+
|
|
398
|
+
/**
|
|
399
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
400
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
401
|
+
* parties (§7.3 item 5).
|
|
402
|
+
*/
|
|
403
|
+
export const RESPONSE_SPEC = {
|
|
404
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
405
|
+
isBearer: false,
|
|
406
|
+
isProofRequired: false,
|
|
407
|
+
isRecipientRequired: true,
|
|
408
|
+
isIssuedAtRequired: true,
|
|
409
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
410
|
+
} as const;
|
|
@@ -0,0 +1,267 @@
|
|
|
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
|
+
|
|
6
|
+
import type { Ext, MonitorEvent, TrafficChannel, TrafficDirection, TrafficOutcome, TrafficStage, Vid, WireProtocol } from "../../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export interface MessagingTrafficMonitorEventPayload {
|
|
10
|
+
subscriptionId: string;
|
|
11
|
+
/**
|
|
12
|
+
* Batch sequence number, starting at 1 and increasing by exactly 1 per batch within a subscription. A gap means batches were lost in transit.
|
|
13
|
+
*/
|
|
14
|
+
seq: number;
|
|
15
|
+
/**
|
|
16
|
+
* Events in the order the mediator observed them. May be empty on a heartbeat batch.
|
|
17
|
+
*
|
|
18
|
+
* @maxItems 500
|
|
19
|
+
*/
|
|
20
|
+
events: MonitorEvent[];
|
|
21
|
+
/**
|
|
22
|
+
* Events that matched the filter but were discarded since the previous batch — rate ceiling exceeded or subscriber not connected.
|
|
23
|
+
*/
|
|
24
|
+
dropped: number;
|
|
25
|
+
/**
|
|
26
|
+
* The subscription's current expiry, so the subscriber can renew before it lapses.
|
|
27
|
+
*/
|
|
28
|
+
expiresAt: string;
|
|
29
|
+
/**
|
|
30
|
+
* Ecosystem-defined extension members per SPEC.md §4.5.1.
|
|
31
|
+
*/
|
|
32
|
+
ext?: Ext;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
36
|
+
export type { Ext, MonitorEvent, TrafficChannel, TrafficDirection, TrafficOutcome, TrafficStage, Vid, WireProtocol };
|
|
37
|
+
|
|
38
|
+
/** Trust Task type URI. */
|
|
39
|
+
export const TYPE_URI = "https://trusttasks.org/spec/messaging/monitor/event/0.1" as const;
|
|
40
|
+
|
|
41
|
+
/** Stable alias for this specification's request payload shape. */
|
|
42
|
+
export type Payload = MessagingTrafficMonitorEventPayload;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* This specification's payload schema, as a value.
|
|
46
|
+
*
|
|
47
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
48
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
49
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
50
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
51
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
52
|
+
*/
|
|
53
|
+
export const PAYLOAD_SCHEMA = {
|
|
54
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
55
|
+
"$id": "https://trusttasks.org/spec/messaging/monitor/event/0.1",
|
|
56
|
+
"title": "Messaging — Traffic Monitor Event — payload",
|
|
57
|
+
"type": "object",
|
|
58
|
+
"additionalProperties": false,
|
|
59
|
+
"required": [
|
|
60
|
+
"subscriptionId",
|
|
61
|
+
"seq",
|
|
62
|
+
"events",
|
|
63
|
+
"dropped",
|
|
64
|
+
"expiresAt"
|
|
65
|
+
],
|
|
66
|
+
"properties": {
|
|
67
|
+
"subscriptionId": {
|
|
68
|
+
"type": "string",
|
|
69
|
+
"minLength": 1
|
|
70
|
+
},
|
|
71
|
+
"seq": {
|
|
72
|
+
"type": "integer",
|
|
73
|
+
"minimum": 1,
|
|
74
|
+
"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."
|
|
75
|
+
},
|
|
76
|
+
"events": {
|
|
77
|
+
"type": "array",
|
|
78
|
+
"maxItems": 500,
|
|
79
|
+
"items": {
|
|
80
|
+
"$ref": "#/$defs/MonitorEvent"
|
|
81
|
+
},
|
|
82
|
+
"description": "Events in the order the mediator observed them. May be empty on a heartbeat batch."
|
|
83
|
+
},
|
|
84
|
+
"dropped": {
|
|
85
|
+
"type": "integer",
|
|
86
|
+
"minimum": 0,
|
|
87
|
+
"description": "Events that matched the filter but were discarded since the previous batch — rate ceiling exceeded or subscriber not connected."
|
|
88
|
+
},
|
|
89
|
+
"expiresAt": {
|
|
90
|
+
"type": "string",
|
|
91
|
+
"format": "date-time",
|
|
92
|
+
"description": "The subscription's current expiry, so the subscriber can renew before it lapses."
|
|
93
|
+
},
|
|
94
|
+
"ext": {
|
|
95
|
+
"$ref": "#/$defs/Ext",
|
|
96
|
+
"description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"$defs": {
|
|
100
|
+
"Ext": {
|
|
101
|
+
"title": "Ext",
|
|
102
|
+
"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.",
|
|
103
|
+
"type": "object",
|
|
104
|
+
"minProperties": 1,
|
|
105
|
+
"additionalProperties": true,
|
|
106
|
+
"propertyNames": {
|
|
107
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"MonitorEvent": {
|
|
111
|
+
"title": "MonitorEvent",
|
|
112
|
+
"type": "object",
|
|
113
|
+
"additionalProperties": false,
|
|
114
|
+
"required": [
|
|
115
|
+
"at",
|
|
116
|
+
"direction",
|
|
117
|
+
"stage",
|
|
118
|
+
"channel",
|
|
119
|
+
"protocol"
|
|
120
|
+
],
|
|
121
|
+
"description": "One observed step in the life of one message at the mediator. Carries metadata only — never a message body.",
|
|
122
|
+
"properties": {
|
|
123
|
+
"at": {
|
|
124
|
+
"type": "string",
|
|
125
|
+
"format": "date-time",
|
|
126
|
+
"description": "When the step happened, with sub-second precision where the mediator has it."
|
|
127
|
+
},
|
|
128
|
+
"direction": {
|
|
129
|
+
"$ref": "#/$defs/TrafficDirection"
|
|
130
|
+
},
|
|
131
|
+
"stage": {
|
|
132
|
+
"$ref": "#/$defs/TrafficStage"
|
|
133
|
+
},
|
|
134
|
+
"channel": {
|
|
135
|
+
"$ref": "#/$defs/TrafficChannel"
|
|
136
|
+
},
|
|
137
|
+
"protocol": {
|
|
138
|
+
"$ref": "#/$defs/WireProtocol"
|
|
139
|
+
},
|
|
140
|
+
"msgId": {
|
|
141
|
+
"type": "string",
|
|
142
|
+
"minLength": 1,
|
|
143
|
+
"description": "The stored message's identifier, once it has one; correlates the events of one message and matches MessageMeta.msgId.",
|
|
144
|
+
"maxLength": 256
|
|
145
|
+
},
|
|
146
|
+
"from": {
|
|
147
|
+
"$ref": "#/$defs/Vid",
|
|
148
|
+
"description": "The sender, where the mediator knows it."
|
|
149
|
+
},
|
|
150
|
+
"to": {
|
|
151
|
+
"$ref": "#/$defs/Vid",
|
|
152
|
+
"description": "The recipient, where the mediator knows it."
|
|
153
|
+
},
|
|
154
|
+
"size": {
|
|
155
|
+
"type": "integer",
|
|
156
|
+
"minimum": 0,
|
|
157
|
+
"description": "Frame size in bytes."
|
|
158
|
+
},
|
|
159
|
+
"messageType": {
|
|
160
|
+
"type": "string",
|
|
161
|
+
"minLength": 1,
|
|
162
|
+
"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.",
|
|
163
|
+
"maxLength": 512
|
|
164
|
+
},
|
|
165
|
+
"outcome": {
|
|
166
|
+
"$ref": "#/$defs/TrafficOutcome",
|
|
167
|
+
"description": "Present when stage is `refused`, and on any other stage that failed."
|
|
168
|
+
},
|
|
169
|
+
"latencyMs": {
|
|
170
|
+
"type": "integer",
|
|
171
|
+
"minimum": 0,
|
|
172
|
+
"description": "For `delivered` and `forwarded`: milliseconds since the message was stored."
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
"TrafficOutcome": {
|
|
177
|
+
"title": "TrafficOutcome",
|
|
178
|
+
"type": "object",
|
|
179
|
+
"additionalProperties": false,
|
|
180
|
+
"required": [
|
|
181
|
+
"code"
|
|
182
|
+
],
|
|
183
|
+
"description": "Why a frame was refused or failed.",
|
|
184
|
+
"properties": {
|
|
185
|
+
"code": {
|
|
186
|
+
"type": "string",
|
|
187
|
+
"minLength": 1,
|
|
188
|
+
"description": "The stable error code the mediator returned to the sender (a trust-task-error or problem-report code).",
|
|
189
|
+
"maxLength": 256
|
|
190
|
+
},
|
|
191
|
+
"detail": {
|
|
192
|
+
"type": "string",
|
|
193
|
+
"description": "Short human-readable explanation. Not machine-parsed.",
|
|
194
|
+
"maxLength": 1024
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
"WireProtocol": {
|
|
199
|
+
"title": "WireProtocol",
|
|
200
|
+
"type": "string",
|
|
201
|
+
"enum": [
|
|
202
|
+
"didcomm",
|
|
203
|
+
"didcommV1",
|
|
204
|
+
"tsp",
|
|
205
|
+
"other"
|
|
206
|
+
],
|
|
207
|
+
"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."
|
|
208
|
+
},
|
|
209
|
+
"TrafficChannel": {
|
|
210
|
+
"title": "TrafficChannel",
|
|
211
|
+
"type": "string",
|
|
212
|
+
"enum": [
|
|
213
|
+
"websocket",
|
|
214
|
+
"rest",
|
|
215
|
+
"peerMediator",
|
|
216
|
+
"internal"
|
|
217
|
+
],
|
|
218
|
+
"description": "How the traffic reached or left the mediator. `peerMediator` is mediator-to-mediator forwarding."
|
|
219
|
+
},
|
|
220
|
+
"TrafficStage": {
|
|
221
|
+
"title": "TrafficStage",
|
|
222
|
+
"type": "string",
|
|
223
|
+
"enum": [
|
|
224
|
+
"received",
|
|
225
|
+
"stored",
|
|
226
|
+
"delivered",
|
|
227
|
+
"forwarded",
|
|
228
|
+
"refused",
|
|
229
|
+
"deleted",
|
|
230
|
+
"expired",
|
|
231
|
+
"purged"
|
|
232
|
+
],
|
|
233
|
+
"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."
|
|
234
|
+
},
|
|
235
|
+
"TrafficDirection": {
|
|
236
|
+
"title": "TrafficDirection",
|
|
237
|
+
"type": "string",
|
|
238
|
+
"enum": [
|
|
239
|
+
"inbound",
|
|
240
|
+
"outbound",
|
|
241
|
+
"internal"
|
|
242
|
+
],
|
|
243
|
+
"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)."
|
|
244
|
+
},
|
|
245
|
+
"Vid": {
|
|
246
|
+
"title": "Vid",
|
|
247
|
+
"type": "string",
|
|
248
|
+
"minLength": 1,
|
|
249
|
+
"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."
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
} as const;
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
256
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
257
|
+
* per-specification and cannot be derived from the document alone, and
|
|
258
|
+
* item 2 needs the schema this carries.
|
|
259
|
+
*/
|
|
260
|
+
export const SPEC = {
|
|
261
|
+
typeUri: TYPE_URI,
|
|
262
|
+
isBearer: false,
|
|
263
|
+
isProofRequired: false,
|
|
264
|
+
isRecipientRequired: true,
|
|
265
|
+
isIssuedAtRequired: true,
|
|
266
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
267
|
+
} as const;
|