@openvtc/trust-tasks 0.26.29 → 0.27.1

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