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