@openvtc/trust-tasks 0.19.8 → 0.19.10

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 (60) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/_shared/components.d.ts +147 -17
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/index.d.ts +5 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +5 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/vta/_shared/0.1/did-template.d.ts +1 -1
  9. package/dist/vta/_shared/0.1/did-template.d.ts.map +1 -1
  10. package/dist/vta/_shared/0.2/did-template.d.ts +16 -0
  11. package/dist/vta/_shared/0.2/did-template.d.ts.map +1 -0
  12. package/dist/vta/_shared/0.2/did-template.js +6 -0
  13. package/dist/vta/_shared/0.2/did-template.js.map +1 -0
  14. package/dist/vta/contexts/delete/1.0/payload.d.ts +32 -0
  15. package/dist/vta/contexts/delete/1.0/payload.d.ts.map +1 -1
  16. package/dist/vta/contexts/delete/1.0/payload.js +14 -0
  17. package/dist/vta/contexts/delete/1.0/payload.js.map +1 -1
  18. package/dist/vta/contexts/preview-delete/1.0/payload.d.ts +32 -0
  19. package/dist/vta/contexts/preview-delete/1.0/payload.d.ts.map +1 -1
  20. package/dist/vta/contexts/preview-delete/1.0/payload.js +14 -0
  21. package/dist/vta/contexts/preview-delete/1.0/payload.js.map +1 -1
  22. package/dist/vta/did-templates/create/2.0/payload.d.ts +1 -1
  23. package/dist/vta/did-templates/create/2.0/payload.d.ts.map +1 -1
  24. package/dist/vta/did-templates/create/3.0/payload.d.ts +1092 -0
  25. package/dist/vta/did-templates/create/3.0/payload.d.ts.map +1 -0
  26. package/dist/vta/did-templates/create/3.0/payload.js +682 -0
  27. package/dist/vta/did-templates/create/3.0/payload.js.map +1 -0
  28. package/dist/vta/did-templates/get/2.0/payload.d.ts +1 -1
  29. package/dist/vta/did-templates/get/2.0/payload.d.ts.map +1 -1
  30. package/dist/vta/did-templates/get/3.0/payload.d.ts +742 -0
  31. package/dist/vta/did-templates/get/3.0/payload.d.ts.map +1 -0
  32. package/dist/vta/did-templates/get/3.0/payload.js +461 -0
  33. package/dist/vta/did-templates/get/3.0/payload.js.map +1 -0
  34. package/dist/vta/did-templates/list/2.0/payload.d.ts +1 -1
  35. package/dist/vta/did-templates/list/2.0/payload.d.ts.map +1 -1
  36. package/dist/vta/did-templates/list/3.0/payload.d.ts +799 -0
  37. package/dist/vta/did-templates/list/3.0/payload.d.ts.map +1 -0
  38. package/dist/vta/did-templates/list/3.0/payload.js +487 -0
  39. package/dist/vta/did-templates/list/3.0/payload.js.map +1 -0
  40. package/dist/vta/did-templates/update/2.0/payload.d.ts +1 -1
  41. package/dist/vta/did-templates/update/2.0/payload.d.ts.map +1 -1
  42. package/dist/vta/did-templates/update/3.0/payload.d.ts +1106 -0
  43. package/dist/vta/did-templates/update/3.0/payload.d.ts.map +1 -0
  44. package/dist/vta/did-templates/update/3.0/payload.js +688 -0
  45. package/dist/vta/did-templates/update/3.0/payload.js.map +1 -0
  46. package/package.json +1 -1
  47. package/src/_shared/components.ts +152 -18
  48. package/src/index.ts +5 -0
  49. package/src/vta/_shared/0.1/did-template.ts +1 -1
  50. package/src/vta/_shared/0.2/did-template.ts +17 -0
  51. package/src/vta/contexts/delete/1.0/payload.ts +18 -0
  52. package/src/vta/contexts/preview-delete/1.0/payload.ts +18 -0
  53. package/src/vta/did-templates/create/2.0/payload.ts +1 -1
  54. package/src/vta/did-templates/create/3.0/payload.ts +717 -0
  55. package/src/vta/did-templates/get/2.0/payload.ts +1 -1
  56. package/src/vta/did-templates/get/3.0/payload.ts +496 -0
  57. package/src/vta/did-templates/list/2.0/payload.ts +1 -1
  58. package/src/vta/did-templates/list/3.0/payload.ts +531 -0
  59. package/src/vta/did-templates/update/2.0/payload.ts +1 -1
  60. package/src/vta/did-templates/update/3.0/payload.ts +727 -0
@@ -0,0 +1,688 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vta/did-templates/update/3.0/payload.schema.json
4
+ */
5
+ /** Trust Task type URI. */
6
+ export const TYPE_URI = "https://trusttasks.org/spec/vta/did-templates/update/3.0";
7
+ /** Trust Task response type URI (request type URI + "#response"). */
8
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/did-templates/update/3.0#response";
9
+ /**
10
+ * This specification's payload schema, as a value.
11
+ *
12
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
13
+ * rather than only as a `.json` file because TypeScript types are erased
14
+ * at runtime: without a schema a consumer has nothing to validate, and
15
+ * every REQUIRED payload member is optional in practice. Cross-file
16
+ * `$ref`s are already inlined, so it needs no resolver.
17
+ */
18
+ export const PAYLOAD_SCHEMA = {
19
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
20
+ "$id": "https://trusttasks.org/spec/vta/did-templates/update/3.0",
21
+ "title": "VTA DID-Template Update — payload",
22
+ "description": "Replace an existing DID template on a VTA. Omit `contextId` to replace in the global scope (super-admin gated); set it to replace a template scoped to that context (gated on the context's admin, or a super-admin). The `name` is the resource id within the selected scope and MUST equal `template.name`; the VTA replaces the stored body, preserving createdAt/createdBy and advancing updatedAt. The success response is the persisted DidTemplateRecord.",
23
+ "type": "object",
24
+ "additionalProperties": false,
25
+ "required": [
26
+ "name",
27
+ "template"
28
+ ],
29
+ "properties": {
30
+ "contextId": {
31
+ "type": "string",
32
+ "minLength": 1,
33
+ "description": "Scope selector. Absent: the global scope, gated on a super-administrator. Present: the context the template is scoped to, gated on that context's administrator (or a super-administrator)."
34
+ },
35
+ "name": {
36
+ "type": "string",
37
+ "minLength": 1,
38
+ "description": "Resource id — the template's name within the selected scope. MUST equal `template.name` or the VTA rejects with the framework's `malformedRequest`."
39
+ },
40
+ "template": {
41
+ "$ref": "#/$defs/DidTemplate",
42
+ "description": "Full replacement template document. Validated against the v1 template schema before persistence; an invalid shape is rejected with the framework's `malformedRequest`."
43
+ },
44
+ "ext": {
45
+ "$ref": "#/$defs/Ext",
46
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
47
+ }
48
+ },
49
+ "$defs": {
50
+ "Response": {
51
+ "$anchor": "response",
52
+ "title": "VTA DID-Template Update — response payload",
53
+ "description": "The persisted DidTemplateRecord after replacement. The DidTemplate fields are flattened at the top level alongside the resolved scope and provenance metadata (createdAt/createdBy preserved, updatedAt advanced). Same shape returned by create/get.",
54
+ "$ref": "#/$defs/DidTemplateRecord"
55
+ },
56
+ "DidTemplateRecord": {
57
+ "title": "DidTemplateRecord",
58
+ "description": "A persisted template. The DidTemplate fields are flattened at the top level alongside the resolved scope and provenance metadata. Same shape returned by get/create/update and carried per-item by list.",
59
+ "type": "object",
60
+ "additionalProperties": false,
61
+ "required": [
62
+ "schemaVersion",
63
+ "name",
64
+ "kind",
65
+ "document",
66
+ "scope",
67
+ "createdAt",
68
+ "updatedAt",
69
+ "createdBy"
70
+ ],
71
+ "properties": {
72
+ "schemaVersion": {
73
+ "type": "integer",
74
+ "enum": [
75
+ 1,
76
+ 2
77
+ ],
78
+ "description": "Template schema version. 1 is the historical shape, whose keys are implicitly an Ed25519 signing key and an X25519 key-agreement key. 2 adds the `keys` block, which makes those explicit and allows others."
79
+ },
80
+ "name": {
81
+ "type": "string",
82
+ "minLength": 1,
83
+ "maxLength": 64,
84
+ "pattern": "^[a-z0-9-]+$"
85
+ },
86
+ "kind": {
87
+ "type": "string",
88
+ "minLength": 1
89
+ },
90
+ "description": {
91
+ "type": [
92
+ "string",
93
+ "null"
94
+ ],
95
+ "maxLength": 1024
96
+ },
97
+ "methods": {
98
+ "type": "array",
99
+ "items": {
100
+ "type": "string"
101
+ }
102
+ },
103
+ "requiredVars": {
104
+ "type": "array",
105
+ "items": {
106
+ "type": "string"
107
+ }
108
+ },
109
+ "optionalVars": {
110
+ "type": "object",
111
+ "additionalProperties": true
112
+ },
113
+ "defaults": {
114
+ "type": "object",
115
+ "additionalProperties": true
116
+ },
117
+ "keys": {
118
+ "type": "object",
119
+ "minProperties": 1,
120
+ "additionalProperties": {
121
+ "type": "object",
122
+ "additionalProperties": false,
123
+ "required": [
124
+ "purpose",
125
+ "algorithms"
126
+ ],
127
+ "properties": {
128
+ "purpose": {
129
+ "type": "string",
130
+ "enum": [
131
+ "signing",
132
+ "keyAgreement"
133
+ ],
134
+ "description": "What the key is for. Deliberately coarser than DID Core's five verification relationships: the template says what the key is, and the `document` body says where it appears. Encoding the relationship here as well would let the two disagree."
135
+ },
136
+ "algorithms": {
137
+ "type": "array",
138
+ "minItems": 1,
139
+ "items": {
140
+ "type": "string",
141
+ "enum": [
142
+ "ed25519",
143
+ "x25519",
144
+ "p256",
145
+ "mldsa44",
146
+ "mldsa65"
147
+ ]
148
+ },
149
+ "description": "Acceptable algorithms, MOST PREFERRED FIRST. A list rather than a single value because a fleet does not migrate atomically: `[\"mldsa44\", \"ed25519\"]` means mint ML-DSA-44 where the implementation can and Ed25519 otherwise, so one template serves a VTA with post-quantum support and one without. An implementation MUST NOT substitute an algorithm absent from this list; running out of candidates is an error, never a silent downgrade — a deployment intended to be post-quantum would otherwise ship classical keys with nothing reporting it. `minItems: 1` for the same reason: an empty list would express no preference and inherit whatever the implementation defaulted to."
150
+ }
151
+ }
152
+ },
153
+ "propertyNames": {
154
+ "pattern": "^[a-z0-9-]+$"
155
+ },
156
+ "description": "The keys this template needs, by slot name. REQUIRES `schemaVersion` 2.\n\nA slot's name becomes a document placeholder by an explicit rule — uppercase, `-` to `_`, suffix `_KEY_MB` — so slot `signing` is rendered into `{SIGNING_KEY_MB}` and slot `ka` into `{KA_KEY_MB}`. Those are the two names a `schemaVersion` 1 template already uses, which is deliberate: a v1 template is exactly a v2 template whose `keys` block is `{signing: [ed25519], ka: [x25519]}`, so an implementation can read both through one path and raising the version cannot change how a v1 template renders.\n\nAn implementation MUST refuse a template that declares a slot whose placeholder never appears in `document` — the key would be minted and never published, so verifiers would continue to see only the keys that are, while the operator believes the template migrated. It MUST likewise refuse a slot placeholder in `document` that no slot declares, which would render as an unsubstituted literal."
157
+ },
158
+ "document": {
159
+ "type": "object"
160
+ },
161
+ "scope": {
162
+ "$ref": "#/$defs/Scope",
163
+ "description": "Resolved scope of the stored template."
164
+ },
165
+ "createdAt": {
166
+ "type": "integer",
167
+ "description": "UTC unix-epoch seconds the template was first stored."
168
+ },
169
+ "updatedAt": {
170
+ "type": "integer",
171
+ "description": "UTC unix-epoch seconds of the last write."
172
+ },
173
+ "createdBy": {
174
+ "type": "string",
175
+ "description": "DID of the admin who last wrote the template."
176
+ }
177
+ }
178
+ },
179
+ "Scope": {
180
+ "title": "Scope",
181
+ "description": "Where a stored template lives. Tagged by `type`.",
182
+ "type": "object",
183
+ "oneOf": [
184
+ {
185
+ "title": "Builtin",
186
+ "type": "object",
187
+ "additionalProperties": false,
188
+ "required": [
189
+ "type"
190
+ ],
191
+ "properties": {
192
+ "type": {
193
+ "const": "builtin"
194
+ }
195
+ }
196
+ },
197
+ {
198
+ "title": "Global",
199
+ "type": "object",
200
+ "additionalProperties": false,
201
+ "required": [
202
+ "type"
203
+ ],
204
+ "properties": {
205
+ "type": {
206
+ "const": "global"
207
+ }
208
+ }
209
+ },
210
+ {
211
+ "title": "Context",
212
+ "type": "object",
213
+ "additionalProperties": false,
214
+ "required": [
215
+ "type",
216
+ "contextId"
217
+ ],
218
+ "properties": {
219
+ "type": {
220
+ "const": "context"
221
+ },
222
+ "contextId": {
223
+ "type": "string",
224
+ "minLength": 1
225
+ }
226
+ }
227
+ }
228
+ ]
229
+ },
230
+ "Ext": {
231
+ "title": "Ext",
232
+ "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.",
233
+ "type": "object",
234
+ "minProperties": 1,
235
+ "additionalProperties": true,
236
+ "propertyNames": {
237
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
238
+ }
239
+ },
240
+ "DidTemplate": {
241
+ "title": "DidTemplate",
242
+ "description": "Authored template shape: a DID document with `{TOKEN}` placeholders plus the variable contract the VTA's renderer enforces.",
243
+ "type": "object",
244
+ "additionalProperties": false,
245
+ "required": [
246
+ "schemaVersion",
247
+ "name",
248
+ "kind",
249
+ "document"
250
+ ],
251
+ "properties": {
252
+ "schemaVersion": {
253
+ "type": "integer",
254
+ "description": "Template schema version. 1 is the historical shape, whose keys are implicitly an Ed25519 signing key and an X25519 key-agreement key. 2 adds the `keys` block, which makes those explicit and allows others.",
255
+ "enum": [
256
+ 1,
257
+ 2
258
+ ]
259
+ },
260
+ "name": {
261
+ "type": "string",
262
+ "minLength": 1,
263
+ "maxLength": 64,
264
+ "pattern": "^[a-z0-9-]+$",
265
+ "description": "Template id within its scope. Lowercase alphanumeric and hyphen only."
266
+ },
267
+ "kind": {
268
+ "type": "string",
269
+ "minLength": 1,
270
+ "description": "Classification hint, e.g. `mediator`, `did-host-http`, `app`. Drives downstream provisioning behaviour."
271
+ },
272
+ "description": {
273
+ "type": [
274
+ "string",
275
+ "null"
276
+ ],
277
+ "maxLength": 1024,
278
+ "description": "Human-readable description of what the template provisions."
279
+ },
280
+ "methods": {
281
+ "type": "array",
282
+ "items": {
283
+ "type": "string"
284
+ },
285
+ "description": "DID methods this template targets, e.g. [\"webvh\", \"web\"] for a hosted DID or [\"key\"] for a did:key."
286
+ },
287
+ "requiredVars": {
288
+ "type": "array",
289
+ "items": {
290
+ "type": "string"
291
+ },
292
+ "description": "Variables the caller MUST supply at render time. MUST NOT include reserved ambient names (DID, SIGNING_KEY_MB, KA_KEY_MB, VTA_DID, VTA_URL, CONTEXT_ID, CONTEXT_DID, NOW)."
293
+ },
294
+ "optionalVars": {
295
+ "type": "object",
296
+ "description": "Variables with default values, keyed by variable name.",
297
+ "additionalProperties": true
298
+ },
299
+ "defaults": {
300
+ "type": "object",
301
+ "description": "Hints for CLI / setup wizards (e.g. preRotationCount, portable, addMediatorService).",
302
+ "additionalProperties": true
303
+ },
304
+ "keys": {
305
+ "type": "object",
306
+ "minProperties": 1,
307
+ "additionalProperties": {
308
+ "type": "object",
309
+ "additionalProperties": false,
310
+ "required": [
311
+ "purpose",
312
+ "algorithms"
313
+ ],
314
+ "properties": {
315
+ "purpose": {
316
+ "type": "string",
317
+ "enum": [
318
+ "signing",
319
+ "keyAgreement"
320
+ ],
321
+ "description": "What the key is for. Deliberately coarser than DID Core's five verification relationships: the template says what the key is, and the `document` body says where it appears. Encoding the relationship here as well would let the two disagree."
322
+ },
323
+ "algorithms": {
324
+ "type": "array",
325
+ "minItems": 1,
326
+ "items": {
327
+ "type": "string",
328
+ "enum": [
329
+ "ed25519",
330
+ "x25519",
331
+ "p256",
332
+ "mldsa44",
333
+ "mldsa65"
334
+ ]
335
+ },
336
+ "description": "Acceptable algorithms, MOST PREFERRED FIRST. A list rather than a single value because a fleet does not migrate atomically: `[\"mldsa44\", \"ed25519\"]` means mint ML-DSA-44 where the implementation can and Ed25519 otherwise, so one template serves a VTA with post-quantum support and one without. An implementation MUST NOT substitute an algorithm absent from this list; running out of candidates is an error, never a silent downgrade — a deployment intended to be post-quantum would otherwise ship classical keys with nothing reporting it. `minItems: 1` for the same reason: an empty list would express no preference and inherit whatever the implementation defaulted to."
337
+ }
338
+ }
339
+ },
340
+ "propertyNames": {
341
+ "pattern": "^[a-z0-9-]+$"
342
+ },
343
+ "description": "The keys this template needs, by slot name. REQUIRES `schemaVersion` 2.\n\nA slot's name becomes a document placeholder by an explicit rule — uppercase, `-` to `_`, suffix `_KEY_MB` — so slot `signing` is rendered into `{SIGNING_KEY_MB}` and slot `ka` into `{KA_KEY_MB}`. Those are the two names a `schemaVersion` 1 template already uses, which is deliberate: a v1 template is exactly a v2 template whose `keys` block is `{signing: [ed25519], ka: [x25519]}`, so an implementation can read both through one path and raising the version cannot change how a v1 template renders.\n\nAn implementation MUST refuse a template that declares a slot whose placeholder never appears in `document` — the key would be minted and never published, so verifiers would continue to see only the keys that are, while the operator believes the template migrated. It MUST likewise refuse a slot placeholder in `document` that no slot declares, which would render as an unsubstituted literal."
344
+ },
345
+ "document": {
346
+ "type": "object",
347
+ "description": "The DID document body with `{TOKEN}` placeholders. `document.id` MUST contain the `{DID}` placeholder. Every `{TOKEN}` MUST be declared in requiredVars/optionalVars or be a reserved ambient name."
348
+ }
349
+ }
350
+ }
351
+ }
352
+ };
353
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
354
+ export const RESPONSE_PAYLOAD_SCHEMA = {
355
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
356
+ "$ref": "#/$defs/Response",
357
+ "$defs": {
358
+ "Response": {
359
+ "$anchor": "response",
360
+ "title": "VTA DID-Template Update — response payload",
361
+ "description": "The persisted DidTemplateRecord after replacement. The DidTemplate fields are flattened at the top level alongside the resolved scope and provenance metadata (createdAt/createdBy preserved, updatedAt advanced). Same shape returned by create/get.",
362
+ "$ref": "#/$defs/DidTemplateRecord"
363
+ },
364
+ "DidTemplateRecord": {
365
+ "title": "DidTemplateRecord",
366
+ "description": "A persisted template. The DidTemplate fields are flattened at the top level alongside the resolved scope and provenance metadata. Same shape returned by get/create/update and carried per-item by list.",
367
+ "type": "object",
368
+ "additionalProperties": false,
369
+ "required": [
370
+ "schemaVersion",
371
+ "name",
372
+ "kind",
373
+ "document",
374
+ "scope",
375
+ "createdAt",
376
+ "updatedAt",
377
+ "createdBy"
378
+ ],
379
+ "properties": {
380
+ "schemaVersion": {
381
+ "type": "integer",
382
+ "enum": [
383
+ 1,
384
+ 2
385
+ ],
386
+ "description": "Template schema version. 1 is the historical shape, whose keys are implicitly an Ed25519 signing key and an X25519 key-agreement key. 2 adds the `keys` block, which makes those explicit and allows others."
387
+ },
388
+ "name": {
389
+ "type": "string",
390
+ "minLength": 1,
391
+ "maxLength": 64,
392
+ "pattern": "^[a-z0-9-]+$"
393
+ },
394
+ "kind": {
395
+ "type": "string",
396
+ "minLength": 1
397
+ },
398
+ "description": {
399
+ "type": [
400
+ "string",
401
+ "null"
402
+ ],
403
+ "maxLength": 1024
404
+ },
405
+ "methods": {
406
+ "type": "array",
407
+ "items": {
408
+ "type": "string"
409
+ }
410
+ },
411
+ "requiredVars": {
412
+ "type": "array",
413
+ "items": {
414
+ "type": "string"
415
+ }
416
+ },
417
+ "optionalVars": {
418
+ "type": "object",
419
+ "additionalProperties": true
420
+ },
421
+ "defaults": {
422
+ "type": "object",
423
+ "additionalProperties": true
424
+ },
425
+ "keys": {
426
+ "type": "object",
427
+ "minProperties": 1,
428
+ "additionalProperties": {
429
+ "type": "object",
430
+ "additionalProperties": false,
431
+ "required": [
432
+ "purpose",
433
+ "algorithms"
434
+ ],
435
+ "properties": {
436
+ "purpose": {
437
+ "type": "string",
438
+ "enum": [
439
+ "signing",
440
+ "keyAgreement"
441
+ ],
442
+ "description": "What the key is for. Deliberately coarser than DID Core's five verification relationships: the template says what the key is, and the `document` body says where it appears. Encoding the relationship here as well would let the two disagree."
443
+ },
444
+ "algorithms": {
445
+ "type": "array",
446
+ "minItems": 1,
447
+ "items": {
448
+ "type": "string",
449
+ "enum": [
450
+ "ed25519",
451
+ "x25519",
452
+ "p256",
453
+ "mldsa44",
454
+ "mldsa65"
455
+ ]
456
+ },
457
+ "description": "Acceptable algorithms, MOST PREFERRED FIRST. A list rather than a single value because a fleet does not migrate atomically: `[\"mldsa44\", \"ed25519\"]` means mint ML-DSA-44 where the implementation can and Ed25519 otherwise, so one template serves a VTA with post-quantum support and one without. An implementation MUST NOT substitute an algorithm absent from this list; running out of candidates is an error, never a silent downgrade — a deployment intended to be post-quantum would otherwise ship classical keys with nothing reporting it. `minItems: 1` for the same reason: an empty list would express no preference and inherit whatever the implementation defaulted to."
458
+ }
459
+ }
460
+ },
461
+ "propertyNames": {
462
+ "pattern": "^[a-z0-9-]+$"
463
+ },
464
+ "description": "The keys this template needs, by slot name. REQUIRES `schemaVersion` 2.\n\nA slot's name becomes a document placeholder by an explicit rule — uppercase, `-` to `_`, suffix `_KEY_MB` — so slot `signing` is rendered into `{SIGNING_KEY_MB}` and slot `ka` into `{KA_KEY_MB}`. Those are the two names a `schemaVersion` 1 template already uses, which is deliberate: a v1 template is exactly a v2 template whose `keys` block is `{signing: [ed25519], ka: [x25519]}`, so an implementation can read both through one path and raising the version cannot change how a v1 template renders.\n\nAn implementation MUST refuse a template that declares a slot whose placeholder never appears in `document` — the key would be minted and never published, so verifiers would continue to see only the keys that are, while the operator believes the template migrated. It MUST likewise refuse a slot placeholder in `document` that no slot declares, which would render as an unsubstituted literal."
465
+ },
466
+ "document": {
467
+ "type": "object"
468
+ },
469
+ "scope": {
470
+ "$ref": "#/$defs/Scope",
471
+ "description": "Resolved scope of the stored template."
472
+ },
473
+ "createdAt": {
474
+ "type": "integer",
475
+ "description": "UTC unix-epoch seconds the template was first stored."
476
+ },
477
+ "updatedAt": {
478
+ "type": "integer",
479
+ "description": "UTC unix-epoch seconds of the last write."
480
+ },
481
+ "createdBy": {
482
+ "type": "string",
483
+ "description": "DID of the admin who last wrote the template."
484
+ }
485
+ }
486
+ },
487
+ "Scope": {
488
+ "title": "Scope",
489
+ "description": "Where a stored template lives. Tagged by `type`.",
490
+ "type": "object",
491
+ "oneOf": [
492
+ {
493
+ "title": "Builtin",
494
+ "type": "object",
495
+ "additionalProperties": false,
496
+ "required": [
497
+ "type"
498
+ ],
499
+ "properties": {
500
+ "type": {
501
+ "const": "builtin"
502
+ }
503
+ }
504
+ },
505
+ {
506
+ "title": "Global",
507
+ "type": "object",
508
+ "additionalProperties": false,
509
+ "required": [
510
+ "type"
511
+ ],
512
+ "properties": {
513
+ "type": {
514
+ "const": "global"
515
+ }
516
+ }
517
+ },
518
+ {
519
+ "title": "Context",
520
+ "type": "object",
521
+ "additionalProperties": false,
522
+ "required": [
523
+ "type",
524
+ "contextId"
525
+ ],
526
+ "properties": {
527
+ "type": {
528
+ "const": "context"
529
+ },
530
+ "contextId": {
531
+ "type": "string",
532
+ "minLength": 1
533
+ }
534
+ }
535
+ }
536
+ ]
537
+ },
538
+ "Ext": {
539
+ "title": "Ext",
540
+ "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.",
541
+ "type": "object",
542
+ "minProperties": 1,
543
+ "additionalProperties": true,
544
+ "propertyNames": {
545
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
546
+ }
547
+ },
548
+ "DidTemplate": {
549
+ "title": "DidTemplate",
550
+ "description": "Authored template shape: a DID document with `{TOKEN}` placeholders plus the variable contract the VTA's renderer enforces.",
551
+ "type": "object",
552
+ "additionalProperties": false,
553
+ "required": [
554
+ "schemaVersion",
555
+ "name",
556
+ "kind",
557
+ "document"
558
+ ],
559
+ "properties": {
560
+ "schemaVersion": {
561
+ "type": "integer",
562
+ "description": "Template schema version. 1 is the historical shape, whose keys are implicitly an Ed25519 signing key and an X25519 key-agreement key. 2 adds the `keys` block, which makes those explicit and allows others.",
563
+ "enum": [
564
+ 1,
565
+ 2
566
+ ]
567
+ },
568
+ "name": {
569
+ "type": "string",
570
+ "minLength": 1,
571
+ "maxLength": 64,
572
+ "pattern": "^[a-z0-9-]+$",
573
+ "description": "Template id within its scope. Lowercase alphanumeric and hyphen only."
574
+ },
575
+ "kind": {
576
+ "type": "string",
577
+ "minLength": 1,
578
+ "description": "Classification hint, e.g. `mediator`, `did-host-http`, `app`. Drives downstream provisioning behaviour."
579
+ },
580
+ "description": {
581
+ "type": [
582
+ "string",
583
+ "null"
584
+ ],
585
+ "maxLength": 1024,
586
+ "description": "Human-readable description of what the template provisions."
587
+ },
588
+ "methods": {
589
+ "type": "array",
590
+ "items": {
591
+ "type": "string"
592
+ },
593
+ "description": "DID methods this template targets, e.g. [\"webvh\", \"web\"] for a hosted DID or [\"key\"] for a did:key."
594
+ },
595
+ "requiredVars": {
596
+ "type": "array",
597
+ "items": {
598
+ "type": "string"
599
+ },
600
+ "description": "Variables the caller MUST supply at render time. MUST NOT include reserved ambient names (DID, SIGNING_KEY_MB, KA_KEY_MB, VTA_DID, VTA_URL, CONTEXT_ID, CONTEXT_DID, NOW)."
601
+ },
602
+ "optionalVars": {
603
+ "type": "object",
604
+ "description": "Variables with default values, keyed by variable name.",
605
+ "additionalProperties": true
606
+ },
607
+ "defaults": {
608
+ "type": "object",
609
+ "description": "Hints for CLI / setup wizards (e.g. preRotationCount, portable, addMediatorService).",
610
+ "additionalProperties": true
611
+ },
612
+ "keys": {
613
+ "type": "object",
614
+ "minProperties": 1,
615
+ "additionalProperties": {
616
+ "type": "object",
617
+ "additionalProperties": false,
618
+ "required": [
619
+ "purpose",
620
+ "algorithms"
621
+ ],
622
+ "properties": {
623
+ "purpose": {
624
+ "type": "string",
625
+ "enum": [
626
+ "signing",
627
+ "keyAgreement"
628
+ ],
629
+ "description": "What the key is for. Deliberately coarser than DID Core's five verification relationships: the template says what the key is, and the `document` body says where it appears. Encoding the relationship here as well would let the two disagree."
630
+ },
631
+ "algorithms": {
632
+ "type": "array",
633
+ "minItems": 1,
634
+ "items": {
635
+ "type": "string",
636
+ "enum": [
637
+ "ed25519",
638
+ "x25519",
639
+ "p256",
640
+ "mldsa44",
641
+ "mldsa65"
642
+ ]
643
+ },
644
+ "description": "Acceptable algorithms, MOST PREFERRED FIRST. A list rather than a single value because a fleet does not migrate atomically: `[\"mldsa44\", \"ed25519\"]` means mint ML-DSA-44 where the implementation can and Ed25519 otherwise, so one template serves a VTA with post-quantum support and one without. An implementation MUST NOT substitute an algorithm absent from this list; running out of candidates is an error, never a silent downgrade — a deployment intended to be post-quantum would otherwise ship classical keys with nothing reporting it. `minItems: 1` for the same reason: an empty list would express no preference and inherit whatever the implementation defaulted to."
645
+ }
646
+ }
647
+ },
648
+ "propertyNames": {
649
+ "pattern": "^[a-z0-9-]+$"
650
+ },
651
+ "description": "The keys this template needs, by slot name. REQUIRES `schemaVersion` 2.\n\nA slot's name becomes a document placeholder by an explicit rule — uppercase, `-` to `_`, suffix `_KEY_MB` — so slot `signing` is rendered into `{SIGNING_KEY_MB}` and slot `ka` into `{KA_KEY_MB}`. Those are the two names a `schemaVersion` 1 template already uses, which is deliberate: a v1 template is exactly a v2 template whose `keys` block is `{signing: [ed25519], ka: [x25519]}`, so an implementation can read both through one path and raising the version cannot change how a v1 template renders.\n\nAn implementation MUST refuse a template that declares a slot whose placeholder never appears in `document` — the key would be minted and never published, so verifiers would continue to see only the keys that are, while the operator believes the template migrated. It MUST likewise refuse a slot placeholder in `document` that no slot declares, which would render as an unsubstituted literal."
652
+ },
653
+ "document": {
654
+ "type": "object",
655
+ "description": "The DID document body with `{TOKEN}` placeholders. `document.id` MUST contain the `{DID}` placeholder. Every `{TOKEN}` MUST be declared in requiredVars/optionalVars or be a reserved ambient name."
656
+ }
657
+ }
658
+ }
659
+ }
660
+ };
661
+ /**
662
+ * SPEC.md §7.2 policy for the request variant, from this specification's
663
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
664
+ * per-specification and cannot be derived from the document alone, and
665
+ * item 2 needs the schema this carries.
666
+ */
667
+ export const SPEC = {
668
+ typeUri: TYPE_URI,
669
+ isBearer: false,
670
+ isProofRequired: true,
671
+ isRecipientRequired: true,
672
+ isIssuedAtRequired: true,
673
+ payloadSchema: PAYLOAD_SCHEMA,
674
+ };
675
+ /**
676
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
677
+ * tracks the *issuer* party's requirement because a response swaps the
678
+ * parties (§7.3 item 5).
679
+ */
680
+ export const RESPONSE_SPEC = {
681
+ typeUri: RESPONSE_TYPE_URI,
682
+ isBearer: false,
683
+ isProofRequired: true,
684
+ isRecipientRequired: true,
685
+ isIssuedAtRequired: true,
686
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
687
+ };
688
+ //# sourceMappingURL=payload.js.map