@openvtc/trust-tasks 0.26.18 → 0.26.20

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 (104) hide show
  1. package/CHANGELOG.md +87 -0
  2. package/dist/_shared/components.d.ts +113 -1
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/index.d.ts +9 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +9 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/rooms/owner/group/add/0.3/payload.d.ts +417 -0
  9. package/dist/rooms/owner/group/add/0.3/payload.d.ts.map +1 -0
  10. package/dist/rooms/owner/group/add/0.3/payload.js +218 -0
  11. package/dist/rooms/owner/group/add/0.3/payload.js.map +1 -0
  12. package/dist/rooms/owner/group/renew/0.2/payload.d.ts +299 -0
  13. package/dist/rooms/owner/group/renew/0.2/payload.d.ts.map +1 -0
  14. package/dist/rooms/owner/group/renew/0.2/payload.js +163 -0
  15. package/dist/rooms/owner/group/renew/0.2/payload.js.map +1 -0
  16. package/dist/vtc/directory/_shared/0.1/directory-card.d.ts +1 -1
  17. package/dist/vtc/directory/_shared/0.1/directory-card.d.ts.map +1 -1
  18. package/dist/vtc/directory/_shared/0.1/disclosure-statement.d.ts +18 -0
  19. package/dist/vtc/directory/_shared/0.1/disclosure-statement.d.ts.map +1 -0
  20. package/dist/vtc/directory/_shared/0.1/disclosure-statement.js +6 -0
  21. package/dist/vtc/directory/_shared/0.1/disclosure-statement.js.map +1 -0
  22. package/dist/vtc/directory/card/assert/0.1/payload.d.ts +4 -4
  23. package/dist/vtc/directory/card/assert/0.1/payload.js +2 -2
  24. package/dist/vtc/directory/card/assert/0.1/payload.js.map +1 -1
  25. package/dist/vtc/directory/card/public/0.1/payload.d.ts +348 -0
  26. package/dist/vtc/directory/card/public/0.1/payload.d.ts.map +1 -0
  27. package/dist/vtc/directory/card/public/0.1/payload.js +197 -0
  28. package/dist/vtc/directory/card/public/0.1/payload.js.map +1 -0
  29. package/dist/vtc/directory/card/publish/0.1/payload.d.ts +384 -0
  30. package/dist/vtc/directory/card/publish/0.1/payload.d.ts.map +1 -0
  31. package/dist/vtc/directory/card/publish/0.1/payload.js +222 -0
  32. package/dist/vtc/directory/card/publish/0.1/payload.js.map +1 -0
  33. package/dist/vtc/directory/card/show/0.1/payload.d.ts +138 -6
  34. package/dist/vtc/directory/card/show/0.1/payload.d.ts.map +1 -1
  35. package/dist/vtc/directory/card/show/0.1/payload.js +82 -2
  36. package/dist/vtc/directory/card/show/0.1/payload.js.map +1 -1
  37. package/dist/vtc/directory/card/update/0.1/payload.d.ts +138 -6
  38. package/dist/vtc/directory/card/update/0.1/payload.d.ts.map +1 -1
  39. package/dist/vtc/directory/card/update/0.1/payload.js +82 -2
  40. package/dist/vtc/directory/card/update/0.1/payload.js.map +1 -1
  41. package/dist/vtc/directory/disclosure/0.1/payload.d.ts +951 -0
  42. package/dist/vtc/directory/disclosure/0.1/payload.d.ts.map +1 -0
  43. package/dist/vtc/directory/disclosure/0.1/payload.js +613 -0
  44. package/dist/vtc/directory/disclosure/0.1/payload.js.map +1 -0
  45. package/dist/vtc/directory/entries/list/0.1/payload.d.ts +4 -4
  46. package/dist/vtc/directory/entries/list/0.1/payload.js +2 -2
  47. package/dist/vtc/directory/entries/list/0.1/payload.js.map +1 -1
  48. package/dist/vtc/directory/entries/show/0.1/payload.d.ts +4 -4
  49. package/dist/vtc/directory/entries/show/0.1/payload.js +2 -2
  50. package/dist/vtc/directory/entries/show/0.1/payload.js.map +1 -1
  51. package/dist/vtc/directory/images/get/0.1/payload.d.ts +484 -0
  52. package/dist/vtc/directory/images/get/0.1/payload.d.ts.map +1 -0
  53. package/dist/vtc/directory/images/get/0.1/payload.js +273 -0
  54. package/dist/vtc/directory/images/get/0.1/payload.js.map +1 -0
  55. package/dist/vtc/directory/images/upload/0.1/payload.d.ts +441 -0
  56. package/dist/vtc/directory/images/upload/0.1/payload.d.ts.map +1 -0
  57. package/dist/vtc/directory/images/upload/0.1/payload.js +262 -0
  58. package/dist/vtc/directory/images/upload/0.1/payload.js.map +1 -0
  59. package/dist/vtc/directory/introduction/0.1/payload.d.ts +2 -2
  60. package/dist/vtc/directory/introduction/0.1/payload.js +1 -1
  61. package/dist/vtc/directory/introduction/0.1/payload.js.map +1 -1
  62. package/dist/vtc/groups/join/0.1/payload.d.ts +4 -4
  63. package/dist/vtc/groups/join/0.1/payload.js +2 -2
  64. package/dist/vtc/groups/join/0.1/payload.js.map +1 -1
  65. package/dist/vtc/groups/members/add/0.1/payload.d.ts +4 -4
  66. package/dist/vtc/groups/members/add/0.1/payload.js +2 -2
  67. package/dist/vtc/groups/members/add/0.1/payload.js.map +1 -1
  68. package/dist/vtc/groups/members/list/0.1/payload.d.ts +4 -4
  69. package/dist/vtc/groups/members/list/0.1/payload.js +2 -2
  70. package/dist/vtc/groups/members/list/0.1/payload.js.map +1 -1
  71. package/dist/vtc/groups/requests/decide/0.1/payload.d.ts +4 -4
  72. package/dist/vtc/groups/requests/decide/0.1/payload.js +2 -2
  73. package/dist/vtc/groups/requests/decide/0.1/payload.js.map +1 -1
  74. package/dist/vtc/groups/requests/list/0.1/payload.d.ts +4 -4
  75. package/dist/vtc/groups/requests/list/0.1/payload.js +2 -2
  76. package/dist/vtc/groups/requests/list/0.1/payload.js.map +1 -1
  77. package/dist/vtc/join-requests/manifest/0.4/payload.d.ts +2303 -0
  78. package/dist/vtc/join-requests/manifest/0.4/payload.d.ts.map +1 -0
  79. package/dist/vtc/join-requests/manifest/0.4/payload.js +1293 -0
  80. package/dist/vtc/join-requests/manifest/0.4/payload.js.map +1 -0
  81. package/package.json +1 -1
  82. package/src/_shared/components.ts +113 -1
  83. package/src/index.ts +9 -0
  84. package/src/rooms/owner/group/add/0.3/payload.ts +288 -0
  85. package/src/rooms/owner/group/renew/0.2/payload.ts +213 -0
  86. package/src/vtc/directory/_shared/0.1/directory-card.ts +1 -1
  87. package/src/vtc/directory/_shared/0.1/disclosure-statement.ts +19 -0
  88. package/src/vtc/directory/card/assert/0.1/payload.ts +2 -2
  89. package/src/vtc/directory/card/public/0.1/payload.ts +238 -0
  90. package/src/vtc/directory/card/publish/0.1/payload.ts +261 -0
  91. package/src/vtc/directory/card/show/0.1/payload.ts +84 -4
  92. package/src/vtc/directory/card/update/0.1/payload.ts +84 -4
  93. package/src/vtc/directory/disclosure/0.1/payload.ts +645 -0
  94. package/src/vtc/directory/entries/list/0.1/payload.ts +2 -2
  95. package/src/vtc/directory/entries/show/0.1/payload.ts +2 -2
  96. package/src/vtc/directory/images/get/0.1/payload.ts +320 -0
  97. package/src/vtc/directory/images/upload/0.1/payload.ts +308 -0
  98. package/src/vtc/directory/introduction/0.1/payload.ts +1 -1
  99. package/src/vtc/groups/join/0.1/payload.ts +2 -2
  100. package/src/vtc/groups/members/add/0.1/payload.ts +2 -2
  101. package/src/vtc/groups/members/list/0.1/payload.ts +2 -2
  102. package/src/vtc/groups/requests/decide/0.1/payload.ts +2 -2
  103. package/src/vtc/groups/requests/list/0.1/payload.ts +2 -2
  104. package/src/vtc/join-requests/manifest/0.4/payload.ts +1490 -0
@@ -0,0 +1,213 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/rooms/owner/group/renew/0.2/payload.schema.json
4
+ */
5
+
6
+ import type { Ext } from "../../../../../_shared/components.js";
7
+
8
+
9
+ export interface RoomsOwnerGroupRenewPayload {
10
+ /**
11
+ * The sealed room to renew. The recipient MUST hold its group.
12
+ */
13
+ roomId: string;
14
+ /**
15
+ * The room's host, as a DID: where the room's epoch advances.
16
+ */
17
+ host: string;
18
+ /**
19
+ * Why, carried to the host's epoch advance. Untrusted and attributed to its author: it MUST NOT carry personal data or a credential.
20
+ */
21
+ reason?: string;
22
+ /**
23
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
24
+ */
25
+ ext?: Ext;
26
+ }
27
+ /**
28
+ * Success response to rooms/owner/group/renew. Type https://trusttasks.org/spec/rooms/owner/group/renew/0.2#response. The room's new epoch, at which the host and the group agree.
29
+ */
30
+ export interface RoomsOwnerGroupRenewResponsePayload {
31
+ /**
32
+ * The room.
33
+ */
34
+ roomId: string;
35
+ /**
36
+ * The room epoch after the renewal, as the host recorded it.
37
+ */
38
+ epoch: number;
39
+ ext?: Ext;
40
+ }
41
+
42
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
43
+ export type { Ext };
44
+
45
+ /** Trust Task type URI. */
46
+ export const TYPE_URI = "https://trusttasks.org/spec/rooms/owner/group/renew/0.2" as const;
47
+
48
+ /** Stable alias for this specification's request payload shape. */
49
+ export type Payload = RoomsOwnerGroupRenewPayload;
50
+
51
+ /** Trust Task response type URI (request type URI + "#response"). */
52
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/rooms/owner/group/renew/0.2#response" as const;
53
+
54
+ /** Stable alias for this specification's success-response payload shape. */
55
+ export type Response = RoomsOwnerGroupRenewResponsePayload;
56
+
57
+ /**
58
+ * This specification's payload schema, as a value.
59
+ *
60
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
61
+ * rather than only as a `.json` file because TypeScript types are erased
62
+ * at runtime: without a schema a consumer has nothing to validate, and
63
+ * every REQUIRED payload member is optional in practice. Cross-file
64
+ * `$ref`s are already inlined, so it needs no resolver.
65
+ */
66
+ export const PAYLOAD_SCHEMA = {
67
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
68
+ "$id": "https://trusttasks.org/spec/rooms/owner/group/renew/0.2",
69
+ "title": "Rooms Owner Group Renew — payload",
70
+ "type": "object",
71
+ "additionalProperties": false,
72
+ "required": [
73
+ "roomId",
74
+ "host"
75
+ ],
76
+ "properties": {
77
+ "roomId": {
78
+ "type": "string",
79
+ "minLength": 1,
80
+ "maxLength": 512,
81
+ "description": "The sealed room to renew. The recipient MUST hold its group."
82
+ },
83
+ "host": {
84
+ "type": "string",
85
+ "pattern": "^did:",
86
+ "maxLength": 2048,
87
+ "description": "The room's host, as a DID: where the room's epoch advances."
88
+ },
89
+ "reason": {
90
+ "type": "string",
91
+ "minLength": 1,
92
+ "maxLength": 500,
93
+ "description": "Why, carried to the host's epoch advance. Untrusted and attributed to its author: it MUST NOT carry personal data or a credential."
94
+ },
95
+ "ext": {
96
+ "$ref": "#/$defs/Ext",
97
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
98
+ }
99
+ },
100
+ "$defs": {
101
+ "Response": {
102
+ "$anchor": "response",
103
+ "title": "Rooms Owner Group Renew — response payload",
104
+ "description": "Success response to rooms/owner/group/renew. Type https://trusttasks.org/spec/rooms/owner/group/renew/0.2#response. The room's new epoch, at which the host and the group agree.",
105
+ "type": "object",
106
+ "additionalProperties": false,
107
+ "required": [
108
+ "roomId",
109
+ "epoch"
110
+ ],
111
+ "properties": {
112
+ "roomId": {
113
+ "type": "string",
114
+ "minLength": 1,
115
+ "maxLength": 512,
116
+ "description": "The room."
117
+ },
118
+ "epoch": {
119
+ "type": "integer",
120
+ "minimum": 2,
121
+ "description": "The room epoch after the renewal, as the host recorded it."
122
+ },
123
+ "ext": {
124
+ "$ref": "#/$defs/Ext"
125
+ }
126
+ }
127
+ },
128
+ "Ext": {
129
+ "title": "Ext",
130
+ "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.",
131
+ "type": "object",
132
+ "minProperties": 1,
133
+ "additionalProperties": true,
134
+ "propertyNames": {
135
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
136
+ }
137
+ }
138
+ }
139
+ } as const;
140
+
141
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
142
+ export const RESPONSE_PAYLOAD_SCHEMA = {
143
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
144
+ "$ref": "#/$defs/Response",
145
+ "$defs": {
146
+ "Response": {
147
+ "$anchor": "response",
148
+ "title": "Rooms Owner Group Renew — response payload",
149
+ "description": "Success response to rooms/owner/group/renew. Type https://trusttasks.org/spec/rooms/owner/group/renew/0.2#response. The room's new epoch, at which the host and the group agree.",
150
+ "type": "object",
151
+ "additionalProperties": false,
152
+ "required": [
153
+ "roomId",
154
+ "epoch"
155
+ ],
156
+ "properties": {
157
+ "roomId": {
158
+ "type": "string",
159
+ "minLength": 1,
160
+ "maxLength": 512,
161
+ "description": "The room."
162
+ },
163
+ "epoch": {
164
+ "type": "integer",
165
+ "minimum": 2,
166
+ "description": "The room epoch after the renewal, as the host recorded it."
167
+ },
168
+ "ext": {
169
+ "$ref": "#/$defs/Ext"
170
+ }
171
+ }
172
+ },
173
+ "Ext": {
174
+ "title": "Ext",
175
+ "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.",
176
+ "type": "object",
177
+ "minProperties": 1,
178
+ "additionalProperties": true,
179
+ "propertyNames": {
180
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
181
+ }
182
+ }
183
+ }
184
+ } as const;
185
+
186
+ /**
187
+ * SPEC.md §7.2 policy for the request variant, from this specification's
188
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
189
+ * per-specification and cannot be derived from the document alone, and
190
+ * item 2 needs the schema this carries.
191
+ */
192
+ export const SPEC = {
193
+ typeUri: TYPE_URI,
194
+ isBearer: false,
195
+ isProofRequired: true,
196
+ isRecipientRequired: true,
197
+ isIssuedAtRequired: true,
198
+ payloadSchema: PAYLOAD_SCHEMA,
199
+ } as const;
200
+
201
+ /**
202
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
203
+ * tracks the *issuer* party's requirement because a response swaps the
204
+ * parties (§7.3 item 5).
205
+ */
206
+ export const RESPONSE_SPEC = {
207
+ typeUri: RESPONSE_TYPE_URI,
208
+ isBearer: false,
209
+ isProofRequired: true,
210
+ isRecipientRequired: true,
211
+ isIssuedAtRequired: true,
212
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
213
+ } as const;
@@ -20,4 +20,4 @@ export interface DirectoryCardSharedDefinitionsForTheVtcDirectorySpecFamily {
20
20
  * The definitions this shared schema publishes, hoisted to one declaration each.
21
21
  * See "../../../../_shared/components.js".
22
22
  */
23
- export type { Audience, CardBlobRef, CardValues, DirectoryCard, DirectoryEntry, Discoverability, EntryFields, EntryId, FieldKey, FieldValue, FieldVisibility, Introductions, JSContactCard, Listing, VerifiedValue } from "../../../../_shared/components.js";
23
+ export type { Audience, CardBlobRef, CardValues, DirectoryCard, DirectoryEntry, Discoverability, EntryFields, EntryId, ExternalCard, FieldKey, FieldValue, FieldVisibility, ImageMediaType, Introductions, JSContactCard, Listing, PublishedCard, VerifiedValue } from "../../../../_shared/components.js";
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vtc/directory/_shared/0.1/disclosure-statement.schema.json
4
+ */
5
+
6
+ /**
7
+ * The statement a community offering a directory publishes so that anyone — above all an applicant deciding whether to apply — can learn what the directory would disclose about them, and to whom, before they hand over anything (VTI-DIR-130). The community GENERATES it from the configuration in force when it is read, never from text an administrator wrote, so it describes the directory that runs rather than the one someone intended. Read on its own through vtc/directory/disclosure, and carried in vtc/join-requests/manifest from 0.4.
8
+ *
9
+ * EVERY AUDIENCE HERE IS AN UPPER BOUND. A value reaches a viewer only where the member's own choice, the field's ceiling and the community's directory policy all admit them, and the policy only narrows. So a statement never understates what can be disclosed: the most any value can reach is what it says, and a member or the policy can only make it less. Not itself a Trust Task specification (the `_shared` folder is skipped by the registry build and the codegen).
10
+ */
11
+ export interface DirectoryDisclosureTheStatementOfWhatACommunitySDirectoryDisclosesAndToWhom {
12
+ [k: string]: unknown | undefined;
13
+ }
14
+
15
+ /**
16
+ * The definitions this shared schema publishes, hoisted to one declaration each.
17
+ * See "../../../../_shared/components.js".
18
+ */
19
+ export type { DirectoryDisclosure, DisclosedField, GroupDisclosure, NewCardDefaults } from "../../../../_shared/components.js";
@@ -243,7 +243,7 @@ export const PAYLOAD_SCHEMA = {
243
243
  },
244
244
  "CardBlobRef": {
245
245
  "title": "CardBlobRef",
246
- "description": "A content-addressed image held in the community's blob store — an avatar or an `image` field. At most 256 KiB, images only, re-encoded by the community on upload (metadata stripped, dimensions capped) so its digest does not link the member across communities. `url` and `urlExpiresAt` appear only in a projection: a short-lived URL the community checks against the same projection, so a member-only image is never a public URL.",
246
+ "description": "A content-addressed image held in the community's blob store — an avatar or an `image` field. At most 256 KiB, images only, re-encoded by the community on upload (vtc/directory/images/upload: metadata stripped, dimensions capped) so its digest does not link the member across communities. A viewer reads the bytes with vtc/directory/images/get, which answers only where the same projection shows the value. `url` and `urlExpiresAt` MAY appear in a projection: a short-lived URL the community checks against the same projection, so a member-only image is never a public URL. A community that does not offer one leaves both out.",
247
247
  "type": "object",
248
248
  "additionalProperties": false,
249
249
  "required": [
@@ -428,7 +428,7 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
428
428
  },
429
429
  "CardBlobRef": {
430
430
  "title": "CardBlobRef",
431
- "description": "A content-addressed image held in the community's blob store — an avatar or an `image` field. At most 256 KiB, images only, re-encoded by the community on upload (metadata stripped, dimensions capped) so its digest does not link the member across communities. `url` and `urlExpiresAt` appear only in a projection: a short-lived URL the community checks against the same projection, so a member-only image is never a public URL.",
431
+ "description": "A content-addressed image held in the community's blob store — an avatar or an `image` field. At most 256 KiB, images only, re-encoded by the community on upload (vtc/directory/images/upload: metadata stripped, dimensions capped) so its digest does not link the member across communities. A viewer reads the bytes with vtc/directory/images/get, which answers only where the same projection shows the value. `url` and `urlExpiresAt` MAY appear in a projection: a short-lived URL the community checks against the same projection, so a member-only image is never a public URL. A community that does not offer one leaves both out.",
432
432
  "type": "object",
433
433
  "additionalProperties": false,
434
434
  "required": [
@@ -0,0 +1,238 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vtc/directory/card/public/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { DigestMultibase, EntryId, Ext, PublishedCard } from "../../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * Read a member's external card, as they signed it. Anyone may ask; the request carries nothing about the reader. The outer document members are owned by the framework — SPEC §6.3.
11
+ */
12
+ export interface VTCDirectoryCardPublicPayload {
13
+ entryId: EntryId;
14
+ /**
15
+ * The card the reader expects, from a registry pointer. Where the card served now is another, the answer is `notFound`.
16
+ */
17
+ cardDigest?: DigestMultibase;
18
+ ext?: Ext;
19
+ }
20
+ /**
21
+ * The success response to a vtc/directory/card/public/0.1 request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vtc/directory/card/public/0.1#response.
22
+ */
23
+ export interface VTCDirectoryCardPublicResponsePayload {
24
+ /**
25
+ * Exactly as the member signed it.
26
+ */
27
+ card: PublishedCard;
28
+ cardDigest: DigestMultibase;
29
+ publishedAt: string;
30
+ ext?: Ext;
31
+ }
32
+
33
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
34
+ export type { DigestMultibase, EntryId, Ext, PublishedCard };
35
+
36
+ /** Trust Task type URI. */
37
+ export const TYPE_URI = "https://trusttasks.org/spec/vtc/directory/card/public/0.1" as const;
38
+
39
+ /** Stable alias for this specification's request payload shape. */
40
+ export type Payload = VTCDirectoryCardPublicPayload;
41
+
42
+ /** Trust Task response type URI (request type URI + "#response"). */
43
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/directory/card/public/0.1#response" as const;
44
+
45
+ /** Stable alias for this specification's success-response payload shape. */
46
+ export type Response = VTCDirectoryCardPublicResponsePayload;
47
+
48
+ /**
49
+ * This specification's payload schema, as a value.
50
+ *
51
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
52
+ * rather than only as a `.json` file because TypeScript types are erased
53
+ * at runtime: without a schema a consumer has nothing to validate, and
54
+ * every REQUIRED payload member is optional in practice. Cross-file
55
+ * `$ref`s are already inlined, so it needs no resolver.
56
+ */
57
+ export const PAYLOAD_SCHEMA = {
58
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
59
+ "$id": "https://trusttasks.org/spec/vtc/directory/card/public/0.1",
60
+ "title": "VTC Directory — Card — Public — payload",
61
+ "description": "Read a member's external card, as they signed it. Anyone may ask; the request carries nothing about the reader. The outer document members are owned by the framework — SPEC §6.3.",
62
+ "type": "object",
63
+ "additionalProperties": false,
64
+ "required": [
65
+ "entryId"
66
+ ],
67
+ "properties": {
68
+ "entryId": {
69
+ "$ref": "#/$defs/EntryId"
70
+ },
71
+ "cardDigest": {
72
+ "$ref": "#/$defs/DigestMultibase",
73
+ "description": "The card the reader expects, from a registry pointer. Where the card served now is another, the answer is `notFound`."
74
+ },
75
+ "ext": {
76
+ "$ref": "#/$defs/Ext"
77
+ }
78
+ },
79
+ "$defs": {
80
+ "Response": {
81
+ "$anchor": "response",
82
+ "title": "VTC Directory — Card — Public — response payload",
83
+ "description": "The success response to a vtc/directory/card/public/0.1 request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vtc/directory/card/public/0.1#response.",
84
+ "type": "object",
85
+ "additionalProperties": false,
86
+ "required": [
87
+ "card",
88
+ "cardDigest",
89
+ "publishedAt"
90
+ ],
91
+ "properties": {
92
+ "card": {
93
+ "$ref": "#/$defs/PublishedCard",
94
+ "description": "Exactly as the member signed it."
95
+ },
96
+ "cardDigest": {
97
+ "$ref": "#/$defs/DigestMultibase"
98
+ },
99
+ "publishedAt": {
100
+ "type": "string",
101
+ "format": "date-time"
102
+ },
103
+ "ext": {
104
+ "$ref": "#/$defs/Ext"
105
+ }
106
+ }
107
+ },
108
+ "Ext": {
109
+ "title": "Ext",
110
+ "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.",
111
+ "type": "object",
112
+ "minProperties": 1,
113
+ "additionalProperties": true,
114
+ "propertyNames": {
115
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
116
+ }
117
+ },
118
+ "DigestMultibase": {
119
+ "title": "DigestMultibase",
120
+ "description": "A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.\n\nMultihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.\n\nThis definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.\n\nRestricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that \"interoperability is not guaranteed between implementations using such values\", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.",
121
+ "type": "string",
122
+ "minLength": 16,
123
+ "pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
124
+ "examples": [
125
+ "zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
126
+ ]
127
+ },
128
+ "PublishedCard": {
129
+ "title": "PublishedCard",
130
+ "description": "A member's external card: a JSContact `Card` (RFC 9553) holding exactly their values whose visibility is `public`, mapped as `JSContactCard` maps them, with the member's W3C Data Integrity `proof`. The community serves it as received and never signs, composes or edits it (VTI-REG-004 item 4).\n\nCarried as an open object, and deliberately so: the proof covers every member of the card, and a typed binding that kept only the members named here would drop the rest and break the signature. So this schema constrains none of its members, and a consumer MUST check them itself: `@type`, `version`, `uid`, `issuer` and `proof` are present; `@type` is `Card`; `version` is `1.0`; `uid` is `urn:vtc-directory:<EntryId>`; `issuer` is the member's membership DID; `proof` is a `DataIntegrityProof` with `cryptosuite` `eddsa-jcs-2022` or `ecdsa-jcs-2019`, `proofPurpose` `assertionMethod`, and a `verificationMethod` of the member's membership DID authorized for `assertionMethod`; and the proof verifies over the card without it, before any member is relied on.",
131
+ "type": "object",
132
+ "additionalProperties": true
133
+ },
134
+ "EntryId": {
135
+ "title": "EntryId",
136
+ "description": "Opaque identifier of one directory entry: `dir_` followed by 16 to 64 base64url characters. Random, scoped to one community, and stable for the life of the membership — it survives a rotation of the member's DID, which is why groups, notes and cards are keyed by it. It MUST NOT be derived from, and MUST NOT reveal, any DID of the member, and the same person's entries in two communities MUST NOT share one. Compared by exact string equality.",
137
+ "type": "string",
138
+ "pattern": "^dir_[A-Za-z0-9_-]{16,64}$"
139
+ }
140
+ }
141
+ } as const;
142
+
143
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
144
+ export const RESPONSE_PAYLOAD_SCHEMA = {
145
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
146
+ "$ref": "#/$defs/Response",
147
+ "$defs": {
148
+ "Response": {
149
+ "$anchor": "response",
150
+ "title": "VTC Directory — Card — Public — response payload",
151
+ "description": "The success response to a vtc/directory/card/public/0.1 request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vtc/directory/card/public/0.1#response.",
152
+ "type": "object",
153
+ "additionalProperties": false,
154
+ "required": [
155
+ "card",
156
+ "cardDigest",
157
+ "publishedAt"
158
+ ],
159
+ "properties": {
160
+ "card": {
161
+ "$ref": "#/$defs/PublishedCard",
162
+ "description": "Exactly as the member signed it."
163
+ },
164
+ "cardDigest": {
165
+ "$ref": "#/$defs/DigestMultibase"
166
+ },
167
+ "publishedAt": {
168
+ "type": "string",
169
+ "format": "date-time"
170
+ },
171
+ "ext": {
172
+ "$ref": "#/$defs/Ext"
173
+ }
174
+ }
175
+ },
176
+ "Ext": {
177
+ "title": "Ext",
178
+ "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.",
179
+ "type": "object",
180
+ "minProperties": 1,
181
+ "additionalProperties": true,
182
+ "propertyNames": {
183
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
184
+ }
185
+ },
186
+ "DigestMultibase": {
187
+ "title": "DigestMultibase",
188
+ "description": "A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.\n\nMultihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.\n\nThis definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.\n\nRestricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that \"interoperability is not guaranteed between implementations using such values\", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.",
189
+ "type": "string",
190
+ "minLength": 16,
191
+ "pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
192
+ "examples": [
193
+ "zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
194
+ ]
195
+ },
196
+ "PublishedCard": {
197
+ "title": "PublishedCard",
198
+ "description": "A member's external card: a JSContact `Card` (RFC 9553) holding exactly their values whose visibility is `public`, mapped as `JSContactCard` maps them, with the member's W3C Data Integrity `proof`. The community serves it as received and never signs, composes or edits it (VTI-REG-004 item 4).\n\nCarried as an open object, and deliberately so: the proof covers every member of the card, and a typed binding that kept only the members named here would drop the rest and break the signature. So this schema constrains none of its members, and a consumer MUST check them itself: `@type`, `version`, `uid`, `issuer` and `proof` are present; `@type` is `Card`; `version` is `1.0`; `uid` is `urn:vtc-directory:<EntryId>`; `issuer` is the member's membership DID; `proof` is a `DataIntegrityProof` with `cryptosuite` `eddsa-jcs-2022` or `ecdsa-jcs-2019`, `proofPurpose` `assertionMethod`, and a `verificationMethod` of the member's membership DID authorized for `assertionMethod`; and the proof verifies over the card without it, before any member is relied on.",
199
+ "type": "object",
200
+ "additionalProperties": true
201
+ },
202
+ "EntryId": {
203
+ "title": "EntryId",
204
+ "description": "Opaque identifier of one directory entry: `dir_` followed by 16 to 64 base64url characters. Random, scoped to one community, and stable for the life of the membership — it survives a rotation of the member's DID, which is why groups, notes and cards are keyed by it. It MUST NOT be derived from, and MUST NOT reveal, any DID of the member, and the same person's entries in two communities MUST NOT share one. Compared by exact string equality.",
205
+ "type": "string",
206
+ "pattern": "^dir_[A-Za-z0-9_-]{16,64}$"
207
+ }
208
+ }
209
+ } as const;
210
+
211
+ /**
212
+ * SPEC.md §7.2 policy for the request variant, from this specification's
213
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
214
+ * per-specification and cannot be derived from the document alone, and
215
+ * item 2 needs the schema this carries.
216
+ */
217
+ export const SPEC = {
218
+ typeUri: TYPE_URI,
219
+ isBearer: false,
220
+ isProofRequired: false,
221
+ isRecipientRequired: true,
222
+ isIssuedAtRequired: false,
223
+ payloadSchema: PAYLOAD_SCHEMA,
224
+ } as const;
225
+
226
+ /**
227
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
228
+ * tracks the *issuer* party's requirement because a response swaps the
229
+ * parties (§7.3 item 5).
230
+ */
231
+ export const RESPONSE_SPEC = {
232
+ typeUri: RESPONSE_TYPE_URI,
233
+ isBearer: false,
234
+ isProofRequired: false,
235
+ isRecipientRequired: true,
236
+ isIssuedAtRequired: false,
237
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
238
+ } as const;