@openvtc/trust-tasks 0.26.25 → 0.26.26

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 (127) hide show
  1. package/CHANGELOG.md +54 -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 +13 -0
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +13 -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/elections/create/0.1/payload.d.ts +4 -4
  95. package/dist/vtc/elections/create/0.1/payload.js +2 -2
  96. package/dist/vtc/elections/create/0.1/payload.js.map +1 -1
  97. package/dist/vtc/elections/show/0.1/payload.d.ts +4 -4
  98. package/dist/vtc/elections/show/0.1/payload.js +2 -2
  99. package/dist/vtc/elections/show/0.1/payload.js.map +1 -1
  100. package/package.json +1 -1
  101. package/src/_shared/components.ts +222 -4
  102. package/src/device/list/0.1/payload.ts +4 -2
  103. package/src/device/list/0.2/payload.ts +4 -2
  104. package/src/device/register/0.1/payload.ts +4 -2
  105. package/src/device/register/0.2/payload.ts +4 -2
  106. package/src/index.ts +13 -0
  107. package/src/voting/_shared/0.1/voting.ts +1 -1
  108. package/src/voting/ballot/cast-encrypted/0.1/payload.ts +735 -0
  109. package/src/voting/board/read/0.1/payload.ts +1519 -393
  110. package/src/voting/election/register/0.1/payload.ts +2 -2
  111. package/src/voting/election/show/0.1/payload.ts +2 -2
  112. package/src/voting/trustees/confirm/0.1/payload.ts +429 -0
  113. package/src/voting/trustees/deal/0.1/payload.ts +665 -0
  114. package/src/voting/trustees/decrypt/0.1/payload.ts +663 -0
  115. package/src/voting/trustees/enrol/0.1/payload.ts +525 -0
  116. package/src/voting/trustees/justify/0.1/payload.ts +439 -0
  117. package/src/voting/trustees/status/0.1/payload.ts +890 -0
  118. package/src/vta/pcs/trustee/deal/0.1/payload.ts +1250 -0
  119. package/src/vta/pcs/trustee/decrypt/0.1/payload.ts +489 -0
  120. package/src/vta/pcs/trustee/enrol/0.1/payload.ts +1107 -0
  121. package/src/vta/pcs/trustee/justify/0.1/payload.ts +341 -0
  122. package/src/vta/pcs/trustee/keys/0.1/payload.ts +1545 -0
  123. package/src/vta/pcs/vote/0.1/payload.ts +2 -2
  124. package/src/vta/pcs/vote-encrypted/0.1/payload.ts +1455 -0
  125. package/src/vta/pcs/voter/register/0.1/payload.ts +2 -2
  126. package/src/vtc/elections/create/0.1/payload.ts +2 -2
  127. package/src/vtc/elections/show/0.1/payload.ts +2 -2
@@ -0,0 +1,1040 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vta/pcs/trustee/enrol/0.1/payload.schema.json
4
+ */
5
+ /** Trust Task type URI. */
6
+ export const TYPE_URI = "https://trusttasks.org/spec/vta/pcs/trustee/enrol/0.1";
7
+ /** Trust Task response type URI (request type URI + "#response"). */
8
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/pcs/trustee/enrol/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/trustee/enrol/0.1",
21
+ "title": "VTA PCS — Trustee Enrol — payload",
22
+ "description": "The trustee's VTA generates the election's transport key and returns the voting/trustees/enrol request signed as the trustee.",
23
+ "type": "object",
24
+ "additionalProperties": false,
25
+ "required": [
26
+ "contextId",
27
+ "community",
28
+ "electionId",
29
+ "trustee",
30
+ "manifest"
31
+ ],
32
+ "properties": {
33
+ "contextId": {
34
+ "type": "string",
35
+ "minLength": 1,
36
+ "maxLength": 256,
37
+ "description": "The VTA context the trustee's keys live in."
38
+ },
39
+ "community": {
40
+ "type": "string",
41
+ "minLength": 1,
42
+ "maxLength": 2048,
43
+ "description": "The community's DID."
44
+ },
45
+ "electionId": {
46
+ "$ref": "#/$defs/ElectionId"
47
+ },
48
+ "trustee": {
49
+ "type": "string",
50
+ "minLength": 1,
51
+ "maxLength": 2048,
52
+ "description": "The trustee's DID: a persona this VTA holds, named in the manifest's `trustees.dids`."
53
+ },
54
+ "manifest": {
55
+ "$ref": "#/$defs/Manifest"
56
+ },
57
+ "ext": {
58
+ "$ref": "#/$defs/Ext"
59
+ }
60
+ },
61
+ "$defs": {
62
+ "Response": {
63
+ "$anchor": "response",
64
+ "title": "VTA PCS — Trustee Enrol — response payload",
65
+ "type": "object",
66
+ "additionalProperties": false,
67
+ "required": [
68
+ "document"
69
+ ],
70
+ "properties": {
71
+ "document": {
72
+ "title": "EnrolDocument",
73
+ "description": "The voting/trustees/enrol request, signed as the trustee, to send to the ballot box unchanged.",
74
+ "type": "object",
75
+ "required": [
76
+ "id",
77
+ "type",
78
+ "issuer",
79
+ "recipient",
80
+ "issuedAt",
81
+ "payload",
82
+ "proof"
83
+ ],
84
+ "properties": {
85
+ "id": {
86
+ "type": "string",
87
+ "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}$"
88
+ },
89
+ "type": {
90
+ "const": "https://trusttasks.org/spec/voting/trustees/enrol/0.1"
91
+ },
92
+ "issuer": {
93
+ "type": "string",
94
+ "minLength": 1,
95
+ "maxLength": 2048,
96
+ "description": "The signer."
97
+ },
98
+ "recipient": {
99
+ "type": "string",
100
+ "minLength": 1,
101
+ "maxLength": 2048,
102
+ "description": "The ballot box."
103
+ },
104
+ "issuedAt": {
105
+ "type": "string",
106
+ "format": "date-time"
107
+ },
108
+ "expiresAt": {
109
+ "type": "string",
110
+ "format": "date-time"
111
+ },
112
+ "payload": {
113
+ "type": "object",
114
+ "description": "That task's request payload."
115
+ },
116
+ "proof": {
117
+ "type": "object",
118
+ "description": "A Data Integrity proof by an `authentication` key of `issuer`."
119
+ }
120
+ }
121
+ },
122
+ "ext": {
123
+ "$ref": "#/$defs/Ext"
124
+ }
125
+ }
126
+ },
127
+ "Ext": {
128
+ "title": "Ext",
129
+ "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.",
130
+ "type": "object",
131
+ "minProperties": 1,
132
+ "additionalProperties": true,
133
+ "propertyNames": {
134
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
135
+ }
136
+ },
137
+ "Manifest": {
138
+ "title": "Manifest",
139
+ "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).",
140
+ "type": "object",
141
+ "additionalProperties": false,
142
+ "required": [
143
+ "electionId",
144
+ "community",
145
+ "questions",
146
+ "secrecy",
147
+ "roll",
148
+ "registrationOpens",
149
+ "votingOpens",
150
+ "votingCloses",
151
+ "revote",
152
+ "board",
153
+ "ballotBox",
154
+ "binding",
155
+ "allowEarlyClose",
156
+ "resultsBeforeClose",
157
+ "textReleaseThreshold"
158
+ ],
159
+ "properties": {
160
+ "electionId": {
161
+ "$ref": "#/$defs/ElectionId"
162
+ },
163
+ "community": {
164
+ "type": "string",
165
+ "minLength": 1,
166
+ "maxLength": 2048,
167
+ "description": "The community's DID."
168
+ },
169
+ "title": {
170
+ "type": "string",
171
+ "maxLength": 512
172
+ },
173
+ "description": {
174
+ "type": "string",
175
+ "maxLength": 8192
176
+ },
177
+ "questions": {
178
+ "type": "array",
179
+ "minItems": 1,
180
+ "maxItems": 128,
181
+ "items": {
182
+ "$ref": "#/$defs/Question"
183
+ }
184
+ },
185
+ "secrecy": {
186
+ "$ref": "#/$defs/SecrecyLevel"
187
+ },
188
+ "roll": {
189
+ "$ref": "#/$defs/RollRule"
190
+ },
191
+ "registrationOpens": {
192
+ "type": "string",
193
+ "format": "date-time"
194
+ },
195
+ "votingOpens": {
196
+ "type": "string",
197
+ "format": "date-time"
198
+ },
199
+ "votingCloses": {
200
+ "type": "string",
201
+ "format": "date-time"
202
+ },
203
+ "revote": {
204
+ "$ref": "#/$defs/Revote"
205
+ },
206
+ "board": {
207
+ "type": "object",
208
+ "additionalProperties": false,
209
+ "required": [
210
+ "visibility",
211
+ "auditors"
212
+ ],
213
+ "properties": {
214
+ "visibility": {
215
+ "$ref": "#/$defs/BoardVisibility"
216
+ },
217
+ "auditors": {
218
+ "type": "array",
219
+ "items": {
220
+ "type": "string",
221
+ "minLength": 1,
222
+ "maxLength": 2048
223
+ },
224
+ "uniqueItems": true
225
+ }
226
+ }
227
+ },
228
+ "ballotBox": {
229
+ "type": "string",
230
+ "minLength": 1,
231
+ "maxLength": 2048,
232
+ "description": "The DID of the voting service that holds the board."
233
+ },
234
+ "trustees": {
235
+ "$ref": "#/$defs/Trustees"
236
+ },
237
+ "binding": {
238
+ "type": "boolean",
239
+ "description": "Whether the community treats the result as deciding something; creating a binding election takes another administrator's consent (VTI-VOT-081)."
240
+ },
241
+ "allowEarlyClose": {
242
+ "type": "boolean"
243
+ },
244
+ "resultsBeforeClose": {
245
+ "type": "boolean",
246
+ "description": "Open elections only: whether running totals may be read while voting is open (VTI-VOT-061)."
247
+ },
248
+ "textReleaseThreshold": {
249
+ "type": "integer",
250
+ "minimum": 10,
251
+ "description": "Counted ballots required before any text answer is disclosed (VTI-VOT-065)."
252
+ }
253
+ }
254
+ },
255
+ "Trustees": {
256
+ "title": "Trustees",
257
+ "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.",
258
+ "type": "object",
259
+ "additionalProperties": false,
260
+ "required": [
261
+ "dids",
262
+ "threshold"
263
+ ],
264
+ "properties": {
265
+ "dids": {
266
+ "type": "array",
267
+ "minItems": 2,
268
+ "items": {
269
+ "type": "string",
270
+ "minLength": 1,
271
+ "maxLength": 2048
272
+ },
273
+ "uniqueItems": true
274
+ },
275
+ "threshold": {
276
+ "type": "integer",
277
+ "minimum": 2
278
+ }
279
+ }
280
+ },
281
+ "BoardVisibility": {
282
+ "title": "BoardVisibility",
283
+ "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).",
284
+ "type": "string",
285
+ "enum": [
286
+ "public",
287
+ "private"
288
+ ]
289
+ },
290
+ "Revote": {
291
+ "title": "Revote",
292
+ "description": "What a later, different ballot under one ticket does: `replace` the earlier one, or be refused (`refuse`) (VTI-VOT-041).",
293
+ "type": "string",
294
+ "enum": [
295
+ "replace",
296
+ "refuse"
297
+ ]
298
+ },
299
+ "RollRule": {
300
+ "title": "RollRule",
301
+ "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.",
302
+ "type": "object",
303
+ "additionalProperties": false,
304
+ "required": [
305
+ "rule"
306
+ ],
307
+ "properties": {
308
+ "rule": {
309
+ "type": "string",
310
+ "enum": [
311
+ "members",
312
+ "membersAndListed",
313
+ "listed"
314
+ ]
315
+ },
316
+ "listed": {
317
+ "type": "array",
318
+ "items": {
319
+ "type": "string",
320
+ "minLength": 1,
321
+ "maxLength": 2048,
322
+ "description": "A DID enfranchised by name."
323
+ },
324
+ "uniqueItems": true
325
+ }
326
+ }
327
+ },
328
+ "SecrecyLevel": {
329
+ "title": "SecrecyLevel",
330
+ "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).",
331
+ "type": "string",
332
+ "enum": [
333
+ "open",
334
+ "sealed",
335
+ "talliedEncrypted"
336
+ ]
337
+ },
338
+ "Question": {
339
+ "title": "Question",
340
+ "description": "One question. Tagged union over `type`.",
341
+ "oneOf": [
342
+ {
343
+ "title": "ChoiceQuestion",
344
+ "description": "Select between `minSelections` and `maxSelections` of `options`. A yes/no/abstain motion is a choice of exactly one of three.",
345
+ "type": "object",
346
+ "additionalProperties": false,
347
+ "required": [
348
+ "key",
349
+ "type",
350
+ "options",
351
+ "minSelections",
352
+ "maxSelections",
353
+ "optional"
354
+ ],
355
+ "properties": {
356
+ "key": {
357
+ "$ref": "#/$defs/Key"
358
+ },
359
+ "type": {
360
+ "const": "choice"
361
+ },
362
+ "text": {
363
+ "type": "string",
364
+ "maxLength": 2048
365
+ },
366
+ "options": {
367
+ "type": "array",
368
+ "minItems": 2,
369
+ "maxItems": 256,
370
+ "items": {
371
+ "$ref": "#/$defs/QuestionOption"
372
+ }
373
+ },
374
+ "minSelections": {
375
+ "type": "integer",
376
+ "minimum": 0
377
+ },
378
+ "maxSelections": {
379
+ "type": "integer",
380
+ "minimum": 1
381
+ },
382
+ "optional": {
383
+ "type": "boolean"
384
+ }
385
+ }
386
+ },
387
+ {
388
+ "title": "RankingQuestion",
389
+ "description": "Order `options`; a ballot ranks every option or, when `partial` is true, a prefix of them.",
390
+ "type": "object",
391
+ "additionalProperties": false,
392
+ "required": [
393
+ "key",
394
+ "type",
395
+ "options",
396
+ "partial",
397
+ "optional"
398
+ ],
399
+ "properties": {
400
+ "key": {
401
+ "$ref": "#/$defs/Key"
402
+ },
403
+ "type": {
404
+ "const": "ranking"
405
+ },
406
+ "text": {
407
+ "type": "string",
408
+ "maxLength": 2048
409
+ },
410
+ "options": {
411
+ "type": "array",
412
+ "minItems": 2,
413
+ "maxItems": 64,
414
+ "items": {
415
+ "$ref": "#/$defs/QuestionOption"
416
+ }
417
+ },
418
+ "partial": {
419
+ "type": "boolean"
420
+ },
421
+ "optional": {
422
+ "type": "boolean"
423
+ }
424
+ }
425
+ },
426
+ {
427
+ "title": "ScoreQuestion",
428
+ "description": "Give each option an integer score within [min, max].",
429
+ "type": "object",
430
+ "additionalProperties": false,
431
+ "required": [
432
+ "key",
433
+ "type",
434
+ "options",
435
+ "min",
436
+ "max",
437
+ "optional"
438
+ ],
439
+ "properties": {
440
+ "key": {
441
+ "$ref": "#/$defs/Key"
442
+ },
443
+ "type": {
444
+ "const": "score"
445
+ },
446
+ "text": {
447
+ "type": "string",
448
+ "maxLength": 2048
449
+ },
450
+ "options": {
451
+ "type": "array",
452
+ "minItems": 1,
453
+ "maxItems": 256,
454
+ "items": {
455
+ "$ref": "#/$defs/QuestionOption"
456
+ }
457
+ },
458
+ "min": {
459
+ "type": "integer"
460
+ },
461
+ "max": {
462
+ "type": "integer"
463
+ },
464
+ "optional": {
465
+ "type": "boolean"
466
+ }
467
+ }
468
+ },
469
+ {
470
+ "title": "TextQuestion",
471
+ "description": "Free text of at most `maxLength` characters.",
472
+ "type": "object",
473
+ "additionalProperties": false,
474
+ "required": [
475
+ "key",
476
+ "type",
477
+ "maxLength",
478
+ "optional"
479
+ ],
480
+ "properties": {
481
+ "key": {
482
+ "$ref": "#/$defs/Key"
483
+ },
484
+ "type": {
485
+ "const": "text"
486
+ },
487
+ "text": {
488
+ "type": "string",
489
+ "maxLength": 2048
490
+ },
491
+ "maxLength": {
492
+ "type": "integer",
493
+ "minimum": 1,
494
+ "maximum": 4096
495
+ },
496
+ "optional": {
497
+ "type": "boolean"
498
+ }
499
+ }
500
+ }
501
+ ]
502
+ },
503
+ "Key": {
504
+ "title": "Key",
505
+ "description": "A question or option key, unique within its manifest or question.",
506
+ "type": "string",
507
+ "pattern": "^[A-Za-z0-9._-]{1,64}$"
508
+ },
509
+ "QuestionOption": {
510
+ "title": "QuestionOption",
511
+ "type": "object",
512
+ "additionalProperties": false,
513
+ "required": [
514
+ "key"
515
+ ],
516
+ "properties": {
517
+ "key": {
518
+ "$ref": "#/$defs/Key"
519
+ },
520
+ "label": {
521
+ "type": "string",
522
+ "maxLength": 512,
523
+ "description": "Display text. Absent from a manifest registered with a ballot box that holds no question text (VTI-VOT-014)."
524
+ }
525
+ }
526
+ },
527
+ "ElectionId": {
528
+ "title": "ElectionId",
529
+ "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.",
530
+ "type": "string",
531
+ "pattern": "^[A-Za-z0-9._-]{1,128}$"
532
+ }
533
+ }
534
+ };
535
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
536
+ export const RESPONSE_PAYLOAD_SCHEMA = {
537
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
538
+ "$ref": "#/$defs/Response",
539
+ "$defs": {
540
+ "Response": {
541
+ "$anchor": "response",
542
+ "title": "VTA PCS — Trustee Enrol — response payload",
543
+ "type": "object",
544
+ "additionalProperties": false,
545
+ "required": [
546
+ "document"
547
+ ],
548
+ "properties": {
549
+ "document": {
550
+ "title": "EnrolDocument",
551
+ "description": "The voting/trustees/enrol request, signed as the trustee, to send to the ballot box unchanged.",
552
+ "type": "object",
553
+ "required": [
554
+ "id",
555
+ "type",
556
+ "issuer",
557
+ "recipient",
558
+ "issuedAt",
559
+ "payload",
560
+ "proof"
561
+ ],
562
+ "properties": {
563
+ "id": {
564
+ "type": "string",
565
+ "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}$"
566
+ },
567
+ "type": {
568
+ "const": "https://trusttasks.org/spec/voting/trustees/enrol/0.1"
569
+ },
570
+ "issuer": {
571
+ "type": "string",
572
+ "minLength": 1,
573
+ "maxLength": 2048,
574
+ "description": "The signer."
575
+ },
576
+ "recipient": {
577
+ "type": "string",
578
+ "minLength": 1,
579
+ "maxLength": 2048,
580
+ "description": "The ballot box."
581
+ },
582
+ "issuedAt": {
583
+ "type": "string",
584
+ "format": "date-time"
585
+ },
586
+ "expiresAt": {
587
+ "type": "string",
588
+ "format": "date-time"
589
+ },
590
+ "payload": {
591
+ "type": "object",
592
+ "description": "That task's request payload."
593
+ },
594
+ "proof": {
595
+ "type": "object",
596
+ "description": "A Data Integrity proof by an `authentication` key of `issuer`."
597
+ }
598
+ }
599
+ },
600
+ "ext": {
601
+ "$ref": "#/$defs/Ext"
602
+ }
603
+ }
604
+ },
605
+ "Ext": {
606
+ "title": "Ext",
607
+ "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.",
608
+ "type": "object",
609
+ "minProperties": 1,
610
+ "additionalProperties": true,
611
+ "propertyNames": {
612
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
613
+ }
614
+ },
615
+ "Manifest": {
616
+ "title": "Manifest",
617
+ "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).",
618
+ "type": "object",
619
+ "additionalProperties": false,
620
+ "required": [
621
+ "electionId",
622
+ "community",
623
+ "questions",
624
+ "secrecy",
625
+ "roll",
626
+ "registrationOpens",
627
+ "votingOpens",
628
+ "votingCloses",
629
+ "revote",
630
+ "board",
631
+ "ballotBox",
632
+ "binding",
633
+ "allowEarlyClose",
634
+ "resultsBeforeClose",
635
+ "textReleaseThreshold"
636
+ ],
637
+ "properties": {
638
+ "electionId": {
639
+ "$ref": "#/$defs/ElectionId"
640
+ },
641
+ "community": {
642
+ "type": "string",
643
+ "minLength": 1,
644
+ "maxLength": 2048,
645
+ "description": "The community's DID."
646
+ },
647
+ "title": {
648
+ "type": "string",
649
+ "maxLength": 512
650
+ },
651
+ "description": {
652
+ "type": "string",
653
+ "maxLength": 8192
654
+ },
655
+ "questions": {
656
+ "type": "array",
657
+ "minItems": 1,
658
+ "maxItems": 128,
659
+ "items": {
660
+ "$ref": "#/$defs/Question"
661
+ }
662
+ },
663
+ "secrecy": {
664
+ "$ref": "#/$defs/SecrecyLevel"
665
+ },
666
+ "roll": {
667
+ "$ref": "#/$defs/RollRule"
668
+ },
669
+ "registrationOpens": {
670
+ "type": "string",
671
+ "format": "date-time"
672
+ },
673
+ "votingOpens": {
674
+ "type": "string",
675
+ "format": "date-time"
676
+ },
677
+ "votingCloses": {
678
+ "type": "string",
679
+ "format": "date-time"
680
+ },
681
+ "revote": {
682
+ "$ref": "#/$defs/Revote"
683
+ },
684
+ "board": {
685
+ "type": "object",
686
+ "additionalProperties": false,
687
+ "required": [
688
+ "visibility",
689
+ "auditors"
690
+ ],
691
+ "properties": {
692
+ "visibility": {
693
+ "$ref": "#/$defs/BoardVisibility"
694
+ },
695
+ "auditors": {
696
+ "type": "array",
697
+ "items": {
698
+ "type": "string",
699
+ "minLength": 1,
700
+ "maxLength": 2048
701
+ },
702
+ "uniqueItems": true
703
+ }
704
+ }
705
+ },
706
+ "ballotBox": {
707
+ "type": "string",
708
+ "minLength": 1,
709
+ "maxLength": 2048,
710
+ "description": "The DID of the voting service that holds the board."
711
+ },
712
+ "trustees": {
713
+ "$ref": "#/$defs/Trustees"
714
+ },
715
+ "binding": {
716
+ "type": "boolean",
717
+ "description": "Whether the community treats the result as deciding something; creating a binding election takes another administrator's consent (VTI-VOT-081)."
718
+ },
719
+ "allowEarlyClose": {
720
+ "type": "boolean"
721
+ },
722
+ "resultsBeforeClose": {
723
+ "type": "boolean",
724
+ "description": "Open elections only: whether running totals may be read while voting is open (VTI-VOT-061)."
725
+ },
726
+ "textReleaseThreshold": {
727
+ "type": "integer",
728
+ "minimum": 10,
729
+ "description": "Counted ballots required before any text answer is disclosed (VTI-VOT-065)."
730
+ }
731
+ }
732
+ },
733
+ "Trustees": {
734
+ "title": "Trustees",
735
+ "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.",
736
+ "type": "object",
737
+ "additionalProperties": false,
738
+ "required": [
739
+ "dids",
740
+ "threshold"
741
+ ],
742
+ "properties": {
743
+ "dids": {
744
+ "type": "array",
745
+ "minItems": 2,
746
+ "items": {
747
+ "type": "string",
748
+ "minLength": 1,
749
+ "maxLength": 2048
750
+ },
751
+ "uniqueItems": true
752
+ },
753
+ "threshold": {
754
+ "type": "integer",
755
+ "minimum": 2
756
+ }
757
+ }
758
+ },
759
+ "BoardVisibility": {
760
+ "title": "BoardVisibility",
761
+ "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).",
762
+ "type": "string",
763
+ "enum": [
764
+ "public",
765
+ "private"
766
+ ]
767
+ },
768
+ "Revote": {
769
+ "title": "Revote",
770
+ "description": "What a later, different ballot under one ticket does: `replace` the earlier one, or be refused (`refuse`) (VTI-VOT-041).",
771
+ "type": "string",
772
+ "enum": [
773
+ "replace",
774
+ "refuse"
775
+ ]
776
+ },
777
+ "RollRule": {
778
+ "title": "RollRule",
779
+ "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.",
780
+ "type": "object",
781
+ "additionalProperties": false,
782
+ "required": [
783
+ "rule"
784
+ ],
785
+ "properties": {
786
+ "rule": {
787
+ "type": "string",
788
+ "enum": [
789
+ "members",
790
+ "membersAndListed",
791
+ "listed"
792
+ ]
793
+ },
794
+ "listed": {
795
+ "type": "array",
796
+ "items": {
797
+ "type": "string",
798
+ "minLength": 1,
799
+ "maxLength": 2048,
800
+ "description": "A DID enfranchised by name."
801
+ },
802
+ "uniqueItems": true
803
+ }
804
+ }
805
+ },
806
+ "SecrecyLevel": {
807
+ "title": "SecrecyLevel",
808
+ "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).",
809
+ "type": "string",
810
+ "enum": [
811
+ "open",
812
+ "sealed",
813
+ "talliedEncrypted"
814
+ ]
815
+ },
816
+ "Question": {
817
+ "title": "Question",
818
+ "description": "One question. Tagged union over `type`.",
819
+ "oneOf": [
820
+ {
821
+ "title": "ChoiceQuestion",
822
+ "description": "Select between `minSelections` and `maxSelections` of `options`. A yes/no/abstain motion is a choice of exactly one of three.",
823
+ "type": "object",
824
+ "additionalProperties": false,
825
+ "required": [
826
+ "key",
827
+ "type",
828
+ "options",
829
+ "minSelections",
830
+ "maxSelections",
831
+ "optional"
832
+ ],
833
+ "properties": {
834
+ "key": {
835
+ "$ref": "#/$defs/Key"
836
+ },
837
+ "type": {
838
+ "const": "choice"
839
+ },
840
+ "text": {
841
+ "type": "string",
842
+ "maxLength": 2048
843
+ },
844
+ "options": {
845
+ "type": "array",
846
+ "minItems": 2,
847
+ "maxItems": 256,
848
+ "items": {
849
+ "$ref": "#/$defs/QuestionOption"
850
+ }
851
+ },
852
+ "minSelections": {
853
+ "type": "integer",
854
+ "minimum": 0
855
+ },
856
+ "maxSelections": {
857
+ "type": "integer",
858
+ "minimum": 1
859
+ },
860
+ "optional": {
861
+ "type": "boolean"
862
+ }
863
+ }
864
+ },
865
+ {
866
+ "title": "RankingQuestion",
867
+ "description": "Order `options`; a ballot ranks every option or, when `partial` is true, a prefix of them.",
868
+ "type": "object",
869
+ "additionalProperties": false,
870
+ "required": [
871
+ "key",
872
+ "type",
873
+ "options",
874
+ "partial",
875
+ "optional"
876
+ ],
877
+ "properties": {
878
+ "key": {
879
+ "$ref": "#/$defs/Key"
880
+ },
881
+ "type": {
882
+ "const": "ranking"
883
+ },
884
+ "text": {
885
+ "type": "string",
886
+ "maxLength": 2048
887
+ },
888
+ "options": {
889
+ "type": "array",
890
+ "minItems": 2,
891
+ "maxItems": 64,
892
+ "items": {
893
+ "$ref": "#/$defs/QuestionOption"
894
+ }
895
+ },
896
+ "partial": {
897
+ "type": "boolean"
898
+ },
899
+ "optional": {
900
+ "type": "boolean"
901
+ }
902
+ }
903
+ },
904
+ {
905
+ "title": "ScoreQuestion",
906
+ "description": "Give each option an integer score within [min, max].",
907
+ "type": "object",
908
+ "additionalProperties": false,
909
+ "required": [
910
+ "key",
911
+ "type",
912
+ "options",
913
+ "min",
914
+ "max",
915
+ "optional"
916
+ ],
917
+ "properties": {
918
+ "key": {
919
+ "$ref": "#/$defs/Key"
920
+ },
921
+ "type": {
922
+ "const": "score"
923
+ },
924
+ "text": {
925
+ "type": "string",
926
+ "maxLength": 2048
927
+ },
928
+ "options": {
929
+ "type": "array",
930
+ "minItems": 1,
931
+ "maxItems": 256,
932
+ "items": {
933
+ "$ref": "#/$defs/QuestionOption"
934
+ }
935
+ },
936
+ "min": {
937
+ "type": "integer"
938
+ },
939
+ "max": {
940
+ "type": "integer"
941
+ },
942
+ "optional": {
943
+ "type": "boolean"
944
+ }
945
+ }
946
+ },
947
+ {
948
+ "title": "TextQuestion",
949
+ "description": "Free text of at most `maxLength` characters.",
950
+ "type": "object",
951
+ "additionalProperties": false,
952
+ "required": [
953
+ "key",
954
+ "type",
955
+ "maxLength",
956
+ "optional"
957
+ ],
958
+ "properties": {
959
+ "key": {
960
+ "$ref": "#/$defs/Key"
961
+ },
962
+ "type": {
963
+ "const": "text"
964
+ },
965
+ "text": {
966
+ "type": "string",
967
+ "maxLength": 2048
968
+ },
969
+ "maxLength": {
970
+ "type": "integer",
971
+ "minimum": 1,
972
+ "maximum": 4096
973
+ },
974
+ "optional": {
975
+ "type": "boolean"
976
+ }
977
+ }
978
+ }
979
+ ]
980
+ },
981
+ "Key": {
982
+ "title": "Key",
983
+ "description": "A question or option key, unique within its manifest or question.",
984
+ "type": "string",
985
+ "pattern": "^[A-Za-z0-9._-]{1,64}$"
986
+ },
987
+ "QuestionOption": {
988
+ "title": "QuestionOption",
989
+ "type": "object",
990
+ "additionalProperties": false,
991
+ "required": [
992
+ "key"
993
+ ],
994
+ "properties": {
995
+ "key": {
996
+ "$ref": "#/$defs/Key"
997
+ },
998
+ "label": {
999
+ "type": "string",
1000
+ "maxLength": 512,
1001
+ "description": "Display text. Absent from a manifest registered with a ballot box that holds no question text (VTI-VOT-014)."
1002
+ }
1003
+ }
1004
+ },
1005
+ "ElectionId": {
1006
+ "title": "ElectionId",
1007
+ "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.",
1008
+ "type": "string",
1009
+ "pattern": "^[A-Za-z0-9._-]{1,128}$"
1010
+ }
1011
+ }
1012
+ };
1013
+ /**
1014
+ * SPEC.md §7.2 policy for the request variant, from this specification's
1015
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
1016
+ * per-specification and cannot be derived from the document alone, and
1017
+ * item 2 needs the schema this carries.
1018
+ */
1019
+ export const SPEC = {
1020
+ typeUri: TYPE_URI,
1021
+ isBearer: false,
1022
+ isProofRequired: true,
1023
+ isRecipientRequired: true,
1024
+ isIssuedAtRequired: true,
1025
+ payloadSchema: PAYLOAD_SCHEMA,
1026
+ };
1027
+ /**
1028
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
1029
+ * tracks the *issuer* party's requirement because a response swaps the
1030
+ * parties (§7.3 item 5).
1031
+ */
1032
+ export const RESPONSE_SPEC = {
1033
+ typeUri: RESPONSE_TYPE_URI,
1034
+ isBearer: false,
1035
+ isProofRequired: false,
1036
+ isRecipientRequired: true,
1037
+ isIssuedAtRequired: true,
1038
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
1039
+ };
1040
+ //# sourceMappingURL=payload.js.map