@openvtc/trust-tasks 0.26.28 → 0.26.29

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.
@@ -0,0 +1,290 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vta/pcs/trustee/read/0.1/payload.schema.json
4
+ */
5
+ /** Trust Task type URI. */
6
+ export const TYPE_URI = "https://trusttasks.org/spec/vta/pcs/trustee/read/0.1";
7
+ /** Trust Task response type URI (request type URI + "#response"). */
8
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/pcs/trustee/read/0.1#response";
9
+ /**
10
+ * This specification's payload schema, as a value.
11
+ *
12
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
13
+ * rather than only as a `.json` file because TypeScript types are erased
14
+ * at runtime: without a schema a consumer has nothing to validate, and
15
+ * every REQUIRED payload member is optional in practice. Cross-file
16
+ * `$ref`s are already inlined, so it needs no resolver.
17
+ */
18
+ export const PAYLOAD_SCHEMA = {
19
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
20
+ "$id": "https://trusttasks.org/spec/vta/pcs/trustee/read/0.1",
21
+ "title": "VTA PCS — Trustee Read — payload",
22
+ "description": "A trustee's client asks its VTA for a voting/trustees/status or voting/election/show request signed as the trustee, so it can follow the election's ceremony at the ballot box — on a private board as on a public one — without holding the trustee's key.",
23
+ "type": "object",
24
+ "additionalProperties": false,
25
+ "required": [
26
+ "contextId",
27
+ "community",
28
+ "electionId",
29
+ "trustee",
30
+ "ballotBox",
31
+ "read"
32
+ ],
33
+ "properties": {
34
+ "contextId": {
35
+ "type": "string",
36
+ "minLength": 1,
37
+ "maxLength": 256,
38
+ "description": "The VTA context the trustee's keys live in."
39
+ },
40
+ "community": {
41
+ "type": "string",
42
+ "minLength": 1,
43
+ "maxLength": 2048,
44
+ "description": "The community's DID: the registrar that registered the election."
45
+ },
46
+ "electionId": {
47
+ "$ref": "#/$defs/ElectionId"
48
+ },
49
+ "trustee": {
50
+ "type": "string",
51
+ "minLength": 1,
52
+ "maxLength": 2048,
53
+ "pattern": "^did:",
54
+ "description": "The trustee's DID: a persona this VTA holds an authentication key of."
55
+ },
56
+ "ballotBox": {
57
+ "type": "string",
58
+ "minLength": 1,
59
+ "maxLength": 2048,
60
+ "pattern": "^did:",
61
+ "description": "The ballot box's DID: the recipient of the signed request."
62
+ },
63
+ "read": {
64
+ "type": "string",
65
+ "enum": [
66
+ "status",
67
+ "election"
68
+ ],
69
+ "description": "Which read to sign: voting/trustees/status/0.1 or voting/election/show/0.1."
70
+ },
71
+ "ext": {
72
+ "$ref": "#/$defs/Ext"
73
+ }
74
+ },
75
+ "$defs": {
76
+ "ReadDocument": {
77
+ "title": "ReadDocument",
78
+ "description": "A complete, signed voting/trustees/status/0.1 or voting/election/show/0.1 request document, ready to send to the ballot box unchanged.",
79
+ "type": "object",
80
+ "required": [
81
+ "id",
82
+ "type",
83
+ "issuer",
84
+ "recipient",
85
+ "issuedAt",
86
+ "payload",
87
+ "proof"
88
+ ],
89
+ "properties": {
90
+ "id": {
91
+ "type": "string",
92
+ "pattern": "^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
93
+ },
94
+ "type": {
95
+ "type": "string",
96
+ "enum": [
97
+ "https://trusttasks.org/spec/voting/trustees/status/0.1",
98
+ "https://trusttasks.org/spec/voting/election/show/0.1"
99
+ ]
100
+ },
101
+ "issuer": {
102
+ "type": "string",
103
+ "minLength": 1,
104
+ "maxLength": 2048,
105
+ "description": "The request's `trustee`."
106
+ },
107
+ "recipient": {
108
+ "type": "string",
109
+ "minLength": 1,
110
+ "maxLength": 2048,
111
+ "description": "The request's `ballotBox`."
112
+ },
113
+ "issuedAt": {
114
+ "type": "string",
115
+ "format": "date-time"
116
+ },
117
+ "expiresAt": {
118
+ "type": "string",
119
+ "format": "date-time"
120
+ },
121
+ "payload": {
122
+ "type": "object",
123
+ "description": "`{ community, electionId }` from the request, exactly."
124
+ },
125
+ "proof": {
126
+ "type": "object",
127
+ "description": "A Data Integrity proof by an `authentication` key of `issuer`."
128
+ }
129
+ }
130
+ },
131
+ "Response": {
132
+ "$anchor": "response",
133
+ "title": "VTA PCS — Trustee Read — response payload",
134
+ "description": "The signed read, to send to the ballot box.",
135
+ "type": "object",
136
+ "additionalProperties": false,
137
+ "required": [
138
+ "document"
139
+ ],
140
+ "properties": {
141
+ "document": {
142
+ "$ref": "#/$defs/ReadDocument"
143
+ },
144
+ "ext": {
145
+ "$ref": "#/$defs/Ext"
146
+ }
147
+ }
148
+ },
149
+ "Ext": {
150
+ "title": "Ext",
151
+ "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.",
152
+ "type": "object",
153
+ "minProperties": 1,
154
+ "additionalProperties": true,
155
+ "propertyNames": {
156
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
157
+ }
158
+ },
159
+ "ElectionId": {
160
+ "title": "ElectionId",
161
+ "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.",
162
+ "type": "string",
163
+ "pattern": "^[A-Za-z0-9._-]{1,128}$"
164
+ }
165
+ }
166
+ };
167
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
168
+ export const RESPONSE_PAYLOAD_SCHEMA = {
169
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
170
+ "$ref": "#/$defs/Response",
171
+ "$defs": {
172
+ "ReadDocument": {
173
+ "title": "ReadDocument",
174
+ "description": "A complete, signed voting/trustees/status/0.1 or voting/election/show/0.1 request document, ready to send to the ballot box unchanged.",
175
+ "type": "object",
176
+ "required": [
177
+ "id",
178
+ "type",
179
+ "issuer",
180
+ "recipient",
181
+ "issuedAt",
182
+ "payload",
183
+ "proof"
184
+ ],
185
+ "properties": {
186
+ "id": {
187
+ "type": "string",
188
+ "pattern": "^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
189
+ },
190
+ "type": {
191
+ "type": "string",
192
+ "enum": [
193
+ "https://trusttasks.org/spec/voting/trustees/status/0.1",
194
+ "https://trusttasks.org/spec/voting/election/show/0.1"
195
+ ]
196
+ },
197
+ "issuer": {
198
+ "type": "string",
199
+ "minLength": 1,
200
+ "maxLength": 2048,
201
+ "description": "The request's `trustee`."
202
+ },
203
+ "recipient": {
204
+ "type": "string",
205
+ "minLength": 1,
206
+ "maxLength": 2048,
207
+ "description": "The request's `ballotBox`."
208
+ },
209
+ "issuedAt": {
210
+ "type": "string",
211
+ "format": "date-time"
212
+ },
213
+ "expiresAt": {
214
+ "type": "string",
215
+ "format": "date-time"
216
+ },
217
+ "payload": {
218
+ "type": "object",
219
+ "description": "`{ community, electionId }` from the request, exactly."
220
+ },
221
+ "proof": {
222
+ "type": "object",
223
+ "description": "A Data Integrity proof by an `authentication` key of `issuer`."
224
+ }
225
+ }
226
+ },
227
+ "Response": {
228
+ "$anchor": "response",
229
+ "title": "VTA PCS — Trustee Read — response payload",
230
+ "description": "The signed read, to send to the ballot box.",
231
+ "type": "object",
232
+ "additionalProperties": false,
233
+ "required": [
234
+ "document"
235
+ ],
236
+ "properties": {
237
+ "document": {
238
+ "$ref": "#/$defs/ReadDocument"
239
+ },
240
+ "ext": {
241
+ "$ref": "#/$defs/Ext"
242
+ }
243
+ }
244
+ },
245
+ "Ext": {
246
+ "title": "Ext",
247
+ "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.",
248
+ "type": "object",
249
+ "minProperties": 1,
250
+ "additionalProperties": true,
251
+ "propertyNames": {
252
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
253
+ }
254
+ },
255
+ "ElectionId": {
256
+ "title": "ElectionId",
257
+ "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.",
258
+ "type": "string",
259
+ "pattern": "^[A-Za-z0-9._-]{1,128}$"
260
+ }
261
+ }
262
+ };
263
+ /**
264
+ * SPEC.md §7.2 policy for the request variant, from this specification's
265
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
266
+ * per-specification and cannot be derived from the document alone, and
267
+ * item 2 needs the schema this carries.
268
+ */
269
+ export const SPEC = {
270
+ typeUri: TYPE_URI,
271
+ isBearer: false,
272
+ isProofRequired: true,
273
+ isRecipientRequired: true,
274
+ isIssuedAtRequired: true,
275
+ payloadSchema: PAYLOAD_SCHEMA,
276
+ };
277
+ /**
278
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
279
+ * tracks the *issuer* party's requirement because a response swaps the
280
+ * parties (§7.3 item 5).
281
+ */
282
+ export const RESPONSE_SPEC = {
283
+ typeUri: RESPONSE_TYPE_URI,
284
+ isBearer: false,
285
+ isProofRequired: false,
286
+ isRecipientRequired: true,
287
+ isIssuedAtRequired: true,
288
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
289
+ };
290
+ //# sourceMappingURL=payload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payload.js","sourceRoot":"","sources":["../../../../../../src/vta/pcs/trustee/read/0.1/payload.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAsEH,2BAA2B;AAC3B,MAAM,CAAC,MAAM,QAAQ,GAAG,sDAA+D,CAAC;AAKxF,qEAAqE;AACrE,MAAM,CAAC,MAAM,iBAAiB,GAAG,+DAAwE,CAAC;AAK1G;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,SAAS,EAAE,8CAA8C;IACzD,KAAK,EAAE,sDAAsD;IAC7D,OAAO,EAAE,kCAAkC;IAC3C,aAAa,EAAE,6PAA6P;IAC5Q,MAAM,EA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,UAAU;YACrB,OAAO,EAAE,2CAA2C;YACpD,aAAa,EAAE,6CAA6C;YAC5D,MAAM,EAAE,QAAQ;YAChB,sBAAsB,EAAE,KAAK;YAC7B,UAAU,EAAE;gBACV,UAAU;aACX;YACD,YAAY,EAAE;gBACZ,UAAU,EAAE;oBACV,MAAM,EAAE,sBAAsB;iBAC/B;gBACD,KAAK,EAAE;oBACL,MAAM,EAAE,aAAa;iBACtB;aACF;SACF;QACD,KAAK,EAAE;YACL,OAAO,EAAE,KAAK;YACd,aAAa,EAAE,uKAAuK;YACtL,MAAM,EAAE,QAAQ;YAChB,eAAe,EAAE,CAAC;YAClB,sBAAsB,EAAE,IAAI;YAC5B,eAAe,EAAE;gBACf,SAAS,EAAE,mCAAmC;aAC/C;SACF;QACD,YAAY,EAAE;YACZ,OAAO,EAAE,YAAY;YACrB,aAAa,EAAE,uLAAuL;YACtM,MAAM,EAAE,QAAQ;YAChB,SAAS,EAAE,yBAAyB;SACrC;KACF;CACO,CAAC;AAEX;;;;;GAKG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB,OAAO,EAAE,QAAQ;IACjB,QAAQ,EAAE,KAAK;IACf,eAAe,EAAE,IAAI;IACrB,mBAAmB,EAAE,IAAI;IACzB,kBAAkB,EAAE,IAAI;IACxB,aAAa,EAAE,cAAc;CACrB,CAAC;AAEX;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,OAAO,EAAE,iBAAiB;IAC1B,QAAQ,EAAE,KAAK;IACf,eAAe,EAAE,KAAK;IACtB,mBAAmB,EAAE,IAAI;IACzB,kBAAkB,EAAE,IAAI;IACxB,aAAa,EAAE,uBAAuB;CAC9B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openvtc/trust-tasks",
3
- "version": "0.26.28",
3
+ "version": "0.26.29",
4
4
  "description": "Generated TypeScript bindings for the Trust Tasks framework registry.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/index.ts CHANGED
@@ -698,6 +698,7 @@ export * as VtaPcsTrusteeDecrypt_v0_1 from "./vta/pcs/trustee/decrypt/0.1/payloa
698
698
  export * as VtaPcsTrusteeEnrol_v0_1 from "./vta/pcs/trustee/enrol/0.1/payload.js";
699
699
  export * as VtaPcsTrusteeJustify_v0_1 from "./vta/pcs/trustee/justify/0.1/payload.js";
700
700
  export * as VtaPcsTrusteeKeys_v0_1 from "./vta/pcs/trustee/keys/0.1/payload.js";
701
+ export * as VtaPcsTrusteeRead_v0_1 from "./vta/pcs/trustee/read/0.1/payload.js";
701
702
  export * as VtaPcsVerifyAttestation_v0_1 from "./vta/pcs/verify-attestation/0.1/payload.js";
702
703
  export * as VtaPcsVetterShow_v0_1 from "./vta/pcs/vetter/show/0.1/payload.js";
703
704
  export * as VtaPcsVoteEncrypted_v0_1 from "./vta/pcs/vote-encrypted/0.1/payload.js";
@@ -31,7 +31,7 @@ export interface VTAPCSTrusteeDecryptPayload {
31
31
  */
32
32
  targets: [DecryptionTarget, ...DecryptionTarget[]];
33
33
  /**
34
- * When voting closed, from the election's summary. The VTA refuses before then.
34
+ * When voting closed: the board's closed or closedEarly entry, or any time at or after the close and not in the future. The VTA refuses a time in the future.
35
35
  */
36
36
  closedAt: string;
37
37
  ext?: Ext;
@@ -139,7 +139,7 @@ export const PAYLOAD_SCHEMA = {
139
139
  "closedAt": {
140
140
  "type": "string",
141
141
  "format": "date-time",
142
- "description": "When voting closed, from the election's summary. The VTA refuses before then."
142
+ "description": "When voting closed: the board's closed or closedEarly entry, or any time at or after the close and not in the future. The VTA refuses a time in the future."
143
143
  },
144
144
  "ext": {
145
145
  "$ref": "#/$defs/Ext"