@qawolf/api-contracts 0.1.0 → 0.11.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 +1 -1
- package/dist/v1/automate/index.d.ts +17 -0
- package/dist/v1/automate/index.d.ts.map +1 -0
- package/dist/v1/automate/index.js +29 -0
- package/dist/v1/automate/index.js.map +1 -0
- package/dist/v1/environment/index.d.ts +78 -0
- package/dist/v1/environment/index.d.ts.map +1 -0
- package/dist/v1/environment/index.js +100 -0
- package/dist/v1/environment/index.js.map +1 -0
- package/dist/v1/flow/index.d.ts +25 -0
- package/dist/v1/flow/index.d.ts.map +1 -0
- package/dist/v1/flow/index.js +35 -0
- package/dist/v1/flow/index.js.map +1 -0
- package/dist/v1/ids.d.ts +5 -2
- package/dist/v1/ids.d.ts.map +1 -1
- package/dist/v1/ids.js +3 -0
- package/dist/v1/ids.js.map +1 -1
- package/dist/v1/index.d.ts +774 -9
- package/dist/v1/index.d.ts.map +1 -1
- package/dist/v1/index.js +38 -5
- package/dist/v1/index.js.map +1 -1
- package/dist/v1/issue/create.d.ts +74 -0
- package/dist/v1/issue/create.d.ts.map +1 -0
- package/dist/v1/issue/create.js +41 -0
- package/dist/v1/issue/create.js.map +1 -0
- package/dist/v1/issue/index.d.ts +165 -0
- package/dist/v1/issue/index.d.ts.map +1 -0
- package/dist/v1/issue/index.js +79 -0
- package/dist/v1/issue/index.js.map +1 -0
- package/dist/v1/pagination.d.ts +26 -0
- package/dist/v1/pagination.d.ts.map +1 -0
- package/dist/v1/pagination.js +37 -0
- package/dist/v1/pagination.js.map +1 -0
- package/dist/v1/resource.d.ts +20 -0
- package/dist/v1/resource.d.ts.map +1 -0
- package/dist/v1/resource.js +19 -0
- package/dist/v1/resource.js.map +1 -0
- package/dist/v1/run/find.d.ts +40 -0
- package/dist/v1/run/find.d.ts.map +1 -0
- package/dist/v1/run/find.js +35 -0
- package/dist/v1/run/find.js.map +1 -0
- package/dist/v1/run/flowSelection.d.ts +9 -0
- package/dist/v1/run/flowSelection.d.ts.map +1 -0
- package/dist/v1/run/flowSelection.js +12 -0
- package/dist/v1/run/flowSelection.js.map +1 -0
- package/dist/v1/run/get.d.ts +51 -0
- package/dist/v1/run/get.d.ts.map +1 -0
- package/dist/v1/run/get.js +55 -0
- package/dist/v1/run/get.js.map +1 -0
- package/dist/v1/run/index.d.ts +17 -6
- package/dist/v1/run/index.d.ts.map +1 -1
- package/dist/v1/run/index.js +24 -5
- package/dist/v1/run/index.js.map +1 -1
- package/dist/v1/run/summary.d.ts +23 -0
- package/dist/v1/run/summary.d.ts.map +1 -0
- package/dist/v1/run/summary.js +31 -0
- package/dist/v1/run/summary.js.map +1 -0
- package/dist/v1/tag/index.d.ts +24 -0
- package/dist/v1/tag/index.d.ts.map +1 -0
- package/dist/v1/tag/index.js +41 -0
- package/dist/v1/tag/index.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find.js","sourceRoot":"","sources":["../../../src/v1/run/find.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpD,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAGlC,GAID,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QACrB,oEAAoE;QACpE,gEAAgE;QAChE,+BAA+B;QAC/B,YAAY,EAAE,CAAC,CAAC,GAAG;aAChB,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;aAC1B,QAAQ,EAAE;aACV,QAAQ,CACP,6EAA6E,CAC9E;QACH,yEAAyE;QACzE,uDAAuD;QACvD,GAAG,yBAAyB,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC;QACjE,aAAa,EAAE,GAAG,CAAC,WAAW;KAC/B,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;QACtB,UAAU,EAAE,gBAAgB;QAC5B,IAAI,EAAE,CAAC;aACJ,KAAK,CACJ,QAAQ,CAAC,oBAAoB,CAAC,GAAG,CAAC,EAAE;YAClC,mBAAmB,EAAE,+BAA+B;SACrD,CAAC,CACH;aACA,QAAQ,CACP,mFAAmF,CACpF;KACJ,CAAC,CAAC;IAEH,OAAO;QACL,WAAW,EAAE,kDAAkD;QAC/D,KAAK;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,UAAU;QAChB,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { PublicIdSchema } from "../ids.js";
|
|
3
|
+
export declare const makeFlowSelectionSchema: <FlowId extends PublicIdSchema>(ids: {
|
|
4
|
+
flow: FlowId;
|
|
5
|
+
}) => z.ZodObject<{
|
|
6
|
+
flowIds: z.ZodDefault<z.ZodArray<FlowId>>;
|
|
7
|
+
tagNames: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
//# sourceMappingURL=flowSelection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flowSelection.d.ts","sourceRoot":"","sources":["../../../src/v1/run/flowSelection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAIhD,eAAO,MAAM,uBAAuB,GAAI,MAAM,SAAS,cAAc,EAAE,KAAK;IAC1E,IAAI,EAAE,MAAM,CAAC;CACd;;;iBAWI,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// Takes only the flow schema: callers like stored trigger actions have no
|
|
3
|
+
// other public id concepts to inject.
|
|
4
|
+
export const makeFlowSelectionSchema = (ids) => z
|
|
5
|
+
.object({
|
|
6
|
+
flowIds: z.array(ids.flow).default([]),
|
|
7
|
+
tagNames: z.array(z.string().min(1)).default([]),
|
|
8
|
+
})
|
|
9
|
+
.refine((selection) => selection.flowIds.length + selection.tagNames.length > 0, {
|
|
10
|
+
message: "At least one flow or tag is required.",
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=flowSelection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flowSelection.js","sourceRoot":"","sources":["../../../src/v1/run/flowSelection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,0EAA0E;AAC1E,sCAAsC;AACtC,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAgC,GAEtE,EAAE,EAAE,CACH,CAAC;KACE,MAAM,CAAC;IACN,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACtC,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;CACjD,CAAC;KACD,MAAM,CACL,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EACvE;IACE,OAAO,EAAE,uCAAuC;CACjD,CACF,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { PublicIdSchema } from "../ids.js";
|
|
3
|
+
export declare const makeGetRunContract: <FlowId extends PublicIdSchema, RunId extends PublicIdSchema>(ids: {
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
flow: FlowId;
|
|
6
|
+
run: RunId;
|
|
7
|
+
}) => {
|
|
8
|
+
readonly description: "Get a run's status, per-flow results, and links.";
|
|
9
|
+
readonly input: z.ZodObject<{
|
|
10
|
+
runId: RunId;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
readonly kind: "read";
|
|
13
|
+
readonly name: "run.get";
|
|
14
|
+
readonly output: z.ZodObject<{
|
|
15
|
+
flows: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
16
|
+
failure: z.ZodObject<{
|
|
17
|
+
error: z.ZodString;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
flowId: FlowId;
|
|
20
|
+
name: z.ZodString;
|
|
21
|
+
status: z.ZodLiteral<"failed">;
|
|
22
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
23
|
+
flowId: FlowId;
|
|
24
|
+
name: z.ZodString;
|
|
25
|
+
status: z.ZodEnum<{
|
|
26
|
+
running: "running";
|
|
27
|
+
canceled: "canceled";
|
|
28
|
+
queued: "queued";
|
|
29
|
+
passed: "passed";
|
|
30
|
+
}>;
|
|
31
|
+
}, z.core.$strip>], "status">>;
|
|
32
|
+
completedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
33
|
+
createdAt: z.ZodISODateTime;
|
|
34
|
+
git: z.ZodObject<{
|
|
35
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
36
|
+
commitMessage: z.ZodOptional<z.ZodString>;
|
|
37
|
+
commitSha: z.ZodOptional<z.ZodString>;
|
|
38
|
+
commitUrl: z.ZodOptional<z.ZodString>;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
runId: RunId;
|
|
41
|
+
status: z.ZodEnum<{
|
|
42
|
+
running: "running";
|
|
43
|
+
canceled: "canceled";
|
|
44
|
+
queued: "queued";
|
|
45
|
+
passed: "passed";
|
|
46
|
+
failed: "failed";
|
|
47
|
+
}>;
|
|
48
|
+
url: z.ZodURL;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=get.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../src/v1/run/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAKhD,eAAO,MAAM,kBAAkB,GAC7B,MAAM,SAAS,cAAc,EAC7B,KAAK,SAAS,cAAc,EAC5B,KAAK;IACL,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,KAAK,CAAC;CACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6DA,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { resource } from "../resource.js";
|
|
3
|
+
import { makeRunSummaryFields } from "./summary.js";
|
|
4
|
+
export const makeGetRunContract = (ids) => {
|
|
5
|
+
const input = z.object({
|
|
6
|
+
runId: ids.run,
|
|
7
|
+
});
|
|
8
|
+
// We return one flat entry per flow, each carrying its own status, rather
|
|
9
|
+
// than status-keyed buckets (`{ passed: [...], failed: [...] }`). A flat list
|
|
10
|
+
// is a superset — the caller can group by status — and gives each flow a
|
|
11
|
+
// place to carry detail (its failure now, links later) without reshaping.
|
|
12
|
+
// We also dropped the aggregate outcome counts an earlier version returned:
|
|
13
|
+
// they are derivable from this list, and keeping both invites the two
|
|
14
|
+
// representations to drift.
|
|
15
|
+
// A flow entry is a discriminated union on `status`: a failed flow always
|
|
16
|
+
// carries `failure`, and every non-failed flow omits it. Encoding the rule in
|
|
17
|
+
// the shape means the contract rejects a "failed" flow with no error (and a
|
|
18
|
+
// `failure` on a flow that didn't fail), so a caller can rely on
|
|
19
|
+
// "failed ⇔ failure present" instead of defensively checking, and we can't
|
|
20
|
+
// accidentally emit a contradictory record.
|
|
21
|
+
const failedFlow = z.object({
|
|
22
|
+
failure: z.object({
|
|
23
|
+
// The raw error from the run itself, available the moment the flow fails.
|
|
24
|
+
// Chosen over QA Wolf's analyzed error (`RunAnalysisDto`): the analysis is
|
|
25
|
+
// produced only after investigation and is usually absent while an agent
|
|
26
|
+
// is still polling, whereas this is immediate. Analysis fields
|
|
27
|
+
// (categorization, a parsed line number) can be added here later as
|
|
28
|
+
// optional additions without another contract bump.
|
|
29
|
+
error: z.string(),
|
|
30
|
+
}),
|
|
31
|
+
flowId: ids.flow,
|
|
32
|
+
name: z.string(),
|
|
33
|
+
status: z.literal("failed"),
|
|
34
|
+
});
|
|
35
|
+
const nonFailedFlow = z.object({
|
|
36
|
+
flowId: ids.flow,
|
|
37
|
+
name: z.string(),
|
|
38
|
+
status: z.enum(["queued", "running", "passed", "canceled"]),
|
|
39
|
+
});
|
|
40
|
+
const flows = z
|
|
41
|
+
.array(z.discriminatedUnion("status", [failedFlow, nonFailedFlow]))
|
|
42
|
+
.describe("The run's flows, ordered alphabetically by name.");
|
|
43
|
+
const output = resource({
|
|
44
|
+
...makeRunSummaryFields(ids),
|
|
45
|
+
flows,
|
|
46
|
+
}, { urlFieldDescription: "Absolute URL of the run page." });
|
|
47
|
+
return {
|
|
48
|
+
description: "Get a run's status, per-flow results, and links.",
|
|
49
|
+
input,
|
|
50
|
+
kind: "read",
|
|
51
|
+
name: "run.get",
|
|
52
|
+
output,
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/v1/run/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAGhC,GAID,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QACrB,KAAK,EAAE,GAAG,CAAC,GAAG;KACf,CAAC,CAAC;IAEH,0EAA0E;IAC1E,8EAA8E;IAC9E,yEAAyE;IACzE,0EAA0E;IAC1E,4EAA4E;IAC5E,sEAAsE;IACtE,4BAA4B;IAC5B,0EAA0E;IAC1E,8EAA8E;IAC9E,4EAA4E;IAC5E,iEAAiE;IACjE,2EAA2E;IAC3E,4CAA4C;IAC5C,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;QAC1B,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC;YAChB,0EAA0E;YAC1E,2EAA2E;YAC3E,yEAAyE;YACzE,+DAA+D;YAC/D,oEAAoE;YACpE,oDAAoD;YACpD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;SAClB,CAAC;QACF,MAAM,EAAE,GAAG,CAAC,IAAI;QAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;KAC5B,CAAC,CAAC;IACH,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;QAC7B,MAAM,EAAE,GAAG,CAAC,IAAI;QAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;KAC5D,CAAC,CAAC;IACH,MAAM,KAAK,GAAG,CAAC;SACZ,KAAK,CAAC,CAAC,CAAC,kBAAkB,CAAC,QAAQ,EAAE,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC;SAClE,QAAQ,CAAC,kDAAkD,CAAC,CAAC;IAEhE,MAAM,MAAM,GAAG,QAAQ,CACrB;QACE,GAAG,oBAAoB,CAAC,GAAG,CAAC;QAC5B,KAAK;KACN,EACD,EAAE,mBAAmB,EAAE,+BAA+B,EAAE,CACzD,CAAC;IAEF,OAAO;QACL,WAAW,EAAE,kDAAkD;QAC/D,KAAK;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,SAAS;QACf,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
|
package/dist/v1/run/index.d.ts
CHANGED
|
@@ -1,17 +1,28 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import type { PublicIdSchema
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import type { PublicIdSchema } from "../ids.js";
|
|
3
|
+
import { makeFlowSelectionSchema } from "./flowSelection.js";
|
|
4
|
+
export { makeFlowSelectionSchema };
|
|
5
|
+
export declare const makeCreateRunContract: <EnvironmentId extends PublicIdSchema, FlowId extends PublicIdSchema, RunId extends PublicIdSchema>(ids: {
|
|
6
|
+
environment: EnvironmentId;
|
|
7
|
+
flow: FlowId;
|
|
8
|
+
run: RunId;
|
|
9
|
+
}) => {
|
|
10
|
+
readonly description: "Create a run for the selected flows and/or tags in an environment.";
|
|
11
|
+
readonly input: z.ZodIntersection<z.ZodObject<{
|
|
6
12
|
environmentId: EnvironmentId;
|
|
7
13
|
environmentVariables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
8
|
-
flowIds: z.ZodArray<FlowId>;
|
|
9
14
|
ignoreRules: z.ZodDefault<z.ZodBoolean>;
|
|
10
|
-
|
|
15
|
+
pullRequestNumber: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
repository: z.ZodOptional<z.ZodString>;
|
|
17
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
18
|
+
flowIds: z.ZodDefault<z.ZodArray<FlowId>>;
|
|
19
|
+
tagNames: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
20
|
+
}, z.core.$strip>>;
|
|
11
21
|
readonly kind: "write";
|
|
12
22
|
readonly name: "run.create";
|
|
13
23
|
readonly output: z.ZodObject<{
|
|
14
24
|
runId: RunId;
|
|
25
|
+
url: z.ZodURL;
|
|
15
26
|
}, z.core.$strip>;
|
|
16
27
|
};
|
|
17
28
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/v1/run/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/v1/run/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAGhD,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,OAAO,EAAE,uBAAuB,EAAE,CAAC;AAEnC,eAAO,MAAM,qBAAqB,GAChC,aAAa,SAAS,cAAc,EACpC,MAAM,SAAS,cAAc,EAC7B,KAAK,SAAS,cAAc,EAC5B,KAAK;IACL,WAAW,EAAE,aAAa,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,KAAK,CAAC;CACZ;;;;;;;;;;;;;;;;;;CAyCA,CAAC"}
|
package/dist/v1/run/index.js
CHANGED
|
@@ -1,14 +1,33 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { resource } from "../resource.js";
|
|
3
|
+
import { makeFlowSelectionSchema } from "./flowSelection.js";
|
|
4
|
+
export { makeFlowSelectionSchema };
|
|
2
5
|
export const makeCreateRunContract = (ids) => {
|
|
3
|
-
const input = z
|
|
6
|
+
const input = z
|
|
7
|
+
.object({
|
|
4
8
|
environmentId: ids.environment,
|
|
5
9
|
environmentVariables: z.record(z.string(), z.string()).optional(),
|
|
6
|
-
flowIds: z.array(ids.flow).min(1),
|
|
7
10
|
ignoreRules: z.boolean().default(false),
|
|
8
|
-
|
|
9
|
-
|
|
11
|
+
// Associate a pull request with the run by its number within a
|
|
12
|
+
// repository. A number requires a repository; a repository may be given
|
|
13
|
+
// on its own. The server resolves the internal pull request id,
|
|
14
|
+
// scoped to the caller's team.
|
|
15
|
+
pullRequestNumber: z
|
|
16
|
+
.number()
|
|
17
|
+
.int()
|
|
18
|
+
.positive()
|
|
19
|
+
.describe("The number of the pull request to associate with the run.")
|
|
20
|
+
.optional(),
|
|
21
|
+
repository: z
|
|
22
|
+
.string()
|
|
23
|
+
.min(1)
|
|
24
|
+
.describe('The owner/name of the repository, e.g. "acme/web".')
|
|
25
|
+
.optional(),
|
|
26
|
+
})
|
|
27
|
+
.and(makeFlowSelectionSchema(ids));
|
|
28
|
+
const output = resource({ runId: ids.run }, { urlFieldDescription: "Absolute URL of the run page." });
|
|
10
29
|
return {
|
|
11
|
-
description: "Create a run for selected flows in an environment.",
|
|
30
|
+
description: "Create a run for the selected flows and/or tags in an environment.",
|
|
12
31
|
input,
|
|
13
32
|
kind: "write",
|
|
14
33
|
name: "run.create",
|
package/dist/v1/run/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v1/run/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v1/run/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,OAAO,EAAE,uBAAuB,EAAE,CAAC;AAEnC,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAInC,GAID,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,CAAC;SACZ,MAAM,CAAC;QACN,aAAa,EAAE,GAAG,CAAC,WAAW;QAC9B,oBAAoB,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;QACjE,WAAW,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;QACvC,+DAA+D;QAC/D,wEAAwE;QACxE,gEAAgE;QAChE,+BAA+B;QAC/B,iBAAiB,EAAE,CAAC;aACjB,MAAM,EAAE;aACR,GAAG,EAAE;aACL,QAAQ,EAAE;aACV,QAAQ,CAAC,2DAA2D,CAAC;aACrE,QAAQ,EAAE;QACb,UAAU,EAAE,CAAC;aACV,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CAAC,oDAAoD,CAAC;aAC9D,QAAQ,EAAE;KACd,CAAC;SACD,GAAG,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC,CAAC;IACrC,MAAM,MAAM,GAAG,QAAQ,CACrB,EAAE,KAAK,EAAE,GAAG,CAAC,GAAG,EAAE,EAClB,EAAE,mBAAmB,EAAE,+BAA+B,EAAE,CACzD,CAAC;IAEF,OAAO;QACL,WAAW,EACT,oEAAoE;QACtE,KAAK;QACL,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,YAAY;QAClB,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { PublicIdSchema } from "../ids.js";
|
|
3
|
+
export declare const makeRunSummaryFields: <RunId extends PublicIdSchema>(ids: {
|
|
4
|
+
run: RunId;
|
|
5
|
+
}) => {
|
|
6
|
+
completedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
7
|
+
createdAt: z.ZodISODateTime;
|
|
8
|
+
git: z.ZodObject<{
|
|
9
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
10
|
+
commitMessage: z.ZodOptional<z.ZodString>;
|
|
11
|
+
commitSha: z.ZodOptional<z.ZodString>;
|
|
12
|
+
commitUrl: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
runId: RunId;
|
|
15
|
+
status: z.ZodEnum<{
|
|
16
|
+
running: "running";
|
|
17
|
+
canceled: "canceled";
|
|
18
|
+
queued: "queued";
|
|
19
|
+
passed: "passed";
|
|
20
|
+
failed: "failed";
|
|
21
|
+
}>;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=summary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../../src/v1/run/summary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAKhD,eAAO,MAAM,oBAAoB,GAAI,KAAK,SAAS,cAAc,EAAE,KAAK;IACtE,GAAG,EAAE,KAAK,CAAC;CACZ;;;;;;;;;;;;;;;;;CA+BC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// The shared run summary fields. run.find returns them as rows. run.get adds
|
|
3
|
+
// the per-flow results to them. Both shapes come from this one factory, so
|
|
4
|
+
// the shapes cannot become different.
|
|
5
|
+
export const makeRunSummaryFields = (ids) => ({
|
|
6
|
+
completedAt: z.iso
|
|
7
|
+
.datetime()
|
|
8
|
+
.optional()
|
|
9
|
+
.describe("When the run finished executing. Absent while queued or running, and also absent for a terminal run that never completed execution (e.g. every flow was canceled or skipped)."),
|
|
10
|
+
createdAt: z.iso.datetime(),
|
|
11
|
+
git: z
|
|
12
|
+
.object({
|
|
13
|
+
branch: z.string().optional(),
|
|
14
|
+
commitMessage: z.string().optional(),
|
|
15
|
+
commitSha: z.string().optional(),
|
|
16
|
+
// This is `z.string()`, not `z.url()`. The value is stored commit data,
|
|
17
|
+
// and the endpoint validates its own output. One bad legacy commit URL
|
|
18
|
+
// would cause a 500 error for that run. A loose schema is safe now. A
|
|
19
|
+
// tighter schema later would be a breaking change.
|
|
20
|
+
commitUrl: z
|
|
21
|
+
.string()
|
|
22
|
+
.optional()
|
|
23
|
+
.describe("Link to the commit on the code host."),
|
|
24
|
+
})
|
|
25
|
+
.describe("The branch and commit under test. The fields are present when a deploy notification started the run, and absent for runs started another way, for example manually or with run.create."),
|
|
26
|
+
runId: ids.run,
|
|
27
|
+
status: z
|
|
28
|
+
.enum(["queued", "running", "passed", "failed", "canceled"])
|
|
29
|
+
.describe("Whole-run status. Terminal statuses are passed, failed, and canceled; poll until one is reached."),
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=summary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summary.js","sourceRoot":"","sources":["../../../src/v1/run/summary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,6EAA6E;AAC7E,2EAA2E;AAC3E,sCAAsC;AACtC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAA+B,GAElE,EAAE,EAAE,CAAC,CAAC;IACL,WAAW,EAAE,CAAC,CAAC,GAAG;SACf,QAAQ,EAAE;SACV,QAAQ,EAAE;SACV,QAAQ,CACP,+KAA+K,CAChL;IACH,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE;IAC3B,GAAG,EAAE,CAAC;SACH,MAAM,CAAC;QACN,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC7B,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QACpC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAChC,wEAAwE;QACxE,uEAAuE;QACvE,sEAAsE;QACtE,mDAAmD;QACnD,SAAS,EAAE,CAAC;aACT,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,sCAAsC,CAAC;KACpD,CAAC;SACD,QAAQ,CACP,wLAAwL,CACzL;IACH,KAAK,EAAE,GAAG,CAAC,GAAG;IACd,MAAM,EAAE,CAAC;SACN,IAAI,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;SAC3D,QAAQ,CACP,kGAAkG,CACnG;CACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* The shared tag resource. Tag names are the public handle; there is no
|
|
4
|
+
* public tag id.
|
|
5
|
+
*/
|
|
6
|
+
export declare const makeTagResourceSchema: () => z.ZodObject<{
|
|
7
|
+
color: z.ZodString;
|
|
8
|
+
name: z.ZodString;
|
|
9
|
+
url: z.ZodURL;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
export declare const makeCreateTagContract: () => {
|
|
12
|
+
readonly description: "Create a tag on the caller's team. Tags select flows in run.create.";
|
|
13
|
+
readonly input: z.ZodObject<{
|
|
14
|
+
name: z.ZodString;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
readonly kind: "write";
|
|
17
|
+
readonly name: "tag.create";
|
|
18
|
+
readonly output: z.ZodObject<{
|
|
19
|
+
color: z.ZodString;
|
|
20
|
+
name: z.ZodString;
|
|
21
|
+
url: z.ZodURL;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/v1/tag/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;;iBAiB/B,CAAC;AAEJ,eAAO,MAAM,qBAAqB;;;;;;;;;;;;CA6BjC,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { resource } from "../resource.js";
|
|
3
|
+
// tag.create returns this schema and the future tag.list returns rows of
|
|
4
|
+
// it; one factory keeps the two shapes from drifting.
|
|
5
|
+
/**
|
|
6
|
+
* The shared tag resource. Tag names are the public handle; there is no
|
|
7
|
+
* public tag id.
|
|
8
|
+
*/
|
|
9
|
+
export const makeTagResourceSchema = () => resource({
|
|
10
|
+
color: z
|
|
11
|
+
.string()
|
|
12
|
+
// Colors are system assigned from a fixed hex palette and the column
|
|
13
|
+
// has no user input path, so the output can promise the format.
|
|
14
|
+
.regex(/^#[0-9a-fA-F]{6}$/)
|
|
15
|
+
.describe("The tag's display color as a hex code, assigned by QA Wolf."),
|
|
16
|
+
name: z.string(),
|
|
17
|
+
}, {
|
|
18
|
+
// Every tag on a team shares this URL: the app has no per-tag page.
|
|
19
|
+
urlFieldDescription: "Absolute URL of the team's tag settings page.",
|
|
20
|
+
});
|
|
21
|
+
export const makeCreateTagContract = () => {
|
|
22
|
+
const input = z.object({
|
|
23
|
+
name: z
|
|
24
|
+
.string()
|
|
25
|
+
.trim()
|
|
26
|
+
.min(1)
|
|
27
|
+
// The tags table stores the name in a varchar(255) column; a longer
|
|
28
|
+
// name must fail here, not as a database error.
|
|
29
|
+
.max(255)
|
|
30
|
+
.refine((name) => !name.includes(","), "Tag names cannot include commas."),
|
|
31
|
+
});
|
|
32
|
+
const output = makeTagResourceSchema();
|
|
33
|
+
return {
|
|
34
|
+
description: "Create a tag on the caller's team. Tags select flows in run.create.",
|
|
35
|
+
input,
|
|
36
|
+
kind: "write",
|
|
37
|
+
name: "tag.create",
|
|
38
|
+
output,
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v1/tag/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,yEAAyE;AACzE,sDAAsD;AACtD;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,EAAE,CACxC,QAAQ,CACN;IACE,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;QACT,qEAAqE;QACrE,gEAAgE;SAC/D,KAAK,CAAC,mBAAmB,CAAC;SAC1B,QAAQ,CACP,6DAA6D,CAC9D;IACH,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;CACjB,EACD;IACE,oEAAoE;IACpE,mBAAmB,EAAE,+CAA+C;CACrE,CACF,CAAC;AAEJ,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACxC,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QACrB,IAAI,EAAE,CAAC;aACJ,MAAM,EAAE;aACR,IAAI,EAAE;aACN,GAAG,CAAC,CAAC,CAAC;YACP,oEAAoE;YACpE,gDAAgD;aAC/C,GAAG,CAAC,GAAG,CAAC;aACR,MAAM,CACL,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAC7B,kCAAkC,CACnC;KACJ,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,qBAAqB,EAAE,CAAC;IAEvC,OAAO;QACL,WAAW,EACT,qEAAqE;QACvE,KAAK;QACL,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,YAAY;QAClB,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qawolf/api-contracts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Versioned contracts for the QA Wolf public API",
|
|
6
6
|
"repository": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"build": "rm -rf ./dist && tsc -p tsconfig.build.json",
|
|
27
27
|
"lint:ci": "npm run lint:non-fixable; NON_FIXABLE_EXIT=$?; npm run lint:fixable && exit $NON_FIXABLE_EXIT",
|
|
28
28
|
"lint:dev": "npm run lint:fixable",
|
|
29
|
-
"lint:fixable": "eslint . --
|
|
29
|
+
"lint:fixable": "eslint . --fix --quiet && oxfmt --write .",
|
|
30
30
|
"lint:non-fixable": "dpdm --exit-code circular:1 --no-tree --no-warning --transform --include='.*' --exclude='/(dist|node_modules)/' '**/*'",
|
|
31
31
|
"prepublishOnly": "npm run build",
|
|
32
32
|
"test": "NODE_OPTIONS=\"--experimental-vm-modules\" NODE_NO_WARNINGS=1 jest",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@typescript/native-preview": "^7.0.0-dev.20260416.1",
|
|
40
|
-
"typescript": "^5.9.
|
|
40
|
+
"typescript": "^5.9.3",
|
|
41
41
|
"zod": "^4.1.11"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|