@openvtc/trust-tasks 0.17.8 → 0.17.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 (33) hide show
  1. package/CHANGELOG.md +111 -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 +3 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +3 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/persona/_shared/0.1/persona-record.d.ts +1 -1
  9. package/dist/persona/_shared/0.1/persona-record.d.ts.map +1 -1
  10. package/dist/persona/correlation/analyze/1.0/payload.d.ts +82 -0
  11. package/dist/persona/correlation/analyze/1.0/payload.d.ts.map +1 -1
  12. package/dist/persona/correlation/analyze/1.0/payload.js +34 -0
  13. package/dist/persona/correlation/analyze/1.0/payload.js.map +1 -1
  14. package/dist/persona/facet/delete/1.0/payload.d.ts +310 -0
  15. package/dist/persona/facet/delete/1.0/payload.d.ts.map +1 -0
  16. package/dist/persona/facet/delete/1.0/payload.js +169 -0
  17. package/dist/persona/facet/delete/1.0/payload.js.map +1 -0
  18. package/dist/persona/facet/list/1.0/payload.d.ts +599 -0
  19. package/dist/persona/facet/list/1.0/payload.d.ts.map +1 -0
  20. package/dist/persona/facet/list/1.0/payload.js +332 -0
  21. package/dist/persona/facet/list/1.0/payload.js.map +1 -0
  22. package/dist/persona/facet/put/1.0/payload.d.ts +490 -0
  23. package/dist/persona/facet/put/1.0/payload.d.ts.map +1 -0
  24. package/dist/persona/facet/put/1.0/payload.js +272 -0
  25. package/dist/persona/facet/put/1.0/payload.js.map +1 -0
  26. package/package.json +1 -1
  27. package/src/_shared/components.ts +4 -0
  28. package/src/index.ts +3 -0
  29. package/src/persona/_shared/0.1/persona-record.ts +1 -1
  30. package/src/persona/correlation/analyze/1.0/payload.ts +48 -0
  31. package/src/persona/facet/delete/1.0/payload.ts +212 -0
  32. package/src/persona/facet/list/1.0/payload.ts +402 -0
  33. package/src/persona/facet/put/1.0/payload.ts +339 -0
@@ -0,0 +1,339 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/persona/facet/put/1.0/payload.schema.json
4
+ */
5
+
6
+ import type { ExpectedVersion_PersonaV0_1 as ExpectedVersion, Ext, FacetColour, Ulid, Version_PersonaV0_1 as Version } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * Create or replace one facet: a named part of the holder's life, and the faces and attributes that belong to it. Omit `facetId` to create; supply it to replace. `expectedVersion` makes the write conditional.
11
+ */
12
+ export interface PersonaFacetPutPayload {
13
+ /**
14
+ * Omit to create — the maintainer assigns one and returns it. Supply to replace an existing facet, 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
+ facetId?: 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: FacetColour;
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 facet. A profile belongs to at most one facet — see `persona/facet/put:faceAlreadyPlaced` — because the facet 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 facet. 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/facet/put. Type https://trusttasks.org/spec/persona/facet/put/1.0#response. A failed precondition is not a success: it is a trust-task-error carrying persona/facet/put:versionConflict.
46
+ */
47
+ export interface PersonaFacetPutResponsePayload {
48
+ facetId: Ulid;
49
+ version: Version;
50
+ /**
51
+ * True when this write created the facet, false when it replaced one. A producer that omitted `facetId` 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, FacetColour, Ulid, Version };
61
+
62
+ /** Trust Task type URI. */
63
+ export const TYPE_URI = "https://trusttasks.org/spec/persona/facet/put/1.0" as const;
64
+
65
+ /** Stable alias for this specification's request payload shape. */
66
+ export type Payload = PersonaFacetPutPayload;
67
+
68
+ /** Trust Task response type URI (request type URI + "#response"). */
69
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/persona/facet/put/1.0#response" as const;
70
+
71
+ /** Stable alias for this specification's success-response payload shape. */
72
+ export type Response = PersonaFacetPutResponsePayload;
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/facet/put/1.0",
86
+ "title": "Persona — Facet Put — payload",
87
+ "description": "Create or replace one facet: a named part of the holder's life, and the faces and attributes that belong to it. Omit `facetId` 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
+ "facetId": {
96
+ "$ref": "#/$defs/Ulid",
97
+ "description": "Omit to create — the maintainer assigns one and returns it. Supply to replace an existing facet, 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/FacetColour"
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 facet. A profile belongs to at most one facet — see `persona/facet/put:faceAlreadyPlaced` — because the facet 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 facet. 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 Facet Put — response payload",
146
+ "description": "Success response to persona/facet/put. Type https://trusttasks.org/spec/persona/facet/put/1.0#response. A failed precondition is not a success: it is a trust-task-error carrying persona/facet/put:versionConflict.",
147
+ "type": "object",
148
+ "additionalProperties": false,
149
+ "required": [
150
+ "facetId",
151
+ "version",
152
+ "created",
153
+ "updatedAt"
154
+ ],
155
+ "properties": {
156
+ "facetId": {
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 facet, false when it replaced one. A producer that omitted `facetId` 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
+ "FacetColour": {
208
+ "title": "FacetColour",
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 Facet Put — response payload",
233
+ "description": "Success response to persona/facet/put. Type https://trusttasks.org/spec/persona/facet/put/1.0#response. A failed precondition is not a success: it is a trust-task-error carrying persona/facet/put:versionConflict.",
234
+ "type": "object",
235
+ "additionalProperties": false,
236
+ "required": [
237
+ "facetId",
238
+ "version",
239
+ "created",
240
+ "updatedAt"
241
+ ],
242
+ "properties": {
243
+ "facetId": {
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 facet, false when it replaced one. A producer that omitted `facetId` 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
+ "FacetColour": {
295
+ "title": "FacetColour",
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;