@openvtc/trust-tasks 0.21.11 → 0.21.13
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.
- package/CHANGELOG.md +76 -0
- package/dist/_framework/0.4/framework.d.ts +1 -1
- package/dist/_framework/0.4/framework.d.ts.map +1 -1
- package/dist/_shared/components.d.ts +371 -0
- package/dist/_shared/components.d.ts.map +1 -1
- package/dist/auth/_shared/0.1/signing-key.d.ts +16 -0
- package/dist/auth/_shared/0.1/signing-key.d.ts.map +1 -0
- package/dist/auth/_shared/0.1/signing-key.js +6 -0
- package/dist/auth/_shared/0.1/signing-key.js.map +1 -0
- package/dist/auth/signing-key/enroll/0.1/payload.d.ts +545 -0
- package/dist/auth/signing-key/enroll/0.1/payload.d.ts.map +1 -0
- package/dist/auth/signing-key/enroll/0.1/payload.js +307 -0
- package/dist/auth/signing-key/enroll/0.1/payload.js.map +1 -0
- package/dist/auth/signing-key/list/0.1/payload.d.ts +509 -0
- package/dist/auth/signing-key/list/0.1/payload.d.ts.map +1 -0
- package/dist/auth/signing-key/list/0.1/payload.js +289 -0
- package/dist/auth/signing-key/list/0.1/payload.js.map +1 -0
- package/dist/auth/signing-key/revoke/0.1/payload.d.ts +292 -0
- package/dist/auth/signing-key/revoke/0.1/payload.d.ts.map +1 -0
- package/dist/auth/signing-key/revoke/0.1/payload.js +167 -0
- package/dist/auth/signing-key/revoke/0.1/payload.js.map +1 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +39 -0
- package/dist/index.js.map +1 -1
- package/dist/vta/contexts/update-did/1.1/payload.d.ts +388 -0
- package/dist/vta/contexts/update-did/1.1/payload.d.ts.map +1 -0
- package/dist/vta/contexts/update-did/1.1/payload.js +227 -0
- package/dist/vta/contexts/update-did/1.1/payload.js.map +1 -0
- package/dist/vtc/_shared/0.1/community-presentation.d.ts +16 -0
- package/dist/vtc/_shared/0.1/community-presentation.d.ts.map +1 -0
- package/dist/vtc/_shared/0.1/community-presentation.js +6 -0
- package/dist/vtc/_shared/0.1/community-presentation.js.map +1 -0
- package/dist/vtc/_shared/0.1/relationship-lifecycle.d.ts +16 -0
- package/dist/vtc/_shared/0.1/relationship-lifecycle.d.ts.map +1 -0
- package/dist/vtc/_shared/0.1/relationship-lifecycle.js +6 -0
- package/dist/vtc/_shared/0.1/relationship-lifecycle.js.map +1 -0
- package/dist/vtc/_shared/0.1/schema-registry.d.ts +16 -0
- package/dist/vtc/_shared/0.1/schema-registry.d.ts.map +1 -0
- package/dist/vtc/_shared/0.1/schema-registry.js +6 -0
- package/dist/vtc/_shared/0.1/schema-registry.js.map +1 -0
- package/dist/vtc/_shared/0.1/vetting-auto-grant.d.ts +16 -0
- package/dist/vtc/_shared/0.1/vetting-auto-grant.d.ts.map +1 -0
- package/dist/vtc/_shared/0.1/vetting-auto-grant.js +6 -0
- package/dist/vtc/_shared/0.1/vetting-auto-grant.js.map +1 -0
- package/dist/vtc/_shared/0.1/website-transfer.d.ts +16 -0
- package/dist/vtc/_shared/0.1/website-transfer.d.ts.map +1 -0
- package/dist/vtc/_shared/0.1/website-transfer.js +6 -0
- package/dist/vtc/_shared/0.1/website-transfer.js.map +1 -0
- package/dist/vtc/community/branding/show/0.1/payload.d.ts +319 -0
- package/dist/vtc/community/branding/show/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/community/branding/show/0.1/payload.js +179 -0
- package/dist/vtc/community/branding/show/0.1/payload.js.map +1 -0
- package/dist/vtc/community/branding/update/0.1/payload.d.ts +328 -0
- package/dist/vtc/community/branding/update/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/community/branding/update/0.1/payload.js +185 -0
- package/dist/vtc/community/branding/update/0.1/payload.js.map +1 -0
- package/dist/vtc/community/join-discovery/show/0.1/payload.d.ts +267 -0
- package/dist/vtc/community/join-discovery/show/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/community/join-discovery/show/0.1/payload.js +157 -0
- package/dist/vtc/community/join-discovery/show/0.1/payload.js.map +1 -0
- package/dist/vtc/community/join-discovery/update/0.1/payload.d.ts +276 -0
- package/dist/vtc/community/join-discovery/update/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/community/join-discovery/update/0.1/payload.js +163 -0
- package/dist/vtc/community/join-discovery/update/0.1/payload.js.map +1 -0
- package/dist/vtc/community/requested-attributes/show/0.1/payload.d.ts +339 -0
- package/dist/vtc/community/requested-attributes/show/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/community/requested-attributes/show/0.1/payload.js +193 -0
- package/dist/vtc/community/requested-attributes/show/0.1/payload.js.map +1 -0
- package/dist/vtc/community/requested-attributes/update/0.1/payload.d.ts +348 -0
- package/dist/vtc/community/requested-attributes/update/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/community/requested-attributes/update/0.1/payload.js +199 -0
- package/dist/vtc/community/requested-attributes/update/0.1/payload.js.map +1 -0
- package/dist/vtc/join-requests/query/0.1/payload.d.ts +412 -0
- package/dist/vtc/join-requests/query/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/join-requests/query/0.1/payload.js +228 -0
- package/dist/vtc/join-requests/query/0.1/payload.js.map +1 -0
- package/dist/vtc/join-requests/vetting/show/0.1/payload.d.ts +1016 -0
- package/dist/vtc/join-requests/vetting/show/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/join-requests/vetting/show/0.1/payload.js +509 -0
- package/dist/vtc/join-requests/vetting/show/0.1/payload.js.map +1 -0
- package/dist/vtc/relationships/restore/0.1/payload.d.ts +462 -0
- package/dist/vtc/relationships/restore/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/relationships/restore/0.1/payload.js +270 -0
- package/dist/vtc/relationships/restore/0.1/payload.js.map +1 -0
- package/dist/vtc/relationships/suspend/0.1/payload.d.ts +462 -0
- package/dist/vtc/relationships/suspend/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/relationships/suspend/0.1/payload.js +270 -0
- package/dist/vtc/relationships/suspend/0.1/payload.js.map +1 -0
- package/dist/vtc/rooms/list/0.1/payload.d.ts +653 -0
- package/dist/vtc/rooms/list/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/rooms/list/0.1/payload.js +360 -0
- package/dist/vtc/rooms/list/0.1/payload.js.map +1 -0
- package/dist/vtc/schemas/accepts/delete/0.1/payload.d.ts +240 -0
- package/dist/vtc/schemas/accepts/delete/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/schemas/accepts/delete/0.1/payload.js +141 -0
- package/dist/vtc/schemas/accepts/delete/0.1/payload.js.map +1 -0
- package/dist/vtc/schemas/accepts/list/0.1/payload.d.ts +1214 -0
- package/dist/vtc/schemas/accepts/list/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/schemas/accepts/list/0.1/payload.js +681 -0
- package/dist/vtc/schemas/accepts/list/0.1/payload.js.map +1 -0
- package/dist/vtc/schemas/accepts/register/0.1/payload.d.ts +1165 -0
- package/dist/vtc/schemas/accepts/register/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/schemas/accepts/register/0.1/payload.js +665 -0
- package/dist/vtc/schemas/accepts/register/0.1/payload.js.map +1 -0
- package/dist/vtc/schemas/accepts/show/0.1/payload.d.ts +1144 -0
- package/dist/vtc/schemas/accepts/show/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/schemas/accepts/show/0.1/payload.js +655 -0
- package/dist/vtc/schemas/accepts/show/0.1/payload.js.map +1 -0
- package/dist/vtc/schemas/delete/0.1/payload.d.ts +240 -0
- package/dist/vtc/schemas/delete/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/schemas/delete/0.1/payload.js +141 -0
- package/dist/vtc/schemas/delete/0.1/payload.js.map +1 -0
- package/dist/vtc/schemas/list/0.1/payload.d.ts +541 -0
- package/dist/vtc/schemas/list/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/schemas/list/0.1/payload.js +300 -0
- package/dist/vtc/schemas/list/0.1/payload.js.map +1 -0
- package/dist/vtc/schemas/register/0.1/payload.d.ts +512 -0
- package/dist/vtc/schemas/register/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/schemas/register/0.1/payload.js +292 -0
- package/dist/vtc/schemas/register/0.1/payload.js.map +1 -0
- package/dist/vtc/schemas/show/0.1/payload.d.ts +484 -0
- package/dist/vtc/schemas/show/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/schemas/show/0.1/payload.js +279 -0
- package/dist/vtc/schemas/show/0.1/payload.js.map +1 -0
- package/dist/vtc/vetting/auto-grant/show/0.1/payload.d.ts +463 -0
- package/dist/vtc/vetting/auto-grant/show/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/vetting/auto-grant/show/0.1/payload.js +269 -0
- package/dist/vtc/vetting/auto-grant/show/0.1/payload.js.map +1 -0
- package/dist/vtc/vetting/auto-grant/update/0.1/payload.d.ts +491 -0
- package/dist/vtc/vetting/auto-grant/update/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/vetting/auto-grant/update/0.1/payload.js +282 -0
- package/dist/vtc/vetting/auto-grant/update/0.1/payload.js.map +1 -0
- package/dist/vtc/vetting/revocations/list/0.1/payload.d.ts +608 -0
- package/dist/vtc/vetting/revocations/list/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/vetting/revocations/list/0.1/payload.js +332 -0
- package/dist/vtc/vetting/revocations/list/0.1/payload.js.map +1 -0
- package/dist/vtc/vetting/vetters/grants/list/0.1/payload.d.ts +992 -0
- package/dist/vtc/vetting/vetters/grants/list/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/vetting/vetters/grants/list/0.1/payload.js +461 -0
- package/dist/vtc/vetting/vetters/grants/list/0.1/payload.js.map +1 -0
- package/dist/vtc/website/deploy/0.1/payload.d.ts +369 -0
- package/dist/vtc/website/deploy/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/website/deploy/0.1/payload.js +213 -0
- package/dist/vtc/website/deploy/0.1/payload.js.map +1 -0
- package/dist/vtc/website/files/show/0.1/payload.d.ts +455 -0
- package/dist/vtc/website/files/show/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/website/files/show/0.1/payload.js +247 -0
- package/dist/vtc/website/files/show/0.1/payload.js.map +1 -0
- package/dist/vtc/website/upload/abort/0.1/payload.d.ts +256 -0
- package/dist/vtc/website/upload/abort/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/website/upload/abort/0.1/payload.js +149 -0
- package/dist/vtc/website/upload/abort/0.1/payload.js.map +1 -0
- package/dist/vtc/website/upload/begin/0.1/payload.d.ts +658 -0
- package/dist/vtc/website/upload/begin/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/website/upload/begin/0.1/payload.js +375 -0
- package/dist/vtc/website/upload/begin/0.1/payload.js.map +1 -0
- package/dist/vtc/website/upload/chunk/0.1/payload.d.ts +447 -0
- package/dist/vtc/website/upload/chunk/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/website/upload/chunk/0.1/payload.js +253 -0
- package/dist/vtc/website/upload/chunk/0.1/payload.js.map +1 -0
- package/dist/vtc/website/upload/commit/0.1/payload.d.ts +603 -0
- package/dist/vtc/website/upload/commit/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/website/upload/commit/0.1/payload.js +337 -0
- package/dist/vtc/website/upload/commit/0.1/payload.js.map +1 -0
- package/package.json +1 -1
- package/src/_framework/0.4/framework.ts +1 -1
- package/src/_shared/components.ts +371 -0
- package/src/auth/_shared/0.1/signing-key.ts +17 -0
- package/src/auth/signing-key/enroll/0.1/payload.ts +349 -0
- package/src/auth/signing-key/list/0.1/payload.ts +323 -0
- package/src/auth/signing-key/revoke/0.1/payload.ts +204 -0
- package/src/index.ts +39 -0
- package/src/vta/contexts/update-did/1.1/payload.ts +256 -0
- package/src/vtc/_shared/0.1/community-presentation.ts +17 -0
- package/src/vtc/_shared/0.1/relationship-lifecycle.ts +17 -0
- package/src/vtc/_shared/0.1/schema-registry.ts +17 -0
- package/src/vtc/_shared/0.1/vetting-auto-grant.ts +17 -0
- package/src/vtc/_shared/0.1/website-transfer.ts +17 -0
- package/src/vtc/community/branding/show/0.1/payload.ts +207 -0
- package/src/vtc/community/branding/update/0.1/payload.ts +214 -0
- package/src/vtc/community/join-discovery/show/0.1/payload.ts +185 -0
- package/src/vtc/community/join-discovery/update/0.1/payload.ts +192 -0
- package/src/vtc/community/requested-attributes/show/0.1/payload.ts +221 -0
- package/src/vtc/community/requested-attributes/update/0.1/payload.ts +228 -0
- package/src/vtc/join-requests/query/0.1/payload.ts +285 -0
- package/src/vtc/join-requests/vetting/show/0.1/payload.ts +740 -0
- package/src/vtc/relationships/restore/0.1/payload.ts +307 -0
- package/src/vtc/relationships/suspend/0.1/payload.ts +307 -0
- package/src/vtc/rooms/list/0.1/payload.ts +449 -0
- package/src/vtc/schemas/accepts/delete/0.1/payload.ts +170 -0
- package/src/vtc/schemas/accepts/list/0.1/payload.ts +724 -0
- package/src/vtc/schemas/accepts/register/0.1/payload.ts +697 -0
- package/src/vtc/schemas/accepts/show/0.1/payload.ts +684 -0
- package/src/vtc/schemas/delete/0.1/payload.ts +170 -0
- package/src/vtc/schemas/list/0.1/payload.ts +344 -0
- package/src/vtc/schemas/register/0.1/payload.ts +325 -0
- package/src/vtc/schemas/show/0.1/payload.ts +308 -0
- package/src/vtc/vetting/auto-grant/show/0.1/payload.ts +297 -0
- package/src/vtc/vetting/auto-grant/update/0.1/payload.ts +316 -0
- package/src/vtc/vetting/revocations/list/0.1/payload.ts +416 -0
- package/src/vtc/vetting/vetters/grants/list/0.1/payload.ts +700 -0
- package/src/vtc/website/deploy/0.1/payload.ts +255 -0
- package/src/vtc/website/files/show/0.1/payload.ts +303 -0
- package/src/vtc/website/upload/abort/0.1/payload.ts +182 -0
- package/src/vtc/website/upload/begin/0.1/payload.ts +408 -0
- package/src/vtc/website/upload/chunk/0.1/payload.ts +295 -0
- package/src/vtc/website/upload/commit/0.1/payload.ts +385 -0
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vtc/website/upload/abort/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { Ext, UploadId } from "../../../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Cancel an upload. The outer document members are owned by the framework — SPEC §6.3.
|
|
11
|
+
*/
|
|
12
|
+
export interface VTCWebsiteUploadAbortPayload {
|
|
13
|
+
uploadId: UploadId;
|
|
14
|
+
ext?: Ext;
|
|
15
|
+
}
|
|
16
|
+
export interface VTCWebsiteUploadAbortResponsePayload {
|
|
17
|
+
uploadId: UploadId;
|
|
18
|
+
/**
|
|
19
|
+
* Whether this request ended the upload. False means it was already aborted — a success, and why abort can be retried safely.
|
|
20
|
+
*/
|
|
21
|
+
aborted: boolean;
|
|
22
|
+
ext?: Ext;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
26
|
+
export type { Ext, UploadId };
|
|
27
|
+
|
|
28
|
+
/** Trust Task type URI. */
|
|
29
|
+
export const TYPE_URI = "https://trusttasks.org/spec/vtc/website/upload/abort/0.1" as const;
|
|
30
|
+
|
|
31
|
+
/** Stable alias for this specification's request payload shape. */
|
|
32
|
+
export type Payload = VTCWebsiteUploadAbortPayload;
|
|
33
|
+
|
|
34
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
35
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/website/upload/abort/0.1#response" as const;
|
|
36
|
+
|
|
37
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
38
|
+
export type Response = VTCWebsiteUploadAbortResponsePayload;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* This specification's payload schema, as a value.
|
|
42
|
+
*
|
|
43
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
44
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
45
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
46
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
47
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
48
|
+
*/
|
|
49
|
+
export const PAYLOAD_SCHEMA = {
|
|
50
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
51
|
+
"$id": "https://trusttasks.org/spec/vtc/website/upload/abort/0.1",
|
|
52
|
+
"title": "VTC Website — Upload — Abort — payload",
|
|
53
|
+
"description": "Cancel an upload. The outer document members are owned by the framework — SPEC §6.3.",
|
|
54
|
+
"type": "object",
|
|
55
|
+
"additionalProperties": false,
|
|
56
|
+
"required": [
|
|
57
|
+
"uploadId"
|
|
58
|
+
],
|
|
59
|
+
"properties": {
|
|
60
|
+
"uploadId": {
|
|
61
|
+
"$ref": "#/$defs/UploadId"
|
|
62
|
+
},
|
|
63
|
+
"ext": {
|
|
64
|
+
"$ref": "#/$defs/Ext"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"$defs": {
|
|
68
|
+
"Response": {
|
|
69
|
+
"$anchor": "response",
|
|
70
|
+
"title": "VTC Website — Upload — Abort — response payload",
|
|
71
|
+
"type": "object",
|
|
72
|
+
"additionalProperties": false,
|
|
73
|
+
"required": [
|
|
74
|
+
"uploadId",
|
|
75
|
+
"aborted"
|
|
76
|
+
],
|
|
77
|
+
"properties": {
|
|
78
|
+
"uploadId": {
|
|
79
|
+
"$ref": "#/$defs/UploadId"
|
|
80
|
+
},
|
|
81
|
+
"aborted": {
|
|
82
|
+
"type": "boolean",
|
|
83
|
+
"description": "Whether this request ended the upload. False means it was already aborted — a success, and why abort can be retried safely."
|
|
84
|
+
},
|
|
85
|
+
"ext": {
|
|
86
|
+
"$ref": "#/$defs/Ext"
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"Ext": {
|
|
91
|
+
"title": "Ext",
|
|
92
|
+
"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.",
|
|
93
|
+
"type": "object",
|
|
94
|
+
"minProperties": 1,
|
|
95
|
+
"additionalProperties": true,
|
|
96
|
+
"propertyNames": {
|
|
97
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"UploadId": {
|
|
101
|
+
"title": "UploadId",
|
|
102
|
+
"type": "string",
|
|
103
|
+
"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}$",
|
|
104
|
+
"description": "Handle for one upload across begin, chunk, commit and abort, and — for a bundle — deploy. Recipient-generated and unguessable, which is what lets a reference to somebody else's upload be answered as not-found without confirming it exists. Opaque: a producer quotes what it was given."
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
} as const;
|
|
108
|
+
|
|
109
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
110
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
111
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
112
|
+
"$ref": "#/$defs/Response",
|
|
113
|
+
"$defs": {
|
|
114
|
+
"Response": {
|
|
115
|
+
"$anchor": "response",
|
|
116
|
+
"title": "VTC Website — Upload — Abort — response payload",
|
|
117
|
+
"type": "object",
|
|
118
|
+
"additionalProperties": false,
|
|
119
|
+
"required": [
|
|
120
|
+
"uploadId",
|
|
121
|
+
"aborted"
|
|
122
|
+
],
|
|
123
|
+
"properties": {
|
|
124
|
+
"uploadId": {
|
|
125
|
+
"$ref": "#/$defs/UploadId"
|
|
126
|
+
},
|
|
127
|
+
"aborted": {
|
|
128
|
+
"type": "boolean",
|
|
129
|
+
"description": "Whether this request ended the upload. False means it was already aborted — a success, and why abort can be retried safely."
|
|
130
|
+
},
|
|
131
|
+
"ext": {
|
|
132
|
+
"$ref": "#/$defs/Ext"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"Ext": {
|
|
137
|
+
"title": "Ext",
|
|
138
|
+
"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.",
|
|
139
|
+
"type": "object",
|
|
140
|
+
"minProperties": 1,
|
|
141
|
+
"additionalProperties": true,
|
|
142
|
+
"propertyNames": {
|
|
143
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
"UploadId": {
|
|
147
|
+
"title": "UploadId",
|
|
148
|
+
"type": "string",
|
|
149
|
+
"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}$",
|
|
150
|
+
"description": "Handle for one upload across begin, chunk, commit and abort, and — for a bundle — deploy. Recipient-generated and unguessable, which is what lets a reference to somebody else's upload be answered as not-found without confirming it exists. Opaque: a producer quotes what it was given."
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
} as const;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
157
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
158
|
+
* per-specification and cannot be derived from the document alone, and
|
|
159
|
+
* item 2 needs the schema this carries.
|
|
160
|
+
*/
|
|
161
|
+
export const SPEC = {
|
|
162
|
+
typeUri: TYPE_URI,
|
|
163
|
+
isBearer: false,
|
|
164
|
+
isProofRequired: true,
|
|
165
|
+
isRecipientRequired: true,
|
|
166
|
+
isIssuedAtRequired: true,
|
|
167
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
168
|
+
} as const;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
172
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
173
|
+
* parties (§7.3 item 5).
|
|
174
|
+
*/
|
|
175
|
+
export const RESPONSE_SPEC = {
|
|
176
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
177
|
+
isBearer: false,
|
|
178
|
+
isProofRequired: true,
|
|
179
|
+
isRecipientRequired: true,
|
|
180
|
+
isIssuedAtRequired: true,
|
|
181
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
182
|
+
} as const;
|
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vtc/website/upload/begin/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { ChunkCount, ChunkManifest, ChunkSize, DigestMultibase, ExpectedSha256, ExpectedSizeBytes, ExpiresAt, Ext, UploadId, UploadTarget, WebsiteEtag, WebsitePath } from "../../../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Open an upload of one website file or a whole-site bundle, committing to its size, SHA-256 and chunk digests. The outer document members are owned by the framework — SPEC §6.3.
|
|
11
|
+
*/
|
|
12
|
+
export interface VTCWebsiteUploadBeginPayload {
|
|
13
|
+
target: UploadTarget;
|
|
14
|
+
expectedSha256: ExpectedSha256;
|
|
15
|
+
expectedSizeBytes: ExpectedSizeBytes;
|
|
16
|
+
chunks: ChunkManifest;
|
|
17
|
+
ext?: Ext;
|
|
18
|
+
}
|
|
19
|
+
export interface VTCWebsiteUploadBeginResponsePayload {
|
|
20
|
+
uploadId: UploadId;
|
|
21
|
+
expiresAt: ExpiresAt;
|
|
22
|
+
ext?: Ext;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
26
|
+
export type { ChunkCount, ChunkManifest, ChunkSize, DigestMultibase, ExpectedSha256, ExpectedSizeBytes, ExpiresAt, Ext, UploadId, UploadTarget, WebsiteEtag, WebsitePath };
|
|
27
|
+
|
|
28
|
+
/** Trust Task type URI. */
|
|
29
|
+
export const TYPE_URI = "https://trusttasks.org/spec/vtc/website/upload/begin/0.1" as const;
|
|
30
|
+
|
|
31
|
+
/** Stable alias for this specification's request payload shape. */
|
|
32
|
+
export type Payload = VTCWebsiteUploadBeginPayload;
|
|
33
|
+
|
|
34
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
35
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/website/upload/begin/0.1#response" as const;
|
|
36
|
+
|
|
37
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
38
|
+
export type Response = VTCWebsiteUploadBeginResponsePayload;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* This specification's payload schema, as a value.
|
|
42
|
+
*
|
|
43
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
44
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
45
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
46
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
47
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
48
|
+
*/
|
|
49
|
+
export const PAYLOAD_SCHEMA = {
|
|
50
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
51
|
+
"$id": "https://trusttasks.org/spec/vtc/website/upload/begin/0.1",
|
|
52
|
+
"title": "VTC Website — Upload — Begin — payload",
|
|
53
|
+
"description": "Open an upload of one website file or a whole-site bundle, committing to its size, SHA-256 and chunk digests. The outer document members are owned by the framework — SPEC §6.3.",
|
|
54
|
+
"type": "object",
|
|
55
|
+
"additionalProperties": false,
|
|
56
|
+
"required": [
|
|
57
|
+
"target",
|
|
58
|
+
"expectedSha256",
|
|
59
|
+
"expectedSizeBytes",
|
|
60
|
+
"chunks"
|
|
61
|
+
],
|
|
62
|
+
"properties": {
|
|
63
|
+
"target": {
|
|
64
|
+
"$ref": "#/$defs/UploadTarget"
|
|
65
|
+
},
|
|
66
|
+
"expectedSha256": {
|
|
67
|
+
"$ref": "#/$defs/ExpectedSha256"
|
|
68
|
+
},
|
|
69
|
+
"expectedSizeBytes": {
|
|
70
|
+
"$ref": "#/$defs/ExpectedSizeBytes"
|
|
71
|
+
},
|
|
72
|
+
"chunks": {
|
|
73
|
+
"$ref": "#/$defs/ChunkManifest"
|
|
74
|
+
},
|
|
75
|
+
"ext": {
|
|
76
|
+
"$ref": "#/$defs/Ext"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"$defs": {
|
|
80
|
+
"Response": {
|
|
81
|
+
"$anchor": "response",
|
|
82
|
+
"title": "VTC Website — Upload — Begin — response payload",
|
|
83
|
+
"type": "object",
|
|
84
|
+
"additionalProperties": false,
|
|
85
|
+
"required": [
|
|
86
|
+
"uploadId",
|
|
87
|
+
"expiresAt"
|
|
88
|
+
],
|
|
89
|
+
"properties": {
|
|
90
|
+
"uploadId": {
|
|
91
|
+
"$ref": "#/$defs/UploadId"
|
|
92
|
+
},
|
|
93
|
+
"expiresAt": {
|
|
94
|
+
"$ref": "#/$defs/ExpiresAt"
|
|
95
|
+
},
|
|
96
|
+
"ext": {
|
|
97
|
+
"$ref": "#/$defs/Ext"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"Ext": {
|
|
102
|
+
"title": "Ext",
|
|
103
|
+
"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.",
|
|
104
|
+
"type": "object",
|
|
105
|
+
"minProperties": 1,
|
|
106
|
+
"additionalProperties": true,
|
|
107
|
+
"propertyNames": {
|
|
108
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"ExpiresAt": {
|
|
112
|
+
"title": "ExpiresAt",
|
|
113
|
+
"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.",
|
|
114
|
+
"type": "string",
|
|
115
|
+
"format": "date-time"
|
|
116
|
+
},
|
|
117
|
+
"UploadId": {
|
|
118
|
+
"title": "UploadId",
|
|
119
|
+
"type": "string",
|
|
120
|
+
"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}$",
|
|
121
|
+
"description": "Handle for one upload across begin, chunk, commit and abort, and — for a bundle — deploy. Recipient-generated and unguessable, which is what lets a reference to somebody else's upload be answered as not-found without confirming it exists. Opaque: a producer quotes what it was given."
|
|
122
|
+
},
|
|
123
|
+
"ChunkManifest": {
|
|
124
|
+
"title": "ChunkManifest",
|
|
125
|
+
"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.",
|
|
126
|
+
"type": "object",
|
|
127
|
+
"additionalProperties": false,
|
|
128
|
+
"required": [
|
|
129
|
+
"chunkSize",
|
|
130
|
+
"chunkCount",
|
|
131
|
+
"chunkDigests"
|
|
132
|
+
],
|
|
133
|
+
"properties": {
|
|
134
|
+
"chunkSize": {
|
|
135
|
+
"$ref": "#/$defs/ChunkSize"
|
|
136
|
+
},
|
|
137
|
+
"chunkCount": {
|
|
138
|
+
"$ref": "#/$defs/ChunkCount"
|
|
139
|
+
},
|
|
140
|
+
"chunkDigests": {
|
|
141
|
+
"type": "array",
|
|
142
|
+
"minItems": 1,
|
|
143
|
+
"maxItems": 4096,
|
|
144
|
+
"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.",
|
|
145
|
+
"items": {
|
|
146
|
+
"$ref": "#/$defs/DigestMultibase"
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
"ChunkCount": {
|
|
152
|
+
"title": "ChunkCount",
|
|
153
|
+
"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.",
|
|
154
|
+
"type": "integer",
|
|
155
|
+
"minimum": 1,
|
|
156
|
+
"maximum": 4096
|
|
157
|
+
},
|
|
158
|
+
"ChunkSize": {
|
|
159
|
+
"title": "ChunkSize",
|
|
160
|
+
"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.",
|
|
161
|
+
"type": "integer",
|
|
162
|
+
"minimum": 16384,
|
|
163
|
+
"maximum": 262144
|
|
164
|
+
},
|
|
165
|
+
"DigestMultibase": {
|
|
166
|
+
"title": "DigestMultibase",
|
|
167
|
+
"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`.",
|
|
168
|
+
"type": "string",
|
|
169
|
+
"minLength": 16,
|
|
170
|
+
"pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
|
|
171
|
+
"examples": [
|
|
172
|
+
"zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
|
|
173
|
+
]
|
|
174
|
+
},
|
|
175
|
+
"ExpectedSizeBytes": {
|
|
176
|
+
"title": "ExpectedSizeBytes",
|
|
177
|
+
"description": "Total byte count of the bundle. A zero-length bundle is not a degenerate success — nothing was serialized — so the floor is 1.",
|
|
178
|
+
"type": "integer",
|
|
179
|
+
"minimum": 1
|
|
180
|
+
},
|
|
181
|
+
"ExpectedSha256": {
|
|
182
|
+
"title": "ExpectedSha256",
|
|
183
|
+
"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.",
|
|
184
|
+
"type": "string",
|
|
185
|
+
"pattern": "^[0-9a-f]{64}$"
|
|
186
|
+
},
|
|
187
|
+
"UploadTarget": {
|
|
188
|
+
"title": "UploadTarget",
|
|
189
|
+
"type": "object",
|
|
190
|
+
"additionalProperties": false,
|
|
191
|
+
"required": [
|
|
192
|
+
"kind"
|
|
193
|
+
],
|
|
194
|
+
"description": "What the uploaded bytes are for, committed before any byte moves. `file`: one file at `path`, written into the site when the upload commits — the single-file write. `bundle`: a gzip-compressed tar of the whole site, staged when the upload commits and published by vtc/website/deploy. `path` is required for a `file` target and forbidden for a `bundle`, and `ifMatch` is allowed only for a `file` — rules over two members that this schema does not express; a community refuses a violation with `malformedRequest`. `ifMatch` is optimistic concurrency: the write commits only if the file's current content hash is this value.",
|
|
195
|
+
"properties": {
|
|
196
|
+
"kind": {
|
|
197
|
+
"type": "string",
|
|
198
|
+
"enum": [
|
|
199
|
+
"file",
|
|
200
|
+
"bundle"
|
|
201
|
+
]
|
|
202
|
+
},
|
|
203
|
+
"path": {
|
|
204
|
+
"$ref": "#/$defs/WebsitePath"
|
|
205
|
+
},
|
|
206
|
+
"ifMatch": {
|
|
207
|
+
"$ref": "#/$defs/WebsiteEtag"
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
"WebsiteEtag": {
|
|
212
|
+
"title": "WebsiteEtag",
|
|
213
|
+
"type": "string",
|
|
214
|
+
"pattern": "^[0-9a-f]{64}$",
|
|
215
|
+
"description": "A file's content hash: the lowercase hex SHA-256 of its bytes — the `etag` vtc/website/files/list reports, and the `ETag` a direct read of the path returns, without the HTTP quotes."
|
|
216
|
+
},
|
|
217
|
+
"WebsitePath": {
|
|
218
|
+
"title": "WebsitePath",
|
|
219
|
+
"type": "string",
|
|
220
|
+
"minLength": 1,
|
|
221
|
+
"maxLength": 1024,
|
|
222
|
+
"pattern": "^[^\\\\]+$",
|
|
223
|
+
"description": "A file's path relative to the site root, `/`-separated, with or without a leading `/`. The community resolves it inside the site root and refuses one that escapes the root (`..`), names a hidden file or directory (a segment beginning `.`), carries a blocklisted extension, or contains a control character — the same rules the public read handler applies, so nothing can be written that the site would refuse to serve, and nothing can be read that it would not."
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
} as const;
|
|
227
|
+
|
|
228
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
229
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
230
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
231
|
+
"$ref": "#/$defs/Response",
|
|
232
|
+
"$defs": {
|
|
233
|
+
"Response": {
|
|
234
|
+
"$anchor": "response",
|
|
235
|
+
"title": "VTC Website — Upload — Begin — response payload",
|
|
236
|
+
"type": "object",
|
|
237
|
+
"additionalProperties": false,
|
|
238
|
+
"required": [
|
|
239
|
+
"uploadId",
|
|
240
|
+
"expiresAt"
|
|
241
|
+
],
|
|
242
|
+
"properties": {
|
|
243
|
+
"uploadId": {
|
|
244
|
+
"$ref": "#/$defs/UploadId"
|
|
245
|
+
},
|
|
246
|
+
"expiresAt": {
|
|
247
|
+
"$ref": "#/$defs/ExpiresAt"
|
|
248
|
+
},
|
|
249
|
+
"ext": {
|
|
250
|
+
"$ref": "#/$defs/Ext"
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
"Ext": {
|
|
255
|
+
"title": "Ext",
|
|
256
|
+
"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.",
|
|
257
|
+
"type": "object",
|
|
258
|
+
"minProperties": 1,
|
|
259
|
+
"additionalProperties": true,
|
|
260
|
+
"propertyNames": {
|
|
261
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
"ExpiresAt": {
|
|
265
|
+
"title": "ExpiresAt",
|
|
266
|
+
"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.",
|
|
267
|
+
"type": "string",
|
|
268
|
+
"format": "date-time"
|
|
269
|
+
},
|
|
270
|
+
"UploadId": {
|
|
271
|
+
"title": "UploadId",
|
|
272
|
+
"type": "string",
|
|
273
|
+
"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}$",
|
|
274
|
+
"description": "Handle for one upload across begin, chunk, commit and abort, and — for a bundle — deploy. Recipient-generated and unguessable, which is what lets a reference to somebody else's upload be answered as not-found without confirming it exists. Opaque: a producer quotes what it was given."
|
|
275
|
+
},
|
|
276
|
+
"ChunkManifest": {
|
|
277
|
+
"title": "ChunkManifest",
|
|
278
|
+
"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.",
|
|
279
|
+
"type": "object",
|
|
280
|
+
"additionalProperties": false,
|
|
281
|
+
"required": [
|
|
282
|
+
"chunkSize",
|
|
283
|
+
"chunkCount",
|
|
284
|
+
"chunkDigests"
|
|
285
|
+
],
|
|
286
|
+
"properties": {
|
|
287
|
+
"chunkSize": {
|
|
288
|
+
"$ref": "#/$defs/ChunkSize"
|
|
289
|
+
},
|
|
290
|
+
"chunkCount": {
|
|
291
|
+
"$ref": "#/$defs/ChunkCount"
|
|
292
|
+
},
|
|
293
|
+
"chunkDigests": {
|
|
294
|
+
"type": "array",
|
|
295
|
+
"minItems": 1,
|
|
296
|
+
"maxItems": 4096,
|
|
297
|
+
"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.",
|
|
298
|
+
"items": {
|
|
299
|
+
"$ref": "#/$defs/DigestMultibase"
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
"ChunkCount": {
|
|
305
|
+
"title": "ChunkCount",
|
|
306
|
+
"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.",
|
|
307
|
+
"type": "integer",
|
|
308
|
+
"minimum": 1,
|
|
309
|
+
"maximum": 4096
|
|
310
|
+
},
|
|
311
|
+
"ChunkSize": {
|
|
312
|
+
"title": "ChunkSize",
|
|
313
|
+
"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.",
|
|
314
|
+
"type": "integer",
|
|
315
|
+
"minimum": 16384,
|
|
316
|
+
"maximum": 262144
|
|
317
|
+
},
|
|
318
|
+
"DigestMultibase": {
|
|
319
|
+
"title": "DigestMultibase",
|
|
320
|
+
"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`.",
|
|
321
|
+
"type": "string",
|
|
322
|
+
"minLength": 16,
|
|
323
|
+
"pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
|
|
324
|
+
"examples": [
|
|
325
|
+
"zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
|
|
326
|
+
]
|
|
327
|
+
},
|
|
328
|
+
"ExpectedSizeBytes": {
|
|
329
|
+
"title": "ExpectedSizeBytes",
|
|
330
|
+
"description": "Total byte count of the bundle. A zero-length bundle is not a degenerate success — nothing was serialized — so the floor is 1.",
|
|
331
|
+
"type": "integer",
|
|
332
|
+
"minimum": 1
|
|
333
|
+
},
|
|
334
|
+
"ExpectedSha256": {
|
|
335
|
+
"title": "ExpectedSha256",
|
|
336
|
+
"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.",
|
|
337
|
+
"type": "string",
|
|
338
|
+
"pattern": "^[0-9a-f]{64}$"
|
|
339
|
+
},
|
|
340
|
+
"UploadTarget": {
|
|
341
|
+
"title": "UploadTarget",
|
|
342
|
+
"type": "object",
|
|
343
|
+
"additionalProperties": false,
|
|
344
|
+
"required": [
|
|
345
|
+
"kind"
|
|
346
|
+
],
|
|
347
|
+
"description": "What the uploaded bytes are for, committed before any byte moves. `file`: one file at `path`, written into the site when the upload commits — the single-file write. `bundle`: a gzip-compressed tar of the whole site, staged when the upload commits and published by vtc/website/deploy. `path` is required for a `file` target and forbidden for a `bundle`, and `ifMatch` is allowed only for a `file` — rules over two members that this schema does not express; a community refuses a violation with `malformedRequest`. `ifMatch` is optimistic concurrency: the write commits only if the file's current content hash is this value.",
|
|
348
|
+
"properties": {
|
|
349
|
+
"kind": {
|
|
350
|
+
"type": "string",
|
|
351
|
+
"enum": [
|
|
352
|
+
"file",
|
|
353
|
+
"bundle"
|
|
354
|
+
]
|
|
355
|
+
},
|
|
356
|
+
"path": {
|
|
357
|
+
"$ref": "#/$defs/WebsitePath"
|
|
358
|
+
},
|
|
359
|
+
"ifMatch": {
|
|
360
|
+
"$ref": "#/$defs/WebsiteEtag"
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
"WebsiteEtag": {
|
|
365
|
+
"title": "WebsiteEtag",
|
|
366
|
+
"type": "string",
|
|
367
|
+
"pattern": "^[0-9a-f]{64}$",
|
|
368
|
+
"description": "A file's content hash: the lowercase hex SHA-256 of its bytes — the `etag` vtc/website/files/list reports, and the `ETag` a direct read of the path returns, without the HTTP quotes."
|
|
369
|
+
},
|
|
370
|
+
"WebsitePath": {
|
|
371
|
+
"title": "WebsitePath",
|
|
372
|
+
"type": "string",
|
|
373
|
+
"minLength": 1,
|
|
374
|
+
"maxLength": 1024,
|
|
375
|
+
"pattern": "^[^\\\\]+$",
|
|
376
|
+
"description": "A file's path relative to the site root, `/`-separated, with or without a leading `/`. The community resolves it inside the site root and refuses one that escapes the root (`..`), names a hidden file or directory (a segment beginning `.`), carries a blocklisted extension, or contains a control character — the same rules the public read handler applies, so nothing can be written that the site would refuse to serve, and nothing can be read that it would not."
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
} as const;
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
383
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
384
|
+
* per-specification and cannot be derived from the document alone, and
|
|
385
|
+
* item 2 needs the schema this carries.
|
|
386
|
+
*/
|
|
387
|
+
export const SPEC = {
|
|
388
|
+
typeUri: TYPE_URI,
|
|
389
|
+
isBearer: false,
|
|
390
|
+
isProofRequired: true,
|
|
391
|
+
isRecipientRequired: true,
|
|
392
|
+
isIssuedAtRequired: true,
|
|
393
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
394
|
+
} as const;
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
398
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
399
|
+
* parties (§7.3 item 5).
|
|
400
|
+
*/
|
|
401
|
+
export const RESPONSE_SPEC = {
|
|
402
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
403
|
+
isBearer: false,
|
|
404
|
+
isProofRequired: true,
|
|
405
|
+
isRecipientRequired: true,
|
|
406
|
+
isIssuedAtRequired: true,
|
|
407
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
408
|
+
} as const;
|