@openvtc/trust-tasks 0.19.22 → 0.20.1
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 +33 -0
- package/dist/_shared/components.d.ts +5 -1
- package/dist/_shared/components.d.ts.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -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/attribute/get/1.0/payload.d.ts +1221 -0
- package/dist/persona/attribute/get/1.0/payload.d.ts.map +1 -0
- package/dist/persona/attribute/get/1.0/payload.js +719 -0
- package/dist/persona/attribute/get/1.0/payload.js.map +1 -0
- package/dist/persona/correlation/analyze/1.1/payload.d.ts +730 -0
- package/dist/persona/correlation/analyze/1.1/payload.d.ts.map +1 -0
- package/dist/persona/correlation/analyze/1.1/payload.js +372 -0
- package/dist/persona/correlation/analyze/1.1/payload.js.map +1 -0
- package/dist/persona/facet/list/1.0/payload.d.ts +4 -4
- package/dist/persona/facet/list/1.0/payload.js +2 -2
- package/dist/persona/facet/list/1.0/payload.js.map +1 -1
- package/dist/persona/facet/put/1.0/payload.d.ts +4 -4
- package/dist/persona/facet/put/1.0/payload.js +2 -2
- package/dist/persona/facet/put/1.0/payload.js.map +1 -1
- package/dist/persona/local/profile/put/1.0/payload.d.ts +10 -10
- package/dist/persona/local/profile/put/1.0/payload.js +4 -4
- package/dist/persona/local/profile/put/1.0/payload.js.map +1 -1
- package/dist/persona/world/delete/1.0/payload.d.ts +310 -0
- package/dist/persona/world/delete/1.0/payload.d.ts.map +1 -0
- package/dist/persona/world/delete/1.0/payload.js +169 -0
- package/dist/persona/world/delete/1.0/payload.js.map +1 -0
- package/dist/persona/world/list/1.0/payload.d.ts +599 -0
- package/dist/persona/world/list/1.0/payload.d.ts.map +1 -0
- package/dist/persona/world/list/1.0/payload.js +332 -0
- package/dist/persona/world/list/1.0/payload.js.map +1 -0
- package/dist/persona/world/put/1.0/payload.d.ts +490 -0
- package/dist/persona/world/put/1.0/payload.d.ts.map +1 -0
- package/dist/persona/world/put/1.0/payload.js +272 -0
- package/dist/persona/world/put/1.0/payload.js.map +1 -0
- package/package.json +1 -1
- package/src/_shared/components.ts +5 -1
- package/src/index.ts +5 -0
- package/src/persona/_shared/0.1/persona-record.ts +1 -1
- package/src/persona/attribute/get/1.0/payload.ts +785 -0
- package/src/persona/correlation/analyze/1.1/payload.ts +514 -0
- package/src/persona/facet/list/1.0/payload.ts +2 -2
- package/src/persona/facet/put/1.0/payload.ts +2 -2
- package/src/persona/local/profile/put/1.0/payload.ts +6 -6
- package/src/persona/world/delete/1.0/payload.ts +212 -0
- package/src/persona/world/list/1.0/payload.ts +402 -0
- package/src/persona/world/put/1.0/payload.ts +339 -0
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/persona/world/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 world. The faces and attributes that belonged to it are untouched — a world is a way of arranging what the holder keeps, never a container for it.
|
|
11
|
+
*/
|
|
12
|
+
export interface PersonaWorldDeletePayload {
|
|
13
|
+
worldId: Ulid;
|
|
14
|
+
/**
|
|
15
|
+
* Optional precondition. Supply the version a prior read returned to refuse a delete against a world that has changed since it was looked at.
|
|
16
|
+
*/
|
|
17
|
+
expectedVersion?: ExpectedVersion;
|
|
18
|
+
ext?: Ext;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Success response to persona/world/delete. Type https://trusttasks.org/spec/persona/world/delete/1.0#response.
|
|
22
|
+
*/
|
|
23
|
+
export interface PersonaWorldDeleteResponsePayload {
|
|
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 world 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/world/delete/1.0" as const;
|
|
40
|
+
|
|
41
|
+
/** Stable alias for this specification's request payload shape. */
|
|
42
|
+
export type Payload = PersonaWorldDeletePayload;
|
|
43
|
+
|
|
44
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
45
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/persona/world/delete/1.0#response" as const;
|
|
46
|
+
|
|
47
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
48
|
+
export type Response = PersonaWorldDeleteResponsePayload;
|
|
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/world/delete/1.0",
|
|
62
|
+
"title": "Persona — World Delete — payload",
|
|
63
|
+
"description": "Delete one world. The faces and attributes that belonged to it are untouched — a world is a way of arranging what the holder keeps, never a container for it.",
|
|
64
|
+
"type": "object",
|
|
65
|
+
"additionalProperties": false,
|
|
66
|
+
"required": [
|
|
67
|
+
"worldId"
|
|
68
|
+
],
|
|
69
|
+
"properties": {
|
|
70
|
+
"worldId": {
|
|
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 world 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 World Delete — response payload",
|
|
85
|
+
"description": "Success response to persona/world/delete. Type https://trusttasks.org/spec/persona/world/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 world 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 World Delete — response payload",
|
|
139
|
+
"description": "Success response to persona/world/delete. Type https://trusttasks.org/spec/persona/world/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 world 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;
|
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/persona/world/list/1.0/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { Ext, Ulid, Version_PersonaV0_1 as Version, WorldColour } from "../../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* List the holder's worlds, with their membership. Cursor-paginated like every other persona listing.
|
|
11
|
+
*/
|
|
12
|
+
export interface PersonaWorldListPayload {
|
|
13
|
+
/**
|
|
14
|
+
* The page size to ask for — never a cap on the result. A consumer that wants every world follows `nextCursor` to the end; one that treats this as a limit will silently draw a partial picture.
|
|
15
|
+
*/
|
|
16
|
+
limit?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Continue a prior listing. Opaque: a producer echoes what it was given and MUST NOT construct one.
|
|
19
|
+
*/
|
|
20
|
+
cursor?: string;
|
|
21
|
+
ext?: Ext;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Success response to persona/world/list. Type https://trusttasks.org/spec/persona/world/list/1.0#response.
|
|
25
|
+
*/
|
|
26
|
+
export interface PersonaWorldListResponsePayload {
|
|
27
|
+
/**
|
|
28
|
+
* @maxItems 250
|
|
29
|
+
*/
|
|
30
|
+
worlds: World[];
|
|
31
|
+
/**
|
|
32
|
+
* Present when more worlds remain. **Its absence is the only signal that a listing is complete** — a consumer MUST NOT infer exhaustion from a short page, because a maintainer may return fewer than `limit` for reasons of its own.
|
|
33
|
+
*/
|
|
34
|
+
nextCursor?: string;
|
|
35
|
+
ext?: Ext;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* One named part of the holder's life, and what belongs to it. Agent-scoped, like the attribute pool and the profiles it groups — a world names records that sit above every trust context, so it cannot itself live inside one.
|
|
39
|
+
*/
|
|
40
|
+
export interface World {
|
|
41
|
+
worldId: Ulid;
|
|
42
|
+
name: string;
|
|
43
|
+
colour: WorldColour;
|
|
44
|
+
icon?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Profiles belonging to this world. A maintainer MUST NOT prune an id whose profile has been deleted: a dangling member is how a consumer can offer to tidy, and silently dropping it turns a deletion the holder may not have intended into one they cannot see.
|
|
47
|
+
*
|
|
48
|
+
* @maxItems 256
|
|
49
|
+
*/
|
|
50
|
+
faceIds: Ulid[];
|
|
51
|
+
/**
|
|
52
|
+
* Attributes belonging to this world, with the same rule about dangling ids as `faceIds`.
|
|
53
|
+
*
|
|
54
|
+
* @maxItems 1024
|
|
55
|
+
*/
|
|
56
|
+
attributeIds: Ulid[];
|
|
57
|
+
version: Version;
|
|
58
|
+
createdAt?: string;
|
|
59
|
+
updatedAt: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
63
|
+
export type { Ext, Ulid, Version, WorldColour };
|
|
64
|
+
|
|
65
|
+
/** Trust Task type URI. */
|
|
66
|
+
export const TYPE_URI = "https://trusttasks.org/spec/persona/world/list/1.0" as const;
|
|
67
|
+
|
|
68
|
+
/** Stable alias for this specification's request payload shape. */
|
|
69
|
+
export type Payload = PersonaWorldListPayload;
|
|
70
|
+
|
|
71
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
72
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/persona/world/list/1.0#response" as const;
|
|
73
|
+
|
|
74
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
75
|
+
export type Response = PersonaWorldListResponsePayload;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* This specification's payload schema, as a value.
|
|
79
|
+
*
|
|
80
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
81
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
82
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
83
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
84
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
85
|
+
*/
|
|
86
|
+
export const PAYLOAD_SCHEMA = {
|
|
87
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
88
|
+
"$id": "https://trusttasks.org/spec/persona/world/list/1.0",
|
|
89
|
+
"title": "Persona — World List — payload",
|
|
90
|
+
"description": "List the holder's worlds, with their membership. Cursor-paginated like every other persona listing.",
|
|
91
|
+
"type": "object",
|
|
92
|
+
"additionalProperties": false,
|
|
93
|
+
"required": [],
|
|
94
|
+
"properties": {
|
|
95
|
+
"limit": {
|
|
96
|
+
"type": "integer",
|
|
97
|
+
"minimum": 1,
|
|
98
|
+
"maximum": 250,
|
|
99
|
+
"default": 100,
|
|
100
|
+
"description": "The page size to ask for — never a cap on the result. A consumer that wants every world follows `nextCursor` to the end; one that treats this as a limit will silently draw a partial picture."
|
|
101
|
+
},
|
|
102
|
+
"cursor": {
|
|
103
|
+
"type": "string",
|
|
104
|
+
"maxLength": 4096,
|
|
105
|
+
"description": "Continue a prior listing. Opaque: a producer echoes what it was given and MUST NOT construct one."
|
|
106
|
+
},
|
|
107
|
+
"ext": {
|
|
108
|
+
"$ref": "#/$defs/Ext"
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"$defs": {
|
|
112
|
+
"Response": {
|
|
113
|
+
"$anchor": "response",
|
|
114
|
+
"title": "Persona World List — response payload",
|
|
115
|
+
"description": "Success response to persona/world/list. Type https://trusttasks.org/spec/persona/world/list/1.0#response.",
|
|
116
|
+
"type": "object",
|
|
117
|
+
"additionalProperties": false,
|
|
118
|
+
"required": [
|
|
119
|
+
"worlds"
|
|
120
|
+
],
|
|
121
|
+
"properties": {
|
|
122
|
+
"worlds": {
|
|
123
|
+
"type": "array",
|
|
124
|
+
"maxItems": 250,
|
|
125
|
+
"items": {
|
|
126
|
+
"$ref": "#/$defs/World"
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"nextCursor": {
|
|
130
|
+
"type": "string",
|
|
131
|
+
"maxLength": 4096,
|
|
132
|
+
"description": "Present when more worlds remain. **Its absence is the only signal that a listing is complete** — a consumer MUST NOT infer exhaustion from a short page, because a maintainer may return fewer than `limit` for reasons of its own."
|
|
133
|
+
},
|
|
134
|
+
"ext": {
|
|
135
|
+
"$ref": "#/$defs/Ext"
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
"World": {
|
|
140
|
+
"title": "World",
|
|
141
|
+
"type": "object",
|
|
142
|
+
"additionalProperties": false,
|
|
143
|
+
"required": [
|
|
144
|
+
"worldId",
|
|
145
|
+
"name",
|
|
146
|
+
"colour",
|
|
147
|
+
"faceIds",
|
|
148
|
+
"attributeIds",
|
|
149
|
+
"version",
|
|
150
|
+
"updatedAt"
|
|
151
|
+
],
|
|
152
|
+
"description": "One named part of the holder's life, and what belongs to it. Agent-scoped, like the attribute pool and the profiles it groups — a world names records that sit above every trust context, so it cannot itself live inside one.",
|
|
153
|
+
"properties": {
|
|
154
|
+
"worldId": {
|
|
155
|
+
"$ref": "#/$defs/Ulid"
|
|
156
|
+
},
|
|
157
|
+
"name": {
|
|
158
|
+
"type": "string",
|
|
159
|
+
"minLength": 1,
|
|
160
|
+
"maxLength": 64
|
|
161
|
+
},
|
|
162
|
+
"colour": {
|
|
163
|
+
"$ref": "#/$defs/WorldColour"
|
|
164
|
+
},
|
|
165
|
+
"icon": {
|
|
166
|
+
"type": "string",
|
|
167
|
+
"minLength": 1,
|
|
168
|
+
"maxLength": 8
|
|
169
|
+
},
|
|
170
|
+
"faceIds": {
|
|
171
|
+
"type": "array",
|
|
172
|
+
"maxItems": 256,
|
|
173
|
+
"uniqueItems": true,
|
|
174
|
+
"items": {
|
|
175
|
+
"$ref": "#/$defs/Ulid"
|
|
176
|
+
},
|
|
177
|
+
"description": "Profiles belonging to this world. A maintainer MUST NOT prune an id whose profile has been deleted: a dangling member is how a consumer can offer to tidy, and silently dropping it turns a deletion the holder may not have intended into one they cannot see."
|
|
178
|
+
},
|
|
179
|
+
"attributeIds": {
|
|
180
|
+
"type": "array",
|
|
181
|
+
"maxItems": 1024,
|
|
182
|
+
"uniqueItems": true,
|
|
183
|
+
"items": {
|
|
184
|
+
"$ref": "#/$defs/Ulid"
|
|
185
|
+
},
|
|
186
|
+
"description": "Attributes belonging to this world, with the same rule about dangling ids as `faceIds`."
|
|
187
|
+
},
|
|
188
|
+
"version": {
|
|
189
|
+
"$ref": "#/$defs/Version"
|
|
190
|
+
},
|
|
191
|
+
"createdAt": {
|
|
192
|
+
"type": "string",
|
|
193
|
+
"format": "date-time"
|
|
194
|
+
},
|
|
195
|
+
"updatedAt": {
|
|
196
|
+
"type": "string",
|
|
197
|
+
"format": "date-time"
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
"Version": {
|
|
202
|
+
"title": "Version",
|
|
203
|
+
"description": "A value of the store's monotonic write counter. Server-assigned; a producer never chooses one.",
|
|
204
|
+
"type": "integer",
|
|
205
|
+
"minimum": 1
|
|
206
|
+
},
|
|
207
|
+
"Ulid": {
|
|
208
|
+
"title": "Ulid",
|
|
209
|
+
"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.",
|
|
210
|
+
"type": "string",
|
|
211
|
+
"pattern": "^[0-9A-HJKMNP-TV-Z]{26}$"
|
|
212
|
+
},
|
|
213
|
+
"WorldColour": {
|
|
214
|
+
"title": "WorldColour",
|
|
215
|
+
"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.",
|
|
216
|
+
"type": "string",
|
|
217
|
+
"enum": [
|
|
218
|
+
"slate",
|
|
219
|
+
"indigo",
|
|
220
|
+
"teal",
|
|
221
|
+
"moss",
|
|
222
|
+
"sand",
|
|
223
|
+
"clay",
|
|
224
|
+
"rose",
|
|
225
|
+
"plum"
|
|
226
|
+
]
|
|
227
|
+
},
|
|
228
|
+
"Ext": {
|
|
229
|
+
"title": "Ext",
|
|
230
|
+
"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.",
|
|
231
|
+
"type": "object",
|
|
232
|
+
"minProperties": 1,
|
|
233
|
+
"additionalProperties": true,
|
|
234
|
+
"propertyNames": {
|
|
235
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
} as const;
|
|
240
|
+
|
|
241
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
242
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
243
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
244
|
+
"$ref": "#/$defs/Response",
|
|
245
|
+
"$defs": {
|
|
246
|
+
"Response": {
|
|
247
|
+
"$anchor": "response",
|
|
248
|
+
"title": "Persona World List — response payload",
|
|
249
|
+
"description": "Success response to persona/world/list. Type https://trusttasks.org/spec/persona/world/list/1.0#response.",
|
|
250
|
+
"type": "object",
|
|
251
|
+
"additionalProperties": false,
|
|
252
|
+
"required": [
|
|
253
|
+
"worlds"
|
|
254
|
+
],
|
|
255
|
+
"properties": {
|
|
256
|
+
"worlds": {
|
|
257
|
+
"type": "array",
|
|
258
|
+
"maxItems": 250,
|
|
259
|
+
"items": {
|
|
260
|
+
"$ref": "#/$defs/World"
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
"nextCursor": {
|
|
264
|
+
"type": "string",
|
|
265
|
+
"maxLength": 4096,
|
|
266
|
+
"description": "Present when more worlds remain. **Its absence is the only signal that a listing is complete** — a consumer MUST NOT infer exhaustion from a short page, because a maintainer may return fewer than `limit` for reasons of its own."
|
|
267
|
+
},
|
|
268
|
+
"ext": {
|
|
269
|
+
"$ref": "#/$defs/Ext"
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
"World": {
|
|
274
|
+
"title": "World",
|
|
275
|
+
"type": "object",
|
|
276
|
+
"additionalProperties": false,
|
|
277
|
+
"required": [
|
|
278
|
+
"worldId",
|
|
279
|
+
"name",
|
|
280
|
+
"colour",
|
|
281
|
+
"faceIds",
|
|
282
|
+
"attributeIds",
|
|
283
|
+
"version",
|
|
284
|
+
"updatedAt"
|
|
285
|
+
],
|
|
286
|
+
"description": "One named part of the holder's life, and what belongs to it. Agent-scoped, like the attribute pool and the profiles it groups — a world names records that sit above every trust context, so it cannot itself live inside one.",
|
|
287
|
+
"properties": {
|
|
288
|
+
"worldId": {
|
|
289
|
+
"$ref": "#/$defs/Ulid"
|
|
290
|
+
},
|
|
291
|
+
"name": {
|
|
292
|
+
"type": "string",
|
|
293
|
+
"minLength": 1,
|
|
294
|
+
"maxLength": 64
|
|
295
|
+
},
|
|
296
|
+
"colour": {
|
|
297
|
+
"$ref": "#/$defs/WorldColour"
|
|
298
|
+
},
|
|
299
|
+
"icon": {
|
|
300
|
+
"type": "string",
|
|
301
|
+
"minLength": 1,
|
|
302
|
+
"maxLength": 8
|
|
303
|
+
},
|
|
304
|
+
"faceIds": {
|
|
305
|
+
"type": "array",
|
|
306
|
+
"maxItems": 256,
|
|
307
|
+
"uniqueItems": true,
|
|
308
|
+
"items": {
|
|
309
|
+
"$ref": "#/$defs/Ulid"
|
|
310
|
+
},
|
|
311
|
+
"description": "Profiles belonging to this world. A maintainer MUST NOT prune an id whose profile has been deleted: a dangling member is how a consumer can offer to tidy, and silently dropping it turns a deletion the holder may not have intended into one they cannot see."
|
|
312
|
+
},
|
|
313
|
+
"attributeIds": {
|
|
314
|
+
"type": "array",
|
|
315
|
+
"maxItems": 1024,
|
|
316
|
+
"uniqueItems": true,
|
|
317
|
+
"items": {
|
|
318
|
+
"$ref": "#/$defs/Ulid"
|
|
319
|
+
},
|
|
320
|
+
"description": "Attributes belonging to this world, with the same rule about dangling ids as `faceIds`."
|
|
321
|
+
},
|
|
322
|
+
"version": {
|
|
323
|
+
"$ref": "#/$defs/Version"
|
|
324
|
+
},
|
|
325
|
+
"createdAt": {
|
|
326
|
+
"type": "string",
|
|
327
|
+
"format": "date-time"
|
|
328
|
+
},
|
|
329
|
+
"updatedAt": {
|
|
330
|
+
"type": "string",
|
|
331
|
+
"format": "date-time"
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
"Version": {
|
|
336
|
+
"title": "Version",
|
|
337
|
+
"description": "A value of the store's monotonic write counter. Server-assigned; a producer never chooses one.",
|
|
338
|
+
"type": "integer",
|
|
339
|
+
"minimum": 1
|
|
340
|
+
},
|
|
341
|
+
"Ulid": {
|
|
342
|
+
"title": "Ulid",
|
|
343
|
+
"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.",
|
|
344
|
+
"type": "string",
|
|
345
|
+
"pattern": "^[0-9A-HJKMNP-TV-Z]{26}$"
|
|
346
|
+
},
|
|
347
|
+
"WorldColour": {
|
|
348
|
+
"title": "WorldColour",
|
|
349
|
+
"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.",
|
|
350
|
+
"type": "string",
|
|
351
|
+
"enum": [
|
|
352
|
+
"slate",
|
|
353
|
+
"indigo",
|
|
354
|
+
"teal",
|
|
355
|
+
"moss",
|
|
356
|
+
"sand",
|
|
357
|
+
"clay",
|
|
358
|
+
"rose",
|
|
359
|
+
"plum"
|
|
360
|
+
]
|
|
361
|
+
},
|
|
362
|
+
"Ext": {
|
|
363
|
+
"title": "Ext",
|
|
364
|
+
"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.",
|
|
365
|
+
"type": "object",
|
|
366
|
+
"minProperties": 1,
|
|
367
|
+
"additionalProperties": true,
|
|
368
|
+
"propertyNames": {
|
|
369
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
} as const;
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
377
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
378
|
+
* per-specification and cannot be derived from the document alone, and
|
|
379
|
+
* item 2 needs the schema this carries.
|
|
380
|
+
*/
|
|
381
|
+
export const SPEC = {
|
|
382
|
+
typeUri: TYPE_URI,
|
|
383
|
+
isBearer: false,
|
|
384
|
+
isProofRequired: true,
|
|
385
|
+
isRecipientRequired: true,
|
|
386
|
+
isIssuedAtRequired: true,
|
|
387
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
388
|
+
} as const;
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
392
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
393
|
+
* parties (§7.3 item 5).
|
|
394
|
+
*/
|
|
395
|
+
export const RESPONSE_SPEC = {
|
|
396
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
397
|
+
isBearer: false,
|
|
398
|
+
isProofRequired: true,
|
|
399
|
+
isRecipientRequired: true,
|
|
400
|
+
isIssuedAtRequired: true,
|
|
401
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
402
|
+
} as const;
|