@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,272 @@
|
|
|
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
|
+
/** Trust Task type URI. */
|
|
6
|
+
export const TYPE_URI = "https://trusttasks.org/spec/persona/facet/put/1.0";
|
|
7
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
8
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/persona/facet/put/1.0#response";
|
|
9
|
+
/**
|
|
10
|
+
* This specification's payload schema, as a value.
|
|
11
|
+
*
|
|
12
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
13
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
14
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
15
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
16
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
17
|
+
*/
|
|
18
|
+
export const PAYLOAD_SCHEMA = {
|
|
19
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
20
|
+
"$id": "https://trusttasks.org/spec/persona/facet/put/1.0",
|
|
21
|
+
"title": "Persona — Facet Put — payload",
|
|
22
|
+
"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.",
|
|
23
|
+
"type": "object",
|
|
24
|
+
"additionalProperties": false,
|
|
25
|
+
"required": [
|
|
26
|
+
"name",
|
|
27
|
+
"colour"
|
|
28
|
+
],
|
|
29
|
+
"properties": {
|
|
30
|
+
"facetId": {
|
|
31
|
+
"$ref": "#/$defs/Ulid",
|
|
32
|
+
"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`."
|
|
33
|
+
},
|
|
34
|
+
"name": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"minLength": 1,
|
|
37
|
+
"maxLength": 64,
|
|
38
|
+
"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."
|
|
39
|
+
},
|
|
40
|
+
"colour": {
|
|
41
|
+
"$ref": "#/$defs/FacetColour"
|
|
42
|
+
},
|
|
43
|
+
"icon": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"minLength": 1,
|
|
46
|
+
"maxLength": 8,
|
|
47
|
+
"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."
|
|
48
|
+
},
|
|
49
|
+
"faceIds": {
|
|
50
|
+
"type": "array",
|
|
51
|
+
"maxItems": 256,
|
|
52
|
+
"uniqueItems": true,
|
|
53
|
+
"default": [],
|
|
54
|
+
"items": {
|
|
55
|
+
"$ref": "#/$defs/Ulid"
|
|
56
|
+
},
|
|
57
|
+
"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."
|
|
58
|
+
},
|
|
59
|
+
"attributeIds": {
|
|
60
|
+
"type": "array",
|
|
61
|
+
"maxItems": 1024,
|
|
62
|
+
"uniqueItems": true,
|
|
63
|
+
"default": [],
|
|
64
|
+
"items": {
|
|
65
|
+
"$ref": "#/$defs/Ulid"
|
|
66
|
+
},
|
|
67
|
+
"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`."
|
|
68
|
+
},
|
|
69
|
+
"expectedVersion": {
|
|
70
|
+
"$ref": "#/$defs/ExpectedVersion",
|
|
71
|
+
"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."
|
|
72
|
+
},
|
|
73
|
+
"ext": {
|
|
74
|
+
"$ref": "#/$defs/Ext"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"$defs": {
|
|
78
|
+
"Response": {
|
|
79
|
+
"$anchor": "response",
|
|
80
|
+
"title": "Persona Facet Put — response payload",
|
|
81
|
+
"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.",
|
|
82
|
+
"type": "object",
|
|
83
|
+
"additionalProperties": false,
|
|
84
|
+
"required": [
|
|
85
|
+
"facetId",
|
|
86
|
+
"version",
|
|
87
|
+
"created",
|
|
88
|
+
"updatedAt"
|
|
89
|
+
],
|
|
90
|
+
"properties": {
|
|
91
|
+
"facetId": {
|
|
92
|
+
"$ref": "#/$defs/Ulid"
|
|
93
|
+
},
|
|
94
|
+
"version": {
|
|
95
|
+
"$ref": "#/$defs/Version"
|
|
96
|
+
},
|
|
97
|
+
"created": {
|
|
98
|
+
"type": "boolean",
|
|
99
|
+
"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."
|
|
100
|
+
},
|
|
101
|
+
"createdAt": {
|
|
102
|
+
"type": "string",
|
|
103
|
+
"format": "date-time"
|
|
104
|
+
},
|
|
105
|
+
"updatedAt": {
|
|
106
|
+
"type": "string",
|
|
107
|
+
"format": "date-time"
|
|
108
|
+
},
|
|
109
|
+
"ext": {
|
|
110
|
+
"$ref": "#/$defs/Ext"
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"Ext": {
|
|
115
|
+
"title": "Ext",
|
|
116
|
+
"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.",
|
|
117
|
+
"type": "object",
|
|
118
|
+
"minProperties": 1,
|
|
119
|
+
"additionalProperties": true,
|
|
120
|
+
"propertyNames": {
|
|
121
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"Version": {
|
|
125
|
+
"title": "Version",
|
|
126
|
+
"description": "A value of the store's monotonic write counter. Server-assigned; a producer never chooses one.",
|
|
127
|
+
"type": "integer",
|
|
128
|
+
"minimum": 1
|
|
129
|
+
},
|
|
130
|
+
"Ulid": {
|
|
131
|
+
"title": "Ulid",
|
|
132
|
+
"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.",
|
|
133
|
+
"type": "string",
|
|
134
|
+
"pattern": "^[0-9A-HJKMNP-TV-Z]{26}$"
|
|
135
|
+
},
|
|
136
|
+
"ExpectedVersion": {
|
|
137
|
+
"title": "ExpectedVersion",
|
|
138
|
+
"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.",
|
|
139
|
+
"type": "integer",
|
|
140
|
+
"minimum": 0
|
|
141
|
+
},
|
|
142
|
+
"FacetColour": {
|
|
143
|
+
"title": "FacetColour",
|
|
144
|
+
"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.",
|
|
145
|
+
"type": "string",
|
|
146
|
+
"enum": [
|
|
147
|
+
"slate",
|
|
148
|
+
"indigo",
|
|
149
|
+
"teal",
|
|
150
|
+
"moss",
|
|
151
|
+
"sand",
|
|
152
|
+
"clay",
|
|
153
|
+
"rose",
|
|
154
|
+
"plum"
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
160
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
161
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
162
|
+
"$ref": "#/$defs/Response",
|
|
163
|
+
"$defs": {
|
|
164
|
+
"Response": {
|
|
165
|
+
"$anchor": "response",
|
|
166
|
+
"title": "Persona Facet Put — response payload",
|
|
167
|
+
"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.",
|
|
168
|
+
"type": "object",
|
|
169
|
+
"additionalProperties": false,
|
|
170
|
+
"required": [
|
|
171
|
+
"facetId",
|
|
172
|
+
"version",
|
|
173
|
+
"created",
|
|
174
|
+
"updatedAt"
|
|
175
|
+
],
|
|
176
|
+
"properties": {
|
|
177
|
+
"facetId": {
|
|
178
|
+
"$ref": "#/$defs/Ulid"
|
|
179
|
+
},
|
|
180
|
+
"version": {
|
|
181
|
+
"$ref": "#/$defs/Version"
|
|
182
|
+
},
|
|
183
|
+
"created": {
|
|
184
|
+
"type": "boolean",
|
|
185
|
+
"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."
|
|
186
|
+
},
|
|
187
|
+
"createdAt": {
|
|
188
|
+
"type": "string",
|
|
189
|
+
"format": "date-time"
|
|
190
|
+
},
|
|
191
|
+
"updatedAt": {
|
|
192
|
+
"type": "string",
|
|
193
|
+
"format": "date-time"
|
|
194
|
+
},
|
|
195
|
+
"ext": {
|
|
196
|
+
"$ref": "#/$defs/Ext"
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
"Ext": {
|
|
201
|
+
"title": "Ext",
|
|
202
|
+
"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.",
|
|
203
|
+
"type": "object",
|
|
204
|
+
"minProperties": 1,
|
|
205
|
+
"additionalProperties": true,
|
|
206
|
+
"propertyNames": {
|
|
207
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
"Version": {
|
|
211
|
+
"title": "Version",
|
|
212
|
+
"description": "A value of the store's monotonic write counter. Server-assigned; a producer never chooses one.",
|
|
213
|
+
"type": "integer",
|
|
214
|
+
"minimum": 1
|
|
215
|
+
},
|
|
216
|
+
"Ulid": {
|
|
217
|
+
"title": "Ulid",
|
|
218
|
+
"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.",
|
|
219
|
+
"type": "string",
|
|
220
|
+
"pattern": "^[0-9A-HJKMNP-TV-Z]{26}$"
|
|
221
|
+
},
|
|
222
|
+
"ExpectedVersion": {
|
|
223
|
+
"title": "ExpectedVersion",
|
|
224
|
+
"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.",
|
|
225
|
+
"type": "integer",
|
|
226
|
+
"minimum": 0
|
|
227
|
+
},
|
|
228
|
+
"FacetColour": {
|
|
229
|
+
"title": "FacetColour",
|
|
230
|
+
"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.",
|
|
231
|
+
"type": "string",
|
|
232
|
+
"enum": [
|
|
233
|
+
"slate",
|
|
234
|
+
"indigo",
|
|
235
|
+
"teal",
|
|
236
|
+
"moss",
|
|
237
|
+
"sand",
|
|
238
|
+
"clay",
|
|
239
|
+
"rose",
|
|
240
|
+
"plum"
|
|
241
|
+
]
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
/**
|
|
246
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
247
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
248
|
+
* per-specification and cannot be derived from the document alone, and
|
|
249
|
+
* item 2 needs the schema this carries.
|
|
250
|
+
*/
|
|
251
|
+
export const SPEC = {
|
|
252
|
+
typeUri: TYPE_URI,
|
|
253
|
+
isBearer: false,
|
|
254
|
+
isProofRequired: true,
|
|
255
|
+
isRecipientRequired: true,
|
|
256
|
+
isIssuedAtRequired: true,
|
|
257
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
258
|
+
};
|
|
259
|
+
/**
|
|
260
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
261
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
262
|
+
* parties (§7.3 item 5).
|
|
263
|
+
*/
|
|
264
|
+
export const RESPONSE_SPEC = {
|
|
265
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
266
|
+
isBearer: false,
|
|
267
|
+
isProofRequired: true,
|
|
268
|
+
isRecipientRequired: true,
|
|
269
|
+
isIssuedAtRequired: true,
|
|
270
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
271
|
+
};
|
|
272
|
+
//# sourceMappingURL=payload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payload.js","sourceRoot":"","sources":["../../../../../src/persona/facet/put/1.0/payload.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA0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ACD,SAAS,EAAE;YACT,OAAO,EAAE,SAAS;YAClB,aAAa,EAAE,gGAAgG;YAC/G,MAAM,EAAE,SAAS;YACjB,SAAS,EAAE,CAAC;SACb;QACD,MAAM,EAAE;YACN,OAAO,EAAE,MAAM;YACf,aAAa,EAAE,waAAwa;YACvb,MAAM,EAAE,QAAQ;YAChB,SAAS,EAAE,0BAA0B;SACtC;QACD,iBAAiB,EAAE;YACjB,OAAO,EAAE,iBAAiB;YAC1B,aAAa,EAAE,uMAAuM;YACtN,MAAM,EAAE,SAAS;YACjB,SAAS,EAAE,CAAC;SACb;QACD,aAAa,EAAE;YACb,OAAO,EAAE,aAAa;YACtB,aAAa,EAAE,kyBAAkyB;YACjzB,MAAM,EAAE,QAAQ;YAChB,MAAM,EAAE;gBACN,OAAO;gBACP,QAAQ;gBACR,MAAM;gBACN,MAAM;gBACN,MAAM;gBACN,MAAM;gBACN,MAAM;gBACN,MAAM;aACP;SACF;KACF;CACO,CAAC;AAEX;;;;;GAKG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB,OAAO,EAAE,QAAQ;IACjB,QAAQ,EAAE,KAAK;IACf,eAAe,EAAE,IAAI;IACrB,mBAAmB,EAAE,IAAI;IACzB,kBAAkB,EAAE,IAAI;IACxB,aAAa,EAAE,cAAc;CACrB,CAAC;AAEX;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,OAAO,EAAE,iBAAiB;IAC1B,QAAQ,EAAE,KAAK;IACf,eAAe,EAAE,IAAI;IACrB,mBAAmB,EAAE,IAAI;IACzB,kBAAkB,EAAE,IAAI;IACxB,aAAa,EAAE,uBAAuB;CAC9B,CAAC"}
|
package/package.json
CHANGED
|
@@ -132,6 +132,10 @@ export type ExpectedVersion_PersonaV0_1 = number;
|
|
|
132
132
|
* Optimistic-concurrency precondition on a write. A positive value requires that the record's current `version` equals it exactly. Zero means "create only" — the write applies only if no LIVE record exists at the address, which is what makes lease acquisition safe: without it two instances can each read "absent", each write, and each believe it won. A tombstone is not a live record, so `expectedVersion: 0` succeeds over one; the created record takes the namespace's next counter value, which is necessarily greater than the tombstone's.
|
|
133
133
|
*/
|
|
134
134
|
export type ExpectedVersion_VtaV0_1 = number;
|
|
135
|
+
/**
|
|
136
|
+
* 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.
|
|
137
|
+
*/
|
|
138
|
+
export type FacetColour = "slate" | "indigo" | "teal" | "moss" | "sand" | "clay" | "rose" | "plum";
|
|
135
139
|
/**
|
|
136
140
|
* `issued` is outstanding and revocable; `consumed` and `expired` are terminal.
|
|
137
141
|
*/
|
package/src/index.ts
CHANGED
|
@@ -185,6 +185,9 @@ export * as PersonaCorrelationAnalyze_v1_0 from "./persona/correlation/analyze/1
|
|
|
185
185
|
export * as PersonaDisclosureHistory_v1_0 from "./persona/disclosure/history/1.0/payload.js";
|
|
186
186
|
export * as PersonaDisclosurePresent_v1_0 from "./persona/disclosure/present/1.0/payload.js";
|
|
187
187
|
export * as PersonaDisclosurePreview_v1_0 from "./persona/disclosure/preview/1.0/payload.js";
|
|
188
|
+
export * as PersonaFacetDelete_v1_0 from "./persona/facet/delete/1.0/payload.js";
|
|
189
|
+
export * as PersonaFacetList_v1_0 from "./persona/facet/list/1.0/payload.js";
|
|
190
|
+
export * as PersonaFacetPut_v1_0 from "./persona/facet/put/1.0/payload.js";
|
|
188
191
|
export * as PersonaLocalBindingSet_v1_0 from "./persona/local/binding/set/1.0/payload.js";
|
|
189
192
|
export * as PersonaLocalProfileDelete_v1_0 from "./persona/local/profile/delete/1.0/payload.js";
|
|
190
193
|
export * as PersonaLocalProfileGet_v1_0 from "./persona/local/profile/get/1.0/payload.js";
|
|
@@ -20,4 +20,4 @@ export interface PersonaRecordSharedDefinitionsForThePersonaSpecFamily {
|
|
|
20
20
|
* The definitions this shared schema publishes, hoisted to one declaration each.
|
|
21
21
|
* See "../../../_shared/components.js".
|
|
22
22
|
*/
|
|
23
|
-
export type { Attribute, ClaimType, ContactDocument, ContactRevision, ExpectedVersion_PersonaV0_1 as ExpectedVersion, Profile, ProfileEntry, ProofRung, Provenance, ReleaseRequirement, ResolvedClaim, Sensitivity, Ulid, ValueType, Version_PersonaV0_1 as Version } from "../../../_shared/components.js";
|
|
23
|
+
export type { Attribute, ClaimType, ContactDocument, ContactRevision, ExpectedVersion_PersonaV0_1 as ExpectedVersion, FacetColour, Profile, ProfileEntry, ProofRung, Provenance, ReleaseRequirement, ResolvedClaim, Sensitivity, Ulid, ValueType, Version_PersonaV0_1 as Version } from "../../../_shared/components.js";
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/persona/facet/delete/1.0/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { ExpectedVersion_PersonaV0_1 as ExpectedVersion, Ext, Ulid } from "../../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Delete one facet. The faces and attributes that belonged to it are untouched — a facet is a way of arranging what the holder keeps, never a container for it.
|
|
11
|
+
*/
|
|
12
|
+
export interface PersonaFacetDeletePayload {
|
|
13
|
+
facetId: Ulid;
|
|
14
|
+
/**
|
|
15
|
+
* Optional precondition. Supply the version a prior read returned to refuse a delete against a facet that has changed since it was looked at.
|
|
16
|
+
*/
|
|
17
|
+
expectedVersion?: ExpectedVersion;
|
|
18
|
+
ext?: Ext;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Success response to persona/facet/delete. Type https://trusttasks.org/spec/persona/facet/delete/1.0#response.
|
|
22
|
+
*/
|
|
23
|
+
export interface PersonaFacetDeleteResponsePayload {
|
|
24
|
+
/**
|
|
25
|
+
* False when there was nothing to delete. A successful no-op rather than an error: a producer retrying after a lost response must be able to reach the state it wanted without having to tell a second delete apart from a first.
|
|
26
|
+
*/
|
|
27
|
+
existed: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* How many profiles no longer belong to any facet as a result. Nothing was deleted and nothing changed about them — this is the count a consumer needs to say what the screen will look like afterwards, which is the honest end of a sentence that would otherwise read only 'deleted'.
|
|
30
|
+
*/
|
|
31
|
+
releasedFaces?: number;
|
|
32
|
+
ext?: Ext;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
36
|
+
export type { ExpectedVersion, Ext, Ulid };
|
|
37
|
+
|
|
38
|
+
/** Trust Task type URI. */
|
|
39
|
+
export const TYPE_URI = "https://trusttasks.org/spec/persona/facet/delete/1.0" as const;
|
|
40
|
+
|
|
41
|
+
/** Stable alias for this specification's request payload shape. */
|
|
42
|
+
export type Payload = PersonaFacetDeletePayload;
|
|
43
|
+
|
|
44
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
45
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/persona/facet/delete/1.0#response" as const;
|
|
46
|
+
|
|
47
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
48
|
+
export type Response = PersonaFacetDeleteResponsePayload;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* This specification's payload schema, as a value.
|
|
52
|
+
*
|
|
53
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
54
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
55
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
56
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
57
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
58
|
+
*/
|
|
59
|
+
export const PAYLOAD_SCHEMA = {
|
|
60
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
61
|
+
"$id": "https://trusttasks.org/spec/persona/facet/delete/1.0",
|
|
62
|
+
"title": "Persona — Facet Delete — payload",
|
|
63
|
+
"description": "Delete one facet. The faces and attributes that belonged to it are untouched — a facet is a way of arranging what the holder keeps, never a container for it.",
|
|
64
|
+
"type": "object",
|
|
65
|
+
"additionalProperties": false,
|
|
66
|
+
"required": [
|
|
67
|
+
"facetId"
|
|
68
|
+
],
|
|
69
|
+
"properties": {
|
|
70
|
+
"facetId": {
|
|
71
|
+
"$ref": "#/$defs/Ulid"
|
|
72
|
+
},
|
|
73
|
+
"expectedVersion": {
|
|
74
|
+
"$ref": "#/$defs/ExpectedVersion",
|
|
75
|
+
"description": "Optional precondition. Supply the version a prior read returned to refuse a delete against a facet that has changed since it was looked at."
|
|
76
|
+
},
|
|
77
|
+
"ext": {
|
|
78
|
+
"$ref": "#/$defs/Ext"
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"$defs": {
|
|
82
|
+
"Response": {
|
|
83
|
+
"$anchor": "response",
|
|
84
|
+
"title": "Persona Facet Delete — response payload",
|
|
85
|
+
"description": "Success response to persona/facet/delete. Type https://trusttasks.org/spec/persona/facet/delete/1.0#response.",
|
|
86
|
+
"type": "object",
|
|
87
|
+
"additionalProperties": false,
|
|
88
|
+
"required": [
|
|
89
|
+
"existed"
|
|
90
|
+
],
|
|
91
|
+
"properties": {
|
|
92
|
+
"existed": {
|
|
93
|
+
"type": "boolean",
|
|
94
|
+
"description": "False when there was nothing to delete. A successful no-op rather than an error: a producer retrying after a lost response must be able to reach the state it wanted without having to tell a second delete apart from a first."
|
|
95
|
+
},
|
|
96
|
+
"releasedFaces": {
|
|
97
|
+
"type": "integer",
|
|
98
|
+
"minimum": 0,
|
|
99
|
+
"description": "How many profiles no longer belong to any facet as a result. Nothing was deleted and nothing changed about them — this is the count a consumer needs to say what the screen will look like afterwards, which is the honest end of a sentence that would otherwise read only 'deleted'."
|
|
100
|
+
},
|
|
101
|
+
"ext": {
|
|
102
|
+
"$ref": "#/$defs/Ext"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"Ext": {
|
|
107
|
+
"title": "Ext",
|
|
108
|
+
"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.",
|
|
109
|
+
"type": "object",
|
|
110
|
+
"minProperties": 1,
|
|
111
|
+
"additionalProperties": true,
|
|
112
|
+
"propertyNames": {
|
|
113
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"ExpectedVersion": {
|
|
117
|
+
"title": "ExpectedVersion",
|
|
118
|
+
"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.",
|
|
119
|
+
"type": "integer",
|
|
120
|
+
"minimum": 0
|
|
121
|
+
},
|
|
122
|
+
"Ulid": {
|
|
123
|
+
"title": "Ulid",
|
|
124
|
+
"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.",
|
|
125
|
+
"type": "string",
|
|
126
|
+
"pattern": "^[0-9A-HJKMNP-TV-Z]{26}$"
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
} as const;
|
|
130
|
+
|
|
131
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
132
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
133
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
134
|
+
"$ref": "#/$defs/Response",
|
|
135
|
+
"$defs": {
|
|
136
|
+
"Response": {
|
|
137
|
+
"$anchor": "response",
|
|
138
|
+
"title": "Persona Facet Delete — response payload",
|
|
139
|
+
"description": "Success response to persona/facet/delete. Type https://trusttasks.org/spec/persona/facet/delete/1.0#response.",
|
|
140
|
+
"type": "object",
|
|
141
|
+
"additionalProperties": false,
|
|
142
|
+
"required": [
|
|
143
|
+
"existed"
|
|
144
|
+
],
|
|
145
|
+
"properties": {
|
|
146
|
+
"existed": {
|
|
147
|
+
"type": "boolean",
|
|
148
|
+
"description": "False when there was nothing to delete. A successful no-op rather than an error: a producer retrying after a lost response must be able to reach the state it wanted without having to tell a second delete apart from a first."
|
|
149
|
+
},
|
|
150
|
+
"releasedFaces": {
|
|
151
|
+
"type": "integer",
|
|
152
|
+
"minimum": 0,
|
|
153
|
+
"description": "How many profiles no longer belong to any facet as a result. Nothing was deleted and nothing changed about them — this is the count a consumer needs to say what the screen will look like afterwards, which is the honest end of a sentence that would otherwise read only 'deleted'."
|
|
154
|
+
},
|
|
155
|
+
"ext": {
|
|
156
|
+
"$ref": "#/$defs/Ext"
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
"Ext": {
|
|
161
|
+
"title": "Ext",
|
|
162
|
+
"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.",
|
|
163
|
+
"type": "object",
|
|
164
|
+
"minProperties": 1,
|
|
165
|
+
"additionalProperties": true,
|
|
166
|
+
"propertyNames": {
|
|
167
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
"ExpectedVersion": {
|
|
171
|
+
"title": "ExpectedVersion",
|
|
172
|
+
"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.",
|
|
173
|
+
"type": "integer",
|
|
174
|
+
"minimum": 0
|
|
175
|
+
},
|
|
176
|
+
"Ulid": {
|
|
177
|
+
"title": "Ulid",
|
|
178
|
+
"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.",
|
|
179
|
+
"type": "string",
|
|
180
|
+
"pattern": "^[0-9A-HJKMNP-TV-Z]{26}$"
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
} as const;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
187
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
188
|
+
* per-specification and cannot be derived from the document alone, and
|
|
189
|
+
* item 2 needs the schema this carries.
|
|
190
|
+
*/
|
|
191
|
+
export const SPEC = {
|
|
192
|
+
typeUri: TYPE_URI,
|
|
193
|
+
isBearer: false,
|
|
194
|
+
isProofRequired: true,
|
|
195
|
+
isRecipientRequired: true,
|
|
196
|
+
isIssuedAtRequired: true,
|
|
197
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
198
|
+
} as const;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
202
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
203
|
+
* parties (§7.3 item 5).
|
|
204
|
+
*/
|
|
205
|
+
export const RESPONSE_SPEC = {
|
|
206
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
207
|
+
isBearer: false,
|
|
208
|
+
isProofRequired: true,
|
|
209
|
+
isRecipientRequired: true,
|
|
210
|
+
isIssuedAtRequired: true,
|
|
211
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
212
|
+
} as const;
|