@openvtc/trust-tasks 0.27.0 → 0.27.2

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