@qawolf/api-contracts 0.1.0 → 0.2.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.
@@ -0,0 +1,21 @@
1
+ import { z } from "zod";
2
+ import type { PublicIdSchema, PublicIdSchemasOf } from "../ids.js";
3
+ export declare const makeListFlowsContract: <EnvironmentId extends PublicIdSchema, FlowId extends PublicIdSchema, RunId extends PublicIdSchema>(ids: PublicIdSchemasOf<EnvironmentId, FlowId, RunId>) => {
4
+ readonly description: "List the flows of an environment at its latest reconciled commit.";
5
+ readonly input: z.ZodObject<{
6
+ environmentId: EnvironmentId;
7
+ includeDrafts: z.ZodDefault<z.ZodBoolean>;
8
+ }, z.core.$strip>;
9
+ readonly kind: "read";
10
+ readonly name: "flow.list";
11
+ readonly output: z.ZodObject<{
12
+ flows: z.ZodArray<z.ZodObject<{
13
+ executionTarget: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
14
+ flowId: FlowId;
15
+ name: z.ZodString;
16
+ path: z.ZodString;
17
+ tags: z.ZodArray<z.ZodString>;
18
+ }, z.core.$strip>>;
19
+ }, z.core.$strip>;
20
+ };
21
+ //# 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,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEnE,eAAO,MAAM,qBAAqB,GAChC,aAAa,SAAS,cAAc,EACpC,MAAM,SAAS,cAAc,EAC7B,KAAK,SAAS,cAAc,EAE5B,KAAK,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,CAAC;;;;;;;;;;;;;;;;;CAqCrD,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { z } from "zod";
2
+ export const makeListFlowsContract = (ids) => {
3
+ const input = z.object({
4
+ environmentId: ids.environment,
5
+ includeDrafts: z
6
+ .boolean()
7
+ .default(false)
8
+ .describe("Include draft flows in the listing."),
9
+ });
10
+ const executionTarget = z
11
+ .union([z.string().min(1), z.record(z.string(), z.unknown())])
12
+ .describe("The target the flow executes against, as a preset or object.");
13
+ const output = z.object({
14
+ flows: z.array(z.object({
15
+ executionTarget,
16
+ flowId: ids.flow,
17
+ name: z.string(),
18
+ path: z.string().describe("The flow file path, relative to the repo."),
19
+ tags: z.array(z.string()),
20
+ })),
21
+ });
22
+ return {
23
+ description: "List the flows of an environment at its latest reconciled commit.",
24
+ input,
25
+ kind: "read",
26
+ name: "flow.list",
27
+ output,
28
+ };
29
+ };
30
+ //# 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;AAKxB,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAKnC,GAAoD,EACpD,EAAE;IACF,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,CAAC,CAAC,MAAM,CAAC;YACP,eAAe;YACf,MAAM,EAAE,GAAG,CAAC,IAAI;YAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;YAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2CAA2C,CAAC;YACtE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SAC1B,CAAC,CACH;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"}
@@ -13,6 +13,26 @@ export type PublicApiOutput<Api extends AnyPublicApiContract> = z.infer<Api["out
13
13
  * never drift between the two while validation strictness stays server-owned.
14
14
  */
15
15
  export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, FlowId extends PublicIdSchema, RunId extends PublicIdSchema>(ids: PublicIdSchemasOf<EnvironmentId, FlowId, RunId>) => {
16
+ flow: {
17
+ list: {
18
+ readonly description: "List the flows of an environment at its latest reconciled commit.";
19
+ readonly input: z.ZodObject<{
20
+ environmentId: EnvironmentId;
21
+ includeDrafts: z.ZodDefault<z.ZodBoolean>;
22
+ }, z.core.$strip>;
23
+ readonly kind: "read";
24
+ readonly name: "flow.list";
25
+ readonly output: z.ZodObject<{
26
+ flows: z.ZodArray<z.ZodObject<{
27
+ executionTarget: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
28
+ flowId: FlowId;
29
+ name: z.ZodString;
30
+ path: z.ZodString;
31
+ tags: z.ZodArray<z.ZodString>;
32
+ }, z.core.$strip>>;
33
+ }, z.core.$strip>;
34
+ };
35
+ };
16
36
  run: {
17
37
  create: {
18
38
  readonly description: "Create a run for selected flows in an environment.";
@@ -31,6 +51,26 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
31
51
  };
32
52
  };
33
53
  export declare const publicContractsV1: {
54
+ flow: {
55
+ list: {
56
+ readonly description: "List the flows of an environment at its latest reconciled commit.";
57
+ readonly input: z.ZodObject<{
58
+ environmentId: PublicIdSchema;
59
+ includeDrafts: z.ZodDefault<z.ZodBoolean>;
60
+ }, z.core.$strip>;
61
+ readonly kind: "read";
62
+ readonly name: "flow.list";
63
+ readonly output: z.ZodObject<{
64
+ flows: z.ZodArray<z.ZodObject<{
65
+ executionTarget: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
66
+ flowId: PublicIdSchema;
67
+ name: z.ZodString;
68
+ path: z.ZodString;
69
+ tags: z.ZodArray<z.ZodString>;
70
+ }, z.core.$strip>>;
71
+ }, z.core.$strip>;
72
+ };
73
+ };
34
74
  run: {
35
75
  create: {
36
76
  readonly description: "Create a run for selected flows in an environment.";
@@ -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;AAElB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,iBAAiB,EAEvB,MAAM,UAAU,CAAC;AAGlB,MAAM,MAAM,cAAc,CAAC,GAAG,SAAS,oBAAoB,IAAI,CAAC,CAAC,KAAK,CACpE,GAAG,CAAC,OAAO,CAAC,CACb,CAAC;AAEF,MAAM,MAAM,eAAe,CAAC,GAAG,SAAS,oBAAoB,IAAI,CAAC,CAAC,KAAK,CACrE,GAAG,CAAC,QAAQ,CAAC,CACd,CAAC;AAEF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;CAAoC,CAAC"}
package/dist/v1/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export { defaultIdSchemas, } from "./ids.js";
2
+ import { makeListFlowsContract } from "./flow/index.js";
2
3
  import { defaultIdSchemas, } from "./ids.js";
3
4
  import { makeCreateRunContract } from "./run/index.js";
4
5
  /**
@@ -9,6 +10,9 @@ import { makeCreateRunContract } from "./run/index.js";
9
10
  * never drift between the two while validation strictness stays server-owned.
10
11
  */
11
12
  export const makeContractsV1 = (ids) => ({
13
+ flow: {
14
+ list: makeListFlowsContract(ids),
15
+ },
12
16
  run: {
13
17
  create: makeCreateRunContract(ids),
14
18
  },
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAGL,gBAAgB,GACjB,MAAM,UAAU,CAAC;AAGlB,OAAO,EAGL,gBAAgB,GACjB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAUvD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAK7B,GAAoD,EACpD,EAAE,CAAC,CAAC;IACJ,GAAG,EAAE;QACH,MAAM,EAAE,qBAAqB,CAAC,GAAG,CAAC;KACnC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC,gBAAgB,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAGL,gBAAgB,GACjB,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAGL,gBAAgB,GACjB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAUvD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAK7B,GAAoD,EACpD,EAAE,CAAC,CAAC;IACJ,IAAI,EAAE;QACJ,IAAI,EAAE,qBAAqB,CAAC,GAAG,CAAC;KACjC;IACD,GAAG,EAAE;QACH,MAAM,EAAE,qBAAqB,CAAC,GAAG,CAAC;KACnC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC,gBAAgB,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qawolf/api-contracts",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "private": false,
5
5
  "description": "Versioned contracts for the QA Wolf public API",
6
6
  "repository": {
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "devDependencies": {
39
39
  "@typescript/native-preview": "^7.0.0-dev.20260416.1",
40
- "typescript": "^5.9.2",
40
+ "typescript": "^5.9.3",
41
41
  "zod": "^4.1.11"
42
42
  },
43
43
  "peerDependencies": {