@openvtc/trust-tasks 0.17.6 → 0.17.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/CHANGELOG.md +158 -0
  2. package/dist/_shared/components.d.ts +4 -0
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/index.d.ts +8 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +8 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/rooms/_shared/0.1/room.d.ts +1 -1
  9. package/dist/rooms/_shared/0.1/room.d.ts.map +1 -1
  10. package/dist/rooms/create/0.1/payload.d.ts +42 -2
  11. package/dist/rooms/create/0.1/payload.d.ts.map +1 -1
  12. package/dist/rooms/create/0.1/payload.js +24 -0
  13. package/dist/rooms/create/0.1/payload.js.map +1 -1
  14. package/dist/rooms/keys/backfill/0.1/payload.d.ts +336 -0
  15. package/dist/rooms/keys/backfill/0.1/payload.d.ts.map +1 -0
  16. package/dist/rooms/keys/backfill/0.1/payload.js +177 -0
  17. package/dist/rooms/keys/backfill/0.1/payload.js.map +1 -0
  18. package/dist/rooms/keys/chain/0.1/payload.d.ts +382 -0
  19. package/dist/rooms/keys/chain/0.1/payload.d.ts.map +1 -0
  20. package/dist/rooms/keys/chain/0.1/payload.js +213 -0
  21. package/dist/rooms/keys/chain/0.1/payload.js.map +1 -0
  22. package/dist/rooms/keys/list/0.1/payload.d.ts +314 -0
  23. package/dist/rooms/keys/list/0.1/payload.d.ts.map +1 -0
  24. package/dist/rooms/keys/list/0.1/payload.js +175 -0
  25. package/dist/rooms/keys/list/0.1/payload.js.map +1 -0
  26. package/dist/rooms/keys/seal/0.1/payload.d.ts +352 -0
  27. package/dist/rooms/keys/seal/0.1/payload.d.ts.map +1 -0
  28. package/dist/rooms/keys/seal/0.1/payload.js +199 -0
  29. package/dist/rooms/keys/seal/0.1/payload.js.map +1 -0
  30. package/dist/rooms/owner/invite/0.1/payload.d.ts +291 -0
  31. package/dist/rooms/owner/invite/0.1/payload.d.ts.map +1 -0
  32. package/dist/rooms/owner/invite/0.1/payload.js +158 -0
  33. package/dist/rooms/owner/invite/0.1/payload.js.map +1 -0
  34. package/dist/rooms/owner/issue-authority/0.1/payload.d.ts +315 -0
  35. package/dist/rooms/owner/issue-authority/0.1/payload.d.ts.map +1 -0
  36. package/dist/rooms/owner/issue-authority/0.1/payload.js +173 -0
  37. package/dist/rooms/owner/issue-authority/0.1/payload.js.map +1 -0
  38. package/dist/rooms/owner/issue-membership/0.1/payload.d.ts +291 -0
  39. package/dist/rooms/owner/issue-membership/0.1/payload.d.ts.map +1 -0
  40. package/dist/rooms/owner/issue-membership/0.1/payload.js +158 -0
  41. package/dist/rooms/owner/issue-membership/0.1/payload.js.map +1 -0
  42. package/dist/rooms/owner/register/0.1/payload.d.ts +382 -0
  43. package/dist/rooms/owner/register/0.1/payload.d.ts.map +1 -0
  44. package/dist/rooms/owner/register/0.1/payload.js +215 -0
  45. package/dist/rooms/owner/register/0.1/payload.js.map +1 -0
  46. package/package.json +1 -1
  47. package/src/_shared/components.ts +4 -0
  48. package/src/index.ts +8 -0
  49. package/src/rooms/_shared/0.1/room.ts +1 -1
  50. package/src/rooms/create/0.1/payload.ts +30 -2
  51. package/src/rooms/keys/backfill/0.1/payload.ts +236 -0
  52. package/src/rooms/keys/chain/0.1/payload.ts +262 -0
  53. package/src/rooms/keys/list/0.1/payload.ts +222 -0
  54. package/src/rooms/keys/seal/0.1/payload.ts +246 -0
  55. package/src/rooms/owner/invite/0.1/payload.ts +212 -0
  56. package/src/rooms/owner/issue-authority/0.1/payload.ts +233 -0
  57. package/src/rooms/owner/issue-membership/0.1/payload.ts +212 -0
  58. package/src/rooms/owner/register/0.1/payload.ts +278 -0
@@ -0,0 +1,222 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/rooms/keys/list/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { Ext } from "../../../../_shared/components.js";
7
+
8
+
9
+ export interface RoomsKeysListPayload {
10
+ /**
11
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
12
+ */
13
+ ext?: Ext;
14
+ }
15
+ /**
16
+ * Success response to rooms/keys/list. Type https://trusttasks.org/spec/rooms/keys/list/0.1#response. The rooms this key holder can open, which is a different set from the rooms its principal is a member of: membership is a credential the room issued, and this is key custody. A room whose group state was never delivered is absent here and the principal may still hold a perfectly good VMC for it.
17
+ */
18
+ export interface RoomsKeysListResponsePayload {
19
+ /**
20
+ * One entry per room, in no guaranteed order.
21
+ */
22
+ rooms: {
23
+ /**
24
+ * The room's identifier.
25
+ */
26
+ roomId: string;
27
+ /**
28
+ * The epoch this key holder is at. Behind the room's own epoch means a commit has not been delivered, and records sealed since will not open.
29
+ */
30
+ epoch: number;
31
+ /**
32
+ * The earliest epoch this key holder can derive a key for, walking the epoch key chain it holds. Equal to `epoch` means it reads only from where it joined; `1` means the room's whole retained history. Anything between is a chain that has been delivered in part, or one deliberately severed below that point.
33
+ */
34
+ earliestReadableEpoch: number;
35
+ }[];
36
+ ext?: Ext;
37
+ }
38
+
39
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
40
+ export type { Ext };
41
+
42
+ /** Trust Task type URI. */
43
+ export const TYPE_URI = "https://trusttasks.org/spec/rooms/keys/list/0.1" as const;
44
+
45
+ /** Stable alias for this specification's request payload shape. */
46
+ export type Payload = RoomsKeysListPayload;
47
+
48
+ /** Trust Task response type URI (request type URI + "#response"). */
49
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/rooms/keys/list/0.1#response" as const;
50
+
51
+ /** Stable alias for this specification's success-response payload shape. */
52
+ export type Response = RoomsKeysListResponsePayload;
53
+
54
+ /**
55
+ * This specification's payload schema, as a value.
56
+ *
57
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
58
+ * rather than only as a `.json` file because TypeScript types are erased
59
+ * at runtime: without a schema a consumer has nothing to validate, and
60
+ * every REQUIRED payload member is optional in practice. Cross-file
61
+ * `$ref`s are already inlined, so it needs no resolver.
62
+ */
63
+ export const PAYLOAD_SCHEMA = {
64
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
65
+ "$id": "https://trusttasks.org/spec/rooms/keys/list/0.1",
66
+ "title": "Rooms Keys List — payload",
67
+ "type": "object",
68
+ "additionalProperties": false,
69
+ "properties": {
70
+ "ext": {
71
+ "$ref": "#/$defs/Ext",
72
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
73
+ }
74
+ },
75
+ "$defs": {
76
+ "Response": {
77
+ "$anchor": "response",
78
+ "title": "Rooms Keys List — response payload",
79
+ "description": "Success response to rooms/keys/list. Type https://trusttasks.org/spec/rooms/keys/list/0.1#response. The rooms this key holder can open, which is a different set from the rooms its principal is a member of: membership is a credential the room issued, and this is key custody. A room whose group state was never delivered is absent here and the principal may still hold a perfectly good VMC for it.",
80
+ "type": "object",
81
+ "additionalProperties": false,
82
+ "required": [
83
+ "rooms"
84
+ ],
85
+ "properties": {
86
+ "rooms": {
87
+ "type": "array",
88
+ "description": "One entry per room, in no guaranteed order.",
89
+ "items": {
90
+ "type": "object",
91
+ "additionalProperties": false,
92
+ "required": [
93
+ "roomId",
94
+ "epoch",
95
+ "earliestReadableEpoch"
96
+ ],
97
+ "properties": {
98
+ "roomId": {
99
+ "type": "string",
100
+ "description": "The room's identifier."
101
+ },
102
+ "epoch": {
103
+ "type": "integer",
104
+ "minimum": 1,
105
+ "description": "The epoch this key holder is at. Behind the room's own epoch means a commit has not been delivered, and records sealed since will not open."
106
+ },
107
+ "earliestReadableEpoch": {
108
+ "type": "integer",
109
+ "minimum": 1,
110
+ "description": "The earliest epoch this key holder can derive a key for, walking the epoch key chain it holds. Equal to `epoch` means it reads only from where it joined; `1` means the room's whole retained history. Anything between is a chain that has been delivered in part, or one deliberately severed below that point."
111
+ }
112
+ }
113
+ }
114
+ },
115
+ "ext": {
116
+ "$ref": "#/$defs/Ext"
117
+ }
118
+ }
119
+ },
120
+ "Ext": {
121
+ "title": "Ext",
122
+ "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.",
123
+ "type": "object",
124
+ "minProperties": 1,
125
+ "additionalProperties": true,
126
+ "propertyNames": {
127
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
128
+ }
129
+ }
130
+ }
131
+ } as const;
132
+
133
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
134
+ export const RESPONSE_PAYLOAD_SCHEMA = {
135
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
136
+ "$ref": "#/$defs/Response",
137
+ "$defs": {
138
+ "Response": {
139
+ "$anchor": "response",
140
+ "title": "Rooms Keys List — response payload",
141
+ "description": "Success response to rooms/keys/list. Type https://trusttasks.org/spec/rooms/keys/list/0.1#response. The rooms this key holder can open, which is a different set from the rooms its principal is a member of: membership is a credential the room issued, and this is key custody. A room whose group state was never delivered is absent here and the principal may still hold a perfectly good VMC for it.",
142
+ "type": "object",
143
+ "additionalProperties": false,
144
+ "required": [
145
+ "rooms"
146
+ ],
147
+ "properties": {
148
+ "rooms": {
149
+ "type": "array",
150
+ "description": "One entry per room, in no guaranteed order.",
151
+ "items": {
152
+ "type": "object",
153
+ "additionalProperties": false,
154
+ "required": [
155
+ "roomId",
156
+ "epoch",
157
+ "earliestReadableEpoch"
158
+ ],
159
+ "properties": {
160
+ "roomId": {
161
+ "type": "string",
162
+ "description": "The room's identifier."
163
+ },
164
+ "epoch": {
165
+ "type": "integer",
166
+ "minimum": 1,
167
+ "description": "The epoch this key holder is at. Behind the room's own epoch means a commit has not been delivered, and records sealed since will not open."
168
+ },
169
+ "earliestReadableEpoch": {
170
+ "type": "integer",
171
+ "minimum": 1,
172
+ "description": "The earliest epoch this key holder can derive a key for, walking the epoch key chain it holds. Equal to `epoch` means it reads only from where it joined; `1` means the room's whole retained history. Anything between is a chain that has been delivered in part, or one deliberately severed below that point."
173
+ }
174
+ }
175
+ }
176
+ },
177
+ "ext": {
178
+ "$ref": "#/$defs/Ext"
179
+ }
180
+ }
181
+ },
182
+ "Ext": {
183
+ "title": "Ext",
184
+ "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.",
185
+ "type": "object",
186
+ "minProperties": 1,
187
+ "additionalProperties": true,
188
+ "propertyNames": {
189
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
190
+ }
191
+ }
192
+ }
193
+ } as const;
194
+
195
+ /**
196
+ * SPEC.md §7.2 policy for the request variant, from this specification's
197
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
198
+ * per-specification and cannot be derived from the document alone, and
199
+ * item 2 needs the schema this carries.
200
+ */
201
+ export const SPEC = {
202
+ typeUri: TYPE_URI,
203
+ isBearer: false,
204
+ isProofRequired: true,
205
+ isRecipientRequired: true,
206
+ isIssuedAtRequired: true,
207
+ payloadSchema: PAYLOAD_SCHEMA,
208
+ } as const;
209
+
210
+ /**
211
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
212
+ * tracks the *issuer* party's requirement because a response swaps the
213
+ * parties (§7.3 item 5).
214
+ */
215
+ export const RESPONSE_SPEC = {
216
+ typeUri: RESPONSE_TYPE_URI,
217
+ isBearer: false,
218
+ isProofRequired: true,
219
+ isRecipientRequired: true,
220
+ isIssuedAtRequired: true,
221
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
222
+ } as const;
@@ -0,0 +1,246 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/rooms/keys/seal/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { Ext, SealedRecord } from "../../../../_shared/components.js";
7
+
8
+
9
+ export interface RoomsKeysSealPayload {
10
+ /**
11
+ * The room to seal for. The recipient MUST hold group state for it.
12
+ */
13
+ roomId: string;
14
+ /**
15
+ * The record key this will be stored under. Bound into the associated data, so a record sealed for one key does not open under another. On a sealed tier keys MUST be opaque — a descriptive key defeats the encryption beside it, and structured naming belongs inside the sealed body.
16
+ */
17
+ key: string;
18
+ /**
19
+ * The version the writer INTENDS the record to take, bound into the associated data before the host assigns it. A caller that lets the host assign a different one will find the record does not open, which is the correct failure: accepting whatever came back would mean the binding commits to nothing. The shape that works is a create-only write (`expectedVersion: 0`) or a read of the current version before a rewrite.
20
+ */
21
+ version: number;
22
+ /**
23
+ * The record body to seal, base64url. Sealed whole rather than field by field: splitting it would let a host learn the shape of the material from ciphertext lengths, for no benefit, since a reader decrypts the whole record either way.
24
+ */
25
+ plaintext: string;
26
+ /**
27
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
28
+ */
29
+ ext?: Ext;
30
+ }
31
+ /**
32
+ * Success response to rooms/keys/seal. Type https://trusttasks.org/spec/rooms/keys/seal/0.1#response. The sealed record, ready to hand to a host with rooms/records/put.
33
+ */
34
+ export interface RoomsKeysSealResponsePayload {
35
+ sealed: SealedRecord;
36
+ ext?: Ext;
37
+ }
38
+
39
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
40
+ export type { Ext, SealedRecord };
41
+
42
+ /** Trust Task type URI. */
43
+ export const TYPE_URI = "https://trusttasks.org/spec/rooms/keys/seal/0.1" as const;
44
+
45
+ /** Stable alias for this specification's request payload shape. */
46
+ export type Payload = RoomsKeysSealPayload;
47
+
48
+ /** Trust Task response type URI (request type URI + "#response"). */
49
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/rooms/keys/seal/0.1#response" as const;
50
+
51
+ /** Stable alias for this specification's success-response payload shape. */
52
+ export type Response = RoomsKeysSealResponsePayload;
53
+
54
+ /**
55
+ * This specification's payload schema, as a value.
56
+ *
57
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
58
+ * rather than only as a `.json` file because TypeScript types are erased
59
+ * at runtime: without a schema a consumer has nothing to validate, and
60
+ * every REQUIRED payload member is optional in practice. Cross-file
61
+ * `$ref`s are already inlined, so it needs no resolver.
62
+ */
63
+ export const PAYLOAD_SCHEMA = {
64
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
65
+ "$id": "https://trusttasks.org/spec/rooms/keys/seal/0.1",
66
+ "title": "Rooms Keys Seal — payload",
67
+ "type": "object",
68
+ "additionalProperties": false,
69
+ "required": [
70
+ "roomId",
71
+ "key",
72
+ "version",
73
+ "plaintext"
74
+ ],
75
+ "properties": {
76
+ "roomId": {
77
+ "type": "string",
78
+ "description": "The room to seal for. The recipient MUST hold group state for it."
79
+ },
80
+ "key": {
81
+ "type": "string",
82
+ "maxLength": 512,
83
+ "description": "The record key this will be stored under. Bound into the associated data, so a record sealed for one key does not open under another. On a sealed tier keys MUST be opaque — a descriptive key defeats the encryption beside it, and structured naming belongs inside the sealed body."
84
+ },
85
+ "version": {
86
+ "type": "integer",
87
+ "minimum": 0,
88
+ "description": "The version the writer INTENDS the record to take, bound into the associated data before the host assigns it. A caller that lets the host assign a different one will find the record does not open, which is the correct failure: accepting whatever came back would mean the binding commits to nothing. The shape that works is a create-only write (`expectedVersion: 0`) or a read of the current version before a rewrite."
89
+ },
90
+ "plaintext": {
91
+ "type": "string",
92
+ "description": "The record body to seal, base64url. Sealed whole rather than field by field: splitting it would let a host learn the shape of the material from ciphertext lengths, for no benefit, since a reader decrypts the whole record either way."
93
+ },
94
+ "ext": {
95
+ "$ref": "#/$defs/Ext",
96
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
97
+ }
98
+ },
99
+ "$defs": {
100
+ "Response": {
101
+ "$anchor": "response",
102
+ "title": "Rooms Keys Seal — response payload",
103
+ "description": "Success response to rooms/keys/seal. Type https://trusttasks.org/spec/rooms/keys/seal/0.1#response. The sealed record, ready to hand to a host with rooms/records/put.",
104
+ "type": "object",
105
+ "additionalProperties": false,
106
+ "required": [
107
+ "sealed"
108
+ ],
109
+ "properties": {
110
+ "sealed": {
111
+ "$ref": "#/$defs/SealedRecord"
112
+ },
113
+ "ext": {
114
+ "$ref": "#/$defs/Ext"
115
+ }
116
+ }
117
+ },
118
+ "Ext": {
119
+ "title": "Ext",
120
+ "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.",
121
+ "type": "object",
122
+ "minProperties": 1,
123
+ "additionalProperties": true,
124
+ "propertyNames": {
125
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
126
+ }
127
+ },
128
+ "SealedRecord": {
129
+ "title": "SealedRecord",
130
+ "type": "object",
131
+ "additionalProperties": false,
132
+ "required": [
133
+ "ciphertext",
134
+ "nonce",
135
+ "epoch"
136
+ ],
137
+ "description": "A record as a host stores it on an `attributed` or `private` room. Title, description, body, author and tags are sealed together in one blob rather than separately: splitting them would let a host learn the shape of the material from ciphertext lengths, for no benefit, since a reader decrypts the whole record either way.",
138
+ "properties": {
139
+ "ciphertext": {
140
+ "type": "string",
141
+ "description": "The sealed record, base64url. Bound by AEAD associated data to `roomId`, `key`, `version` and `epoch`, so a host that relocates it to another key, version, epoch or room produces a mismatch and the open fails. The record cannot be moved undetected even though the host holds every byte of it."
142
+ },
143
+ "nonce": {
144
+ "type": "string",
145
+ "description": "AEAD nonce, base64url."
146
+ },
147
+ "epoch": {
148
+ "type": "integer",
149
+ "minimum": 1,
150
+ "description": "The key epoch this record was sealed under. Cleartext because the host must serve the right ciphertext, and bound into the associated data so that relabelling it fails authentication rather than causing a reader to try the wrong key."
151
+ }
152
+ }
153
+ }
154
+ }
155
+ } as const;
156
+
157
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
158
+ export const RESPONSE_PAYLOAD_SCHEMA = {
159
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
160
+ "$ref": "#/$defs/Response",
161
+ "$defs": {
162
+ "Response": {
163
+ "$anchor": "response",
164
+ "title": "Rooms Keys Seal — response payload",
165
+ "description": "Success response to rooms/keys/seal. Type https://trusttasks.org/spec/rooms/keys/seal/0.1#response. The sealed record, ready to hand to a host with rooms/records/put.",
166
+ "type": "object",
167
+ "additionalProperties": false,
168
+ "required": [
169
+ "sealed"
170
+ ],
171
+ "properties": {
172
+ "sealed": {
173
+ "$ref": "#/$defs/SealedRecord"
174
+ },
175
+ "ext": {
176
+ "$ref": "#/$defs/Ext"
177
+ }
178
+ }
179
+ },
180
+ "Ext": {
181
+ "title": "Ext",
182
+ "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.",
183
+ "type": "object",
184
+ "minProperties": 1,
185
+ "additionalProperties": true,
186
+ "propertyNames": {
187
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
188
+ }
189
+ },
190
+ "SealedRecord": {
191
+ "title": "SealedRecord",
192
+ "type": "object",
193
+ "additionalProperties": false,
194
+ "required": [
195
+ "ciphertext",
196
+ "nonce",
197
+ "epoch"
198
+ ],
199
+ "description": "A record as a host stores it on an `attributed` or `private` room. Title, description, body, author and tags are sealed together in one blob rather than separately: splitting them would let a host learn the shape of the material from ciphertext lengths, for no benefit, since a reader decrypts the whole record either way.",
200
+ "properties": {
201
+ "ciphertext": {
202
+ "type": "string",
203
+ "description": "The sealed record, base64url. Bound by AEAD associated data to `roomId`, `key`, `version` and `epoch`, so a host that relocates it to another key, version, epoch or room produces a mismatch and the open fails. The record cannot be moved undetected even though the host holds every byte of it."
204
+ },
205
+ "nonce": {
206
+ "type": "string",
207
+ "description": "AEAD nonce, base64url."
208
+ },
209
+ "epoch": {
210
+ "type": "integer",
211
+ "minimum": 1,
212
+ "description": "The key epoch this record was sealed under. Cleartext because the host must serve the right ciphertext, and bound into the associated data so that relabelling it fails authentication rather than causing a reader to try the wrong key."
213
+ }
214
+ }
215
+ }
216
+ }
217
+ } as const;
218
+
219
+ /**
220
+ * SPEC.md §7.2 policy for the request variant, from this specification's
221
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
222
+ * per-specification and cannot be derived from the document alone, and
223
+ * item 2 needs the schema this carries.
224
+ */
225
+ export const SPEC = {
226
+ typeUri: TYPE_URI,
227
+ isBearer: false,
228
+ isProofRequired: true,
229
+ isRecipientRequired: true,
230
+ isIssuedAtRequired: true,
231
+ payloadSchema: PAYLOAD_SCHEMA,
232
+ } as const;
233
+
234
+ /**
235
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
236
+ * tracks the *issuer* party's requirement because a response swaps the
237
+ * parties (§7.3 item 5).
238
+ */
239
+ export const RESPONSE_SPEC = {
240
+ typeUri: RESPONSE_TYPE_URI,
241
+ isBearer: false,
242
+ isProofRequired: true,
243
+ isRecipientRequired: true,
244
+ isIssuedAtRequired: true,
245
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
246
+ } as const;
@@ -0,0 +1,212 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/rooms/owner/invite/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { Ext } from "../../../../_shared/components.js";
7
+
8
+
9
+ export interface RoomsOwnerInvitePayload {
10
+ /**
11
+ * The room whose identity issues this credential. The recipient MUST hold a signing key for it — it is signing AS the room, not as itself.
12
+ */
13
+ roomId: string;
14
+ /**
15
+ * Which held key signs. Named explicitly rather than looked up from `roomId`, because nothing maps a DID to a key it was minted with and inventing that mapping would add a lifecycle to get wrong. A key that is not the room's produces a credential that fails to verify against the room's DID document — loud, and at the first use rather than later.
16
+ */
17
+ signingKeyId: string;
18
+ /**
19
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
20
+ */
21
+ ext?: Ext;
22
+ /**
23
+ * The party being invited. Named in the credential, which is why a VIC is single-use and why it is not presented on every access: presenting one would disclose the member.
24
+ */
25
+ subject: string;
26
+ /**
27
+ * When the invitation expires. An invitation that never expires is a standing right to enter, held by whoever ends up with the bytes.
28
+ */
29
+ validUntil?: string;
30
+ }
31
+ /**
32
+ * Success response to rooms/owner/invite. Type https://trusttasks.org/spec/rooms/owner/invite/0.1#response. The signed VIC, for delivery to the invitee.
33
+ */
34
+ export interface RoomsOwnerInviteResponsePayload {
35
+ /**
36
+ * The signed Verifiable Invitation Credential, serialised.
37
+ */
38
+ credential: string;
39
+ /**
40
+ * Its `id`. The owner tracks consumption by this on a `private` room, where a host-side invitation store would hand the host the membership at invite time.
41
+ */
42
+ credentialId: string;
43
+ ext?: Ext;
44
+ }
45
+
46
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
47
+ export type { Ext };
48
+
49
+ /** Trust Task type URI. */
50
+ export const TYPE_URI = "https://trusttasks.org/spec/rooms/owner/invite/0.1" as const;
51
+
52
+ /** Stable alias for this specification's request payload shape. */
53
+ export type Payload = RoomsOwnerInvitePayload;
54
+
55
+ /** Trust Task response type URI (request type URI + "#response"). */
56
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/rooms/owner/invite/0.1#response" as const;
57
+
58
+ /** Stable alias for this specification's success-response payload shape. */
59
+ export type Response = RoomsOwnerInviteResponsePayload;
60
+
61
+ /**
62
+ * This specification's payload schema, as a value.
63
+ *
64
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
65
+ * rather than only as a `.json` file because TypeScript types are erased
66
+ * at runtime: without a schema a consumer has nothing to validate, and
67
+ * every REQUIRED payload member is optional in practice. Cross-file
68
+ * `$ref`s are already inlined, so it needs no resolver.
69
+ */
70
+ export const PAYLOAD_SCHEMA = {
71
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
72
+ "$id": "https://trusttasks.org/spec/rooms/owner/invite/0.1",
73
+ "title": "Rooms Owner Invite — payload",
74
+ "type": "object",
75
+ "additionalProperties": false,
76
+ "required": [
77
+ "roomId",
78
+ "signingKeyId",
79
+ "subject"
80
+ ],
81
+ "properties": {
82
+ "roomId": {
83
+ "type": "string",
84
+ "description": "The room whose identity issues this credential. The recipient MUST hold a signing key for it — it is signing AS the room, not as itself."
85
+ },
86
+ "signingKeyId": {
87
+ "type": "string",
88
+ "maxLength": 256,
89
+ "description": "Which held key signs. Named explicitly rather than looked up from `roomId`, because nothing maps a DID to a key it was minted with and inventing that mapping would add a lifecycle to get wrong. A key that is not the room's produces a credential that fails to verify against the room's DID document — loud, and at the first use rather than later."
90
+ },
91
+ "ext": {
92
+ "$ref": "#/$defs/Ext",
93
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
94
+ },
95
+ "subject": {
96
+ "type": "string",
97
+ "description": "The party being invited. Named in the credential, which is why a VIC is single-use and why it is not presented on every access: presenting one would disclose the member."
98
+ },
99
+ "validUntil": {
100
+ "type": "string",
101
+ "format": "date-time",
102
+ "description": "When the invitation expires. An invitation that never expires is a standing right to enter, held by whoever ends up with the bytes."
103
+ }
104
+ },
105
+ "$defs": {
106
+ "Response": {
107
+ "$anchor": "response",
108
+ "title": "Rooms Owner Invite — response payload",
109
+ "description": "Success response to rooms/owner/invite. Type https://trusttasks.org/spec/rooms/owner/invite/0.1#response. The signed VIC, for delivery to the invitee.",
110
+ "type": "object",
111
+ "additionalProperties": false,
112
+ "required": [
113
+ "credential",
114
+ "credentialId"
115
+ ],
116
+ "properties": {
117
+ "credential": {
118
+ "type": "string",
119
+ "description": "The signed Verifiable Invitation Credential, serialised."
120
+ },
121
+ "credentialId": {
122
+ "type": "string",
123
+ "description": "Its `id`. The owner tracks consumption by this on a `private` room, where a host-side invitation store would hand the host the membership at invite time."
124
+ },
125
+ "ext": {
126
+ "$ref": "#/$defs/Ext"
127
+ }
128
+ }
129
+ },
130
+ "Ext": {
131
+ "title": "Ext",
132
+ "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.",
133
+ "type": "object",
134
+ "minProperties": 1,
135
+ "additionalProperties": true,
136
+ "propertyNames": {
137
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
138
+ }
139
+ }
140
+ }
141
+ } as const;
142
+
143
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
144
+ export const RESPONSE_PAYLOAD_SCHEMA = {
145
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
146
+ "$ref": "#/$defs/Response",
147
+ "$defs": {
148
+ "Response": {
149
+ "$anchor": "response",
150
+ "title": "Rooms Owner Invite — response payload",
151
+ "description": "Success response to rooms/owner/invite. Type https://trusttasks.org/spec/rooms/owner/invite/0.1#response. The signed VIC, for delivery to the invitee.",
152
+ "type": "object",
153
+ "additionalProperties": false,
154
+ "required": [
155
+ "credential",
156
+ "credentialId"
157
+ ],
158
+ "properties": {
159
+ "credential": {
160
+ "type": "string",
161
+ "description": "The signed Verifiable Invitation Credential, serialised."
162
+ },
163
+ "credentialId": {
164
+ "type": "string",
165
+ "description": "Its `id`. The owner tracks consumption by this on a `private` room, where a host-side invitation store would hand the host the membership at invite time."
166
+ },
167
+ "ext": {
168
+ "$ref": "#/$defs/Ext"
169
+ }
170
+ }
171
+ },
172
+ "Ext": {
173
+ "title": "Ext",
174
+ "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.",
175
+ "type": "object",
176
+ "minProperties": 1,
177
+ "additionalProperties": true,
178
+ "propertyNames": {
179
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
180
+ }
181
+ }
182
+ }
183
+ } as const;
184
+
185
+ /**
186
+ * SPEC.md §7.2 policy for the request variant, from this specification's
187
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
188
+ * per-specification and cannot be derived from the document alone, and
189
+ * item 2 needs the schema this carries.
190
+ */
191
+ export const SPEC = {
192
+ typeUri: TYPE_URI,
193
+ isBearer: false,
194
+ isProofRequired: true,
195
+ isRecipientRequired: true,
196
+ isIssuedAtRequired: true,
197
+ payloadSchema: PAYLOAD_SCHEMA,
198
+ } as const;
199
+
200
+ /**
201
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
202
+ * tracks the *issuer* party's requirement because a response swaps the
203
+ * parties (§7.3 item 5).
204
+ */
205
+ export const RESPONSE_SPEC = {
206
+ typeUri: RESPONSE_TYPE_URI,
207
+ isBearer: false,
208
+ isProofRequired: true,
209
+ isRecipientRequired: true,
210
+ isIssuedAtRequired: true,
211
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
212
+ } as const;