@openvtc/trust-tasks 0.26.8 → 0.26.10

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 (30) hide show
  1. package/CHANGELOG.md +126 -0
  2. package/dist/_shared/components.d.ts +43 -0
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/external/credentials/issue/0.3/payload.d.ts +1523 -0
  5. package/dist/external/credentials/issue/0.3/payload.d.ts.map +1 -0
  6. package/dist/external/credentials/issue/0.3/payload.js +847 -0
  7. package/dist/external/credentials/issue/0.3/payload.js.map +1 -0
  8. package/dist/index.d.ts +4 -0
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +4 -0
  11. package/dist/index.js.map +1 -1
  12. package/dist/vtc/_shared/0.1/admission.d.ts +16 -0
  13. package/dist/vtc/_shared/0.1/admission.d.ts.map +1 -0
  14. package/dist/vtc/_shared/0.1/admission.js +6 -0
  15. package/dist/vtc/_shared/0.1/admission.js.map +1 -0
  16. package/dist/vtc/members/admit/0.1/payload.d.ts +481 -0
  17. package/dist/vtc/members/admit/0.1/payload.d.ts.map +1 -0
  18. package/dist/vtc/members/admit/0.1/payload.js +281 -0
  19. package/dist/vtc/members/admit/0.1/payload.js.map +1 -0
  20. package/dist/vtc/members/make-membership/0.1/payload.d.ts +447 -0
  21. package/dist/vtc/members/make-membership/0.1/payload.d.ts.map +1 -0
  22. package/dist/vtc/members/make-membership/0.1/payload.js +267 -0
  23. package/dist/vtc/members/make-membership/0.1/payload.js.map +1 -0
  24. package/package.json +1 -1
  25. package/src/_shared/components.ts +43 -0
  26. package/src/external/credentials/issue/0.3/payload.ts +999 -0
  27. package/src/index.ts +4 -0
  28. package/src/vtc/_shared/0.1/admission.ts +17 -0
  29. package/src/vtc/members/admit/0.1/payload.ts +326 -0
  30. package/src/vtc/members/make-membership/0.1/payload.ts +304 -0
package/src/index.ts CHANGED
@@ -228,6 +228,7 @@ export * as ExternalAccountsSuspend_v0_1 from "./external/accounts/suspend/0.1/p
228
228
  export * as ExternalAccountsUpdate_v0_1 from "./external/accounts/update/0.1/payload.js";
229
229
  export * as ExternalCredentialsIssue_v0_1 from "./external/credentials/issue/0.1/payload.js";
230
230
  export * as ExternalCredentialsIssue_v0_2 from "./external/credentials/issue/0.2/payload.js";
231
+ export * as ExternalCredentialsIssue_v0_3 from "./external/credentials/issue/0.3/payload.js";
231
232
  export * as ExternalSign_v0_1 from "./external/sign/0.1/payload.js";
232
233
  export * as GitNsShared_v0_1 from "./git-ns/_shared/0.1/git-ns.js";
233
234
  export * as GitNsShared_v0_2 from "./git-ns/_shared/0.2/git-ns.js";
@@ -684,6 +685,7 @@ export * as VtaWitnessAccept_v0_1 from "./vta/witness/accept/0.1/payload.js";
684
685
  export * as VtaWitnessOpen_v0_1 from "./vta/witness/open/0.1/payload.js";
685
686
  export * as VtaWitnessPresent_v0_1 from "./vta/witness/present/0.1/payload.js";
686
687
  export * as VtaWitnessRequest_v0_1 from "./vta/witness/request/0.1/payload.js";
688
+ export * as AdmissionShared_v0_1 from "./vtc/_shared/0.1/admission.js";
687
689
  export * as BackupShared_v0_1 from "./vtc/_shared/0.1/backup.js";
688
690
  export * as CeremonyShared_v0_1 from "./vtc/_shared/0.1/ceremony.js";
689
691
  export * as CommunityPresentationShared_v0_1 from "./vtc/_shared/0.1/community-presentation.js";
@@ -780,10 +782,12 @@ export * as VtcJoinRequestsWalletSessionStart_v0_1 from "./vtc/join-requests/wal
780
782
  export * as VtcJoinRequestsWalletSessionStatus_v0_1 from "./vtc/join-requests/wallet-session/status/0.1/payload.js";
781
783
  export * as VtcJoinRequestsWithdraw_v0_1 from "./vtc/join-requests/withdraw/0.1/payload.js";
782
784
  export * as VtcMembersAdminRemove_v0_1 from "./vtc/members/admin-remove/0.1/payload.js";
785
+ export * as VtcMembersAdmit_v0_1 from "./vtc/members/admit/0.1/payload.js";
783
786
  export * as VtcMembersAuthorityReducedNotice_v0_1 from "./vtc/members/authority-reduced-notice/0.1/payload.js";
784
787
  export * as VtcMembersAuthorityReductionPendingNotice_v0_1 from "./vtc/members/authority-reduction-pending-notice/0.1/payload.js";
785
788
  export * as VtcMembersCredentials_v0_1 from "./vtc/members/credentials/0.1/payload.js";
786
789
  export * as VtcMembersList_v0_1 from "./vtc/members/list/0.1/payload.js";
790
+ export * as VtcMembersMakeMembership_v0_1 from "./vtc/members/make-membership/0.1/payload.js";
787
791
  export * as VtcMembersPersonhoodAssert_v0_1 from "./vtc/members/personhood/assert/0.1/payload.js";
788
792
  export * as VtcMembersPersonhoodChallenge_v0_1 from "./vtc/members/personhood/challenge/0.1/payload.js";
789
793
  export * as VtcMembersPersonhoodRevoke_v0_1 from "./vtc/members/personhood/revoke/0.1/payload.js";
@@ -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/admission.schema.json
4
+ */
5
+
6
+ /**
7
+ * Shared types for direct admission: vtc/members/admit (an administrator admits a DID without a join request) and vtc/members/make-membership (an administrator gives an existing access-control entry with no member record the membership a completed join would have given it). Both answer with the same record of the membership admitted, so it lives here. Not itself a Trust Task specification (the `_shared` folder is skipped by the registry build and the codegen).
8
+ */
9
+ export interface VTCSharedDirectAdmissionDefinitions {
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 { AdmittedMembership, Approval } from "../../../_shared/components.js";
@@ -0,0 +1,326 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vtc/members/admit/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { AdmittedMembership, Approval, Ext } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * Success response to vtc/members/admit/0.1: the membership as admitted, with the credentials issued for it. Type https://trusttasks.org/spec/vtc/members/admit/0.1#response — carried directly, or on the request's threadId when a referred operation executes after its approval.
11
+ */
12
+ export type VTCMembersAdmitResponsePayload = AdmittedMembership;
13
+
14
+ /**
15
+ * An administrator admits a DID as a member of the community without a join request, at a community role it names.
16
+ */
17
+ export interface VTCMembersAdmitPayload {
18
+ /**
19
+ * The DID to admit. It holds no access-control entry at the community, or only one of the `application` community role (a non-member holding resource grants), and no live membership.
20
+ */
21
+ subject: string;
22
+ /**
23
+ * The community role the membership will hold, in the community's wire form (`member`, `moderator`, `issuer`, `custom:<name>`). Required, so that what an approver is shown is what was asked for. Never `admin`, never `application`, and never a role whose authority would confer authority-conferring capabilities; a role other than `member` is subject to the role-assignment rules of Conformance item 3.
24
+ */
25
+ role: string;
26
+ /**
27
+ * A human-readable label for the new access-control entry, as `acl/grant` carries one. Confers nothing. Not blank.
28
+ */
29
+ label?: string;
30
+ /**
31
+ * Why, for the community's audit trail and for the administrators asked to approve it if the admission is referred. Never published to the subject or beyond the community.
32
+ */
33
+ reason?: string;
34
+ ext?: Ext;
35
+ }
36
+
37
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
38
+ export type { AdmittedMembership, Approval, Ext };
39
+
40
+ /** Trust Task type URI. */
41
+ export const TYPE_URI = "https://trusttasks.org/spec/vtc/members/admit/0.1" as const;
42
+
43
+ /** Stable alias for this specification's request payload shape. */
44
+ export type Payload = VTCMembersAdmitPayload;
45
+
46
+ /** Trust Task response type URI (request type URI + "#response"). */
47
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/members/admit/0.1#response" as const;
48
+
49
+ /** Stable alias for this specification's success-response payload shape. */
50
+ export type Response = VTCMembersAdmitResponsePayload;
51
+
52
+ /**
53
+ * This specification's payload schema, as a value.
54
+ *
55
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
56
+ * rather than only as a `.json` file because TypeScript types are erased
57
+ * at runtime: without a schema a consumer has nothing to validate, and
58
+ * every REQUIRED payload member is optional in practice. Cross-file
59
+ * `$ref`s are already inlined, so it needs no resolver.
60
+ */
61
+ export const PAYLOAD_SCHEMA = {
62
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
63
+ "$id": "https://trusttasks.org/spec/vtc/members/admit/0.1",
64
+ "title": "VTC Members Admit — payload",
65
+ "description": "An administrator admits a DID as a member of the community without a join request, at a community role it names.",
66
+ "type": "object",
67
+ "additionalProperties": false,
68
+ "required": [
69
+ "subject",
70
+ "role"
71
+ ],
72
+ "properties": {
73
+ "subject": {
74
+ "type": "string",
75
+ "pattern": "^did:",
76
+ "maxLength": 2048,
77
+ "description": "The DID to admit. It holds no access-control entry at the community, or only one of the `application` community role (a non-member holding resource grants), and no live membership."
78
+ },
79
+ "role": {
80
+ "type": "string",
81
+ "minLength": 1,
82
+ "maxLength": 128,
83
+ "description": "The community role the membership will hold, in the community's wire form (`member`, `moderator`, `issuer`, `custom:<name>`). Required, so that what an approver is shown is what was asked for. Never `admin`, never `application`, and never a role whose authority would confer authority-conferring capabilities; a role other than `member` is subject to the role-assignment rules of Conformance item 3."
84
+ },
85
+ "label": {
86
+ "type": "string",
87
+ "minLength": 1,
88
+ "maxLength": 256,
89
+ "pattern": "\\S",
90
+ "description": "A human-readable label for the new access-control entry, as `acl/grant` carries one. Confers nothing. Not blank."
91
+ },
92
+ "reason": {
93
+ "type": "string",
94
+ "maxLength": 1024,
95
+ "description": "Why, for the community's audit trail and for the administrators asked to approve it if the admission is referred. Never published to the subject or beyond the community."
96
+ },
97
+ "ext": {
98
+ "$ref": "#/$defs/Ext"
99
+ }
100
+ },
101
+ "$defs": {
102
+ "Response": {
103
+ "$anchor": "response",
104
+ "title": "VTC Members Admit — response payload",
105
+ "description": "Success response to vtc/members/admit/0.1: the membership as admitted, with the credentials issued for it. Type https://trusttasks.org/spec/vtc/members/admit/0.1#response — carried directly, or on the request's threadId when a referred operation executes after its approval.",
106
+ "$ref": "#/$defs/AdmittedMembership",
107
+ "unevaluatedProperties": false
108
+ },
109
+ "AdmittedMembership": {
110
+ "title": "AdmittedMembership",
111
+ "description": "A membership admitted directly, with the credentials issued for it — the success payload of vtc/members/admit and vtc/members/make-membership.",
112
+ "type": "object",
113
+ "additionalProperties": false,
114
+ "required": [
115
+ "subject",
116
+ "role",
117
+ "status",
118
+ "returning",
119
+ "approval",
120
+ "statusListIndex",
121
+ "vmc",
122
+ "roleVac"
123
+ ],
124
+ "properties": {
125
+ "subject": {
126
+ "type": "string",
127
+ "pattern": "^did:",
128
+ "maxLength": 2048,
129
+ "description": "The DID admitted."
130
+ },
131
+ "role": {
132
+ "type": "string",
133
+ "minLength": 1,
134
+ "maxLength": 128,
135
+ "description": "The community role the membership holds: for vtc/members/admit the one requested, for vtc/members/make-membership the role the entry already held."
136
+ },
137
+ "label": {
138
+ "type": "string",
139
+ "minLength": 1,
140
+ "maxLength": 256,
141
+ "description": "The new entry's label, when vtc/members/admit was given one. Absent for vtc/members/make-membership, which writes no entry."
142
+ },
143
+ "status": {
144
+ "type": "string",
145
+ "enum": [
146
+ "admitted"
147
+ ],
148
+ "description": "Always `admitted`: a refusal is a trust-task-error, and a referred admission is answered with trust-task-next-step until it executes."
149
+ },
150
+ "returning": {
151
+ "type": "boolean",
152
+ "description": "True when vtc/members/admit re-admitted a former member (a removed member record, no entry), as a rejoin would re-admit them. Always false for vtc/members/make-membership, which refuses a removed record."
153
+ },
154
+ "approval": {
155
+ "$ref": "#/$defs/Approval"
156
+ },
157
+ "statusListIndex": {
158
+ "type": "integer",
159
+ "minimum": 0,
160
+ "description": "The membership's slot on the community's revocation status list, which the VMC's credentialStatus names."
161
+ },
162
+ "vmc": {
163
+ "type": "object",
164
+ "description": "The Verifiable Membership Credential issued for the admission, delivered inline as vtc/join-requests/decide delivers it."
165
+ },
166
+ "roleVac": {
167
+ "type": "object",
168
+ "description": "The role credential issued for the admission: a Verifiable Authority Credential issued by the community whose `credentialSubject.authority` is `{ scope: <community DID>, actions: [\"role:<name>\"] }`, the shape vtc/join-requests/decide returns."
169
+ },
170
+ "ext": {
171
+ "$ref": "#/$defs/Ext"
172
+ }
173
+ }
174
+ },
175
+ "Approval": {
176
+ "title": "Approval",
177
+ "type": "string",
178
+ "enum": [
179
+ "policyAllowed",
180
+ "approved",
181
+ "waived"
182
+ ],
183
+ "description": "How the admission came to execute. `policyAllowed`: the community's policy admitted it at once. `approved`: the policy referred it, the community parked it, and another administrator approved it. `waived`: the policy referred it, and the community's single-administrator mode waived the approval on the requester's own re-authentication bound to the operation."
184
+ },
185
+ "Ext": {
186
+ "title": "Ext",
187
+ "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.",
188
+ "type": "object",
189
+ "minProperties": 1,
190
+ "additionalProperties": true,
191
+ "propertyNames": {
192
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
193
+ }
194
+ }
195
+ }
196
+ } as const;
197
+
198
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
199
+ export const RESPONSE_PAYLOAD_SCHEMA = {
200
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
201
+ "$ref": "#/$defs/Response",
202
+ "$defs": {
203
+ "Response": {
204
+ "$anchor": "response",
205
+ "title": "VTC Members Admit — response payload",
206
+ "description": "Success response to vtc/members/admit/0.1: the membership as admitted, with the credentials issued for it. Type https://trusttasks.org/spec/vtc/members/admit/0.1#response — carried directly, or on the request's threadId when a referred operation executes after its approval.",
207
+ "$ref": "#/$defs/AdmittedMembership",
208
+ "unevaluatedProperties": false
209
+ },
210
+ "AdmittedMembership": {
211
+ "title": "AdmittedMembership",
212
+ "description": "A membership admitted directly, with the credentials issued for it — the success payload of vtc/members/admit and vtc/members/make-membership.",
213
+ "type": "object",
214
+ "additionalProperties": false,
215
+ "required": [
216
+ "subject",
217
+ "role",
218
+ "status",
219
+ "returning",
220
+ "approval",
221
+ "statusListIndex",
222
+ "vmc",
223
+ "roleVac"
224
+ ],
225
+ "properties": {
226
+ "subject": {
227
+ "type": "string",
228
+ "pattern": "^did:",
229
+ "maxLength": 2048,
230
+ "description": "The DID admitted."
231
+ },
232
+ "role": {
233
+ "type": "string",
234
+ "minLength": 1,
235
+ "maxLength": 128,
236
+ "description": "The community role the membership holds: for vtc/members/admit the one requested, for vtc/members/make-membership the role the entry already held."
237
+ },
238
+ "label": {
239
+ "type": "string",
240
+ "minLength": 1,
241
+ "maxLength": 256,
242
+ "description": "The new entry's label, when vtc/members/admit was given one. Absent for vtc/members/make-membership, which writes no entry."
243
+ },
244
+ "status": {
245
+ "type": "string",
246
+ "enum": [
247
+ "admitted"
248
+ ],
249
+ "description": "Always `admitted`: a refusal is a trust-task-error, and a referred admission is answered with trust-task-next-step until it executes."
250
+ },
251
+ "returning": {
252
+ "type": "boolean",
253
+ "description": "True when vtc/members/admit re-admitted a former member (a removed member record, no entry), as a rejoin would re-admit them. Always false for vtc/members/make-membership, which refuses a removed record."
254
+ },
255
+ "approval": {
256
+ "$ref": "#/$defs/Approval"
257
+ },
258
+ "statusListIndex": {
259
+ "type": "integer",
260
+ "minimum": 0,
261
+ "description": "The membership's slot on the community's revocation status list, which the VMC's credentialStatus names."
262
+ },
263
+ "vmc": {
264
+ "type": "object",
265
+ "description": "The Verifiable Membership Credential issued for the admission, delivered inline as vtc/join-requests/decide delivers it."
266
+ },
267
+ "roleVac": {
268
+ "type": "object",
269
+ "description": "The role credential issued for the admission: a Verifiable Authority Credential issued by the community whose `credentialSubject.authority` is `{ scope: <community DID>, actions: [\"role:<name>\"] }`, the shape vtc/join-requests/decide returns."
270
+ },
271
+ "ext": {
272
+ "$ref": "#/$defs/Ext"
273
+ }
274
+ }
275
+ },
276
+ "Approval": {
277
+ "title": "Approval",
278
+ "type": "string",
279
+ "enum": [
280
+ "policyAllowed",
281
+ "approved",
282
+ "waived"
283
+ ],
284
+ "description": "How the admission came to execute. `policyAllowed`: the community's policy admitted it at once. `approved`: the policy referred it, the community parked it, and another administrator approved it. `waived`: the policy referred it, and the community's single-administrator mode waived the approval on the requester's own re-authentication bound to the operation."
285
+ },
286
+ "Ext": {
287
+ "title": "Ext",
288
+ "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.",
289
+ "type": "object",
290
+ "minProperties": 1,
291
+ "additionalProperties": true,
292
+ "propertyNames": {
293
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
294
+ }
295
+ }
296
+ }
297
+ } as const;
298
+
299
+ /**
300
+ * SPEC.md §7.2 policy for the request variant, from this specification's
301
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
302
+ * per-specification and cannot be derived from the document alone, and
303
+ * item 2 needs the schema this carries.
304
+ */
305
+ export const SPEC = {
306
+ typeUri: TYPE_URI,
307
+ isBearer: false,
308
+ isProofRequired: true,
309
+ isRecipientRequired: true,
310
+ isIssuedAtRequired: true,
311
+ payloadSchema: PAYLOAD_SCHEMA,
312
+ } as const;
313
+
314
+ /**
315
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
316
+ * tracks the *issuer* party's requirement because a response swaps the
317
+ * parties (§7.3 item 5).
318
+ */
319
+ export const RESPONSE_SPEC = {
320
+ typeUri: RESPONSE_TYPE_URI,
321
+ isBearer: false,
322
+ isProofRequired: true,
323
+ isRecipientRequired: true,
324
+ isIssuedAtRequired: true,
325
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
326
+ } as const;