@openvtc/trust-tasks 0.26.20 → 0.26.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. package/CHANGELOG.md +84 -0
  2. package/dist/_shared/components.d.ts +328 -17
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/device/list/0.1/payload.d.ts +4 -4
  5. package/dist/device/list/0.1/payload.d.ts.map +1 -1
  6. package/dist/device/list/0.1/payload.js +4 -2
  7. package/dist/device/list/0.1/payload.js.map +1 -1
  8. package/dist/device/list/0.2/payload.d.ts +4 -4
  9. package/dist/device/list/0.2/payload.d.ts.map +1 -1
  10. package/dist/device/list/0.2/payload.js +4 -2
  11. package/dist/device/list/0.2/payload.js.map +1 -1
  12. package/dist/device/register/0.1/payload.d.ts +4 -4
  13. package/dist/device/register/0.1/payload.d.ts.map +1 -1
  14. package/dist/device/register/0.1/payload.js +4 -2
  15. package/dist/device/register/0.1/payload.js.map +1 -1
  16. package/dist/device/register/0.2/payload.d.ts +4 -4
  17. package/dist/device/register/0.2/payload.d.ts.map +1 -1
  18. package/dist/device/register/0.2/payload.js +4 -2
  19. package/dist/device/register/0.2/payload.js.map +1 -1
  20. package/dist/index.d.ts +24 -0
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +24 -0
  23. package/dist/index.js.map +1 -1
  24. package/dist/voting/_shared/0.1/voting.d.ts +16 -0
  25. package/dist/voting/_shared/0.1/voting.d.ts.map +1 -0
  26. package/dist/voting/_shared/0.1/voting.js +6 -0
  27. package/dist/voting/_shared/0.1/voting.js.map +1 -0
  28. package/dist/voting/ballot/cast/0.1/payload.d.ts +887 -0
  29. package/dist/voting/ballot/cast/0.1/payload.d.ts.map +1 -0
  30. package/dist/voting/ballot/cast/0.1/payload.js +506 -0
  31. package/dist/voting/ballot/cast/0.1/payload.js.map +1 -0
  32. package/dist/voting/board/consistency/0.1/payload.d.ts +389 -0
  33. package/dist/voting/board/consistency/0.1/payload.d.ts.map +1 -0
  34. package/dist/voting/board/consistency/0.1/payload.js +218 -0
  35. package/dist/voting/board/consistency/0.1/payload.js.map +1 -0
  36. package/dist/voting/board/head/0.1/payload.d.ts +380 -0
  37. package/dist/voting/board/head/0.1/payload.d.ts.map +1 -0
  38. package/dist/voting/board/head/0.1/payload.js +224 -0
  39. package/dist/voting/board/head/0.1/payload.js.map +1 -0
  40. package/dist/voting/board/inclusion/0.1/payload.d.ts +449 -0
  41. package/dist/voting/board/inclusion/0.1/payload.d.ts.map +1 -0
  42. package/dist/voting/board/inclusion/0.1/payload.js +246 -0
  43. package/dist/voting/board/inclusion/0.1/payload.js.map +1 -0
  44. package/dist/voting/board/read/0.1/payload.d.ts +1596 -0
  45. package/dist/voting/board/read/0.1/payload.d.ts.map +1 -0
  46. package/dist/voting/board/read/0.1/payload.js +920 -0
  47. package/dist/voting/board/read/0.1/payload.js.map +1 -0
  48. package/dist/voting/election/cancel/0.1/payload.d.ts +540 -0
  49. package/dist/voting/election/cancel/0.1/payload.d.ts.map +1 -0
  50. package/dist/voting/election/cancel/0.1/payload.js +331 -0
  51. package/dist/voting/election/cancel/0.1/payload.js.map +1 -0
  52. package/dist/voting/election/close/0.1/payload.d.ts +540 -0
  53. package/dist/voting/election/close/0.1/payload.d.ts.map +1 -0
  54. package/dist/voting/election/close/0.1/payload.js +330 -0
  55. package/dist/voting/election/close/0.1/payload.js.map +1 -0
  56. package/dist/voting/election/register/0.1/payload.d.ts +1920 -0
  57. package/dist/voting/election/register/0.1/payload.d.ts.map +1 -0
  58. package/dist/voting/election/register/0.1/payload.js +1166 -0
  59. package/dist/voting/election/register/0.1/payload.js.map +1 -0
  60. package/dist/voting/election/show/0.1/payload.d.ts +1824 -0
  61. package/dist/voting/election/show/0.1/payload.d.ts.map +1 -0
  62. package/dist/voting/election/show/0.1/payload.js +1112 -0
  63. package/dist/voting/election/show/0.1/payload.js.map +1 -0
  64. package/dist/voting/result/show/0.1/payload.d.ts +849 -0
  65. package/dist/voting/result/show/0.1/payload.d.ts.map +1 -0
  66. package/dist/voting/result/show/0.1/payload.js +498 -0
  67. package/dist/voting/result/show/0.1/payload.js.map +1 -0
  68. package/dist/vta/_shared/0.1/app-state-record.d.ts +1 -1
  69. package/dist/vta/_shared/0.1/app-state-record.d.ts.map +1 -1
  70. package/dist/vta/_shared/0.4/pcs-engine.d.ts +1 -1
  71. package/dist/vta/_shared/0.4/pcs-engine.d.ts.map +1 -1
  72. package/dist/vta/app-state/delete/1.0/payload.d.ts +1 -1
  73. package/dist/vta/app-state/delete/1.0/payload.d.ts.map +1 -1
  74. package/dist/vta/app-state/get/1.0/payload.d.ts +1 -1
  75. package/dist/vta/app-state/get/1.0/payload.d.ts.map +1 -1
  76. package/dist/vta/app-state/get-many/1.0/payload.d.ts +1 -1
  77. package/dist/vta/app-state/get-many/1.0/payload.d.ts.map +1 -1
  78. package/dist/vta/app-state/list/1.0/payload.d.ts +1 -1
  79. package/dist/vta/app-state/list/1.0/payload.d.ts.map +1 -1
  80. package/dist/vta/app-state/put/1.0/payload.d.ts +1 -1
  81. package/dist/vta/app-state/put/1.0/payload.d.ts.map +1 -1
  82. package/dist/vta/app-state/put-many/1.0/payload.d.ts +1 -1
  83. package/dist/vta/app-state/put-many/1.0/payload.d.ts.map +1 -1
  84. package/dist/vta/pcs/applications/create/0.1/payload.d.ts +1 -1
  85. package/dist/vta/pcs/applications/create/0.1/payload.d.ts.map +1 -1
  86. package/dist/vta/pcs/applications/show/0.1/payload.d.ts +1 -1
  87. package/dist/vta/pcs/applications/show/0.1/payload.d.ts.map +1 -1
  88. package/dist/vta/pcs/attest/0.1/payload.d.ts +1 -1
  89. package/dist/vta/pcs/attest/0.1/payload.d.ts.map +1 -1
  90. package/dist/vta/pcs/prove/0.1/payload.d.ts +1 -1
  91. package/dist/vta/pcs/prove/0.1/payload.d.ts.map +1 -1
  92. package/dist/vta/pcs/root-accept/0.1/payload.d.ts +1 -1
  93. package/dist/vta/pcs/root-accept/0.1/payload.d.ts.map +1 -1
  94. package/dist/vta/pcs/tokens/abandon/0.1/payload.d.ts +1 -1
  95. package/dist/vta/pcs/tokens/abandon/0.1/payload.d.ts.map +1 -1
  96. package/dist/vta/pcs/tokens/accept/0.1/payload.d.ts +1 -1
  97. package/dist/vta/pcs/tokens/accept/0.1/payload.d.ts.map +1 -1
  98. package/dist/vta/pcs/verify-attestation/0.1/payload.d.ts +1 -1
  99. package/dist/vta/pcs/verify-attestation/0.1/payload.d.ts.map +1 -1
  100. package/dist/vta/pcs/vetter/show/0.1/payload.d.ts +1 -1
  101. package/dist/vta/pcs/vetter/show/0.1/payload.d.ts.map +1 -1
  102. package/dist/vta/pcs/vote/0.1/payload.d.ts +2208 -0
  103. package/dist/vta/pcs/vote/0.1/payload.d.ts.map +1 -0
  104. package/dist/vta/pcs/vote/0.1/payload.js +1282 -0
  105. package/dist/vta/pcs/vote/0.1/payload.js.map +1 -0
  106. package/dist/vta/pcs/voter/accept/0.1/payload.d.ts +450 -0
  107. package/dist/vta/pcs/voter/accept/0.1/payload.d.ts.map +1 -0
  108. package/dist/vta/pcs/voter/accept/0.1/payload.js +247 -0
  109. package/dist/vta/pcs/voter/accept/0.1/payload.js.map +1 -0
  110. package/dist/vta/pcs/voter/receipt/0.1/payload.d.ts +531 -0
  111. package/dist/vta/pcs/voter/receipt/0.1/payload.d.ts.map +1 -0
  112. package/dist/vta/pcs/voter/receipt/0.1/payload.js +301 -0
  113. package/dist/vta/pcs/voter/receipt/0.1/payload.js.map +1 -0
  114. package/dist/vta/pcs/voter/register/0.1/payload.d.ts +1934 -0
  115. package/dist/vta/pcs/voter/register/0.1/payload.d.ts.map +1 -0
  116. package/dist/vta/pcs/voter/register/0.1/payload.js +1133 -0
  117. package/dist/vta/pcs/voter/register/0.1/payload.js.map +1 -0
  118. package/dist/vtc/directory/card/present/0.1/payload.d.ts +2 -2
  119. package/dist/vtc/directory/card/present/0.1/payload.js +1 -1
  120. package/dist/vtc/directory/card/present/0.1/payload.js.map +1 -1
  121. package/dist/vtc/elections/cancel/0.1/payload.d.ts +301 -0
  122. package/dist/vtc/elections/cancel/0.1/payload.d.ts.map +1 -0
  123. package/dist/vtc/elections/cancel/0.1/payload.js +183 -0
  124. package/dist/vtc/elections/cancel/0.1/payload.js.map +1 -0
  125. package/dist/vtc/elections/certify/0.1/payload.d.ts +914 -0
  126. package/dist/vtc/elections/certify/0.1/payload.d.ts.map +1 -0
  127. package/dist/vtc/elections/certify/0.1/payload.js +512 -0
  128. package/dist/vtc/elections/certify/0.1/payload.js.map +1 -0
  129. package/dist/vtc/elections/close/0.1/payload.d.ts +301 -0
  130. package/dist/vtc/elections/close/0.1/payload.d.ts.map +1 -0
  131. package/dist/vtc/elections/close/0.1/payload.js +182 -0
  132. package/dist/vtc/elections/close/0.1/payload.js.map +1 -0
  133. package/dist/vtc/elections/create/0.1/payload.d.ts +1656 -0
  134. package/dist/vtc/elections/create/0.1/payload.d.ts.map +1 -0
  135. package/dist/vtc/elections/create/0.1/payload.js +994 -0
  136. package/dist/vtc/elections/create/0.1/payload.js.map +1 -0
  137. package/dist/vtc/elections/list/0.1/payload.d.ts +521 -0
  138. package/dist/vtc/elections/list/0.1/payload.d.ts.map +1 -0
  139. package/dist/vtc/elections/list/0.1/payload.js +290 -0
  140. package/dist/vtc/elections/list/0.1/payload.js.map +1 -0
  141. package/dist/vtc/elections/show/0.1/payload.d.ts +2688 -0
  142. package/dist/vtc/elections/show/0.1/payload.d.ts.map +1 -0
  143. package/dist/vtc/elections/show/0.1/payload.js +1581 -0
  144. package/dist/vtc/elections/show/0.1/payload.js.map +1 -0
  145. package/dist/vtc/elections/tickets/issue/0.1/payload.d.ts +597 -0
  146. package/dist/vtc/elections/tickets/issue/0.1/payload.d.ts.map +1 -0
  147. package/dist/vtc/elections/tickets/issue/0.1/payload.js +318 -0
  148. package/dist/vtc/elections/tickets/issue/0.1/payload.js.map +1 -0
  149. package/dist/vtc/groups/create/0.1/payload.d.ts +4 -4
  150. package/dist/vtc/groups/create/0.1/payload.js +2 -2
  151. package/dist/vtc/groups/create/0.1/payload.js.map +1 -1
  152. package/dist/vtc/groups/list/0.1/payload.d.ts +4 -4
  153. package/dist/vtc/groups/list/0.1/payload.js +2 -2
  154. package/dist/vtc/groups/list/0.1/payload.js.map +1 -1
  155. package/dist/vtc/groups/managers/add/0.1/payload.d.ts +337 -0
  156. package/dist/vtc/groups/managers/add/0.1/payload.d.ts.map +1 -0
  157. package/dist/vtc/groups/managers/add/0.1/payload.js +184 -0
  158. package/dist/vtc/groups/managers/add/0.1/payload.js.map +1 -0
  159. package/dist/vtc/groups/managers/remove/0.1/payload.d.ts +337 -0
  160. package/dist/vtc/groups/managers/remove/0.1/payload.d.ts.map +1 -0
  161. package/dist/vtc/groups/managers/remove/0.1/payload.js +184 -0
  162. package/dist/vtc/groups/managers/remove/0.1/payload.js.map +1 -0
  163. package/dist/vtc/groups/show/0.1/payload.d.ts +4 -4
  164. package/dist/vtc/groups/show/0.1/payload.js +2 -2
  165. package/dist/vtc/groups/show/0.1/payload.js.map +1 -1
  166. package/dist/vtc/groups/update/0.1/payload.d.ts +4 -4
  167. package/dist/vtc/groups/update/0.1/payload.js +2 -2
  168. package/dist/vtc/groups/update/0.1/payload.js.map +1 -1
  169. package/package.json +1 -1
  170. package/src/_shared/components.ts +332 -17
  171. package/src/device/list/0.1/payload.ts +4 -2
  172. package/src/device/list/0.2/payload.ts +4 -2
  173. package/src/device/register/0.1/payload.ts +4 -2
  174. package/src/device/register/0.2/payload.ts +4 -2
  175. package/src/index.ts +24 -0
  176. package/src/voting/_shared/0.1/voting.ts +17 -0
  177. package/src/voting/ballot/cast/0.1/payload.ts +560 -0
  178. package/src/voting/board/consistency/0.1/payload.ts +264 -0
  179. package/src/voting/board/head/0.1/payload.ts +257 -0
  180. package/src/voting/board/inclusion/0.1/payload.ts +300 -0
  181. package/src/voting/board/read/0.1/payload.ts +981 -0
  182. package/src/voting/election/cancel/0.1/payload.ts +368 -0
  183. package/src/voting/election/close/0.1/payload.ts +367 -0
  184. package/src/voting/election/register/0.1/payload.ts +1207 -0
  185. package/src/voting/election/show/0.1/payload.ts +1149 -0
  186. package/src/voting/result/show/0.1/payload.ts +536 -0
  187. package/src/vta/_shared/0.1/app-state-record.ts +1 -1
  188. package/src/vta/_shared/0.4/pcs-engine.ts +1 -1
  189. package/src/vta/app-state/delete/1.0/payload.ts +1 -1
  190. package/src/vta/app-state/get/1.0/payload.ts +1 -1
  191. package/src/vta/app-state/get-many/1.0/payload.ts +1 -1
  192. package/src/vta/app-state/list/1.0/payload.ts +1 -1
  193. package/src/vta/app-state/put/1.0/payload.ts +1 -1
  194. package/src/vta/app-state/put-many/1.0/payload.ts +1 -1
  195. package/src/vta/pcs/applications/create/0.1/payload.ts +1 -1
  196. package/src/vta/pcs/applications/show/0.1/payload.ts +1 -1
  197. package/src/vta/pcs/attest/0.1/payload.ts +1 -1
  198. package/src/vta/pcs/prove/0.1/payload.ts +1 -1
  199. package/src/vta/pcs/root-accept/0.1/payload.ts +1 -1
  200. package/src/vta/pcs/tokens/abandon/0.1/payload.ts +1 -1
  201. package/src/vta/pcs/tokens/accept/0.1/payload.ts +1 -1
  202. package/src/vta/pcs/verify-attestation/0.1/payload.ts +1 -1
  203. package/src/vta/pcs/vetter/show/0.1/payload.ts +1 -1
  204. package/src/vta/pcs/vote/0.1/payload.ts +1365 -0
  205. package/src/vta/pcs/voter/accept/0.1/payload.ts +306 -0
  206. package/src/vta/pcs/voter/receipt/0.1/payload.ts +367 -0
  207. package/src/vta/pcs/voter/register/0.1/payload.ts +1211 -0
  208. package/src/vtc/directory/card/present/0.1/payload.ts +1 -1
  209. package/src/vtc/elections/cancel/0.1/payload.ts +223 -0
  210. package/src/vtc/elections/certify/0.1/payload.ts +565 -0
  211. package/src/vtc/elections/close/0.1/payload.ts +222 -0
  212. package/src/vtc/elections/create/0.1/payload.ts +1041 -0
  213. package/src/vtc/elections/list/0.1/payload.ts +371 -0
  214. package/src/vtc/elections/show/0.1/payload.ts +1671 -0
  215. package/src/vtc/elections/tickets/issue/0.1/payload.ts +394 -0
  216. package/src/vtc/groups/create/0.1/payload.ts +2 -2
  217. package/src/vtc/groups/list/0.1/payload.ts +2 -2
  218. package/src/vtc/groups/managers/add/0.1/payload.ts +230 -0
  219. package/src/vtc/groups/managers/remove/0.1/payload.ts +230 -0
  220. package/src/vtc/groups/show/0.1/payload.ts +2 -2
  221. package/src/vtc/groups/update/0.1/payload.ts +2 -2
@@ -0,0 +1,887 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/voting/ballot/cast/0.1/payload.schema.json
4
+ */
5
+ import type { Answer, Ballot, BoardHead, Cast, DigestMultibase, ElectionId, Ext, Key_VotingV0_1 as Key, Multibase_VotingV0_1 as Multibase } from "../../../../_shared/components.js";
6
+ /**
7
+ * A voter's client sends one cast — a ballot and the PCS attestation that admits it — to the election's ballot box, signed by a did:key made for this cast alone. The ballot box answers with a signed receipt.
8
+ */
9
+ export interface VotingBallotCastPayload {
10
+ /**
11
+ * The DID of the community whose election this is.
12
+ */
13
+ community: string;
14
+ electionId: ElectionId;
15
+ cast: Cast;
16
+ ext?: Ext;
17
+ }
18
+ export interface VotingBallotCastResponsePayloadTheReceipt {
19
+ electionId: ElectionId;
20
+ /**
21
+ * `counted`: the first ballot under this tag, now counted. `replaced`: a later ballot under a tag that already had one; it is counted and the earlier one no longer is. `alreadyCounted`: this cast was admitted before; nothing changed, and the receipt is the first one's.
22
+ */
23
+ outcome: "counted" | "replaced" | "alreadyCounted";
24
+ /**
25
+ * The board index of this cast's CastEntry.
26
+ */
27
+ leafIndex: number;
28
+ /**
29
+ * The RFC 9162 leaf hash of the CastEntry at `leafIndex` (SHA-256, as a multihash).
30
+ */
31
+ entryHash: DigestMultibase;
32
+ /**
33
+ * A head whose tree includes `leafIndex` — and, for `replaced`, the ReplacementEntry that follows it.
34
+ */
35
+ head: BoardHead;
36
+ /**
37
+ * 32 random bytes, multibase base58btc. On a private board it authorizes voting/board/inclusion reads of this one leaf.
38
+ */
39
+ receiptToken: Multibase;
40
+ ext?: Ext;
41
+ }
42
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
43
+ export type { Answer, Ballot, BoardHead, Cast, DigestMultibase, ElectionId, Ext, Key, Multibase };
44
+ /** Trust Task type URI. */
45
+ export declare const TYPE_URI: "https://trusttasks.org/spec/voting/ballot/cast/0.1";
46
+ /** Stable alias for this specification's request payload shape. */
47
+ export type Payload = VotingBallotCastPayload;
48
+ /** Trust Task response type URI (request type URI + "#response"). */
49
+ export declare const RESPONSE_TYPE_URI: "https://trusttasks.org/spec/voting/ballot/cast/0.1#response";
50
+ /** Stable alias for this specification's success-response payload shape. */
51
+ export type Response = VotingBallotCastResponsePayloadTheReceipt;
52
+ /**
53
+ * This specification's payload schema, as a value.
54
+ *
55
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
56
+ * rather than only as a `.json` file because TypeScript types are erased
57
+ * at runtime: without a schema a consumer has nothing to validate, and
58
+ * every REQUIRED payload member is optional in practice. Cross-file
59
+ * `$ref`s are already inlined, so it needs no resolver.
60
+ */
61
+ export declare const PAYLOAD_SCHEMA: {
62
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
63
+ readonly $id: "https://trusttasks.org/spec/voting/ballot/cast/0.1";
64
+ readonly title: "Voting — Ballot Cast — payload";
65
+ readonly description: "A voter's client sends one cast — a ballot and the PCS attestation that admits it — to the election's ballot box, signed by a did:key made for this cast alone. The ballot box answers with a signed receipt.";
66
+ readonly type: "object";
67
+ readonly additionalProperties: false;
68
+ readonly required: readonly ["community", "electionId", "cast"];
69
+ readonly properties: {
70
+ readonly community: {
71
+ readonly type: "string";
72
+ readonly minLength: 1;
73
+ readonly maxLength: 2048;
74
+ readonly description: "The DID of the community whose election this is.";
75
+ };
76
+ readonly electionId: {
77
+ readonly $ref: "#/$defs/ElectionId";
78
+ };
79
+ readonly cast: {
80
+ readonly $ref: "#/$defs/Cast";
81
+ };
82
+ readonly ext: {
83
+ readonly $ref: "#/$defs/Ext";
84
+ };
85
+ };
86
+ readonly $defs: {
87
+ readonly Response: {
88
+ readonly $anchor: "response";
89
+ readonly title: "Voting — Ballot Cast — response payload (the receipt)";
90
+ readonly type: "object";
91
+ readonly additionalProperties: false;
92
+ readonly required: readonly ["electionId", "outcome", "leafIndex", "entryHash", "head", "receiptToken"];
93
+ readonly properties: {
94
+ readonly electionId: {
95
+ readonly $ref: "#/$defs/ElectionId";
96
+ };
97
+ readonly outcome: {
98
+ readonly type: "string";
99
+ readonly enum: readonly ["counted", "replaced", "alreadyCounted"];
100
+ readonly description: "`counted`: the first ballot under this tag, now counted. `replaced`: a later ballot under a tag that already had one; it is counted and the earlier one no longer is. `alreadyCounted`: this cast was admitted before; nothing changed, and the receipt is the first one's.";
101
+ };
102
+ readonly leafIndex: {
103
+ readonly type: "integer";
104
+ readonly minimum: 0;
105
+ readonly description: "The board index of this cast's CastEntry.";
106
+ };
107
+ readonly entryHash: {
108
+ readonly $ref: "#/$defs/DigestMultibase";
109
+ readonly description: "The RFC 9162 leaf hash of the CastEntry at `leafIndex` (SHA-256, as a multihash).";
110
+ };
111
+ readonly head: {
112
+ readonly $ref: "#/$defs/BoardHead";
113
+ readonly description: "A head whose tree includes `leafIndex` — and, for `replaced`, the ReplacementEntry that follows it.";
114
+ };
115
+ readonly receiptToken: {
116
+ readonly $ref: "#/$defs/Multibase";
117
+ readonly description: "32 random bytes, multibase base58btc. On a private board it authorizes voting/board/inclusion reads of this one leaf.";
118
+ };
119
+ readonly ext: {
120
+ readonly $ref: "#/$defs/Ext";
121
+ };
122
+ };
123
+ };
124
+ readonly Ext: {
125
+ readonly title: "Ext";
126
+ 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.";
127
+ readonly type: "object";
128
+ readonly minProperties: 1;
129
+ readonly additionalProperties: true;
130
+ readonly propertyNames: {
131
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
132
+ };
133
+ };
134
+ readonly Multibase: {
135
+ readonly title: "Multibase";
136
+ readonly description: "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.";
137
+ readonly type: "string";
138
+ readonly maxLength: 16384;
139
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
140
+ };
141
+ readonly BoardHead: {
142
+ readonly title: "BoardHead";
143
+ 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.";
144
+ readonly type: "object";
145
+ readonly additionalProperties: false;
146
+ readonly required: readonly ["electionId", "treeSize", "rootHash", "issuedAt"];
147
+ readonly properties: {
148
+ readonly electionId: {
149
+ readonly $ref: "#/$defs/ElectionId";
150
+ };
151
+ readonly treeSize: {
152
+ readonly type: "integer";
153
+ readonly minimum: 0;
154
+ };
155
+ readonly rootHash: {
156
+ readonly $ref: "#/$defs/DigestMultibase";
157
+ readonly description: "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash.";
158
+ };
159
+ readonly issuedAt: {
160
+ readonly type: "string";
161
+ readonly format: "date-time";
162
+ };
163
+ };
164
+ };
165
+ readonly ElectionId: {
166
+ readonly title: "ElectionId";
167
+ 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.";
168
+ readonly type: "string";
169
+ readonly pattern: "^[A-Za-z0-9._-]{1,128}$";
170
+ };
171
+ readonly DigestMultibase: {
172
+ readonly title: "DigestMultibase";
173
+ 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`.";
174
+ readonly type: "string";
175
+ readonly minLength: 16;
176
+ readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
177
+ readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
178
+ };
179
+ readonly Cast: {
180
+ readonly title: "Cast";
181
+ readonly description: "A ballot and the PCS attestation that admits it (VTI-VOT-030). `attestation` is the suite's canonical encoding of the attestation made for the election point with the ballot context bound in (CONVENTIONS §3); `tag` repeats its tag so a ballot box can refuse a duplicate before the pairing check.";
182
+ readonly type: "object";
183
+ readonly additionalProperties: false;
184
+ readonly required: readonly ["ballot", "tag", "attestation"];
185
+ readonly properties: {
186
+ readonly ballot: {
187
+ readonly $ref: "#/$defs/Ballot";
188
+ };
189
+ readonly tag: {
190
+ readonly $ref: "#/$defs/Multibase";
191
+ };
192
+ readonly attestation: {
193
+ readonly $ref: "#/$defs/Multibase";
194
+ };
195
+ };
196
+ };
197
+ readonly Ballot: {
198
+ readonly title: "Ballot";
199
+ readonly description: "An open ballot: one answer per question of the manifest, in any order. The bytes a cast's proof binds are the RFC 8785 (JCS) canonicalization of this object as received.";
200
+ readonly type: "object";
201
+ readonly additionalProperties: false;
202
+ readonly required: readonly ["electionId", "manifestDigest", "answers"];
203
+ readonly properties: {
204
+ readonly electionId: {
205
+ readonly $ref: "#/$defs/ElectionId";
206
+ };
207
+ readonly manifestDigest: {
208
+ readonly $ref: "#/$defs/DigestMultibase";
209
+ };
210
+ readonly answers: {
211
+ readonly type: "array";
212
+ readonly minItems: 1;
213
+ readonly maxItems: 128;
214
+ readonly items: {
215
+ readonly $ref: "#/$defs/Answer";
216
+ };
217
+ };
218
+ };
219
+ };
220
+ readonly Answer: {
221
+ readonly title: "Answer";
222
+ readonly description: "The answer to one question. Exactly one member besides `question` is present, matching the question's type, or `abstain` for an optional question left unanswered.";
223
+ readonly type: "object";
224
+ readonly additionalProperties: false;
225
+ readonly required: readonly ["question"];
226
+ readonly minProperties: 2;
227
+ readonly maxProperties: 2;
228
+ readonly properties: {
229
+ readonly question: {
230
+ readonly $ref: "#/$defs/Key";
231
+ };
232
+ readonly choice: {
233
+ readonly type: "array";
234
+ readonly items: {
235
+ readonly $ref: "#/$defs/Key";
236
+ };
237
+ readonly uniqueItems: true;
238
+ };
239
+ readonly ranking: {
240
+ readonly type: "array";
241
+ readonly items: {
242
+ readonly $ref: "#/$defs/Key";
243
+ };
244
+ readonly uniqueItems: true;
245
+ };
246
+ readonly scores: {
247
+ readonly type: "object";
248
+ readonly propertyNames: {
249
+ readonly $ref: "#/$defs/Key";
250
+ };
251
+ readonly additionalProperties: {
252
+ readonly type: "integer";
253
+ };
254
+ };
255
+ readonly text: {
256
+ readonly type: "string";
257
+ readonly maxLength: 4096;
258
+ };
259
+ readonly abstain: {
260
+ readonly const: true;
261
+ };
262
+ };
263
+ };
264
+ readonly Key: {
265
+ readonly title: "Key";
266
+ readonly description: "A question or option key, unique within its manifest or question.";
267
+ readonly type: "string";
268
+ readonly pattern: "^[A-Za-z0-9._-]{1,64}$";
269
+ };
270
+ };
271
+ };
272
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
273
+ export declare const RESPONSE_PAYLOAD_SCHEMA: {
274
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
275
+ readonly $ref: "#/$defs/Response";
276
+ readonly $defs: {
277
+ readonly Response: {
278
+ readonly $anchor: "response";
279
+ readonly title: "Voting — Ballot Cast — response payload (the receipt)";
280
+ readonly type: "object";
281
+ readonly additionalProperties: false;
282
+ readonly required: readonly ["electionId", "outcome", "leafIndex", "entryHash", "head", "receiptToken"];
283
+ readonly properties: {
284
+ readonly electionId: {
285
+ readonly $ref: "#/$defs/ElectionId";
286
+ };
287
+ readonly outcome: {
288
+ readonly type: "string";
289
+ readonly enum: readonly ["counted", "replaced", "alreadyCounted"];
290
+ readonly description: "`counted`: the first ballot under this tag, now counted. `replaced`: a later ballot under a tag that already had one; it is counted and the earlier one no longer is. `alreadyCounted`: this cast was admitted before; nothing changed, and the receipt is the first one's.";
291
+ };
292
+ readonly leafIndex: {
293
+ readonly type: "integer";
294
+ readonly minimum: 0;
295
+ readonly description: "The board index of this cast's CastEntry.";
296
+ };
297
+ readonly entryHash: {
298
+ readonly $ref: "#/$defs/DigestMultibase";
299
+ readonly description: "The RFC 9162 leaf hash of the CastEntry at `leafIndex` (SHA-256, as a multihash).";
300
+ };
301
+ readonly head: {
302
+ readonly $ref: "#/$defs/BoardHead";
303
+ readonly description: "A head whose tree includes `leafIndex` — and, for `replaced`, the ReplacementEntry that follows it.";
304
+ };
305
+ readonly receiptToken: {
306
+ readonly $ref: "#/$defs/Multibase";
307
+ readonly description: "32 random bytes, multibase base58btc. On a private board it authorizes voting/board/inclusion reads of this one leaf.";
308
+ };
309
+ readonly ext: {
310
+ readonly $ref: "#/$defs/Ext";
311
+ };
312
+ };
313
+ };
314
+ readonly Ext: {
315
+ readonly title: "Ext";
316
+ 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.";
317
+ readonly type: "object";
318
+ readonly minProperties: 1;
319
+ readonly additionalProperties: true;
320
+ readonly propertyNames: {
321
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
322
+ };
323
+ };
324
+ readonly Multibase: {
325
+ readonly title: "Multibase";
326
+ readonly description: "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.";
327
+ readonly type: "string";
328
+ readonly maxLength: 16384;
329
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
330
+ };
331
+ readonly BoardHead: {
332
+ readonly title: "BoardHead";
333
+ 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.";
334
+ readonly type: "object";
335
+ readonly additionalProperties: false;
336
+ readonly required: readonly ["electionId", "treeSize", "rootHash", "issuedAt"];
337
+ readonly properties: {
338
+ readonly electionId: {
339
+ readonly $ref: "#/$defs/ElectionId";
340
+ };
341
+ readonly treeSize: {
342
+ readonly type: "integer";
343
+ readonly minimum: 0;
344
+ };
345
+ readonly rootHash: {
346
+ readonly $ref: "#/$defs/DigestMultibase";
347
+ readonly description: "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash.";
348
+ };
349
+ readonly issuedAt: {
350
+ readonly type: "string";
351
+ readonly format: "date-time";
352
+ };
353
+ };
354
+ };
355
+ readonly ElectionId: {
356
+ readonly title: "ElectionId";
357
+ 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.";
358
+ readonly type: "string";
359
+ readonly pattern: "^[A-Za-z0-9._-]{1,128}$";
360
+ };
361
+ readonly DigestMultibase: {
362
+ readonly title: "DigestMultibase";
363
+ 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`.";
364
+ readonly type: "string";
365
+ readonly minLength: 16;
366
+ readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
367
+ readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
368
+ };
369
+ readonly Cast: {
370
+ readonly title: "Cast";
371
+ readonly description: "A ballot and the PCS attestation that admits it (VTI-VOT-030). `attestation` is the suite's canonical encoding of the attestation made for the election point with the ballot context bound in (CONVENTIONS §3); `tag` repeats its tag so a ballot box can refuse a duplicate before the pairing check.";
372
+ readonly type: "object";
373
+ readonly additionalProperties: false;
374
+ readonly required: readonly ["ballot", "tag", "attestation"];
375
+ readonly properties: {
376
+ readonly ballot: {
377
+ readonly $ref: "#/$defs/Ballot";
378
+ };
379
+ readonly tag: {
380
+ readonly $ref: "#/$defs/Multibase";
381
+ };
382
+ readonly attestation: {
383
+ readonly $ref: "#/$defs/Multibase";
384
+ };
385
+ };
386
+ };
387
+ readonly Ballot: {
388
+ readonly title: "Ballot";
389
+ readonly description: "An open ballot: one answer per question of the manifest, in any order. The bytes a cast's proof binds are the RFC 8785 (JCS) canonicalization of this object as received.";
390
+ readonly type: "object";
391
+ readonly additionalProperties: false;
392
+ readonly required: readonly ["electionId", "manifestDigest", "answers"];
393
+ readonly properties: {
394
+ readonly electionId: {
395
+ readonly $ref: "#/$defs/ElectionId";
396
+ };
397
+ readonly manifestDigest: {
398
+ readonly $ref: "#/$defs/DigestMultibase";
399
+ };
400
+ readonly answers: {
401
+ readonly type: "array";
402
+ readonly minItems: 1;
403
+ readonly maxItems: 128;
404
+ readonly items: {
405
+ readonly $ref: "#/$defs/Answer";
406
+ };
407
+ };
408
+ };
409
+ };
410
+ readonly Answer: {
411
+ readonly title: "Answer";
412
+ readonly description: "The answer to one question. Exactly one member besides `question` is present, matching the question's type, or `abstain` for an optional question left unanswered.";
413
+ readonly type: "object";
414
+ readonly additionalProperties: false;
415
+ readonly required: readonly ["question"];
416
+ readonly minProperties: 2;
417
+ readonly maxProperties: 2;
418
+ readonly properties: {
419
+ readonly question: {
420
+ readonly $ref: "#/$defs/Key";
421
+ };
422
+ readonly choice: {
423
+ readonly type: "array";
424
+ readonly items: {
425
+ readonly $ref: "#/$defs/Key";
426
+ };
427
+ readonly uniqueItems: true;
428
+ };
429
+ readonly ranking: {
430
+ readonly type: "array";
431
+ readonly items: {
432
+ readonly $ref: "#/$defs/Key";
433
+ };
434
+ readonly uniqueItems: true;
435
+ };
436
+ readonly scores: {
437
+ readonly type: "object";
438
+ readonly propertyNames: {
439
+ readonly $ref: "#/$defs/Key";
440
+ };
441
+ readonly additionalProperties: {
442
+ readonly type: "integer";
443
+ };
444
+ };
445
+ readonly text: {
446
+ readonly type: "string";
447
+ readonly maxLength: 4096;
448
+ };
449
+ readonly abstain: {
450
+ readonly const: true;
451
+ };
452
+ };
453
+ };
454
+ readonly Key: {
455
+ readonly title: "Key";
456
+ readonly description: "A question or option key, unique within its manifest or question.";
457
+ readonly type: "string";
458
+ readonly pattern: "^[A-Za-z0-9._-]{1,64}$";
459
+ };
460
+ };
461
+ };
462
+ /**
463
+ * SPEC.md §7.2 policy for the request variant, from this specification's
464
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
465
+ * per-specification and cannot be derived from the document alone, and
466
+ * item 2 needs the schema this carries.
467
+ */
468
+ export declare const SPEC: {
469
+ readonly typeUri: "https://trusttasks.org/spec/voting/ballot/cast/0.1";
470
+ readonly isBearer: false;
471
+ readonly isProofRequired: true;
472
+ readonly isRecipientRequired: true;
473
+ readonly isIssuedAtRequired: true;
474
+ readonly payloadSchema: {
475
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
476
+ readonly $id: "https://trusttasks.org/spec/voting/ballot/cast/0.1";
477
+ readonly title: "Voting — Ballot Cast — payload";
478
+ readonly description: "A voter's client sends one cast — a ballot and the PCS attestation that admits it — to the election's ballot box, signed by a did:key made for this cast alone. The ballot box answers with a signed receipt.";
479
+ readonly type: "object";
480
+ readonly additionalProperties: false;
481
+ readonly required: readonly ["community", "electionId", "cast"];
482
+ readonly properties: {
483
+ readonly community: {
484
+ readonly type: "string";
485
+ readonly minLength: 1;
486
+ readonly maxLength: 2048;
487
+ readonly description: "The DID of the community whose election this is.";
488
+ };
489
+ readonly electionId: {
490
+ readonly $ref: "#/$defs/ElectionId";
491
+ };
492
+ readonly cast: {
493
+ readonly $ref: "#/$defs/Cast";
494
+ };
495
+ readonly ext: {
496
+ readonly $ref: "#/$defs/Ext";
497
+ };
498
+ };
499
+ readonly $defs: {
500
+ readonly Response: {
501
+ readonly $anchor: "response";
502
+ readonly title: "Voting — Ballot Cast — response payload (the receipt)";
503
+ readonly type: "object";
504
+ readonly additionalProperties: false;
505
+ readonly required: readonly ["electionId", "outcome", "leafIndex", "entryHash", "head", "receiptToken"];
506
+ readonly properties: {
507
+ readonly electionId: {
508
+ readonly $ref: "#/$defs/ElectionId";
509
+ };
510
+ readonly outcome: {
511
+ readonly type: "string";
512
+ readonly enum: readonly ["counted", "replaced", "alreadyCounted"];
513
+ readonly description: "`counted`: the first ballot under this tag, now counted. `replaced`: a later ballot under a tag that already had one; it is counted and the earlier one no longer is. `alreadyCounted`: this cast was admitted before; nothing changed, and the receipt is the first one's.";
514
+ };
515
+ readonly leafIndex: {
516
+ readonly type: "integer";
517
+ readonly minimum: 0;
518
+ readonly description: "The board index of this cast's CastEntry.";
519
+ };
520
+ readonly entryHash: {
521
+ readonly $ref: "#/$defs/DigestMultibase";
522
+ readonly description: "The RFC 9162 leaf hash of the CastEntry at `leafIndex` (SHA-256, as a multihash).";
523
+ };
524
+ readonly head: {
525
+ readonly $ref: "#/$defs/BoardHead";
526
+ readonly description: "A head whose tree includes `leafIndex` — and, for `replaced`, the ReplacementEntry that follows it.";
527
+ };
528
+ readonly receiptToken: {
529
+ readonly $ref: "#/$defs/Multibase";
530
+ readonly description: "32 random bytes, multibase base58btc. On a private board it authorizes voting/board/inclusion reads of this one leaf.";
531
+ };
532
+ readonly ext: {
533
+ readonly $ref: "#/$defs/Ext";
534
+ };
535
+ };
536
+ };
537
+ readonly Ext: {
538
+ readonly title: "Ext";
539
+ 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.";
540
+ readonly type: "object";
541
+ readonly minProperties: 1;
542
+ readonly additionalProperties: true;
543
+ readonly propertyNames: {
544
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
545
+ };
546
+ };
547
+ readonly Multibase: {
548
+ readonly title: "Multibase";
549
+ readonly description: "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.";
550
+ readonly type: "string";
551
+ readonly maxLength: 16384;
552
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
553
+ };
554
+ readonly BoardHead: {
555
+ readonly title: "BoardHead";
556
+ 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.";
557
+ readonly type: "object";
558
+ readonly additionalProperties: false;
559
+ readonly required: readonly ["electionId", "treeSize", "rootHash", "issuedAt"];
560
+ readonly properties: {
561
+ readonly electionId: {
562
+ readonly $ref: "#/$defs/ElectionId";
563
+ };
564
+ readonly treeSize: {
565
+ readonly type: "integer";
566
+ readonly minimum: 0;
567
+ };
568
+ readonly rootHash: {
569
+ readonly $ref: "#/$defs/DigestMultibase";
570
+ readonly description: "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash.";
571
+ };
572
+ readonly issuedAt: {
573
+ readonly type: "string";
574
+ readonly format: "date-time";
575
+ };
576
+ };
577
+ };
578
+ readonly ElectionId: {
579
+ readonly title: "ElectionId";
580
+ 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.";
581
+ readonly type: "string";
582
+ readonly pattern: "^[A-Za-z0-9._-]{1,128}$";
583
+ };
584
+ readonly DigestMultibase: {
585
+ readonly title: "DigestMultibase";
586
+ 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`.";
587
+ readonly type: "string";
588
+ readonly minLength: 16;
589
+ readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
590
+ readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
591
+ };
592
+ readonly Cast: {
593
+ readonly title: "Cast";
594
+ readonly description: "A ballot and the PCS attestation that admits it (VTI-VOT-030). `attestation` is the suite's canonical encoding of the attestation made for the election point with the ballot context bound in (CONVENTIONS §3); `tag` repeats its tag so a ballot box can refuse a duplicate before the pairing check.";
595
+ readonly type: "object";
596
+ readonly additionalProperties: false;
597
+ readonly required: readonly ["ballot", "tag", "attestation"];
598
+ readonly properties: {
599
+ readonly ballot: {
600
+ readonly $ref: "#/$defs/Ballot";
601
+ };
602
+ readonly tag: {
603
+ readonly $ref: "#/$defs/Multibase";
604
+ };
605
+ readonly attestation: {
606
+ readonly $ref: "#/$defs/Multibase";
607
+ };
608
+ };
609
+ };
610
+ readonly Ballot: {
611
+ readonly title: "Ballot";
612
+ readonly description: "An open ballot: one answer per question of the manifest, in any order. The bytes a cast's proof binds are the RFC 8785 (JCS) canonicalization of this object as received.";
613
+ readonly type: "object";
614
+ readonly additionalProperties: false;
615
+ readonly required: readonly ["electionId", "manifestDigest", "answers"];
616
+ readonly properties: {
617
+ readonly electionId: {
618
+ readonly $ref: "#/$defs/ElectionId";
619
+ };
620
+ readonly manifestDigest: {
621
+ readonly $ref: "#/$defs/DigestMultibase";
622
+ };
623
+ readonly answers: {
624
+ readonly type: "array";
625
+ readonly minItems: 1;
626
+ readonly maxItems: 128;
627
+ readonly items: {
628
+ readonly $ref: "#/$defs/Answer";
629
+ };
630
+ };
631
+ };
632
+ };
633
+ readonly Answer: {
634
+ readonly title: "Answer";
635
+ readonly description: "The answer to one question. Exactly one member besides `question` is present, matching the question's type, or `abstain` for an optional question left unanswered.";
636
+ readonly type: "object";
637
+ readonly additionalProperties: false;
638
+ readonly required: readonly ["question"];
639
+ readonly minProperties: 2;
640
+ readonly maxProperties: 2;
641
+ readonly properties: {
642
+ readonly question: {
643
+ readonly $ref: "#/$defs/Key";
644
+ };
645
+ readonly choice: {
646
+ readonly type: "array";
647
+ readonly items: {
648
+ readonly $ref: "#/$defs/Key";
649
+ };
650
+ readonly uniqueItems: true;
651
+ };
652
+ readonly ranking: {
653
+ readonly type: "array";
654
+ readonly items: {
655
+ readonly $ref: "#/$defs/Key";
656
+ };
657
+ readonly uniqueItems: true;
658
+ };
659
+ readonly scores: {
660
+ readonly type: "object";
661
+ readonly propertyNames: {
662
+ readonly $ref: "#/$defs/Key";
663
+ };
664
+ readonly additionalProperties: {
665
+ readonly type: "integer";
666
+ };
667
+ };
668
+ readonly text: {
669
+ readonly type: "string";
670
+ readonly maxLength: 4096;
671
+ };
672
+ readonly abstain: {
673
+ readonly const: true;
674
+ };
675
+ };
676
+ };
677
+ readonly Key: {
678
+ readonly title: "Key";
679
+ readonly description: "A question or option key, unique within its manifest or question.";
680
+ readonly type: "string";
681
+ readonly pattern: "^[A-Za-z0-9._-]{1,64}$";
682
+ };
683
+ };
684
+ };
685
+ };
686
+ /**
687
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
688
+ * tracks the *issuer* party's requirement because a response swaps the
689
+ * parties (§7.3 item 5).
690
+ */
691
+ export declare const RESPONSE_SPEC: {
692
+ readonly typeUri: "https://trusttasks.org/spec/voting/ballot/cast/0.1#response";
693
+ readonly isBearer: false;
694
+ readonly isProofRequired: true;
695
+ readonly isRecipientRequired: true;
696
+ readonly isIssuedAtRequired: true;
697
+ readonly payloadSchema: {
698
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
699
+ readonly $ref: "#/$defs/Response";
700
+ readonly $defs: {
701
+ readonly Response: {
702
+ readonly $anchor: "response";
703
+ readonly title: "Voting — Ballot Cast — response payload (the receipt)";
704
+ readonly type: "object";
705
+ readonly additionalProperties: false;
706
+ readonly required: readonly ["electionId", "outcome", "leafIndex", "entryHash", "head", "receiptToken"];
707
+ readonly properties: {
708
+ readonly electionId: {
709
+ readonly $ref: "#/$defs/ElectionId";
710
+ };
711
+ readonly outcome: {
712
+ readonly type: "string";
713
+ readonly enum: readonly ["counted", "replaced", "alreadyCounted"];
714
+ readonly description: "`counted`: the first ballot under this tag, now counted. `replaced`: a later ballot under a tag that already had one; it is counted and the earlier one no longer is. `alreadyCounted`: this cast was admitted before; nothing changed, and the receipt is the first one's.";
715
+ };
716
+ readonly leafIndex: {
717
+ readonly type: "integer";
718
+ readonly minimum: 0;
719
+ readonly description: "The board index of this cast's CastEntry.";
720
+ };
721
+ readonly entryHash: {
722
+ readonly $ref: "#/$defs/DigestMultibase";
723
+ readonly description: "The RFC 9162 leaf hash of the CastEntry at `leafIndex` (SHA-256, as a multihash).";
724
+ };
725
+ readonly head: {
726
+ readonly $ref: "#/$defs/BoardHead";
727
+ readonly description: "A head whose tree includes `leafIndex` — and, for `replaced`, the ReplacementEntry that follows it.";
728
+ };
729
+ readonly receiptToken: {
730
+ readonly $ref: "#/$defs/Multibase";
731
+ readonly description: "32 random bytes, multibase base58btc. On a private board it authorizes voting/board/inclusion reads of this one leaf.";
732
+ };
733
+ readonly ext: {
734
+ readonly $ref: "#/$defs/Ext";
735
+ };
736
+ };
737
+ };
738
+ readonly Ext: {
739
+ readonly title: "Ext";
740
+ 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.";
741
+ readonly type: "object";
742
+ readonly minProperties: 1;
743
+ readonly additionalProperties: true;
744
+ readonly propertyNames: {
745
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
746
+ };
747
+ };
748
+ readonly Multibase: {
749
+ readonly title: "Multibase";
750
+ readonly description: "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.";
751
+ readonly type: "string";
752
+ readonly maxLength: 16384;
753
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
754
+ };
755
+ readonly BoardHead: {
756
+ readonly title: "BoardHead";
757
+ 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.";
758
+ readonly type: "object";
759
+ readonly additionalProperties: false;
760
+ readonly required: readonly ["electionId", "treeSize", "rootHash", "issuedAt"];
761
+ readonly properties: {
762
+ readonly electionId: {
763
+ readonly $ref: "#/$defs/ElectionId";
764
+ };
765
+ readonly treeSize: {
766
+ readonly type: "integer";
767
+ readonly minimum: 0;
768
+ };
769
+ readonly rootHash: {
770
+ readonly $ref: "#/$defs/DigestMultibase";
771
+ readonly description: "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash.";
772
+ };
773
+ readonly issuedAt: {
774
+ readonly type: "string";
775
+ readonly format: "date-time";
776
+ };
777
+ };
778
+ };
779
+ readonly ElectionId: {
780
+ readonly title: "ElectionId";
781
+ 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.";
782
+ readonly type: "string";
783
+ readonly pattern: "^[A-Za-z0-9._-]{1,128}$";
784
+ };
785
+ readonly DigestMultibase: {
786
+ readonly title: "DigestMultibase";
787
+ 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`.";
788
+ readonly type: "string";
789
+ readonly minLength: 16;
790
+ readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
791
+ readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
792
+ };
793
+ readonly Cast: {
794
+ readonly title: "Cast";
795
+ readonly description: "A ballot and the PCS attestation that admits it (VTI-VOT-030). `attestation` is the suite's canonical encoding of the attestation made for the election point with the ballot context bound in (CONVENTIONS §3); `tag` repeats its tag so a ballot box can refuse a duplicate before the pairing check.";
796
+ readonly type: "object";
797
+ readonly additionalProperties: false;
798
+ readonly required: readonly ["ballot", "tag", "attestation"];
799
+ readonly properties: {
800
+ readonly ballot: {
801
+ readonly $ref: "#/$defs/Ballot";
802
+ };
803
+ readonly tag: {
804
+ readonly $ref: "#/$defs/Multibase";
805
+ };
806
+ readonly attestation: {
807
+ readonly $ref: "#/$defs/Multibase";
808
+ };
809
+ };
810
+ };
811
+ readonly Ballot: {
812
+ readonly title: "Ballot";
813
+ readonly description: "An open ballot: one answer per question of the manifest, in any order. The bytes a cast's proof binds are the RFC 8785 (JCS) canonicalization of this object as received.";
814
+ readonly type: "object";
815
+ readonly additionalProperties: false;
816
+ readonly required: readonly ["electionId", "manifestDigest", "answers"];
817
+ readonly properties: {
818
+ readonly electionId: {
819
+ readonly $ref: "#/$defs/ElectionId";
820
+ };
821
+ readonly manifestDigest: {
822
+ readonly $ref: "#/$defs/DigestMultibase";
823
+ };
824
+ readonly answers: {
825
+ readonly type: "array";
826
+ readonly minItems: 1;
827
+ readonly maxItems: 128;
828
+ readonly items: {
829
+ readonly $ref: "#/$defs/Answer";
830
+ };
831
+ };
832
+ };
833
+ };
834
+ readonly Answer: {
835
+ readonly title: "Answer";
836
+ readonly description: "The answer to one question. Exactly one member besides `question` is present, matching the question's type, or `abstain` for an optional question left unanswered.";
837
+ readonly type: "object";
838
+ readonly additionalProperties: false;
839
+ readonly required: readonly ["question"];
840
+ readonly minProperties: 2;
841
+ readonly maxProperties: 2;
842
+ readonly properties: {
843
+ readonly question: {
844
+ readonly $ref: "#/$defs/Key";
845
+ };
846
+ readonly choice: {
847
+ readonly type: "array";
848
+ readonly items: {
849
+ readonly $ref: "#/$defs/Key";
850
+ };
851
+ readonly uniqueItems: true;
852
+ };
853
+ readonly ranking: {
854
+ readonly type: "array";
855
+ readonly items: {
856
+ readonly $ref: "#/$defs/Key";
857
+ };
858
+ readonly uniqueItems: true;
859
+ };
860
+ readonly scores: {
861
+ readonly type: "object";
862
+ readonly propertyNames: {
863
+ readonly $ref: "#/$defs/Key";
864
+ };
865
+ readonly additionalProperties: {
866
+ readonly type: "integer";
867
+ };
868
+ };
869
+ readonly text: {
870
+ readonly type: "string";
871
+ readonly maxLength: 4096;
872
+ };
873
+ readonly abstain: {
874
+ readonly const: true;
875
+ };
876
+ };
877
+ };
878
+ readonly Key: {
879
+ readonly title: "Key";
880
+ readonly description: "A question or option key, unique within its manifest or question.";
881
+ readonly type: "string";
882
+ readonly pattern: "^[A-Za-z0-9._-]{1,64}$";
883
+ };
884
+ };
885
+ };
886
+ };
887
+ //# sourceMappingURL=payload.d.ts.map