@openvtc/trust-tasks 0.26.20 → 0.26.22

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