@openvtc/trust-tasks 0.26.20 → 0.26.21

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