@openvtc/trust-tasks 0.16.2 → 0.16.4

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 (52) hide show
  1. package/CHANGELOG.md +76 -0
  2. package/dist/consent/approve-request/0.1/payload.d.ts +267 -0
  3. package/dist/consent/approve-request/0.1/payload.d.ts.map +1 -0
  4. package/dist/consent/approve-request/0.1/payload.js +138 -0
  5. package/dist/consent/approve-request/0.1/payload.js.map +1 -0
  6. package/dist/index.d.ts +9 -0
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +9 -0
  9. package/dist/index.js.map +1 -1
  10. package/dist/vault/credentials/archive/0.1/payload.d.ts +297 -0
  11. package/dist/vault/credentials/archive/0.1/payload.d.ts.map +1 -0
  12. package/dist/vault/credentials/archive/0.1/payload.js +171 -0
  13. package/dist/vault/credentials/archive/0.1/payload.js.map +1 -0
  14. package/dist/vault/credentials/delete/0.1/payload.d.ts +333 -0
  15. package/dist/vault/credentials/delete/0.1/payload.d.ts.map +1 -0
  16. package/dist/vault/credentials/delete/0.1/payload.js +185 -0
  17. package/dist/vault/credentials/delete/0.1/payload.js.map +1 -0
  18. package/dist/vault/credentials/get/0.1/payload.d.ts +244 -0
  19. package/dist/vault/credentials/get/0.1/payload.d.ts.map +1 -0
  20. package/dist/vault/credentials/get/0.1/payload.js +137 -0
  21. package/dist/vault/credentials/get/0.1/payload.js.map +1 -0
  22. package/dist/vault/credentials/purge/0.1/payload.d.ts +297 -0
  23. package/dist/vault/credentials/purge/0.1/payload.d.ts.map +1 -0
  24. package/dist/vault/credentials/purge/0.1/payload.js +171 -0
  25. package/dist/vault/credentials/purge/0.1/payload.js.map +1 -0
  26. package/dist/vault/credentials/query/0.1/payload.d.ts +689 -0
  27. package/dist/vault/credentials/query/0.1/payload.d.ts.map +1 -0
  28. package/dist/vault/credentials/query/0.1/payload.js +350 -0
  29. package/dist/vault/credentials/query/0.1/payload.js.map +1 -0
  30. package/dist/vault/credentials/receive/0.1/payload.d.ts +414 -0
  31. package/dist/vault/credentials/receive/0.1/payload.d.ts.map +1 -0
  32. package/dist/vault/credentials/receive/0.1/payload.js +226 -0
  33. package/dist/vault/credentials/receive/0.1/payload.js.map +1 -0
  34. package/dist/vault/credentials/restore/0.1/payload.d.ts +297 -0
  35. package/dist/vault/credentials/restore/0.1/payload.d.ts.map +1 -0
  36. package/dist/vault/credentials/restore/0.1/payload.js +171 -0
  37. package/dist/vault/credentials/restore/0.1/payload.js.map +1 -0
  38. package/dist/vault/credentials/unarchive/0.1/payload.d.ts +297 -0
  39. package/dist/vault/credentials/unarchive/0.1/payload.d.ts.map +1 -0
  40. package/dist/vault/credentials/unarchive/0.1/payload.js +171 -0
  41. package/dist/vault/credentials/unarchive/0.1/payload.js.map +1 -0
  42. package/package.json +1 -1
  43. package/src/consent/approve-request/0.1/payload.ts +200 -0
  44. package/src/index.ts +9 -0
  45. package/src/vault/credentials/archive/0.1/payload.ts +217 -0
  46. package/src/vault/credentials/delete/0.1/payload.ts +239 -0
  47. package/src/vault/credentials/get/0.1/payload.ts +178 -0
  48. package/src/vault/credentials/purge/0.1/payload.ts +217 -0
  49. package/src/vault/credentials/query/0.1/payload.ts +459 -0
  50. package/src/vault/credentials/receive/0.1/payload.ts +298 -0
  51. package/src/vault/credentials/restore/0.1/payload.ts +217 -0
  52. package/src/vault/credentials/unarchive/0.1/payload.ts +217 -0
@@ -0,0 +1,459 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vault/credentials/query/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { Ext } from "../../../../_shared/components.js";
7
+
8
+
9
+ export type Did = string;
10
+ /**
11
+ * Semantic classification. `invite`, `membership`, `role`, `endorsement` and `personhood` are defined; a maintainer MAY use another token.
12
+ */
13
+ export type CredentialPurpose = string;
14
+ /**
15
+ * Validity, driven by the credential's own window and by status-list checks. Orthogonal to lifecycle.
16
+ */
17
+ export type CredentialStatus = "valid" | "expired" | "revoked" | "unknown";
18
+
19
+ /**
20
+ * A filtered, body-free search over stored credentials. At least one of `type`, `communityDid`, `issuerDid`, `purpose` or `status` MUST be present — see the specification; `includeArchived` and `includeDeleted` are modifiers and do not satisfy that requirement.
21
+ */
22
+ export interface VaultCredentialsQuery {
23
+ /**
24
+ * Match credentials carrying this VC `type` tag.
25
+ */
26
+ type?: string;
27
+ /**
28
+ * Match credentials held for this community or context DID.
29
+ */
30
+ communityDid?: string;
31
+ /**
32
+ * Match credentials issued by this DID.
33
+ */
34
+ issuerDid?: string;
35
+ /**
36
+ * Match the maintainer's semantic classification of the credential.
37
+ */
38
+ purpose?: string;
39
+ /**
40
+ * Match the validity dimension.
41
+ */
42
+ status?: "valid" | "expired" | "revoked" | "unknown";
43
+ /**
44
+ * Modifier, not a filter: also return archived credentials matching the other constraints. Absent means false.
45
+ */
46
+ includeArchived?: boolean;
47
+ /**
48
+ * Modifier, not a filter: also return soft-deleted tombstones matching the other constraints. Absent means false.
49
+ */
50
+ includeDeleted?: boolean;
51
+ /**
52
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
53
+ */
54
+ ext?: Ext;
55
+ }
56
+ export interface VaultCredentialsQueryResponsePayload {
57
+ /**
58
+ * Matching descriptors. Empty when nothing matched — a successful answer, not an error.
59
+ */
60
+ credentials: CredentialDescriptor[];
61
+ /**
62
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
63
+ */
64
+ ext?: Ext;
65
+ }
66
+ /**
67
+ * A body-free projection of a stored credential. Carries no claim content by construction.
68
+ */
69
+ export interface CredentialDescriptor {
70
+ /**
71
+ * Local handle. Opaque to the consumer; the id `get`, `archive`, `delete` and the rest are keyed on.
72
+ */
73
+ id: string;
74
+ /**
75
+ * VC `type` tags carried by the credential.
76
+ */
77
+ types: string[];
78
+ issuerDid?: Did;
79
+ purpose?: CredentialPurpose;
80
+ status: CredentialStatus;
81
+ /**
82
+ * Omitted for active credentials, so an active-only result is unchanged by this member's existence.
83
+ */
84
+ lifecycle?: "active" | "archived" | "deleted";
85
+ validFrom?: string;
86
+ validUntil?: string;
87
+ /**
88
+ * Present iff `lifecycle` is `archived`.
89
+ */
90
+ archivedAt?: string;
91
+ /**
92
+ * Present iff `lifecycle` is `deleted`.
93
+ */
94
+ deletedAt?: string;
95
+ /**
96
+ * Present iff `lifecycle` is `deleted`. Restorable while now < graceUntil.
97
+ */
98
+ graceUntil?: string;
99
+ }
100
+
101
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
102
+ export type { Ext };
103
+
104
+ /** Trust Task type URI. */
105
+ export const TYPE_URI = "https://trusttasks.org/spec/vault/credentials/query/0.1" as const;
106
+
107
+ /** Stable alias for this specification's request payload shape. */
108
+ export type Payload = VaultCredentialsQuery;
109
+
110
+ /** Trust Task response type URI (request type URI + "#response"). */
111
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vault/credentials/query/0.1#response" as const;
112
+
113
+ /** Stable alias for this specification's success-response payload shape. */
114
+ export type Response = VaultCredentialsQueryResponsePayload;
115
+
116
+ /**
117
+ * This specification's payload schema, as a value.
118
+ *
119
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
120
+ * rather than only as a `.json` file because TypeScript types are erased
121
+ * at runtime: without a schema a consumer has nothing to validate, and
122
+ * every REQUIRED payload member is optional in practice. Cross-file
123
+ * `$ref`s are already inlined, so it needs no resolver.
124
+ */
125
+ export const PAYLOAD_SCHEMA = {
126
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
127
+ "$id": "https://trusttasks.org/spec/vault/credentials/query/0.1",
128
+ "title": "Vault Credentials — Query",
129
+ "description": "A filtered, body-free search over stored credentials. At least one of `type`, `communityDid`, `issuerDid`, `purpose` or `status` MUST be present — see the specification; `includeArchived` and `includeDeleted` are modifiers and do not satisfy that requirement.",
130
+ "type": "object",
131
+ "additionalProperties": false,
132
+ "properties": {
133
+ "type": {
134
+ "type": "string",
135
+ "minLength": 1,
136
+ "maxLength": 256,
137
+ "description": "Match credentials carrying this VC `type` tag."
138
+ },
139
+ "communityDid": {
140
+ "$ref": "#/$defs/Did",
141
+ "description": "Match credentials held for this community or context DID."
142
+ },
143
+ "issuerDid": {
144
+ "$ref": "#/$defs/Did",
145
+ "description": "Match credentials issued by this DID."
146
+ },
147
+ "purpose": {
148
+ "$ref": "#/$defs/CredentialPurpose",
149
+ "description": "Match the maintainer's semantic classification of the credential."
150
+ },
151
+ "status": {
152
+ "$ref": "#/$defs/CredentialStatus",
153
+ "description": "Match the validity dimension."
154
+ },
155
+ "includeArchived": {
156
+ "type": "boolean",
157
+ "description": "Modifier, not a filter: also return archived credentials matching the other constraints. Absent means false."
158
+ },
159
+ "includeDeleted": {
160
+ "type": "boolean",
161
+ "description": "Modifier, not a filter: also return soft-deleted tombstones matching the other constraints. Absent means false."
162
+ },
163
+ "ext": {
164
+ "$ref": "#/$defs/Ext",
165
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
166
+ }
167
+ },
168
+ "$defs": {
169
+ "Response": {
170
+ "$anchor": "response",
171
+ "title": "Vault Credentials Query — response payload",
172
+ "type": "object",
173
+ "additionalProperties": false,
174
+ "required": [
175
+ "credentials"
176
+ ],
177
+ "properties": {
178
+ "credentials": {
179
+ "type": "array",
180
+ "items": {
181
+ "$ref": "#/$defs/CredentialDescriptor"
182
+ },
183
+ "description": "Matching descriptors. Empty when nothing matched — a successful answer, not an error."
184
+ },
185
+ "ext": {
186
+ "$ref": "#/$defs/Ext",
187
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
188
+ }
189
+ }
190
+ },
191
+ "CredentialDescriptor": {
192
+ "title": "Credential descriptor",
193
+ "description": "A body-free projection of a stored credential. Carries no claim content by construction.",
194
+ "type": "object",
195
+ "additionalProperties": false,
196
+ "required": [
197
+ "id",
198
+ "types",
199
+ "status"
200
+ ],
201
+ "properties": {
202
+ "id": {
203
+ "type": "string",
204
+ "minLength": 1,
205
+ "maxLength": 256,
206
+ "description": "Local handle. Opaque to the consumer; the id `get`, `archive`, `delete` and the rest are keyed on."
207
+ },
208
+ "types": {
209
+ "type": "array",
210
+ "items": {
211
+ "type": "string",
212
+ "minLength": 1,
213
+ "maxLength": 256
214
+ },
215
+ "description": "VC `type` tags carried by the credential."
216
+ },
217
+ "issuerDid": {
218
+ "$ref": "#/$defs/Did"
219
+ },
220
+ "purpose": {
221
+ "$ref": "#/$defs/CredentialPurpose"
222
+ },
223
+ "status": {
224
+ "$ref": "#/$defs/CredentialStatus"
225
+ },
226
+ "lifecycle": {
227
+ "$ref": "#/$defs/VaultLifecycle",
228
+ "description": "Omitted for active credentials, so an active-only result is unchanged by this member's existence."
229
+ },
230
+ "validFrom": {
231
+ "type": "string",
232
+ "format": "date-time"
233
+ },
234
+ "validUntil": {
235
+ "type": "string",
236
+ "format": "date-time"
237
+ },
238
+ "archivedAt": {
239
+ "type": "string",
240
+ "format": "date-time",
241
+ "description": "Present iff `lifecycle` is `archived`."
242
+ },
243
+ "deletedAt": {
244
+ "type": "string",
245
+ "format": "date-time",
246
+ "description": "Present iff `lifecycle` is `deleted`."
247
+ },
248
+ "graceUntil": {
249
+ "type": "string",
250
+ "format": "date-time",
251
+ "description": "Present iff `lifecycle` is `deleted`. Restorable while now < graceUntil."
252
+ }
253
+ }
254
+ },
255
+ "CredentialStatus": {
256
+ "type": "string",
257
+ "enum": [
258
+ "valid",
259
+ "expired",
260
+ "revoked",
261
+ "unknown"
262
+ ],
263
+ "description": "Validity, driven by the credential's own window and by status-list checks. Orthogonal to lifecycle."
264
+ },
265
+ "CredentialPurpose": {
266
+ "type": "string",
267
+ "minLength": 1,
268
+ "maxLength": 128,
269
+ "description": "Semantic classification. `invite`, `membership`, `role`, `endorsement` and `personhood` are defined; a maintainer MAY use another token."
270
+ },
271
+ "VaultLifecycle": {
272
+ "type": "string",
273
+ "enum": [
274
+ "active",
275
+ "archived",
276
+ "deleted"
277
+ ],
278
+ "description": "Archival state, chosen through this family. Orthogonal to validity."
279
+ },
280
+ "Did": {
281
+ "type": "string",
282
+ "pattern": "^did:[a-z0-9]+:.+$",
283
+ "maxLength": 2048
284
+ },
285
+ "Ext": {
286
+ "title": "Ext",
287
+ "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.",
288
+ "type": "object",
289
+ "minProperties": 1,
290
+ "additionalProperties": true,
291
+ "propertyNames": {
292
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
293
+ }
294
+ }
295
+ }
296
+ } as const;
297
+
298
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
299
+ export const RESPONSE_PAYLOAD_SCHEMA = {
300
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
301
+ "$ref": "#/$defs/Response",
302
+ "$defs": {
303
+ "Response": {
304
+ "$anchor": "response",
305
+ "title": "Vault Credentials Query — response payload",
306
+ "type": "object",
307
+ "additionalProperties": false,
308
+ "required": [
309
+ "credentials"
310
+ ],
311
+ "properties": {
312
+ "credentials": {
313
+ "type": "array",
314
+ "items": {
315
+ "$ref": "#/$defs/CredentialDescriptor"
316
+ },
317
+ "description": "Matching descriptors. Empty when nothing matched — a successful answer, not an error."
318
+ },
319
+ "ext": {
320
+ "$ref": "#/$defs/Ext",
321
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
322
+ }
323
+ }
324
+ },
325
+ "CredentialDescriptor": {
326
+ "title": "Credential descriptor",
327
+ "description": "A body-free projection of a stored credential. Carries no claim content by construction.",
328
+ "type": "object",
329
+ "additionalProperties": false,
330
+ "required": [
331
+ "id",
332
+ "types",
333
+ "status"
334
+ ],
335
+ "properties": {
336
+ "id": {
337
+ "type": "string",
338
+ "minLength": 1,
339
+ "maxLength": 256,
340
+ "description": "Local handle. Opaque to the consumer; the id `get`, `archive`, `delete` and the rest are keyed on."
341
+ },
342
+ "types": {
343
+ "type": "array",
344
+ "items": {
345
+ "type": "string",
346
+ "minLength": 1,
347
+ "maxLength": 256
348
+ },
349
+ "description": "VC `type` tags carried by the credential."
350
+ },
351
+ "issuerDid": {
352
+ "$ref": "#/$defs/Did"
353
+ },
354
+ "purpose": {
355
+ "$ref": "#/$defs/CredentialPurpose"
356
+ },
357
+ "status": {
358
+ "$ref": "#/$defs/CredentialStatus"
359
+ },
360
+ "lifecycle": {
361
+ "$ref": "#/$defs/VaultLifecycle",
362
+ "description": "Omitted for active credentials, so an active-only result is unchanged by this member's existence."
363
+ },
364
+ "validFrom": {
365
+ "type": "string",
366
+ "format": "date-time"
367
+ },
368
+ "validUntil": {
369
+ "type": "string",
370
+ "format": "date-time"
371
+ },
372
+ "archivedAt": {
373
+ "type": "string",
374
+ "format": "date-time",
375
+ "description": "Present iff `lifecycle` is `archived`."
376
+ },
377
+ "deletedAt": {
378
+ "type": "string",
379
+ "format": "date-time",
380
+ "description": "Present iff `lifecycle` is `deleted`."
381
+ },
382
+ "graceUntil": {
383
+ "type": "string",
384
+ "format": "date-time",
385
+ "description": "Present iff `lifecycle` is `deleted`. Restorable while now < graceUntil."
386
+ }
387
+ }
388
+ },
389
+ "CredentialStatus": {
390
+ "type": "string",
391
+ "enum": [
392
+ "valid",
393
+ "expired",
394
+ "revoked",
395
+ "unknown"
396
+ ],
397
+ "description": "Validity, driven by the credential's own window and by status-list checks. Orthogonal to lifecycle."
398
+ },
399
+ "CredentialPurpose": {
400
+ "type": "string",
401
+ "minLength": 1,
402
+ "maxLength": 128,
403
+ "description": "Semantic classification. `invite`, `membership`, `role`, `endorsement` and `personhood` are defined; a maintainer MAY use another token."
404
+ },
405
+ "VaultLifecycle": {
406
+ "type": "string",
407
+ "enum": [
408
+ "active",
409
+ "archived",
410
+ "deleted"
411
+ ],
412
+ "description": "Archival state, chosen through this family. Orthogonal to validity."
413
+ },
414
+ "Did": {
415
+ "type": "string",
416
+ "pattern": "^did:[a-z0-9]+:.+$",
417
+ "maxLength": 2048
418
+ },
419
+ "Ext": {
420
+ "title": "Ext",
421
+ "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.",
422
+ "type": "object",
423
+ "minProperties": 1,
424
+ "additionalProperties": true,
425
+ "propertyNames": {
426
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
427
+ }
428
+ }
429
+ }
430
+ } as const;
431
+
432
+ /**
433
+ * SPEC.md §7.2 policy for the request variant, from this specification's
434
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
435
+ * per-specification and cannot be derived from the document alone, and
436
+ * item 2 needs the schema this carries.
437
+ */
438
+ export const SPEC = {
439
+ typeUri: TYPE_URI,
440
+ isBearer: false,
441
+ isProofRequired: false,
442
+ isRecipientRequired: true,
443
+ isIssuedAtRequired: false,
444
+ payloadSchema: PAYLOAD_SCHEMA,
445
+ } as const;
446
+
447
+ /**
448
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
449
+ * tracks the *issuer* party's requirement because a response swaps the
450
+ * parties (§7.3 item 5).
451
+ */
452
+ export const RESPONSE_SPEC = {
453
+ typeUri: RESPONSE_TYPE_URI,
454
+ isBearer: false,
455
+ isProofRequired: false,
456
+ isRecipientRequired: true,
457
+ isIssuedAtRequired: false,
458
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
459
+ } as const;