@openvtc/trust-tasks 0.26.20 → 0.26.22

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 (221) hide show
  1. package/CHANGELOG.md +84 -0
  2. package/dist/_shared/components.d.ts +328 -17
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/device/list/0.1/payload.d.ts +4 -4
  5. package/dist/device/list/0.1/payload.d.ts.map +1 -1
  6. package/dist/device/list/0.1/payload.js +4 -2
  7. package/dist/device/list/0.1/payload.js.map +1 -1
  8. package/dist/device/list/0.2/payload.d.ts +4 -4
  9. package/dist/device/list/0.2/payload.d.ts.map +1 -1
  10. package/dist/device/list/0.2/payload.js +4 -2
  11. package/dist/device/list/0.2/payload.js.map +1 -1
  12. package/dist/device/register/0.1/payload.d.ts +4 -4
  13. package/dist/device/register/0.1/payload.d.ts.map +1 -1
  14. package/dist/device/register/0.1/payload.js +4 -2
  15. package/dist/device/register/0.1/payload.js.map +1 -1
  16. package/dist/device/register/0.2/payload.d.ts +4 -4
  17. package/dist/device/register/0.2/payload.d.ts.map +1 -1
  18. package/dist/device/register/0.2/payload.js +4 -2
  19. package/dist/device/register/0.2/payload.js.map +1 -1
  20. package/dist/index.d.ts +24 -0
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +24 -0
  23. package/dist/index.js.map +1 -1
  24. package/dist/voting/_shared/0.1/voting.d.ts +16 -0
  25. package/dist/voting/_shared/0.1/voting.d.ts.map +1 -0
  26. package/dist/voting/_shared/0.1/voting.js +6 -0
  27. package/dist/voting/_shared/0.1/voting.js.map +1 -0
  28. package/dist/voting/ballot/cast/0.1/payload.d.ts +887 -0
  29. package/dist/voting/ballot/cast/0.1/payload.d.ts.map +1 -0
  30. package/dist/voting/ballot/cast/0.1/payload.js +506 -0
  31. package/dist/voting/ballot/cast/0.1/payload.js.map +1 -0
  32. package/dist/voting/board/consistency/0.1/payload.d.ts +389 -0
  33. package/dist/voting/board/consistency/0.1/payload.d.ts.map +1 -0
  34. package/dist/voting/board/consistency/0.1/payload.js +218 -0
  35. package/dist/voting/board/consistency/0.1/payload.js.map +1 -0
  36. package/dist/voting/board/head/0.1/payload.d.ts +380 -0
  37. package/dist/voting/board/head/0.1/payload.d.ts.map +1 -0
  38. package/dist/voting/board/head/0.1/payload.js +224 -0
  39. package/dist/voting/board/head/0.1/payload.js.map +1 -0
  40. package/dist/voting/board/inclusion/0.1/payload.d.ts +449 -0
  41. package/dist/voting/board/inclusion/0.1/payload.d.ts.map +1 -0
  42. package/dist/voting/board/inclusion/0.1/payload.js +246 -0
  43. package/dist/voting/board/inclusion/0.1/payload.js.map +1 -0
  44. package/dist/voting/board/read/0.1/payload.d.ts +1596 -0
  45. package/dist/voting/board/read/0.1/payload.d.ts.map +1 -0
  46. package/dist/voting/board/read/0.1/payload.js +920 -0
  47. package/dist/voting/board/read/0.1/payload.js.map +1 -0
  48. package/dist/voting/election/cancel/0.1/payload.d.ts +540 -0
  49. package/dist/voting/election/cancel/0.1/payload.d.ts.map +1 -0
  50. package/dist/voting/election/cancel/0.1/payload.js +331 -0
  51. package/dist/voting/election/cancel/0.1/payload.js.map +1 -0
  52. package/dist/voting/election/close/0.1/payload.d.ts +540 -0
  53. package/dist/voting/election/close/0.1/payload.d.ts.map +1 -0
  54. package/dist/voting/election/close/0.1/payload.js +330 -0
  55. package/dist/voting/election/close/0.1/payload.js.map +1 -0
  56. package/dist/voting/election/register/0.1/payload.d.ts +1920 -0
  57. package/dist/voting/election/register/0.1/payload.d.ts.map +1 -0
  58. package/dist/voting/election/register/0.1/payload.js +1166 -0
  59. package/dist/voting/election/register/0.1/payload.js.map +1 -0
  60. package/dist/voting/election/show/0.1/payload.d.ts +1824 -0
  61. package/dist/voting/election/show/0.1/payload.d.ts.map +1 -0
  62. package/dist/voting/election/show/0.1/payload.js +1112 -0
  63. package/dist/voting/election/show/0.1/payload.js.map +1 -0
  64. package/dist/voting/result/show/0.1/payload.d.ts +849 -0
  65. package/dist/voting/result/show/0.1/payload.d.ts.map +1 -0
  66. package/dist/voting/result/show/0.1/payload.js +498 -0
  67. package/dist/voting/result/show/0.1/payload.js.map +1 -0
  68. package/dist/vta/_shared/0.1/app-state-record.d.ts +1 -1
  69. package/dist/vta/_shared/0.1/app-state-record.d.ts.map +1 -1
  70. package/dist/vta/_shared/0.4/pcs-engine.d.ts +1 -1
  71. package/dist/vta/_shared/0.4/pcs-engine.d.ts.map +1 -1
  72. package/dist/vta/app-state/delete/1.0/payload.d.ts +1 -1
  73. package/dist/vta/app-state/delete/1.0/payload.d.ts.map +1 -1
  74. package/dist/vta/app-state/get/1.0/payload.d.ts +1 -1
  75. package/dist/vta/app-state/get/1.0/payload.d.ts.map +1 -1
  76. package/dist/vta/app-state/get-many/1.0/payload.d.ts +1 -1
  77. package/dist/vta/app-state/get-many/1.0/payload.d.ts.map +1 -1
  78. package/dist/vta/app-state/list/1.0/payload.d.ts +1 -1
  79. package/dist/vta/app-state/list/1.0/payload.d.ts.map +1 -1
  80. package/dist/vta/app-state/put/1.0/payload.d.ts +1 -1
  81. package/dist/vta/app-state/put/1.0/payload.d.ts.map +1 -1
  82. package/dist/vta/app-state/put-many/1.0/payload.d.ts +1 -1
  83. package/dist/vta/app-state/put-many/1.0/payload.d.ts.map +1 -1
  84. package/dist/vta/pcs/applications/create/0.1/payload.d.ts +1 -1
  85. package/dist/vta/pcs/applications/create/0.1/payload.d.ts.map +1 -1
  86. package/dist/vta/pcs/applications/show/0.1/payload.d.ts +1 -1
  87. package/dist/vta/pcs/applications/show/0.1/payload.d.ts.map +1 -1
  88. package/dist/vta/pcs/attest/0.1/payload.d.ts +1 -1
  89. package/dist/vta/pcs/attest/0.1/payload.d.ts.map +1 -1
  90. package/dist/vta/pcs/prove/0.1/payload.d.ts +1 -1
  91. package/dist/vta/pcs/prove/0.1/payload.d.ts.map +1 -1
  92. package/dist/vta/pcs/root-accept/0.1/payload.d.ts +1 -1
  93. package/dist/vta/pcs/root-accept/0.1/payload.d.ts.map +1 -1
  94. package/dist/vta/pcs/tokens/abandon/0.1/payload.d.ts +1 -1
  95. package/dist/vta/pcs/tokens/abandon/0.1/payload.d.ts.map +1 -1
  96. package/dist/vta/pcs/tokens/accept/0.1/payload.d.ts +1 -1
  97. package/dist/vta/pcs/tokens/accept/0.1/payload.d.ts.map +1 -1
  98. package/dist/vta/pcs/verify-attestation/0.1/payload.d.ts +1 -1
  99. package/dist/vta/pcs/verify-attestation/0.1/payload.d.ts.map +1 -1
  100. package/dist/vta/pcs/vetter/show/0.1/payload.d.ts +1 -1
  101. package/dist/vta/pcs/vetter/show/0.1/payload.d.ts.map +1 -1
  102. package/dist/vta/pcs/vote/0.1/payload.d.ts +2208 -0
  103. package/dist/vta/pcs/vote/0.1/payload.d.ts.map +1 -0
  104. package/dist/vta/pcs/vote/0.1/payload.js +1282 -0
  105. package/dist/vta/pcs/vote/0.1/payload.js.map +1 -0
  106. package/dist/vta/pcs/voter/accept/0.1/payload.d.ts +450 -0
  107. package/dist/vta/pcs/voter/accept/0.1/payload.d.ts.map +1 -0
  108. package/dist/vta/pcs/voter/accept/0.1/payload.js +247 -0
  109. package/dist/vta/pcs/voter/accept/0.1/payload.js.map +1 -0
  110. package/dist/vta/pcs/voter/receipt/0.1/payload.d.ts +531 -0
  111. package/dist/vta/pcs/voter/receipt/0.1/payload.d.ts.map +1 -0
  112. package/dist/vta/pcs/voter/receipt/0.1/payload.js +301 -0
  113. package/dist/vta/pcs/voter/receipt/0.1/payload.js.map +1 -0
  114. package/dist/vta/pcs/voter/register/0.1/payload.d.ts +1934 -0
  115. package/dist/vta/pcs/voter/register/0.1/payload.d.ts.map +1 -0
  116. package/dist/vta/pcs/voter/register/0.1/payload.js +1133 -0
  117. package/dist/vta/pcs/voter/register/0.1/payload.js.map +1 -0
  118. package/dist/vtc/directory/card/present/0.1/payload.d.ts +2 -2
  119. package/dist/vtc/directory/card/present/0.1/payload.js +1 -1
  120. package/dist/vtc/directory/card/present/0.1/payload.js.map +1 -1
  121. package/dist/vtc/elections/cancel/0.1/payload.d.ts +301 -0
  122. package/dist/vtc/elections/cancel/0.1/payload.d.ts.map +1 -0
  123. package/dist/vtc/elections/cancel/0.1/payload.js +183 -0
  124. package/dist/vtc/elections/cancel/0.1/payload.js.map +1 -0
  125. package/dist/vtc/elections/certify/0.1/payload.d.ts +914 -0
  126. package/dist/vtc/elections/certify/0.1/payload.d.ts.map +1 -0
  127. package/dist/vtc/elections/certify/0.1/payload.js +512 -0
  128. package/dist/vtc/elections/certify/0.1/payload.js.map +1 -0
  129. package/dist/vtc/elections/close/0.1/payload.d.ts +301 -0
  130. package/dist/vtc/elections/close/0.1/payload.d.ts.map +1 -0
  131. package/dist/vtc/elections/close/0.1/payload.js +182 -0
  132. package/dist/vtc/elections/close/0.1/payload.js.map +1 -0
  133. package/dist/vtc/elections/create/0.1/payload.d.ts +1656 -0
  134. package/dist/vtc/elections/create/0.1/payload.d.ts.map +1 -0
  135. package/dist/vtc/elections/create/0.1/payload.js +994 -0
  136. package/dist/vtc/elections/create/0.1/payload.js.map +1 -0
  137. package/dist/vtc/elections/list/0.1/payload.d.ts +521 -0
  138. package/dist/vtc/elections/list/0.1/payload.d.ts.map +1 -0
  139. package/dist/vtc/elections/list/0.1/payload.js +290 -0
  140. package/dist/vtc/elections/list/0.1/payload.js.map +1 -0
  141. package/dist/vtc/elections/show/0.1/payload.d.ts +2688 -0
  142. package/dist/vtc/elections/show/0.1/payload.d.ts.map +1 -0
  143. package/dist/vtc/elections/show/0.1/payload.js +1581 -0
  144. package/dist/vtc/elections/show/0.1/payload.js.map +1 -0
  145. package/dist/vtc/elections/tickets/issue/0.1/payload.d.ts +597 -0
  146. package/dist/vtc/elections/tickets/issue/0.1/payload.d.ts.map +1 -0
  147. package/dist/vtc/elections/tickets/issue/0.1/payload.js +318 -0
  148. package/dist/vtc/elections/tickets/issue/0.1/payload.js.map +1 -0
  149. package/dist/vtc/groups/create/0.1/payload.d.ts +4 -4
  150. package/dist/vtc/groups/create/0.1/payload.js +2 -2
  151. package/dist/vtc/groups/create/0.1/payload.js.map +1 -1
  152. package/dist/vtc/groups/list/0.1/payload.d.ts +4 -4
  153. package/dist/vtc/groups/list/0.1/payload.js +2 -2
  154. package/dist/vtc/groups/list/0.1/payload.js.map +1 -1
  155. package/dist/vtc/groups/managers/add/0.1/payload.d.ts +337 -0
  156. package/dist/vtc/groups/managers/add/0.1/payload.d.ts.map +1 -0
  157. package/dist/vtc/groups/managers/add/0.1/payload.js +184 -0
  158. package/dist/vtc/groups/managers/add/0.1/payload.js.map +1 -0
  159. package/dist/vtc/groups/managers/remove/0.1/payload.d.ts +337 -0
  160. package/dist/vtc/groups/managers/remove/0.1/payload.d.ts.map +1 -0
  161. package/dist/vtc/groups/managers/remove/0.1/payload.js +184 -0
  162. package/dist/vtc/groups/managers/remove/0.1/payload.js.map +1 -0
  163. package/dist/vtc/groups/show/0.1/payload.d.ts +4 -4
  164. package/dist/vtc/groups/show/0.1/payload.js +2 -2
  165. package/dist/vtc/groups/show/0.1/payload.js.map +1 -1
  166. package/dist/vtc/groups/update/0.1/payload.d.ts +4 -4
  167. package/dist/vtc/groups/update/0.1/payload.js +2 -2
  168. package/dist/vtc/groups/update/0.1/payload.js.map +1 -1
  169. package/package.json +1 -1
  170. package/src/_shared/components.ts +332 -17
  171. package/src/device/list/0.1/payload.ts +4 -2
  172. package/src/device/list/0.2/payload.ts +4 -2
  173. package/src/device/register/0.1/payload.ts +4 -2
  174. package/src/device/register/0.2/payload.ts +4 -2
  175. package/src/index.ts +24 -0
  176. package/src/voting/_shared/0.1/voting.ts +17 -0
  177. package/src/voting/ballot/cast/0.1/payload.ts +560 -0
  178. package/src/voting/board/consistency/0.1/payload.ts +264 -0
  179. package/src/voting/board/head/0.1/payload.ts +257 -0
  180. package/src/voting/board/inclusion/0.1/payload.ts +300 -0
  181. package/src/voting/board/read/0.1/payload.ts +981 -0
  182. package/src/voting/election/cancel/0.1/payload.ts +368 -0
  183. package/src/voting/election/close/0.1/payload.ts +367 -0
  184. package/src/voting/election/register/0.1/payload.ts +1207 -0
  185. package/src/voting/election/show/0.1/payload.ts +1149 -0
  186. package/src/voting/result/show/0.1/payload.ts +536 -0
  187. package/src/vta/_shared/0.1/app-state-record.ts +1 -1
  188. package/src/vta/_shared/0.4/pcs-engine.ts +1 -1
  189. package/src/vta/app-state/delete/1.0/payload.ts +1 -1
  190. package/src/vta/app-state/get/1.0/payload.ts +1 -1
  191. package/src/vta/app-state/get-many/1.0/payload.ts +1 -1
  192. package/src/vta/app-state/list/1.0/payload.ts +1 -1
  193. package/src/vta/app-state/put/1.0/payload.ts +1 -1
  194. package/src/vta/app-state/put-many/1.0/payload.ts +1 -1
  195. package/src/vta/pcs/applications/create/0.1/payload.ts +1 -1
  196. package/src/vta/pcs/applications/show/0.1/payload.ts +1 -1
  197. package/src/vta/pcs/attest/0.1/payload.ts +1 -1
  198. package/src/vta/pcs/prove/0.1/payload.ts +1 -1
  199. package/src/vta/pcs/root-accept/0.1/payload.ts +1 -1
  200. package/src/vta/pcs/tokens/abandon/0.1/payload.ts +1 -1
  201. package/src/vta/pcs/tokens/accept/0.1/payload.ts +1 -1
  202. package/src/vta/pcs/verify-attestation/0.1/payload.ts +1 -1
  203. package/src/vta/pcs/vetter/show/0.1/payload.ts +1 -1
  204. package/src/vta/pcs/vote/0.1/payload.ts +1365 -0
  205. package/src/vta/pcs/voter/accept/0.1/payload.ts +306 -0
  206. package/src/vta/pcs/voter/receipt/0.1/payload.ts +367 -0
  207. package/src/vta/pcs/voter/register/0.1/payload.ts +1211 -0
  208. package/src/vtc/directory/card/present/0.1/payload.ts +1 -1
  209. package/src/vtc/elections/cancel/0.1/payload.ts +223 -0
  210. package/src/vtc/elections/certify/0.1/payload.ts +565 -0
  211. package/src/vtc/elections/close/0.1/payload.ts +222 -0
  212. package/src/vtc/elections/create/0.1/payload.ts +1041 -0
  213. package/src/vtc/elections/list/0.1/payload.ts +371 -0
  214. package/src/vtc/elections/show/0.1/payload.ts +1671 -0
  215. package/src/vtc/elections/tickets/issue/0.1/payload.ts +394 -0
  216. package/src/vtc/groups/create/0.1/payload.ts +2 -2
  217. package/src/vtc/groups/list/0.1/payload.ts +2 -2
  218. package/src/vtc/groups/managers/add/0.1/payload.ts +230 -0
  219. package/src/vtc/groups/managers/remove/0.1/payload.ts +230 -0
  220. package/src/vtc/groups/show/0.1/payload.ts +2 -2
  221. package/src/vtc/groups/update/0.1/payload.ts +2 -2
@@ -0,0 +1,1112 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/voting/election/show/0.1/payload.schema.json
4
+ */
5
+ /** Trust Task type URI. */
6
+ export const TYPE_URI = "https://trusttasks.org/spec/voting/election/show/0.1";
7
+ /** Trust Task response type URI (request type URI + "#response"). */
8
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/voting/election/show/0.1#response";
9
+ /**
10
+ * This specification's payload schema, as a value.
11
+ *
12
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
13
+ * rather than only as a `.json` file because TypeScript types are erased
14
+ * at runtime: without a schema a consumer has nothing to validate, and
15
+ * every REQUIRED payload member is optional in practice. Cross-file
16
+ * `$ref`s are already inlined, so it needs no resolver.
17
+ */
18
+ export const PAYLOAD_SCHEMA = {
19
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
20
+ "$id": "https://trusttasks.org/spec/voting/election/show/0.1",
21
+ "title": "Voting — Election Show — payload",
22
+ "description": "Reads one election at its ballot box: its state, manifest digest, admitted count and current head, and the manifest where the caller may read the board.",
23
+ "type": "object",
24
+ "additionalProperties": false,
25
+ "required": [
26
+ "community",
27
+ "electionId"
28
+ ],
29
+ "properties": {
30
+ "community": {
31
+ "type": "string",
32
+ "minLength": 1,
33
+ "maxLength": 2048,
34
+ "description": "The community's DID."
35
+ },
36
+ "electionId": {
37
+ "$ref": "#/$defs/ElectionId"
38
+ },
39
+ "ext": {
40
+ "$ref": "#/$defs/Ext"
41
+ }
42
+ },
43
+ "$defs": {
44
+ "Response": {
45
+ "$anchor": "response",
46
+ "title": "Voting — Election Show — response payload",
47
+ "type": "object",
48
+ "additionalProperties": false,
49
+ "required": [
50
+ "election"
51
+ ],
52
+ "properties": {
53
+ "election": {
54
+ "$ref": "#/$defs/ElectionSummary"
55
+ },
56
+ "manifest": {
57
+ "$ref": "#/$defs/Manifest",
58
+ "description": "The registered manifest, exactly as registered. Present when the board is public or the caller may read the private board."
59
+ },
60
+ "ext": {
61
+ "$ref": "#/$defs/Ext"
62
+ }
63
+ }
64
+ },
65
+ "Ext": {
66
+ "title": "Ext",
67
+ "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.",
68
+ "type": "object",
69
+ "minProperties": 1,
70
+ "additionalProperties": true,
71
+ "propertyNames": {
72
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
73
+ }
74
+ },
75
+ "Manifest": {
76
+ "title": "Manifest",
77
+ "description": "What an election asks and how it is decided (VTI-VOT-010). Its digest (`manifestDigest`) is the SHA-256 multihash of its RFC 8785 (JCS) canonicalization, and every cast is bound to it (VTI-VOT-011).",
78
+ "type": "object",
79
+ "additionalProperties": false,
80
+ "required": [
81
+ "electionId",
82
+ "community",
83
+ "questions",
84
+ "secrecy",
85
+ "roll",
86
+ "registrationOpens",
87
+ "votingOpens",
88
+ "votingCloses",
89
+ "revote",
90
+ "board",
91
+ "ballotBox",
92
+ "binding",
93
+ "allowEarlyClose",
94
+ "resultsBeforeClose",
95
+ "textReleaseThreshold"
96
+ ],
97
+ "properties": {
98
+ "electionId": {
99
+ "$ref": "#/$defs/ElectionId"
100
+ },
101
+ "community": {
102
+ "type": "string",
103
+ "minLength": 1,
104
+ "maxLength": 2048,
105
+ "description": "The community's DID."
106
+ },
107
+ "title": {
108
+ "type": "string",
109
+ "maxLength": 512
110
+ },
111
+ "description": {
112
+ "type": "string",
113
+ "maxLength": 8192
114
+ },
115
+ "questions": {
116
+ "type": "array",
117
+ "minItems": 1,
118
+ "maxItems": 128,
119
+ "items": {
120
+ "$ref": "#/$defs/Question"
121
+ }
122
+ },
123
+ "secrecy": {
124
+ "$ref": "#/$defs/SecrecyLevel"
125
+ },
126
+ "roll": {
127
+ "$ref": "#/$defs/RollRule"
128
+ },
129
+ "registrationOpens": {
130
+ "type": "string",
131
+ "format": "date-time"
132
+ },
133
+ "votingOpens": {
134
+ "type": "string",
135
+ "format": "date-time"
136
+ },
137
+ "votingCloses": {
138
+ "type": "string",
139
+ "format": "date-time"
140
+ },
141
+ "revote": {
142
+ "$ref": "#/$defs/Revote"
143
+ },
144
+ "board": {
145
+ "type": "object",
146
+ "additionalProperties": false,
147
+ "required": [
148
+ "visibility",
149
+ "auditors"
150
+ ],
151
+ "properties": {
152
+ "visibility": {
153
+ "$ref": "#/$defs/BoardVisibility"
154
+ },
155
+ "auditors": {
156
+ "type": "array",
157
+ "items": {
158
+ "type": "string",
159
+ "minLength": 1,
160
+ "maxLength": 2048
161
+ },
162
+ "uniqueItems": true
163
+ }
164
+ }
165
+ },
166
+ "ballotBox": {
167
+ "type": "string",
168
+ "minLength": 1,
169
+ "maxLength": 2048,
170
+ "description": "The DID of the voting service that holds the board."
171
+ },
172
+ "trustees": {
173
+ "$ref": "#/$defs/Trustees"
174
+ },
175
+ "binding": {
176
+ "type": "boolean",
177
+ "description": "Whether the community treats the result as deciding something; creating a binding election takes another administrator's consent (VTI-VOT-081)."
178
+ },
179
+ "allowEarlyClose": {
180
+ "type": "boolean"
181
+ },
182
+ "resultsBeforeClose": {
183
+ "type": "boolean",
184
+ "description": "Open elections only: whether running totals may be read while voting is open (VTI-VOT-061)."
185
+ },
186
+ "textReleaseThreshold": {
187
+ "type": "integer",
188
+ "minimum": 10,
189
+ "description": "Counted ballots required before any text answer is disclosed (VTI-VOT-065)."
190
+ }
191
+ }
192
+ },
193
+ "Trustees": {
194
+ "title": "Trustees",
195
+ "description": "The trustees of a sealed or tallied-encrypted election and the number of them decryption needs (VTI-VOT-062). Neither the community nor the ballot box may be one.",
196
+ "type": "object",
197
+ "additionalProperties": false,
198
+ "required": [
199
+ "dids",
200
+ "threshold"
201
+ ],
202
+ "properties": {
203
+ "dids": {
204
+ "type": "array",
205
+ "minItems": 2,
206
+ "items": {
207
+ "type": "string",
208
+ "minLength": 1,
209
+ "maxLength": 2048
210
+ },
211
+ "uniqueItems": true
212
+ },
213
+ "threshold": {
214
+ "type": "integer",
215
+ "minimum": 2
216
+ }
217
+ }
218
+ },
219
+ "BoardVisibility": {
220
+ "title": "BoardVisibility",
221
+ "description": "`public`: anyone reads the board. `private`: the community, the auditors the manifest names and, for one cast's inclusion, the holder of its receipt (VTI-VOT-052).",
222
+ "type": "string",
223
+ "enum": [
224
+ "public",
225
+ "private"
226
+ ]
227
+ },
228
+ "Revote": {
229
+ "title": "Revote",
230
+ "description": "What a later, different ballot under one ticket does: `replace` the earlier one, or be refused (`refuse`) (VTI-VOT-041).",
231
+ "type": "string",
232
+ "enum": [
233
+ "replace",
234
+ "refuse"
235
+ ]
236
+ },
237
+ "RollRule": {
238
+ "title": "RollRule",
239
+ "description": "Who may be issued a ticket (VTI-VOT-021): the community's active members, its active members and the parties `listed` names, or only the parties `listed` names.",
240
+ "type": "object",
241
+ "additionalProperties": false,
242
+ "required": [
243
+ "rule"
244
+ ],
245
+ "properties": {
246
+ "rule": {
247
+ "type": "string",
248
+ "enum": [
249
+ "members",
250
+ "membersAndListed",
251
+ "listed"
252
+ ]
253
+ },
254
+ "listed": {
255
+ "type": "array",
256
+ "items": {
257
+ "type": "string",
258
+ "minLength": 1,
259
+ "maxLength": 2048,
260
+ "description": "A DID enfranchised by name."
261
+ },
262
+ "uniqueItems": true
263
+ }
264
+ }
265
+ },
266
+ "SecrecyLevel": {
267
+ "title": "SecrecyLevel",
268
+ "description": "`open`: ballots are recorded on the board as cast. `sealed`: ballots are encrypted to a jointly generated election key and decrypted after voting closes. `talliedEncrypted`: ballots are encrypted and only the totals are ever decrypted (VTI-VOT-060). Version 0.1 of the voting tasks carries open ballots only; a ballot box refuses to register any other level with `voting/election/register:unsupportedSecrecy` until the trustee tasks are specified.",
269
+ "type": "string",
270
+ "enum": [
271
+ "open",
272
+ "sealed",
273
+ "talliedEncrypted"
274
+ ]
275
+ },
276
+ "Question": {
277
+ "title": "Question",
278
+ "description": "One question. Tagged union over `type`.",
279
+ "oneOf": [
280
+ {
281
+ "title": "ChoiceQuestion",
282
+ "description": "Select between `minSelections` and `maxSelections` of `options`. A yes/no/abstain motion is a choice of exactly one of three.",
283
+ "type": "object",
284
+ "additionalProperties": false,
285
+ "required": [
286
+ "key",
287
+ "type",
288
+ "options",
289
+ "minSelections",
290
+ "maxSelections",
291
+ "optional"
292
+ ],
293
+ "properties": {
294
+ "key": {
295
+ "$ref": "#/$defs/Key"
296
+ },
297
+ "type": {
298
+ "const": "choice"
299
+ },
300
+ "text": {
301
+ "type": "string",
302
+ "maxLength": 2048
303
+ },
304
+ "options": {
305
+ "type": "array",
306
+ "minItems": 2,
307
+ "maxItems": 256,
308
+ "items": {
309
+ "$ref": "#/$defs/QuestionOption"
310
+ }
311
+ },
312
+ "minSelections": {
313
+ "type": "integer",
314
+ "minimum": 0
315
+ },
316
+ "maxSelections": {
317
+ "type": "integer",
318
+ "minimum": 1
319
+ },
320
+ "optional": {
321
+ "type": "boolean"
322
+ }
323
+ }
324
+ },
325
+ {
326
+ "title": "RankingQuestion",
327
+ "description": "Order `options`; a ballot ranks every option or, when `partial` is true, a prefix of them.",
328
+ "type": "object",
329
+ "additionalProperties": false,
330
+ "required": [
331
+ "key",
332
+ "type",
333
+ "options",
334
+ "partial",
335
+ "optional"
336
+ ],
337
+ "properties": {
338
+ "key": {
339
+ "$ref": "#/$defs/Key"
340
+ },
341
+ "type": {
342
+ "const": "ranking"
343
+ },
344
+ "text": {
345
+ "type": "string",
346
+ "maxLength": 2048
347
+ },
348
+ "options": {
349
+ "type": "array",
350
+ "minItems": 2,
351
+ "maxItems": 64,
352
+ "items": {
353
+ "$ref": "#/$defs/QuestionOption"
354
+ }
355
+ },
356
+ "partial": {
357
+ "type": "boolean"
358
+ },
359
+ "optional": {
360
+ "type": "boolean"
361
+ }
362
+ }
363
+ },
364
+ {
365
+ "title": "ScoreQuestion",
366
+ "description": "Give each option an integer score within [min, max].",
367
+ "type": "object",
368
+ "additionalProperties": false,
369
+ "required": [
370
+ "key",
371
+ "type",
372
+ "options",
373
+ "min",
374
+ "max",
375
+ "optional"
376
+ ],
377
+ "properties": {
378
+ "key": {
379
+ "$ref": "#/$defs/Key"
380
+ },
381
+ "type": {
382
+ "const": "score"
383
+ },
384
+ "text": {
385
+ "type": "string",
386
+ "maxLength": 2048
387
+ },
388
+ "options": {
389
+ "type": "array",
390
+ "minItems": 1,
391
+ "maxItems": 256,
392
+ "items": {
393
+ "$ref": "#/$defs/QuestionOption"
394
+ }
395
+ },
396
+ "min": {
397
+ "type": "integer"
398
+ },
399
+ "max": {
400
+ "type": "integer"
401
+ },
402
+ "optional": {
403
+ "type": "boolean"
404
+ }
405
+ }
406
+ },
407
+ {
408
+ "title": "TextQuestion",
409
+ "description": "Free text of at most `maxLength` characters.",
410
+ "type": "object",
411
+ "additionalProperties": false,
412
+ "required": [
413
+ "key",
414
+ "type",
415
+ "maxLength",
416
+ "optional"
417
+ ],
418
+ "properties": {
419
+ "key": {
420
+ "$ref": "#/$defs/Key"
421
+ },
422
+ "type": {
423
+ "const": "text"
424
+ },
425
+ "text": {
426
+ "type": "string",
427
+ "maxLength": 2048
428
+ },
429
+ "maxLength": {
430
+ "type": "integer",
431
+ "minimum": 1,
432
+ "maximum": 4096
433
+ },
434
+ "optional": {
435
+ "type": "boolean"
436
+ }
437
+ }
438
+ }
439
+ ]
440
+ },
441
+ "Key": {
442
+ "title": "Key",
443
+ "description": "A question or option key, unique within its manifest or question.",
444
+ "type": "string",
445
+ "pattern": "^[A-Za-z0-9._-]{1,64}$"
446
+ },
447
+ "QuestionOption": {
448
+ "title": "QuestionOption",
449
+ "type": "object",
450
+ "additionalProperties": false,
451
+ "required": [
452
+ "key"
453
+ ],
454
+ "properties": {
455
+ "key": {
456
+ "$ref": "#/$defs/Key"
457
+ },
458
+ "label": {
459
+ "type": "string",
460
+ "maxLength": 512,
461
+ "description": "Display text. Absent from a manifest registered with a ballot box that holds no question text (VTI-VOT-014)."
462
+ }
463
+ }
464
+ },
465
+ "ElectionId": {
466
+ "title": "ElectionId",
467
+ "description": "An election's identifier, unique within its community. A closed alphabet: it appears in the ticket class label `voter/<electionId>` and is framed into every hash a cast is bound to.",
468
+ "type": "string",
469
+ "pattern": "^[A-Za-z0-9._-]{1,128}$"
470
+ },
471
+ "ElectionSummary": {
472
+ "title": "ElectionSummary",
473
+ "description": "A ballot box's view of one election.",
474
+ "type": "object",
475
+ "additionalProperties": false,
476
+ "required": [
477
+ "electionId",
478
+ "community",
479
+ "manifestDigest",
480
+ "state",
481
+ "ballotsAdmitted",
482
+ "head"
483
+ ],
484
+ "properties": {
485
+ "electionId": {
486
+ "$ref": "#/$defs/ElectionId"
487
+ },
488
+ "community": {
489
+ "type": "string",
490
+ "minLength": 1,
491
+ "maxLength": 2048
492
+ },
493
+ "manifestDigest": {
494
+ "$ref": "#/$defs/DigestMultibase"
495
+ },
496
+ "state": {
497
+ "$ref": "#/$defs/ElectionState"
498
+ },
499
+ "ballotsAdmitted": {
500
+ "type": "integer",
501
+ "minimum": 0,
502
+ "description": "Distinct tags with a counted ballot."
503
+ },
504
+ "head": {
505
+ "$ref": "#/$defs/BoardHead"
506
+ }
507
+ }
508
+ },
509
+ "BoardHead": {
510
+ "title": "BoardHead",
511
+ "description": "A board's tree head (RFC 9162 §2.1). A head is signed by being carried in a document the ballot box signs; whoever keeps a head keeps that whole document.",
512
+ "type": "object",
513
+ "additionalProperties": false,
514
+ "required": [
515
+ "electionId",
516
+ "treeSize",
517
+ "rootHash",
518
+ "issuedAt"
519
+ ],
520
+ "properties": {
521
+ "electionId": {
522
+ "$ref": "#/$defs/ElectionId"
523
+ },
524
+ "treeSize": {
525
+ "type": "integer",
526
+ "minimum": 0
527
+ },
528
+ "rootHash": {
529
+ "$ref": "#/$defs/DigestMultibase",
530
+ "description": "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash."
531
+ },
532
+ "issuedAt": {
533
+ "type": "string",
534
+ "format": "date-time"
535
+ }
536
+ }
537
+ },
538
+ "DigestMultibase": {
539
+ "title": "DigestMultibase",
540
+ "description": "A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.\n\nMultihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.\n\nThis definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.\n\nRestricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that \"interoperability is not guaranteed between implementations using such values\", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.",
541
+ "type": "string",
542
+ "minLength": 16,
543
+ "pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
544
+ "examples": [
545
+ "zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
546
+ ]
547
+ },
548
+ "ElectionState": {
549
+ "title": "ElectionState",
550
+ "type": "string",
551
+ "enum": [
552
+ "registered",
553
+ "registration",
554
+ "voting",
555
+ "closed",
556
+ "tallied",
557
+ "cancelled"
558
+ ]
559
+ }
560
+ }
561
+ };
562
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
563
+ export const RESPONSE_PAYLOAD_SCHEMA = {
564
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
565
+ "$ref": "#/$defs/Response",
566
+ "$defs": {
567
+ "Response": {
568
+ "$anchor": "response",
569
+ "title": "Voting — Election Show — response payload",
570
+ "type": "object",
571
+ "additionalProperties": false,
572
+ "required": [
573
+ "election"
574
+ ],
575
+ "properties": {
576
+ "election": {
577
+ "$ref": "#/$defs/ElectionSummary"
578
+ },
579
+ "manifest": {
580
+ "$ref": "#/$defs/Manifest",
581
+ "description": "The registered manifest, exactly as registered. Present when the board is public or the caller may read the private board."
582
+ },
583
+ "ext": {
584
+ "$ref": "#/$defs/Ext"
585
+ }
586
+ }
587
+ },
588
+ "Ext": {
589
+ "title": "Ext",
590
+ "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.",
591
+ "type": "object",
592
+ "minProperties": 1,
593
+ "additionalProperties": true,
594
+ "propertyNames": {
595
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
596
+ }
597
+ },
598
+ "Manifest": {
599
+ "title": "Manifest",
600
+ "description": "What an election asks and how it is decided (VTI-VOT-010). Its digest (`manifestDigest`) is the SHA-256 multihash of its RFC 8785 (JCS) canonicalization, and every cast is bound to it (VTI-VOT-011).",
601
+ "type": "object",
602
+ "additionalProperties": false,
603
+ "required": [
604
+ "electionId",
605
+ "community",
606
+ "questions",
607
+ "secrecy",
608
+ "roll",
609
+ "registrationOpens",
610
+ "votingOpens",
611
+ "votingCloses",
612
+ "revote",
613
+ "board",
614
+ "ballotBox",
615
+ "binding",
616
+ "allowEarlyClose",
617
+ "resultsBeforeClose",
618
+ "textReleaseThreshold"
619
+ ],
620
+ "properties": {
621
+ "electionId": {
622
+ "$ref": "#/$defs/ElectionId"
623
+ },
624
+ "community": {
625
+ "type": "string",
626
+ "minLength": 1,
627
+ "maxLength": 2048,
628
+ "description": "The community's DID."
629
+ },
630
+ "title": {
631
+ "type": "string",
632
+ "maxLength": 512
633
+ },
634
+ "description": {
635
+ "type": "string",
636
+ "maxLength": 8192
637
+ },
638
+ "questions": {
639
+ "type": "array",
640
+ "minItems": 1,
641
+ "maxItems": 128,
642
+ "items": {
643
+ "$ref": "#/$defs/Question"
644
+ }
645
+ },
646
+ "secrecy": {
647
+ "$ref": "#/$defs/SecrecyLevel"
648
+ },
649
+ "roll": {
650
+ "$ref": "#/$defs/RollRule"
651
+ },
652
+ "registrationOpens": {
653
+ "type": "string",
654
+ "format": "date-time"
655
+ },
656
+ "votingOpens": {
657
+ "type": "string",
658
+ "format": "date-time"
659
+ },
660
+ "votingCloses": {
661
+ "type": "string",
662
+ "format": "date-time"
663
+ },
664
+ "revote": {
665
+ "$ref": "#/$defs/Revote"
666
+ },
667
+ "board": {
668
+ "type": "object",
669
+ "additionalProperties": false,
670
+ "required": [
671
+ "visibility",
672
+ "auditors"
673
+ ],
674
+ "properties": {
675
+ "visibility": {
676
+ "$ref": "#/$defs/BoardVisibility"
677
+ },
678
+ "auditors": {
679
+ "type": "array",
680
+ "items": {
681
+ "type": "string",
682
+ "minLength": 1,
683
+ "maxLength": 2048
684
+ },
685
+ "uniqueItems": true
686
+ }
687
+ }
688
+ },
689
+ "ballotBox": {
690
+ "type": "string",
691
+ "minLength": 1,
692
+ "maxLength": 2048,
693
+ "description": "The DID of the voting service that holds the board."
694
+ },
695
+ "trustees": {
696
+ "$ref": "#/$defs/Trustees"
697
+ },
698
+ "binding": {
699
+ "type": "boolean",
700
+ "description": "Whether the community treats the result as deciding something; creating a binding election takes another administrator's consent (VTI-VOT-081)."
701
+ },
702
+ "allowEarlyClose": {
703
+ "type": "boolean"
704
+ },
705
+ "resultsBeforeClose": {
706
+ "type": "boolean",
707
+ "description": "Open elections only: whether running totals may be read while voting is open (VTI-VOT-061)."
708
+ },
709
+ "textReleaseThreshold": {
710
+ "type": "integer",
711
+ "minimum": 10,
712
+ "description": "Counted ballots required before any text answer is disclosed (VTI-VOT-065)."
713
+ }
714
+ }
715
+ },
716
+ "Trustees": {
717
+ "title": "Trustees",
718
+ "description": "The trustees of a sealed or tallied-encrypted election and the number of them decryption needs (VTI-VOT-062). Neither the community nor the ballot box may be one.",
719
+ "type": "object",
720
+ "additionalProperties": false,
721
+ "required": [
722
+ "dids",
723
+ "threshold"
724
+ ],
725
+ "properties": {
726
+ "dids": {
727
+ "type": "array",
728
+ "minItems": 2,
729
+ "items": {
730
+ "type": "string",
731
+ "minLength": 1,
732
+ "maxLength": 2048
733
+ },
734
+ "uniqueItems": true
735
+ },
736
+ "threshold": {
737
+ "type": "integer",
738
+ "minimum": 2
739
+ }
740
+ }
741
+ },
742
+ "BoardVisibility": {
743
+ "title": "BoardVisibility",
744
+ "description": "`public`: anyone reads the board. `private`: the community, the auditors the manifest names and, for one cast's inclusion, the holder of its receipt (VTI-VOT-052).",
745
+ "type": "string",
746
+ "enum": [
747
+ "public",
748
+ "private"
749
+ ]
750
+ },
751
+ "Revote": {
752
+ "title": "Revote",
753
+ "description": "What a later, different ballot under one ticket does: `replace` the earlier one, or be refused (`refuse`) (VTI-VOT-041).",
754
+ "type": "string",
755
+ "enum": [
756
+ "replace",
757
+ "refuse"
758
+ ]
759
+ },
760
+ "RollRule": {
761
+ "title": "RollRule",
762
+ "description": "Who may be issued a ticket (VTI-VOT-021): the community's active members, its active members and the parties `listed` names, or only the parties `listed` names.",
763
+ "type": "object",
764
+ "additionalProperties": false,
765
+ "required": [
766
+ "rule"
767
+ ],
768
+ "properties": {
769
+ "rule": {
770
+ "type": "string",
771
+ "enum": [
772
+ "members",
773
+ "membersAndListed",
774
+ "listed"
775
+ ]
776
+ },
777
+ "listed": {
778
+ "type": "array",
779
+ "items": {
780
+ "type": "string",
781
+ "minLength": 1,
782
+ "maxLength": 2048,
783
+ "description": "A DID enfranchised by name."
784
+ },
785
+ "uniqueItems": true
786
+ }
787
+ }
788
+ },
789
+ "SecrecyLevel": {
790
+ "title": "SecrecyLevel",
791
+ "description": "`open`: ballots are recorded on the board as cast. `sealed`: ballots are encrypted to a jointly generated election key and decrypted after voting closes. `talliedEncrypted`: ballots are encrypted and only the totals are ever decrypted (VTI-VOT-060). Version 0.1 of the voting tasks carries open ballots only; a ballot box refuses to register any other level with `voting/election/register:unsupportedSecrecy` until the trustee tasks are specified.",
792
+ "type": "string",
793
+ "enum": [
794
+ "open",
795
+ "sealed",
796
+ "talliedEncrypted"
797
+ ]
798
+ },
799
+ "Question": {
800
+ "title": "Question",
801
+ "description": "One question. Tagged union over `type`.",
802
+ "oneOf": [
803
+ {
804
+ "title": "ChoiceQuestion",
805
+ "description": "Select between `minSelections` and `maxSelections` of `options`. A yes/no/abstain motion is a choice of exactly one of three.",
806
+ "type": "object",
807
+ "additionalProperties": false,
808
+ "required": [
809
+ "key",
810
+ "type",
811
+ "options",
812
+ "minSelections",
813
+ "maxSelections",
814
+ "optional"
815
+ ],
816
+ "properties": {
817
+ "key": {
818
+ "$ref": "#/$defs/Key"
819
+ },
820
+ "type": {
821
+ "const": "choice"
822
+ },
823
+ "text": {
824
+ "type": "string",
825
+ "maxLength": 2048
826
+ },
827
+ "options": {
828
+ "type": "array",
829
+ "minItems": 2,
830
+ "maxItems": 256,
831
+ "items": {
832
+ "$ref": "#/$defs/QuestionOption"
833
+ }
834
+ },
835
+ "minSelections": {
836
+ "type": "integer",
837
+ "minimum": 0
838
+ },
839
+ "maxSelections": {
840
+ "type": "integer",
841
+ "minimum": 1
842
+ },
843
+ "optional": {
844
+ "type": "boolean"
845
+ }
846
+ }
847
+ },
848
+ {
849
+ "title": "RankingQuestion",
850
+ "description": "Order `options`; a ballot ranks every option or, when `partial` is true, a prefix of them.",
851
+ "type": "object",
852
+ "additionalProperties": false,
853
+ "required": [
854
+ "key",
855
+ "type",
856
+ "options",
857
+ "partial",
858
+ "optional"
859
+ ],
860
+ "properties": {
861
+ "key": {
862
+ "$ref": "#/$defs/Key"
863
+ },
864
+ "type": {
865
+ "const": "ranking"
866
+ },
867
+ "text": {
868
+ "type": "string",
869
+ "maxLength": 2048
870
+ },
871
+ "options": {
872
+ "type": "array",
873
+ "minItems": 2,
874
+ "maxItems": 64,
875
+ "items": {
876
+ "$ref": "#/$defs/QuestionOption"
877
+ }
878
+ },
879
+ "partial": {
880
+ "type": "boolean"
881
+ },
882
+ "optional": {
883
+ "type": "boolean"
884
+ }
885
+ }
886
+ },
887
+ {
888
+ "title": "ScoreQuestion",
889
+ "description": "Give each option an integer score within [min, max].",
890
+ "type": "object",
891
+ "additionalProperties": false,
892
+ "required": [
893
+ "key",
894
+ "type",
895
+ "options",
896
+ "min",
897
+ "max",
898
+ "optional"
899
+ ],
900
+ "properties": {
901
+ "key": {
902
+ "$ref": "#/$defs/Key"
903
+ },
904
+ "type": {
905
+ "const": "score"
906
+ },
907
+ "text": {
908
+ "type": "string",
909
+ "maxLength": 2048
910
+ },
911
+ "options": {
912
+ "type": "array",
913
+ "minItems": 1,
914
+ "maxItems": 256,
915
+ "items": {
916
+ "$ref": "#/$defs/QuestionOption"
917
+ }
918
+ },
919
+ "min": {
920
+ "type": "integer"
921
+ },
922
+ "max": {
923
+ "type": "integer"
924
+ },
925
+ "optional": {
926
+ "type": "boolean"
927
+ }
928
+ }
929
+ },
930
+ {
931
+ "title": "TextQuestion",
932
+ "description": "Free text of at most `maxLength` characters.",
933
+ "type": "object",
934
+ "additionalProperties": false,
935
+ "required": [
936
+ "key",
937
+ "type",
938
+ "maxLength",
939
+ "optional"
940
+ ],
941
+ "properties": {
942
+ "key": {
943
+ "$ref": "#/$defs/Key"
944
+ },
945
+ "type": {
946
+ "const": "text"
947
+ },
948
+ "text": {
949
+ "type": "string",
950
+ "maxLength": 2048
951
+ },
952
+ "maxLength": {
953
+ "type": "integer",
954
+ "minimum": 1,
955
+ "maximum": 4096
956
+ },
957
+ "optional": {
958
+ "type": "boolean"
959
+ }
960
+ }
961
+ }
962
+ ]
963
+ },
964
+ "Key": {
965
+ "title": "Key",
966
+ "description": "A question or option key, unique within its manifest or question.",
967
+ "type": "string",
968
+ "pattern": "^[A-Za-z0-9._-]{1,64}$"
969
+ },
970
+ "QuestionOption": {
971
+ "title": "QuestionOption",
972
+ "type": "object",
973
+ "additionalProperties": false,
974
+ "required": [
975
+ "key"
976
+ ],
977
+ "properties": {
978
+ "key": {
979
+ "$ref": "#/$defs/Key"
980
+ },
981
+ "label": {
982
+ "type": "string",
983
+ "maxLength": 512,
984
+ "description": "Display text. Absent from a manifest registered with a ballot box that holds no question text (VTI-VOT-014)."
985
+ }
986
+ }
987
+ },
988
+ "ElectionId": {
989
+ "title": "ElectionId",
990
+ "description": "An election's identifier, unique within its community. A closed alphabet: it appears in the ticket class label `voter/<electionId>` and is framed into every hash a cast is bound to.",
991
+ "type": "string",
992
+ "pattern": "^[A-Za-z0-9._-]{1,128}$"
993
+ },
994
+ "ElectionSummary": {
995
+ "title": "ElectionSummary",
996
+ "description": "A ballot box's view of one election.",
997
+ "type": "object",
998
+ "additionalProperties": false,
999
+ "required": [
1000
+ "electionId",
1001
+ "community",
1002
+ "manifestDigest",
1003
+ "state",
1004
+ "ballotsAdmitted",
1005
+ "head"
1006
+ ],
1007
+ "properties": {
1008
+ "electionId": {
1009
+ "$ref": "#/$defs/ElectionId"
1010
+ },
1011
+ "community": {
1012
+ "type": "string",
1013
+ "minLength": 1,
1014
+ "maxLength": 2048
1015
+ },
1016
+ "manifestDigest": {
1017
+ "$ref": "#/$defs/DigestMultibase"
1018
+ },
1019
+ "state": {
1020
+ "$ref": "#/$defs/ElectionState"
1021
+ },
1022
+ "ballotsAdmitted": {
1023
+ "type": "integer",
1024
+ "minimum": 0,
1025
+ "description": "Distinct tags with a counted ballot."
1026
+ },
1027
+ "head": {
1028
+ "$ref": "#/$defs/BoardHead"
1029
+ }
1030
+ }
1031
+ },
1032
+ "BoardHead": {
1033
+ "title": "BoardHead",
1034
+ "description": "A board's tree head (RFC 9162 §2.1). A head is signed by being carried in a document the ballot box signs; whoever keeps a head keeps that whole document.",
1035
+ "type": "object",
1036
+ "additionalProperties": false,
1037
+ "required": [
1038
+ "electionId",
1039
+ "treeSize",
1040
+ "rootHash",
1041
+ "issuedAt"
1042
+ ],
1043
+ "properties": {
1044
+ "electionId": {
1045
+ "$ref": "#/$defs/ElectionId"
1046
+ },
1047
+ "treeSize": {
1048
+ "type": "integer",
1049
+ "minimum": 0
1050
+ },
1051
+ "rootHash": {
1052
+ "$ref": "#/$defs/DigestMultibase",
1053
+ "description": "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash."
1054
+ },
1055
+ "issuedAt": {
1056
+ "type": "string",
1057
+ "format": "date-time"
1058
+ }
1059
+ }
1060
+ },
1061
+ "DigestMultibase": {
1062
+ "title": "DigestMultibase",
1063
+ "description": "A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.\n\nMultihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.\n\nThis definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.\n\nRestricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that \"interoperability is not guaranteed between implementations using such values\", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.",
1064
+ "type": "string",
1065
+ "minLength": 16,
1066
+ "pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
1067
+ "examples": [
1068
+ "zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
1069
+ ]
1070
+ },
1071
+ "ElectionState": {
1072
+ "title": "ElectionState",
1073
+ "type": "string",
1074
+ "enum": [
1075
+ "registered",
1076
+ "registration",
1077
+ "voting",
1078
+ "closed",
1079
+ "tallied",
1080
+ "cancelled"
1081
+ ]
1082
+ }
1083
+ }
1084
+ };
1085
+ /**
1086
+ * SPEC.md §7.2 policy for the request variant, from this specification's
1087
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
1088
+ * per-specification and cannot be derived from the document alone, and
1089
+ * item 2 needs the schema this carries.
1090
+ */
1091
+ export const SPEC = {
1092
+ typeUri: TYPE_URI,
1093
+ isBearer: false,
1094
+ isProofRequired: false,
1095
+ isRecipientRequired: true,
1096
+ isIssuedAtRequired: false,
1097
+ payloadSchema: PAYLOAD_SCHEMA,
1098
+ };
1099
+ /**
1100
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
1101
+ * tracks the *issuer* party's requirement because a response swaps the
1102
+ * parties (§7.3 item 5).
1103
+ */
1104
+ export const RESPONSE_SPEC = {
1105
+ typeUri: RESPONSE_TYPE_URI,
1106
+ isBearer: false,
1107
+ isProofRequired: true,
1108
+ isRecipientRequired: false,
1109
+ isIssuedAtRequired: false,
1110
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
1111
+ };
1112
+ //# sourceMappingURL=payload.js.map