@openvtc/trust-tasks 0.28.23 → 0.28.24

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 (100) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/dist/_shared/components.d.ts +520 -0
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/index.d.ts +45 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +45 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/messaging/mux/_shared/0.1/mux.d.ts +16 -0
  9. package/dist/messaging/mux/_shared/0.1/mux.d.ts.map +1 -0
  10. package/dist/messaging/mux/_shared/0.1/mux.js +6 -0
  11. package/dist/messaging/mux/_shared/0.1/mux.js.map +1 -0
  12. package/dist/messaging/mux/attach/0.1/payload.d.ts +996 -0
  13. package/dist/messaging/mux/attach/0.1/payload.d.ts.map +1 -0
  14. package/dist/messaging/mux/attach/0.1/payload.js +594 -0
  15. package/dist/messaging/mux/attach/0.1/payload.js.map +1 -0
  16. package/dist/messaging/mux/detach/0.1/payload.d.ts +398 -0
  17. package/dist/messaging/mux/detach/0.1/payload.d.ts.map +1 -0
  18. package/dist/messaging/mux/detach/0.1/payload.js +215 -0
  19. package/dist/messaging/mux/detach/0.1/payload.js.map +1 -0
  20. package/dist/messaging/mux/event/0.1/payload.d.ts +513 -0
  21. package/dist/messaging/mux/event/0.1/payload.d.ts.map +1 -0
  22. package/dist/messaging/mux/event/0.1/payload.js +260 -0
  23. package/dist/messaging/mux/event/0.1/payload.js.map +1 -0
  24. package/dist/messaging/mux/grant/0.1/payload.d.ts +1008 -0
  25. package/dist/messaging/mux/grant/0.1/payload.d.ts.map +1 -0
  26. package/dist/messaging/mux/grant/0.1/payload.js +606 -0
  27. package/dist/messaging/mux/grant/0.1/payload.js.map +1 -0
  28. package/dist/messaging/mux/list/0.1/payload.d.ts +1241 -0
  29. package/dist/messaging/mux/list/0.1/payload.d.ts.map +1 -0
  30. package/dist/messaging/mux/list/0.1/payload.js +715 -0
  31. package/dist/messaging/mux/list/0.1/payload.js.map +1 -0
  32. package/dist/messaging/mux/notice/0.1/payload.d.ts +489 -0
  33. package/dist/messaging/mux/notice/0.1/payload.d.ts.map +1 -0
  34. package/dist/messaging/mux/notice/0.1/payload.js +249 -0
  35. package/dist/messaging/mux/notice/0.1/payload.js.map +1 -0
  36. package/dist/messaging/mux/revoke/0.1/payload.d.ts +585 -0
  37. package/dist/messaging/mux/revoke/0.1/payload.d.ts.map +1 -0
  38. package/dist/messaging/mux/revoke/0.1/payload.js +311 -0
  39. package/dist/messaging/mux/revoke/0.1/payload.js.map +1 -0
  40. package/dist/messaging/mux/revoke-all/0.1/payload.d.ts +682 -0
  41. package/dist/messaging/mux/revoke-all/0.1/payload.d.ts.map +1 -0
  42. package/dist/messaging/mux/revoke-all/0.1/payload.js +397 -0
  43. package/dist/messaging/mux/revoke-all/0.1/payload.js.map +1 -0
  44. package/dist/messaging/mux/update/0.1/payload.d.ts +995 -0
  45. package/dist/messaging/mux/update/0.1/payload.d.ts.map +1 -0
  46. package/dist/messaging/mux/update/0.1/payload.js +586 -0
  47. package/dist/messaging/mux/update/0.1/payload.js.map +1 -0
  48. package/dist/vta/_shared/0.1/memory-record.d.ts +22 -0
  49. package/dist/vta/_shared/0.1/memory-record.d.ts.map +1 -0
  50. package/dist/vta/_shared/0.1/memory-record.js +6 -0
  51. package/dist/vta/_shared/0.1/memory-record.js.map +1 -0
  52. package/dist/vta/memory/delete/0.1/payload.d.ts +13 -2
  53. package/dist/vta/memory/delete/0.1/payload.d.ts.map +1 -1
  54. package/dist/vta/memory/delete/0.1/payload.js +1 -1
  55. package/dist/vta/memory/delete/0.1/payload.js.map +1 -1
  56. package/dist/vta/memory/delete/0.2/payload.d.ts +415 -0
  57. package/dist/vta/memory/delete/0.2/payload.d.ts.map +1 -0
  58. package/dist/vta/memory/delete/0.2/payload.js +224 -0
  59. package/dist/vta/memory/delete/0.2/payload.js.map +1 -0
  60. package/dist/vta/memory/get/0.1/payload.d.ts +646 -0
  61. package/dist/vta/memory/get/0.1/payload.d.ts.map +1 -0
  62. package/dist/vta/memory/get/0.1/payload.js +349 -0
  63. package/dist/vta/memory/get/0.1/payload.js.map +1 -0
  64. package/dist/vta/memory/list/0.1/payload.d.ts +13 -2
  65. package/dist/vta/memory/list/0.1/payload.d.ts.map +1 -1
  66. package/dist/vta/memory/list/0.1/payload.js +1 -1
  67. package/dist/vta/memory/list/0.1/payload.js.map +1 -1
  68. package/dist/vta/memory/list/0.2/payload.d.ts +693 -0
  69. package/dist/vta/memory/list/0.2/payload.d.ts.map +1 -0
  70. package/dist/vta/memory/list/0.2/payload.js +363 -0
  71. package/dist/vta/memory/list/0.2/payload.js.map +1 -0
  72. package/dist/vta/memory/put/0.1/payload.d.ts +13 -2
  73. package/dist/vta/memory/put/0.1/payload.d.ts.map +1 -1
  74. package/dist/vta/memory/put/0.1/payload.js +1 -1
  75. package/dist/vta/memory/put/0.1/payload.js.map +1 -1
  76. package/dist/vta/memory/put/0.2/payload.d.ts +490 -0
  77. package/dist/vta/memory/put/0.2/payload.d.ts.map +1 -0
  78. package/dist/vta/memory/put/0.2/payload.js +264 -0
  79. package/dist/vta/memory/put/0.2/payload.js.map +1 -0
  80. package/package.json +1 -1
  81. package/src/_shared/components.ts +581 -0
  82. package/src/index.ts +45 -0
  83. package/src/messaging/mux/_shared/0.1/mux.ts +17 -0
  84. package/src/messaging/mux/attach/0.1/payload.ts +682 -0
  85. package/src/messaging/mux/detach/0.1/payload.ts +278 -0
  86. package/src/messaging/mux/event/0.1/payload.ts +371 -0
  87. package/src/messaging/mux/grant/0.1/payload.ts +710 -0
  88. package/src/messaging/mux/list/0.1/payload.ts +793 -0
  89. package/src/messaging/mux/notice/0.1/payload.ts +362 -0
  90. package/src/messaging/mux/revoke/0.1/payload.ts +389 -0
  91. package/src/messaging/mux/revoke-all/0.1/payload.ts +452 -0
  92. package/src/messaging/mux/update/0.1/payload.ts +644 -0
  93. package/src/vta/_shared/0.1/memory-record.ts +23 -0
  94. package/src/vta/memory/delete/0.1/payload.ts +14 -3
  95. package/src/vta/memory/delete/0.2/payload.ts +288 -0
  96. package/src/vta/memory/get/0.1/payload.ts +414 -0
  97. package/src/vta/memory/list/0.1/payload.ts +14 -3
  98. package/src/vta/memory/list/0.2/payload.ts +445 -0
  99. package/src/vta/memory/put/0.1/payload.ts +14 -3
  100. package/src/vta/memory/put/0.2/payload.ts +333 -0
@@ -0,0 +1,362 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/messaging/mux/notice/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { DetachReason, Ext, GrantId, MuxDid } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * A durable notice from a mediator, stored in the recipient's inbox and delivered at least once, about grants the recipient must act on or know of: suspended, revoked, expiring, or present on a member DID. The members present depend on `notice`; see the specification. The outer document members are owned by the framework — SPEC §6.3.
11
+ */
12
+ export interface MessagingMuxNoticePayload {
13
+ /**
14
+ * Which notice this is. Each kind carries the members the specification lists for it, and no others.
15
+ */
16
+ notice: "grantsSuspended" | "grantsRevoked" | "grantsExpiring" | "grantsPresent";
17
+ /**
18
+ * `grantsSuspended` only, REQUIRED: the recipient's grants that were suspended. They must be recreated by a fresh messaging/mux/grant signed by the member DID under its current epoch.
19
+ *
20
+ * @minItems 1
21
+ * @maxItems 256
22
+ */
23
+ suspensions?: [Suspension, ...Suspension[]];
24
+ /**
25
+ * `grantsRevoked` only, REQUIRED: the recipient's grants that were revoked by someone other than the recipient.
26
+ *
27
+ * @minItems 1
28
+ * @maxItems 256
29
+ */
30
+ revocations?: [Revocation, ...Revocation[]];
31
+ /**
32
+ * `grantsExpiring` only, REQUIRED: grants delegated to the recipient that have passed about three quarters of their lifetime.
33
+ *
34
+ * @minItems 1
35
+ * @maxItems 256
36
+ */
37
+ expiring?: [ExpiringGrant, ...ExpiringGrant[]];
38
+ /**
39
+ * `grantsPresent` only, REQUIRED: the member DID the recipient authenticated as.
40
+ */
41
+ did?: MuxDid;
42
+ /**
43
+ * `grantsPresent` only, REQUIRED: grants on the member DID the mediator holds, in every state.
44
+ */
45
+ count?: number;
46
+ /**
47
+ * `grantsPresent` only, REQUIRED: how many of them this authentication just suspended under the unknown-key rule.
48
+ */
49
+ suspended?: number;
50
+ /**
51
+ * `grantsPresent` only, REQUIRED: the member DID's epoch now in force.
52
+ */
53
+ epoch?: number;
54
+ /**
55
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
56
+ */
57
+ ext?: Ext;
58
+ }
59
+ export interface Suspension {
60
+ /**
61
+ * The member DID.
62
+ */
63
+ did: MuxDid;
64
+ /**
65
+ * @minItems 1
66
+ * @maxItems 256
67
+ */
68
+ grantIds: [GrantId, ...GrantId[]];
69
+ /**
70
+ * Why: `suspendedUnknownKey` in this version.
71
+ */
72
+ reason: DetachReason;
73
+ /**
74
+ * When the suspension was committed.
75
+ */
76
+ suspendedAt: string;
77
+ }
78
+ export interface Revocation {
79
+ /**
80
+ * The member DID.
81
+ */
82
+ did: MuxDid;
83
+ /**
84
+ * @minItems 1
85
+ * @maxItems 256
86
+ */
87
+ grantIds: [GrantId, ...GrantId[]];
88
+ /**
89
+ * Why: `revokedByMember`, `epochBumped`, `admin` or `accountRemoved`.
90
+ */
91
+ reason: DetachReason;
92
+ /**
93
+ * When the revocation was committed.
94
+ */
95
+ revokedAt: string;
96
+ }
97
+ export interface ExpiringGrant {
98
+ grantId: GrantId;
99
+ /**
100
+ * The member DID.
101
+ */
102
+ did: MuxDid;
103
+ /**
104
+ * The grant's effective expiry.
105
+ */
106
+ expiresAt: string;
107
+ }
108
+
109
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
110
+ export type { DetachReason, Ext, GrantId, MuxDid };
111
+
112
+ /** Trust Task type URI. */
113
+ export const TYPE_URI = "https://trusttasks.org/spec/messaging/mux/notice/0.1" as const;
114
+
115
+ /**
116
+ * The earlier version of this specification that this one declares it
117
+ * extends (front matter `extends`, SPEC §5.2 "Declared extension"), or
118
+ * `null`. Only the direct declaration — follow the chain with
119
+ * `extendsChain` / `readForSpec`.
120
+ */
121
+ export const EXTENDS: string | null = null;
122
+
123
+ /**
124
+ * Why this version is deprecated, or `null` while it is current. A
125
+ * superseded or retired version is still supported, and is withdrawn from
126
+ * this package in a later scheduled batch (SPEC "Superseded and Withdrawn
127
+ * Versions").
128
+ */
129
+ export const DEPRECATION: string | null = null;
130
+
131
+ /** Stable alias for this specification's request payload shape. */
132
+ export type Payload = MessagingMuxNoticePayload;
133
+
134
+ /**
135
+ * This specification's payload schema, as a value.
136
+ *
137
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
138
+ * rather than only as a `.json` file because TypeScript types are erased
139
+ * at runtime: without a schema a consumer has nothing to validate, and
140
+ * every REQUIRED payload member is optional in practice. Cross-file
141
+ * `$ref`s are already inlined, so it needs no resolver.
142
+ */
143
+ export const PAYLOAD_SCHEMA = {
144
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
145
+ "$id": "https://trusttasks.org/spec/messaging/mux/notice/0.1",
146
+ "title": "Messaging — Mux Notice — payload",
147
+ "description": "A durable notice from a mediator, stored in the recipient's inbox and delivered at least once, about grants the recipient must act on or know of: suspended, revoked, expiring, or present on a member DID. The members present depend on `notice`; see the specification. The outer document members are owned by the framework — SPEC §6.3.",
148
+ "type": "object",
149
+ "additionalProperties": false,
150
+ "required": [
151
+ "notice"
152
+ ],
153
+ "properties": {
154
+ "notice": {
155
+ "type": "string",
156
+ "enum": [
157
+ "grantsSuspended",
158
+ "grantsRevoked",
159
+ "grantsExpiring",
160
+ "grantsPresent"
161
+ ],
162
+ "description": "Which notice this is. Each kind carries the members the specification lists for it, and no others."
163
+ },
164
+ "suspensions": {
165
+ "type": "array",
166
+ "minItems": 1,
167
+ "maxItems": 256,
168
+ "items": {
169
+ "title": "Suspension",
170
+ "type": "object",
171
+ "additionalProperties": false,
172
+ "required": [
173
+ "did",
174
+ "grantIds",
175
+ "reason",
176
+ "suspendedAt"
177
+ ],
178
+ "properties": {
179
+ "did": {
180
+ "$ref": "#/$defs/MuxDid",
181
+ "description": "The member DID."
182
+ },
183
+ "grantIds": {
184
+ "type": "array",
185
+ "minItems": 1,
186
+ "maxItems": 256,
187
+ "uniqueItems": true,
188
+ "items": {
189
+ "$ref": "#/$defs/GrantId"
190
+ }
191
+ },
192
+ "reason": {
193
+ "$ref": "#/$defs/DetachReason",
194
+ "description": "Why: `suspendedUnknownKey` in this version."
195
+ },
196
+ "suspendedAt": {
197
+ "type": "string",
198
+ "format": "date-time",
199
+ "description": "When the suspension was committed."
200
+ }
201
+ }
202
+ },
203
+ "description": "`grantsSuspended` only, REQUIRED: the recipient's grants that were suspended. They must be recreated by a fresh messaging/mux/grant signed by the member DID under its current epoch."
204
+ },
205
+ "revocations": {
206
+ "type": "array",
207
+ "minItems": 1,
208
+ "maxItems": 256,
209
+ "items": {
210
+ "title": "Revocation",
211
+ "type": "object",
212
+ "additionalProperties": false,
213
+ "required": [
214
+ "did",
215
+ "grantIds",
216
+ "reason",
217
+ "revokedAt"
218
+ ],
219
+ "properties": {
220
+ "did": {
221
+ "$ref": "#/$defs/MuxDid",
222
+ "description": "The member DID."
223
+ },
224
+ "grantIds": {
225
+ "type": "array",
226
+ "minItems": 1,
227
+ "maxItems": 256,
228
+ "uniqueItems": true,
229
+ "items": {
230
+ "$ref": "#/$defs/GrantId"
231
+ }
232
+ },
233
+ "reason": {
234
+ "$ref": "#/$defs/DetachReason",
235
+ "description": "Why: `revokedByMember`, `epochBumped`, `admin` or `accountRemoved`."
236
+ },
237
+ "revokedAt": {
238
+ "type": "string",
239
+ "format": "date-time",
240
+ "description": "When the revocation was committed."
241
+ }
242
+ }
243
+ },
244
+ "description": "`grantsRevoked` only, REQUIRED: the recipient's grants that were revoked by someone other than the recipient."
245
+ },
246
+ "expiring": {
247
+ "type": "array",
248
+ "minItems": 1,
249
+ "maxItems": 256,
250
+ "items": {
251
+ "title": "ExpiringGrant",
252
+ "type": "object",
253
+ "additionalProperties": false,
254
+ "required": [
255
+ "grantId",
256
+ "did",
257
+ "expiresAt"
258
+ ],
259
+ "properties": {
260
+ "grantId": {
261
+ "$ref": "#/$defs/GrantId"
262
+ },
263
+ "did": {
264
+ "$ref": "#/$defs/MuxDid",
265
+ "description": "The member DID."
266
+ },
267
+ "expiresAt": {
268
+ "type": "string",
269
+ "format": "date-time",
270
+ "description": "The grant's effective expiry."
271
+ }
272
+ }
273
+ },
274
+ "description": "`grantsExpiring` only, REQUIRED: grants delegated to the recipient that have passed about three quarters of their lifetime."
275
+ },
276
+ "did": {
277
+ "$ref": "#/$defs/MuxDid",
278
+ "description": "`grantsPresent` only, REQUIRED: the member DID the recipient authenticated as."
279
+ },
280
+ "count": {
281
+ "type": "integer",
282
+ "minimum": 0,
283
+ "description": "`grantsPresent` only, REQUIRED: grants on the member DID the mediator holds, in every state."
284
+ },
285
+ "suspended": {
286
+ "type": "integer",
287
+ "minimum": 0,
288
+ "description": "`grantsPresent` only, REQUIRED: how many of them this authentication just suspended under the unknown-key rule."
289
+ },
290
+ "epoch": {
291
+ "type": "integer",
292
+ "minimum": 0,
293
+ "description": "`grantsPresent` only, REQUIRED: the member DID's epoch now in force."
294
+ },
295
+ "ext": {
296
+ "$ref": "#/$defs/Ext",
297
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
298
+ }
299
+ },
300
+ "$defs": {
301
+ "Ext": {
302
+ "title": "Ext",
303
+ "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.",
304
+ "type": "object",
305
+ "minProperties": 1,
306
+ "additionalProperties": true,
307
+ "propertyNames": {
308
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
309
+ }
310
+ },
311
+ "MuxDid": {
312
+ "title": "MuxDid",
313
+ "type": "string",
314
+ "minLength": 7,
315
+ "maxLength": 2048,
316
+ "pattern": "^did:[a-z0-9]+:\\S+$",
317
+ "description": "A DID, carried verbatim and compared by exact string equality. Unlike the messaging family's `Vid`, never a hash: the mediator resolves it to verify a statement signed by it. For a member DID reached over TSP, the TSP VID is the DID itself."
318
+ },
319
+ "GrantId": {
320
+ "title": "GrantId",
321
+ "type": "string",
322
+ "minLength": 1,
323
+ "maxLength": 128,
324
+ "pattern": "^[A-Za-z0-9._:-]+$",
325
+ "description": "A grant's identifier, chosen by the member DID's signer and carried in its grant statement; a UUID is RECOMMENDED. A mediator refuses a grant whose identifier is already on the member DID's record."
326
+ },
327
+ "DetachReason": {
328
+ "title": "DetachReason",
329
+ "type": "string",
330
+ "enum": [
331
+ "revokedByMember",
332
+ "revokedByPrincipal",
333
+ "epochBumped",
334
+ "suspendedUnknownKey",
335
+ "keyRotated",
336
+ "expired",
337
+ "accountBlocked",
338
+ "superseded",
339
+ "admin",
340
+ "detachRequested",
341
+ "accountRemoved",
342
+ "resolutionFailed"
343
+ ],
344
+ "description": "Why a member left a connection, or why a stored grant did not attach on connect. `revokedByMember` / `revokedByPrincipal`: messaging/mux/revoke by that side. `epochBumped`: the member DID ran messaging/mux/revoke-all. `suspendedUnknownKey`: the unknown-key rule suspended the grant. `keyRotated`: the grant's signing key left the member DID's current authentication relationship (grant state `staleKey`). `expired`: the grant or attach reached its effective expiry. `accountBlocked`: the member's account was blocked. `superseded`: the member DID's own direct connection, or a newer connection of the same kind, now receives its live traffic; the member stays on this connection inactive. `admin`: an operator acted. `detachRequested`: the principal removed a session attach with messaging/mux/detach. `accountRemoved`: the member's account, or the principal's, was removed. `resolutionFailed`: the member DID could not be resolved when the grant was re-validated; the grant is not changed and is re-checked later."
345
+ }
346
+ }
347
+ } as const;
348
+
349
+ /**
350
+ * SPEC.md §7.2 policy for the request variant, from this specification's
351
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
352
+ * per-specification and cannot be derived from the document alone, and
353
+ * item 2 needs the schema this carries.
354
+ */
355
+ export const SPEC = {
356
+ typeUri: TYPE_URI,
357
+ isBearer: false,
358
+ isProofRequired: true,
359
+ isRecipientRequired: true,
360
+ isIssuedAtRequired: true,
361
+ payloadSchema: PAYLOAD_SCHEMA,
362
+ } as const;