@openvtc/trust-tasks 0.18.5 → 0.19.1

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.
@@ -0,0 +1,369 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vta/contexts/secrets/1.0/payload.schema.json
4
+ */
5
+ import type { Ext } from "../../../../_shared/components.js";
6
+ /**
7
+ * Names the trust context whose DID key material is being asked for. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.
8
+ */
9
+ export interface VTAContextSecretsPayload {
10
+ /**
11
+ * Context id. For a nested context this is the full path (`parent/leaf`). Named `id` to match the rest of the `vta/contexts/*` family, where it always identifies the context being acted on.
12
+ */
13
+ id: string;
14
+ ext?: Ext;
15
+ }
16
+ /**
17
+ * The context's DID and the private key material behind it, sufficient to operate as that DID and nothing more. Failures use trust-task-error, not this shape. Type https://trusttasks.org/spec/vta/contexts/secrets/1.0#response.
18
+ */
19
+ export interface VTAContextSecretsResponsePayload {
20
+ /**
21
+ * The DID the returned secrets belong to — the DID recorded on the named context. Every `keyId` below is a verification method of this DID, so a consumer can check the two agree before installing anything.
22
+ */
23
+ did: string;
24
+ /**
25
+ * One entry per verification method of `did` whose secret the recipient holds and is willing to release. MAY be empty: a context whose DID has no releasable key material is not an error, and a consumer that treats an empty array as a failure will misreport a context that is merely not provisioned yet.
26
+ */
27
+ secrets: SecretEntry[];
28
+ }
29
+ /**
30
+ * One private key, named by the verification method it backs.
31
+ */
32
+ export interface SecretEntry {
33
+ /**
34
+ * The verification method this key backs, as an absolute DID URL under the response's `did` (`{did}#key-0`). It is the DID document — not the recipient's own storage — that decides this name, so a consumer installs the key under a `kid` that an inbound message's recipient field will actually match.
35
+ */
36
+ keyId: string;
37
+ /**
38
+ * What the key is for, and how to reconstruct it. `ed25519` signs, `x25519` is a key-agreement key and signs nothing, `p256` is an ECDSA key for ES256. Stated as well as encoded in `privateKeyMultibase` so a consumer can select a key by purpose without decoding every entry.
39
+ */
40
+ keyType: "ed25519" | "x25519" | "p256";
41
+ /**
42
+ * The private key, multibase-encoded (Base58BTC, `z` prefix) over its multicodec-prefixed bytes — `0x1300` Ed25519, `0x1302` X25519, `0x1306` P-256. The multicodec prefix, not this member's position in the array, is what identifies the key material.
43
+ */
44
+ privateKeyMultibase: string;
45
+ }
46
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
47
+ export type { Ext };
48
+ /** Trust Task type URI. */
49
+ export declare const TYPE_URI: "https://trusttasks.org/spec/vta/contexts/secrets/1.0";
50
+ /** Stable alias for this specification's request payload shape. */
51
+ export type Payload = VTAContextSecretsPayload;
52
+ /** Trust Task response type URI (request type URI + "#response"). */
53
+ export declare const RESPONSE_TYPE_URI: "https://trusttasks.org/spec/vta/contexts/secrets/1.0#response";
54
+ /** Stable alias for this specification's success-response payload shape. */
55
+ export type Response = VTAContextSecretsResponsePayload;
56
+ /**
57
+ * This specification's payload schema, as a value.
58
+ *
59
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
60
+ * rather than only as a `.json` file because TypeScript types are erased
61
+ * at runtime: without a schema a consumer has nothing to validate, and
62
+ * every REQUIRED payload member is optional in practice. Cross-file
63
+ * `$ref`s are already inlined, so it needs no resolver.
64
+ */
65
+ export declare const PAYLOAD_SCHEMA: {
66
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
67
+ readonly $id: "https://trusttasks.org/spec/vta/contexts/secrets/1.0";
68
+ readonly title: "VTA Context Secrets — payload";
69
+ readonly description: "Names the trust context whose DID key material is being asked for. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.";
70
+ readonly type: "object";
71
+ readonly additionalProperties: false;
72
+ readonly required: readonly ["id"];
73
+ readonly properties: {
74
+ readonly id: {
75
+ readonly type: "string";
76
+ readonly minLength: 1;
77
+ readonly description: "Context id. For a nested context this is the full path (`parent/leaf`). Named `id` to match the rest of the `vta/contexts/*` family, where it always identifies the context being acted on.";
78
+ };
79
+ readonly ext: {
80
+ readonly $ref: "#/$defs/Ext";
81
+ };
82
+ };
83
+ readonly $defs: {
84
+ readonly Response: {
85
+ readonly $anchor: "response";
86
+ readonly title: "VTA Context Secrets — response payload";
87
+ readonly type: "object";
88
+ readonly additionalProperties: false;
89
+ readonly required: readonly ["did", "secrets"];
90
+ readonly description: "The context's DID and the private key material behind it, sufficient to operate as that DID and nothing more. Failures use trust-task-error, not this shape. Type https://trusttasks.org/spec/vta/contexts/secrets/1.0#response.";
91
+ readonly properties: {
92
+ readonly did: {
93
+ readonly type: "string";
94
+ readonly minLength: 1;
95
+ readonly description: "The DID the returned secrets belong to — the DID recorded on the named context. Every `keyId` below is a verification method of this DID, so a consumer can check the two agree before installing anything.";
96
+ };
97
+ readonly secrets: {
98
+ readonly type: "array";
99
+ readonly description: "One entry per verification method of `did` whose secret the recipient holds and is willing to release. MAY be empty: a context whose DID has no releasable key material is not an error, and a consumer that treats an empty array as a failure will misreport a context that is merely not provisioned yet.";
100
+ readonly items: {
101
+ readonly $ref: "#/$defs/SecretEntry";
102
+ };
103
+ };
104
+ };
105
+ };
106
+ readonly SecretEntry: {
107
+ readonly title: "Secret entry";
108
+ readonly type: "object";
109
+ readonly additionalProperties: false;
110
+ readonly required: readonly ["keyId", "keyType", "privateKeyMultibase"];
111
+ readonly description: "One private key, named by the verification method it backs.";
112
+ readonly properties: {
113
+ readonly keyId: {
114
+ readonly type: "string";
115
+ readonly minLength: 1;
116
+ readonly description: "The verification method this key backs, as an absolute DID URL under the response's `did` (`{did}#key-0`). It is the DID document — not the recipient's own storage — that decides this name, so a consumer installs the key under a `kid` that an inbound message's recipient field will actually match.";
117
+ };
118
+ readonly keyType: {
119
+ readonly type: "string";
120
+ readonly enum: readonly ["ed25519", "x25519", "p256"];
121
+ readonly description: "What the key is for, and how to reconstruct it. `ed25519` signs, `x25519` is a key-agreement key and signs nothing, `p256` is an ECDSA key for ES256. Stated as well as encoded in `privateKeyMultibase` so a consumer can select a key by purpose without decoding every entry.";
122
+ };
123
+ readonly privateKeyMultibase: {
124
+ readonly type: "string";
125
+ readonly minLength: 1;
126
+ readonly description: "The private key, multibase-encoded (Base58BTC, `z` prefix) over its multicodec-prefixed bytes — `0x1300` Ed25519, `0x1302` X25519, `0x1306` P-256. The multicodec prefix, not this member's position in the array, is what identifies the key material.";
127
+ };
128
+ };
129
+ };
130
+ readonly Ext: {
131
+ readonly title: "Ext";
132
+ readonly 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.";
133
+ readonly type: "object";
134
+ readonly minProperties: 1;
135
+ readonly additionalProperties: true;
136
+ readonly propertyNames: {
137
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
138
+ };
139
+ };
140
+ };
141
+ };
142
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
143
+ export declare const RESPONSE_PAYLOAD_SCHEMA: {
144
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
145
+ readonly $ref: "#/$defs/Response";
146
+ readonly $defs: {
147
+ readonly Response: {
148
+ readonly $anchor: "response";
149
+ readonly title: "VTA Context Secrets — response payload";
150
+ readonly type: "object";
151
+ readonly additionalProperties: false;
152
+ readonly required: readonly ["did", "secrets"];
153
+ readonly description: "The context's DID and the private key material behind it, sufficient to operate as that DID and nothing more. Failures use trust-task-error, not this shape. Type https://trusttasks.org/spec/vta/contexts/secrets/1.0#response.";
154
+ readonly properties: {
155
+ readonly did: {
156
+ readonly type: "string";
157
+ readonly minLength: 1;
158
+ readonly description: "The DID the returned secrets belong to — the DID recorded on the named context. Every `keyId` below is a verification method of this DID, so a consumer can check the two agree before installing anything.";
159
+ };
160
+ readonly secrets: {
161
+ readonly type: "array";
162
+ readonly description: "One entry per verification method of `did` whose secret the recipient holds and is willing to release. MAY be empty: a context whose DID has no releasable key material is not an error, and a consumer that treats an empty array as a failure will misreport a context that is merely not provisioned yet.";
163
+ readonly items: {
164
+ readonly $ref: "#/$defs/SecretEntry";
165
+ };
166
+ };
167
+ };
168
+ };
169
+ readonly SecretEntry: {
170
+ readonly title: "Secret entry";
171
+ readonly type: "object";
172
+ readonly additionalProperties: false;
173
+ readonly required: readonly ["keyId", "keyType", "privateKeyMultibase"];
174
+ readonly description: "One private key, named by the verification method it backs.";
175
+ readonly properties: {
176
+ readonly keyId: {
177
+ readonly type: "string";
178
+ readonly minLength: 1;
179
+ readonly description: "The verification method this key backs, as an absolute DID URL under the response's `did` (`{did}#key-0`). It is the DID document — not the recipient's own storage — that decides this name, so a consumer installs the key under a `kid` that an inbound message's recipient field will actually match.";
180
+ };
181
+ readonly keyType: {
182
+ readonly type: "string";
183
+ readonly enum: readonly ["ed25519", "x25519", "p256"];
184
+ readonly description: "What the key is for, and how to reconstruct it. `ed25519` signs, `x25519` is a key-agreement key and signs nothing, `p256` is an ECDSA key for ES256. Stated as well as encoded in `privateKeyMultibase` so a consumer can select a key by purpose without decoding every entry.";
185
+ };
186
+ readonly privateKeyMultibase: {
187
+ readonly type: "string";
188
+ readonly minLength: 1;
189
+ readonly description: "The private key, multibase-encoded (Base58BTC, `z` prefix) over its multicodec-prefixed bytes — `0x1300` Ed25519, `0x1302` X25519, `0x1306` P-256. The multicodec prefix, not this member's position in the array, is what identifies the key material.";
190
+ };
191
+ };
192
+ };
193
+ readonly Ext: {
194
+ readonly title: "Ext";
195
+ readonly 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.";
196
+ readonly type: "object";
197
+ readonly minProperties: 1;
198
+ readonly additionalProperties: true;
199
+ readonly propertyNames: {
200
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
201
+ };
202
+ };
203
+ };
204
+ };
205
+ /**
206
+ * SPEC.md §7.2 policy for the request variant, from this specification's
207
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
208
+ * per-specification and cannot be derived from the document alone, and
209
+ * item 2 needs the schema this carries.
210
+ */
211
+ export declare const SPEC: {
212
+ readonly typeUri: "https://trusttasks.org/spec/vta/contexts/secrets/1.0";
213
+ readonly isBearer: false;
214
+ readonly isProofRequired: true;
215
+ readonly isRecipientRequired: true;
216
+ readonly isIssuedAtRequired: true;
217
+ readonly payloadSchema: {
218
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
219
+ readonly $id: "https://trusttasks.org/spec/vta/contexts/secrets/1.0";
220
+ readonly title: "VTA Context Secrets — payload";
221
+ readonly description: "Names the trust context whose DID key material is being asked for. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.";
222
+ readonly type: "object";
223
+ readonly additionalProperties: false;
224
+ readonly required: readonly ["id"];
225
+ readonly properties: {
226
+ readonly id: {
227
+ readonly type: "string";
228
+ readonly minLength: 1;
229
+ readonly description: "Context id. For a nested context this is the full path (`parent/leaf`). Named `id` to match the rest of the `vta/contexts/*` family, where it always identifies the context being acted on.";
230
+ };
231
+ readonly ext: {
232
+ readonly $ref: "#/$defs/Ext";
233
+ };
234
+ };
235
+ readonly $defs: {
236
+ readonly Response: {
237
+ readonly $anchor: "response";
238
+ readonly title: "VTA Context Secrets — response payload";
239
+ readonly type: "object";
240
+ readonly additionalProperties: false;
241
+ readonly required: readonly ["did", "secrets"];
242
+ readonly description: "The context's DID and the private key material behind it, sufficient to operate as that DID and nothing more. Failures use trust-task-error, not this shape. Type https://trusttasks.org/spec/vta/contexts/secrets/1.0#response.";
243
+ readonly properties: {
244
+ readonly did: {
245
+ readonly type: "string";
246
+ readonly minLength: 1;
247
+ readonly description: "The DID the returned secrets belong to — the DID recorded on the named context. Every `keyId` below is a verification method of this DID, so a consumer can check the two agree before installing anything.";
248
+ };
249
+ readonly secrets: {
250
+ readonly type: "array";
251
+ readonly description: "One entry per verification method of `did` whose secret the recipient holds and is willing to release. MAY be empty: a context whose DID has no releasable key material is not an error, and a consumer that treats an empty array as a failure will misreport a context that is merely not provisioned yet.";
252
+ readonly items: {
253
+ readonly $ref: "#/$defs/SecretEntry";
254
+ };
255
+ };
256
+ };
257
+ };
258
+ readonly SecretEntry: {
259
+ readonly title: "Secret entry";
260
+ readonly type: "object";
261
+ readonly additionalProperties: false;
262
+ readonly required: readonly ["keyId", "keyType", "privateKeyMultibase"];
263
+ readonly description: "One private key, named by the verification method it backs.";
264
+ readonly properties: {
265
+ readonly keyId: {
266
+ readonly type: "string";
267
+ readonly minLength: 1;
268
+ readonly description: "The verification method this key backs, as an absolute DID URL under the response's `did` (`{did}#key-0`). It is the DID document — not the recipient's own storage — that decides this name, so a consumer installs the key under a `kid` that an inbound message's recipient field will actually match.";
269
+ };
270
+ readonly keyType: {
271
+ readonly type: "string";
272
+ readonly enum: readonly ["ed25519", "x25519", "p256"];
273
+ readonly description: "What the key is for, and how to reconstruct it. `ed25519` signs, `x25519` is a key-agreement key and signs nothing, `p256` is an ECDSA key for ES256. Stated as well as encoded in `privateKeyMultibase` so a consumer can select a key by purpose without decoding every entry.";
274
+ };
275
+ readonly privateKeyMultibase: {
276
+ readonly type: "string";
277
+ readonly minLength: 1;
278
+ readonly description: "The private key, multibase-encoded (Base58BTC, `z` prefix) over its multicodec-prefixed bytes — `0x1300` Ed25519, `0x1302` X25519, `0x1306` P-256. The multicodec prefix, not this member's position in the array, is what identifies the key material.";
279
+ };
280
+ };
281
+ };
282
+ readonly Ext: {
283
+ readonly title: "Ext";
284
+ readonly 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.";
285
+ readonly type: "object";
286
+ readonly minProperties: 1;
287
+ readonly additionalProperties: true;
288
+ readonly propertyNames: {
289
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
290
+ };
291
+ };
292
+ };
293
+ };
294
+ };
295
+ /**
296
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
297
+ * tracks the *issuer* party's requirement because a response swaps the
298
+ * parties (§7.3 item 5).
299
+ */
300
+ export declare const RESPONSE_SPEC: {
301
+ readonly typeUri: "https://trusttasks.org/spec/vta/contexts/secrets/1.0#response";
302
+ readonly isBearer: false;
303
+ readonly isProofRequired: true;
304
+ readonly isRecipientRequired: true;
305
+ readonly isIssuedAtRequired: true;
306
+ readonly payloadSchema: {
307
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
308
+ readonly $ref: "#/$defs/Response";
309
+ readonly $defs: {
310
+ readonly Response: {
311
+ readonly $anchor: "response";
312
+ readonly title: "VTA Context Secrets — response payload";
313
+ readonly type: "object";
314
+ readonly additionalProperties: false;
315
+ readonly required: readonly ["did", "secrets"];
316
+ readonly description: "The context's DID and the private key material behind it, sufficient to operate as that DID and nothing more. Failures use trust-task-error, not this shape. Type https://trusttasks.org/spec/vta/contexts/secrets/1.0#response.";
317
+ readonly properties: {
318
+ readonly did: {
319
+ readonly type: "string";
320
+ readonly minLength: 1;
321
+ readonly description: "The DID the returned secrets belong to — the DID recorded on the named context. Every `keyId` below is a verification method of this DID, so a consumer can check the two agree before installing anything.";
322
+ };
323
+ readonly secrets: {
324
+ readonly type: "array";
325
+ readonly description: "One entry per verification method of `did` whose secret the recipient holds and is willing to release. MAY be empty: a context whose DID has no releasable key material is not an error, and a consumer that treats an empty array as a failure will misreport a context that is merely not provisioned yet.";
326
+ readonly items: {
327
+ readonly $ref: "#/$defs/SecretEntry";
328
+ };
329
+ };
330
+ };
331
+ };
332
+ readonly SecretEntry: {
333
+ readonly title: "Secret entry";
334
+ readonly type: "object";
335
+ readonly additionalProperties: false;
336
+ readonly required: readonly ["keyId", "keyType", "privateKeyMultibase"];
337
+ readonly description: "One private key, named by the verification method it backs.";
338
+ readonly properties: {
339
+ readonly keyId: {
340
+ readonly type: "string";
341
+ readonly minLength: 1;
342
+ readonly description: "The verification method this key backs, as an absolute DID URL under the response's `did` (`{did}#key-0`). It is the DID document — not the recipient's own storage — that decides this name, so a consumer installs the key under a `kid` that an inbound message's recipient field will actually match.";
343
+ };
344
+ readonly keyType: {
345
+ readonly type: "string";
346
+ readonly enum: readonly ["ed25519", "x25519", "p256"];
347
+ readonly description: "What the key is for, and how to reconstruct it. `ed25519` signs, `x25519` is a key-agreement key and signs nothing, `p256` is an ECDSA key for ES256. Stated as well as encoded in `privateKeyMultibase` so a consumer can select a key by purpose without decoding every entry.";
348
+ };
349
+ readonly privateKeyMultibase: {
350
+ readonly type: "string";
351
+ readonly minLength: 1;
352
+ readonly description: "The private key, multibase-encoded (Base58BTC, `z` prefix) over its multicodec-prefixed bytes — `0x1300` Ed25519, `0x1302` X25519, `0x1306` P-256. The multicodec prefix, not this member's position in the array, is what identifies the key material.";
353
+ };
354
+ };
355
+ };
356
+ readonly Ext: {
357
+ readonly title: "Ext";
358
+ readonly 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.";
359
+ readonly type: "object";
360
+ readonly minProperties: 1;
361
+ readonly additionalProperties: true;
362
+ readonly propertyNames: {
363
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
364
+ };
365
+ };
366
+ };
367
+ };
368
+ };
369
+ //# sourceMappingURL=payload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../../../src/vta/contexts/secrets/1.0/payload.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mCAAmC,CAAC;AAG7D;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,CAAC,EAAE,GAAG,CAAC;CACX;AACD;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAC/C;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,OAAO,EA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export const TYPE_URI = "https://trusttasks.org/spec/vta/contexts/secrets/1.0";
7
+ /** Trust Task response type URI (request type URI + "#response"). */
8
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/contexts/secrets/1.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/contexts/secrets/1.0",
21
+ "title": "VTA Context Secrets — payload",
22
+ "description": "Names the trust context whose DID key material is being asked for. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.",
23
+ "type": "object",
24
+ "additionalProperties": false,
25
+ "required": [
26
+ "id"
27
+ ],
28
+ "properties": {
29
+ "id": {
30
+ "type": "string",
31
+ "minLength": 1,
32
+ "description": "Context id. For a nested context this is the full path (`parent/leaf`). Named `id` to match the rest of the `vta/contexts/*` family, where it always identifies the context being acted on."
33
+ },
34
+ "ext": {
35
+ "$ref": "#/$defs/Ext"
36
+ }
37
+ },
38
+ "$defs": {
39
+ "Response": {
40
+ "$anchor": "response",
41
+ "title": "VTA Context Secrets — response payload",
42
+ "type": "object",
43
+ "additionalProperties": false,
44
+ "required": [
45
+ "did",
46
+ "secrets"
47
+ ],
48
+ "description": "The context's DID and the private key material behind it, sufficient to operate as that DID and nothing more. Failures use trust-task-error, not this shape. Type https://trusttasks.org/spec/vta/contexts/secrets/1.0#response.",
49
+ "properties": {
50
+ "did": {
51
+ "type": "string",
52
+ "minLength": 1,
53
+ "description": "The DID the returned secrets belong to — the DID recorded on the named context. Every `keyId` below is a verification method of this DID, so a consumer can check the two agree before installing anything."
54
+ },
55
+ "secrets": {
56
+ "type": "array",
57
+ "description": "One entry per verification method of `did` whose secret the recipient holds and is willing to release. MAY be empty: a context whose DID has no releasable key material is not an error, and a consumer that treats an empty array as a failure will misreport a context that is merely not provisioned yet.",
58
+ "items": {
59
+ "$ref": "#/$defs/SecretEntry"
60
+ }
61
+ }
62
+ }
63
+ },
64
+ "SecretEntry": {
65
+ "title": "Secret entry",
66
+ "type": "object",
67
+ "additionalProperties": false,
68
+ "required": [
69
+ "keyId",
70
+ "keyType",
71
+ "privateKeyMultibase"
72
+ ],
73
+ "description": "One private key, named by the verification method it backs.",
74
+ "properties": {
75
+ "keyId": {
76
+ "type": "string",
77
+ "minLength": 1,
78
+ "description": "The verification method this key backs, as an absolute DID URL under the response's `did` (`{did}#key-0`). It is the DID document — not the recipient's own storage — that decides this name, so a consumer installs the key under a `kid` that an inbound message's recipient field will actually match."
79
+ },
80
+ "keyType": {
81
+ "type": "string",
82
+ "enum": [
83
+ "ed25519",
84
+ "x25519",
85
+ "p256"
86
+ ],
87
+ "description": "What the key is for, and how to reconstruct it. `ed25519` signs, `x25519` is a key-agreement key and signs nothing, `p256` is an ECDSA key for ES256. Stated as well as encoded in `privateKeyMultibase` so a consumer can select a key by purpose without decoding every entry."
88
+ },
89
+ "privateKeyMultibase": {
90
+ "type": "string",
91
+ "minLength": 1,
92
+ "description": "The private key, multibase-encoded (Base58BTC, `z` prefix) over its multicodec-prefixed bytes — `0x1300` Ed25519, `0x1302` X25519, `0x1306` P-256. The multicodec prefix, not this member's position in the array, is what identifies the key material."
93
+ }
94
+ }
95
+ },
96
+ "Ext": {
97
+ "title": "Ext",
98
+ "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.",
99
+ "type": "object",
100
+ "minProperties": 1,
101
+ "additionalProperties": true,
102
+ "propertyNames": {
103
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
104
+ }
105
+ }
106
+ }
107
+ };
108
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
109
+ export const RESPONSE_PAYLOAD_SCHEMA = {
110
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
111
+ "$ref": "#/$defs/Response",
112
+ "$defs": {
113
+ "Response": {
114
+ "$anchor": "response",
115
+ "title": "VTA Context Secrets — response payload",
116
+ "type": "object",
117
+ "additionalProperties": false,
118
+ "required": [
119
+ "did",
120
+ "secrets"
121
+ ],
122
+ "description": "The context's DID and the private key material behind it, sufficient to operate as that DID and nothing more. Failures use trust-task-error, not this shape. Type https://trusttasks.org/spec/vta/contexts/secrets/1.0#response.",
123
+ "properties": {
124
+ "did": {
125
+ "type": "string",
126
+ "minLength": 1,
127
+ "description": "The DID the returned secrets belong to — the DID recorded on the named context. Every `keyId` below is a verification method of this DID, so a consumer can check the two agree before installing anything."
128
+ },
129
+ "secrets": {
130
+ "type": "array",
131
+ "description": "One entry per verification method of `did` whose secret the recipient holds and is willing to release. MAY be empty: a context whose DID has no releasable key material is not an error, and a consumer that treats an empty array as a failure will misreport a context that is merely not provisioned yet.",
132
+ "items": {
133
+ "$ref": "#/$defs/SecretEntry"
134
+ }
135
+ }
136
+ }
137
+ },
138
+ "SecretEntry": {
139
+ "title": "Secret entry",
140
+ "type": "object",
141
+ "additionalProperties": false,
142
+ "required": [
143
+ "keyId",
144
+ "keyType",
145
+ "privateKeyMultibase"
146
+ ],
147
+ "description": "One private key, named by the verification method it backs.",
148
+ "properties": {
149
+ "keyId": {
150
+ "type": "string",
151
+ "minLength": 1,
152
+ "description": "The verification method this key backs, as an absolute DID URL under the response's `did` (`{did}#key-0`). It is the DID document — not the recipient's own storage — that decides this name, so a consumer installs the key under a `kid` that an inbound message's recipient field will actually match."
153
+ },
154
+ "keyType": {
155
+ "type": "string",
156
+ "enum": [
157
+ "ed25519",
158
+ "x25519",
159
+ "p256"
160
+ ],
161
+ "description": "What the key is for, and how to reconstruct it. `ed25519` signs, `x25519` is a key-agreement key and signs nothing, `p256` is an ECDSA key for ES256. Stated as well as encoded in `privateKeyMultibase` so a consumer can select a key by purpose without decoding every entry."
162
+ },
163
+ "privateKeyMultibase": {
164
+ "type": "string",
165
+ "minLength": 1,
166
+ "description": "The private key, multibase-encoded (Base58BTC, `z` prefix) over its multicodec-prefixed bytes — `0x1300` Ed25519, `0x1302` X25519, `0x1306` P-256. The multicodec prefix, not this member's position in the array, is what identifies the key material."
167
+ }
168
+ }
169
+ },
170
+ "Ext": {
171
+ "title": "Ext",
172
+ "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.",
173
+ "type": "object",
174
+ "minProperties": 1,
175
+ "additionalProperties": true,
176
+ "propertyNames": {
177
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
178
+ }
179
+ }
180
+ }
181
+ };
182
+ /**
183
+ * SPEC.md §7.2 policy for the request variant, from this specification's
184
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
185
+ * per-specification and cannot be derived from the document alone, and
186
+ * item 2 needs the schema this carries.
187
+ */
188
+ export const SPEC = {
189
+ typeUri: TYPE_URI,
190
+ isBearer: false,
191
+ isProofRequired: true,
192
+ isRecipientRequired: true,
193
+ isIssuedAtRequired: true,
194
+ payloadSchema: PAYLOAD_SCHEMA,
195
+ };
196
+ /**
197
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
198
+ * tracks the *issuer* party's requirement because a response swaps the
199
+ * parties (§7.3 item 5).
200
+ */
201
+ export const RESPONSE_SPEC = {
202
+ typeUri: RESPONSE_TYPE_URI,
203
+ isBearer: false,
204
+ isProofRequired: true,
205
+ isRecipientRequired: true,
206
+ isIssuedAtRequired: true,
207
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
208
+ };
209
+ //# sourceMappingURL=payload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payload.js","sourceRoot":"","sources":["../../../../../src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": "@openvtc/trust-tasks",
3
- "version": "0.18.5",
3
+ "version": "0.19.1",
4
4
  "description": "Generated TypeScript bindings for the Trust Tasks framework registry.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/index.ts CHANGED
@@ -354,6 +354,7 @@ export * as VtaContextsDidTemplatesUpdate_v1_0 from "./vta/contexts/did-template
354
354
  export * as VtaContextsGet_v1_0 from "./vta/contexts/get/1.0/payload.js";
355
355
  export * as VtaContextsList_v1_0 from "./vta/contexts/list/1.0/payload.js";
356
356
  export * as VtaContextsPreviewDelete_v1_0 from "./vta/contexts/preview-delete/1.0/payload.js";
357
+ export * as VtaContextsSecrets_v1_0 from "./vta/contexts/secrets/1.0/payload.js";
357
358
  export * as VtaContextsUpdateDid_v1_0 from "./vta/contexts/update-did/1.0/payload.js";
358
359
  export * as VtaContextsUpdate_v1_0 from "./vta/contexts/update/1.0/payload.js";
359
360
  export * as VtaCredentialsIssue_v0_1 from "./vta/credentials/issue/0.1/payload.js";