@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,1282 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vta/pcs/vote/0.1/payload.schema.json
4
+ */
5
+ /** Trust Task type URI. */
6
+ export const TYPE_URI = "https://trusttasks.org/spec/vta/pcs/vote/0.1";
7
+ /** Trust Task response type URI (request type URI + "#response"). */
8
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/pcs/vote/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/vta/pcs/vote/0.1",
21
+ "title": "VTA PCS — Vote — payload",
22
+ "description": "A voter's client hands its VTA a ballot; the VTA checks it against the election's manifest, makes the ticket's attestation over it, and returns the complete voting/ballot/cast document, signed by a did:key used for this cast alone, for the client to send.",
23
+ "type": "object",
24
+ "additionalProperties": false,
25
+ "required": [
26
+ "contextId",
27
+ "community",
28
+ "parameters",
29
+ "manifest",
30
+ "ballot"
31
+ ],
32
+ "properties": {
33
+ "contextId": {
34
+ "type": "string",
35
+ "minLength": 1,
36
+ "maxLength": 256,
37
+ "description": "The context the voter belongs to."
38
+ },
39
+ "community": {
40
+ "type": "string",
41
+ "minLength": 1,
42
+ "maxLength": 2048,
43
+ "description": "The community's DID. MUST equal the manifest's `community`."
44
+ },
45
+ "parameters": {
46
+ "$ref": "#/$defs/VotingParameters",
47
+ "description": "The community's published voting parameters. Its `votingKey` MUST be the one the ticket was issued under."
48
+ },
49
+ "manifest": {
50
+ "$ref": "#/$defs/Manifest",
51
+ "description": "The election's manifest, exactly as registered. The engine recomputes its digest and checks it against the one it recorded at voter/register."
52
+ },
53
+ "ballot": {
54
+ "$ref": "#/$defs/Ballot",
55
+ "description": "The voter's ballot. The cast binds its RFC 8785 (JCS) canonicalization."
56
+ },
57
+ "ext": {
58
+ "$ref": "#/$defs/Ext"
59
+ }
60
+ },
61
+ "$defs": {
62
+ "CastDocument": {
63
+ "title": "CastDocument",
64
+ "description": "A complete, signed voting/ballot/cast/0.1 request document, ready to send to the ballot box. Its payload is validated by that specification's schema; the members fixed here are the ones this task guarantees.",
65
+ "type": "object",
66
+ "required": [
67
+ "id",
68
+ "type",
69
+ "issuer",
70
+ "recipient",
71
+ "issuedAt",
72
+ "payload",
73
+ "proof"
74
+ ],
75
+ "properties": {
76
+ "id": {
77
+ "type": "string",
78
+ "pattern": "^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
79
+ "description": "A random (version 4) UUID URN, generated for this cast and derived from nothing else."
80
+ },
81
+ "type": {
82
+ "const": "https://trusttasks.org/spec/voting/ballot/cast/0.1#request"
83
+ },
84
+ "issuer": {
85
+ "type": "string",
86
+ "maxLength": 256,
87
+ "pattern": "^did:key:z[1-9A-HJ-NP-Za-km-z]+$",
88
+ "description": "The did:key generated for this cast alone (VTI-VOT-003)."
89
+ },
90
+ "recipient": {
91
+ "type": "string",
92
+ "minLength": 1,
93
+ "maxLength": 2048,
94
+ "description": "The manifest's `ballotBox`."
95
+ },
96
+ "issuedAt": {
97
+ "type": "string",
98
+ "format": "date-time"
99
+ },
100
+ "expiresAt": {
101
+ "type": "string",
102
+ "format": "date-time",
103
+ "description": "When present, the manifest's `votingCloses`."
104
+ },
105
+ "payload": {
106
+ "type": "object",
107
+ "description": "The voting/ballot/cast/0.1 request payload — `community`, `electionId` and the Cast the engine built — and nothing else."
108
+ },
109
+ "proof": {
110
+ "type": "object",
111
+ "description": "The Data Integrity proof made with the cast's one-time key."
112
+ }
113
+ }
114
+ },
115
+ "Response": {
116
+ "$anchor": "response",
117
+ "title": "VTA PCS — Vote — response payload",
118
+ "type": "object",
119
+ "additionalProperties": false,
120
+ "required": [
121
+ "castDocument",
122
+ "tag"
123
+ ],
124
+ "properties": {
125
+ "castDocument": {
126
+ "$ref": "#/$defs/CastDocument"
127
+ },
128
+ "tag": {
129
+ "type": "string",
130
+ "maxLength": 4096,
131
+ "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$",
132
+ "description": "The cast's tag (the election's nullifier for this ticket), as the cast carries it. The same for every cast this ticket makes in this election."
133
+ },
134
+ "ext": {
135
+ "$ref": "#/$defs/Ext"
136
+ }
137
+ }
138
+ },
139
+ "Ext": {
140
+ "title": "Ext",
141
+ "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.",
142
+ "type": "object",
143
+ "minProperties": 1,
144
+ "additionalProperties": true,
145
+ "propertyNames": {
146
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
147
+ }
148
+ },
149
+ "Ballot": {
150
+ "title": "Ballot",
151
+ "description": "An open ballot: one answer per question of the manifest, in any order. The bytes a cast's proof binds are the RFC 8785 (JCS) canonicalization of this object as received.",
152
+ "type": "object",
153
+ "additionalProperties": false,
154
+ "required": [
155
+ "electionId",
156
+ "manifestDigest",
157
+ "answers"
158
+ ],
159
+ "properties": {
160
+ "electionId": {
161
+ "$ref": "#/$defs/ElectionId"
162
+ },
163
+ "manifestDigest": {
164
+ "$ref": "#/$defs/DigestMultibase"
165
+ },
166
+ "answers": {
167
+ "type": "array",
168
+ "minItems": 1,
169
+ "maxItems": 128,
170
+ "items": {
171
+ "$ref": "#/$defs/Answer"
172
+ }
173
+ }
174
+ }
175
+ },
176
+ "Answer": {
177
+ "title": "Answer",
178
+ "description": "The answer to one question. Exactly one member besides `question` is present, matching the question's type, or `abstain` for an optional question left unanswered.",
179
+ "type": "object",
180
+ "additionalProperties": false,
181
+ "required": [
182
+ "question"
183
+ ],
184
+ "minProperties": 2,
185
+ "maxProperties": 2,
186
+ "properties": {
187
+ "question": {
188
+ "$ref": "#/$defs/Key"
189
+ },
190
+ "choice": {
191
+ "type": "array",
192
+ "items": {
193
+ "$ref": "#/$defs/Key"
194
+ },
195
+ "uniqueItems": true
196
+ },
197
+ "ranking": {
198
+ "type": "array",
199
+ "items": {
200
+ "$ref": "#/$defs/Key"
201
+ },
202
+ "uniqueItems": true
203
+ },
204
+ "scores": {
205
+ "type": "object",
206
+ "propertyNames": {
207
+ "$ref": "#/$defs/Key"
208
+ },
209
+ "additionalProperties": {
210
+ "type": "integer"
211
+ }
212
+ },
213
+ "text": {
214
+ "type": "string",
215
+ "maxLength": 4096
216
+ },
217
+ "abstain": {
218
+ "const": true
219
+ }
220
+ }
221
+ },
222
+ "Key": {
223
+ "title": "Key",
224
+ "description": "A question or option key, unique within its manifest or question.",
225
+ "type": "string",
226
+ "pattern": "^[A-Za-z0-9._-]{1,64}$"
227
+ },
228
+ "ElectionId": {
229
+ "title": "ElectionId",
230
+ "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.",
231
+ "type": "string",
232
+ "pattern": "^[A-Za-z0-9._-]{1,128}$"
233
+ },
234
+ "DigestMultibase": {
235
+ "title": "DigestMultibase",
236
+ "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`.",
237
+ "type": "string",
238
+ "minLength": 16,
239
+ "pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
240
+ "examples": [
241
+ "zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
242
+ ]
243
+ },
244
+ "Manifest": {
245
+ "title": "Manifest",
246
+ "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).",
247
+ "type": "object",
248
+ "additionalProperties": false,
249
+ "required": [
250
+ "electionId",
251
+ "community",
252
+ "questions",
253
+ "secrecy",
254
+ "roll",
255
+ "registrationOpens",
256
+ "votingOpens",
257
+ "votingCloses",
258
+ "revote",
259
+ "board",
260
+ "ballotBox",
261
+ "binding",
262
+ "allowEarlyClose",
263
+ "resultsBeforeClose",
264
+ "textReleaseThreshold"
265
+ ],
266
+ "properties": {
267
+ "electionId": {
268
+ "$ref": "#/$defs/ElectionId"
269
+ },
270
+ "community": {
271
+ "type": "string",
272
+ "minLength": 1,
273
+ "maxLength": 2048,
274
+ "description": "The community's DID."
275
+ },
276
+ "title": {
277
+ "type": "string",
278
+ "maxLength": 512
279
+ },
280
+ "description": {
281
+ "type": "string",
282
+ "maxLength": 8192
283
+ },
284
+ "questions": {
285
+ "type": "array",
286
+ "minItems": 1,
287
+ "maxItems": 128,
288
+ "items": {
289
+ "$ref": "#/$defs/Question"
290
+ }
291
+ },
292
+ "secrecy": {
293
+ "$ref": "#/$defs/SecrecyLevel"
294
+ },
295
+ "roll": {
296
+ "$ref": "#/$defs/RollRule"
297
+ },
298
+ "registrationOpens": {
299
+ "type": "string",
300
+ "format": "date-time"
301
+ },
302
+ "votingOpens": {
303
+ "type": "string",
304
+ "format": "date-time"
305
+ },
306
+ "votingCloses": {
307
+ "type": "string",
308
+ "format": "date-time"
309
+ },
310
+ "revote": {
311
+ "$ref": "#/$defs/Revote"
312
+ },
313
+ "board": {
314
+ "type": "object",
315
+ "additionalProperties": false,
316
+ "required": [
317
+ "visibility",
318
+ "auditors"
319
+ ],
320
+ "properties": {
321
+ "visibility": {
322
+ "$ref": "#/$defs/BoardVisibility"
323
+ },
324
+ "auditors": {
325
+ "type": "array",
326
+ "items": {
327
+ "type": "string",
328
+ "minLength": 1,
329
+ "maxLength": 2048
330
+ },
331
+ "uniqueItems": true
332
+ }
333
+ }
334
+ },
335
+ "ballotBox": {
336
+ "type": "string",
337
+ "minLength": 1,
338
+ "maxLength": 2048,
339
+ "description": "The DID of the voting service that holds the board."
340
+ },
341
+ "trustees": {
342
+ "$ref": "#/$defs/Trustees"
343
+ },
344
+ "binding": {
345
+ "type": "boolean",
346
+ "description": "Whether the community treats the result as deciding something; creating a binding election takes another administrator's consent (VTI-VOT-081)."
347
+ },
348
+ "allowEarlyClose": {
349
+ "type": "boolean"
350
+ },
351
+ "resultsBeforeClose": {
352
+ "type": "boolean",
353
+ "description": "Open elections only: whether running totals may be read while voting is open (VTI-VOT-061)."
354
+ },
355
+ "textReleaseThreshold": {
356
+ "type": "integer",
357
+ "minimum": 10,
358
+ "description": "Counted ballots required before any text answer is disclosed (VTI-VOT-065)."
359
+ }
360
+ }
361
+ },
362
+ "Trustees": {
363
+ "title": "Trustees",
364
+ "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.",
365
+ "type": "object",
366
+ "additionalProperties": false,
367
+ "required": [
368
+ "dids",
369
+ "threshold"
370
+ ],
371
+ "properties": {
372
+ "dids": {
373
+ "type": "array",
374
+ "minItems": 2,
375
+ "items": {
376
+ "type": "string",
377
+ "minLength": 1,
378
+ "maxLength": 2048
379
+ },
380
+ "uniqueItems": true
381
+ },
382
+ "threshold": {
383
+ "type": "integer",
384
+ "minimum": 2
385
+ }
386
+ }
387
+ },
388
+ "BoardVisibility": {
389
+ "title": "BoardVisibility",
390
+ "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).",
391
+ "type": "string",
392
+ "enum": [
393
+ "public",
394
+ "private"
395
+ ]
396
+ },
397
+ "Revote": {
398
+ "title": "Revote",
399
+ "description": "What a later, different ballot under one ticket does: `replace` the earlier one, or be refused (`refuse`) (VTI-VOT-041).",
400
+ "type": "string",
401
+ "enum": [
402
+ "replace",
403
+ "refuse"
404
+ ]
405
+ },
406
+ "RollRule": {
407
+ "title": "RollRule",
408
+ "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.",
409
+ "type": "object",
410
+ "additionalProperties": false,
411
+ "required": [
412
+ "rule"
413
+ ],
414
+ "properties": {
415
+ "rule": {
416
+ "type": "string",
417
+ "enum": [
418
+ "members",
419
+ "membersAndListed",
420
+ "listed"
421
+ ]
422
+ },
423
+ "listed": {
424
+ "type": "array",
425
+ "items": {
426
+ "type": "string",
427
+ "minLength": 1,
428
+ "maxLength": 2048,
429
+ "description": "A DID enfranchised by name."
430
+ },
431
+ "uniqueItems": true
432
+ }
433
+ }
434
+ },
435
+ "SecrecyLevel": {
436
+ "title": "SecrecyLevel",
437
+ "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.",
438
+ "type": "string",
439
+ "enum": [
440
+ "open",
441
+ "sealed",
442
+ "talliedEncrypted"
443
+ ]
444
+ },
445
+ "Question": {
446
+ "title": "Question",
447
+ "description": "One question. Tagged union over `type`.",
448
+ "oneOf": [
449
+ {
450
+ "title": "ChoiceQuestion",
451
+ "description": "Select between `minSelections` and `maxSelections` of `options`. A yes/no/abstain motion is a choice of exactly one of three.",
452
+ "type": "object",
453
+ "additionalProperties": false,
454
+ "required": [
455
+ "key",
456
+ "type",
457
+ "options",
458
+ "minSelections",
459
+ "maxSelections",
460
+ "optional"
461
+ ],
462
+ "properties": {
463
+ "key": {
464
+ "$ref": "#/$defs/Key"
465
+ },
466
+ "type": {
467
+ "const": "choice"
468
+ },
469
+ "text": {
470
+ "type": "string",
471
+ "maxLength": 2048
472
+ },
473
+ "options": {
474
+ "type": "array",
475
+ "minItems": 2,
476
+ "maxItems": 256,
477
+ "items": {
478
+ "$ref": "#/$defs/QuestionOption"
479
+ }
480
+ },
481
+ "minSelections": {
482
+ "type": "integer",
483
+ "minimum": 0
484
+ },
485
+ "maxSelections": {
486
+ "type": "integer",
487
+ "minimum": 1
488
+ },
489
+ "optional": {
490
+ "type": "boolean"
491
+ }
492
+ }
493
+ },
494
+ {
495
+ "title": "RankingQuestion",
496
+ "description": "Order `options`; a ballot ranks every option or, when `partial` is true, a prefix of them.",
497
+ "type": "object",
498
+ "additionalProperties": false,
499
+ "required": [
500
+ "key",
501
+ "type",
502
+ "options",
503
+ "partial",
504
+ "optional"
505
+ ],
506
+ "properties": {
507
+ "key": {
508
+ "$ref": "#/$defs/Key"
509
+ },
510
+ "type": {
511
+ "const": "ranking"
512
+ },
513
+ "text": {
514
+ "type": "string",
515
+ "maxLength": 2048
516
+ },
517
+ "options": {
518
+ "type": "array",
519
+ "minItems": 2,
520
+ "maxItems": 64,
521
+ "items": {
522
+ "$ref": "#/$defs/QuestionOption"
523
+ }
524
+ },
525
+ "partial": {
526
+ "type": "boolean"
527
+ },
528
+ "optional": {
529
+ "type": "boolean"
530
+ }
531
+ }
532
+ },
533
+ {
534
+ "title": "ScoreQuestion",
535
+ "description": "Give each option an integer score within [min, max].",
536
+ "type": "object",
537
+ "additionalProperties": false,
538
+ "required": [
539
+ "key",
540
+ "type",
541
+ "options",
542
+ "min",
543
+ "max",
544
+ "optional"
545
+ ],
546
+ "properties": {
547
+ "key": {
548
+ "$ref": "#/$defs/Key"
549
+ },
550
+ "type": {
551
+ "const": "score"
552
+ },
553
+ "text": {
554
+ "type": "string",
555
+ "maxLength": 2048
556
+ },
557
+ "options": {
558
+ "type": "array",
559
+ "minItems": 1,
560
+ "maxItems": 256,
561
+ "items": {
562
+ "$ref": "#/$defs/QuestionOption"
563
+ }
564
+ },
565
+ "min": {
566
+ "type": "integer"
567
+ },
568
+ "max": {
569
+ "type": "integer"
570
+ },
571
+ "optional": {
572
+ "type": "boolean"
573
+ }
574
+ }
575
+ },
576
+ {
577
+ "title": "TextQuestion",
578
+ "description": "Free text of at most `maxLength` characters.",
579
+ "type": "object",
580
+ "additionalProperties": false,
581
+ "required": [
582
+ "key",
583
+ "type",
584
+ "maxLength",
585
+ "optional"
586
+ ],
587
+ "properties": {
588
+ "key": {
589
+ "$ref": "#/$defs/Key"
590
+ },
591
+ "type": {
592
+ "const": "text"
593
+ },
594
+ "text": {
595
+ "type": "string",
596
+ "maxLength": 2048
597
+ },
598
+ "maxLength": {
599
+ "type": "integer",
600
+ "minimum": 1,
601
+ "maximum": 4096
602
+ },
603
+ "optional": {
604
+ "type": "boolean"
605
+ }
606
+ }
607
+ }
608
+ ]
609
+ },
610
+ "QuestionOption": {
611
+ "title": "QuestionOption",
612
+ "type": "object",
613
+ "additionalProperties": false,
614
+ "required": [
615
+ "key"
616
+ ],
617
+ "properties": {
618
+ "key": {
619
+ "$ref": "#/$defs/Key"
620
+ },
621
+ "label": {
622
+ "type": "string",
623
+ "maxLength": 512,
624
+ "description": "Display text. Absent from a manifest registered with a ballot box that holds no question text (VTI-VOT-014)."
625
+ }
626
+ }
627
+ },
628
+ "VotingParameters": {
629
+ "title": "VotingParameters",
630
+ "description": "The community's published voting parameters: the PCS suite and the voting verification key tickets are issued under (VTI-VOT-020). Distinct from its hidden-vetting helper key.",
631
+ "type": "object",
632
+ "additionalProperties": false,
633
+ "required": [
634
+ "suite",
635
+ "votingKey"
636
+ ],
637
+ "properties": {
638
+ "suite": {
639
+ "type": "string",
640
+ "const": "ps-ddh-bls12381"
641
+ },
642
+ "votingKey": {
643
+ "$ref": "#/$defs/Multibase"
644
+ }
645
+ }
646
+ },
647
+ "Multibase": {
648
+ "title": "Multibase",
649
+ "description": "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.",
650
+ "type": "string",
651
+ "maxLength": 16384,
652
+ "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
653
+ }
654
+ }
655
+ };
656
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
657
+ export const RESPONSE_PAYLOAD_SCHEMA = {
658
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
659
+ "$ref": "#/$defs/Response",
660
+ "$defs": {
661
+ "CastDocument": {
662
+ "title": "CastDocument",
663
+ "description": "A complete, signed voting/ballot/cast/0.1 request document, ready to send to the ballot box. Its payload is validated by that specification's schema; the members fixed here are the ones this task guarantees.",
664
+ "type": "object",
665
+ "required": [
666
+ "id",
667
+ "type",
668
+ "issuer",
669
+ "recipient",
670
+ "issuedAt",
671
+ "payload",
672
+ "proof"
673
+ ],
674
+ "properties": {
675
+ "id": {
676
+ "type": "string",
677
+ "pattern": "^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
678
+ "description": "A random (version 4) UUID URN, generated for this cast and derived from nothing else."
679
+ },
680
+ "type": {
681
+ "const": "https://trusttasks.org/spec/voting/ballot/cast/0.1#request"
682
+ },
683
+ "issuer": {
684
+ "type": "string",
685
+ "maxLength": 256,
686
+ "pattern": "^did:key:z[1-9A-HJ-NP-Za-km-z]+$",
687
+ "description": "The did:key generated for this cast alone (VTI-VOT-003)."
688
+ },
689
+ "recipient": {
690
+ "type": "string",
691
+ "minLength": 1,
692
+ "maxLength": 2048,
693
+ "description": "The manifest's `ballotBox`."
694
+ },
695
+ "issuedAt": {
696
+ "type": "string",
697
+ "format": "date-time"
698
+ },
699
+ "expiresAt": {
700
+ "type": "string",
701
+ "format": "date-time",
702
+ "description": "When present, the manifest's `votingCloses`."
703
+ },
704
+ "payload": {
705
+ "type": "object",
706
+ "description": "The voting/ballot/cast/0.1 request payload — `community`, `electionId` and the Cast the engine built — and nothing else."
707
+ },
708
+ "proof": {
709
+ "type": "object",
710
+ "description": "The Data Integrity proof made with the cast's one-time key."
711
+ }
712
+ }
713
+ },
714
+ "Response": {
715
+ "$anchor": "response",
716
+ "title": "VTA PCS — Vote — response payload",
717
+ "type": "object",
718
+ "additionalProperties": false,
719
+ "required": [
720
+ "castDocument",
721
+ "tag"
722
+ ],
723
+ "properties": {
724
+ "castDocument": {
725
+ "$ref": "#/$defs/CastDocument"
726
+ },
727
+ "tag": {
728
+ "type": "string",
729
+ "maxLength": 4096,
730
+ "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$",
731
+ "description": "The cast's tag (the election's nullifier for this ticket), as the cast carries it. The same for every cast this ticket makes in this election."
732
+ },
733
+ "ext": {
734
+ "$ref": "#/$defs/Ext"
735
+ }
736
+ }
737
+ },
738
+ "Ext": {
739
+ "title": "Ext",
740
+ "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.",
741
+ "type": "object",
742
+ "minProperties": 1,
743
+ "additionalProperties": true,
744
+ "propertyNames": {
745
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
746
+ }
747
+ },
748
+ "Ballot": {
749
+ "title": "Ballot",
750
+ "description": "An open ballot: one answer per question of the manifest, in any order. The bytes a cast's proof binds are the RFC 8785 (JCS) canonicalization of this object as received.",
751
+ "type": "object",
752
+ "additionalProperties": false,
753
+ "required": [
754
+ "electionId",
755
+ "manifestDigest",
756
+ "answers"
757
+ ],
758
+ "properties": {
759
+ "electionId": {
760
+ "$ref": "#/$defs/ElectionId"
761
+ },
762
+ "manifestDigest": {
763
+ "$ref": "#/$defs/DigestMultibase"
764
+ },
765
+ "answers": {
766
+ "type": "array",
767
+ "minItems": 1,
768
+ "maxItems": 128,
769
+ "items": {
770
+ "$ref": "#/$defs/Answer"
771
+ }
772
+ }
773
+ }
774
+ },
775
+ "Answer": {
776
+ "title": "Answer",
777
+ "description": "The answer to one question. Exactly one member besides `question` is present, matching the question's type, or `abstain` for an optional question left unanswered.",
778
+ "type": "object",
779
+ "additionalProperties": false,
780
+ "required": [
781
+ "question"
782
+ ],
783
+ "minProperties": 2,
784
+ "maxProperties": 2,
785
+ "properties": {
786
+ "question": {
787
+ "$ref": "#/$defs/Key"
788
+ },
789
+ "choice": {
790
+ "type": "array",
791
+ "items": {
792
+ "$ref": "#/$defs/Key"
793
+ },
794
+ "uniqueItems": true
795
+ },
796
+ "ranking": {
797
+ "type": "array",
798
+ "items": {
799
+ "$ref": "#/$defs/Key"
800
+ },
801
+ "uniqueItems": true
802
+ },
803
+ "scores": {
804
+ "type": "object",
805
+ "propertyNames": {
806
+ "$ref": "#/$defs/Key"
807
+ },
808
+ "additionalProperties": {
809
+ "type": "integer"
810
+ }
811
+ },
812
+ "text": {
813
+ "type": "string",
814
+ "maxLength": 4096
815
+ },
816
+ "abstain": {
817
+ "const": true
818
+ }
819
+ }
820
+ },
821
+ "Key": {
822
+ "title": "Key",
823
+ "description": "A question or option key, unique within its manifest or question.",
824
+ "type": "string",
825
+ "pattern": "^[A-Za-z0-9._-]{1,64}$"
826
+ },
827
+ "ElectionId": {
828
+ "title": "ElectionId",
829
+ "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.",
830
+ "type": "string",
831
+ "pattern": "^[A-Za-z0-9._-]{1,128}$"
832
+ },
833
+ "DigestMultibase": {
834
+ "title": "DigestMultibase",
835
+ "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`.",
836
+ "type": "string",
837
+ "minLength": 16,
838
+ "pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
839
+ "examples": [
840
+ "zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
841
+ ]
842
+ },
843
+ "Manifest": {
844
+ "title": "Manifest",
845
+ "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).",
846
+ "type": "object",
847
+ "additionalProperties": false,
848
+ "required": [
849
+ "electionId",
850
+ "community",
851
+ "questions",
852
+ "secrecy",
853
+ "roll",
854
+ "registrationOpens",
855
+ "votingOpens",
856
+ "votingCloses",
857
+ "revote",
858
+ "board",
859
+ "ballotBox",
860
+ "binding",
861
+ "allowEarlyClose",
862
+ "resultsBeforeClose",
863
+ "textReleaseThreshold"
864
+ ],
865
+ "properties": {
866
+ "electionId": {
867
+ "$ref": "#/$defs/ElectionId"
868
+ },
869
+ "community": {
870
+ "type": "string",
871
+ "minLength": 1,
872
+ "maxLength": 2048,
873
+ "description": "The community's DID."
874
+ },
875
+ "title": {
876
+ "type": "string",
877
+ "maxLength": 512
878
+ },
879
+ "description": {
880
+ "type": "string",
881
+ "maxLength": 8192
882
+ },
883
+ "questions": {
884
+ "type": "array",
885
+ "minItems": 1,
886
+ "maxItems": 128,
887
+ "items": {
888
+ "$ref": "#/$defs/Question"
889
+ }
890
+ },
891
+ "secrecy": {
892
+ "$ref": "#/$defs/SecrecyLevel"
893
+ },
894
+ "roll": {
895
+ "$ref": "#/$defs/RollRule"
896
+ },
897
+ "registrationOpens": {
898
+ "type": "string",
899
+ "format": "date-time"
900
+ },
901
+ "votingOpens": {
902
+ "type": "string",
903
+ "format": "date-time"
904
+ },
905
+ "votingCloses": {
906
+ "type": "string",
907
+ "format": "date-time"
908
+ },
909
+ "revote": {
910
+ "$ref": "#/$defs/Revote"
911
+ },
912
+ "board": {
913
+ "type": "object",
914
+ "additionalProperties": false,
915
+ "required": [
916
+ "visibility",
917
+ "auditors"
918
+ ],
919
+ "properties": {
920
+ "visibility": {
921
+ "$ref": "#/$defs/BoardVisibility"
922
+ },
923
+ "auditors": {
924
+ "type": "array",
925
+ "items": {
926
+ "type": "string",
927
+ "minLength": 1,
928
+ "maxLength": 2048
929
+ },
930
+ "uniqueItems": true
931
+ }
932
+ }
933
+ },
934
+ "ballotBox": {
935
+ "type": "string",
936
+ "minLength": 1,
937
+ "maxLength": 2048,
938
+ "description": "The DID of the voting service that holds the board."
939
+ },
940
+ "trustees": {
941
+ "$ref": "#/$defs/Trustees"
942
+ },
943
+ "binding": {
944
+ "type": "boolean",
945
+ "description": "Whether the community treats the result as deciding something; creating a binding election takes another administrator's consent (VTI-VOT-081)."
946
+ },
947
+ "allowEarlyClose": {
948
+ "type": "boolean"
949
+ },
950
+ "resultsBeforeClose": {
951
+ "type": "boolean",
952
+ "description": "Open elections only: whether running totals may be read while voting is open (VTI-VOT-061)."
953
+ },
954
+ "textReleaseThreshold": {
955
+ "type": "integer",
956
+ "minimum": 10,
957
+ "description": "Counted ballots required before any text answer is disclosed (VTI-VOT-065)."
958
+ }
959
+ }
960
+ },
961
+ "Trustees": {
962
+ "title": "Trustees",
963
+ "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.",
964
+ "type": "object",
965
+ "additionalProperties": false,
966
+ "required": [
967
+ "dids",
968
+ "threshold"
969
+ ],
970
+ "properties": {
971
+ "dids": {
972
+ "type": "array",
973
+ "minItems": 2,
974
+ "items": {
975
+ "type": "string",
976
+ "minLength": 1,
977
+ "maxLength": 2048
978
+ },
979
+ "uniqueItems": true
980
+ },
981
+ "threshold": {
982
+ "type": "integer",
983
+ "minimum": 2
984
+ }
985
+ }
986
+ },
987
+ "BoardVisibility": {
988
+ "title": "BoardVisibility",
989
+ "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).",
990
+ "type": "string",
991
+ "enum": [
992
+ "public",
993
+ "private"
994
+ ]
995
+ },
996
+ "Revote": {
997
+ "title": "Revote",
998
+ "description": "What a later, different ballot under one ticket does: `replace` the earlier one, or be refused (`refuse`) (VTI-VOT-041).",
999
+ "type": "string",
1000
+ "enum": [
1001
+ "replace",
1002
+ "refuse"
1003
+ ]
1004
+ },
1005
+ "RollRule": {
1006
+ "title": "RollRule",
1007
+ "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.",
1008
+ "type": "object",
1009
+ "additionalProperties": false,
1010
+ "required": [
1011
+ "rule"
1012
+ ],
1013
+ "properties": {
1014
+ "rule": {
1015
+ "type": "string",
1016
+ "enum": [
1017
+ "members",
1018
+ "membersAndListed",
1019
+ "listed"
1020
+ ]
1021
+ },
1022
+ "listed": {
1023
+ "type": "array",
1024
+ "items": {
1025
+ "type": "string",
1026
+ "minLength": 1,
1027
+ "maxLength": 2048,
1028
+ "description": "A DID enfranchised by name."
1029
+ },
1030
+ "uniqueItems": true
1031
+ }
1032
+ }
1033
+ },
1034
+ "SecrecyLevel": {
1035
+ "title": "SecrecyLevel",
1036
+ "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.",
1037
+ "type": "string",
1038
+ "enum": [
1039
+ "open",
1040
+ "sealed",
1041
+ "talliedEncrypted"
1042
+ ]
1043
+ },
1044
+ "Question": {
1045
+ "title": "Question",
1046
+ "description": "One question. Tagged union over `type`.",
1047
+ "oneOf": [
1048
+ {
1049
+ "title": "ChoiceQuestion",
1050
+ "description": "Select between `minSelections` and `maxSelections` of `options`. A yes/no/abstain motion is a choice of exactly one of three.",
1051
+ "type": "object",
1052
+ "additionalProperties": false,
1053
+ "required": [
1054
+ "key",
1055
+ "type",
1056
+ "options",
1057
+ "minSelections",
1058
+ "maxSelections",
1059
+ "optional"
1060
+ ],
1061
+ "properties": {
1062
+ "key": {
1063
+ "$ref": "#/$defs/Key"
1064
+ },
1065
+ "type": {
1066
+ "const": "choice"
1067
+ },
1068
+ "text": {
1069
+ "type": "string",
1070
+ "maxLength": 2048
1071
+ },
1072
+ "options": {
1073
+ "type": "array",
1074
+ "minItems": 2,
1075
+ "maxItems": 256,
1076
+ "items": {
1077
+ "$ref": "#/$defs/QuestionOption"
1078
+ }
1079
+ },
1080
+ "minSelections": {
1081
+ "type": "integer",
1082
+ "minimum": 0
1083
+ },
1084
+ "maxSelections": {
1085
+ "type": "integer",
1086
+ "minimum": 1
1087
+ },
1088
+ "optional": {
1089
+ "type": "boolean"
1090
+ }
1091
+ }
1092
+ },
1093
+ {
1094
+ "title": "RankingQuestion",
1095
+ "description": "Order `options`; a ballot ranks every option or, when `partial` is true, a prefix of them.",
1096
+ "type": "object",
1097
+ "additionalProperties": false,
1098
+ "required": [
1099
+ "key",
1100
+ "type",
1101
+ "options",
1102
+ "partial",
1103
+ "optional"
1104
+ ],
1105
+ "properties": {
1106
+ "key": {
1107
+ "$ref": "#/$defs/Key"
1108
+ },
1109
+ "type": {
1110
+ "const": "ranking"
1111
+ },
1112
+ "text": {
1113
+ "type": "string",
1114
+ "maxLength": 2048
1115
+ },
1116
+ "options": {
1117
+ "type": "array",
1118
+ "minItems": 2,
1119
+ "maxItems": 64,
1120
+ "items": {
1121
+ "$ref": "#/$defs/QuestionOption"
1122
+ }
1123
+ },
1124
+ "partial": {
1125
+ "type": "boolean"
1126
+ },
1127
+ "optional": {
1128
+ "type": "boolean"
1129
+ }
1130
+ }
1131
+ },
1132
+ {
1133
+ "title": "ScoreQuestion",
1134
+ "description": "Give each option an integer score within [min, max].",
1135
+ "type": "object",
1136
+ "additionalProperties": false,
1137
+ "required": [
1138
+ "key",
1139
+ "type",
1140
+ "options",
1141
+ "min",
1142
+ "max",
1143
+ "optional"
1144
+ ],
1145
+ "properties": {
1146
+ "key": {
1147
+ "$ref": "#/$defs/Key"
1148
+ },
1149
+ "type": {
1150
+ "const": "score"
1151
+ },
1152
+ "text": {
1153
+ "type": "string",
1154
+ "maxLength": 2048
1155
+ },
1156
+ "options": {
1157
+ "type": "array",
1158
+ "minItems": 1,
1159
+ "maxItems": 256,
1160
+ "items": {
1161
+ "$ref": "#/$defs/QuestionOption"
1162
+ }
1163
+ },
1164
+ "min": {
1165
+ "type": "integer"
1166
+ },
1167
+ "max": {
1168
+ "type": "integer"
1169
+ },
1170
+ "optional": {
1171
+ "type": "boolean"
1172
+ }
1173
+ }
1174
+ },
1175
+ {
1176
+ "title": "TextQuestion",
1177
+ "description": "Free text of at most `maxLength` characters.",
1178
+ "type": "object",
1179
+ "additionalProperties": false,
1180
+ "required": [
1181
+ "key",
1182
+ "type",
1183
+ "maxLength",
1184
+ "optional"
1185
+ ],
1186
+ "properties": {
1187
+ "key": {
1188
+ "$ref": "#/$defs/Key"
1189
+ },
1190
+ "type": {
1191
+ "const": "text"
1192
+ },
1193
+ "text": {
1194
+ "type": "string",
1195
+ "maxLength": 2048
1196
+ },
1197
+ "maxLength": {
1198
+ "type": "integer",
1199
+ "minimum": 1,
1200
+ "maximum": 4096
1201
+ },
1202
+ "optional": {
1203
+ "type": "boolean"
1204
+ }
1205
+ }
1206
+ }
1207
+ ]
1208
+ },
1209
+ "QuestionOption": {
1210
+ "title": "QuestionOption",
1211
+ "type": "object",
1212
+ "additionalProperties": false,
1213
+ "required": [
1214
+ "key"
1215
+ ],
1216
+ "properties": {
1217
+ "key": {
1218
+ "$ref": "#/$defs/Key"
1219
+ },
1220
+ "label": {
1221
+ "type": "string",
1222
+ "maxLength": 512,
1223
+ "description": "Display text. Absent from a manifest registered with a ballot box that holds no question text (VTI-VOT-014)."
1224
+ }
1225
+ }
1226
+ },
1227
+ "VotingParameters": {
1228
+ "title": "VotingParameters",
1229
+ "description": "The community's published voting parameters: the PCS suite and the voting verification key tickets are issued under (VTI-VOT-020). Distinct from its hidden-vetting helper key.",
1230
+ "type": "object",
1231
+ "additionalProperties": false,
1232
+ "required": [
1233
+ "suite",
1234
+ "votingKey"
1235
+ ],
1236
+ "properties": {
1237
+ "suite": {
1238
+ "type": "string",
1239
+ "const": "ps-ddh-bls12381"
1240
+ },
1241
+ "votingKey": {
1242
+ "$ref": "#/$defs/Multibase"
1243
+ }
1244
+ }
1245
+ },
1246
+ "Multibase": {
1247
+ "title": "Multibase",
1248
+ "description": "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.",
1249
+ "type": "string",
1250
+ "maxLength": 16384,
1251
+ "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
1252
+ }
1253
+ }
1254
+ };
1255
+ /**
1256
+ * SPEC.md §7.2 policy for the request variant, from this specification's
1257
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
1258
+ * per-specification and cannot be derived from the document alone, and
1259
+ * item 2 needs the schema this carries.
1260
+ */
1261
+ export const SPEC = {
1262
+ typeUri: TYPE_URI,
1263
+ isBearer: false,
1264
+ isProofRequired: true,
1265
+ isRecipientRequired: true,
1266
+ isIssuedAtRequired: true,
1267
+ payloadSchema: PAYLOAD_SCHEMA,
1268
+ };
1269
+ /**
1270
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
1271
+ * tracks the *issuer* party's requirement because a response swaps the
1272
+ * parties (§7.3 item 5).
1273
+ */
1274
+ export const RESPONSE_SPEC = {
1275
+ typeUri: RESPONSE_TYPE_URI,
1276
+ isBearer: false,
1277
+ isProofRequired: false,
1278
+ isRecipientRequired: true,
1279
+ isIssuedAtRequired: true,
1280
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
1281
+ };
1282
+ //# sourceMappingURL=payload.js.map