@opensoftware/contracts 1.6.0 → 1.8.0
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/README.md +5 -2
- package/dist/formats.js +2 -0
- package/dist/formats.js.map +1 -1
- package/dist/generated/types.d.ts +568 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js.map +1 -1
- package/events/asyncapi.yaml +42 -0
- package/events/issue-labeled/issue-labeled.schema.json +128 -0
- package/events/run-started/run-started.schema.json +139 -0
- package/factory-definition/factory-definition.schema.json +9 -0
- package/openapi/openapi.json +974 -132
- package/package.json +2 -2
- package/typespec/events.tsp +47 -0
- package/typespec/factory-definition.tsp +10 -0
- package/typespec/foreman-api.tsp +45 -0
- package/typespec/foreman.tsp +110 -0
- package/typespec/intake-api.tsp +40 -0
- package/typespec/intake.tsp +52 -0
- package/typespec/main.tsp +4 -0
package/README.md
CHANGED
|
@@ -44,13 +44,16 @@ Each format has one schema, generated from `typespec/`, and fixtures that CONTRA
|
|
|
44
44
|
| score | `score/score.schema.json` | `Score` | Subset of Langfuse's create-score request; factory fields in `metadata`. |
|
|
45
45
|
| gate record | `gate-record/gate-record.schema.json` | `GateRecord` | gatekeeper's signed approval record (ADR 0047). |
|
|
46
46
|
| sandbox spec | `sandbox-spec/sandbox-spec.schema.json` | `SandboxSpec` | The input of a sandbox adapter's `create` (ADR 0054). Closed objects: an unknown field is an error. |
|
|
47
|
-
| events | `events/<event>/<event>.schema.json`, `events/asyncapi.yaml` | `WorkReceived` … `
|
|
47
|
+
| events | `events/<event>/<event>.schema.json`, `events/asyncapi.yaml` | `WorkReceived`, `RunStarted` … `IssueLabeled` | CloudEvents 1.0, structured JSON. |
|
|
48
48
|
|
|
49
49
|
## HTTP APIs
|
|
50
50
|
|
|
51
51
|
`openapi/openapi.json` also holds the paths of the module APIs, from the operations in `typespec/` (ADR 0048). The
|
|
52
52
|
first is gatekeeper's: `POST /v1/gates` and `GET /v1/gates/{gateId}` with the models `GateRequest`, `GateView` and
|
|
53
|
-
`ApiProblem` (RFC 9457).
|
|
53
|
+
`ApiProblem` (RFC 9457). The second is intake's (ADR 0063): `POST /v1/work-items` and
|
|
54
|
+
`GET /v1/work-items/{workItemId}` with the models `WorkSubmission`, `WorkItemView` and `WorkRequest`. The third is the
|
|
55
|
+
foreman's (ADR 0067): `POST /v1/runs`, `GET /v1/runs/{runId}` and `POST /v1/runs/{runId}/signals` with the models
|
|
56
|
+
`RunView`, `StageView`, `CheckView` (ADR 0069) and `RunSignal`. `pnpm build` compiles the operations with the TypeSpec OpenAPI 3 emitter and copies their
|
|
54
57
|
paths next to the named models; an operation that uses a type that is no model fails the build. The package exports
|
|
55
58
|
the type `paths`, which types a client such as openapi-fetch.
|
|
56
59
|
|
package/dist/formats.js
CHANGED
|
@@ -9,6 +9,7 @@ export const FORMATS = [
|
|
|
9
9
|
format("gate-record", "GateRecord"),
|
|
10
10
|
format("sandbox-spec", "SandboxSpec"),
|
|
11
11
|
format("events/work-received", "WorkReceived"),
|
|
12
|
+
format("events/run-started", "RunStarted"),
|
|
12
13
|
format("events/run-completed", "RunCompleted"),
|
|
13
14
|
format("events/gate-requested", "GateRequested"),
|
|
14
15
|
format("events/gate-decided", "GateDecided"),
|
|
@@ -16,6 +17,7 @@ export const FORMATS = [
|
|
|
16
17
|
format("events/pr-opened", "PrOpened"),
|
|
17
18
|
format("events/pr-reviewed", "PrReviewed"),
|
|
18
19
|
format("events/pr-closed", "PrClosed"),
|
|
20
|
+
format("events/issue-labeled", "IssueLabeled"),
|
|
19
21
|
];
|
|
20
22
|
export function formatNamed(name) {
|
|
21
23
|
return FORMATS.find((candidate) => candidate.name === name);
|
package/dist/formats.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formats.js","sourceRoot":"","sources":["../src/formats.ts"],"names":[],"mappings":"AAAA,2GAA2G;AAW3G,MAAM,MAAM,GAAG,CAAC,IAAY,EAAE,KAAa,EAAU,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAY,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;AAEjH,MAAM,CAAC,MAAM,OAAO,GAAsB;IACxC,MAAM,CAAC,oBAAoB,EAAE,mBAAmB,CAAC;IACjD,MAAM,CAAC,WAAW,EAAE,UAAU,CAAC;IAC/B,MAAM,CAAC,YAAY,EAAE,WAAW,CAAC;IACjC,MAAM,CAAC,iBAAiB,EAAE,kBAAkB,CAAC;IAC7C,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC;IACxB,MAAM,CAAC,aAAa,EAAE,YAAY,CAAC;IACnC,MAAM,CAAC,cAAc,EAAE,aAAa,CAAC;IACrC,MAAM,CAAC,sBAAsB,EAAE,cAAc,CAAC;IAC9C,MAAM,CAAC,sBAAsB,EAAE,cAAc,CAAC;IAC9C,MAAM,CAAC,uBAAuB,EAAE,eAAe,CAAC;IAChD,MAAM,CAAC,qBAAqB,EAAE,aAAa,CAAC;IAC5C,MAAM,CAAC,uBAAuB,EAAE,eAAe,CAAC;IAChD,MAAM,CAAC,kBAAkB,EAAE,UAAU,CAAC;IACtC,MAAM,CAAC,oBAAoB,EAAE,YAAY,CAAC;IAC1C,MAAM,CAAC,kBAAkB,EAAE,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"formats.js","sourceRoot":"","sources":["../src/formats.ts"],"names":[],"mappings":"AAAA,2GAA2G;AAW3G,MAAM,MAAM,GAAG,CAAC,IAAY,EAAE,KAAa,EAAU,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAY,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;AAEjH,MAAM,CAAC,MAAM,OAAO,GAAsB;IACxC,MAAM,CAAC,oBAAoB,EAAE,mBAAmB,CAAC;IACjD,MAAM,CAAC,WAAW,EAAE,UAAU,CAAC;IAC/B,MAAM,CAAC,YAAY,EAAE,WAAW,CAAC;IACjC,MAAM,CAAC,iBAAiB,EAAE,kBAAkB,CAAC;IAC7C,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC;IACxB,MAAM,CAAC,aAAa,EAAE,YAAY,CAAC;IACnC,MAAM,CAAC,cAAc,EAAE,aAAa,CAAC;IACrC,MAAM,CAAC,sBAAsB,EAAE,cAAc,CAAC;IAC9C,MAAM,CAAC,oBAAoB,EAAE,YAAY,CAAC;IAC1C,MAAM,CAAC,sBAAsB,EAAE,cAAc,CAAC;IAC9C,MAAM,CAAC,uBAAuB,EAAE,eAAe,CAAC;IAChD,MAAM,CAAC,qBAAqB,EAAE,aAAa,CAAC;IAC5C,MAAM,CAAC,uBAAuB,EAAE,eAAe,CAAC;IAChD,MAAM,CAAC,kBAAkB,EAAE,UAAU,CAAC;IACtC,MAAM,CAAC,oBAAoB,EAAE,YAAY,CAAC;IAC1C,MAAM,CAAC,kBAAkB,EAAE,UAAU,CAAC;IACtC,MAAM,CAAC,sBAAsB,EAAE,cAAc,CAAC;CAC/C,CAAC;AAEF,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AAC9D,CAAC"}
|
|
@@ -33,6 +33,92 @@ export type paths = {
|
|
|
33
33
|
patch?: never;
|
|
34
34
|
trace?: never;
|
|
35
35
|
};
|
|
36
|
+
"/v1/runs": {
|
|
37
|
+
parameters: {
|
|
38
|
+
query?: never;
|
|
39
|
+
header?: never;
|
|
40
|
+
path?: never;
|
|
41
|
+
cookie?: never;
|
|
42
|
+
};
|
|
43
|
+
get?: never;
|
|
44
|
+
put?: never;
|
|
45
|
+
/** @description Start a run of the factory's workflow for a work item. The same work item again answers the run it started. */
|
|
46
|
+
post: operations["ForemanApi_startRun"];
|
|
47
|
+
delete?: never;
|
|
48
|
+
options?: never;
|
|
49
|
+
head?: never;
|
|
50
|
+
patch?: never;
|
|
51
|
+
trace?: never;
|
|
52
|
+
};
|
|
53
|
+
"/v1/runs/{runId}": {
|
|
54
|
+
parameters: {
|
|
55
|
+
query?: never;
|
|
56
|
+
header?: never;
|
|
57
|
+
path?: never;
|
|
58
|
+
cookie?: never;
|
|
59
|
+
};
|
|
60
|
+
/** @description A run: its state and the state of each stage. */
|
|
61
|
+
get: operations["ForemanApi_getRun"];
|
|
62
|
+
put?: never;
|
|
63
|
+
post?: never;
|
|
64
|
+
delete?: never;
|
|
65
|
+
options?: never;
|
|
66
|
+
head?: never;
|
|
67
|
+
patch?: never;
|
|
68
|
+
trace?: never;
|
|
69
|
+
};
|
|
70
|
+
"/v1/runs/{runId}/signals": {
|
|
71
|
+
parameters: {
|
|
72
|
+
query?: never;
|
|
73
|
+
header?: never;
|
|
74
|
+
path?: never;
|
|
75
|
+
cookie?: never;
|
|
76
|
+
};
|
|
77
|
+
get?: never;
|
|
78
|
+
put?: never;
|
|
79
|
+
/** @description Steer the running stage's agent, or cancel the run. */
|
|
80
|
+
post: operations["ForemanApi_signalRun"];
|
|
81
|
+
delete?: never;
|
|
82
|
+
options?: never;
|
|
83
|
+
head?: never;
|
|
84
|
+
patch?: never;
|
|
85
|
+
trace?: never;
|
|
86
|
+
};
|
|
87
|
+
"/v1/work-items": {
|
|
88
|
+
parameters: {
|
|
89
|
+
query?: never;
|
|
90
|
+
header?: never;
|
|
91
|
+
path?: never;
|
|
92
|
+
cookie?: never;
|
|
93
|
+
};
|
|
94
|
+
/** @description The work item with this dedupe key, such as an issue's link (ADR 0065). */
|
|
95
|
+
get: operations["IntakeApi_findWorkItem"];
|
|
96
|
+
put?: never;
|
|
97
|
+
/** @description Put work into the inbox. A submission with the dedupe key of a work item answers that work item. */
|
|
98
|
+
post: operations["IntakeApi_submitWork"];
|
|
99
|
+
delete?: never;
|
|
100
|
+
options?: never;
|
|
101
|
+
head?: never;
|
|
102
|
+
patch?: never;
|
|
103
|
+
trace?: never;
|
|
104
|
+
};
|
|
105
|
+
"/v1/work-items/{workItemId}": {
|
|
106
|
+
parameters: {
|
|
107
|
+
query?: never;
|
|
108
|
+
header?: never;
|
|
109
|
+
path?: never;
|
|
110
|
+
cookie?: never;
|
|
111
|
+
};
|
|
112
|
+
/** @description A work item, its status and every request that asked for it. */
|
|
113
|
+
get: operations["IntakeApi_getWorkItem"];
|
|
114
|
+
put?: never;
|
|
115
|
+
post?: never;
|
|
116
|
+
delete?: never;
|
|
117
|
+
options?: never;
|
|
118
|
+
head?: never;
|
|
119
|
+
patch?: never;
|
|
120
|
+
trace?: never;
|
|
121
|
+
};
|
|
36
122
|
};
|
|
37
123
|
export type webhooks = Record<string, never>;
|
|
38
124
|
export type components = {
|
|
@@ -107,6 +193,18 @@ export type components = {
|
|
|
107
193
|
};
|
|
108
194
|
/** @description A path inside the bundle: relative, forward slashes, no "..". */
|
|
109
195
|
BundlePath: string;
|
|
196
|
+
/** @description The name of a check on the forge: a commit status context. */
|
|
197
|
+
CheckName: string;
|
|
198
|
+
/**
|
|
199
|
+
* @description foreman: the state of a check on the forge (forge port).
|
|
200
|
+
* @enum {string}
|
|
201
|
+
*/
|
|
202
|
+
CheckState: "pending" | "success" | "failure" | "error";
|
|
203
|
+
/** @description foreman: a check that a stage waits for, as the foreman last read it on the run's pull request (ADR 0069). */
|
|
204
|
+
CheckView: {
|
|
205
|
+
name: components["schemas"]["CheckName"];
|
|
206
|
+
state: components["schemas"]["CheckState"];
|
|
207
|
+
};
|
|
110
208
|
/** @description A Git commit hash, abbreviated (7+) or full. The factory version is the commit of the factory definition. */
|
|
111
209
|
CommitHash: string;
|
|
112
210
|
/**
|
|
@@ -332,6 +430,46 @@ export type components = {
|
|
|
332
430
|
Hostname: string;
|
|
333
431
|
/** @description An identifier chosen by the producer. ULIDs are recommended; consumers treat it as opaque. */
|
|
334
432
|
Identifier: string;
|
|
433
|
+
/** @description forge adapters: a label was added to an issue. */
|
|
434
|
+
IssueLabeled: {
|
|
435
|
+
/** @constant */
|
|
436
|
+
specversion: "1.0";
|
|
437
|
+
/** @description Unique per source. A consumer that sees the same source and id twice handles the event once. */
|
|
438
|
+
id: components["schemas"]["Identifier"];
|
|
439
|
+
/** @description The producing module, for example "/osf/intake". */
|
|
440
|
+
source: string;
|
|
441
|
+
/** @constant */
|
|
442
|
+
type: "issue.labeled@v1";
|
|
443
|
+
/** Format: date-time */
|
|
444
|
+
time: string;
|
|
445
|
+
/** @description The ID of the thing the event is about: work item, gate, run, score or pull request. */
|
|
446
|
+
subject?: string;
|
|
447
|
+
/** @constant */
|
|
448
|
+
datacontenttype?: "application/json";
|
|
449
|
+
/** Format: uri */
|
|
450
|
+
dataschema?: string;
|
|
451
|
+
/** @description W3C trace context (CloudEvents distributed tracing extension). */
|
|
452
|
+
traceparent?: string;
|
|
453
|
+
data: components["schemas"]["IssueLabeledData"];
|
|
454
|
+
};
|
|
455
|
+
IssueLabeledData: {
|
|
456
|
+
/**
|
|
457
|
+
* Format: uri
|
|
458
|
+
* @description The issue.
|
|
459
|
+
*/
|
|
460
|
+
url: string;
|
|
461
|
+
/** Format: uri */
|
|
462
|
+
repository: string;
|
|
463
|
+
number: number;
|
|
464
|
+
title: string;
|
|
465
|
+
body?: string;
|
|
466
|
+
/** @description The person who opened the issue. */
|
|
467
|
+
author: components["schemas"]["Actor"];
|
|
468
|
+
/** @description Every label of the issue after the change. */
|
|
469
|
+
labels: string[];
|
|
470
|
+
/** @description The label that was added, when the forge names it. */
|
|
471
|
+
label?: string;
|
|
472
|
+
};
|
|
335
473
|
Link: {
|
|
336
474
|
/** Format: uri */
|
|
337
475
|
url: string;
|
|
@@ -569,6 +707,17 @@ export type components = {
|
|
|
569
707
|
"osf.harness.name": components["schemas"]["Name"];
|
|
570
708
|
"osf.harness.version"?: string;
|
|
571
709
|
};
|
|
710
|
+
/** @description foreman: a signal to a run: "steer" with a message for the running stage's agent, or "cancel". */
|
|
711
|
+
RunSignal: {
|
|
712
|
+
type: components["schemas"]["RunSignalType"];
|
|
713
|
+
/** @description The steering message. Required with "steer". */
|
|
714
|
+
message?: string;
|
|
715
|
+
};
|
|
716
|
+
/**
|
|
717
|
+
* @description foreman: what a person tells a run.
|
|
718
|
+
* @enum {string}
|
|
719
|
+
*/
|
|
720
|
+
RunSignalType: "steer" | "cancel";
|
|
572
721
|
/** @description Attributes of the root span of the run. GenAI names where a convention exists. */
|
|
573
722
|
RunSpan: {
|
|
574
723
|
/** @constant */
|
|
@@ -603,6 +752,68 @@ export type components = {
|
|
|
603
752
|
*/
|
|
604
753
|
"osf.agent_trace.uri"?: string;
|
|
605
754
|
};
|
|
755
|
+
/** @description foreman: a run started (ADR 0067). */
|
|
756
|
+
RunStarted: {
|
|
757
|
+
/** @constant */
|
|
758
|
+
specversion: "1.0";
|
|
759
|
+
/** @description Unique per source. A consumer that sees the same source and id twice handles the event once. */
|
|
760
|
+
id: components["schemas"]["Identifier"];
|
|
761
|
+
/** @description The producing module, for example "/osf/intake". */
|
|
762
|
+
source: string;
|
|
763
|
+
/** @constant */
|
|
764
|
+
type: "run.started@v1";
|
|
765
|
+
/** Format: date-time */
|
|
766
|
+
time: string;
|
|
767
|
+
/** @description The ID of the thing the event is about: work item, gate, run, score or pull request. */
|
|
768
|
+
subject?: string;
|
|
769
|
+
/** @constant */
|
|
770
|
+
datacontenttype?: "application/json";
|
|
771
|
+
/** Format: uri */
|
|
772
|
+
dataschema?: string;
|
|
773
|
+
/** @description W3C trace context (CloudEvents distributed tracing extension). */
|
|
774
|
+
traceparent?: string;
|
|
775
|
+
data: components["schemas"]["RunStartedData"];
|
|
776
|
+
};
|
|
777
|
+
RunStartedData: {
|
|
778
|
+
runId: components["schemas"]["Identifier"];
|
|
779
|
+
workItemId: components["schemas"]["Identifier"];
|
|
780
|
+
/** @description The name of the factory. */
|
|
781
|
+
factory: components["schemas"]["Name"];
|
|
782
|
+
factoryVersion: components["schemas"]["CommitHash"];
|
|
783
|
+
/** @description The stages of the run's workflow, in order. */
|
|
784
|
+
stages: components["schemas"]["Name"][];
|
|
785
|
+
/** Format: date-time */
|
|
786
|
+
startedAt: string;
|
|
787
|
+
requester: components["schemas"]["Actor"];
|
|
788
|
+
source: components["schemas"]["Name"];
|
|
789
|
+
};
|
|
790
|
+
/**
|
|
791
|
+
* @description foreman: where a run stands (vision scenario ORCH-008).
|
|
792
|
+
* @enum {string}
|
|
793
|
+
*/
|
|
794
|
+
RunState: "running" | "blocked" | "complete" | "failed" | "cancelled";
|
|
795
|
+
/** @description foreman: a run of the factory's workflow for one work item, as the HTTP API shows it (ADR 0067). */
|
|
796
|
+
RunView: {
|
|
797
|
+
/** @description "run_" and 20 hex digits of the SHA-256 of the work item's ID. */
|
|
798
|
+
runId: string;
|
|
799
|
+
workItem: components["schemas"]["WorkItem"];
|
|
800
|
+
/** @description The name of the factory. */
|
|
801
|
+
factory: components["schemas"]["Name"];
|
|
802
|
+
/** @description The commit of the factory definition the run started with. */
|
|
803
|
+
factoryVersion: components["schemas"]["CommitHash"];
|
|
804
|
+
state: components["schemas"]["RunState"];
|
|
805
|
+
/**
|
|
806
|
+
* Format: uri
|
|
807
|
+
* @description The last pull request link that an agent of the run wrote (ADR 0069).
|
|
808
|
+
*/
|
|
809
|
+
pullRequest?: string;
|
|
810
|
+
/** Format: date-time */
|
|
811
|
+
startedAt: string;
|
|
812
|
+
/** Format: date-time */
|
|
813
|
+
endedAt?: string;
|
|
814
|
+
/** @description The stages of the workflow, in order. */
|
|
815
|
+
stages: components["schemas"]["StageView"][];
|
|
816
|
+
};
|
|
606
817
|
Sandbox: {
|
|
607
818
|
/** @description Sandbox template name, for example "node-24". */
|
|
608
819
|
template: string;
|
|
@@ -737,9 +948,38 @@ export type components = {
|
|
|
737
948
|
agent?: components["schemas"]["Name"];
|
|
738
949
|
/** @description The stage waits for a decision before it starts. */
|
|
739
950
|
gate?: components["schemas"]["Gate"];
|
|
951
|
+
/**
|
|
952
|
+
* @description Checks that must succeed on the run's pull request before the stage starts, by their names on the forge, for
|
|
953
|
+
* example "verify" (ADR 0069).
|
|
954
|
+
*/
|
|
955
|
+
checks?: components["schemas"]["CheckName"][];
|
|
740
956
|
/** @description Whether the stage must produce an evidence bundle. */
|
|
741
957
|
evidence?: components["schemas"]["EvidenceRequirement"];
|
|
742
958
|
};
|
|
959
|
+
/**
|
|
960
|
+
* @description foreman: where a stage of a run stands.
|
|
961
|
+
* @enum {string}
|
|
962
|
+
*/
|
|
963
|
+
StageState: "pending" | "blocked" | "running" | "succeeded" | "failed" | "rejected" | "cancelled";
|
|
964
|
+
/** @description foreman: one stage of a run (ADR 0067). */
|
|
965
|
+
StageView: {
|
|
966
|
+
stage: components["schemas"]["Name"];
|
|
967
|
+
/** @description The agent that runs the stage. */
|
|
968
|
+
agent: components["schemas"]["Name"];
|
|
969
|
+
state: components["schemas"]["StageState"];
|
|
970
|
+
/** @description The harness session of the stage's agent, once it started. */
|
|
971
|
+
sessionId?: string;
|
|
972
|
+
/** @description The gate that decides whether the stage starts, once it was requested. */
|
|
973
|
+
gateId?: string;
|
|
974
|
+
/** @description The checks the stage waits for, once the foreman read them (ADR 0069). */
|
|
975
|
+
checks?: components["schemas"]["CheckView"][];
|
|
976
|
+
/** @description Why the stage ended without success, when the foreman knows. */
|
|
977
|
+
reason?: string;
|
|
978
|
+
/** Format: date-time */
|
|
979
|
+
startedAt?: string;
|
|
980
|
+
/** Format: date-time */
|
|
981
|
+
endedAt?: string;
|
|
982
|
+
};
|
|
743
983
|
/** @description An OpenTelemetry trace ID: 32 lowercase hex characters. */
|
|
744
984
|
TraceId: string;
|
|
745
985
|
/** @enum {string} */
|
|
@@ -765,8 +1005,23 @@ export type components = {
|
|
|
765
1005
|
/** @description Related material: an error report, a change, a document. */
|
|
766
1006
|
links?: components["schemas"]["Link"][];
|
|
767
1007
|
};
|
|
1008
|
+
/**
|
|
1009
|
+
* @description Where a work item stands.
|
|
1010
|
+
* @enum {string}
|
|
1011
|
+
*/
|
|
1012
|
+
WorkItemStatus: "received";
|
|
768
1013
|
/** @enum {string} */
|
|
769
1014
|
WorkItemType: "idea" | "bug" | "task" | "automation";
|
|
1015
|
+
/** @description intake: a work item as the HTTP API shows it (ADR 0063). */
|
|
1016
|
+
WorkItemView: {
|
|
1017
|
+
/** @description Its ID is "wi_" and 20 hex digits of the SHA-256 of its dedupe key. */
|
|
1018
|
+
workItem: components["schemas"]["WorkItem"];
|
|
1019
|
+
status: components["schemas"]["WorkItemStatus"];
|
|
1020
|
+
/** Format: date-time */
|
|
1021
|
+
receivedAt: string;
|
|
1022
|
+
/** @description Every submission that asked for the work item, oldest first; one per origin. */
|
|
1023
|
+
requests: components["schemas"]["WorkRequest"][];
|
|
1024
|
+
};
|
|
770
1025
|
/** @description intake: a work item was accepted. */
|
|
771
1026
|
WorkReceived: {
|
|
772
1027
|
/** @constant */
|
|
@@ -789,6 +1044,26 @@ export type components = {
|
|
|
789
1044
|
traceparent?: string;
|
|
790
1045
|
data: components["schemas"]["WorkItem"];
|
|
791
1046
|
};
|
|
1047
|
+
/** @description intake: one submission that asked for a work item. */
|
|
1048
|
+
WorkRequest: {
|
|
1049
|
+
requester: components["schemas"]["Actor"];
|
|
1050
|
+
origin: components["schemas"]["Origin"];
|
|
1051
|
+
/** Format: date-time */
|
|
1052
|
+
receivedAt: string;
|
|
1053
|
+
};
|
|
1054
|
+
/** @description intake: work to put into the inbox, a work item without its ID (ADR 0063). */
|
|
1055
|
+
WorkSubmission: {
|
|
1056
|
+
/** @description Default: task. */
|
|
1057
|
+
type?: components["schemas"]["WorkItemType"];
|
|
1058
|
+
title: string;
|
|
1059
|
+
description?: string;
|
|
1060
|
+
requester: components["schemas"]["Actor"];
|
|
1061
|
+
origin: components["schemas"]["Origin"];
|
|
1062
|
+
/** @description Requests with the same key become one work item. Default: the origin's url, else "<source>:<externalId>". */
|
|
1063
|
+
dedupeKey?: string;
|
|
1064
|
+
surface?: string;
|
|
1065
|
+
links?: components["schemas"]["Link"][];
|
|
1066
|
+
};
|
|
792
1067
|
};
|
|
793
1068
|
responses: never;
|
|
794
1069
|
parameters: never;
|
|
@@ -889,4 +1164,297 @@ export interface operations {
|
|
|
889
1164
|
};
|
|
890
1165
|
};
|
|
891
1166
|
};
|
|
1167
|
+
ForemanApi_startRun: {
|
|
1168
|
+
parameters: {
|
|
1169
|
+
query?: never;
|
|
1170
|
+
header?: never;
|
|
1171
|
+
path?: never;
|
|
1172
|
+
cookie?: never;
|
|
1173
|
+
};
|
|
1174
|
+
requestBody: {
|
|
1175
|
+
content: {
|
|
1176
|
+
"application/json": components["schemas"]["WorkItem"];
|
|
1177
|
+
};
|
|
1178
|
+
};
|
|
1179
|
+
responses: {
|
|
1180
|
+
/** @description The request has succeeded. */
|
|
1181
|
+
200: {
|
|
1182
|
+
headers: {
|
|
1183
|
+
[name: string]: unknown;
|
|
1184
|
+
};
|
|
1185
|
+
content: {
|
|
1186
|
+
"application/json": components["schemas"]["RunView"];
|
|
1187
|
+
};
|
|
1188
|
+
};
|
|
1189
|
+
/** @description The request has succeeded and a new resource has been created as a result. */
|
|
1190
|
+
201: {
|
|
1191
|
+
headers: {
|
|
1192
|
+
[name: string]: unknown;
|
|
1193
|
+
};
|
|
1194
|
+
content: {
|
|
1195
|
+
"application/json": components["schemas"]["RunView"];
|
|
1196
|
+
};
|
|
1197
|
+
};
|
|
1198
|
+
/** @description The server could not understand the request due to invalid syntax. */
|
|
1199
|
+
400: {
|
|
1200
|
+
headers: {
|
|
1201
|
+
[name: string]: unknown;
|
|
1202
|
+
};
|
|
1203
|
+
content: {
|
|
1204
|
+
"application/problem+json": components["schemas"]["ApiProblem"];
|
|
1205
|
+
};
|
|
1206
|
+
};
|
|
1207
|
+
/** @description Access is unauthorized. */
|
|
1208
|
+
401: {
|
|
1209
|
+
headers: {
|
|
1210
|
+
[name: string]: unknown;
|
|
1211
|
+
};
|
|
1212
|
+
content: {
|
|
1213
|
+
"application/problem+json": components["schemas"]["ApiProblem"];
|
|
1214
|
+
};
|
|
1215
|
+
};
|
|
1216
|
+
};
|
|
1217
|
+
};
|
|
1218
|
+
ForemanApi_getRun: {
|
|
1219
|
+
parameters: {
|
|
1220
|
+
query?: never;
|
|
1221
|
+
header?: never;
|
|
1222
|
+
path: {
|
|
1223
|
+
runId: string;
|
|
1224
|
+
};
|
|
1225
|
+
cookie?: never;
|
|
1226
|
+
};
|
|
1227
|
+
requestBody?: never;
|
|
1228
|
+
responses: {
|
|
1229
|
+
/** @description The request has succeeded. */
|
|
1230
|
+
200: {
|
|
1231
|
+
headers: {
|
|
1232
|
+
[name: string]: unknown;
|
|
1233
|
+
};
|
|
1234
|
+
content: {
|
|
1235
|
+
"application/json": components["schemas"]["RunView"];
|
|
1236
|
+
};
|
|
1237
|
+
};
|
|
1238
|
+
/** @description Access is unauthorized. */
|
|
1239
|
+
401: {
|
|
1240
|
+
headers: {
|
|
1241
|
+
[name: string]: unknown;
|
|
1242
|
+
};
|
|
1243
|
+
content: {
|
|
1244
|
+
"application/problem+json": components["schemas"]["ApiProblem"];
|
|
1245
|
+
};
|
|
1246
|
+
};
|
|
1247
|
+
/** @description The server cannot find the requested resource. */
|
|
1248
|
+
404: {
|
|
1249
|
+
headers: {
|
|
1250
|
+
[name: string]: unknown;
|
|
1251
|
+
};
|
|
1252
|
+
content: {
|
|
1253
|
+
"application/problem+json": components["schemas"]["ApiProblem"];
|
|
1254
|
+
};
|
|
1255
|
+
};
|
|
1256
|
+
};
|
|
1257
|
+
};
|
|
1258
|
+
ForemanApi_signalRun: {
|
|
1259
|
+
parameters: {
|
|
1260
|
+
query?: never;
|
|
1261
|
+
header?: never;
|
|
1262
|
+
path: {
|
|
1263
|
+
runId: string;
|
|
1264
|
+
};
|
|
1265
|
+
cookie?: never;
|
|
1266
|
+
};
|
|
1267
|
+
requestBody: {
|
|
1268
|
+
content: {
|
|
1269
|
+
"application/json": components["schemas"]["RunSignal"];
|
|
1270
|
+
};
|
|
1271
|
+
};
|
|
1272
|
+
responses: {
|
|
1273
|
+
/** @description The request has been accepted for processing, but processing has not yet completed. */
|
|
1274
|
+
202: {
|
|
1275
|
+
headers: {
|
|
1276
|
+
[name: string]: unknown;
|
|
1277
|
+
};
|
|
1278
|
+
content: {
|
|
1279
|
+
"application/json": components["schemas"]["RunView"];
|
|
1280
|
+
};
|
|
1281
|
+
};
|
|
1282
|
+
/** @description The server could not understand the request due to invalid syntax. */
|
|
1283
|
+
400: {
|
|
1284
|
+
headers: {
|
|
1285
|
+
[name: string]: unknown;
|
|
1286
|
+
};
|
|
1287
|
+
content: {
|
|
1288
|
+
"application/problem+json": components["schemas"]["ApiProblem"];
|
|
1289
|
+
};
|
|
1290
|
+
};
|
|
1291
|
+
/** @description Access is unauthorized. */
|
|
1292
|
+
401: {
|
|
1293
|
+
headers: {
|
|
1294
|
+
[name: string]: unknown;
|
|
1295
|
+
};
|
|
1296
|
+
content: {
|
|
1297
|
+
"application/problem+json": components["schemas"]["ApiProblem"];
|
|
1298
|
+
};
|
|
1299
|
+
};
|
|
1300
|
+
/** @description The server cannot find the requested resource. */
|
|
1301
|
+
404: {
|
|
1302
|
+
headers: {
|
|
1303
|
+
[name: string]: unknown;
|
|
1304
|
+
};
|
|
1305
|
+
content: {
|
|
1306
|
+
"application/problem+json": components["schemas"]["ApiProblem"];
|
|
1307
|
+
};
|
|
1308
|
+
};
|
|
1309
|
+
/** @description The request conflicts with the current state of the server. */
|
|
1310
|
+
409: {
|
|
1311
|
+
headers: {
|
|
1312
|
+
[name: string]: unknown;
|
|
1313
|
+
};
|
|
1314
|
+
content: {
|
|
1315
|
+
"application/problem+json": components["schemas"]["ApiProblem"];
|
|
1316
|
+
};
|
|
1317
|
+
};
|
|
1318
|
+
};
|
|
1319
|
+
};
|
|
1320
|
+
IntakeApi_findWorkItem: {
|
|
1321
|
+
parameters: {
|
|
1322
|
+
query: {
|
|
1323
|
+
dedupeKey: string;
|
|
1324
|
+
};
|
|
1325
|
+
header?: never;
|
|
1326
|
+
path?: never;
|
|
1327
|
+
cookie?: never;
|
|
1328
|
+
};
|
|
1329
|
+
requestBody?: never;
|
|
1330
|
+
responses: {
|
|
1331
|
+
/** @description The request has succeeded. */
|
|
1332
|
+
200: {
|
|
1333
|
+
headers: {
|
|
1334
|
+
[name: string]: unknown;
|
|
1335
|
+
};
|
|
1336
|
+
content: {
|
|
1337
|
+
"application/json": components["schemas"]["WorkItemView"];
|
|
1338
|
+
};
|
|
1339
|
+
};
|
|
1340
|
+
/** @description The server could not understand the request due to invalid syntax. */
|
|
1341
|
+
400: {
|
|
1342
|
+
headers: {
|
|
1343
|
+
[name: string]: unknown;
|
|
1344
|
+
};
|
|
1345
|
+
content: {
|
|
1346
|
+
"application/problem+json": components["schemas"]["ApiProblem"];
|
|
1347
|
+
};
|
|
1348
|
+
};
|
|
1349
|
+
/** @description Access is unauthorized. */
|
|
1350
|
+
401: {
|
|
1351
|
+
headers: {
|
|
1352
|
+
[name: string]: unknown;
|
|
1353
|
+
};
|
|
1354
|
+
content: {
|
|
1355
|
+
"application/problem+json": components["schemas"]["ApiProblem"];
|
|
1356
|
+
};
|
|
1357
|
+
};
|
|
1358
|
+
/** @description The server cannot find the requested resource. */
|
|
1359
|
+
404: {
|
|
1360
|
+
headers: {
|
|
1361
|
+
[name: string]: unknown;
|
|
1362
|
+
};
|
|
1363
|
+
content: {
|
|
1364
|
+
"application/problem+json": components["schemas"]["ApiProblem"];
|
|
1365
|
+
};
|
|
1366
|
+
};
|
|
1367
|
+
};
|
|
1368
|
+
};
|
|
1369
|
+
IntakeApi_submitWork: {
|
|
1370
|
+
parameters: {
|
|
1371
|
+
query?: never;
|
|
1372
|
+
header?: never;
|
|
1373
|
+
path?: never;
|
|
1374
|
+
cookie?: never;
|
|
1375
|
+
};
|
|
1376
|
+
requestBody: {
|
|
1377
|
+
content: {
|
|
1378
|
+
"application/json": components["schemas"]["WorkSubmission"];
|
|
1379
|
+
};
|
|
1380
|
+
};
|
|
1381
|
+
responses: {
|
|
1382
|
+
/** @description The request has succeeded. */
|
|
1383
|
+
200: {
|
|
1384
|
+
headers: {
|
|
1385
|
+
[name: string]: unknown;
|
|
1386
|
+
};
|
|
1387
|
+
content: {
|
|
1388
|
+
"application/json": components["schemas"]["WorkItemView"];
|
|
1389
|
+
};
|
|
1390
|
+
};
|
|
1391
|
+
/** @description The request has succeeded and a new resource has been created as a result. */
|
|
1392
|
+
201: {
|
|
1393
|
+
headers: {
|
|
1394
|
+
[name: string]: unknown;
|
|
1395
|
+
};
|
|
1396
|
+
content: {
|
|
1397
|
+
"application/json": components["schemas"]["WorkItemView"];
|
|
1398
|
+
};
|
|
1399
|
+
};
|
|
1400
|
+
/** @description The server could not understand the request due to invalid syntax. */
|
|
1401
|
+
400: {
|
|
1402
|
+
headers: {
|
|
1403
|
+
[name: string]: unknown;
|
|
1404
|
+
};
|
|
1405
|
+
content: {
|
|
1406
|
+
"application/problem+json": components["schemas"]["ApiProblem"];
|
|
1407
|
+
};
|
|
1408
|
+
};
|
|
1409
|
+
/** @description Access is unauthorized. */
|
|
1410
|
+
401: {
|
|
1411
|
+
headers: {
|
|
1412
|
+
[name: string]: unknown;
|
|
1413
|
+
};
|
|
1414
|
+
content: {
|
|
1415
|
+
"application/problem+json": components["schemas"]["ApiProblem"];
|
|
1416
|
+
};
|
|
1417
|
+
};
|
|
1418
|
+
};
|
|
1419
|
+
};
|
|
1420
|
+
IntakeApi_getWorkItem: {
|
|
1421
|
+
parameters: {
|
|
1422
|
+
query?: never;
|
|
1423
|
+
header?: never;
|
|
1424
|
+
path: {
|
|
1425
|
+
workItemId: string;
|
|
1426
|
+
};
|
|
1427
|
+
cookie?: never;
|
|
1428
|
+
};
|
|
1429
|
+
requestBody?: never;
|
|
1430
|
+
responses: {
|
|
1431
|
+
/** @description The request has succeeded. */
|
|
1432
|
+
200: {
|
|
1433
|
+
headers: {
|
|
1434
|
+
[name: string]: unknown;
|
|
1435
|
+
};
|
|
1436
|
+
content: {
|
|
1437
|
+
"application/json": components["schemas"]["WorkItemView"];
|
|
1438
|
+
};
|
|
1439
|
+
};
|
|
1440
|
+
/** @description Access is unauthorized. */
|
|
1441
|
+
401: {
|
|
1442
|
+
headers: {
|
|
1443
|
+
[name: string]: unknown;
|
|
1444
|
+
};
|
|
1445
|
+
content: {
|
|
1446
|
+
"application/problem+json": components["schemas"]["ApiProblem"];
|
|
1447
|
+
};
|
|
1448
|
+
};
|
|
1449
|
+
/** @description The server cannot find the requested resource. */
|
|
1450
|
+
404: {
|
|
1451
|
+
headers: {
|
|
1452
|
+
[name: string]: unknown;
|
|
1453
|
+
};
|
|
1454
|
+
content: {
|
|
1455
|
+
"application/problem+json": components["schemas"]["ApiProblem"];
|
|
1456
|
+
};
|
|
1457
|
+
};
|
|
1458
|
+
};
|
|
1459
|
+
};
|
|
892
1460
|
}
|