@openvtc/trust-tasks 0.28.5 → 0.28.7

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 (187) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/_shared/components.d.ts +45 -0
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/index.d.ts +42 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +42 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/voting/_shared/0.3/voting.d.ts +16 -0
  9. package/dist/voting/_shared/0.3/voting.d.ts.map +1 -0
  10. package/dist/voting/_shared/0.3/voting.js +6 -0
  11. package/dist/voting/_shared/0.3/voting.js.map +1 -0
  12. package/dist/voting/election/register/0.1/payload.d.ts +4 -4
  13. package/dist/voting/election/register/0.1/payload.js +1 -1
  14. package/dist/voting/election/register/0.2/payload.d.ts +13 -2
  15. package/dist/voting/election/register/0.2/payload.d.ts.map +1 -1
  16. package/dist/voting/election/register/0.2/payload.js +1 -1
  17. package/dist/voting/election/register/0.2/payload.js.map +1 -1
  18. package/dist/voting/election/register/0.3/payload.d.ts +1934 -0
  19. package/dist/voting/election/register/0.3/payload.d.ts.map +1 -0
  20. package/dist/voting/election/register/0.3/payload.js +1180 -0
  21. package/dist/voting/election/register/0.3/payload.js.map +1 -0
  22. package/dist/voting/election/show/0.1/payload.d.ts +4 -4
  23. package/dist/voting/election/show/0.1/payload.js +1 -1
  24. package/dist/voting/election/show/0.2/payload.d.ts +13 -2
  25. package/dist/voting/election/show/0.2/payload.d.ts.map +1 -1
  26. package/dist/voting/election/show/0.2/payload.js +1 -1
  27. package/dist/voting/election/show/0.2/payload.js.map +1 -1
  28. package/dist/voting/election/show/0.3/payload.d.ts +1838 -0
  29. package/dist/voting/election/show/0.3/payload.d.ts.map +1 -0
  30. package/dist/voting/election/show/0.3/payload.js +1126 -0
  31. package/dist/voting/election/show/0.3/payload.js.map +1 -0
  32. package/dist/vta/pcs/trustee/deal/0.2/payload.d.ts +4 -4
  33. package/dist/vta/pcs/trustee/deal/0.2/payload.js +1 -1
  34. package/dist/vta/pcs/trustee/deal/0.3/payload.d.ts +13 -2
  35. package/dist/vta/pcs/trustee/deal/0.3/payload.d.ts.map +1 -1
  36. package/dist/vta/pcs/trustee/deal/0.3/payload.js +1 -1
  37. package/dist/vta/pcs/trustee/deal/0.3/payload.js.map +1 -1
  38. package/dist/vta/pcs/trustee/deal/0.4/payload.d.ts +1846 -0
  39. package/dist/vta/pcs/trustee/deal/0.4/payload.d.ts.map +1 -0
  40. package/dist/vta/pcs/trustee/deal/0.4/payload.js +1091 -0
  41. package/dist/vta/pcs/trustee/deal/0.4/payload.js.map +1 -0
  42. package/dist/vta/pcs/trustee/enrol/0.1/payload.d.ts +4 -4
  43. package/dist/vta/pcs/trustee/enrol/0.1/payload.js +1 -1
  44. package/dist/vta/pcs/trustee/enrol/0.2/payload.d.ts +13 -2
  45. package/dist/vta/pcs/trustee/enrol/0.2/payload.d.ts.map +1 -1
  46. package/dist/vta/pcs/trustee/enrol/0.2/payload.js +1 -1
  47. package/dist/vta/pcs/trustee/enrol/0.2/payload.js.map +1 -1
  48. package/dist/vta/pcs/trustee/enrol/0.3/payload.d.ts +1770 -0
  49. package/dist/vta/pcs/trustee/enrol/0.3/payload.d.ts.map +1 -0
  50. package/dist/vta/pcs/trustee/enrol/0.3/payload.js +1054 -0
  51. package/dist/vta/pcs/trustee/enrol/0.3/payload.js.map +1 -0
  52. package/dist/vta/pcs/trustee/justify/0.2/payload.d.ts +4 -4
  53. package/dist/vta/pcs/trustee/justify/0.2/payload.js +1 -1
  54. package/dist/vta/pcs/trustee/justify/0.3/payload.d.ts +13 -2
  55. package/dist/vta/pcs/trustee/justify/0.3/payload.d.ts.map +1 -1
  56. package/dist/vta/pcs/trustee/justify/0.3/payload.js +1 -1
  57. package/dist/vta/pcs/trustee/justify/0.3/payload.js.map +1 -1
  58. package/dist/vta/pcs/trustee/justify/0.4/payload.d.ts +1881 -0
  59. package/dist/vta/pcs/trustee/justify/0.4/payload.d.ts.map +1 -0
  60. package/dist/vta/pcs/trustee/justify/0.4/payload.js +1109 -0
  61. package/dist/vta/pcs/trustee/justify/0.4/payload.js.map +1 -0
  62. package/dist/vta/pcs/trustee/keys/0.2/payload.d.ts +4 -4
  63. package/dist/vta/pcs/trustee/keys/0.2/payload.js +1 -1
  64. package/dist/vta/pcs/trustee/keys/0.3/payload.d.ts +13 -2
  65. package/dist/vta/pcs/trustee/keys/0.3/payload.d.ts.map +1 -1
  66. package/dist/vta/pcs/trustee/keys/0.3/payload.js +1 -1
  67. package/dist/vta/pcs/trustee/keys/0.3/payload.js.map +1 -1
  68. package/dist/vta/pcs/trustee/keys/0.4/payload.d.ts +1926 -0
  69. package/dist/vta/pcs/trustee/keys/0.4/payload.d.ts.map +1 -0
  70. package/dist/vta/pcs/trustee/keys/0.4/payload.js +1129 -0
  71. package/dist/vta/pcs/trustee/keys/0.4/payload.js.map +1 -0
  72. package/dist/vta/pcs/trustee/read/0.1/payload.d.ts +4 -4
  73. package/dist/vta/pcs/trustee/read/0.1/payload.js +1 -1
  74. package/dist/vta/pcs/trustee/read/0.2/payload.d.ts +14 -2
  75. package/dist/vta/pcs/trustee/read/0.2/payload.d.ts.map +1 -1
  76. package/dist/vta/pcs/trustee/read/0.2/payload.js +1 -1
  77. package/dist/vta/pcs/trustee/read/0.2/payload.js.map +1 -1
  78. package/dist/vta/pcs/trustee/read/0.3/payload.d.ts +540 -0
  79. package/dist/vta/pcs/trustee/read/0.3/payload.d.ts.map +1 -0
  80. package/dist/vta/pcs/trustee/read/0.3/payload.js +304 -0
  81. package/dist/vta/pcs/trustee/read/0.3/payload.js.map +1 -0
  82. package/dist/vta/pcs/vote/0.1/payload.d.ts +4 -4
  83. package/dist/vta/pcs/vote/0.1/payload.js +1 -1
  84. package/dist/vta/pcs/vote/0.2/payload.d.ts +13 -2
  85. package/dist/vta/pcs/vote/0.2/payload.d.ts.map +1 -1
  86. package/dist/vta/pcs/vote/0.2/payload.js +1 -1
  87. package/dist/vta/pcs/vote/0.2/payload.js.map +1 -1
  88. package/dist/vta/pcs/vote/0.3/payload.d.ts +2222 -0
  89. package/dist/vta/pcs/vote/0.3/payload.d.ts.map +1 -0
  90. package/dist/vta/pcs/vote/0.3/payload.js +1296 -0
  91. package/dist/vta/pcs/vote/0.3/payload.js.map +1 -0
  92. package/dist/vta/pcs/vote-encrypted/0.2/payload.d.ts +4 -4
  93. package/dist/vta/pcs/vote-encrypted/0.2/payload.js +1 -1
  94. package/dist/vta/pcs/vote-encrypted/0.3/payload.d.ts +13 -2
  95. package/dist/vta/pcs/vote-encrypted/0.3/payload.d.ts.map +1 -1
  96. package/dist/vta/pcs/vote-encrypted/0.3/payload.js +1 -1
  97. package/dist/vta/pcs/vote-encrypted/0.3/payload.js.map +1 -1
  98. package/dist/vta/pcs/vote-encrypted/0.4/payload.d.ts +2242 -0
  99. package/dist/vta/pcs/vote-encrypted/0.4/payload.d.ts.map +1 -0
  100. package/dist/vta/pcs/vote-encrypted/0.4/payload.js +1314 -0
  101. package/dist/vta/pcs/vote-encrypted/0.4/payload.js.map +1 -0
  102. package/dist/vta/pcs/voter/read/0.1/payload.d.ts +4 -4
  103. package/dist/vta/pcs/voter/read/0.1/payload.js +1 -1
  104. package/dist/vta/pcs/voter/read/0.2/payload.d.ts +14 -2
  105. package/dist/vta/pcs/voter/read/0.2/payload.d.ts.map +1 -1
  106. package/dist/vta/pcs/voter/read/0.2/payload.js +1 -1
  107. package/dist/vta/pcs/voter/read/0.2/payload.js.map +1 -1
  108. package/dist/vta/pcs/voter/read/0.3/payload.d.ts +503 -0
  109. package/dist/vta/pcs/voter/read/0.3/payload.d.ts.map +1 -0
  110. package/dist/vta/pcs/voter/read/0.3/payload.js +285 -0
  111. package/dist/vta/pcs/voter/read/0.3/payload.js.map +1 -0
  112. package/dist/vta/pcs/voter/register/0.1/payload.d.ts +4 -4
  113. package/dist/vta/pcs/voter/register/0.1/payload.js +1 -1
  114. package/dist/vta/pcs/voter/register/0.2/payload.d.ts +14 -2
  115. package/dist/vta/pcs/voter/register/0.2/payload.d.ts.map +1 -1
  116. package/dist/vta/pcs/voter/register/0.2/payload.js +1 -1
  117. package/dist/vta/pcs/voter/register/0.2/payload.js.map +1 -1
  118. package/dist/vta/pcs/voter/register/0.3/payload.d.ts +2176 -0
  119. package/dist/vta/pcs/voter/register/0.3/payload.d.ts.map +1 -0
  120. package/dist/vta/pcs/voter/register/0.3/payload.js +1262 -0
  121. package/dist/vta/pcs/voter/register/0.3/payload.js.map +1 -0
  122. package/dist/vtc/elections/create/0.1/payload.d.ts +4 -4
  123. package/dist/vtc/elections/create/0.1/payload.js +1 -1
  124. package/dist/vtc/elections/create/0.2/payload.d.ts +4 -4
  125. package/dist/vtc/elections/create/0.2/payload.js +1 -1
  126. package/dist/vtc/elections/create/0.3/payload.d.ts +14 -2
  127. package/dist/vtc/elections/create/0.3/payload.d.ts.map +1 -1
  128. package/dist/vtc/elections/create/0.3/payload.js +1 -1
  129. package/dist/vtc/elections/create/0.3/payload.js.map +1 -1
  130. package/dist/vtc/elections/create/0.4/payload.d.ts +1670 -0
  131. package/dist/vtc/elections/create/0.4/payload.d.ts.map +1 -0
  132. package/dist/vtc/elections/create/0.4/payload.js +1008 -0
  133. package/dist/vtc/elections/create/0.4/payload.js.map +1 -0
  134. package/dist/vtc/elections/show/0.1/payload.d.ts +4 -4
  135. package/dist/vtc/elections/show/0.1/payload.js +1 -1
  136. package/dist/vtc/elections/show/0.2/payload.d.ts +14 -2
  137. package/dist/vtc/elections/show/0.2/payload.d.ts.map +1 -1
  138. package/dist/vtc/elections/show/0.2/payload.js +1 -1
  139. package/dist/vtc/elections/show/0.2/payload.js.map +1 -1
  140. package/dist/vtc/elections/show/0.3/payload.d.ts +3022 -0
  141. package/dist/vtc/elections/show/0.3/payload.d.ts.map +1 -0
  142. package/dist/vtc/elections/show/0.3/payload.js +1765 -0
  143. package/dist/vtc/elections/show/0.3/payload.js.map +1 -0
  144. package/package.json +1 -1
  145. package/src/_shared/components.ts +45 -0
  146. package/src/index.ts +42 -0
  147. package/src/voting/_shared/0.3/voting.ts +17 -0
  148. package/src/voting/election/register/0.1/payload.ts +5 -5
  149. package/src/voting/election/register/0.2/payload.ts +14 -3
  150. package/src/voting/election/register/0.3/payload.ts +1223 -0
  151. package/src/voting/election/show/0.1/payload.ts +5 -5
  152. package/src/voting/election/show/0.2/payload.ts +14 -3
  153. package/src/voting/election/show/0.3/payload.ts +1165 -0
  154. package/src/vta/pcs/trustee/deal/0.2/payload.ts +5 -5
  155. package/src/vta/pcs/trustee/deal/0.3/payload.ts +14 -3
  156. package/src/vta/pcs/trustee/deal/0.4/payload.ts +1164 -0
  157. package/src/vta/pcs/trustee/enrol/0.1/payload.ts +5 -5
  158. package/src/vta/pcs/trustee/enrol/0.2/payload.ts +14 -3
  159. package/src/vta/pcs/trustee/enrol/0.3/payload.ts +1123 -0
  160. package/src/vta/pcs/trustee/justify/0.2/payload.ts +5 -5
  161. package/src/vta/pcs/trustee/justify/0.3/payload.ts +14 -3
  162. package/src/vta/pcs/trustee/justify/0.4/payload.ts +1183 -0
  163. package/src/vta/pcs/trustee/keys/0.2/payload.ts +5 -5
  164. package/src/vta/pcs/trustee/keys/0.3/payload.ts +14 -3
  165. package/src/vta/pcs/trustee/keys/0.4/payload.ts +1210 -0
  166. package/src/vta/pcs/trustee/read/0.1/payload.ts +5 -5
  167. package/src/vta/pcs/trustee/read/0.2/payload.ts +15 -3
  168. package/src/vta/pcs/trustee/read/0.3/payload.ts +385 -0
  169. package/src/vta/pcs/vote/0.1/payload.ts +5 -5
  170. package/src/vta/pcs/vote/0.2/payload.ts +14 -3
  171. package/src/vta/pcs/vote/0.3/payload.ts +1381 -0
  172. package/src/vta/pcs/vote-encrypted/0.2/payload.ts +5 -5
  173. package/src/vta/pcs/vote-encrypted/0.3/payload.ts +14 -3
  174. package/src/vta/pcs/vote-encrypted/0.4/payload.ts +1385 -0
  175. package/src/vta/pcs/voter/read/0.1/payload.ts +5 -5
  176. package/src/vta/pcs/voter/read/0.2/payload.ts +15 -3
  177. package/src/vta/pcs/voter/read/0.3/payload.ts +363 -0
  178. package/src/vta/pcs/voter/register/0.1/payload.ts +5 -5
  179. package/src/vta/pcs/voter/register/0.2/payload.ts +15 -3
  180. package/src/vta/pcs/voter/register/0.3/payload.ts +1372 -0
  181. package/src/vtc/elections/create/0.1/payload.ts +5 -5
  182. package/src/vtc/elections/create/0.2/payload.ts +5 -5
  183. package/src/vtc/elections/create/0.3/payload.ts +15 -3
  184. package/src/vtc/elections/create/0.4/payload.ts +1057 -0
  185. package/src/vtc/elections/show/0.1/payload.ts +5 -5
  186. package/src/vtc/elections/show/0.2/payload.ts +15 -3
  187. package/src/vtc/elections/show/0.3/payload.ts +1865 -0
@@ -0,0 +1,1934 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/voting/election/register/0.3/payload.schema.json
4
+ */
5
+ import type { BoardHead, BoardVisibility, ChoiceQuestion, DigestMultibase, ElectionId, ElectionState, ElectionSummary, Ext, Key_VotingV0_1 as Key, Manifest_VotingV0_3 as Manifest, Multibase_VotingV0_1 as Multibase, Question, QuestionOption, RankingQuestion, Revote, RollRule, ScoreQuestion, SecrecyLevel, TextQuestion, Trustees, VotingParameters } from "../../../../_shared/components.js";
6
+ /**
7
+ * A community registers an election it signed with the ballot box the election's manifest names. The ballot box answers with its view of the election.
8
+ */
9
+ export interface VotingElectionRegisterPayload {
10
+ /**
11
+ * The community's DID. Equal to the proven signer and to `manifest.community`.
12
+ */
13
+ community: string;
14
+ manifest: Manifest;
15
+ /**
16
+ * The SHA-256 multihash of the RFC 8785 (JCS) canonicalization of `manifest`, as the community computed it.
17
+ */
18
+ manifestDigest: DigestMultibase;
19
+ /**
20
+ * The community's voting parameters: the key the election's tickets are issued under, which every cast's attestation is checked against.
21
+ */
22
+ parameters: VotingParameters;
23
+ ext?: Ext;
24
+ }
25
+ export interface VotingElectionRegisterResponsePayload {
26
+ election: ElectionSummary;
27
+ ext?: Ext;
28
+ }
29
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
30
+ export type { BoardHead, BoardVisibility, ChoiceQuestion, DigestMultibase, ElectionId, ElectionState, ElectionSummary, Ext, Key, Manifest, Multibase, Question, QuestionOption, RankingQuestion, Revote, RollRule, ScoreQuestion, SecrecyLevel, TextQuestion, Trustees, VotingParameters };
31
+ /** Trust Task type URI. */
32
+ export declare const TYPE_URI: "https://trusttasks.org/spec/voting/election/register/0.3";
33
+ /**
34
+ * The earlier version of this specification that this one declares it
35
+ * extends (front matter `extends`, SPEC §5.2 "Declared extension"), or
36
+ * `null`. Only the direct declaration — follow the chain with
37
+ * `extendsChain` / `readForSpec`.
38
+ */
39
+ export declare const EXTENDS: string | null;
40
+ /**
41
+ * Why this version is deprecated, or `null` while it is current. A
42
+ * superseded or retired version is still supported, and is withdrawn from
43
+ * this package in a later scheduled batch (SPEC "Superseded and Withdrawn
44
+ * Versions").
45
+ */
46
+ export declare const DEPRECATION: string | null;
47
+ /** Stable alias for this specification's request payload shape. */
48
+ export type Payload = VotingElectionRegisterPayload;
49
+ /** Trust Task response type URI (request type URI + "#response"). */
50
+ export declare const RESPONSE_TYPE_URI: "https://trusttasks.org/spec/voting/election/register/0.3#response";
51
+ /** Stable alias for this specification's success-response payload shape. */
52
+ export type Response = VotingElectionRegisterResponsePayload;
53
+ /**
54
+ * This specification's payload schema, as a value.
55
+ *
56
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
57
+ * rather than only as a `.json` file because TypeScript types are erased
58
+ * at runtime: without a schema a consumer has nothing to validate, and
59
+ * every REQUIRED payload member is optional in practice. Cross-file
60
+ * `$ref`s are already inlined, so it needs no resolver.
61
+ */
62
+ export declare const PAYLOAD_SCHEMA: {
63
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
64
+ readonly $id: "https://trusttasks.org/spec/voting/election/register/0.3";
65
+ readonly title: "Voting — Election Register — payload";
66
+ readonly description: "A community registers an election it signed with the ballot box the election's manifest names. The ballot box answers with its view of the election.";
67
+ readonly type: "object";
68
+ readonly additionalProperties: false;
69
+ readonly required: readonly ["community", "manifest", "manifestDigest", "parameters"];
70
+ readonly properties: {
71
+ readonly community: {
72
+ readonly type: "string";
73
+ readonly minLength: 1;
74
+ readonly maxLength: 2048;
75
+ readonly description: "The community's DID. Equal to the proven signer and to `manifest.community`.";
76
+ };
77
+ readonly manifest: {
78
+ readonly $ref: "#/$defs/Manifest";
79
+ };
80
+ readonly manifestDigest: {
81
+ readonly $ref: "#/$defs/DigestMultibase";
82
+ readonly description: "The SHA-256 multihash of the RFC 8785 (JCS) canonicalization of `manifest`, as the community computed it.";
83
+ };
84
+ readonly parameters: {
85
+ readonly $ref: "#/$defs/VotingParameters";
86
+ readonly description: "The community's voting parameters: the key the election's tickets are issued under, which every cast's attestation is checked against.";
87
+ };
88
+ readonly ext: {
89
+ readonly $ref: "#/$defs/Ext";
90
+ };
91
+ };
92
+ readonly $defs: {
93
+ readonly Response: {
94
+ readonly $anchor: "response";
95
+ readonly title: "Voting — Election Register — response payload";
96
+ readonly type: "object";
97
+ readonly additionalProperties: false;
98
+ readonly required: readonly ["election"];
99
+ readonly properties: {
100
+ readonly election: {
101
+ readonly $ref: "#/$defs/ElectionSummary";
102
+ };
103
+ readonly ext: {
104
+ readonly $ref: "#/$defs/Ext";
105
+ };
106
+ };
107
+ };
108
+ readonly Ext: {
109
+ readonly title: "Ext";
110
+ readonly 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.";
111
+ readonly type: "object";
112
+ readonly minProperties: 1;
113
+ readonly additionalProperties: true;
114
+ readonly propertyNames: {
115
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
116
+ };
117
+ };
118
+ readonly ElectionSummary: {
119
+ readonly title: "ElectionSummary";
120
+ readonly description: "A ballot box's view of one election.";
121
+ readonly type: "object";
122
+ readonly additionalProperties: false;
123
+ readonly required: readonly ["electionId", "community", "manifestDigest", "state", "ballotsAdmitted", "head"];
124
+ readonly properties: {
125
+ readonly electionId: {
126
+ readonly $ref: "#/$defs/ElectionId";
127
+ };
128
+ readonly community: {
129
+ readonly type: "string";
130
+ readonly minLength: 1;
131
+ readonly maxLength: 2048;
132
+ };
133
+ readonly manifestDigest: {
134
+ readonly $ref: "#/$defs/DigestMultibase";
135
+ };
136
+ readonly state: {
137
+ readonly $ref: "#/$defs/ElectionState";
138
+ };
139
+ readonly ballotsAdmitted: {
140
+ readonly type: "integer";
141
+ readonly minimum: 0;
142
+ readonly description: "Distinct tags with a counted ballot.";
143
+ };
144
+ readonly head: {
145
+ readonly $ref: "#/$defs/BoardHead";
146
+ };
147
+ };
148
+ };
149
+ readonly BoardHead: {
150
+ readonly title: "BoardHead";
151
+ readonly description: "A board's tree head (RFC 9162 §2.1). A head is signed by being carried in a document the ballot box signs; whoever keeps a head keeps that whole document.";
152
+ readonly type: "object";
153
+ readonly additionalProperties: false;
154
+ readonly required: readonly ["electionId", "treeSize", "rootHash", "issuedAt"];
155
+ readonly properties: {
156
+ readonly electionId: {
157
+ readonly $ref: "#/$defs/ElectionId";
158
+ };
159
+ readonly treeSize: {
160
+ readonly type: "integer";
161
+ readonly minimum: 0;
162
+ };
163
+ readonly rootHash: {
164
+ readonly $ref: "#/$defs/DigestMultibase";
165
+ readonly description: "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash.";
166
+ };
167
+ readonly issuedAt: {
168
+ readonly type: "string";
169
+ readonly format: "date-time";
170
+ };
171
+ };
172
+ };
173
+ readonly ElectionId: {
174
+ readonly title: "ElectionId";
175
+ readonly 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.";
176
+ readonly type: "string";
177
+ readonly pattern: "^[A-Za-z0-9._-]{1,128}$";
178
+ };
179
+ readonly DigestMultibase: {
180
+ readonly title: "DigestMultibase";
181
+ readonly 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`.";
182
+ readonly type: "string";
183
+ readonly minLength: 16;
184
+ readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
185
+ readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
186
+ };
187
+ readonly ElectionState: {
188
+ readonly title: "ElectionState";
189
+ readonly type: "string";
190
+ readonly enum: readonly ["registered", "registration", "voting", "closed", "tallied", "cancelled"];
191
+ };
192
+ readonly VotingParameters: {
193
+ readonly title: "VotingParameters";
194
+ readonly description: "The community's published voting parameters: the PCS suite and the voting verification key tickets are issued under (VTI-VOT-020). Distinct from its hidden-vetting helper key.";
195
+ readonly type: "object";
196
+ readonly additionalProperties: false;
197
+ readonly required: readonly ["suite", "votingKey"];
198
+ readonly properties: {
199
+ readonly suite: {
200
+ readonly type: "string";
201
+ readonly const: "ps-ddh-bls12381";
202
+ };
203
+ readonly votingKey: {
204
+ readonly $ref: "#/$defs/Multibase";
205
+ };
206
+ };
207
+ };
208
+ readonly Multibase: {
209
+ readonly title: "Multibase";
210
+ readonly description: "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.";
211
+ readonly type: "string";
212
+ readonly maxLength: 16384;
213
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
214
+ };
215
+ readonly Manifest: {
216
+ readonly title: "Manifest";
217
+ readonly 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).";
218
+ readonly type: "object";
219
+ readonly additionalProperties: false;
220
+ readonly required: readonly ["electionId", "community", "questions", "secrecy", "roll", "registrationOpensAt", "votingOpensAt", "votingClosesAt", "revote", "board", "ballotBox", "binding", "allowEarlyClose", "resultsBeforeClose", "textReleaseThreshold"];
221
+ readonly properties: {
222
+ readonly electionId: {
223
+ readonly $ref: "#/$defs/ElectionId";
224
+ };
225
+ readonly community: {
226
+ readonly type: "string";
227
+ readonly minLength: 1;
228
+ readonly maxLength: 2048;
229
+ readonly description: "The community's DID.";
230
+ };
231
+ readonly title: {
232
+ readonly type: "string";
233
+ readonly maxLength: 512;
234
+ };
235
+ readonly description: {
236
+ readonly type: "string";
237
+ readonly maxLength: 8192;
238
+ };
239
+ readonly questions: {
240
+ readonly type: "array";
241
+ readonly minItems: 1;
242
+ readonly maxItems: 128;
243
+ readonly items: {
244
+ readonly $ref: "#/$defs/Question";
245
+ };
246
+ };
247
+ readonly secrecy: {
248
+ readonly $ref: "#/$defs/SecrecyLevel";
249
+ };
250
+ readonly roll: {
251
+ readonly $ref: "#/$defs/RollRule";
252
+ };
253
+ readonly registrationOpensAt: {
254
+ readonly type: "string";
255
+ readonly format: "date-time";
256
+ };
257
+ readonly votingOpensAt: {
258
+ readonly type: "string";
259
+ readonly format: "date-time";
260
+ };
261
+ readonly votingClosesAt: {
262
+ readonly type: "string";
263
+ readonly format: "date-time";
264
+ };
265
+ readonly revote: {
266
+ readonly $ref: "#/$defs/Revote";
267
+ };
268
+ readonly board: {
269
+ readonly type: "object";
270
+ readonly additionalProperties: false;
271
+ readonly required: readonly ["visibility", "auditors"];
272
+ readonly properties: {
273
+ readonly visibility: {
274
+ readonly $ref: "#/$defs/BoardVisibility";
275
+ };
276
+ readonly auditors: {
277
+ readonly type: "array";
278
+ readonly items: {
279
+ readonly type: "string";
280
+ readonly minLength: 1;
281
+ readonly maxLength: 2048;
282
+ };
283
+ readonly uniqueItems: true;
284
+ };
285
+ };
286
+ };
287
+ readonly ballotBox: {
288
+ readonly type: "string";
289
+ readonly minLength: 1;
290
+ readonly maxLength: 2048;
291
+ readonly description: "The DID of the voting service that holds the board.";
292
+ };
293
+ readonly trustees: {
294
+ readonly $ref: "#/$defs/Trustees";
295
+ };
296
+ readonly binding: {
297
+ readonly type: "boolean";
298
+ readonly description: "Whether the community treats the result as deciding something; creating a binding election takes another administrator's consent (VTI-VOT-081).";
299
+ };
300
+ readonly allowEarlyClose: {
301
+ readonly type: "boolean";
302
+ };
303
+ readonly resultsBeforeClose: {
304
+ readonly type: "boolean";
305
+ readonly description: "Open elections only: whether running totals may be read while voting is open (VTI-VOT-061).";
306
+ };
307
+ readonly textReleaseThreshold: {
308
+ readonly type: "integer";
309
+ readonly minimum: 1;
310
+ readonly description: "Counted ballots required before any text answer is disclosed (VTI-VOT-065). At least 1, and SHOULD be at least 10: a written answer can identify its author by what it says or how it is phrased, and the fewer the ballots released together, the easier that is. Where it is below 10, the disclosure a member is shown before they request a ticket MUST say so, and MUST say that a written answer may identify its author (VTI-VOT-090).";
311
+ };
312
+ };
313
+ };
314
+ readonly Trustees: {
315
+ readonly title: "Trustees";
316
+ readonly 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.";
317
+ readonly type: "object";
318
+ readonly additionalProperties: false;
319
+ readonly required: readonly ["dids", "threshold"];
320
+ readonly properties: {
321
+ readonly dids: {
322
+ readonly type: "array";
323
+ readonly minItems: 2;
324
+ readonly items: {
325
+ readonly type: "string";
326
+ readonly minLength: 1;
327
+ readonly maxLength: 2048;
328
+ };
329
+ readonly uniqueItems: true;
330
+ };
331
+ readonly threshold: {
332
+ readonly type: "integer";
333
+ readonly minimum: 2;
334
+ };
335
+ };
336
+ };
337
+ readonly BoardVisibility: {
338
+ readonly title: "BoardVisibility";
339
+ readonly 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).";
340
+ readonly type: "string";
341
+ readonly enum: readonly ["public", "private"];
342
+ };
343
+ readonly Revote: {
344
+ readonly title: "Revote";
345
+ readonly description: "What a later, different ballot under one ticket does: `replace` the earlier one, or be refused (`refuse`) (VTI-VOT-041).";
346
+ readonly type: "string";
347
+ readonly enum: readonly ["replace", "refuse"];
348
+ };
349
+ readonly RollRule: {
350
+ readonly title: "RollRule";
351
+ readonly 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.";
352
+ readonly type: "object";
353
+ readonly additionalProperties: false;
354
+ readonly required: readonly ["rule"];
355
+ readonly properties: {
356
+ readonly rule: {
357
+ readonly type: "string";
358
+ readonly enum: readonly ["members", "membersAndListed", "listed"];
359
+ };
360
+ readonly listed: {
361
+ readonly type: "array";
362
+ readonly items: {
363
+ readonly type: "string";
364
+ readonly minLength: 1;
365
+ readonly maxLength: 2048;
366
+ readonly description: "A DID enfranchised by name.";
367
+ };
368
+ readonly uniqueItems: true;
369
+ };
370
+ };
371
+ };
372
+ readonly SecrecyLevel: {
373
+ readonly title: "SecrecyLevel";
374
+ readonly 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).";
375
+ readonly type: "string";
376
+ readonly enum: readonly ["open", "sealed", "talliedEncrypted"];
377
+ };
378
+ readonly Question: {
379
+ readonly title: "Question";
380
+ readonly description: "One question. Tagged union over `type`.";
381
+ readonly oneOf: readonly [{
382
+ readonly title: "ChoiceQuestion";
383
+ readonly description: "Select between `minSelections` and `maxSelections` of `options`. A yes/no/abstain motion is a choice of exactly one of three.";
384
+ readonly type: "object";
385
+ readonly additionalProperties: false;
386
+ readonly required: readonly ["key", "type", "options", "minSelections", "maxSelections", "optional"];
387
+ readonly properties: {
388
+ readonly key: {
389
+ readonly $ref: "#/$defs/Key";
390
+ };
391
+ readonly type: {
392
+ readonly const: "choice";
393
+ };
394
+ readonly text: {
395
+ readonly type: "string";
396
+ readonly maxLength: 2048;
397
+ };
398
+ readonly options: {
399
+ readonly type: "array";
400
+ readonly minItems: 2;
401
+ readonly maxItems: 256;
402
+ readonly items: {
403
+ readonly $ref: "#/$defs/QuestionOption";
404
+ };
405
+ };
406
+ readonly minSelections: {
407
+ readonly type: "integer";
408
+ readonly minimum: 0;
409
+ };
410
+ readonly maxSelections: {
411
+ readonly type: "integer";
412
+ readonly minimum: 1;
413
+ };
414
+ readonly optional: {
415
+ readonly type: "boolean";
416
+ };
417
+ };
418
+ }, {
419
+ readonly title: "RankingQuestion";
420
+ readonly description: "Order `options`; a ballot ranks every option or, when `partial` is true, a prefix of them.";
421
+ readonly type: "object";
422
+ readonly additionalProperties: false;
423
+ readonly required: readonly ["key", "type", "options", "partial", "optional"];
424
+ readonly properties: {
425
+ readonly key: {
426
+ readonly $ref: "#/$defs/Key";
427
+ };
428
+ readonly type: {
429
+ readonly const: "ranking";
430
+ };
431
+ readonly text: {
432
+ readonly type: "string";
433
+ readonly maxLength: 2048;
434
+ };
435
+ readonly options: {
436
+ readonly type: "array";
437
+ readonly minItems: 2;
438
+ readonly maxItems: 64;
439
+ readonly items: {
440
+ readonly $ref: "#/$defs/QuestionOption";
441
+ };
442
+ };
443
+ readonly partial: {
444
+ readonly type: "boolean";
445
+ };
446
+ readonly optional: {
447
+ readonly type: "boolean";
448
+ };
449
+ };
450
+ }, {
451
+ readonly title: "ScoreQuestion";
452
+ readonly description: "Give each option an integer score within [min, max].";
453
+ readonly type: "object";
454
+ readonly additionalProperties: false;
455
+ readonly required: readonly ["key", "type", "options", "min", "max", "optional"];
456
+ readonly properties: {
457
+ readonly key: {
458
+ readonly $ref: "#/$defs/Key";
459
+ };
460
+ readonly type: {
461
+ readonly const: "score";
462
+ };
463
+ readonly text: {
464
+ readonly type: "string";
465
+ readonly maxLength: 2048;
466
+ };
467
+ readonly options: {
468
+ readonly type: "array";
469
+ readonly minItems: 1;
470
+ readonly maxItems: 256;
471
+ readonly items: {
472
+ readonly $ref: "#/$defs/QuestionOption";
473
+ };
474
+ };
475
+ readonly min: {
476
+ readonly type: "integer";
477
+ };
478
+ readonly max: {
479
+ readonly type: "integer";
480
+ };
481
+ readonly optional: {
482
+ readonly type: "boolean";
483
+ };
484
+ };
485
+ }, {
486
+ readonly title: "TextQuestion";
487
+ readonly description: "Free text of at most `maxLength` characters.";
488
+ readonly type: "object";
489
+ readonly additionalProperties: false;
490
+ readonly required: readonly ["key", "type", "maxLength", "optional"];
491
+ readonly properties: {
492
+ readonly key: {
493
+ readonly $ref: "#/$defs/Key";
494
+ };
495
+ readonly type: {
496
+ readonly const: "text";
497
+ };
498
+ readonly text: {
499
+ readonly type: "string";
500
+ readonly maxLength: 2048;
501
+ };
502
+ readonly maxLength: {
503
+ readonly type: "integer";
504
+ readonly minimum: 1;
505
+ readonly maximum: 4096;
506
+ };
507
+ readonly optional: {
508
+ readonly type: "boolean";
509
+ };
510
+ };
511
+ }];
512
+ };
513
+ readonly Key: {
514
+ readonly title: "Key";
515
+ readonly description: "A question or option key, unique within its manifest or question.";
516
+ readonly type: "string";
517
+ readonly pattern: "^[A-Za-z0-9._-]{1,64}$";
518
+ };
519
+ readonly QuestionOption: {
520
+ readonly title: "QuestionOption";
521
+ readonly type: "object";
522
+ readonly additionalProperties: false;
523
+ readonly required: readonly ["key"];
524
+ readonly properties: {
525
+ readonly key: {
526
+ readonly $ref: "#/$defs/Key";
527
+ };
528
+ readonly label: {
529
+ readonly type: "string";
530
+ readonly maxLength: 512;
531
+ readonly description: "Display text. Absent from a manifest registered with a ballot box that holds no question text (VTI-VOT-014).";
532
+ };
533
+ };
534
+ };
535
+ };
536
+ };
537
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
538
+ export declare const RESPONSE_PAYLOAD_SCHEMA: {
539
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
540
+ readonly $ref: "#/$defs/Response";
541
+ readonly $defs: {
542
+ readonly Response: {
543
+ readonly $anchor: "response";
544
+ readonly title: "Voting — Election Register — response payload";
545
+ readonly type: "object";
546
+ readonly additionalProperties: false;
547
+ readonly required: readonly ["election"];
548
+ readonly properties: {
549
+ readonly election: {
550
+ readonly $ref: "#/$defs/ElectionSummary";
551
+ };
552
+ readonly ext: {
553
+ readonly $ref: "#/$defs/Ext";
554
+ };
555
+ };
556
+ };
557
+ readonly Ext: {
558
+ readonly title: "Ext";
559
+ readonly 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.";
560
+ readonly type: "object";
561
+ readonly minProperties: 1;
562
+ readonly additionalProperties: true;
563
+ readonly propertyNames: {
564
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
565
+ };
566
+ };
567
+ readonly ElectionSummary: {
568
+ readonly title: "ElectionSummary";
569
+ readonly description: "A ballot box's view of one election.";
570
+ readonly type: "object";
571
+ readonly additionalProperties: false;
572
+ readonly required: readonly ["electionId", "community", "manifestDigest", "state", "ballotsAdmitted", "head"];
573
+ readonly properties: {
574
+ readonly electionId: {
575
+ readonly $ref: "#/$defs/ElectionId";
576
+ };
577
+ readonly community: {
578
+ readonly type: "string";
579
+ readonly minLength: 1;
580
+ readonly maxLength: 2048;
581
+ };
582
+ readonly manifestDigest: {
583
+ readonly $ref: "#/$defs/DigestMultibase";
584
+ };
585
+ readonly state: {
586
+ readonly $ref: "#/$defs/ElectionState";
587
+ };
588
+ readonly ballotsAdmitted: {
589
+ readonly type: "integer";
590
+ readonly minimum: 0;
591
+ readonly description: "Distinct tags with a counted ballot.";
592
+ };
593
+ readonly head: {
594
+ readonly $ref: "#/$defs/BoardHead";
595
+ };
596
+ };
597
+ };
598
+ readonly BoardHead: {
599
+ readonly title: "BoardHead";
600
+ readonly description: "A board's tree head (RFC 9162 §2.1). A head is signed by being carried in a document the ballot box signs; whoever keeps a head keeps that whole document.";
601
+ readonly type: "object";
602
+ readonly additionalProperties: false;
603
+ readonly required: readonly ["electionId", "treeSize", "rootHash", "issuedAt"];
604
+ readonly properties: {
605
+ readonly electionId: {
606
+ readonly $ref: "#/$defs/ElectionId";
607
+ };
608
+ readonly treeSize: {
609
+ readonly type: "integer";
610
+ readonly minimum: 0;
611
+ };
612
+ readonly rootHash: {
613
+ readonly $ref: "#/$defs/DigestMultibase";
614
+ readonly description: "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash.";
615
+ };
616
+ readonly issuedAt: {
617
+ readonly type: "string";
618
+ readonly format: "date-time";
619
+ };
620
+ };
621
+ };
622
+ readonly ElectionId: {
623
+ readonly title: "ElectionId";
624
+ readonly 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.";
625
+ readonly type: "string";
626
+ readonly pattern: "^[A-Za-z0-9._-]{1,128}$";
627
+ };
628
+ readonly DigestMultibase: {
629
+ readonly title: "DigestMultibase";
630
+ readonly 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`.";
631
+ readonly type: "string";
632
+ readonly minLength: 16;
633
+ readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
634
+ readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
635
+ };
636
+ readonly ElectionState: {
637
+ readonly title: "ElectionState";
638
+ readonly type: "string";
639
+ readonly enum: readonly ["registered", "registration", "voting", "closed", "tallied", "cancelled"];
640
+ };
641
+ readonly VotingParameters: {
642
+ readonly title: "VotingParameters";
643
+ readonly description: "The community's published voting parameters: the PCS suite and the voting verification key tickets are issued under (VTI-VOT-020). Distinct from its hidden-vetting helper key.";
644
+ readonly type: "object";
645
+ readonly additionalProperties: false;
646
+ readonly required: readonly ["suite", "votingKey"];
647
+ readonly properties: {
648
+ readonly suite: {
649
+ readonly type: "string";
650
+ readonly const: "ps-ddh-bls12381";
651
+ };
652
+ readonly votingKey: {
653
+ readonly $ref: "#/$defs/Multibase";
654
+ };
655
+ };
656
+ };
657
+ readonly Multibase: {
658
+ readonly title: "Multibase";
659
+ readonly description: "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.";
660
+ readonly type: "string";
661
+ readonly maxLength: 16384;
662
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
663
+ };
664
+ readonly Manifest: {
665
+ readonly title: "Manifest";
666
+ readonly 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).";
667
+ readonly type: "object";
668
+ readonly additionalProperties: false;
669
+ readonly required: readonly ["electionId", "community", "questions", "secrecy", "roll", "registrationOpensAt", "votingOpensAt", "votingClosesAt", "revote", "board", "ballotBox", "binding", "allowEarlyClose", "resultsBeforeClose", "textReleaseThreshold"];
670
+ readonly properties: {
671
+ readonly electionId: {
672
+ readonly $ref: "#/$defs/ElectionId";
673
+ };
674
+ readonly community: {
675
+ readonly type: "string";
676
+ readonly minLength: 1;
677
+ readonly maxLength: 2048;
678
+ readonly description: "The community's DID.";
679
+ };
680
+ readonly title: {
681
+ readonly type: "string";
682
+ readonly maxLength: 512;
683
+ };
684
+ readonly description: {
685
+ readonly type: "string";
686
+ readonly maxLength: 8192;
687
+ };
688
+ readonly questions: {
689
+ readonly type: "array";
690
+ readonly minItems: 1;
691
+ readonly maxItems: 128;
692
+ readonly items: {
693
+ readonly $ref: "#/$defs/Question";
694
+ };
695
+ };
696
+ readonly secrecy: {
697
+ readonly $ref: "#/$defs/SecrecyLevel";
698
+ };
699
+ readonly roll: {
700
+ readonly $ref: "#/$defs/RollRule";
701
+ };
702
+ readonly registrationOpensAt: {
703
+ readonly type: "string";
704
+ readonly format: "date-time";
705
+ };
706
+ readonly votingOpensAt: {
707
+ readonly type: "string";
708
+ readonly format: "date-time";
709
+ };
710
+ readonly votingClosesAt: {
711
+ readonly type: "string";
712
+ readonly format: "date-time";
713
+ };
714
+ readonly revote: {
715
+ readonly $ref: "#/$defs/Revote";
716
+ };
717
+ readonly board: {
718
+ readonly type: "object";
719
+ readonly additionalProperties: false;
720
+ readonly required: readonly ["visibility", "auditors"];
721
+ readonly properties: {
722
+ readonly visibility: {
723
+ readonly $ref: "#/$defs/BoardVisibility";
724
+ };
725
+ readonly auditors: {
726
+ readonly type: "array";
727
+ readonly items: {
728
+ readonly type: "string";
729
+ readonly minLength: 1;
730
+ readonly maxLength: 2048;
731
+ };
732
+ readonly uniqueItems: true;
733
+ };
734
+ };
735
+ };
736
+ readonly ballotBox: {
737
+ readonly type: "string";
738
+ readonly minLength: 1;
739
+ readonly maxLength: 2048;
740
+ readonly description: "The DID of the voting service that holds the board.";
741
+ };
742
+ readonly trustees: {
743
+ readonly $ref: "#/$defs/Trustees";
744
+ };
745
+ readonly binding: {
746
+ readonly type: "boolean";
747
+ readonly description: "Whether the community treats the result as deciding something; creating a binding election takes another administrator's consent (VTI-VOT-081).";
748
+ };
749
+ readonly allowEarlyClose: {
750
+ readonly type: "boolean";
751
+ };
752
+ readonly resultsBeforeClose: {
753
+ readonly type: "boolean";
754
+ readonly description: "Open elections only: whether running totals may be read while voting is open (VTI-VOT-061).";
755
+ };
756
+ readonly textReleaseThreshold: {
757
+ readonly type: "integer";
758
+ readonly minimum: 1;
759
+ readonly description: "Counted ballots required before any text answer is disclosed (VTI-VOT-065). At least 1, and SHOULD be at least 10: a written answer can identify its author by what it says or how it is phrased, and the fewer the ballots released together, the easier that is. Where it is below 10, the disclosure a member is shown before they request a ticket MUST say so, and MUST say that a written answer may identify its author (VTI-VOT-090).";
760
+ };
761
+ };
762
+ };
763
+ readonly Trustees: {
764
+ readonly title: "Trustees";
765
+ readonly 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.";
766
+ readonly type: "object";
767
+ readonly additionalProperties: false;
768
+ readonly required: readonly ["dids", "threshold"];
769
+ readonly properties: {
770
+ readonly dids: {
771
+ readonly type: "array";
772
+ readonly minItems: 2;
773
+ readonly items: {
774
+ readonly type: "string";
775
+ readonly minLength: 1;
776
+ readonly maxLength: 2048;
777
+ };
778
+ readonly uniqueItems: true;
779
+ };
780
+ readonly threshold: {
781
+ readonly type: "integer";
782
+ readonly minimum: 2;
783
+ };
784
+ };
785
+ };
786
+ readonly BoardVisibility: {
787
+ readonly title: "BoardVisibility";
788
+ readonly 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).";
789
+ readonly type: "string";
790
+ readonly enum: readonly ["public", "private"];
791
+ };
792
+ readonly Revote: {
793
+ readonly title: "Revote";
794
+ readonly description: "What a later, different ballot under one ticket does: `replace` the earlier one, or be refused (`refuse`) (VTI-VOT-041).";
795
+ readonly type: "string";
796
+ readonly enum: readonly ["replace", "refuse"];
797
+ };
798
+ readonly RollRule: {
799
+ readonly title: "RollRule";
800
+ readonly 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.";
801
+ readonly type: "object";
802
+ readonly additionalProperties: false;
803
+ readonly required: readonly ["rule"];
804
+ readonly properties: {
805
+ readonly rule: {
806
+ readonly type: "string";
807
+ readonly enum: readonly ["members", "membersAndListed", "listed"];
808
+ };
809
+ readonly listed: {
810
+ readonly type: "array";
811
+ readonly items: {
812
+ readonly type: "string";
813
+ readonly minLength: 1;
814
+ readonly maxLength: 2048;
815
+ readonly description: "A DID enfranchised by name.";
816
+ };
817
+ readonly uniqueItems: true;
818
+ };
819
+ };
820
+ };
821
+ readonly SecrecyLevel: {
822
+ readonly title: "SecrecyLevel";
823
+ readonly 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).";
824
+ readonly type: "string";
825
+ readonly enum: readonly ["open", "sealed", "talliedEncrypted"];
826
+ };
827
+ readonly Question: {
828
+ readonly title: "Question";
829
+ readonly description: "One question. Tagged union over `type`.";
830
+ readonly oneOf: readonly [{
831
+ readonly title: "ChoiceQuestion";
832
+ readonly description: "Select between `minSelections` and `maxSelections` of `options`. A yes/no/abstain motion is a choice of exactly one of three.";
833
+ readonly type: "object";
834
+ readonly additionalProperties: false;
835
+ readonly required: readonly ["key", "type", "options", "minSelections", "maxSelections", "optional"];
836
+ readonly properties: {
837
+ readonly key: {
838
+ readonly $ref: "#/$defs/Key";
839
+ };
840
+ readonly type: {
841
+ readonly const: "choice";
842
+ };
843
+ readonly text: {
844
+ readonly type: "string";
845
+ readonly maxLength: 2048;
846
+ };
847
+ readonly options: {
848
+ readonly type: "array";
849
+ readonly minItems: 2;
850
+ readonly maxItems: 256;
851
+ readonly items: {
852
+ readonly $ref: "#/$defs/QuestionOption";
853
+ };
854
+ };
855
+ readonly minSelections: {
856
+ readonly type: "integer";
857
+ readonly minimum: 0;
858
+ };
859
+ readonly maxSelections: {
860
+ readonly type: "integer";
861
+ readonly minimum: 1;
862
+ };
863
+ readonly optional: {
864
+ readonly type: "boolean";
865
+ };
866
+ };
867
+ }, {
868
+ readonly title: "RankingQuestion";
869
+ readonly description: "Order `options`; a ballot ranks every option or, when `partial` is true, a prefix of them.";
870
+ readonly type: "object";
871
+ readonly additionalProperties: false;
872
+ readonly required: readonly ["key", "type", "options", "partial", "optional"];
873
+ readonly properties: {
874
+ readonly key: {
875
+ readonly $ref: "#/$defs/Key";
876
+ };
877
+ readonly type: {
878
+ readonly const: "ranking";
879
+ };
880
+ readonly text: {
881
+ readonly type: "string";
882
+ readonly maxLength: 2048;
883
+ };
884
+ readonly options: {
885
+ readonly type: "array";
886
+ readonly minItems: 2;
887
+ readonly maxItems: 64;
888
+ readonly items: {
889
+ readonly $ref: "#/$defs/QuestionOption";
890
+ };
891
+ };
892
+ readonly partial: {
893
+ readonly type: "boolean";
894
+ };
895
+ readonly optional: {
896
+ readonly type: "boolean";
897
+ };
898
+ };
899
+ }, {
900
+ readonly title: "ScoreQuestion";
901
+ readonly description: "Give each option an integer score within [min, max].";
902
+ readonly type: "object";
903
+ readonly additionalProperties: false;
904
+ readonly required: readonly ["key", "type", "options", "min", "max", "optional"];
905
+ readonly properties: {
906
+ readonly key: {
907
+ readonly $ref: "#/$defs/Key";
908
+ };
909
+ readonly type: {
910
+ readonly const: "score";
911
+ };
912
+ readonly text: {
913
+ readonly type: "string";
914
+ readonly maxLength: 2048;
915
+ };
916
+ readonly options: {
917
+ readonly type: "array";
918
+ readonly minItems: 1;
919
+ readonly maxItems: 256;
920
+ readonly items: {
921
+ readonly $ref: "#/$defs/QuestionOption";
922
+ };
923
+ };
924
+ readonly min: {
925
+ readonly type: "integer";
926
+ };
927
+ readonly max: {
928
+ readonly type: "integer";
929
+ };
930
+ readonly optional: {
931
+ readonly type: "boolean";
932
+ };
933
+ };
934
+ }, {
935
+ readonly title: "TextQuestion";
936
+ readonly description: "Free text of at most `maxLength` characters.";
937
+ readonly type: "object";
938
+ readonly additionalProperties: false;
939
+ readonly required: readonly ["key", "type", "maxLength", "optional"];
940
+ readonly properties: {
941
+ readonly key: {
942
+ readonly $ref: "#/$defs/Key";
943
+ };
944
+ readonly type: {
945
+ readonly const: "text";
946
+ };
947
+ readonly text: {
948
+ readonly type: "string";
949
+ readonly maxLength: 2048;
950
+ };
951
+ readonly maxLength: {
952
+ readonly type: "integer";
953
+ readonly minimum: 1;
954
+ readonly maximum: 4096;
955
+ };
956
+ readonly optional: {
957
+ readonly type: "boolean";
958
+ };
959
+ };
960
+ }];
961
+ };
962
+ readonly Key: {
963
+ readonly title: "Key";
964
+ readonly description: "A question or option key, unique within its manifest or question.";
965
+ readonly type: "string";
966
+ readonly pattern: "^[A-Za-z0-9._-]{1,64}$";
967
+ };
968
+ readonly QuestionOption: {
969
+ readonly title: "QuestionOption";
970
+ readonly type: "object";
971
+ readonly additionalProperties: false;
972
+ readonly required: readonly ["key"];
973
+ readonly properties: {
974
+ readonly key: {
975
+ readonly $ref: "#/$defs/Key";
976
+ };
977
+ readonly label: {
978
+ readonly type: "string";
979
+ readonly maxLength: 512;
980
+ readonly description: "Display text. Absent from a manifest registered with a ballot box that holds no question text (VTI-VOT-014).";
981
+ };
982
+ };
983
+ };
984
+ };
985
+ };
986
+ /**
987
+ * SPEC.md §7.2 policy for the request variant, from this specification's
988
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
989
+ * per-specification and cannot be derived from the document alone, and
990
+ * item 2 needs the schema this carries.
991
+ */
992
+ export declare const SPEC: {
993
+ readonly typeUri: "https://trusttasks.org/spec/voting/election/register/0.3";
994
+ readonly isBearer: false;
995
+ readonly isProofRequired: true;
996
+ readonly isRecipientRequired: true;
997
+ readonly isIssuedAtRequired: true;
998
+ readonly payloadSchema: {
999
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
1000
+ readonly $id: "https://trusttasks.org/spec/voting/election/register/0.3";
1001
+ readonly title: "Voting — Election Register — payload";
1002
+ readonly description: "A community registers an election it signed with the ballot box the election's manifest names. The ballot box answers with its view of the election.";
1003
+ readonly type: "object";
1004
+ readonly additionalProperties: false;
1005
+ readonly required: readonly ["community", "manifest", "manifestDigest", "parameters"];
1006
+ readonly properties: {
1007
+ readonly community: {
1008
+ readonly type: "string";
1009
+ readonly minLength: 1;
1010
+ readonly maxLength: 2048;
1011
+ readonly description: "The community's DID. Equal to the proven signer and to `manifest.community`.";
1012
+ };
1013
+ readonly manifest: {
1014
+ readonly $ref: "#/$defs/Manifest";
1015
+ };
1016
+ readonly manifestDigest: {
1017
+ readonly $ref: "#/$defs/DigestMultibase";
1018
+ readonly description: "The SHA-256 multihash of the RFC 8785 (JCS) canonicalization of `manifest`, as the community computed it.";
1019
+ };
1020
+ readonly parameters: {
1021
+ readonly $ref: "#/$defs/VotingParameters";
1022
+ readonly description: "The community's voting parameters: the key the election's tickets are issued under, which every cast's attestation is checked against.";
1023
+ };
1024
+ readonly ext: {
1025
+ readonly $ref: "#/$defs/Ext";
1026
+ };
1027
+ };
1028
+ readonly $defs: {
1029
+ readonly Response: {
1030
+ readonly $anchor: "response";
1031
+ readonly title: "Voting — Election Register — response payload";
1032
+ readonly type: "object";
1033
+ readonly additionalProperties: false;
1034
+ readonly required: readonly ["election"];
1035
+ readonly properties: {
1036
+ readonly election: {
1037
+ readonly $ref: "#/$defs/ElectionSummary";
1038
+ };
1039
+ readonly ext: {
1040
+ readonly $ref: "#/$defs/Ext";
1041
+ };
1042
+ };
1043
+ };
1044
+ readonly Ext: {
1045
+ readonly title: "Ext";
1046
+ readonly 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.";
1047
+ readonly type: "object";
1048
+ readonly minProperties: 1;
1049
+ readonly additionalProperties: true;
1050
+ readonly propertyNames: {
1051
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
1052
+ };
1053
+ };
1054
+ readonly ElectionSummary: {
1055
+ readonly title: "ElectionSummary";
1056
+ readonly description: "A ballot box's view of one election.";
1057
+ readonly type: "object";
1058
+ readonly additionalProperties: false;
1059
+ readonly required: readonly ["electionId", "community", "manifestDigest", "state", "ballotsAdmitted", "head"];
1060
+ readonly properties: {
1061
+ readonly electionId: {
1062
+ readonly $ref: "#/$defs/ElectionId";
1063
+ };
1064
+ readonly community: {
1065
+ readonly type: "string";
1066
+ readonly minLength: 1;
1067
+ readonly maxLength: 2048;
1068
+ };
1069
+ readonly manifestDigest: {
1070
+ readonly $ref: "#/$defs/DigestMultibase";
1071
+ };
1072
+ readonly state: {
1073
+ readonly $ref: "#/$defs/ElectionState";
1074
+ };
1075
+ readonly ballotsAdmitted: {
1076
+ readonly type: "integer";
1077
+ readonly minimum: 0;
1078
+ readonly description: "Distinct tags with a counted ballot.";
1079
+ };
1080
+ readonly head: {
1081
+ readonly $ref: "#/$defs/BoardHead";
1082
+ };
1083
+ };
1084
+ };
1085
+ readonly BoardHead: {
1086
+ readonly title: "BoardHead";
1087
+ readonly description: "A board's tree head (RFC 9162 §2.1). A head is signed by being carried in a document the ballot box signs; whoever keeps a head keeps that whole document.";
1088
+ readonly type: "object";
1089
+ readonly additionalProperties: false;
1090
+ readonly required: readonly ["electionId", "treeSize", "rootHash", "issuedAt"];
1091
+ readonly properties: {
1092
+ readonly electionId: {
1093
+ readonly $ref: "#/$defs/ElectionId";
1094
+ };
1095
+ readonly treeSize: {
1096
+ readonly type: "integer";
1097
+ readonly minimum: 0;
1098
+ };
1099
+ readonly rootHash: {
1100
+ readonly $ref: "#/$defs/DigestMultibase";
1101
+ readonly description: "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash.";
1102
+ };
1103
+ readonly issuedAt: {
1104
+ readonly type: "string";
1105
+ readonly format: "date-time";
1106
+ };
1107
+ };
1108
+ };
1109
+ readonly ElectionId: {
1110
+ readonly title: "ElectionId";
1111
+ readonly 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.";
1112
+ readonly type: "string";
1113
+ readonly pattern: "^[A-Za-z0-9._-]{1,128}$";
1114
+ };
1115
+ readonly DigestMultibase: {
1116
+ readonly title: "DigestMultibase";
1117
+ readonly 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`.";
1118
+ readonly type: "string";
1119
+ readonly minLength: 16;
1120
+ readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
1121
+ readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
1122
+ };
1123
+ readonly ElectionState: {
1124
+ readonly title: "ElectionState";
1125
+ readonly type: "string";
1126
+ readonly enum: readonly ["registered", "registration", "voting", "closed", "tallied", "cancelled"];
1127
+ };
1128
+ readonly VotingParameters: {
1129
+ readonly title: "VotingParameters";
1130
+ readonly description: "The community's published voting parameters: the PCS suite and the voting verification key tickets are issued under (VTI-VOT-020). Distinct from its hidden-vetting helper key.";
1131
+ readonly type: "object";
1132
+ readonly additionalProperties: false;
1133
+ readonly required: readonly ["suite", "votingKey"];
1134
+ readonly properties: {
1135
+ readonly suite: {
1136
+ readonly type: "string";
1137
+ readonly const: "ps-ddh-bls12381";
1138
+ };
1139
+ readonly votingKey: {
1140
+ readonly $ref: "#/$defs/Multibase";
1141
+ };
1142
+ };
1143
+ };
1144
+ readonly Multibase: {
1145
+ readonly title: "Multibase";
1146
+ readonly description: "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.";
1147
+ readonly type: "string";
1148
+ readonly maxLength: 16384;
1149
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
1150
+ };
1151
+ readonly Manifest: {
1152
+ readonly title: "Manifest";
1153
+ readonly 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).";
1154
+ readonly type: "object";
1155
+ readonly additionalProperties: false;
1156
+ readonly required: readonly ["electionId", "community", "questions", "secrecy", "roll", "registrationOpensAt", "votingOpensAt", "votingClosesAt", "revote", "board", "ballotBox", "binding", "allowEarlyClose", "resultsBeforeClose", "textReleaseThreshold"];
1157
+ readonly properties: {
1158
+ readonly electionId: {
1159
+ readonly $ref: "#/$defs/ElectionId";
1160
+ };
1161
+ readonly community: {
1162
+ readonly type: "string";
1163
+ readonly minLength: 1;
1164
+ readonly maxLength: 2048;
1165
+ readonly description: "The community's DID.";
1166
+ };
1167
+ readonly title: {
1168
+ readonly type: "string";
1169
+ readonly maxLength: 512;
1170
+ };
1171
+ readonly description: {
1172
+ readonly type: "string";
1173
+ readonly maxLength: 8192;
1174
+ };
1175
+ readonly questions: {
1176
+ readonly type: "array";
1177
+ readonly minItems: 1;
1178
+ readonly maxItems: 128;
1179
+ readonly items: {
1180
+ readonly $ref: "#/$defs/Question";
1181
+ };
1182
+ };
1183
+ readonly secrecy: {
1184
+ readonly $ref: "#/$defs/SecrecyLevel";
1185
+ };
1186
+ readonly roll: {
1187
+ readonly $ref: "#/$defs/RollRule";
1188
+ };
1189
+ readonly registrationOpensAt: {
1190
+ readonly type: "string";
1191
+ readonly format: "date-time";
1192
+ };
1193
+ readonly votingOpensAt: {
1194
+ readonly type: "string";
1195
+ readonly format: "date-time";
1196
+ };
1197
+ readonly votingClosesAt: {
1198
+ readonly type: "string";
1199
+ readonly format: "date-time";
1200
+ };
1201
+ readonly revote: {
1202
+ readonly $ref: "#/$defs/Revote";
1203
+ };
1204
+ readonly board: {
1205
+ readonly type: "object";
1206
+ readonly additionalProperties: false;
1207
+ readonly required: readonly ["visibility", "auditors"];
1208
+ readonly properties: {
1209
+ readonly visibility: {
1210
+ readonly $ref: "#/$defs/BoardVisibility";
1211
+ };
1212
+ readonly auditors: {
1213
+ readonly type: "array";
1214
+ readonly items: {
1215
+ readonly type: "string";
1216
+ readonly minLength: 1;
1217
+ readonly maxLength: 2048;
1218
+ };
1219
+ readonly uniqueItems: true;
1220
+ };
1221
+ };
1222
+ };
1223
+ readonly ballotBox: {
1224
+ readonly type: "string";
1225
+ readonly minLength: 1;
1226
+ readonly maxLength: 2048;
1227
+ readonly description: "The DID of the voting service that holds the board.";
1228
+ };
1229
+ readonly trustees: {
1230
+ readonly $ref: "#/$defs/Trustees";
1231
+ };
1232
+ readonly binding: {
1233
+ readonly type: "boolean";
1234
+ readonly description: "Whether the community treats the result as deciding something; creating a binding election takes another administrator's consent (VTI-VOT-081).";
1235
+ };
1236
+ readonly allowEarlyClose: {
1237
+ readonly type: "boolean";
1238
+ };
1239
+ readonly resultsBeforeClose: {
1240
+ readonly type: "boolean";
1241
+ readonly description: "Open elections only: whether running totals may be read while voting is open (VTI-VOT-061).";
1242
+ };
1243
+ readonly textReleaseThreshold: {
1244
+ readonly type: "integer";
1245
+ readonly minimum: 1;
1246
+ readonly description: "Counted ballots required before any text answer is disclosed (VTI-VOT-065). At least 1, and SHOULD be at least 10: a written answer can identify its author by what it says or how it is phrased, and the fewer the ballots released together, the easier that is. Where it is below 10, the disclosure a member is shown before they request a ticket MUST say so, and MUST say that a written answer may identify its author (VTI-VOT-090).";
1247
+ };
1248
+ };
1249
+ };
1250
+ readonly Trustees: {
1251
+ readonly title: "Trustees";
1252
+ readonly 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.";
1253
+ readonly type: "object";
1254
+ readonly additionalProperties: false;
1255
+ readonly required: readonly ["dids", "threshold"];
1256
+ readonly properties: {
1257
+ readonly dids: {
1258
+ readonly type: "array";
1259
+ readonly minItems: 2;
1260
+ readonly items: {
1261
+ readonly type: "string";
1262
+ readonly minLength: 1;
1263
+ readonly maxLength: 2048;
1264
+ };
1265
+ readonly uniqueItems: true;
1266
+ };
1267
+ readonly threshold: {
1268
+ readonly type: "integer";
1269
+ readonly minimum: 2;
1270
+ };
1271
+ };
1272
+ };
1273
+ readonly BoardVisibility: {
1274
+ readonly title: "BoardVisibility";
1275
+ readonly 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).";
1276
+ readonly type: "string";
1277
+ readonly enum: readonly ["public", "private"];
1278
+ };
1279
+ readonly Revote: {
1280
+ readonly title: "Revote";
1281
+ readonly description: "What a later, different ballot under one ticket does: `replace` the earlier one, or be refused (`refuse`) (VTI-VOT-041).";
1282
+ readonly type: "string";
1283
+ readonly enum: readonly ["replace", "refuse"];
1284
+ };
1285
+ readonly RollRule: {
1286
+ readonly title: "RollRule";
1287
+ readonly 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.";
1288
+ readonly type: "object";
1289
+ readonly additionalProperties: false;
1290
+ readonly required: readonly ["rule"];
1291
+ readonly properties: {
1292
+ readonly rule: {
1293
+ readonly type: "string";
1294
+ readonly enum: readonly ["members", "membersAndListed", "listed"];
1295
+ };
1296
+ readonly listed: {
1297
+ readonly type: "array";
1298
+ readonly items: {
1299
+ readonly type: "string";
1300
+ readonly minLength: 1;
1301
+ readonly maxLength: 2048;
1302
+ readonly description: "A DID enfranchised by name.";
1303
+ };
1304
+ readonly uniqueItems: true;
1305
+ };
1306
+ };
1307
+ };
1308
+ readonly SecrecyLevel: {
1309
+ readonly title: "SecrecyLevel";
1310
+ readonly 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).";
1311
+ readonly type: "string";
1312
+ readonly enum: readonly ["open", "sealed", "talliedEncrypted"];
1313
+ };
1314
+ readonly Question: {
1315
+ readonly title: "Question";
1316
+ readonly description: "One question. Tagged union over `type`.";
1317
+ readonly oneOf: readonly [{
1318
+ readonly title: "ChoiceQuestion";
1319
+ readonly description: "Select between `minSelections` and `maxSelections` of `options`. A yes/no/abstain motion is a choice of exactly one of three.";
1320
+ readonly type: "object";
1321
+ readonly additionalProperties: false;
1322
+ readonly required: readonly ["key", "type", "options", "minSelections", "maxSelections", "optional"];
1323
+ readonly properties: {
1324
+ readonly key: {
1325
+ readonly $ref: "#/$defs/Key";
1326
+ };
1327
+ readonly type: {
1328
+ readonly const: "choice";
1329
+ };
1330
+ readonly text: {
1331
+ readonly type: "string";
1332
+ readonly maxLength: 2048;
1333
+ };
1334
+ readonly options: {
1335
+ readonly type: "array";
1336
+ readonly minItems: 2;
1337
+ readonly maxItems: 256;
1338
+ readonly items: {
1339
+ readonly $ref: "#/$defs/QuestionOption";
1340
+ };
1341
+ };
1342
+ readonly minSelections: {
1343
+ readonly type: "integer";
1344
+ readonly minimum: 0;
1345
+ };
1346
+ readonly maxSelections: {
1347
+ readonly type: "integer";
1348
+ readonly minimum: 1;
1349
+ };
1350
+ readonly optional: {
1351
+ readonly type: "boolean";
1352
+ };
1353
+ };
1354
+ }, {
1355
+ readonly title: "RankingQuestion";
1356
+ readonly description: "Order `options`; a ballot ranks every option or, when `partial` is true, a prefix of them.";
1357
+ readonly type: "object";
1358
+ readonly additionalProperties: false;
1359
+ readonly required: readonly ["key", "type", "options", "partial", "optional"];
1360
+ readonly properties: {
1361
+ readonly key: {
1362
+ readonly $ref: "#/$defs/Key";
1363
+ };
1364
+ readonly type: {
1365
+ readonly const: "ranking";
1366
+ };
1367
+ readonly text: {
1368
+ readonly type: "string";
1369
+ readonly maxLength: 2048;
1370
+ };
1371
+ readonly options: {
1372
+ readonly type: "array";
1373
+ readonly minItems: 2;
1374
+ readonly maxItems: 64;
1375
+ readonly items: {
1376
+ readonly $ref: "#/$defs/QuestionOption";
1377
+ };
1378
+ };
1379
+ readonly partial: {
1380
+ readonly type: "boolean";
1381
+ };
1382
+ readonly optional: {
1383
+ readonly type: "boolean";
1384
+ };
1385
+ };
1386
+ }, {
1387
+ readonly title: "ScoreQuestion";
1388
+ readonly description: "Give each option an integer score within [min, max].";
1389
+ readonly type: "object";
1390
+ readonly additionalProperties: false;
1391
+ readonly required: readonly ["key", "type", "options", "min", "max", "optional"];
1392
+ readonly properties: {
1393
+ readonly key: {
1394
+ readonly $ref: "#/$defs/Key";
1395
+ };
1396
+ readonly type: {
1397
+ readonly const: "score";
1398
+ };
1399
+ readonly text: {
1400
+ readonly type: "string";
1401
+ readonly maxLength: 2048;
1402
+ };
1403
+ readonly options: {
1404
+ readonly type: "array";
1405
+ readonly minItems: 1;
1406
+ readonly maxItems: 256;
1407
+ readonly items: {
1408
+ readonly $ref: "#/$defs/QuestionOption";
1409
+ };
1410
+ };
1411
+ readonly min: {
1412
+ readonly type: "integer";
1413
+ };
1414
+ readonly max: {
1415
+ readonly type: "integer";
1416
+ };
1417
+ readonly optional: {
1418
+ readonly type: "boolean";
1419
+ };
1420
+ };
1421
+ }, {
1422
+ readonly title: "TextQuestion";
1423
+ readonly description: "Free text of at most `maxLength` characters.";
1424
+ readonly type: "object";
1425
+ readonly additionalProperties: false;
1426
+ readonly required: readonly ["key", "type", "maxLength", "optional"];
1427
+ readonly properties: {
1428
+ readonly key: {
1429
+ readonly $ref: "#/$defs/Key";
1430
+ };
1431
+ readonly type: {
1432
+ readonly const: "text";
1433
+ };
1434
+ readonly text: {
1435
+ readonly type: "string";
1436
+ readonly maxLength: 2048;
1437
+ };
1438
+ readonly maxLength: {
1439
+ readonly type: "integer";
1440
+ readonly minimum: 1;
1441
+ readonly maximum: 4096;
1442
+ };
1443
+ readonly optional: {
1444
+ readonly type: "boolean";
1445
+ };
1446
+ };
1447
+ }];
1448
+ };
1449
+ readonly Key: {
1450
+ readonly title: "Key";
1451
+ readonly description: "A question or option key, unique within its manifest or question.";
1452
+ readonly type: "string";
1453
+ readonly pattern: "^[A-Za-z0-9._-]{1,64}$";
1454
+ };
1455
+ readonly QuestionOption: {
1456
+ readonly title: "QuestionOption";
1457
+ readonly type: "object";
1458
+ readonly additionalProperties: false;
1459
+ readonly required: readonly ["key"];
1460
+ readonly properties: {
1461
+ readonly key: {
1462
+ readonly $ref: "#/$defs/Key";
1463
+ };
1464
+ readonly label: {
1465
+ readonly type: "string";
1466
+ readonly maxLength: 512;
1467
+ readonly description: "Display text. Absent from a manifest registered with a ballot box that holds no question text (VTI-VOT-014).";
1468
+ };
1469
+ };
1470
+ };
1471
+ };
1472
+ };
1473
+ };
1474
+ /**
1475
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
1476
+ * tracks the *issuer* party's requirement because a response swaps the
1477
+ * parties (§7.3 item 5).
1478
+ */
1479
+ export declare const RESPONSE_SPEC: {
1480
+ readonly typeUri: "https://trusttasks.org/spec/voting/election/register/0.3#response";
1481
+ readonly isBearer: false;
1482
+ readonly isProofRequired: true;
1483
+ readonly isRecipientRequired: true;
1484
+ readonly isIssuedAtRequired: true;
1485
+ readonly payloadSchema: {
1486
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
1487
+ readonly $ref: "#/$defs/Response";
1488
+ readonly $defs: {
1489
+ readonly Response: {
1490
+ readonly $anchor: "response";
1491
+ readonly title: "Voting — Election Register — response payload";
1492
+ readonly type: "object";
1493
+ readonly additionalProperties: false;
1494
+ readonly required: readonly ["election"];
1495
+ readonly properties: {
1496
+ readonly election: {
1497
+ readonly $ref: "#/$defs/ElectionSummary";
1498
+ };
1499
+ readonly ext: {
1500
+ readonly $ref: "#/$defs/Ext";
1501
+ };
1502
+ };
1503
+ };
1504
+ readonly Ext: {
1505
+ readonly title: "Ext";
1506
+ readonly 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.";
1507
+ readonly type: "object";
1508
+ readonly minProperties: 1;
1509
+ readonly additionalProperties: true;
1510
+ readonly propertyNames: {
1511
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
1512
+ };
1513
+ };
1514
+ readonly ElectionSummary: {
1515
+ readonly title: "ElectionSummary";
1516
+ readonly description: "A ballot box's view of one election.";
1517
+ readonly type: "object";
1518
+ readonly additionalProperties: false;
1519
+ readonly required: readonly ["electionId", "community", "manifestDigest", "state", "ballotsAdmitted", "head"];
1520
+ readonly properties: {
1521
+ readonly electionId: {
1522
+ readonly $ref: "#/$defs/ElectionId";
1523
+ };
1524
+ readonly community: {
1525
+ readonly type: "string";
1526
+ readonly minLength: 1;
1527
+ readonly maxLength: 2048;
1528
+ };
1529
+ readonly manifestDigest: {
1530
+ readonly $ref: "#/$defs/DigestMultibase";
1531
+ };
1532
+ readonly state: {
1533
+ readonly $ref: "#/$defs/ElectionState";
1534
+ };
1535
+ readonly ballotsAdmitted: {
1536
+ readonly type: "integer";
1537
+ readonly minimum: 0;
1538
+ readonly description: "Distinct tags with a counted ballot.";
1539
+ };
1540
+ readonly head: {
1541
+ readonly $ref: "#/$defs/BoardHead";
1542
+ };
1543
+ };
1544
+ };
1545
+ readonly BoardHead: {
1546
+ readonly title: "BoardHead";
1547
+ readonly description: "A board's tree head (RFC 9162 §2.1). A head is signed by being carried in a document the ballot box signs; whoever keeps a head keeps that whole document.";
1548
+ readonly type: "object";
1549
+ readonly additionalProperties: false;
1550
+ readonly required: readonly ["electionId", "treeSize", "rootHash", "issuedAt"];
1551
+ readonly properties: {
1552
+ readonly electionId: {
1553
+ readonly $ref: "#/$defs/ElectionId";
1554
+ };
1555
+ readonly treeSize: {
1556
+ readonly type: "integer";
1557
+ readonly minimum: 0;
1558
+ };
1559
+ readonly rootHash: {
1560
+ readonly $ref: "#/$defs/DigestMultibase";
1561
+ readonly description: "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash.";
1562
+ };
1563
+ readonly issuedAt: {
1564
+ readonly type: "string";
1565
+ readonly format: "date-time";
1566
+ };
1567
+ };
1568
+ };
1569
+ readonly ElectionId: {
1570
+ readonly title: "ElectionId";
1571
+ readonly 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.";
1572
+ readonly type: "string";
1573
+ readonly pattern: "^[A-Za-z0-9._-]{1,128}$";
1574
+ };
1575
+ readonly DigestMultibase: {
1576
+ readonly title: "DigestMultibase";
1577
+ readonly 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`.";
1578
+ readonly type: "string";
1579
+ readonly minLength: 16;
1580
+ readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
1581
+ readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
1582
+ };
1583
+ readonly ElectionState: {
1584
+ readonly title: "ElectionState";
1585
+ readonly type: "string";
1586
+ readonly enum: readonly ["registered", "registration", "voting", "closed", "tallied", "cancelled"];
1587
+ };
1588
+ readonly VotingParameters: {
1589
+ readonly title: "VotingParameters";
1590
+ readonly description: "The community's published voting parameters: the PCS suite and the voting verification key tickets are issued under (VTI-VOT-020). Distinct from its hidden-vetting helper key.";
1591
+ readonly type: "object";
1592
+ readonly additionalProperties: false;
1593
+ readonly required: readonly ["suite", "votingKey"];
1594
+ readonly properties: {
1595
+ readonly suite: {
1596
+ readonly type: "string";
1597
+ readonly const: "ps-ddh-bls12381";
1598
+ };
1599
+ readonly votingKey: {
1600
+ readonly $ref: "#/$defs/Multibase";
1601
+ };
1602
+ };
1603
+ };
1604
+ readonly Multibase: {
1605
+ readonly title: "Multibase";
1606
+ readonly description: "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.";
1607
+ readonly type: "string";
1608
+ readonly maxLength: 16384;
1609
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
1610
+ };
1611
+ readonly Manifest: {
1612
+ readonly title: "Manifest";
1613
+ readonly 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).";
1614
+ readonly type: "object";
1615
+ readonly additionalProperties: false;
1616
+ readonly required: readonly ["electionId", "community", "questions", "secrecy", "roll", "registrationOpensAt", "votingOpensAt", "votingClosesAt", "revote", "board", "ballotBox", "binding", "allowEarlyClose", "resultsBeforeClose", "textReleaseThreshold"];
1617
+ readonly properties: {
1618
+ readonly electionId: {
1619
+ readonly $ref: "#/$defs/ElectionId";
1620
+ };
1621
+ readonly community: {
1622
+ readonly type: "string";
1623
+ readonly minLength: 1;
1624
+ readonly maxLength: 2048;
1625
+ readonly description: "The community's DID.";
1626
+ };
1627
+ readonly title: {
1628
+ readonly type: "string";
1629
+ readonly maxLength: 512;
1630
+ };
1631
+ readonly description: {
1632
+ readonly type: "string";
1633
+ readonly maxLength: 8192;
1634
+ };
1635
+ readonly questions: {
1636
+ readonly type: "array";
1637
+ readonly minItems: 1;
1638
+ readonly maxItems: 128;
1639
+ readonly items: {
1640
+ readonly $ref: "#/$defs/Question";
1641
+ };
1642
+ };
1643
+ readonly secrecy: {
1644
+ readonly $ref: "#/$defs/SecrecyLevel";
1645
+ };
1646
+ readonly roll: {
1647
+ readonly $ref: "#/$defs/RollRule";
1648
+ };
1649
+ readonly registrationOpensAt: {
1650
+ readonly type: "string";
1651
+ readonly format: "date-time";
1652
+ };
1653
+ readonly votingOpensAt: {
1654
+ readonly type: "string";
1655
+ readonly format: "date-time";
1656
+ };
1657
+ readonly votingClosesAt: {
1658
+ readonly type: "string";
1659
+ readonly format: "date-time";
1660
+ };
1661
+ readonly revote: {
1662
+ readonly $ref: "#/$defs/Revote";
1663
+ };
1664
+ readonly board: {
1665
+ readonly type: "object";
1666
+ readonly additionalProperties: false;
1667
+ readonly required: readonly ["visibility", "auditors"];
1668
+ readonly properties: {
1669
+ readonly visibility: {
1670
+ readonly $ref: "#/$defs/BoardVisibility";
1671
+ };
1672
+ readonly auditors: {
1673
+ readonly type: "array";
1674
+ readonly items: {
1675
+ readonly type: "string";
1676
+ readonly minLength: 1;
1677
+ readonly maxLength: 2048;
1678
+ };
1679
+ readonly uniqueItems: true;
1680
+ };
1681
+ };
1682
+ };
1683
+ readonly ballotBox: {
1684
+ readonly type: "string";
1685
+ readonly minLength: 1;
1686
+ readonly maxLength: 2048;
1687
+ readonly description: "The DID of the voting service that holds the board.";
1688
+ };
1689
+ readonly trustees: {
1690
+ readonly $ref: "#/$defs/Trustees";
1691
+ };
1692
+ readonly binding: {
1693
+ readonly type: "boolean";
1694
+ readonly description: "Whether the community treats the result as deciding something; creating a binding election takes another administrator's consent (VTI-VOT-081).";
1695
+ };
1696
+ readonly allowEarlyClose: {
1697
+ readonly type: "boolean";
1698
+ };
1699
+ readonly resultsBeforeClose: {
1700
+ readonly type: "boolean";
1701
+ readonly description: "Open elections only: whether running totals may be read while voting is open (VTI-VOT-061).";
1702
+ };
1703
+ readonly textReleaseThreshold: {
1704
+ readonly type: "integer";
1705
+ readonly minimum: 1;
1706
+ readonly description: "Counted ballots required before any text answer is disclosed (VTI-VOT-065). At least 1, and SHOULD be at least 10: a written answer can identify its author by what it says or how it is phrased, and the fewer the ballots released together, the easier that is. Where it is below 10, the disclosure a member is shown before they request a ticket MUST say so, and MUST say that a written answer may identify its author (VTI-VOT-090).";
1707
+ };
1708
+ };
1709
+ };
1710
+ readonly Trustees: {
1711
+ readonly title: "Trustees";
1712
+ readonly 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.";
1713
+ readonly type: "object";
1714
+ readonly additionalProperties: false;
1715
+ readonly required: readonly ["dids", "threshold"];
1716
+ readonly properties: {
1717
+ readonly dids: {
1718
+ readonly type: "array";
1719
+ readonly minItems: 2;
1720
+ readonly items: {
1721
+ readonly type: "string";
1722
+ readonly minLength: 1;
1723
+ readonly maxLength: 2048;
1724
+ };
1725
+ readonly uniqueItems: true;
1726
+ };
1727
+ readonly threshold: {
1728
+ readonly type: "integer";
1729
+ readonly minimum: 2;
1730
+ };
1731
+ };
1732
+ };
1733
+ readonly BoardVisibility: {
1734
+ readonly title: "BoardVisibility";
1735
+ readonly 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).";
1736
+ readonly type: "string";
1737
+ readonly enum: readonly ["public", "private"];
1738
+ };
1739
+ readonly Revote: {
1740
+ readonly title: "Revote";
1741
+ readonly description: "What a later, different ballot under one ticket does: `replace` the earlier one, or be refused (`refuse`) (VTI-VOT-041).";
1742
+ readonly type: "string";
1743
+ readonly enum: readonly ["replace", "refuse"];
1744
+ };
1745
+ readonly RollRule: {
1746
+ readonly title: "RollRule";
1747
+ readonly 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.";
1748
+ readonly type: "object";
1749
+ readonly additionalProperties: false;
1750
+ readonly required: readonly ["rule"];
1751
+ readonly properties: {
1752
+ readonly rule: {
1753
+ readonly type: "string";
1754
+ readonly enum: readonly ["members", "membersAndListed", "listed"];
1755
+ };
1756
+ readonly listed: {
1757
+ readonly type: "array";
1758
+ readonly items: {
1759
+ readonly type: "string";
1760
+ readonly minLength: 1;
1761
+ readonly maxLength: 2048;
1762
+ readonly description: "A DID enfranchised by name.";
1763
+ };
1764
+ readonly uniqueItems: true;
1765
+ };
1766
+ };
1767
+ };
1768
+ readonly SecrecyLevel: {
1769
+ readonly title: "SecrecyLevel";
1770
+ readonly 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).";
1771
+ readonly type: "string";
1772
+ readonly enum: readonly ["open", "sealed", "talliedEncrypted"];
1773
+ };
1774
+ readonly Question: {
1775
+ readonly title: "Question";
1776
+ readonly description: "One question. Tagged union over `type`.";
1777
+ readonly oneOf: readonly [{
1778
+ readonly title: "ChoiceQuestion";
1779
+ readonly description: "Select between `minSelections` and `maxSelections` of `options`. A yes/no/abstain motion is a choice of exactly one of three.";
1780
+ readonly type: "object";
1781
+ readonly additionalProperties: false;
1782
+ readonly required: readonly ["key", "type", "options", "minSelections", "maxSelections", "optional"];
1783
+ readonly properties: {
1784
+ readonly key: {
1785
+ readonly $ref: "#/$defs/Key";
1786
+ };
1787
+ readonly type: {
1788
+ readonly const: "choice";
1789
+ };
1790
+ readonly text: {
1791
+ readonly type: "string";
1792
+ readonly maxLength: 2048;
1793
+ };
1794
+ readonly options: {
1795
+ readonly type: "array";
1796
+ readonly minItems: 2;
1797
+ readonly maxItems: 256;
1798
+ readonly items: {
1799
+ readonly $ref: "#/$defs/QuestionOption";
1800
+ };
1801
+ };
1802
+ readonly minSelections: {
1803
+ readonly type: "integer";
1804
+ readonly minimum: 0;
1805
+ };
1806
+ readonly maxSelections: {
1807
+ readonly type: "integer";
1808
+ readonly minimum: 1;
1809
+ };
1810
+ readonly optional: {
1811
+ readonly type: "boolean";
1812
+ };
1813
+ };
1814
+ }, {
1815
+ readonly title: "RankingQuestion";
1816
+ readonly description: "Order `options`; a ballot ranks every option or, when `partial` is true, a prefix of them.";
1817
+ readonly type: "object";
1818
+ readonly additionalProperties: false;
1819
+ readonly required: readonly ["key", "type", "options", "partial", "optional"];
1820
+ readonly properties: {
1821
+ readonly key: {
1822
+ readonly $ref: "#/$defs/Key";
1823
+ };
1824
+ readonly type: {
1825
+ readonly const: "ranking";
1826
+ };
1827
+ readonly text: {
1828
+ readonly type: "string";
1829
+ readonly maxLength: 2048;
1830
+ };
1831
+ readonly options: {
1832
+ readonly type: "array";
1833
+ readonly minItems: 2;
1834
+ readonly maxItems: 64;
1835
+ readonly items: {
1836
+ readonly $ref: "#/$defs/QuestionOption";
1837
+ };
1838
+ };
1839
+ readonly partial: {
1840
+ readonly type: "boolean";
1841
+ };
1842
+ readonly optional: {
1843
+ readonly type: "boolean";
1844
+ };
1845
+ };
1846
+ }, {
1847
+ readonly title: "ScoreQuestion";
1848
+ readonly description: "Give each option an integer score within [min, max].";
1849
+ readonly type: "object";
1850
+ readonly additionalProperties: false;
1851
+ readonly required: readonly ["key", "type", "options", "min", "max", "optional"];
1852
+ readonly properties: {
1853
+ readonly key: {
1854
+ readonly $ref: "#/$defs/Key";
1855
+ };
1856
+ readonly type: {
1857
+ readonly const: "score";
1858
+ };
1859
+ readonly text: {
1860
+ readonly type: "string";
1861
+ readonly maxLength: 2048;
1862
+ };
1863
+ readonly options: {
1864
+ readonly type: "array";
1865
+ readonly minItems: 1;
1866
+ readonly maxItems: 256;
1867
+ readonly items: {
1868
+ readonly $ref: "#/$defs/QuestionOption";
1869
+ };
1870
+ };
1871
+ readonly min: {
1872
+ readonly type: "integer";
1873
+ };
1874
+ readonly max: {
1875
+ readonly type: "integer";
1876
+ };
1877
+ readonly optional: {
1878
+ readonly type: "boolean";
1879
+ };
1880
+ };
1881
+ }, {
1882
+ readonly title: "TextQuestion";
1883
+ readonly description: "Free text of at most `maxLength` characters.";
1884
+ readonly type: "object";
1885
+ readonly additionalProperties: false;
1886
+ readonly required: readonly ["key", "type", "maxLength", "optional"];
1887
+ readonly properties: {
1888
+ readonly key: {
1889
+ readonly $ref: "#/$defs/Key";
1890
+ };
1891
+ readonly type: {
1892
+ readonly const: "text";
1893
+ };
1894
+ readonly text: {
1895
+ readonly type: "string";
1896
+ readonly maxLength: 2048;
1897
+ };
1898
+ readonly maxLength: {
1899
+ readonly type: "integer";
1900
+ readonly minimum: 1;
1901
+ readonly maximum: 4096;
1902
+ };
1903
+ readonly optional: {
1904
+ readonly type: "boolean";
1905
+ };
1906
+ };
1907
+ }];
1908
+ };
1909
+ readonly Key: {
1910
+ readonly title: "Key";
1911
+ readonly description: "A question or option key, unique within its manifest or question.";
1912
+ readonly type: "string";
1913
+ readonly pattern: "^[A-Za-z0-9._-]{1,64}$";
1914
+ };
1915
+ readonly QuestionOption: {
1916
+ readonly title: "QuestionOption";
1917
+ readonly type: "object";
1918
+ readonly additionalProperties: false;
1919
+ readonly required: readonly ["key"];
1920
+ readonly properties: {
1921
+ readonly key: {
1922
+ readonly $ref: "#/$defs/Key";
1923
+ };
1924
+ readonly label: {
1925
+ readonly type: "string";
1926
+ readonly maxLength: 512;
1927
+ readonly description: "Display text. Absent from a manifest registered with a ballot box that holds no question text (VTI-VOT-014).";
1928
+ };
1929
+ };
1930
+ };
1931
+ };
1932
+ };
1933
+ };
1934
+ //# sourceMappingURL=payload.d.ts.map