@openvtc/trust-tasks 0.19.3 → 0.19.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 (75) hide show
  1. package/CHANGELOG.md +161 -0
  2. package/dist/_shared/components.d.ts +298 -0
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/index.d.ts +13 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +13 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/vetting/_shared/0.1/identity-vetting.d.ts +11 -0
  9. package/dist/vetting/_shared/0.1/identity-vetting.d.ts.map +1 -0
  10. package/dist/vetting/_shared/0.1/identity-vetting.js +6 -0
  11. package/dist/vetting/_shared/0.1/identity-vetting.js.map +1 -0
  12. package/dist/vetting/_shared/0.1/vetting-card.d.ts +16 -0
  13. package/dist/vetting/_shared/0.1/vetting-card.d.ts.map +1 -0
  14. package/dist/vetting/_shared/0.1/vetting-card.js +6 -0
  15. package/dist/vetting/_shared/0.1/vetting-card.js.map +1 -0
  16. package/dist/vetting/_shared/0.1/vetting.d.ts +16 -0
  17. package/dist/vetting/_shared/0.1/vetting.d.ts.map +1 -0
  18. package/dist/vetting/_shared/0.1/vetting.js +6 -0
  19. package/dist/vetting/_shared/0.1/vetting.js.map +1 -0
  20. package/dist/vetting/decline/0.1/payload.d.ts +138 -0
  21. package/dist/vetting/decline/0.1/payload.d.ts.map +1 -0
  22. package/dist/vetting/decline/0.1/payload.js +81 -0
  23. package/dist/vetting/decline/0.1/payload.js.map +1 -0
  24. package/dist/vetting/request/0.1/payload.d.ts +1188 -0
  25. package/dist/vetting/request/0.1/payload.d.ts.map +1 -0
  26. package/dist/vetting/request/0.1/payload.js +596 -0
  27. package/dist/vetting/request/0.1/payload.js.map +1 -0
  28. package/dist/vetting/session/0.1/payload.d.ts +978 -0
  29. package/dist/vetting/session/0.1/payload.d.ts.map +1 -0
  30. package/dist/vetting/session/0.1/payload.js +570 -0
  31. package/dist/vetting/session/0.1/payload.js.map +1 -0
  32. package/dist/vtc/_shared/0.1/vetter-profile.d.ts +16 -0
  33. package/dist/vtc/_shared/0.1/vetter-profile.d.ts.map +1 -0
  34. package/dist/vtc/_shared/0.1/vetter-profile.js +6 -0
  35. package/dist/vtc/_shared/0.1/vetter-profile.js.map +1 -0
  36. package/dist/vtc/join-requests/manifest/0.2/payload.d.ts +1294 -0
  37. package/dist/vtc/join-requests/manifest/0.2/payload.d.ts.map +1 -0
  38. package/dist/vtc/join-requests/manifest/0.2/payload.js +667 -0
  39. package/dist/vtc/join-requests/manifest/0.2/payload.js.map +1 -0
  40. package/dist/vtc/vetting/revoke-statement/0.1/payload.d.ts +299 -0
  41. package/dist/vtc/vetting/revoke-statement/0.1/payload.d.ts.map +1 -0
  42. package/dist/vtc/vetting/revoke-statement/0.1/payload.js +172 -0
  43. package/dist/vtc/vetting/revoke-statement/0.1/payload.js.map +1 -0
  44. package/dist/vtc/vetting/vetters/grant/0.1/payload.d.ts +337 -0
  45. package/dist/vtc/vetting/vetters/grant/0.1/payload.d.ts.map +1 -0
  46. package/dist/vtc/vetting/vetters/grant/0.1/payload.js +183 -0
  47. package/dist/vtc/vetting/vetters/grant/0.1/payload.js.map +1 -0
  48. package/dist/vtc/vetting/vetters/list/0.1/payload.d.ts +1257 -0
  49. package/dist/vtc/vetting/vetters/list/0.1/payload.d.ts.map +1 -0
  50. package/dist/vtc/vetting/vetters/list/0.1/payload.js +597 -0
  51. package/dist/vtc/vetting/vetters/list/0.1/payload.js.map +1 -0
  52. package/dist/vtc/vetting/vetters/profile/0.1/payload.d.ts +970 -0
  53. package/dist/vtc/vetting/vetters/profile/0.1/payload.d.ts.map +1 -0
  54. package/dist/vtc/vetting/vetters/profile/0.1/payload.js +463 -0
  55. package/dist/vtc/vetting/vetters/profile/0.1/payload.js.map +1 -0
  56. package/dist/vtc/vetting/vetters/resend/0.1/payload.d.ts +240 -0
  57. package/dist/vtc/vetting/vetters/resend/0.1/payload.d.ts.map +1 -0
  58. package/dist/vtc/vetting/vetters/resend/0.1/payload.js +137 -0
  59. package/dist/vtc/vetting/vetters/resend/0.1/payload.js.map +1 -0
  60. package/package.json +1 -1
  61. package/src/_shared/components.ts +318 -0
  62. package/src/index.ts +13 -0
  63. package/src/vetting/_shared/0.1/identity-vetting.ts +11 -0
  64. package/src/vetting/_shared/0.1/vetting-card.ts +17 -0
  65. package/src/vetting/_shared/0.1/vetting.ts +17 -0
  66. package/src/vetting/decline/0.1/payload.ts +111 -0
  67. package/src/vetting/request/0.1/payload.ts +799 -0
  68. package/src/vetting/session/0.1/payload.ts +629 -0
  69. package/src/vtc/_shared/0.1/vetter-profile.ts +17 -0
  70. package/src/vtc/join-requests/manifest/0.2/payload.ts +815 -0
  71. package/src/vtc/vetting/revoke-statement/0.1/payload.ts +218 -0
  72. package/src/vtc/vetting/vetters/grant/0.1/payload.ts +237 -0
  73. package/src/vtc/vetting/vetters/list/0.1/payload.ts +816 -0
  74. package/src/vtc/vetting/vetters/profile/0.1/payload.ts +647 -0
  75. package/src/vtc/vetting/vetters/resend/0.1/payload.ts +174 -0
@@ -0,0 +1,799 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vetting/request/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { DigestMultibase, Ext, VettingDocumentation, VettingMethod } from "../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * A ticket the vetter issued: the short code a person reads or types, or the full-entropy QR form.
11
+ */
12
+ export type Ticket = ShortCodeTicket | QrTicket;
13
+
14
+ /**
15
+ * An applicant asks one vetter to vet them for one community. The applicant is the document's issuer, and `joinDid` repeats that DID: it is the DID the applicant is applying with, and every card and statement that follows names it. Carries a ticket the vetter issued or an introduction, never both. The vetter's response accepts the request and proves the vetter is currently eligible to vet for that community.
16
+ */
17
+ export interface VettingRequestPayload {
18
+ /**
19
+ * The community the applicant is applying to and asks to be vetted for.
20
+ */
21
+ community: string;
22
+ /**
23
+ * The `requirementsDigest` of the community's manifest criterion the applicant is gathering for, recorded when the application started. RECOMMENDED; a community that publishes no digest leaves the applicant nothing to cite.
24
+ */
25
+ requirementsDigest?: DigestMultibase;
26
+ /**
27
+ * The DID the applicant will join the community with. MUST equal the document's `issuer`. Every card and statement this request leads to names it, and it is the holder of the presentation the applicant eventually submits.
28
+ */
29
+ joinDid: string;
30
+ ticket?: Ticket;
31
+ /**
32
+ * A verifiable invitation credential for `community` whose subject is the applicant's DID, issued by the community or a member (opaque here). An alternative to a ticket for vetters who accept introductions.
33
+ */
34
+ introduction?: {};
35
+ /**
36
+ * The method the applicant would prefer. A preference: the vetter chooses the session's method.
37
+ */
38
+ preferredMethod?: VettingMethod;
39
+ /**
40
+ * BCP 47 language tags the applicant can hold a session in, most preferred first.
41
+ *
42
+ * @maxItems 16
43
+ */
44
+ languages?:
45
+ | []
46
+ | [string]
47
+ | [string, string]
48
+ | [string, string, string]
49
+ | [string, string, string, string]
50
+ | [string, string, string, string, string]
51
+ | [string, string, string, string, string, string]
52
+ | [string, string, string, string, string, string, string]
53
+ | [string, string, string, string, string, string, string, string]
54
+ | [string, string, string, string, string, string, string, string, string]
55
+ | [string, string, string, string, string, string, string, string, string, string]
56
+ | [string, string, string, string, string, string, string, string, string, string, string]
57
+ | [string, string, string, string, string, string, string, string, string, string, string, string]
58
+ | [string, string, string, string, string, string, string, string, string, string, string, string, string]
59
+ | [string, string, string, string, string, string, string, string, string, string, string, string, string, string]
60
+ | [
61
+ string,
62
+ string,
63
+ string,
64
+ string,
65
+ string,
66
+ string,
67
+ string,
68
+ string,
69
+ string,
70
+ string,
71
+ string,
72
+ string,
73
+ string,
74
+ string,
75
+ string
76
+ ]
77
+ | [
78
+ string,
79
+ string,
80
+ string,
81
+ string,
82
+ string,
83
+ string,
84
+ string,
85
+ string,
86
+ string,
87
+ string,
88
+ string,
89
+ string,
90
+ string,
91
+ string,
92
+ string,
93
+ string
94
+ ];
95
+ /**
96
+ * OPTIONAL applicant-authored text for the vetter — typically how they know each other. Untrusted: read by the vetter, attributed to the applicant on every surface that renders it, never shown to the community.
97
+ */
98
+ message?: string;
99
+ /**
100
+ * OPTIONAL applicant-authored free text on when they can meet. Scheduling is out of band; this is a hint, attributed to the applicant.
101
+ */
102
+ availability?: string;
103
+ ext?: Ext;
104
+ }
105
+ export interface ShortCodeTicket {
106
+ /**
107
+ * Eight Crockford base32 characters, grouped four and four (40 bits). A secret the vetter handed over; not derived from anything.
108
+ */
109
+ code: string;
110
+ }
111
+ export interface QrTicket {
112
+ ticketId: string;
113
+ /**
114
+ * 32 random bytes, base64url without padding.
115
+ */
116
+ secret: string;
117
+ }
118
+ /**
119
+ * The vetter accepts the request. A refusal is a trust-task-error, never a response document.
120
+ */
121
+ export interface VettingRequestResponsePayload {
122
+ /**
123
+ * The vetter's handle for this accepted request, carried by the session and any decline.
124
+ */
125
+ requestId: string;
126
+ eligibilityVp?: EligibilityPresentation;
127
+ /**
128
+ * RECOMMENDED. What this vetter will rely on, so the applicant brings it — the vetter's own choice. `none` means the vetter attests from prior acquaintance.
129
+ *
130
+ * @minItems 1
131
+ */
132
+ acceptsDocumentation?: [VettingDocumentation, ...VettingDocumentation[]];
133
+ /**
134
+ * OPTIONAL vetter-authored free text on how and when the session will happen. Attributed to the vetter.
135
+ */
136
+ sessionHint?: string;
137
+ ext?: Ext;
138
+ }
139
+ /**
140
+ * OPTIONAL. A W3C Verifiable Presentation by which the vetter shows the applicant that it currently holds the community's vetter role. Bound to this request by `nonce` (the vetting/request document's `id`, which the applicant chose) and to this applicant by `domain` (its `joinDid`), so it cannot be replayed to another request or another applicant. The applicant's check is advisory; the community evaluates eligibility again, authoritatively, when it decides. Members other than those defined here are permitted, as the VC data model allows.
141
+ */
142
+ export interface EligibilityPresentation {
143
+ /**
144
+ * JSON-LD contexts. The first item MUST be `https://www.w3.org/ns/credentials/v2` (stated here rather than as `prefixItems`, which the Rust generator cannot express).
145
+ *
146
+ * @minItems 1
147
+ */
148
+ "@context": [string, ...string[]];
149
+ /**
150
+ * MUST include `VerifiablePresentation` (stated here rather than as `contains`, which the Rust generator cannot express).
151
+ *
152
+ * @minItems 1
153
+ */
154
+ type: [string, ...string[]];
155
+ /**
156
+ * The vetter's DID — the response's `issuer`.
157
+ */
158
+ holder: string;
159
+ /**
160
+ * Credentials presented (opaque here). MUST include the community-issued `CommunityRole` endorsement credential naming `holder`, whose `endorsement.role` is the manifest's `eligibleVetters.role` — see vtc/vetting/vetters/grant/0.1. MAY include others, such as the membership credential.
161
+ *
162
+ * @minItems 1
163
+ */
164
+ verifiableCredential: [{}, ...{}[]];
165
+ /**
166
+ * The `id` of the vetting/request document this responds to.
167
+ */
168
+ nonce: string;
169
+ /**
170
+ * The applicant's `joinDid` from that request.
171
+ */
172
+ domain: string;
173
+ proof: EligibilityPresentationProof;
174
+ [k: string]: unknown | undefined;
175
+ }
176
+ /**
177
+ * A W3C Data Integrity proof by `holder` over the presentation, `nonce` and `domain` included.
178
+ */
179
+ export interface EligibilityPresentationProof {
180
+ type: "DataIntegrityProof";
181
+ /**
182
+ * e.g. `eddsa-jcs-2022`.
183
+ */
184
+ cryptosuite: string;
185
+ /**
186
+ * A verification method of `holder`, authorized for `authentication`.
187
+ */
188
+ verificationMethod: string;
189
+ proofPurpose: "authentication";
190
+ created?: string;
191
+ proofValue: string;
192
+ [k: string]: unknown | undefined;
193
+ }
194
+
195
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
196
+ export type { DigestMultibase, Ext, VettingDocumentation, VettingMethod };
197
+
198
+ /** Trust Task type URI. */
199
+ export const TYPE_URI = "https://trusttasks.org/spec/vetting/request/0.1" as const;
200
+
201
+ /** Stable alias for this specification's request payload shape. */
202
+ export type Payload = VettingRequestPayload;
203
+
204
+ /** Trust Task response type URI (request type URI + "#response"). */
205
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vetting/request/0.1#response" as const;
206
+
207
+ /** Stable alias for this specification's success-response payload shape. */
208
+ export type Response = VettingRequestResponsePayload;
209
+
210
+ /**
211
+ * This specification's payload schema, as a value.
212
+ *
213
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
214
+ * rather than only as a `.json` file because TypeScript types are erased
215
+ * at runtime: without a schema a consumer has nothing to validate, and
216
+ * every REQUIRED payload member is optional in practice. Cross-file
217
+ * `$ref`s are already inlined, so it needs no resolver.
218
+ */
219
+ export const PAYLOAD_SCHEMA = {
220
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
221
+ "$id": "https://trusttasks.org/spec/vetting/request/0.1",
222
+ "title": "Vetting Request — payload",
223
+ "description": "An applicant asks one vetter to vet them for one community. The applicant is the document's issuer, and `joinDid` repeats that DID: it is the DID the applicant is applying with, and every card and statement that follows names it. Carries a ticket the vetter issued or an introduction, never both. The vetter's response accepts the request and proves the vetter is currently eligible to vet for that community.",
224
+ "type": "object",
225
+ "additionalProperties": false,
226
+ "required": [
227
+ "community",
228
+ "joinDid"
229
+ ],
230
+ "dependentSchemas": {
231
+ "ticket": {
232
+ "not": {
233
+ "required": [
234
+ "introduction"
235
+ ]
236
+ }
237
+ }
238
+ },
239
+ "properties": {
240
+ "community": {
241
+ "type": "string",
242
+ "pattern": "^did:",
243
+ "description": "The community the applicant is applying to and asks to be vetted for."
244
+ },
245
+ "requirementsDigest": {
246
+ "$ref": "#/$defs/DigestMultibase",
247
+ "description": "The `requirementsDigest` of the community's manifest criterion the applicant is gathering for, recorded when the application started. RECOMMENDED; a community that publishes no digest leaves the applicant nothing to cite."
248
+ },
249
+ "joinDid": {
250
+ "type": "string",
251
+ "pattern": "^did:",
252
+ "description": "The DID the applicant will join the community with. MUST equal the document's `issuer`. Every card and statement this request leads to names it, and it is the holder of the presentation the applicant eventually submits."
253
+ },
254
+ "ticket": {
255
+ "$ref": "#/$defs/Ticket"
256
+ },
257
+ "introduction": {
258
+ "type": "object",
259
+ "description": "A verifiable invitation credential for `community` whose subject is the applicant's DID, issued by the community or a member (opaque here). An alternative to a ticket for vetters who accept introductions."
260
+ },
261
+ "preferredMethod": {
262
+ "$ref": "#/$defs/VettingMethod",
263
+ "description": "The method the applicant would prefer. A preference: the vetter chooses the session's method."
264
+ },
265
+ "languages": {
266
+ "type": "array",
267
+ "maxItems": 16,
268
+ "uniqueItems": true,
269
+ "items": {
270
+ "type": "string",
271
+ "maxLength": 35,
272
+ "pattern": "^[A-Za-z]{2,3}(-[A-Za-z0-9]{1,8})*$"
273
+ },
274
+ "description": "BCP 47 language tags the applicant can hold a session in, most preferred first."
275
+ },
276
+ "message": {
277
+ "type": "string",
278
+ "minLength": 1,
279
+ "maxLength": 1000,
280
+ "description": "OPTIONAL applicant-authored text for the vetter — typically how they know each other. Untrusted: read by the vetter, attributed to the applicant on every surface that renders it, never shown to the community."
281
+ },
282
+ "availability": {
283
+ "type": "string",
284
+ "minLength": 1,
285
+ "maxLength": 256,
286
+ "description": "OPTIONAL applicant-authored free text on when they can meet. Scheduling is out of band; this is a hint, attributed to the applicant."
287
+ },
288
+ "ext": {
289
+ "$ref": "#/$defs/Ext"
290
+ }
291
+ },
292
+ "$defs": {
293
+ "Ticket": {
294
+ "title": "Ticket",
295
+ "description": "A ticket the vetter issued: the short code a person reads or types, or the full-entropy QR form.",
296
+ "oneOf": [
297
+ {
298
+ "$ref": "#/$defs/ShortCodeTicket"
299
+ },
300
+ {
301
+ "$ref": "#/$defs/QrTicket"
302
+ }
303
+ ]
304
+ },
305
+ "ShortCodeTicket": {
306
+ "title": "ShortCodeTicket",
307
+ "type": "object",
308
+ "additionalProperties": false,
309
+ "required": [
310
+ "code"
311
+ ],
312
+ "properties": {
313
+ "code": {
314
+ "type": "string",
315
+ "pattern": "^[0-9A-HJKMNP-TV-Z]{4}-[0-9A-HJKMNP-TV-Z]{4}$",
316
+ "description": "Eight Crockford base32 characters, grouped four and four (40 bits). A secret the vetter handed over; not derived from anything."
317
+ }
318
+ }
319
+ },
320
+ "QrTicket": {
321
+ "title": "QrTicket",
322
+ "type": "object",
323
+ "additionalProperties": false,
324
+ "required": [
325
+ "ticketId",
326
+ "secret"
327
+ ],
328
+ "properties": {
329
+ "ticketId": {
330
+ "type": "string",
331
+ "minLength": 1,
332
+ "maxLength": 128,
333
+ "pattern": "^[A-Za-z0-9._:-]+$"
334
+ },
335
+ "secret": {
336
+ "type": "string",
337
+ "pattern": "^[A-Za-z0-9_-]{43}$",
338
+ "description": "32 random bytes, base64url without padding."
339
+ }
340
+ }
341
+ },
342
+ "EligibilityPresentation": {
343
+ "title": "EligibilityPresentation",
344
+ "description": "OPTIONAL. A W3C Verifiable Presentation by which the vetter shows the applicant that it currently holds the community's vetter role. Bound to this request by `nonce` (the vetting/request document's `id`, which the applicant chose) and to this applicant by `domain` (its `joinDid`), so it cannot be replayed to another request or another applicant. The applicant's check is advisory; the community evaluates eligibility again, authoritatively, when it decides. Members other than those defined here are permitted, as the VC data model allows.",
345
+ "type": "object",
346
+ "additionalProperties": true,
347
+ "required": [
348
+ "@context",
349
+ "type",
350
+ "holder",
351
+ "verifiableCredential",
352
+ "nonce",
353
+ "domain",
354
+ "proof"
355
+ ],
356
+ "properties": {
357
+ "@context": {
358
+ "type": "array",
359
+ "minItems": 1,
360
+ "items": {
361
+ "type": "string",
362
+ "minLength": 1,
363
+ "maxLength": 2048
364
+ },
365
+ "description": "JSON-LD contexts. The first item MUST be `https://www.w3.org/ns/credentials/v2` (stated here rather than as `prefixItems`, which the Rust generator cannot express)."
366
+ },
367
+ "type": {
368
+ "type": "array",
369
+ "minItems": 1,
370
+ "uniqueItems": true,
371
+ "items": {
372
+ "type": "string",
373
+ "minLength": 1,
374
+ "maxLength": 128
375
+ },
376
+ "description": "MUST include `VerifiablePresentation` (stated here rather than as `contains`, which the Rust generator cannot express)."
377
+ },
378
+ "holder": {
379
+ "type": "string",
380
+ "pattern": "^did:",
381
+ "description": "The vetter's DID — the response's `issuer`."
382
+ },
383
+ "verifiableCredential": {
384
+ "type": "array",
385
+ "minItems": 1,
386
+ "items": {
387
+ "type": "object"
388
+ },
389
+ "description": "Credentials presented (opaque here). MUST include the community-issued `CommunityRole` endorsement credential naming `holder`, whose `endorsement.role` is the manifest's `eligibleVetters.role` — see vtc/vetting/vetters/grant/0.1. MAY include others, such as the membership credential."
390
+ },
391
+ "nonce": {
392
+ "type": "string",
393
+ "minLength": 1,
394
+ "maxLength": 512,
395
+ "description": "The `id` of the vetting/request document this responds to."
396
+ },
397
+ "domain": {
398
+ "type": "string",
399
+ "pattern": "^did:",
400
+ "description": "The applicant's `joinDid` from that request."
401
+ },
402
+ "proof": {
403
+ "$ref": "#/$defs/EligibilityPresentationProof"
404
+ }
405
+ }
406
+ },
407
+ "EligibilityPresentationProof": {
408
+ "title": "EligibilityPresentationProof",
409
+ "description": "A W3C Data Integrity proof by `holder` over the presentation, `nonce` and `domain` included.",
410
+ "type": "object",
411
+ "additionalProperties": true,
412
+ "required": [
413
+ "type",
414
+ "cryptosuite",
415
+ "verificationMethod",
416
+ "proofPurpose",
417
+ "proofValue"
418
+ ],
419
+ "properties": {
420
+ "type": {
421
+ "type": "string",
422
+ "const": "DataIntegrityProof"
423
+ },
424
+ "cryptosuite": {
425
+ "type": "string",
426
+ "minLength": 1,
427
+ "maxLength": 64,
428
+ "pattern": "^[a-z0-9-]+$",
429
+ "description": "e.g. `eddsa-jcs-2022`."
430
+ },
431
+ "verificationMethod": {
432
+ "type": "string",
433
+ "pattern": "^did:",
434
+ "description": "A verification method of `holder`, authorized for `authentication`."
435
+ },
436
+ "proofPurpose": {
437
+ "type": "string",
438
+ "const": "authentication"
439
+ },
440
+ "created": {
441
+ "type": "string",
442
+ "format": "date-time"
443
+ },
444
+ "proofValue": {
445
+ "type": "string",
446
+ "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
447
+ }
448
+ }
449
+ },
450
+ "Response": {
451
+ "$anchor": "response",
452
+ "title": "Vetting Request — response payload",
453
+ "description": "The vetter accepts the request. A refusal is a trust-task-error, never a response document.",
454
+ "type": "object",
455
+ "additionalProperties": false,
456
+ "required": [
457
+ "requestId"
458
+ ],
459
+ "properties": {
460
+ "requestId": {
461
+ "type": "string",
462
+ "minLength": 1,
463
+ "maxLength": 128,
464
+ "description": "The vetter's handle for this accepted request, carried by the session and any decline."
465
+ },
466
+ "eligibilityVp": {
467
+ "$ref": "#/$defs/EligibilityPresentation"
468
+ },
469
+ "acceptsDocumentation": {
470
+ "type": "array",
471
+ "minItems": 1,
472
+ "uniqueItems": true,
473
+ "items": {
474
+ "$ref": "#/$defs/VettingDocumentation"
475
+ },
476
+ "description": "RECOMMENDED. What this vetter will rely on, so the applicant brings it — the vetter's own choice. `none` means the vetter attests from prior acquaintance."
477
+ },
478
+ "sessionHint": {
479
+ "type": "string",
480
+ "minLength": 1,
481
+ "maxLength": 500,
482
+ "description": "OPTIONAL vetter-authored free text on how and when the session will happen. Attributed to the vetter."
483
+ },
484
+ "ext": {
485
+ "$ref": "#/$defs/Ext"
486
+ }
487
+ }
488
+ },
489
+ "Ext": {
490
+ "title": "Ext",
491
+ "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.",
492
+ "type": "object",
493
+ "minProperties": 1,
494
+ "additionalProperties": true,
495
+ "propertyNames": {
496
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
497
+ }
498
+ },
499
+ "VettingDocumentation": {
500
+ "title": "VettingDocumentation",
501
+ "type": "string",
502
+ "minLength": 1,
503
+ "maxLength": 64,
504
+ "pattern": "^[a-z][a-zA-Z0-9]*$",
505
+ "description": "A class of documentation, named in lowerCamelCase. Open rather than enumerated, because what documentation a vetter accepts is each vetter's own choice. Well-known values: `passport`, `nationalId`, `driverLicence`, and `none` — the vetter will attest without a document, which is the `priorAcquaintance` case. Only the class ever travels — never a document number, an image, an issuing authority or an expiry date. `none` states a policy (what a vetter accepts); a record of what was relied on expresses 'no document' as an empty list instead."
506
+ },
507
+ "VettingMethod": {
508
+ "title": "VettingMethod",
509
+ "type": "string",
510
+ "enum": [
511
+ "inPerson",
512
+ "video",
513
+ "priorAcquaintance"
514
+ ],
515
+ "description": "How the vetter established that the person they checked is the person controlling the applicant's DID. `inPerson` — both people were physically together. `video` — a live, two-way video call. `priorAcquaintance` — the vetter has known or worked with this person over a period, and attests from that knowledge rather than from a document. A method is a description of what happened, not an assurance level: which methods count, and how many of each, is community policy."
516
+ },
517
+ "DigestMultibase": {
518
+ "title": "DigestMultibase",
519
+ "description": "A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.\n\nMultihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.\n\nThis definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.\n\nRestricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that \"interoperability is not guaranteed between implementations using such values\", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.",
520
+ "type": "string",
521
+ "minLength": 16,
522
+ "pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
523
+ "examples": [
524
+ "zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
525
+ ]
526
+ }
527
+ }
528
+ } as const;
529
+
530
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
531
+ export const RESPONSE_PAYLOAD_SCHEMA = {
532
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
533
+ "$ref": "#/$defs/Response",
534
+ "$defs": {
535
+ "Ticket": {
536
+ "title": "Ticket",
537
+ "description": "A ticket the vetter issued: the short code a person reads or types, or the full-entropy QR form.",
538
+ "oneOf": [
539
+ {
540
+ "$ref": "#/$defs/ShortCodeTicket"
541
+ },
542
+ {
543
+ "$ref": "#/$defs/QrTicket"
544
+ }
545
+ ]
546
+ },
547
+ "ShortCodeTicket": {
548
+ "title": "ShortCodeTicket",
549
+ "type": "object",
550
+ "additionalProperties": false,
551
+ "required": [
552
+ "code"
553
+ ],
554
+ "properties": {
555
+ "code": {
556
+ "type": "string",
557
+ "pattern": "^[0-9A-HJKMNP-TV-Z]{4}-[0-9A-HJKMNP-TV-Z]{4}$",
558
+ "description": "Eight Crockford base32 characters, grouped four and four (40 bits). A secret the vetter handed over; not derived from anything."
559
+ }
560
+ }
561
+ },
562
+ "QrTicket": {
563
+ "title": "QrTicket",
564
+ "type": "object",
565
+ "additionalProperties": false,
566
+ "required": [
567
+ "ticketId",
568
+ "secret"
569
+ ],
570
+ "properties": {
571
+ "ticketId": {
572
+ "type": "string",
573
+ "minLength": 1,
574
+ "maxLength": 128,
575
+ "pattern": "^[A-Za-z0-9._:-]+$"
576
+ },
577
+ "secret": {
578
+ "type": "string",
579
+ "pattern": "^[A-Za-z0-9_-]{43}$",
580
+ "description": "32 random bytes, base64url without padding."
581
+ }
582
+ }
583
+ },
584
+ "EligibilityPresentation": {
585
+ "title": "EligibilityPresentation",
586
+ "description": "OPTIONAL. A W3C Verifiable Presentation by which the vetter shows the applicant that it currently holds the community's vetter role. Bound to this request by `nonce` (the vetting/request document's `id`, which the applicant chose) and to this applicant by `domain` (its `joinDid`), so it cannot be replayed to another request or another applicant. The applicant's check is advisory; the community evaluates eligibility again, authoritatively, when it decides. Members other than those defined here are permitted, as the VC data model allows.",
587
+ "type": "object",
588
+ "additionalProperties": true,
589
+ "required": [
590
+ "@context",
591
+ "type",
592
+ "holder",
593
+ "verifiableCredential",
594
+ "nonce",
595
+ "domain",
596
+ "proof"
597
+ ],
598
+ "properties": {
599
+ "@context": {
600
+ "type": "array",
601
+ "minItems": 1,
602
+ "items": {
603
+ "type": "string",
604
+ "minLength": 1,
605
+ "maxLength": 2048
606
+ },
607
+ "description": "JSON-LD contexts. The first item MUST be `https://www.w3.org/ns/credentials/v2` (stated here rather than as `prefixItems`, which the Rust generator cannot express)."
608
+ },
609
+ "type": {
610
+ "type": "array",
611
+ "minItems": 1,
612
+ "uniqueItems": true,
613
+ "items": {
614
+ "type": "string",
615
+ "minLength": 1,
616
+ "maxLength": 128
617
+ },
618
+ "description": "MUST include `VerifiablePresentation` (stated here rather than as `contains`, which the Rust generator cannot express)."
619
+ },
620
+ "holder": {
621
+ "type": "string",
622
+ "pattern": "^did:",
623
+ "description": "The vetter's DID — the response's `issuer`."
624
+ },
625
+ "verifiableCredential": {
626
+ "type": "array",
627
+ "minItems": 1,
628
+ "items": {
629
+ "type": "object"
630
+ },
631
+ "description": "Credentials presented (opaque here). MUST include the community-issued `CommunityRole` endorsement credential naming `holder`, whose `endorsement.role` is the manifest's `eligibleVetters.role` — see vtc/vetting/vetters/grant/0.1. MAY include others, such as the membership credential."
632
+ },
633
+ "nonce": {
634
+ "type": "string",
635
+ "minLength": 1,
636
+ "maxLength": 512,
637
+ "description": "The `id` of the vetting/request document this responds to."
638
+ },
639
+ "domain": {
640
+ "type": "string",
641
+ "pattern": "^did:",
642
+ "description": "The applicant's `joinDid` from that request."
643
+ },
644
+ "proof": {
645
+ "$ref": "#/$defs/EligibilityPresentationProof"
646
+ }
647
+ }
648
+ },
649
+ "EligibilityPresentationProof": {
650
+ "title": "EligibilityPresentationProof",
651
+ "description": "A W3C Data Integrity proof by `holder` over the presentation, `nonce` and `domain` included.",
652
+ "type": "object",
653
+ "additionalProperties": true,
654
+ "required": [
655
+ "type",
656
+ "cryptosuite",
657
+ "verificationMethod",
658
+ "proofPurpose",
659
+ "proofValue"
660
+ ],
661
+ "properties": {
662
+ "type": {
663
+ "type": "string",
664
+ "const": "DataIntegrityProof"
665
+ },
666
+ "cryptosuite": {
667
+ "type": "string",
668
+ "minLength": 1,
669
+ "maxLength": 64,
670
+ "pattern": "^[a-z0-9-]+$",
671
+ "description": "e.g. `eddsa-jcs-2022`."
672
+ },
673
+ "verificationMethod": {
674
+ "type": "string",
675
+ "pattern": "^did:",
676
+ "description": "A verification method of `holder`, authorized for `authentication`."
677
+ },
678
+ "proofPurpose": {
679
+ "type": "string",
680
+ "const": "authentication"
681
+ },
682
+ "created": {
683
+ "type": "string",
684
+ "format": "date-time"
685
+ },
686
+ "proofValue": {
687
+ "type": "string",
688
+ "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
689
+ }
690
+ }
691
+ },
692
+ "Response": {
693
+ "$anchor": "response",
694
+ "title": "Vetting Request — response payload",
695
+ "description": "The vetter accepts the request. A refusal is a trust-task-error, never a response document.",
696
+ "type": "object",
697
+ "additionalProperties": false,
698
+ "required": [
699
+ "requestId"
700
+ ],
701
+ "properties": {
702
+ "requestId": {
703
+ "type": "string",
704
+ "minLength": 1,
705
+ "maxLength": 128,
706
+ "description": "The vetter's handle for this accepted request, carried by the session and any decline."
707
+ },
708
+ "eligibilityVp": {
709
+ "$ref": "#/$defs/EligibilityPresentation"
710
+ },
711
+ "acceptsDocumentation": {
712
+ "type": "array",
713
+ "minItems": 1,
714
+ "uniqueItems": true,
715
+ "items": {
716
+ "$ref": "#/$defs/VettingDocumentation"
717
+ },
718
+ "description": "RECOMMENDED. What this vetter will rely on, so the applicant brings it — the vetter's own choice. `none` means the vetter attests from prior acquaintance."
719
+ },
720
+ "sessionHint": {
721
+ "type": "string",
722
+ "minLength": 1,
723
+ "maxLength": 500,
724
+ "description": "OPTIONAL vetter-authored free text on how and when the session will happen. Attributed to the vetter."
725
+ },
726
+ "ext": {
727
+ "$ref": "#/$defs/Ext"
728
+ }
729
+ }
730
+ },
731
+ "Ext": {
732
+ "title": "Ext",
733
+ "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.",
734
+ "type": "object",
735
+ "minProperties": 1,
736
+ "additionalProperties": true,
737
+ "propertyNames": {
738
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
739
+ }
740
+ },
741
+ "VettingDocumentation": {
742
+ "title": "VettingDocumentation",
743
+ "type": "string",
744
+ "minLength": 1,
745
+ "maxLength": 64,
746
+ "pattern": "^[a-z][a-zA-Z0-9]*$",
747
+ "description": "A class of documentation, named in lowerCamelCase. Open rather than enumerated, because what documentation a vetter accepts is each vetter's own choice. Well-known values: `passport`, `nationalId`, `driverLicence`, and `none` — the vetter will attest without a document, which is the `priorAcquaintance` case. Only the class ever travels — never a document number, an image, an issuing authority or an expiry date. `none` states a policy (what a vetter accepts); a record of what was relied on expresses 'no document' as an empty list instead."
748
+ },
749
+ "VettingMethod": {
750
+ "title": "VettingMethod",
751
+ "type": "string",
752
+ "enum": [
753
+ "inPerson",
754
+ "video",
755
+ "priorAcquaintance"
756
+ ],
757
+ "description": "How the vetter established that the person they checked is the person controlling the applicant's DID. `inPerson` — both people were physically together. `video` — a live, two-way video call. `priorAcquaintance` — the vetter has known or worked with this person over a period, and attests from that knowledge rather than from a document. A method is a description of what happened, not an assurance level: which methods count, and how many of each, is community policy."
758
+ },
759
+ "DigestMultibase": {
760
+ "title": "DigestMultibase",
761
+ "description": "A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.\n\nMultihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.\n\nThis definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.\n\nRestricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that \"interoperability is not guaranteed between implementations using such values\", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.",
762
+ "type": "string",
763
+ "minLength": 16,
764
+ "pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
765
+ "examples": [
766
+ "zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
767
+ ]
768
+ }
769
+ }
770
+ } as const;
771
+
772
+ /**
773
+ * SPEC.md §7.2 policy for the request variant, from this specification's
774
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
775
+ * per-specification and cannot be derived from the document alone, and
776
+ * item 2 needs the schema this carries.
777
+ */
778
+ export const SPEC = {
779
+ typeUri: TYPE_URI,
780
+ isBearer: false,
781
+ isProofRequired: true,
782
+ isRecipientRequired: true,
783
+ isIssuedAtRequired: true,
784
+ payloadSchema: PAYLOAD_SCHEMA,
785
+ } as const;
786
+
787
+ /**
788
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
789
+ * tracks the *issuer* party's requirement because a response swaps the
790
+ * parties (§7.3 item 5).
791
+ */
792
+ export const RESPONSE_SPEC = {
793
+ typeUri: RESPONSE_TYPE_URI,
794
+ isBearer: false,
795
+ isProofRequired: true,
796
+ isRecipientRequired: true,
797
+ isIssuedAtRequired: true,
798
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
799
+ } as const;