@openvtc/trust-tasks 0.26.25 → 0.26.27

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