@openvtc/trust-tasks 0.16.9 → 0.16.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/CHANGELOG.md +220 -0
  2. package/dist/_shared/components.d.ts +206 -5
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/index.d.ts +27 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +27 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/persona/_shared/0.1/persona-record.d.ts +22 -0
  9. package/dist/persona/_shared/0.1/persona-record.d.ts.map +1 -0
  10. package/dist/persona/_shared/0.1/persona-record.js +6 -0
  11. package/dist/persona/_shared/0.1/persona-record.js.map +1 -0
  12. package/dist/persona/attribute/delete/1.0/payload.d.ts +351 -0
  13. package/dist/persona/attribute/delete/1.0/payload.d.ts.map +1 -0
  14. package/dist/persona/attribute/delete/1.0/payload.js +188 -0
  15. package/dist/persona/attribute/delete/1.0/payload.js.map +1 -0
  16. package/dist/persona/attribute/list/1.0/payload.d.ts +895 -0
  17. package/dist/persona/attribute/list/1.0/payload.d.ts.map +1 -0
  18. package/dist/persona/attribute/list/1.0/payload.js +530 -0
  19. package/dist/persona/attribute/list/1.0/payload.js.map +1 -0
  20. package/dist/persona/attribute/put/1.0/payload.d.ts +829 -0
  21. package/dist/persona/attribute/put/1.0/payload.d.ts.map +1 -0
  22. package/dist/persona/attribute/put/1.0/payload.js +487 -0
  23. package/dist/persona/attribute/put/1.0/payload.js.map +1 -0
  24. package/dist/persona/binding/get/1.0/payload.d.ts +382 -0
  25. package/dist/persona/binding/get/1.0/payload.d.ts.map +1 -0
  26. package/dist/persona/binding/get/1.0/payload.js +206 -0
  27. package/dist/persona/binding/get/1.0/payload.js.map +1 -0
  28. package/dist/persona/binding/list/1.0/payload.d.ts +387 -0
  29. package/dist/persona/binding/list/1.0/payload.d.ts.map +1 -0
  30. package/dist/persona/binding/list/1.0/payload.js +210 -0
  31. package/dist/persona/binding/list/1.0/payload.js.map +1 -0
  32. package/dist/persona/binding/set/1.0/payload.d.ts +545 -0
  33. package/dist/persona/binding/set/1.0/payload.d.ts.map +1 -0
  34. package/dist/persona/binding/set/1.0/payload.js +302 -0
  35. package/dist/persona/binding/set/1.0/payload.js.map +1 -0
  36. package/dist/persona/contact/delete/1.0/payload.d.ts +313 -0
  37. package/dist/persona/contact/delete/1.0/payload.d.ts.map +1 -0
  38. package/dist/persona/contact/delete/1.0/payload.js +174 -0
  39. package/dist/persona/contact/delete/1.0/payload.js.map +1 -0
  40. package/dist/persona/contact/get/1.0/payload.d.ts +1027 -0
  41. package/dist/persona/contact/get/1.0/payload.d.ts.map +1 -0
  42. package/dist/persona/contact/get/1.0/payload.js +606 -0
  43. package/dist/persona/contact/get/1.0/payload.js.map +1 -0
  44. package/dist/persona/contact/list/1.0/payload.d.ts +490 -0
  45. package/dist/persona/contact/list/1.0/payload.d.ts.map +1 -0
  46. package/dist/persona/contact/list/1.0/payload.js +262 -0
  47. package/dist/persona/contact/list/1.0/payload.js.map +1 -0
  48. package/dist/persona/contact/put/1.0/payload.d.ts +885 -0
  49. package/dist/persona/contact/put/1.0/payload.d.ts.map +1 -0
  50. package/dist/persona/contact/put/1.0/payload.js +518 -0
  51. package/dist/persona/contact/put/1.0/payload.js.map +1 -0
  52. package/dist/persona/correlation/analyze/1.0/payload.d.ts +648 -0
  53. package/dist/persona/correlation/analyze/1.0/payload.d.ts.map +1 -0
  54. package/dist/persona/correlation/analyze/1.0/payload.js +338 -0
  55. package/dist/persona/correlation/analyze/1.0/payload.js.map +1 -0
  56. package/dist/persona/disclosure/history/1.0/payload.d.ts +639 -0
  57. package/dist/persona/disclosure/history/1.0/payload.d.ts.map +1 -0
  58. package/dist/persona/disclosure/history/1.0/payload.js +339 -0
  59. package/dist/persona/disclosure/history/1.0/payload.js.map +1 -0
  60. package/dist/persona/disclosure/present/1.0/payload.d.ts +400 -0
  61. package/dist/persona/disclosure/present/1.0/payload.d.ts.map +1 -0
  62. package/dist/persona/disclosure/present/1.0/payload.js +211 -0
  63. package/dist/persona/disclosure/present/1.0/payload.js.map +1 -0
  64. package/dist/persona/disclosure/preview/1.0/payload.d.ts +858 -0
  65. package/dist/persona/disclosure/preview/1.0/payload.d.ts.map +1 -0
  66. package/dist/persona/disclosure/preview/1.0/payload.js +480 -0
  67. package/dist/persona/disclosure/preview/1.0/payload.js.map +1 -0
  68. package/dist/persona/local/binding/set/1.0/payload.d.ts +394 -0
  69. package/dist/persona/local/binding/set/1.0/payload.d.ts.map +1 -0
  70. package/dist/persona/local/binding/set/1.0/payload.js +226 -0
  71. package/dist/persona/local/binding/set/1.0/payload.js.map +1 -0
  72. package/dist/persona/local/profile/delete/1.0/payload.d.ts +311 -0
  73. package/dist/persona/local/profile/delete/1.0/payload.d.ts.map +1 -0
  74. package/dist/persona/local/profile/delete/1.0/payload.js +173 -0
  75. package/dist/persona/local/profile/delete/1.0/payload.js.map +1 -0
  76. package/dist/persona/local/profile/get/1.0/payload.d.ts +368 -0
  77. package/dist/persona/local/profile/get/1.0/payload.d.ts.map +1 -0
  78. package/dist/persona/local/profile/get/1.0/payload.js +210 -0
  79. package/dist/persona/local/profile/get/1.0/payload.js.map +1 -0
  80. package/dist/persona/local/profile/list/1.0/payload.d.ts +387 -0
  81. package/dist/persona/local/profile/list/1.0/payload.d.ts.map +1 -0
  82. package/dist/persona/local/profile/list/1.0/payload.js +214 -0
  83. package/dist/persona/local/profile/list/1.0/payload.js.map +1 -0
  84. package/dist/persona/local/profile/put/1.0/payload.d.ts +545 -0
  85. package/dist/persona/local/profile/put/1.0/payload.d.ts.map +1 -0
  86. package/dist/persona/local/profile/put/1.0/payload.js +315 -0
  87. package/dist/persona/local/profile/put/1.0/payload.js.map +1 -0
  88. package/dist/persona/profile/delete/1.0/payload.d.ts +350 -0
  89. package/dist/persona/profile/delete/1.0/payload.d.ts.map +1 -0
  90. package/dist/persona/profile/delete/1.0/payload.js +189 -0
  91. package/dist/persona/profile/delete/1.0/payload.js.map +1 -0
  92. package/dist/persona/profile/get/1.0/payload.d.ts +1307 -0
  93. package/dist/persona/profile/get/1.0/payload.d.ts.map +1 -0
  94. package/dist/persona/profile/get/1.0/payload.js +802 -0
  95. package/dist/persona/profile/get/1.0/payload.js.map +1 -0
  96. package/dist/persona/profile/list/1.0/payload.d.ts +1120 -0
  97. package/dist/persona/profile/list/1.0/payload.d.ts.map +1 -0
  98. package/dist/persona/profile/list/1.0/payload.js +680 -0
  99. package/dist/persona/profile/list/1.0/payload.js.map +1 -0
  100. package/dist/persona/profile/put/1.0/payload.d.ts +1115 -0
  101. package/dist/persona/profile/put/1.0/payload.d.ts.map +1 -0
  102. package/dist/persona/profile/put/1.0/payload.js +675 -0
  103. package/dist/persona/profile/put/1.0/payload.js.map +1 -0
  104. package/dist/persona/renderers/list/1.0/payload.d.ts +362 -0
  105. package/dist/persona/renderers/list/1.0/payload.d.ts.map +1 -0
  106. package/dist/persona/renderers/list/1.0/payload.js +197 -0
  107. package/dist/persona/renderers/list/1.0/payload.js.map +1 -0
  108. package/dist/rooms/owner/claim/0.1/payload.d.ts +391 -0
  109. package/dist/rooms/owner/claim/0.1/payload.d.ts.map +1 -0
  110. package/dist/rooms/owner/claim/0.1/payload.js +214 -0
  111. package/dist/rooms/owner/claim/0.1/payload.js.map +1 -0
  112. package/dist/rooms/owner/transfer/0.1/payload.d.ts +391 -0
  113. package/dist/rooms/owner/transfer/0.1/payload.d.ts.map +1 -0
  114. package/dist/rooms/owner/transfer/0.1/payload.js +214 -0
  115. package/dist/rooms/owner/transfer/0.1/payload.js.map +1 -0
  116. package/dist/vta/_shared/0.1/app-state-record.d.ts +1 -1
  117. package/dist/vta/_shared/0.1/app-state-record.d.ts.map +1 -1
  118. package/dist/vta/app-state/delete/1.0/payload.d.ts +1 -1
  119. package/dist/vta/app-state/delete/1.0/payload.d.ts.map +1 -1
  120. package/dist/vta/app-state/get/1.0/payload.d.ts +1 -1
  121. package/dist/vta/app-state/get/1.0/payload.d.ts.map +1 -1
  122. package/dist/vta/app-state/get-many/1.0/payload.d.ts +1 -1
  123. package/dist/vta/app-state/get-many/1.0/payload.d.ts.map +1 -1
  124. package/dist/vta/app-state/list/1.0/payload.d.ts +1 -1
  125. package/dist/vta/app-state/list/1.0/payload.d.ts.map +1 -1
  126. package/dist/vta/app-state/put/1.0/payload.d.ts +1 -1
  127. package/dist/vta/app-state/put/1.0/payload.d.ts.map +1 -1
  128. package/dist/vta/app-state/put-many/1.0/payload.d.ts +1 -1
  129. package/dist/vta/app-state/put-many/1.0/payload.d.ts.map +1 -1
  130. package/package.json +1 -1
  131. package/src/_shared/components.ts +213 -5
  132. package/src/index.ts +27 -0
  133. package/src/persona/_shared/0.1/persona-record.ts +23 -0
  134. package/src/persona/attribute/delete/1.0/payload.ts +238 -0
  135. package/src/persona/attribute/list/1.0/payload.ts +588 -0
  136. package/src/persona/attribute/put/1.0/payload.ts +559 -0
  137. package/src/persona/binding/get/1.0/payload.ts +257 -0
  138. package/src/persona/binding/list/1.0/payload.ts +260 -0
  139. package/src/persona/binding/set/1.0/payload.ts +370 -0
  140. package/src/persona/contact/delete/1.0/payload.ts +216 -0
  141. package/src/persona/contact/get/1.0/payload.ts +662 -0
  142. package/src/persona/contact/list/1.0/payload.ts +323 -0
  143. package/src/persona/contact/put/1.0/payload.ts +580 -0
  144. package/src/persona/correlation/analyze/1.0/payload.ts +466 -0
  145. package/src/persona/disclosure/history/1.0/payload.ts +415 -0
  146. package/src/persona/disclosure/present/1.0/payload.ts +274 -0
  147. package/src/persona/disclosure/preview/1.0/payload.ts +597 -0
  148. package/src/persona/local/binding/set/1.0/payload.ts +267 -0
  149. package/src/persona/local/profile/delete/1.0/payload.ts +215 -0
  150. package/src/persona/local/profile/get/1.0/payload.ts +251 -0
  151. package/src/persona/local/profile/list/1.0/payload.ts +260 -0
  152. package/src/persona/local/profile/put/1.0/payload.ts +373 -0
  153. package/src/persona/profile/delete/1.0/payload.ts +236 -0
  154. package/src/persona/profile/get/1.0/payload.ts +844 -0
  155. package/src/persona/profile/list/1.0/payload.ts +723 -0
  156. package/src/persona/profile/put/1.0/payload.ts +741 -0
  157. package/src/persona/renderers/list/1.0/payload.ts +248 -0
  158. package/src/rooms/owner/claim/0.1/payload.ts +268 -0
  159. package/src/rooms/owner/transfer/0.1/payload.ts +268 -0
  160. package/src/vta/_shared/0.1/app-state-record.ts +1 -1
  161. package/src/vta/app-state/delete/1.0/payload.ts +1 -1
  162. package/src/vta/app-state/get/1.0/payload.ts +1 -1
  163. package/src/vta/app-state/get-many/1.0/payload.ts +1 -1
  164. package/src/vta/app-state/list/1.0/payload.ts +1 -1
  165. package/src/vta/app-state/put/1.0/payload.ts +1 -1
  166. package/src/vta/app-state/put-many/1.0/payload.ts +1 -1
@@ -0,0 +1,741 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/persona/profile/put/1.0/payload.schema.json
4
+ */
5
+
6
+ import type { ClaimType, ExpectedVersion_PersonaV0_1 as ExpectedVersion, Ext, ProfileEntry, ProofRung, Provenance, Ulid, ValueType, Version_PersonaV0_1 as Version } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * Create or replace one profile: a named, ordered projection over the holder's attribute pool. Entries reference pool attributes rather than copying them, so a fact edited once is edited everywhere it appears.
11
+ */
12
+ export interface PersonaProfilePutPayload {
13
+ /**
14
+ * Omit to create; supply to replace. A producer that means to create and wants the write to be safe under retry SHOULD supply a generated id together with `expectedVersion: 0`.
15
+ */
16
+ profileId?: Ulid;
17
+ /**
18
+ * The holder's name for the profile — "Work", "Gaming". Never disclosed to a verifier; it is how the holder finds it again.
19
+ */
20
+ name: string;
21
+ /**
22
+ * Ordered; the order is display order. An empty array is legal and means a profile that discloses nothing — useful as a starting point, and not the same as no profile at all.
23
+ *
24
+ * @maxItems 256
25
+ */
26
+ entries: ProfileEntry[];
27
+ /**
28
+ * Vault identifiers of credentials associated with this profile as inventory — what this persona can prove — as distinct from the evidence relationship a credentialBacked attribute expresses. The two answer different questions and a consumer MUST NOT read one as the other.
29
+ *
30
+ * @maxItems 256
31
+ */
32
+ credentialRefs?: string[];
33
+ expectedVersion?: ExpectedVersion;
34
+ ext?: Ext;
35
+ }
36
+ /**
37
+ * Success response to persona/profile/put. Type https://trusttasks.org/spec/persona/profile/put/1.0#response.
38
+ */
39
+ export interface PersonaProfilePutResponsePayload {
40
+ profileId: Ulid;
41
+ version: Version;
42
+ created: boolean;
43
+ /**
44
+ * Advisory correlation result for the composition as a whole, returned on the write so a builder can warn while the holder is still composing. Advisory only: the write has applied, and a maintainer MUST NOT refuse a composition on correlation grounds.
45
+ */
46
+ correlation?: {
47
+ severity: "none" | "low" | "high";
48
+ /**
49
+ * How many of this profile's entries present a value that another profile also presents. A count rather than a list; identifiers come from persona/correlation/analyze.
50
+ */
51
+ sharedAttributeCount?: number;
52
+ };
53
+ createdAt?: string;
54
+ updatedAt: string;
55
+ ext?: Ext;
56
+ }
57
+
58
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
59
+ export type { ClaimType, ExpectedVersion, Ext, ProfileEntry, ProofRung, Provenance, Ulid, ValueType, Version };
60
+
61
+ /** Trust Task type URI. */
62
+ export const TYPE_URI = "https://trusttasks.org/spec/persona/profile/put/1.0" as const;
63
+
64
+ /** Stable alias for this specification's request payload shape. */
65
+ export type Payload = PersonaProfilePutPayload;
66
+
67
+ /** Trust Task response type URI (request type URI + "#response"). */
68
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/persona/profile/put/1.0#response" as const;
69
+
70
+ /** Stable alias for this specification's success-response payload shape. */
71
+ export type Response = PersonaProfilePutResponsePayload;
72
+
73
+ /**
74
+ * This specification's payload schema, as a value.
75
+ *
76
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
77
+ * rather than only as a `.json` file because TypeScript types are erased
78
+ * at runtime: without a schema a consumer has nothing to validate, and
79
+ * every REQUIRED payload member is optional in practice. Cross-file
80
+ * `$ref`s are already inlined, so it needs no resolver.
81
+ */
82
+ export const PAYLOAD_SCHEMA = {
83
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
84
+ "$id": "https://trusttasks.org/spec/persona/profile/put/1.0",
85
+ "title": "Persona Profile Put — payload",
86
+ "description": "Create or replace one profile: a named, ordered projection over the holder's attribute pool. Entries reference pool attributes rather than copying them, so a fact edited once is edited everywhere it appears.",
87
+ "type": "object",
88
+ "additionalProperties": false,
89
+ "required": [
90
+ "name",
91
+ "entries"
92
+ ],
93
+ "properties": {
94
+ "profileId": {
95
+ "$ref": "#/$defs/Ulid",
96
+ "description": "Omit to create; supply to replace. A producer that means to create and wants the write to be safe under retry SHOULD supply a generated id together with `expectedVersion: 0`."
97
+ },
98
+ "name": {
99
+ "type": "string",
100
+ "minLength": 1,
101
+ "maxLength": 128,
102
+ "description": "The holder's name for the profile — \"Work\", \"Gaming\". Never disclosed to a verifier; it is how the holder finds it again."
103
+ },
104
+ "entries": {
105
+ "type": "array",
106
+ "maxItems": 256,
107
+ "items": {
108
+ "$ref": "#/$defs/ProfileEntry"
109
+ },
110
+ "description": "Ordered; the order is display order. An empty array is legal and means a profile that discloses nothing — useful as a starting point, and not the same as no profile at all."
111
+ },
112
+ "credentialRefs": {
113
+ "type": "array",
114
+ "maxItems": 256,
115
+ "items": {
116
+ "type": "string",
117
+ "minLength": 1
118
+ },
119
+ "description": "Vault identifiers of credentials associated with this profile as inventory — what this persona can prove — as distinct from the evidence relationship a credentialBacked attribute expresses. The two answer different questions and a consumer MUST NOT read one as the other."
120
+ },
121
+ "expectedVersion": {
122
+ "$ref": "#/$defs/ExpectedVersion"
123
+ },
124
+ "ext": {
125
+ "$ref": "#/$defs/Ext"
126
+ }
127
+ },
128
+ "$defs": {
129
+ "Response": {
130
+ "$anchor": "response",
131
+ "title": "Persona Profile Put — response payload",
132
+ "description": "Success response to persona/profile/put. Type https://trusttasks.org/spec/persona/profile/put/1.0#response.",
133
+ "type": "object",
134
+ "additionalProperties": false,
135
+ "required": [
136
+ "profileId",
137
+ "version",
138
+ "created",
139
+ "updatedAt"
140
+ ],
141
+ "properties": {
142
+ "profileId": {
143
+ "$ref": "#/$defs/Ulid"
144
+ },
145
+ "version": {
146
+ "$ref": "#/$defs/Version"
147
+ },
148
+ "created": {
149
+ "type": "boolean"
150
+ },
151
+ "correlation": {
152
+ "type": "object",
153
+ "additionalProperties": false,
154
+ "required": [
155
+ "severity"
156
+ ],
157
+ "description": "Advisory correlation result for the composition as a whole, returned on the write so a builder can warn while the holder is still composing. Advisory only: the write has applied, and a maintainer MUST NOT refuse a composition on correlation grounds.",
158
+ "properties": {
159
+ "severity": {
160
+ "type": "string",
161
+ "enum": [
162
+ "none",
163
+ "low",
164
+ "high"
165
+ ]
166
+ },
167
+ "sharedAttributeCount": {
168
+ "type": "integer",
169
+ "minimum": 0,
170
+ "description": "How many of this profile's entries present a value that another profile also presents. A count rather than a list; identifiers come from persona/correlation/analyze."
171
+ }
172
+ }
173
+ },
174
+ "createdAt": {
175
+ "type": "string",
176
+ "format": "date-time"
177
+ },
178
+ "updatedAt": {
179
+ "type": "string",
180
+ "format": "date-time"
181
+ },
182
+ "ext": {
183
+ "$ref": "#/$defs/Ext"
184
+ }
185
+ }
186
+ },
187
+ "Ext": {
188
+ "title": "Ext",
189
+ "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.",
190
+ "type": "object",
191
+ "minProperties": 1,
192
+ "additionalProperties": true,
193
+ "propertyNames": {
194
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
195
+ }
196
+ },
197
+ "Version": {
198
+ "title": "Version",
199
+ "description": "A value of the store's monotonic write counter. Server-assigned; a producer never chooses one.",
200
+ "type": "integer",
201
+ "minimum": 1
202
+ },
203
+ "Ulid": {
204
+ "title": "Ulid",
205
+ "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.",
206
+ "type": "string",
207
+ "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$"
208
+ },
209
+ "ExpectedVersion": {
210
+ "title": "ExpectedVersion",
211
+ "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.",
212
+ "type": "integer",
213
+ "minimum": 0
214
+ },
215
+ "ProfileEntry": {
216
+ "title": "ProfileEntry",
217
+ "description": "One line of a profile, in exactly one of four forms. Together they are the whole of a profile's flexibility, and each exists for a case the others handle badly.\n\n`{ref}` — use the pool attribute, live. Editing the pool updates every profile that references it, which is the point.\n\n`{ref, pinVersion}` — use the value as it was at that version. For a profile that must keep presenting the value a counterparty already verified.\n\n`{ref, override}` — the same fact, a different value here. (\"In the gaming profile my display name is different.\")\n\n`{inline}` — a value that never enters the pool, and so never leaks into another profile.\n\nOmission is exclusion; there is no removal marker.",
218
+ "type": "object",
219
+ "oneOf": [
220
+ {
221
+ "additionalProperties": false,
222
+ "required": [
223
+ "ref"
224
+ ],
225
+ "properties": {
226
+ "ref": {
227
+ "$ref": "#/$defs/Ulid"
228
+ }
229
+ }
230
+ },
231
+ {
232
+ "additionalProperties": false,
233
+ "required": [
234
+ "ref",
235
+ "pinVersion"
236
+ ],
237
+ "properties": {
238
+ "ref": {
239
+ "$ref": "#/$defs/Ulid"
240
+ },
241
+ "pinVersion": {
242
+ "$ref": "#/$defs/Version"
243
+ }
244
+ }
245
+ },
246
+ {
247
+ "additionalProperties": false,
248
+ "required": [
249
+ "ref",
250
+ "override"
251
+ ],
252
+ "properties": {
253
+ "ref": {
254
+ "$ref": "#/$defs/Ulid"
255
+ },
256
+ "override": {
257
+ "type": "object",
258
+ "additionalProperties": false,
259
+ "required": [
260
+ "value"
261
+ ],
262
+ "properties": {
263
+ "value": {},
264
+ "label": {
265
+ "type": "string",
266
+ "maxLength": 128
267
+ }
268
+ },
269
+ "description": "Replaces the pool attribute's value for this profile only. `type`, `valueType` and `provenance` are inherited from the referenced attribute and MUST NOT be overridden — an override that changed provenance would let a self-asserted value present as attested."
270
+ }
271
+ }
272
+ },
273
+ {
274
+ "additionalProperties": false,
275
+ "required": [
276
+ "inline"
277
+ ],
278
+ "properties": {
279
+ "inline": {
280
+ "type": "object",
281
+ "additionalProperties": false,
282
+ "required": [
283
+ "type",
284
+ "valueType",
285
+ "value",
286
+ "provenance"
287
+ ],
288
+ "properties": {
289
+ "type": {
290
+ "$ref": "#/$defs/ClaimType"
291
+ },
292
+ "valueType": {
293
+ "$ref": "#/$defs/ValueType"
294
+ },
295
+ "value": {},
296
+ "label": {
297
+ "type": "string",
298
+ "maxLength": 128
299
+ },
300
+ "provenance": {
301
+ "$ref": "#/$defs/Provenance"
302
+ }
303
+ }
304
+ }
305
+ }
306
+ }
307
+ ]
308
+ },
309
+ "Provenance": {
310
+ "title": "Provenance",
311
+ "description": "Where a value comes from, and the member that makes this family worth building on a trust stack rather than in an address book. It survives to the verifier, so a recipient can tell — per field — what the holder typed from what an issuer attested.\n\n`selfAsserted` — the holder supplied it.\n\n`credentialBacked` — the value is derived from a credential in the vault at `claimPath`. The stored value is a CACHE FOR DISPLAY; the credential is the truth. A maintainer MUST re-derive it on read and MUST fail closed (never presenting a stale value) when the credential has been revoked, has expired, or has been archived or deleted.\n\n`generated` — the value is minted per verifier at disclosure time and recorded against that verifier, so every relying party receives a different one that routes back to the holder. This is the shape of the most widely adopted consumer privacy feature in this space; a maintainer need not operate a relay to conform, but the shape must exist, because retrofitting per-verifier values into a pool-of-values model is a migration rather than an addition.",
312
+ "type": "object",
313
+ "required": [
314
+ "kind"
315
+ ],
316
+ "oneOf": [
317
+ {
318
+ "additionalProperties": false,
319
+ "required": [
320
+ "kind"
321
+ ],
322
+ "properties": {
323
+ "kind": {
324
+ "const": "selfAsserted"
325
+ }
326
+ }
327
+ },
328
+ {
329
+ "additionalProperties": false,
330
+ "required": [
331
+ "kind",
332
+ "credentialId",
333
+ "claimPath"
334
+ ],
335
+ "properties": {
336
+ "kind": {
337
+ "const": "credentialBacked"
338
+ },
339
+ "credentialId": {
340
+ "type": "string",
341
+ "minLength": 1,
342
+ "description": "Vault identifier of the backing credential."
343
+ },
344
+ "claimPath": {
345
+ "type": "string",
346
+ "pattern": "^(/[^/~]*(~[01][^/~]*)*)*$",
347
+ "description": "RFC 6901 JSON Pointer to the claim within the credential, e.g. `/credentialSubject/familyName`."
348
+ },
349
+ "issuerDid": {
350
+ "type": "string",
351
+ "minLength": 1,
352
+ "description": "Issuer of the backing credential. Advisory: a consumer MUST verify the credential rather than trusting this member."
353
+ },
354
+ "proof": {
355
+ "$ref": "#/$defs/ProofRung",
356
+ "description": "The disclosure rung this claim was, or will be, presented at."
357
+ }
358
+ }
359
+ },
360
+ {
361
+ "additionalProperties": false,
362
+ "required": [
363
+ "kind",
364
+ "generator"
365
+ ],
366
+ "properties": {
367
+ "kind": {
368
+ "const": "generated"
369
+ },
370
+ "generator": {
371
+ "type": "string",
372
+ "minLength": 1,
373
+ "maxLength": 64,
374
+ "description": "Names the minting scheme, e.g. `relayEmail`. Maintainer-defined."
375
+ },
376
+ "perVerifier": {
377
+ "type": "boolean",
378
+ "default": true,
379
+ "description": "When true (the default and the only useful setting), a distinct value is minted for each verifier."
380
+ }
381
+ }
382
+ }
383
+ ]
384
+ },
385
+ "ProofRung": {
386
+ "title": "ProofRung",
387
+ "description": "How strongly a credential-backed claim is hidden when presented, ordered most private first. `predicate` proves a statement over a claim without disclosing the claim. `derived` discloses exactly the claims needed via an unlinkable derived proof, so two presentations cannot be joined. `selectiveDisclosure` discloses exactly the claims needed but carries the issuer's signature unchanged, so two presentations ARE linkable. `whole` discloses the entire credential.\n\nThe distinction between the first two and the last two is of kind, not degree: only `predicate` and `derived` avoid handing two verifiers a join key. A maintainer MUST default to the highest rung the credential's format supports, and MUST NOT silently fall to a lower one — a request that cannot be satisfied at the rung a producer asked for is refused, because a silent privacy downgrade discloses material the holder believed was hidden.",
388
+ "type": "string",
389
+ "enum": [
390
+ "predicate",
391
+ "derived",
392
+ "selectiveDisclosure",
393
+ "whole"
394
+ ]
395
+ },
396
+ "ValueType": {
397
+ "title": "ValueType",
398
+ "description": "The JSON shape of `value`, declared so that a consumer can render and compare without guessing. The maintainer validates that `value` agrees with this member and does nothing further: it does NOT validate a phone number against a phone-number grammar. That is a producer's affordance, and a store that grows opinions about the contents of its records eventually blocks its consumer's release.",
399
+ "type": "string",
400
+ "enum": [
401
+ "string",
402
+ "number",
403
+ "boolean",
404
+ "date",
405
+ "object"
406
+ ]
407
+ },
408
+ "ClaimType": {
409
+ "title": "ClaimType",
410
+ "description": "The vocabulary token naming what a value IS — `name.legal`, `phone.mobile`, `address.postal`, `person.birthDate`. Dotted, most-general segment first, so that a consumer with no knowledge of the specific token can still group by its prefix.\n\nThe token is the maintainer's own; no external vocabulary is primary. External vocabularies (vCard/jCard, OIDC standard claims, schema.org) are mappings applied at PRESENTATION by a renderer, not at rest, so that a query written in any of them can be matched without the store having to live inside any one of them.\n\nThe `x:` prefix is an open extension namespace and is not decoration. The closest prior art — Windows CardSpace's self-issued card — supported exactly fifteen predefined claim types with no extensibility, and that is the specific way it failed the requirement a holder actually has. An `x:` attribute stores, composes, binds and discloses exactly like a known one; it renders generically and matches only an explicit query.",
411
+ "type": "string",
412
+ "minLength": 1,
413
+ "maxLength": 128,
414
+ "pattern": "^(x:)?[a-z][a-zA-Z0-9]*(\\.[a-z][a-zA-Z0-9]*)*$"
415
+ }
416
+ }
417
+ } as const;
418
+
419
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
420
+ export const RESPONSE_PAYLOAD_SCHEMA = {
421
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
422
+ "$ref": "#/$defs/Response",
423
+ "$defs": {
424
+ "Response": {
425
+ "$anchor": "response",
426
+ "title": "Persona Profile Put — response payload",
427
+ "description": "Success response to persona/profile/put. Type https://trusttasks.org/spec/persona/profile/put/1.0#response.",
428
+ "type": "object",
429
+ "additionalProperties": false,
430
+ "required": [
431
+ "profileId",
432
+ "version",
433
+ "created",
434
+ "updatedAt"
435
+ ],
436
+ "properties": {
437
+ "profileId": {
438
+ "$ref": "#/$defs/Ulid"
439
+ },
440
+ "version": {
441
+ "$ref": "#/$defs/Version"
442
+ },
443
+ "created": {
444
+ "type": "boolean"
445
+ },
446
+ "correlation": {
447
+ "type": "object",
448
+ "additionalProperties": false,
449
+ "required": [
450
+ "severity"
451
+ ],
452
+ "description": "Advisory correlation result for the composition as a whole, returned on the write so a builder can warn while the holder is still composing. Advisory only: the write has applied, and a maintainer MUST NOT refuse a composition on correlation grounds.",
453
+ "properties": {
454
+ "severity": {
455
+ "type": "string",
456
+ "enum": [
457
+ "none",
458
+ "low",
459
+ "high"
460
+ ]
461
+ },
462
+ "sharedAttributeCount": {
463
+ "type": "integer",
464
+ "minimum": 0,
465
+ "description": "How many of this profile's entries present a value that another profile also presents. A count rather than a list; identifiers come from persona/correlation/analyze."
466
+ }
467
+ }
468
+ },
469
+ "createdAt": {
470
+ "type": "string",
471
+ "format": "date-time"
472
+ },
473
+ "updatedAt": {
474
+ "type": "string",
475
+ "format": "date-time"
476
+ },
477
+ "ext": {
478
+ "$ref": "#/$defs/Ext"
479
+ }
480
+ }
481
+ },
482
+ "Ext": {
483
+ "title": "Ext",
484
+ "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.",
485
+ "type": "object",
486
+ "minProperties": 1,
487
+ "additionalProperties": true,
488
+ "propertyNames": {
489
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
490
+ }
491
+ },
492
+ "Version": {
493
+ "title": "Version",
494
+ "description": "A value of the store's monotonic write counter. Server-assigned; a producer never chooses one.",
495
+ "type": "integer",
496
+ "minimum": 1
497
+ },
498
+ "Ulid": {
499
+ "title": "Ulid",
500
+ "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.",
501
+ "type": "string",
502
+ "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$"
503
+ },
504
+ "ExpectedVersion": {
505
+ "title": "ExpectedVersion",
506
+ "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.",
507
+ "type": "integer",
508
+ "minimum": 0
509
+ },
510
+ "ProfileEntry": {
511
+ "title": "ProfileEntry",
512
+ "description": "One line of a profile, in exactly one of four forms. Together they are the whole of a profile's flexibility, and each exists for a case the others handle badly.\n\n`{ref}` — use the pool attribute, live. Editing the pool updates every profile that references it, which is the point.\n\n`{ref, pinVersion}` — use the value as it was at that version. For a profile that must keep presenting the value a counterparty already verified.\n\n`{ref, override}` — the same fact, a different value here. (\"In the gaming profile my display name is different.\")\n\n`{inline}` — a value that never enters the pool, and so never leaks into another profile.\n\nOmission is exclusion; there is no removal marker.",
513
+ "type": "object",
514
+ "oneOf": [
515
+ {
516
+ "additionalProperties": false,
517
+ "required": [
518
+ "ref"
519
+ ],
520
+ "properties": {
521
+ "ref": {
522
+ "$ref": "#/$defs/Ulid"
523
+ }
524
+ }
525
+ },
526
+ {
527
+ "additionalProperties": false,
528
+ "required": [
529
+ "ref",
530
+ "pinVersion"
531
+ ],
532
+ "properties": {
533
+ "ref": {
534
+ "$ref": "#/$defs/Ulid"
535
+ },
536
+ "pinVersion": {
537
+ "$ref": "#/$defs/Version"
538
+ }
539
+ }
540
+ },
541
+ {
542
+ "additionalProperties": false,
543
+ "required": [
544
+ "ref",
545
+ "override"
546
+ ],
547
+ "properties": {
548
+ "ref": {
549
+ "$ref": "#/$defs/Ulid"
550
+ },
551
+ "override": {
552
+ "type": "object",
553
+ "additionalProperties": false,
554
+ "required": [
555
+ "value"
556
+ ],
557
+ "properties": {
558
+ "value": {},
559
+ "label": {
560
+ "type": "string",
561
+ "maxLength": 128
562
+ }
563
+ },
564
+ "description": "Replaces the pool attribute's value for this profile only. `type`, `valueType` and `provenance` are inherited from the referenced attribute and MUST NOT be overridden — an override that changed provenance would let a self-asserted value present as attested."
565
+ }
566
+ }
567
+ },
568
+ {
569
+ "additionalProperties": false,
570
+ "required": [
571
+ "inline"
572
+ ],
573
+ "properties": {
574
+ "inline": {
575
+ "type": "object",
576
+ "additionalProperties": false,
577
+ "required": [
578
+ "type",
579
+ "valueType",
580
+ "value",
581
+ "provenance"
582
+ ],
583
+ "properties": {
584
+ "type": {
585
+ "$ref": "#/$defs/ClaimType"
586
+ },
587
+ "valueType": {
588
+ "$ref": "#/$defs/ValueType"
589
+ },
590
+ "value": {},
591
+ "label": {
592
+ "type": "string",
593
+ "maxLength": 128
594
+ },
595
+ "provenance": {
596
+ "$ref": "#/$defs/Provenance"
597
+ }
598
+ }
599
+ }
600
+ }
601
+ }
602
+ ]
603
+ },
604
+ "Provenance": {
605
+ "title": "Provenance",
606
+ "description": "Where a value comes from, and the member that makes this family worth building on a trust stack rather than in an address book. It survives to the verifier, so a recipient can tell — per field — what the holder typed from what an issuer attested.\n\n`selfAsserted` — the holder supplied it.\n\n`credentialBacked` — the value is derived from a credential in the vault at `claimPath`. The stored value is a CACHE FOR DISPLAY; the credential is the truth. A maintainer MUST re-derive it on read and MUST fail closed (never presenting a stale value) when the credential has been revoked, has expired, or has been archived or deleted.\n\n`generated` — the value is minted per verifier at disclosure time and recorded against that verifier, so every relying party receives a different one that routes back to the holder. This is the shape of the most widely adopted consumer privacy feature in this space; a maintainer need not operate a relay to conform, but the shape must exist, because retrofitting per-verifier values into a pool-of-values model is a migration rather than an addition.",
607
+ "type": "object",
608
+ "required": [
609
+ "kind"
610
+ ],
611
+ "oneOf": [
612
+ {
613
+ "additionalProperties": false,
614
+ "required": [
615
+ "kind"
616
+ ],
617
+ "properties": {
618
+ "kind": {
619
+ "const": "selfAsserted"
620
+ }
621
+ }
622
+ },
623
+ {
624
+ "additionalProperties": false,
625
+ "required": [
626
+ "kind",
627
+ "credentialId",
628
+ "claimPath"
629
+ ],
630
+ "properties": {
631
+ "kind": {
632
+ "const": "credentialBacked"
633
+ },
634
+ "credentialId": {
635
+ "type": "string",
636
+ "minLength": 1,
637
+ "description": "Vault identifier of the backing credential."
638
+ },
639
+ "claimPath": {
640
+ "type": "string",
641
+ "pattern": "^(/[^/~]*(~[01][^/~]*)*)*$",
642
+ "description": "RFC 6901 JSON Pointer to the claim within the credential, e.g. `/credentialSubject/familyName`."
643
+ },
644
+ "issuerDid": {
645
+ "type": "string",
646
+ "minLength": 1,
647
+ "description": "Issuer of the backing credential. Advisory: a consumer MUST verify the credential rather than trusting this member."
648
+ },
649
+ "proof": {
650
+ "$ref": "#/$defs/ProofRung",
651
+ "description": "The disclosure rung this claim was, or will be, presented at."
652
+ }
653
+ }
654
+ },
655
+ {
656
+ "additionalProperties": false,
657
+ "required": [
658
+ "kind",
659
+ "generator"
660
+ ],
661
+ "properties": {
662
+ "kind": {
663
+ "const": "generated"
664
+ },
665
+ "generator": {
666
+ "type": "string",
667
+ "minLength": 1,
668
+ "maxLength": 64,
669
+ "description": "Names the minting scheme, e.g. `relayEmail`. Maintainer-defined."
670
+ },
671
+ "perVerifier": {
672
+ "type": "boolean",
673
+ "default": true,
674
+ "description": "When true (the default and the only useful setting), a distinct value is minted for each verifier."
675
+ }
676
+ }
677
+ }
678
+ ]
679
+ },
680
+ "ProofRung": {
681
+ "title": "ProofRung",
682
+ "description": "How strongly a credential-backed claim is hidden when presented, ordered most private first. `predicate` proves a statement over a claim without disclosing the claim. `derived` discloses exactly the claims needed via an unlinkable derived proof, so two presentations cannot be joined. `selectiveDisclosure` discloses exactly the claims needed but carries the issuer's signature unchanged, so two presentations ARE linkable. `whole` discloses the entire credential.\n\nThe distinction between the first two and the last two is of kind, not degree: only `predicate` and `derived` avoid handing two verifiers a join key. A maintainer MUST default to the highest rung the credential's format supports, and MUST NOT silently fall to a lower one — a request that cannot be satisfied at the rung a producer asked for is refused, because a silent privacy downgrade discloses material the holder believed was hidden.",
683
+ "type": "string",
684
+ "enum": [
685
+ "predicate",
686
+ "derived",
687
+ "selectiveDisclosure",
688
+ "whole"
689
+ ]
690
+ },
691
+ "ValueType": {
692
+ "title": "ValueType",
693
+ "description": "The JSON shape of `value`, declared so that a consumer can render and compare without guessing. The maintainer validates that `value` agrees with this member and does nothing further: it does NOT validate a phone number against a phone-number grammar. That is a producer's affordance, and a store that grows opinions about the contents of its records eventually blocks its consumer's release.",
694
+ "type": "string",
695
+ "enum": [
696
+ "string",
697
+ "number",
698
+ "boolean",
699
+ "date",
700
+ "object"
701
+ ]
702
+ },
703
+ "ClaimType": {
704
+ "title": "ClaimType",
705
+ "description": "The vocabulary token naming what a value IS — `name.legal`, `phone.mobile`, `address.postal`, `person.birthDate`. Dotted, most-general segment first, so that a consumer with no knowledge of the specific token can still group by its prefix.\n\nThe token is the maintainer's own; no external vocabulary is primary. External vocabularies (vCard/jCard, OIDC standard claims, schema.org) are mappings applied at PRESENTATION by a renderer, not at rest, so that a query written in any of them can be matched without the store having to live inside any one of them.\n\nThe `x:` prefix is an open extension namespace and is not decoration. The closest prior art — Windows CardSpace's self-issued card — supported exactly fifteen predefined claim types with no extensibility, and that is the specific way it failed the requirement a holder actually has. An `x:` attribute stores, composes, binds and discloses exactly like a known one; it renders generically and matches only an explicit query.",
706
+ "type": "string",
707
+ "minLength": 1,
708
+ "maxLength": 128,
709
+ "pattern": "^(x:)?[a-z][a-zA-Z0-9]*(\\.[a-z][a-zA-Z0-9]*)*$"
710
+ }
711
+ }
712
+ } as const;
713
+
714
+ /**
715
+ * SPEC.md §7.2 policy for the request variant, from this specification's
716
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
717
+ * per-specification and cannot be derived from the document alone, and
718
+ * item 2 needs the schema this carries.
719
+ */
720
+ export const SPEC = {
721
+ typeUri: TYPE_URI,
722
+ isBearer: false,
723
+ isProofRequired: true,
724
+ isRecipientRequired: true,
725
+ isIssuedAtRequired: true,
726
+ payloadSchema: PAYLOAD_SCHEMA,
727
+ } as const;
728
+
729
+ /**
730
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
731
+ * tracks the *issuer* party's requirement because a response swaps the
732
+ * parties (§7.3 item 5).
733
+ */
734
+ export const RESPONSE_SPEC = {
735
+ typeUri: RESPONSE_TYPE_URI,
736
+ isBearer: false,
737
+ isProofRequired: true,
738
+ isRecipientRequired: true,
739
+ isIssuedAtRequired: true,
740
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
741
+ } as const;