@openvtc/trust-tasks 0.26.13 → 0.26.14

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,401 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vtc/registry/sync-jobs/retry/0.2/payload.schema.json
4
+ */
5
+
6
+ import type { Ext } from "../../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * Requeue a trust-registry reconciliation job — one the community's reconciler has abandoned, or one waiting out a retry backoff — so it is dispatched on the reconciler's next pass.
11
+ */
12
+ export type VTCRegistrySyncJobsRetryPayload = {
13
+ /**
14
+ * The single job to requeue, from `vtc/registry/sync-jobs/list`. It may be `failed`, or `pending` and waiting out a retry backoff.
15
+ */
16
+ jobId?: string;
17
+ /**
18
+ * Requeue every job in the terminal `failed` state. Spelled as its own member rather than an absent `jobId` so that a client bug which drops the identifier cannot silently become a bulk operation.
19
+ */
20
+ allFailed?: true;
21
+ /**
22
+ * Bring forward every `pending` job that is waiting out a retry backoff. Never a held job. Its own member for the same reason as `allFailed`, and distinct from it so that repairing a shared cause and hurrying a slow backoff stay two decisions.
23
+ */
24
+ allWaiting?: true;
25
+ ext?: Ext;
26
+ } & {
27
+ [k: string]: unknown | undefined;
28
+ };
29
+
30
+ export interface VTCRegistrySyncJobsRetryResponsePayload {
31
+ /**
32
+ * Jobs now scheduled for dispatch on the reconciler's next pass. Empty is a valid answer and is not an error.
33
+ */
34
+ requeued: Requeued[];
35
+ /**
36
+ * Jobs the maintainer declined to requeue, each with why. Reported rather than failing the task, so a bulk retry is not defeated by one ineligible row.
37
+ */
38
+ skipped: Skipped[];
39
+ ext?: Ext;
40
+ }
41
+ export interface Requeued {
42
+ jobId: string;
43
+ /**
44
+ * The member whose record the requeued job carries.
45
+ */
46
+ memberDid?: string;
47
+ /**
48
+ * The state the job was in. `failed` — the reconciler had abandoned it. `pending` — it was waiting out a retry backoff and has been brought forward.
49
+ */
50
+ from: "failed" | "pending";
51
+ ext?: Ext;
52
+ }
53
+ export interface Skipped {
54
+ jobId: string;
55
+ /**
56
+ * `inFlight` — the reconciler is dispatching the job now, so requeueing it would dispatch the same mutation twice. `held` — the job is deliberately delayed, and the delay is the point; it is never brought forward. `notFound` — no such job; it may already have been dispatched, retried, discarded, or swept.
57
+ */
58
+ reason: "inFlight" | "held" | "notFound";
59
+ ext?: Ext;
60
+ }
61
+
62
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
63
+ export type { Ext };
64
+
65
+ /** Trust Task type URI. */
66
+ export const TYPE_URI = "https://trusttasks.org/spec/vtc/registry/sync-jobs/retry/0.2" as const;
67
+
68
+ /** Stable alias for this specification's request payload shape. */
69
+ export type Payload = VTCRegistrySyncJobsRetryPayload;
70
+
71
+ /** Trust Task response type URI (request type URI + "#response"). */
72
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/registry/sync-jobs/retry/0.2#response" as const;
73
+
74
+ /** Stable alias for this specification's success-response payload shape. */
75
+ export type Response = VTCRegistrySyncJobsRetryResponsePayload;
76
+
77
+ /**
78
+ * This specification's payload schema, as a value.
79
+ *
80
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
81
+ * rather than only as a `.json` file because TypeScript types are erased
82
+ * at runtime: without a schema a consumer has nothing to validate, and
83
+ * every REQUIRED payload member is optional in practice. Cross-file
84
+ * `$ref`s are already inlined, so it needs no resolver.
85
+ */
86
+ export const PAYLOAD_SCHEMA = {
87
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
88
+ "$id": "https://trusttasks.org/spec/vtc/registry/sync-jobs/retry/0.2",
89
+ "title": "VTC Registry Sync Jobs Retry — payload",
90
+ "description": "Requeue a trust-registry reconciliation job — one the community's reconciler has abandoned, or one waiting out a retry backoff — so it is dispatched on the reconciler's next pass.",
91
+ "type": "object",
92
+ "additionalProperties": false,
93
+ "oneOf": [
94
+ {
95
+ "required": [
96
+ "jobId"
97
+ ],
98
+ "not": {
99
+ "anyOf": [
100
+ {
101
+ "required": [
102
+ "allFailed"
103
+ ]
104
+ },
105
+ {
106
+ "required": [
107
+ "allWaiting"
108
+ ]
109
+ }
110
+ ]
111
+ }
112
+ },
113
+ {
114
+ "required": [
115
+ "allFailed"
116
+ ],
117
+ "not": {
118
+ "anyOf": [
119
+ {
120
+ "required": [
121
+ "jobId"
122
+ ]
123
+ },
124
+ {
125
+ "required": [
126
+ "allWaiting"
127
+ ]
128
+ }
129
+ ]
130
+ }
131
+ },
132
+ {
133
+ "required": [
134
+ "allWaiting"
135
+ ],
136
+ "not": {
137
+ "anyOf": [
138
+ {
139
+ "required": [
140
+ "jobId"
141
+ ]
142
+ },
143
+ {
144
+ "required": [
145
+ "allFailed"
146
+ ]
147
+ }
148
+ ]
149
+ }
150
+ }
151
+ ],
152
+ "properties": {
153
+ "jobId": {
154
+ "type": "string",
155
+ "minLength": 1,
156
+ "description": "The single job to requeue, from `vtc/registry/sync-jobs/list`. It may be `failed`, or `pending` and waiting out a retry backoff."
157
+ },
158
+ "allFailed": {
159
+ "type": "boolean",
160
+ "const": true,
161
+ "description": "Requeue every job in the terminal `failed` state. Spelled as its own member rather than an absent `jobId` so that a client bug which drops the identifier cannot silently become a bulk operation."
162
+ },
163
+ "allWaiting": {
164
+ "type": "boolean",
165
+ "const": true,
166
+ "description": "Bring forward every `pending` job that is waiting out a retry backoff. Never a held job. Its own member for the same reason as `allFailed`, and distinct from it so that repairing a shared cause and hurrying a slow backoff stay two decisions."
167
+ },
168
+ "ext": {
169
+ "$ref": "#/$defs/Ext"
170
+ }
171
+ },
172
+ "$defs": {
173
+ "Requeued": {
174
+ "type": "object",
175
+ "additionalProperties": false,
176
+ "required": [
177
+ "jobId",
178
+ "from"
179
+ ],
180
+ "properties": {
181
+ "jobId": {
182
+ "type": "string",
183
+ "minLength": 1
184
+ },
185
+ "memberDid": {
186
+ "type": "string",
187
+ "minLength": 1,
188
+ "description": "The member whose record the requeued job carries."
189
+ },
190
+ "from": {
191
+ "type": "string",
192
+ "enum": [
193
+ "failed",
194
+ "pending"
195
+ ],
196
+ "description": "The state the job was in. `failed` — the reconciler had abandoned it. `pending` — it was waiting out a retry backoff and has been brought forward."
197
+ },
198
+ "ext": {
199
+ "$ref": "#/$defs/Ext"
200
+ }
201
+ }
202
+ },
203
+ "Skipped": {
204
+ "type": "object",
205
+ "additionalProperties": false,
206
+ "required": [
207
+ "jobId",
208
+ "reason"
209
+ ],
210
+ "properties": {
211
+ "jobId": {
212
+ "type": "string",
213
+ "minLength": 1
214
+ },
215
+ "reason": {
216
+ "type": "string",
217
+ "enum": [
218
+ "inFlight",
219
+ "held",
220
+ "notFound"
221
+ ],
222
+ "description": "`inFlight` — the reconciler is dispatching the job now, so requeueing it would dispatch the same mutation twice. `held` — the job is deliberately delayed, and the delay is the point; it is never brought forward. `notFound` — no such job; it may already have been dispatched, retried, discarded, or swept."
223
+ },
224
+ "ext": {
225
+ "$ref": "#/$defs/Ext"
226
+ }
227
+ }
228
+ },
229
+ "Response": {
230
+ "$anchor": "response",
231
+ "title": "VTC Registry Sync Jobs Retry — response payload",
232
+ "type": "object",
233
+ "additionalProperties": false,
234
+ "required": [
235
+ "requeued",
236
+ "skipped"
237
+ ],
238
+ "properties": {
239
+ "requeued": {
240
+ "type": "array",
241
+ "items": {
242
+ "$ref": "#/$defs/Requeued"
243
+ },
244
+ "description": "Jobs now scheduled for dispatch on the reconciler's next pass. Empty is a valid answer and is not an error."
245
+ },
246
+ "skipped": {
247
+ "type": "array",
248
+ "items": {
249
+ "$ref": "#/$defs/Skipped"
250
+ },
251
+ "description": "Jobs the maintainer declined to requeue, each with why. Reported rather than failing the task, so a bulk retry is not defeated by one ineligible row."
252
+ },
253
+ "ext": {
254
+ "$ref": "#/$defs/Ext"
255
+ }
256
+ }
257
+ },
258
+ "Ext": {
259
+ "title": "Ext",
260
+ "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.",
261
+ "type": "object",
262
+ "minProperties": 1,
263
+ "additionalProperties": true,
264
+ "propertyNames": {
265
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
266
+ }
267
+ }
268
+ }
269
+ } as const;
270
+
271
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
272
+ export const RESPONSE_PAYLOAD_SCHEMA = {
273
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
274
+ "$ref": "#/$defs/Response",
275
+ "$defs": {
276
+ "Requeued": {
277
+ "type": "object",
278
+ "additionalProperties": false,
279
+ "required": [
280
+ "jobId",
281
+ "from"
282
+ ],
283
+ "properties": {
284
+ "jobId": {
285
+ "type": "string",
286
+ "minLength": 1
287
+ },
288
+ "memberDid": {
289
+ "type": "string",
290
+ "minLength": 1,
291
+ "description": "The member whose record the requeued job carries."
292
+ },
293
+ "from": {
294
+ "type": "string",
295
+ "enum": [
296
+ "failed",
297
+ "pending"
298
+ ],
299
+ "description": "The state the job was in. `failed` — the reconciler had abandoned it. `pending` — it was waiting out a retry backoff and has been brought forward."
300
+ },
301
+ "ext": {
302
+ "$ref": "#/$defs/Ext"
303
+ }
304
+ }
305
+ },
306
+ "Skipped": {
307
+ "type": "object",
308
+ "additionalProperties": false,
309
+ "required": [
310
+ "jobId",
311
+ "reason"
312
+ ],
313
+ "properties": {
314
+ "jobId": {
315
+ "type": "string",
316
+ "minLength": 1
317
+ },
318
+ "reason": {
319
+ "type": "string",
320
+ "enum": [
321
+ "inFlight",
322
+ "held",
323
+ "notFound"
324
+ ],
325
+ "description": "`inFlight` — the reconciler is dispatching the job now, so requeueing it would dispatch the same mutation twice. `held` — the job is deliberately delayed, and the delay is the point; it is never brought forward. `notFound` — no such job; it may already have been dispatched, retried, discarded, or swept."
326
+ },
327
+ "ext": {
328
+ "$ref": "#/$defs/Ext"
329
+ }
330
+ }
331
+ },
332
+ "Response": {
333
+ "$anchor": "response",
334
+ "title": "VTC Registry Sync Jobs Retry — response payload",
335
+ "type": "object",
336
+ "additionalProperties": false,
337
+ "required": [
338
+ "requeued",
339
+ "skipped"
340
+ ],
341
+ "properties": {
342
+ "requeued": {
343
+ "type": "array",
344
+ "items": {
345
+ "$ref": "#/$defs/Requeued"
346
+ },
347
+ "description": "Jobs now scheduled for dispatch on the reconciler's next pass. Empty is a valid answer and is not an error."
348
+ },
349
+ "skipped": {
350
+ "type": "array",
351
+ "items": {
352
+ "$ref": "#/$defs/Skipped"
353
+ },
354
+ "description": "Jobs the maintainer declined to requeue, each with why. Reported rather than failing the task, so a bulk retry is not defeated by one ineligible row."
355
+ },
356
+ "ext": {
357
+ "$ref": "#/$defs/Ext"
358
+ }
359
+ }
360
+ },
361
+ "Ext": {
362
+ "title": "Ext",
363
+ "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.",
364
+ "type": "object",
365
+ "minProperties": 1,
366
+ "additionalProperties": true,
367
+ "propertyNames": {
368
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
369
+ }
370
+ }
371
+ }
372
+ } as const;
373
+
374
+ /**
375
+ * SPEC.md §7.2 policy for the request variant, from this specification's
376
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
377
+ * per-specification and cannot be derived from the document alone, and
378
+ * item 2 needs the schema this carries.
379
+ */
380
+ export const SPEC = {
381
+ typeUri: TYPE_URI,
382
+ isBearer: false,
383
+ isProofRequired: true,
384
+ isRecipientRequired: true,
385
+ isIssuedAtRequired: true,
386
+ payloadSchema: PAYLOAD_SCHEMA,
387
+ } as const;
388
+
389
+ /**
390
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
391
+ * tracks the *issuer* party's requirement because a response swaps the
392
+ * parties (§7.3 item 5).
393
+ */
394
+ export const RESPONSE_SPEC = {
395
+ typeUri: RESPONSE_TYPE_URI,
396
+ isBearer: false,
397
+ isProofRequired: true,
398
+ isRecipientRequired: true,
399
+ isIssuedAtRequired: true,
400
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
401
+ } as const;