@openvtc/trust-tasks 0.28.4 → 0.28.6
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 +29 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/vtc/elections/ballot-boxes/list/0.1/payload.d.ts +366 -0
- package/dist/vtc/elections/ballot-boxes/list/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/elections/ballot-boxes/list/0.1/payload.js +205 -0
- package/dist/vtc/elections/ballot-boxes/list/0.1/payload.js.map +1 -0
- package/package.json +1 -1
- package/src/index.ts +3 -0
- package/src/vtc/elections/ballot-boxes/list/0.1/payload.ts +260 -0
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vtc/elections/ballot-boxes/list/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { Ext } from "../../../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* An administrator reads the voting services the community will register an election with — its trusted ballot boxes — so that a manifest names one the community accepts. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.
|
|
11
|
+
*/
|
|
12
|
+
export interface VTCElectionsBallotBoxesListPayload {
|
|
13
|
+
ext?: Ext;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Success response to vtc/elections/ballot-boxes/list/0.1: every voting service the community trusts, as it trusts them now.
|
|
17
|
+
*/
|
|
18
|
+
export interface VTCElectionsBallotBoxesListResponsePayload {
|
|
19
|
+
/**
|
|
20
|
+
* Every trusted ballot box, in the community's own order. Empty when the community trusts none, and so can create no election.
|
|
21
|
+
*
|
|
22
|
+
* @maxItems 256
|
|
23
|
+
*/
|
|
24
|
+
ballotBoxes: TrustedBallotBox[];
|
|
25
|
+
ext?: Ext;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* One voting service the community trusts (VTI-VOT-082), with what its members are told about it when an election names it (VTI-VOT-090).
|
|
29
|
+
*/
|
|
30
|
+
export interface TrustedBallotBox {
|
|
31
|
+
/**
|
|
32
|
+
* The ballot box's DID, exactly as a manifest names it in `ballotBox`.
|
|
33
|
+
*/
|
|
34
|
+
did: string;
|
|
35
|
+
/**
|
|
36
|
+
* Who operates it, as the community names them — the `ballotBoxOperator` a member is shown.
|
|
37
|
+
*/
|
|
38
|
+
operator: string;
|
|
39
|
+
/**
|
|
40
|
+
* Whether the party operating the community's VTC also operates this ballot box — the `sameOperator` a member is shown.
|
|
41
|
+
*/
|
|
42
|
+
sameOperator: boolean;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
46
|
+
export type { Ext };
|
|
47
|
+
|
|
48
|
+
/** Trust Task type URI. */
|
|
49
|
+
export const TYPE_URI = "https://trusttasks.org/spec/vtc/elections/ballot-boxes/list/0.1" as const;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The earlier version of this specification that this one declares it
|
|
53
|
+
* extends (front matter `extends`, SPEC §5.2 "Declared extension"), or
|
|
54
|
+
* `null`. Only the direct declaration — follow the chain with
|
|
55
|
+
* `extendsChain` / `readForSpec`.
|
|
56
|
+
*/
|
|
57
|
+
export const EXTENDS: string | null = null;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Why this version is deprecated, or `null` while it is current. A
|
|
61
|
+
* superseded or retired version is still supported, and is withdrawn from
|
|
62
|
+
* this package in a later scheduled batch (SPEC "Superseded and Withdrawn
|
|
63
|
+
* Versions").
|
|
64
|
+
*/
|
|
65
|
+
export const DEPRECATION: string | null = null;
|
|
66
|
+
|
|
67
|
+
/** Stable alias for this specification's request payload shape. */
|
|
68
|
+
export type Payload = VTCElectionsBallotBoxesListPayload;
|
|
69
|
+
|
|
70
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
71
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/elections/ballot-boxes/list/0.1#response" as const;
|
|
72
|
+
|
|
73
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
74
|
+
export type Response = VTCElectionsBallotBoxesListResponsePayload;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* This specification's payload schema, as a value.
|
|
78
|
+
*
|
|
79
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
80
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
81
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
82
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
83
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
84
|
+
*/
|
|
85
|
+
export const PAYLOAD_SCHEMA = {
|
|
86
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
87
|
+
"$id": "https://trusttasks.org/spec/vtc/elections/ballot-boxes/list/0.1",
|
|
88
|
+
"title": "VTC Elections — Ballot Boxes — List — payload",
|
|
89
|
+
"description": "An administrator reads the voting services the community will register an election with — its trusted ballot boxes — so that a manifest names one the community accepts. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.",
|
|
90
|
+
"type": "object",
|
|
91
|
+
"additionalProperties": false,
|
|
92
|
+
"properties": {
|
|
93
|
+
"ext": {
|
|
94
|
+
"$ref": "#/$defs/Ext"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"$defs": {
|
|
98
|
+
"TrustedBallotBox": {
|
|
99
|
+
"title": "TrustedBallotBox",
|
|
100
|
+
"description": "One voting service the community trusts (VTI-VOT-082), with what its members are told about it when an election names it (VTI-VOT-090).",
|
|
101
|
+
"type": "object",
|
|
102
|
+
"additionalProperties": false,
|
|
103
|
+
"required": [
|
|
104
|
+
"did",
|
|
105
|
+
"operator",
|
|
106
|
+
"sameOperator"
|
|
107
|
+
],
|
|
108
|
+
"properties": {
|
|
109
|
+
"did": {
|
|
110
|
+
"type": "string",
|
|
111
|
+
"minLength": 1,
|
|
112
|
+
"maxLength": 2048,
|
|
113
|
+
"description": "The ballot box's DID, exactly as a manifest names it in `ballotBox`."
|
|
114
|
+
},
|
|
115
|
+
"operator": {
|
|
116
|
+
"type": "string",
|
|
117
|
+
"minLength": 1,
|
|
118
|
+
"maxLength": 512,
|
|
119
|
+
"description": "Who operates it, as the community names them — the `ballotBoxOperator` a member is shown."
|
|
120
|
+
},
|
|
121
|
+
"sameOperator": {
|
|
122
|
+
"type": "boolean",
|
|
123
|
+
"description": "Whether the party operating the community's VTC also operates this ballot box — the `sameOperator` a member is shown."
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"Response": {
|
|
128
|
+
"$anchor": "response",
|
|
129
|
+
"title": "VTC Elections — Ballot Boxes — List — response payload",
|
|
130
|
+
"description": "Success response to vtc/elections/ballot-boxes/list/0.1: every voting service the community trusts, as it trusts them now.",
|
|
131
|
+
"type": "object",
|
|
132
|
+
"additionalProperties": false,
|
|
133
|
+
"required": [
|
|
134
|
+
"ballotBoxes"
|
|
135
|
+
],
|
|
136
|
+
"properties": {
|
|
137
|
+
"ballotBoxes": {
|
|
138
|
+
"type": "array",
|
|
139
|
+
"maxItems": 256,
|
|
140
|
+
"items": {
|
|
141
|
+
"$ref": "#/$defs/TrustedBallotBox"
|
|
142
|
+
},
|
|
143
|
+
"description": "Every trusted ballot box, in the community's own order. Empty when the community trusts none, and so can create no election."
|
|
144
|
+
},
|
|
145
|
+
"ext": {
|
|
146
|
+
"$ref": "#/$defs/Ext"
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"Ext": {
|
|
151
|
+
"title": "Ext",
|
|
152
|
+
"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.",
|
|
153
|
+
"type": "object",
|
|
154
|
+
"minProperties": 1,
|
|
155
|
+
"additionalProperties": true,
|
|
156
|
+
"propertyNames": {
|
|
157
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
} as const;
|
|
162
|
+
|
|
163
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
164
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
165
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
166
|
+
"$ref": "#/$defs/Response",
|
|
167
|
+
"$defs": {
|
|
168
|
+
"TrustedBallotBox": {
|
|
169
|
+
"title": "TrustedBallotBox",
|
|
170
|
+
"description": "One voting service the community trusts (VTI-VOT-082), with what its members are told about it when an election names it (VTI-VOT-090).",
|
|
171
|
+
"type": "object",
|
|
172
|
+
"additionalProperties": false,
|
|
173
|
+
"required": [
|
|
174
|
+
"did",
|
|
175
|
+
"operator",
|
|
176
|
+
"sameOperator"
|
|
177
|
+
],
|
|
178
|
+
"properties": {
|
|
179
|
+
"did": {
|
|
180
|
+
"type": "string",
|
|
181
|
+
"minLength": 1,
|
|
182
|
+
"maxLength": 2048,
|
|
183
|
+
"description": "The ballot box's DID, exactly as a manifest names it in `ballotBox`."
|
|
184
|
+
},
|
|
185
|
+
"operator": {
|
|
186
|
+
"type": "string",
|
|
187
|
+
"minLength": 1,
|
|
188
|
+
"maxLength": 512,
|
|
189
|
+
"description": "Who operates it, as the community names them — the `ballotBoxOperator` a member is shown."
|
|
190
|
+
},
|
|
191
|
+
"sameOperator": {
|
|
192
|
+
"type": "boolean",
|
|
193
|
+
"description": "Whether the party operating the community's VTC also operates this ballot box — the `sameOperator` a member is shown."
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
"Response": {
|
|
198
|
+
"$anchor": "response",
|
|
199
|
+
"title": "VTC Elections — Ballot Boxes — List — response payload",
|
|
200
|
+
"description": "Success response to vtc/elections/ballot-boxes/list/0.1: every voting service the community trusts, as it trusts them now.",
|
|
201
|
+
"type": "object",
|
|
202
|
+
"additionalProperties": false,
|
|
203
|
+
"required": [
|
|
204
|
+
"ballotBoxes"
|
|
205
|
+
],
|
|
206
|
+
"properties": {
|
|
207
|
+
"ballotBoxes": {
|
|
208
|
+
"type": "array",
|
|
209
|
+
"maxItems": 256,
|
|
210
|
+
"items": {
|
|
211
|
+
"$ref": "#/$defs/TrustedBallotBox"
|
|
212
|
+
},
|
|
213
|
+
"description": "Every trusted ballot box, in the community's own order. Empty when the community trusts none, and so can create no election."
|
|
214
|
+
},
|
|
215
|
+
"ext": {
|
|
216
|
+
"$ref": "#/$defs/Ext"
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
"Ext": {
|
|
221
|
+
"title": "Ext",
|
|
222
|
+
"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.",
|
|
223
|
+
"type": "object",
|
|
224
|
+
"minProperties": 1,
|
|
225
|
+
"additionalProperties": true,
|
|
226
|
+
"propertyNames": {
|
|
227
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
} as const;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
235
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
236
|
+
* per-specification and cannot be derived from the document alone, and
|
|
237
|
+
* item 2 needs the schema this carries.
|
|
238
|
+
*/
|
|
239
|
+
export const SPEC = {
|
|
240
|
+
typeUri: TYPE_URI,
|
|
241
|
+
isBearer: false,
|
|
242
|
+
isProofRequired: false,
|
|
243
|
+
isRecipientRequired: true,
|
|
244
|
+
isIssuedAtRequired: false,
|
|
245
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
246
|
+
} as const;
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
250
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
251
|
+
* parties (§7.3 item 5).
|
|
252
|
+
*/
|
|
253
|
+
export const RESPONSE_SPEC = {
|
|
254
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
255
|
+
isBearer: false,
|
|
256
|
+
isProofRequired: false,
|
|
257
|
+
isRecipientRequired: true,
|
|
258
|
+
isIssuedAtRequired: false,
|
|
259
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
260
|
+
} as const;
|