@openvtc/trust-tasks 0.20.7 → 0.20.8

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 (52) hide show
  1. package/CHANGELOG.md +87 -0
  2. package/dist/auth/step-up/approve-request/0.3/payload.d.ts +613 -0
  3. package/dist/auth/step-up/approve-request/0.3/payload.d.ts.map +1 -0
  4. package/dist/auth/step-up/approve-request/0.3/payload.js +345 -0
  5. package/dist/auth/step-up/approve-request/0.3/payload.js.map +1 -0
  6. package/dist/auth/step-up/approve-response/0.4/payload.d.ts +887 -0
  7. package/dist/auth/step-up/approve-response/0.4/payload.d.ts.map +1 -0
  8. package/dist/auth/step-up/approve-response/0.4/payload.js +504 -0
  9. package/dist/auth/step-up/approve-response/0.4/payload.js.map +1 -0
  10. package/dist/backup/abort/0.1/payload.d.ts +262 -0
  11. package/dist/backup/abort/0.1/payload.d.ts.map +1 -0
  12. package/dist/backup/abort/0.1/payload.js +146 -0
  13. package/dist/backup/abort/0.1/payload.js.map +1 -0
  14. package/dist/backup/complete-export/0.1/payload.d.ts +262 -0
  15. package/dist/backup/complete-export/0.1/payload.d.ts.map +1 -0
  16. package/dist/backup/complete-export/0.1/payload.js +146 -0
  17. package/dist/backup/complete-export/0.1/payload.js.map +1 -0
  18. package/dist/backup/finalize-import/0.1/payload.d.ts +395 -0
  19. package/dist/backup/finalize-import/0.1/payload.d.ts.map +1 -0
  20. package/dist/backup/finalize-import/0.1/payload.js +209 -0
  21. package/dist/backup/finalize-import/0.1/payload.js.map +1 -0
  22. package/dist/backup/get-chunk/0.1/payload.d.ts +461 -0
  23. package/dist/backup/get-chunk/0.1/payload.d.ts.map +1 -0
  24. package/dist/backup/get-chunk/0.1/payload.js +250 -0
  25. package/dist/backup/get-chunk/0.1/payload.js.map +1 -0
  26. package/dist/backup/initiate-export/0.1/payload.d.ts +896 -0
  27. package/dist/backup/initiate-export/0.1/payload.d.ts.map +1 -0
  28. package/dist/backup/initiate-export/0.1/payload.js +507 -0
  29. package/dist/backup/initiate-export/0.1/payload.js.map +1 -0
  30. package/dist/backup/initiate-import/0.1/payload.d.ts +888 -0
  31. package/dist/backup/initiate-import/0.1/payload.d.ts.map +1 -0
  32. package/dist/backup/initiate-import/0.1/payload.js +504 -0
  33. package/dist/backup/initiate-import/0.1/payload.js.map +1 -0
  34. package/dist/backup/put-chunk/0.1/payload.d.ts +495 -0
  35. package/dist/backup/put-chunk/0.1/payload.d.ts.map +1 -0
  36. package/dist/backup/put-chunk/0.1/payload.js +265 -0
  37. package/dist/backup/put-chunk/0.1/payload.js.map +1 -0
  38. package/dist/index.d.ts +9 -0
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +9 -0
  41. package/dist/index.js.map +1 -1
  42. package/package.json +1 -1
  43. package/src/auth/step-up/approve-request/0.3/payload.ts +421 -0
  44. package/src/auth/step-up/approve-response/0.4/payload.ts +593 -0
  45. package/src/backup/abort/0.1/payload.ts +191 -0
  46. package/src/backup/complete-export/0.1/payload.ts +191 -0
  47. package/src/backup/finalize-import/0.1/payload.ts +279 -0
  48. package/src/backup/get-chunk/0.1/payload.ts +308 -0
  49. package/src/backup/initiate-export/0.1/payload.ts +564 -0
  50. package/src/backup/initiate-import/0.1/payload.ts +561 -0
  51. package/src/backup/put-chunk/0.1/payload.ts +331 -0
  52. package/src/index.ts +9 -0
@@ -0,0 +1,896 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/backup/initiate-export/0.1/payload.schema.json
4
+ */
5
+ import type { BundleDescriptor, BundleId, ChunkCount, ChunkedDescriptor, ChunkManifest, ChunkSize, DigestMultibase, ExpectedSha256, ExpectedSizeBytes, ExpiresAt, Ext, StreamDescriptor } from "../../../_shared/components.js";
6
+ /**
7
+ * Asks the recipient to serialize its entire state into a password-encrypted bundle and return the descriptor that fetches it — by an HTTPS address (`stream`) or chunk by chunk over Trust Task documents (`chunkedTrustTask`). The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.
8
+ */
9
+ export interface BackupInitiateExportPayload {
10
+ /**
11
+ * Key-derivation input protecting the bundle. Chosen by the producer and never recoverable from the recipient. `writeOnly` is the machine-readable form of the rule in Data carried: this member goes in and never comes back, so a generated client must not surface it in a response type, and a recipient must never log, echo or persist it. The minLength floor is a shape check only — a recipient may require more, and refuses with weakPassword.
12
+ */
13
+ password: string;
14
+ /**
15
+ * Serialize the audit trail alongside the operational state. Absent means false — stated in prose rather than as a schema `default`, because a materialised default turns an omitted member into an asserted one in generated bindings, which is a different document.
16
+ */
17
+ includeAudit?: boolean;
18
+ /**
19
+ * Requested transport mechanism — how the bytes move, not how they are encrypted. This version defines `stream` (one HTTPS transfer; what an absent member means) and `chunkedTrustTask` (a sequence of get-chunk tasks over the transport already carrying this one). Deliberately not an enum: a recipient offering more must be askable for it without a specification revision, and one that does not implement the request refuses with unsupportedAlgorithm.
20
+ */
21
+ algorithm?: string;
22
+ /**
23
+ * For `chunkedTrustTask` only: the largest chunk the producer can receive, for a producer whose transport is tighter than the one the normative ceiling assumes. The recipient chooses a chunkSize no larger than this. Absent means the normative ceiling. Meaningless for any other algorithm, and a recipient ignores it there.
24
+ */
25
+ maxChunkSize?: ChunkSize;
26
+ /**
27
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
28
+ */
29
+ ext?: Ext;
30
+ }
31
+ export interface BackupInitiateExportResponsePayload {
32
+ /**
33
+ * Where the bytes are, or how they are divided, what they should be, and until when.
34
+ */
35
+ descriptor: BundleDescriptor;
36
+ /**
37
+ * Operator-facing text describing how to complete the download. Advisory: a producer must not parse it or derive behaviour from it, and a recipient must not put a secret in it.
38
+ */
39
+ completionHint?: string;
40
+ /**
41
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
42
+ */
43
+ ext?: Ext;
44
+ }
45
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
46
+ export type { BundleDescriptor, BundleId, ChunkCount, ChunkedDescriptor, ChunkManifest, ChunkSize, DigestMultibase, ExpectedSha256, ExpectedSizeBytes, ExpiresAt, Ext, StreamDescriptor };
47
+ /** Trust Task type URI. */
48
+ export declare const TYPE_URI: "https://trusttasks.org/spec/backup/initiate-export/0.1";
49
+ /** Stable alias for this specification's request payload shape. */
50
+ export type Payload = BackupInitiateExportPayload;
51
+ /** Trust Task response type URI (request type URI + "#response"). */
52
+ export declare const RESPONSE_TYPE_URI: "https://trusttasks.org/spec/backup/initiate-export/0.1#response";
53
+ /** Stable alias for this specification's success-response payload shape. */
54
+ export type Response = BackupInitiateExportResponsePayload;
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 declare const PAYLOAD_SCHEMA: {
65
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
66
+ readonly $id: "https://trusttasks.org/spec/backup/initiate-export/0.1";
67
+ readonly title: "Backup — Initiate Export — payload";
68
+ readonly description: "Asks the recipient to serialize its entire state into a password-encrypted bundle and return the descriptor that fetches it — by an HTTPS address (`stream`) or chunk by chunk over Trust Task documents (`chunkedTrustTask`). The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.";
69
+ readonly type: "object";
70
+ readonly additionalProperties: false;
71
+ readonly required: readonly ["password"];
72
+ readonly properties: {
73
+ readonly password: {
74
+ readonly type: "string";
75
+ readonly minLength: 15;
76
+ readonly maxLength: 1024;
77
+ readonly writeOnly: true;
78
+ readonly description: "Key-derivation input protecting the bundle. Chosen by the producer and never recoverable from the recipient. `writeOnly` is the machine-readable form of the rule in Data carried: this member goes in and never comes back, so a generated client must not surface it in a response type, and a recipient must never log, echo or persist it. The minLength floor is a shape check only — a recipient may require more, and refuses with weakPassword.";
79
+ readonly $comment: "No `format: password` — the annotation is advisory in 2020-12 and says less than writeOnly does. No example value anywhere in this directory: a specimen password is the one thing implementers copy.";
80
+ };
81
+ readonly includeAudit: {
82
+ readonly type: "boolean";
83
+ readonly description: "Serialize the audit trail alongside the operational state. Absent means false — stated in prose rather than as a schema `default`, because a materialised default turns an omitted member into an asserted one in generated bindings, which is a different document.";
84
+ };
85
+ readonly algorithm: {
86
+ readonly type: "string";
87
+ readonly minLength: 1;
88
+ readonly maxLength: 64;
89
+ readonly description: "Requested transport mechanism — how the bytes move, not how they are encrypted. This version defines `stream` (one HTTPS transfer; what an absent member means) and `chunkedTrustTask` (a sequence of get-chunk tasks over the transport already carrying this one). Deliberately not an enum: a recipient offering more must be askable for it without a specification revision, and one that does not implement the request refuses with unsupportedAlgorithm.";
90
+ };
91
+ readonly maxChunkSize: {
92
+ readonly $ref: "#/$defs/ChunkSize";
93
+ readonly description: "For `chunkedTrustTask` only: the largest chunk the producer can receive, for a producer whose transport is tighter than the one the normative ceiling assumes. The recipient chooses a chunkSize no larger than this. Absent means the normative ceiling. Meaningless for any other algorithm, and a recipient ignores it there.";
94
+ };
95
+ readonly ext: {
96
+ readonly $ref: "#/$defs/Ext";
97
+ readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
98
+ };
99
+ };
100
+ readonly $defs: {
101
+ readonly Response: {
102
+ readonly $anchor: "response";
103
+ readonly title: "Backup — Initiate Export — response payload";
104
+ readonly type: "object";
105
+ readonly additionalProperties: false;
106
+ readonly required: readonly ["descriptor"];
107
+ readonly properties: {
108
+ readonly descriptor: {
109
+ readonly $ref: "#/$defs/BundleDescriptor";
110
+ readonly description: "Where the bytes are, or how they are divided, what they should be, and until when.";
111
+ };
112
+ readonly completionHint: {
113
+ readonly type: "string";
114
+ readonly maxLength: 1024;
115
+ readonly description: "Operator-facing text describing how to complete the download. Advisory: a producer must not parse it or derive behaviour from it, and a recipient must not put a secret in it.";
116
+ };
117
+ readonly ext: {
118
+ readonly $ref: "#/$defs/Ext";
119
+ readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
120
+ };
121
+ };
122
+ };
123
+ readonly Ext: {
124
+ readonly title: "Ext";
125
+ 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.";
126
+ readonly type: "object";
127
+ readonly minProperties: 1;
128
+ readonly additionalProperties: true;
129
+ readonly propertyNames: {
130
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
131
+ };
132
+ };
133
+ readonly BundleDescriptor: {
134
+ readonly title: "BundleDescriptor";
135
+ readonly description: "The control-plane account of a bundle transfer: which algorithm, on what terms, until when. Exactly one of the two shapes — they are mutually exclusive, since StreamDescriptor requires `transportUrl` and `transportToken` and forbids `chunks`, and ChunkedDescriptor requires `chunks` and forbids both.";
136
+ readonly oneOf: readonly [{
137
+ readonly $ref: "#/$defs/StreamDescriptor";
138
+ }, {
139
+ readonly $ref: "#/$defs/ChunkedDescriptor";
140
+ }];
141
+ };
142
+ readonly ChunkedDescriptor: {
143
+ readonly title: "ChunkedDescriptor";
144
+ readonly type: "object";
145
+ readonly additionalProperties: false;
146
+ readonly description: "A descriptor for the `chunkedTrustTask` algorithm. Carries no address and no bearer token: every chunk moves in a Trust Task document whose sender the transport authenticates, so possession of a token would add nothing and would be one more secret to leak.";
147
+ readonly required: readonly ["bundleId", "algorithm", "chunks", "expectedSha256", "expectedSizeBytes", "expiresAt"];
148
+ readonly properties: {
149
+ readonly bundleId: {
150
+ readonly $ref: "#/$defs/BundleId";
151
+ };
152
+ readonly algorithm: {
153
+ readonly type: "string";
154
+ readonly enum: readonly ["chunkedTrustTask"];
155
+ readonly description: "Discriminates this shape from StreamDescriptor.";
156
+ };
157
+ readonly chunks: {
158
+ readonly $ref: "#/$defs/ChunkManifest";
159
+ };
160
+ readonly expectedSha256: {
161
+ readonly $ref: "#/$defs/ExpectedSha256";
162
+ };
163
+ readonly expectedSizeBytes: {
164
+ readonly $ref: "#/$defs/ExpectedSizeBytes";
165
+ };
166
+ readonly expiresAt: {
167
+ readonly $ref: "#/$defs/ExpiresAt";
168
+ };
169
+ };
170
+ };
171
+ readonly ExpiresAt: {
172
+ readonly title: "ExpiresAt";
173
+ readonly description: "After which the bundle is collected: staged bytes discarded, tokens and chunk requests refused. Short by design. For a chunked transfer a recipient may move it later as chunks are exchanged, never past its own ceiling — each chunk response reports the current value.";
174
+ readonly type: "string";
175
+ readonly format: "date-time";
176
+ };
177
+ readonly ExpectedSizeBytes: {
178
+ readonly title: "ExpectedSizeBytes";
179
+ readonly description: "Total byte count of the bundle. A zero-length bundle is not a degenerate success — nothing was serialized — so the floor is 1.";
180
+ readonly type: "integer";
181
+ readonly minimum: 1;
182
+ };
183
+ readonly ExpectedSha256: {
184
+ readonly title: "ExpectedSha256";
185
+ readonly description: "Lowercase hex SHA-256 of the whole bundle's bytes. Kept in the hex form the 1.0 descriptor published rather than moved to DigestMultibase, because it is an unchanged member of an existing descriptor and re-encoding it would break every stream producer for no gain in what it checks. For a chunked transfer it is the check over the reassembled bundle, applied after every chunk has verified individually, so that a correct set of chunks assembled in the wrong order is still caught.";
186
+ readonly type: "string";
187
+ readonly pattern: "^[0-9a-f]{64}$";
188
+ };
189
+ readonly ChunkManifest: {
190
+ readonly title: "ChunkManifest";
191
+ readonly description: "The terms of a `chunkedTrustTask` transfer, committed before any chunk moves. On export the recipient states them in the descriptor; on import the producer pre-commits them in the request and the recipient echoes them. Either way the manifest arrives in a document whose proof is REQUIRED, so the per-chunk digests are authenticated by the party that computed them and each chunk can be verified — and a single bad chunk re-fetched or refused — on arrival rather than only after reassembly.\n\nConsistency rules JSON Schema cannot state: `chunkCount` MUST equal ceil(expectedSizeBytes / chunkSize) for the bundle the manifest describes, and `chunkDigests` MUST have exactly `chunkCount` items. A party receiving a manifest violating either MUST refuse it.";
192
+ readonly type: "object";
193
+ readonly additionalProperties: false;
194
+ readonly required: readonly ["chunkSize", "chunkCount", "chunkDigests"];
195
+ readonly properties: {
196
+ readonly chunkSize: {
197
+ readonly $ref: "#/$defs/ChunkSize";
198
+ };
199
+ readonly chunkCount: {
200
+ readonly $ref: "#/$defs/ChunkCount";
201
+ };
202
+ readonly chunkDigests: {
203
+ readonly type: "array";
204
+ readonly minItems: 1;
205
+ readonly maxItems: 4096;
206
+ readonly description: "Digest of each chunk's raw bytes (not of its base64url encoding), in index order. Compared as decoded multihash bytes, never as encoded strings. sha2-256 is RECOMMENDED and MUST be implemented by every party; a party that does not implement the hash a digest names MUST treat the manifest as unverifiable rather than skip the check.";
207
+ readonly items: {
208
+ readonly $ref: "#/$defs/DigestMultibase";
209
+ };
210
+ };
211
+ };
212
+ };
213
+ readonly ChunkCount: {
214
+ readonly title: "ChunkCount";
215
+ readonly description: "Number of chunks in the bundle, equal to ceil(expectedSizeBytes / chunkSize). Bounded at 4096 so that the manifest itself — one digest per chunk — fits in the single document that carries it under the same message-size reasoning as a chunk.";
216
+ readonly type: "integer";
217
+ readonly minimum: 1;
218
+ readonly maximum: 4096;
219
+ };
220
+ readonly ChunkSize: {
221
+ readonly title: "ChunkSize";
222
+ readonly description: "Size in bytes of every chunk except the last, which carries the remainder and is between 1 and this value inclusive. The ceiling of 262144 (256 KiB) is normative and is derived in `vta/backup/initiate-export/1.1` under Chunked transfer: it is the largest power of two whose `get-chunk` or `put-chunk` document still fits a 1 MiB mediator message after base64url encoding of `data`, DIDComm authcrypt encoding, and two nested forward wrappers. The floor of 16384 keeps a 1 GiB bundle within `ChunkCount`'s ceiling at sizes a constrained transport can still choose.";
223
+ readonly type: "integer";
224
+ readonly minimum: 16384;
225
+ readonly maximum: 262144;
226
+ };
227
+ readonly DigestMultibase: {
228
+ readonly title: "DigestMultibase";
229
+ readonly description: "A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.\n\nMultihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.\n\nThis definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.\n\nRestricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that \"interoperability is not guaranteed between implementations using such values\", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.";
230
+ readonly type: "string";
231
+ readonly minLength: 16;
232
+ readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
233
+ readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
234
+ };
235
+ readonly BundleId: {
236
+ readonly title: "BundleId";
237
+ readonly description: "Handle for a bundle across its whole lifecycle. Recipient-generated and unguessable, which is what lets an unauthorized reference be answered as not-found without confirming existence. Opaque: a producer quotes what it was given and must not derive, guess or enumerate one.";
238
+ readonly type: "string";
239
+ readonly pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$";
240
+ };
241
+ readonly StreamDescriptor: {
242
+ readonly title: "StreamDescriptor";
243
+ readonly type: "object";
244
+ readonly additionalProperties: false;
245
+ readonly description: "A descriptor for a transfer that happens outside Trust Task documents, at an address the recipient publishes — the `stream` algorithm, and any other algorithm a recipient offers that is shaped as an address plus a bearer credential. Identical in members to the `vta/backup/*/1.0` descriptor.";
246
+ readonly required: readonly ["bundleId", "algorithm", "transportUrl", "transportToken", "expectedSha256", "expectedSizeBytes", "expiresAt"];
247
+ readonly properties: {
248
+ readonly bundleId: {
249
+ readonly $ref: "#/$defs/BundleId";
250
+ };
251
+ readonly algorithm: {
252
+ readonly type: "string";
253
+ readonly minLength: 1;
254
+ readonly maxLength: 64;
255
+ readonly description: "The mechanism in use. Never `chunkedTrustTask`, which has its own descriptor shape; a descriptor naming it with a transport address is malformed.";
256
+ };
257
+ readonly transportUrl: {
258
+ readonly type: "string";
259
+ readonly format: "uri";
260
+ readonly maxLength: 2048;
261
+ readonly description: "Where to fetch (export) or write (import) the bytes. A recipient with no address at which it is reachable cannot produce this and refuses with transportUnavailable rather than returning an unusable one. An import address is write-only: staged bytes are never served back from it.";
262
+ };
263
+ readonly transportToken: {
264
+ readonly type: "string";
265
+ readonly minLength: 1;
266
+ readonly maxLength: 1024;
267
+ readonly description: "Bearer credential for transportUrl, presented in the X-Backup-Token header. Minted per bundle and never reused. A recipient should store only a hash of it, and should accept an export token once.";
268
+ };
269
+ readonly expectedSha256: {
270
+ readonly $ref: "#/$defs/ExpectedSha256";
271
+ };
272
+ readonly expectedSizeBytes: {
273
+ readonly $ref: "#/$defs/ExpectedSizeBytes";
274
+ };
275
+ readonly expiresAt: {
276
+ readonly $ref: "#/$defs/ExpiresAt";
277
+ };
278
+ };
279
+ };
280
+ };
281
+ };
282
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
283
+ export declare const RESPONSE_PAYLOAD_SCHEMA: {
284
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
285
+ readonly $ref: "#/$defs/Response";
286
+ readonly $defs: {
287
+ readonly Response: {
288
+ readonly $anchor: "response";
289
+ readonly title: "Backup — Initiate Export — response payload";
290
+ readonly type: "object";
291
+ readonly additionalProperties: false;
292
+ readonly required: readonly ["descriptor"];
293
+ readonly properties: {
294
+ readonly descriptor: {
295
+ readonly $ref: "#/$defs/BundleDescriptor";
296
+ readonly description: "Where the bytes are, or how they are divided, what they should be, and until when.";
297
+ };
298
+ readonly completionHint: {
299
+ readonly type: "string";
300
+ readonly maxLength: 1024;
301
+ readonly description: "Operator-facing text describing how to complete the download. Advisory: a producer must not parse it or derive behaviour from it, and a recipient must not put a secret in it.";
302
+ };
303
+ readonly ext: {
304
+ readonly $ref: "#/$defs/Ext";
305
+ readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
306
+ };
307
+ };
308
+ };
309
+ readonly Ext: {
310
+ readonly title: "Ext";
311
+ 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.";
312
+ readonly type: "object";
313
+ readonly minProperties: 1;
314
+ readonly additionalProperties: true;
315
+ readonly propertyNames: {
316
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
317
+ };
318
+ };
319
+ readonly BundleDescriptor: {
320
+ readonly title: "BundleDescriptor";
321
+ readonly description: "The control-plane account of a bundle transfer: which algorithm, on what terms, until when. Exactly one of the two shapes — they are mutually exclusive, since StreamDescriptor requires `transportUrl` and `transportToken` and forbids `chunks`, and ChunkedDescriptor requires `chunks` and forbids both.";
322
+ readonly oneOf: readonly [{
323
+ readonly $ref: "#/$defs/StreamDescriptor";
324
+ }, {
325
+ readonly $ref: "#/$defs/ChunkedDescriptor";
326
+ }];
327
+ };
328
+ readonly ChunkedDescriptor: {
329
+ readonly title: "ChunkedDescriptor";
330
+ readonly type: "object";
331
+ readonly additionalProperties: false;
332
+ readonly description: "A descriptor for the `chunkedTrustTask` algorithm. Carries no address and no bearer token: every chunk moves in a Trust Task document whose sender the transport authenticates, so possession of a token would add nothing and would be one more secret to leak.";
333
+ readonly required: readonly ["bundleId", "algorithm", "chunks", "expectedSha256", "expectedSizeBytes", "expiresAt"];
334
+ readonly properties: {
335
+ readonly bundleId: {
336
+ readonly $ref: "#/$defs/BundleId";
337
+ };
338
+ readonly algorithm: {
339
+ readonly type: "string";
340
+ readonly enum: readonly ["chunkedTrustTask"];
341
+ readonly description: "Discriminates this shape from StreamDescriptor.";
342
+ };
343
+ readonly chunks: {
344
+ readonly $ref: "#/$defs/ChunkManifest";
345
+ };
346
+ readonly expectedSha256: {
347
+ readonly $ref: "#/$defs/ExpectedSha256";
348
+ };
349
+ readonly expectedSizeBytes: {
350
+ readonly $ref: "#/$defs/ExpectedSizeBytes";
351
+ };
352
+ readonly expiresAt: {
353
+ readonly $ref: "#/$defs/ExpiresAt";
354
+ };
355
+ };
356
+ };
357
+ readonly ExpiresAt: {
358
+ readonly title: "ExpiresAt";
359
+ readonly description: "After which the bundle is collected: staged bytes discarded, tokens and chunk requests refused. Short by design. For a chunked transfer a recipient may move it later as chunks are exchanged, never past its own ceiling — each chunk response reports the current value.";
360
+ readonly type: "string";
361
+ readonly format: "date-time";
362
+ };
363
+ readonly ExpectedSizeBytes: {
364
+ readonly title: "ExpectedSizeBytes";
365
+ readonly description: "Total byte count of the bundle. A zero-length bundle is not a degenerate success — nothing was serialized — so the floor is 1.";
366
+ readonly type: "integer";
367
+ readonly minimum: 1;
368
+ };
369
+ readonly ExpectedSha256: {
370
+ readonly title: "ExpectedSha256";
371
+ readonly description: "Lowercase hex SHA-256 of the whole bundle's bytes. Kept in the hex form the 1.0 descriptor published rather than moved to DigestMultibase, because it is an unchanged member of an existing descriptor and re-encoding it would break every stream producer for no gain in what it checks. For a chunked transfer it is the check over the reassembled bundle, applied after every chunk has verified individually, so that a correct set of chunks assembled in the wrong order is still caught.";
372
+ readonly type: "string";
373
+ readonly pattern: "^[0-9a-f]{64}$";
374
+ };
375
+ readonly ChunkManifest: {
376
+ readonly title: "ChunkManifest";
377
+ readonly description: "The terms of a `chunkedTrustTask` transfer, committed before any chunk moves. On export the recipient states them in the descriptor; on import the producer pre-commits them in the request and the recipient echoes them. Either way the manifest arrives in a document whose proof is REQUIRED, so the per-chunk digests are authenticated by the party that computed them and each chunk can be verified — and a single bad chunk re-fetched or refused — on arrival rather than only after reassembly.\n\nConsistency rules JSON Schema cannot state: `chunkCount` MUST equal ceil(expectedSizeBytes / chunkSize) for the bundle the manifest describes, and `chunkDigests` MUST have exactly `chunkCount` items. A party receiving a manifest violating either MUST refuse it.";
378
+ readonly type: "object";
379
+ readonly additionalProperties: false;
380
+ readonly required: readonly ["chunkSize", "chunkCount", "chunkDigests"];
381
+ readonly properties: {
382
+ readonly chunkSize: {
383
+ readonly $ref: "#/$defs/ChunkSize";
384
+ };
385
+ readonly chunkCount: {
386
+ readonly $ref: "#/$defs/ChunkCount";
387
+ };
388
+ readonly chunkDigests: {
389
+ readonly type: "array";
390
+ readonly minItems: 1;
391
+ readonly maxItems: 4096;
392
+ readonly description: "Digest of each chunk's raw bytes (not of its base64url encoding), in index order. Compared as decoded multihash bytes, never as encoded strings. sha2-256 is RECOMMENDED and MUST be implemented by every party; a party that does not implement the hash a digest names MUST treat the manifest as unverifiable rather than skip the check.";
393
+ readonly items: {
394
+ readonly $ref: "#/$defs/DigestMultibase";
395
+ };
396
+ };
397
+ };
398
+ };
399
+ readonly ChunkCount: {
400
+ readonly title: "ChunkCount";
401
+ readonly description: "Number of chunks in the bundle, equal to ceil(expectedSizeBytes / chunkSize). Bounded at 4096 so that the manifest itself — one digest per chunk — fits in the single document that carries it under the same message-size reasoning as a chunk.";
402
+ readonly type: "integer";
403
+ readonly minimum: 1;
404
+ readonly maximum: 4096;
405
+ };
406
+ readonly ChunkSize: {
407
+ readonly title: "ChunkSize";
408
+ readonly description: "Size in bytes of every chunk except the last, which carries the remainder and is between 1 and this value inclusive. The ceiling of 262144 (256 KiB) is normative and is derived in `vta/backup/initiate-export/1.1` under Chunked transfer: it is the largest power of two whose `get-chunk` or `put-chunk` document still fits a 1 MiB mediator message after base64url encoding of `data`, DIDComm authcrypt encoding, and two nested forward wrappers. The floor of 16384 keeps a 1 GiB bundle within `ChunkCount`'s ceiling at sizes a constrained transport can still choose.";
409
+ readonly type: "integer";
410
+ readonly minimum: 16384;
411
+ readonly maximum: 262144;
412
+ };
413
+ readonly DigestMultibase: {
414
+ readonly title: "DigestMultibase";
415
+ readonly description: "A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.\n\nMultihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.\n\nThis definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.\n\nRestricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that \"interoperability is not guaranteed between implementations using such values\", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.";
416
+ readonly type: "string";
417
+ readonly minLength: 16;
418
+ readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
419
+ readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
420
+ };
421
+ readonly BundleId: {
422
+ readonly title: "BundleId";
423
+ readonly description: "Handle for a bundle across its whole lifecycle. Recipient-generated and unguessable, which is what lets an unauthorized reference be answered as not-found without confirming existence. Opaque: a producer quotes what it was given and must not derive, guess or enumerate one.";
424
+ readonly type: "string";
425
+ readonly pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$";
426
+ };
427
+ readonly StreamDescriptor: {
428
+ readonly title: "StreamDescriptor";
429
+ readonly type: "object";
430
+ readonly additionalProperties: false;
431
+ readonly description: "A descriptor for a transfer that happens outside Trust Task documents, at an address the recipient publishes — the `stream` algorithm, and any other algorithm a recipient offers that is shaped as an address plus a bearer credential. Identical in members to the `vta/backup/*/1.0` descriptor.";
432
+ readonly required: readonly ["bundleId", "algorithm", "transportUrl", "transportToken", "expectedSha256", "expectedSizeBytes", "expiresAt"];
433
+ readonly properties: {
434
+ readonly bundleId: {
435
+ readonly $ref: "#/$defs/BundleId";
436
+ };
437
+ readonly algorithm: {
438
+ readonly type: "string";
439
+ readonly minLength: 1;
440
+ readonly maxLength: 64;
441
+ readonly description: "The mechanism in use. Never `chunkedTrustTask`, which has its own descriptor shape; a descriptor naming it with a transport address is malformed.";
442
+ };
443
+ readonly transportUrl: {
444
+ readonly type: "string";
445
+ readonly format: "uri";
446
+ readonly maxLength: 2048;
447
+ readonly description: "Where to fetch (export) or write (import) the bytes. A recipient with no address at which it is reachable cannot produce this and refuses with transportUnavailable rather than returning an unusable one. An import address is write-only: staged bytes are never served back from it.";
448
+ };
449
+ readonly transportToken: {
450
+ readonly type: "string";
451
+ readonly minLength: 1;
452
+ readonly maxLength: 1024;
453
+ readonly description: "Bearer credential for transportUrl, presented in the X-Backup-Token header. Minted per bundle and never reused. A recipient should store only a hash of it, and should accept an export token once.";
454
+ };
455
+ readonly expectedSha256: {
456
+ readonly $ref: "#/$defs/ExpectedSha256";
457
+ };
458
+ readonly expectedSizeBytes: {
459
+ readonly $ref: "#/$defs/ExpectedSizeBytes";
460
+ };
461
+ readonly expiresAt: {
462
+ readonly $ref: "#/$defs/ExpiresAt";
463
+ };
464
+ };
465
+ };
466
+ };
467
+ };
468
+ /**
469
+ * SPEC.md §7.2 policy for the request variant, from this specification's
470
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
471
+ * per-specification and cannot be derived from the document alone, and
472
+ * item 2 needs the schema this carries.
473
+ */
474
+ export declare const SPEC: {
475
+ readonly typeUri: "https://trusttasks.org/spec/backup/initiate-export/0.1";
476
+ readonly isBearer: false;
477
+ readonly isProofRequired: true;
478
+ readonly isRecipientRequired: true;
479
+ readonly isIssuedAtRequired: true;
480
+ readonly payloadSchema: {
481
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
482
+ readonly $id: "https://trusttasks.org/spec/backup/initiate-export/0.1";
483
+ readonly title: "Backup — Initiate Export — payload";
484
+ readonly description: "Asks the recipient to serialize its entire state into a password-encrypted bundle and return the descriptor that fetches it — by an HTTPS address (`stream`) or chunk by chunk over Trust Task documents (`chunkedTrustTask`). The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.";
485
+ readonly type: "object";
486
+ readonly additionalProperties: false;
487
+ readonly required: readonly ["password"];
488
+ readonly properties: {
489
+ readonly password: {
490
+ readonly type: "string";
491
+ readonly minLength: 15;
492
+ readonly maxLength: 1024;
493
+ readonly writeOnly: true;
494
+ readonly description: "Key-derivation input protecting the bundle. Chosen by the producer and never recoverable from the recipient. `writeOnly` is the machine-readable form of the rule in Data carried: this member goes in and never comes back, so a generated client must not surface it in a response type, and a recipient must never log, echo or persist it. The minLength floor is a shape check only — a recipient may require more, and refuses with weakPassword.";
495
+ readonly $comment: "No `format: password` — the annotation is advisory in 2020-12 and says less than writeOnly does. No example value anywhere in this directory: a specimen password is the one thing implementers copy.";
496
+ };
497
+ readonly includeAudit: {
498
+ readonly type: "boolean";
499
+ readonly description: "Serialize the audit trail alongside the operational state. Absent means false — stated in prose rather than as a schema `default`, because a materialised default turns an omitted member into an asserted one in generated bindings, which is a different document.";
500
+ };
501
+ readonly algorithm: {
502
+ readonly type: "string";
503
+ readonly minLength: 1;
504
+ readonly maxLength: 64;
505
+ readonly description: "Requested transport mechanism — how the bytes move, not how they are encrypted. This version defines `stream` (one HTTPS transfer; what an absent member means) and `chunkedTrustTask` (a sequence of get-chunk tasks over the transport already carrying this one). Deliberately not an enum: a recipient offering more must be askable for it without a specification revision, and one that does not implement the request refuses with unsupportedAlgorithm.";
506
+ };
507
+ readonly maxChunkSize: {
508
+ readonly $ref: "#/$defs/ChunkSize";
509
+ readonly description: "For `chunkedTrustTask` only: the largest chunk the producer can receive, for a producer whose transport is tighter than the one the normative ceiling assumes. The recipient chooses a chunkSize no larger than this. Absent means the normative ceiling. Meaningless for any other algorithm, and a recipient ignores it there.";
510
+ };
511
+ readonly ext: {
512
+ readonly $ref: "#/$defs/Ext";
513
+ readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
514
+ };
515
+ };
516
+ readonly $defs: {
517
+ readonly Response: {
518
+ readonly $anchor: "response";
519
+ readonly title: "Backup — Initiate Export — response payload";
520
+ readonly type: "object";
521
+ readonly additionalProperties: false;
522
+ readonly required: readonly ["descriptor"];
523
+ readonly properties: {
524
+ readonly descriptor: {
525
+ readonly $ref: "#/$defs/BundleDescriptor";
526
+ readonly description: "Where the bytes are, or how they are divided, what they should be, and until when.";
527
+ };
528
+ readonly completionHint: {
529
+ readonly type: "string";
530
+ readonly maxLength: 1024;
531
+ readonly description: "Operator-facing text describing how to complete the download. Advisory: a producer must not parse it or derive behaviour from it, and a recipient must not put a secret in it.";
532
+ };
533
+ readonly ext: {
534
+ readonly $ref: "#/$defs/Ext";
535
+ readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
536
+ };
537
+ };
538
+ };
539
+ readonly Ext: {
540
+ readonly title: "Ext";
541
+ 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.";
542
+ readonly type: "object";
543
+ readonly minProperties: 1;
544
+ readonly additionalProperties: true;
545
+ readonly propertyNames: {
546
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
547
+ };
548
+ };
549
+ readonly BundleDescriptor: {
550
+ readonly title: "BundleDescriptor";
551
+ readonly description: "The control-plane account of a bundle transfer: which algorithm, on what terms, until when. Exactly one of the two shapes — they are mutually exclusive, since StreamDescriptor requires `transportUrl` and `transportToken` and forbids `chunks`, and ChunkedDescriptor requires `chunks` and forbids both.";
552
+ readonly oneOf: readonly [{
553
+ readonly $ref: "#/$defs/StreamDescriptor";
554
+ }, {
555
+ readonly $ref: "#/$defs/ChunkedDescriptor";
556
+ }];
557
+ };
558
+ readonly ChunkedDescriptor: {
559
+ readonly title: "ChunkedDescriptor";
560
+ readonly type: "object";
561
+ readonly additionalProperties: false;
562
+ readonly description: "A descriptor for the `chunkedTrustTask` algorithm. Carries no address and no bearer token: every chunk moves in a Trust Task document whose sender the transport authenticates, so possession of a token would add nothing and would be one more secret to leak.";
563
+ readonly required: readonly ["bundleId", "algorithm", "chunks", "expectedSha256", "expectedSizeBytes", "expiresAt"];
564
+ readonly properties: {
565
+ readonly bundleId: {
566
+ readonly $ref: "#/$defs/BundleId";
567
+ };
568
+ readonly algorithm: {
569
+ readonly type: "string";
570
+ readonly enum: readonly ["chunkedTrustTask"];
571
+ readonly description: "Discriminates this shape from StreamDescriptor.";
572
+ };
573
+ readonly chunks: {
574
+ readonly $ref: "#/$defs/ChunkManifest";
575
+ };
576
+ readonly expectedSha256: {
577
+ readonly $ref: "#/$defs/ExpectedSha256";
578
+ };
579
+ readonly expectedSizeBytes: {
580
+ readonly $ref: "#/$defs/ExpectedSizeBytes";
581
+ };
582
+ readonly expiresAt: {
583
+ readonly $ref: "#/$defs/ExpiresAt";
584
+ };
585
+ };
586
+ };
587
+ readonly ExpiresAt: {
588
+ readonly title: "ExpiresAt";
589
+ readonly description: "After which the bundle is collected: staged bytes discarded, tokens and chunk requests refused. Short by design. For a chunked transfer a recipient may move it later as chunks are exchanged, never past its own ceiling — each chunk response reports the current value.";
590
+ readonly type: "string";
591
+ readonly format: "date-time";
592
+ };
593
+ readonly ExpectedSizeBytes: {
594
+ readonly title: "ExpectedSizeBytes";
595
+ readonly description: "Total byte count of the bundle. A zero-length bundle is not a degenerate success — nothing was serialized — so the floor is 1.";
596
+ readonly type: "integer";
597
+ readonly minimum: 1;
598
+ };
599
+ readonly ExpectedSha256: {
600
+ readonly title: "ExpectedSha256";
601
+ readonly description: "Lowercase hex SHA-256 of the whole bundle's bytes. Kept in the hex form the 1.0 descriptor published rather than moved to DigestMultibase, because it is an unchanged member of an existing descriptor and re-encoding it would break every stream producer for no gain in what it checks. For a chunked transfer it is the check over the reassembled bundle, applied after every chunk has verified individually, so that a correct set of chunks assembled in the wrong order is still caught.";
602
+ readonly type: "string";
603
+ readonly pattern: "^[0-9a-f]{64}$";
604
+ };
605
+ readonly ChunkManifest: {
606
+ readonly title: "ChunkManifest";
607
+ readonly description: "The terms of a `chunkedTrustTask` transfer, committed before any chunk moves. On export the recipient states them in the descriptor; on import the producer pre-commits them in the request and the recipient echoes them. Either way the manifest arrives in a document whose proof is REQUIRED, so the per-chunk digests are authenticated by the party that computed them and each chunk can be verified — and a single bad chunk re-fetched or refused — on arrival rather than only after reassembly.\n\nConsistency rules JSON Schema cannot state: `chunkCount` MUST equal ceil(expectedSizeBytes / chunkSize) for the bundle the manifest describes, and `chunkDigests` MUST have exactly `chunkCount` items. A party receiving a manifest violating either MUST refuse it.";
608
+ readonly type: "object";
609
+ readonly additionalProperties: false;
610
+ readonly required: readonly ["chunkSize", "chunkCount", "chunkDigests"];
611
+ readonly properties: {
612
+ readonly chunkSize: {
613
+ readonly $ref: "#/$defs/ChunkSize";
614
+ };
615
+ readonly chunkCount: {
616
+ readonly $ref: "#/$defs/ChunkCount";
617
+ };
618
+ readonly chunkDigests: {
619
+ readonly type: "array";
620
+ readonly minItems: 1;
621
+ readonly maxItems: 4096;
622
+ readonly description: "Digest of each chunk's raw bytes (not of its base64url encoding), in index order. Compared as decoded multihash bytes, never as encoded strings. sha2-256 is RECOMMENDED and MUST be implemented by every party; a party that does not implement the hash a digest names MUST treat the manifest as unverifiable rather than skip the check.";
623
+ readonly items: {
624
+ readonly $ref: "#/$defs/DigestMultibase";
625
+ };
626
+ };
627
+ };
628
+ };
629
+ readonly ChunkCount: {
630
+ readonly title: "ChunkCount";
631
+ readonly description: "Number of chunks in the bundle, equal to ceil(expectedSizeBytes / chunkSize). Bounded at 4096 so that the manifest itself — one digest per chunk — fits in the single document that carries it under the same message-size reasoning as a chunk.";
632
+ readonly type: "integer";
633
+ readonly minimum: 1;
634
+ readonly maximum: 4096;
635
+ };
636
+ readonly ChunkSize: {
637
+ readonly title: "ChunkSize";
638
+ readonly description: "Size in bytes of every chunk except the last, which carries the remainder and is between 1 and this value inclusive. The ceiling of 262144 (256 KiB) is normative and is derived in `vta/backup/initiate-export/1.1` under Chunked transfer: it is the largest power of two whose `get-chunk` or `put-chunk` document still fits a 1 MiB mediator message after base64url encoding of `data`, DIDComm authcrypt encoding, and two nested forward wrappers. The floor of 16384 keeps a 1 GiB bundle within `ChunkCount`'s ceiling at sizes a constrained transport can still choose.";
639
+ readonly type: "integer";
640
+ readonly minimum: 16384;
641
+ readonly maximum: 262144;
642
+ };
643
+ readonly DigestMultibase: {
644
+ readonly title: "DigestMultibase";
645
+ readonly description: "A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.\n\nMultihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.\n\nThis definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.\n\nRestricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that \"interoperability is not guaranteed between implementations using such values\", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.";
646
+ readonly type: "string";
647
+ readonly minLength: 16;
648
+ readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
649
+ readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
650
+ };
651
+ readonly BundleId: {
652
+ readonly title: "BundleId";
653
+ readonly description: "Handle for a bundle across its whole lifecycle. Recipient-generated and unguessable, which is what lets an unauthorized reference be answered as not-found without confirming existence. Opaque: a producer quotes what it was given and must not derive, guess or enumerate one.";
654
+ readonly type: "string";
655
+ readonly pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$";
656
+ };
657
+ readonly StreamDescriptor: {
658
+ readonly title: "StreamDescriptor";
659
+ readonly type: "object";
660
+ readonly additionalProperties: false;
661
+ readonly description: "A descriptor for a transfer that happens outside Trust Task documents, at an address the recipient publishes — the `stream` algorithm, and any other algorithm a recipient offers that is shaped as an address plus a bearer credential. Identical in members to the `vta/backup/*/1.0` descriptor.";
662
+ readonly required: readonly ["bundleId", "algorithm", "transportUrl", "transportToken", "expectedSha256", "expectedSizeBytes", "expiresAt"];
663
+ readonly properties: {
664
+ readonly bundleId: {
665
+ readonly $ref: "#/$defs/BundleId";
666
+ };
667
+ readonly algorithm: {
668
+ readonly type: "string";
669
+ readonly minLength: 1;
670
+ readonly maxLength: 64;
671
+ readonly description: "The mechanism in use. Never `chunkedTrustTask`, which has its own descriptor shape; a descriptor naming it with a transport address is malformed.";
672
+ };
673
+ readonly transportUrl: {
674
+ readonly type: "string";
675
+ readonly format: "uri";
676
+ readonly maxLength: 2048;
677
+ readonly description: "Where to fetch (export) or write (import) the bytes. A recipient with no address at which it is reachable cannot produce this and refuses with transportUnavailable rather than returning an unusable one. An import address is write-only: staged bytes are never served back from it.";
678
+ };
679
+ readonly transportToken: {
680
+ readonly type: "string";
681
+ readonly minLength: 1;
682
+ readonly maxLength: 1024;
683
+ readonly description: "Bearer credential for transportUrl, presented in the X-Backup-Token header. Minted per bundle and never reused. A recipient should store only a hash of it, and should accept an export token once.";
684
+ };
685
+ readonly expectedSha256: {
686
+ readonly $ref: "#/$defs/ExpectedSha256";
687
+ };
688
+ readonly expectedSizeBytes: {
689
+ readonly $ref: "#/$defs/ExpectedSizeBytes";
690
+ };
691
+ readonly expiresAt: {
692
+ readonly $ref: "#/$defs/ExpiresAt";
693
+ };
694
+ };
695
+ };
696
+ };
697
+ };
698
+ };
699
+ /**
700
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
701
+ * tracks the *issuer* party's requirement because a response swaps the
702
+ * parties (§7.3 item 5).
703
+ */
704
+ export declare const RESPONSE_SPEC: {
705
+ readonly typeUri: "https://trusttasks.org/spec/backup/initiate-export/0.1#response";
706
+ readonly isBearer: false;
707
+ readonly isProofRequired: true;
708
+ readonly isRecipientRequired: true;
709
+ readonly isIssuedAtRequired: true;
710
+ readonly payloadSchema: {
711
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
712
+ readonly $ref: "#/$defs/Response";
713
+ readonly $defs: {
714
+ readonly Response: {
715
+ readonly $anchor: "response";
716
+ readonly title: "Backup — Initiate Export — response payload";
717
+ readonly type: "object";
718
+ readonly additionalProperties: false;
719
+ readonly required: readonly ["descriptor"];
720
+ readonly properties: {
721
+ readonly descriptor: {
722
+ readonly $ref: "#/$defs/BundleDescriptor";
723
+ readonly description: "Where the bytes are, or how they are divided, what they should be, and until when.";
724
+ };
725
+ readonly completionHint: {
726
+ readonly type: "string";
727
+ readonly maxLength: 1024;
728
+ readonly description: "Operator-facing text describing how to complete the download. Advisory: a producer must not parse it or derive behaviour from it, and a recipient must not put a secret in it.";
729
+ };
730
+ readonly ext: {
731
+ readonly $ref: "#/$defs/Ext";
732
+ readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
733
+ };
734
+ };
735
+ };
736
+ readonly Ext: {
737
+ readonly title: "Ext";
738
+ 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.";
739
+ readonly type: "object";
740
+ readonly minProperties: 1;
741
+ readonly additionalProperties: true;
742
+ readonly propertyNames: {
743
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
744
+ };
745
+ };
746
+ readonly BundleDescriptor: {
747
+ readonly title: "BundleDescriptor";
748
+ readonly description: "The control-plane account of a bundle transfer: which algorithm, on what terms, until when. Exactly one of the two shapes — they are mutually exclusive, since StreamDescriptor requires `transportUrl` and `transportToken` and forbids `chunks`, and ChunkedDescriptor requires `chunks` and forbids both.";
749
+ readonly oneOf: readonly [{
750
+ readonly $ref: "#/$defs/StreamDescriptor";
751
+ }, {
752
+ readonly $ref: "#/$defs/ChunkedDescriptor";
753
+ }];
754
+ };
755
+ readonly ChunkedDescriptor: {
756
+ readonly title: "ChunkedDescriptor";
757
+ readonly type: "object";
758
+ readonly additionalProperties: false;
759
+ readonly description: "A descriptor for the `chunkedTrustTask` algorithm. Carries no address and no bearer token: every chunk moves in a Trust Task document whose sender the transport authenticates, so possession of a token would add nothing and would be one more secret to leak.";
760
+ readonly required: readonly ["bundleId", "algorithm", "chunks", "expectedSha256", "expectedSizeBytes", "expiresAt"];
761
+ readonly properties: {
762
+ readonly bundleId: {
763
+ readonly $ref: "#/$defs/BundleId";
764
+ };
765
+ readonly algorithm: {
766
+ readonly type: "string";
767
+ readonly enum: readonly ["chunkedTrustTask"];
768
+ readonly description: "Discriminates this shape from StreamDescriptor.";
769
+ };
770
+ readonly chunks: {
771
+ readonly $ref: "#/$defs/ChunkManifest";
772
+ };
773
+ readonly expectedSha256: {
774
+ readonly $ref: "#/$defs/ExpectedSha256";
775
+ };
776
+ readonly expectedSizeBytes: {
777
+ readonly $ref: "#/$defs/ExpectedSizeBytes";
778
+ };
779
+ readonly expiresAt: {
780
+ readonly $ref: "#/$defs/ExpiresAt";
781
+ };
782
+ };
783
+ };
784
+ readonly ExpiresAt: {
785
+ readonly title: "ExpiresAt";
786
+ readonly description: "After which the bundle is collected: staged bytes discarded, tokens and chunk requests refused. Short by design. For a chunked transfer a recipient may move it later as chunks are exchanged, never past its own ceiling — each chunk response reports the current value.";
787
+ readonly type: "string";
788
+ readonly format: "date-time";
789
+ };
790
+ readonly ExpectedSizeBytes: {
791
+ readonly title: "ExpectedSizeBytes";
792
+ readonly description: "Total byte count of the bundle. A zero-length bundle is not a degenerate success — nothing was serialized — so the floor is 1.";
793
+ readonly type: "integer";
794
+ readonly minimum: 1;
795
+ };
796
+ readonly ExpectedSha256: {
797
+ readonly title: "ExpectedSha256";
798
+ readonly description: "Lowercase hex SHA-256 of the whole bundle's bytes. Kept in the hex form the 1.0 descriptor published rather than moved to DigestMultibase, because it is an unchanged member of an existing descriptor and re-encoding it would break every stream producer for no gain in what it checks. For a chunked transfer it is the check over the reassembled bundle, applied after every chunk has verified individually, so that a correct set of chunks assembled in the wrong order is still caught.";
799
+ readonly type: "string";
800
+ readonly pattern: "^[0-9a-f]{64}$";
801
+ };
802
+ readonly ChunkManifest: {
803
+ readonly title: "ChunkManifest";
804
+ readonly description: "The terms of a `chunkedTrustTask` transfer, committed before any chunk moves. On export the recipient states them in the descriptor; on import the producer pre-commits them in the request and the recipient echoes them. Either way the manifest arrives in a document whose proof is REQUIRED, so the per-chunk digests are authenticated by the party that computed them and each chunk can be verified — and a single bad chunk re-fetched or refused — on arrival rather than only after reassembly.\n\nConsistency rules JSON Schema cannot state: `chunkCount` MUST equal ceil(expectedSizeBytes / chunkSize) for the bundle the manifest describes, and `chunkDigests` MUST have exactly `chunkCount` items. A party receiving a manifest violating either MUST refuse it.";
805
+ readonly type: "object";
806
+ readonly additionalProperties: false;
807
+ readonly required: readonly ["chunkSize", "chunkCount", "chunkDigests"];
808
+ readonly properties: {
809
+ readonly chunkSize: {
810
+ readonly $ref: "#/$defs/ChunkSize";
811
+ };
812
+ readonly chunkCount: {
813
+ readonly $ref: "#/$defs/ChunkCount";
814
+ };
815
+ readonly chunkDigests: {
816
+ readonly type: "array";
817
+ readonly minItems: 1;
818
+ readonly maxItems: 4096;
819
+ readonly description: "Digest of each chunk's raw bytes (not of its base64url encoding), in index order. Compared as decoded multihash bytes, never as encoded strings. sha2-256 is RECOMMENDED and MUST be implemented by every party; a party that does not implement the hash a digest names MUST treat the manifest as unverifiable rather than skip the check.";
820
+ readonly items: {
821
+ readonly $ref: "#/$defs/DigestMultibase";
822
+ };
823
+ };
824
+ };
825
+ };
826
+ readonly ChunkCount: {
827
+ readonly title: "ChunkCount";
828
+ readonly description: "Number of chunks in the bundle, equal to ceil(expectedSizeBytes / chunkSize). Bounded at 4096 so that the manifest itself — one digest per chunk — fits in the single document that carries it under the same message-size reasoning as a chunk.";
829
+ readonly type: "integer";
830
+ readonly minimum: 1;
831
+ readonly maximum: 4096;
832
+ };
833
+ readonly ChunkSize: {
834
+ readonly title: "ChunkSize";
835
+ readonly description: "Size in bytes of every chunk except the last, which carries the remainder and is between 1 and this value inclusive. The ceiling of 262144 (256 KiB) is normative and is derived in `vta/backup/initiate-export/1.1` under Chunked transfer: it is the largest power of two whose `get-chunk` or `put-chunk` document still fits a 1 MiB mediator message after base64url encoding of `data`, DIDComm authcrypt encoding, and two nested forward wrappers. The floor of 16384 keeps a 1 GiB bundle within `ChunkCount`'s ceiling at sizes a constrained transport can still choose.";
836
+ readonly type: "integer";
837
+ readonly minimum: 16384;
838
+ readonly maximum: 262144;
839
+ };
840
+ readonly DigestMultibase: {
841
+ readonly title: "DigestMultibase";
842
+ readonly description: "A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.\n\nMultihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.\n\nThis definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.\n\nRestricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that \"interoperability is not guaranteed between implementations using such values\", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.";
843
+ readonly type: "string";
844
+ readonly minLength: 16;
845
+ readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
846
+ readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
847
+ };
848
+ readonly BundleId: {
849
+ readonly title: "BundleId";
850
+ readonly description: "Handle for a bundle across its whole lifecycle. Recipient-generated and unguessable, which is what lets an unauthorized reference be answered as not-found without confirming existence. Opaque: a producer quotes what it was given and must not derive, guess or enumerate one.";
851
+ readonly type: "string";
852
+ readonly pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$";
853
+ };
854
+ readonly StreamDescriptor: {
855
+ readonly title: "StreamDescriptor";
856
+ readonly type: "object";
857
+ readonly additionalProperties: false;
858
+ readonly description: "A descriptor for a transfer that happens outside Trust Task documents, at an address the recipient publishes — the `stream` algorithm, and any other algorithm a recipient offers that is shaped as an address plus a bearer credential. Identical in members to the `vta/backup/*/1.0` descriptor.";
859
+ readonly required: readonly ["bundleId", "algorithm", "transportUrl", "transportToken", "expectedSha256", "expectedSizeBytes", "expiresAt"];
860
+ readonly properties: {
861
+ readonly bundleId: {
862
+ readonly $ref: "#/$defs/BundleId";
863
+ };
864
+ readonly algorithm: {
865
+ readonly type: "string";
866
+ readonly minLength: 1;
867
+ readonly maxLength: 64;
868
+ readonly description: "The mechanism in use. Never `chunkedTrustTask`, which has its own descriptor shape; a descriptor naming it with a transport address is malformed.";
869
+ };
870
+ readonly transportUrl: {
871
+ readonly type: "string";
872
+ readonly format: "uri";
873
+ readonly maxLength: 2048;
874
+ readonly description: "Where to fetch (export) or write (import) the bytes. A recipient with no address at which it is reachable cannot produce this and refuses with transportUnavailable rather than returning an unusable one. An import address is write-only: staged bytes are never served back from it.";
875
+ };
876
+ readonly transportToken: {
877
+ readonly type: "string";
878
+ readonly minLength: 1;
879
+ readonly maxLength: 1024;
880
+ readonly description: "Bearer credential for transportUrl, presented in the X-Backup-Token header. Minted per bundle and never reused. A recipient should store only a hash of it, and should accept an export token once.";
881
+ };
882
+ readonly expectedSha256: {
883
+ readonly $ref: "#/$defs/ExpectedSha256";
884
+ };
885
+ readonly expectedSizeBytes: {
886
+ readonly $ref: "#/$defs/ExpectedSizeBytes";
887
+ };
888
+ readonly expiresAt: {
889
+ readonly $ref: "#/$defs/ExpiresAt";
890
+ };
891
+ };
892
+ };
893
+ };
894
+ };
895
+ };
896
+ //# sourceMappingURL=payload.d.ts.map