@openvtc/trust-tasks 0.19.18 → 0.19.19

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 (73) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/dist/_shared/components.d.ts +38 -0
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/index.d.ts +3 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +3 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/persona/_shared/0.1/persona-record.d.ts +1 -1
  9. package/dist/persona/_shared/0.1/persona-record.d.ts.map +1 -1
  10. package/dist/persona/attribute/list/1.0/payload.d.ts +124 -4
  11. package/dist/persona/attribute/list/1.0/payload.d.ts.map +1 -1
  12. package/dist/persona/attribute/list/1.0/payload.js +72 -2
  13. package/dist/persona/attribute/list/1.0/payload.js.map +1 -1
  14. package/dist/persona/attribute/put/1.0/payload.d.ts +110 -4
  15. package/dist/persona/attribute/put/1.0/payload.d.ts.map +1 -1
  16. package/dist/persona/attribute/put/1.0/payload.js +62 -2
  17. package/dist/persona/attribute/put/1.0/payload.js.map +1 -1
  18. package/dist/persona/contact/get/1.0/payload.d.ts +84 -4
  19. package/dist/persona/contact/get/1.0/payload.d.ts.map +1 -1
  20. package/dist/persona/contact/get/1.0/payload.js +52 -2
  21. package/dist/persona/contact/get/1.0/payload.js.map +1 -1
  22. package/dist/persona/contact/put/1.0/payload.d.ts +84 -4
  23. package/dist/persona/contact/put/1.0/payload.d.ts.map +1 -1
  24. package/dist/persona/contact/put/1.0/payload.js +52 -2
  25. package/dist/persona/contact/put/1.0/payload.js.map +1 -1
  26. package/dist/persona/disclosure/preview/1.0/payload.d.ts +5 -5
  27. package/dist/persona/disclosure/preview/1.0/payload.d.ts.map +1 -1
  28. package/dist/persona/disclosure/preview/1.0/payload.js +4 -2
  29. package/dist/persona/disclosure/preview/1.0/payload.js.map +1 -1
  30. package/dist/persona/profile/compose/1.0/payload.d.ts +14 -0
  31. package/dist/persona/profile/compose/1.0/payload.d.ts.map +1 -1
  32. package/dist/persona/profile/compose/1.0/payload.js +5 -0
  33. package/dist/persona/profile/compose/1.0/payload.js.map +1 -1
  34. package/dist/persona/profile/get/1.0/payload.d.ts +230 -6
  35. package/dist/persona/profile/get/1.0/payload.d.ts.map +1 -1
  36. package/dist/persona/profile/get/1.0/payload.js +140 -2
  37. package/dist/persona/profile/get/1.0/payload.js.map +1 -1
  38. package/dist/persona/profile/list/1.0/payload.d.ts +230 -6
  39. package/dist/persona/profile/list/1.0/payload.d.ts.map +1 -1
  40. package/dist/persona/profile/list/1.0/payload.js +140 -2
  41. package/dist/persona/profile/list/1.0/payload.js.map +1 -1
  42. package/dist/persona/profile/put/1.0/payload.d.ts +230 -6
  43. package/dist/persona/profile/put/1.0/payload.d.ts.map +1 -1
  44. package/dist/persona/profile/put/1.0/payload.js +138 -2
  45. package/dist/persona/profile/put/1.0/payload.js.map +1 -1
  46. package/dist/persona/profile/timeline/1.0/payload.d.ts +588 -0
  47. package/dist/persona/profile/timeline/1.0/payload.d.ts.map +1 -0
  48. package/dist/persona/profile/timeline/1.0/payload.js +322 -0
  49. package/dist/persona/profile/timeline/1.0/payload.js.map +1 -0
  50. package/dist/persona/profile/usage/1.0/payload.d.ts +533 -0
  51. package/dist/persona/profile/usage/1.0/payload.d.ts.map +1 -0
  52. package/dist/persona/profile/usage/1.0/payload.js +302 -0
  53. package/dist/persona/profile/usage/1.0/payload.js.map +1 -0
  54. package/dist/vtc/invitations/deliver/0.1/payload.d.ts +318 -0
  55. package/dist/vtc/invitations/deliver/0.1/payload.d.ts.map +1 -0
  56. package/dist/vtc/invitations/deliver/0.1/payload.js +183 -0
  57. package/dist/vtc/invitations/deliver/0.1/payload.js.map +1 -0
  58. package/package.json +1 -1
  59. package/src/_shared/components.ts +41 -0
  60. package/src/index.ts +3 -0
  61. package/src/persona/_shared/0.1/persona-record.ts +1 -1
  62. package/src/persona/attribute/list/1.0/payload.ts +72 -2
  63. package/src/persona/attribute/put/1.0/payload.ts +68 -2
  64. package/src/persona/contact/get/1.0/payload.ts +52 -2
  65. package/src/persona/contact/put/1.0/payload.ts +52 -2
  66. package/src/persona/disclosure/preview/1.0/payload.ts +5 -3
  67. package/src/persona/profile/compose/1.0/payload.ts +9 -0
  68. package/src/persona/profile/get/1.0/payload.ts +142 -4
  69. package/src/persona/profile/list/1.0/payload.ts +142 -4
  70. package/src/persona/profile/put/1.0/payload.ts +144 -4
  71. package/src/persona/profile/timeline/1.0/payload.ts +402 -0
  72. package/src/persona/profile/usage/1.0/payload.ts +354 -0
  73. package/src/vtc/invitations/deliver/0.1/payload.ts +234 -0
@@ -3,7 +3,7 @@
3
3
  * Source: specs/persona/profile/put/1.0/payload.schema.json
4
4
  */
5
5
 
6
- import type { ClaimType, ExpectedVersion_PersonaV0_1 as ExpectedVersion, Ext, ProfileEntry, ProofRung, Provenance, Slot, Ulid, ValueType, Version_PersonaV0_1 as Version } from "../../../../_shared/components.js";
6
+ import type { ClaimType, ExpectedVersion_PersonaV0_1 as ExpectedVersion, Ext, FaceReach, ProfileEntry, ProofRung, Provenance, Slot, Ulid, ValueType, Version_PersonaV0_1 as Version } from "../../../../_shared/components.js";
7
7
 
8
8
 
9
9
  /**
@@ -24,6 +24,10 @@ export interface PersonaProfilePutPayload {
24
24
  * @maxItems 256
25
25
  */
26
26
  entries: ProfileEntry[];
27
+ /**
28
+ * Where this face may be worn. Omit to keep the face's current reach — anywhere, for a new face. Unlike the rest of a put, omission does not reset it: a reach is a restriction the holder set, and a producer that predates this member must not widen a face to anywhere by saving an unrelated edit. To widen, send `{"kind": "anywhere"}`. Narrowing it while the face is worn outside the new reach is refused (`boundOutsideReach`), naming the contexts: the holder takes it off there first, deliberately.
29
+ */
30
+ reach?: FaceReach;
27
31
  /**
28
32
  * 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
33
  *
@@ -56,7 +60,7 @@ export interface PersonaProfilePutResponsePayload {
56
60
  }
57
61
 
58
62
  /** 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, Slot, Ulid, ValueType, Version };
63
+ export type { ClaimType, ExpectedVersion, Ext, FaceReach, ProfileEntry, ProofRung, Provenance, Slot, Ulid, ValueType, Version };
60
64
 
61
65
  /** Trust Task type URI. */
62
66
  export const TYPE_URI = "https://trusttasks.org/spec/persona/profile/put/1.0" as const;
@@ -109,6 +113,10 @@ export const PAYLOAD_SCHEMA = {
109
113
  },
110
114
  "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
115
  },
116
+ "reach": {
117
+ "$ref": "#/$defs/FaceReach",
118
+ "description": "Where this face may be worn. Omit to keep the face's current reach — anywhere, for a new face. Unlike the rest of a put, omission does not reset it: a reach is a restriction the holder set, and a producer that predates this member must not widen a face to anywhere by saving an unrelated edit. To widen, send `{\"kind\": \"anywhere\"}`. Narrowing it while the face is worn outside the new reach is refused (`boundOutsideReach`), naming the contexts: the holder takes it off there first, deliberately."
119
+ },
112
120
  "credentialRefs": {
113
121
  "type": "array",
114
122
  "maxItems": 256,
@@ -212,6 +220,47 @@ export const PAYLOAD_SCHEMA = {
212
220
  "type": "integer",
213
221
  "minimum": 0
214
222
  },
223
+ "FaceReach": {
224
+ "title": "FaceReach",
225
+ "description": "Where a pool face may be worn. `anywhere` is the default and what an absent member means. `only` names the contexts it may be worn in, and a maintainer MUST refuse to wear it in any other (persona/binding/set `outsideReach`).\n\nA tagged object rather than a bare list of contexts, deliberately: an empty list has been read as both 'unrestricted' and 'nowhere' in this family's neighbours, and a shape where the two cannot be confused is worth more than one where they must be remembered. So `only` requires at least one context, and 'nowhere' is not a reach — it is a retired face.\n\nA context-local face has no reach: it lives in its context and is worn there by construction.",
226
+ "oneOf": [
227
+ {
228
+ "type": "object",
229
+ "additionalProperties": false,
230
+ "required": [
231
+ "kind"
232
+ ],
233
+ "properties": {
234
+ "kind": {
235
+ "const": "anywhere"
236
+ }
237
+ }
238
+ },
239
+ {
240
+ "type": "object",
241
+ "additionalProperties": false,
242
+ "required": [
243
+ "kind",
244
+ "contextIds"
245
+ ],
246
+ "properties": {
247
+ "kind": {
248
+ "const": "only"
249
+ },
250
+ "contextIds": {
251
+ "type": "array",
252
+ "minItems": 1,
253
+ "maxItems": 256,
254
+ "uniqueItems": true,
255
+ "items": {
256
+ "type": "string",
257
+ "minLength": 1
258
+ }
259
+ }
260
+ }
261
+ }
262
+ ]
263
+ },
215
264
  "ProfileEntry": {
216
265
  "title": "ProfileEntry",
217
266
  "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.\n\nAny form MAY carry a `slot` naming the role the entry plays in the profile — see `Slot`. A maintainer MUST refuse a profile in which two entries carry the same slot: a slot exists to answer one question with one entry.",
@@ -326,7 +375,7 @@ export const PAYLOAD_SCHEMA = {
326
375
  },
327
376
  "Provenance": {
328
377
  "title": "Provenance",
329
- "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.",
378
+ "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.\n\n`derived` — the value was taken from a source the holder connected or supplied — a code-hosting profile, an uploaded CV — rather than typed by them or attested by an issuer. Nobody signed it: it is the holder's claim that the source said so, and a consumer MUST NOT present it as attested. It exists as its own kind because a derived value is neither of the others — the holder did not author it, and no one vouches for it — and a holder deciding whether to disclose deserves to know which of their values they typed.\n\nFor how strongly a disclosed value identifies the holder, the kinds rank `credentialBacked` above `derived` above `selfAsserted`; `generated` values are per-verifier and do not correlate.",
330
379
  "type": "object",
331
380
  "required": [
332
381
  "kind"
@@ -397,6 +446,31 @@ export const PAYLOAD_SCHEMA = {
397
446
  "description": "When true (the default and the only useful setting), a distinct value is minted for each verifier."
398
447
  }
399
448
  }
449
+ },
450
+ {
451
+ "additionalProperties": false,
452
+ "required": [
453
+ "kind",
454
+ "source",
455
+ "derivedAt"
456
+ ],
457
+ "properties": {
458
+ "kind": {
459
+ "const": "derived"
460
+ },
461
+ "source": {
462
+ "type": "string",
463
+ "minLength": 1,
464
+ "maxLength": 64,
465
+ "pattern": "^[a-z][A-Za-z0-9.-]*$",
466
+ "description": "The KIND of source the value was taken from — `github`, `cvUpload`, `linkedIn` — never an account, handle or URL. Provenance survives to the verifier, so this member is disclosed with the claim; a handle here would disclose an identifier the holder never chose to share."
467
+ },
468
+ "derivedAt": {
469
+ "type": "string",
470
+ "format": "date-time",
471
+ "description": "When the value was taken from the source. A derived value is a snapshot: the source may have changed since, and nothing re-derives it."
472
+ }
473
+ }
400
474
  }
401
475
  ]
402
476
  },
@@ -525,6 +599,47 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
525
599
  "type": "integer",
526
600
  "minimum": 0
527
601
  },
602
+ "FaceReach": {
603
+ "title": "FaceReach",
604
+ "description": "Where a pool face may be worn. `anywhere` is the default and what an absent member means. `only` names the contexts it may be worn in, and a maintainer MUST refuse to wear it in any other (persona/binding/set `outsideReach`).\n\nA tagged object rather than a bare list of contexts, deliberately: an empty list has been read as both 'unrestricted' and 'nowhere' in this family's neighbours, and a shape where the two cannot be confused is worth more than one where they must be remembered. So `only` requires at least one context, and 'nowhere' is not a reach — it is a retired face.\n\nA context-local face has no reach: it lives in its context and is worn there by construction.",
605
+ "oneOf": [
606
+ {
607
+ "type": "object",
608
+ "additionalProperties": false,
609
+ "required": [
610
+ "kind"
611
+ ],
612
+ "properties": {
613
+ "kind": {
614
+ "const": "anywhere"
615
+ }
616
+ }
617
+ },
618
+ {
619
+ "type": "object",
620
+ "additionalProperties": false,
621
+ "required": [
622
+ "kind",
623
+ "contextIds"
624
+ ],
625
+ "properties": {
626
+ "kind": {
627
+ "const": "only"
628
+ },
629
+ "contextIds": {
630
+ "type": "array",
631
+ "minItems": 1,
632
+ "maxItems": 256,
633
+ "uniqueItems": true,
634
+ "items": {
635
+ "type": "string",
636
+ "minLength": 1
637
+ }
638
+ }
639
+ }
640
+ }
641
+ ]
642
+ },
528
643
  "ProfileEntry": {
529
644
  "title": "ProfileEntry",
530
645
  "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.\n\nAny form MAY carry a `slot` naming the role the entry plays in the profile — see `Slot`. A maintainer MUST refuse a profile in which two entries carry the same slot: a slot exists to answer one question with one entry.",
@@ -639,7 +754,7 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
639
754
  },
640
755
  "Provenance": {
641
756
  "title": "Provenance",
642
- "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.",
757
+ "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.\n\n`derived` — the value was taken from a source the holder connected or supplied — a code-hosting profile, an uploaded CV — rather than typed by them or attested by an issuer. Nobody signed it: it is the holder's claim that the source said so, and a consumer MUST NOT present it as attested. It exists as its own kind because a derived value is neither of the others — the holder did not author it, and no one vouches for it — and a holder deciding whether to disclose deserves to know which of their values they typed.\n\nFor how strongly a disclosed value identifies the holder, the kinds rank `credentialBacked` above `derived` above `selfAsserted`; `generated` values are per-verifier and do not correlate.",
643
758
  "type": "object",
644
759
  "required": [
645
760
  "kind"
@@ -710,6 +825,31 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
710
825
  "description": "When true (the default and the only useful setting), a distinct value is minted for each verifier."
711
826
  }
712
827
  }
828
+ },
829
+ {
830
+ "additionalProperties": false,
831
+ "required": [
832
+ "kind",
833
+ "source",
834
+ "derivedAt"
835
+ ],
836
+ "properties": {
837
+ "kind": {
838
+ "const": "derived"
839
+ },
840
+ "source": {
841
+ "type": "string",
842
+ "minLength": 1,
843
+ "maxLength": 64,
844
+ "pattern": "^[a-z][A-Za-z0-9.-]*$",
845
+ "description": "The KIND of source the value was taken from — `github`, `cvUpload`, `linkedIn` — never an account, handle or URL. Provenance survives to the verifier, so this member is disclosed with the claim; a handle here would disclose an identifier the holder never chose to share."
846
+ },
847
+ "derivedAt": {
848
+ "type": "string",
849
+ "format": "date-time",
850
+ "description": "When the value was taken from the source. A derived value is a snapshot: the source may have changed since, and nothing re-derives it."
851
+ }
852
+ }
713
853
  }
714
854
  ]
715
855
  },
@@ -0,0 +1,402 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/persona/profile/timeline/1.0/payload.schema.json
4
+ */
5
+
6
+ import type { ClaimType, Ext, Ulid, Version_PersonaV0_1 as Version } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * What one face has done, in order: composed, worn and taken off, what it told whom, when a value it shows changed, retired and reinstated. Types, versions, contexts and parties — never a value, never one of the holder's private labels.
11
+ */
12
+ export interface PersonaProfileTimelinePayload {
13
+ profileId: Ulid;
14
+ /**
15
+ * The context of a context-local face. Omit for a pool face.
16
+ */
17
+ contextId?: string;
18
+ /**
19
+ * Only events at or after this time.
20
+ */
21
+ since?: string;
22
+ /**
23
+ * Opaque continuation token from a prior response. A producer MUST NOT construct or parse one.
24
+ */
25
+ cursor?: string;
26
+ limit?: number;
27
+ ext?: Ext;
28
+ }
29
+ /**
30
+ * Success response to persona/profile/timeline. Type https://trusttasks.org/spec/persona/profile/timeline/1.0#response. Oldest first.
31
+ */
32
+ export interface PersonaProfileTimelineResponsePayload {
33
+ profileId: Ulid;
34
+ /**
35
+ * @maxItems 500
36
+ */
37
+ events: TimelineEvent[];
38
+ /**
39
+ * Present when more events follow. Absent at the end — a producer MUST NOT infer the end from a short page.
40
+ */
41
+ nextCursor?: string;
42
+ ext?: Ext;
43
+ }
44
+ /**
45
+ * One thing that happened to a face. Which members are present depends on `kind`; none carries a value or a private label.
46
+ */
47
+ export interface TimelineEvent {
48
+ at: string;
49
+ /**
50
+ * `composed` — the face was made. `worn` / `unworn` — a persona began or stopped wearing it in a context. `expired` — a binding's `until` passed. `disclosed` — it told a party something (`verifierDid`, `claimTypes`). `valueChanged` — a value it shows changed (`claimTypes`, `version`). `promoted` — it moved from one context into the pool. `retired` / `reinstated`.
51
+ */
52
+ kind:
53
+ | "composed"
54
+ | "worn"
55
+ | "unworn"
56
+ | "expired"
57
+ | "disclosed"
58
+ | "valueChanged"
59
+ | "promoted"
60
+ | "retired"
61
+ | "reinstated";
62
+ contextId?: string;
63
+ personaDid?: string;
64
+ verifierDid?: string;
65
+ /**
66
+ * @maxItems 64
67
+ */
68
+ claimTypes?: ClaimType[];
69
+ version?: Version;
70
+ }
71
+
72
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
73
+ export type { ClaimType, Ext, Ulid, Version };
74
+
75
+ /** Trust Task type URI. */
76
+ export const TYPE_URI = "https://trusttasks.org/spec/persona/profile/timeline/1.0" as const;
77
+
78
+ /** Stable alias for this specification's request payload shape. */
79
+ export type Payload = PersonaProfileTimelinePayload;
80
+
81
+ /** Trust Task response type URI (request type URI + "#response"). */
82
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/persona/profile/timeline/1.0#response" as const;
83
+
84
+ /** Stable alias for this specification's success-response payload shape. */
85
+ export type Response = PersonaProfileTimelineResponsePayload;
86
+
87
+ /**
88
+ * This specification's payload schema, as a value.
89
+ *
90
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
91
+ * rather than only as a `.json` file because TypeScript types are erased
92
+ * at runtime: without a schema a consumer has nothing to validate, and
93
+ * every REQUIRED payload member is optional in practice. Cross-file
94
+ * `$ref`s are already inlined, so it needs no resolver.
95
+ */
96
+ export const PAYLOAD_SCHEMA = {
97
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
98
+ "$id": "https://trusttasks.org/spec/persona/profile/timeline/1.0",
99
+ "title": "Persona Profile Timeline — payload",
100
+ "description": "What one face has done, in order: composed, worn and taken off, what it told whom, when a value it shows changed, retired and reinstated. Types, versions, contexts and parties — never a value, never one of the holder's private labels.",
101
+ "type": "object",
102
+ "additionalProperties": false,
103
+ "required": [
104
+ "profileId"
105
+ ],
106
+ "properties": {
107
+ "profileId": {
108
+ "$ref": "#/$defs/Ulid"
109
+ },
110
+ "contextId": {
111
+ "type": "string",
112
+ "minLength": 1,
113
+ "description": "The context of a context-local face. Omit for a pool face."
114
+ },
115
+ "since": {
116
+ "type": "string",
117
+ "format": "date-time",
118
+ "description": "Only events at or after this time."
119
+ },
120
+ "cursor": {
121
+ "type": "string",
122
+ "maxLength": 4096,
123
+ "description": "Opaque continuation token from a prior response. A producer MUST NOT construct or parse one."
124
+ },
125
+ "limit": {
126
+ "type": "integer",
127
+ "minimum": 1,
128
+ "maximum": 500,
129
+ "default": 100
130
+ },
131
+ "ext": {
132
+ "$ref": "#/$defs/Ext"
133
+ }
134
+ },
135
+ "$defs": {
136
+ "TimelineEvent": {
137
+ "title": "TimelineEvent",
138
+ "description": "One thing that happened to a face. Which members are present depends on `kind`; none carries a value or a private label.",
139
+ "type": "object",
140
+ "additionalProperties": false,
141
+ "required": [
142
+ "at",
143
+ "kind"
144
+ ],
145
+ "properties": {
146
+ "at": {
147
+ "type": "string",
148
+ "format": "date-time"
149
+ },
150
+ "kind": {
151
+ "type": "string",
152
+ "enum": [
153
+ "composed",
154
+ "worn",
155
+ "unworn",
156
+ "expired",
157
+ "disclosed",
158
+ "valueChanged",
159
+ "promoted",
160
+ "retired",
161
+ "reinstated"
162
+ ],
163
+ "description": "`composed` — the face was made. `worn` / `unworn` — a persona began or stopped wearing it in a context. `expired` — a binding's `until` passed. `disclosed` — it told a party something (`verifierDid`, `claimTypes`). `valueChanged` — a value it shows changed (`claimTypes`, `version`). `promoted` — it moved from one context into the pool. `retired` / `reinstated`."
164
+ },
165
+ "contextId": {
166
+ "type": "string",
167
+ "minLength": 1
168
+ },
169
+ "personaDid": {
170
+ "type": "string",
171
+ "minLength": 1
172
+ },
173
+ "verifierDid": {
174
+ "type": "string",
175
+ "minLength": 1
176
+ },
177
+ "claimTypes": {
178
+ "type": "array",
179
+ "maxItems": 64,
180
+ "items": {
181
+ "$ref": "#/$defs/ClaimType"
182
+ }
183
+ },
184
+ "version": {
185
+ "$ref": "#/$defs/Version"
186
+ }
187
+ }
188
+ },
189
+ "Response": {
190
+ "$anchor": "response",
191
+ "title": "Persona Profile Timeline — response payload",
192
+ "description": "Success response to persona/profile/timeline. Type https://trusttasks.org/spec/persona/profile/timeline/1.0#response. Oldest first.",
193
+ "type": "object",
194
+ "additionalProperties": false,
195
+ "required": [
196
+ "profileId",
197
+ "events"
198
+ ],
199
+ "properties": {
200
+ "profileId": {
201
+ "$ref": "#/$defs/Ulid"
202
+ },
203
+ "events": {
204
+ "type": "array",
205
+ "maxItems": 500,
206
+ "items": {
207
+ "$ref": "#/$defs/TimelineEvent"
208
+ }
209
+ },
210
+ "nextCursor": {
211
+ "type": "string",
212
+ "maxLength": 4096,
213
+ "description": "Present when more events follow. Absent at the end — a producer MUST NOT infer the end from a short page."
214
+ },
215
+ "ext": {
216
+ "$ref": "#/$defs/Ext"
217
+ }
218
+ }
219
+ },
220
+ "Ext": {
221
+ "title": "Ext",
222
+ "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.",
223
+ "type": "object",
224
+ "minProperties": 1,
225
+ "additionalProperties": true,
226
+ "propertyNames": {
227
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
228
+ }
229
+ },
230
+ "Ulid": {
231
+ "title": "Ulid",
232
+ "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.",
233
+ "type": "string",
234
+ "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$"
235
+ },
236
+ "Version": {
237
+ "title": "Version",
238
+ "description": "A value of the store's monotonic write counter. Server-assigned; a producer never chooses one.",
239
+ "type": "integer",
240
+ "minimum": 1
241
+ },
242
+ "ClaimType": {
243
+ "title": "ClaimType",
244
+ "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.",
245
+ "type": "string",
246
+ "minLength": 1,
247
+ "maxLength": 128,
248
+ "pattern": "^(x:)?[a-z][a-zA-Z0-9]*(\\.[a-z][a-zA-Z0-9]*)*$"
249
+ }
250
+ }
251
+ } as const;
252
+
253
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
254
+ export const RESPONSE_PAYLOAD_SCHEMA = {
255
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
256
+ "$ref": "#/$defs/Response",
257
+ "$defs": {
258
+ "TimelineEvent": {
259
+ "title": "TimelineEvent",
260
+ "description": "One thing that happened to a face. Which members are present depends on `kind`; none carries a value or a private label.",
261
+ "type": "object",
262
+ "additionalProperties": false,
263
+ "required": [
264
+ "at",
265
+ "kind"
266
+ ],
267
+ "properties": {
268
+ "at": {
269
+ "type": "string",
270
+ "format": "date-time"
271
+ },
272
+ "kind": {
273
+ "type": "string",
274
+ "enum": [
275
+ "composed",
276
+ "worn",
277
+ "unworn",
278
+ "expired",
279
+ "disclosed",
280
+ "valueChanged",
281
+ "promoted",
282
+ "retired",
283
+ "reinstated"
284
+ ],
285
+ "description": "`composed` — the face was made. `worn` / `unworn` — a persona began or stopped wearing it in a context. `expired` — a binding's `until` passed. `disclosed` — it told a party something (`verifierDid`, `claimTypes`). `valueChanged` — a value it shows changed (`claimTypes`, `version`). `promoted` — it moved from one context into the pool. `retired` / `reinstated`."
286
+ },
287
+ "contextId": {
288
+ "type": "string",
289
+ "minLength": 1
290
+ },
291
+ "personaDid": {
292
+ "type": "string",
293
+ "minLength": 1
294
+ },
295
+ "verifierDid": {
296
+ "type": "string",
297
+ "minLength": 1
298
+ },
299
+ "claimTypes": {
300
+ "type": "array",
301
+ "maxItems": 64,
302
+ "items": {
303
+ "$ref": "#/$defs/ClaimType"
304
+ }
305
+ },
306
+ "version": {
307
+ "$ref": "#/$defs/Version"
308
+ }
309
+ }
310
+ },
311
+ "Response": {
312
+ "$anchor": "response",
313
+ "title": "Persona Profile Timeline — response payload",
314
+ "description": "Success response to persona/profile/timeline. Type https://trusttasks.org/spec/persona/profile/timeline/1.0#response. Oldest first.",
315
+ "type": "object",
316
+ "additionalProperties": false,
317
+ "required": [
318
+ "profileId",
319
+ "events"
320
+ ],
321
+ "properties": {
322
+ "profileId": {
323
+ "$ref": "#/$defs/Ulid"
324
+ },
325
+ "events": {
326
+ "type": "array",
327
+ "maxItems": 500,
328
+ "items": {
329
+ "$ref": "#/$defs/TimelineEvent"
330
+ }
331
+ },
332
+ "nextCursor": {
333
+ "type": "string",
334
+ "maxLength": 4096,
335
+ "description": "Present when more events follow. Absent at the end — a producer MUST NOT infer the end from a short page."
336
+ },
337
+ "ext": {
338
+ "$ref": "#/$defs/Ext"
339
+ }
340
+ }
341
+ },
342
+ "Ext": {
343
+ "title": "Ext",
344
+ "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.",
345
+ "type": "object",
346
+ "minProperties": 1,
347
+ "additionalProperties": true,
348
+ "propertyNames": {
349
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
350
+ }
351
+ },
352
+ "Ulid": {
353
+ "title": "Ulid",
354
+ "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.",
355
+ "type": "string",
356
+ "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$"
357
+ },
358
+ "Version": {
359
+ "title": "Version",
360
+ "description": "A value of the store's monotonic write counter. Server-assigned; a producer never chooses one.",
361
+ "type": "integer",
362
+ "minimum": 1
363
+ },
364
+ "ClaimType": {
365
+ "title": "ClaimType",
366
+ "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.",
367
+ "type": "string",
368
+ "minLength": 1,
369
+ "maxLength": 128,
370
+ "pattern": "^(x:)?[a-z][a-zA-Z0-9]*(\\.[a-z][a-zA-Z0-9]*)*$"
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: false,
385
+ isRecipientRequired: true,
386
+ isIssuedAtRequired: false,
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: false,
399
+ isRecipientRequired: true,
400
+ isIssuedAtRequired: false,
401
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
402
+ } as const;