@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.
Files changed (62) hide show
  1. package/README.md +1 -1
  2. package/dist/v1/automate/index.d.ts +17 -0
  3. package/dist/v1/automate/index.d.ts.map +1 -0
  4. package/dist/v1/automate/index.js +29 -0
  5. package/dist/v1/automate/index.js.map +1 -0
  6. package/dist/v1/environment/index.d.ts +78 -0
  7. package/dist/v1/environment/index.d.ts.map +1 -0
  8. package/dist/v1/environment/index.js +100 -0
  9. package/dist/v1/environment/index.js.map +1 -0
  10. package/dist/v1/flow/index.d.ts +25 -0
  11. package/dist/v1/flow/index.d.ts.map +1 -0
  12. package/dist/v1/flow/index.js +35 -0
  13. package/dist/v1/flow/index.js.map +1 -0
  14. package/dist/v1/ids.d.ts +5 -2
  15. package/dist/v1/ids.d.ts.map +1 -1
  16. package/dist/v1/ids.js +3 -0
  17. package/dist/v1/ids.js.map +1 -1
  18. package/dist/v1/index.d.ts +774 -9
  19. package/dist/v1/index.d.ts.map +1 -1
  20. package/dist/v1/index.js +38 -5
  21. package/dist/v1/index.js.map +1 -1
  22. package/dist/v1/issue/create.d.ts +74 -0
  23. package/dist/v1/issue/create.d.ts.map +1 -0
  24. package/dist/v1/issue/create.js +41 -0
  25. package/dist/v1/issue/create.js.map +1 -0
  26. package/dist/v1/issue/index.d.ts +165 -0
  27. package/dist/v1/issue/index.d.ts.map +1 -0
  28. package/dist/v1/issue/index.js +79 -0
  29. package/dist/v1/issue/index.js.map +1 -0
  30. package/dist/v1/pagination.d.ts +26 -0
  31. package/dist/v1/pagination.d.ts.map +1 -0
  32. package/dist/v1/pagination.js +37 -0
  33. package/dist/v1/pagination.js.map +1 -0
  34. package/dist/v1/resource.d.ts +20 -0
  35. package/dist/v1/resource.d.ts.map +1 -0
  36. package/dist/v1/resource.js +19 -0
  37. package/dist/v1/resource.js.map +1 -0
  38. package/dist/v1/run/find.d.ts +40 -0
  39. package/dist/v1/run/find.d.ts.map +1 -0
  40. package/dist/v1/run/find.js +35 -0
  41. package/dist/v1/run/find.js.map +1 -0
  42. package/dist/v1/run/flowSelection.d.ts +9 -0
  43. package/dist/v1/run/flowSelection.d.ts.map +1 -0
  44. package/dist/v1/run/flowSelection.js +12 -0
  45. package/dist/v1/run/flowSelection.js.map +1 -0
  46. package/dist/v1/run/get.d.ts +51 -0
  47. package/dist/v1/run/get.d.ts.map +1 -0
  48. package/dist/v1/run/get.js +55 -0
  49. package/dist/v1/run/get.js.map +1 -0
  50. package/dist/v1/run/index.d.ts +17 -6
  51. package/dist/v1/run/index.d.ts.map +1 -1
  52. package/dist/v1/run/index.js +24 -5
  53. package/dist/v1/run/index.js.map +1 -1
  54. package/dist/v1/run/summary.d.ts +23 -0
  55. package/dist/v1/run/summary.d.ts.map +1 -0
  56. package/dist/v1/run/summary.js +31 -0
  57. package/dist/v1/run/summary.js.map +1 -0
  58. package/dist/v1/tag/index.d.ts +24 -0
  59. package/dist/v1/tag/index.d.ts.map +1 -0
  60. package/dist/v1/tag/index.js +41 -0
  61. package/dist/v1/tag/index.js.map +1 -0
  62. package/package.json +3 -3
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 intended to be published to the public npm registry so external repositories such as `qawolf/cli` can consume the public contracts. It is not published yet.
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,78 @@
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
+ environmentId: EnvironmentId;
12
+ flowCodeBranch: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
13
+ lastSyncedCommitHash: z.ZodString;
14
+ name: z.ZodString;
15
+ syncStatus: z.ZodLiteral<"reconciled">;
16
+ }, z.core.$strip>, z.ZodObject<{
17
+ name: z.ZodString;
18
+ syncStatus: z.ZodLiteral<"not-reconciled">;
19
+ }, z.core.$strip>], "syncStatus">>;
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 makeCreateEnvironmentContract: <EnvironmentId extends PublicIdSchema, FlowId extends PublicIdSchema, RunId extends PublicIdSchema>(ids: PublicIdSchemasOf<EnvironmentId, FlowId, RunId>) => {
47
+ readonly description: "Create an environment on the caller's team and return it in the environment.get shape.";
48
+ readonly input: z.ZodObject<{
49
+ name: z.ZodString;
50
+ }, z.core.$strip>;
51
+ readonly kind: "write";
52
+ readonly name: "environment.create";
53
+ readonly output: z.ZodObject<{
54
+ environmentId: EnvironmentId;
55
+ flowCodeBranch: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
56
+ lastSyncedCommitHash: z.ZodString;
57
+ name: z.ZodString;
58
+ syncStatus: z.ZodLiteral<"reconciled">;
59
+ }, z.core.$strip>, z.ZodObject<{
60
+ name: z.ZodString;
61
+ syncStatus: z.ZodLiteral<"not-reconciled">;
62
+ }, z.core.$strip>], "syncStatus">>;
63
+ kind: z.ZodEnum<{
64
+ static: "static";
65
+ preview: "preview";
66
+ }>;
67
+ name: z.ZodString;
68
+ status: z.ZodEnum<{
69
+ blocked: "blocked";
70
+ "needs-investigation": "needs-investigation";
71
+ ready: "ready";
72
+ running: "running";
73
+ }>;
74
+ terminatedAt: z.ZodOptional<z.ZodISODateTime>;
75
+ url: z.ZodURL;
76
+ }, z.core.$strip>;
77
+ };
78
+ //# 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;AA2DnE,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,6BAA6B,GACxC,aAAa,SAAS,cAAc,EACpC,MAAM,SAAS,cAAc,EAC7B,KAAK,SAAS,cAAc,EAE5B,KAAK,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyBrD,CAAC"}
@@ -0,0 +1,100 @@
1
+ import { z } from "zod";
2
+ import { resource } from "../resource.js";
3
+ // Both environment contracts return this one resource. The read and write
4
+ // shapes cannot drift apart.
5
+ const makeEnvironmentResource = (environmentId) => resource({
6
+ environmentId,
7
+ // Named after the branch, not "status": the object describes the
8
+ // environment's flow code branch. "flowCode" marks it as ours, so
9
+ // consumers don't read it as the status of their own git.
10
+ flowCodeBranch: z
11
+ .discriminatedUnion("syncStatus", [
12
+ z.object({
13
+ lastSyncedCommitHash: z
14
+ .string()
15
+ .describe("Hash of the latest reconciled commit."),
16
+ name: z
17
+ .string()
18
+ .describe("The name of the environment's flow code branch."),
19
+ syncStatus: z
20
+ .literal("reconciled")
21
+ .describe("The branch has reconciled at least one commit."),
22
+ }),
23
+ z.object({
24
+ name: z
25
+ .string()
26
+ .describe("The name of the environment's flow code branch."),
27
+ syncStatus: z
28
+ .literal("not-reconciled")
29
+ .describe("The branch has not reconciled any commit yet."),
30
+ }),
31
+ ])
32
+ .optional()
33
+ .describe("The environment's flow code branch and its git reconciliation state, if it has one."),
34
+ kind: z
35
+ .enum(["static", "preview"])
36
+ .describe("Whether the environment is static or a preview."),
37
+ name: z.string(),
38
+ // Environment-scoped health, aligned with the CI greenlight vocabulary
39
+ // (deriveEffectiveEnvironmentStatus): "ready" is the greenlit state.
40
+ status: z
41
+ .enum(["blocked", "needs-investigation", "ready", "running"])
42
+ .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)."),
43
+ terminatedAt: z.iso
44
+ .datetime()
45
+ .optional()
46
+ .describe("When the environment was terminated, if it has been."),
47
+ }, { urlFieldDescription: "Absolute URL of the environment page." });
48
+ export const makeGetEnvironmentContract = (ids) => {
49
+ const input = z.object({
50
+ environmentId: ids.environment,
51
+ });
52
+ const output = makeEnvironmentResource(ids.environment);
53
+ return {
54
+ description: "Read a single environment's name, kind, health status, and termination state.",
55
+ input,
56
+ kind: "read",
57
+ name: "environment.get",
58
+ output,
59
+ };
60
+ };
61
+ export const makeListEnvironmentVariableNamesContract = (ids) => {
62
+ const input = z.object({
63
+ environmentId: ids.environment,
64
+ });
65
+ // The schema strips every field except variableNames, so a resolver bug
66
+ // attaching extra data (like the full variables record) cannot serialize.
67
+ // A value is a string too, so the array's contents are guarded by the
68
+ // resolver returning Object.keys and its exact-equality endpoint test.
69
+ const output = z.object({
70
+ variableNames: z
71
+ .array(z.string())
72
+ .describe("Names of the environment's variables, sorted alphabetically. Values are never returned."),
73
+ });
74
+ return {
75
+ description: "List the names of an environment's variables, sorted. Names only — values never leave the server.",
76
+ input,
77
+ kind: "read",
78
+ name: "environment.listVariableNames",
79
+ output,
80
+ };
81
+ };
82
+ export const makeCreateEnvironmentContract = (ids) => {
83
+ const input = z.object({
84
+ name: z
85
+ .string()
86
+ .min(1)
87
+ .max(255)
88
+ .regex(/\S/, "Environment name cannot be blank.")
89
+ .describe("Display name of the new environment."),
90
+ });
91
+ const output = makeEnvironmentResource(ids.environment);
92
+ return {
93
+ description: "Create an environment on the caller's team and return it in the environment.get shape.",
94
+ input,
95
+ kind: "write",
96
+ name: "environment.create",
97
+ output,
98
+ };
99
+ };
100
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3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C;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;KACpD,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,uBAAuB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAExD,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,25 @@
1
+ import { z } from "zod";
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
+ }) => {
7
+ readonly description: "List the flows of an environment at its latest reconciled commit.";
8
+ readonly input: z.ZodObject<{
9
+ environmentId: EnvironmentId;
10
+ includeDrafts: z.ZodDefault<z.ZodBoolean>;
11
+ }, z.core.$strip>;
12
+ readonly kind: "read";
13
+ readonly name: "flow.list";
14
+ readonly output: z.ZodObject<{
15
+ flows: z.ZodArray<z.ZodObject<{
16
+ executionTarget: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
17
+ flowId: FlowId;
18
+ name: z.ZodString;
19
+ path: z.ZodString;
20
+ tags: z.ZodArray<z.ZodString>;
21
+ url: z.ZodURL;
22
+ }, z.core.$strip>>;
23
+ }, z.core.$strip>;
24
+ };
25
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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,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"}
@@ -0,0 +1,35 @@
1
+ import { z } from "zod";
2
+ import { resource } from "../resource.js";
3
+ export const makeListFlowsContract = (ids) => {
4
+ const input = z.object({
5
+ environmentId: ids.environment,
6
+ includeDrafts: z
7
+ .boolean()
8
+ .default(false)
9
+ .describe("Include draft flows in the listing."),
10
+ });
11
+ const executionTarget = z
12
+ .union([z.string().min(1), z.record(z.string(), z.unknown())])
13
+ .describe("The target the flow executes against, as a preset or object.");
14
+ const output = z.object({
15
+ flows: z.array(resource({
16
+ executionTarget,
17
+ flowId: ids.flow,
18
+ name: z.string(),
19
+ path: z
20
+ .string()
21
+ .describe("The flow file path, relative to the repo."),
22
+ tags: z.array(z.string()),
23
+ }, {
24
+ urlFieldDescription: "Absolute URL of the flow page in its environment.",
25
+ })),
26
+ });
27
+ return {
28
+ description: "List the flows of an environment at its latest reconciled commit.",
29
+ input,
30
+ kind: "read",
31
+ name: "flow.list",
32
+ output,
33
+ };
34
+ };
35
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v1/flow/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAGnC,GAGD,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QACrB,aAAa,EAAE,GAAG,CAAC,WAAW;QAC9B,aAAa,EAAE,CAAC;aACb,OAAO,EAAE;aACT,OAAO,CAAC,KAAK,CAAC;aACd,QAAQ,CAAC,qCAAqC,CAAC;KACnD,CAAC,CAAC;IACH,MAAM,eAAe,GAAG,CAAC;SACtB,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;SAC7D,QAAQ,CAAC,8DAA8D,CAAC,CAAC;IAC5E,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;QACtB,KAAK,EAAE,CAAC,CAAC,KAAK,CACZ,QAAQ,CACN;YACE,eAAe;YACf,MAAM,EAAE,GAAG,CAAC,IAAI;YAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;YAChB,IAAI,EAAE,CAAC;iBACJ,MAAM,EAAE;iBACR,QAAQ,CAAC,2CAA2C,CAAC;YACxD,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SAC1B,EACD;YACE,mBAAmB,EACjB,mDAAmD;SACtD,CACF,CACF;KACF,CAAC,CAAC;IAEH,OAAO;QACL,WAAW,EACT,mEAAmE;QACrE,KAAK;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,WAAW;QACjB,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
package/dist/v1/ids.d.ts CHANGED
@@ -9,12 +9,15 @@ export type PublicIdSchema = z.ZodType<string, string>;
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
@@ -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,IAC1B;IACF,WAAW,EAAE,aAAa,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,KAAK,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,iBAAiB,CAC7C,cAAc,EACd,cAAc,EACd,cAAc,CACf,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,eAI9B,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
@@ -1 +1 @@
1
- {"version":3,"file":"ids.js","sourceRoot":"","sources":["../../src/v1/ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA6BxB;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAoB;IAC/C,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,Q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