@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,380 @@
|
|
|
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
|
+
import type { BoardHead, DigestMultibase, ElectionId, Ext } from "../../../../_shared/components.js";
|
|
6
|
+
/**
|
|
7
|
+
* Reads an election board's current tree head. The response document's proof is the head's signature.
|
|
8
|
+
*/
|
|
9
|
+
export interface VotingBoardHeadPayload {
|
|
10
|
+
/**
|
|
11
|
+
* The community's DID.
|
|
12
|
+
*/
|
|
13
|
+
community: string;
|
|
14
|
+
electionId: ElectionId;
|
|
15
|
+
ext?: Ext;
|
|
16
|
+
}
|
|
17
|
+
export interface VotingBoardHeadResponsePayload {
|
|
18
|
+
head: BoardHead;
|
|
19
|
+
ext?: Ext;
|
|
20
|
+
}
|
|
21
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
22
|
+
export type { BoardHead, DigestMultibase, ElectionId, Ext };
|
|
23
|
+
/** Trust Task type URI. */
|
|
24
|
+
export declare const TYPE_URI: "https://trusttasks.org/spec/voting/board/head/0.1";
|
|
25
|
+
/** Stable alias for this specification's request payload shape. */
|
|
26
|
+
export type Payload = VotingBoardHeadPayload;
|
|
27
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
28
|
+
export declare const RESPONSE_TYPE_URI: "https://trusttasks.org/spec/voting/board/head/0.1#response";
|
|
29
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
30
|
+
export type Response = VotingBoardHeadResponsePayload;
|
|
31
|
+
/**
|
|
32
|
+
* This specification's payload schema, as a value.
|
|
33
|
+
*
|
|
34
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
35
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
36
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
37
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
38
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
39
|
+
*/
|
|
40
|
+
export declare const PAYLOAD_SCHEMA: {
|
|
41
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
42
|
+
readonly $id: "https://trusttasks.org/spec/voting/board/head/0.1";
|
|
43
|
+
readonly title: "Voting — Board Head — payload";
|
|
44
|
+
readonly description: "Reads an election board's current tree head. The response document's proof is the head's signature.";
|
|
45
|
+
readonly type: "object";
|
|
46
|
+
readonly additionalProperties: false;
|
|
47
|
+
readonly required: readonly ["community", "electionId"];
|
|
48
|
+
readonly properties: {
|
|
49
|
+
readonly community: {
|
|
50
|
+
readonly type: "string";
|
|
51
|
+
readonly minLength: 1;
|
|
52
|
+
readonly maxLength: 2048;
|
|
53
|
+
readonly description: "The community's DID.";
|
|
54
|
+
};
|
|
55
|
+
readonly electionId: {
|
|
56
|
+
readonly $ref: "#/$defs/ElectionId";
|
|
57
|
+
};
|
|
58
|
+
readonly ext: {
|
|
59
|
+
readonly $ref: "#/$defs/Ext";
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
readonly $defs: {
|
|
63
|
+
readonly Response: {
|
|
64
|
+
readonly $anchor: "response";
|
|
65
|
+
readonly title: "Voting — Board Head — response payload";
|
|
66
|
+
readonly type: "object";
|
|
67
|
+
readonly additionalProperties: false;
|
|
68
|
+
readonly required: readonly ["head"];
|
|
69
|
+
readonly properties: {
|
|
70
|
+
readonly head: {
|
|
71
|
+
readonly $ref: "#/$defs/BoardHead";
|
|
72
|
+
};
|
|
73
|
+
readonly ext: {
|
|
74
|
+
readonly $ref: "#/$defs/Ext";
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
readonly Ext: {
|
|
79
|
+
readonly title: "Ext";
|
|
80
|
+
readonly 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.";
|
|
81
|
+
readonly type: "object";
|
|
82
|
+
readonly minProperties: 1;
|
|
83
|
+
readonly additionalProperties: true;
|
|
84
|
+
readonly propertyNames: {
|
|
85
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
readonly BoardHead: {
|
|
89
|
+
readonly title: "BoardHead";
|
|
90
|
+
readonly 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.";
|
|
91
|
+
readonly type: "object";
|
|
92
|
+
readonly additionalProperties: false;
|
|
93
|
+
readonly required: readonly ["electionId", "treeSize", "rootHash", "issuedAt"];
|
|
94
|
+
readonly properties: {
|
|
95
|
+
readonly electionId: {
|
|
96
|
+
readonly $ref: "#/$defs/ElectionId";
|
|
97
|
+
};
|
|
98
|
+
readonly treeSize: {
|
|
99
|
+
readonly type: "integer";
|
|
100
|
+
readonly minimum: 0;
|
|
101
|
+
};
|
|
102
|
+
readonly rootHash: {
|
|
103
|
+
readonly $ref: "#/$defs/DigestMultibase";
|
|
104
|
+
readonly description: "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash.";
|
|
105
|
+
};
|
|
106
|
+
readonly issuedAt: {
|
|
107
|
+
readonly type: "string";
|
|
108
|
+
readonly format: "date-time";
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
readonly ElectionId: {
|
|
113
|
+
readonly title: "ElectionId";
|
|
114
|
+
readonly 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.";
|
|
115
|
+
readonly type: "string";
|
|
116
|
+
readonly pattern: "^[A-Za-z0-9._-]{1,128}$";
|
|
117
|
+
};
|
|
118
|
+
readonly DigestMultibase: {
|
|
119
|
+
readonly title: "DigestMultibase";
|
|
120
|
+
readonly 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`.";
|
|
121
|
+
readonly type: "string";
|
|
122
|
+
readonly minLength: 16;
|
|
123
|
+
readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
|
|
124
|
+
readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
129
|
+
export declare const RESPONSE_PAYLOAD_SCHEMA: {
|
|
130
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
131
|
+
readonly $ref: "#/$defs/Response";
|
|
132
|
+
readonly $defs: {
|
|
133
|
+
readonly Response: {
|
|
134
|
+
readonly $anchor: "response";
|
|
135
|
+
readonly title: "Voting — Board Head — response payload";
|
|
136
|
+
readonly type: "object";
|
|
137
|
+
readonly additionalProperties: false;
|
|
138
|
+
readonly required: readonly ["head"];
|
|
139
|
+
readonly properties: {
|
|
140
|
+
readonly head: {
|
|
141
|
+
readonly $ref: "#/$defs/BoardHead";
|
|
142
|
+
};
|
|
143
|
+
readonly ext: {
|
|
144
|
+
readonly $ref: "#/$defs/Ext";
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
readonly Ext: {
|
|
149
|
+
readonly title: "Ext";
|
|
150
|
+
readonly 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.";
|
|
151
|
+
readonly type: "object";
|
|
152
|
+
readonly minProperties: 1;
|
|
153
|
+
readonly additionalProperties: true;
|
|
154
|
+
readonly propertyNames: {
|
|
155
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
readonly BoardHead: {
|
|
159
|
+
readonly title: "BoardHead";
|
|
160
|
+
readonly 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.";
|
|
161
|
+
readonly type: "object";
|
|
162
|
+
readonly additionalProperties: false;
|
|
163
|
+
readonly required: readonly ["electionId", "treeSize", "rootHash", "issuedAt"];
|
|
164
|
+
readonly properties: {
|
|
165
|
+
readonly electionId: {
|
|
166
|
+
readonly $ref: "#/$defs/ElectionId";
|
|
167
|
+
};
|
|
168
|
+
readonly treeSize: {
|
|
169
|
+
readonly type: "integer";
|
|
170
|
+
readonly minimum: 0;
|
|
171
|
+
};
|
|
172
|
+
readonly rootHash: {
|
|
173
|
+
readonly $ref: "#/$defs/DigestMultibase";
|
|
174
|
+
readonly description: "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash.";
|
|
175
|
+
};
|
|
176
|
+
readonly issuedAt: {
|
|
177
|
+
readonly type: "string";
|
|
178
|
+
readonly format: "date-time";
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
readonly ElectionId: {
|
|
183
|
+
readonly title: "ElectionId";
|
|
184
|
+
readonly 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.";
|
|
185
|
+
readonly type: "string";
|
|
186
|
+
readonly pattern: "^[A-Za-z0-9._-]{1,128}$";
|
|
187
|
+
};
|
|
188
|
+
readonly DigestMultibase: {
|
|
189
|
+
readonly title: "DigestMultibase";
|
|
190
|
+
readonly 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`.";
|
|
191
|
+
readonly type: "string";
|
|
192
|
+
readonly minLength: 16;
|
|
193
|
+
readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
|
|
194
|
+
readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
/**
|
|
199
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
200
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
201
|
+
* per-specification and cannot be derived from the document alone, and
|
|
202
|
+
* item 2 needs the schema this carries.
|
|
203
|
+
*/
|
|
204
|
+
export declare const SPEC: {
|
|
205
|
+
readonly typeUri: "https://trusttasks.org/spec/voting/board/head/0.1";
|
|
206
|
+
readonly isBearer: false;
|
|
207
|
+
readonly isProofRequired: false;
|
|
208
|
+
readonly isRecipientRequired: true;
|
|
209
|
+
readonly isIssuedAtRequired: false;
|
|
210
|
+
readonly payloadSchema: {
|
|
211
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
212
|
+
readonly $id: "https://trusttasks.org/spec/voting/board/head/0.1";
|
|
213
|
+
readonly title: "Voting — Board Head — payload";
|
|
214
|
+
readonly description: "Reads an election board's current tree head. The response document's proof is the head's signature.";
|
|
215
|
+
readonly type: "object";
|
|
216
|
+
readonly additionalProperties: false;
|
|
217
|
+
readonly required: readonly ["community", "electionId"];
|
|
218
|
+
readonly properties: {
|
|
219
|
+
readonly community: {
|
|
220
|
+
readonly type: "string";
|
|
221
|
+
readonly minLength: 1;
|
|
222
|
+
readonly maxLength: 2048;
|
|
223
|
+
readonly description: "The community's DID.";
|
|
224
|
+
};
|
|
225
|
+
readonly electionId: {
|
|
226
|
+
readonly $ref: "#/$defs/ElectionId";
|
|
227
|
+
};
|
|
228
|
+
readonly ext: {
|
|
229
|
+
readonly $ref: "#/$defs/Ext";
|
|
230
|
+
};
|
|
231
|
+
};
|
|
232
|
+
readonly $defs: {
|
|
233
|
+
readonly Response: {
|
|
234
|
+
readonly $anchor: "response";
|
|
235
|
+
readonly title: "Voting — Board Head — response payload";
|
|
236
|
+
readonly type: "object";
|
|
237
|
+
readonly additionalProperties: false;
|
|
238
|
+
readonly required: readonly ["head"];
|
|
239
|
+
readonly properties: {
|
|
240
|
+
readonly head: {
|
|
241
|
+
readonly $ref: "#/$defs/BoardHead";
|
|
242
|
+
};
|
|
243
|
+
readonly ext: {
|
|
244
|
+
readonly $ref: "#/$defs/Ext";
|
|
245
|
+
};
|
|
246
|
+
};
|
|
247
|
+
};
|
|
248
|
+
readonly Ext: {
|
|
249
|
+
readonly title: "Ext";
|
|
250
|
+
readonly 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.";
|
|
251
|
+
readonly type: "object";
|
|
252
|
+
readonly minProperties: 1;
|
|
253
|
+
readonly additionalProperties: true;
|
|
254
|
+
readonly propertyNames: {
|
|
255
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
256
|
+
};
|
|
257
|
+
};
|
|
258
|
+
readonly BoardHead: {
|
|
259
|
+
readonly title: "BoardHead";
|
|
260
|
+
readonly 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.";
|
|
261
|
+
readonly type: "object";
|
|
262
|
+
readonly additionalProperties: false;
|
|
263
|
+
readonly required: readonly ["electionId", "treeSize", "rootHash", "issuedAt"];
|
|
264
|
+
readonly properties: {
|
|
265
|
+
readonly electionId: {
|
|
266
|
+
readonly $ref: "#/$defs/ElectionId";
|
|
267
|
+
};
|
|
268
|
+
readonly treeSize: {
|
|
269
|
+
readonly type: "integer";
|
|
270
|
+
readonly minimum: 0;
|
|
271
|
+
};
|
|
272
|
+
readonly rootHash: {
|
|
273
|
+
readonly $ref: "#/$defs/DigestMultibase";
|
|
274
|
+
readonly description: "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash.";
|
|
275
|
+
};
|
|
276
|
+
readonly issuedAt: {
|
|
277
|
+
readonly type: "string";
|
|
278
|
+
readonly format: "date-time";
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
};
|
|
282
|
+
readonly ElectionId: {
|
|
283
|
+
readonly title: "ElectionId";
|
|
284
|
+
readonly 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.";
|
|
285
|
+
readonly type: "string";
|
|
286
|
+
readonly pattern: "^[A-Za-z0-9._-]{1,128}$";
|
|
287
|
+
};
|
|
288
|
+
readonly DigestMultibase: {
|
|
289
|
+
readonly title: "DigestMultibase";
|
|
290
|
+
readonly 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`.";
|
|
291
|
+
readonly type: "string";
|
|
292
|
+
readonly minLength: 16;
|
|
293
|
+
readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
|
|
294
|
+
readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
|
|
295
|
+
};
|
|
296
|
+
};
|
|
297
|
+
};
|
|
298
|
+
};
|
|
299
|
+
/**
|
|
300
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
301
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
302
|
+
* parties (§7.3 item 5).
|
|
303
|
+
*/
|
|
304
|
+
export declare const RESPONSE_SPEC: {
|
|
305
|
+
readonly typeUri: "https://trusttasks.org/spec/voting/board/head/0.1#response";
|
|
306
|
+
readonly isBearer: false;
|
|
307
|
+
readonly isProofRequired: true;
|
|
308
|
+
readonly isRecipientRequired: false;
|
|
309
|
+
readonly isIssuedAtRequired: false;
|
|
310
|
+
readonly payloadSchema: {
|
|
311
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
312
|
+
readonly $ref: "#/$defs/Response";
|
|
313
|
+
readonly $defs: {
|
|
314
|
+
readonly Response: {
|
|
315
|
+
readonly $anchor: "response";
|
|
316
|
+
readonly title: "Voting — Board Head — response payload";
|
|
317
|
+
readonly type: "object";
|
|
318
|
+
readonly additionalProperties: false;
|
|
319
|
+
readonly required: readonly ["head"];
|
|
320
|
+
readonly properties: {
|
|
321
|
+
readonly head: {
|
|
322
|
+
readonly $ref: "#/$defs/BoardHead";
|
|
323
|
+
};
|
|
324
|
+
readonly ext: {
|
|
325
|
+
readonly $ref: "#/$defs/Ext";
|
|
326
|
+
};
|
|
327
|
+
};
|
|
328
|
+
};
|
|
329
|
+
readonly Ext: {
|
|
330
|
+
readonly title: "Ext";
|
|
331
|
+
readonly 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.";
|
|
332
|
+
readonly type: "object";
|
|
333
|
+
readonly minProperties: 1;
|
|
334
|
+
readonly additionalProperties: true;
|
|
335
|
+
readonly propertyNames: {
|
|
336
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
337
|
+
};
|
|
338
|
+
};
|
|
339
|
+
readonly BoardHead: {
|
|
340
|
+
readonly title: "BoardHead";
|
|
341
|
+
readonly 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.";
|
|
342
|
+
readonly type: "object";
|
|
343
|
+
readonly additionalProperties: false;
|
|
344
|
+
readonly required: readonly ["electionId", "treeSize", "rootHash", "issuedAt"];
|
|
345
|
+
readonly properties: {
|
|
346
|
+
readonly electionId: {
|
|
347
|
+
readonly $ref: "#/$defs/ElectionId";
|
|
348
|
+
};
|
|
349
|
+
readonly treeSize: {
|
|
350
|
+
readonly type: "integer";
|
|
351
|
+
readonly minimum: 0;
|
|
352
|
+
};
|
|
353
|
+
readonly rootHash: {
|
|
354
|
+
readonly $ref: "#/$defs/DigestMultibase";
|
|
355
|
+
readonly description: "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash.";
|
|
356
|
+
};
|
|
357
|
+
readonly issuedAt: {
|
|
358
|
+
readonly type: "string";
|
|
359
|
+
readonly format: "date-time";
|
|
360
|
+
};
|
|
361
|
+
};
|
|
362
|
+
};
|
|
363
|
+
readonly ElectionId: {
|
|
364
|
+
readonly title: "ElectionId";
|
|
365
|
+
readonly 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.";
|
|
366
|
+
readonly type: "string";
|
|
367
|
+
readonly pattern: "^[A-Za-z0-9._-]{1,128}$";
|
|
368
|
+
};
|
|
369
|
+
readonly DigestMultibase: {
|
|
370
|
+
readonly title: "DigestMultibase";
|
|
371
|
+
readonly 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`.";
|
|
372
|
+
readonly type: "string";
|
|
373
|
+
readonly minLength: 16;
|
|
374
|
+
readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
|
|
375
|
+
readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
|
|
376
|
+
};
|
|
377
|
+
};
|
|
378
|
+
};
|
|
379
|
+
};
|
|
380
|
+
//# sourceMappingURL=payload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../../../src/voting/board/head/0.1/payload.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,mCAAmC,CAAC;AAGrG;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,UAAU,CAAC;IACvB,GAAG,CAAC,EAAE,GAAG,CAAC;CACX;AACD,MAAM,WAAW,8BAA8B;IAC7C,IAAI,EAAE,SAAS,CAAC;IAChB,GAAG,CAAC,EAAE,GAAG,CAAC;CACX;AAED,kHAAkH;AAClH,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC;AAE5D,2BAA2B;AAC3B,eAAO,MAAM,QAAQ,EAAG,mDAA4D,CAAC;AAErF,mEAAmE;AACnE,MAAM,MAAM,OAAO,GAAG,sBAAsB,CAAC;AAE7C,qEAAqE;AACrE,eAAO,MAAM,iBAAiB,EAAG,4DAAqE,CAAC;AAEvG,4EAA4E;AAC5E,MAAM,MAAM,QAAQ,GAAG,8BAA8B,CAAC;AAEtD;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmGjB,CAAC;AAEX,mEAAmE;AACnE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6E1B,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOP,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOhB,CAAC"}
|
|
@@ -0,0 +1,224 @@
|
|
|
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
|
+
/** Trust Task type URI. */
|
|
6
|
+
export const TYPE_URI = "https://trusttasks.org/spec/voting/board/head/0.1";
|
|
7
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
8
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/voting/board/head/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/head/0.1",
|
|
21
|
+
"title": "Voting — Board Head — payload",
|
|
22
|
+
"description": "Reads an election board's current tree head. The response document's proof is the head's signature.",
|
|
23
|
+
"type": "object",
|
|
24
|
+
"additionalProperties": false,
|
|
25
|
+
"required": [
|
|
26
|
+
"community",
|
|
27
|
+
"electionId"
|
|
28
|
+
],
|
|
29
|
+
"properties": {
|
|
30
|
+
"community": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"minLength": 1,
|
|
33
|
+
"maxLength": 2048,
|
|
34
|
+
"description": "The community's DID."
|
|
35
|
+
},
|
|
36
|
+
"electionId": {
|
|
37
|
+
"$ref": "#/$defs/ElectionId"
|
|
38
|
+
},
|
|
39
|
+
"ext": {
|
|
40
|
+
"$ref": "#/$defs/Ext"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"$defs": {
|
|
44
|
+
"Response": {
|
|
45
|
+
"$anchor": "response",
|
|
46
|
+
"title": "Voting — Board Head — response payload",
|
|
47
|
+
"type": "object",
|
|
48
|
+
"additionalProperties": false,
|
|
49
|
+
"required": [
|
|
50
|
+
"head"
|
|
51
|
+
],
|
|
52
|
+
"properties": {
|
|
53
|
+
"head": {
|
|
54
|
+
"$ref": "#/$defs/BoardHead"
|
|
55
|
+
},
|
|
56
|
+
"ext": {
|
|
57
|
+
"$ref": "#/$defs/Ext"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"Ext": {
|
|
62
|
+
"title": "Ext",
|
|
63
|
+
"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.",
|
|
64
|
+
"type": "object",
|
|
65
|
+
"minProperties": 1,
|
|
66
|
+
"additionalProperties": true,
|
|
67
|
+
"propertyNames": {
|
|
68
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"BoardHead": {
|
|
72
|
+
"title": "BoardHead",
|
|
73
|
+
"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.",
|
|
74
|
+
"type": "object",
|
|
75
|
+
"additionalProperties": false,
|
|
76
|
+
"required": [
|
|
77
|
+
"electionId",
|
|
78
|
+
"treeSize",
|
|
79
|
+
"rootHash",
|
|
80
|
+
"issuedAt"
|
|
81
|
+
],
|
|
82
|
+
"properties": {
|
|
83
|
+
"electionId": {
|
|
84
|
+
"$ref": "#/$defs/ElectionId"
|
|
85
|
+
},
|
|
86
|
+
"treeSize": {
|
|
87
|
+
"type": "integer",
|
|
88
|
+
"minimum": 0
|
|
89
|
+
},
|
|
90
|
+
"rootHash": {
|
|
91
|
+
"$ref": "#/$defs/DigestMultibase",
|
|
92
|
+
"description": "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash."
|
|
93
|
+
},
|
|
94
|
+
"issuedAt": {
|
|
95
|
+
"type": "string",
|
|
96
|
+
"format": "date-time"
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"ElectionId": {
|
|
101
|
+
"title": "ElectionId",
|
|
102
|
+
"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.",
|
|
103
|
+
"type": "string",
|
|
104
|
+
"pattern": "^[A-Za-z0-9._-]{1,128}$"
|
|
105
|
+
},
|
|
106
|
+
"DigestMultibase": {
|
|
107
|
+
"title": "DigestMultibase",
|
|
108
|
+
"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`.",
|
|
109
|
+
"type": "string",
|
|
110
|
+
"minLength": 16,
|
|
111
|
+
"pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
|
|
112
|
+
"examples": [
|
|
113
|
+
"zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
119
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
120
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
121
|
+
"$ref": "#/$defs/Response",
|
|
122
|
+
"$defs": {
|
|
123
|
+
"Response": {
|
|
124
|
+
"$anchor": "response",
|
|
125
|
+
"title": "Voting — Board Head — response payload",
|
|
126
|
+
"type": "object",
|
|
127
|
+
"additionalProperties": false,
|
|
128
|
+
"required": [
|
|
129
|
+
"head"
|
|
130
|
+
],
|
|
131
|
+
"properties": {
|
|
132
|
+
"head": {
|
|
133
|
+
"$ref": "#/$defs/BoardHead"
|
|
134
|
+
},
|
|
135
|
+
"ext": {
|
|
136
|
+
"$ref": "#/$defs/Ext"
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"Ext": {
|
|
141
|
+
"title": "Ext",
|
|
142
|
+
"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.",
|
|
143
|
+
"type": "object",
|
|
144
|
+
"minProperties": 1,
|
|
145
|
+
"additionalProperties": true,
|
|
146
|
+
"propertyNames": {
|
|
147
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"BoardHead": {
|
|
151
|
+
"title": "BoardHead",
|
|
152
|
+
"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.",
|
|
153
|
+
"type": "object",
|
|
154
|
+
"additionalProperties": false,
|
|
155
|
+
"required": [
|
|
156
|
+
"electionId",
|
|
157
|
+
"treeSize",
|
|
158
|
+
"rootHash",
|
|
159
|
+
"issuedAt"
|
|
160
|
+
],
|
|
161
|
+
"properties": {
|
|
162
|
+
"electionId": {
|
|
163
|
+
"$ref": "#/$defs/ElectionId"
|
|
164
|
+
},
|
|
165
|
+
"treeSize": {
|
|
166
|
+
"type": "integer",
|
|
167
|
+
"minimum": 0
|
|
168
|
+
},
|
|
169
|
+
"rootHash": {
|
|
170
|
+
"$ref": "#/$defs/DigestMultibase",
|
|
171
|
+
"description": "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash."
|
|
172
|
+
},
|
|
173
|
+
"issuedAt": {
|
|
174
|
+
"type": "string",
|
|
175
|
+
"format": "date-time"
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
"ElectionId": {
|
|
180
|
+
"title": "ElectionId",
|
|
181
|
+
"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.",
|
|
182
|
+
"type": "string",
|
|
183
|
+
"pattern": "^[A-Za-z0-9._-]{1,128}$"
|
|
184
|
+
},
|
|
185
|
+
"DigestMultibase": {
|
|
186
|
+
"title": "DigestMultibase",
|
|
187
|
+
"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`.",
|
|
188
|
+
"type": "string",
|
|
189
|
+
"minLength": 16,
|
|
190
|
+
"pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
|
|
191
|
+
"examples": [
|
|
192
|
+
"zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
|
|
193
|
+
]
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
/**
|
|
198
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
199
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
200
|
+
* per-specification and cannot be derived from the document alone, and
|
|
201
|
+
* item 2 needs the schema this carries.
|
|
202
|
+
*/
|
|
203
|
+
export const SPEC = {
|
|
204
|
+
typeUri: TYPE_URI,
|
|
205
|
+
isBearer: false,
|
|
206
|
+
isProofRequired: false,
|
|
207
|
+
isRecipientRequired: true,
|
|
208
|
+
isIssuedAtRequired: false,
|
|
209
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
210
|
+
};
|
|
211
|
+
/**
|
|
212
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
213
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
214
|
+
* parties (§7.3 item 5).
|
|
215
|
+
*/
|
|
216
|
+
export const RESPONSE_SPEC = {
|
|
217
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
218
|
+
isBearer: false,
|
|
219
|
+
isProofRequired: true,
|
|
220
|
+
isRecipientRequired: false,
|
|
221
|
+
isIssuedAtRequired: false,
|
|
222
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
223
|
+
};
|
|
224
|
+
//# sourceMappingURL=payload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payload.js","sourceRoot":"","sources":["../../../../../src/voting/board/head/0.1/payload.ts"],"names":[],"mappings":"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"}
|