@openvtc/trust-tasks 0.19.3 → 0.19.5

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 (80) hide show
  1. package/CHANGELOG.md +209 -0
  2. package/dist/_shared/components.d.ts +298 -0
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/index.d.ts +14 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +14 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/vetting/_shared/0.1/identity-vetting.d.ts +11 -0
  9. package/dist/vetting/_shared/0.1/identity-vetting.d.ts.map +1 -0
  10. package/dist/vetting/_shared/0.1/identity-vetting.js +6 -0
  11. package/dist/vetting/_shared/0.1/identity-vetting.js.map +1 -0
  12. package/dist/vetting/_shared/0.1/vetting-card.d.ts +16 -0
  13. package/dist/vetting/_shared/0.1/vetting-card.d.ts.map +1 -0
  14. package/dist/vetting/_shared/0.1/vetting-card.js +6 -0
  15. package/dist/vetting/_shared/0.1/vetting-card.js.map +1 -0
  16. package/dist/vetting/_shared/0.1/vetting.d.ts +16 -0
  17. package/dist/vetting/_shared/0.1/vetting.d.ts.map +1 -0
  18. package/dist/vetting/_shared/0.1/vetting.js +6 -0
  19. package/dist/vetting/_shared/0.1/vetting.js.map +1 -0
  20. package/dist/vetting/decline/0.1/payload.d.ts +138 -0
  21. package/dist/vetting/decline/0.1/payload.d.ts.map +1 -0
  22. package/dist/vetting/decline/0.1/payload.js +81 -0
  23. package/dist/vetting/decline/0.1/payload.js.map +1 -0
  24. package/dist/vetting/request/0.1/payload.d.ts +1188 -0
  25. package/dist/vetting/request/0.1/payload.d.ts.map +1 -0
  26. package/dist/vetting/request/0.1/payload.js +596 -0
  27. package/dist/vetting/request/0.1/payload.js.map +1 -0
  28. package/dist/vetting/session/0.1/payload.d.ts +978 -0
  29. package/dist/vetting/session/0.1/payload.d.ts.map +1 -0
  30. package/dist/vetting/session/0.1/payload.js +570 -0
  31. package/dist/vetting/session/0.1/payload.js.map +1 -0
  32. package/dist/vta/webvh/dids/realign-keys/1.0/payload.d.ts +484 -0
  33. package/dist/vta/webvh/dids/realign-keys/1.0/payload.d.ts.map +1 -0
  34. package/dist/vta/webvh/dids/realign-keys/1.0/payload.js +259 -0
  35. package/dist/vta/webvh/dids/realign-keys/1.0/payload.js.map +1 -0
  36. package/dist/vtc/_shared/0.1/vetter-profile.d.ts +16 -0
  37. package/dist/vtc/_shared/0.1/vetter-profile.d.ts.map +1 -0
  38. package/dist/vtc/_shared/0.1/vetter-profile.js +6 -0
  39. package/dist/vtc/_shared/0.1/vetter-profile.js.map +1 -0
  40. package/dist/vtc/join-requests/manifest/0.2/payload.d.ts +1294 -0
  41. package/dist/vtc/join-requests/manifest/0.2/payload.d.ts.map +1 -0
  42. package/dist/vtc/join-requests/manifest/0.2/payload.js +667 -0
  43. package/dist/vtc/join-requests/manifest/0.2/payload.js.map +1 -0
  44. package/dist/vtc/vetting/revoke-statement/0.1/payload.d.ts +299 -0
  45. package/dist/vtc/vetting/revoke-statement/0.1/payload.d.ts.map +1 -0
  46. package/dist/vtc/vetting/revoke-statement/0.1/payload.js +172 -0
  47. package/dist/vtc/vetting/revoke-statement/0.1/payload.js.map +1 -0
  48. package/dist/vtc/vetting/vetters/grant/0.1/payload.d.ts +337 -0
  49. package/dist/vtc/vetting/vetters/grant/0.1/payload.d.ts.map +1 -0
  50. package/dist/vtc/vetting/vetters/grant/0.1/payload.js +183 -0
  51. package/dist/vtc/vetting/vetters/grant/0.1/payload.js.map +1 -0
  52. package/dist/vtc/vetting/vetters/list/0.1/payload.d.ts +1257 -0
  53. package/dist/vtc/vetting/vetters/list/0.1/payload.d.ts.map +1 -0
  54. package/dist/vtc/vetting/vetters/list/0.1/payload.js +597 -0
  55. package/dist/vtc/vetting/vetters/list/0.1/payload.js.map +1 -0
  56. package/dist/vtc/vetting/vetters/profile/0.1/payload.d.ts +970 -0
  57. package/dist/vtc/vetting/vetters/profile/0.1/payload.d.ts.map +1 -0
  58. package/dist/vtc/vetting/vetters/profile/0.1/payload.js +463 -0
  59. package/dist/vtc/vetting/vetters/profile/0.1/payload.js.map +1 -0
  60. package/dist/vtc/vetting/vetters/resend/0.1/payload.d.ts +240 -0
  61. package/dist/vtc/vetting/vetters/resend/0.1/payload.d.ts.map +1 -0
  62. package/dist/vtc/vetting/vetters/resend/0.1/payload.js +137 -0
  63. package/dist/vtc/vetting/vetters/resend/0.1/payload.js.map +1 -0
  64. package/package.json +1 -1
  65. package/src/_shared/components.ts +318 -0
  66. package/src/index.ts +14 -0
  67. package/src/vetting/_shared/0.1/identity-vetting.ts +11 -0
  68. package/src/vetting/_shared/0.1/vetting-card.ts +17 -0
  69. package/src/vetting/_shared/0.1/vetting.ts +17 -0
  70. package/src/vetting/decline/0.1/payload.ts +111 -0
  71. package/src/vetting/request/0.1/payload.ts +799 -0
  72. package/src/vetting/session/0.1/payload.ts +629 -0
  73. package/src/vta/webvh/dids/realign-keys/1.0/payload.ts +332 -0
  74. package/src/vtc/_shared/0.1/vetter-profile.ts +17 -0
  75. package/src/vtc/join-requests/manifest/0.2/payload.ts +815 -0
  76. package/src/vtc/vetting/revoke-statement/0.1/payload.ts +218 -0
  77. package/src/vtc/vetting/vetters/grant/0.1/payload.ts +237 -0
  78. package/src/vtc/vetting/vetters/list/0.1/payload.ts +816 -0
  79. package/src/vtc/vetting/vetters/profile/0.1/payload.ts +647 -0
  80. package/src/vtc/vetting/vetters/resend/0.1/payload.ts +174 -0
@@ -0,0 +1,218 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vtc/vetting/revoke-statement/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { DigestMultibase, Ext } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * A vetter tells the community it withdraws a Vetting Statement it issued. The community records the notice against the statement's id and digest, and from then on that statement does not count. The response is the time the community recorded the notice; repeating a notice returns the original time.
11
+ */
12
+ export interface VTCVettingRevokeStatementPayload {
13
+ /**
14
+ * The withdrawn statement's `id`, a URI (e.g. `urn:uuid:…`).
15
+ */
16
+ statementId: string;
17
+ /**
18
+ * Digest over the RFC 8785 canonicalization of the withdrawn statement exactly as issued, `proof` included (SHA-256 RECOMMENDED). Pins the notice to one credential, so it cannot be aimed at a different statement that reuses the id.
19
+ */
20
+ statementDigestMultibase: DigestMultibase;
21
+ /**
22
+ * OPTIONAL. `mistake` — the vetter attested in error. `newInformation` — the vetter learned something that changes its view. `keyCompromise` — the key that signed the statement may be in someone else's hands. `other` — none of these.
23
+ */
24
+ reason?: "mistake" | "newInformation" | "keyCompromise" | "other";
25
+ ext?: Ext;
26
+ }
27
+ /**
28
+ * The community recorded the notice.
29
+ */
30
+ export interface VTCVettingRevokeStatementResponsePayload {
31
+ /**
32
+ * When the community recorded the notice. A repeated notice for the same statement returns the time the first was recorded: revocation converges, and a vetter retrying cannot move it.
33
+ */
34
+ recordedAt: string;
35
+ ext?: Ext;
36
+ }
37
+
38
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
39
+ export type { DigestMultibase, Ext };
40
+
41
+ /** Trust Task type URI. */
42
+ export const TYPE_URI = "https://trusttasks.org/spec/vtc/vetting/revoke-statement/0.1" as const;
43
+
44
+ /** Stable alias for this specification's request payload shape. */
45
+ export type Payload = VTCVettingRevokeStatementPayload;
46
+
47
+ /** Trust Task response type URI (request type URI + "#response"). */
48
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/vetting/revoke-statement/0.1#response" as const;
49
+
50
+ /** Stable alias for this specification's success-response payload shape. */
51
+ export type Response = VTCVettingRevokeStatementResponsePayload;
52
+
53
+ /**
54
+ * This specification's payload schema, as a value.
55
+ *
56
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
57
+ * rather than only as a `.json` file because TypeScript types are erased
58
+ * at runtime: without a schema a consumer has nothing to validate, and
59
+ * every REQUIRED payload member is optional in practice. Cross-file
60
+ * `$ref`s are already inlined, so it needs no resolver.
61
+ */
62
+ export const PAYLOAD_SCHEMA = {
63
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
64
+ "$id": "https://trusttasks.org/spec/vtc/vetting/revoke-statement/0.1",
65
+ "title": "VTC Vetting — Revoke Statement — payload",
66
+ "description": "A vetter tells the community it withdraws a Vetting Statement it issued. The community records the notice against the statement's id and digest, and from then on that statement does not count. The response is the time the community recorded the notice; repeating a notice returns the original time.",
67
+ "type": "object",
68
+ "additionalProperties": false,
69
+ "required": [
70
+ "statementId",
71
+ "statementDigestMultibase"
72
+ ],
73
+ "properties": {
74
+ "statementId": {
75
+ "type": "string",
76
+ "minLength": 1,
77
+ "maxLength": 512,
78
+ "pattern": "^[a-zA-Z][a-zA-Z0-9+.-]*:\\S+$",
79
+ "description": "The withdrawn statement's `id`, a URI (e.g. `urn:uuid:…`)."
80
+ },
81
+ "statementDigestMultibase": {
82
+ "$ref": "#/$defs/DigestMultibase",
83
+ "description": "Digest over the RFC 8785 canonicalization of the withdrawn statement exactly as issued, `proof` included (SHA-256 RECOMMENDED). Pins the notice to one credential, so it cannot be aimed at a different statement that reuses the id."
84
+ },
85
+ "reason": {
86
+ "type": "string",
87
+ "enum": [
88
+ "mistake",
89
+ "newInformation",
90
+ "keyCompromise",
91
+ "other"
92
+ ],
93
+ "description": "OPTIONAL. `mistake` — the vetter attested in error. `newInformation` — the vetter learned something that changes its view. `keyCompromise` — the key that signed the statement may be in someone else's hands. `other` — none of these."
94
+ },
95
+ "ext": {
96
+ "$ref": "#/$defs/Ext"
97
+ }
98
+ },
99
+ "$defs": {
100
+ "Response": {
101
+ "$anchor": "response",
102
+ "title": "VTC Vetting — Revoke Statement — response payload",
103
+ "description": "The community recorded the notice.",
104
+ "type": "object",
105
+ "additionalProperties": false,
106
+ "required": [
107
+ "recordedAt"
108
+ ],
109
+ "properties": {
110
+ "recordedAt": {
111
+ "type": "string",
112
+ "format": "date-time",
113
+ "description": "When the community recorded the notice. A repeated notice for the same statement returns the time the first was recorded: revocation converges, and a vetter retrying cannot move it."
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
+ "DigestMultibase": {
131
+ "title": "DigestMultibase",
132
+ "description": "A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.\n\nMultihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.\n\nThis definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.\n\nRestricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that \"interoperability is not guaranteed between implementations using such values\", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.",
133
+ "type": "string",
134
+ "minLength": 16,
135
+ "pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
136
+ "examples": [
137
+ "zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
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": "VTC Vetting — Revoke Statement — response payload",
151
+ "description": "The community recorded the notice.",
152
+ "type": "object",
153
+ "additionalProperties": false,
154
+ "required": [
155
+ "recordedAt"
156
+ ],
157
+ "properties": {
158
+ "recordedAt": {
159
+ "type": "string",
160
+ "format": "date-time",
161
+ "description": "When the community recorded the notice. A repeated notice for the same statement returns the time the first was recorded: revocation converges, and a vetter retrying cannot move it."
162
+ },
163
+ "ext": {
164
+ "$ref": "#/$defs/Ext"
165
+ }
166
+ }
167
+ },
168
+ "Ext": {
169
+ "title": "Ext",
170
+ "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.",
171
+ "type": "object",
172
+ "minProperties": 1,
173
+ "additionalProperties": true,
174
+ "propertyNames": {
175
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
176
+ }
177
+ },
178
+ "DigestMultibase": {
179
+ "title": "DigestMultibase",
180
+ "description": "A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.\n\nMultihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.\n\nThis definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.\n\nRestricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that \"interoperability is not guaranteed between implementations using such values\", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.",
181
+ "type": "string",
182
+ "minLength": 16,
183
+ "pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
184
+ "examples": [
185
+ "zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
186
+ ]
187
+ }
188
+ }
189
+ } as const;
190
+
191
+ /**
192
+ * SPEC.md §7.2 policy for the request variant, from this specification's
193
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
194
+ * per-specification and cannot be derived from the document alone, and
195
+ * item 2 needs the schema this carries.
196
+ */
197
+ export const SPEC = {
198
+ typeUri: TYPE_URI,
199
+ isBearer: false,
200
+ isProofRequired: true,
201
+ isRecipientRequired: true,
202
+ isIssuedAtRequired: true,
203
+ payloadSchema: PAYLOAD_SCHEMA,
204
+ } as const;
205
+
206
+ /**
207
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
208
+ * tracks the *issuer* party's requirement because a response swaps the
209
+ * parties (§7.3 item 5).
210
+ */
211
+ export const RESPONSE_SPEC = {
212
+ typeUri: RESPONSE_TYPE_URI,
213
+ isBearer: false,
214
+ isProofRequired: true,
215
+ isRecipientRequired: true,
216
+ isIssuedAtRequired: true,
217
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
218
+ } as const;
@@ -0,0 +1,237 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vtc/vetting/vetters/grant/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { Ext } from "../../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * A community administrator makes a member a vetter. The community issues the member a revocable `CommunityRole` endorsement credential for the `vetter` role, delivers it over credential-exchange/issue, and returns the identifiers and validity of the grant. A member who already holds a live grant gets that grant back unchanged.
11
+ */
12
+ export interface VTCVettingVettersGrantPayload {
13
+ /**
14
+ * The member DID to grant the vetter role to — the subject of the role credential, and the DID the vetter signs statements with.
15
+ */
16
+ memberDid: string;
17
+ /**
18
+ * OPTIONAL. How long the role credential is valid, from issuance: at least one day, at most two years. Absent: 31536000 (365 days). Ignored when the member already holds a live grant.
19
+ */
20
+ validitySeconds?: number;
21
+ ext?: Ext;
22
+ }
23
+ /**
24
+ * The grant — newly issued, or the member's existing live grant.
25
+ */
26
+ export interface VTCVettingVettersGrantResponsePayload {
27
+ /**
28
+ * The community's endorsement record for this grant — the identifier vtc/endorsements/revoke takes.
29
+ */
30
+ endorsementId: string;
31
+ /**
32
+ * The `id` of the role credential, a URI.
33
+ */
34
+ credentialId: string;
35
+ /**
36
+ * The role credential's `validFrom`.
37
+ */
38
+ validFrom: string;
39
+ /**
40
+ * The role credential's `validUntil`.
41
+ */
42
+ validUntil: 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/vtc/vetting/vetters/grant/0.1" as const;
51
+
52
+ /** Stable alias for this specification's request payload shape. */
53
+ export type Payload = VTCVettingVettersGrantPayload;
54
+
55
+ /** Trust Task response type URI (request type URI + "#response"). */
56
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/vetting/vetters/grant/0.1#response" as const;
57
+
58
+ /** Stable alias for this specification's success-response payload shape. */
59
+ export type Response = VTCVettingVettersGrantResponsePayload;
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/vtc/vetting/vetters/grant/0.1",
73
+ "title": "VTC Vetting — Vetters Grant — payload",
74
+ "description": "A community administrator makes a member a vetter. The community issues the member a revocable `CommunityRole` endorsement credential for the `vetter` role, delivers it over credential-exchange/issue, and returns the identifiers and validity of the grant. A member who already holds a live grant gets that grant back unchanged.",
75
+ "type": "object",
76
+ "additionalProperties": false,
77
+ "required": [
78
+ "memberDid"
79
+ ],
80
+ "properties": {
81
+ "memberDid": {
82
+ "type": "string",
83
+ "pattern": "^did:",
84
+ "description": "The member DID to grant the vetter role to — the subject of the role credential, and the DID the vetter signs statements with."
85
+ },
86
+ "validitySeconds": {
87
+ "type": "integer",
88
+ "minimum": 86400,
89
+ "maximum": 63072000,
90
+ "description": "OPTIONAL. How long the role credential is valid, from issuance: at least one day, at most two years. Absent: 31536000 (365 days). Ignored when the member already holds a live grant."
91
+ },
92
+ "ext": {
93
+ "$ref": "#/$defs/Ext"
94
+ }
95
+ },
96
+ "$defs": {
97
+ "Response": {
98
+ "$anchor": "response",
99
+ "title": "VTC Vetting — Vetters Grant — response payload",
100
+ "description": "The grant — newly issued, or the member's existing live grant.",
101
+ "type": "object",
102
+ "additionalProperties": false,
103
+ "required": [
104
+ "endorsementId",
105
+ "credentialId",
106
+ "validFrom",
107
+ "validUntil"
108
+ ],
109
+ "properties": {
110
+ "endorsementId": {
111
+ "type": "string",
112
+ "minLength": 1,
113
+ "maxLength": 128,
114
+ "description": "The community's endorsement record for this grant — the identifier vtc/endorsements/revoke takes."
115
+ },
116
+ "credentialId": {
117
+ "type": "string",
118
+ "minLength": 1,
119
+ "maxLength": 512,
120
+ "pattern": "^[a-zA-Z][a-zA-Z0-9+.-]*:\\S+$",
121
+ "description": "The `id` of the role credential, a URI."
122
+ },
123
+ "validFrom": {
124
+ "type": "string",
125
+ "format": "date-time",
126
+ "description": "The role credential's `validFrom`."
127
+ },
128
+ "validUntil": {
129
+ "type": "string",
130
+ "format": "date-time",
131
+ "description": "The role credential's `validUntil`."
132
+ },
133
+ "ext": {
134
+ "$ref": "#/$defs/Ext"
135
+ }
136
+ }
137
+ },
138
+ "Ext": {
139
+ "title": "Ext",
140
+ "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.",
141
+ "type": "object",
142
+ "minProperties": 1,
143
+ "additionalProperties": true,
144
+ "propertyNames": {
145
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
146
+ }
147
+ }
148
+ }
149
+ } as const;
150
+
151
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
152
+ export const RESPONSE_PAYLOAD_SCHEMA = {
153
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
154
+ "$ref": "#/$defs/Response",
155
+ "$defs": {
156
+ "Response": {
157
+ "$anchor": "response",
158
+ "title": "VTC Vetting — Vetters Grant — response payload",
159
+ "description": "The grant — newly issued, or the member's existing live grant.",
160
+ "type": "object",
161
+ "additionalProperties": false,
162
+ "required": [
163
+ "endorsementId",
164
+ "credentialId",
165
+ "validFrom",
166
+ "validUntil"
167
+ ],
168
+ "properties": {
169
+ "endorsementId": {
170
+ "type": "string",
171
+ "minLength": 1,
172
+ "maxLength": 128,
173
+ "description": "The community's endorsement record for this grant — the identifier vtc/endorsements/revoke takes."
174
+ },
175
+ "credentialId": {
176
+ "type": "string",
177
+ "minLength": 1,
178
+ "maxLength": 512,
179
+ "pattern": "^[a-zA-Z][a-zA-Z0-9+.-]*:\\S+$",
180
+ "description": "The `id` of the role credential, a URI."
181
+ },
182
+ "validFrom": {
183
+ "type": "string",
184
+ "format": "date-time",
185
+ "description": "The role credential's `validFrom`."
186
+ },
187
+ "validUntil": {
188
+ "type": "string",
189
+ "format": "date-time",
190
+ "description": "The role credential's `validUntil`."
191
+ },
192
+ "ext": {
193
+ "$ref": "#/$defs/Ext"
194
+ }
195
+ }
196
+ },
197
+ "Ext": {
198
+ "title": "Ext",
199
+ "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.",
200
+ "type": "object",
201
+ "minProperties": 1,
202
+ "additionalProperties": true,
203
+ "propertyNames": {
204
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
205
+ }
206
+ }
207
+ }
208
+ } as const;
209
+
210
+ /**
211
+ * SPEC.md §7.2 policy for the request variant, from this specification's
212
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
213
+ * per-specification and cannot be derived from the document alone, and
214
+ * item 2 needs the schema this carries.
215
+ */
216
+ export const SPEC = {
217
+ typeUri: TYPE_URI,
218
+ isBearer: false,
219
+ isProofRequired: true,
220
+ isRecipientRequired: true,
221
+ isIssuedAtRequired: true,
222
+ payloadSchema: PAYLOAD_SCHEMA,
223
+ } as const;
224
+
225
+ /**
226
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
227
+ * tracks the *issuer* party's requirement because a response swaps the
228
+ * parties (§7.3 item 5).
229
+ */
230
+ export const RESPONSE_SPEC = {
231
+ typeUri: RESPONSE_TYPE_URI,
232
+ isBearer: false,
233
+ isProofRequired: true,
234
+ isRecipientRequired: true,
235
+ isIssuedAtRequired: true,
236
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
237
+ } as const;