@openvtc/trust-tasks 0.25.0 → 0.25.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,88 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/provision/vta/claim/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { Ext, Handle } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * A wallet claims a VTA that a Farm has reserved behind a `vta-claim` trigger link. The document is the first request of the exchange (VTI-LNK-054): issued and signed by a fresh Ed25519 `did:key` that becomes the VTA's administrator, addressed to the Farm, and carrying the reservation's handle both here and as the envelope's `parentThreadId`. The task defines no `#response`: the Farm answers a `trust-task-next-step` expecting `provision/vta/redeem/0.1`, whose response is the hand-over. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, parentThreadId, proof) are owned by the framework — SPEC §6.3.
11
+ */
12
+ export interface ProvisionVTAClaimPayload {
13
+ handle: Handle;
14
+ ext?: Ext;
15
+ }
16
+
17
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
18
+ export type { Ext, Handle };
19
+
20
+ /** Trust Task type URI. */
21
+ export const TYPE_URI = "https://trusttasks.org/spec/provision/vta/claim/0.1" as const;
22
+
23
+ /** Stable alias for this specification's request payload shape. */
24
+ export type Payload = ProvisionVTAClaimPayload;
25
+
26
+ /**
27
+ * This specification's payload schema, as a value.
28
+ *
29
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
30
+ * rather than only as a `.json` file because TypeScript types are erased
31
+ * at runtime: without a schema a consumer has nothing to validate, and
32
+ * every REQUIRED payload member is optional in practice. Cross-file
33
+ * `$ref`s are already inlined, so it needs no resolver.
34
+ */
35
+ export const PAYLOAD_SCHEMA = {
36
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
37
+ "$id": "https://trusttasks.org/spec/provision/vta/claim/0.1",
38
+ "title": "Provision — VTA Claim — payload",
39
+ "description": "A wallet claims a VTA that a Farm has reserved behind a `vta-claim` trigger link. The document is the first request of the exchange (VTI-LNK-054): issued and signed by a fresh Ed25519 `did:key` that becomes the VTA's administrator, addressed to the Farm, and carrying the reservation's handle both here and as the envelope's `parentThreadId`. The task defines no `#response`: the Farm answers a `trust-task-next-step` expecting `provision/vta/redeem/0.1`, whose response is the hand-over. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, parentThreadId, proof) are owned by the framework — SPEC §6.3.",
40
+ "type": "object",
41
+ "additionalProperties": false,
42
+ "required": [
43
+ "handle"
44
+ ],
45
+ "properties": {
46
+ "handle": {
47
+ "$ref": "#/$defs/Handle"
48
+ },
49
+ "ext": {
50
+ "$ref": "#/$defs/Ext"
51
+ }
52
+ },
53
+ "$defs": {
54
+ "Ext": {
55
+ "title": "Ext",
56
+ "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.",
57
+ "type": "object",
58
+ "minProperties": 1,
59
+ "additionalProperties": true,
60
+ "propertyNames": {
61
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
62
+ }
63
+ },
64
+ "Handle": {
65
+ "title": "Handle",
66
+ "type": "string",
67
+ "minLength": 22,
68
+ "maxLength": 43,
69
+ "pattern": "^[A-Za-z0-9_-]{22,43}$",
70
+ "description": "The Farm-generated handle of one reservation: 16 to 32 bytes from a cryptographically secure random source, written as unpadded base64url (22 to 43 characters; 16 bytes, 22 characters, is what VTI-LNK-116 recommends). It is the `_id` of the trigger link (VTI-LNK-033) and is compared as a string. In a claim it MUST equal the document's `parentThreadId`. It confers no authority on its holder beyond the right to make one claim."
71
+ }
72
+ }
73
+ } as const;
74
+
75
+ /**
76
+ * SPEC.md §7.2 policy for the request variant, from this specification's
77
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
78
+ * per-specification and cannot be derived from the document alone, and
79
+ * item 2 needs the schema this carries.
80
+ */
81
+ export const SPEC = {
82
+ typeUri: TYPE_URI,
83
+ isBearer: false,
84
+ isProofRequired: true,
85
+ isRecipientRequired: true,
86
+ isIssuedAtRequired: true,
87
+ payloadSchema: PAYLOAD_SCHEMA,
88
+ } as const;
@@ -0,0 +1,255 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/provision/vta/redeem/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { Ext, Handle } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * The claimant polls the Farm, with the key that made the claim, for the outcome of its claim on a reservation. Each poll is a freshly signed document carrying the handle. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.
11
+ */
12
+ export interface ProvisionVTARedeemPayload {
13
+ handle: Handle;
14
+ ext?: Ext;
15
+ }
16
+ /**
17
+ * The hand-over, signed by the Farm's assertionMethod key and sent only once the claimant's key is written into the VTA as its administrator and the VTA answers: which VTA, what the claim did, and where the VTA is reachable. Every earlier state is a `trust-task-error` (`pending`, `rejected`, or a family code), never this document.
18
+ */
19
+ export interface ProvisionVTARedeemResponsePayload {
20
+ handle: Handle;
21
+ /**
22
+ * The DID of the VTA the claimant now administers. The Farm chooses the DID method; the VTA Farm issues `did:webvh`.
23
+ */
24
+ vtaDid: string;
25
+ /**
26
+ * What the claim did. `provisionVta`: the claimant is the first administrator of a VTA provisioned for this reservation. `grantAcl`: the claimant was added as an administrator of a VTA that already had one. The Farm derives it from the reservation; the wallet never chooses it.
27
+ */
28
+ operation: "provisionVta" | "grantAcl";
29
+ /**
30
+ * The DID of the DIDComm mediator the VTA is reachable through. A convenience: the wallet can also read it from the VTA's own DID document.
31
+ */
32
+ mediatorDid?: string;
33
+ /**
34
+ * Where the VTA's DID log is served. For `did:webvh` it is the `did.jsonl` URL the DID itself encodes. An `https` URL with no userinfo.
35
+ */
36
+ didLogUrl?: string;
37
+ ext?: Ext;
38
+ }
39
+
40
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
41
+ export type { Ext, Handle };
42
+
43
+ /** Trust Task type URI. */
44
+ export const TYPE_URI = "https://trusttasks.org/spec/provision/vta/redeem/0.1" as const;
45
+
46
+ /** Stable alias for this specification's request payload shape. */
47
+ export type Payload = ProvisionVTARedeemPayload;
48
+
49
+ /** Trust Task response type URI (request type URI + "#response"). */
50
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/provision/vta/redeem/0.1#response" as const;
51
+
52
+ /** Stable alias for this specification's success-response payload shape. */
53
+ export type Response = ProvisionVTARedeemResponsePayload;
54
+
55
+ /**
56
+ * This specification's payload schema, as a value.
57
+ *
58
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
59
+ * rather than only as a `.json` file because TypeScript types are erased
60
+ * at runtime: without a schema a consumer has nothing to validate, and
61
+ * every REQUIRED payload member is optional in practice. Cross-file
62
+ * `$ref`s are already inlined, so it needs no resolver.
63
+ */
64
+ export const PAYLOAD_SCHEMA = {
65
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
66
+ "$id": "https://trusttasks.org/spec/provision/vta/redeem/0.1",
67
+ "title": "Provision — VTA Redeem — payload",
68
+ "description": "The claimant polls the Farm, with the key that made the claim, for the outcome of its claim on a reservation. Each poll is a freshly signed document carrying the handle. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.",
69
+ "type": "object",
70
+ "additionalProperties": false,
71
+ "required": [
72
+ "handle"
73
+ ],
74
+ "properties": {
75
+ "handle": {
76
+ "$ref": "#/$defs/Handle"
77
+ },
78
+ "ext": {
79
+ "$ref": "#/$defs/Ext"
80
+ }
81
+ },
82
+ "$defs": {
83
+ "Response": {
84
+ "$anchor": "response",
85
+ "title": "Provision — VTA Redeem — response payload",
86
+ "description": "The hand-over, signed by the Farm's assertionMethod key and sent only once the claimant's key is written into the VTA as its administrator and the VTA answers: which VTA, what the claim did, and where the VTA is reachable. Every earlier state is a `trust-task-error` (`pending`, `rejected`, or a family code), never this document.",
87
+ "type": "object",
88
+ "additionalProperties": false,
89
+ "required": [
90
+ "handle",
91
+ "vtaDid",
92
+ "operation"
93
+ ],
94
+ "properties": {
95
+ "handle": {
96
+ "$ref": "#/$defs/Handle"
97
+ },
98
+ "vtaDid": {
99
+ "type": "string",
100
+ "minLength": 8,
101
+ "maxLength": 2048,
102
+ "pattern": "^did:[a-z0-9]+:[^\\s]+$",
103
+ "description": "The DID of the VTA the claimant now administers. The Farm chooses the DID method; the VTA Farm issues `did:webvh`."
104
+ },
105
+ "operation": {
106
+ "type": "string",
107
+ "enum": [
108
+ "provisionVta",
109
+ "grantAcl"
110
+ ],
111
+ "description": "What the claim did. `provisionVta`: the claimant is the first administrator of a VTA provisioned for this reservation. `grantAcl`: the claimant was added as an administrator of a VTA that already had one. The Farm derives it from the reservation; the wallet never chooses it."
112
+ },
113
+ "mediatorDid": {
114
+ "type": "string",
115
+ "minLength": 8,
116
+ "maxLength": 2048,
117
+ "pattern": "^did:[a-z0-9]+:[^\\s]+$",
118
+ "description": "The DID of the DIDComm mediator the VTA is reachable through. A convenience: the wallet can also read it from the VTA's own DID document."
119
+ },
120
+ "didLogUrl": {
121
+ "type": "string",
122
+ "minLength": 9,
123
+ "maxLength": 2048,
124
+ "pattern": "^https://[^@/?#\\s]+(/[^\\s]*)?$",
125
+ "description": "Where the VTA's DID log is served. For `did:webvh` it is the `did.jsonl` URL the DID itself encodes. An `https` URL with no userinfo."
126
+ },
127
+ "ext": {
128
+ "$ref": "#/$defs/Ext"
129
+ }
130
+ }
131
+ },
132
+ "Ext": {
133
+ "title": "Ext",
134
+ "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.",
135
+ "type": "object",
136
+ "minProperties": 1,
137
+ "additionalProperties": true,
138
+ "propertyNames": {
139
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
140
+ }
141
+ },
142
+ "Handle": {
143
+ "title": "Handle",
144
+ "type": "string",
145
+ "minLength": 22,
146
+ "maxLength": 43,
147
+ "pattern": "^[A-Za-z0-9_-]{22,43}$",
148
+ "description": "The Farm-generated handle of one reservation: 16 to 32 bytes from a cryptographically secure random source, written as unpadded base64url (22 to 43 characters; 16 bytes, 22 characters, is what VTI-LNK-116 recommends). It is the `_id` of the trigger link (VTI-LNK-033) and is compared as a string. In a claim it MUST equal the document's `parentThreadId`. It confers no authority on its holder beyond the right to make one claim."
149
+ }
150
+ }
151
+ } as const;
152
+
153
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
154
+ export const RESPONSE_PAYLOAD_SCHEMA = {
155
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
156
+ "$ref": "#/$defs/Response",
157
+ "$defs": {
158
+ "Response": {
159
+ "$anchor": "response",
160
+ "title": "Provision — VTA Redeem — response payload",
161
+ "description": "The hand-over, signed by the Farm's assertionMethod key and sent only once the claimant's key is written into the VTA as its administrator and the VTA answers: which VTA, what the claim did, and where the VTA is reachable. Every earlier state is a `trust-task-error` (`pending`, `rejected`, or a family code), never this document.",
162
+ "type": "object",
163
+ "additionalProperties": false,
164
+ "required": [
165
+ "handle",
166
+ "vtaDid",
167
+ "operation"
168
+ ],
169
+ "properties": {
170
+ "handle": {
171
+ "$ref": "#/$defs/Handle"
172
+ },
173
+ "vtaDid": {
174
+ "type": "string",
175
+ "minLength": 8,
176
+ "maxLength": 2048,
177
+ "pattern": "^did:[a-z0-9]+:[^\\s]+$",
178
+ "description": "The DID of the VTA the claimant now administers. The Farm chooses the DID method; the VTA Farm issues `did:webvh`."
179
+ },
180
+ "operation": {
181
+ "type": "string",
182
+ "enum": [
183
+ "provisionVta",
184
+ "grantAcl"
185
+ ],
186
+ "description": "What the claim did. `provisionVta`: the claimant is the first administrator of a VTA provisioned for this reservation. `grantAcl`: the claimant was added as an administrator of a VTA that already had one. The Farm derives it from the reservation; the wallet never chooses it."
187
+ },
188
+ "mediatorDid": {
189
+ "type": "string",
190
+ "minLength": 8,
191
+ "maxLength": 2048,
192
+ "pattern": "^did:[a-z0-9]+:[^\\s]+$",
193
+ "description": "The DID of the DIDComm mediator the VTA is reachable through. A convenience: the wallet can also read it from the VTA's own DID document."
194
+ },
195
+ "didLogUrl": {
196
+ "type": "string",
197
+ "minLength": 9,
198
+ "maxLength": 2048,
199
+ "pattern": "^https://[^@/?#\\s]+(/[^\\s]*)?$",
200
+ "description": "Where the VTA's DID log is served. For `did:webvh` it is the `did.jsonl` URL the DID itself encodes. An `https` URL with no userinfo."
201
+ },
202
+ "ext": {
203
+ "$ref": "#/$defs/Ext"
204
+ }
205
+ }
206
+ },
207
+ "Ext": {
208
+ "title": "Ext",
209
+ "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.",
210
+ "type": "object",
211
+ "minProperties": 1,
212
+ "additionalProperties": true,
213
+ "propertyNames": {
214
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
215
+ }
216
+ },
217
+ "Handle": {
218
+ "title": "Handle",
219
+ "type": "string",
220
+ "minLength": 22,
221
+ "maxLength": 43,
222
+ "pattern": "^[A-Za-z0-9_-]{22,43}$",
223
+ "description": "The Farm-generated handle of one reservation: 16 to 32 bytes from a cryptographically secure random source, written as unpadded base64url (22 to 43 characters; 16 bytes, 22 characters, is what VTI-LNK-116 recommends). It is the `_id` of the trigger link (VTI-LNK-033) and is compared as a string. In a claim it MUST equal the document's `parentThreadId`. It confers no authority on its holder beyond the right to make one claim."
224
+ }
225
+ }
226
+ } as const;
227
+
228
+ /**
229
+ * SPEC.md §7.2 policy for the request variant, from this specification's
230
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
231
+ * per-specification and cannot be derived from the document alone, and
232
+ * item 2 needs the schema this carries.
233
+ */
234
+ export const SPEC = {
235
+ typeUri: TYPE_URI,
236
+ isBearer: false,
237
+ isProofRequired: true,
238
+ isRecipientRequired: true,
239
+ isIssuedAtRequired: true,
240
+ payloadSchema: PAYLOAD_SCHEMA,
241
+ } as const;
242
+
243
+ /**
244
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
245
+ * tracks the *issuer* party's requirement because a response swaps the
246
+ * parties (§7.3 item 5).
247
+ */
248
+ export const RESPONSE_SPEC = {
249
+ typeUri: RESPONSE_TYPE_URI,
250
+ isBearer: false,
251
+ isProofRequired: true,
252
+ isRecipientRequired: true,
253
+ isIssuedAtRequired: true,
254
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
255
+ } as const;