@openvtc/trust-tasks 0.28.18 → 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 (160) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/_shared/components.d.ts +228 -0
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/index.d.ts +75 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +75 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/vtc/badges/_shared/0.1/badge.d.ts +22 -0
  9. package/dist/vtc/badges/_shared/0.1/badge.d.ts.map +1 -0
  10. package/dist/vtc/badges/_shared/0.1/badge.js +6 -0
  11. package/dist/vtc/badges/_shared/0.1/badge.js.map +1 -0
  12. package/dist/vtc/badges/awards/list/0.1/payload.d.ts +1228 -0
  13. package/dist/vtc/badges/awards/list/0.1/payload.d.ts.map +1 -0
  14. package/dist/vtc/badges/awards/list/0.1/payload.js +699 -0
  15. package/dist/vtc/badges/awards/list/0.1/payload.js.map +1 -0
  16. package/dist/vtc/badges/awards/offer/0.1/payload.d.ts +793 -0
  17. package/dist/vtc/badges/awards/offer/0.1/payload.d.ts.map +1 -0
  18. package/dist/vtc/badges/awards/offer/0.1/payload.js +461 -0
  19. package/dist/vtc/badges/awards/offer/0.1/payload.js.map +1 -0
  20. package/dist/vtc/badges/awards/revoke/0.1/payload.d.ts +605 -0
  21. package/dist/vtc/badges/awards/revoke/0.1/payload.d.ts.map +1 -0
  22. package/dist/vtc/badges/awards/revoke/0.1/payload.js +351 -0
  23. package/dist/vtc/badges/awards/revoke/0.1/payload.js.map +1 -0
  24. package/dist/vtc/badges/awards/withdraw/0.1/payload.d.ts +605 -0
  25. package/dist/vtc/badges/awards/withdraw/0.1/payload.d.ts.map +1 -0
  26. package/dist/vtc/badges/awards/withdraw/0.1/payload.js +351 -0
  27. package/dist/vtc/badges/awards/withdraw/0.1/payload.js.map +1 -0
  28. package/dist/vtc/badges/create/0.1/payload.d.ts +1829 -0
  29. package/dist/vtc/badges/create/0.1/payload.d.ts.map +1 -0
  30. package/dist/vtc/badges/create/0.1/payload.js +1051 -0
  31. package/dist/vtc/badges/create/0.1/payload.js.map +1 -0
  32. package/dist/vtc/badges/holders/list/0.1/payload.d.ts +984 -0
  33. package/dist/vtc/badges/holders/list/0.1/payload.d.ts.map +1 -0
  34. package/dist/vtc/badges/holders/list/0.1/payload.js +555 -0
  35. package/dist/vtc/badges/holders/list/0.1/payload.js.map +1 -0
  36. package/dist/vtc/badges/images/get/0.1/payload.d.ts +454 -0
  37. package/dist/vtc/badges/images/get/0.1/payload.d.ts.map +1 -0
  38. package/dist/vtc/badges/images/get/0.1/payload.js +266 -0
  39. package/dist/vtc/badges/images/get/0.1/payload.js.map +1 -0
  40. package/dist/vtc/badges/images/upload/0.1/payload.d.ts +455 -0
  41. package/dist/vtc/badges/images/upload/0.1/payload.d.ts.map +1 -0
  42. package/dist/vtc/badges/images/upload/0.1/payload.js +276 -0
  43. package/dist/vtc/badges/images/upload/0.1/payload.js.map +1 -0
  44. package/dist/vtc/badges/kudos/give/0.1/payload.d.ts +613 -0
  45. package/dist/vtc/badges/kudos/give/0.1/payload.d.ts.map +1 -0
  46. package/dist/vtc/badges/kudos/give/0.1/payload.js +353 -0
  47. package/dist/vtc/badges/kudos/give/0.1/payload.js.map +1 -0
  48. package/dist/vtc/badges/kudos/list/0.1/payload.d.ts +1766 -0
  49. package/dist/vtc/badges/kudos/list/0.1/payload.d.ts.map +1 -0
  50. package/dist/vtc/badges/kudos/list/0.1/payload.js +995 -0
  51. package/dist/vtc/badges/kudos/list/0.1/payload.js.map +1 -0
  52. package/dist/vtc/badges/list/0.1/payload.d.ts +1096 -0
  53. package/dist/vtc/badges/list/0.1/payload.d.ts.map +1 -0
  54. package/dist/vtc/badges/list/0.1/payload.js +617 -0
  55. package/dist/vtc/badges/list/0.1/payload.js.map +1 -0
  56. package/dist/vtc/badges/mine/accept/0.1/payload.d.ts +1376 -0
  57. package/dist/vtc/badges/mine/accept/0.1/payload.d.ts.map +1 -0
  58. package/dist/vtc/badges/mine/accept/0.1/payload.js +799 -0
  59. package/dist/vtc/badges/mine/accept/0.1/payload.js.map +1 -0
  60. package/dist/vtc/badges/mine/arrange/0.1/payload.d.ts +1217 -0
  61. package/dist/vtc/badges/mine/arrange/0.1/payload.d.ts.map +1 -0
  62. package/dist/vtc/badges/mine/arrange/0.1/payload.js +698 -0
  63. package/dist/vtc/badges/mine/arrange/0.1/payload.js.map +1 -0
  64. package/dist/vtc/badges/mine/decline/0.1/payload.d.ts +589 -0
  65. package/dist/vtc/badges/mine/decline/0.1/payload.d.ts.map +1 -0
  66. package/dist/vtc/badges/mine/decline/0.1/payload.js +344 -0
  67. package/dist/vtc/badges/mine/decline/0.1/payload.js.map +1 -0
  68. package/dist/vtc/badges/mine/hide/0.1/payload.d.ts +1093 -0
  69. package/dist/vtc/badges/mine/hide/0.1/payload.d.ts.map +1 -0
  70. package/dist/vtc/badges/mine/hide/0.1/payload.js +630 -0
  71. package/dist/vtc/badges/mine/hide/0.1/payload.js.map +1 -0
  72. package/dist/vtc/badges/mine/list/0.1/payload.d.ts +1897 -0
  73. package/dist/vtc/badges/mine/list/0.1/payload.d.ts.map +1 -0
  74. package/dist/vtc/badges/mine/list/0.1/payload.js +1087 -0
  75. package/dist/vtc/badges/mine/list/0.1/payload.js.map +1 -0
  76. package/dist/vtc/badges/mine/show/0.1/payload.d.ts +1093 -0
  77. package/dist/vtc/badges/mine/show/0.1/payload.d.ts.map +1 -0
  78. package/dist/vtc/badges/mine/show/0.1/payload.js +630 -0
  79. package/dist/vtc/badges/mine/show/0.1/payload.js.map +1 -0
  80. package/dist/vtc/badges/promote/0.1/payload.d.ts +1757 -0
  81. package/dist/vtc/badges/promote/0.1/payload.d.ts.map +1 -0
  82. package/dist/vtc/badges/promote/0.1/payload.js +1018 -0
  83. package/dist/vtc/badges/promote/0.1/payload.js.map +1 -0
  84. package/dist/vtc/badges/retire/0.1/payload.d.ts +904 -0
  85. package/dist/vtc/badges/retire/0.1/payload.d.ts.map +1 -0
  86. package/dist/vtc/badges/retire/0.1/payload.js +524 -0
  87. package/dist/vtc/badges/retire/0.1/payload.js.map +1 -0
  88. package/dist/vtc/badges/settings/show/0.1/payload.d.ts +731 -0
  89. package/dist/vtc/badges/settings/show/0.1/payload.d.ts.map +1 -0
  90. package/dist/vtc/badges/settings/show/0.1/payload.js +421 -0
  91. package/dist/vtc/badges/settings/show/0.1/payload.js.map +1 -0
  92. package/dist/vtc/badges/settings/update/0.1/payload.d.ts +775 -0
  93. package/dist/vtc/badges/settings/update/0.1/payload.d.ts.map +1 -0
  94. package/dist/vtc/badges/settings/update/0.1/payload.js +444 -0
  95. package/dist/vtc/badges/settings/update/0.1/payload.js.map +1 -0
  96. package/dist/vtc/badges/show/0.1/payload.d.ts +1056 -0
  97. package/dist/vtc/badges/show/0.1/payload.d.ts.map +1 -0
  98. package/dist/vtc/badges/show/0.1/payload.js +613 -0
  99. package/dist/vtc/badges/show/0.1/payload.js.map +1 -0
  100. package/dist/vtc/badges/update/0.1/payload.d.ts +1033 -0
  101. package/dist/vtc/badges/update/0.1/payload.d.ts.map +1 -0
  102. package/dist/vtc/badges/update/0.1/payload.js +588 -0
  103. package/dist/vtc/badges/update/0.1/payload.js.map +1 -0
  104. package/dist/vtc/badges/wall/show/0.1/payload.d.ts +1099 -0
  105. package/dist/vtc/badges/wall/show/0.1/payload.d.ts.map +1 -0
  106. package/dist/vtc/badges/wall/show/0.1/payload.js +634 -0
  107. package/dist/vtc/badges/wall/show/0.1/payload.js.map +1 -0
  108. package/dist/vtc/groups/create/0.1/payload.d.ts +42 -2
  109. package/dist/vtc/groups/create/0.1/payload.d.ts.map +1 -1
  110. package/dist/vtc/groups/create/0.1/payload.js +20 -0
  111. package/dist/vtc/groups/create/0.1/payload.js.map +1 -1
  112. package/dist/vtc/groups/list/0.1/payload.d.ts +42 -2
  113. package/dist/vtc/groups/list/0.1/payload.d.ts.map +1 -1
  114. package/dist/vtc/groups/list/0.1/payload.js +20 -0
  115. package/dist/vtc/groups/list/0.1/payload.js.map +1 -1
  116. package/dist/vtc/groups/list/0.2/payload.d.ts +42 -2
  117. package/dist/vtc/groups/list/0.2/payload.d.ts.map +1 -1
  118. package/dist/vtc/groups/list/0.2/payload.js +20 -0
  119. package/dist/vtc/groups/list/0.2/payload.js.map +1 -1
  120. package/dist/vtc/groups/show/0.1/payload.d.ts +42 -2
  121. package/dist/vtc/groups/show/0.1/payload.d.ts.map +1 -1
  122. package/dist/vtc/groups/show/0.1/payload.js +20 -0
  123. package/dist/vtc/groups/show/0.1/payload.js.map +1 -1
  124. package/dist/vtc/groups/update/0.1/payload.d.ts +42 -2
  125. package/dist/vtc/groups/update/0.1/payload.d.ts.map +1 -1
  126. package/dist/vtc/groups/update/0.1/payload.js +20 -0
  127. package/dist/vtc/groups/update/0.1/payload.js.map +1 -1
  128. package/package.json +1 -1
  129. package/src/_shared/components.ts +228 -0
  130. package/src/index.ts +75 -0
  131. package/src/vtc/badges/_shared/0.1/badge.ts +23 -0
  132. package/src/vtc/badges/awards/list/0.1/payload.ts +768 -0
  133. package/src/vtc/badges/awards/offer/0.1/payload.ts +530 -0
  134. package/src/vtc/badges/awards/revoke/0.1/payload.ts +395 -0
  135. package/src/vtc/badges/awards/withdraw/0.1/payload.ts +395 -0
  136. package/src/vtc/badges/create/0.1/payload.ts +1137 -0
  137. package/src/vtc/badges/holders/list/0.1/payload.ts +628 -0
  138. package/src/vtc/badges/images/get/0.1/payload.ts +311 -0
  139. package/src/vtc/badges/images/upload/0.1/payload.ts +324 -0
  140. package/src/vtc/badges/kudos/give/0.1/payload.ts +401 -0
  141. package/src/vtc/badges/kudos/list/0.1/payload.ts +1080 -0
  142. package/src/vtc/badges/list/0.1/payload.ts +695 -0
  143. package/src/vtc/badges/mine/accept/0.1/payload.ts +840 -0
  144. package/src/vtc/badges/mine/arrange/0.1/payload.ts +768 -0
  145. package/src/vtc/badges/mine/decline/0.1/payload.ts +384 -0
  146. package/src/vtc/badges/mine/hide/0.1/payload.ts +670 -0
  147. package/src/vtc/badges/mine/list/0.1/payload.ts +1153 -0
  148. package/src/vtc/badges/mine/show/0.1/payload.ts +670 -0
  149. package/src/vtc/badges/promote/0.1/payload.ts +1088 -0
  150. package/src/vtc/badges/retire/0.1/payload.ts +565 -0
  151. package/src/vtc/badges/settings/show/0.1/payload.ts +457 -0
  152. package/src/vtc/badges/settings/update/0.1/payload.ts +490 -0
  153. package/src/vtc/badges/show/0.1/payload.ts +675 -0
  154. package/src/vtc/badges/update/0.1/payload.ts +656 -0
  155. package/src/vtc/badges/wall/show/0.1/payload.ts +684 -0
  156. package/src/vtc/groups/create/0.1/payload.ts +22 -2
  157. package/src/vtc/groups/list/0.1/payload.ts +22 -2
  158. package/src/vtc/groups/list/0.2/payload.ts +22 -2
  159. package/src/vtc/groups/show/0.1/payload.ts +22 -2
  160. package/src/vtc/groups/update/0.1/payload.ts +22 -2
@@ -0,0 +1,1087 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vtc/badges/mine/list/0.1/payload.schema.json
4
+ */
5
+ /** Trust Task type URI. */
6
+ export const TYPE_URI = "https://trusttasks.org/spec/vtc/badges/mine/list/0.1";
7
+ /**
8
+ * The earlier version of this specification that this one declares it
9
+ * extends (front matter `extends`, SPEC §5.2 "Declared extension"), or
10
+ * `null`. Only the direct declaration — follow the chain with
11
+ * `extendsChain` / `readForSpec`.
12
+ */
13
+ export const EXTENDS = null;
14
+ /**
15
+ * Why this version is deprecated, or `null` while it is current. A
16
+ * superseded or retired version is still supported, and is withdrawn from
17
+ * this package in a later scheduled batch (SPEC "Superseded and Withdrawn
18
+ * Versions").
19
+ */
20
+ export const DEPRECATION = null;
21
+ /** Trust Task response type URI (request type URI + "#response"). */
22
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/badges/mine/list/0.1#response";
23
+ /**
24
+ * This specification's payload schema, as a value.
25
+ *
26
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
27
+ * rather than only as a `.json` file because TypeScript types are erased
28
+ * at runtime: without a schema a consumer has nothing to validate, and
29
+ * every REQUIRED payload member is optional in practice. Cross-file
30
+ * `$ref`s are already inlined, so it needs no resolver.
31
+ */
32
+ export const PAYLOAD_SCHEMA = {
33
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
34
+ "$id": "https://trusttasks.org/spec/vtc/badges/mine/list/0.1",
35
+ "title": "VTC Badges — Mine — List — payload",
36
+ "description": "A member's own badges: every badge they hold, hidden ones included, in their own order, with the offers waiting for their decision, their wall visibility and their kudos total. The signer is the subject; the payload names nothing. The outer document members are owned by the framework — SPEC §6.3.",
37
+ "type": "object",
38
+ "additionalProperties": false,
39
+ "properties": {
40
+ "ext": {
41
+ "$ref": "#/$defs/Ext"
42
+ }
43
+ },
44
+ "$defs": {
45
+ "Offer": {
46
+ "title": "Offer",
47
+ "description": "An award waiting for the signer's decision, with the badge it offers and its giver as the directory projects them to the signer.",
48
+ "type": "object",
49
+ "additionalProperties": false,
50
+ "required": [
51
+ "award",
52
+ "badge"
53
+ ],
54
+ "properties": {
55
+ "award": {
56
+ "$ref": "#/$defs/Award",
57
+ "description": "In state `offered`; `note` is returned, it is written for the recipient."
58
+ },
59
+ "badge": {
60
+ "$ref": "#/$defs/Badge"
61
+ },
62
+ "givenBy": {
63
+ "$ref": "#/$defs/EntryFields",
64
+ "description": "The giver's directory fields the signer may see, projected exactly as vtc/directory/entries/show would project them. Absent when the signer may see none, or when a rule made the award."
65
+ }
66
+ }
67
+ },
68
+ "Response": {
69
+ "$anchor": "response",
70
+ "title": "VTC Badges — Mine — List — response payload",
71
+ "description": "The success response to a vtc/badges/mine/list/0.1 request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vtc/badges/mine/list/0.1#response.",
72
+ "type": "object",
73
+ "additionalProperties": false,
74
+ "required": [
75
+ "badges",
76
+ "offers",
77
+ "visibility"
78
+ ],
79
+ "properties": {
80
+ "badges": {
81
+ "type": "array",
82
+ "maxItems": 1000,
83
+ "items": {
84
+ "$ref": "#/$defs/MyBadge"
85
+ },
86
+ "description": "Every badge the signer holds, hidden ones included (`hidden: true`), in the signer's own order, lowest `position` first."
87
+ },
88
+ "offers": {
89
+ "type": "array",
90
+ "maxItems": 1000,
91
+ "items": {
92
+ "$ref": "#/$defs/Offer"
93
+ },
94
+ "description": "Every award in state `offered` to the signer, newest first."
95
+ },
96
+ "visibility": {
97
+ "$ref": "#/$defs/WallVisibility",
98
+ "description": "Who sees the signer's wall, as the signer set it; `members` where they never did."
99
+ },
100
+ "kudosTotal": {
101
+ "type": "integer",
102
+ "minimum": 0,
103
+ "description": "Kudos awards the signer accepted and did not hide. Present only where the community's badge settings show kudos totals (VTI-BDG-043)."
104
+ },
105
+ "ext": {
106
+ "$ref": "#/$defs/Ext"
107
+ }
108
+ }
109
+ },
110
+ "Ext": {
111
+ "title": "Ext",
112
+ "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.",
113
+ "type": "object",
114
+ "minProperties": 1,
115
+ "additionalProperties": true,
116
+ "propertyNames": {
117
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
118
+ }
119
+ },
120
+ "WallVisibility": {
121
+ "title": "WallVisibility",
122
+ "description": "Who sees a member's badges, the member's own setting (VTI-BDG-031). `members`: every active member the directory shows their card to. `nobody`: no one but the member. Never wider than the directory shows the card.",
123
+ "type": "string",
124
+ "enum": [
125
+ "members",
126
+ "nobody"
127
+ ]
128
+ },
129
+ "MyBadge": {
130
+ "title": "MyBadge",
131
+ "description": "A badge as its holder sees it in their own list: the wall entry plus what only the holder knows — whether they hid it, their position for it, and the credential that evidences it.",
132
+ "type": "object",
133
+ "additionalProperties": false,
134
+ "required": [
135
+ "badge",
136
+ "count",
137
+ "since",
138
+ "pinned",
139
+ "hidden"
140
+ ],
141
+ "properties": {
142
+ "badge": {
143
+ "$ref": "#/$defs/Badge"
144
+ },
145
+ "count": {
146
+ "type": "integer",
147
+ "minimum": 1
148
+ },
149
+ "since": {
150
+ "type": "string",
151
+ "format": "date-time"
152
+ },
153
+ "latestAt": {
154
+ "type": "string",
155
+ "format": "date-time"
156
+ },
157
+ "pinned": {
158
+ "type": "boolean"
159
+ },
160
+ "hidden": {
161
+ "type": "boolean",
162
+ "description": "The holder hid it: off their wall, out of the badge's holder list for members, out of its count; the awards, the membership and the credential stand (VTI-BDG-030)."
163
+ },
164
+ "position": {
165
+ "type": "integer",
166
+ "minimum": 0,
167
+ "description": "The holder's order on their wall, lowest first."
168
+ },
169
+ "credentialId": {
170
+ "$ref": "#/$defs/GroupCredentialId"
171
+ },
172
+ "credentialValidUntil": {
173
+ "type": "string",
174
+ "format": "date-time"
175
+ }
176
+ }
177
+ },
178
+ "Badge": {
179
+ "title": "Badge",
180
+ "description": "A badge as a caller who may see it sees it. `groupId` is present exactly when `kind` is `community`. `holderCount` only to callers who may see the badge's holders, counted over holders who have not hidden it (VTI-BDG-030, VTI-BDG-033). `createdBy` is the directory entry of the administrator or member who made it, where they have one.",
181
+ "type": "object",
182
+ "additionalProperties": false,
183
+ "required": [
184
+ "badgeId",
185
+ "kind",
186
+ "name",
187
+ "description",
188
+ "image",
189
+ "repeatable",
190
+ "listed",
191
+ "state",
192
+ "createdAt"
193
+ ],
194
+ "properties": {
195
+ "badgeId": {
196
+ "$ref": "#/$defs/BadgeId"
197
+ },
198
+ "kind": {
199
+ "$ref": "#/$defs/BadgeKind"
200
+ },
201
+ "name": {
202
+ "$ref": "#/$defs/BadgeName"
203
+ },
204
+ "description": {
205
+ "$ref": "#/$defs/BadgeDescription"
206
+ },
207
+ "criteria": {
208
+ "$ref": "#/$defs/BadgeCriteria"
209
+ },
210
+ "image": {
211
+ "$ref": "#/$defs/CardBlobRef",
212
+ "description": "The badge's picture, re-encoded and stored by the community (vtc/badges/images/upload), read with vtc/badges/images/get. `url` and `urlExpiresAt` MAY appear in a projection as for a card picture; for a badge whose holders may show it outside, `url` MAY be the picture's stable public location."
213
+ },
214
+ "repeatable": {
215
+ "type": "boolean",
216
+ "description": "Whether one member may hold the badge more than once, each giving an award of its own (VTI-BDG-022). Always true for a kudos badge."
217
+ },
218
+ "requestable": {
219
+ "type": "boolean",
220
+ "description": "Community badges only. Whether a member may ask for it: a request to join its badge group, decided by its owners (VTI-BDG-014). Absent reads as false."
221
+ },
222
+ "listed": {
223
+ "type": "boolean",
224
+ "description": "Whether members who do not hold the badge see it in the community's badge list. An unlisted badge is seen by its holders, its owners and administrators."
225
+ },
226
+ "shareableOutside": {
227
+ "type": "boolean",
228
+ "description": "Community badges only. Whether its holders may show it outside the community, which decides the credential's regime: short-lived and renewed with no status when false, long-lived with a status in the community's own status set when true (VTI-BDG-061, VTI-BDG-062). Absent reads as false."
229
+ },
230
+ "groupId": {
231
+ "$ref": "#/$defs/GroupId",
232
+ "description": "The badge group that backs a community badge: its managers are the badge's owners, its members the holders, its DID the credential's issuer."
233
+ },
234
+ "state": {
235
+ "$ref": "#/$defs/BadgeState"
236
+ },
237
+ "holderCount": {
238
+ "type": "integer",
239
+ "minimum": 0,
240
+ "description": "Holders who show the badge. Only to callers who may see the holders."
241
+ },
242
+ "createdAt": {
243
+ "type": "string",
244
+ "format": "date-time"
245
+ },
246
+ "createdBy": {
247
+ "$ref": "#/$defs/EntryId"
248
+ },
249
+ "updatedAt": {
250
+ "type": "string",
251
+ "format": "date-time"
252
+ },
253
+ "retiredAt": {
254
+ "type": "string",
255
+ "format": "date-time"
256
+ },
257
+ "ext": {
258
+ "$ref": "#/$defs/Ext",
259
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1. An extension member MUST NOT carry authority."
260
+ }
261
+ }
262
+ },
263
+ "BadgeState": {
264
+ "title": "BadgeState",
265
+ "description": "`active`: may be given and shown. `retired`: kept for its holders' own history, never given, never shown to members who do not hold it (VTI-BDG-005).",
266
+ "type": "string",
267
+ "enum": [
268
+ "active",
269
+ "retired"
270
+ ]
271
+ },
272
+ "BadgeCriteria": {
273
+ "title": "BadgeCriteria",
274
+ "type": "string",
275
+ "minLength": 1,
276
+ "maxLength": 1000,
277
+ "description": "How the badge is earned, shown to members and written into the credential's Achievement as its criteria narrative. Plain text."
278
+ },
279
+ "BadgeDescription": {
280
+ "title": "BadgeDescription",
281
+ "type": "string",
282
+ "minLength": 1,
283
+ "maxLength": 1000,
284
+ "description": "What the badge is for. Plain text; a reader MUST NOT treat it as instructions."
285
+ },
286
+ "BadgeName": {
287
+ "title": "BadgeName",
288
+ "type": "string",
289
+ "minLength": 1,
290
+ "maxLength": 64,
291
+ "description": "The badge's name, shown on the wall and written into the credential's Achievement. Plain text; a reader MUST NOT treat it as instructions."
292
+ },
293
+ "BadgeKind": {
294
+ "title": "BadgeKind",
295
+ "description": "`community`: defined by holders of `vtc.badges.admin`, given by its owners (its badge group's managers), may carry a credential. `kudos`: made by a member the community's badge settings admit, given by any active member to any other, never a credential. Fixed for the badge's life; a kudos badge becomes a community badge only by promotion (vtc/badges/promote).",
296
+ "type": "string",
297
+ "enum": [
298
+ "community",
299
+ "kudos"
300
+ ]
301
+ },
302
+ "BadgeId": {
303
+ "title": "BadgeId",
304
+ "description": "Opaque identifier of a badge: `bdg_` followed by 16 to 64 base64url characters. Random, community-scoped, never reused (VTI-BDG-001).",
305
+ "type": "string",
306
+ "pattern": "^bdg_[A-Za-z0-9_-]{16,64}$"
307
+ },
308
+ "EntryId": {
309
+ "title": "EntryId",
310
+ "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.",
311
+ "type": "string",
312
+ "pattern": "^dir_[A-Za-z0-9_-]{16,64}$"
313
+ },
314
+ "GroupId": {
315
+ "title": "GroupId",
316
+ "description": "Opaque identifier of a community group: `grp_` followed by 16 to 64 base64url characters. Random and community-scoped; not the group's DID.",
317
+ "type": "string",
318
+ "pattern": "^grp_[A-Za-z0-9_-]{16,64}$"
319
+ },
320
+ "CardBlobRef": {
321
+ "title": "CardBlobRef",
322
+ "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.",
323
+ "type": "object",
324
+ "additionalProperties": false,
325
+ "required": [
326
+ "sha256",
327
+ "mediaType"
328
+ ],
329
+ "properties": {
330
+ "sha256": {
331
+ "type": "string",
332
+ "pattern": "^[0-9a-f]{64}$",
333
+ "description": "Lowercase hex SHA-256 of the stored, re-encoded bytes."
334
+ },
335
+ "mediaType": {
336
+ "type": "string",
337
+ "enum": [
338
+ "image/png",
339
+ "image/jpeg",
340
+ "image/webp",
341
+ "image/avif"
342
+ ],
343
+ "description": "Media type of the stored bytes."
344
+ },
345
+ "size": {
346
+ "type": "integer",
347
+ "minimum": 1,
348
+ "maximum": 262144,
349
+ "description": "Size in bytes of the stored bytes."
350
+ },
351
+ "url": {
352
+ "type": "string",
353
+ "format": "uri",
354
+ "maxLength": 2048,
355
+ "description": "Projection only: a URL the viewer can fetch the image from until `urlExpiresAt`."
356
+ },
357
+ "urlExpiresAt": {
358
+ "type": "string",
359
+ "format": "date-time",
360
+ "description": "Projection only: when `url` stops working."
361
+ }
362
+ }
363
+ },
364
+ "GroupCredentialId": {
365
+ "title": "GroupCredentialId",
366
+ "description": "Identifier (`id`) of a group membership credential issued to a member. Each renewal issues a new credential with a new identifier. Validity is the community's setting; a community SHOULD default to 30 days, renewed when 10 days remain.",
367
+ "type": "string",
368
+ "minLength": 1,
369
+ "maxLength": 512
370
+ },
371
+ "EntryFields": {
372
+ "title": "EntryFields",
373
+ "description": "The fields of one entry that a particular viewer may see, keyed by field: the intersection of the member's visibility, the community's ceiling and policy, plus any derived fields that intersection admits. A withheld field is ABSENT, never null.",
374
+ "type": "object",
375
+ "maxProperties": 64,
376
+ "propertyNames": {
377
+ "$ref": "#/$defs/FieldKey"
378
+ },
379
+ "additionalProperties": {
380
+ "$ref": "#/$defs/FieldValue"
381
+ }
382
+ },
383
+ "FieldValue": {
384
+ "title": "FieldValue",
385
+ "description": "The value of one field. Which shape a field takes is fixed by its definition's `type`: text-like types (`text`, `longText`, `url`, `email`, `phone`, `enum`, `date` as YYYY-MM-DD, `country` as ISO 3166-1 alpha-2, `did`) are strings; `multiEnum` and the base field `links` are arrays of strings; `image` and the base field `avatar` are a `CardBlobRef`; `claim` is a `VerifiedValue`; the derived base field `personhood` is a boolean.",
386
+ "anyOf": [
387
+ {
388
+ "type": "string",
389
+ "maxLength": 2000
390
+ },
391
+ {
392
+ "type": "boolean"
393
+ },
394
+ {
395
+ "type": "array",
396
+ "maxItems": 32,
397
+ "items": {
398
+ "type": "string",
399
+ "maxLength": 500
400
+ }
401
+ },
402
+ {
403
+ "$ref": "#/$defs/CardBlobRef"
404
+ },
405
+ {
406
+ "$ref": "#/$defs/VerifiedValue"
407
+ }
408
+ ]
409
+ },
410
+ "VerifiedValue": {
411
+ "title": "VerifiedValue",
412
+ "description": "The value of a `credential`-sourced field: a claim the member disclosed from a credential they presented, with the issuer that attests it. A verified value always names its issuer, and a self-asserted value is never shaped as one. The community keeps only the disclosed claim and these facts about it — never the presentation.",
413
+ "type": "object",
414
+ "additionalProperties": false,
415
+ "required": [
416
+ "value",
417
+ "issuer",
418
+ "verifiedAt"
419
+ ],
420
+ "properties": {
421
+ "value": {
422
+ "anyOf": [
423
+ {
424
+ "type": "string",
425
+ "maxLength": 2000
426
+ },
427
+ {
428
+ "type": "boolean"
429
+ },
430
+ {
431
+ "type": "number"
432
+ }
433
+ ],
434
+ "description": "The disclosed claim value."
435
+ },
436
+ "issuer": {
437
+ "type": "string",
438
+ "pattern": "^did:",
439
+ "maxLength": 2048,
440
+ "description": "DID of the credential's issuer, shown as the field's verification badge."
441
+ },
442
+ "credentialType": {
443
+ "type": "string",
444
+ "minLength": 1,
445
+ "maxLength": 128,
446
+ "description": "The most specific `type` of the credential the claim came from."
447
+ },
448
+ "verifiedAt": {
449
+ "type": "string",
450
+ "format": "date-time",
451
+ "description": "When the community verified the presentation."
452
+ },
453
+ "validUntil": {
454
+ "type": "string",
455
+ "format": "date-time",
456
+ "description": "When the credential expires, where it does. The community withdraws the value once it passes."
457
+ }
458
+ }
459
+ },
460
+ "FieldKey": {
461
+ "title": "FieldKey",
462
+ "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.",
463
+ "type": "string",
464
+ "minLength": 1,
465
+ "maxLength": 128,
466
+ "pattern": "^([a-z][a-z0-9-]*\\.)*[a-z][a-zA-Z0-9]{0,63}$"
467
+ },
468
+ "Award": {
469
+ "title": "Award",
470
+ "description": "One giving of a badge to one member. `givenBy` is the giver's directory entry, absent for an award a dynamic badge group's rule made. `note` is shown to the recipient, the giver, the badge's owners and administrators, never to other members. `credentialId` is present on an accepted award of a community badge: the badge credential that evidences it, renewed or re-issued as the badge's regime requires.",
471
+ "type": "object",
472
+ "additionalProperties": false,
473
+ "required": [
474
+ "awardId",
475
+ "badgeId",
476
+ "entryId",
477
+ "state",
478
+ "offeredAt"
479
+ ],
480
+ "properties": {
481
+ "awardId": {
482
+ "$ref": "#/$defs/AwardId"
483
+ },
484
+ "badgeId": {
485
+ "$ref": "#/$defs/BadgeId"
486
+ },
487
+ "entryId": {
488
+ "$ref": "#/$defs/EntryId",
489
+ "description": "The recipient."
490
+ },
491
+ "givenBy": {
492
+ "$ref": "#/$defs/EntryId"
493
+ },
494
+ "note": {
495
+ "$ref": "#/$defs/AwardNote"
496
+ },
497
+ "state": {
498
+ "$ref": "#/$defs/AwardState"
499
+ },
500
+ "offeredAt": {
501
+ "type": "string",
502
+ "format": "date-time"
503
+ },
504
+ "decidedAt": {
505
+ "type": "string",
506
+ "format": "date-time",
507
+ "description": "When the recipient accepted or declined, the giver withdrew, the offer expired, or the award was revoked."
508
+ },
509
+ "expiresAt": {
510
+ "type": "string",
511
+ "format": "date-time",
512
+ "description": "When an unanswered offer lapses, where the community expires offers."
513
+ },
514
+ "credentialId": {
515
+ "$ref": "#/$defs/GroupCredentialId"
516
+ },
517
+ "ext": {
518
+ "$ref": "#/$defs/Ext"
519
+ }
520
+ }
521
+ },
522
+ "AwardState": {
523
+ "title": "AwardState",
524
+ "description": "`offered`: waiting for the recipient. `accepted`: the recipient took it; for a community badge the credential was issued and the membership recorded. `declined`: the recipient declined; nothing was recorded in the group and nothing issued. `withdrawn`: the giver withdrew the offer before a decision. `expired`: the offer lapsed unanswered. `revoked`: taken back after acceptance (VTI-BDG-023).",
525
+ "type": "string",
526
+ "enum": [
527
+ "offered",
528
+ "accepted",
529
+ "declined",
530
+ "withdrawn",
531
+ "expired",
532
+ "revoked"
533
+ ]
534
+ },
535
+ "AwardNote": {
536
+ "title": "AwardNote",
537
+ "type": "string",
538
+ "minLength": 1,
539
+ "maxLength": 500,
540
+ "description": "What the award is for, from the giver, shown to the recipient and written as the award's evidence narrative where the badge carries a credential. Plain text; erased with its author (VTI-BDG-090)."
541
+ },
542
+ "AwardId": {
543
+ "title": "AwardId",
544
+ "description": "Opaque identifier of one giving of a badge to one member: `awd_` followed by 16 to 64 base64url characters. Random and unique within the community.",
545
+ "type": "string",
546
+ "pattern": "^awd_[A-Za-z0-9_-]{16,64}$"
547
+ }
548
+ }
549
+ };
550
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
551
+ export const RESPONSE_PAYLOAD_SCHEMA = {
552
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
553
+ "$ref": "#/$defs/Response",
554
+ "$defs": {
555
+ "Offer": {
556
+ "title": "Offer",
557
+ "description": "An award waiting for the signer's decision, with the badge it offers and its giver as the directory projects them to the signer.",
558
+ "type": "object",
559
+ "additionalProperties": false,
560
+ "required": [
561
+ "award",
562
+ "badge"
563
+ ],
564
+ "properties": {
565
+ "award": {
566
+ "$ref": "#/$defs/Award",
567
+ "description": "In state `offered`; `note` is returned, it is written for the recipient."
568
+ },
569
+ "badge": {
570
+ "$ref": "#/$defs/Badge"
571
+ },
572
+ "givenBy": {
573
+ "$ref": "#/$defs/EntryFields",
574
+ "description": "The giver's directory fields the signer may see, projected exactly as vtc/directory/entries/show would project them. Absent when the signer may see none, or when a rule made the award."
575
+ }
576
+ }
577
+ },
578
+ "Response": {
579
+ "$anchor": "response",
580
+ "title": "VTC Badges — Mine — List — response payload",
581
+ "description": "The success response to a vtc/badges/mine/list/0.1 request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vtc/badges/mine/list/0.1#response.",
582
+ "type": "object",
583
+ "additionalProperties": false,
584
+ "required": [
585
+ "badges",
586
+ "offers",
587
+ "visibility"
588
+ ],
589
+ "properties": {
590
+ "badges": {
591
+ "type": "array",
592
+ "maxItems": 1000,
593
+ "items": {
594
+ "$ref": "#/$defs/MyBadge"
595
+ },
596
+ "description": "Every badge the signer holds, hidden ones included (`hidden: true`), in the signer's own order, lowest `position` first."
597
+ },
598
+ "offers": {
599
+ "type": "array",
600
+ "maxItems": 1000,
601
+ "items": {
602
+ "$ref": "#/$defs/Offer"
603
+ },
604
+ "description": "Every award in state `offered` to the signer, newest first."
605
+ },
606
+ "visibility": {
607
+ "$ref": "#/$defs/WallVisibility",
608
+ "description": "Who sees the signer's wall, as the signer set it; `members` where they never did."
609
+ },
610
+ "kudosTotal": {
611
+ "type": "integer",
612
+ "minimum": 0,
613
+ "description": "Kudos awards the signer accepted and did not hide. Present only where the community's badge settings show kudos totals (VTI-BDG-043)."
614
+ },
615
+ "ext": {
616
+ "$ref": "#/$defs/Ext"
617
+ }
618
+ }
619
+ },
620
+ "Ext": {
621
+ "title": "Ext",
622
+ "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.",
623
+ "type": "object",
624
+ "minProperties": 1,
625
+ "additionalProperties": true,
626
+ "propertyNames": {
627
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
628
+ }
629
+ },
630
+ "WallVisibility": {
631
+ "title": "WallVisibility",
632
+ "description": "Who sees a member's badges, the member's own setting (VTI-BDG-031). `members`: every active member the directory shows their card to. `nobody`: no one but the member. Never wider than the directory shows the card.",
633
+ "type": "string",
634
+ "enum": [
635
+ "members",
636
+ "nobody"
637
+ ]
638
+ },
639
+ "MyBadge": {
640
+ "title": "MyBadge",
641
+ "description": "A badge as its holder sees it in their own list: the wall entry plus what only the holder knows — whether they hid it, their position for it, and the credential that evidences it.",
642
+ "type": "object",
643
+ "additionalProperties": false,
644
+ "required": [
645
+ "badge",
646
+ "count",
647
+ "since",
648
+ "pinned",
649
+ "hidden"
650
+ ],
651
+ "properties": {
652
+ "badge": {
653
+ "$ref": "#/$defs/Badge"
654
+ },
655
+ "count": {
656
+ "type": "integer",
657
+ "minimum": 1
658
+ },
659
+ "since": {
660
+ "type": "string",
661
+ "format": "date-time"
662
+ },
663
+ "latestAt": {
664
+ "type": "string",
665
+ "format": "date-time"
666
+ },
667
+ "pinned": {
668
+ "type": "boolean"
669
+ },
670
+ "hidden": {
671
+ "type": "boolean",
672
+ "description": "The holder hid it: off their wall, out of the badge's holder list for members, out of its count; the awards, the membership and the credential stand (VTI-BDG-030)."
673
+ },
674
+ "position": {
675
+ "type": "integer",
676
+ "minimum": 0,
677
+ "description": "The holder's order on their wall, lowest first."
678
+ },
679
+ "credentialId": {
680
+ "$ref": "#/$defs/GroupCredentialId"
681
+ },
682
+ "credentialValidUntil": {
683
+ "type": "string",
684
+ "format": "date-time"
685
+ }
686
+ }
687
+ },
688
+ "Badge": {
689
+ "title": "Badge",
690
+ "description": "A badge as a caller who may see it sees it. `groupId` is present exactly when `kind` is `community`. `holderCount` only to callers who may see the badge's holders, counted over holders who have not hidden it (VTI-BDG-030, VTI-BDG-033). `createdBy` is the directory entry of the administrator or member who made it, where they have one.",
691
+ "type": "object",
692
+ "additionalProperties": false,
693
+ "required": [
694
+ "badgeId",
695
+ "kind",
696
+ "name",
697
+ "description",
698
+ "image",
699
+ "repeatable",
700
+ "listed",
701
+ "state",
702
+ "createdAt"
703
+ ],
704
+ "properties": {
705
+ "badgeId": {
706
+ "$ref": "#/$defs/BadgeId"
707
+ },
708
+ "kind": {
709
+ "$ref": "#/$defs/BadgeKind"
710
+ },
711
+ "name": {
712
+ "$ref": "#/$defs/BadgeName"
713
+ },
714
+ "description": {
715
+ "$ref": "#/$defs/BadgeDescription"
716
+ },
717
+ "criteria": {
718
+ "$ref": "#/$defs/BadgeCriteria"
719
+ },
720
+ "image": {
721
+ "$ref": "#/$defs/CardBlobRef",
722
+ "description": "The badge's picture, re-encoded and stored by the community (vtc/badges/images/upload), read with vtc/badges/images/get. `url` and `urlExpiresAt` MAY appear in a projection as for a card picture; for a badge whose holders may show it outside, `url` MAY be the picture's stable public location."
723
+ },
724
+ "repeatable": {
725
+ "type": "boolean",
726
+ "description": "Whether one member may hold the badge more than once, each giving an award of its own (VTI-BDG-022). Always true for a kudos badge."
727
+ },
728
+ "requestable": {
729
+ "type": "boolean",
730
+ "description": "Community badges only. Whether a member may ask for it: a request to join its badge group, decided by its owners (VTI-BDG-014). Absent reads as false."
731
+ },
732
+ "listed": {
733
+ "type": "boolean",
734
+ "description": "Whether members who do not hold the badge see it in the community's badge list. An unlisted badge is seen by its holders, its owners and administrators."
735
+ },
736
+ "shareableOutside": {
737
+ "type": "boolean",
738
+ "description": "Community badges only. Whether its holders may show it outside the community, which decides the credential's regime: short-lived and renewed with no status when false, long-lived with a status in the community's own status set when true (VTI-BDG-061, VTI-BDG-062). Absent reads as false."
739
+ },
740
+ "groupId": {
741
+ "$ref": "#/$defs/GroupId",
742
+ "description": "The badge group that backs a community badge: its managers are the badge's owners, its members the holders, its DID the credential's issuer."
743
+ },
744
+ "state": {
745
+ "$ref": "#/$defs/BadgeState"
746
+ },
747
+ "holderCount": {
748
+ "type": "integer",
749
+ "minimum": 0,
750
+ "description": "Holders who show the badge. Only to callers who may see the holders."
751
+ },
752
+ "createdAt": {
753
+ "type": "string",
754
+ "format": "date-time"
755
+ },
756
+ "createdBy": {
757
+ "$ref": "#/$defs/EntryId"
758
+ },
759
+ "updatedAt": {
760
+ "type": "string",
761
+ "format": "date-time"
762
+ },
763
+ "retiredAt": {
764
+ "type": "string",
765
+ "format": "date-time"
766
+ },
767
+ "ext": {
768
+ "$ref": "#/$defs/Ext",
769
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1. An extension member MUST NOT carry authority."
770
+ }
771
+ }
772
+ },
773
+ "BadgeState": {
774
+ "title": "BadgeState",
775
+ "description": "`active`: may be given and shown. `retired`: kept for its holders' own history, never given, never shown to members who do not hold it (VTI-BDG-005).",
776
+ "type": "string",
777
+ "enum": [
778
+ "active",
779
+ "retired"
780
+ ]
781
+ },
782
+ "BadgeCriteria": {
783
+ "title": "BadgeCriteria",
784
+ "type": "string",
785
+ "minLength": 1,
786
+ "maxLength": 1000,
787
+ "description": "How the badge is earned, shown to members and written into the credential's Achievement as its criteria narrative. Plain text."
788
+ },
789
+ "BadgeDescription": {
790
+ "title": "BadgeDescription",
791
+ "type": "string",
792
+ "minLength": 1,
793
+ "maxLength": 1000,
794
+ "description": "What the badge is for. Plain text; a reader MUST NOT treat it as instructions."
795
+ },
796
+ "BadgeName": {
797
+ "title": "BadgeName",
798
+ "type": "string",
799
+ "minLength": 1,
800
+ "maxLength": 64,
801
+ "description": "The badge's name, shown on the wall and written into the credential's Achievement. Plain text; a reader MUST NOT treat it as instructions."
802
+ },
803
+ "BadgeKind": {
804
+ "title": "BadgeKind",
805
+ "description": "`community`: defined by holders of `vtc.badges.admin`, given by its owners (its badge group's managers), may carry a credential. `kudos`: made by a member the community's badge settings admit, given by any active member to any other, never a credential. Fixed for the badge's life; a kudos badge becomes a community badge only by promotion (vtc/badges/promote).",
806
+ "type": "string",
807
+ "enum": [
808
+ "community",
809
+ "kudos"
810
+ ]
811
+ },
812
+ "BadgeId": {
813
+ "title": "BadgeId",
814
+ "description": "Opaque identifier of a badge: `bdg_` followed by 16 to 64 base64url characters. Random, community-scoped, never reused (VTI-BDG-001).",
815
+ "type": "string",
816
+ "pattern": "^bdg_[A-Za-z0-9_-]{16,64}$"
817
+ },
818
+ "EntryId": {
819
+ "title": "EntryId",
820
+ "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.",
821
+ "type": "string",
822
+ "pattern": "^dir_[A-Za-z0-9_-]{16,64}$"
823
+ },
824
+ "GroupId": {
825
+ "title": "GroupId",
826
+ "description": "Opaque identifier of a community group: `grp_` followed by 16 to 64 base64url characters. Random and community-scoped; not the group's DID.",
827
+ "type": "string",
828
+ "pattern": "^grp_[A-Za-z0-9_-]{16,64}$"
829
+ },
830
+ "CardBlobRef": {
831
+ "title": "CardBlobRef",
832
+ "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.",
833
+ "type": "object",
834
+ "additionalProperties": false,
835
+ "required": [
836
+ "sha256",
837
+ "mediaType"
838
+ ],
839
+ "properties": {
840
+ "sha256": {
841
+ "type": "string",
842
+ "pattern": "^[0-9a-f]{64}$",
843
+ "description": "Lowercase hex SHA-256 of the stored, re-encoded bytes."
844
+ },
845
+ "mediaType": {
846
+ "type": "string",
847
+ "enum": [
848
+ "image/png",
849
+ "image/jpeg",
850
+ "image/webp",
851
+ "image/avif"
852
+ ],
853
+ "description": "Media type of the stored bytes."
854
+ },
855
+ "size": {
856
+ "type": "integer",
857
+ "minimum": 1,
858
+ "maximum": 262144,
859
+ "description": "Size in bytes of the stored bytes."
860
+ },
861
+ "url": {
862
+ "type": "string",
863
+ "format": "uri",
864
+ "maxLength": 2048,
865
+ "description": "Projection only: a URL the viewer can fetch the image from until `urlExpiresAt`."
866
+ },
867
+ "urlExpiresAt": {
868
+ "type": "string",
869
+ "format": "date-time",
870
+ "description": "Projection only: when `url` stops working."
871
+ }
872
+ }
873
+ },
874
+ "GroupCredentialId": {
875
+ "title": "GroupCredentialId",
876
+ "description": "Identifier (`id`) of a group membership credential issued to a member. Each renewal issues a new credential with a new identifier. Validity is the community's setting; a community SHOULD default to 30 days, renewed when 10 days remain.",
877
+ "type": "string",
878
+ "minLength": 1,
879
+ "maxLength": 512
880
+ },
881
+ "EntryFields": {
882
+ "title": "EntryFields",
883
+ "description": "The fields of one entry that a particular viewer may see, keyed by field: the intersection of the member's visibility, the community's ceiling and policy, plus any derived fields that intersection admits. A withheld field is ABSENT, never null.",
884
+ "type": "object",
885
+ "maxProperties": 64,
886
+ "propertyNames": {
887
+ "$ref": "#/$defs/FieldKey"
888
+ },
889
+ "additionalProperties": {
890
+ "$ref": "#/$defs/FieldValue"
891
+ }
892
+ },
893
+ "FieldValue": {
894
+ "title": "FieldValue",
895
+ "description": "The value of one field. Which shape a field takes is fixed by its definition's `type`: text-like types (`text`, `longText`, `url`, `email`, `phone`, `enum`, `date` as YYYY-MM-DD, `country` as ISO 3166-1 alpha-2, `did`) are strings; `multiEnum` and the base field `links` are arrays of strings; `image` and the base field `avatar` are a `CardBlobRef`; `claim` is a `VerifiedValue`; the derived base field `personhood` is a boolean.",
896
+ "anyOf": [
897
+ {
898
+ "type": "string",
899
+ "maxLength": 2000
900
+ },
901
+ {
902
+ "type": "boolean"
903
+ },
904
+ {
905
+ "type": "array",
906
+ "maxItems": 32,
907
+ "items": {
908
+ "type": "string",
909
+ "maxLength": 500
910
+ }
911
+ },
912
+ {
913
+ "$ref": "#/$defs/CardBlobRef"
914
+ },
915
+ {
916
+ "$ref": "#/$defs/VerifiedValue"
917
+ }
918
+ ]
919
+ },
920
+ "VerifiedValue": {
921
+ "title": "VerifiedValue",
922
+ "description": "The value of a `credential`-sourced field: a claim the member disclosed from a credential they presented, with the issuer that attests it. A verified value always names its issuer, and a self-asserted value is never shaped as one. The community keeps only the disclosed claim and these facts about it — never the presentation.",
923
+ "type": "object",
924
+ "additionalProperties": false,
925
+ "required": [
926
+ "value",
927
+ "issuer",
928
+ "verifiedAt"
929
+ ],
930
+ "properties": {
931
+ "value": {
932
+ "anyOf": [
933
+ {
934
+ "type": "string",
935
+ "maxLength": 2000
936
+ },
937
+ {
938
+ "type": "boolean"
939
+ },
940
+ {
941
+ "type": "number"
942
+ }
943
+ ],
944
+ "description": "The disclosed claim value."
945
+ },
946
+ "issuer": {
947
+ "type": "string",
948
+ "pattern": "^did:",
949
+ "maxLength": 2048,
950
+ "description": "DID of the credential's issuer, shown as the field's verification badge."
951
+ },
952
+ "credentialType": {
953
+ "type": "string",
954
+ "minLength": 1,
955
+ "maxLength": 128,
956
+ "description": "The most specific `type` of the credential the claim came from."
957
+ },
958
+ "verifiedAt": {
959
+ "type": "string",
960
+ "format": "date-time",
961
+ "description": "When the community verified the presentation."
962
+ },
963
+ "validUntil": {
964
+ "type": "string",
965
+ "format": "date-time",
966
+ "description": "When the credential expires, where it does. The community withdraws the value once it passes."
967
+ }
968
+ }
969
+ },
970
+ "FieldKey": {
971
+ "title": "FieldKey",
972
+ "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.",
973
+ "type": "string",
974
+ "minLength": 1,
975
+ "maxLength": 128,
976
+ "pattern": "^([a-z][a-z0-9-]*\\.)*[a-z][a-zA-Z0-9]{0,63}$"
977
+ },
978
+ "Award": {
979
+ "title": "Award",
980
+ "description": "One giving of a badge to one member. `givenBy` is the giver's directory entry, absent for an award a dynamic badge group's rule made. `note` is shown to the recipient, the giver, the badge's owners and administrators, never to other members. `credentialId` is present on an accepted award of a community badge: the badge credential that evidences it, renewed or re-issued as the badge's regime requires.",
981
+ "type": "object",
982
+ "additionalProperties": false,
983
+ "required": [
984
+ "awardId",
985
+ "badgeId",
986
+ "entryId",
987
+ "state",
988
+ "offeredAt"
989
+ ],
990
+ "properties": {
991
+ "awardId": {
992
+ "$ref": "#/$defs/AwardId"
993
+ },
994
+ "badgeId": {
995
+ "$ref": "#/$defs/BadgeId"
996
+ },
997
+ "entryId": {
998
+ "$ref": "#/$defs/EntryId",
999
+ "description": "The recipient."
1000
+ },
1001
+ "givenBy": {
1002
+ "$ref": "#/$defs/EntryId"
1003
+ },
1004
+ "note": {
1005
+ "$ref": "#/$defs/AwardNote"
1006
+ },
1007
+ "state": {
1008
+ "$ref": "#/$defs/AwardState"
1009
+ },
1010
+ "offeredAt": {
1011
+ "type": "string",
1012
+ "format": "date-time"
1013
+ },
1014
+ "decidedAt": {
1015
+ "type": "string",
1016
+ "format": "date-time",
1017
+ "description": "When the recipient accepted or declined, the giver withdrew, the offer expired, or the award was revoked."
1018
+ },
1019
+ "expiresAt": {
1020
+ "type": "string",
1021
+ "format": "date-time",
1022
+ "description": "When an unanswered offer lapses, where the community expires offers."
1023
+ },
1024
+ "credentialId": {
1025
+ "$ref": "#/$defs/GroupCredentialId"
1026
+ },
1027
+ "ext": {
1028
+ "$ref": "#/$defs/Ext"
1029
+ }
1030
+ }
1031
+ },
1032
+ "AwardState": {
1033
+ "title": "AwardState",
1034
+ "description": "`offered`: waiting for the recipient. `accepted`: the recipient took it; for a community badge the credential was issued and the membership recorded. `declined`: the recipient declined; nothing was recorded in the group and nothing issued. `withdrawn`: the giver withdrew the offer before a decision. `expired`: the offer lapsed unanswered. `revoked`: taken back after acceptance (VTI-BDG-023).",
1035
+ "type": "string",
1036
+ "enum": [
1037
+ "offered",
1038
+ "accepted",
1039
+ "declined",
1040
+ "withdrawn",
1041
+ "expired",
1042
+ "revoked"
1043
+ ]
1044
+ },
1045
+ "AwardNote": {
1046
+ "title": "AwardNote",
1047
+ "type": "string",
1048
+ "minLength": 1,
1049
+ "maxLength": 500,
1050
+ "description": "What the award is for, from the giver, shown to the recipient and written as the award's evidence narrative where the badge carries a credential. Plain text; erased with its author (VTI-BDG-090)."
1051
+ },
1052
+ "AwardId": {
1053
+ "title": "AwardId",
1054
+ "description": "Opaque identifier of one giving of a badge to one member: `awd_` followed by 16 to 64 base64url characters. Random and unique within the community.",
1055
+ "type": "string",
1056
+ "pattern": "^awd_[A-Za-z0-9_-]{16,64}$"
1057
+ }
1058
+ }
1059
+ };
1060
+ /**
1061
+ * SPEC.md §7.2 policy for the request variant, from this specification's
1062
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
1063
+ * per-specification and cannot be derived from the document alone, and
1064
+ * item 2 needs the schema this carries.
1065
+ */
1066
+ export const SPEC = {
1067
+ typeUri: TYPE_URI,
1068
+ isBearer: false,
1069
+ isProofRequired: true,
1070
+ isRecipientRequired: true,
1071
+ isIssuedAtRequired: true,
1072
+ payloadSchema: PAYLOAD_SCHEMA,
1073
+ };
1074
+ /**
1075
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
1076
+ * tracks the *issuer* party's requirement because a response swaps the
1077
+ * parties (§7.3 item 5).
1078
+ */
1079
+ export const RESPONSE_SPEC = {
1080
+ typeUri: RESPONSE_TYPE_URI,
1081
+ isBearer: false,
1082
+ isProofRequired: true,
1083
+ isRecipientRequired: true,
1084
+ isIssuedAtRequired: true,
1085
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
1086
+ };
1087
+ //# sourceMappingURL=payload.js.map