@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,278 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/rooms/owner/register/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { Ext, RetentionPolicy, Visibility } from "../../../../_shared/components.js";
7
+
8
+
9
+ export interface RoomsOwnerRegisterPayload {
10
+ /**
11
+ * The room being registered. Its identity exists already — this asks a host to store it, not to name it.
12
+ */
13
+ roomId: string;
14
+ /**
15
+ * The host to register with, as a DID. Named by the caller because a room has no host until this call succeeds, and because a room may be registered with more than one (a mirror serves reads while its primary takes writes).
16
+ */
17
+ host: string;
18
+ /**
19
+ * The tier to create the room at. Passed through to `rooms/create`, whose description of the choice governs.
20
+ */
21
+ visibility: Visibility;
22
+ /**
23
+ * The accountable party. Absent means the caller — a registration is normally made by the owner it names, and defaulting saves a surface repeating the DID it just authenticated as. Present and different is legitimate: an operator registering on behalf of the party who will answer for the room.
24
+ */
25
+ ownerDid?: string;
26
+ /**
27
+ * Whether the room keeps its history readable across a membership change. Immutable once set, so a caller that omits it is taking the host's default for the life of the room.
28
+ */
29
+ retentionPolicy?: RetentionPolicy;
30
+ /**
31
+ * How long the host is asked to hold the room after it lapses.
32
+ */
33
+ retentionDays?: number;
34
+ /**
35
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
36
+ */
37
+ ext?: Ext;
38
+ }
39
+ /**
40
+ * Success response to rooms/owner/register. Type https://trusttasks.org/spec/rooms/owner/register/0.1#response.
41
+ */
42
+ export interface RoomsOwnerRegisterResponsePayload {
43
+ roomId: string;
44
+ /**
45
+ * The host that accepted it, echoed so a caller recording where its room lives records what the recipient actually reached rather than what it asked for.
46
+ */
47
+ host: string;
48
+ /**
49
+ * The epoch the room now stands at, as the host reports it. `1` for a room registered for the first time.
50
+ */
51
+ epoch: number;
52
+ ext?: Ext;
53
+ }
54
+
55
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
56
+ export type { Ext, RetentionPolicy, Visibility };
57
+
58
+ /** Trust Task type URI. */
59
+ export const TYPE_URI = "https://trusttasks.org/spec/rooms/owner/register/0.1" as const;
60
+
61
+ /** Stable alias for this specification's request payload shape. */
62
+ export type Payload = RoomsOwnerRegisterPayload;
63
+
64
+ /** Trust Task response type URI (request type URI + "#response"). */
65
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/rooms/owner/register/0.1#response" as const;
66
+
67
+ /** Stable alias for this specification's success-response payload shape. */
68
+ export type Response = RoomsOwnerRegisterResponsePayload;
69
+
70
+ /**
71
+ * This specification's payload schema, as a value.
72
+ *
73
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
74
+ * rather than only as a `.json` file because TypeScript types are erased
75
+ * at runtime: without a schema a consumer has nothing to validate, and
76
+ * every REQUIRED payload member is optional in practice. Cross-file
77
+ * `$ref`s are already inlined, so it needs no resolver.
78
+ */
79
+ export const PAYLOAD_SCHEMA = {
80
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
81
+ "$id": "https://trusttasks.org/spec/rooms/owner/register/0.1",
82
+ "title": "Rooms Owner Register — payload",
83
+ "type": "object",
84
+ "additionalProperties": false,
85
+ "required": [
86
+ "roomId",
87
+ "host",
88
+ "visibility"
89
+ ],
90
+ "properties": {
91
+ "roomId": {
92
+ "type": "string",
93
+ "description": "The room being registered. Its identity exists already — this asks a host to store it, not to name it."
94
+ },
95
+ "host": {
96
+ "type": "string",
97
+ "description": "The host to register with, as a DID. Named by the caller because a room has no host until this call succeeds, and because a room may be registered with more than one (a mirror serves reads while its primary takes writes)."
98
+ },
99
+ "visibility": {
100
+ "$ref": "#/$defs/Visibility",
101
+ "description": "The tier to create the room at. Passed through to `rooms/create`, whose description of the choice governs."
102
+ },
103
+ "ownerDid": {
104
+ "type": "string",
105
+ "description": "The accountable party. Absent means the caller — a registration is normally made by the owner it names, and defaulting saves a surface repeating the DID it just authenticated as. Present and different is legitimate: an operator registering on behalf of the party who will answer for the room."
106
+ },
107
+ "retentionPolicy": {
108
+ "$ref": "#/$defs/RetentionPolicy",
109
+ "description": "Whether the room keeps its history readable across a membership change. Immutable once set, so a caller that omits it is taking the host's default for the life of the room."
110
+ },
111
+ "retentionDays": {
112
+ "type": "integer",
113
+ "minimum": 1,
114
+ "description": "How long the host is asked to hold the room after it lapses."
115
+ },
116
+ "ext": {
117
+ "$ref": "#/$defs/Ext",
118
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
119
+ }
120
+ },
121
+ "$defs": {
122
+ "Response": {
123
+ "$anchor": "response",
124
+ "title": "Rooms Owner Register — response payload",
125
+ "description": "Success response to rooms/owner/register. Type https://trusttasks.org/spec/rooms/owner/register/0.1#response.",
126
+ "type": "object",
127
+ "additionalProperties": false,
128
+ "required": [
129
+ "roomId",
130
+ "host",
131
+ "epoch"
132
+ ],
133
+ "properties": {
134
+ "roomId": {
135
+ "type": "string"
136
+ },
137
+ "host": {
138
+ "type": "string",
139
+ "description": "The host that accepted it, echoed so a caller recording where its room lives records what the recipient actually reached rather than what it asked for."
140
+ },
141
+ "epoch": {
142
+ "type": "integer",
143
+ "minimum": 1,
144
+ "description": "The epoch the room now stands at, as the host reports it. `1` for a room registered for the first time."
145
+ },
146
+ "ext": {
147
+ "$ref": "#/$defs/Ext"
148
+ }
149
+ }
150
+ },
151
+ "Ext": {
152
+ "title": "Ext",
153
+ "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.",
154
+ "type": "object",
155
+ "minProperties": 1,
156
+ "additionalProperties": true,
157
+ "propertyNames": {
158
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
159
+ }
160
+ },
161
+ "RetentionPolicy": {
162
+ "title": "RetentionPolicy",
163
+ "type": "string",
164
+ "enum": [
165
+ "chained",
166
+ "fromJoin"
167
+ ],
168
+ "description": "Whether a room keeps its history readable across a membership change, fixed at creation and immutable thereafter — like `Visibility`, and for the same reason: the rungs of an epoch key chain either exist for an epoch or they do not, and no later change of mind can seal key material that was never sealed or unseal what was already severed. `chained`: each advance produces an `EpochLink`, so every member reads the room's whole retained history however long they have been in it — what a **library** wants, at the cost of post-compromise security for record content, since a compromised current key then reaches every retained epoch. `fromJoin`: no rungs are produced, so a member reads only from the epoch their group state is at — what a **stream** wants, and what a room under a strict forward-secrecy obligation wants, at the cost that a joining member finds an empty-looking room and nobody can reread a record once their group state has moved past the epoch it was sealed under. Absent means `chained`; see the prose on why the absent case is the readable one.",
169
+ "$comment": "Deliberately no JSON Schema `default`. A declared default is materialised by the generated bindings — the member becomes non-optional with a serde default — so an absent value would reappear as an explicit one on re-serialisation and break round-trip idempotence for every document written before this member existed. The meaning of absence is stated in prose, where a binding cannot act on it."
170
+ },
171
+ "Visibility": {
172
+ "title": "Visibility",
173
+ "type": "string",
174
+ "enum": [
175
+ "open",
176
+ "attributed",
177
+ "private"
178
+ ],
179
+ "description": "How much of a room its host can see, fixed at creation and immutable thereafter. `open`: records are cleartext, searchable and fully audited. `attributed`: record content is sealed, and the host still learns which member acted. `private`: content is sealed and membership is presented in zero knowledge, so the host verifies that a member acted without learning which. Immutable because a downgrade cannot un-see cleartext and an upgrade would protect only what came after while presenting as though it protected everything."
180
+ }
181
+ }
182
+ } as const;
183
+
184
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
185
+ export const RESPONSE_PAYLOAD_SCHEMA = {
186
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
187
+ "$ref": "#/$defs/Response",
188
+ "$defs": {
189
+ "Response": {
190
+ "$anchor": "response",
191
+ "title": "Rooms Owner Register — response payload",
192
+ "description": "Success response to rooms/owner/register. Type https://trusttasks.org/spec/rooms/owner/register/0.1#response.",
193
+ "type": "object",
194
+ "additionalProperties": false,
195
+ "required": [
196
+ "roomId",
197
+ "host",
198
+ "epoch"
199
+ ],
200
+ "properties": {
201
+ "roomId": {
202
+ "type": "string"
203
+ },
204
+ "host": {
205
+ "type": "string",
206
+ "description": "The host that accepted it, echoed so a caller recording where its room lives records what the recipient actually reached rather than what it asked for."
207
+ },
208
+ "epoch": {
209
+ "type": "integer",
210
+ "minimum": 1,
211
+ "description": "The epoch the room now stands at, as the host reports it. `1` for a room registered for the first time."
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
+ "RetentionPolicy": {
229
+ "title": "RetentionPolicy",
230
+ "type": "string",
231
+ "enum": [
232
+ "chained",
233
+ "fromJoin"
234
+ ],
235
+ "description": "Whether a room keeps its history readable across a membership change, fixed at creation and immutable thereafter — like `Visibility`, and for the same reason: the rungs of an epoch key chain either exist for an epoch or they do not, and no later change of mind can seal key material that was never sealed or unseal what was already severed. `chained`: each advance produces an `EpochLink`, so every member reads the room's whole retained history however long they have been in it — what a **library** wants, at the cost of post-compromise security for record content, since a compromised current key then reaches every retained epoch. `fromJoin`: no rungs are produced, so a member reads only from the epoch their group state is at — what a **stream** wants, and what a room under a strict forward-secrecy obligation wants, at the cost that a joining member finds an empty-looking room and nobody can reread a record once their group state has moved past the epoch it was sealed under. Absent means `chained`; see the prose on why the absent case is the readable one.",
236
+ "$comment": "Deliberately no JSON Schema `default`. A declared default is materialised by the generated bindings — the member becomes non-optional with a serde default — so an absent value would reappear as an explicit one on re-serialisation and break round-trip idempotence for every document written before this member existed. The meaning of absence is stated in prose, where a binding cannot act on it."
237
+ },
238
+ "Visibility": {
239
+ "title": "Visibility",
240
+ "type": "string",
241
+ "enum": [
242
+ "open",
243
+ "attributed",
244
+ "private"
245
+ ],
246
+ "description": "How much of a room its host can see, fixed at creation and immutable thereafter. `open`: records are cleartext, searchable and fully audited. `attributed`: record content is sealed, and the host still learns which member acted. `private`: content is sealed and membership is presented in zero knowledge, so the host verifies that a member acted without learning which. Immutable because a downgrade cannot un-see cleartext and an upgrade would protect only what came after while presenting as though it protected everything."
247
+ }
248
+ }
249
+ } as const;
250
+
251
+ /**
252
+ * SPEC.md §7.2 policy for the request variant, from this specification's
253
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
254
+ * per-specification and cannot be derived from the document alone, and
255
+ * item 2 needs the schema this carries.
256
+ */
257
+ export const SPEC = {
258
+ typeUri: TYPE_URI,
259
+ isBearer: false,
260
+ isProofRequired: true,
261
+ isRecipientRequired: true,
262
+ isIssuedAtRequired: true,
263
+ payloadSchema: PAYLOAD_SCHEMA,
264
+ } as const;
265
+
266
+ /**
267
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
268
+ * tracks the *issuer* party's requirement because a response swaps the
269
+ * parties (§7.3 item 5).
270
+ */
271
+ export const RESPONSE_SPEC = {
272
+ typeUri: RESPONSE_TYPE_URI,
273
+ isBearer: false,
274
+ isProofRequired: true,
275
+ isRecipientRequired: true,
276
+ isIssuedAtRequired: true,
277
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
278
+ } as const;