@openvtc/trust-tasks 0.17.8 → 0.17.9
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.
- package/CHANGELOG.md +66 -0
- package/dist/_shared/components.d.ts +4 -0
- package/dist/_shared/components.d.ts.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/persona/_shared/0.1/persona-record.d.ts +1 -1
- package/dist/persona/_shared/0.1/persona-record.d.ts.map +1 -1
- package/dist/persona/facet/delete/1.0/payload.d.ts +310 -0
- package/dist/persona/facet/delete/1.0/payload.d.ts.map +1 -0
- package/dist/persona/facet/delete/1.0/payload.js +169 -0
- package/dist/persona/facet/delete/1.0/payload.js.map +1 -0
- package/dist/persona/facet/list/1.0/payload.d.ts +599 -0
- package/dist/persona/facet/list/1.0/payload.d.ts.map +1 -0
- package/dist/persona/facet/list/1.0/payload.js +332 -0
- package/dist/persona/facet/list/1.0/payload.js.map +1 -0
- package/dist/persona/facet/put/1.0/payload.d.ts +490 -0
- package/dist/persona/facet/put/1.0/payload.d.ts.map +1 -0
- package/dist/persona/facet/put/1.0/payload.js +272 -0
- package/dist/persona/facet/put/1.0/payload.js.map +1 -0
- package/package.json +1 -1
- package/src/_shared/components.ts +4 -0
- package/src/index.ts +3 -0
- package/src/persona/_shared/0.1/persona-record.ts +1 -1
- package/src/persona/facet/delete/1.0/payload.ts +212 -0
- package/src/persona/facet/list/1.0/payload.ts +402 -0
- package/src/persona/facet/put/1.0/payload.ts +339 -0
|
@@ -0,0 +1,490 @@
|
|
|
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
|
+
import type { ExpectedVersion_PersonaV0_1 as ExpectedVersion, Ext, FacetColour, Ulid, Version_PersonaV0_1 as Version } from "../../../../_shared/components.js";
|
|
6
|
+
/**
|
|
7
|
+
* 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.
|
|
8
|
+
*/
|
|
9
|
+
export interface PersonaFacetPutPayload {
|
|
10
|
+
/**
|
|
11
|
+
* 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`.
|
|
12
|
+
*/
|
|
13
|
+
facetId?: Ulid;
|
|
14
|
+
/**
|
|
15
|
+
* 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.
|
|
16
|
+
*/
|
|
17
|
+
name: string;
|
|
18
|
+
colour: FacetColour;
|
|
19
|
+
/**
|
|
20
|
+
* 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.
|
|
21
|
+
*/
|
|
22
|
+
icon?: string;
|
|
23
|
+
/**
|
|
24
|
+
* 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.
|
|
25
|
+
*
|
|
26
|
+
* @maxItems 256
|
|
27
|
+
*/
|
|
28
|
+
faceIds?: Ulid[];
|
|
29
|
+
/**
|
|
30
|
+
* 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`.
|
|
31
|
+
*
|
|
32
|
+
* @maxItems 1024
|
|
33
|
+
*/
|
|
34
|
+
attributeIds?: Ulid[];
|
|
35
|
+
/**
|
|
36
|
+
* Optional precondition. Omit for last-writer-wins. Supply the version a prior read returned to make the write conditional; supply 0 to create only.
|
|
37
|
+
*/
|
|
38
|
+
expectedVersion?: ExpectedVersion;
|
|
39
|
+
ext?: Ext;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* 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.
|
|
43
|
+
*/
|
|
44
|
+
export interface PersonaFacetPutResponsePayload {
|
|
45
|
+
facetId: Ulid;
|
|
46
|
+
version: Version;
|
|
47
|
+
/**
|
|
48
|
+
* 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.
|
|
49
|
+
*/
|
|
50
|
+
created: boolean;
|
|
51
|
+
createdAt?: string;
|
|
52
|
+
updatedAt: string;
|
|
53
|
+
ext?: Ext;
|
|
54
|
+
}
|
|
55
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
56
|
+
export type { ExpectedVersion, Ext, FacetColour, Ulid, Version };
|
|
57
|
+
/** Trust Task type URI. */
|
|
58
|
+
export declare const TYPE_URI: "https://trusttasks.org/spec/persona/facet/put/1.0";
|
|
59
|
+
/** Stable alias for this specification's request payload shape. */
|
|
60
|
+
export type Payload = PersonaFacetPutPayload;
|
|
61
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
62
|
+
export declare const RESPONSE_TYPE_URI: "https://trusttasks.org/spec/persona/facet/put/1.0#response";
|
|
63
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
64
|
+
export type Response = PersonaFacetPutResponsePayload;
|
|
65
|
+
/**
|
|
66
|
+
* This specification's payload schema, as a value.
|
|
67
|
+
*
|
|
68
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
69
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
70
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
71
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
72
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
73
|
+
*/
|
|
74
|
+
export declare const PAYLOAD_SCHEMA: {
|
|
75
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
76
|
+
readonly $id: "https://trusttasks.org/spec/persona/facet/put/1.0";
|
|
77
|
+
readonly title: "Persona — Facet Put — payload";
|
|
78
|
+
readonly 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.";
|
|
79
|
+
readonly type: "object";
|
|
80
|
+
readonly additionalProperties: false;
|
|
81
|
+
readonly required: readonly ["name", "colour"];
|
|
82
|
+
readonly properties: {
|
|
83
|
+
readonly facetId: {
|
|
84
|
+
readonly $ref: "#/$defs/Ulid";
|
|
85
|
+
readonly 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`.";
|
|
86
|
+
};
|
|
87
|
+
readonly name: {
|
|
88
|
+
readonly type: "string";
|
|
89
|
+
readonly minLength: 1;
|
|
90
|
+
readonly maxLength: 64;
|
|
91
|
+
readonly 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.";
|
|
92
|
+
};
|
|
93
|
+
readonly colour: {
|
|
94
|
+
readonly $ref: "#/$defs/FacetColour";
|
|
95
|
+
};
|
|
96
|
+
readonly icon: {
|
|
97
|
+
readonly type: "string";
|
|
98
|
+
readonly minLength: 1;
|
|
99
|
+
readonly maxLength: 8;
|
|
100
|
+
readonly 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.";
|
|
101
|
+
};
|
|
102
|
+
readonly faceIds: {
|
|
103
|
+
readonly type: "array";
|
|
104
|
+
readonly maxItems: 256;
|
|
105
|
+
readonly uniqueItems: true;
|
|
106
|
+
readonly default: readonly [];
|
|
107
|
+
readonly items: {
|
|
108
|
+
readonly $ref: "#/$defs/Ulid";
|
|
109
|
+
};
|
|
110
|
+
readonly 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.";
|
|
111
|
+
};
|
|
112
|
+
readonly attributeIds: {
|
|
113
|
+
readonly type: "array";
|
|
114
|
+
readonly maxItems: 1024;
|
|
115
|
+
readonly uniqueItems: true;
|
|
116
|
+
readonly default: readonly [];
|
|
117
|
+
readonly items: {
|
|
118
|
+
readonly $ref: "#/$defs/Ulid";
|
|
119
|
+
};
|
|
120
|
+
readonly 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`.";
|
|
121
|
+
};
|
|
122
|
+
readonly expectedVersion: {
|
|
123
|
+
readonly $ref: "#/$defs/ExpectedVersion";
|
|
124
|
+
readonly 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.";
|
|
125
|
+
};
|
|
126
|
+
readonly ext: {
|
|
127
|
+
readonly $ref: "#/$defs/Ext";
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
readonly $defs: {
|
|
131
|
+
readonly Response: {
|
|
132
|
+
readonly $anchor: "response";
|
|
133
|
+
readonly title: "Persona Facet Put — response payload";
|
|
134
|
+
readonly 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.";
|
|
135
|
+
readonly type: "object";
|
|
136
|
+
readonly additionalProperties: false;
|
|
137
|
+
readonly required: readonly ["facetId", "version", "created", "updatedAt"];
|
|
138
|
+
readonly properties: {
|
|
139
|
+
readonly facetId: {
|
|
140
|
+
readonly $ref: "#/$defs/Ulid";
|
|
141
|
+
};
|
|
142
|
+
readonly version: {
|
|
143
|
+
readonly $ref: "#/$defs/Version";
|
|
144
|
+
};
|
|
145
|
+
readonly created: {
|
|
146
|
+
readonly type: "boolean";
|
|
147
|
+
readonly 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.";
|
|
148
|
+
};
|
|
149
|
+
readonly createdAt: {
|
|
150
|
+
readonly type: "string";
|
|
151
|
+
readonly format: "date-time";
|
|
152
|
+
};
|
|
153
|
+
readonly updatedAt: {
|
|
154
|
+
readonly type: "string";
|
|
155
|
+
readonly format: "date-time";
|
|
156
|
+
};
|
|
157
|
+
readonly ext: {
|
|
158
|
+
readonly $ref: "#/$defs/Ext";
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
readonly Ext: {
|
|
163
|
+
readonly title: "Ext";
|
|
164
|
+
readonly 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.";
|
|
165
|
+
readonly type: "object";
|
|
166
|
+
readonly minProperties: 1;
|
|
167
|
+
readonly additionalProperties: true;
|
|
168
|
+
readonly propertyNames: {
|
|
169
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
readonly Version: {
|
|
173
|
+
readonly title: "Version";
|
|
174
|
+
readonly description: "A value of the store's monotonic write counter. Server-assigned; a producer never chooses one.";
|
|
175
|
+
readonly type: "integer";
|
|
176
|
+
readonly minimum: 1;
|
|
177
|
+
};
|
|
178
|
+
readonly Ulid: {
|
|
179
|
+
readonly title: "Ulid";
|
|
180
|
+
readonly 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.";
|
|
181
|
+
readonly type: "string";
|
|
182
|
+
readonly pattern: "^[0-9A-HJKMNP-TV-Z]{26}$";
|
|
183
|
+
};
|
|
184
|
+
readonly ExpectedVersion: {
|
|
185
|
+
readonly title: "ExpectedVersion";
|
|
186
|
+
readonly 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.";
|
|
187
|
+
readonly type: "integer";
|
|
188
|
+
readonly minimum: 0;
|
|
189
|
+
};
|
|
190
|
+
readonly FacetColour: {
|
|
191
|
+
readonly title: "FacetColour";
|
|
192
|
+
readonly 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.";
|
|
193
|
+
readonly type: "string";
|
|
194
|
+
readonly enum: readonly ["slate", "indigo", "teal", "moss", "sand", "clay", "rose", "plum"];
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
199
|
+
export declare const RESPONSE_PAYLOAD_SCHEMA: {
|
|
200
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
201
|
+
readonly $ref: "#/$defs/Response";
|
|
202
|
+
readonly $defs: {
|
|
203
|
+
readonly Response: {
|
|
204
|
+
readonly $anchor: "response";
|
|
205
|
+
readonly title: "Persona Facet Put — response payload";
|
|
206
|
+
readonly 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.";
|
|
207
|
+
readonly type: "object";
|
|
208
|
+
readonly additionalProperties: false;
|
|
209
|
+
readonly required: readonly ["facetId", "version", "created", "updatedAt"];
|
|
210
|
+
readonly properties: {
|
|
211
|
+
readonly facetId: {
|
|
212
|
+
readonly $ref: "#/$defs/Ulid";
|
|
213
|
+
};
|
|
214
|
+
readonly version: {
|
|
215
|
+
readonly $ref: "#/$defs/Version";
|
|
216
|
+
};
|
|
217
|
+
readonly created: {
|
|
218
|
+
readonly type: "boolean";
|
|
219
|
+
readonly 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.";
|
|
220
|
+
};
|
|
221
|
+
readonly createdAt: {
|
|
222
|
+
readonly type: "string";
|
|
223
|
+
readonly format: "date-time";
|
|
224
|
+
};
|
|
225
|
+
readonly updatedAt: {
|
|
226
|
+
readonly type: "string";
|
|
227
|
+
readonly format: "date-time";
|
|
228
|
+
};
|
|
229
|
+
readonly ext: {
|
|
230
|
+
readonly $ref: "#/$defs/Ext";
|
|
231
|
+
};
|
|
232
|
+
};
|
|
233
|
+
};
|
|
234
|
+
readonly Ext: {
|
|
235
|
+
readonly title: "Ext";
|
|
236
|
+
readonly 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.";
|
|
237
|
+
readonly type: "object";
|
|
238
|
+
readonly minProperties: 1;
|
|
239
|
+
readonly additionalProperties: true;
|
|
240
|
+
readonly propertyNames: {
|
|
241
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
readonly Version: {
|
|
245
|
+
readonly title: "Version";
|
|
246
|
+
readonly description: "A value of the store's monotonic write counter. Server-assigned; a producer never chooses one.";
|
|
247
|
+
readonly type: "integer";
|
|
248
|
+
readonly minimum: 1;
|
|
249
|
+
};
|
|
250
|
+
readonly Ulid: {
|
|
251
|
+
readonly title: "Ulid";
|
|
252
|
+
readonly 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.";
|
|
253
|
+
readonly type: "string";
|
|
254
|
+
readonly pattern: "^[0-9A-HJKMNP-TV-Z]{26}$";
|
|
255
|
+
};
|
|
256
|
+
readonly ExpectedVersion: {
|
|
257
|
+
readonly title: "ExpectedVersion";
|
|
258
|
+
readonly 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.";
|
|
259
|
+
readonly type: "integer";
|
|
260
|
+
readonly minimum: 0;
|
|
261
|
+
};
|
|
262
|
+
readonly FacetColour: {
|
|
263
|
+
readonly title: "FacetColour";
|
|
264
|
+
readonly 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.";
|
|
265
|
+
readonly type: "string";
|
|
266
|
+
readonly enum: readonly ["slate", "indigo", "teal", "moss", "sand", "clay", "rose", "plum"];
|
|
267
|
+
};
|
|
268
|
+
};
|
|
269
|
+
};
|
|
270
|
+
/**
|
|
271
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
272
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
273
|
+
* per-specification and cannot be derived from the document alone, and
|
|
274
|
+
* item 2 needs the schema this carries.
|
|
275
|
+
*/
|
|
276
|
+
export declare const SPEC: {
|
|
277
|
+
readonly typeUri: "https://trusttasks.org/spec/persona/facet/put/1.0";
|
|
278
|
+
readonly isBearer: false;
|
|
279
|
+
readonly isProofRequired: true;
|
|
280
|
+
readonly isRecipientRequired: true;
|
|
281
|
+
readonly isIssuedAtRequired: true;
|
|
282
|
+
readonly payloadSchema: {
|
|
283
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
284
|
+
readonly $id: "https://trusttasks.org/spec/persona/facet/put/1.0";
|
|
285
|
+
readonly title: "Persona — Facet Put — payload";
|
|
286
|
+
readonly 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.";
|
|
287
|
+
readonly type: "object";
|
|
288
|
+
readonly additionalProperties: false;
|
|
289
|
+
readonly required: readonly ["name", "colour"];
|
|
290
|
+
readonly properties: {
|
|
291
|
+
readonly facetId: {
|
|
292
|
+
readonly $ref: "#/$defs/Ulid";
|
|
293
|
+
readonly 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`.";
|
|
294
|
+
};
|
|
295
|
+
readonly name: {
|
|
296
|
+
readonly type: "string";
|
|
297
|
+
readonly minLength: 1;
|
|
298
|
+
readonly maxLength: 64;
|
|
299
|
+
readonly 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.";
|
|
300
|
+
};
|
|
301
|
+
readonly colour: {
|
|
302
|
+
readonly $ref: "#/$defs/FacetColour";
|
|
303
|
+
};
|
|
304
|
+
readonly icon: {
|
|
305
|
+
readonly type: "string";
|
|
306
|
+
readonly minLength: 1;
|
|
307
|
+
readonly maxLength: 8;
|
|
308
|
+
readonly 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.";
|
|
309
|
+
};
|
|
310
|
+
readonly faceIds: {
|
|
311
|
+
readonly type: "array";
|
|
312
|
+
readonly maxItems: 256;
|
|
313
|
+
readonly uniqueItems: true;
|
|
314
|
+
readonly default: readonly [];
|
|
315
|
+
readonly items: {
|
|
316
|
+
readonly $ref: "#/$defs/Ulid";
|
|
317
|
+
};
|
|
318
|
+
readonly 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.";
|
|
319
|
+
};
|
|
320
|
+
readonly attributeIds: {
|
|
321
|
+
readonly type: "array";
|
|
322
|
+
readonly maxItems: 1024;
|
|
323
|
+
readonly uniqueItems: true;
|
|
324
|
+
readonly default: readonly [];
|
|
325
|
+
readonly items: {
|
|
326
|
+
readonly $ref: "#/$defs/Ulid";
|
|
327
|
+
};
|
|
328
|
+
readonly 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`.";
|
|
329
|
+
};
|
|
330
|
+
readonly expectedVersion: {
|
|
331
|
+
readonly $ref: "#/$defs/ExpectedVersion";
|
|
332
|
+
readonly 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.";
|
|
333
|
+
};
|
|
334
|
+
readonly ext: {
|
|
335
|
+
readonly $ref: "#/$defs/Ext";
|
|
336
|
+
};
|
|
337
|
+
};
|
|
338
|
+
readonly $defs: {
|
|
339
|
+
readonly Response: {
|
|
340
|
+
readonly $anchor: "response";
|
|
341
|
+
readonly title: "Persona Facet Put — response payload";
|
|
342
|
+
readonly 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.";
|
|
343
|
+
readonly type: "object";
|
|
344
|
+
readonly additionalProperties: false;
|
|
345
|
+
readonly required: readonly ["facetId", "version", "created", "updatedAt"];
|
|
346
|
+
readonly properties: {
|
|
347
|
+
readonly facetId: {
|
|
348
|
+
readonly $ref: "#/$defs/Ulid";
|
|
349
|
+
};
|
|
350
|
+
readonly version: {
|
|
351
|
+
readonly $ref: "#/$defs/Version";
|
|
352
|
+
};
|
|
353
|
+
readonly created: {
|
|
354
|
+
readonly type: "boolean";
|
|
355
|
+
readonly 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.";
|
|
356
|
+
};
|
|
357
|
+
readonly createdAt: {
|
|
358
|
+
readonly type: "string";
|
|
359
|
+
readonly format: "date-time";
|
|
360
|
+
};
|
|
361
|
+
readonly updatedAt: {
|
|
362
|
+
readonly type: "string";
|
|
363
|
+
readonly format: "date-time";
|
|
364
|
+
};
|
|
365
|
+
readonly ext: {
|
|
366
|
+
readonly $ref: "#/$defs/Ext";
|
|
367
|
+
};
|
|
368
|
+
};
|
|
369
|
+
};
|
|
370
|
+
readonly Ext: {
|
|
371
|
+
readonly title: "Ext";
|
|
372
|
+
readonly 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.";
|
|
373
|
+
readonly type: "object";
|
|
374
|
+
readonly minProperties: 1;
|
|
375
|
+
readonly additionalProperties: true;
|
|
376
|
+
readonly propertyNames: {
|
|
377
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
378
|
+
};
|
|
379
|
+
};
|
|
380
|
+
readonly Version: {
|
|
381
|
+
readonly title: "Version";
|
|
382
|
+
readonly description: "A value of the store's monotonic write counter. Server-assigned; a producer never chooses one.";
|
|
383
|
+
readonly type: "integer";
|
|
384
|
+
readonly minimum: 1;
|
|
385
|
+
};
|
|
386
|
+
readonly Ulid: {
|
|
387
|
+
readonly title: "Ulid";
|
|
388
|
+
readonly 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.";
|
|
389
|
+
readonly type: "string";
|
|
390
|
+
readonly pattern: "^[0-9A-HJKMNP-TV-Z]{26}$";
|
|
391
|
+
};
|
|
392
|
+
readonly ExpectedVersion: {
|
|
393
|
+
readonly title: "ExpectedVersion";
|
|
394
|
+
readonly 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.";
|
|
395
|
+
readonly type: "integer";
|
|
396
|
+
readonly minimum: 0;
|
|
397
|
+
};
|
|
398
|
+
readonly FacetColour: {
|
|
399
|
+
readonly title: "FacetColour";
|
|
400
|
+
readonly 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.";
|
|
401
|
+
readonly type: "string";
|
|
402
|
+
readonly enum: readonly ["slate", "indigo", "teal", "moss", "sand", "clay", "rose", "plum"];
|
|
403
|
+
};
|
|
404
|
+
};
|
|
405
|
+
};
|
|
406
|
+
};
|
|
407
|
+
/**
|
|
408
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
409
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
410
|
+
* parties (§7.3 item 5).
|
|
411
|
+
*/
|
|
412
|
+
export declare const RESPONSE_SPEC: {
|
|
413
|
+
readonly typeUri: "https://trusttasks.org/spec/persona/facet/put/1.0#response";
|
|
414
|
+
readonly isBearer: false;
|
|
415
|
+
readonly isProofRequired: true;
|
|
416
|
+
readonly isRecipientRequired: true;
|
|
417
|
+
readonly isIssuedAtRequired: true;
|
|
418
|
+
readonly payloadSchema: {
|
|
419
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
420
|
+
readonly $ref: "#/$defs/Response";
|
|
421
|
+
readonly $defs: {
|
|
422
|
+
readonly Response: {
|
|
423
|
+
readonly $anchor: "response";
|
|
424
|
+
readonly title: "Persona Facet Put — response payload";
|
|
425
|
+
readonly 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.";
|
|
426
|
+
readonly type: "object";
|
|
427
|
+
readonly additionalProperties: false;
|
|
428
|
+
readonly required: readonly ["facetId", "version", "created", "updatedAt"];
|
|
429
|
+
readonly properties: {
|
|
430
|
+
readonly facetId: {
|
|
431
|
+
readonly $ref: "#/$defs/Ulid";
|
|
432
|
+
};
|
|
433
|
+
readonly version: {
|
|
434
|
+
readonly $ref: "#/$defs/Version";
|
|
435
|
+
};
|
|
436
|
+
readonly created: {
|
|
437
|
+
readonly type: "boolean";
|
|
438
|
+
readonly 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.";
|
|
439
|
+
};
|
|
440
|
+
readonly createdAt: {
|
|
441
|
+
readonly type: "string";
|
|
442
|
+
readonly format: "date-time";
|
|
443
|
+
};
|
|
444
|
+
readonly updatedAt: {
|
|
445
|
+
readonly type: "string";
|
|
446
|
+
readonly format: "date-time";
|
|
447
|
+
};
|
|
448
|
+
readonly ext: {
|
|
449
|
+
readonly $ref: "#/$defs/Ext";
|
|
450
|
+
};
|
|
451
|
+
};
|
|
452
|
+
};
|
|
453
|
+
readonly Ext: {
|
|
454
|
+
readonly title: "Ext";
|
|
455
|
+
readonly 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.";
|
|
456
|
+
readonly type: "object";
|
|
457
|
+
readonly minProperties: 1;
|
|
458
|
+
readonly additionalProperties: true;
|
|
459
|
+
readonly propertyNames: {
|
|
460
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
461
|
+
};
|
|
462
|
+
};
|
|
463
|
+
readonly Version: {
|
|
464
|
+
readonly title: "Version";
|
|
465
|
+
readonly description: "A value of the store's monotonic write counter. Server-assigned; a producer never chooses one.";
|
|
466
|
+
readonly type: "integer";
|
|
467
|
+
readonly minimum: 1;
|
|
468
|
+
};
|
|
469
|
+
readonly Ulid: {
|
|
470
|
+
readonly title: "Ulid";
|
|
471
|
+
readonly 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.";
|
|
472
|
+
readonly type: "string";
|
|
473
|
+
readonly pattern: "^[0-9A-HJKMNP-TV-Z]{26}$";
|
|
474
|
+
};
|
|
475
|
+
readonly ExpectedVersion: {
|
|
476
|
+
readonly title: "ExpectedVersion";
|
|
477
|
+
readonly 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.";
|
|
478
|
+
readonly type: "integer";
|
|
479
|
+
readonly minimum: 0;
|
|
480
|
+
};
|
|
481
|
+
readonly FacetColour: {
|
|
482
|
+
readonly title: "FacetColour";
|
|
483
|
+
readonly 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.";
|
|
484
|
+
readonly type: "string";
|
|
485
|
+
readonly enum: readonly ["slate", "indigo", "teal", "moss", "sand", "clay", "rose", "plum"];
|
|
486
|
+
};
|
|
487
|
+
};
|
|
488
|
+
};
|
|
489
|
+
};
|
|
490
|
+
//# sourceMappingURL=payload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../../../src/persona/facet/put/1.0/payload.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,2BAA2B,IAAI,eAAe,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,mBAAmB,IAAI,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAGhK;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,OAAO,CAAC,EAAE,IAAI,CAAC;IACf;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,WAAW,CAAC;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC;IACjB;;;;OAIG;IACH,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;IACtB;;OAEG;IACH,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,GAAG,CAAC,EAAE,GAAG,CAAC;CACX;AACD;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C,OAAO,EAAE,IAAI,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,GAAG,CAAC;CACX;AAED,kHAAkH;AAClH,YAAY,EAAE,eAAe,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAEjE,2BAA2B;AAC3B,eAAO,MAAM,QAAQ,EAAG,mDAA4D,CAAC;AAErF,mEAAmE;AACnE,MAAM,MAAM,OAAO,GAAG,sBAAsB,CAAC;AAE7C,qEAAqE;AACrE,eAAO,MAAM,iBAAiB,EAAG,4DAAqE,CAAC;AAEvG,4EAA4E;AAC5E,MAAM,MAAM,QAAQ,GAAG,8BAA8B,CAAC;AAEtD;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4IjB,CAAC;AAEX,mEAAmE;AACnE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoF1B,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOP,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOhB,CAAC"}
|