@openvtc/trust-tasks 0.28.18 → 0.28.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 (170) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/dist/_shared/components.d.ts +243 -0
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/index.d.ts +81 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +81 -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 +1340 -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 +761 -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 +905 -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 +523 -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 +717 -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 +413 -0
  23. package/dist/vtc/badges/awards/revoke/0.1/payload.js.map +1 -0
  24. package/dist/vtc/badges/awards/share/0.1/payload.d.ts +701 -0
  25. package/dist/vtc/badges/awards/share/0.1/payload.d.ts.map +1 -0
  26. package/dist/vtc/badges/awards/share/0.1/payload.js +406 -0
  27. package/dist/vtc/badges/awards/share/0.1/payload.js.map +1 -0
  28. package/dist/vtc/badges/awards/unshare/0.1/payload.d.ts +701 -0
  29. package/dist/vtc/badges/awards/unshare/0.1/payload.d.ts.map +1 -0
  30. package/dist/vtc/badges/awards/unshare/0.1/payload.js +406 -0
  31. package/dist/vtc/badges/awards/unshare/0.1/payload.js.map +1 -0
  32. package/dist/vtc/badges/awards/withdraw/0.1/payload.d.ts +717 -0
  33. package/dist/vtc/badges/awards/withdraw/0.1/payload.d.ts.map +1 -0
  34. package/dist/vtc/badges/awards/withdraw/0.1/payload.js +413 -0
  35. package/dist/vtc/badges/awards/withdraw/0.1/payload.js.map +1 -0
  36. package/dist/vtc/badges/create/0.1/payload.d.ts +1829 -0
  37. package/dist/vtc/badges/create/0.1/payload.d.ts.map +1 -0
  38. package/dist/vtc/badges/create/0.1/payload.js +1051 -0
  39. package/dist/vtc/badges/create/0.1/payload.js.map +1 -0
  40. package/dist/vtc/badges/holders/list/0.1/payload.d.ts +984 -0
  41. package/dist/vtc/badges/holders/list/0.1/payload.d.ts.map +1 -0
  42. package/dist/vtc/badges/holders/list/0.1/payload.js +555 -0
  43. package/dist/vtc/badges/holders/list/0.1/payload.js.map +1 -0
  44. package/dist/vtc/badges/images/get/0.1/payload.d.ts +454 -0
  45. package/dist/vtc/badges/images/get/0.1/payload.d.ts.map +1 -0
  46. package/dist/vtc/badges/images/get/0.1/payload.js +266 -0
  47. package/dist/vtc/badges/images/get/0.1/payload.js.map +1 -0
  48. package/dist/vtc/badges/images/upload/0.1/payload.d.ts +455 -0
  49. package/dist/vtc/badges/images/upload/0.1/payload.d.ts.map +1 -0
  50. package/dist/vtc/badges/images/upload/0.1/payload.js +276 -0
  51. package/dist/vtc/badges/images/upload/0.1/payload.js.map +1 -0
  52. package/dist/vtc/badges/kudos/give/0.1/payload.d.ts +725 -0
  53. package/dist/vtc/badges/kudos/give/0.1/payload.d.ts.map +1 -0
  54. package/dist/vtc/badges/kudos/give/0.1/payload.js +415 -0
  55. package/dist/vtc/badges/kudos/give/0.1/payload.js.map +1 -0
  56. package/dist/vtc/badges/kudos/list/0.1/payload.d.ts +1878 -0
  57. package/dist/vtc/badges/kudos/list/0.1/payload.d.ts.map +1 -0
  58. package/dist/vtc/badges/kudos/list/0.1/payload.js +1057 -0
  59. package/dist/vtc/badges/kudos/list/0.1/payload.js.map +1 -0
  60. package/dist/vtc/badges/list/0.1/payload.d.ts +1096 -0
  61. package/dist/vtc/badges/list/0.1/payload.d.ts.map +1 -0
  62. package/dist/vtc/badges/list/0.1/payload.js +617 -0
  63. package/dist/vtc/badges/list/0.1/payload.js.map +1 -0
  64. package/dist/vtc/badges/mine/accept/0.1/payload.d.ts +1488 -0
  65. package/dist/vtc/badges/mine/accept/0.1/payload.d.ts.map +1 -0
  66. package/dist/vtc/badges/mine/accept/0.1/payload.js +861 -0
  67. package/dist/vtc/badges/mine/accept/0.1/payload.js.map +1 -0
  68. package/dist/vtc/badges/mine/arrange/0.1/payload.d.ts +1217 -0
  69. package/dist/vtc/badges/mine/arrange/0.1/payload.d.ts.map +1 -0
  70. package/dist/vtc/badges/mine/arrange/0.1/payload.js +698 -0
  71. package/dist/vtc/badges/mine/arrange/0.1/payload.js.map +1 -0
  72. package/dist/vtc/badges/mine/decline/0.1/payload.d.ts +701 -0
  73. package/dist/vtc/badges/mine/decline/0.1/payload.d.ts.map +1 -0
  74. package/dist/vtc/badges/mine/decline/0.1/payload.js +406 -0
  75. package/dist/vtc/badges/mine/decline/0.1/payload.js.map +1 -0
  76. package/dist/vtc/badges/mine/hide/0.1/payload.d.ts +1093 -0
  77. package/dist/vtc/badges/mine/hide/0.1/payload.d.ts.map +1 -0
  78. package/dist/vtc/badges/mine/hide/0.1/payload.js +630 -0
  79. package/dist/vtc/badges/mine/hide/0.1/payload.js.map +1 -0
  80. package/dist/vtc/badges/mine/list/0.1/payload.d.ts +2009 -0
  81. package/dist/vtc/badges/mine/list/0.1/payload.d.ts.map +1 -0
  82. package/dist/vtc/badges/mine/list/0.1/payload.js +1149 -0
  83. package/dist/vtc/badges/mine/list/0.1/payload.js.map +1 -0
  84. package/dist/vtc/badges/mine/show/0.1/payload.d.ts +1093 -0
  85. package/dist/vtc/badges/mine/show/0.1/payload.d.ts.map +1 -0
  86. package/dist/vtc/badges/mine/show/0.1/payload.js +630 -0
  87. package/dist/vtc/badges/mine/show/0.1/payload.js.map +1 -0
  88. package/dist/vtc/badges/promote/0.1/payload.d.ts +1757 -0
  89. package/dist/vtc/badges/promote/0.1/payload.d.ts.map +1 -0
  90. package/dist/vtc/badges/promote/0.1/payload.js +1018 -0
  91. package/dist/vtc/badges/promote/0.1/payload.js.map +1 -0
  92. package/dist/vtc/badges/retire/0.1/payload.d.ts +904 -0
  93. package/dist/vtc/badges/retire/0.1/payload.d.ts.map +1 -0
  94. package/dist/vtc/badges/retire/0.1/payload.js +524 -0
  95. package/dist/vtc/badges/retire/0.1/payload.js.map +1 -0
  96. package/dist/vtc/badges/settings/show/0.1/payload.d.ts +731 -0
  97. package/dist/vtc/badges/settings/show/0.1/payload.d.ts.map +1 -0
  98. package/dist/vtc/badges/settings/show/0.1/payload.js +421 -0
  99. package/dist/vtc/badges/settings/show/0.1/payload.js.map +1 -0
  100. package/dist/vtc/badges/settings/update/0.1/payload.d.ts +775 -0
  101. package/dist/vtc/badges/settings/update/0.1/payload.d.ts.map +1 -0
  102. package/dist/vtc/badges/settings/update/0.1/payload.js +444 -0
  103. package/dist/vtc/badges/settings/update/0.1/payload.js.map +1 -0
  104. package/dist/vtc/badges/show/0.1/payload.d.ts +1056 -0
  105. package/dist/vtc/badges/show/0.1/payload.d.ts.map +1 -0
  106. package/dist/vtc/badges/show/0.1/payload.js +613 -0
  107. package/dist/vtc/badges/show/0.1/payload.js.map +1 -0
  108. package/dist/vtc/badges/update/0.1/payload.d.ts +1033 -0
  109. package/dist/vtc/badges/update/0.1/payload.d.ts.map +1 -0
  110. package/dist/vtc/badges/update/0.1/payload.js +588 -0
  111. package/dist/vtc/badges/update/0.1/payload.js.map +1 -0
  112. package/dist/vtc/badges/wall/show/0.1/payload.d.ts +1099 -0
  113. package/dist/vtc/badges/wall/show/0.1/payload.d.ts.map +1 -0
  114. package/dist/vtc/badges/wall/show/0.1/payload.js +634 -0
  115. package/dist/vtc/badges/wall/show/0.1/payload.js.map +1 -0
  116. package/dist/vtc/groups/create/0.1/payload.d.ts +42 -2
  117. package/dist/vtc/groups/create/0.1/payload.d.ts.map +1 -1
  118. package/dist/vtc/groups/create/0.1/payload.js +20 -0
  119. package/dist/vtc/groups/create/0.1/payload.js.map +1 -1
  120. package/dist/vtc/groups/list/0.1/payload.d.ts +42 -2
  121. package/dist/vtc/groups/list/0.1/payload.d.ts.map +1 -1
  122. package/dist/vtc/groups/list/0.1/payload.js +20 -0
  123. package/dist/vtc/groups/list/0.1/payload.js.map +1 -1
  124. package/dist/vtc/groups/list/0.2/payload.d.ts +42 -2
  125. package/dist/vtc/groups/list/0.2/payload.d.ts.map +1 -1
  126. package/dist/vtc/groups/list/0.2/payload.js +20 -0
  127. package/dist/vtc/groups/list/0.2/payload.js.map +1 -1
  128. package/dist/vtc/groups/show/0.1/payload.d.ts +42 -2
  129. package/dist/vtc/groups/show/0.1/payload.d.ts.map +1 -1
  130. package/dist/vtc/groups/show/0.1/payload.js +20 -0
  131. package/dist/vtc/groups/show/0.1/payload.js.map +1 -1
  132. package/dist/vtc/groups/update/0.1/payload.d.ts +42 -2
  133. package/dist/vtc/groups/update/0.1/payload.d.ts.map +1 -1
  134. package/dist/vtc/groups/update/0.1/payload.js +20 -0
  135. package/dist/vtc/groups/update/0.1/payload.js.map +1 -1
  136. package/package.json +1 -1
  137. package/src/_shared/components.ts +243 -0
  138. package/src/index.ts +81 -0
  139. package/src/vtc/badges/_shared/0.1/badge.ts +23 -0
  140. package/src/vtc/badges/awards/list/0.1/payload.ts +830 -0
  141. package/src/vtc/badges/awards/offer/0.1/payload.ts +592 -0
  142. package/src/vtc/badges/awards/revoke/0.1/payload.ts +457 -0
  143. package/src/vtc/badges/awards/share/0.1/payload.ts +446 -0
  144. package/src/vtc/badges/awards/unshare/0.1/payload.ts +446 -0
  145. package/src/vtc/badges/awards/withdraw/0.1/payload.ts +457 -0
  146. package/src/vtc/badges/create/0.1/payload.ts +1137 -0
  147. package/src/vtc/badges/holders/list/0.1/payload.ts +628 -0
  148. package/src/vtc/badges/images/get/0.1/payload.ts +311 -0
  149. package/src/vtc/badges/images/upload/0.1/payload.ts +324 -0
  150. package/src/vtc/badges/kudos/give/0.1/payload.ts +463 -0
  151. package/src/vtc/badges/kudos/list/0.1/payload.ts +1142 -0
  152. package/src/vtc/badges/list/0.1/payload.ts +695 -0
  153. package/src/vtc/badges/mine/accept/0.1/payload.ts +902 -0
  154. package/src/vtc/badges/mine/arrange/0.1/payload.ts +768 -0
  155. package/src/vtc/badges/mine/decline/0.1/payload.ts +446 -0
  156. package/src/vtc/badges/mine/hide/0.1/payload.ts +670 -0
  157. package/src/vtc/badges/mine/list/0.1/payload.ts +1215 -0
  158. package/src/vtc/badges/mine/show/0.1/payload.ts +670 -0
  159. package/src/vtc/badges/promote/0.1/payload.ts +1088 -0
  160. package/src/vtc/badges/retire/0.1/payload.ts +565 -0
  161. package/src/vtc/badges/settings/show/0.1/payload.ts +457 -0
  162. package/src/vtc/badges/settings/update/0.1/payload.ts +490 -0
  163. package/src/vtc/badges/show/0.1/payload.ts +675 -0
  164. package/src/vtc/badges/update/0.1/payload.ts +656 -0
  165. package/src/vtc/badges/wall/show/0.1/payload.ts +684 -0
  166. package/src/vtc/groups/create/0.1/payload.ts +22 -2
  167. package/src/vtc/groups/list/0.1/payload.ts +22 -2
  168. package/src/vtc/groups/list/0.2/payload.ts +22 -2
  169. package/src/vtc/groups/show/0.1/payload.ts +22 -2
  170. package/src/vtc/groups/update/0.1/payload.ts +22 -2
@@ -0,0 +1,695 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vtc/badges/list/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { Badge, BadgeCriteria, BadgeDescription, BadgeId, BadgeKind, BadgeName, BadgeState, CardBlobRef, EntryId, Ext, GroupId } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * Where the caller stands with a badge. `holder`: at least one accepted award. `offered`: an open offer names them. `requested`: an undecided request to join its badge group. `none`: nothing.
11
+ */
12
+ export type MyState = "holder" | "offered" | "requested" | "none";
13
+
14
+ /**
15
+ * List the badges the caller may see — every listed active badge and the ones they hold, own or are offered; every badge for an administrator — with how many of each they hold and where they stand with it. The outer document members are owned by the framework — SPEC §6.3.
16
+ */
17
+ export interface VTCBadgesListPayload {
18
+ /**
19
+ * Only badges of this kind.
20
+ */
21
+ kind?: BadgeKind;
22
+ /**
23
+ * Only badges the caller holds — at least one accepted award.
24
+ */
25
+ mine?: boolean;
26
+ /**
27
+ * Administrators only (`vtc.badges.admin`): also the badges that are not `listed`. A member sees the unlisted badges they hold, own or are offered without it.
28
+ */
29
+ includeUnlisted?: boolean;
30
+ /**
31
+ * Administrators only (`vtc.badges.admin`): also the retired badges. A holder's retired badges are in vtc/badges/mine/list.
32
+ */
33
+ includeRetired?: boolean;
34
+ /**
35
+ * An opaque continuation token from a previous response's `nextCursor`, bound to the caller and the filters; a responder MUST NOT accept a cursor it did not issue.
36
+ */
37
+ cursor?: string;
38
+ /**
39
+ * The most items to return, at most 200; the responder chooses a default (50) and MAY return fewer.
40
+ */
41
+ limit?: number;
42
+ ext?: Ext;
43
+ }
44
+ /**
45
+ * The success response to a vtc/badges/list/0.1 request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vtc/badges/list/0.1#response.
46
+ */
47
+ export interface VTCBadgesListResponsePayload {
48
+ /**
49
+ * In order of `name`, then `badgeId`.
50
+ *
51
+ * @maxItems 200
52
+ */
53
+ items: {
54
+ badge: Badge;
55
+ /**
56
+ * Accepted awards of this badge the caller holds; 0 where none.
57
+ */
58
+ myCount: number;
59
+ myState: MyState;
60
+ }[];
61
+ /**
62
+ * Continuation token for the next page; pass it back as `cursor`. Absent on the last page — never `null`.
63
+ */
64
+ nextCursor?: string;
65
+ ext?: Ext;
66
+ }
67
+
68
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
69
+ export type { Badge, BadgeCriteria, BadgeDescription, BadgeId, BadgeKind, BadgeName, BadgeState, CardBlobRef, EntryId, Ext, GroupId };
70
+
71
+ /** Trust Task type URI. */
72
+ export const TYPE_URI = "https://trusttasks.org/spec/vtc/badges/list/0.1" as const;
73
+
74
+ /**
75
+ * The earlier version of this specification that this one declares it
76
+ * extends (front matter `extends`, SPEC §5.2 "Declared extension"), or
77
+ * `null`. Only the direct declaration — follow the chain with
78
+ * `extendsChain` / `readForSpec`.
79
+ */
80
+ export const EXTENDS: string | null = null;
81
+
82
+ /**
83
+ * Why this version is deprecated, or `null` while it is current. A
84
+ * superseded or retired version is still supported, and is withdrawn from
85
+ * this package in a later scheduled batch (SPEC "Superseded and Withdrawn
86
+ * Versions").
87
+ */
88
+ export const DEPRECATION: string | null = null;
89
+
90
+ /** Stable alias for this specification's request payload shape. */
91
+ export type Payload = VTCBadgesListPayload;
92
+
93
+ /** Trust Task response type URI (request type URI + "#response"). */
94
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/badges/list/0.1#response" as const;
95
+
96
+ /** Stable alias for this specification's success-response payload shape. */
97
+ export type Response = VTCBadgesListResponsePayload;
98
+
99
+ /**
100
+ * This specification's payload schema, as a value.
101
+ *
102
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
103
+ * rather than only as a `.json` file because TypeScript types are erased
104
+ * at runtime: without a schema a consumer has nothing to validate, and
105
+ * every REQUIRED payload member is optional in practice. Cross-file
106
+ * `$ref`s are already inlined, so it needs no resolver.
107
+ */
108
+ export const PAYLOAD_SCHEMA = {
109
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
110
+ "$id": "https://trusttasks.org/spec/vtc/badges/list/0.1",
111
+ "title": "VTC Badges — List — payload",
112
+ "description": "List the badges the caller may see — every listed active badge and the ones they hold, own or are offered; every badge for an administrator — with how many of each they hold and where they stand with it. The outer document members are owned by the framework — SPEC §6.3.",
113
+ "type": "object",
114
+ "additionalProperties": false,
115
+ "properties": {
116
+ "kind": {
117
+ "$ref": "#/$defs/BadgeKind",
118
+ "description": "Only badges of this kind."
119
+ },
120
+ "mine": {
121
+ "type": "boolean",
122
+ "description": "Only badges the caller holds — at least one accepted award."
123
+ },
124
+ "includeUnlisted": {
125
+ "type": "boolean",
126
+ "description": "Administrators only (`vtc.badges.admin`): also the badges that are not `listed`. A member sees the unlisted badges they hold, own or are offered without it."
127
+ },
128
+ "includeRetired": {
129
+ "type": "boolean",
130
+ "description": "Administrators only (`vtc.badges.admin`): also the retired badges. A holder's retired badges are in vtc/badges/mine/list."
131
+ },
132
+ "cursor": {
133
+ "type": "string",
134
+ "minLength": 1,
135
+ "maxLength": 1024,
136
+ "description": "An opaque continuation token from a previous response's `nextCursor`, bound to the caller and the filters; a responder MUST NOT accept a cursor it did not issue."
137
+ },
138
+ "limit": {
139
+ "type": "integer",
140
+ "minimum": 1,
141
+ "maximum": 200,
142
+ "description": "The most items to return, at most 200; the responder chooses a default (50) and MAY return fewer."
143
+ },
144
+ "ext": {
145
+ "$ref": "#/$defs/Ext"
146
+ }
147
+ },
148
+ "$defs": {
149
+ "MyState": {
150
+ "title": "MyState",
151
+ "description": "Where the caller stands with a badge. `holder`: at least one accepted award. `offered`: an open offer names them. `requested`: an undecided request to join its badge group. `none`: nothing.",
152
+ "type": "string",
153
+ "enum": [
154
+ "holder",
155
+ "offered",
156
+ "requested",
157
+ "none"
158
+ ]
159
+ },
160
+ "Response": {
161
+ "$anchor": "response",
162
+ "title": "VTC Badges — List — response payload",
163
+ "description": "The success response to a vtc/badges/list/0.1 request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vtc/badges/list/0.1#response.",
164
+ "type": "object",
165
+ "additionalProperties": false,
166
+ "required": [
167
+ "items"
168
+ ],
169
+ "properties": {
170
+ "items": {
171
+ "type": "array",
172
+ "maxItems": 200,
173
+ "items": {
174
+ "type": "object",
175
+ "additionalProperties": false,
176
+ "required": [
177
+ "badge",
178
+ "myCount",
179
+ "myState"
180
+ ],
181
+ "properties": {
182
+ "badge": {
183
+ "$ref": "#/$defs/Badge"
184
+ },
185
+ "myCount": {
186
+ "type": "integer",
187
+ "minimum": 0,
188
+ "description": "Accepted awards of this badge the caller holds; 0 where none."
189
+ },
190
+ "myState": {
191
+ "$ref": "#/$defs/MyState"
192
+ }
193
+ }
194
+ },
195
+ "description": "In order of `name`, then `badgeId`."
196
+ },
197
+ "nextCursor": {
198
+ "type": "string",
199
+ "maxLength": 1024,
200
+ "description": "Continuation token for the next page; pass it back as `cursor`. Absent on the last page — never `null`."
201
+ },
202
+ "ext": {
203
+ "$ref": "#/$defs/Ext"
204
+ }
205
+ }
206
+ },
207
+ "Ext": {
208
+ "title": "Ext",
209
+ "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.",
210
+ "type": "object",
211
+ "minProperties": 1,
212
+ "additionalProperties": true,
213
+ "propertyNames": {
214
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
215
+ }
216
+ },
217
+ "Badge": {
218
+ "title": "Badge",
219
+ "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.",
220
+ "type": "object",
221
+ "additionalProperties": false,
222
+ "required": [
223
+ "badgeId",
224
+ "kind",
225
+ "name",
226
+ "description",
227
+ "image",
228
+ "repeatable",
229
+ "listed",
230
+ "state",
231
+ "createdAt"
232
+ ],
233
+ "properties": {
234
+ "badgeId": {
235
+ "$ref": "#/$defs/BadgeId"
236
+ },
237
+ "kind": {
238
+ "$ref": "#/$defs/BadgeKind"
239
+ },
240
+ "name": {
241
+ "$ref": "#/$defs/BadgeName"
242
+ },
243
+ "description": {
244
+ "$ref": "#/$defs/BadgeDescription"
245
+ },
246
+ "criteria": {
247
+ "$ref": "#/$defs/BadgeCriteria"
248
+ },
249
+ "image": {
250
+ "$ref": "#/$defs/CardBlobRef",
251
+ "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."
252
+ },
253
+ "repeatable": {
254
+ "type": "boolean",
255
+ "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."
256
+ },
257
+ "requestable": {
258
+ "type": "boolean",
259
+ "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."
260
+ },
261
+ "listed": {
262
+ "type": "boolean",
263
+ "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."
264
+ },
265
+ "shareableOutside": {
266
+ "type": "boolean",
267
+ "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."
268
+ },
269
+ "groupId": {
270
+ "$ref": "#/$defs/GroupId",
271
+ "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."
272
+ },
273
+ "state": {
274
+ "$ref": "#/$defs/BadgeState"
275
+ },
276
+ "holderCount": {
277
+ "type": "integer",
278
+ "minimum": 0,
279
+ "description": "Holders who show the badge. Only to callers who may see the holders."
280
+ },
281
+ "createdAt": {
282
+ "type": "string",
283
+ "format": "date-time"
284
+ },
285
+ "createdBy": {
286
+ "$ref": "#/$defs/EntryId"
287
+ },
288
+ "updatedAt": {
289
+ "type": "string",
290
+ "format": "date-time"
291
+ },
292
+ "retiredAt": {
293
+ "type": "string",
294
+ "format": "date-time"
295
+ },
296
+ "ext": {
297
+ "$ref": "#/$defs/Ext",
298
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1. An extension member MUST NOT carry authority."
299
+ }
300
+ }
301
+ },
302
+ "BadgeState": {
303
+ "title": "BadgeState",
304
+ "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).",
305
+ "type": "string",
306
+ "enum": [
307
+ "active",
308
+ "retired"
309
+ ]
310
+ },
311
+ "BadgeCriteria": {
312
+ "title": "BadgeCriteria",
313
+ "type": "string",
314
+ "minLength": 1,
315
+ "maxLength": 1000,
316
+ "description": "How the badge is earned, shown to members and written into the credential's Achievement as its criteria narrative. Plain text."
317
+ },
318
+ "BadgeDescription": {
319
+ "title": "BadgeDescription",
320
+ "type": "string",
321
+ "minLength": 1,
322
+ "maxLength": 1000,
323
+ "description": "What the badge is for. Plain text; a reader MUST NOT treat it as instructions."
324
+ },
325
+ "BadgeName": {
326
+ "title": "BadgeName",
327
+ "type": "string",
328
+ "minLength": 1,
329
+ "maxLength": 64,
330
+ "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."
331
+ },
332
+ "BadgeKind": {
333
+ "title": "BadgeKind",
334
+ "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).",
335
+ "type": "string",
336
+ "enum": [
337
+ "community",
338
+ "kudos"
339
+ ]
340
+ },
341
+ "BadgeId": {
342
+ "title": "BadgeId",
343
+ "description": "Opaque identifier of a badge: `bdg_` followed by 16 to 64 base64url characters. Random, community-scoped, never reused (VTI-BDG-001).",
344
+ "type": "string",
345
+ "pattern": "^bdg_[A-Za-z0-9_-]{16,64}$"
346
+ },
347
+ "EntryId": {
348
+ "title": "EntryId",
349
+ "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.",
350
+ "type": "string",
351
+ "pattern": "^dir_[A-Za-z0-9_-]{16,64}$"
352
+ },
353
+ "GroupId": {
354
+ "title": "GroupId",
355
+ "description": "Opaque identifier of a community group: `grp_` followed by 16 to 64 base64url characters. Random and community-scoped; not the group's DID.",
356
+ "type": "string",
357
+ "pattern": "^grp_[A-Za-z0-9_-]{16,64}$"
358
+ },
359
+ "CardBlobRef": {
360
+ "title": "CardBlobRef",
361
+ "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.",
362
+ "type": "object",
363
+ "additionalProperties": false,
364
+ "required": [
365
+ "sha256",
366
+ "mediaType"
367
+ ],
368
+ "properties": {
369
+ "sha256": {
370
+ "type": "string",
371
+ "pattern": "^[0-9a-f]{64}$",
372
+ "description": "Lowercase hex SHA-256 of the stored, re-encoded bytes."
373
+ },
374
+ "mediaType": {
375
+ "type": "string",
376
+ "enum": [
377
+ "image/png",
378
+ "image/jpeg",
379
+ "image/webp",
380
+ "image/avif"
381
+ ],
382
+ "description": "Media type of the stored bytes."
383
+ },
384
+ "size": {
385
+ "type": "integer",
386
+ "minimum": 1,
387
+ "maximum": 262144,
388
+ "description": "Size in bytes of the stored bytes."
389
+ },
390
+ "url": {
391
+ "type": "string",
392
+ "format": "uri",
393
+ "maxLength": 2048,
394
+ "description": "Projection only: a URL the viewer can fetch the image from until `urlExpiresAt`."
395
+ },
396
+ "urlExpiresAt": {
397
+ "type": "string",
398
+ "format": "date-time",
399
+ "description": "Projection only: when `url` stops working."
400
+ }
401
+ }
402
+ }
403
+ }
404
+ } as const;
405
+
406
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
407
+ export const RESPONSE_PAYLOAD_SCHEMA = {
408
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
409
+ "$ref": "#/$defs/Response",
410
+ "$defs": {
411
+ "MyState": {
412
+ "title": "MyState",
413
+ "description": "Where the caller stands with a badge. `holder`: at least one accepted award. `offered`: an open offer names them. `requested`: an undecided request to join its badge group. `none`: nothing.",
414
+ "type": "string",
415
+ "enum": [
416
+ "holder",
417
+ "offered",
418
+ "requested",
419
+ "none"
420
+ ]
421
+ },
422
+ "Response": {
423
+ "$anchor": "response",
424
+ "title": "VTC Badges — List — response payload",
425
+ "description": "The success response to a vtc/badges/list/0.1 request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vtc/badges/list/0.1#response.",
426
+ "type": "object",
427
+ "additionalProperties": false,
428
+ "required": [
429
+ "items"
430
+ ],
431
+ "properties": {
432
+ "items": {
433
+ "type": "array",
434
+ "maxItems": 200,
435
+ "items": {
436
+ "type": "object",
437
+ "additionalProperties": false,
438
+ "required": [
439
+ "badge",
440
+ "myCount",
441
+ "myState"
442
+ ],
443
+ "properties": {
444
+ "badge": {
445
+ "$ref": "#/$defs/Badge"
446
+ },
447
+ "myCount": {
448
+ "type": "integer",
449
+ "minimum": 0,
450
+ "description": "Accepted awards of this badge the caller holds; 0 where none."
451
+ },
452
+ "myState": {
453
+ "$ref": "#/$defs/MyState"
454
+ }
455
+ }
456
+ },
457
+ "description": "In order of `name`, then `badgeId`."
458
+ },
459
+ "nextCursor": {
460
+ "type": "string",
461
+ "maxLength": 1024,
462
+ "description": "Continuation token for the next page; pass it back as `cursor`. Absent on the last page — never `null`."
463
+ },
464
+ "ext": {
465
+ "$ref": "#/$defs/Ext"
466
+ }
467
+ }
468
+ },
469
+ "Ext": {
470
+ "title": "Ext",
471
+ "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.",
472
+ "type": "object",
473
+ "minProperties": 1,
474
+ "additionalProperties": true,
475
+ "propertyNames": {
476
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
477
+ }
478
+ },
479
+ "Badge": {
480
+ "title": "Badge",
481
+ "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.",
482
+ "type": "object",
483
+ "additionalProperties": false,
484
+ "required": [
485
+ "badgeId",
486
+ "kind",
487
+ "name",
488
+ "description",
489
+ "image",
490
+ "repeatable",
491
+ "listed",
492
+ "state",
493
+ "createdAt"
494
+ ],
495
+ "properties": {
496
+ "badgeId": {
497
+ "$ref": "#/$defs/BadgeId"
498
+ },
499
+ "kind": {
500
+ "$ref": "#/$defs/BadgeKind"
501
+ },
502
+ "name": {
503
+ "$ref": "#/$defs/BadgeName"
504
+ },
505
+ "description": {
506
+ "$ref": "#/$defs/BadgeDescription"
507
+ },
508
+ "criteria": {
509
+ "$ref": "#/$defs/BadgeCriteria"
510
+ },
511
+ "image": {
512
+ "$ref": "#/$defs/CardBlobRef",
513
+ "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."
514
+ },
515
+ "repeatable": {
516
+ "type": "boolean",
517
+ "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."
518
+ },
519
+ "requestable": {
520
+ "type": "boolean",
521
+ "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."
522
+ },
523
+ "listed": {
524
+ "type": "boolean",
525
+ "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."
526
+ },
527
+ "shareableOutside": {
528
+ "type": "boolean",
529
+ "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."
530
+ },
531
+ "groupId": {
532
+ "$ref": "#/$defs/GroupId",
533
+ "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."
534
+ },
535
+ "state": {
536
+ "$ref": "#/$defs/BadgeState"
537
+ },
538
+ "holderCount": {
539
+ "type": "integer",
540
+ "minimum": 0,
541
+ "description": "Holders who show the badge. Only to callers who may see the holders."
542
+ },
543
+ "createdAt": {
544
+ "type": "string",
545
+ "format": "date-time"
546
+ },
547
+ "createdBy": {
548
+ "$ref": "#/$defs/EntryId"
549
+ },
550
+ "updatedAt": {
551
+ "type": "string",
552
+ "format": "date-time"
553
+ },
554
+ "retiredAt": {
555
+ "type": "string",
556
+ "format": "date-time"
557
+ },
558
+ "ext": {
559
+ "$ref": "#/$defs/Ext",
560
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1. An extension member MUST NOT carry authority."
561
+ }
562
+ }
563
+ },
564
+ "BadgeState": {
565
+ "title": "BadgeState",
566
+ "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).",
567
+ "type": "string",
568
+ "enum": [
569
+ "active",
570
+ "retired"
571
+ ]
572
+ },
573
+ "BadgeCriteria": {
574
+ "title": "BadgeCriteria",
575
+ "type": "string",
576
+ "minLength": 1,
577
+ "maxLength": 1000,
578
+ "description": "How the badge is earned, shown to members and written into the credential's Achievement as its criteria narrative. Plain text."
579
+ },
580
+ "BadgeDescription": {
581
+ "title": "BadgeDescription",
582
+ "type": "string",
583
+ "minLength": 1,
584
+ "maxLength": 1000,
585
+ "description": "What the badge is for. Plain text; a reader MUST NOT treat it as instructions."
586
+ },
587
+ "BadgeName": {
588
+ "title": "BadgeName",
589
+ "type": "string",
590
+ "minLength": 1,
591
+ "maxLength": 64,
592
+ "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."
593
+ },
594
+ "BadgeKind": {
595
+ "title": "BadgeKind",
596
+ "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).",
597
+ "type": "string",
598
+ "enum": [
599
+ "community",
600
+ "kudos"
601
+ ]
602
+ },
603
+ "BadgeId": {
604
+ "title": "BadgeId",
605
+ "description": "Opaque identifier of a badge: `bdg_` followed by 16 to 64 base64url characters. Random, community-scoped, never reused (VTI-BDG-001).",
606
+ "type": "string",
607
+ "pattern": "^bdg_[A-Za-z0-9_-]{16,64}$"
608
+ },
609
+ "EntryId": {
610
+ "title": "EntryId",
611
+ "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.",
612
+ "type": "string",
613
+ "pattern": "^dir_[A-Za-z0-9_-]{16,64}$"
614
+ },
615
+ "GroupId": {
616
+ "title": "GroupId",
617
+ "description": "Opaque identifier of a community group: `grp_` followed by 16 to 64 base64url characters. Random and community-scoped; not the group's DID.",
618
+ "type": "string",
619
+ "pattern": "^grp_[A-Za-z0-9_-]{16,64}$"
620
+ },
621
+ "CardBlobRef": {
622
+ "title": "CardBlobRef",
623
+ "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.",
624
+ "type": "object",
625
+ "additionalProperties": false,
626
+ "required": [
627
+ "sha256",
628
+ "mediaType"
629
+ ],
630
+ "properties": {
631
+ "sha256": {
632
+ "type": "string",
633
+ "pattern": "^[0-9a-f]{64}$",
634
+ "description": "Lowercase hex SHA-256 of the stored, re-encoded bytes."
635
+ },
636
+ "mediaType": {
637
+ "type": "string",
638
+ "enum": [
639
+ "image/png",
640
+ "image/jpeg",
641
+ "image/webp",
642
+ "image/avif"
643
+ ],
644
+ "description": "Media type of the stored bytes."
645
+ },
646
+ "size": {
647
+ "type": "integer",
648
+ "minimum": 1,
649
+ "maximum": 262144,
650
+ "description": "Size in bytes of the stored bytes."
651
+ },
652
+ "url": {
653
+ "type": "string",
654
+ "format": "uri",
655
+ "maxLength": 2048,
656
+ "description": "Projection only: a URL the viewer can fetch the image from until `urlExpiresAt`."
657
+ },
658
+ "urlExpiresAt": {
659
+ "type": "string",
660
+ "format": "date-time",
661
+ "description": "Projection only: when `url` stops working."
662
+ }
663
+ }
664
+ }
665
+ }
666
+ } as const;
667
+
668
+ /**
669
+ * SPEC.md §7.2 policy for the request variant, from this specification's
670
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
671
+ * per-specification and cannot be derived from the document alone, and
672
+ * item 2 needs the schema this carries.
673
+ */
674
+ export const SPEC = {
675
+ typeUri: TYPE_URI,
676
+ isBearer: false,
677
+ isProofRequired: true,
678
+ isRecipientRequired: true,
679
+ isIssuedAtRequired: false,
680
+ payloadSchema: PAYLOAD_SCHEMA,
681
+ } as const;
682
+
683
+ /**
684
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
685
+ * tracks the *issuer* party's requirement because a response swaps the
686
+ * parties (§7.3 item 5).
687
+ */
688
+ export const RESPONSE_SPEC = {
689
+ typeUri: RESPONSE_TYPE_URI,
690
+ isBearer: false,
691
+ isProofRequired: true,
692
+ isRecipientRequired: true,
693
+ isIssuedAtRequired: false,
694
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
695
+ } as const;