@openvtc/trust-tasks 0.24.0 → 0.24.2

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 (53) hide show
  1. package/CHANGELOG.md +113 -0
  2. package/dist/_shared/components.d.ts +55 -2
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/device/list/0.1/payload.d.ts +4 -4
  5. package/dist/device/list/0.1/payload.d.ts.map +1 -1
  6. package/dist/device/list/0.1/payload.js +4 -0
  7. package/dist/device/list/0.1/payload.js.map +1 -1
  8. package/dist/device/list/0.2/payload.d.ts +4 -4
  9. package/dist/device/list/0.2/payload.d.ts.map +1 -1
  10. package/dist/device/list/0.2/payload.js +4 -0
  11. package/dist/device/list/0.2/payload.js.map +1 -1
  12. package/dist/device/register/0.1/payload.d.ts +4 -4
  13. package/dist/device/register/0.1/payload.d.ts.map +1 -1
  14. package/dist/device/register/0.1/payload.js +4 -0
  15. package/dist/device/register/0.1/payload.js.map +1 -1
  16. package/dist/device/register/0.2/payload.d.ts +4 -4
  17. package/dist/device/register/0.2/payload.d.ts.map +1 -1
  18. package/dist/device/register/0.2/payload.js +4 -0
  19. package/dist/device/register/0.2/payload.js.map +1 -1
  20. package/dist/index.d.ts +4 -0
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +4 -0
  23. package/dist/index.js.map +1 -1
  24. package/dist/keys/sign-csr/0.1/payload.d.ts +729 -0
  25. package/dist/keys/sign-csr/0.1/payload.d.ts.map +1 -0
  26. package/dist/keys/sign-csr/0.1/payload.js +280 -0
  27. package/dist/keys/sign-csr/0.1/payload.js.map +1 -0
  28. package/dist/keys/sign-jws/0.1/payload.d.ts +352 -0
  29. package/dist/keys/sign-jws/0.1/payload.d.ts.map +1 -0
  30. package/dist/keys/sign-jws/0.1/payload.js +207 -0
  31. package/dist/keys/sign-jws/0.1/payload.js.map +1 -0
  32. package/dist/rooms/_shared/0.1/blobs.d.ts +1 -1
  33. package/dist/rooms/_shared/0.1/blobs.d.ts.map +1 -1
  34. package/dist/vtc/join-requests/wallet-session/start/0.1/payload.d.ts +398 -0
  35. package/dist/vtc/join-requests/wallet-session/start/0.1/payload.d.ts.map +1 -0
  36. package/dist/vtc/join-requests/wallet-session/start/0.1/payload.js +220 -0
  37. package/dist/vtc/join-requests/wallet-session/start/0.1/payload.js.map +1 -0
  38. package/dist/vtc/join-requests/wallet-session/status/0.1/payload.d.ts +655 -0
  39. package/dist/vtc/join-requests/wallet-session/status/0.1/payload.d.ts.map +1 -0
  40. package/dist/vtc/join-requests/wallet-session/status/0.1/payload.js +360 -0
  41. package/dist/vtc/join-requests/wallet-session/status/0.1/payload.js.map +1 -0
  42. package/package.json +1 -1
  43. package/src/_shared/components.ts +57 -0
  44. package/src/device/list/0.1/payload.ts +4 -0
  45. package/src/device/list/0.2/payload.ts +4 -0
  46. package/src/device/register/0.1/payload.ts +4 -0
  47. package/src/device/register/0.2/payload.ts +4 -0
  48. package/src/index.ts +4 -0
  49. package/src/keys/sign-csr/0.1/payload.ts +646 -0
  50. package/src/keys/sign-jws/0.1/payload.ts +271 -0
  51. package/src/rooms/_shared/0.1/blobs.ts +1 -1
  52. package/src/vtc/join-requests/wallet-session/start/0.1/payload.ts +279 -0
  53. package/src/vtc/join-requests/wallet-session/status/0.1/payload.ts +454 -0
@@ -0,0 +1,454 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vtc/join-requests/wallet-session/status/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { Ext } from "../../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * An applicant reads the state of a wallet presentation session they opened with vtc/join-requests/wallet-session/start, and, once a wallet has answered, what the presentation established. The applicant is the document proof's signer. The outer document members are owned by the framework — SPEC §6.3.
11
+ */
12
+ export interface VTCJoinRequestsWalletSessionStatusPayload {
13
+ /**
14
+ * The session to read, as vtc/join-requests/wallet-session/start returned it.
15
+ */
16
+ sessionId: string;
17
+ ext?: Ext;
18
+ }
19
+ export interface VTCJoinRequestsWalletSessionStatusResponsePayload {
20
+ sessionId: string;
21
+ /**
22
+ * `awaitingWallet`: no wallet has fetched the request object. `requestRetrieved`: a wallet has fetched it and not yet answered. `presented`: a wallet answered and the presentation verified; see `evidence`. `refused`: a wallet answered and the community did not accept the answer, or the wallet declined; see `reason`. `expired`: the session closed unanswered.
23
+ */
24
+ state: "awaitingWallet" | "requestRetrieved" | "presented" | "refused" | "expired";
25
+ /**
26
+ * When the session closes, or closed, if unanswered.
27
+ */
28
+ expiresAt: string;
29
+ /**
30
+ * The join request the session's evidence is recorded on. Present when the session was bound to one, or its evidence has since been attached to one by a submission.
31
+ */
32
+ requestId?: string;
33
+ evidence?: Evidence;
34
+ /**
35
+ * Why the session ended `refused`. `presentationInvalid`: the response or a presentation failed verification — decryption, `state`, signature, key binding, nonce or audience. `queryNotSatisfied`: the presentations verified but do not satisfy the query. `issuerNotTrusted`: a credential's issuer is not one the criterion accepts. `statusNotValid`: a credential's status is revoked or suspended, or could not be read. `walletDeclined`: the wallet answered with an OpenID4VP error, such as `access_denied`. Present only when `state` is `refused`.
36
+ */
37
+ reason?: "presentationInvalid" | "queryNotSatisfied" | "issuerNotTrusted" | "statusNotValid" | "walletDeclined";
38
+ ext?: Ext;
39
+ }
40
+ /**
41
+ * Present only when `state` is `presented`.
42
+ */
43
+ export interface Evidence {
44
+ /**
45
+ * Whether the presentation satisfies the criterion's DCQL query. Satisfying the query is not admission: the community still decides the join under the criterion's `admission`.
46
+ */
47
+ satisfied: boolean;
48
+ /**
49
+ * The identifier of the key that held the presented credentials — for an SD-JWT VC, the `did:key` of its `cnf` key. Recorded beside the applicant DID, never as it.
50
+ */
51
+ holder: string;
52
+ /**
53
+ * The credentials presented, one entry each.
54
+ *
55
+ * @minItems 1
56
+ * @maxItems 32
57
+ */
58
+ credentials: [PresentedCredential, ...PresentedCredential[]];
59
+ /**
60
+ * When evidence not yet recorded on a join request is discarded if the applicant has not submitted under the session's criterion. Absent when the evidence is recorded on a request.
61
+ */
62
+ heldUntil?: string;
63
+ }
64
+ /**
65
+ * One credential the wallet presented, described without any of its claim values.
66
+ */
67
+ export interface PresentedCredential {
68
+ /**
69
+ * The `id` of the DCQL credential query this credential was presented for — the key it arrived under in the OpenID4VP `vp_token`.
70
+ */
71
+ credentialQueryId: string;
72
+ /**
73
+ * The credential format identifier, as OpenID4VP names it (`dc+sd-jwt`, `mso_mdoc`). Carried verbatim.
74
+ */
75
+ format: string;
76
+ /**
77
+ * The identifier of the credential's issuer as the community verified it — a DID, or for an issuer identified by an X.509 certificate, the certificate subject or hash the community's policy names it by.
78
+ */
79
+ issuer: string;
80
+ /**
81
+ * The SD-JWT VC credential type (`vct`). Present for SD-JWT VC credentials.
82
+ */
83
+ vct?: string;
84
+ }
85
+
86
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
87
+ export type { Ext };
88
+
89
+ /** Trust Task type URI. */
90
+ export const TYPE_URI = "https://trusttasks.org/spec/vtc/join-requests/wallet-session/status/0.1" as const;
91
+
92
+ /** Stable alias for this specification's request payload shape. */
93
+ export type Payload = VTCJoinRequestsWalletSessionStatusPayload;
94
+
95
+ /** Trust Task response type URI (request type URI + "#response"). */
96
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/join-requests/wallet-session/status/0.1#response" as const;
97
+
98
+ /** Stable alias for this specification's success-response payload shape. */
99
+ export type Response = VTCJoinRequestsWalletSessionStatusResponsePayload;
100
+
101
+ /**
102
+ * This specification's payload schema, as a value.
103
+ *
104
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
105
+ * rather than only as a `.json` file because TypeScript types are erased
106
+ * at runtime: without a schema a consumer has nothing to validate, and
107
+ * every REQUIRED payload member is optional in practice. Cross-file
108
+ * `$ref`s are already inlined, so it needs no resolver.
109
+ */
110
+ export const PAYLOAD_SCHEMA = {
111
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
112
+ "$id": "https://trusttasks.org/spec/vtc/join-requests/wallet-session/status/0.1",
113
+ "title": "VTC Join-Requests Wallet Session Status — payload",
114
+ "description": "An applicant reads the state of a wallet presentation session they opened with vtc/join-requests/wallet-session/start, and, once a wallet has answered, what the presentation established. The applicant is the document proof's signer. The outer document members are owned by the framework — SPEC §6.3.",
115
+ "type": "object",
116
+ "additionalProperties": false,
117
+ "required": [
118
+ "sessionId"
119
+ ],
120
+ "properties": {
121
+ "sessionId": {
122
+ "type": "string",
123
+ "minLength": 16,
124
+ "maxLength": 128,
125
+ "description": "The session to read, as vtc/join-requests/wallet-session/start returned it."
126
+ },
127
+ "ext": {
128
+ "$ref": "#/$defs/Ext"
129
+ }
130
+ },
131
+ "$defs": {
132
+ "PresentedCredential": {
133
+ "title": "PresentedCredential",
134
+ "type": "object",
135
+ "additionalProperties": false,
136
+ "required": [
137
+ "credentialQueryId",
138
+ "format",
139
+ "issuer"
140
+ ],
141
+ "description": "One credential the wallet presented, described without any of its claim values.",
142
+ "properties": {
143
+ "credentialQueryId": {
144
+ "type": "string",
145
+ "minLength": 1,
146
+ "maxLength": 128,
147
+ "description": "The `id` of the DCQL credential query this credential was presented for — the key it arrived under in the OpenID4VP `vp_token`."
148
+ },
149
+ "format": {
150
+ "type": "string",
151
+ "minLength": 1,
152
+ "maxLength": 64,
153
+ "description": "The credential format identifier, as OpenID4VP names it (`dc+sd-jwt`, `mso_mdoc`). Carried verbatim."
154
+ },
155
+ "issuer": {
156
+ "type": "string",
157
+ "minLength": 1,
158
+ "maxLength": 2048,
159
+ "description": "The identifier of the credential's issuer as the community verified it — a DID, or for an issuer identified by an X.509 certificate, the certificate subject or hash the community's policy names it by."
160
+ },
161
+ "vct": {
162
+ "type": "string",
163
+ "minLength": 1,
164
+ "maxLength": 2048,
165
+ "description": "The SD-JWT VC credential type (`vct`). Present for SD-JWT VC credentials."
166
+ }
167
+ }
168
+ },
169
+ "Evidence": {
170
+ "title": "Evidence",
171
+ "type": "object",
172
+ "additionalProperties": false,
173
+ "required": [
174
+ "satisfied",
175
+ "holder",
176
+ "credentials"
177
+ ],
178
+ "description": "What a verified wallet presentation established. Never claim values.",
179
+ "properties": {
180
+ "satisfied": {
181
+ "type": "boolean",
182
+ "description": "Whether the presentation satisfies the criterion's DCQL query. Satisfying the query is not admission: the community still decides the join under the criterion's `admission`."
183
+ },
184
+ "holder": {
185
+ "type": "string",
186
+ "minLength": 1,
187
+ "maxLength": 2048,
188
+ "description": "The identifier of the key that held the presented credentials — for an SD-JWT VC, the `did:key` of its `cnf` key. Recorded beside the applicant DID, never as it."
189
+ },
190
+ "credentials": {
191
+ "type": "array",
192
+ "minItems": 1,
193
+ "maxItems": 32,
194
+ "items": {
195
+ "$ref": "#/$defs/PresentedCredential"
196
+ },
197
+ "description": "The credentials presented, one entry each."
198
+ },
199
+ "heldUntil": {
200
+ "type": "string",
201
+ "format": "date-time",
202
+ "description": "When evidence not yet recorded on a join request is discarded if the applicant has not submitted under the session's criterion. Absent when the evidence is recorded on a request."
203
+ }
204
+ }
205
+ },
206
+ "Response": {
207
+ "$anchor": "response",
208
+ "title": "VTC Join-Requests Wallet Session Status — response payload",
209
+ "type": "object",
210
+ "additionalProperties": false,
211
+ "required": [
212
+ "sessionId",
213
+ "state",
214
+ "expiresAt"
215
+ ],
216
+ "properties": {
217
+ "sessionId": {
218
+ "type": "string",
219
+ "minLength": 16,
220
+ "maxLength": 128
221
+ },
222
+ "state": {
223
+ "type": "string",
224
+ "enum": [
225
+ "awaitingWallet",
226
+ "requestRetrieved",
227
+ "presented",
228
+ "refused",
229
+ "expired"
230
+ ],
231
+ "description": "`awaitingWallet`: no wallet has fetched the request object. `requestRetrieved`: a wallet has fetched it and not yet answered. `presented`: a wallet answered and the presentation verified; see `evidence`. `refused`: a wallet answered and the community did not accept the answer, or the wallet declined; see `reason`. `expired`: the session closed unanswered."
232
+ },
233
+ "expiresAt": {
234
+ "type": "string",
235
+ "format": "date-time",
236
+ "description": "When the session closes, or closed, if unanswered."
237
+ },
238
+ "requestId": {
239
+ "type": "string",
240
+ "minLength": 1,
241
+ "maxLength": 128,
242
+ "description": "The join request the session's evidence is recorded on. Present when the session was bound to one, or its evidence has since been attached to one by a submission."
243
+ },
244
+ "evidence": {
245
+ "$ref": "#/$defs/Evidence",
246
+ "description": "Present only when `state` is `presented`."
247
+ },
248
+ "reason": {
249
+ "type": "string",
250
+ "enum": [
251
+ "presentationInvalid",
252
+ "queryNotSatisfied",
253
+ "issuerNotTrusted",
254
+ "statusNotValid",
255
+ "walletDeclined"
256
+ ],
257
+ "description": "Why the session ended `refused`. `presentationInvalid`: the response or a presentation failed verification — decryption, `state`, signature, key binding, nonce or audience. `queryNotSatisfied`: the presentations verified but do not satisfy the query. `issuerNotTrusted`: a credential's issuer is not one the criterion accepts. `statusNotValid`: a credential's status is revoked or suspended, or could not be read. `walletDeclined`: the wallet answered with an OpenID4VP error, such as `access_denied`. Present only when `state` is `refused`."
258
+ },
259
+ "ext": {
260
+ "$ref": "#/$defs/Ext"
261
+ }
262
+ }
263
+ },
264
+ "Ext": {
265
+ "title": "Ext",
266
+ "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.",
267
+ "type": "object",
268
+ "minProperties": 1,
269
+ "additionalProperties": true,
270
+ "propertyNames": {
271
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
272
+ }
273
+ }
274
+ }
275
+ } as const;
276
+
277
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
278
+ export const RESPONSE_PAYLOAD_SCHEMA = {
279
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
280
+ "$ref": "#/$defs/Response",
281
+ "$defs": {
282
+ "PresentedCredential": {
283
+ "title": "PresentedCredential",
284
+ "type": "object",
285
+ "additionalProperties": false,
286
+ "required": [
287
+ "credentialQueryId",
288
+ "format",
289
+ "issuer"
290
+ ],
291
+ "description": "One credential the wallet presented, described without any of its claim values.",
292
+ "properties": {
293
+ "credentialQueryId": {
294
+ "type": "string",
295
+ "minLength": 1,
296
+ "maxLength": 128,
297
+ "description": "The `id` of the DCQL credential query this credential was presented for — the key it arrived under in the OpenID4VP `vp_token`."
298
+ },
299
+ "format": {
300
+ "type": "string",
301
+ "minLength": 1,
302
+ "maxLength": 64,
303
+ "description": "The credential format identifier, as OpenID4VP names it (`dc+sd-jwt`, `mso_mdoc`). Carried verbatim."
304
+ },
305
+ "issuer": {
306
+ "type": "string",
307
+ "minLength": 1,
308
+ "maxLength": 2048,
309
+ "description": "The identifier of the credential's issuer as the community verified it — a DID, or for an issuer identified by an X.509 certificate, the certificate subject or hash the community's policy names it by."
310
+ },
311
+ "vct": {
312
+ "type": "string",
313
+ "minLength": 1,
314
+ "maxLength": 2048,
315
+ "description": "The SD-JWT VC credential type (`vct`). Present for SD-JWT VC credentials."
316
+ }
317
+ }
318
+ },
319
+ "Evidence": {
320
+ "title": "Evidence",
321
+ "type": "object",
322
+ "additionalProperties": false,
323
+ "required": [
324
+ "satisfied",
325
+ "holder",
326
+ "credentials"
327
+ ],
328
+ "description": "What a verified wallet presentation established. Never claim values.",
329
+ "properties": {
330
+ "satisfied": {
331
+ "type": "boolean",
332
+ "description": "Whether the presentation satisfies the criterion's DCQL query. Satisfying the query is not admission: the community still decides the join under the criterion's `admission`."
333
+ },
334
+ "holder": {
335
+ "type": "string",
336
+ "minLength": 1,
337
+ "maxLength": 2048,
338
+ "description": "The identifier of the key that held the presented credentials — for an SD-JWT VC, the `did:key` of its `cnf` key. Recorded beside the applicant DID, never as it."
339
+ },
340
+ "credentials": {
341
+ "type": "array",
342
+ "minItems": 1,
343
+ "maxItems": 32,
344
+ "items": {
345
+ "$ref": "#/$defs/PresentedCredential"
346
+ },
347
+ "description": "The credentials presented, one entry each."
348
+ },
349
+ "heldUntil": {
350
+ "type": "string",
351
+ "format": "date-time",
352
+ "description": "When evidence not yet recorded on a join request is discarded if the applicant has not submitted under the session's criterion. Absent when the evidence is recorded on a request."
353
+ }
354
+ }
355
+ },
356
+ "Response": {
357
+ "$anchor": "response",
358
+ "title": "VTC Join-Requests Wallet Session Status — response payload",
359
+ "type": "object",
360
+ "additionalProperties": false,
361
+ "required": [
362
+ "sessionId",
363
+ "state",
364
+ "expiresAt"
365
+ ],
366
+ "properties": {
367
+ "sessionId": {
368
+ "type": "string",
369
+ "minLength": 16,
370
+ "maxLength": 128
371
+ },
372
+ "state": {
373
+ "type": "string",
374
+ "enum": [
375
+ "awaitingWallet",
376
+ "requestRetrieved",
377
+ "presented",
378
+ "refused",
379
+ "expired"
380
+ ],
381
+ "description": "`awaitingWallet`: no wallet has fetched the request object. `requestRetrieved`: a wallet has fetched it and not yet answered. `presented`: a wallet answered and the presentation verified; see `evidence`. `refused`: a wallet answered and the community did not accept the answer, or the wallet declined; see `reason`. `expired`: the session closed unanswered."
382
+ },
383
+ "expiresAt": {
384
+ "type": "string",
385
+ "format": "date-time",
386
+ "description": "When the session closes, or closed, if unanswered."
387
+ },
388
+ "requestId": {
389
+ "type": "string",
390
+ "minLength": 1,
391
+ "maxLength": 128,
392
+ "description": "The join request the session's evidence is recorded on. Present when the session was bound to one, or its evidence has since been attached to one by a submission."
393
+ },
394
+ "evidence": {
395
+ "$ref": "#/$defs/Evidence",
396
+ "description": "Present only when `state` is `presented`."
397
+ },
398
+ "reason": {
399
+ "type": "string",
400
+ "enum": [
401
+ "presentationInvalid",
402
+ "queryNotSatisfied",
403
+ "issuerNotTrusted",
404
+ "statusNotValid",
405
+ "walletDeclined"
406
+ ],
407
+ "description": "Why the session ended `refused`. `presentationInvalid`: the response or a presentation failed verification — decryption, `state`, signature, key binding, nonce or audience. `queryNotSatisfied`: the presentations verified but do not satisfy the query. `issuerNotTrusted`: a credential's issuer is not one the criterion accepts. `statusNotValid`: a credential's status is revoked or suspended, or could not be read. `walletDeclined`: the wallet answered with an OpenID4VP error, such as `access_denied`. Present only when `state` is `refused`."
408
+ },
409
+ "ext": {
410
+ "$ref": "#/$defs/Ext"
411
+ }
412
+ }
413
+ },
414
+ "Ext": {
415
+ "title": "Ext",
416
+ "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.",
417
+ "type": "object",
418
+ "minProperties": 1,
419
+ "additionalProperties": true,
420
+ "propertyNames": {
421
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
422
+ }
423
+ }
424
+ }
425
+ } as const;
426
+
427
+ /**
428
+ * SPEC.md §7.2 policy for the request variant, from this specification's
429
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
430
+ * per-specification and cannot be derived from the document alone, and
431
+ * item 2 needs the schema this carries.
432
+ */
433
+ export const SPEC = {
434
+ typeUri: TYPE_URI,
435
+ isBearer: false,
436
+ isProofRequired: true,
437
+ isRecipientRequired: true,
438
+ isIssuedAtRequired: false,
439
+ payloadSchema: PAYLOAD_SCHEMA,
440
+ } as const;
441
+
442
+ /**
443
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
444
+ * tracks the *issuer* party's requirement because a response swaps the
445
+ * parties (§7.3 item 5).
446
+ */
447
+ export const RESPONSE_SPEC = {
448
+ typeUri: RESPONSE_TYPE_URI,
449
+ isBearer: false,
450
+ isProofRequired: true,
451
+ isRecipientRequired: true,
452
+ isIssuedAtRequired: false,
453
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
454
+ } as const;