@opensoftware/contracts 1.9.0 → 1.10.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.
@@ -40,7 +40,8 @@ export type paths = {
40
40
  path?: never;
41
41
  cookie?: never;
42
42
  };
43
- get?: never;
43
+ /** @description The runs of the server, running runs first, then the runs that ended, the one that ended last first; with `state`, only the runs in that state (ADR 0071). */
44
+ get: operations["ForemanApi_listRuns"];
44
45
  put?: never;
45
46
  /** @description Start a run of the factory's workflow for a work item. The same work item again answers the run it started. */
46
47
  post: operations["ForemanApi_startRun"];
@@ -684,6 +685,10 @@ export type components = {
684
685
  /** Format: uri */
685
686
  evidenceBundle?: string;
686
687
  };
688
+ /** @description foreman: the runs of the server, running runs first, then the runs that ended, the one that ended last first, as `GET /v1/runs` answers them (ADR 0071). */
689
+ RunList: {
690
+ runs: components["schemas"]["RunView"][];
691
+ };
687
692
  /**
688
693
  * @description How a run ended.
689
694
  * @enum {string}
@@ -1025,10 +1030,10 @@ export type components = {
1025
1030
  links?: components["schemas"]["Link"][];
1026
1031
  };
1027
1032
  /**
1028
- * @description Where a work item stands.
1033
+ * @description Where a work item stands: received, then as its run in the foreman goes (ADR 0071).
1029
1034
  * @enum {string}
1030
1035
  */
1031
- WorkItemStatus: "received";
1036
+ WorkItemStatus: "received" | "running" | "complete" | "failed" | "cancelled";
1032
1037
  /** @enum {string} */
1033
1038
  WorkItemType: "idea" | "bug" | "task" | "automation";
1034
1039
  /** @description intake: a work item as the HTTP API shows it (ADR 0063). */
@@ -1036,6 +1041,8 @@ export type components = {
1036
1041
  /** @description Its ID is "wi_" and 20 hex digits of the SHA-256 of its dedupe key. */
1037
1042
  workItem: components["schemas"]["WorkItem"];
1038
1043
  status: components["schemas"]["WorkItemStatus"];
1044
+ /** @description The foreman's run of the work item, once it started (ADR 0071). */
1045
+ runId?: string;
1039
1046
  /** Format: date-time */
1040
1047
  receivedAt: string;
1041
1048
  /** @description Every submission that asked for the work item, oldest first; one per origin. */
@@ -1183,6 +1190,46 @@ export interface operations {
1183
1190
  };
1184
1191
  };
1185
1192
  };
1193
+ ForemanApi_listRuns: {
1194
+ parameters: {
1195
+ query?: {
1196
+ state?: components["schemas"]["RunState"];
1197
+ };
1198
+ header?: never;
1199
+ path?: never;
1200
+ cookie?: never;
1201
+ };
1202
+ requestBody?: never;
1203
+ responses: {
1204
+ /** @description The request has succeeded. */
1205
+ 200: {
1206
+ headers: {
1207
+ [name: string]: unknown;
1208
+ };
1209
+ content: {
1210
+ "application/json": components["schemas"]["RunList"];
1211
+ };
1212
+ };
1213
+ /** @description The server could not understand the request due to invalid syntax. */
1214
+ 400: {
1215
+ headers: {
1216
+ [name: string]: unknown;
1217
+ };
1218
+ content: {
1219
+ "application/problem+json": components["schemas"]["ApiProblem"];
1220
+ };
1221
+ };
1222
+ /** @description Access is unauthorized. */
1223
+ 401: {
1224
+ headers: {
1225
+ [name: string]: unknown;
1226
+ };
1227
+ content: {
1228
+ "application/problem+json": components["schemas"]["ApiProblem"];
1229
+ };
1230
+ };
1231
+ };
1232
+ };
1186
1233
  ForemanApi_startRun: {
1187
1234
  parameters: {
1188
1235
  query?: never;
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.1.0",
3
3
  "info": {
4
4
  "title": "Open Software Factory contracts",
5
- "version": "1.9.0",
5
+ "version": "1.10.0",
6
6
  "description": "The shared formats as named models, and the HTTP APIs of the modules. Generated by `pnpm build` in contracts/ from typespec/. Do not edit.",
7
7
  "license": {
8
8
  "name": "Apache-2.0",
@@ -174,6 +174,53 @@
174
174
  }
175
175
  }
176
176
  }
177
+ },
178
+ "get": {
179
+ "operationId": "ForemanApi_listRuns",
180
+ "description": "The runs of the server, running runs first, then the runs that ended, the one that ended last first; with `state`, only the runs in that state (ADR 0071).",
181
+ "parameters": [
182
+ {
183
+ "name": "state",
184
+ "in": "query",
185
+ "required": false,
186
+ "schema": {
187
+ "$ref": "#/components/schemas/RunState"
188
+ },
189
+ "explode": false
190
+ }
191
+ ],
192
+ "responses": {
193
+ "200": {
194
+ "description": "The request has succeeded.",
195
+ "content": {
196
+ "application/json": {
197
+ "schema": {
198
+ "$ref": "#/components/schemas/RunList"
199
+ }
200
+ }
201
+ }
202
+ },
203
+ "400": {
204
+ "description": "The server could not understand the request due to invalid syntax.",
205
+ "content": {
206
+ "application/problem+json": {
207
+ "schema": {
208
+ "$ref": "#/components/schemas/ApiProblem"
209
+ }
210
+ }
211
+ }
212
+ },
213
+ "401": {
214
+ "description": "Access is unauthorized.",
215
+ "content": {
216
+ "application/problem+json": {
217
+ "schema": {
218
+ "$ref": "#/components/schemas/ApiProblem"
219
+ }
220
+ }
221
+ }
222
+ }
223
+ }
177
224
  }
178
225
  },
179
226
  "/v1/runs/{runId}": {
@@ -2000,6 +2047,21 @@
2000
2047
  "source"
2001
2048
  ]
2002
2049
  },
2050
+ "RunList": {
2051
+ "type": "object",
2052
+ "properties": {
2053
+ "runs": {
2054
+ "type": "array",
2055
+ "items": {
2056
+ "$ref": "#/components/schemas/RunView"
2057
+ }
2058
+ }
2059
+ },
2060
+ "required": [
2061
+ "runs"
2062
+ ],
2063
+ "description": "foreman: the runs of the server, running runs first, then the runs that ended, the one that ended last first, as `GET /v1/runs` answers them (ADR 0071)."
2064
+ },
2003
2065
  "RunOutcome": {
2004
2066
  "type": "string",
2005
2067
  "enum": [
@@ -2884,9 +2946,13 @@
2884
2946
  "WorkItemStatus": {
2885
2947
  "type": "string",
2886
2948
  "enum": [
2887
- "received"
2949
+ "received",
2950
+ "running",
2951
+ "complete",
2952
+ "failed",
2953
+ "cancelled"
2888
2954
  ],
2889
- "description": "Where a work item stands."
2955
+ "description": "Where a work item stands: received, then as its run in the foreman goes (ADR 0071)."
2890
2956
  },
2891
2957
  "WorkItemType": {
2892
2958
  "type": "string",
@@ -2907,6 +2973,11 @@
2907
2973
  "status": {
2908
2974
  "$ref": "#/components/schemas/WorkItemStatus"
2909
2975
  },
2976
+ "runId": {
2977
+ "type": "string",
2978
+ "minLength": 1,
2979
+ "description": "The foreman's run of the work item, once it started (ADR 0071)."
2980
+ },
2910
2981
  "receivedAt": {
2911
2982
  "type": "string",
2912
2983
  "format": "date-time"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opensoftware/contracts",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "description": "The shared formats of the open software factory: JSON Schemas, TypeScript types and the osf-contracts CLI.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -25,6 +25,11 @@ namespace ForemanApi {
25
25
  | GatekeeperApi.Failure<400>
26
26
  | GatekeeperApi.Failure<401>;
27
27
 
28
+ /** The runs of the server, running runs first, then the runs that ended, the one that ended last first; with `state`, only the runs in that state (ADR 0071). */
29
+ @route("/v1/runs")
30
+ @get
31
+ op listRuns(@query state?: RunState): RunList | GatekeeperApi.Failure<400> | GatekeeperApi.Failure<401>;
32
+
28
33
  /** A run: its state and the state of each stage. */
29
34
  @route("/v1/runs/{runId}")
30
35
  @get
@@ -101,6 +101,11 @@ model RunView {
101
101
  stages: StageView[];
102
102
  }
103
103
 
104
+ /** foreman: the runs of the server, running runs first, then the runs that ended, the one that ended last first, as `GET /v1/runs` answers them (ADR 0071). */
105
+ model RunList {
106
+ runs: RunView[];
107
+ }
108
+
104
109
  /** foreman: what a person tells a run. */
105
110
  enum RunSignalType {
106
111
  steer,
@@ -27,9 +27,13 @@ model WorkSubmission {
27
27
  links?: Link[];
28
28
  }
29
29
 
30
- /** Where a work item stands. */
30
+ /** Where a work item stands: received, then as its run in the foreman goes (ADR 0071). */
31
31
  enum WorkItemStatus {
32
32
  received,
33
+ running,
34
+ complete,
35
+ failed,
36
+ cancelled,
33
37
  }
34
38
 
35
39
  /** intake: one submission that asked for a work item. */
@@ -45,6 +49,11 @@ model WorkItemView {
45
49
  workItem: WorkItem;
46
50
 
47
51
  status: WorkItemStatus;
52
+
53
+ /** The foreman's run of the work item, once it started (ADR 0071). */
54
+ @minLength(1)
55
+ runId?: string;
56
+
48
57
  receivedAt: utcDateTime;
49
58
 
50
59
  /** Every submission that asked for the work item, oldest first; one per origin. */