@openvtc/trust-tasks 0.19.21 → 0.20.0

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 (83) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/_shared/components.d.ts +59 -1
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/index.d.ts +5 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +5 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/messaging/_shared/0.1/messaging.d.ts +1 -1
  9. package/dist/messaging/_shared/0.1/messaging.d.ts.map +1 -1
  10. package/dist/messaging/account/add/0.1/payload.d.ts +274 -2
  11. package/dist/messaging/account/add/0.1/payload.d.ts.map +1 -1
  12. package/dist/messaging/account/add/0.1/payload.js +136 -0
  13. package/dist/messaging/account/add/0.1/payload.js.map +1 -1
  14. package/dist/messaging/account/change-queue-limits/0.1/payload.d.ts +274 -2
  15. package/dist/messaging/account/change-queue-limits/0.1/payload.d.ts.map +1 -1
  16. package/dist/messaging/account/change-queue-limits/0.1/payload.js +136 -0
  17. package/dist/messaging/account/change-queue-limits/0.1/payload.js.map +1 -1
  18. package/dist/messaging/account/change-type/0.1/payload.d.ts +274 -2
  19. package/dist/messaging/account/change-type/0.1/payload.d.ts.map +1 -1
  20. package/dist/messaging/account/change-type/0.1/payload.js +136 -0
  21. package/dist/messaging/account/change-type/0.1/payload.js.map +1 -1
  22. package/dist/messaging/account/get/0.1/payload.d.ts +286 -2
  23. package/dist/messaging/account/get/0.1/payload.d.ts.map +1 -1
  24. package/dist/messaging/account/get/0.1/payload.js +140 -0
  25. package/dist/messaging/account/get/0.1/payload.js.map +1 -1
  26. package/dist/messaging/account/list/0.1/payload.d.ts +286 -2
  27. package/dist/messaging/account/list/0.1/payload.d.ts.map +1 -1
  28. package/dist/messaging/account/list/0.1/payload.js +140 -0
  29. package/dist/messaging/account/list/0.1/payload.js.map +1 -1
  30. package/dist/messaging/account/update/0.1/payload.d.ts +274 -2
  31. package/dist/messaging/account/update/0.1/payload.d.ts.map +1 -1
  32. package/dist/messaging/account/update/0.1/payload.js +136 -0
  33. package/dist/messaging/account/update/0.1/payload.js.map +1 -1
  34. package/dist/persona/_shared/0.1/persona-record.d.ts +1 -1
  35. package/dist/persona/_shared/0.1/persona-record.d.ts.map +1 -1
  36. package/dist/persona/correlation/analyze/1.1/payload.d.ts +730 -0
  37. package/dist/persona/correlation/analyze/1.1/payload.d.ts.map +1 -0
  38. package/dist/persona/correlation/analyze/1.1/payload.js +372 -0
  39. package/dist/persona/correlation/analyze/1.1/payload.js.map +1 -0
  40. package/dist/persona/facet/list/1.0/payload.d.ts +4 -4
  41. package/dist/persona/facet/list/1.0/payload.js +2 -2
  42. package/dist/persona/facet/list/1.0/payload.js.map +1 -1
  43. package/dist/persona/facet/put/1.0/payload.d.ts +4 -4
  44. package/dist/persona/facet/put/1.0/payload.js +2 -2
  45. package/dist/persona/facet/put/1.0/payload.js.map +1 -1
  46. package/dist/persona/local/profile/put/1.0/payload.d.ts +10 -10
  47. package/dist/persona/local/profile/put/1.0/payload.js +4 -4
  48. package/dist/persona/local/profile/put/1.0/payload.js.map +1 -1
  49. package/dist/persona/world/delete/1.0/payload.d.ts +310 -0
  50. package/dist/persona/world/delete/1.0/payload.d.ts.map +1 -0
  51. package/dist/persona/world/delete/1.0/payload.js +169 -0
  52. package/dist/persona/world/delete/1.0/payload.js.map +1 -0
  53. package/dist/persona/world/list/1.0/payload.d.ts +599 -0
  54. package/dist/persona/world/list/1.0/payload.d.ts.map +1 -0
  55. package/dist/persona/world/list/1.0/payload.js +332 -0
  56. package/dist/persona/world/list/1.0/payload.js.map +1 -0
  57. package/dist/persona/world/put/1.0/payload.d.ts +490 -0
  58. package/dist/persona/world/put/1.0/payload.d.ts.map +1 -0
  59. package/dist/persona/world/put/1.0/payload.js +272 -0
  60. package/dist/persona/world/put/1.0/payload.js.map +1 -0
  61. package/dist/vtc/vetting/vetters/show/0.1/payload.d.ts +378 -0
  62. package/dist/vtc/vetting/vetters/show/0.1/payload.d.ts.map +1 -0
  63. package/dist/vtc/vetting/vetters/show/0.1/payload.js +207 -0
  64. package/dist/vtc/vetting/vetters/show/0.1/payload.js.map +1 -0
  65. package/package.json +1 -1
  66. package/src/_shared/components.ts +59 -1
  67. package/src/index.ts +5 -0
  68. package/src/messaging/_shared/0.1/messaging.ts +1 -1
  69. package/src/messaging/account/add/0.1/payload.ts +138 -2
  70. package/src/messaging/account/change-queue-limits/0.1/payload.ts +138 -2
  71. package/src/messaging/account/change-type/0.1/payload.ts +138 -2
  72. package/src/messaging/account/get/0.1/payload.ts +146 -2
  73. package/src/messaging/account/list/0.1/payload.ts +146 -2
  74. package/src/messaging/account/update/0.1/payload.ts +138 -2
  75. package/src/persona/_shared/0.1/persona-record.ts +1 -1
  76. package/src/persona/correlation/analyze/1.1/payload.ts +514 -0
  77. package/src/persona/facet/list/1.0/payload.ts +2 -2
  78. package/src/persona/facet/put/1.0/payload.ts +2 -2
  79. package/src/persona/local/profile/put/1.0/payload.ts +6 -6
  80. package/src/persona/world/delete/1.0/payload.ts +212 -0
  81. package/src/persona/world/list/1.0/payload.ts +402 -0
  82. package/src/persona/world/put/1.0/payload.ts +339 -0
  83. package/src/vtc/vetting/vetters/show/0.1/payload.ts +267 -0
@@ -0,0 +1,339 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/persona/world/put/1.0/payload.schema.json
4
+ */
5
+
6
+ import type { ExpectedVersion_PersonaV0_1 as ExpectedVersion, Ext, Ulid, Version_PersonaV0_1 as Version, WorldColour } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * Create or replace one world: a named part of the holder's life, and the faces and attributes that belong to it. Omit `worldId` to create; supply it to replace. `expectedVersion` makes the write conditional.
11
+ */
12
+ export interface PersonaWorldPutPayload {
13
+ /**
14
+ * Omit to create — the maintainer assigns one and returns it. Supply to replace an existing world, or to make a create idempotent under retry; a supplied id that already exists is a replacement, and a producer that meant to create MUST pair it with `expectedVersion: 0`.
15
+ */
16
+ worldId?: Ulid;
17
+ /**
18
+ * The holder's name for this part of their life — "Work", "Home", "Play". Never disclosed to a verifier; it is how the holder finds it again. A maintainer MUST NOT interpret it: it is not a scope, a policy input, or a name a counterparty ever sees.
19
+ */
20
+ name: string;
21
+ colour: WorldColour;
22
+ /**
23
+ * One or two emoji, as a decorative mark beside the name. Bounded at 8 bytes because it is a mark and not a field: anything longer is text, and text belongs in `name` where a consumer will lay it out. A maintainer stores it opaquely and MUST NOT parse it; a consumer that cannot render emoji omits it and shows the name, which is why it is OPTIONAL and carries no meaning of its own.
24
+ */
25
+ icon?: string;
26
+ /**
27
+ * Profiles belonging to this world. A profile belongs to at most one world — see `persona/world/put:faceAlreadyPlaced` — because the world is where a consumer reads a profile's colour from, and two answers is no answer. Omission on a replace means an empty list, not 'leave as they were': this is a replace, and a member whose absence meant 'keep' would make it impossible to empty one.
28
+ *
29
+ * @maxItems 256
30
+ */
31
+ faceIds?: Ulid[];
32
+ /**
33
+ * Attributes belonging to this world. Unlike a profile, an attribute MAY belong to several — a mobile number is genuinely both work and home — so no exclusivity is enforced and none should be inferred. Same replace semantics as `faceIds`.
34
+ *
35
+ * @maxItems 1024
36
+ */
37
+ attributeIds?: Ulid[];
38
+ /**
39
+ * Optional precondition. Omit for last-writer-wins. Supply the version a prior read returned to make the write conditional; supply 0 to create only.
40
+ */
41
+ expectedVersion?: ExpectedVersion;
42
+ ext?: Ext;
43
+ }
44
+ /**
45
+ * Success response to persona/world/put. Type https://trusttasks.org/spec/persona/world/put/1.0#response. A failed precondition is not a success: it is a trust-task-error carrying persona/world/put:versionConflict.
46
+ */
47
+ export interface PersonaWorldPutResponsePayload {
48
+ worldId: Ulid;
49
+ version: Version;
50
+ /**
51
+ * True when this write created the world, false when it replaced one. A producer that omitted `worldId` can still be told which happened, because a retried create with a supplied id is a replacement.
52
+ */
53
+ created: boolean;
54
+ createdAt?: string;
55
+ updatedAt: string;
56
+ ext?: Ext;
57
+ }
58
+
59
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
60
+ export type { ExpectedVersion, Ext, Ulid, Version, WorldColour };
61
+
62
+ /** Trust Task type URI. */
63
+ export const TYPE_URI = "https://trusttasks.org/spec/persona/world/put/1.0" as const;
64
+
65
+ /** Stable alias for this specification's request payload shape. */
66
+ export type Payload = PersonaWorldPutPayload;
67
+
68
+ /** Trust Task response type URI (request type URI + "#response"). */
69
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/persona/world/put/1.0#response" as const;
70
+
71
+ /** Stable alias for this specification's success-response payload shape. */
72
+ export type Response = PersonaWorldPutResponsePayload;
73
+
74
+ /**
75
+ * This specification's payload schema, as a value.
76
+ *
77
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
78
+ * rather than only as a `.json` file because TypeScript types are erased
79
+ * at runtime: without a schema a consumer has nothing to validate, and
80
+ * every REQUIRED payload member is optional in practice. Cross-file
81
+ * `$ref`s are already inlined, so it needs no resolver.
82
+ */
83
+ export const PAYLOAD_SCHEMA = {
84
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
85
+ "$id": "https://trusttasks.org/spec/persona/world/put/1.0",
86
+ "title": "Persona — World Put — payload",
87
+ "description": "Create or replace one world: a named part of the holder's life, and the faces and attributes that belong to it. Omit `worldId` to create; supply it to replace. `expectedVersion` makes the write conditional.",
88
+ "type": "object",
89
+ "additionalProperties": false,
90
+ "required": [
91
+ "name",
92
+ "colour"
93
+ ],
94
+ "properties": {
95
+ "worldId": {
96
+ "$ref": "#/$defs/Ulid",
97
+ "description": "Omit to create — the maintainer assigns one and returns it. Supply to replace an existing world, or to make a create idempotent under retry; a supplied id that already exists is a replacement, and a producer that meant to create MUST pair it with `expectedVersion: 0`."
98
+ },
99
+ "name": {
100
+ "type": "string",
101
+ "minLength": 1,
102
+ "maxLength": 64,
103
+ "description": "The holder's name for this part of their life — \"Work\", \"Home\", \"Play\". Never disclosed to a verifier; it is how the holder finds it again. A maintainer MUST NOT interpret it: it is not a scope, a policy input, or a name a counterparty ever sees."
104
+ },
105
+ "colour": {
106
+ "$ref": "#/$defs/WorldColour"
107
+ },
108
+ "icon": {
109
+ "type": "string",
110
+ "minLength": 1,
111
+ "maxLength": 8,
112
+ "description": "One or two emoji, as a decorative mark beside the name. Bounded at 8 bytes because it is a mark and not a field: anything longer is text, and text belongs in `name` where a consumer will lay it out. A maintainer stores it opaquely and MUST NOT parse it; a consumer that cannot render emoji omits it and shows the name, which is why it is OPTIONAL and carries no meaning of its own."
113
+ },
114
+ "faceIds": {
115
+ "type": "array",
116
+ "maxItems": 256,
117
+ "uniqueItems": true,
118
+ "default": [],
119
+ "items": {
120
+ "$ref": "#/$defs/Ulid"
121
+ },
122
+ "description": "Profiles belonging to this world. A profile belongs to at most one world — see `persona/world/put:faceAlreadyPlaced` — because the world is where a consumer reads a profile's colour from, and two answers is no answer. Omission on a replace means an empty list, not 'leave as they were': this is a replace, and a member whose absence meant 'keep' would make it impossible to empty one."
123
+ },
124
+ "attributeIds": {
125
+ "type": "array",
126
+ "maxItems": 1024,
127
+ "uniqueItems": true,
128
+ "default": [],
129
+ "items": {
130
+ "$ref": "#/$defs/Ulid"
131
+ },
132
+ "description": "Attributes belonging to this world. Unlike a profile, an attribute MAY belong to several — a mobile number is genuinely both work and home — so no exclusivity is enforced and none should be inferred. Same replace semantics as `faceIds`."
133
+ },
134
+ "expectedVersion": {
135
+ "$ref": "#/$defs/ExpectedVersion",
136
+ "description": "Optional precondition. Omit for last-writer-wins. Supply the version a prior read returned to make the write conditional; supply 0 to create only."
137
+ },
138
+ "ext": {
139
+ "$ref": "#/$defs/Ext"
140
+ }
141
+ },
142
+ "$defs": {
143
+ "Response": {
144
+ "$anchor": "response",
145
+ "title": "Persona World Put — response payload",
146
+ "description": "Success response to persona/world/put. Type https://trusttasks.org/spec/persona/world/put/1.0#response. A failed precondition is not a success: it is a trust-task-error carrying persona/world/put:versionConflict.",
147
+ "type": "object",
148
+ "additionalProperties": false,
149
+ "required": [
150
+ "worldId",
151
+ "version",
152
+ "created",
153
+ "updatedAt"
154
+ ],
155
+ "properties": {
156
+ "worldId": {
157
+ "$ref": "#/$defs/Ulid"
158
+ },
159
+ "version": {
160
+ "$ref": "#/$defs/Version"
161
+ },
162
+ "created": {
163
+ "type": "boolean",
164
+ "description": "True when this write created the world, false when it replaced one. A producer that omitted `worldId` can still be told which happened, because a retried create with a supplied id is a replacement."
165
+ },
166
+ "createdAt": {
167
+ "type": "string",
168
+ "format": "date-time"
169
+ },
170
+ "updatedAt": {
171
+ "type": "string",
172
+ "format": "date-time"
173
+ },
174
+ "ext": {
175
+ "$ref": "#/$defs/Ext"
176
+ }
177
+ }
178
+ },
179
+ "Ext": {
180
+ "title": "Ext",
181
+ "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.",
182
+ "type": "object",
183
+ "minProperties": 1,
184
+ "additionalProperties": true,
185
+ "propertyNames": {
186
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
187
+ }
188
+ },
189
+ "Version": {
190
+ "title": "Version",
191
+ "description": "A value of the store's monotonic write counter. Server-assigned; a producer never chooses one.",
192
+ "type": "integer",
193
+ "minimum": 1
194
+ },
195
+ "Ulid": {
196
+ "title": "Ulid",
197
+ "description": "A ULID in Crockford base32, uppercase. Used for `attributeId` and `profileId`. Chosen over a UUID because the leading 48 bits are a timestamp, so a key-ordered scan of the store is also creation-ordered and a `list` needs no secondary sort. Server-assigned on create; a producer MAY supply one to make a create idempotent, and a maintainer MUST reject a supplied value that already exists rather than silently overwriting.",
198
+ "type": "string",
199
+ "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$"
200
+ },
201
+ "ExpectedVersion": {
202
+ "title": "ExpectedVersion",
203
+ "description": "Optimistic-concurrency precondition. A positive value requires the record's current `version` to equal it exactly; zero means create-only and applies only when no live record exists at the address.",
204
+ "type": "integer",
205
+ "minimum": 0
206
+ },
207
+ "WorldColour": {
208
+ "title": "WorldColour",
209
+ "description": "A colour **name**, resolved by each consumer against its own palette — never a hex value or any other literal. Two reasons, and both are about the consumer rather than the holder. A literal cannot be legible in a terminal, in a light theme and in a dark one at once, so a stored `#8B0000` is a colour that is wrong somewhere and the holder has no way to know where. And a consumer that reserves colours to mean something — an error, a warning, an irreversible act — must be able to keep a holder's decorative choice out of that channel; it cannot do that with an arbitrary value, and it can do it trivially with a closed set it maps itself. The eight members are chosen to be distinguishable from one another and deliberately carry no status connotation: none is named for success, warning or danger.",
210
+ "type": "string",
211
+ "enum": [
212
+ "slate",
213
+ "indigo",
214
+ "teal",
215
+ "moss",
216
+ "sand",
217
+ "clay",
218
+ "rose",
219
+ "plum"
220
+ ]
221
+ }
222
+ }
223
+ } as const;
224
+
225
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
226
+ export const RESPONSE_PAYLOAD_SCHEMA = {
227
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
228
+ "$ref": "#/$defs/Response",
229
+ "$defs": {
230
+ "Response": {
231
+ "$anchor": "response",
232
+ "title": "Persona World Put — response payload",
233
+ "description": "Success response to persona/world/put. Type https://trusttasks.org/spec/persona/world/put/1.0#response. A failed precondition is not a success: it is a trust-task-error carrying persona/world/put:versionConflict.",
234
+ "type": "object",
235
+ "additionalProperties": false,
236
+ "required": [
237
+ "worldId",
238
+ "version",
239
+ "created",
240
+ "updatedAt"
241
+ ],
242
+ "properties": {
243
+ "worldId": {
244
+ "$ref": "#/$defs/Ulid"
245
+ },
246
+ "version": {
247
+ "$ref": "#/$defs/Version"
248
+ },
249
+ "created": {
250
+ "type": "boolean",
251
+ "description": "True when this write created the world, false when it replaced one. A producer that omitted `worldId` can still be told which happened, because a retried create with a supplied id is a replacement."
252
+ },
253
+ "createdAt": {
254
+ "type": "string",
255
+ "format": "date-time"
256
+ },
257
+ "updatedAt": {
258
+ "type": "string",
259
+ "format": "date-time"
260
+ },
261
+ "ext": {
262
+ "$ref": "#/$defs/Ext"
263
+ }
264
+ }
265
+ },
266
+ "Ext": {
267
+ "title": "Ext",
268
+ "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.",
269
+ "type": "object",
270
+ "minProperties": 1,
271
+ "additionalProperties": true,
272
+ "propertyNames": {
273
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
274
+ }
275
+ },
276
+ "Version": {
277
+ "title": "Version",
278
+ "description": "A value of the store's monotonic write counter. Server-assigned; a producer never chooses one.",
279
+ "type": "integer",
280
+ "minimum": 1
281
+ },
282
+ "Ulid": {
283
+ "title": "Ulid",
284
+ "description": "A ULID in Crockford base32, uppercase. Used for `attributeId` and `profileId`. Chosen over a UUID because the leading 48 bits are a timestamp, so a key-ordered scan of the store is also creation-ordered and a `list` needs no secondary sort. Server-assigned on create; a producer MAY supply one to make a create idempotent, and a maintainer MUST reject a supplied value that already exists rather than silently overwriting.",
285
+ "type": "string",
286
+ "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$"
287
+ },
288
+ "ExpectedVersion": {
289
+ "title": "ExpectedVersion",
290
+ "description": "Optimistic-concurrency precondition. A positive value requires the record's current `version` to equal it exactly; zero means create-only and applies only when no live record exists at the address.",
291
+ "type": "integer",
292
+ "minimum": 0
293
+ },
294
+ "WorldColour": {
295
+ "title": "WorldColour",
296
+ "description": "A colour **name**, resolved by each consumer against its own palette — never a hex value or any other literal. Two reasons, and both are about the consumer rather than the holder. A literal cannot be legible in a terminal, in a light theme and in a dark one at once, so a stored `#8B0000` is a colour that is wrong somewhere and the holder has no way to know where. And a consumer that reserves colours to mean something — an error, a warning, an irreversible act — must be able to keep a holder's decorative choice out of that channel; it cannot do that with an arbitrary value, and it can do it trivially with a closed set it maps itself. The eight members are chosen to be distinguishable from one another and deliberately carry no status connotation: none is named for success, warning or danger.",
297
+ "type": "string",
298
+ "enum": [
299
+ "slate",
300
+ "indigo",
301
+ "teal",
302
+ "moss",
303
+ "sand",
304
+ "clay",
305
+ "rose",
306
+ "plum"
307
+ ]
308
+ }
309
+ }
310
+ } as const;
311
+
312
+ /**
313
+ * SPEC.md §7.2 policy for the request variant, from this specification's
314
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
315
+ * per-specification and cannot be derived from the document alone, and
316
+ * item 2 needs the schema this carries.
317
+ */
318
+ export const SPEC = {
319
+ typeUri: TYPE_URI,
320
+ isBearer: false,
321
+ isProofRequired: true,
322
+ isRecipientRequired: true,
323
+ isIssuedAtRequired: true,
324
+ payloadSchema: PAYLOAD_SCHEMA,
325
+ } as const;
326
+
327
+ /**
328
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
329
+ * tracks the *issuer* party's requirement because a response swaps the
330
+ * parties (§7.3 item 5).
331
+ */
332
+ export const RESPONSE_SPEC = {
333
+ typeUri: RESPONSE_TYPE_URI,
334
+ isBearer: false,
335
+ isProofRequired: true,
336
+ isRecipientRequired: true,
337
+ isIssuedAtRequired: true,
338
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
339
+ } as const;
@@ -0,0 +1,267 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vtc/vetting/vetters/show/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { Ext } from "../../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * The state of a vetter's grant in this community. The three refusing values are deliberately distinct: `revoked` says the community withdrew a grant it had made, `expired` says one ran out, and `none` says there is nothing to withdraw. An applicant reads those differently, and so does a vetter checking their own standing.
11
+ */
12
+ export type GrantStatus = "live" | "revoked" | "expired" | "none";
13
+
14
+ /**
15
+ * An authenticated applicant or member asks a community about one vetter, by DID. The answer is the state of that vetter's grant — `live`, `revoked`, `expired` or `none` — which a list of vetters cannot express, because an absent vetter and a revoked one look identical in it. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.
16
+ */
17
+ export interface VTCVettingShowVetterPayload {
18
+ /**
19
+ * The DID of the vetter being asked about — the subject of the vetter role credential. The caller usually holds it from an earlier listing, or from a vetting exchange that has since gone quiet.
20
+ */
21
+ vetterDid: string;
22
+ ext?: Ext;
23
+ }
24
+ /**
25
+ * One vetter's grant status. Carries no profile: what a vetter published for a directory is answered by vtc/vetting/vetters/list, and this task answers a caller who already knows which vetter they mean.
26
+ */
27
+ export interface VTCVettingShowVetterResponsePayload {
28
+ /**
29
+ * The DID asked about, echoed so a response is self-contained.
30
+ */
31
+ vetterDid: string;
32
+ status: GrantStatus;
33
+ /**
34
+ * The identifier of the grant this status is about. Present for `live`, `revoked` and `expired`; absent for `none`, which is the absence of a grant and so has nothing to identify.
35
+ */
36
+ grantId?: string;
37
+ /**
38
+ * The grant's `validUntil`. Present for `live` and `expired` — for `expired` it is when it ran out, which tells a caller whether it lapsed long ago or yesterday. Absent for `none`, and for `revoked`, where the revocation and not the expiry is what ended it.
39
+ */
40
+ validUntil?: string;
41
+ /**
42
+ * When the grant was revoked. Present only for `revoked`. The reason is deliberately not carried: it is the community's internal record, and an applicant needs to know the grant does not hold, not why.
43
+ */
44
+ revokedAt?: string;
45
+ /**
46
+ * Whether this vetter has a profile stored with `listed: true`, and so would appear in vtc/vetting/vetters/list. Present only for `live`. It is what separates the two reasons a live vetter is missing from a listing: unlisted by choice, rather than not a vetter.
47
+ */
48
+ listed?: boolean;
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/vtc/vetting/vetters/show/0.1" as const;
57
+
58
+ /** Stable alias for this specification's request payload shape. */
59
+ export type Payload = VTCVettingShowVetterPayload;
60
+
61
+ /** Trust Task response type URI (request type URI + "#response"). */
62
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/vetting/vetters/show/0.1#response" as const;
63
+
64
+ /** Stable alias for this specification's success-response payload shape. */
65
+ export type Response = VTCVettingShowVetterResponsePayload;
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/vtc/vetting/vetters/show/0.1",
79
+ "title": "VTC Vetting — Show Vetter — payload",
80
+ "description": "An authenticated applicant or member asks a community about one vetter, by DID. The answer is the state of that vetter's grant — `live`, `revoked`, `expired` or `none` — which a list of vetters cannot express, because an absent vetter and a revoked one look identical in it. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.",
81
+ "type": "object",
82
+ "additionalProperties": false,
83
+ "required": [
84
+ "vetterDid"
85
+ ],
86
+ "properties": {
87
+ "vetterDid": {
88
+ "type": "string",
89
+ "pattern": "^did:",
90
+ "minLength": 1,
91
+ "maxLength": 2048,
92
+ "description": "The DID of the vetter being asked about — the subject of the vetter role credential. The caller usually holds it from an earlier listing, or from a vetting exchange that has since gone quiet."
93
+ },
94
+ "ext": {
95
+ "$ref": "#/$defs/Ext"
96
+ }
97
+ },
98
+ "$defs": {
99
+ "GrantStatus": {
100
+ "title": "GrantStatus",
101
+ "description": "The state of a vetter's grant in this community. The three refusing values are deliberately distinct: `revoked` says the community withdrew a grant it had made, `expired` says one ran out, and `none` says there is nothing to withdraw. An applicant reads those differently, and so does a vetter checking their own standing.",
102
+ "type": "string",
103
+ "enum": [
104
+ "live",
105
+ "revoked",
106
+ "expired",
107
+ "none"
108
+ ]
109
+ },
110
+ "Response": {
111
+ "$anchor": "response",
112
+ "title": "VTC Vetting — Show Vetter — response payload",
113
+ "description": "One vetter's grant status. Carries no profile: what a vetter published for a directory is answered by vtc/vetting/vetters/list, and this task answers a caller who already knows which vetter they mean.",
114
+ "type": "object",
115
+ "additionalProperties": false,
116
+ "required": [
117
+ "vetterDid",
118
+ "status"
119
+ ],
120
+ "properties": {
121
+ "vetterDid": {
122
+ "type": "string",
123
+ "pattern": "^did:",
124
+ "description": "The DID asked about, echoed so a response is self-contained."
125
+ },
126
+ "status": {
127
+ "$ref": "#/$defs/GrantStatus"
128
+ },
129
+ "grantId": {
130
+ "type": "string",
131
+ "minLength": 1,
132
+ "maxLength": 512,
133
+ "description": "The identifier of the grant this status is about. Present for `live`, `revoked` and `expired`; absent for `none`, which is the absence of a grant and so has nothing to identify."
134
+ },
135
+ "validUntil": {
136
+ "type": "string",
137
+ "format": "date-time",
138
+ "description": "The grant's `validUntil`. Present for `live` and `expired` — for `expired` it is when it ran out, which tells a caller whether it lapsed long ago or yesterday. Absent for `none`, and for `revoked`, where the revocation and not the expiry is what ended it."
139
+ },
140
+ "revokedAt": {
141
+ "type": "string",
142
+ "format": "date-time",
143
+ "description": "When the grant was revoked. Present only for `revoked`. The reason is deliberately not carried: it is the community's internal record, and an applicant needs to know the grant does not hold, not why."
144
+ },
145
+ "listed": {
146
+ "type": "boolean",
147
+ "description": "Whether this vetter has a profile stored with `listed: true`, and so would appear in vtc/vetting/vetters/list. Present only for `live`. It is what separates the two reasons a live vetter is missing from a listing: unlisted by choice, rather than not a vetter."
148
+ },
149
+ "ext": {
150
+ "$ref": "#/$defs/Ext"
151
+ }
152
+ }
153
+ },
154
+ "Ext": {
155
+ "title": "Ext",
156
+ "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.",
157
+ "type": "object",
158
+ "minProperties": 1,
159
+ "additionalProperties": true,
160
+ "propertyNames": {
161
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
162
+ }
163
+ }
164
+ }
165
+ } as const;
166
+
167
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
168
+ export const RESPONSE_PAYLOAD_SCHEMA = {
169
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
170
+ "$ref": "#/$defs/Response",
171
+ "$defs": {
172
+ "GrantStatus": {
173
+ "title": "GrantStatus",
174
+ "description": "The state of a vetter's grant in this community. The three refusing values are deliberately distinct: `revoked` says the community withdrew a grant it had made, `expired` says one ran out, and `none` says there is nothing to withdraw. An applicant reads those differently, and so does a vetter checking their own standing.",
175
+ "type": "string",
176
+ "enum": [
177
+ "live",
178
+ "revoked",
179
+ "expired",
180
+ "none"
181
+ ]
182
+ },
183
+ "Response": {
184
+ "$anchor": "response",
185
+ "title": "VTC Vetting — Show Vetter — response payload",
186
+ "description": "One vetter's grant status. Carries no profile: what a vetter published for a directory is answered by vtc/vetting/vetters/list, and this task answers a caller who already knows which vetter they mean.",
187
+ "type": "object",
188
+ "additionalProperties": false,
189
+ "required": [
190
+ "vetterDid",
191
+ "status"
192
+ ],
193
+ "properties": {
194
+ "vetterDid": {
195
+ "type": "string",
196
+ "pattern": "^did:",
197
+ "description": "The DID asked about, echoed so a response is self-contained."
198
+ },
199
+ "status": {
200
+ "$ref": "#/$defs/GrantStatus"
201
+ },
202
+ "grantId": {
203
+ "type": "string",
204
+ "minLength": 1,
205
+ "maxLength": 512,
206
+ "description": "The identifier of the grant this status is about. Present for `live`, `revoked` and `expired`; absent for `none`, which is the absence of a grant and so has nothing to identify."
207
+ },
208
+ "validUntil": {
209
+ "type": "string",
210
+ "format": "date-time",
211
+ "description": "The grant's `validUntil`. Present for `live` and `expired` — for `expired` it is when it ran out, which tells a caller whether it lapsed long ago or yesterday. Absent for `none`, and for `revoked`, where the revocation and not the expiry is what ended it."
212
+ },
213
+ "revokedAt": {
214
+ "type": "string",
215
+ "format": "date-time",
216
+ "description": "When the grant was revoked. Present only for `revoked`. The reason is deliberately not carried: it is the community's internal record, and an applicant needs to know the grant does not hold, not why."
217
+ },
218
+ "listed": {
219
+ "type": "boolean",
220
+ "description": "Whether this vetter has a profile stored with `listed: true`, and so would appear in vtc/vetting/vetters/list. Present only for `live`. It is what separates the two reasons a live vetter is missing from a listing: unlisted by choice, rather than not a vetter."
221
+ },
222
+ "ext": {
223
+ "$ref": "#/$defs/Ext"
224
+ }
225
+ }
226
+ },
227
+ "Ext": {
228
+ "title": "Ext",
229
+ "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.",
230
+ "type": "object",
231
+ "minProperties": 1,
232
+ "additionalProperties": true,
233
+ "propertyNames": {
234
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
235
+ }
236
+ }
237
+ }
238
+ } as const;
239
+
240
+ /**
241
+ * SPEC.md §7.2 policy for the request variant, from this specification's
242
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
243
+ * per-specification and cannot be derived from the document alone, and
244
+ * item 2 needs the schema this carries.
245
+ */
246
+ export const SPEC = {
247
+ typeUri: TYPE_URI,
248
+ isBearer: false,
249
+ isProofRequired: false,
250
+ isRecipientRequired: true,
251
+ isIssuedAtRequired: false,
252
+ payloadSchema: PAYLOAD_SCHEMA,
253
+ } as const;
254
+
255
+ /**
256
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
257
+ * tracks the *issuer* party's requirement because a response swaps the
258
+ * parties (§7.3 item 5).
259
+ */
260
+ export const RESPONSE_SPEC = {
261
+ typeUri: RESPONSE_TYPE_URI,
262
+ isBearer: false,
263
+ isProofRequired: false,
264
+ isRecipientRequired: true,
265
+ isIssuedAtRequired: false,
266
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
267
+ } as const;