@openvtc/trust-tasks 0.23.4 → 0.23.5

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,517 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/git-ns/bridge/job/list/0.2/payload.schema.json
4
+ */
5
+
6
+ import type { Did_GitNsV0_3 as Did, Ext, NamespaceId, RepoResource } from "../../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * The VTC's own queue state for the job, driven by git-ns/bridge/result/0.1 reports. `pending` — queued, not yet accepted. `accepted` — the bridge has taken it and not yet reported an outcome. `succeeded` — every step completed. `partial` — some steps completed and at least one did not. `failed` — no step completed. `cancelled` — withdrawn before the bridge accepted it.
11
+ */
12
+ export type JobState = "pending" | "accepted" | "succeeded" | "partial" | "failed" | "cancelled";
13
+ /**
14
+ * The VTC's identifier for the job, unique across the VTC's jobs. The same identifier git-ns/bridge/job (0.4 and 0.5) assigns and git-ns/bridge/result/0.1 reports against.
15
+ */
16
+ export type JobId = string;
17
+ /**
18
+ * What the job asks the bridge to do — the same eight kinds git-ns/bridge/job/0.5 defines. Kept as its own enum here, rather than a cross-file $ref, because job/0.5 declares its `kind` inline rather than as a named $def; the two lists change together.
19
+ */
20
+ export type JobKind =
21
+ | "projectRoles"
22
+ | "createRepo"
23
+ | "bootstrap"
24
+ | "archive"
25
+ | "inspect"
26
+ | "beginBind"
27
+ | "beginAccountLink"
28
+ | "closePullRequest";
29
+
30
+ /**
31
+ * A namespace's administrators list the bridge jobs queued or run for it — every namespace, for a community administrator — with each job's kind, state and last error. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.
32
+ */
33
+ export interface GitNamespacesListBridgeJobsPayload {
34
+ /**
35
+ * Only jobs in this namespace. Absent: every administered namespace.
36
+ */
37
+ namespace?: NamespaceId;
38
+ state?: JobState;
39
+ /**
40
+ * Opaque continuation token from a previous response's `nextCursor`. A consumer supplying a `cursor` MUST NOT also change `namespace` or `state` from the request that produced it — start a fresh query instead.
41
+ */
42
+ cursor?: string;
43
+ /**
44
+ * Maximum jobs to return in this page. A VTC clamps to 1..=500 (default 100).
45
+ */
46
+ limit?: number;
47
+ ext?: Ext;
48
+ }
49
+ /**
50
+ * The matching jobs, newest first.
51
+ */
52
+ export interface GitNamespacesListBridgeJobsResponsePayload {
53
+ /**
54
+ * Jobs matching `namespace` and `state`, newest (`createdAt`) first.
55
+ */
56
+ jobs: JobRow[];
57
+ /**
58
+ * Continuation token for the next page, or `null` when this is the last.
59
+ */
60
+ nextCursor?: string | null;
61
+ ext?: Ext;
62
+ }
63
+ /**
64
+ * One bridge job as the administrator's console shows it.
65
+ */
66
+ export interface JobRow {
67
+ jobId: JobId;
68
+ namespace: NamespaceId;
69
+ /**
70
+ * The bridge the job was dispatched to.
71
+ */
72
+ bridgeDid: Did;
73
+ kind: JobKind;
74
+ state: JobState;
75
+ /**
76
+ * The repository the job acts on. Absent for a namespace-wide `inspect` sweep or a job with no repository (`beginBind`, `beginAccountLink`).
77
+ */
78
+ repo?: RepoResource;
79
+ /**
80
+ * The pull request a `closePullRequest` job closes, in `repo` — the job's own `number`. Present for a `closePullRequest` job and absent for every other kind.
81
+ */
82
+ number?: number;
83
+ /**
84
+ * How many times the VTC has dispatched this job to a bridge.
85
+ */
86
+ attempts: number;
87
+ /**
88
+ * When the VTC queued the job.
89
+ */
90
+ createdAt: string;
91
+ /**
92
+ * When a bridge last accepted it. Absent while `state` is `pending` or `cancelled`.
93
+ */
94
+ acceptedAt?: string;
95
+ /**
96
+ * The bridge's last reported error, verbatim. Diagnostic prose for an administrator; a consumer MUST NOT parse it. Absent unless `state` is `partial` or `failed`.
97
+ */
98
+ lastError?: string;
99
+ }
100
+
101
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
102
+ export type { Did, Ext, NamespaceId, RepoResource };
103
+
104
+ /** Trust Task type URI. */
105
+ export const TYPE_URI = "https://trusttasks.org/spec/git-ns/bridge/job/list/0.2" as const;
106
+
107
+ /** Stable alias for this specification's request payload shape. */
108
+ export type Payload = GitNamespacesListBridgeJobsPayload;
109
+
110
+ /** Trust Task response type URI (request type URI + "#response"). */
111
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/git-ns/bridge/job/list/0.2#response" as const;
112
+
113
+ /** Stable alias for this specification's success-response payload shape. */
114
+ export type Response = GitNamespacesListBridgeJobsResponsePayload;
115
+
116
+ /**
117
+ * This specification's payload schema, as a value.
118
+ *
119
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
120
+ * rather than only as a `.json` file because TypeScript types are erased
121
+ * at runtime: without a schema a consumer has nothing to validate, and
122
+ * every REQUIRED payload member is optional in practice. Cross-file
123
+ * `$ref`s are already inlined, so it needs no resolver.
124
+ */
125
+ export const PAYLOAD_SCHEMA = {
126
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
127
+ "$id": "https://trusttasks.org/spec/git-ns/bridge/job/list/0.2",
128
+ "title": "Git Namespaces — List Bridge Jobs — payload",
129
+ "description": "A namespace's administrators list the bridge jobs queued or run for it — every namespace, for a community administrator — with each job's kind, state and last error. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.",
130
+ "type": "object",
131
+ "additionalProperties": false,
132
+ "properties": {
133
+ "namespace": {
134
+ "$ref": "#/$defs/NamespaceId",
135
+ "description": "Only jobs in this namespace. Absent: every administered namespace."
136
+ },
137
+ "state": {
138
+ "$ref": "#/$defs/JobState"
139
+ },
140
+ "cursor": {
141
+ "type": "string",
142
+ "description": "Opaque continuation token from a previous response's `nextCursor`. A consumer supplying a `cursor` MUST NOT also change `namespace` or `state` from the request that produced it — start a fresh query instead."
143
+ },
144
+ "limit": {
145
+ "type": "integer",
146
+ "minimum": 1,
147
+ "maximum": 500,
148
+ "description": "Maximum jobs to return in this page. A VTC clamps to 1..=500 (default 100)."
149
+ },
150
+ "ext": {
151
+ "$ref": "#/$defs/Ext"
152
+ }
153
+ },
154
+ "$defs": {
155
+ "JobId": {
156
+ "title": "JobId",
157
+ "type": "string",
158
+ "minLength": 1,
159
+ "maxLength": 128,
160
+ "description": "The VTC's identifier for the job, unique across the VTC's jobs. The same identifier git-ns/bridge/job (0.4 and 0.5) assigns and git-ns/bridge/result/0.1 reports against."
161
+ },
162
+ "JobKind": {
163
+ "title": "JobKind",
164
+ "type": "string",
165
+ "enum": [
166
+ "projectRoles",
167
+ "createRepo",
168
+ "bootstrap",
169
+ "archive",
170
+ "inspect",
171
+ "beginBind",
172
+ "beginAccountLink",
173
+ "closePullRequest"
174
+ ],
175
+ "description": "What the job asks the bridge to do — the same eight kinds git-ns/bridge/job/0.5 defines. Kept as its own enum here, rather than a cross-file $ref, because job/0.5 declares its `kind` inline rather than as a named $def; the two lists change together."
176
+ },
177
+ "JobState": {
178
+ "title": "JobState",
179
+ "type": "string",
180
+ "enum": [
181
+ "pending",
182
+ "accepted",
183
+ "succeeded",
184
+ "partial",
185
+ "failed",
186
+ "cancelled"
187
+ ],
188
+ "description": "The VTC's own queue state for the job, driven by git-ns/bridge/result/0.1 reports. `pending` — queued, not yet accepted. `accepted` — the bridge has taken it and not yet reported an outcome. `succeeded` — every step completed. `partial` — some steps completed and at least one did not. `failed` — no step completed. `cancelled` — withdrawn before the bridge accepted it."
189
+ },
190
+ "JobRow": {
191
+ "title": "JobRow",
192
+ "description": "One bridge job as the administrator's console shows it.",
193
+ "type": "object",
194
+ "additionalProperties": false,
195
+ "dependentRequired": {
196
+ "number": [
197
+ "repo"
198
+ ]
199
+ },
200
+ "required": [
201
+ "jobId",
202
+ "namespace",
203
+ "bridgeDid",
204
+ "kind",
205
+ "state",
206
+ "attempts",
207
+ "createdAt"
208
+ ],
209
+ "properties": {
210
+ "jobId": {
211
+ "$ref": "#/$defs/JobId"
212
+ },
213
+ "namespace": {
214
+ "$ref": "#/$defs/NamespaceId"
215
+ },
216
+ "bridgeDid": {
217
+ "$ref": "#/$defs/Did",
218
+ "description": "The bridge the job was dispatched to."
219
+ },
220
+ "kind": {
221
+ "$ref": "#/$defs/JobKind"
222
+ },
223
+ "state": {
224
+ "$ref": "#/$defs/JobState"
225
+ },
226
+ "repo": {
227
+ "$ref": "#/$defs/RepoResource",
228
+ "description": "The repository the job acts on. Absent for a namespace-wide `inspect` sweep or a job with no repository (`beginBind`, `beginAccountLink`)."
229
+ },
230
+ "number": {
231
+ "type": "integer",
232
+ "minimum": 1,
233
+ "description": "The pull request a `closePullRequest` job closes, in `repo` — the job's own `number`. Present for a `closePullRequest` job and absent for every other kind."
234
+ },
235
+ "attempts": {
236
+ "type": "integer",
237
+ "minimum": 0,
238
+ "description": "How many times the VTC has dispatched this job to a bridge."
239
+ },
240
+ "createdAt": {
241
+ "type": "string",
242
+ "format": "date-time",
243
+ "description": "When the VTC queued the job."
244
+ },
245
+ "acceptedAt": {
246
+ "type": "string",
247
+ "format": "date-time",
248
+ "description": "When a bridge last accepted it. Absent while `state` is `pending` or `cancelled`."
249
+ },
250
+ "lastError": {
251
+ "type": "string",
252
+ "maxLength": 1024,
253
+ "description": "The bridge's last reported error, verbatim. Diagnostic prose for an administrator; a consumer MUST NOT parse it. Absent unless `state` is `partial` or `failed`."
254
+ }
255
+ }
256
+ },
257
+ "Response": {
258
+ "$anchor": "response",
259
+ "title": "Git Namespaces — List Bridge Jobs — response payload",
260
+ "description": "The matching jobs, newest first.",
261
+ "type": "object",
262
+ "additionalProperties": false,
263
+ "required": [
264
+ "jobs"
265
+ ],
266
+ "properties": {
267
+ "jobs": {
268
+ "type": "array",
269
+ "items": {
270
+ "$ref": "#/$defs/JobRow"
271
+ },
272
+ "description": "Jobs matching `namespace` and `state`, newest (`createdAt`) first."
273
+ },
274
+ "nextCursor": {
275
+ "type": [
276
+ "string",
277
+ "null"
278
+ ],
279
+ "description": "Continuation token for the next page, or `null` when this is the last."
280
+ },
281
+ "ext": {
282
+ "$ref": "#/$defs/Ext"
283
+ }
284
+ }
285
+ },
286
+ "Ext": {
287
+ "title": "Ext",
288
+ "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.",
289
+ "type": "object",
290
+ "minProperties": 1,
291
+ "additionalProperties": true,
292
+ "propertyNames": {
293
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
294
+ }
295
+ },
296
+ "RepoResource": {
297
+ "title": "RepoResource",
298
+ "description": "A forge-qualified resource naming exactly one repository: `<forge-host>/<owner>/<repo>`, lowercase.",
299
+ "type": "string",
300
+ "maxLength": 455,
301
+ "pattern": "^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+/[a-z0-9_-][a-z0-9._-]{0,99}/[a-z0-9_-][a-z0-9._-]{0,99}$"
302
+ },
303
+ "Did": {
304
+ "title": "Did",
305
+ "description": "A bare DID in the W3C DID Core syntax (§3.1): `did:`, a method name of lowercase letters and digits, `:`, and a method-specific id of colon-separated segments drawn from `A-Z a-z 0-9 . - _` and percent-encoded octets, the last segment non-empty. A DID URL is not a DID: no path, query or fragment (`/`, `?`, `#`), so a verification-method id such as `did:key:z6Mk…#z6Mk…` is refused. Compared by exact string equality — no case folding or percent-decoding. A consumer MUST still treat the value as data: the pattern keeps shell metacharacters, whitespace and quotes out of the wire form, but it does not make a DID safe to splice into a command or markup.",
306
+ "type": "string",
307
+ "maxLength": 2048,
308
+ "pattern": "^did:[a-z0-9]+:(?:(?:[A-Za-z0-9._-]|%[0-9A-Fa-f]{2})*:)*(?:[A-Za-z0-9._-]|%[0-9A-Fa-f]{2})+$"
309
+ },
310
+ "NamespaceId": {
311
+ "title": "NamespaceId",
312
+ "description": "The VTC's opaque identifier for a namespace, assigned when it is bound. Stable for the life of the binding; never reused for another binding.",
313
+ "type": "string",
314
+ "minLength": 1,
315
+ "maxLength": 128
316
+ }
317
+ }
318
+ } as const;
319
+
320
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
321
+ export const RESPONSE_PAYLOAD_SCHEMA = {
322
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
323
+ "$ref": "#/$defs/Response",
324
+ "$defs": {
325
+ "JobId": {
326
+ "title": "JobId",
327
+ "type": "string",
328
+ "minLength": 1,
329
+ "maxLength": 128,
330
+ "description": "The VTC's identifier for the job, unique across the VTC's jobs. The same identifier git-ns/bridge/job (0.4 and 0.5) assigns and git-ns/bridge/result/0.1 reports against."
331
+ },
332
+ "JobKind": {
333
+ "title": "JobKind",
334
+ "type": "string",
335
+ "enum": [
336
+ "projectRoles",
337
+ "createRepo",
338
+ "bootstrap",
339
+ "archive",
340
+ "inspect",
341
+ "beginBind",
342
+ "beginAccountLink",
343
+ "closePullRequest"
344
+ ],
345
+ "description": "What the job asks the bridge to do — the same eight kinds git-ns/bridge/job/0.5 defines. Kept as its own enum here, rather than a cross-file $ref, because job/0.5 declares its `kind` inline rather than as a named $def; the two lists change together."
346
+ },
347
+ "JobState": {
348
+ "title": "JobState",
349
+ "type": "string",
350
+ "enum": [
351
+ "pending",
352
+ "accepted",
353
+ "succeeded",
354
+ "partial",
355
+ "failed",
356
+ "cancelled"
357
+ ],
358
+ "description": "The VTC's own queue state for the job, driven by git-ns/bridge/result/0.1 reports. `pending` — queued, not yet accepted. `accepted` — the bridge has taken it and not yet reported an outcome. `succeeded` — every step completed. `partial` — some steps completed and at least one did not. `failed` — no step completed. `cancelled` — withdrawn before the bridge accepted it."
359
+ },
360
+ "JobRow": {
361
+ "title": "JobRow",
362
+ "description": "One bridge job as the administrator's console shows it.",
363
+ "type": "object",
364
+ "additionalProperties": false,
365
+ "dependentRequired": {
366
+ "number": [
367
+ "repo"
368
+ ]
369
+ },
370
+ "required": [
371
+ "jobId",
372
+ "namespace",
373
+ "bridgeDid",
374
+ "kind",
375
+ "state",
376
+ "attempts",
377
+ "createdAt"
378
+ ],
379
+ "properties": {
380
+ "jobId": {
381
+ "$ref": "#/$defs/JobId"
382
+ },
383
+ "namespace": {
384
+ "$ref": "#/$defs/NamespaceId"
385
+ },
386
+ "bridgeDid": {
387
+ "$ref": "#/$defs/Did",
388
+ "description": "The bridge the job was dispatched to."
389
+ },
390
+ "kind": {
391
+ "$ref": "#/$defs/JobKind"
392
+ },
393
+ "state": {
394
+ "$ref": "#/$defs/JobState"
395
+ },
396
+ "repo": {
397
+ "$ref": "#/$defs/RepoResource",
398
+ "description": "The repository the job acts on. Absent for a namespace-wide `inspect` sweep or a job with no repository (`beginBind`, `beginAccountLink`)."
399
+ },
400
+ "number": {
401
+ "type": "integer",
402
+ "minimum": 1,
403
+ "description": "The pull request a `closePullRequest` job closes, in `repo` — the job's own `number`. Present for a `closePullRequest` job and absent for every other kind."
404
+ },
405
+ "attempts": {
406
+ "type": "integer",
407
+ "minimum": 0,
408
+ "description": "How many times the VTC has dispatched this job to a bridge."
409
+ },
410
+ "createdAt": {
411
+ "type": "string",
412
+ "format": "date-time",
413
+ "description": "When the VTC queued the job."
414
+ },
415
+ "acceptedAt": {
416
+ "type": "string",
417
+ "format": "date-time",
418
+ "description": "When a bridge last accepted it. Absent while `state` is `pending` or `cancelled`."
419
+ },
420
+ "lastError": {
421
+ "type": "string",
422
+ "maxLength": 1024,
423
+ "description": "The bridge's last reported error, verbatim. Diagnostic prose for an administrator; a consumer MUST NOT parse it. Absent unless `state` is `partial` or `failed`."
424
+ }
425
+ }
426
+ },
427
+ "Response": {
428
+ "$anchor": "response",
429
+ "title": "Git Namespaces — List Bridge Jobs — response payload",
430
+ "description": "The matching jobs, newest first.",
431
+ "type": "object",
432
+ "additionalProperties": false,
433
+ "required": [
434
+ "jobs"
435
+ ],
436
+ "properties": {
437
+ "jobs": {
438
+ "type": "array",
439
+ "items": {
440
+ "$ref": "#/$defs/JobRow"
441
+ },
442
+ "description": "Jobs matching `namespace` and `state`, newest (`createdAt`) first."
443
+ },
444
+ "nextCursor": {
445
+ "type": [
446
+ "string",
447
+ "null"
448
+ ],
449
+ "description": "Continuation token for the next page, or `null` when this is the last."
450
+ },
451
+ "ext": {
452
+ "$ref": "#/$defs/Ext"
453
+ }
454
+ }
455
+ },
456
+ "Ext": {
457
+ "title": "Ext",
458
+ "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.",
459
+ "type": "object",
460
+ "minProperties": 1,
461
+ "additionalProperties": true,
462
+ "propertyNames": {
463
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
464
+ }
465
+ },
466
+ "RepoResource": {
467
+ "title": "RepoResource",
468
+ "description": "A forge-qualified resource naming exactly one repository: `<forge-host>/<owner>/<repo>`, lowercase.",
469
+ "type": "string",
470
+ "maxLength": 455,
471
+ "pattern": "^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+/[a-z0-9_-][a-z0-9._-]{0,99}/[a-z0-9_-][a-z0-9._-]{0,99}$"
472
+ },
473
+ "Did": {
474
+ "title": "Did",
475
+ "description": "A bare DID in the W3C DID Core syntax (§3.1): `did:`, a method name of lowercase letters and digits, `:`, and a method-specific id of colon-separated segments drawn from `A-Z a-z 0-9 . - _` and percent-encoded octets, the last segment non-empty. A DID URL is not a DID: no path, query or fragment (`/`, `?`, `#`), so a verification-method id such as `did:key:z6Mk…#z6Mk…` is refused. Compared by exact string equality — no case folding or percent-decoding. A consumer MUST still treat the value as data: the pattern keeps shell metacharacters, whitespace and quotes out of the wire form, but it does not make a DID safe to splice into a command or markup.",
476
+ "type": "string",
477
+ "maxLength": 2048,
478
+ "pattern": "^did:[a-z0-9]+:(?:(?:[A-Za-z0-9._-]|%[0-9A-Fa-f]{2})*:)*(?:[A-Za-z0-9._-]|%[0-9A-Fa-f]{2})+$"
479
+ },
480
+ "NamespaceId": {
481
+ "title": "NamespaceId",
482
+ "description": "The VTC's opaque identifier for a namespace, assigned when it is bound. Stable for the life of the binding; never reused for another binding.",
483
+ "type": "string",
484
+ "minLength": 1,
485
+ "maxLength": 128
486
+ }
487
+ }
488
+ } as const;
489
+
490
+ /**
491
+ * SPEC.md §7.2 policy for the request variant, from this specification's
492
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
493
+ * per-specification and cannot be derived from the document alone, and
494
+ * item 2 needs the schema this carries.
495
+ */
496
+ export const SPEC = {
497
+ typeUri: TYPE_URI,
498
+ isBearer: false,
499
+ isProofRequired: true,
500
+ isRecipientRequired: true,
501
+ isIssuedAtRequired: false,
502
+ payloadSchema: PAYLOAD_SCHEMA,
503
+ } as const;
504
+
505
+ /**
506
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
507
+ * tracks the *issuer* party's requirement because a response swaps the
508
+ * parties (§7.3 item 5).
509
+ */
510
+ export const RESPONSE_SPEC = {
511
+ typeUri: RESPONSE_TYPE_URI,
512
+ isBearer: false,
513
+ isProofRequired: true,
514
+ isRecipientRequired: true,
515
+ isIssuedAtRequired: false,
516
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
517
+ } as const;
package/src/index.ts CHANGED
@@ -221,6 +221,7 @@ export * as GitNsBridgeJob_v0_3 from "./git-ns/bridge/job/0.3/payload.js";
221
221
  export * as GitNsBridgeJob_v0_4 from "./git-ns/bridge/job/0.4/payload.js";
222
222
  export * as GitNsBridgeJob_v0_5 from "./git-ns/bridge/job/0.5/payload.js";
223
223
  export * as GitNsBridgeJobList_v0_1 from "./git-ns/bridge/job/list/0.1/payload.js";
224
+ export * as GitNsBridgeJobList_v0_2 from "./git-ns/bridge/job/list/0.2/payload.js";
224
225
  export * as GitNsBridgeResult_v0_1 from "./git-ns/bridge/result/0.1/payload.js";
225
226
  export * as GitNsDriftResolve_v0_1 from "./git-ns/drift/resolve/0.1/payload.js";
226
227
  export * as GitNsDriftResolve_v0_2 from "./git-ns/drift/resolve/0.2/payload.js";