@openvtc/trust-tasks 0.26.10 → 0.26.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,305 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/rooms/keys/act/0.2/payload.schema.json
4
+ */
5
+ /** Trust Task type URI. */
6
+ export const TYPE_URI = "https://trusttasks.org/spec/rooms/keys/act/0.2";
7
+ /** Trust Task response type URI (request type URI + "#response"). */
8
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/rooms/keys/act/0.2#response";
9
+ /**
10
+ * This specification's payload schema, as a value.
11
+ *
12
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
13
+ * rather than only as a `.json` file because TypeScript types are erased
14
+ * at runtime: without a schema a consumer has nothing to validate, and
15
+ * every REQUIRED payload member is optional in practice. Cross-file
16
+ * `$ref`s are already inlined, so it needs no resolver.
17
+ */
18
+ export const PAYLOAD_SCHEMA = {
19
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
20
+ "$id": "https://trusttasks.org/spec/rooms/keys/act/0.2",
21
+ "title": "Rooms Keys Act — payload",
22
+ "description": "A member's own client asks the member's key holder to complete one host-bound room request as the member: the member's own authority narrowed to the one action the request's type needs, the member as issuer, and the member's signature. The outer document members are owned by the framework — SPEC §6.3.",
23
+ "type": "object",
24
+ "additionalProperties": false,
25
+ "required": [
26
+ "document"
27
+ ],
28
+ "properties": {
29
+ "document": {
30
+ "$ref": "#/$defs/UnsignedRoomRequest",
31
+ "description": "The room request to complete, as the client will send it, minus its presentation and its proof."
32
+ },
33
+ "ext": {
34
+ "$ref": "#/$defs/Ext",
35
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
36
+ }
37
+ },
38
+ "$defs": {
39
+ "UnsignedRoomRequest": {
40
+ "$anchor": "unsigned-room-request",
41
+ "title": "Unsigned room request",
42
+ "description": "A Trust Task document of a type in the rooms/keys/act table, built by the member's client: no proof, and no presentation in its payload. The recipient validates the payload against the named type's own schema; this one fixes only the envelope.",
43
+ "type": "object",
44
+ "additionalProperties": false,
45
+ "required": [
46
+ "id",
47
+ "type",
48
+ "recipient",
49
+ "issuedAt",
50
+ "payload"
51
+ ],
52
+ "properties": {
53
+ "id": {
54
+ "type": "string",
55
+ "minLength": 1,
56
+ "maxLength": 512,
57
+ "description": "The request's identifier, set by the client. The host keys duplicate-execution protection on it."
58
+ },
59
+ "type": {
60
+ "type": "string",
61
+ "pattern": "^https://trusttasks\\.org/spec/rooms/",
62
+ "maxLength": 2048,
63
+ "description": "The room request's Type URI. Only the types in this task's table are completed; any other is `typeNotActable`."
64
+ },
65
+ "issuer": {
66
+ "type": "string",
67
+ "pattern": "^did:",
68
+ "maxLength": 2048,
69
+ "description": "The member to act as, and this task's subject (subjectPath /document/issuer). REQUIRED for a type that names no room (rooms/blobs/chunk/0.1, rooms/blobs/upload/{commit,abort}/0.2), where it is the member whose request opened the transfer; REQUIRED where the caller may act as more than one member of the room; optional where it may act as exactly one. A rule over two members this schema does not express: the recipient refuses an absent issuer it needs with principalAmbiguous. Never the client's own identifier."
70
+ },
71
+ "recipient": {
72
+ "type": "string",
73
+ "pattern": "^did:",
74
+ "maxLength": 2048,
75
+ "description": "The room's host, which the completed document is for. Covered by the member's proof."
76
+ },
77
+ "issuedAt": {
78
+ "type": "string",
79
+ "format": "date-time"
80
+ },
81
+ "expiresAt": {
82
+ "type": "string",
83
+ "format": "date-time"
84
+ },
85
+ "threadId": {
86
+ "type": "string",
87
+ "minLength": 1,
88
+ "maxLength": 512
89
+ },
90
+ "payload": {
91
+ "type": "object",
92
+ "description": "The request's payload, as the named type's schema defines it but without `presentation`: the recipient inserts the member's own, narrowed to the table's action, and refuses a payload that already carries one."
93
+ },
94
+ "ext": {
95
+ "$ref": "#/$defs/Ext"
96
+ }
97
+ },
98
+ "not": {
99
+ "required": [
100
+ "proof"
101
+ ]
102
+ }
103
+ },
104
+ "Response": {
105
+ "$anchor": "response",
106
+ "title": "Rooms Keys Act — response payload",
107
+ "description": "Success response to rooms/keys/act. Type https://trusttasks.org/spec/rooms/keys/act/0.2#response. The request, completed as the member, for the caller to send to its recipient unaltered.",
108
+ "type": "object",
109
+ "additionalProperties": false,
110
+ "required": [
111
+ "principal",
112
+ "document"
113
+ ],
114
+ "properties": {
115
+ "principal": {
116
+ "type": "string",
117
+ "pattern": "^did:",
118
+ "maxLength": 2048,
119
+ "description": "The member the recipient signed as: the completed document's `issuer`."
120
+ },
121
+ "document": {
122
+ "type": "object",
123
+ "required": [
124
+ "id",
125
+ "type",
126
+ "issuer",
127
+ "recipient",
128
+ "issuedAt",
129
+ "payload",
130
+ "proof"
131
+ ],
132
+ "description": "The supplied document with `issuer` set to the member, `payload.presentation` inserted where the type takes one, and the member's Data Integrity `proof` (`proofPurpose: authentication`). Every other member is unchanged."
133
+ },
134
+ "expiresAt": {
135
+ "type": "string",
136
+ "format": "date-time",
137
+ "description": "When the inserted presentation's leaf lapses. Absent when the type takes no presentation."
138
+ },
139
+ "ext": {
140
+ "$ref": "#/$defs/Ext"
141
+ }
142
+ }
143
+ },
144
+ "Ext": {
145
+ "title": "Ext",
146
+ "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.",
147
+ "type": "object",
148
+ "minProperties": 1,
149
+ "additionalProperties": true,
150
+ "propertyNames": {
151
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
152
+ }
153
+ }
154
+ }
155
+ };
156
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
157
+ export const RESPONSE_PAYLOAD_SCHEMA = {
158
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
159
+ "$ref": "#/$defs/Response",
160
+ "$defs": {
161
+ "UnsignedRoomRequest": {
162
+ "$anchor": "unsigned-room-request",
163
+ "title": "Unsigned room request",
164
+ "description": "A Trust Task document of a type in the rooms/keys/act table, built by the member's client: no proof, and no presentation in its payload. The recipient validates the payload against the named type's own schema; this one fixes only the envelope.",
165
+ "type": "object",
166
+ "additionalProperties": false,
167
+ "required": [
168
+ "id",
169
+ "type",
170
+ "recipient",
171
+ "issuedAt",
172
+ "payload"
173
+ ],
174
+ "properties": {
175
+ "id": {
176
+ "type": "string",
177
+ "minLength": 1,
178
+ "maxLength": 512,
179
+ "description": "The request's identifier, set by the client. The host keys duplicate-execution protection on it."
180
+ },
181
+ "type": {
182
+ "type": "string",
183
+ "pattern": "^https://trusttasks\\.org/spec/rooms/",
184
+ "maxLength": 2048,
185
+ "description": "The room request's Type URI. Only the types in this task's table are completed; any other is `typeNotActable`."
186
+ },
187
+ "issuer": {
188
+ "type": "string",
189
+ "pattern": "^did:",
190
+ "maxLength": 2048,
191
+ "description": "The member to act as, and this task's subject (subjectPath /document/issuer). REQUIRED for a type that names no room (rooms/blobs/chunk/0.1, rooms/blobs/upload/{commit,abort}/0.2), where it is the member whose request opened the transfer; REQUIRED where the caller may act as more than one member of the room; optional where it may act as exactly one. A rule over two members this schema does not express: the recipient refuses an absent issuer it needs with principalAmbiguous. Never the client's own identifier."
192
+ },
193
+ "recipient": {
194
+ "type": "string",
195
+ "pattern": "^did:",
196
+ "maxLength": 2048,
197
+ "description": "The room's host, which the completed document is for. Covered by the member's proof."
198
+ },
199
+ "issuedAt": {
200
+ "type": "string",
201
+ "format": "date-time"
202
+ },
203
+ "expiresAt": {
204
+ "type": "string",
205
+ "format": "date-time"
206
+ },
207
+ "threadId": {
208
+ "type": "string",
209
+ "minLength": 1,
210
+ "maxLength": 512
211
+ },
212
+ "payload": {
213
+ "type": "object",
214
+ "description": "The request's payload, as the named type's schema defines it but without `presentation`: the recipient inserts the member's own, narrowed to the table's action, and refuses a payload that already carries one."
215
+ },
216
+ "ext": {
217
+ "$ref": "#/$defs/Ext"
218
+ }
219
+ },
220
+ "not": {
221
+ "required": [
222
+ "proof"
223
+ ]
224
+ }
225
+ },
226
+ "Response": {
227
+ "$anchor": "response",
228
+ "title": "Rooms Keys Act — response payload",
229
+ "description": "Success response to rooms/keys/act. Type https://trusttasks.org/spec/rooms/keys/act/0.2#response. The request, completed as the member, for the caller to send to its recipient unaltered.",
230
+ "type": "object",
231
+ "additionalProperties": false,
232
+ "required": [
233
+ "principal",
234
+ "document"
235
+ ],
236
+ "properties": {
237
+ "principal": {
238
+ "type": "string",
239
+ "pattern": "^did:",
240
+ "maxLength": 2048,
241
+ "description": "The member the recipient signed as: the completed document's `issuer`."
242
+ },
243
+ "document": {
244
+ "type": "object",
245
+ "required": [
246
+ "id",
247
+ "type",
248
+ "issuer",
249
+ "recipient",
250
+ "issuedAt",
251
+ "payload",
252
+ "proof"
253
+ ],
254
+ "description": "The supplied document with `issuer` set to the member, `payload.presentation` inserted where the type takes one, and the member's Data Integrity `proof` (`proofPurpose: authentication`). Every other member is unchanged."
255
+ },
256
+ "expiresAt": {
257
+ "type": "string",
258
+ "format": "date-time",
259
+ "description": "When the inserted presentation's leaf lapses. Absent when the type takes no presentation."
260
+ },
261
+ "ext": {
262
+ "$ref": "#/$defs/Ext"
263
+ }
264
+ }
265
+ },
266
+ "Ext": {
267
+ "title": "Ext",
268
+ "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.",
269
+ "type": "object",
270
+ "minProperties": 1,
271
+ "additionalProperties": true,
272
+ "propertyNames": {
273
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
274
+ }
275
+ }
276
+ }
277
+ };
278
+ /**
279
+ * SPEC.md §7.2 policy for the request variant, from this specification's
280
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
281
+ * per-specification and cannot be derived from the document alone, and
282
+ * item 2 needs the schema this carries.
283
+ */
284
+ export const SPEC = {
285
+ typeUri: TYPE_URI,
286
+ isBearer: false,
287
+ isProofRequired: true,
288
+ isRecipientRequired: true,
289
+ isIssuedAtRequired: true,
290
+ payloadSchema: PAYLOAD_SCHEMA,
291
+ };
292
+ /**
293
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
294
+ * tracks the *issuer* party's requirement because a response swaps the
295
+ * parties (§7.3 item 5).
296
+ */
297
+ export const RESPONSE_SPEC = {
298
+ typeUri: RESPONSE_TYPE_URI,
299
+ isBearer: false,
300
+ isProofRequired: true,
301
+ isRecipientRequired: true,
302
+ isIssuedAtRequired: true,
303
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
304
+ };
305
+ //# sourceMappingURL=payload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payload.js","sourceRoot":"","sources":["../../../../../src/rooms/keys/act/0.2/payload.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAkEH,2BAA2B;AAC3B,MAAM,CAAC,MAAM,QAAQ,GAAG,gDAAyD,CAAC;AAKlF,qEAAqE;AACrE,MAAM,CAAC,MAAM,iBAAiB,GAAG,yDAAkE,CAAC;AAKpG;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,SAAS,EAAE,8CAA8C;IACzD,KAAK,EAAE,gDAAgD;IACvD,OAAO,EAAE,0BAA0B;IACnC,aAAa,EAAE,gTAAgT;IAC/T,MAAM,EAAE,QAAQ;IAChB,sBAAsB,EAAE,KAAK;IAC7B,UAAU,EAAE;QACV,UAAU;KACX;IACD,YAAY,EAAE;QACZ,UAAU,EAAE;YACV,MAAM,EAAE,6BAA6B;YACrC,aAAa,EAAE,iGAAiG;SACjH;QACD,KAAK,EAAE;YACL,MAAM,EAAE,aAAa;YACrB,aAAa,EAAE,yDAAyD;SACzE;KACF;IACD,OAAO,EAAE;QACP,qBAAqB,EAAE;YACrB,SAAS,EAAE,uBAAuB;YAClC,OAAO,EAAE,uBAAuB;YAChC,aAAa,EAAE,qPAAqP;YACpQ,MAAM,EAAE,QAAQ;YAChB,sBAAsB,EAAE,KAAK;YAC7B,UAAU,EAAE;gB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Q;oBAChB,UAAU,EAAE;wBACV,IAAI;wBACJ,MAAM;wBACN,QAAQ;wBACR,WAAW;wBACX,UAAU;wBACV,SAAS;wBACT,OAAO;qBACR;oBACD,aAAa,EAAE,6NAA6N;iBAC7O;gBACD,WAAW,EAAE;oBACX,MAAM,EAAE,QAAQ;oBAChB,QAAQ,EAAE,WAAW;oBACrB,aAAa,EAAE,2FAA2F;iBAC3G;gBACD,KAAK,EAAE;oBACL,MAAM,EAAE,aAAa;iBACtB;aACF;SACF;QACD,KAAK,EAAE;YACL,OAAO,EAAE,KAAK;YACd,aAAa,EAAE,uKAAuK;YACtL,MAAM,EAAE,QAAQ;YAChB,eAAe,EAAE,CAAC;YAClB,sBAAsB,EAAE,IAAI;YAC5B,eAAe,EAAE;gBACf,SAAS,EAAE,mCAAmC;aAC/C;SACF;KACF;CACO,CAAC;AAEX;;;;;GAKG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB,OAAO,EAAE,QAAQ;IACjB,QAAQ,EAAE,KAAK;IACf,eAAe,EAAE,IAAI;IACrB,mBAAmB,EAAE,IAAI;IACzB,kBAAkB,EAAE,IAAI;IACxB,aAAa,EAAE,cAAc;CACrB,CAAC;AAEX;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,OAAO,EAAE,iBAAiB;IAC1B,QAAQ,EAAE,KAAK;IACf,eAAe,EAAE,IAAI;IACrB,mBAAmB,EAAE,IAAI;IACzB,kBAAkB,EAAE,IAAI;IACxB,aAAa,EAAE,uBAAuB;CAC9B,CAAC"}
@@ -0,0 +1,306 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/rooms/keys/file-key/0.2/payload.schema.json
4
+ */
5
+ import type { Ext } from "../../../../_shared/components.js";
6
+ /**
7
+ * A caller asks the party holding its principal's room keys for the key of ONE file in a room: derived from the room's storage key for an epoch, bound to the room, the epoch and the file's identifier, and opening that file and nothing else.
8
+ */
9
+ export interface RoomsKeysFileKeyPayload {
10
+ /**
11
+ * The room the file belongs to. Bound into the derivation, so a key released for one room cannot open a blob relocated from another.
12
+ */
13
+ roomId: string;
14
+ /**
15
+ * The file's identifier: 32 random bytes, base64url without padding, as in FileManifest.fileId. The salt of the derivation. For `seal` the caller mints it fresh and MUST NOT reuse it; for `open` it is read from the sealed record's file manifest.
16
+ */
17
+ fileId: string;
18
+ /**
19
+ * `seal`: a key for a file about to be uploaded, derived under the room's CURRENT epoch, which the response names. `open`: a key for a file already in the room, derived under the epoch its manifest names.
20
+ */
21
+ purpose: "seal" | "open";
22
+ /**
23
+ * The epoch the file key derives from, as FileManifest.epoch states it. REQUIRED for `open` and forbidden for `seal` — a rule over two members this schema does not express; the custodian refuses a violation with `malformedRequest`. A sealing caller never chooses the epoch: sealing under anything but the current one would produce a file members who joined later could not open, or one a removed member still could.
24
+ */
25
+ epoch?: number;
26
+ /**
27
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
28
+ */
29
+ ext?: Ext;
30
+ }
31
+ /**
32
+ * Success response to rooms/keys/file-key. Type https://trusttasks.org/spec/rooms/keys/file-key/0.2#response.
33
+ */
34
+ export interface RoomsKeysFileKeyResponsePayload {
35
+ /**
36
+ * The 32-byte file key, base64url without padding. Opens exactly one file. The caller holds it in memory for as long as the file is being sealed or opened and then discards it; it never stores, logs or forwards it.
37
+ */
38
+ key: string;
39
+ /**
40
+ * The epoch the key was derived under. For `seal`, the room's current epoch, which the caller writes into the file's manifest; for `open`, the epoch requested.
41
+ */
42
+ epoch: number;
43
+ ext?: Ext;
44
+ }
45
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
46
+ export type { Ext };
47
+ /** Trust Task type URI. */
48
+ export declare const TYPE_URI: "https://trusttasks.org/spec/rooms/keys/file-key/0.2";
49
+ /** Stable alias for this specification's request payload shape. */
50
+ export type Payload = RoomsKeysFileKeyPayload;
51
+ /** Trust Task response type URI (request type URI + "#response"). */
52
+ export declare const RESPONSE_TYPE_URI: "https://trusttasks.org/spec/rooms/keys/file-key/0.2#response";
53
+ /** Stable alias for this specification's success-response payload shape. */
54
+ export type Response = RoomsKeysFileKeyResponsePayload;
55
+ /**
56
+ * This specification's payload schema, as a value.
57
+ *
58
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
59
+ * rather than only as a `.json` file because TypeScript types are erased
60
+ * at runtime: without a schema a consumer has nothing to validate, and
61
+ * every REQUIRED payload member is optional in practice. Cross-file
62
+ * `$ref`s are already inlined, so it needs no resolver.
63
+ */
64
+ export declare const PAYLOAD_SCHEMA: {
65
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
66
+ readonly $id: "https://trusttasks.org/spec/rooms/keys/file-key/0.2";
67
+ readonly title: "Rooms Keys File Key — payload";
68
+ readonly description: "A caller asks the party holding its principal's room keys for the key of ONE file in a room: derived from the room's storage key for an epoch, bound to the room, the epoch and the file's identifier, and opening that file and nothing else.";
69
+ readonly type: "object";
70
+ readonly additionalProperties: false;
71
+ readonly required: readonly ["roomId", "fileId", "purpose"];
72
+ readonly properties: {
73
+ readonly roomId: {
74
+ readonly type: "string";
75
+ readonly description: "The room the file belongs to. Bound into the derivation, so a key released for one room cannot open a blob relocated from another.";
76
+ };
77
+ readonly fileId: {
78
+ readonly type: "string";
79
+ readonly pattern: "^[A-Za-z0-9_-]{43}$";
80
+ readonly description: "The file's identifier: 32 random bytes, base64url without padding, as in FileManifest.fileId. The salt of the derivation. For `seal` the caller mints it fresh and MUST NOT reuse it; for `open` it is read from the sealed record's file manifest.";
81
+ };
82
+ readonly purpose: {
83
+ readonly type: "string";
84
+ readonly enum: readonly ["seal", "open"];
85
+ readonly description: "`seal`: a key for a file about to be uploaded, derived under the room's CURRENT epoch, which the response names. `open`: a key for a file already in the room, derived under the epoch its manifest names.";
86
+ };
87
+ readonly epoch: {
88
+ readonly type: "integer";
89
+ readonly minimum: 1;
90
+ readonly description: "The epoch the file key derives from, as FileManifest.epoch states it. REQUIRED for `open` and forbidden for `seal` — a rule over two members this schema does not express; the custodian refuses a violation with `malformedRequest`. A sealing caller never chooses the epoch: sealing under anything but the current one would produce a file members who joined later could not open, or one a removed member still could.";
91
+ };
92
+ readonly ext: {
93
+ readonly $ref: "#/$defs/Ext";
94
+ readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
95
+ };
96
+ };
97
+ readonly $defs: {
98
+ readonly Response: {
99
+ readonly $anchor: "response";
100
+ readonly title: "Rooms Keys File Key — response payload";
101
+ readonly description: "Success response to rooms/keys/file-key. Type https://trusttasks.org/spec/rooms/keys/file-key/0.2#response.";
102
+ readonly type: "object";
103
+ readonly additionalProperties: false;
104
+ readonly required: readonly ["key", "epoch"];
105
+ readonly properties: {
106
+ readonly key: {
107
+ readonly type: "string";
108
+ readonly pattern: "^[A-Za-z0-9_-]{43}$";
109
+ readonly description: "The 32-byte file key, base64url without padding. Opens exactly one file. The caller holds it in memory for as long as the file is being sealed or opened and then discards it; it never stores, logs or forwards it.";
110
+ };
111
+ readonly epoch: {
112
+ readonly type: "integer";
113
+ readonly minimum: 1;
114
+ readonly description: "The epoch the key was derived under. For `seal`, the room's current epoch, which the caller writes into the file's manifest; for `open`, the epoch requested.";
115
+ };
116
+ readonly ext: {
117
+ readonly $ref: "#/$defs/Ext";
118
+ };
119
+ };
120
+ };
121
+ readonly Ext: {
122
+ readonly title: "Ext";
123
+ readonly description: "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.";
124
+ readonly type: "object";
125
+ readonly minProperties: 1;
126
+ readonly additionalProperties: true;
127
+ readonly propertyNames: {
128
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
129
+ };
130
+ };
131
+ };
132
+ };
133
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
134
+ export declare const RESPONSE_PAYLOAD_SCHEMA: {
135
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
136
+ readonly $ref: "#/$defs/Response";
137
+ readonly $defs: {
138
+ readonly Response: {
139
+ readonly $anchor: "response";
140
+ readonly title: "Rooms Keys File Key — response payload";
141
+ readonly description: "Success response to rooms/keys/file-key. Type https://trusttasks.org/spec/rooms/keys/file-key/0.2#response.";
142
+ readonly type: "object";
143
+ readonly additionalProperties: false;
144
+ readonly required: readonly ["key", "epoch"];
145
+ readonly properties: {
146
+ readonly key: {
147
+ readonly type: "string";
148
+ readonly pattern: "^[A-Za-z0-9_-]{43}$";
149
+ readonly description: "The 32-byte file key, base64url without padding. Opens exactly one file. The caller holds it in memory for as long as the file is being sealed or opened and then discards it; it never stores, logs or forwards it.";
150
+ };
151
+ readonly epoch: {
152
+ readonly type: "integer";
153
+ readonly minimum: 1;
154
+ readonly description: "The epoch the key was derived under. For `seal`, the room's current epoch, which the caller writes into the file's manifest; for `open`, the epoch requested.";
155
+ };
156
+ readonly ext: {
157
+ readonly $ref: "#/$defs/Ext";
158
+ };
159
+ };
160
+ };
161
+ readonly Ext: {
162
+ readonly title: "Ext";
163
+ readonly description: "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.";
164
+ readonly type: "object";
165
+ readonly minProperties: 1;
166
+ readonly additionalProperties: true;
167
+ readonly propertyNames: {
168
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
169
+ };
170
+ };
171
+ };
172
+ };
173
+ /**
174
+ * SPEC.md §7.2 policy for the request variant, from this specification's
175
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
176
+ * per-specification and cannot be derived from the document alone, and
177
+ * item 2 needs the schema this carries.
178
+ */
179
+ export declare const SPEC: {
180
+ readonly typeUri: "https://trusttasks.org/spec/rooms/keys/file-key/0.2";
181
+ readonly isBearer: false;
182
+ readonly isProofRequired: true;
183
+ readonly isRecipientRequired: true;
184
+ readonly isIssuedAtRequired: true;
185
+ readonly payloadSchema: {
186
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
187
+ readonly $id: "https://trusttasks.org/spec/rooms/keys/file-key/0.2";
188
+ readonly title: "Rooms Keys File Key — payload";
189
+ readonly description: "A caller asks the party holding its principal's room keys for the key of ONE file in a room: derived from the room's storage key for an epoch, bound to the room, the epoch and the file's identifier, and opening that file and nothing else.";
190
+ readonly type: "object";
191
+ readonly additionalProperties: false;
192
+ readonly required: readonly ["roomId", "fileId", "purpose"];
193
+ readonly properties: {
194
+ readonly roomId: {
195
+ readonly type: "string";
196
+ readonly description: "The room the file belongs to. Bound into the derivation, so a key released for one room cannot open a blob relocated from another.";
197
+ };
198
+ readonly fileId: {
199
+ readonly type: "string";
200
+ readonly pattern: "^[A-Za-z0-9_-]{43}$";
201
+ readonly description: "The file's identifier: 32 random bytes, base64url without padding, as in FileManifest.fileId. The salt of the derivation. For `seal` the caller mints it fresh and MUST NOT reuse it; for `open` it is read from the sealed record's file manifest.";
202
+ };
203
+ readonly purpose: {
204
+ readonly type: "string";
205
+ readonly enum: readonly ["seal", "open"];
206
+ readonly description: "`seal`: a key for a file about to be uploaded, derived under the room's CURRENT epoch, which the response names. `open`: a key for a file already in the room, derived under the epoch its manifest names.";
207
+ };
208
+ readonly epoch: {
209
+ readonly type: "integer";
210
+ readonly minimum: 1;
211
+ readonly description: "The epoch the file key derives from, as FileManifest.epoch states it. REQUIRED for `open` and forbidden for `seal` — a rule over two members this schema does not express; the custodian refuses a violation with `malformedRequest`. A sealing caller never chooses the epoch: sealing under anything but the current one would produce a file members who joined later could not open, or one a removed member still could.";
212
+ };
213
+ readonly ext: {
214
+ readonly $ref: "#/$defs/Ext";
215
+ readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
216
+ };
217
+ };
218
+ readonly $defs: {
219
+ readonly Response: {
220
+ readonly $anchor: "response";
221
+ readonly title: "Rooms Keys File Key — response payload";
222
+ readonly description: "Success response to rooms/keys/file-key. Type https://trusttasks.org/spec/rooms/keys/file-key/0.2#response.";
223
+ readonly type: "object";
224
+ readonly additionalProperties: false;
225
+ readonly required: readonly ["key", "epoch"];
226
+ readonly properties: {
227
+ readonly key: {
228
+ readonly type: "string";
229
+ readonly pattern: "^[A-Za-z0-9_-]{43}$";
230
+ readonly description: "The 32-byte file key, base64url without padding. Opens exactly one file. The caller holds it in memory for as long as the file is being sealed or opened and then discards it; it never stores, logs or forwards it.";
231
+ };
232
+ readonly epoch: {
233
+ readonly type: "integer";
234
+ readonly minimum: 1;
235
+ readonly description: "The epoch the key was derived under. For `seal`, the room's current epoch, which the caller writes into the file's manifest; for `open`, the epoch requested.";
236
+ };
237
+ readonly ext: {
238
+ readonly $ref: "#/$defs/Ext";
239
+ };
240
+ };
241
+ };
242
+ readonly Ext: {
243
+ readonly title: "Ext";
244
+ readonly description: "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.";
245
+ readonly type: "object";
246
+ readonly minProperties: 1;
247
+ readonly additionalProperties: true;
248
+ readonly propertyNames: {
249
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
250
+ };
251
+ };
252
+ };
253
+ };
254
+ };
255
+ /**
256
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
257
+ * tracks the *issuer* party's requirement because a response swaps the
258
+ * parties (§7.3 item 5).
259
+ */
260
+ export declare const RESPONSE_SPEC: {
261
+ readonly typeUri: "https://trusttasks.org/spec/rooms/keys/file-key/0.2#response";
262
+ readonly isBearer: false;
263
+ readonly isProofRequired: true;
264
+ readonly isRecipientRequired: true;
265
+ readonly isIssuedAtRequired: true;
266
+ readonly payloadSchema: {
267
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
268
+ readonly $ref: "#/$defs/Response";
269
+ readonly $defs: {
270
+ readonly Response: {
271
+ readonly $anchor: "response";
272
+ readonly title: "Rooms Keys File Key — response payload";
273
+ readonly description: "Success response to rooms/keys/file-key. Type https://trusttasks.org/spec/rooms/keys/file-key/0.2#response.";
274
+ readonly type: "object";
275
+ readonly additionalProperties: false;
276
+ readonly required: readonly ["key", "epoch"];
277
+ readonly properties: {
278
+ readonly key: {
279
+ readonly type: "string";
280
+ readonly pattern: "^[A-Za-z0-9_-]{43}$";
281
+ readonly description: "The 32-byte file key, base64url without padding. Opens exactly one file. The caller holds it in memory for as long as the file is being sealed or opened and then discards it; it never stores, logs or forwards it.";
282
+ };
283
+ readonly epoch: {
284
+ readonly type: "integer";
285
+ readonly minimum: 1;
286
+ readonly description: "The epoch the key was derived under. For `seal`, the room's current epoch, which the caller writes into the file's manifest; for `open`, the epoch requested.";
287
+ };
288
+ readonly ext: {
289
+ readonly $ref: "#/$defs/Ext";
290
+ };
291
+ };
292
+ };
293
+ readonly Ext: {
294
+ readonly title: "Ext";
295
+ readonly description: "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.";
296
+ readonly type: "object";
297
+ readonly minProperties: 1;
298
+ readonly additionalProperties: true;
299
+ readonly propertyNames: {
300
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
301
+ };
302
+ };
303
+ };
304
+ };
305
+ };
306
+ //# sourceMappingURL=payload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../../../src/rooms/keys/file-key/0.2/payload.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mCAAmC,CAAC;AAG7D;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,GAAG,CAAC,EAAE,GAAG,CAAC;CACX;AACD;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