@openvtc/trust-tasks 0.19.0 → 0.19.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/CHANGELOG.md +110 -0
  2. package/dist/_shared/components.d.ts +4 -0
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/index.d.ts +2 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +2 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/keys/create/0.1/payload.d.ts +20 -0
  9. package/dist/keys/create/0.1/payload.d.ts.map +1 -1
  10. package/dist/keys/create/0.1/payload.js +10 -0
  11. package/dist/keys/create/0.1/payload.js.map +1 -1
  12. package/dist/keys/import/0.1/payload.d.ts +20 -0
  13. package/dist/keys/import/0.1/payload.d.ts.map +1 -1
  14. package/dist/keys/import/0.1/payload.js +10 -0
  15. package/dist/keys/import/0.1/payload.js.map +1 -1
  16. package/dist/keys/list/0.1/payload.d.ts +20 -0
  17. package/dist/keys/list/0.1/payload.d.ts.map +1 -1
  18. package/dist/keys/list/0.1/payload.js +10 -0
  19. package/dist/keys/list/0.1/payload.js.map +1 -1
  20. package/dist/keys/set-exportability/0.1/payload.d.ts +560 -0
  21. package/dist/keys/set-exportability/0.1/payload.d.ts.map +1 -0
  22. package/dist/keys/set-exportability/0.1/payload.js +330 -0
  23. package/dist/keys/set-exportability/0.1/payload.js.map +1 -0
  24. package/dist/keys/show/0.1/payload.d.ts +20 -0
  25. package/dist/keys/show/0.1/payload.d.ts.map +1 -1
  26. package/dist/keys/show/0.1/payload.js +10 -0
  27. package/dist/keys/show/0.1/payload.js.map +1 -1
  28. package/dist/vta/contexts/secrets/1.0/payload.d.ts +369 -0
  29. package/dist/vta/contexts/secrets/1.0/payload.d.ts.map +1 -0
  30. package/dist/vta/contexts/secrets/1.0/payload.js +209 -0
  31. package/dist/vta/contexts/secrets/1.0/payload.js.map +1 -0
  32. package/package.json +1 -1
  33. package/src/_shared/components.ts +4 -0
  34. package/src/index.ts +2 -0
  35. package/src/keys/create/0.1/payload.ts +10 -0
  36. package/src/keys/import/0.1/payload.ts +10 -0
  37. package/src/keys/list/0.1/payload.ts +10 -0
  38. package/src/keys/set-exportability/0.1/payload.ts +371 -0
  39. package/src/keys/show/0.1/payload.ts +10 -0
  40. package/src/vta/contexts/secrets/1.0/payload.ts +267 -0
@@ -0,0 +1,267 @@
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
+
6
+ import type { Ext } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * 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.
11
+ */
12
+ export interface VTAContextSecretsPayload {
13
+ /**
14
+ * 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.
15
+ */
16
+ id: string;
17
+ ext?: Ext;
18
+ }
19
+ /**
20
+ * 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.
21
+ */
22
+ export interface VTAContextSecretsResponsePayload {
23
+ /**
24
+ * 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.
25
+ */
26
+ did: string;
27
+ /**
28
+ * 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.
29
+ */
30
+ secrets: SecretEntry[];
31
+ }
32
+ /**
33
+ * One private key, named by the verification method it backs.
34
+ */
35
+ export interface SecretEntry {
36
+ /**
37
+ * 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.
38
+ */
39
+ keyId: string;
40
+ /**
41
+ * 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.
42
+ */
43
+ keyType: "ed25519" | "x25519" | "p256";
44
+ /**
45
+ * 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.
46
+ */
47
+ privateKeyMultibase: string;
48
+ }
49
+
50
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
51
+ export type { Ext };
52
+
53
+ /** Trust Task type URI. */
54
+ export const TYPE_URI = "https://trusttasks.org/spec/vta/contexts/secrets/1.0" as const;
55
+
56
+ /** Stable alias for this specification's request payload shape. */
57
+ export type Payload = VTAContextSecretsPayload;
58
+
59
+ /** Trust Task response type URI (request type URI + "#response"). */
60
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/contexts/secrets/1.0#response" as const;
61
+
62
+ /** Stable alias for this specification's success-response payload shape. */
63
+ export type Response = VTAContextSecretsResponsePayload;
64
+
65
+ /**
66
+ * This specification's payload schema, as a value.
67
+ *
68
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
69
+ * rather than only as a `.json` file because TypeScript types are erased
70
+ * at runtime: without a schema a consumer has nothing to validate, and
71
+ * every REQUIRED payload member is optional in practice. Cross-file
72
+ * `$ref`s are already inlined, so it needs no resolver.
73
+ */
74
+ export const PAYLOAD_SCHEMA = {
75
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
76
+ "$id": "https://trusttasks.org/spec/vta/contexts/secrets/1.0",
77
+ "title": "VTA Context Secrets — payload",
78
+ "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.",
79
+ "type": "object",
80
+ "additionalProperties": false,
81
+ "required": [
82
+ "id"
83
+ ],
84
+ "properties": {
85
+ "id": {
86
+ "type": "string",
87
+ "minLength": 1,
88
+ "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."
89
+ },
90
+ "ext": {
91
+ "$ref": "#/$defs/Ext"
92
+ }
93
+ },
94
+ "$defs": {
95
+ "Response": {
96
+ "$anchor": "response",
97
+ "title": "VTA Context Secrets — response payload",
98
+ "type": "object",
99
+ "additionalProperties": false,
100
+ "required": [
101
+ "did",
102
+ "secrets"
103
+ ],
104
+ "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.",
105
+ "properties": {
106
+ "did": {
107
+ "type": "string",
108
+ "minLength": 1,
109
+ "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."
110
+ },
111
+ "secrets": {
112
+ "type": "array",
113
+ "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.",
114
+ "items": {
115
+ "$ref": "#/$defs/SecretEntry"
116
+ }
117
+ }
118
+ }
119
+ },
120
+ "SecretEntry": {
121
+ "title": "Secret entry",
122
+ "type": "object",
123
+ "additionalProperties": false,
124
+ "required": [
125
+ "keyId",
126
+ "keyType",
127
+ "privateKeyMultibase"
128
+ ],
129
+ "description": "One private key, named by the verification method it backs.",
130
+ "properties": {
131
+ "keyId": {
132
+ "type": "string",
133
+ "minLength": 1,
134
+ "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."
135
+ },
136
+ "keyType": {
137
+ "type": "string",
138
+ "enum": [
139
+ "ed25519",
140
+ "x25519",
141
+ "p256"
142
+ ],
143
+ "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."
144
+ },
145
+ "privateKeyMultibase": {
146
+ "type": "string",
147
+ "minLength": 1,
148
+ "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."
149
+ }
150
+ }
151
+ },
152
+ "Ext": {
153
+ "title": "Ext",
154
+ "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.",
155
+ "type": "object",
156
+ "minProperties": 1,
157
+ "additionalProperties": true,
158
+ "propertyNames": {
159
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
160
+ }
161
+ }
162
+ }
163
+ } as const;
164
+
165
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
166
+ export const RESPONSE_PAYLOAD_SCHEMA = {
167
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
168
+ "$ref": "#/$defs/Response",
169
+ "$defs": {
170
+ "Response": {
171
+ "$anchor": "response",
172
+ "title": "VTA Context Secrets — response payload",
173
+ "type": "object",
174
+ "additionalProperties": false,
175
+ "required": [
176
+ "did",
177
+ "secrets"
178
+ ],
179
+ "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.",
180
+ "properties": {
181
+ "did": {
182
+ "type": "string",
183
+ "minLength": 1,
184
+ "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."
185
+ },
186
+ "secrets": {
187
+ "type": "array",
188
+ "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.",
189
+ "items": {
190
+ "$ref": "#/$defs/SecretEntry"
191
+ }
192
+ }
193
+ }
194
+ },
195
+ "SecretEntry": {
196
+ "title": "Secret entry",
197
+ "type": "object",
198
+ "additionalProperties": false,
199
+ "required": [
200
+ "keyId",
201
+ "keyType",
202
+ "privateKeyMultibase"
203
+ ],
204
+ "description": "One private key, named by the verification method it backs.",
205
+ "properties": {
206
+ "keyId": {
207
+ "type": "string",
208
+ "minLength": 1,
209
+ "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."
210
+ },
211
+ "keyType": {
212
+ "type": "string",
213
+ "enum": [
214
+ "ed25519",
215
+ "x25519",
216
+ "p256"
217
+ ],
218
+ "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."
219
+ },
220
+ "privateKeyMultibase": {
221
+ "type": "string",
222
+ "minLength": 1,
223
+ "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."
224
+ }
225
+ }
226
+ },
227
+ "Ext": {
228
+ "title": "Ext",
229
+ "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.",
230
+ "type": "object",
231
+ "minProperties": 1,
232
+ "additionalProperties": true,
233
+ "propertyNames": {
234
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
235
+ }
236
+ }
237
+ }
238
+ } as const;
239
+
240
+ /**
241
+ * SPEC.md §7.2 policy for the request variant, from this specification's
242
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
243
+ * per-specification and cannot be derived from the document alone, and
244
+ * item 2 needs the schema this carries.
245
+ */
246
+ export const SPEC = {
247
+ typeUri: TYPE_URI,
248
+ isBearer: false,
249
+ isProofRequired: true,
250
+ isRecipientRequired: true,
251
+ isIssuedAtRequired: true,
252
+ payloadSchema: PAYLOAD_SCHEMA,
253
+ } as const;
254
+
255
+ /**
256
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
257
+ * tracks the *issuer* party's requirement because a response swaps the
258
+ * parties (§7.3 item 5).
259
+ */
260
+ export const RESPONSE_SPEC = {
261
+ typeUri: RESPONSE_TYPE_URI,
262
+ isBearer: false,
263
+ isProofRequired: true,
264
+ isRecipientRequired: true,
265
+ isIssuedAtRequired: true,
266
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
267
+ } as const;