@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
package/dist/v1/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,YAAY,EACV,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,gBAAgB,GACjB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,YAAY,EACV,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,gBAAgB,GACjB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,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AM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAoC,CAAC"}
|
package/dist/v1/index.js
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
export { defaultIdSchemas, } from "./ids.js";
|
|
2
|
+
export { makeFlowSelectionSchema } from "./run/index.js";
|
|
3
|
+
import { makeAutomateContract } from "./automate/index.js";
|
|
4
|
+
import { makeCreateEnvironmentContract, makeGetEnvironmentContract, makeListEnvironmentVariableNamesContract, } from "./environment/index.js";
|
|
5
|
+
import { makeListFlowsContract } from "./flow/index.js";
|
|
2
6
|
import { defaultIdSchemas, } from "./ids.js";
|
|
7
|
+
import { makeCreateIssueContract } from "./issue/create.js";
|
|
8
|
+
import { makeFindIssuesContract, makeGetIssueContract } from "./issue/index.js";
|
|
9
|
+
import { makeFindRunsContract } from "./run/find.js";
|
|
10
|
+
import { makeGetRunContract } from "./run/get.js";
|
|
3
11
|
import { makeCreateRunContract } from "./run/index.js";
|
|
12
|
+
import { makeCreateTagContract } from "./tag/index.js";
|
|
4
13
|
/**
|
|
5
14
|
* Builds the v1 contract catalog from a set of id schemas.
|
|
6
15
|
*
|
|
@@ -8,10 +17,34 @@ import { makeCreateRunContract } from "./run/index.js";
|
|
|
8
17
|
* the same factory with its own strict id schemas, so the contract shape can
|
|
9
18
|
* never drift between the two while validation strictness stays server-owned.
|
|
10
19
|
*/
|
|
11
|
-
export const makeContractsV1 = (ids) =>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
20
|
+
export const makeContractsV1 = (ids) => {
|
|
21
|
+
const resolvedIds = { ...defaultIdSchemas, ...ids };
|
|
22
|
+
return {
|
|
23
|
+
// Top-level contract: the public command is the verb itself, with no
|
|
24
|
+
// resource namespace (`qawolf automate`).
|
|
25
|
+
automate: makeAutomateContract(resolvedIds),
|
|
26
|
+
environment: {
|
|
27
|
+
create: makeCreateEnvironmentContract(resolvedIds),
|
|
28
|
+
get: makeGetEnvironmentContract(resolvedIds),
|
|
29
|
+
listVariableNames: makeListEnvironmentVariableNamesContract(resolvedIds),
|
|
30
|
+
},
|
|
31
|
+
flow: {
|
|
32
|
+
list: makeListFlowsContract(resolvedIds),
|
|
33
|
+
},
|
|
34
|
+
issue: {
|
|
35
|
+
create: makeCreateIssueContract(resolvedIds),
|
|
36
|
+
find: makeFindIssuesContract(resolvedIds),
|
|
37
|
+
get: makeGetIssueContract(resolvedIds),
|
|
38
|
+
},
|
|
39
|
+
run: {
|
|
40
|
+
create: makeCreateRunContract(resolvedIds),
|
|
41
|
+
find: makeFindRunsContract(resolvedIds),
|
|
42
|
+
get: makeGetRunContract(resolvedIds),
|
|
43
|
+
},
|
|
44
|
+
tag: {
|
|
45
|
+
create: makeCreateTagContract(),
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
};
|
|
16
49
|
export const publicContractsV1 = makeContractsV1(defaultIdSchemas);
|
|
17
50
|
//# sourceMappingURL=index.js.map
|
package/dist/v1/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAGL,gBAAgB,GACjB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js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AC,WAAW,CAAC;YAC5C,IAAI,EAAE,sBAAsB,CAAC,WAAW,CAAC;YACzC,GAAG,EAAE,oBAAoB,CAAC,WAAW,CAAC;SACvC;QACD,GAAG,EAAE;YACH,MAAM,EAAE,qBAAqB,CAAC,WAAW,CAAC;YAC1C,IAAI,EAAE,oBAAoB,CAAC,WAAW,CAAC;YACvC,GAAG,EAAE,kBAAkB,CAAC,WAAW,CAAC;SACrC;QACD,GAAG,EAAE;YACH,MAAM,EAAE,qBAAqB,EAAE;SAChC;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { PublicIdSchema } from "../ids.js";
|
|
3
|
+
export declare const makeCreateIssueContract: <EnvironmentId extends PublicIdSchema, FlowId extends PublicIdSchema, RunId extends PublicIdSchema, IssueId extends PublicIdSchema>(ids: {
|
|
4
|
+
environment: EnvironmentId;
|
|
5
|
+
flow: FlowId;
|
|
6
|
+
issue: IssueId;
|
|
7
|
+
run: RunId;
|
|
8
|
+
}) => {
|
|
9
|
+
readonly description: string;
|
|
10
|
+
readonly input: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
11
|
+
type: z.ZodLiteral<"bug">;
|
|
12
|
+
description: z.ZodOptional<z.ZodString>;
|
|
13
|
+
name: z.ZodString;
|
|
14
|
+
priority: z.ZodOptional<z.ZodEnum<{
|
|
15
|
+
unprioritized: "unprioritized";
|
|
16
|
+
low: "low";
|
|
17
|
+
medium: "medium";
|
|
18
|
+
high: "high";
|
|
19
|
+
urgent: "urgent";
|
|
20
|
+
}>>;
|
|
21
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
22
|
+
estimatedDueDate: z.ZodOptional<z.ZodISODate>;
|
|
23
|
+
type: z.ZodLiteral<"coverageRequest">;
|
|
24
|
+
description: z.ZodOptional<z.ZodString>;
|
|
25
|
+
name: z.ZodString;
|
|
26
|
+
priority: z.ZodOptional<z.ZodEnum<{
|
|
27
|
+
unprioritized: "unprioritized";
|
|
28
|
+
low: "low";
|
|
29
|
+
medium: "medium";
|
|
30
|
+
high: "high";
|
|
31
|
+
urgent: "urgent";
|
|
32
|
+
}>>;
|
|
33
|
+
}, z.core.$strip>], "type">;
|
|
34
|
+
readonly kind: "write";
|
|
35
|
+
readonly name: "issue.create";
|
|
36
|
+
readonly output: z.ZodObject<{
|
|
37
|
+
issue: z.ZodObject<{
|
|
38
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
39
|
+
description: z.ZodString;
|
|
40
|
+
issueId: IssueId;
|
|
41
|
+
name: z.ZodString;
|
|
42
|
+
number: z.ZodNumber;
|
|
43
|
+
priority: z.ZodEnum<{
|
|
44
|
+
unprioritized: "unprioritized";
|
|
45
|
+
low: "low";
|
|
46
|
+
medium: "medium";
|
|
47
|
+
high: "high";
|
|
48
|
+
urgent: "urgent";
|
|
49
|
+
}>;
|
|
50
|
+
reproductions: z.ZodArray<z.ZodObject<{
|
|
51
|
+
environmentId: EnvironmentId;
|
|
52
|
+
firstReproducedInRunId: RunId;
|
|
53
|
+
flowId: FlowId;
|
|
54
|
+
isActive: z.ZodBoolean;
|
|
55
|
+
lastReproducedInRunId: RunId;
|
|
56
|
+
}, z.core.$strip>>;
|
|
57
|
+
status: z.ZodEnum<{
|
|
58
|
+
pending: "pending";
|
|
59
|
+
inProgress: "inProgress";
|
|
60
|
+
paused: "paused";
|
|
61
|
+
resolved: "resolved";
|
|
62
|
+
canceled: "canceled";
|
|
63
|
+
archived: "archived";
|
|
64
|
+
}>;
|
|
65
|
+
type: z.ZodEnum<{
|
|
66
|
+
bug: "bug";
|
|
67
|
+
coverageRequest: "coverageRequest";
|
|
68
|
+
maintenance: "maintenance";
|
|
69
|
+
}>;
|
|
70
|
+
url: z.ZodURL;
|
|
71
|
+
}, z.core.$strip>;
|
|
72
|
+
}, z.core.$strip>;
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/v1/issue/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAIhD,eAAO,MAAM,uBAAuB,GAClC,aAAa,SAAS,cAAc,EACpC,MAAM,SAAS,cAAc,EAC7B,KAAK,SAAS,cAAc,EAC5B,OAAO,SAAS,cAAc,EAC9B,KAAK;IACL,WAAW,EAAE,aAAa,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,EAAE,KAAK,CAAC;CACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgDA,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { issuePrioritySchema, makeIssueResourceSchema } from "./index.js";
|
|
3
|
+
export const makeCreateIssueContract = (ids) => {
|
|
4
|
+
const commonFields = {
|
|
5
|
+
description: z
|
|
6
|
+
.string()
|
|
7
|
+
.optional()
|
|
8
|
+
.describe("The issue description as plain text; each line becomes a paragraph. Markdown is not parsed."),
|
|
9
|
+
// Trimmed so a whitespace-only name cannot create a blank-titled issue.
|
|
10
|
+
name: z.string().trim().min(1).max(255),
|
|
11
|
+
priority: issuePrioritySchema
|
|
12
|
+
.optional()
|
|
13
|
+
.describe('Defaults to "unprioritized".'),
|
|
14
|
+
};
|
|
15
|
+
const input = z.discriminatedUnion("type", [
|
|
16
|
+
z.object({
|
|
17
|
+
...commonFields,
|
|
18
|
+
type: z.literal("bug"),
|
|
19
|
+
}),
|
|
20
|
+
z.object({
|
|
21
|
+
...commonFields,
|
|
22
|
+
estimatedDueDate: z.iso
|
|
23
|
+
.date()
|
|
24
|
+
.optional()
|
|
25
|
+
.describe("The calendar date the coverage is estimated to be complete, as YYYY-MM-DD."),
|
|
26
|
+
type: z.literal("coverageRequest"),
|
|
27
|
+
}),
|
|
28
|
+
]);
|
|
29
|
+
const output = z.object({
|
|
30
|
+
issue: makeIssueResourceSchema(ids),
|
|
31
|
+
});
|
|
32
|
+
return {
|
|
33
|
+
description: "Create a bug or coverage request issue for the caller's team. " +
|
|
34
|
+
"Maintenance issues cannot be created through the public API.",
|
|
35
|
+
input,
|
|
36
|
+
kind: "write",
|
|
37
|
+
name: "issue.create",
|
|
38
|
+
output,
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/v1/issue/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAE1E,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAKrC,GAKD,EAAE,EAAE;IACH,MAAM,YAAY,GAAG;QACnB,WAAW,EAAE,CAAC;aACX,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,6FAA6F,CAC9F;QACH,wEAAwE;QACxE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;QACvC,QAAQ,EAAE,mBAAmB;aAC1B,QAAQ,EAAE;aACV,QAAQ,CAAC,8BAA8B,CAAC;KAC5C,CAAC;IACF,MAAM,KAAK,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;QACzC,CAAC,CAAC,MAAM,CAAC;YACP,GAAG,YAAY;YACf,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;SACvB,CAAC;QACF,CAAC,CAAC,MAAM,CAAC;YACP,GAAG,YAAY;YACf,gBAAgB,EAAE,CAAC,CAAC,GAAG;iBACpB,IAAI,EAAE;iBACN,QAAQ,EAAE;iBACV,QAAQ,CACP,4EAA4E,CAC7E;YACH,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC;SACnC,CAAC;KACH,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;QACtB,KAAK,EAAE,uBAAuB,CAAC,GAAG,CAAC;KACpC,CAAC,CAAC;IAEH,OAAO;QACL,WAAW,EACT,gEAAgE;YAChE,8DAA8D;QAChE,KAAK;QACL,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,cAAc;QACpB,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { PublicIdSchema } from "../ids.js";
|
|
3
|
+
export declare const issuePrioritySchema: z.ZodEnum<{
|
|
4
|
+
unprioritized: "unprioritized";
|
|
5
|
+
low: "low";
|
|
6
|
+
medium: "medium";
|
|
7
|
+
high: "high";
|
|
8
|
+
urgent: "urgent";
|
|
9
|
+
}>;
|
|
10
|
+
export declare const makeIssueResourceSchema: <EnvironmentId extends PublicIdSchema, FlowId extends PublicIdSchema, RunId extends PublicIdSchema, IssueId extends PublicIdSchema>(ids: {
|
|
11
|
+
environment: EnvironmentId;
|
|
12
|
+
flow: FlowId;
|
|
13
|
+
issue: IssueId;
|
|
14
|
+
run: RunId;
|
|
15
|
+
}) => z.ZodObject<{
|
|
16
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
17
|
+
description: z.ZodString;
|
|
18
|
+
issueId: IssueId;
|
|
19
|
+
name: z.ZodString;
|
|
20
|
+
number: z.ZodNumber;
|
|
21
|
+
priority: z.ZodEnum<{
|
|
22
|
+
unprioritized: "unprioritized";
|
|
23
|
+
low: "low";
|
|
24
|
+
medium: "medium";
|
|
25
|
+
high: "high";
|
|
26
|
+
urgent: "urgent";
|
|
27
|
+
}>;
|
|
28
|
+
reproductions: z.ZodArray<z.ZodObject<{
|
|
29
|
+
environmentId: EnvironmentId;
|
|
30
|
+
firstReproducedInRunId: RunId;
|
|
31
|
+
flowId: FlowId;
|
|
32
|
+
isActive: z.ZodBoolean;
|
|
33
|
+
lastReproducedInRunId: RunId;
|
|
34
|
+
}, z.core.$strip>>;
|
|
35
|
+
status: z.ZodEnum<{
|
|
36
|
+
pending: "pending";
|
|
37
|
+
inProgress: "inProgress";
|
|
38
|
+
paused: "paused";
|
|
39
|
+
resolved: "resolved";
|
|
40
|
+
canceled: "canceled";
|
|
41
|
+
archived: "archived";
|
|
42
|
+
}>;
|
|
43
|
+
type: z.ZodEnum<{
|
|
44
|
+
bug: "bug";
|
|
45
|
+
coverageRequest: "coverageRequest";
|
|
46
|
+
maintenance: "maintenance";
|
|
47
|
+
}>;
|
|
48
|
+
url: z.ZodURL;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
export declare const makeFindIssuesContract: <EnvironmentId extends PublicIdSchema, FlowId extends PublicIdSchema, RunId extends PublicIdSchema, IssueId extends PublicIdSchema>(ids: {
|
|
51
|
+
environment: EnvironmentId;
|
|
52
|
+
flow: FlowId;
|
|
53
|
+
issue: IssueId;
|
|
54
|
+
run: RunId;
|
|
55
|
+
}) => {
|
|
56
|
+
readonly description: "List the team's bug reports, maintenance reports, or coverage requests, newest first.";
|
|
57
|
+
readonly input: z.ZodObject<{
|
|
58
|
+
statuses: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
59
|
+
pending: "pending";
|
|
60
|
+
inProgress: "inProgress";
|
|
61
|
+
paused: "paused";
|
|
62
|
+
resolved: "resolved";
|
|
63
|
+
canceled: "canceled";
|
|
64
|
+
archived: "archived";
|
|
65
|
+
}>>>;
|
|
66
|
+
type: z.ZodEnum<{
|
|
67
|
+
bug: "bug";
|
|
68
|
+
coverageRequest: "coverageRequest";
|
|
69
|
+
maintenance: "maintenance";
|
|
70
|
+
}>;
|
|
71
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
72
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
73
|
+
}, z.core.$strip>;
|
|
74
|
+
readonly kind: "read";
|
|
75
|
+
readonly name: "issue.find";
|
|
76
|
+
readonly output: z.ZodObject<{
|
|
77
|
+
issues: z.ZodArray<z.ZodObject<{
|
|
78
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
79
|
+
description: z.ZodString;
|
|
80
|
+
issueId: IssueId;
|
|
81
|
+
name: z.ZodString;
|
|
82
|
+
number: z.ZodNumber;
|
|
83
|
+
priority: z.ZodEnum<{
|
|
84
|
+
unprioritized: "unprioritized";
|
|
85
|
+
low: "low";
|
|
86
|
+
medium: "medium";
|
|
87
|
+
high: "high";
|
|
88
|
+
urgent: "urgent";
|
|
89
|
+
}>;
|
|
90
|
+
reproductions: z.ZodArray<z.ZodObject<{
|
|
91
|
+
environmentId: EnvironmentId;
|
|
92
|
+
firstReproducedInRunId: RunId;
|
|
93
|
+
flowId: FlowId;
|
|
94
|
+
isActive: z.ZodBoolean;
|
|
95
|
+
lastReproducedInRunId: RunId;
|
|
96
|
+
}, z.core.$strip>>;
|
|
97
|
+
status: z.ZodEnum<{
|
|
98
|
+
pending: "pending";
|
|
99
|
+
inProgress: "inProgress";
|
|
100
|
+
paused: "paused";
|
|
101
|
+
resolved: "resolved";
|
|
102
|
+
canceled: "canceled";
|
|
103
|
+
archived: "archived";
|
|
104
|
+
}>;
|
|
105
|
+
type: z.ZodEnum<{
|
|
106
|
+
bug: "bug";
|
|
107
|
+
coverageRequest: "coverageRequest";
|
|
108
|
+
maintenance: "maintenance";
|
|
109
|
+
}>;
|
|
110
|
+
url: z.ZodURL;
|
|
111
|
+
}, z.core.$strip>>;
|
|
112
|
+
nextCursor: z.ZodOptional<z.ZodString>;
|
|
113
|
+
}, z.core.$strip>;
|
|
114
|
+
};
|
|
115
|
+
export declare const makeGetIssueContract: <EnvironmentId extends PublicIdSchema, FlowId extends PublicIdSchema, RunId extends PublicIdSchema, IssueId extends PublicIdSchema>(ids: {
|
|
116
|
+
environment: EnvironmentId;
|
|
117
|
+
flow: FlowId;
|
|
118
|
+
issue: IssueId;
|
|
119
|
+
run: RunId;
|
|
120
|
+
}) => {
|
|
121
|
+
readonly description: "Get an issue by id.";
|
|
122
|
+
readonly input: z.ZodObject<{
|
|
123
|
+
issueId: IssueId;
|
|
124
|
+
}, z.core.$strip>;
|
|
125
|
+
readonly kind: "read";
|
|
126
|
+
readonly name: "issue.get";
|
|
127
|
+
readonly output: z.ZodObject<{
|
|
128
|
+
issue: z.ZodObject<{
|
|
129
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
130
|
+
description: z.ZodString;
|
|
131
|
+
issueId: IssueId;
|
|
132
|
+
name: z.ZodString;
|
|
133
|
+
number: z.ZodNumber;
|
|
134
|
+
priority: z.ZodEnum<{
|
|
135
|
+
unprioritized: "unprioritized";
|
|
136
|
+
low: "low";
|
|
137
|
+
medium: "medium";
|
|
138
|
+
high: "high";
|
|
139
|
+
urgent: "urgent";
|
|
140
|
+
}>;
|
|
141
|
+
reproductions: z.ZodArray<z.ZodObject<{
|
|
142
|
+
environmentId: EnvironmentId;
|
|
143
|
+
firstReproducedInRunId: RunId;
|
|
144
|
+
flowId: FlowId;
|
|
145
|
+
isActive: z.ZodBoolean;
|
|
146
|
+
lastReproducedInRunId: RunId;
|
|
147
|
+
}, z.core.$strip>>;
|
|
148
|
+
status: z.ZodEnum<{
|
|
149
|
+
pending: "pending";
|
|
150
|
+
inProgress: "inProgress";
|
|
151
|
+
paused: "paused";
|
|
152
|
+
resolved: "resolved";
|
|
153
|
+
canceled: "canceled";
|
|
154
|
+
archived: "archived";
|
|
155
|
+
}>;
|
|
156
|
+
type: z.ZodEnum<{
|
|
157
|
+
bug: "bug";
|
|
158
|
+
coverageRequest: "coverageRequest";
|
|
159
|
+
maintenance: "maintenance";
|
|
160
|
+
}>;
|
|
161
|
+
url: z.ZodURL;
|
|
162
|
+
}, z.core.$strip>;
|
|
163
|
+
}, z.core.$strip>;
|
|
164
|
+
};
|
|
165
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/v1/issue/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAIhD,eAAO,MAAM,mBAAmB;;;;;;EAM9B,CAAC;AAeH,eAAO,MAAM,uBAAuB,GAClC,aAAa,SAAS,cAAc,EACpC,MAAM,SAAS,cAAc,EAC7B,KAAK,SAAS,cAAc,EAC5B,OAAO,SAAS,cAAc,EAC9B,KAAK;IACL,WAAW,EAAE,aAAa,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,EAAE,KAAK,CAAC;CACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0BE,CAAC;AAEJ,eAAO,MAAM,sBAAsB,GACjC,aAAa,SAAS,cAAc,EACpC,MAAM,SAAS,cAAc,EAC7B,KAAK,SAAS,cAAc,EAC5B,OAAO,SAAS,cAAc,EAC9B,KAAK;IACL,WAAW,EAAE,aAAa,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,EAAE,KAAK,CAAC;CACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCA,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,aAAa,SAAS,cAAc,EACpC,MAAM,SAAS,cAAc,EAC7B,KAAK,SAAS,cAAc,EAC5B,OAAO,SAAS,cAAc,EAC9B,KAAK;IACL,WAAW,EAAE,aAAa,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,EAAE,KAAK,CAAC;CACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoBA,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { makePaginationInputFields, nextCursorSchema } from "../pagination.js";
|
|
3
|
+
import { resource } from "../resource.js";
|
|
4
|
+
export const issuePrioritySchema = z.enum([
|
|
5
|
+
"unprioritized",
|
|
6
|
+
"low",
|
|
7
|
+
"medium",
|
|
8
|
+
"high",
|
|
9
|
+
"urgent",
|
|
10
|
+
]);
|
|
11
|
+
const issueStatusSchema = z.enum([
|
|
12
|
+
"pending",
|
|
13
|
+
"inProgress",
|
|
14
|
+
"paused",
|
|
15
|
+
"resolved",
|
|
16
|
+
"canceled",
|
|
17
|
+
"archived",
|
|
18
|
+
]);
|
|
19
|
+
const publicIssueTypeSchema = z.enum(["bug", "coverageRequest", "maintenance"]);
|
|
20
|
+
const openIssueStatuses = ["pending", "inProgress", "paused"];
|
|
21
|
+
export const makeIssueResourceSchema = (ids) => resource({
|
|
22
|
+
createdAt: z.coerce.date().describe("When the issue was created."),
|
|
23
|
+
description: z.string().describe("The issue description in Markdown."),
|
|
24
|
+
issueId: ids.issue,
|
|
25
|
+
name: z.string(),
|
|
26
|
+
number: z.number().int(),
|
|
27
|
+
priority: issuePrioritySchema,
|
|
28
|
+
reproductions: z
|
|
29
|
+
.array(z.object({
|
|
30
|
+
environmentId: ids.environment,
|
|
31
|
+
firstReproducedInRunId: ids.run,
|
|
32
|
+
flowId: ids.flow,
|
|
33
|
+
isActive: z.boolean(),
|
|
34
|
+
lastReproducedInRunId: ids.run,
|
|
35
|
+
}))
|
|
36
|
+
.describe("The environments, flows, and runs where the issue was reproduced."),
|
|
37
|
+
status: issueStatusSchema,
|
|
38
|
+
type: publicIssueTypeSchema,
|
|
39
|
+
}, { urlFieldDescription: "Absolute URL of the issue page." });
|
|
40
|
+
export const makeFindIssuesContract = (ids) => {
|
|
41
|
+
const input = z.object({
|
|
42
|
+
...makePaginationInputFields({ defaultLimit: 20, maxLimit: 100 }),
|
|
43
|
+
statuses: z
|
|
44
|
+
.array(issueStatusSchema)
|
|
45
|
+
.min(1)
|
|
46
|
+
.default([...openIssueStatuses])
|
|
47
|
+
.describe("Issue statuses to include. Defaults to pending, in-progress, and paused issues."),
|
|
48
|
+
type: publicIssueTypeSchema.describe("The issue type to include: bug report, maintenance report, or coverage request."),
|
|
49
|
+
});
|
|
50
|
+
const output = z.object({
|
|
51
|
+
issues: z
|
|
52
|
+
.array(makeIssueResourceSchema(ids))
|
|
53
|
+
.describe("The team's bug reports, maintenance reports, or coverage requests, newest first."),
|
|
54
|
+
nextCursor: nextCursorSchema,
|
|
55
|
+
});
|
|
56
|
+
return {
|
|
57
|
+
description: "List the team's bug reports, maintenance reports, or coverage requests, newest first.",
|
|
58
|
+
input,
|
|
59
|
+
kind: "read",
|
|
60
|
+
name: "issue.find",
|
|
61
|
+
output,
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
export const makeGetIssueContract = (ids) => {
|
|
65
|
+
const input = z.object({
|
|
66
|
+
issueId: ids.issue,
|
|
67
|
+
});
|
|
68
|
+
const output = z.object({
|
|
69
|
+
issue: makeIssueResourceSchema(ids),
|
|
70
|
+
});
|
|
71
|
+
return {
|
|
72
|
+
description: "Get an issue by id.",
|
|
73
|
+
input,
|
|
74
|
+
kind: "read",
|
|
75
|
+
name: "issue.get",
|
|
76
|
+
output,
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v1/issue/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB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H,OAAO;QACL,WAAW,EAAE,qBAAqB;QAClC,KAAK;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,WAAW;QACjB,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* The shared pagination input fields for public list contracts. The `cursor`
|
|
4
|
+
* field is opaque. The caller copies it from the `nextCursor` field of the
|
|
5
|
+
* previous response. Spread the fields into the input object of the contract.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* const input = z.object({
|
|
9
|
+
* environmentId: ids.environment,
|
|
10
|
+
* ...makePaginationInputFields({ defaultLimit: 20, maxLimit: 50 }),
|
|
11
|
+
* });
|
|
12
|
+
*/
|
|
13
|
+
export declare const makePaginationInputFields: (limits: {
|
|
14
|
+
defaultLimit: number;
|
|
15
|
+
maxLimit: number;
|
|
16
|
+
}) => {
|
|
17
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
18
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* The output field that pairs with {@link makePaginationInputFields}. The
|
|
22
|
+
* field is present when more results exist. The field is absent on the last
|
|
23
|
+
* page.
|
|
24
|
+
*/
|
|
25
|
+
export declare const nextCursorSchema: z.ZodOptional<z.ZodString>;
|
|
26
|
+
//# sourceMappingURL=pagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src/v1/pagination.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;GAUG;AACH,eAAO,MAAM,yBAAyB,GAAI,QAAQ;IAChD,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;CAClB;;;CAiBC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,4BAM1B,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* The shared pagination input fields for public list contracts. The `cursor`
|
|
4
|
+
* field is opaque. The caller copies it from the `nextCursor` field of the
|
|
5
|
+
* previous response. Spread the fields into the input object of the contract.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* const input = z.object({
|
|
9
|
+
* environmentId: ids.environment,
|
|
10
|
+
* ...makePaginationInputFields({ defaultLimit: 20, maxLimit: 50 }),
|
|
11
|
+
* });
|
|
12
|
+
*/
|
|
13
|
+
export const makePaginationInputFields = (limits) => ({
|
|
14
|
+
cursor: z
|
|
15
|
+
.string()
|
|
16
|
+
.min(1)
|
|
17
|
+
.optional()
|
|
18
|
+
.describe("Opaque cursor copied from the previous response's nextCursor. Omit to fetch the first page."),
|
|
19
|
+
limit: z
|
|
20
|
+
.number()
|
|
21
|
+
.int()
|
|
22
|
+
.min(1)
|
|
23
|
+
.max(limits.maxLimit)
|
|
24
|
+
.default(limits.defaultLimit)
|
|
25
|
+
.describe(`Maximum rows per page. Defaults to ${limits.defaultLimit}, capped at ${limits.maxLimit}.`),
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* The output field that pairs with {@link makePaginationInputFields}. The
|
|
29
|
+
* field is present when more results exist. The field is absent on the last
|
|
30
|
+
* page.
|
|
31
|
+
*/
|
|
32
|
+
export const nextCursorSchema = z
|
|
33
|
+
.string()
|
|
34
|
+
.min(1)
|
|
35
|
+
.optional()
|
|
36
|
+
.describe("Repeat the request with this value as cursor to fetch the next page. Absent when there are no further results.");
|
|
37
|
+
//# sourceMappingURL=pagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../src/v1/pagination.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,MAGzC,EAAE,EAAE,CAAC,CAAC;IACL,MAAM,EAAE,CAAC;SACN,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,EAAE;SACV,QAAQ,CACP,6FAA6F,CAC9F;IACH,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC;SACpB,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC;SAC5B,QAAQ,CACP,sCAAsC,MAAM,CAAC,YAAY,eAAe,MAAM,CAAC,QAAQ,GAAG,CAC3F;CACJ,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC;KAC9B,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,QAAQ,EAAE;KACV,QAAQ,CACP,gHAAgH,CACjH,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
type ResourceOptions = {
|
|
3
|
+
urlFieldDescription?: string;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Builds the zod object schema for a resource returned by a public contract.
|
|
7
|
+
*
|
|
8
|
+
* Every public resource carries a `url` — an absolute app link — alongside its
|
|
9
|
+
* own fields, so this factory always injects it. Because resource schemas are
|
|
10
|
+
* built through here, you cannot define one without a `url`: the convention is
|
|
11
|
+
* enforced by construction rather than left to each contract to remember.
|
|
12
|
+
*
|
|
13
|
+
* The schema comes first; `url` presentation is a secondary, optional concern
|
|
14
|
+
* passed through the options object.
|
|
15
|
+
*/
|
|
16
|
+
export declare function resource<Shape extends z.ZodRawShape>(fields: Shape, { urlFieldDescription }?: ResourceOptions): z.ZodObject<Shape & {
|
|
17
|
+
url: z.ZodURL;
|
|
18
|
+
} extends infer T ? { -readonly [P in keyof T]: T[P]; } : never, z.core.$strip>;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=resource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../src/v1/resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,KAAK,eAAe,GAAG;IACrB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,KAAK,SAAS,CAAC,CAAC,WAAW,EAClD,MAAM,EAAE,KAAK,EACb,EAAE,mBAAqC,EAAE,GAAE,eAAoB;;gFAMhE"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Builds the zod object schema for a resource returned by a public contract.
|
|
4
|
+
*
|
|
5
|
+
* Every public resource carries a `url` — an absolute app link — alongside its
|
|
6
|
+
* own fields, so this factory always injects it. Because resource schemas are
|
|
7
|
+
* built through here, you cannot define one without a `url`: the convention is
|
|
8
|
+
* enforced by construction rather than left to each contract to remember.
|
|
9
|
+
*
|
|
10
|
+
* The schema comes first; `url` presentation is a secondary, optional concern
|
|
11
|
+
* passed through the options object.
|
|
12
|
+
*/
|
|
13
|
+
export function resource(fields, { urlFieldDescription = "Absolute URL." } = {}) {
|
|
14
|
+
return z.object({
|
|
15
|
+
...fields,
|
|
16
|
+
url: z.url().describe(urlFieldDescription),
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=resource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource.js","sourceRoot":"","sources":["../../src/v1/resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;;;;;;;;;GAUG;AACH,MAAM,UAAU,QAAQ,CACtB,MAAa,EACb,EAAE,mBAAmB,GAAG,eAAe,KAAsB,EAAE;IAE/D,OAAO,CAAC,CAAC,MAAM,CAAC;QACd,GAAG,MAAM;QACT,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;KAC3C,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { PublicIdSchema } from "../ids.js";
|
|
3
|
+
export declare const makeFindRunsContract: <EnvironmentId extends PublicIdSchema, RunId extends PublicIdSchema>(ids: {
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
environment: EnvironmentId;
|
|
6
|
+
run: RunId;
|
|
7
|
+
}) => {
|
|
8
|
+
readonly description: "List an environment's recent runs, newest first.";
|
|
9
|
+
readonly input: z.ZodObject<{
|
|
10
|
+
environmentId: EnvironmentId;
|
|
11
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
12
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
13
|
+
createdAfter: z.ZodOptional<z.ZodISODateTime>;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
readonly kind: "read";
|
|
16
|
+
readonly name: "run.find";
|
|
17
|
+
readonly output: z.ZodObject<{
|
|
18
|
+
nextCursor: z.ZodOptional<z.ZodString>;
|
|
19
|
+
runs: z.ZodArray<z.ZodObject<{
|
|
20
|
+
completedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
21
|
+
createdAt: z.ZodISODateTime;
|
|
22
|
+
git: z.ZodObject<{
|
|
23
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
24
|
+
commitMessage: z.ZodOptional<z.ZodString>;
|
|
25
|
+
commitSha: z.ZodOptional<z.ZodString>;
|
|
26
|
+
commitUrl: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
runId: RunId;
|
|
29
|
+
status: z.ZodEnum<{
|
|
30
|
+
running: "running";
|
|
31
|
+
canceled: "canceled";
|
|
32
|
+
queued: "queued";
|
|
33
|
+
passed: "passed";
|
|
34
|
+
failed: "failed";
|
|
35
|
+
}>;
|
|
36
|
+
url: z.ZodURL;
|
|
37
|
+
}, z.core.$strip>>;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=find.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find.d.ts","sourceRoot":"","sources":["../../../src/v1/run/find.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAMhD,eAAO,MAAM,oBAAoB,GAC/B,aAAa,SAAS,cAAc,EACpC,KAAK,SAAS,cAAc,EAC5B,KAAK;IACL,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,WAAW,EAAE,aAAa,CAAC;IAC3B,GAAG,EAAE,KAAK,CAAC;CACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0CA,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { makePaginationInputFields, nextCursorSchema } from "../pagination.js";
|
|
3
|
+
import { resource } from "../resource.js";
|
|
4
|
+
import { makeRunSummaryFields } from "./summary.js";
|
|
5
|
+
export const makeFindRunsContract = (ids) => {
|
|
6
|
+
const input = z.object({
|
|
7
|
+
// `offset: true` accepts all ISO 8601 datetimes, with `Z` or with a
|
|
8
|
+
// timezone offset. Without it, zod rejects valid inputs such as
|
|
9
|
+
// `2026-07-01T00:00:00+02:00`.
|
|
10
|
+
createdAfter: z.iso
|
|
11
|
+
.datetime({ offset: true })
|
|
12
|
+
.optional()
|
|
13
|
+
.describe("Only include runs created after this instant, e.g. the runs since a deploy."),
|
|
14
|
+
// Rows are summaries, so pages stay small. A caller that wants more rows
|
|
15
|
+
// walks the cursor to more pages. The cap stays small.
|
|
16
|
+
...makePaginationInputFields({ defaultLimit: 20, maxLimit: 100 }),
|
|
17
|
+
environmentId: ids.environment,
|
|
18
|
+
});
|
|
19
|
+
const output = z.object({
|
|
20
|
+
nextCursor: nextCursorSchema,
|
|
21
|
+
runs: z
|
|
22
|
+
.array(resource(makeRunSummaryFields(ids), {
|
|
23
|
+
urlFieldDescription: "Absolute URL of the run page.",
|
|
24
|
+
}))
|
|
25
|
+
.describe("The environment's runs, newest first. Per-flow results are available via run.get."),
|
|
26
|
+
});
|
|
27
|
+
return {
|
|
28
|
+
description: "List an environment's recent runs, newest first.",
|
|
29
|
+
input,
|
|
30
|
+
kind: "read",
|
|
31
|
+
name: "run.find",
|
|
32
|
+
output,
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=find.js.map
|