@openvtc/trust-tasks 0.28.17 → 0.28.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 (187) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/dist/_shared/components.d.ts +254 -1
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/index.d.ts +87 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +87 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/vta/collection/_shared/0.1/collection.d.ts +2 -2
  9. package/dist/vta/collection/_shared/0.1/collection.d.ts.map +1 -1
  10. package/dist/vta/collection/list/0.1/payload.d.ts +4 -4
  11. package/dist/vta/collection/list/0.1/payload.js +2 -2
  12. package/dist/vta/collection/list/0.1/payload.js.map +1 -1
  13. package/dist/vta/collection/settings/set/0.1/payload.d.ts +469 -0
  14. package/dist/vta/collection/settings/set/0.1/payload.d.ts.map +1 -0
  15. package/dist/vta/collection/settings/set/0.1/payload.js +275 -0
  16. package/dist/vta/collection/settings/set/0.1/payload.js.map +1 -0
  17. package/dist/vta/collection/settings/show/0.1/payload.d.ts +437 -0
  18. package/dist/vta/collection/settings/show/0.1/payload.d.ts.map +1 -0
  19. package/dist/vta/collection/settings/show/0.1/payload.js +260 -0
  20. package/dist/vta/collection/settings/show/0.1/payload.js.map +1 -0
  21. package/dist/vtc/badges/_shared/0.1/badge.d.ts +22 -0
  22. package/dist/vtc/badges/_shared/0.1/badge.d.ts.map +1 -0
  23. package/dist/vtc/badges/_shared/0.1/badge.js +6 -0
  24. package/dist/vtc/badges/_shared/0.1/badge.js.map +1 -0
  25. package/dist/vtc/badges/awards/list/0.1/payload.d.ts +1228 -0
  26. package/dist/vtc/badges/awards/list/0.1/payload.d.ts.map +1 -0
  27. package/dist/vtc/badges/awards/list/0.1/payload.js +699 -0
  28. package/dist/vtc/badges/awards/list/0.1/payload.js.map +1 -0
  29. package/dist/vtc/badges/awards/offer/0.1/payload.d.ts +793 -0
  30. package/dist/vtc/badges/awards/offer/0.1/payload.d.ts.map +1 -0
  31. package/dist/vtc/badges/awards/offer/0.1/payload.js +461 -0
  32. package/dist/vtc/badges/awards/offer/0.1/payload.js.map +1 -0
  33. package/dist/vtc/badges/awards/revoke/0.1/payload.d.ts +605 -0
  34. package/dist/vtc/badges/awards/revoke/0.1/payload.d.ts.map +1 -0
  35. package/dist/vtc/badges/awards/revoke/0.1/payload.js +351 -0
  36. package/dist/vtc/badges/awards/revoke/0.1/payload.js.map +1 -0
  37. package/dist/vtc/badges/awards/withdraw/0.1/payload.d.ts +605 -0
  38. package/dist/vtc/badges/awards/withdraw/0.1/payload.d.ts.map +1 -0
  39. package/dist/vtc/badges/awards/withdraw/0.1/payload.js +351 -0
  40. package/dist/vtc/badges/awards/withdraw/0.1/payload.js.map +1 -0
  41. package/dist/vtc/badges/create/0.1/payload.d.ts +1829 -0
  42. package/dist/vtc/badges/create/0.1/payload.d.ts.map +1 -0
  43. package/dist/vtc/badges/create/0.1/payload.js +1051 -0
  44. package/dist/vtc/badges/create/0.1/payload.js.map +1 -0
  45. package/dist/vtc/badges/holders/list/0.1/payload.d.ts +984 -0
  46. package/dist/vtc/badges/holders/list/0.1/payload.d.ts.map +1 -0
  47. package/dist/vtc/badges/holders/list/0.1/payload.js +555 -0
  48. package/dist/vtc/badges/holders/list/0.1/payload.js.map +1 -0
  49. package/dist/vtc/badges/images/get/0.1/payload.d.ts +454 -0
  50. package/dist/vtc/badges/images/get/0.1/payload.d.ts.map +1 -0
  51. package/dist/vtc/badges/images/get/0.1/payload.js +266 -0
  52. package/dist/vtc/badges/images/get/0.1/payload.js.map +1 -0
  53. package/dist/vtc/badges/images/upload/0.1/payload.d.ts +455 -0
  54. package/dist/vtc/badges/images/upload/0.1/payload.d.ts.map +1 -0
  55. package/dist/vtc/badges/images/upload/0.1/payload.js +276 -0
  56. package/dist/vtc/badges/images/upload/0.1/payload.js.map +1 -0
  57. package/dist/vtc/badges/kudos/give/0.1/payload.d.ts +613 -0
  58. package/dist/vtc/badges/kudos/give/0.1/payload.d.ts.map +1 -0
  59. package/dist/vtc/badges/kudos/give/0.1/payload.js +353 -0
  60. package/dist/vtc/badges/kudos/give/0.1/payload.js.map +1 -0
  61. package/dist/vtc/badges/kudos/list/0.1/payload.d.ts +1766 -0
  62. package/dist/vtc/badges/kudos/list/0.1/payload.d.ts.map +1 -0
  63. package/dist/vtc/badges/kudos/list/0.1/payload.js +995 -0
  64. package/dist/vtc/badges/kudos/list/0.1/payload.js.map +1 -0
  65. package/dist/vtc/badges/list/0.1/payload.d.ts +1096 -0
  66. package/dist/vtc/badges/list/0.1/payload.d.ts.map +1 -0
  67. package/dist/vtc/badges/list/0.1/payload.js +617 -0
  68. package/dist/vtc/badges/list/0.1/payload.js.map +1 -0
  69. package/dist/vtc/badges/mine/accept/0.1/payload.d.ts +1376 -0
  70. package/dist/vtc/badges/mine/accept/0.1/payload.d.ts.map +1 -0
  71. package/dist/vtc/badges/mine/accept/0.1/payload.js +799 -0
  72. package/dist/vtc/badges/mine/accept/0.1/payload.js.map +1 -0
  73. package/dist/vtc/badges/mine/arrange/0.1/payload.d.ts +1217 -0
  74. package/dist/vtc/badges/mine/arrange/0.1/payload.d.ts.map +1 -0
  75. package/dist/vtc/badges/mine/arrange/0.1/payload.js +698 -0
  76. package/dist/vtc/badges/mine/arrange/0.1/payload.js.map +1 -0
  77. package/dist/vtc/badges/mine/decline/0.1/payload.d.ts +589 -0
  78. package/dist/vtc/badges/mine/decline/0.1/payload.d.ts.map +1 -0
  79. package/dist/vtc/badges/mine/decline/0.1/payload.js +344 -0
  80. package/dist/vtc/badges/mine/decline/0.1/payload.js.map +1 -0
  81. package/dist/vtc/badges/mine/hide/0.1/payload.d.ts +1093 -0
  82. package/dist/vtc/badges/mine/hide/0.1/payload.d.ts.map +1 -0
  83. package/dist/vtc/badges/mine/hide/0.1/payload.js +630 -0
  84. package/dist/vtc/badges/mine/hide/0.1/payload.js.map +1 -0
  85. package/dist/vtc/badges/mine/list/0.1/payload.d.ts +1897 -0
  86. package/dist/vtc/badges/mine/list/0.1/payload.d.ts.map +1 -0
  87. package/dist/vtc/badges/mine/list/0.1/payload.js +1087 -0
  88. package/dist/vtc/badges/mine/list/0.1/payload.js.map +1 -0
  89. package/dist/vtc/badges/mine/show/0.1/payload.d.ts +1093 -0
  90. package/dist/vtc/badges/mine/show/0.1/payload.d.ts.map +1 -0
  91. package/dist/vtc/badges/mine/show/0.1/payload.js +630 -0
  92. package/dist/vtc/badges/mine/show/0.1/payload.js.map +1 -0
  93. package/dist/vtc/badges/promote/0.1/payload.d.ts +1757 -0
  94. package/dist/vtc/badges/promote/0.1/payload.d.ts.map +1 -0
  95. package/dist/vtc/badges/promote/0.1/payload.js +1018 -0
  96. package/dist/vtc/badges/promote/0.1/payload.js.map +1 -0
  97. package/dist/vtc/badges/retire/0.1/payload.d.ts +904 -0
  98. package/dist/vtc/badges/retire/0.1/payload.d.ts.map +1 -0
  99. package/dist/vtc/badges/retire/0.1/payload.js +524 -0
  100. package/dist/vtc/badges/retire/0.1/payload.js.map +1 -0
  101. package/dist/vtc/badges/settings/show/0.1/payload.d.ts +731 -0
  102. package/dist/vtc/badges/settings/show/0.1/payload.d.ts.map +1 -0
  103. package/dist/vtc/badges/settings/show/0.1/payload.js +421 -0
  104. package/dist/vtc/badges/settings/show/0.1/payload.js.map +1 -0
  105. package/dist/vtc/badges/settings/update/0.1/payload.d.ts +775 -0
  106. package/dist/vtc/badges/settings/update/0.1/payload.d.ts.map +1 -0
  107. package/dist/vtc/badges/settings/update/0.1/payload.js +444 -0
  108. package/dist/vtc/badges/settings/update/0.1/payload.js.map +1 -0
  109. package/dist/vtc/badges/show/0.1/payload.d.ts +1056 -0
  110. package/dist/vtc/badges/show/0.1/payload.d.ts.map +1 -0
  111. package/dist/vtc/badges/show/0.1/payload.js +613 -0
  112. package/dist/vtc/badges/show/0.1/payload.js.map +1 -0
  113. package/dist/vtc/badges/update/0.1/payload.d.ts +1033 -0
  114. package/dist/vtc/badges/update/0.1/payload.d.ts.map +1 -0
  115. package/dist/vtc/badges/update/0.1/payload.js +588 -0
  116. package/dist/vtc/badges/update/0.1/payload.js.map +1 -0
  117. package/dist/vtc/badges/wall/show/0.1/payload.d.ts +1099 -0
  118. package/dist/vtc/badges/wall/show/0.1/payload.d.ts.map +1 -0
  119. package/dist/vtc/badges/wall/show/0.1/payload.js +634 -0
  120. package/dist/vtc/badges/wall/show/0.1/payload.js.map +1 -0
  121. package/dist/vtc/groups/create/0.1/payload.d.ts +42 -2
  122. package/dist/vtc/groups/create/0.1/payload.d.ts.map +1 -1
  123. package/dist/vtc/groups/create/0.1/payload.js +20 -0
  124. package/dist/vtc/groups/create/0.1/payload.js.map +1 -1
  125. package/dist/vtc/groups/list/0.1/payload.d.ts +42 -2
  126. package/dist/vtc/groups/list/0.1/payload.d.ts.map +1 -1
  127. package/dist/vtc/groups/list/0.1/payload.js +20 -0
  128. package/dist/vtc/groups/list/0.1/payload.js.map +1 -1
  129. package/dist/vtc/groups/list/0.2/payload.d.ts +42 -2
  130. package/dist/vtc/groups/list/0.2/payload.d.ts.map +1 -1
  131. package/dist/vtc/groups/list/0.2/payload.js +20 -0
  132. package/dist/vtc/groups/list/0.2/payload.js.map +1 -1
  133. package/dist/vtc/groups/show/0.1/payload.d.ts +42 -2
  134. package/dist/vtc/groups/show/0.1/payload.d.ts.map +1 -1
  135. package/dist/vtc/groups/show/0.1/payload.js +20 -0
  136. package/dist/vtc/groups/show/0.1/payload.js.map +1 -1
  137. package/dist/vtc/groups/update/0.1/payload.d.ts +42 -2
  138. package/dist/vtc/groups/update/0.1/payload.d.ts.map +1 -1
  139. package/dist/vtc/groups/update/0.1/payload.js +20 -0
  140. package/dist/vtc/groups/update/0.1/payload.js.map +1 -1
  141. package/dist/vtn/registry/check/0.1/payload.d.ts +528 -0
  142. package/dist/vtn/registry/check/0.1/payload.d.ts.map +1 -0
  143. package/dist/vtn/registry/check/0.1/payload.js +282 -0
  144. package/dist/vtn/registry/check/0.1/payload.js.map +1 -0
  145. package/dist/vtn/registry/status/0.1/payload.d.ts +736 -0
  146. package/dist/vtn/registry/status/0.1/payload.d.ts.map +1 -0
  147. package/dist/vtn/registry/status/0.1/payload.js +421 -0
  148. package/dist/vtn/registry/status/0.1/payload.js.map +1 -0
  149. package/package.json +1 -1
  150. package/src/_shared/components.ts +254 -1
  151. package/src/index.ts +87 -0
  152. package/src/vta/collection/_shared/0.1/collection.ts +2 -2
  153. package/src/vta/collection/list/0.1/payload.ts +2 -2
  154. package/src/vta/collection/settings/set/0.1/payload.ts +319 -0
  155. package/src/vta/collection/settings/show/0.1/payload.ts +296 -0
  156. package/src/vtc/badges/_shared/0.1/badge.ts +23 -0
  157. package/src/vtc/badges/awards/list/0.1/payload.ts +768 -0
  158. package/src/vtc/badges/awards/offer/0.1/payload.ts +530 -0
  159. package/src/vtc/badges/awards/revoke/0.1/payload.ts +395 -0
  160. package/src/vtc/badges/awards/withdraw/0.1/payload.ts +395 -0
  161. package/src/vtc/badges/create/0.1/payload.ts +1137 -0
  162. package/src/vtc/badges/holders/list/0.1/payload.ts +628 -0
  163. package/src/vtc/badges/images/get/0.1/payload.ts +311 -0
  164. package/src/vtc/badges/images/upload/0.1/payload.ts +324 -0
  165. package/src/vtc/badges/kudos/give/0.1/payload.ts +401 -0
  166. package/src/vtc/badges/kudos/list/0.1/payload.ts +1080 -0
  167. package/src/vtc/badges/list/0.1/payload.ts +695 -0
  168. package/src/vtc/badges/mine/accept/0.1/payload.ts +840 -0
  169. package/src/vtc/badges/mine/arrange/0.1/payload.ts +768 -0
  170. package/src/vtc/badges/mine/decline/0.1/payload.ts +384 -0
  171. package/src/vtc/badges/mine/hide/0.1/payload.ts +670 -0
  172. package/src/vtc/badges/mine/list/0.1/payload.ts +1153 -0
  173. package/src/vtc/badges/mine/show/0.1/payload.ts +670 -0
  174. package/src/vtc/badges/promote/0.1/payload.ts +1088 -0
  175. package/src/vtc/badges/retire/0.1/payload.ts +565 -0
  176. package/src/vtc/badges/settings/show/0.1/payload.ts +457 -0
  177. package/src/vtc/badges/settings/update/0.1/payload.ts +490 -0
  178. package/src/vtc/badges/show/0.1/payload.ts +675 -0
  179. package/src/vtc/badges/update/0.1/payload.ts +656 -0
  180. package/src/vtc/badges/wall/show/0.1/payload.ts +684 -0
  181. package/src/vtc/groups/create/0.1/payload.ts +22 -2
  182. package/src/vtc/groups/list/0.1/payload.ts +22 -2
  183. package/src/vtc/groups/list/0.2/payload.ts +22 -2
  184. package/src/vtc/groups/show/0.1/payload.ts +22 -2
  185. package/src/vtc/groups/update/0.1/payload.ts +22 -2
  186. package/src/vtn/registry/check/0.1/payload.ts +365 -0
  187. package/src/vtn/registry/status/0.1/payload.ts +502 -0
@@ -0,0 +1,311 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vtc/badges/images/get/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { BadgeId, CardBlobRef, Ext } from "../../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * Read the bytes of a badge's picture, where the caller is an active member who may see the badge. The outer document members are owned by the framework — SPEC §6.3.
11
+ */
12
+ export interface VTCBadgesImagesGetPayload {
13
+ badgeId: BadgeId;
14
+ /**
15
+ * The picture the caller expects, from the `CardBlobRef` it was shown on the badge. Where the badge now holds another, the answer is `notFound`, so a reader never shows a picture under a badge it did not come from.
16
+ */
17
+ sha256?: string;
18
+ ext?: Ext;
19
+ }
20
+ /**
21
+ * The success response to a vtc/badges/images/get/0.1 request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vtc/badges/images/get/0.1#response.
22
+ */
23
+ export interface VTCBadgesImagesGetResponsePayload {
24
+ /**
25
+ * The picture as stored, without `url` or `urlExpiresAt`.
26
+ */
27
+ image: CardBlobRef;
28
+ /**
29
+ * The stored bytes, base64url without padding. Their SHA-256 is `image.sha256`.
30
+ */
31
+ data: string;
32
+ ext?: Ext;
33
+ }
34
+
35
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
36
+ export type { BadgeId, CardBlobRef, Ext };
37
+
38
+ /** Trust Task type URI. */
39
+ export const TYPE_URI = "https://trusttasks.org/spec/vtc/badges/images/get/0.1" as const;
40
+
41
+ /**
42
+ * The earlier version of this specification that this one declares it
43
+ * extends (front matter `extends`, SPEC §5.2 "Declared extension"), or
44
+ * `null`. Only the direct declaration — follow the chain with
45
+ * `extendsChain` / `readForSpec`.
46
+ */
47
+ export const EXTENDS: string | null = null;
48
+
49
+ /**
50
+ * Why this version is deprecated, or `null` while it is current. A
51
+ * superseded or retired version is still supported, and is withdrawn from
52
+ * this package in a later scheduled batch (SPEC "Superseded and Withdrawn
53
+ * Versions").
54
+ */
55
+ export const DEPRECATION: string | null = null;
56
+
57
+ /** Stable alias for this specification's request payload shape. */
58
+ export type Payload = VTCBadgesImagesGetPayload;
59
+
60
+ /** Trust Task response type URI (request type URI + "#response"). */
61
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/badges/images/get/0.1#response" as const;
62
+
63
+ /** Stable alias for this specification's success-response payload shape. */
64
+ export type Response = VTCBadgesImagesGetResponsePayload;
65
+
66
+ /**
67
+ * This specification's payload schema, as a value.
68
+ *
69
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
70
+ * rather than only as a `.json` file because TypeScript types are erased
71
+ * at runtime: without a schema a consumer has nothing to validate, and
72
+ * every REQUIRED payload member is optional in practice. Cross-file
73
+ * `$ref`s are already inlined, so it needs no resolver.
74
+ */
75
+ export const PAYLOAD_SCHEMA = {
76
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
77
+ "$id": "https://trusttasks.org/spec/vtc/badges/images/get/0.1",
78
+ "title": "VTC Badges — Images — Get — payload",
79
+ "description": "Read the bytes of a badge's picture, where the caller is an active member who may see the badge. The outer document members are owned by the framework — SPEC §6.3.",
80
+ "type": "object",
81
+ "additionalProperties": false,
82
+ "required": [
83
+ "badgeId"
84
+ ],
85
+ "properties": {
86
+ "badgeId": {
87
+ "$ref": "#/$defs/BadgeId"
88
+ },
89
+ "sha256": {
90
+ "type": "string",
91
+ "pattern": "^[0-9a-f]{64}$",
92
+ "description": "The picture the caller expects, from the `CardBlobRef` it was shown on the badge. Where the badge now holds another, the answer is `notFound`, so a reader never shows a picture under a badge it did not come from."
93
+ },
94
+ "ext": {
95
+ "$ref": "#/$defs/Ext"
96
+ }
97
+ },
98
+ "$defs": {
99
+ "Response": {
100
+ "$anchor": "response",
101
+ "title": "VTC Badges — Images — Get — response payload",
102
+ "description": "The success response to a vtc/badges/images/get/0.1 request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vtc/badges/images/get/0.1#response.",
103
+ "type": "object",
104
+ "additionalProperties": false,
105
+ "required": [
106
+ "image",
107
+ "data"
108
+ ],
109
+ "properties": {
110
+ "image": {
111
+ "$ref": "#/$defs/CardBlobRef",
112
+ "description": "The picture as stored, without `url` or `urlExpiresAt`."
113
+ },
114
+ "data": {
115
+ "type": "string",
116
+ "minLength": 1,
117
+ "maxLength": 349526,
118
+ "pattern": "^[A-Za-z0-9_-]+$",
119
+ "description": "The stored bytes, base64url without padding. Their SHA-256 is `image.sha256`."
120
+ },
121
+ "ext": {
122
+ "$ref": "#/$defs/Ext"
123
+ }
124
+ }
125
+ },
126
+ "Ext": {
127
+ "title": "Ext",
128
+ "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.",
129
+ "type": "object",
130
+ "minProperties": 1,
131
+ "additionalProperties": true,
132
+ "propertyNames": {
133
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
134
+ }
135
+ },
136
+ "CardBlobRef": {
137
+ "title": "CardBlobRef",
138
+ "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.",
139
+ "type": "object",
140
+ "additionalProperties": false,
141
+ "required": [
142
+ "sha256",
143
+ "mediaType"
144
+ ],
145
+ "properties": {
146
+ "sha256": {
147
+ "type": "string",
148
+ "pattern": "^[0-9a-f]{64}$",
149
+ "description": "Lowercase hex SHA-256 of the stored, re-encoded bytes."
150
+ },
151
+ "mediaType": {
152
+ "type": "string",
153
+ "enum": [
154
+ "image/png",
155
+ "image/jpeg",
156
+ "image/webp",
157
+ "image/avif"
158
+ ],
159
+ "description": "Media type of the stored bytes."
160
+ },
161
+ "size": {
162
+ "type": "integer",
163
+ "minimum": 1,
164
+ "maximum": 262144,
165
+ "description": "Size in bytes of the stored bytes."
166
+ },
167
+ "url": {
168
+ "type": "string",
169
+ "format": "uri",
170
+ "maxLength": 2048,
171
+ "description": "Projection only: a URL the viewer can fetch the image from until `urlExpiresAt`."
172
+ },
173
+ "urlExpiresAt": {
174
+ "type": "string",
175
+ "format": "date-time",
176
+ "description": "Projection only: when `url` stops working."
177
+ }
178
+ }
179
+ },
180
+ "BadgeId": {
181
+ "title": "BadgeId",
182
+ "description": "Opaque identifier of a badge: `bdg_` followed by 16 to 64 base64url characters. Random, community-scoped, never reused (VTI-BDG-001).",
183
+ "type": "string",
184
+ "pattern": "^bdg_[A-Za-z0-9_-]{16,64}$"
185
+ }
186
+ }
187
+ } as const;
188
+
189
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
190
+ export const RESPONSE_PAYLOAD_SCHEMA = {
191
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
192
+ "$ref": "#/$defs/Response",
193
+ "$defs": {
194
+ "Response": {
195
+ "$anchor": "response",
196
+ "title": "VTC Badges — Images — Get — response payload",
197
+ "description": "The success response to a vtc/badges/images/get/0.1 request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vtc/badges/images/get/0.1#response.",
198
+ "type": "object",
199
+ "additionalProperties": false,
200
+ "required": [
201
+ "image",
202
+ "data"
203
+ ],
204
+ "properties": {
205
+ "image": {
206
+ "$ref": "#/$defs/CardBlobRef",
207
+ "description": "The picture as stored, without `url` or `urlExpiresAt`."
208
+ },
209
+ "data": {
210
+ "type": "string",
211
+ "minLength": 1,
212
+ "maxLength": 349526,
213
+ "pattern": "^[A-Za-z0-9_-]+$",
214
+ "description": "The stored bytes, base64url without padding. Their SHA-256 is `image.sha256`."
215
+ },
216
+ "ext": {
217
+ "$ref": "#/$defs/Ext"
218
+ }
219
+ }
220
+ },
221
+ "Ext": {
222
+ "title": "Ext",
223
+ "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.",
224
+ "type": "object",
225
+ "minProperties": 1,
226
+ "additionalProperties": true,
227
+ "propertyNames": {
228
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
229
+ }
230
+ },
231
+ "CardBlobRef": {
232
+ "title": "CardBlobRef",
233
+ "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.",
234
+ "type": "object",
235
+ "additionalProperties": false,
236
+ "required": [
237
+ "sha256",
238
+ "mediaType"
239
+ ],
240
+ "properties": {
241
+ "sha256": {
242
+ "type": "string",
243
+ "pattern": "^[0-9a-f]{64}$",
244
+ "description": "Lowercase hex SHA-256 of the stored, re-encoded bytes."
245
+ },
246
+ "mediaType": {
247
+ "type": "string",
248
+ "enum": [
249
+ "image/png",
250
+ "image/jpeg",
251
+ "image/webp",
252
+ "image/avif"
253
+ ],
254
+ "description": "Media type of the stored bytes."
255
+ },
256
+ "size": {
257
+ "type": "integer",
258
+ "minimum": 1,
259
+ "maximum": 262144,
260
+ "description": "Size in bytes of the stored bytes."
261
+ },
262
+ "url": {
263
+ "type": "string",
264
+ "format": "uri",
265
+ "maxLength": 2048,
266
+ "description": "Projection only: a URL the viewer can fetch the image from until `urlExpiresAt`."
267
+ },
268
+ "urlExpiresAt": {
269
+ "type": "string",
270
+ "format": "date-time",
271
+ "description": "Projection only: when `url` stops working."
272
+ }
273
+ }
274
+ },
275
+ "BadgeId": {
276
+ "title": "BadgeId",
277
+ "description": "Opaque identifier of a badge: `bdg_` followed by 16 to 64 base64url characters. Random, community-scoped, never reused (VTI-BDG-001).",
278
+ "type": "string",
279
+ "pattern": "^bdg_[A-Za-z0-9_-]{16,64}$"
280
+ }
281
+ }
282
+ } as const;
283
+
284
+ /**
285
+ * SPEC.md §7.2 policy for the request variant, from this specification's
286
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
287
+ * per-specification and cannot be derived from the document alone, and
288
+ * item 2 needs the schema this carries.
289
+ */
290
+ export const SPEC = {
291
+ typeUri: TYPE_URI,
292
+ isBearer: false,
293
+ isProofRequired: true,
294
+ isRecipientRequired: true,
295
+ isIssuedAtRequired: false,
296
+ payloadSchema: PAYLOAD_SCHEMA,
297
+ } as const;
298
+
299
+ /**
300
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
301
+ * tracks the *issuer* party's requirement because a response swaps the
302
+ * parties (§7.3 item 5).
303
+ */
304
+ export const RESPONSE_SPEC = {
305
+ typeUri: RESPONSE_TYPE_URI,
306
+ isBearer: false,
307
+ isProofRequired: true,
308
+ isRecipientRequired: true,
309
+ isIssuedAtRequired: false,
310
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
311
+ } as const;
@@ -0,0 +1,324 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vtc/badges/images/upload/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { CardBlobRef, Ext, ImageMediaType } from "../../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * A badge administrator, owner or member hands the community the picture for a badge. The community re-encodes it and answers the reference a badge holds. The outer document members are owned by the framework — SPEC §6.3.
11
+ */
12
+ export interface VTCBadgesImagesUploadPayload {
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/badges/images/upload/0.1 request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vtc/badges/images/upload/0.1#response.
25
+ */
26
+ export interface VTCBadgesImagesUploadResponsePayload {
27
+ /**
28
+ * The stored, re-encoded image, without `url` or `urlExpiresAt`. A badge holds this as its picture; the signer names its `sha256` in vtc/badges/create, update or promote.
29
+ */
30
+ image: CardBlobRef;
31
+ /**
32
+ * When the community erases the image if no badge 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/badges/images/upload/0.1" as const;
43
+
44
+ /**
45
+ * The earlier version of this specification that this one declares it
46
+ * extends (front matter `extends`, SPEC §5.2 "Declared extension"), or
47
+ * `null`. Only the direct declaration — follow the chain with
48
+ * `extendsChain` / `readForSpec`.
49
+ */
50
+ export const EXTENDS: string | null = null;
51
+
52
+ /**
53
+ * Why this version is deprecated, or `null` while it is current. A
54
+ * superseded or retired version is still supported, and is withdrawn from
55
+ * this package in a later scheduled batch (SPEC "Superseded and Withdrawn
56
+ * Versions").
57
+ */
58
+ export const DEPRECATION: string | null = null;
59
+
60
+ /** Stable alias for this specification's request payload shape. */
61
+ export type Payload = VTCBadgesImagesUploadPayload;
62
+
63
+ /** Trust Task response type URI (request type URI + "#response"). */
64
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/badges/images/upload/0.1#response" as const;
65
+
66
+ /** Stable alias for this specification's success-response payload shape. */
67
+ export type Response = VTCBadgesImagesUploadResponsePayload;
68
+
69
+ /**
70
+ * This specification's payload schema, as a value.
71
+ *
72
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
73
+ * rather than only as a `.json` file because TypeScript types are erased
74
+ * at runtime: without a schema a consumer has nothing to validate, and
75
+ * every REQUIRED payload member is optional in practice. Cross-file
76
+ * `$ref`s are already inlined, so it needs no resolver.
77
+ */
78
+ export const PAYLOAD_SCHEMA = {
79
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
80
+ "$id": "https://trusttasks.org/spec/vtc/badges/images/upload/0.1",
81
+ "title": "VTC Badges — Images — Upload — payload",
82
+ "description": "A badge administrator, owner or member hands the community the picture for a badge. The community re-encodes it and answers the reference a badge holds. The outer document members are owned by the framework — SPEC §6.3.",
83
+ "type": "object",
84
+ "additionalProperties": false,
85
+ "required": [
86
+ "mediaType",
87
+ "data"
88
+ ],
89
+ "properties": {
90
+ "mediaType": {
91
+ "$ref": "#/$defs/ImageMediaType",
92
+ "description": "The media type of `data` as sent. The community may store another: it re-encodes."
93
+ },
94
+ "data": {
95
+ "type": "string",
96
+ "minLength": 1,
97
+ "maxLength": 349526,
98
+ "pattern": "^[A-Za-z0-9_-]+$",
99
+ "description": "The image, base64url without padding (RFC 4648 §5). At most 262144 bytes decoded."
100
+ },
101
+ "ext": {
102
+ "$ref": "#/$defs/Ext"
103
+ }
104
+ },
105
+ "$defs": {
106
+ "Response": {
107
+ "$anchor": "response",
108
+ "title": "VTC Badges — Images — Upload — response payload",
109
+ "description": "The success response to a vtc/badges/images/upload/0.1 request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vtc/badges/images/upload/0.1#response.",
110
+ "type": "object",
111
+ "additionalProperties": false,
112
+ "required": [
113
+ "image",
114
+ "expiresAt"
115
+ ],
116
+ "properties": {
117
+ "image": {
118
+ "$ref": "#/$defs/CardBlobRef",
119
+ "description": "The stored, re-encoded image, without `url` or `urlExpiresAt`. A badge holds this as its picture; the signer names its `sha256` in vtc/badges/create, update or promote."
120
+ },
121
+ "expiresAt": {
122
+ "type": "string",
123
+ "format": "date-time",
124
+ "description": "When the community erases the image if no badge holds it by then."
125
+ },
126
+ "ext": {
127
+ "$ref": "#/$defs/Ext"
128
+ }
129
+ }
130
+ },
131
+ "Ext": {
132
+ "title": "Ext",
133
+ "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.",
134
+ "type": "object",
135
+ "minProperties": 1,
136
+ "additionalProperties": true,
137
+ "propertyNames": {
138
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
139
+ }
140
+ },
141
+ "CardBlobRef": {
142
+ "title": "CardBlobRef",
143
+ "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.",
144
+ "type": "object",
145
+ "additionalProperties": false,
146
+ "required": [
147
+ "sha256",
148
+ "mediaType"
149
+ ],
150
+ "properties": {
151
+ "sha256": {
152
+ "type": "string",
153
+ "pattern": "^[0-9a-f]{64}$",
154
+ "description": "Lowercase hex SHA-256 of the stored, re-encoded bytes."
155
+ },
156
+ "mediaType": {
157
+ "type": "string",
158
+ "enum": [
159
+ "image/png",
160
+ "image/jpeg",
161
+ "image/webp",
162
+ "image/avif"
163
+ ],
164
+ "description": "Media type of the stored bytes."
165
+ },
166
+ "size": {
167
+ "type": "integer",
168
+ "minimum": 1,
169
+ "maximum": 262144,
170
+ "description": "Size in bytes of the stored bytes."
171
+ },
172
+ "url": {
173
+ "type": "string",
174
+ "format": "uri",
175
+ "maxLength": 2048,
176
+ "description": "Projection only: a URL the viewer can fetch the image from until `urlExpiresAt`."
177
+ },
178
+ "urlExpiresAt": {
179
+ "type": "string",
180
+ "format": "date-time",
181
+ "description": "Projection only: when `url` stops working."
182
+ }
183
+ }
184
+ },
185
+ "ImageMediaType": {
186
+ "title": "ImageMediaType",
187
+ "description": "The media types a directory image may have — those a `CardBlobRef` admits.",
188
+ "type": "string",
189
+ "enum": [
190
+ "image/png",
191
+ "image/jpeg",
192
+ "image/webp",
193
+ "image/avif"
194
+ ]
195
+ }
196
+ }
197
+ } as const;
198
+
199
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
200
+ export const RESPONSE_PAYLOAD_SCHEMA = {
201
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
202
+ "$ref": "#/$defs/Response",
203
+ "$defs": {
204
+ "Response": {
205
+ "$anchor": "response",
206
+ "title": "VTC Badges — Images — Upload — response payload",
207
+ "description": "The success response to a vtc/badges/images/upload/0.1 request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vtc/badges/images/upload/0.1#response.",
208
+ "type": "object",
209
+ "additionalProperties": false,
210
+ "required": [
211
+ "image",
212
+ "expiresAt"
213
+ ],
214
+ "properties": {
215
+ "image": {
216
+ "$ref": "#/$defs/CardBlobRef",
217
+ "description": "The stored, re-encoded image, without `url` or `urlExpiresAt`. A badge holds this as its picture; the signer names its `sha256` in vtc/badges/create, update or promote."
218
+ },
219
+ "expiresAt": {
220
+ "type": "string",
221
+ "format": "date-time",
222
+ "description": "When the community erases the image if no badge holds it by then."
223
+ },
224
+ "ext": {
225
+ "$ref": "#/$defs/Ext"
226
+ }
227
+ }
228
+ },
229
+ "Ext": {
230
+ "title": "Ext",
231
+ "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.",
232
+ "type": "object",
233
+ "minProperties": 1,
234
+ "additionalProperties": true,
235
+ "propertyNames": {
236
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
237
+ }
238
+ },
239
+ "CardBlobRef": {
240
+ "title": "CardBlobRef",
241
+ "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.",
242
+ "type": "object",
243
+ "additionalProperties": false,
244
+ "required": [
245
+ "sha256",
246
+ "mediaType"
247
+ ],
248
+ "properties": {
249
+ "sha256": {
250
+ "type": "string",
251
+ "pattern": "^[0-9a-f]{64}$",
252
+ "description": "Lowercase hex SHA-256 of the stored, re-encoded bytes."
253
+ },
254
+ "mediaType": {
255
+ "type": "string",
256
+ "enum": [
257
+ "image/png",
258
+ "image/jpeg",
259
+ "image/webp",
260
+ "image/avif"
261
+ ],
262
+ "description": "Media type of the stored bytes."
263
+ },
264
+ "size": {
265
+ "type": "integer",
266
+ "minimum": 1,
267
+ "maximum": 262144,
268
+ "description": "Size in bytes of the stored bytes."
269
+ },
270
+ "url": {
271
+ "type": "string",
272
+ "format": "uri",
273
+ "maxLength": 2048,
274
+ "description": "Projection only: a URL the viewer can fetch the image from until `urlExpiresAt`."
275
+ },
276
+ "urlExpiresAt": {
277
+ "type": "string",
278
+ "format": "date-time",
279
+ "description": "Projection only: when `url` stops working."
280
+ }
281
+ }
282
+ },
283
+ "ImageMediaType": {
284
+ "title": "ImageMediaType",
285
+ "description": "The media types a directory image may have — those a `CardBlobRef` admits.",
286
+ "type": "string",
287
+ "enum": [
288
+ "image/png",
289
+ "image/jpeg",
290
+ "image/webp",
291
+ "image/avif"
292
+ ]
293
+ }
294
+ }
295
+ } as const;
296
+
297
+ /**
298
+ * SPEC.md §7.2 policy for the request variant, from this specification's
299
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
300
+ * per-specification and cannot be derived from the document alone, and
301
+ * item 2 needs the schema this carries.
302
+ */
303
+ export const SPEC = {
304
+ typeUri: TYPE_URI,
305
+ isBearer: false,
306
+ isProofRequired: true,
307
+ isRecipientRequired: true,
308
+ isIssuedAtRequired: true,
309
+ payloadSchema: PAYLOAD_SCHEMA,
310
+ } as const;
311
+
312
+ /**
313
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
314
+ * tracks the *issuer* party's requirement because a response swaps the
315
+ * parties (§7.3 item 5).
316
+ */
317
+ export const RESPONSE_SPEC = {
318
+ typeUri: RESPONSE_TYPE_URI,
319
+ isBearer: false,
320
+ isProofRequired: true,
321
+ isRecipientRequired: true,
322
+ isIssuedAtRequired: true,
323
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
324
+ } as const;