@openvtc/trust-tasks 0.28.5 → 0.28.7

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