@openvtc/trust-tasks 0.20.1 → 0.20.2

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.
Files changed (32) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/dist/index.d.ts +5 -0
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +5 -0
  5. package/dist/index.js.map +1 -1
  6. package/dist/vetting/attestation/0.1/payload.d.ts +690 -0
  7. package/dist/vetting/attestation/0.1/payload.d.ts.map +1 -0
  8. package/dist/vetting/attestation/0.1/payload.js +374 -0
  9. package/dist/vetting/attestation/0.1/payload.js.map +1 -0
  10. package/dist/vtc/vetting/pcs-challenge/0.1/payload.d.ts +261 -0
  11. package/dist/vtc/vetting/pcs-challenge/0.1/payload.d.ts.map +1 -0
  12. package/dist/vtc/vetting/pcs-challenge/0.1/payload.js +145 -0
  13. package/dist/vtc/vetting/pcs-challenge/0.1/payload.js.map +1 -0
  14. package/dist/vtc/vetting/vetters/event-mode/0.1/payload.d.ts +546 -0
  15. package/dist/vtc/vetting/vetters/event-mode/0.1/payload.d.ts.map +1 -0
  16. package/dist/vtc/vetting/vetters/event-mode/0.1/payload.js +290 -0
  17. package/dist/vtc/vetting/vetters/event-mode/0.1/payload.js.map +1 -0
  18. package/dist/vtc/vetting/vetters/pcs-root/0.1/payload.d.ts +336 -0
  19. package/dist/vtc/vetting/vetters/pcs-root/0.1/payload.d.ts.map +1 -0
  20. package/dist/vtc/vetting/vetters/pcs-root/0.1/payload.js +178 -0
  21. package/dist/vtc/vetting/vetters/pcs-root/0.1/payload.js.map +1 -0
  22. package/dist/vtc/vetting/vetters/pcs-tokens/0.1/payload.d.ts +402 -0
  23. package/dist/vtc/vetting/vetters/pcs-tokens/0.1/payload.d.ts.map +1 -0
  24. package/dist/vtc/vetting/vetters/pcs-tokens/0.1/payload.js +205 -0
  25. package/dist/vtc/vetting/vetters/pcs-tokens/0.1/payload.js.map +1 -0
  26. package/package.json +1 -1
  27. package/src/index.ts +5 -0
  28. package/src/vetting/attestation/0.1/payload.ts +493 -0
  29. package/src/vtc/vetting/pcs-challenge/0.1/payload.ts +187 -0
  30. package/src/vtc/vetting/vetters/event-mode/0.1/payload.ts +375 -0
  31. package/src/vtc/vetting/vetters/pcs-root/0.1/payload.ts +241 -0
  32. package/src/vtc/vetting/vetters/pcs-tokens/0.1/payload.ts +286 -0
@@ -0,0 +1,286 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vtc/vetting/vetters/pcs-tokens/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { Ext } from "../../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * A vetter draws its tick of attestation tokens. The draw is unconditional and on a schedule — a vetter asks whether or not it has vetted anyone — because a fetch that tracked activity would report activity.
11
+ */
12
+ export interface VTCVettingPCSTokensPayload {
13
+ /**
14
+ * The token label to draw under: the community's current monthly label, or an event label it has approved for this vetter.
15
+ */
16
+ label: string;
17
+ /**
18
+ * The vetter's own schedule counter for this label. It makes `once per tick` a rule the community can enforce without learning whether the vetter has been busy.
19
+ */
20
+ tick: number;
21
+ /**
22
+ * One blinded serial per token asked for. More than the community's published `dripPerTick` is refused outright — the cap is the community's, not the asker's restraint.
23
+ *
24
+ * @minItems 1
25
+ * @maxItems 64
26
+ */
27
+ requests: [
28
+ {
29
+ /**
30
+ * A commitment to a serial only the vetter knows.
31
+ */
32
+ commitment: string;
33
+ /**
34
+ * Proof that the commitment opens to a serial the vetter holds, bound to this label, member and tick.
35
+ */
36
+ openingProof: string;
37
+ },
38
+ ...{
39
+ /**
40
+ * A commitment to a serial only the vetter knows.
41
+ */
42
+ commitment: string;
43
+ /**
44
+ * Proof that the commitment opens to a serial the vetter holds, bound to this label, member and tick.
45
+ */
46
+ openingProof: string;
47
+ }[]
48
+ ];
49
+ ext?: Ext;
50
+ }
51
+ /**
52
+ * One blind signature per request, in the order asked.
53
+ */
54
+ export interface VTCVettingPCSTokensResponsePayload {
55
+ /**
56
+ * The label served.
57
+ */
58
+ label: string;
59
+ /**
60
+ * The tick served.
61
+ */
62
+ tick: number;
63
+ /**
64
+ * The blind signatures, positionally matching `requests`.
65
+ *
66
+ * @minItems 1
67
+ * @maxItems 64
68
+ */
69
+ preCredentials: [string, ...string[]];
70
+ ext?: Ext;
71
+ }
72
+
73
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
74
+ export type { Ext };
75
+
76
+ /** Trust Task type URI. */
77
+ export const TYPE_URI = "https://trusttasks.org/spec/vtc/vetting/vetters/pcs-tokens/0.1" as const;
78
+
79
+ /** Stable alias for this specification's request payload shape. */
80
+ export type Payload = VTCVettingPCSTokensPayload;
81
+
82
+ /** Trust Task response type URI (request type URI + "#response"). */
83
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/vetting/vetters/pcs-tokens/0.1#response" as const;
84
+
85
+ /** Stable alias for this specification's success-response payload shape. */
86
+ export type Response = VTCVettingPCSTokensResponsePayload;
87
+
88
+ /**
89
+ * This specification's payload schema, as a value.
90
+ *
91
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
92
+ * rather than only as a `.json` file because TypeScript types are erased
93
+ * at runtime: without a schema a consumer has nothing to validate, and
94
+ * every REQUIRED payload member is optional in practice. Cross-file
95
+ * `$ref`s are already inlined, so it needs no resolver.
96
+ */
97
+ export const PAYLOAD_SCHEMA = {
98
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
99
+ "$id": "https://trusttasks.org/spec/vtc/vetting/vetters/pcs-tokens/0.1",
100
+ "title": "VTC — Vetting PCS Tokens — payload",
101
+ "description": "A vetter draws its tick of attestation tokens. The draw is unconditional and on a schedule — a vetter asks whether or not it has vetted anyone — because a fetch that tracked activity would report activity.",
102
+ "type": "object",
103
+ "additionalProperties": false,
104
+ "required": [
105
+ "label",
106
+ "tick",
107
+ "requests"
108
+ ],
109
+ "properties": {
110
+ "label": {
111
+ "type": "string",
112
+ "minLength": 1,
113
+ "maxLength": 128,
114
+ "description": "The token label to draw under: the community's current monthly label, or an event label it has approved for this vetter."
115
+ },
116
+ "tick": {
117
+ "type": "integer",
118
+ "minimum": 0,
119
+ "description": "The vetter's own schedule counter for this label. It makes `once per tick` a rule the community can enforce without learning whether the vetter has been busy."
120
+ },
121
+ "requests": {
122
+ "type": "array",
123
+ "minItems": 1,
124
+ "maxItems": 64,
125
+ "description": "One blinded serial per token asked for. More than the community's published `dripPerTick` is refused outright — the cap is the community's, not the asker's restraint.",
126
+ "items": {
127
+ "type": "object",
128
+ "additionalProperties": false,
129
+ "required": [
130
+ "commitment",
131
+ "openingProof"
132
+ ],
133
+ "properties": {
134
+ "commitment": {
135
+ "type": "string",
136
+ "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$",
137
+ "description": "A commitment to a serial only the vetter knows."
138
+ },
139
+ "openingProof": {
140
+ "type": "string",
141
+ "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$",
142
+ "description": "Proof that the commitment opens to a serial the vetter holds, bound to this label, member and tick."
143
+ }
144
+ }
145
+ }
146
+ },
147
+ "ext": {
148
+ "$ref": "#/$defs/Ext"
149
+ }
150
+ },
151
+ "$defs": {
152
+ "Response": {
153
+ "$anchor": "response",
154
+ "title": "VTC Vetting PCS Tokens — response payload",
155
+ "type": "object",
156
+ "additionalProperties": false,
157
+ "required": [
158
+ "label",
159
+ "tick",
160
+ "preCredentials"
161
+ ],
162
+ "description": "One blind signature per request, in the order asked.",
163
+ "properties": {
164
+ "label": {
165
+ "type": "string",
166
+ "minLength": 1,
167
+ "maxLength": 128,
168
+ "description": "The label served."
169
+ },
170
+ "tick": {
171
+ "type": "integer",
172
+ "minimum": 0,
173
+ "description": "The tick served."
174
+ },
175
+ "preCredentials": {
176
+ "type": "array",
177
+ "minItems": 1,
178
+ "maxItems": 64,
179
+ "description": "The blind signatures, positionally matching `requests`.",
180
+ "items": {
181
+ "type": "string",
182
+ "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
183
+ }
184
+ },
185
+ "ext": {
186
+ "$ref": "#/$defs/Ext"
187
+ }
188
+ }
189
+ },
190
+ "Ext": {
191
+ "title": "Ext",
192
+ "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.",
193
+ "type": "object",
194
+ "minProperties": 1,
195
+ "additionalProperties": true,
196
+ "propertyNames": {
197
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
198
+ }
199
+ }
200
+ }
201
+ } as const;
202
+
203
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
204
+ export const RESPONSE_PAYLOAD_SCHEMA = {
205
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
206
+ "$ref": "#/$defs/Response",
207
+ "$defs": {
208
+ "Response": {
209
+ "$anchor": "response",
210
+ "title": "VTC Vetting PCS Tokens — response payload",
211
+ "type": "object",
212
+ "additionalProperties": false,
213
+ "required": [
214
+ "label",
215
+ "tick",
216
+ "preCredentials"
217
+ ],
218
+ "description": "One blind signature per request, in the order asked.",
219
+ "properties": {
220
+ "label": {
221
+ "type": "string",
222
+ "minLength": 1,
223
+ "maxLength": 128,
224
+ "description": "The label served."
225
+ },
226
+ "tick": {
227
+ "type": "integer",
228
+ "minimum": 0,
229
+ "description": "The tick served."
230
+ },
231
+ "preCredentials": {
232
+ "type": "array",
233
+ "minItems": 1,
234
+ "maxItems": 64,
235
+ "description": "The blind signatures, positionally matching `requests`.",
236
+ "items": {
237
+ "type": "string",
238
+ "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
239
+ }
240
+ },
241
+ "ext": {
242
+ "$ref": "#/$defs/Ext"
243
+ }
244
+ }
245
+ },
246
+ "Ext": {
247
+ "title": "Ext",
248
+ "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.",
249
+ "type": "object",
250
+ "minProperties": 1,
251
+ "additionalProperties": true,
252
+ "propertyNames": {
253
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
254
+ }
255
+ }
256
+ }
257
+ } as const;
258
+
259
+ /**
260
+ * SPEC.md §7.2 policy for the request variant, from this specification's
261
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
262
+ * per-specification and cannot be derived from the document alone, and
263
+ * item 2 needs the schema this carries.
264
+ */
265
+ export const SPEC = {
266
+ typeUri: TYPE_URI,
267
+ isBearer: false,
268
+ isProofRequired: true,
269
+ isRecipientRequired: true,
270
+ isIssuedAtRequired: true,
271
+ payloadSchema: PAYLOAD_SCHEMA,
272
+ } as const;
273
+
274
+ /**
275
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
276
+ * tracks the *issuer* party's requirement because a response swaps the
277
+ * parties (§7.3 item 5).
278
+ */
279
+ export const RESPONSE_SPEC = {
280
+ typeUri: RESPONSE_TYPE_URI,
281
+ isBearer: false,
282
+ isProofRequired: true,
283
+ isRecipientRequired: true,
284
+ isIssuedAtRequired: true,
285
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
286
+ } as const;