@openvtc/trust-tasks 0.26.1 → 0.26.2
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 +142 -0
- package/dist/_shared/components.d.ts +107 -1
- package/dist/_shared/components.d.ts.map +1 -1
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -1
- package/dist/rooms/owner/group/add/0.1/payload.d.ts +417 -0
- package/dist/rooms/owner/group/add/0.1/payload.d.ts.map +1 -0
- package/dist/rooms/owner/group/add/0.1/payload.js +218 -0
- package/dist/rooms/owner/group/add/0.1/payload.js.map +1 -0
- package/dist/rooms/owner/group/create/0.1/payload.d.ts +299 -0
- package/dist/rooms/owner/group/create/0.1/payload.d.ts.map +1 -0
- package/dist/rooms/owner/group/create/0.1/payload.js +163 -0
- package/dist/rooms/owner/group/create/0.1/payload.js.map +1 -0
- package/dist/rooms/owner/group/remove/0.1/payload.d.ts +343 -0
- package/dist/rooms/owner/group/remove/0.1/payload.d.ts.map +1 -0
- package/dist/rooms/owner/group/remove/0.1/payload.js +184 -0
- package/dist/rooms/owner/group/remove/0.1/payload.js.map +1 -0
- package/dist/rooms/owner/register/0.1/payload.d.ts +3 -3
- package/dist/rooms/owner/register/0.1/payload.js +1 -1
- package/dist/rooms/owner/register/0.1/payload.js.map +1 -1
- package/dist/vtc/_shared/0.1/community-room.d.ts +16 -0
- package/dist/vtc/_shared/0.1/community-room.d.ts.map +1 -0
- package/dist/vtc/_shared/0.1/community-room.js +6 -0
- package/dist/vtc/_shared/0.1/community-room.js.map +1 -0
- package/dist/vtc/admin/events/_shared/0.1/topic.d.ts +1 -1
- package/dist/vtc/admin/events/_shared/0.1/topic.d.ts.map +1 -1
- package/dist/vtc/admin/events/_shared/0.2/topic.d.ts +28 -0
- package/dist/vtc/admin/events/_shared/0.2/topic.d.ts.map +1 -0
- package/dist/vtc/admin/events/_shared/0.2/topic.js +6 -0
- package/dist/vtc/admin/events/_shared/0.2/topic.js.map +1 -0
- package/dist/vtc/admin/events/event/0.1/payload.d.ts +1 -1
- package/dist/vtc/admin/events/event/0.1/payload.d.ts.map +1 -1
- package/dist/vtc/admin/events/event/0.2/payload.d.ts +172 -0
- package/dist/vtc/admin/events/event/0.2/payload.d.ts.map +1 -0
- package/dist/vtc/admin/events/event/0.2/payload.js +100 -0
- package/dist/vtc/admin/events/event/0.2/payload.js.map +1 -0
- package/dist/vtc/admin/events/subscribe/0.1/payload.d.ts +1 -1
- package/dist/vtc/admin/events/subscribe/0.1/payload.d.ts.map +1 -1
- package/dist/vtc/admin/events/subscribe/0.2/payload.d.ts +409 -0
- package/dist/vtc/admin/events/subscribe/0.2/payload.d.ts.map +1 -0
- package/dist/vtc/admin/events/subscribe/0.2/payload.js +232 -0
- package/dist/vtc/admin/events/subscribe/0.2/payload.js.map +1 -0
- package/dist/vtc/rooms/community/create/0.1/payload.d.ts +789 -0
- package/dist/vtc/rooms/community/create/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/rooms/community/create/0.1/payload.js +463 -0
- package/dist/vtc/rooms/community/create/0.1/payload.js.map +1 -0
- package/dist/vtc/rooms/community/get/0.1/payload.d.ts +711 -0
- package/dist/vtc/rooms/community/get/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/rooms/community/get/0.1/payload.js +429 -0
- package/dist/vtc/rooms/community/get/0.1/payload.js.map +1 -0
- package/dist/vtc/rooms/community/list/0.1/payload.d.ts +772 -0
- package/dist/vtc/rooms/community/list/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/rooms/community/list/0.1/payload.js +452 -0
- package/dist/vtc/rooms/community/list/0.1/payload.js.map +1 -0
- package/dist/vtc/rooms/community/members/add/0.1/payload.d.ts +535 -0
- package/dist/vtc/rooms/community/members/add/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/rooms/community/members/add/0.1/payload.js +314 -0
- package/dist/vtc/rooms/community/members/add/0.1/payload.js.map +1 -0
- package/dist/vtc/rooms/community/members/list/0.1/payload.d.ts +554 -0
- package/dist/vtc/rooms/community/members/list/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/rooms/community/members/list/0.1/payload.js +315 -0
- package/dist/vtc/rooms/community/members/list/0.1/payload.js.map +1 -0
- package/dist/vtc/rooms/community/members/remove/0.1/payload.d.ts +533 -0
- package/dist/vtc/rooms/community/members/remove/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/rooms/community/members/remove/0.1/payload.js +313 -0
- package/dist/vtc/rooms/community/members/remove/0.1/payload.js.map +1 -0
- package/dist/vtc/rooms/offers/accept/0.1/payload.d.ts +349 -0
- package/dist/vtc/rooms/offers/accept/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/rooms/offers/accept/0.1/payload.js +188 -0
- package/dist/vtc/rooms/offers/accept/0.1/payload.js.map +1 -0
- package/dist/vtc/rooms/offers/list/0.1/payload.d.ts +692 -0
- package/dist/vtc/rooms/offers/list/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/rooms/offers/list/0.1/payload.js +408 -0
- package/dist/vtc/rooms/offers/list/0.1/payload.js.map +1 -0
- package/package.json +1 -1
- package/src/_shared/components.ts +120 -1
- package/src/index.ts +15 -0
- package/src/rooms/owner/group/add/0.1/payload.ts +288 -0
- package/src/rooms/owner/group/create/0.1/payload.ts +213 -0
- package/src/rooms/owner/group/remove/0.1/payload.ts +242 -0
- package/src/rooms/owner/register/0.1/payload.ts +2 -2
- package/src/vtc/_shared/0.1/community-room.ts +17 -0
- package/src/vtc/admin/events/_shared/0.1/topic.ts +1 -1
- package/src/vtc/admin/events/_shared/0.2/topic.ts +29 -0
- package/src/vtc/admin/events/event/0.1/payload.ts +1 -1
- package/src/vtc/admin/events/event/0.2/payload.ts +134 -0
- package/src/vtc/admin/events/subscribe/0.1/payload.ts +1 -1
- package/src/vtc/admin/events/subscribe/0.2/payload.ts +306 -0
- package/src/vtc/rooms/community/create/0.1/payload.ts +509 -0
- package/src/vtc/rooms/community/get/0.1/payload.ts +461 -0
- package/src/vtc/rooms/community/list/0.1/payload.ts +495 -0
- package/src/vtc/rooms/community/members/add/0.1/payload.ts +356 -0
- package/src/vtc/rooms/community/members/list/0.1/payload.ts +366 -0
- package/src/vtc/rooms/community/members/remove/0.1/payload.ts +351 -0
- package/src/vtc/rooms/offers/accept/0.1/payload.ts +240 -0
- package/src/vtc/rooms/offers/list/0.1/payload.ts +451 -0
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/rooms/owner/group/remove/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { Ext } from "../../../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export interface RoomsOwnerGroupRemovePayload {
|
|
10
|
+
/**
|
|
11
|
+
* The room whose group loses a member. The recipient MUST hold its group.
|
|
12
|
+
*/
|
|
13
|
+
roomId: string;
|
|
14
|
+
/**
|
|
15
|
+
* The room's host, as a DID: where the room's epoch advances.
|
|
16
|
+
*/
|
|
17
|
+
host: string;
|
|
18
|
+
/**
|
|
19
|
+
* The DID whose leaf is removed. Never the recipient's own leaf.
|
|
20
|
+
*/
|
|
21
|
+
member: string;
|
|
22
|
+
/**
|
|
23
|
+
* Why, carried to the host's epoch advance. Untrusted and attributed to its author: it MUST NOT carry personal data or a credential.
|
|
24
|
+
*/
|
|
25
|
+
reason?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Ecosystem-defined extension members per SPEC.md §4.5.1.
|
|
28
|
+
*/
|
|
29
|
+
ext?: Ext;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Success response to rooms/owner/group/remove. Type https://trusttasks.org/spec/rooms/owner/group/remove/0.1#response. The room's new epoch, which the removed member holds no key for.
|
|
33
|
+
*/
|
|
34
|
+
export interface RoomsOwnerGroupRemoveResponsePayload {
|
|
35
|
+
/**
|
|
36
|
+
* The room.
|
|
37
|
+
*/
|
|
38
|
+
roomId: string;
|
|
39
|
+
/**
|
|
40
|
+
* Who was removed.
|
|
41
|
+
*/
|
|
42
|
+
member: string;
|
|
43
|
+
/**
|
|
44
|
+
* The room epoch after the removal, as the host recorded it.
|
|
45
|
+
*/
|
|
46
|
+
epoch: number;
|
|
47
|
+
ext?: Ext;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
51
|
+
export type { Ext };
|
|
52
|
+
|
|
53
|
+
/** Trust Task type URI. */
|
|
54
|
+
export const TYPE_URI = "https://trusttasks.org/spec/rooms/owner/group/remove/0.1" as const;
|
|
55
|
+
|
|
56
|
+
/** Stable alias for this specification's request payload shape. */
|
|
57
|
+
export type Payload = RoomsOwnerGroupRemovePayload;
|
|
58
|
+
|
|
59
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
60
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/rooms/owner/group/remove/0.1#response" as const;
|
|
61
|
+
|
|
62
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
63
|
+
export type Response = RoomsOwnerGroupRemoveResponsePayload;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* This specification's payload schema, as a value.
|
|
67
|
+
*
|
|
68
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
69
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
70
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
71
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
72
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
73
|
+
*/
|
|
74
|
+
export const PAYLOAD_SCHEMA = {
|
|
75
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
76
|
+
"$id": "https://trusttasks.org/spec/rooms/owner/group/remove/0.1",
|
|
77
|
+
"title": "Rooms Owner Group Remove — payload",
|
|
78
|
+
"type": "object",
|
|
79
|
+
"additionalProperties": false,
|
|
80
|
+
"required": [
|
|
81
|
+
"roomId",
|
|
82
|
+
"host",
|
|
83
|
+
"member"
|
|
84
|
+
],
|
|
85
|
+
"properties": {
|
|
86
|
+
"roomId": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"minLength": 1,
|
|
89
|
+
"maxLength": 512,
|
|
90
|
+
"description": "The room whose group loses a member. The recipient MUST hold its group."
|
|
91
|
+
},
|
|
92
|
+
"host": {
|
|
93
|
+
"type": "string",
|
|
94
|
+
"pattern": "^did:",
|
|
95
|
+
"maxLength": 2048,
|
|
96
|
+
"description": "The room's host, as a DID: where the room's epoch advances."
|
|
97
|
+
},
|
|
98
|
+
"member": {
|
|
99
|
+
"type": "string",
|
|
100
|
+
"pattern": "^did:",
|
|
101
|
+
"maxLength": 2048,
|
|
102
|
+
"description": "The DID whose leaf is removed. Never the recipient's own leaf."
|
|
103
|
+
},
|
|
104
|
+
"reason": {
|
|
105
|
+
"type": "string",
|
|
106
|
+
"minLength": 1,
|
|
107
|
+
"maxLength": 500,
|
|
108
|
+
"description": "Why, carried to the host's epoch advance. Untrusted and attributed to its author: it MUST NOT carry personal data or a credential."
|
|
109
|
+
},
|
|
110
|
+
"ext": {
|
|
111
|
+
"$ref": "#/$defs/Ext",
|
|
112
|
+
"description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"$defs": {
|
|
116
|
+
"Response": {
|
|
117
|
+
"$anchor": "response",
|
|
118
|
+
"title": "Rooms Owner Group Remove — response payload",
|
|
119
|
+
"description": "Success response to rooms/owner/group/remove. Type https://trusttasks.org/spec/rooms/owner/group/remove/0.1#response. The room's new epoch, which the removed member holds no key for.",
|
|
120
|
+
"type": "object",
|
|
121
|
+
"additionalProperties": false,
|
|
122
|
+
"required": [
|
|
123
|
+
"roomId",
|
|
124
|
+
"member",
|
|
125
|
+
"epoch"
|
|
126
|
+
],
|
|
127
|
+
"properties": {
|
|
128
|
+
"roomId": {
|
|
129
|
+
"type": "string",
|
|
130
|
+
"minLength": 1,
|
|
131
|
+
"maxLength": 512,
|
|
132
|
+
"description": "The room."
|
|
133
|
+
},
|
|
134
|
+
"member": {
|
|
135
|
+
"type": "string",
|
|
136
|
+
"pattern": "^did:",
|
|
137
|
+
"maxLength": 2048,
|
|
138
|
+
"description": "Who was removed."
|
|
139
|
+
},
|
|
140
|
+
"epoch": {
|
|
141
|
+
"type": "integer",
|
|
142
|
+
"minimum": 2,
|
|
143
|
+
"description": "The room epoch after the removal, as the host recorded it."
|
|
144
|
+
},
|
|
145
|
+
"ext": {
|
|
146
|
+
"$ref": "#/$defs/Ext"
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"Ext": {
|
|
151
|
+
"title": "Ext",
|
|
152
|
+
"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.",
|
|
153
|
+
"type": "object",
|
|
154
|
+
"minProperties": 1,
|
|
155
|
+
"additionalProperties": true,
|
|
156
|
+
"propertyNames": {
|
|
157
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
} as const;
|
|
162
|
+
|
|
163
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
164
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
165
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
166
|
+
"$ref": "#/$defs/Response",
|
|
167
|
+
"$defs": {
|
|
168
|
+
"Response": {
|
|
169
|
+
"$anchor": "response",
|
|
170
|
+
"title": "Rooms Owner Group Remove — response payload",
|
|
171
|
+
"description": "Success response to rooms/owner/group/remove. Type https://trusttasks.org/spec/rooms/owner/group/remove/0.1#response. The room's new epoch, which the removed member holds no key for.",
|
|
172
|
+
"type": "object",
|
|
173
|
+
"additionalProperties": false,
|
|
174
|
+
"required": [
|
|
175
|
+
"roomId",
|
|
176
|
+
"member",
|
|
177
|
+
"epoch"
|
|
178
|
+
],
|
|
179
|
+
"properties": {
|
|
180
|
+
"roomId": {
|
|
181
|
+
"type": "string",
|
|
182
|
+
"minLength": 1,
|
|
183
|
+
"maxLength": 512,
|
|
184
|
+
"description": "The room."
|
|
185
|
+
},
|
|
186
|
+
"member": {
|
|
187
|
+
"type": "string",
|
|
188
|
+
"pattern": "^did:",
|
|
189
|
+
"maxLength": 2048,
|
|
190
|
+
"description": "Who was removed."
|
|
191
|
+
},
|
|
192
|
+
"epoch": {
|
|
193
|
+
"type": "integer",
|
|
194
|
+
"minimum": 2,
|
|
195
|
+
"description": "The room epoch after the removal, as the host recorded it."
|
|
196
|
+
},
|
|
197
|
+
"ext": {
|
|
198
|
+
"$ref": "#/$defs/Ext"
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
"Ext": {
|
|
203
|
+
"title": "Ext",
|
|
204
|
+
"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.",
|
|
205
|
+
"type": "object",
|
|
206
|
+
"minProperties": 1,
|
|
207
|
+
"additionalProperties": true,
|
|
208
|
+
"propertyNames": {
|
|
209
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
} as const;
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
217
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
218
|
+
* per-specification and cannot be derived from the document alone, and
|
|
219
|
+
* item 2 needs the schema this carries.
|
|
220
|
+
*/
|
|
221
|
+
export const SPEC = {
|
|
222
|
+
typeUri: TYPE_URI,
|
|
223
|
+
isBearer: false,
|
|
224
|
+
isProofRequired: true,
|
|
225
|
+
isRecipientRequired: true,
|
|
226
|
+
isIssuedAtRequired: true,
|
|
227
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
228
|
+
} as const;
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
232
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
233
|
+
* parties (§7.3 item 5).
|
|
234
|
+
*/
|
|
235
|
+
export const RESPONSE_SPEC = {
|
|
236
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
237
|
+
isBearer: false,
|
|
238
|
+
isProofRequired: true,
|
|
239
|
+
isRecipientRequired: true,
|
|
240
|
+
isIssuedAtRequired: true,
|
|
241
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
242
|
+
} as const;
|
|
@@ -20,7 +20,7 @@ export interface RoomsOwnerRegisterPayload {
|
|
|
20
20
|
*/
|
|
21
21
|
visibility: Visibility;
|
|
22
22
|
/**
|
|
23
|
-
* The accountable party
|
|
23
|
+
* The accountable party, and the issuer of the rooms/create document the recipient sends on its behalf: the recipient signs it with a key of this DID that it holds, never as itself. Absent means the caller — a registration is normally made by the owner it names. A recipient holding no key for it refuses with permissionDenied before contacting the host.
|
|
24
24
|
*/
|
|
25
25
|
ownerDid?: string;
|
|
26
26
|
/**
|
|
@@ -102,7 +102,7 @@ export const PAYLOAD_SCHEMA = {
|
|
|
102
102
|
},
|
|
103
103
|
"ownerDid": {
|
|
104
104
|
"type": "string",
|
|
105
|
-
"description": "The accountable party
|
|
105
|
+
"description": "The accountable party, and the issuer of the rooms/create document the recipient sends on its behalf: the recipient signs it with a key of this DID that it holds, never as itself. Absent means the caller — a registration is normally made by the owner it names. A recipient holding no key for it refuses with permissionDenied before contacting the host."
|
|
106
106
|
},
|
|
107
107
|
"retentionPolicy": {
|
|
108
108
|
"$ref": "#/$defs/RetentionPolicy",
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vtc/_shared/0.1/community-room.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Shared types for rooms a community owns rather than merely hosts: the vtc/rooms/community/* tasks an administrator runs them with, and the vtc/rooms/offers/* tasks a member collects and accepts an admission with. The community is the room's owner; the community's own VTA holds the room's signing key and, on a sealed tier, the community's place in its MLS group. The community holds no room key and no group secret. What it records here is the owner's own record of whom it admitted — never read when the community serves the room as its host, where authorization is the room's credential chain and nothing else. Not itself a Trust Task specification (the `_shared` folder is skipped by the registry build and the codegen).
|
|
8
|
+
*/
|
|
9
|
+
export interface VTCSharedCommunityOwnedRoomDefinitions {
|
|
10
|
+
[k: string]: unknown | undefined;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The definitions this shared schema publishes, hoisted to one declaration each.
|
|
15
|
+
* See "../../../_shared/components.js".
|
|
16
|
+
*/
|
|
17
|
+
export type { CommunityRoom, MemberAction, MemberActions, MemberState, Offer, OfferCredentials, Reason, RoomLabel, RoomMember } from "../../../_shared/components.js";
|
|
@@ -25,4 +25,4 @@ export interface VTCAdminEventsSharedDefinitions {
|
|
|
25
25
|
* The definitions this shared schema publishes, hoisted to one declaration each.
|
|
26
26
|
* See "../../../../../_shared/components.js".
|
|
27
27
|
*/
|
|
28
|
-
export type { ResumeToken, Topic } from "../../../../../_shared/components.js";
|
|
28
|
+
export type { ResumeToken, Topic_VtcAdminEventsV0_1 as Topic } from "../../../../../_shared/components.js";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vtc/admin/events/_shared/0.2/topic.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Shared shapes for a Verifiable Trust Community's live administrative console events: a hint-only channel that tells an administrator's console WHEN to re-read, never WHAT changed.
|
|
8
|
+
*
|
|
9
|
+
* THE MODEL. A console subscribes once per session with `vtc/admin/events/subscribe`, naming the topics it renders. The community answers with a stream of `vtc/admin/events/event` documents, each naming one topic and, for a count topic, the caller's current count. An event carries no record and no personal data. The console reacts by re-fetching the topic's own signed read, so the read stays the only place authorization is decided and the only place data leaves the community: the stream can neither leak a record nor grant a read. Polling those reads remains the fallback whenever the stream is down.
|
|
10
|
+
*
|
|
11
|
+
* TOPICS AND THEIR READS. Each topic names one read. A community sends a topic's events only to a caller it would answer on that read.
|
|
12
|
+
*
|
|
13
|
+
* - `actions` — the caller's visible administrative actions (`vtc/admin/actions/list`). Count topic: the caller's `waitingForMe` count.
|
|
14
|
+
* - `acknowledgements` — the acknowledge-category actions awaiting the caller (`vtc/admin/actions/list`). Count topic: the open acknowledge actions the caller has not yet acknowledged.
|
|
15
|
+
* - `joinRequests` — the community's join requests (`vtc/join-requests/list`). Count topic: the join requests awaiting a decision.
|
|
16
|
+
* - `members` — the community's members (`vtc/members/list`). No count.
|
|
17
|
+
* - `singleAdminMode` — whether single-administrator mode is in effect. Every administrator may read it. No count.
|
|
18
|
+
* - `config` — the community's stored configuration (`vtc/config/export`). No count.
|
|
19
|
+
* - `rooms` — the rooms this community hosts and where their files are kept (`vtc/rooms/list`, `vtc/rooms/usage`, `vtc/storage/configs/list`), for holders of `vtc.rooms.admin`. No count. Added in 0.2.
|
|
20
|
+
*/
|
|
21
|
+
export interface VTCAdminEventsSharedDefinitions {
|
|
22
|
+
[k: string]: unknown | undefined;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The definitions this shared schema publishes, hoisted to one declaration each.
|
|
27
|
+
* See "../../../../../_shared/components.js".
|
|
28
|
+
*/
|
|
29
|
+
export type { ResumeToken, Topic_VtcAdminEventsV0_2 as Topic } from "../../../../../_shared/components.js";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Source: specs/vtc/admin/events/event/0.1/payload.schema.json
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type { Ext, ResumeToken, Topic } from "../../../../../_shared/components.js";
|
|
6
|
+
import type { Ext, ResumeToken, Topic_VtcAdminEventsV0_1 as Topic } from "../../../../../_shared/components.js";
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vtc/admin/events/event/0.2/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { Ext, ResumeToken, Topic_VtcAdminEventsV0_2 as Topic } from "../../../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* One hint, sent by a Verifiable Trust Community down an administrator console's live channel: something under `topic` changed, re-read it. It never carries the record that changed. Fire-and-forget: there is no response. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.
|
|
11
|
+
*/
|
|
12
|
+
export interface VTCAdminEventsEventPayload {
|
|
13
|
+
/**
|
|
14
|
+
* What changed. Always one of the effective topics the subscribe response named.
|
|
15
|
+
*/
|
|
16
|
+
topic: Topic;
|
|
17
|
+
/**
|
|
18
|
+
* When the community observed the change. Where it coalesced several changes into this hint, the latest of them.
|
|
19
|
+
*/
|
|
20
|
+
at: string;
|
|
21
|
+
/**
|
|
22
|
+
* Only on a count topic (`actions`, `acknowledgements`, `joinRequests`): the caller's current count for that topic as of `at` — what a console badge shows. Absent on every other topic. A console MAY show it until its re-fetch returns, and MUST prefer the read's own count once it does.
|
|
23
|
+
*/
|
|
24
|
+
count?: number;
|
|
25
|
+
/**
|
|
26
|
+
* The stream position after this hint. A console keeps the latest one and passes it back as `since` when it re-subscribes.
|
|
27
|
+
*/
|
|
28
|
+
resumeToken: ResumeToken;
|
|
29
|
+
ext?: Ext;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
33
|
+
export type { Ext, ResumeToken, Topic };
|
|
34
|
+
|
|
35
|
+
/** Trust Task type URI. */
|
|
36
|
+
export const TYPE_URI = "https://trusttasks.org/spec/vtc/admin/events/event/0.2" as const;
|
|
37
|
+
|
|
38
|
+
/** Stable alias for this specification's request payload shape. */
|
|
39
|
+
export type Payload = VTCAdminEventsEventPayload;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* This specification's payload schema, as a value.
|
|
43
|
+
*
|
|
44
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
45
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
46
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
47
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
48
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
49
|
+
*/
|
|
50
|
+
export const PAYLOAD_SCHEMA = {
|
|
51
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
52
|
+
"$id": "https://trusttasks.org/spec/vtc/admin/events/event/0.2",
|
|
53
|
+
"title": "VTC Admin Events — Event — payload",
|
|
54
|
+
"description": "One hint, sent by a Verifiable Trust Community down an administrator console's live channel: something under `topic` changed, re-read it. It never carries the record that changed. Fire-and-forget: there is no response. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.",
|
|
55
|
+
"type": "object",
|
|
56
|
+
"additionalProperties": false,
|
|
57
|
+
"required": [
|
|
58
|
+
"topic",
|
|
59
|
+
"at",
|
|
60
|
+
"resumeToken"
|
|
61
|
+
],
|
|
62
|
+
"properties": {
|
|
63
|
+
"topic": {
|
|
64
|
+
"$ref": "#/$defs/Topic",
|
|
65
|
+
"description": "What changed. Always one of the effective topics the subscribe response named."
|
|
66
|
+
},
|
|
67
|
+
"at": {
|
|
68
|
+
"type": "string",
|
|
69
|
+
"format": "date-time",
|
|
70
|
+
"description": "When the community observed the change. Where it coalesced several changes into this hint, the latest of them."
|
|
71
|
+
},
|
|
72
|
+
"count": {
|
|
73
|
+
"type": "integer",
|
|
74
|
+
"minimum": 0,
|
|
75
|
+
"description": "Only on a count topic (`actions`, `acknowledgements`, `joinRequests`): the caller's current count for that topic as of `at` — what a console badge shows. Absent on every other topic. A console MAY show it until its re-fetch returns, and MUST prefer the read's own count once it does."
|
|
76
|
+
},
|
|
77
|
+
"resumeToken": {
|
|
78
|
+
"$ref": "#/$defs/ResumeToken",
|
|
79
|
+
"description": "The stream position after this hint. A console keeps the latest one and passes it back as `since` when it re-subscribes."
|
|
80
|
+
},
|
|
81
|
+
"ext": {
|
|
82
|
+
"$ref": "#/$defs/Ext"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"$defs": {
|
|
86
|
+
"Ext": {
|
|
87
|
+
"title": "Ext",
|
|
88
|
+
"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.",
|
|
89
|
+
"type": "object",
|
|
90
|
+
"minProperties": 1,
|
|
91
|
+
"additionalProperties": true,
|
|
92
|
+
"propertyNames": {
|
|
93
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"ResumeToken": {
|
|
97
|
+
"title": "ResumeToken",
|
|
98
|
+
"description": "Opaque, community-minted position in one caller's event stream. A console MUST NOT parse, construct or order it; it only hands the latest one back as `since` when it re-subscribes. A community binds it to the caller it was minted for and treats a token minted for anyone else as unknown.",
|
|
99
|
+
"type": "string",
|
|
100
|
+
"minLength": 1,
|
|
101
|
+
"maxLength": 256,
|
|
102
|
+
"pattern": "^[A-Za-z0-9._~-]+$"
|
|
103
|
+
},
|
|
104
|
+
"Topic": {
|
|
105
|
+
"title": "Topic",
|
|
106
|
+
"description": "One kind of change a console can be told about. A closed set: a topic not listed here is a new MINOR version of this component, not an `ext` member, because each topic is bound to the read that authorizes it.",
|
|
107
|
+
"type": "string",
|
|
108
|
+
"enum": [
|
|
109
|
+
"actions",
|
|
110
|
+
"acknowledgements",
|
|
111
|
+
"joinRequests",
|
|
112
|
+
"members",
|
|
113
|
+
"singleAdminMode",
|
|
114
|
+
"config",
|
|
115
|
+
"rooms"
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
} as const;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
123
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
124
|
+
* per-specification and cannot be derived from the document alone, and
|
|
125
|
+
* item 2 needs the schema this carries.
|
|
126
|
+
*/
|
|
127
|
+
export const SPEC = {
|
|
128
|
+
typeUri: TYPE_URI,
|
|
129
|
+
isBearer: false,
|
|
130
|
+
isProofRequired: false,
|
|
131
|
+
isRecipientRequired: true,
|
|
132
|
+
isIssuedAtRequired: false,
|
|
133
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
134
|
+
} as const;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Source: specs/vtc/admin/events/subscribe/0.1/payload.schema.json
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type { Ext, ResumeToken, Topic } from "../../../../../_shared/components.js";
|
|
6
|
+
import type { Ext, ResumeToken, Topic_VtcAdminEventsV0_1 as Topic } from "../../../../../_shared/components.js";
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
/**
|