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