@openvtc/trust-tasks 0.17.6 → 0.17.7

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 (48) hide show
  1. package/CHANGELOG.md +114 -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 +6 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +6 -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/chain/0.1/payload.d.ts +382 -0
  15. package/dist/rooms/keys/chain/0.1/payload.d.ts.map +1 -0
  16. package/dist/rooms/keys/chain/0.1/payload.js +213 -0
  17. package/dist/rooms/keys/chain/0.1/payload.js.map +1 -0
  18. package/dist/rooms/keys/list/0.1/payload.d.ts +314 -0
  19. package/dist/rooms/keys/list/0.1/payload.d.ts.map +1 -0
  20. package/dist/rooms/keys/list/0.1/payload.js +175 -0
  21. package/dist/rooms/keys/list/0.1/payload.js.map +1 -0
  22. package/dist/rooms/keys/seal/0.1/payload.d.ts +352 -0
  23. package/dist/rooms/keys/seal/0.1/payload.d.ts.map +1 -0
  24. package/dist/rooms/keys/seal/0.1/payload.js +199 -0
  25. package/dist/rooms/keys/seal/0.1/payload.js.map +1 -0
  26. package/dist/rooms/owner/invite/0.1/payload.d.ts +291 -0
  27. package/dist/rooms/owner/invite/0.1/payload.d.ts.map +1 -0
  28. package/dist/rooms/owner/invite/0.1/payload.js +158 -0
  29. package/dist/rooms/owner/invite/0.1/payload.js.map +1 -0
  30. package/dist/rooms/owner/issue-authority/0.1/payload.d.ts +315 -0
  31. package/dist/rooms/owner/issue-authority/0.1/payload.d.ts.map +1 -0
  32. package/dist/rooms/owner/issue-authority/0.1/payload.js +173 -0
  33. package/dist/rooms/owner/issue-authority/0.1/payload.js.map +1 -0
  34. package/dist/rooms/owner/issue-membership/0.1/payload.d.ts +291 -0
  35. package/dist/rooms/owner/issue-membership/0.1/payload.d.ts.map +1 -0
  36. package/dist/rooms/owner/issue-membership/0.1/payload.js +158 -0
  37. package/dist/rooms/owner/issue-membership/0.1/payload.js.map +1 -0
  38. package/package.json +1 -1
  39. package/src/_shared/components.ts +4 -0
  40. package/src/index.ts +6 -0
  41. package/src/rooms/_shared/0.1/room.ts +1 -1
  42. package/src/rooms/create/0.1/payload.ts +30 -2
  43. package/src/rooms/keys/chain/0.1/payload.ts +262 -0
  44. package/src/rooms/keys/list/0.1/payload.ts +222 -0
  45. package/src/rooms/keys/seal/0.1/payload.ts +246 -0
  46. package/src/rooms/owner/invite/0.1/payload.ts +212 -0
  47. package/src/rooms/owner/issue-authority/0.1/payload.ts +233 -0
  48. package/src/rooms/owner/issue-membership/0.1/payload.ts +212 -0
@@ -0,0 +1,233 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/rooms/owner/issue-authority/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { Ext } from "../../../../_shared/components.js";
7
+
8
+
9
+ export interface RoomsOwnerIssueAuthorityPayload {
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 this grants to. A chain ROOT: the room is the governing party, so this is the grant everything else descends from. A holder narrows their own grant with attenuation instead, which needs no issuer.
24
+ */
25
+ subject: string;
26
+ /**
27
+ * What the subject may do. MUST NOT be empty — an empty list confers nothing rather than everything, and a schema that allowed it would make the more dangerous reading available to a careless consumer. `curate` is not implied by `write`: pinning, deprecating and retracting are judgements over shared knowledge, not writes.
28
+ *
29
+ * @minItems 1
30
+ */
31
+ actions: ["read" | "write" | "curate" | "admin", ...("read" | "write" | "curate" | "admin")[]];
32
+ /**
33
+ * When the grant lapses. Changing what a party may do reissues this one small credential and leaves the membership edge alone, which is why the two are separate credentials.
34
+ */
35
+ validUntil?: string;
36
+ }
37
+ /**
38
+ * Success response to rooms/owner/issue-authority. Type https://trusttasks.org/spec/rooms/owner/issue-authority/0.1#response. The signed VAC, a chain root at the room's scope.
39
+ */
40
+ export interface RoomsOwnerIssueAuthorityResponsePayload {
41
+ /**
42
+ * The signed Verifiable Authority Credential, serialised.
43
+ */
44
+ credential: string;
45
+ /**
46
+ * Its `id`.
47
+ */
48
+ credentialId: string;
49
+ ext?: Ext;
50
+ }
51
+
52
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
53
+ export type { Ext };
54
+
55
+ /** Trust Task type URI. */
56
+ export const TYPE_URI = "https://trusttasks.org/spec/rooms/owner/issue-authority/0.1" as const;
57
+
58
+ /** Stable alias for this specification's request payload shape. */
59
+ export type Payload = RoomsOwnerIssueAuthorityPayload;
60
+
61
+ /** Trust Task response type URI (request type URI + "#response"). */
62
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/rooms/owner/issue-authority/0.1#response" as const;
63
+
64
+ /** Stable alias for this specification's success-response payload shape. */
65
+ export type Response = RoomsOwnerIssueAuthorityResponsePayload;
66
+
67
+ /**
68
+ * This specification's payload schema, as a value.
69
+ *
70
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
71
+ * rather than only as a `.json` file because TypeScript types are erased
72
+ * at runtime: without a schema a consumer has nothing to validate, and
73
+ * every REQUIRED payload member is optional in practice. Cross-file
74
+ * `$ref`s are already inlined, so it needs no resolver.
75
+ */
76
+ export const PAYLOAD_SCHEMA = {
77
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
78
+ "$id": "https://trusttasks.org/spec/rooms/owner/issue-authority/0.1",
79
+ "title": "Rooms Owner Issue Authority — payload",
80
+ "type": "object",
81
+ "additionalProperties": false,
82
+ "required": [
83
+ "roomId",
84
+ "signingKeyId",
85
+ "subject",
86
+ "actions"
87
+ ],
88
+ "properties": {
89
+ "roomId": {
90
+ "type": "string",
91
+ "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."
92
+ },
93
+ "signingKeyId": {
94
+ "type": "string",
95
+ "maxLength": 256,
96
+ "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."
97
+ },
98
+ "ext": {
99
+ "$ref": "#/$defs/Ext",
100
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
101
+ },
102
+ "subject": {
103
+ "type": "string",
104
+ "description": "The party this grants to. A chain ROOT: the room is the governing party, so this is the grant everything else descends from. A holder narrows their own grant with attenuation instead, which needs no issuer."
105
+ },
106
+ "actions": {
107
+ "type": "array",
108
+ "minItems": 1,
109
+ "items": {
110
+ "type": "string",
111
+ "enum": [
112
+ "read",
113
+ "write",
114
+ "curate",
115
+ "admin"
116
+ ]
117
+ },
118
+ "description": "What the subject may do. MUST NOT be empty — an empty list confers nothing rather than everything, and a schema that allowed it would make the more dangerous reading available to a careless consumer. `curate` is not implied by `write`: pinning, deprecating and retracting are judgements over shared knowledge, not writes."
119
+ },
120
+ "validUntil": {
121
+ "type": "string",
122
+ "format": "date-time",
123
+ "description": "When the grant lapses. Changing what a party may do reissues this one small credential and leaves the membership edge alone, which is why the two are separate credentials."
124
+ }
125
+ },
126
+ "$defs": {
127
+ "Response": {
128
+ "$anchor": "response",
129
+ "title": "Rooms Owner Issue Authority — response payload",
130
+ "description": "Success response to rooms/owner/issue-authority. Type https://trusttasks.org/spec/rooms/owner/issue-authority/0.1#response. The signed VAC, a chain root at the room's scope.",
131
+ "type": "object",
132
+ "additionalProperties": false,
133
+ "required": [
134
+ "credential",
135
+ "credentialId"
136
+ ],
137
+ "properties": {
138
+ "credential": {
139
+ "type": "string",
140
+ "description": "The signed Verifiable Authority Credential, serialised."
141
+ },
142
+ "credentialId": {
143
+ "type": "string",
144
+ "description": "Its `id`."
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
+ }
162
+ } as const;
163
+
164
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
165
+ export const RESPONSE_PAYLOAD_SCHEMA = {
166
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
167
+ "$ref": "#/$defs/Response",
168
+ "$defs": {
169
+ "Response": {
170
+ "$anchor": "response",
171
+ "title": "Rooms Owner Issue Authority — response payload",
172
+ "description": "Success response to rooms/owner/issue-authority. Type https://trusttasks.org/spec/rooms/owner/issue-authority/0.1#response. The signed VAC, a chain root at the room's scope.",
173
+ "type": "object",
174
+ "additionalProperties": false,
175
+ "required": [
176
+ "credential",
177
+ "credentialId"
178
+ ],
179
+ "properties": {
180
+ "credential": {
181
+ "type": "string",
182
+ "description": "The signed Verifiable Authority Credential, serialised."
183
+ },
184
+ "credentialId": {
185
+ "type": "string",
186
+ "description": "Its `id`."
187
+ },
188
+ "ext": {
189
+ "$ref": "#/$defs/Ext"
190
+ }
191
+ }
192
+ },
193
+ "Ext": {
194
+ "title": "Ext",
195
+ "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.",
196
+ "type": "object",
197
+ "minProperties": 1,
198
+ "additionalProperties": true,
199
+ "propertyNames": {
200
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
201
+ }
202
+ }
203
+ }
204
+ } as const;
205
+
206
+ /**
207
+ * SPEC.md §7.2 policy for the request variant, from this specification's
208
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
209
+ * per-specification and cannot be derived from the document alone, and
210
+ * item 2 needs the schema this carries.
211
+ */
212
+ export const SPEC = {
213
+ typeUri: TYPE_URI,
214
+ isBearer: false,
215
+ isProofRequired: true,
216
+ isRecipientRequired: true,
217
+ isIssuedAtRequired: true,
218
+ payloadSchema: PAYLOAD_SCHEMA,
219
+ } as const;
220
+
221
+ /**
222
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
223
+ * tracks the *issuer* party's requirement because a response swaps the
224
+ * parties (§7.3 item 5).
225
+ */
226
+ export const RESPONSE_SPEC = {
227
+ typeUri: RESPONSE_TYPE_URI,
228
+ isBearer: false,
229
+ isProofRequired: true,
230
+ isRecipientRequired: true,
231
+ isIssuedAtRequired: true,
232
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
233
+ } 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/issue-membership/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { Ext } from "../../../../_shared/components.js";
7
+
8
+
9
+ export interface RoomsOwnerIssueMembershipPayload {
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 member this admits. Membership is an explicit set of parties, never a role — a room that admitted a role would be a room whose membership its host could compute.
24
+ */
25
+ subject: string;
26
+ /**
27
+ * When membership lapses. Absent means it does not, and removal is then an epoch advance rather than an expiry — see `rooms/epoch/mint`.
28
+ */
29
+ validUntil?: string;
30
+ }
31
+ /**
32
+ * Success response to rooms/owner/issue-membership. Type https://trusttasks.org/spec/rooms/owner/issue-membership/0.1#response. The signed VMC naming the member.
33
+ */
34
+ export interface RoomsOwnerIssueMembershipResponsePayload {
35
+ /**
36
+ * The signed Verifiable Membership Credential, serialised, for delivery to the member.
37
+ */
38
+ credential: string;
39
+ /**
40
+ * Its `id`, which is how a re-send is told from a renewal.
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/issue-membership/0.1" as const;
51
+
52
+ /** Stable alias for this specification's request payload shape. */
53
+ export type Payload = RoomsOwnerIssueMembershipPayload;
54
+
55
+ /** Trust Task response type URI (request type URI + "#response"). */
56
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/rooms/owner/issue-membership/0.1#response" as const;
57
+
58
+ /** Stable alias for this specification's success-response payload shape. */
59
+ export type Response = RoomsOwnerIssueMembershipResponsePayload;
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/issue-membership/0.1",
73
+ "title": "Rooms Owner Issue Membership — 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 member this admits. Membership is an explicit set of parties, never a role — a room that admitted a role would be a room whose membership its host could compute."
98
+ },
99
+ "validUntil": {
100
+ "type": "string",
101
+ "format": "date-time",
102
+ "description": "When membership lapses. Absent means it does not, and removal is then an epoch advance rather than an expiry — see `rooms/epoch/mint`."
103
+ }
104
+ },
105
+ "$defs": {
106
+ "Response": {
107
+ "$anchor": "response",
108
+ "title": "Rooms Owner Issue Membership — response payload",
109
+ "description": "Success response to rooms/owner/issue-membership. Type https://trusttasks.org/spec/rooms/owner/issue-membership/0.1#response. The signed VMC naming the member.",
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 Membership Credential, serialised, for delivery to the member."
120
+ },
121
+ "credentialId": {
122
+ "type": "string",
123
+ "description": "Its `id`, which is how a re-send is told from a renewal."
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 Issue Membership — response payload",
151
+ "description": "Success response to rooms/owner/issue-membership. Type https://trusttasks.org/spec/rooms/owner/issue-membership/0.1#response. The signed VMC naming the member.",
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 Membership Credential, serialised, for delivery to the member."
162
+ },
163
+ "credentialId": {
164
+ "type": "string",
165
+ "description": "Its `id`, which is how a re-send is told from a renewal."
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;