@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.
- package/CHANGELOG.md +84 -0
- package/dist/_shared/components.d.ts +328 -17
- package/dist/_shared/components.d.ts.map +1 -1
- package/dist/device/list/0.1/payload.d.ts +4 -4
- package/dist/device/list/0.1/payload.d.ts.map +1 -1
- package/dist/device/list/0.1/payload.js +4 -2
- package/dist/device/list/0.1/payload.js.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.1/payload.d.ts +4 -4
- package/dist/device/register/0.1/payload.d.ts.map +1 -1
- package/dist/device/register/0.1/payload.js +4 -2
- package/dist/device/register/0.1/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 +332 -17
- package/src/device/list/0.1/payload.ts +4 -2
- package/src/device/list/0.2/payload.ts +4 -2
- package/src/device/register/0.1/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,565 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vtc/elections/certify/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { BoardHead, DigestMultibase, ElectionId, ElectionResult, Ext, Key_VotingV0_1 as Key, QuestionResult } from "../../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* An administrator has the community verify a tallied election's board for itself and certify its result. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.
|
|
11
|
+
*/
|
|
12
|
+
export interface VTCElectionsCertifyPayload {
|
|
13
|
+
electionId: ElectionId;
|
|
14
|
+
/**
|
|
15
|
+
* Attestations from auditors the manifest names in `board.auditors`, to be certified with the result.
|
|
16
|
+
*
|
|
17
|
+
* @maxItems 32
|
|
18
|
+
*/
|
|
19
|
+
auditAttestations?: {}[];
|
|
20
|
+
ext?: Ext;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Success response to vtc/elections/certify/0.1: the result the community verified and certified.
|
|
24
|
+
*/
|
|
25
|
+
export interface VTCElectionsCertifyResponsePayload {
|
|
26
|
+
electionId: ElectionId;
|
|
27
|
+
/**
|
|
28
|
+
* The result the community recomputed from the board, equal to the ballot box's.
|
|
29
|
+
*/
|
|
30
|
+
result: ElectionResult;
|
|
31
|
+
/**
|
|
32
|
+
* The board head the community verified: the head as it stood at close, which the result counts exactly.
|
|
33
|
+
*/
|
|
34
|
+
head: BoardHead;
|
|
35
|
+
certifiedAt: string;
|
|
36
|
+
/**
|
|
37
|
+
* The attestations certified with the result; empty when none was given.
|
|
38
|
+
*
|
|
39
|
+
* @maxItems 32
|
|
40
|
+
*/
|
|
41
|
+
auditAttestations: {}[];
|
|
42
|
+
ext?: Ext;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
46
|
+
export type { BoardHead, DigestMultibase, ElectionId, ElectionResult, Ext, Key, QuestionResult };
|
|
47
|
+
|
|
48
|
+
/** Trust Task type URI. */
|
|
49
|
+
export const TYPE_URI = "https://trusttasks.org/spec/vtc/elections/certify/0.1" as const;
|
|
50
|
+
|
|
51
|
+
/** Stable alias for this specification's request payload shape. */
|
|
52
|
+
export type Payload = VTCElectionsCertifyPayload;
|
|
53
|
+
|
|
54
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
55
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/elections/certify/0.1#response" as const;
|
|
56
|
+
|
|
57
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
58
|
+
export type Response = VTCElectionsCertifyResponsePayload;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* This specification's payload schema, as a value.
|
|
62
|
+
*
|
|
63
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
64
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
65
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
66
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
67
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
68
|
+
*/
|
|
69
|
+
export const PAYLOAD_SCHEMA = {
|
|
70
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
71
|
+
"$id": "https://trusttasks.org/spec/vtc/elections/certify/0.1",
|
|
72
|
+
"title": "VTC Elections — Certify — payload",
|
|
73
|
+
"description": "An administrator has the community verify a tallied election's board for itself and certify its result. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.",
|
|
74
|
+
"type": "object",
|
|
75
|
+
"additionalProperties": false,
|
|
76
|
+
"required": [
|
|
77
|
+
"electionId"
|
|
78
|
+
],
|
|
79
|
+
"properties": {
|
|
80
|
+
"electionId": {
|
|
81
|
+
"$ref": "#/$defs/ElectionId"
|
|
82
|
+
},
|
|
83
|
+
"auditAttestations": {
|
|
84
|
+
"type": "array",
|
|
85
|
+
"maxItems": 32,
|
|
86
|
+
"items": {
|
|
87
|
+
"type": "object",
|
|
88
|
+
"description": "A verifiable credential, as its auditor issued it, attesting the auditor's own recount of this election's board (VTI-VOT-073). Kept exactly as received."
|
|
89
|
+
},
|
|
90
|
+
"description": "Attestations from auditors the manifest names in `board.auditors`, to be certified with the result."
|
|
91
|
+
},
|
|
92
|
+
"ext": {
|
|
93
|
+
"$ref": "#/$defs/Ext"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"$defs": {
|
|
97
|
+
"Response": {
|
|
98
|
+
"$anchor": "response",
|
|
99
|
+
"title": "VTC Elections — Certify — response payload",
|
|
100
|
+
"description": "Success response to vtc/elections/certify/0.1: the result the community verified and certified.",
|
|
101
|
+
"type": "object",
|
|
102
|
+
"additionalProperties": false,
|
|
103
|
+
"required": [
|
|
104
|
+
"electionId",
|
|
105
|
+
"result",
|
|
106
|
+
"head",
|
|
107
|
+
"certifiedAt",
|
|
108
|
+
"auditAttestations"
|
|
109
|
+
],
|
|
110
|
+
"properties": {
|
|
111
|
+
"electionId": {
|
|
112
|
+
"$ref": "#/$defs/ElectionId"
|
|
113
|
+
},
|
|
114
|
+
"result": {
|
|
115
|
+
"$ref": "#/$defs/ElectionResult",
|
|
116
|
+
"description": "The result the community recomputed from the board, equal to the ballot box's."
|
|
117
|
+
},
|
|
118
|
+
"head": {
|
|
119
|
+
"$ref": "#/$defs/BoardHead",
|
|
120
|
+
"description": "The board head the community verified: the head as it stood at close, which the result counts exactly."
|
|
121
|
+
},
|
|
122
|
+
"certifiedAt": {
|
|
123
|
+
"type": "string",
|
|
124
|
+
"format": "date-time",
|
|
125
|
+
"maxLength": 64
|
|
126
|
+
},
|
|
127
|
+
"auditAttestations": {
|
|
128
|
+
"type": "array",
|
|
129
|
+
"maxItems": 32,
|
|
130
|
+
"items": {
|
|
131
|
+
"type": "object",
|
|
132
|
+
"description": "An auditor's attestation the community verified, as received."
|
|
133
|
+
},
|
|
134
|
+
"description": "The attestations certified with the result; empty when none was given."
|
|
135
|
+
},
|
|
136
|
+
"ext": {
|
|
137
|
+
"$ref": "#/$defs/Ext"
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"Ext": {
|
|
142
|
+
"title": "Ext",
|
|
143
|
+
"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.",
|
|
144
|
+
"type": "object",
|
|
145
|
+
"minProperties": 1,
|
|
146
|
+
"additionalProperties": true,
|
|
147
|
+
"propertyNames": {
|
|
148
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
"BoardHead": {
|
|
152
|
+
"title": "BoardHead",
|
|
153
|
+
"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.",
|
|
154
|
+
"type": "object",
|
|
155
|
+
"additionalProperties": false,
|
|
156
|
+
"required": [
|
|
157
|
+
"electionId",
|
|
158
|
+
"treeSize",
|
|
159
|
+
"rootHash",
|
|
160
|
+
"issuedAt"
|
|
161
|
+
],
|
|
162
|
+
"properties": {
|
|
163
|
+
"electionId": {
|
|
164
|
+
"$ref": "#/$defs/ElectionId"
|
|
165
|
+
},
|
|
166
|
+
"treeSize": {
|
|
167
|
+
"type": "integer",
|
|
168
|
+
"minimum": 0
|
|
169
|
+
},
|
|
170
|
+
"rootHash": {
|
|
171
|
+
"$ref": "#/$defs/DigestMultibase",
|
|
172
|
+
"description": "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash."
|
|
173
|
+
},
|
|
174
|
+
"issuedAt": {
|
|
175
|
+
"type": "string",
|
|
176
|
+
"format": "date-time"
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
"ElectionId": {
|
|
181
|
+
"title": "ElectionId",
|
|
182
|
+
"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.",
|
|
183
|
+
"type": "string",
|
|
184
|
+
"pattern": "^[A-Za-z0-9._-]{1,128}$"
|
|
185
|
+
},
|
|
186
|
+
"DigestMultibase": {
|
|
187
|
+
"title": "DigestMultibase",
|
|
188
|
+
"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`.",
|
|
189
|
+
"type": "string",
|
|
190
|
+
"minLength": 16,
|
|
191
|
+
"pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
|
|
192
|
+
"examples": [
|
|
193
|
+
"zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
|
|
194
|
+
]
|
|
195
|
+
},
|
|
196
|
+
"ElectionResult": {
|
|
197
|
+
"title": "ElectionResult",
|
|
198
|
+
"description": "An election's result, computable by anyone who can read its board from the board and the registration alone (VTI-VOT-070).",
|
|
199
|
+
"type": "object",
|
|
200
|
+
"additionalProperties": false,
|
|
201
|
+
"required": [
|
|
202
|
+
"electionId",
|
|
203
|
+
"manifestDigest",
|
|
204
|
+
"ballotsCounted",
|
|
205
|
+
"questions",
|
|
206
|
+
"head"
|
|
207
|
+
],
|
|
208
|
+
"properties": {
|
|
209
|
+
"electionId": {
|
|
210
|
+
"$ref": "#/$defs/ElectionId"
|
|
211
|
+
},
|
|
212
|
+
"manifestDigest": {
|
|
213
|
+
"$ref": "#/$defs/DigestMultibase"
|
|
214
|
+
},
|
|
215
|
+
"ballotsCounted": {
|
|
216
|
+
"type": "integer",
|
|
217
|
+
"minimum": 0
|
|
218
|
+
},
|
|
219
|
+
"questions": {
|
|
220
|
+
"type": "array",
|
|
221
|
+
"items": {
|
|
222
|
+
"$ref": "#/$defs/QuestionResult"
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
"head": {
|
|
226
|
+
"$ref": "#/$defs/BoardHead",
|
|
227
|
+
"description": "The head of the board as it stood at close: the result counts exactly its entries."
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
"QuestionResult": {
|
|
232
|
+
"title": "QuestionResult",
|
|
233
|
+
"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.",
|
|
234
|
+
"type": "object",
|
|
235
|
+
"additionalProperties": false,
|
|
236
|
+
"required": [
|
|
237
|
+
"question",
|
|
238
|
+
"abstained"
|
|
239
|
+
],
|
|
240
|
+
"properties": {
|
|
241
|
+
"question": {
|
|
242
|
+
"$ref": "#/$defs/Key"
|
|
243
|
+
},
|
|
244
|
+
"abstained": {
|
|
245
|
+
"type": "integer",
|
|
246
|
+
"minimum": 0
|
|
247
|
+
},
|
|
248
|
+
"choice": {
|
|
249
|
+
"type": "object",
|
|
250
|
+
"propertyNames": {
|
|
251
|
+
"$ref": "#/$defs/Key"
|
|
252
|
+
},
|
|
253
|
+
"additionalProperties": {
|
|
254
|
+
"type": "integer",
|
|
255
|
+
"minimum": 0
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
"ranking": {
|
|
259
|
+
"type": "object",
|
|
260
|
+
"propertyNames": {
|
|
261
|
+
"$ref": "#/$defs/Key"
|
|
262
|
+
},
|
|
263
|
+
"additionalProperties": {
|
|
264
|
+
"type": "array",
|
|
265
|
+
"items": {
|
|
266
|
+
"type": "integer",
|
|
267
|
+
"minimum": 0
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
"score": {
|
|
272
|
+
"type": "object",
|
|
273
|
+
"propertyNames": {
|
|
274
|
+
"$ref": "#/$defs/Key"
|
|
275
|
+
},
|
|
276
|
+
"additionalProperties": {
|
|
277
|
+
"type": "object",
|
|
278
|
+
"additionalProperties": false,
|
|
279
|
+
"required": [
|
|
280
|
+
"sum",
|
|
281
|
+
"count"
|
|
282
|
+
],
|
|
283
|
+
"properties": {
|
|
284
|
+
"sum": {
|
|
285
|
+
"type": "integer"
|
|
286
|
+
},
|
|
287
|
+
"count": {
|
|
288
|
+
"type": "integer",
|
|
289
|
+
"minimum": 0
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
"text": {
|
|
295
|
+
"type": "array",
|
|
296
|
+
"items": {
|
|
297
|
+
"type": "string",
|
|
298
|
+
"maxLength": 4096
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
"withheld": {
|
|
302
|
+
"type": "boolean"
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
"Key": {
|
|
307
|
+
"title": "Key",
|
|
308
|
+
"description": "A question or option key, unique within its manifest or question.",
|
|
309
|
+
"type": "string",
|
|
310
|
+
"pattern": "^[A-Za-z0-9._-]{1,64}$"
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
} as const;
|
|
314
|
+
|
|
315
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
316
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
317
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
318
|
+
"$ref": "#/$defs/Response",
|
|
319
|
+
"$defs": {
|
|
320
|
+
"Response": {
|
|
321
|
+
"$anchor": "response",
|
|
322
|
+
"title": "VTC Elections — Certify — response payload",
|
|
323
|
+
"description": "Success response to vtc/elections/certify/0.1: the result the community verified and certified.",
|
|
324
|
+
"type": "object",
|
|
325
|
+
"additionalProperties": false,
|
|
326
|
+
"required": [
|
|
327
|
+
"electionId",
|
|
328
|
+
"result",
|
|
329
|
+
"head",
|
|
330
|
+
"certifiedAt",
|
|
331
|
+
"auditAttestations"
|
|
332
|
+
],
|
|
333
|
+
"properties": {
|
|
334
|
+
"electionId": {
|
|
335
|
+
"$ref": "#/$defs/ElectionId"
|
|
336
|
+
},
|
|
337
|
+
"result": {
|
|
338
|
+
"$ref": "#/$defs/ElectionResult",
|
|
339
|
+
"description": "The result the community recomputed from the board, equal to the ballot box's."
|
|
340
|
+
},
|
|
341
|
+
"head": {
|
|
342
|
+
"$ref": "#/$defs/BoardHead",
|
|
343
|
+
"description": "The board head the community verified: the head as it stood at close, which the result counts exactly."
|
|
344
|
+
},
|
|
345
|
+
"certifiedAt": {
|
|
346
|
+
"type": "string",
|
|
347
|
+
"format": "date-time",
|
|
348
|
+
"maxLength": 64
|
|
349
|
+
},
|
|
350
|
+
"auditAttestations": {
|
|
351
|
+
"type": "array",
|
|
352
|
+
"maxItems": 32,
|
|
353
|
+
"items": {
|
|
354
|
+
"type": "object",
|
|
355
|
+
"description": "An auditor's attestation the community verified, as received."
|
|
356
|
+
},
|
|
357
|
+
"description": "The attestations certified with the result; empty when none was given."
|
|
358
|
+
},
|
|
359
|
+
"ext": {
|
|
360
|
+
"$ref": "#/$defs/Ext"
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
"Ext": {
|
|
365
|
+
"title": "Ext",
|
|
366
|
+
"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.",
|
|
367
|
+
"type": "object",
|
|
368
|
+
"minProperties": 1,
|
|
369
|
+
"additionalProperties": true,
|
|
370
|
+
"propertyNames": {
|
|
371
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
372
|
+
}
|
|
373
|
+
},
|
|
374
|
+
"BoardHead": {
|
|
375
|
+
"title": "BoardHead",
|
|
376
|
+
"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.",
|
|
377
|
+
"type": "object",
|
|
378
|
+
"additionalProperties": false,
|
|
379
|
+
"required": [
|
|
380
|
+
"electionId",
|
|
381
|
+
"treeSize",
|
|
382
|
+
"rootHash",
|
|
383
|
+
"issuedAt"
|
|
384
|
+
],
|
|
385
|
+
"properties": {
|
|
386
|
+
"electionId": {
|
|
387
|
+
"$ref": "#/$defs/ElectionId"
|
|
388
|
+
},
|
|
389
|
+
"treeSize": {
|
|
390
|
+
"type": "integer",
|
|
391
|
+
"minimum": 0
|
|
392
|
+
},
|
|
393
|
+
"rootHash": {
|
|
394
|
+
"$ref": "#/$defs/DigestMultibase",
|
|
395
|
+
"description": "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash."
|
|
396
|
+
},
|
|
397
|
+
"issuedAt": {
|
|
398
|
+
"type": "string",
|
|
399
|
+
"format": "date-time"
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
},
|
|
403
|
+
"ElectionId": {
|
|
404
|
+
"title": "ElectionId",
|
|
405
|
+
"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.",
|
|
406
|
+
"type": "string",
|
|
407
|
+
"pattern": "^[A-Za-z0-9._-]{1,128}$"
|
|
408
|
+
},
|
|
409
|
+
"DigestMultibase": {
|
|
410
|
+
"title": "DigestMultibase",
|
|
411
|
+
"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`.",
|
|
412
|
+
"type": "string",
|
|
413
|
+
"minLength": 16,
|
|
414
|
+
"pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
|
|
415
|
+
"examples": [
|
|
416
|
+
"zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
|
|
417
|
+
]
|
|
418
|
+
},
|
|
419
|
+
"ElectionResult": {
|
|
420
|
+
"title": "ElectionResult",
|
|
421
|
+
"description": "An election's result, computable by anyone who can read its board from the board and the registration alone (VTI-VOT-070).",
|
|
422
|
+
"type": "object",
|
|
423
|
+
"additionalProperties": false,
|
|
424
|
+
"required": [
|
|
425
|
+
"electionId",
|
|
426
|
+
"manifestDigest",
|
|
427
|
+
"ballotsCounted",
|
|
428
|
+
"questions",
|
|
429
|
+
"head"
|
|
430
|
+
],
|
|
431
|
+
"properties": {
|
|
432
|
+
"electionId": {
|
|
433
|
+
"$ref": "#/$defs/ElectionId"
|
|
434
|
+
},
|
|
435
|
+
"manifestDigest": {
|
|
436
|
+
"$ref": "#/$defs/DigestMultibase"
|
|
437
|
+
},
|
|
438
|
+
"ballotsCounted": {
|
|
439
|
+
"type": "integer",
|
|
440
|
+
"minimum": 0
|
|
441
|
+
},
|
|
442
|
+
"questions": {
|
|
443
|
+
"type": "array",
|
|
444
|
+
"items": {
|
|
445
|
+
"$ref": "#/$defs/QuestionResult"
|
|
446
|
+
}
|
|
447
|
+
},
|
|
448
|
+
"head": {
|
|
449
|
+
"$ref": "#/$defs/BoardHead",
|
|
450
|
+
"description": "The head of the board as it stood at close: the result counts exactly its entries."
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
},
|
|
454
|
+
"QuestionResult": {
|
|
455
|
+
"title": "QuestionResult",
|
|
456
|
+
"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.",
|
|
457
|
+
"type": "object",
|
|
458
|
+
"additionalProperties": false,
|
|
459
|
+
"required": [
|
|
460
|
+
"question",
|
|
461
|
+
"abstained"
|
|
462
|
+
],
|
|
463
|
+
"properties": {
|
|
464
|
+
"question": {
|
|
465
|
+
"$ref": "#/$defs/Key"
|
|
466
|
+
},
|
|
467
|
+
"abstained": {
|
|
468
|
+
"type": "integer",
|
|
469
|
+
"minimum": 0
|
|
470
|
+
},
|
|
471
|
+
"choice": {
|
|
472
|
+
"type": "object",
|
|
473
|
+
"propertyNames": {
|
|
474
|
+
"$ref": "#/$defs/Key"
|
|
475
|
+
},
|
|
476
|
+
"additionalProperties": {
|
|
477
|
+
"type": "integer",
|
|
478
|
+
"minimum": 0
|
|
479
|
+
}
|
|
480
|
+
},
|
|
481
|
+
"ranking": {
|
|
482
|
+
"type": "object",
|
|
483
|
+
"propertyNames": {
|
|
484
|
+
"$ref": "#/$defs/Key"
|
|
485
|
+
},
|
|
486
|
+
"additionalProperties": {
|
|
487
|
+
"type": "array",
|
|
488
|
+
"items": {
|
|
489
|
+
"type": "integer",
|
|
490
|
+
"minimum": 0
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
},
|
|
494
|
+
"score": {
|
|
495
|
+
"type": "object",
|
|
496
|
+
"propertyNames": {
|
|
497
|
+
"$ref": "#/$defs/Key"
|
|
498
|
+
},
|
|
499
|
+
"additionalProperties": {
|
|
500
|
+
"type": "object",
|
|
501
|
+
"additionalProperties": false,
|
|
502
|
+
"required": [
|
|
503
|
+
"sum",
|
|
504
|
+
"count"
|
|
505
|
+
],
|
|
506
|
+
"properties": {
|
|
507
|
+
"sum": {
|
|
508
|
+
"type": "integer"
|
|
509
|
+
},
|
|
510
|
+
"count": {
|
|
511
|
+
"type": "integer",
|
|
512
|
+
"minimum": 0
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
},
|
|
517
|
+
"text": {
|
|
518
|
+
"type": "array",
|
|
519
|
+
"items": {
|
|
520
|
+
"type": "string",
|
|
521
|
+
"maxLength": 4096
|
|
522
|
+
}
|
|
523
|
+
},
|
|
524
|
+
"withheld": {
|
|
525
|
+
"type": "boolean"
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
},
|
|
529
|
+
"Key": {
|
|
530
|
+
"title": "Key",
|
|
531
|
+
"description": "A question or option key, unique within its manifest or question.",
|
|
532
|
+
"type": "string",
|
|
533
|
+
"pattern": "^[A-Za-z0-9._-]{1,64}$"
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
} as const;
|
|
537
|
+
|
|
538
|
+
/**
|
|
539
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
540
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
541
|
+
* per-specification and cannot be derived from the document alone, and
|
|
542
|
+
* item 2 needs the schema this carries.
|
|
543
|
+
*/
|
|
544
|
+
export const SPEC = {
|
|
545
|
+
typeUri: TYPE_URI,
|
|
546
|
+
isBearer: false,
|
|
547
|
+
isProofRequired: true,
|
|
548
|
+
isRecipientRequired: true,
|
|
549
|
+
isIssuedAtRequired: true,
|
|
550
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
551
|
+
} as const;
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
555
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
556
|
+
* parties (§7.3 item 5).
|
|
557
|
+
*/
|
|
558
|
+
export const RESPONSE_SPEC = {
|
|
559
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
560
|
+
isBearer: false,
|
|
561
|
+
isProofRequired: true,
|
|
562
|
+
isRecipientRequired: true,
|
|
563
|
+
isIssuedAtRequired: true,
|
|
564
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
565
|
+
} as const;
|