@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
@@ -237,7 +237,7 @@ export const PAYLOAD_SCHEMA = {
237
237
  },
238
238
  "CardBlobRef": {
239
239
  "title": "CardBlobRef",
240
- "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.",
240
+ "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.",
241
241
  "type": "object",
242
242
  "additionalProperties": false,
243
243
  "required": [
@@ -452,7 +452,7 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
452
452
  },
453
453
  "CardBlobRef": {
454
454
  "title": "CardBlobRef",
455
- "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.",
455
+ "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.",
456
456
  "type": "object",
457
457
  "additionalProperties": false,
458
458
  "required": [
@@ -0,0 +1,320 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vtc/directory/images/get/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { CardBlobRef, EntryId, Ext, FieldKey } from "../../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * Read the bytes of an image on a directory entry, where the caller's projection of that entry shows it. The outer document members are owned by the framework — SPEC §6.3.
11
+ */
12
+ export interface VTCDirectoryImagesGetPayload {
13
+ entryId: EntryId;
14
+ /**
15
+ * The image field: `avatar` or a community field of type `image`.
16
+ */
17
+ field: FieldKey;
18
+ /**
19
+ * The image the caller expects, from the `CardBlobRef` it was shown. Where the field now holds another, the answer is `notFound`, so a reader never shows a picture under a card it did not come from.
20
+ */
21
+ sha256?: string;
22
+ ext?: Ext;
23
+ }
24
+ /**
25
+ * The success response to a vtc/directory/images/get/0.1 request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vtc/directory/images/get/0.1#response.
26
+ */
27
+ export interface VTCDirectoryImagesGetResponsePayload {
28
+ /**
29
+ * The image as stored, without `url` or `urlExpiresAt`.
30
+ */
31
+ image: CardBlobRef;
32
+ /**
33
+ * The stored bytes, base64url without padding. Their SHA-256 is `image.sha256`.
34
+ */
35
+ data: string;
36
+ ext?: Ext;
37
+ }
38
+
39
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
40
+ export type { CardBlobRef, EntryId, Ext, FieldKey };
41
+
42
+ /** Trust Task type URI. */
43
+ export const TYPE_URI = "https://trusttasks.org/spec/vtc/directory/images/get/0.1" as const;
44
+
45
+ /** Stable alias for this specification's request payload shape. */
46
+ export type Payload = VTCDirectoryImagesGetPayload;
47
+
48
+ /** Trust Task response type URI (request type URI + "#response"). */
49
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/directory/images/get/0.1#response" as const;
50
+
51
+ /** Stable alias for this specification's success-response payload shape. */
52
+ export type Response = VTCDirectoryImagesGetResponsePayload;
53
+
54
+ /**
55
+ * This specification's payload schema, as a value.
56
+ *
57
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
58
+ * rather than only as a `.json` file because TypeScript types are erased
59
+ * at runtime: without a schema a consumer has nothing to validate, and
60
+ * every REQUIRED payload member is optional in practice. Cross-file
61
+ * `$ref`s are already inlined, so it needs no resolver.
62
+ */
63
+ export const PAYLOAD_SCHEMA = {
64
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
65
+ "$id": "https://trusttasks.org/spec/vtc/directory/images/get/0.1",
66
+ "title": "VTC Directory — Images — Get — payload",
67
+ "description": "Read the bytes of an image on a directory entry, where the caller's projection of that entry shows it. The outer document members are owned by the framework — SPEC §6.3.",
68
+ "type": "object",
69
+ "additionalProperties": false,
70
+ "required": [
71
+ "entryId",
72
+ "field"
73
+ ],
74
+ "properties": {
75
+ "entryId": {
76
+ "$ref": "#/$defs/EntryId"
77
+ },
78
+ "field": {
79
+ "$ref": "#/$defs/FieldKey",
80
+ "description": "The image field: `avatar` or a community field of type `image`."
81
+ },
82
+ "sha256": {
83
+ "type": "string",
84
+ "pattern": "^[0-9a-f]{64}$",
85
+ "description": "The image the caller expects, from the `CardBlobRef` it was shown. Where the field now holds another, the answer is `notFound`, so a reader never shows a picture under a card it did not come from."
86
+ },
87
+ "ext": {
88
+ "$ref": "#/$defs/Ext"
89
+ }
90
+ },
91
+ "$defs": {
92
+ "Response": {
93
+ "$anchor": "response",
94
+ "title": "VTC Directory — Images — Get — response payload",
95
+ "description": "The success response to a vtc/directory/images/get/0.1 request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vtc/directory/images/get/0.1#response.",
96
+ "type": "object",
97
+ "additionalProperties": false,
98
+ "required": [
99
+ "image",
100
+ "data"
101
+ ],
102
+ "properties": {
103
+ "image": {
104
+ "$ref": "#/$defs/CardBlobRef",
105
+ "description": "The image as stored, without `url` or `urlExpiresAt`."
106
+ },
107
+ "data": {
108
+ "type": "string",
109
+ "minLength": 1,
110
+ "maxLength": 349526,
111
+ "pattern": "^[A-Za-z0-9_-]+$",
112
+ "description": "The stored bytes, base64url without padding. Their SHA-256 is `image.sha256`."
113
+ },
114
+ "ext": {
115
+ "$ref": "#/$defs/Ext"
116
+ }
117
+ }
118
+ },
119
+ "Ext": {
120
+ "title": "Ext",
121
+ "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.",
122
+ "type": "object",
123
+ "minProperties": 1,
124
+ "additionalProperties": true,
125
+ "propertyNames": {
126
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
127
+ }
128
+ },
129
+ "CardBlobRef": {
130
+ "title": "CardBlobRef",
131
+ "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.",
132
+ "type": "object",
133
+ "additionalProperties": false,
134
+ "required": [
135
+ "sha256",
136
+ "mediaType"
137
+ ],
138
+ "properties": {
139
+ "sha256": {
140
+ "type": "string",
141
+ "pattern": "^[0-9a-f]{64}$",
142
+ "description": "Lowercase hex SHA-256 of the stored, re-encoded bytes."
143
+ },
144
+ "mediaType": {
145
+ "type": "string",
146
+ "enum": [
147
+ "image/png",
148
+ "image/jpeg",
149
+ "image/webp",
150
+ "image/avif"
151
+ ],
152
+ "description": "Media type of the stored bytes."
153
+ },
154
+ "size": {
155
+ "type": "integer",
156
+ "minimum": 1,
157
+ "maximum": 262144,
158
+ "description": "Size in bytes of the stored bytes."
159
+ },
160
+ "url": {
161
+ "type": "string",
162
+ "format": "uri",
163
+ "maxLength": 2048,
164
+ "description": "Projection only: a URL the viewer can fetch the image from until `urlExpiresAt`."
165
+ },
166
+ "urlExpiresAt": {
167
+ "type": "string",
168
+ "format": "date-time",
169
+ "description": "Projection only: when `url` stops working."
170
+ }
171
+ }
172
+ },
173
+ "FieldKey": {
174
+ "title": "FieldKey",
175
+ "description": "Identifier of a directory field. A key with no `.` is a BASE field, the same in every community: `displayName`, `nickname`, `avatar`, `pronouns`, `bio`, `links` (written by the member) and `role`, `joinedAt`, `did`, `personhood` (derived from the community's own records, never stored on a card). A community-defined field MUST use a reverse-DNS key (`org.example.employer`), so a base key never collides with one, and a key is never reused with a different meaning once defined.",
176
+ "type": "string",
177
+ "minLength": 1,
178
+ "maxLength": 128,
179
+ "pattern": "^([a-z][a-z0-9-]*\\.)*[a-z][a-zA-Z0-9]{0,63}$"
180
+ },
181
+ "EntryId": {
182
+ "title": "EntryId",
183
+ "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.",
184
+ "type": "string",
185
+ "pattern": "^dir_[A-Za-z0-9_-]{16,64}$"
186
+ }
187
+ }
188
+ } as const;
189
+
190
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
191
+ export const RESPONSE_PAYLOAD_SCHEMA = {
192
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
193
+ "$ref": "#/$defs/Response",
194
+ "$defs": {
195
+ "Response": {
196
+ "$anchor": "response",
197
+ "title": "VTC Directory — Images — Get — response payload",
198
+ "description": "The success response to a vtc/directory/images/get/0.1 request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vtc/directory/images/get/0.1#response.",
199
+ "type": "object",
200
+ "additionalProperties": false,
201
+ "required": [
202
+ "image",
203
+ "data"
204
+ ],
205
+ "properties": {
206
+ "image": {
207
+ "$ref": "#/$defs/CardBlobRef",
208
+ "description": "The image as stored, without `url` or `urlExpiresAt`."
209
+ },
210
+ "data": {
211
+ "type": "string",
212
+ "minLength": 1,
213
+ "maxLength": 349526,
214
+ "pattern": "^[A-Za-z0-9_-]+$",
215
+ "description": "The stored bytes, base64url without padding. Their SHA-256 is `image.sha256`."
216
+ },
217
+ "ext": {
218
+ "$ref": "#/$defs/Ext"
219
+ }
220
+ }
221
+ },
222
+ "Ext": {
223
+ "title": "Ext",
224
+ "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.",
225
+ "type": "object",
226
+ "minProperties": 1,
227
+ "additionalProperties": true,
228
+ "propertyNames": {
229
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
230
+ }
231
+ },
232
+ "CardBlobRef": {
233
+ "title": "CardBlobRef",
234
+ "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.",
235
+ "type": "object",
236
+ "additionalProperties": false,
237
+ "required": [
238
+ "sha256",
239
+ "mediaType"
240
+ ],
241
+ "properties": {
242
+ "sha256": {
243
+ "type": "string",
244
+ "pattern": "^[0-9a-f]{64}$",
245
+ "description": "Lowercase hex SHA-256 of the stored, re-encoded bytes."
246
+ },
247
+ "mediaType": {
248
+ "type": "string",
249
+ "enum": [
250
+ "image/png",
251
+ "image/jpeg",
252
+ "image/webp",
253
+ "image/avif"
254
+ ],
255
+ "description": "Media type of the stored bytes."
256
+ },
257
+ "size": {
258
+ "type": "integer",
259
+ "minimum": 1,
260
+ "maximum": 262144,
261
+ "description": "Size in bytes of the stored bytes."
262
+ },
263
+ "url": {
264
+ "type": "string",
265
+ "format": "uri",
266
+ "maxLength": 2048,
267
+ "description": "Projection only: a URL the viewer can fetch the image from until `urlExpiresAt`."
268
+ },
269
+ "urlExpiresAt": {
270
+ "type": "string",
271
+ "format": "date-time",
272
+ "description": "Projection only: when `url` stops working."
273
+ }
274
+ }
275
+ },
276
+ "FieldKey": {
277
+ "title": "FieldKey",
278
+ "description": "Identifier of a directory field. A key with no `.` is a BASE field, the same in every community: `displayName`, `nickname`, `avatar`, `pronouns`, `bio`, `links` (written by the member) and `role`, `joinedAt`, `did`, `personhood` (derived from the community's own records, never stored on a card). A community-defined field MUST use a reverse-DNS key (`org.example.employer`), so a base key never collides with one, and a key is never reused with a different meaning once defined.",
279
+ "type": "string",
280
+ "minLength": 1,
281
+ "maxLength": 128,
282
+ "pattern": "^([a-z][a-z0-9-]*\\.)*[a-z][a-zA-Z0-9]{0,63}$"
283
+ },
284
+ "EntryId": {
285
+ "title": "EntryId",
286
+ "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.",
287
+ "type": "string",
288
+ "pattern": "^dir_[A-Za-z0-9_-]{16,64}$"
289
+ }
290
+ }
291
+ } as const;
292
+
293
+ /**
294
+ * SPEC.md §7.2 policy for the request variant, from this specification's
295
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
296
+ * per-specification and cannot be derived from the document alone, and
297
+ * item 2 needs the schema this carries.
298
+ */
299
+ export const SPEC = {
300
+ typeUri: TYPE_URI,
301
+ isBearer: false,
302
+ isProofRequired: false,
303
+ isRecipientRequired: true,
304
+ isIssuedAtRequired: false,
305
+ payloadSchema: PAYLOAD_SCHEMA,
306
+ } as const;
307
+
308
+ /**
309
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
310
+ * tracks the *issuer* party's requirement because a response swaps the
311
+ * parties (§7.3 item 5).
312
+ */
313
+ export const RESPONSE_SPEC = {
314
+ typeUri: RESPONSE_TYPE_URI,
315
+ isBearer: false,
316
+ isProofRequired: false,
317
+ isRecipientRequired: true,
318
+ isIssuedAtRequired: false,
319
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
320
+ } as const;
@@ -0,0 +1,308 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vtc/directory/images/upload/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { CardBlobRef, Ext, ImageMediaType } from "../../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * A member, or a directory administrator, hands the community an image for a directory card — an avatar or an `image` field. The community re-encodes it and answers the reference a card holds. The outer document members are owned by the framework — SPEC §6.3.
11
+ */
12
+ export interface VTCDirectoryImagesUploadPayload {
13
+ /**
14
+ * The media type of `data` as sent. The community may store another: it re-encodes.
15
+ */
16
+ mediaType: ImageMediaType;
17
+ /**
18
+ * The image, base64url without padding (RFC 4648 §5). At most 262144 bytes decoded.
19
+ */
20
+ data: string;
21
+ ext?: Ext;
22
+ }
23
+ /**
24
+ * The success response to a vtc/directory/images/upload/0.1 request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vtc/directory/images/upload/0.1#response.
25
+ */
26
+ export interface VTCDirectoryImagesUploadResponsePayload {
27
+ /**
28
+ * The stored, re-encoded image, without `url` or `urlExpiresAt`. A card holds this as the field's value.
29
+ */
30
+ image: CardBlobRef;
31
+ /**
32
+ * When the community erases the image if no card holds it by then.
33
+ */
34
+ expiresAt: string;
35
+ ext?: Ext;
36
+ }
37
+
38
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
39
+ export type { CardBlobRef, Ext, ImageMediaType };
40
+
41
+ /** Trust Task type URI. */
42
+ export const TYPE_URI = "https://trusttasks.org/spec/vtc/directory/images/upload/0.1" as const;
43
+
44
+ /** Stable alias for this specification's request payload shape. */
45
+ export type Payload = VTCDirectoryImagesUploadPayload;
46
+
47
+ /** Trust Task response type URI (request type URI + "#response"). */
48
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/directory/images/upload/0.1#response" as const;
49
+
50
+ /** Stable alias for this specification's success-response payload shape. */
51
+ export type Response = VTCDirectoryImagesUploadResponsePayload;
52
+
53
+ /**
54
+ * This specification's payload schema, as a value.
55
+ *
56
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
57
+ * rather than only as a `.json` file because TypeScript types are erased
58
+ * at runtime: without a schema a consumer has nothing to validate, and
59
+ * every REQUIRED payload member is optional in practice. Cross-file
60
+ * `$ref`s are already inlined, so it needs no resolver.
61
+ */
62
+ export const PAYLOAD_SCHEMA = {
63
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
64
+ "$id": "https://trusttasks.org/spec/vtc/directory/images/upload/0.1",
65
+ "title": "VTC Directory — Images — Upload — payload",
66
+ "description": "A member, or a directory administrator, hands the community an image for a directory card — an avatar or an `image` field. The community re-encodes it and answers the reference a card holds. The outer document members are owned by the framework — SPEC §6.3.",
67
+ "type": "object",
68
+ "additionalProperties": false,
69
+ "required": [
70
+ "mediaType",
71
+ "data"
72
+ ],
73
+ "properties": {
74
+ "mediaType": {
75
+ "$ref": "#/$defs/ImageMediaType",
76
+ "description": "The media type of `data` as sent. The community may store another: it re-encodes."
77
+ },
78
+ "data": {
79
+ "type": "string",
80
+ "minLength": 1,
81
+ "maxLength": 349526,
82
+ "pattern": "^[A-Za-z0-9_-]+$",
83
+ "description": "The image, base64url without padding (RFC 4648 §5). At most 262144 bytes decoded."
84
+ },
85
+ "ext": {
86
+ "$ref": "#/$defs/Ext"
87
+ }
88
+ },
89
+ "$defs": {
90
+ "Response": {
91
+ "$anchor": "response",
92
+ "title": "VTC Directory — Images — Upload — response payload",
93
+ "description": "The success response to a vtc/directory/images/upload/0.1 request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vtc/directory/images/upload/0.1#response.",
94
+ "type": "object",
95
+ "additionalProperties": false,
96
+ "required": [
97
+ "image",
98
+ "expiresAt"
99
+ ],
100
+ "properties": {
101
+ "image": {
102
+ "$ref": "#/$defs/CardBlobRef",
103
+ "description": "The stored, re-encoded image, without `url` or `urlExpiresAt`. A card holds this as the field's value."
104
+ },
105
+ "expiresAt": {
106
+ "type": "string",
107
+ "format": "date-time",
108
+ "description": "When the community erases the image if no card holds it by then."
109
+ },
110
+ "ext": {
111
+ "$ref": "#/$defs/Ext"
112
+ }
113
+ }
114
+ },
115
+ "Ext": {
116
+ "title": "Ext",
117
+ "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.",
118
+ "type": "object",
119
+ "minProperties": 1,
120
+ "additionalProperties": true,
121
+ "propertyNames": {
122
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
123
+ }
124
+ },
125
+ "CardBlobRef": {
126
+ "title": "CardBlobRef",
127
+ "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.",
128
+ "type": "object",
129
+ "additionalProperties": false,
130
+ "required": [
131
+ "sha256",
132
+ "mediaType"
133
+ ],
134
+ "properties": {
135
+ "sha256": {
136
+ "type": "string",
137
+ "pattern": "^[0-9a-f]{64}$",
138
+ "description": "Lowercase hex SHA-256 of the stored, re-encoded bytes."
139
+ },
140
+ "mediaType": {
141
+ "type": "string",
142
+ "enum": [
143
+ "image/png",
144
+ "image/jpeg",
145
+ "image/webp",
146
+ "image/avif"
147
+ ],
148
+ "description": "Media type of the stored bytes."
149
+ },
150
+ "size": {
151
+ "type": "integer",
152
+ "minimum": 1,
153
+ "maximum": 262144,
154
+ "description": "Size in bytes of the stored bytes."
155
+ },
156
+ "url": {
157
+ "type": "string",
158
+ "format": "uri",
159
+ "maxLength": 2048,
160
+ "description": "Projection only: a URL the viewer can fetch the image from until `urlExpiresAt`."
161
+ },
162
+ "urlExpiresAt": {
163
+ "type": "string",
164
+ "format": "date-time",
165
+ "description": "Projection only: when `url` stops working."
166
+ }
167
+ }
168
+ },
169
+ "ImageMediaType": {
170
+ "title": "ImageMediaType",
171
+ "description": "The media types a directory image may have — those a `CardBlobRef` admits.",
172
+ "type": "string",
173
+ "enum": [
174
+ "image/png",
175
+ "image/jpeg",
176
+ "image/webp",
177
+ "image/avif"
178
+ ]
179
+ }
180
+ }
181
+ } as const;
182
+
183
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
184
+ export const RESPONSE_PAYLOAD_SCHEMA = {
185
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
186
+ "$ref": "#/$defs/Response",
187
+ "$defs": {
188
+ "Response": {
189
+ "$anchor": "response",
190
+ "title": "VTC Directory — Images — Upload — response payload",
191
+ "description": "The success response to a vtc/directory/images/upload/0.1 request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vtc/directory/images/upload/0.1#response.",
192
+ "type": "object",
193
+ "additionalProperties": false,
194
+ "required": [
195
+ "image",
196
+ "expiresAt"
197
+ ],
198
+ "properties": {
199
+ "image": {
200
+ "$ref": "#/$defs/CardBlobRef",
201
+ "description": "The stored, re-encoded image, without `url` or `urlExpiresAt`. A card holds this as the field's value."
202
+ },
203
+ "expiresAt": {
204
+ "type": "string",
205
+ "format": "date-time",
206
+ "description": "When the community erases the image if no card holds it by then."
207
+ },
208
+ "ext": {
209
+ "$ref": "#/$defs/Ext"
210
+ }
211
+ }
212
+ },
213
+ "Ext": {
214
+ "title": "Ext",
215
+ "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.",
216
+ "type": "object",
217
+ "minProperties": 1,
218
+ "additionalProperties": true,
219
+ "propertyNames": {
220
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
221
+ }
222
+ },
223
+ "CardBlobRef": {
224
+ "title": "CardBlobRef",
225
+ "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.",
226
+ "type": "object",
227
+ "additionalProperties": false,
228
+ "required": [
229
+ "sha256",
230
+ "mediaType"
231
+ ],
232
+ "properties": {
233
+ "sha256": {
234
+ "type": "string",
235
+ "pattern": "^[0-9a-f]{64}$",
236
+ "description": "Lowercase hex SHA-256 of the stored, re-encoded bytes."
237
+ },
238
+ "mediaType": {
239
+ "type": "string",
240
+ "enum": [
241
+ "image/png",
242
+ "image/jpeg",
243
+ "image/webp",
244
+ "image/avif"
245
+ ],
246
+ "description": "Media type of the stored bytes."
247
+ },
248
+ "size": {
249
+ "type": "integer",
250
+ "minimum": 1,
251
+ "maximum": 262144,
252
+ "description": "Size in bytes of the stored bytes."
253
+ },
254
+ "url": {
255
+ "type": "string",
256
+ "format": "uri",
257
+ "maxLength": 2048,
258
+ "description": "Projection only: a URL the viewer can fetch the image from until `urlExpiresAt`."
259
+ },
260
+ "urlExpiresAt": {
261
+ "type": "string",
262
+ "format": "date-time",
263
+ "description": "Projection only: when `url` stops working."
264
+ }
265
+ }
266
+ },
267
+ "ImageMediaType": {
268
+ "title": "ImageMediaType",
269
+ "description": "The media types a directory image may have — those a `CardBlobRef` admits.",
270
+ "type": "string",
271
+ "enum": [
272
+ "image/png",
273
+ "image/jpeg",
274
+ "image/webp",
275
+ "image/avif"
276
+ ]
277
+ }
278
+ }
279
+ } as const;
280
+
281
+ /**
282
+ * SPEC.md §7.2 policy for the request variant, from this specification's
283
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
284
+ * per-specification and cannot be derived from the document alone, and
285
+ * item 2 needs the schema this carries.
286
+ */
287
+ export const SPEC = {
288
+ typeUri: TYPE_URI,
289
+ isBearer: false,
290
+ isProofRequired: true,
291
+ isRecipientRequired: true,
292
+ isIssuedAtRequired: true,
293
+ payloadSchema: PAYLOAD_SCHEMA,
294
+ } as const;
295
+
296
+ /**
297
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
298
+ * tracks the *issuer* party's requirement because a response swaps the
299
+ * parties (§7.3 item 5).
300
+ */
301
+ export const RESPONSE_SPEC = {
302
+ typeUri: RESPONSE_TYPE_URI,
303
+ isBearer: false,
304
+ isProofRequired: true,
305
+ isRecipientRequired: true,
306
+ isIssuedAtRequired: true,
307
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
308
+ } as const;
@@ -203,7 +203,7 @@ export const PAYLOAD_SCHEMA = {
203
203
  },
204
204
  "CardBlobRef": {
205
205
  "title": "CardBlobRef",
206
- "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.",
206
+ "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.",
207
207
  "type": "object",
208
208
  "additionalProperties": false,
209
209
  "required": [