@qawolf/api-contracts 0.2.0 → 0.14.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/find.d.ts +46 -0
- package/dist/v1/environment/find.d.ts.map +1 -0
- package/dist/v1/environment/find.js +30 -0
- package/dist/v1/environment/find.js.map +1 -0
- package/dist/v1/environment/index.d.ts +92 -0
- package/dist/v1/environment/index.d.ts.map +1 -0
- package/dist/v1/environment/index.js +84 -0
- package/dist/v1/environment/index.js.map +1 -0
- package/dist/v1/environment/resource.d.ts +29 -0
- package/dist/v1/environment/resource.d.ts.map +1 -0
- package/dist/v1/environment/resource.js +46 -0
- package/dist/v1/environment/resource.js.map +1 -0
- package/dist/v1/flow/addTag.d.ts +19 -0
- package/dist/v1/flow/addTag.d.ts.map +1 -0
- package/dist/v1/flow/addTag.js +29 -0
- package/dist/v1/flow/addTag.js.map +1 -0
- package/dist/v1/flow/index.d.ts +6 -2
- package/dist/v1/flow/index.d.ts.map +1 -1
- package/dist/v1/flow/index.js +7 -2
- package/dist/v1/flow/index.js.map +1 -1
- 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 +878 -9
- package/dist/v1/index.d.ts.map +1 -1
- package/dist/v1/index.js +42 -8
- package/dist/v1/index.js.map +1 -1
- package/dist/v1/issue/create.d.ts +77 -0
- package/dist/v1/issue/create.d.ts.map +1 -0
- package/dist/v1/issue/create.js +44 -0
- package/dist/v1/issue/create.js.map +1 -0
- package/dist/v1/issue/index.d.ts +167 -0
- package/dist/v1/issue/index.d.ts.map +1 -0
- package/dist/v1/issue/index.js +82 -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 +9 -9
package/README.md
CHANGED
|
@@ -16,6 +16,6 @@ This package must not depend on internal packages or expose internal concepts: i
|
|
|
16
16
|
|
|
17
17
|
## Publishing
|
|
18
18
|
|
|
19
|
-
This package is
|
|
19
|
+
This package is published to the public npm registry so external repositories such as `qawolf/cli` can consume the public contracts.
|
|
20
20
|
|
|
21
21
|
To publish a new version, bump `version` in `package.json` and run `npm publish` from this directory with an npm token authorized for the `@qawolf` scope (the build runs automatically via `prepublishOnly`).
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { PublicIdSchema, PublicIdSchemasOf } from "../ids.js";
|
|
3
|
+
export declare const makeAutomateContract: <EnvironmentId extends PublicIdSchema, FlowId extends PublicIdSchema, RunId extends PublicIdSchema, AutomationId extends PublicIdSchema>(ids: PublicIdSchemasOf<EnvironmentId, FlowId, RunId, AutomationId>) => {
|
|
4
|
+
readonly description: "Request an automation that builds the selected draft flows in an environment.";
|
|
5
|
+
readonly input: z.ZodObject<{
|
|
6
|
+
environmentId: EnvironmentId;
|
|
7
|
+
flowIds: z.ZodArray<FlowId>;
|
|
8
|
+
patch: z.ZodOptional<z.ZodString>;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
readonly kind: "write";
|
|
11
|
+
readonly name: "automate";
|
|
12
|
+
readonly output: z.ZodObject<{
|
|
13
|
+
automationId: AutomationId;
|
|
14
|
+
url: z.ZodURL;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/v1/automate/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAGnE,eAAO,MAAM,oBAAoB,GAC/B,aAAa,SAAS,cAAc,EACpC,MAAM,SAAS,cAAc,EAC7B,KAAK,SAAS,cAAc,EAC5B,YAAY,SAAS,cAAc,EAEnC,KAAK,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,CAAC;;;;;;;;;;;;;CAyCnE,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { resource } from "../resource.js";
|
|
3
|
+
export const makeAutomateContract = (ids) => {
|
|
4
|
+
const input = z.object({
|
|
5
|
+
environmentId: ids.environment,
|
|
6
|
+
flowIds: z
|
|
7
|
+
.array(ids.flow)
|
|
8
|
+
.min(1)
|
|
9
|
+
// Matches the server's maxJobsPerAiJobGroup cap.
|
|
10
|
+
.max(300)
|
|
11
|
+
.refine((flowIds) => new Set(flowIds).size === flowIds.length, "flowIds must be unique")
|
|
12
|
+
.describe("Draft flows the automation builds."),
|
|
13
|
+
patch: z
|
|
14
|
+
.string()
|
|
15
|
+
.min(1)
|
|
16
|
+
.max(1_000_000)
|
|
17
|
+
.optional()
|
|
18
|
+
.describe("Unified diff applied to the automation's working branch before it runs."),
|
|
19
|
+
});
|
|
20
|
+
const output = resource({ automationId: ids.automation }, { urlFieldDescription: "Absolute URL of the automation review page." });
|
|
21
|
+
return {
|
|
22
|
+
description: "Request an automation that builds the selected draft flows in an environment.",
|
|
23
|
+
input,
|
|
24
|
+
kind: "write",
|
|
25
|
+
name: "automate",
|
|
26
|
+
output,
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v1/automate/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAMlC,GAAkE,EAClE,EAAE;IACF,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QACrB,aAAa,EAAE,GAAG,CAAC,WAAW;QAC9B,OAAO,EAAE,CAAC;aACP,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC;aACf,GAAG,CAAC,CAAC,CAAC;YACP,iDAAiD;aAChD,GAAG,CAAC,GAAG,CAAC;aACR,MAAM,CACL,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,MAAM,EACrD,wBAAwB,CACzB;aACA,QAAQ,CAAC,oCAAoC,CAAC;QACjD,KAAK,EAAE,CAAC;aACL,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,GAAG,CAAC,SAAS,CAAC;aACd,QAAQ,EAAE;aACV,QAAQ,CACP,yEAAyE,CAC1E;KACJ,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,QAAQ,CACrB,EAAE,YAAY,EAAE,GAAG,CAAC,UAAU,EAAE,EAChC,EAAE,mBAAmB,EAAE,6CAA6C,EAAE,CACvE,CAAC;IAEF,OAAO;QACL,WAAW,EACT,+EAA+E;QACjF,KAAK;QACL,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,UAAU;QAChB,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { PublicIdSchema } from "../ids.js";
|
|
3
|
+
export declare const makeFindEnvironmentsContract: <EnvironmentId extends PublicIdSchema>(ids: {
|
|
4
|
+
environment: EnvironmentId;
|
|
5
|
+
}) => {
|
|
6
|
+
readonly description: "List the team's environments, newest first.";
|
|
7
|
+
readonly input: z.ZodObject<{
|
|
8
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
9
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
10
|
+
includeTerminated: z.ZodDefault<z.ZodBoolean>;
|
|
11
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
12
|
+
static: "static";
|
|
13
|
+
preview: "preview";
|
|
14
|
+
}>>;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
readonly kind: "read";
|
|
17
|
+
readonly name: "environment.find";
|
|
18
|
+
readonly output: z.ZodObject<{
|
|
19
|
+
environments: z.ZodArray<z.ZodObject<{
|
|
20
|
+
flowCodeBranch: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
21
|
+
lastSyncedCommitHash: z.ZodString;
|
|
22
|
+
name: z.ZodString;
|
|
23
|
+
syncStatus: z.ZodLiteral<"reconciled">;
|
|
24
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
25
|
+
name: z.ZodString;
|
|
26
|
+
syncStatus: z.ZodLiteral<"not-reconciled">;
|
|
27
|
+
}, z.core.$strip>], "syncStatus">>;
|
|
28
|
+
id: EnvironmentId;
|
|
29
|
+
kind: z.ZodEnum<{
|
|
30
|
+
static: "static";
|
|
31
|
+
preview: "preview";
|
|
32
|
+
}>;
|
|
33
|
+
name: z.ZodString;
|
|
34
|
+
status: z.ZodEnum<{
|
|
35
|
+
blocked: "blocked";
|
|
36
|
+
"needs-investigation": "needs-investigation";
|
|
37
|
+
ready: "ready";
|
|
38
|
+
running: "running";
|
|
39
|
+
}>;
|
|
40
|
+
terminatedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
41
|
+
url: z.ZodURL;
|
|
42
|
+
}, z.core.$strip>>;
|
|
43
|
+
nextCursor: z.ZodOptional<z.ZodString>;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=find.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find.d.ts","sourceRoot":"","sources":["../../../src/v1/environment/find.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAKhD,eAAO,MAAM,4BAA4B,GACvC,aAAa,SAAS,cAAc,EACpC,KAAK;IACL,WAAW,EAAE,aAAa,CAAC;CAC5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCA,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { makePaginationInputFields, nextCursorSchema } from "../pagination.js";
|
|
3
|
+
import { makeEnvironmentResourceSchema } from "./resource.js";
|
|
4
|
+
export const makeFindEnvironmentsContract = (ids) => {
|
|
5
|
+
const input = z.object({
|
|
6
|
+
includeTerminated: z
|
|
7
|
+
.boolean()
|
|
8
|
+
.default(false)
|
|
9
|
+
.describe("Also list terminated environments. By default only environments that have not been terminated are listed."),
|
|
10
|
+
kind: z
|
|
11
|
+
.enum(["static", "preview"])
|
|
12
|
+
.optional()
|
|
13
|
+
.describe("Only list environments of this kind. Omit to list both."),
|
|
14
|
+
...makePaginationInputFields({ defaultLimit: 20, maxLimit: 100 }),
|
|
15
|
+
});
|
|
16
|
+
const output = z.object({
|
|
17
|
+
environments: z
|
|
18
|
+
.array(makeEnvironmentResourceSchema(ids))
|
|
19
|
+
.describe("The team's environments, newest first."),
|
|
20
|
+
nextCursor: nextCursorSchema,
|
|
21
|
+
});
|
|
22
|
+
return {
|
|
23
|
+
description: "List the team's environments, newest first.",
|
|
24
|
+
input,
|
|
25
|
+
kind: "read",
|
|
26
|
+
name: "environment.find",
|
|
27
|
+
output,
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=find.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find.js","sourceRoot":"","sources":["../../../src/v1/environment/find.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAE/E,OAAO,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAC;AAE9D,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAE1C,GAED,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QACrB,iBAAiB,EAAE,CAAC;aACjB,OAAO,EAAE;aACT,OAAO,CAAC,KAAK,CAAC;aACd,QAAQ,CACP,2GAA2G,CAC5G;QACH,IAAI,EAAE,CAAC;aACJ,IAAI,CAAC,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;aAC3B,QAAQ,EAAE;aACV,QAAQ,CAAC,yDAAyD,CAAC;QACtE,GAAG,yBAAyB,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC;KAClE,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;QACtB,YAAY,EAAE,CAAC;aACZ,KAAK,CAAC,6BAA6B,CAAC,GAAG,CAAC,CAAC;aACzC,QAAQ,CAAC,wCAAwC,CAAC;QACrD,UAAU,EAAE,gBAAgB;KAC7B,CAAC,CAAC;IAEH,OAAO;QACL,WAAW,EAAE,6CAA6C;QAC1D,KAAK;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,kBAAkB;QACxB,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { PublicIdSchema, PublicIdSchemasOf } from "../ids.js";
|
|
3
|
+
export declare const makeGetEnvironmentContract: <EnvironmentId extends PublicIdSchema, FlowId extends PublicIdSchema, RunId extends PublicIdSchema>(ids: PublicIdSchemasOf<EnvironmentId, FlowId, RunId>) => {
|
|
4
|
+
readonly description: "Read a single environment's name, kind, health status, and termination state.";
|
|
5
|
+
readonly input: z.ZodObject<{
|
|
6
|
+
environmentId: EnvironmentId;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
readonly kind: "read";
|
|
9
|
+
readonly name: "environment.get";
|
|
10
|
+
readonly output: z.ZodObject<{
|
|
11
|
+
flowCodeBranch: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
12
|
+
lastSyncedCommitHash: z.ZodString;
|
|
13
|
+
name: z.ZodString;
|
|
14
|
+
syncStatus: z.ZodLiteral<"reconciled">;
|
|
15
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
16
|
+
name: z.ZodString;
|
|
17
|
+
syncStatus: z.ZodLiteral<"not-reconciled">;
|
|
18
|
+
}, z.core.$strip>], "syncStatus">>;
|
|
19
|
+
id: EnvironmentId;
|
|
20
|
+
kind: z.ZodEnum<{
|
|
21
|
+
static: "static";
|
|
22
|
+
preview: "preview";
|
|
23
|
+
}>;
|
|
24
|
+
name: z.ZodString;
|
|
25
|
+
status: z.ZodEnum<{
|
|
26
|
+
blocked: "blocked";
|
|
27
|
+
"needs-investigation": "needs-investigation";
|
|
28
|
+
ready: "ready";
|
|
29
|
+
running: "running";
|
|
30
|
+
}>;
|
|
31
|
+
terminatedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
32
|
+
url: z.ZodURL;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
};
|
|
35
|
+
export declare const makeListEnvironmentVariableNamesContract: <EnvironmentId extends PublicIdSchema, FlowId extends PublicIdSchema, RunId extends PublicIdSchema>(ids: PublicIdSchemasOf<EnvironmentId, FlowId, RunId>) => {
|
|
36
|
+
readonly description: "List the names of an environment's variables, sorted. Names only — values never leave the server.";
|
|
37
|
+
readonly input: z.ZodObject<{
|
|
38
|
+
environmentId: EnvironmentId;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
readonly kind: "read";
|
|
41
|
+
readonly name: "environment.listVariableNames";
|
|
42
|
+
readonly output: z.ZodObject<{
|
|
43
|
+
variableNames: z.ZodArray<z.ZodString>;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
};
|
|
46
|
+
export declare const makeSetEnvironmentVariableContract: <EnvironmentId extends PublicIdSchema, FlowId extends PublicIdSchema, RunId extends PublicIdSchema>(ids: PublicIdSchemasOf<EnvironmentId, FlowId, RunId>) => {
|
|
47
|
+
readonly description: "Create or replace one environment variable by name and return its stored name. The value is never returned.";
|
|
48
|
+
readonly input: z.ZodObject<{
|
|
49
|
+
environmentId: EnvironmentId;
|
|
50
|
+
name: z.ZodString;
|
|
51
|
+
value: z.ZodString;
|
|
52
|
+
}, z.core.$strip>;
|
|
53
|
+
readonly kind: "write";
|
|
54
|
+
readonly name: "environment.setVariable";
|
|
55
|
+
readonly output: z.ZodObject<{
|
|
56
|
+
name: z.ZodString;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
};
|
|
59
|
+
export declare const makeCreateEnvironmentContract: <EnvironmentId extends PublicIdSchema, FlowId extends PublicIdSchema, RunId extends PublicIdSchema, WorkspaceId extends PublicIdSchema = PublicIdSchema>(ids: PublicIdSchemasOf<EnvironmentId, FlowId, RunId, PublicIdSchema, PublicIdSchema, WorkspaceId>) => {
|
|
60
|
+
readonly description: "Create an environment on the caller's team and return it in the environment.get shape.";
|
|
61
|
+
readonly input: z.ZodObject<{
|
|
62
|
+
name: z.ZodString;
|
|
63
|
+
workspaceId: z.ZodOptional<WorkspaceId>;
|
|
64
|
+
}, z.core.$strip>;
|
|
65
|
+
readonly kind: "write";
|
|
66
|
+
readonly name: "environment.create";
|
|
67
|
+
readonly output: z.ZodObject<{
|
|
68
|
+
flowCodeBranch: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
69
|
+
lastSyncedCommitHash: z.ZodString;
|
|
70
|
+
name: z.ZodString;
|
|
71
|
+
syncStatus: z.ZodLiteral<"reconciled">;
|
|
72
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
73
|
+
name: z.ZodString;
|
|
74
|
+
syncStatus: z.ZodLiteral<"not-reconciled">;
|
|
75
|
+
}, z.core.$strip>], "syncStatus">>;
|
|
76
|
+
id: EnvironmentId;
|
|
77
|
+
kind: z.ZodEnum<{
|
|
78
|
+
static: "static";
|
|
79
|
+
preview: "preview";
|
|
80
|
+
}>;
|
|
81
|
+
name: z.ZodString;
|
|
82
|
+
status: z.ZodEnum<{
|
|
83
|
+
blocked: "blocked";
|
|
84
|
+
"needs-investigation": "needs-investigation";
|
|
85
|
+
ready: "ready";
|
|
86
|
+
running: "running";
|
|
87
|
+
}>;
|
|
88
|
+
terminatedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
89
|
+
url: z.ZodURL;
|
|
90
|
+
}, z.core.$strip>;
|
|
91
|
+
};
|
|
92
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/v1/environment/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAInE,eAAO,MAAM,0BAA0B,GACrC,aAAa,SAAS,cAAc,EACpC,MAAM,SAAS,cAAc,EAC7B,KAAK,SAAS,cAAc,EAE5B,KAAK,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoBrD,CAAC;AAEF,eAAO,MAAM,wCAAwC,GACnD,aAAa,SAAS,cAAc,EACpC,MAAM,SAAS,cAAc,EAC7B,KAAK,SAAS,cAAc,EAE5B,KAAK,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,CAAC;;;;;;;;;;CA8BrD,CAAC;AAEF,eAAO,MAAM,kCAAkC,GAC7C,aAAa,SAAS,cAAc,EACpC,MAAM,SAAS,cAAc,EAC7B,KAAK,SAAS,cAAc,EAE5B,KAAK,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,CAAC;;;;;;;;;;;;CAuCrD,CAAC;AAEF,eAAO,MAAM,6BAA6B,GACxC,aAAa,SAAS,cAAc,EACpC,MAAM,SAAS,cAAc,EAC7B,KAAK,SAAS,cAAc,EAC5B,WAAW,SAAS,cAAc,GAAG,cAAc,EAEnD,KAAK,iBAAiB,CACpB,aAAa,EACb,MAAM,EACN,KAAK,EACL,cAAc,EACd,cAAc,EACd,WAAW,CACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BF,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { makeEnvironmentResourceSchema } from "./resource.js";
|
|
3
|
+
export const makeGetEnvironmentContract = (ids) => {
|
|
4
|
+
const input = z.object({
|
|
5
|
+
environmentId: ids.environment,
|
|
6
|
+
});
|
|
7
|
+
const output = makeEnvironmentResourceSchema(ids);
|
|
8
|
+
return {
|
|
9
|
+
description: "Read a single environment's name, kind, health status, and termination state.",
|
|
10
|
+
input,
|
|
11
|
+
kind: "read",
|
|
12
|
+
name: "environment.get",
|
|
13
|
+
output,
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export const makeListEnvironmentVariableNamesContract = (ids) => {
|
|
17
|
+
const input = z.object({
|
|
18
|
+
environmentId: ids.environment,
|
|
19
|
+
});
|
|
20
|
+
// The schema strips every field except variableNames, so a resolver bug
|
|
21
|
+
// attaching extra data (like the full variables record) cannot serialize.
|
|
22
|
+
// A value is a string too, so the array's contents are guarded by the
|
|
23
|
+
// resolver returning Object.keys and its exact-equality endpoint test.
|
|
24
|
+
const output = z.object({
|
|
25
|
+
variableNames: z
|
|
26
|
+
.array(z.string())
|
|
27
|
+
.describe("Names of the environment's variables, sorted alphabetically. Values are never returned."),
|
|
28
|
+
});
|
|
29
|
+
return {
|
|
30
|
+
description: "List the names of an environment's variables, sorted. Names only — values never leave the server.",
|
|
31
|
+
input,
|
|
32
|
+
kind: "read",
|
|
33
|
+
name: "environment.listVariableNames",
|
|
34
|
+
output,
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export const makeSetEnvironmentVariableContract = (ids) => {
|
|
38
|
+
const input = z.object({
|
|
39
|
+
environmentId: ids.environment,
|
|
40
|
+
name: z
|
|
41
|
+
.string()
|
|
42
|
+
.trim()
|
|
43
|
+
.min(1, "Environment variable name cannot be blank.")
|
|
44
|
+
.max(255)
|
|
45
|
+
.describe("Name of the environment variable to create or replace. Leading and trailing whitespace is removed, remaining whitespace is replaced with underscores, and letters are uppercased."),
|
|
46
|
+
value: z
|
|
47
|
+
.string()
|
|
48
|
+
.describe("Value to store. This secret value is accepted but never returned."),
|
|
49
|
+
});
|
|
50
|
+
const output = z.object({
|
|
51
|
+
name: z
|
|
52
|
+
.string()
|
|
53
|
+
.describe("The stored variable name after whitespace is replaced with underscores and letters are uppercased."),
|
|
54
|
+
});
|
|
55
|
+
return {
|
|
56
|
+
description: "Create or replace one environment variable by name and return its stored name. The value is never returned.",
|
|
57
|
+
input,
|
|
58
|
+
kind: "write",
|
|
59
|
+
name: "environment.setVariable",
|
|
60
|
+
output,
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
export const makeCreateEnvironmentContract = (ids) => {
|
|
64
|
+
const input = z.object({
|
|
65
|
+
name: z
|
|
66
|
+
.string()
|
|
67
|
+
.min(1)
|
|
68
|
+
.max(255)
|
|
69
|
+
.regex(/\S/, "Environment name cannot be blank.")
|
|
70
|
+
.describe("Display name of the new environment."),
|
|
71
|
+
workspaceId: ids.workspace
|
|
72
|
+
.optional()
|
|
73
|
+
.describe("The workspace to create the environment in. Required when authenticating with an organization API key."),
|
|
74
|
+
});
|
|
75
|
+
const output = makeEnvironmentResourceSchema(ids);
|
|
76
|
+
return {
|
|
77
|
+
description: "Create an environment on the caller's team and return it in the environment.get shape.",
|
|
78
|
+
input,
|
|
79
|
+
kind: "write",
|
|
80
|
+
name: "environment.create",
|
|
81
|
+
output,
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v1/environment/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAC;AAE9D,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAKxC,GAAoD,EACpD,EAAE;IACF,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QACrB,aAAa,E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,EAAE,CAAC;aACJ,MAAM,EAAE;aACR,QAAQ,CACP,oGAAoG,CACrG;KACJ,CAAC,CAAC;IAEH,OAAO;QACL,WAAW,EACT,6GAA6G;QAC/G,KAAK;QACL,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,yBAAyB;QAC/B,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAM3C,GAOC,EACD,EAAE;IACF,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QACrB,IAAI,EAAE,CAAC;aACJ,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,GAAG,CAAC,GAAG,CAAC;aACR,KAAK,CAAC,IAAI,EAAE,mCAAmC,CAAC;aAChD,QAAQ,CAAC,sCAAsC,CAAC;QACnD,WAAW,EAAE,GAAG,CAAC,SAAS;aACvB,QAAQ,EAAE;aACV,QAAQ,CACP,wGAAwG,CACzG;KACJ,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,6BAA6B,CAAC,GAAG,CAAC,CAAC;IAElD,OAAO;QACL,WAAW,EACT,wFAAwF;QAC1F,KAAK;QACL,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,oBAAoB;QAC1B,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { PublicIdSchema } from "../ids.js";
|
|
3
|
+
export declare const makeEnvironmentResourceSchema: <EnvironmentId extends PublicIdSchema>(ids: {
|
|
4
|
+
environment: EnvironmentId;
|
|
5
|
+
}) => z.ZodObject<{
|
|
6
|
+
flowCodeBranch: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
7
|
+
lastSyncedCommitHash: z.ZodString;
|
|
8
|
+
name: z.ZodString;
|
|
9
|
+
syncStatus: z.ZodLiteral<"reconciled">;
|
|
10
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
11
|
+
name: z.ZodString;
|
|
12
|
+
syncStatus: z.ZodLiteral<"not-reconciled">;
|
|
13
|
+
}, z.core.$strip>], "syncStatus">>;
|
|
14
|
+
id: EnvironmentId;
|
|
15
|
+
kind: z.ZodEnum<{
|
|
16
|
+
static: "static";
|
|
17
|
+
preview: "preview";
|
|
18
|
+
}>;
|
|
19
|
+
name: z.ZodString;
|
|
20
|
+
status: z.ZodEnum<{
|
|
21
|
+
blocked: "blocked";
|
|
22
|
+
"needs-investigation": "needs-investigation";
|
|
23
|
+
ready: "ready";
|
|
24
|
+
running: "running";
|
|
25
|
+
}>;
|
|
26
|
+
terminatedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
27
|
+
url: z.ZodURL;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
//# sourceMappingURL=resource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../../src/v1/environment/resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAGhD,eAAO,MAAM,6BAA6B,GACxC,aAAa,SAAS,cAAc,EACpC,KAAK;IACL,WAAW,EAAE,aAAa,CAAC;CAC5B;;;;;;;;;;;;;;;;;;;;;;;iBAkDE,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { resource } from "../resource.js";
|
|
3
|
+
export const makeEnvironmentResourceSchema = (ids) => resource({
|
|
4
|
+
// Named after the branch, not "status": the object describes the
|
|
5
|
+
// environment's flow code branch. "flowCode" marks it as ours, so
|
|
6
|
+
// consumers don't read it as the status of their own git.
|
|
7
|
+
flowCodeBranch: z
|
|
8
|
+
.discriminatedUnion("syncStatus", [
|
|
9
|
+
z.object({
|
|
10
|
+
lastSyncedCommitHash: z
|
|
11
|
+
.string()
|
|
12
|
+
.describe("Hash of the latest reconciled commit."),
|
|
13
|
+
name: z
|
|
14
|
+
.string()
|
|
15
|
+
.describe("The name of the environment's flow code branch."),
|
|
16
|
+
syncStatus: z
|
|
17
|
+
.literal("reconciled")
|
|
18
|
+
.describe("The branch has reconciled at least one commit."),
|
|
19
|
+
}),
|
|
20
|
+
z.object({
|
|
21
|
+
name: z
|
|
22
|
+
.string()
|
|
23
|
+
.describe("The name of the environment's flow code branch."),
|
|
24
|
+
syncStatus: z
|
|
25
|
+
.literal("not-reconciled")
|
|
26
|
+
.describe("The branch has not reconciled any commit yet."),
|
|
27
|
+
}),
|
|
28
|
+
])
|
|
29
|
+
.optional()
|
|
30
|
+
.describe("The environment's flow code branch and its git reconciliation state, if it has one."),
|
|
31
|
+
id: ids.environment,
|
|
32
|
+
kind: z
|
|
33
|
+
.enum(["static", "preview"])
|
|
34
|
+
.describe("Whether the environment is static or a preview."),
|
|
35
|
+
name: z.string(),
|
|
36
|
+
// Environment-scoped health, aligned with the CI greenlight vocabulary
|
|
37
|
+
// (deriveEffectiveEnvironmentStatus): "ready" is the greenlit state.
|
|
38
|
+
status: z
|
|
39
|
+
.enum(["blocked", "needs-investigation", "ready", "running"])
|
|
40
|
+
.describe("Standing health across the environment's runs: blocked (open blocking bugs), needs-investigation (failures awaiting triage), running (flows executing), ready (none of the above — the greenlit state)."),
|
|
41
|
+
terminatedAt: z.iso
|
|
42
|
+
.datetime()
|
|
43
|
+
.optional()
|
|
44
|
+
.describe("When the environment was terminated, if it has been."),
|
|
45
|
+
}, { urlFieldDescription: "Absolute URL of the environment page." });
|
|
46
|
+
//# sourceMappingURL=resource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource.js","sourceRoot":"","sources":["../../../src/v1/environment/resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,MAAM,CAA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CACjE,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { PublicIdSchema } from "../ids.js";
|
|
3
|
+
export declare const makeAddTagToFlowsContract: <FlowId extends PublicIdSchema>(ids: {
|
|
4
|
+
flow: FlowId;
|
|
5
|
+
}) => {
|
|
6
|
+
readonly description: "Assign an existing tag to the selected flows. Create tags with tag.create.";
|
|
7
|
+
readonly input: z.ZodObject<{
|
|
8
|
+
flowIds: z.ZodArray<FlowId>;
|
|
9
|
+
tagName: z.ZodString;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
readonly kind: "write";
|
|
12
|
+
readonly name: "flow.addTag";
|
|
13
|
+
readonly output: z.ZodObject<{
|
|
14
|
+
color: z.ZodString;
|
|
15
|
+
name: z.ZodString;
|
|
16
|
+
url: z.ZodURL;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=addTag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addTag.d.ts","sourceRoot":"","sources":["../../../src/v1/flow/addTag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAGhD,eAAO,MAAM,yBAAyB,GAAI,MAAM,SAAS,cAAc,EAAE,KAAK;IAC5E,IAAI,EAAE,MAAM,CAAC;CACd;;;;;;;;;;;;;CAmCA,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { makeTagResourceSchema } from "../tag/index.js";
|
|
3
|
+
export const makeAddTagToFlowsContract = (ids) => {
|
|
4
|
+
const input = z.object({
|
|
5
|
+
flowIds: z
|
|
6
|
+
.array(ids.flow)
|
|
7
|
+
.min(1)
|
|
8
|
+
// Matches the automate contract's flow selection cap.
|
|
9
|
+
.max(300)
|
|
10
|
+
.refine((flowIds) => new Set(flowIds).size === flowIds.length, "flowIds must be unique")
|
|
11
|
+
.describe("The flows that receive the tag."),
|
|
12
|
+
// A lookup, not an insert: a name that cannot exist simply misses and
|
|
13
|
+
// returns the not-found error, so no format rules apply here.
|
|
14
|
+
tagName: z
|
|
15
|
+
.string()
|
|
16
|
+
.trim()
|
|
17
|
+
.min(1)
|
|
18
|
+
.describe("The name of an existing tag on the caller's team."),
|
|
19
|
+
});
|
|
20
|
+
const output = makeTagResourceSchema();
|
|
21
|
+
return {
|
|
22
|
+
description: "Assign an existing tag to the selected flows. Create tags with tag.create.",
|
|
23
|
+
input,
|
|
24
|
+
kind: "write",
|
|
25
|
+
name: "flow.addTag",
|
|
26
|
+
output,
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=addTag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addTag.js","sourceRoot":"","sources":["../../../src/v1/flow/addTag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAgC,GAExE,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QACrB,OAAO,EAAE,CAAC;aACP,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC;aACf,GAAG,CAAC,CAAC,CAAC;YACP,sDAAsD;aACrD,GAAG,CAAC,GAAG,CAAC;aACR,MAAM,CACL,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,MAAM,EACrD,wBAAwB,CACzB;aACA,QAAQ,CAAC,iCAAiC,CAAC;QAC9C,sEAAsE;QACtE,8DAA8D;QAC9D,OAAO,EAAE,CAAC;aACP,MAAM,EAAE;aACR,IAAI,EAAE;aACN,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CAAC,mDAAmD,CAAC;KACjE,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,qBAAqB,EAAE,CAAC;IAEvC,OAAO;QACL,WAAW,EACT,4EAA4E;QAC9E,KAAK;QACL,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,aAAa;QACnB,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
|
package/dist/v1/flow/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import type { PublicIdSchema
|
|
3
|
-
export declare const makeListFlowsContract: <EnvironmentId extends PublicIdSchema, FlowId extends PublicIdSchema
|
|
2
|
+
import type { PublicIdSchema } from "../ids.js";
|
|
3
|
+
export declare const makeListFlowsContract: <EnvironmentId extends PublicIdSchema, FlowId extends PublicIdSchema>(ids: {
|
|
4
|
+
environment: EnvironmentId;
|
|
5
|
+
flow: FlowId;
|
|
6
|
+
}) => {
|
|
4
7
|
readonly description: "List the flows of an environment at its latest reconciled commit.";
|
|
5
8
|
readonly input: z.ZodObject<{
|
|
6
9
|
environmentId: EnvironmentId;
|
|
@@ -15,6 +18,7 @@ export declare const makeListFlowsContract: <EnvironmentId extends PublicIdSchem
|
|
|
15
18
|
name: z.ZodString;
|
|
16
19
|
path: z.ZodString;
|
|
17
20
|
tags: z.ZodArray<z.ZodString>;
|
|
21
|
+
url: z.ZodURL;
|
|
18
22
|
}, z.core.$strip>>;
|
|
19
23
|
}, z.core.$strip>;
|
|
20
24
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/v1/flow/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/flow/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAGhD,eAAO,MAAM,qBAAqB,GAChC,aAAa,SAAS,cAAc,EACpC,MAAM,SAAS,cAAc,EAC7B,KAAK;IACL,WAAW,EAAE,aAAa,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;CACd;;;;;;;;;;;;;;;;;;CA4CA,CAAC"}
|
package/dist/v1/flow/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { resource } from "../resource.js";
|
|
2
3
|
export const makeListFlowsContract = (ids) => {
|
|
3
4
|
const input = z.object({
|
|
4
5
|
environmentId: ids.environment,
|
|
@@ -11,12 +12,16 @@ export const makeListFlowsContract = (ids) => {
|
|
|
11
12
|
.union([z.string().min(1), z.record(z.string(), z.unknown())])
|
|
12
13
|
.describe("The target the flow executes against, as a preset or object.");
|
|
13
14
|
const output = z.object({
|
|
14
|
-
flows: z.array(
|
|
15
|
+
flows: z.array(resource({
|
|
15
16
|
executionTarget,
|
|
16
17
|
flowId: ids.flow,
|
|
17
18
|
name: z.string(),
|
|
18
|
-
path: z
|
|
19
|
+
path: z
|
|
20
|
+
.string()
|
|
21
|
+
.describe("The flow file path, relative to the repo."),
|
|
19
22
|
tags: z.array(z.string()),
|
|
23
|
+
}, {
|
|
24
|
+
urlFieldDescription: "Absolute URL of the flow page in its environment.",
|
|
20
25
|
})),
|
|
21
26
|
});
|
|
22
27
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v1/flow/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v1/flow/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EA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
9
9
|
* injected schema types (TypeScript resolves the indexed access to its
|
|
10
10
|
* constraint inside the factory body).
|
|
11
11
|
*/
|
|
12
|
-
export type PublicIdSchemasOf<EnvironmentId extends PublicIdSchema, FlowId extends PublicIdSchema, RunId extends PublicIdSchema> = {
|
|
12
|
+
export type PublicIdSchemasOf<EnvironmentId extends PublicIdSchema, FlowId extends PublicIdSchema, RunId extends PublicIdSchema, AutomationId extends PublicIdSchema = PublicIdSchema, IssueId extends PublicIdSchema = PublicIdSchema, WorkspaceId extends PublicIdSchema = PublicIdSchema> = {
|
|
13
|
+
automation: AutomationId;
|
|
13
14
|
environment: EnvironmentId;
|
|
14
15
|
flow: FlowId;
|
|
16
|
+
issue: IssueId;
|
|
15
17
|
run: RunId;
|
|
18
|
+
workspace: WorkspaceId;
|
|
16
19
|
};
|
|
17
|
-
export type PublicIdSchemas = PublicIdSchemasOf<PublicIdSchema, PublicIdSchema, PublicIdSchema>;
|
|
20
|
+
export type PublicIdSchemas = PublicIdSchemasOf<PublicIdSchema, PublicIdSchema, PublicIdSchema, PublicIdSchema, PublicIdSchema, PublicIdSchema>;
|
|
18
21
|
/**
|
|
19
22
|
* The default schemas validate loosely: the server is the source of truth
|
|
20
23
|
* for id formats (including legacy formats), and encoding those rules here
|
package/dist/v1/ids.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids.d.ts","sourceRoot":"","sources":["../../src/v1/ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEvD;;;;;;;;GAQG;AACH,MAAM,MAAM,iBAAiB,CAC3B,aAAa,SAAS,cAAc,EACpC,MAAM,SAAS,cAAc,EAC7B,KAAK,SAAS,cAAc,
|
|
1
|
+
{"version":3,"file":"ids.d.ts","sourceRoot":"","sources":["../../src/v1/ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEvD;;;;;;;;GAQG;AACH,MAAM,MAAM,iBAAiB,CAC3B,aAAa,SAAS,cAAc,EACpC,MAAM,SAAS,cAAc,EAC7B,KAAK,SAAS,cAAc,EAC5B,YAAY,SAAS,cAAc,GAAG,cAAc,EACpD,OAAO,SAAS,cAAc,GAAG,cAAc,EAC/C,WAAW,SAAS,cAAc,GAAG,cAAc,IACjD;IACF,UAAU,EAAE,YAAY,CAAC;IACzB,WAAW,EAAE,aAAa,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,EAAE,KAAK,CAAC;IACX,SAAS,EAAE,WAAW,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,iBAAiB,CAC7C,cAAc,EACd,cAAc,EACd,cAAc,EACd,cAAc,EACd,cAAc,EACd,cAAc,CACf,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,eAO9B,CAAC"}
|
package/dist/v1/ids.js
CHANGED
|
@@ -6,8 +6,11 @@ import { z } from "zod";
|
|
|
6
6
|
* schemas instead.
|
|
7
7
|
*/
|
|
8
8
|
export const defaultIdSchemas = {
|
|
9
|
+
automation: z.string().min(1).describe("The id of the automation."),
|
|
9
10
|
environment: z.string().min(1).describe("The id of the environment."),
|
|
10
11
|
flow: z.string().min(1).describe("The id of the flow."),
|
|
12
|
+
issue: z.string().min(1).describe("The id of the issue."),
|
|
11
13
|
run: z.string().min(1).describe("The id of the run."),
|
|
14
|
+
workspace: z.string().min(1).describe("The id of the workspace."),
|
|
12
15
|
};
|
|
13
16
|
//# sourceMappingURL=ids.js.map
|
package/dist/v1/ids.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids.js","sourceRoot":"","sources":["../../src/v1/ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"ids.js","sourceRoot":"","sources":["../../src/v1/ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAsCxB;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAoB;IAC/C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,2BAA2B,CAAC;IACnE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,4BAA4B,CAAC;IACrE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,qBAAqB,CAAC;IACvD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,sBAAsB,CAAC;IACzD,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,oBAAoB,CAAC;IACrD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,0BAA0B,CAAC;CAClE,CAAC"}
|