@openvtc/trust-tasks 0.26.20 → 0.26.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. package/CHANGELOG.md +84 -0
  2. package/dist/_shared/components.d.ts +328 -17
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/device/list/0.1/payload.d.ts +4 -4
  5. package/dist/device/list/0.1/payload.d.ts.map +1 -1
  6. package/dist/device/list/0.1/payload.js +4 -2
  7. package/dist/device/list/0.1/payload.js.map +1 -1
  8. package/dist/device/list/0.2/payload.d.ts +4 -4
  9. package/dist/device/list/0.2/payload.d.ts.map +1 -1
  10. package/dist/device/list/0.2/payload.js +4 -2
  11. package/dist/device/list/0.2/payload.js.map +1 -1
  12. package/dist/device/register/0.1/payload.d.ts +4 -4
  13. package/dist/device/register/0.1/payload.d.ts.map +1 -1
  14. package/dist/device/register/0.1/payload.js +4 -2
  15. package/dist/device/register/0.1/payload.js.map +1 -1
  16. package/dist/device/register/0.2/payload.d.ts +4 -4
  17. package/dist/device/register/0.2/payload.d.ts.map +1 -1
  18. package/dist/device/register/0.2/payload.js +4 -2
  19. package/dist/device/register/0.2/payload.js.map +1 -1
  20. package/dist/index.d.ts +24 -0
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +24 -0
  23. package/dist/index.js.map +1 -1
  24. package/dist/voting/_shared/0.1/voting.d.ts +16 -0
  25. package/dist/voting/_shared/0.1/voting.d.ts.map +1 -0
  26. package/dist/voting/_shared/0.1/voting.js +6 -0
  27. package/dist/voting/_shared/0.1/voting.js.map +1 -0
  28. package/dist/voting/ballot/cast/0.1/payload.d.ts +887 -0
  29. package/dist/voting/ballot/cast/0.1/payload.d.ts.map +1 -0
  30. package/dist/voting/ballot/cast/0.1/payload.js +506 -0
  31. package/dist/voting/ballot/cast/0.1/payload.js.map +1 -0
  32. package/dist/voting/board/consistency/0.1/payload.d.ts +389 -0
  33. package/dist/voting/board/consistency/0.1/payload.d.ts.map +1 -0
  34. package/dist/voting/board/consistency/0.1/payload.js +218 -0
  35. package/dist/voting/board/consistency/0.1/payload.js.map +1 -0
  36. package/dist/voting/board/head/0.1/payload.d.ts +380 -0
  37. package/dist/voting/board/head/0.1/payload.d.ts.map +1 -0
  38. package/dist/voting/board/head/0.1/payload.js +224 -0
  39. package/dist/voting/board/head/0.1/payload.js.map +1 -0
  40. package/dist/voting/board/inclusion/0.1/payload.d.ts +449 -0
  41. package/dist/voting/board/inclusion/0.1/payload.d.ts.map +1 -0
  42. package/dist/voting/board/inclusion/0.1/payload.js +246 -0
  43. package/dist/voting/board/inclusion/0.1/payload.js.map +1 -0
  44. package/dist/voting/board/read/0.1/payload.d.ts +1596 -0
  45. package/dist/voting/board/read/0.1/payload.d.ts.map +1 -0
  46. package/dist/voting/board/read/0.1/payload.js +920 -0
  47. package/dist/voting/board/read/0.1/payload.js.map +1 -0
  48. package/dist/voting/election/cancel/0.1/payload.d.ts +540 -0
  49. package/dist/voting/election/cancel/0.1/payload.d.ts.map +1 -0
  50. package/dist/voting/election/cancel/0.1/payload.js +331 -0
  51. package/dist/voting/election/cancel/0.1/payload.js.map +1 -0
  52. package/dist/voting/election/close/0.1/payload.d.ts +540 -0
  53. package/dist/voting/election/close/0.1/payload.d.ts.map +1 -0
  54. package/dist/voting/election/close/0.1/payload.js +330 -0
  55. package/dist/voting/election/close/0.1/payload.js.map +1 -0
  56. package/dist/voting/election/register/0.1/payload.d.ts +1920 -0
  57. package/dist/voting/election/register/0.1/payload.d.ts.map +1 -0
  58. package/dist/voting/election/register/0.1/payload.js +1166 -0
  59. package/dist/voting/election/register/0.1/payload.js.map +1 -0
  60. package/dist/voting/election/show/0.1/payload.d.ts +1824 -0
  61. package/dist/voting/election/show/0.1/payload.d.ts.map +1 -0
  62. package/dist/voting/election/show/0.1/payload.js +1112 -0
  63. package/dist/voting/election/show/0.1/payload.js.map +1 -0
  64. package/dist/voting/result/show/0.1/payload.d.ts +849 -0
  65. package/dist/voting/result/show/0.1/payload.d.ts.map +1 -0
  66. package/dist/voting/result/show/0.1/payload.js +498 -0
  67. package/dist/voting/result/show/0.1/payload.js.map +1 -0
  68. package/dist/vta/_shared/0.1/app-state-record.d.ts +1 -1
  69. package/dist/vta/_shared/0.1/app-state-record.d.ts.map +1 -1
  70. package/dist/vta/_shared/0.4/pcs-engine.d.ts +1 -1
  71. package/dist/vta/_shared/0.4/pcs-engine.d.ts.map +1 -1
  72. package/dist/vta/app-state/delete/1.0/payload.d.ts +1 -1
  73. package/dist/vta/app-state/delete/1.0/payload.d.ts.map +1 -1
  74. package/dist/vta/app-state/get/1.0/payload.d.ts +1 -1
  75. package/dist/vta/app-state/get/1.0/payload.d.ts.map +1 -1
  76. package/dist/vta/app-state/get-many/1.0/payload.d.ts +1 -1
  77. package/dist/vta/app-state/get-many/1.0/payload.d.ts.map +1 -1
  78. package/dist/vta/app-state/list/1.0/payload.d.ts +1 -1
  79. package/dist/vta/app-state/list/1.0/payload.d.ts.map +1 -1
  80. package/dist/vta/app-state/put/1.0/payload.d.ts +1 -1
  81. package/dist/vta/app-state/put/1.0/payload.d.ts.map +1 -1
  82. package/dist/vta/app-state/put-many/1.0/payload.d.ts +1 -1
  83. package/dist/vta/app-state/put-many/1.0/payload.d.ts.map +1 -1
  84. package/dist/vta/pcs/applications/create/0.1/payload.d.ts +1 -1
  85. package/dist/vta/pcs/applications/create/0.1/payload.d.ts.map +1 -1
  86. package/dist/vta/pcs/applications/show/0.1/payload.d.ts +1 -1
  87. package/dist/vta/pcs/applications/show/0.1/payload.d.ts.map +1 -1
  88. package/dist/vta/pcs/attest/0.1/payload.d.ts +1 -1
  89. package/dist/vta/pcs/attest/0.1/payload.d.ts.map +1 -1
  90. package/dist/vta/pcs/prove/0.1/payload.d.ts +1 -1
  91. package/dist/vta/pcs/prove/0.1/payload.d.ts.map +1 -1
  92. package/dist/vta/pcs/root-accept/0.1/payload.d.ts +1 -1
  93. package/dist/vta/pcs/root-accept/0.1/payload.d.ts.map +1 -1
  94. package/dist/vta/pcs/tokens/abandon/0.1/payload.d.ts +1 -1
  95. package/dist/vta/pcs/tokens/abandon/0.1/payload.d.ts.map +1 -1
  96. package/dist/vta/pcs/tokens/accept/0.1/payload.d.ts +1 -1
  97. package/dist/vta/pcs/tokens/accept/0.1/payload.d.ts.map +1 -1
  98. package/dist/vta/pcs/verify-attestation/0.1/payload.d.ts +1 -1
  99. package/dist/vta/pcs/verify-attestation/0.1/payload.d.ts.map +1 -1
  100. package/dist/vta/pcs/vetter/show/0.1/payload.d.ts +1 -1
  101. package/dist/vta/pcs/vetter/show/0.1/payload.d.ts.map +1 -1
  102. package/dist/vta/pcs/vote/0.1/payload.d.ts +2208 -0
  103. package/dist/vta/pcs/vote/0.1/payload.d.ts.map +1 -0
  104. package/dist/vta/pcs/vote/0.1/payload.js +1282 -0
  105. package/dist/vta/pcs/vote/0.1/payload.js.map +1 -0
  106. package/dist/vta/pcs/voter/accept/0.1/payload.d.ts +450 -0
  107. package/dist/vta/pcs/voter/accept/0.1/payload.d.ts.map +1 -0
  108. package/dist/vta/pcs/voter/accept/0.1/payload.js +247 -0
  109. package/dist/vta/pcs/voter/accept/0.1/payload.js.map +1 -0
  110. package/dist/vta/pcs/voter/receipt/0.1/payload.d.ts +531 -0
  111. package/dist/vta/pcs/voter/receipt/0.1/payload.d.ts.map +1 -0
  112. package/dist/vta/pcs/voter/receipt/0.1/payload.js +301 -0
  113. package/dist/vta/pcs/voter/receipt/0.1/payload.js.map +1 -0
  114. package/dist/vta/pcs/voter/register/0.1/payload.d.ts +1934 -0
  115. package/dist/vta/pcs/voter/register/0.1/payload.d.ts.map +1 -0
  116. package/dist/vta/pcs/voter/register/0.1/payload.js +1133 -0
  117. package/dist/vta/pcs/voter/register/0.1/payload.js.map +1 -0
  118. package/dist/vtc/directory/card/present/0.1/payload.d.ts +2 -2
  119. package/dist/vtc/directory/card/present/0.1/payload.js +1 -1
  120. package/dist/vtc/directory/card/present/0.1/payload.js.map +1 -1
  121. package/dist/vtc/elections/cancel/0.1/payload.d.ts +301 -0
  122. package/dist/vtc/elections/cancel/0.1/payload.d.ts.map +1 -0
  123. package/dist/vtc/elections/cancel/0.1/payload.js +183 -0
  124. package/dist/vtc/elections/cancel/0.1/payload.js.map +1 -0
  125. package/dist/vtc/elections/certify/0.1/payload.d.ts +914 -0
  126. package/dist/vtc/elections/certify/0.1/payload.d.ts.map +1 -0
  127. package/dist/vtc/elections/certify/0.1/payload.js +512 -0
  128. package/dist/vtc/elections/certify/0.1/payload.js.map +1 -0
  129. package/dist/vtc/elections/close/0.1/payload.d.ts +301 -0
  130. package/dist/vtc/elections/close/0.1/payload.d.ts.map +1 -0
  131. package/dist/vtc/elections/close/0.1/payload.js +182 -0
  132. package/dist/vtc/elections/close/0.1/payload.js.map +1 -0
  133. package/dist/vtc/elections/create/0.1/payload.d.ts +1656 -0
  134. package/dist/vtc/elections/create/0.1/payload.d.ts.map +1 -0
  135. package/dist/vtc/elections/create/0.1/payload.js +994 -0
  136. package/dist/vtc/elections/create/0.1/payload.js.map +1 -0
  137. package/dist/vtc/elections/list/0.1/payload.d.ts +521 -0
  138. package/dist/vtc/elections/list/0.1/payload.d.ts.map +1 -0
  139. package/dist/vtc/elections/list/0.1/payload.js +290 -0
  140. package/dist/vtc/elections/list/0.1/payload.js.map +1 -0
  141. package/dist/vtc/elections/show/0.1/payload.d.ts +2688 -0
  142. package/dist/vtc/elections/show/0.1/payload.d.ts.map +1 -0
  143. package/dist/vtc/elections/show/0.1/payload.js +1581 -0
  144. package/dist/vtc/elections/show/0.1/payload.js.map +1 -0
  145. package/dist/vtc/elections/tickets/issue/0.1/payload.d.ts +597 -0
  146. package/dist/vtc/elections/tickets/issue/0.1/payload.d.ts.map +1 -0
  147. package/dist/vtc/elections/tickets/issue/0.1/payload.js +318 -0
  148. package/dist/vtc/elections/tickets/issue/0.1/payload.js.map +1 -0
  149. package/dist/vtc/groups/create/0.1/payload.d.ts +4 -4
  150. package/dist/vtc/groups/create/0.1/payload.js +2 -2
  151. package/dist/vtc/groups/create/0.1/payload.js.map +1 -1
  152. package/dist/vtc/groups/list/0.1/payload.d.ts +4 -4
  153. package/dist/vtc/groups/list/0.1/payload.js +2 -2
  154. package/dist/vtc/groups/list/0.1/payload.js.map +1 -1
  155. package/dist/vtc/groups/managers/add/0.1/payload.d.ts +337 -0
  156. package/dist/vtc/groups/managers/add/0.1/payload.d.ts.map +1 -0
  157. package/dist/vtc/groups/managers/add/0.1/payload.js +184 -0
  158. package/dist/vtc/groups/managers/add/0.1/payload.js.map +1 -0
  159. package/dist/vtc/groups/managers/remove/0.1/payload.d.ts +337 -0
  160. package/dist/vtc/groups/managers/remove/0.1/payload.d.ts.map +1 -0
  161. package/dist/vtc/groups/managers/remove/0.1/payload.js +184 -0
  162. package/dist/vtc/groups/managers/remove/0.1/payload.js.map +1 -0
  163. package/dist/vtc/groups/show/0.1/payload.d.ts +4 -4
  164. package/dist/vtc/groups/show/0.1/payload.js +2 -2
  165. package/dist/vtc/groups/show/0.1/payload.js.map +1 -1
  166. package/dist/vtc/groups/update/0.1/payload.d.ts +4 -4
  167. package/dist/vtc/groups/update/0.1/payload.js +2 -2
  168. package/dist/vtc/groups/update/0.1/payload.js.map +1 -1
  169. package/package.json +1 -1
  170. package/src/_shared/components.ts +332 -17
  171. package/src/device/list/0.1/payload.ts +4 -2
  172. package/src/device/list/0.2/payload.ts +4 -2
  173. package/src/device/register/0.1/payload.ts +4 -2
  174. package/src/device/register/0.2/payload.ts +4 -2
  175. package/src/index.ts +24 -0
  176. package/src/voting/_shared/0.1/voting.ts +17 -0
  177. package/src/voting/ballot/cast/0.1/payload.ts +560 -0
  178. package/src/voting/board/consistency/0.1/payload.ts +264 -0
  179. package/src/voting/board/head/0.1/payload.ts +257 -0
  180. package/src/voting/board/inclusion/0.1/payload.ts +300 -0
  181. package/src/voting/board/read/0.1/payload.ts +981 -0
  182. package/src/voting/election/cancel/0.1/payload.ts +368 -0
  183. package/src/voting/election/close/0.1/payload.ts +367 -0
  184. package/src/voting/election/register/0.1/payload.ts +1207 -0
  185. package/src/voting/election/show/0.1/payload.ts +1149 -0
  186. package/src/voting/result/show/0.1/payload.ts +536 -0
  187. package/src/vta/_shared/0.1/app-state-record.ts +1 -1
  188. package/src/vta/_shared/0.4/pcs-engine.ts +1 -1
  189. package/src/vta/app-state/delete/1.0/payload.ts +1 -1
  190. package/src/vta/app-state/get/1.0/payload.ts +1 -1
  191. package/src/vta/app-state/get-many/1.0/payload.ts +1 -1
  192. package/src/vta/app-state/list/1.0/payload.ts +1 -1
  193. package/src/vta/app-state/put/1.0/payload.ts +1 -1
  194. package/src/vta/app-state/put-many/1.0/payload.ts +1 -1
  195. package/src/vta/pcs/applications/create/0.1/payload.ts +1 -1
  196. package/src/vta/pcs/applications/show/0.1/payload.ts +1 -1
  197. package/src/vta/pcs/attest/0.1/payload.ts +1 -1
  198. package/src/vta/pcs/prove/0.1/payload.ts +1 -1
  199. package/src/vta/pcs/root-accept/0.1/payload.ts +1 -1
  200. package/src/vta/pcs/tokens/abandon/0.1/payload.ts +1 -1
  201. package/src/vta/pcs/tokens/accept/0.1/payload.ts +1 -1
  202. package/src/vta/pcs/verify-attestation/0.1/payload.ts +1 -1
  203. package/src/vta/pcs/vetter/show/0.1/payload.ts +1 -1
  204. package/src/vta/pcs/vote/0.1/payload.ts +1365 -0
  205. package/src/vta/pcs/voter/accept/0.1/payload.ts +306 -0
  206. package/src/vta/pcs/voter/receipt/0.1/payload.ts +367 -0
  207. package/src/vta/pcs/voter/register/0.1/payload.ts +1211 -0
  208. package/src/vtc/directory/card/present/0.1/payload.ts +1 -1
  209. package/src/vtc/elections/cancel/0.1/payload.ts +223 -0
  210. package/src/vtc/elections/certify/0.1/payload.ts +565 -0
  211. package/src/vtc/elections/close/0.1/payload.ts +222 -0
  212. package/src/vtc/elections/create/0.1/payload.ts +1041 -0
  213. package/src/vtc/elections/list/0.1/payload.ts +371 -0
  214. package/src/vtc/elections/show/0.1/payload.ts +1671 -0
  215. package/src/vtc/elections/tickets/issue/0.1/payload.ts +394 -0
  216. package/src/vtc/groups/create/0.1/payload.ts +2 -2
  217. package/src/vtc/groups/list/0.1/payload.ts +2 -2
  218. package/src/vtc/groups/managers/add/0.1/payload.ts +230 -0
  219. package/src/vtc/groups/managers/remove/0.1/payload.ts +230 -0
  220. package/src/vtc/groups/show/0.1/payload.ts +2 -2
  221. package/src/vtc/groups/update/0.1/payload.ts +2 -2
@@ -0,0 +1,264 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/voting/board/consistency/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { DigestMultibase, ElectionId, Ext, MerklePath } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * Asks for an RFC 9162 consistency proof that the board of one size is a prefix of the board of a larger size.
11
+ */
12
+ export interface VotingBoardConsistencyPayload {
13
+ /**
14
+ * The community's DID.
15
+ */
16
+ community: string;
17
+ electionId: ElectionId;
18
+ /**
19
+ * The size of the earlier head.
20
+ */
21
+ firstSize: number;
22
+ /**
23
+ * The size of the later head. At least `firstSize`, at most the current size.
24
+ */
25
+ secondSize: number;
26
+ ext?: Ext;
27
+ }
28
+ export interface VotingBoardConsistencyResponsePayload {
29
+ firstSize: number;
30
+ secondSize: number;
31
+ /**
32
+ * The RFC 9162 §2.1.4 consistency proof between the trees of `firstSize` and `secondSize` entries. Empty when the two sizes are equal.
33
+ */
34
+ path: MerklePath;
35
+ ext?: Ext;
36
+ }
37
+
38
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
39
+ export type { DigestMultibase, ElectionId, Ext, MerklePath };
40
+
41
+ /** Trust Task type URI. */
42
+ export const TYPE_URI = "https://trusttasks.org/spec/voting/board/consistency/0.1" as const;
43
+
44
+ /** Stable alias for this specification's request payload shape. */
45
+ export type Payload = VotingBoardConsistencyPayload;
46
+
47
+ /** Trust Task response type URI (request type URI + "#response"). */
48
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/voting/board/consistency/0.1#response" as const;
49
+
50
+ /** Stable alias for this specification's success-response payload shape. */
51
+ export type Response = VotingBoardConsistencyResponsePayload;
52
+
53
+ /**
54
+ * This specification's payload schema, as a value.
55
+ *
56
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
57
+ * rather than only as a `.json` file because TypeScript types are erased
58
+ * at runtime: without a schema a consumer has nothing to validate, and
59
+ * every REQUIRED payload member is optional in practice. Cross-file
60
+ * `$ref`s are already inlined, so it needs no resolver.
61
+ */
62
+ export const PAYLOAD_SCHEMA = {
63
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
64
+ "$id": "https://trusttasks.org/spec/voting/board/consistency/0.1",
65
+ "title": "Voting — Board Consistency — payload",
66
+ "description": "Asks for an RFC 9162 consistency proof that the board of one size is a prefix of the board of a larger size.",
67
+ "type": "object",
68
+ "additionalProperties": false,
69
+ "required": [
70
+ "community",
71
+ "electionId",
72
+ "firstSize",
73
+ "secondSize"
74
+ ],
75
+ "properties": {
76
+ "community": {
77
+ "type": "string",
78
+ "minLength": 1,
79
+ "maxLength": 2048,
80
+ "description": "The community's DID."
81
+ },
82
+ "electionId": {
83
+ "$ref": "#/$defs/ElectionId"
84
+ },
85
+ "firstSize": {
86
+ "type": "integer",
87
+ "minimum": 1,
88
+ "description": "The size of the earlier head."
89
+ },
90
+ "secondSize": {
91
+ "type": "integer",
92
+ "minimum": 1,
93
+ "description": "The size of the later head. At least `firstSize`, at most the current size."
94
+ },
95
+ "ext": {
96
+ "$ref": "#/$defs/Ext"
97
+ }
98
+ },
99
+ "$defs": {
100
+ "Response": {
101
+ "$anchor": "response",
102
+ "title": "Voting — Board Consistency — response payload",
103
+ "type": "object",
104
+ "additionalProperties": false,
105
+ "required": [
106
+ "firstSize",
107
+ "secondSize",
108
+ "path"
109
+ ],
110
+ "properties": {
111
+ "firstSize": {
112
+ "type": "integer",
113
+ "minimum": 1
114
+ },
115
+ "secondSize": {
116
+ "type": "integer",
117
+ "minimum": 1
118
+ },
119
+ "path": {
120
+ "$ref": "#/$defs/MerklePath",
121
+ "description": "The RFC 9162 §2.1.4 consistency proof between the trees of `firstSize` and `secondSize` entries. Empty when the two sizes are equal."
122
+ },
123
+ "ext": {
124
+ "$ref": "#/$defs/Ext"
125
+ }
126
+ }
127
+ },
128
+ "Ext": {
129
+ "title": "Ext",
130
+ "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.",
131
+ "type": "object",
132
+ "minProperties": 1,
133
+ "additionalProperties": true,
134
+ "propertyNames": {
135
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
136
+ }
137
+ },
138
+ "MerklePath": {
139
+ "title": "MerklePath",
140
+ "description": "An RFC 9162 audit or consistency path: the node hashes, in the order §2.1.3 / §2.1.4 define.",
141
+ "type": "array",
142
+ "maxItems": 64,
143
+ "items": {
144
+ "$ref": "#/$defs/DigestMultibase"
145
+ }
146
+ },
147
+ "DigestMultibase": {
148
+ "title": "DigestMultibase",
149
+ "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`.",
150
+ "type": "string",
151
+ "minLength": 16,
152
+ "pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
153
+ "examples": [
154
+ "zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
155
+ ]
156
+ },
157
+ "ElectionId": {
158
+ "title": "ElectionId",
159
+ "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.",
160
+ "type": "string",
161
+ "pattern": "^[A-Za-z0-9._-]{1,128}$"
162
+ }
163
+ }
164
+ } as const;
165
+
166
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
167
+ export const RESPONSE_PAYLOAD_SCHEMA = {
168
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
169
+ "$ref": "#/$defs/Response",
170
+ "$defs": {
171
+ "Response": {
172
+ "$anchor": "response",
173
+ "title": "Voting — Board Consistency — response payload",
174
+ "type": "object",
175
+ "additionalProperties": false,
176
+ "required": [
177
+ "firstSize",
178
+ "secondSize",
179
+ "path"
180
+ ],
181
+ "properties": {
182
+ "firstSize": {
183
+ "type": "integer",
184
+ "minimum": 1
185
+ },
186
+ "secondSize": {
187
+ "type": "integer",
188
+ "minimum": 1
189
+ },
190
+ "path": {
191
+ "$ref": "#/$defs/MerklePath",
192
+ "description": "The RFC 9162 §2.1.4 consistency proof between the trees of `firstSize` and `secondSize` entries. Empty when the two sizes are equal."
193
+ },
194
+ "ext": {
195
+ "$ref": "#/$defs/Ext"
196
+ }
197
+ }
198
+ },
199
+ "Ext": {
200
+ "title": "Ext",
201
+ "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.",
202
+ "type": "object",
203
+ "minProperties": 1,
204
+ "additionalProperties": true,
205
+ "propertyNames": {
206
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
207
+ }
208
+ },
209
+ "MerklePath": {
210
+ "title": "MerklePath",
211
+ "description": "An RFC 9162 audit or consistency path: the node hashes, in the order §2.1.3 / §2.1.4 define.",
212
+ "type": "array",
213
+ "maxItems": 64,
214
+ "items": {
215
+ "$ref": "#/$defs/DigestMultibase"
216
+ }
217
+ },
218
+ "DigestMultibase": {
219
+ "title": "DigestMultibase",
220
+ "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`.",
221
+ "type": "string",
222
+ "minLength": 16,
223
+ "pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
224
+ "examples": [
225
+ "zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
226
+ ]
227
+ },
228
+ "ElectionId": {
229
+ "title": "ElectionId",
230
+ "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.",
231
+ "type": "string",
232
+ "pattern": "^[A-Za-z0-9._-]{1,128}$"
233
+ }
234
+ }
235
+ } as const;
236
+
237
+ /**
238
+ * SPEC.md §7.2 policy for the request variant, from this specification's
239
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
240
+ * per-specification and cannot be derived from the document alone, and
241
+ * item 2 needs the schema this carries.
242
+ */
243
+ export const SPEC = {
244
+ typeUri: TYPE_URI,
245
+ isBearer: false,
246
+ isProofRequired: false,
247
+ isRecipientRequired: true,
248
+ isIssuedAtRequired: false,
249
+ payloadSchema: PAYLOAD_SCHEMA,
250
+ } as const;
251
+
252
+ /**
253
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
254
+ * tracks the *issuer* party's requirement because a response swaps the
255
+ * parties (§7.3 item 5).
256
+ */
257
+ export const RESPONSE_SPEC = {
258
+ typeUri: RESPONSE_TYPE_URI,
259
+ isBearer: false,
260
+ isProofRequired: false,
261
+ isRecipientRequired: false,
262
+ isIssuedAtRequired: false,
263
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
264
+ } as const;
@@ -0,0 +1,257 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/voting/board/head/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { BoardHead, DigestMultibase, ElectionId, Ext } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * Reads an election board's current tree head. The response document's proof is the head's signature.
11
+ */
12
+ export interface VotingBoardHeadPayload {
13
+ /**
14
+ * The community's DID.
15
+ */
16
+ community: string;
17
+ electionId: ElectionId;
18
+ ext?: Ext;
19
+ }
20
+ export interface VotingBoardHeadResponsePayload {
21
+ head: BoardHead;
22
+ ext?: Ext;
23
+ }
24
+
25
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
26
+ export type { BoardHead, DigestMultibase, ElectionId, Ext };
27
+
28
+ /** Trust Task type URI. */
29
+ export const TYPE_URI = "https://trusttasks.org/spec/voting/board/head/0.1" as const;
30
+
31
+ /** Stable alias for this specification's request payload shape. */
32
+ export type Payload = VotingBoardHeadPayload;
33
+
34
+ /** Trust Task response type URI (request type URI + "#response"). */
35
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/voting/board/head/0.1#response" as const;
36
+
37
+ /** Stable alias for this specification's success-response payload shape. */
38
+ export type Response = VotingBoardHeadResponsePayload;
39
+
40
+ /**
41
+ * This specification's payload schema, as a value.
42
+ *
43
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
44
+ * rather than only as a `.json` file because TypeScript types are erased
45
+ * at runtime: without a schema a consumer has nothing to validate, and
46
+ * every REQUIRED payload member is optional in practice. Cross-file
47
+ * `$ref`s are already inlined, so it needs no resolver.
48
+ */
49
+ export const PAYLOAD_SCHEMA = {
50
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
51
+ "$id": "https://trusttasks.org/spec/voting/board/head/0.1",
52
+ "title": "Voting — Board Head — payload",
53
+ "description": "Reads an election board's current tree head. The response document's proof is the head's signature.",
54
+ "type": "object",
55
+ "additionalProperties": false,
56
+ "required": [
57
+ "community",
58
+ "electionId"
59
+ ],
60
+ "properties": {
61
+ "community": {
62
+ "type": "string",
63
+ "minLength": 1,
64
+ "maxLength": 2048,
65
+ "description": "The community's DID."
66
+ },
67
+ "electionId": {
68
+ "$ref": "#/$defs/ElectionId"
69
+ },
70
+ "ext": {
71
+ "$ref": "#/$defs/Ext"
72
+ }
73
+ },
74
+ "$defs": {
75
+ "Response": {
76
+ "$anchor": "response",
77
+ "title": "Voting — Board Head — response payload",
78
+ "type": "object",
79
+ "additionalProperties": false,
80
+ "required": [
81
+ "head"
82
+ ],
83
+ "properties": {
84
+ "head": {
85
+ "$ref": "#/$defs/BoardHead"
86
+ },
87
+ "ext": {
88
+ "$ref": "#/$defs/Ext"
89
+ }
90
+ }
91
+ },
92
+ "Ext": {
93
+ "title": "Ext",
94
+ "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.",
95
+ "type": "object",
96
+ "minProperties": 1,
97
+ "additionalProperties": true,
98
+ "propertyNames": {
99
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
100
+ }
101
+ },
102
+ "BoardHead": {
103
+ "title": "BoardHead",
104
+ "description": "A board's tree head (RFC 9162 §2.1). A head is signed by being carried in a document the ballot box signs; whoever keeps a head keeps that whole document.",
105
+ "type": "object",
106
+ "additionalProperties": false,
107
+ "required": [
108
+ "electionId",
109
+ "treeSize",
110
+ "rootHash",
111
+ "issuedAt"
112
+ ],
113
+ "properties": {
114
+ "electionId": {
115
+ "$ref": "#/$defs/ElectionId"
116
+ },
117
+ "treeSize": {
118
+ "type": "integer",
119
+ "minimum": 0
120
+ },
121
+ "rootHash": {
122
+ "$ref": "#/$defs/DigestMultibase",
123
+ "description": "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash."
124
+ },
125
+ "issuedAt": {
126
+ "type": "string",
127
+ "format": "date-time"
128
+ }
129
+ }
130
+ },
131
+ "ElectionId": {
132
+ "title": "ElectionId",
133
+ "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.",
134
+ "type": "string",
135
+ "pattern": "^[A-Za-z0-9._-]{1,128}$"
136
+ },
137
+ "DigestMultibase": {
138
+ "title": "DigestMultibase",
139
+ "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`.",
140
+ "type": "string",
141
+ "minLength": 16,
142
+ "pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
143
+ "examples": [
144
+ "zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
145
+ ]
146
+ }
147
+ }
148
+ } as const;
149
+
150
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
151
+ export const RESPONSE_PAYLOAD_SCHEMA = {
152
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
153
+ "$ref": "#/$defs/Response",
154
+ "$defs": {
155
+ "Response": {
156
+ "$anchor": "response",
157
+ "title": "Voting — Board Head — response payload",
158
+ "type": "object",
159
+ "additionalProperties": false,
160
+ "required": [
161
+ "head"
162
+ ],
163
+ "properties": {
164
+ "head": {
165
+ "$ref": "#/$defs/BoardHead"
166
+ },
167
+ "ext": {
168
+ "$ref": "#/$defs/Ext"
169
+ }
170
+ }
171
+ },
172
+ "Ext": {
173
+ "title": "Ext",
174
+ "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.",
175
+ "type": "object",
176
+ "minProperties": 1,
177
+ "additionalProperties": true,
178
+ "propertyNames": {
179
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
180
+ }
181
+ },
182
+ "BoardHead": {
183
+ "title": "BoardHead",
184
+ "description": "A board's tree head (RFC 9162 §2.1). A head is signed by being carried in a document the ballot box signs; whoever keeps a head keeps that whole document.",
185
+ "type": "object",
186
+ "additionalProperties": false,
187
+ "required": [
188
+ "electionId",
189
+ "treeSize",
190
+ "rootHash",
191
+ "issuedAt"
192
+ ],
193
+ "properties": {
194
+ "electionId": {
195
+ "$ref": "#/$defs/ElectionId"
196
+ },
197
+ "treeSize": {
198
+ "type": "integer",
199
+ "minimum": 0
200
+ },
201
+ "rootHash": {
202
+ "$ref": "#/$defs/DigestMultibase",
203
+ "description": "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash."
204
+ },
205
+ "issuedAt": {
206
+ "type": "string",
207
+ "format": "date-time"
208
+ }
209
+ }
210
+ },
211
+ "ElectionId": {
212
+ "title": "ElectionId",
213
+ "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.",
214
+ "type": "string",
215
+ "pattern": "^[A-Za-z0-9._-]{1,128}$"
216
+ },
217
+ "DigestMultibase": {
218
+ "title": "DigestMultibase",
219
+ "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`.",
220
+ "type": "string",
221
+ "minLength": 16,
222
+ "pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
223
+ "examples": [
224
+ "zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
225
+ ]
226
+ }
227
+ }
228
+ } as const;
229
+
230
+ /**
231
+ * SPEC.md §7.2 policy for the request variant, from this specification's
232
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
233
+ * per-specification and cannot be derived from the document alone, and
234
+ * item 2 needs the schema this carries.
235
+ */
236
+ export const SPEC = {
237
+ typeUri: TYPE_URI,
238
+ isBearer: false,
239
+ isProofRequired: false,
240
+ isRecipientRequired: true,
241
+ isIssuedAtRequired: false,
242
+ payloadSchema: PAYLOAD_SCHEMA,
243
+ } as const;
244
+
245
+ /**
246
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
247
+ * tracks the *issuer* party's requirement because a response swaps the
248
+ * parties (§7.3 item 5).
249
+ */
250
+ export const RESPONSE_SPEC = {
251
+ typeUri: RESPONSE_TYPE_URI,
252
+ isBearer: false,
253
+ isProofRequired: true,
254
+ isRecipientRequired: false,
255
+ isIssuedAtRequired: false,
256
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
257
+ } as const;