@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,295 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vtc/website/upload/chunk/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { ChunkData, ChunkIndex, DigestMultibase, ExpiresAt, Ext, UploadId } from "../../../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* One chunk of an open upload. The outer document members are owned by the framework — SPEC §6.3.
|
|
11
|
+
*/
|
|
12
|
+
export interface VTCWebsiteUploadChunkPayload {
|
|
13
|
+
uploadId: UploadId;
|
|
14
|
+
index: ChunkIndex;
|
|
15
|
+
digestMultibase: DigestMultibase;
|
|
16
|
+
data: ChunkData;
|
|
17
|
+
ext?: Ext;
|
|
18
|
+
}
|
|
19
|
+
export interface VTCWebsiteUploadChunkResponsePayload {
|
|
20
|
+
uploadId: UploadId;
|
|
21
|
+
index: ChunkIndex;
|
|
22
|
+
/**
|
|
23
|
+
* Whether this request is what stored the chunk. False means identical bytes were already staged at this index — a success, and why a chunk can be re-sent safely.
|
|
24
|
+
*/
|
|
25
|
+
stored: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Indices still missing after this write.
|
|
28
|
+
*/
|
|
29
|
+
remainingCount: number;
|
|
30
|
+
expiresAt: ExpiresAt;
|
|
31
|
+
ext?: Ext;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
35
|
+
export type { ChunkData, ChunkIndex, DigestMultibase, ExpiresAt, Ext, UploadId };
|
|
36
|
+
|
|
37
|
+
/** Trust Task type URI. */
|
|
38
|
+
export const TYPE_URI = "https://trusttasks.org/spec/vtc/website/upload/chunk/0.1" as const;
|
|
39
|
+
|
|
40
|
+
/** Stable alias for this specification's request payload shape. */
|
|
41
|
+
export type Payload = VTCWebsiteUploadChunkPayload;
|
|
42
|
+
|
|
43
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
44
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/website/upload/chunk/0.1#response" as const;
|
|
45
|
+
|
|
46
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
47
|
+
export type Response = VTCWebsiteUploadChunkResponsePayload;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* This specification's payload schema, as a value.
|
|
51
|
+
*
|
|
52
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
53
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
54
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
55
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
56
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
57
|
+
*/
|
|
58
|
+
export const PAYLOAD_SCHEMA = {
|
|
59
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
60
|
+
"$id": "https://trusttasks.org/spec/vtc/website/upload/chunk/0.1",
|
|
61
|
+
"title": "VTC Website — Upload — Chunk — payload",
|
|
62
|
+
"description": "One chunk of an open upload. The outer document members are owned by the framework — SPEC §6.3.",
|
|
63
|
+
"type": "object",
|
|
64
|
+
"additionalProperties": false,
|
|
65
|
+
"required": [
|
|
66
|
+
"uploadId",
|
|
67
|
+
"index",
|
|
68
|
+
"digestMultibase",
|
|
69
|
+
"data"
|
|
70
|
+
],
|
|
71
|
+
"properties": {
|
|
72
|
+
"uploadId": {
|
|
73
|
+
"$ref": "#/$defs/UploadId"
|
|
74
|
+
},
|
|
75
|
+
"index": {
|
|
76
|
+
"$ref": "#/$defs/ChunkIndex"
|
|
77
|
+
},
|
|
78
|
+
"digestMultibase": {
|
|
79
|
+
"$ref": "#/$defs/DigestMultibase"
|
|
80
|
+
},
|
|
81
|
+
"data": {
|
|
82
|
+
"$ref": "#/$defs/ChunkData"
|
|
83
|
+
},
|
|
84
|
+
"ext": {
|
|
85
|
+
"$ref": "#/$defs/Ext"
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"$defs": {
|
|
89
|
+
"Response": {
|
|
90
|
+
"$anchor": "response",
|
|
91
|
+
"title": "VTC Website — Upload — Chunk — response payload",
|
|
92
|
+
"type": "object",
|
|
93
|
+
"additionalProperties": false,
|
|
94
|
+
"required": [
|
|
95
|
+
"uploadId",
|
|
96
|
+
"index",
|
|
97
|
+
"stored",
|
|
98
|
+
"remainingCount",
|
|
99
|
+
"expiresAt"
|
|
100
|
+
],
|
|
101
|
+
"properties": {
|
|
102
|
+
"uploadId": {
|
|
103
|
+
"$ref": "#/$defs/UploadId"
|
|
104
|
+
},
|
|
105
|
+
"index": {
|
|
106
|
+
"$ref": "#/$defs/ChunkIndex"
|
|
107
|
+
},
|
|
108
|
+
"stored": {
|
|
109
|
+
"type": "boolean",
|
|
110
|
+
"description": "Whether this request is what stored the chunk. False means identical bytes were already staged at this index — a success, and why a chunk can be re-sent safely."
|
|
111
|
+
},
|
|
112
|
+
"remainingCount": {
|
|
113
|
+
"type": "integer",
|
|
114
|
+
"minimum": 0,
|
|
115
|
+
"maximum": 4095,
|
|
116
|
+
"description": "Indices still missing after this write."
|
|
117
|
+
},
|
|
118
|
+
"expiresAt": {
|
|
119
|
+
"$ref": "#/$defs/ExpiresAt"
|
|
120
|
+
},
|
|
121
|
+
"ext": {
|
|
122
|
+
"$ref": "#/$defs/Ext"
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"Ext": {
|
|
127
|
+
"title": "Ext",
|
|
128
|
+
"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.",
|
|
129
|
+
"type": "object",
|
|
130
|
+
"minProperties": 1,
|
|
131
|
+
"additionalProperties": true,
|
|
132
|
+
"propertyNames": {
|
|
133
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"ExpiresAt": {
|
|
137
|
+
"title": "ExpiresAt",
|
|
138
|
+
"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.",
|
|
139
|
+
"type": "string",
|
|
140
|
+
"format": "date-time"
|
|
141
|
+
},
|
|
142
|
+
"ChunkIndex": {
|
|
143
|
+
"title": "ChunkIndex",
|
|
144
|
+
"description": "Zero-based position of a chunk within its bundle. Valid values are 0 to chunkCount − 1; an index outside that range is refused with chunkOutOfRange rather than validated here, because the bound depends on the bundle.",
|
|
145
|
+
"type": "integer",
|
|
146
|
+
"minimum": 0,
|
|
147
|
+
"maximum": 4095
|
|
148
|
+
},
|
|
149
|
+
"UploadId": {
|
|
150
|
+
"title": "UploadId",
|
|
151
|
+
"type": "string",
|
|
152
|
+
"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}$",
|
|
153
|
+
"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."
|
|
154
|
+
},
|
|
155
|
+
"ChunkData": {
|
|
156
|
+
"title": "ChunkData",
|
|
157
|
+
"description": "The chunk's bytes, base64url-encoded without padding (RFC 4648 §5). Bounded at 349526 characters, the unpadded encoding of a 262144-byte chunk. These are bytes of the encrypted bundle, so a chunk read in isolation reveals nothing of the agent's state — but a complete set of chunks is the export, and is to be handled as such.",
|
|
158
|
+
"type": "string",
|
|
159
|
+
"minLength": 2,
|
|
160
|
+
"maxLength": 349526,
|
|
161
|
+
"pattern": "^[A-Za-z0-9_-]+$"
|
|
162
|
+
},
|
|
163
|
+
"DigestMultibase": {
|
|
164
|
+
"title": "DigestMultibase",
|
|
165
|
+
"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`.",
|
|
166
|
+
"type": "string",
|
|
167
|
+
"minLength": 16,
|
|
168
|
+
"pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
|
|
169
|
+
"examples": [
|
|
170
|
+
"zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
|
|
171
|
+
]
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
} as const;
|
|
175
|
+
|
|
176
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
177
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
178
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
179
|
+
"$ref": "#/$defs/Response",
|
|
180
|
+
"$defs": {
|
|
181
|
+
"Response": {
|
|
182
|
+
"$anchor": "response",
|
|
183
|
+
"title": "VTC Website — Upload — Chunk — response payload",
|
|
184
|
+
"type": "object",
|
|
185
|
+
"additionalProperties": false,
|
|
186
|
+
"required": [
|
|
187
|
+
"uploadId",
|
|
188
|
+
"index",
|
|
189
|
+
"stored",
|
|
190
|
+
"remainingCount",
|
|
191
|
+
"expiresAt"
|
|
192
|
+
],
|
|
193
|
+
"properties": {
|
|
194
|
+
"uploadId": {
|
|
195
|
+
"$ref": "#/$defs/UploadId"
|
|
196
|
+
},
|
|
197
|
+
"index": {
|
|
198
|
+
"$ref": "#/$defs/ChunkIndex"
|
|
199
|
+
},
|
|
200
|
+
"stored": {
|
|
201
|
+
"type": "boolean",
|
|
202
|
+
"description": "Whether this request is what stored the chunk. False means identical bytes were already staged at this index — a success, and why a chunk can be re-sent safely."
|
|
203
|
+
},
|
|
204
|
+
"remainingCount": {
|
|
205
|
+
"type": "integer",
|
|
206
|
+
"minimum": 0,
|
|
207
|
+
"maximum": 4095,
|
|
208
|
+
"description": "Indices still missing after this write."
|
|
209
|
+
},
|
|
210
|
+
"expiresAt": {
|
|
211
|
+
"$ref": "#/$defs/ExpiresAt"
|
|
212
|
+
},
|
|
213
|
+
"ext": {
|
|
214
|
+
"$ref": "#/$defs/Ext"
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
"Ext": {
|
|
219
|
+
"title": "Ext",
|
|
220
|
+
"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.",
|
|
221
|
+
"type": "object",
|
|
222
|
+
"minProperties": 1,
|
|
223
|
+
"additionalProperties": true,
|
|
224
|
+
"propertyNames": {
|
|
225
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
"ExpiresAt": {
|
|
229
|
+
"title": "ExpiresAt",
|
|
230
|
+
"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.",
|
|
231
|
+
"type": "string",
|
|
232
|
+
"format": "date-time"
|
|
233
|
+
},
|
|
234
|
+
"ChunkIndex": {
|
|
235
|
+
"title": "ChunkIndex",
|
|
236
|
+
"description": "Zero-based position of a chunk within its bundle. Valid values are 0 to chunkCount − 1; an index outside that range is refused with chunkOutOfRange rather than validated here, because the bound depends on the bundle.",
|
|
237
|
+
"type": "integer",
|
|
238
|
+
"minimum": 0,
|
|
239
|
+
"maximum": 4095
|
|
240
|
+
},
|
|
241
|
+
"UploadId": {
|
|
242
|
+
"title": "UploadId",
|
|
243
|
+
"type": "string",
|
|
244
|
+
"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}$",
|
|
245
|
+
"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."
|
|
246
|
+
},
|
|
247
|
+
"ChunkData": {
|
|
248
|
+
"title": "ChunkData",
|
|
249
|
+
"description": "The chunk's bytes, base64url-encoded without padding (RFC 4648 §5). Bounded at 349526 characters, the unpadded encoding of a 262144-byte chunk. These are bytes of the encrypted bundle, so a chunk read in isolation reveals nothing of the agent's state — but a complete set of chunks is the export, and is to be handled as such.",
|
|
250
|
+
"type": "string",
|
|
251
|
+
"minLength": 2,
|
|
252
|
+
"maxLength": 349526,
|
|
253
|
+
"pattern": "^[A-Za-z0-9_-]+$"
|
|
254
|
+
},
|
|
255
|
+
"DigestMultibase": {
|
|
256
|
+
"title": "DigestMultibase",
|
|
257
|
+
"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`.",
|
|
258
|
+
"type": "string",
|
|
259
|
+
"minLength": 16,
|
|
260
|
+
"pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
|
|
261
|
+
"examples": [
|
|
262
|
+
"zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
|
|
263
|
+
]
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
} as const;
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
270
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
271
|
+
* per-specification and cannot be derived from the document alone, and
|
|
272
|
+
* item 2 needs the schema this carries.
|
|
273
|
+
*/
|
|
274
|
+
export const SPEC = {
|
|
275
|
+
typeUri: TYPE_URI,
|
|
276
|
+
isBearer: false,
|
|
277
|
+
isProofRequired: true,
|
|
278
|
+
isRecipientRequired: true,
|
|
279
|
+
isIssuedAtRequired: true,
|
|
280
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
281
|
+
} as const;
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
285
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
286
|
+
* parties (§7.3 item 5).
|
|
287
|
+
*/
|
|
288
|
+
export const RESPONSE_SPEC = {
|
|
289
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
290
|
+
isBearer: false,
|
|
291
|
+
isProofRequired: false,
|
|
292
|
+
isRecipientRequired: true,
|
|
293
|
+
isIssuedAtRequired: true,
|
|
294
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
295
|
+
} as const;
|
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vtc/website/upload/commit/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { ExpectedSha256, ExpectedSizeBytes, ExpiresAt, Ext, UploadId, UploadTarget, WebsiteEtag, WebsitePath } from "../../../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Complete an upload. The outer document members are owned by the framework — SPEC §6.3.
|
|
11
|
+
*/
|
|
12
|
+
export interface VTCWebsiteUploadCommitPayload {
|
|
13
|
+
uploadId: UploadId;
|
|
14
|
+
ext?: Ext;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Exactly one of `file` (for a `file` target) and `stagedUntil` (for a `bundle` target) is present — a rule over two members that this schema does not express.
|
|
18
|
+
*/
|
|
19
|
+
export interface VTCWebsiteUploadCommitResponsePayload {
|
|
20
|
+
uploadId: UploadId;
|
|
21
|
+
target: UploadTarget;
|
|
22
|
+
sha256: ExpectedSha256;
|
|
23
|
+
sizeBytes: ExpectedSizeBytes;
|
|
24
|
+
file?: WrittenFile;
|
|
25
|
+
stagedUntil?: ExpiresAt;
|
|
26
|
+
ext?: Ext;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The file a `file` upload wrote.
|
|
30
|
+
*/
|
|
31
|
+
export interface WrittenFile {
|
|
32
|
+
path: WebsitePath;
|
|
33
|
+
etag: WebsiteEtag;
|
|
34
|
+
/**
|
|
35
|
+
* The file's size in bytes.
|
|
36
|
+
*/
|
|
37
|
+
sizeBytes: number;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
41
|
+
export type { ExpectedSha256, ExpectedSizeBytes, ExpiresAt, Ext, UploadId, UploadTarget, WebsiteEtag, WebsitePath };
|
|
42
|
+
|
|
43
|
+
/** Trust Task type URI. */
|
|
44
|
+
export const TYPE_URI = "https://trusttasks.org/spec/vtc/website/upload/commit/0.1" as const;
|
|
45
|
+
|
|
46
|
+
/** Stable alias for this specification's request payload shape. */
|
|
47
|
+
export type Payload = VTCWebsiteUploadCommitPayload;
|
|
48
|
+
|
|
49
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
50
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/website/upload/commit/0.1#response" as const;
|
|
51
|
+
|
|
52
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
53
|
+
export type Response = VTCWebsiteUploadCommitResponsePayload;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* This specification's payload schema, as a value.
|
|
57
|
+
*
|
|
58
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
59
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
60
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
61
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
62
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
63
|
+
*/
|
|
64
|
+
export const PAYLOAD_SCHEMA = {
|
|
65
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
66
|
+
"$id": "https://trusttasks.org/spec/vtc/website/upload/commit/0.1",
|
|
67
|
+
"title": "VTC Website — Upload — Commit — payload",
|
|
68
|
+
"description": "Complete an upload. The outer document members are owned by the framework — SPEC §6.3.",
|
|
69
|
+
"type": "object",
|
|
70
|
+
"additionalProperties": false,
|
|
71
|
+
"required": [
|
|
72
|
+
"uploadId"
|
|
73
|
+
],
|
|
74
|
+
"properties": {
|
|
75
|
+
"uploadId": {
|
|
76
|
+
"$ref": "#/$defs/UploadId"
|
|
77
|
+
},
|
|
78
|
+
"ext": {
|
|
79
|
+
"$ref": "#/$defs/Ext"
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"$defs": {
|
|
83
|
+
"WrittenFile": {
|
|
84
|
+
"title": "WrittenFile",
|
|
85
|
+
"type": "object",
|
|
86
|
+
"additionalProperties": false,
|
|
87
|
+
"required": [
|
|
88
|
+
"path",
|
|
89
|
+
"etag",
|
|
90
|
+
"sizeBytes"
|
|
91
|
+
],
|
|
92
|
+
"description": "The file a `file` upload wrote.",
|
|
93
|
+
"properties": {
|
|
94
|
+
"path": {
|
|
95
|
+
"$ref": "#/$defs/WebsitePath"
|
|
96
|
+
},
|
|
97
|
+
"etag": {
|
|
98
|
+
"$ref": "#/$defs/WebsiteEtag"
|
|
99
|
+
},
|
|
100
|
+
"sizeBytes": {
|
|
101
|
+
"type": "integer",
|
|
102
|
+
"minimum": 1,
|
|
103
|
+
"description": "The file's size in bytes."
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"Response": {
|
|
108
|
+
"$anchor": "response",
|
|
109
|
+
"title": "VTC Website — Upload — Commit — response payload",
|
|
110
|
+
"type": "object",
|
|
111
|
+
"additionalProperties": false,
|
|
112
|
+
"required": [
|
|
113
|
+
"uploadId",
|
|
114
|
+
"target",
|
|
115
|
+
"sha256",
|
|
116
|
+
"sizeBytes"
|
|
117
|
+
],
|
|
118
|
+
"description": "Exactly one of `file` (for a `file` target) and `stagedUntil` (for a `bundle` target) is present — a rule over two members that this schema does not express.",
|
|
119
|
+
"properties": {
|
|
120
|
+
"uploadId": {
|
|
121
|
+
"$ref": "#/$defs/UploadId"
|
|
122
|
+
},
|
|
123
|
+
"target": {
|
|
124
|
+
"$ref": "#/$defs/UploadTarget"
|
|
125
|
+
},
|
|
126
|
+
"sha256": {
|
|
127
|
+
"$ref": "#/$defs/ExpectedSha256"
|
|
128
|
+
},
|
|
129
|
+
"sizeBytes": {
|
|
130
|
+
"$ref": "#/$defs/ExpectedSizeBytes"
|
|
131
|
+
},
|
|
132
|
+
"file": {
|
|
133
|
+
"$ref": "#/$defs/WrittenFile"
|
|
134
|
+
},
|
|
135
|
+
"stagedUntil": {
|
|
136
|
+
"$ref": "#/$defs/ExpiresAt"
|
|
137
|
+
},
|
|
138
|
+
"ext": {
|
|
139
|
+
"$ref": "#/$defs/Ext"
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"Ext": {
|
|
144
|
+
"title": "Ext",
|
|
145
|
+
"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.",
|
|
146
|
+
"type": "object",
|
|
147
|
+
"minProperties": 1,
|
|
148
|
+
"additionalProperties": true,
|
|
149
|
+
"propertyNames": {
|
|
150
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
"ExpiresAt": {
|
|
154
|
+
"title": "ExpiresAt",
|
|
155
|
+
"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.",
|
|
156
|
+
"type": "string",
|
|
157
|
+
"format": "date-time"
|
|
158
|
+
},
|
|
159
|
+
"ExpectedSizeBytes": {
|
|
160
|
+
"title": "ExpectedSizeBytes",
|
|
161
|
+
"description": "Total byte count of the bundle. A zero-length bundle is not a degenerate success — nothing was serialized — so the floor is 1.",
|
|
162
|
+
"type": "integer",
|
|
163
|
+
"minimum": 1
|
|
164
|
+
},
|
|
165
|
+
"ExpectedSha256": {
|
|
166
|
+
"title": "ExpectedSha256",
|
|
167
|
+
"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.",
|
|
168
|
+
"type": "string",
|
|
169
|
+
"pattern": "^[0-9a-f]{64}$"
|
|
170
|
+
},
|
|
171
|
+
"UploadTarget": {
|
|
172
|
+
"title": "UploadTarget",
|
|
173
|
+
"type": "object",
|
|
174
|
+
"additionalProperties": false,
|
|
175
|
+
"required": [
|
|
176
|
+
"kind"
|
|
177
|
+
],
|
|
178
|
+
"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.",
|
|
179
|
+
"properties": {
|
|
180
|
+
"kind": {
|
|
181
|
+
"type": "string",
|
|
182
|
+
"enum": [
|
|
183
|
+
"file",
|
|
184
|
+
"bundle"
|
|
185
|
+
]
|
|
186
|
+
},
|
|
187
|
+
"path": {
|
|
188
|
+
"$ref": "#/$defs/WebsitePath"
|
|
189
|
+
},
|
|
190
|
+
"ifMatch": {
|
|
191
|
+
"$ref": "#/$defs/WebsiteEtag"
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
"WebsiteEtag": {
|
|
196
|
+
"title": "WebsiteEtag",
|
|
197
|
+
"type": "string",
|
|
198
|
+
"pattern": "^[0-9a-f]{64}$",
|
|
199
|
+
"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."
|
|
200
|
+
},
|
|
201
|
+
"WebsitePath": {
|
|
202
|
+
"title": "WebsitePath",
|
|
203
|
+
"type": "string",
|
|
204
|
+
"minLength": 1,
|
|
205
|
+
"maxLength": 1024,
|
|
206
|
+
"pattern": "^[^\\\\]+$",
|
|
207
|
+
"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."
|
|
208
|
+
},
|
|
209
|
+
"UploadId": {
|
|
210
|
+
"title": "UploadId",
|
|
211
|
+
"type": "string",
|
|
212
|
+
"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}$",
|
|
213
|
+
"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."
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
} as const;
|
|
217
|
+
|
|
218
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
219
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
220
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
221
|
+
"$ref": "#/$defs/Response",
|
|
222
|
+
"$defs": {
|
|
223
|
+
"WrittenFile": {
|
|
224
|
+
"title": "WrittenFile",
|
|
225
|
+
"type": "object",
|
|
226
|
+
"additionalProperties": false,
|
|
227
|
+
"required": [
|
|
228
|
+
"path",
|
|
229
|
+
"etag",
|
|
230
|
+
"sizeBytes"
|
|
231
|
+
],
|
|
232
|
+
"description": "The file a `file` upload wrote.",
|
|
233
|
+
"properties": {
|
|
234
|
+
"path": {
|
|
235
|
+
"$ref": "#/$defs/WebsitePath"
|
|
236
|
+
},
|
|
237
|
+
"etag": {
|
|
238
|
+
"$ref": "#/$defs/WebsiteEtag"
|
|
239
|
+
},
|
|
240
|
+
"sizeBytes": {
|
|
241
|
+
"type": "integer",
|
|
242
|
+
"minimum": 1,
|
|
243
|
+
"description": "The file's size in bytes."
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
"Response": {
|
|
248
|
+
"$anchor": "response",
|
|
249
|
+
"title": "VTC Website — Upload — Commit — response payload",
|
|
250
|
+
"type": "object",
|
|
251
|
+
"additionalProperties": false,
|
|
252
|
+
"required": [
|
|
253
|
+
"uploadId",
|
|
254
|
+
"target",
|
|
255
|
+
"sha256",
|
|
256
|
+
"sizeBytes"
|
|
257
|
+
],
|
|
258
|
+
"description": "Exactly one of `file` (for a `file` target) and `stagedUntil` (for a `bundle` target) is present — a rule over two members that this schema does not express.",
|
|
259
|
+
"properties": {
|
|
260
|
+
"uploadId": {
|
|
261
|
+
"$ref": "#/$defs/UploadId"
|
|
262
|
+
},
|
|
263
|
+
"target": {
|
|
264
|
+
"$ref": "#/$defs/UploadTarget"
|
|
265
|
+
},
|
|
266
|
+
"sha256": {
|
|
267
|
+
"$ref": "#/$defs/ExpectedSha256"
|
|
268
|
+
},
|
|
269
|
+
"sizeBytes": {
|
|
270
|
+
"$ref": "#/$defs/ExpectedSizeBytes"
|
|
271
|
+
},
|
|
272
|
+
"file": {
|
|
273
|
+
"$ref": "#/$defs/WrittenFile"
|
|
274
|
+
},
|
|
275
|
+
"stagedUntil": {
|
|
276
|
+
"$ref": "#/$defs/ExpiresAt"
|
|
277
|
+
},
|
|
278
|
+
"ext": {
|
|
279
|
+
"$ref": "#/$defs/Ext"
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
"Ext": {
|
|
284
|
+
"title": "Ext",
|
|
285
|
+
"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.",
|
|
286
|
+
"type": "object",
|
|
287
|
+
"minProperties": 1,
|
|
288
|
+
"additionalProperties": true,
|
|
289
|
+
"propertyNames": {
|
|
290
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
"ExpiresAt": {
|
|
294
|
+
"title": "ExpiresAt",
|
|
295
|
+
"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.",
|
|
296
|
+
"type": "string",
|
|
297
|
+
"format": "date-time"
|
|
298
|
+
},
|
|
299
|
+
"ExpectedSizeBytes": {
|
|
300
|
+
"title": "ExpectedSizeBytes",
|
|
301
|
+
"description": "Total byte count of the bundle. A zero-length bundle is not a degenerate success — nothing was serialized — so the floor is 1.",
|
|
302
|
+
"type": "integer",
|
|
303
|
+
"minimum": 1
|
|
304
|
+
},
|
|
305
|
+
"ExpectedSha256": {
|
|
306
|
+
"title": "ExpectedSha256",
|
|
307
|
+
"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.",
|
|
308
|
+
"type": "string",
|
|
309
|
+
"pattern": "^[0-9a-f]{64}$"
|
|
310
|
+
},
|
|
311
|
+
"UploadTarget": {
|
|
312
|
+
"title": "UploadTarget",
|
|
313
|
+
"type": "object",
|
|
314
|
+
"additionalProperties": false,
|
|
315
|
+
"required": [
|
|
316
|
+
"kind"
|
|
317
|
+
],
|
|
318
|
+
"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.",
|
|
319
|
+
"properties": {
|
|
320
|
+
"kind": {
|
|
321
|
+
"type": "string",
|
|
322
|
+
"enum": [
|
|
323
|
+
"file",
|
|
324
|
+
"bundle"
|
|
325
|
+
]
|
|
326
|
+
},
|
|
327
|
+
"path": {
|
|
328
|
+
"$ref": "#/$defs/WebsitePath"
|
|
329
|
+
},
|
|
330
|
+
"ifMatch": {
|
|
331
|
+
"$ref": "#/$defs/WebsiteEtag"
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
"WebsiteEtag": {
|
|
336
|
+
"title": "WebsiteEtag",
|
|
337
|
+
"type": "string",
|
|
338
|
+
"pattern": "^[0-9a-f]{64}$",
|
|
339
|
+
"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."
|
|
340
|
+
},
|
|
341
|
+
"WebsitePath": {
|
|
342
|
+
"title": "WebsitePath",
|
|
343
|
+
"type": "string",
|
|
344
|
+
"minLength": 1,
|
|
345
|
+
"maxLength": 1024,
|
|
346
|
+
"pattern": "^[^\\\\]+$",
|
|
347
|
+
"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."
|
|
348
|
+
},
|
|
349
|
+
"UploadId": {
|
|
350
|
+
"title": "UploadId",
|
|
351
|
+
"type": "string",
|
|
352
|
+
"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}$",
|
|
353
|
+
"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."
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
} as const;
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
360
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
361
|
+
* per-specification and cannot be derived from the document alone, and
|
|
362
|
+
* item 2 needs the schema this carries.
|
|
363
|
+
*/
|
|
364
|
+
export const SPEC = {
|
|
365
|
+
typeUri: TYPE_URI,
|
|
366
|
+
isBearer: false,
|
|
367
|
+
isProofRequired: true,
|
|
368
|
+
isRecipientRequired: true,
|
|
369
|
+
isIssuedAtRequired: true,
|
|
370
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
371
|
+
} as const;
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
375
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
376
|
+
* parties (§7.3 item 5).
|
|
377
|
+
*/
|
|
378
|
+
export const RESPONSE_SPEC = {
|
|
379
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
380
|
+
isBearer: false,
|
|
381
|
+
isProofRequired: true,
|
|
382
|
+
isRecipientRequired: true,
|
|
383
|
+
isIssuedAtRequired: true,
|
|
384
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
385
|
+
} as const;
|