@qawolf/legacy-execution-targets 1.0.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/LICENSE +21 -0
- package/README.md +14 -0
- package/dist/browser.d.ts +27 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +28 -0
- package/dist/browser.js.map +1 -0
- package/dist/device-identifiers.d.ts +62 -0
- package/dist/device-identifiers.d.ts.map +1 -0
- package/dist/device-identifiers.js +48 -0
- package/dist/device-identifiers.js.map +1 -0
- package/dist/getLegacyExecutionTargetTypeByRunnerName.d.ts +7 -0
- package/dist/getLegacyExecutionTargetTypeByRunnerName.d.ts.map +1 -0
- package/dist/getLegacyExecutionTargetTypeByRunnerName.js +20 -0
- package/dist/getLegacyExecutionTargetTypeByRunnerName.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/isValidLegacyExecutionTarget.d.ts +8 -0
- package/dist/isValidLegacyExecutionTarget.d.ts.map +1 -0
- package/dist/isValidLegacyExecutionTarget.js +11 -0
- package/dist/isValidLegacyExecutionTarget.js.map +1 -0
- package/dist/parseLegacyExecutionTarget.d.ts +10 -0
- package/dist/parseLegacyExecutionTarget.d.ts.map +1 -0
- package/dist/parseLegacyExecutionTarget.js +14 -0
- package/dist/parseLegacyExecutionTarget.js.map +1 -0
- package/dist/schema.d.ts +248 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +91 -0
- package/dist/schema.js.map +1 -0
- package/package.json +45 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 QA Wolf Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# @qawolf/legacy-execution-targets
|
|
2
|
+
|
|
3
|
+
`@qawolf/legacy-execution-targets` is a companion package for `@qawolf/flows`.
|
|
4
|
+
It provides legacy execution target schemas and helpers used by the QA Wolf flow
|
|
5
|
+
libraries.
|
|
6
|
+
|
|
7
|
+
Most users should start with the
|
|
8
|
+
[`@qawolf/flows` documentation](https://docs.qawolf.com/qawolf/libraries/flows).
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
npm install @qawolf/legacy-execution-targets
|
|
14
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* All possible browser names, including aliases.
|
|
4
|
+
*/
|
|
5
|
+
export declare const browserNames: readonly ["chrome", "chromium", "firefox", "msedge", "webkit"];
|
|
6
|
+
export declare const browserNameSchema: z.ZodEnum<{
|
|
7
|
+
chrome: "chrome";
|
|
8
|
+
chromium: "chromium";
|
|
9
|
+
firefox: "firefox";
|
|
10
|
+
msedge: "msedge";
|
|
11
|
+
webkit: "webkit";
|
|
12
|
+
}>;
|
|
13
|
+
export type BrowserName = z.infer<typeof browserNameSchema>;
|
|
14
|
+
/**
|
|
15
|
+
* Browser that is used by default, i.e. when no browser is specified in
|
|
16
|
+
* certain scenarios, including for backwards compatibility.
|
|
17
|
+
*
|
|
18
|
+
* Beware that it may be ignored in local development due to lack of support
|
|
19
|
+
* for Chrome on linux/arm64. In such a case, Chromium is used instead.
|
|
20
|
+
*/
|
|
21
|
+
export declare const defaultBrowserName: BrowserName;
|
|
22
|
+
/**
|
|
23
|
+
* Validate and return the browser name from a string.
|
|
24
|
+
* Will fail if the name is not a valid browser name.
|
|
25
|
+
*/
|
|
26
|
+
export declare function parseBrowserName(name: string): BrowserName;
|
|
27
|
+
//# sourceMappingURL=browser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,YAAY,gEAMf,CAAC;AAEX,eAAO,MAAM,iBAAiB;;;;;;EAAuB,CAAC;AAEtD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,EAAE,WAAsB,CAAC;AAExD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAE1D"}
|
package/dist/browser.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* All possible browser names, including aliases.
|
|
4
|
+
*/
|
|
5
|
+
export const browserNames = [
|
|
6
|
+
"chrome",
|
|
7
|
+
"chromium",
|
|
8
|
+
"firefox",
|
|
9
|
+
"msedge",
|
|
10
|
+
"webkit",
|
|
11
|
+
];
|
|
12
|
+
export const browserNameSchema = z.enum(browserNames);
|
|
13
|
+
/**
|
|
14
|
+
* Browser that is used by default, i.e. when no browser is specified in
|
|
15
|
+
* certain scenarios, including for backwards compatibility.
|
|
16
|
+
*
|
|
17
|
+
* Beware that it may be ignored in local development due to lack of support
|
|
18
|
+
* for Chrome on linux/arm64. In such a case, Chromium is used instead.
|
|
19
|
+
*/
|
|
20
|
+
export const defaultBrowserName = "chrome";
|
|
21
|
+
/**
|
|
22
|
+
* Validate and return the browser name from a string.
|
|
23
|
+
* Will fail if the name is not a valid browser name.
|
|
24
|
+
*/
|
|
25
|
+
export function parseBrowserName(name) {
|
|
26
|
+
return browserNameSchema.parse(name);
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=browser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,QAAQ;IACR,UAAU;IACV,SAAS;IACT,QAAQ;IACR,QAAQ;CACA,CAAC;AAEX,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AAItD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAgB,QAAQ,CAAC;AAExD;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,OAAO,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Valid Android device models as stored in the database.
|
|
4
|
+
* Keep in sync with ExecutionTargetAndroid table.
|
|
5
|
+
*/
|
|
6
|
+
export declare const androidDeviceModelSchema: z.ZodEnum<{
|
|
7
|
+
pixel_2: "pixel_2";
|
|
8
|
+
pixel_9: "pixel_9";
|
|
9
|
+
pixel_tablet: "pixel_tablet";
|
|
10
|
+
}>;
|
|
11
|
+
export type AndroidDeviceModel = z.infer<typeof androidDeviceModelSchema>;
|
|
12
|
+
/**
|
|
13
|
+
* Valid Android OS major versions as stored in the database.
|
|
14
|
+
* Keep in sync with ExecutionTargetAndroid table.
|
|
15
|
+
*/
|
|
16
|
+
export declare const androidOsMajorVersionSchema: z.ZodEnum<{
|
|
17
|
+
34: "34";
|
|
18
|
+
35: "35";
|
|
19
|
+
36: "36";
|
|
20
|
+
}>;
|
|
21
|
+
export type AndroidOsMajorVersion = z.infer<typeof androidOsMajorVersionSchema>;
|
|
22
|
+
/**
|
|
23
|
+
* Valid iOS device models as stored in the database.
|
|
24
|
+
* Keep in sync with ExecutionTargetIos table.
|
|
25
|
+
* Empty string is used with extraSelectors.
|
|
26
|
+
*/
|
|
27
|
+
export declare const iosDeviceModelSchema: z.ZodEnum<{
|
|
28
|
+
"": "";
|
|
29
|
+
iphone14_7: "iphone14_7";
|
|
30
|
+
iphone14_8: "iphone14_8";
|
|
31
|
+
iphone15_4: "iphone15_4";
|
|
32
|
+
iphone15_5: "iphone15_5";
|
|
33
|
+
iphone16_1: "iphone16_1";
|
|
34
|
+
iphone16_2: "iphone16_2";
|
|
35
|
+
}>;
|
|
36
|
+
export type IosDeviceModel = z.infer<typeof iosDeviceModelSchema>;
|
|
37
|
+
/**
|
|
38
|
+
* Valid iOS OS major versions as stored in the database.
|
|
39
|
+
* Keep in sync with ExecutionTargetIos table.
|
|
40
|
+
* Empty string is used with extraSelectors.
|
|
41
|
+
*/
|
|
42
|
+
export declare const iosOsMajorVersionSchema: z.ZodEnum<{
|
|
43
|
+
"": "";
|
|
44
|
+
17: "17";
|
|
45
|
+
18: "18";
|
|
46
|
+
26: "26";
|
|
47
|
+
}>;
|
|
48
|
+
export type IosOsMajorVersion = z.infer<typeof iosOsMajorVersionSchema>;
|
|
49
|
+
/**
|
|
50
|
+
* Valid iOS extra selectors as stored in the database.
|
|
51
|
+
* Keep in sync with ExecutionTargetIos table.
|
|
52
|
+
* Some IOS execution targets dont have extra selectors.
|
|
53
|
+
*/
|
|
54
|
+
export declare const iosExtraSelectorsSchema: z.ZodEnum<{
|
|
55
|
+
"": "";
|
|
56
|
+
"apple-id-enabled=yes,deviceClass=ipad": "apple-id-enabled=yes,deviceClass=ipad";
|
|
57
|
+
"apple-id-enabled=yes,deviceClass=iphone": "apple-id-enabled=yes,deviceClass=iphone";
|
|
58
|
+
"deviceClass=ipad": "deviceClass=ipad";
|
|
59
|
+
"deviceClass=iphone": "deviceClass=iphone";
|
|
60
|
+
}>;
|
|
61
|
+
export type IosExtraSelectors = z.infer<typeof iosExtraSelectorsSchema>;
|
|
62
|
+
//# sourceMappingURL=device-identifiers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"device-identifiers.d.ts","sourceRoot":"","sources":["../src/device-identifiers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,wBAAwB;;;;EAInC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E;;;GAGG;AACH,eAAO,MAAM,2BAA2B;;;;EAA6B,CAAC;AACtE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;EAQ/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE;;;;GAIG;AACH,eAAO,MAAM,uBAAuB;;;;;EAAiC,CAAC;AACtE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;;;GAIG;AACH,eAAO,MAAM,uBAAuB;;;;;;EAMlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Valid Android device models as stored in the database.
|
|
4
|
+
* Keep in sync with ExecutionTargetAndroid table.
|
|
5
|
+
*/
|
|
6
|
+
export const androidDeviceModelSchema = z.enum([
|
|
7
|
+
"pixel_2",
|
|
8
|
+
"pixel_9",
|
|
9
|
+
"pixel_tablet",
|
|
10
|
+
]);
|
|
11
|
+
/**
|
|
12
|
+
* Valid Android OS major versions as stored in the database.
|
|
13
|
+
* Keep in sync with ExecutionTargetAndroid table.
|
|
14
|
+
*/
|
|
15
|
+
export const androidOsMajorVersionSchema = z.enum(["34", "35", "36"]);
|
|
16
|
+
/**
|
|
17
|
+
* Valid iOS device models as stored in the database.
|
|
18
|
+
* Keep in sync with ExecutionTargetIos table.
|
|
19
|
+
* Empty string is used with extraSelectors.
|
|
20
|
+
*/
|
|
21
|
+
export const iosDeviceModelSchema = z.enum([
|
|
22
|
+
"",
|
|
23
|
+
"iphone14_7",
|
|
24
|
+
"iphone14_8",
|
|
25
|
+
"iphone15_4",
|
|
26
|
+
"iphone15_5",
|
|
27
|
+
"iphone16_1",
|
|
28
|
+
"iphone16_2",
|
|
29
|
+
]);
|
|
30
|
+
/**
|
|
31
|
+
* Valid iOS OS major versions as stored in the database.
|
|
32
|
+
* Keep in sync with ExecutionTargetIos table.
|
|
33
|
+
* Empty string is used with extraSelectors.
|
|
34
|
+
*/
|
|
35
|
+
export const iosOsMajorVersionSchema = z.enum(["", "17", "18", "26"]);
|
|
36
|
+
/**
|
|
37
|
+
* Valid iOS extra selectors as stored in the database.
|
|
38
|
+
* Keep in sync with ExecutionTargetIos table.
|
|
39
|
+
* Some IOS execution targets dont have extra selectors.
|
|
40
|
+
*/
|
|
41
|
+
export const iosExtraSelectorsSchema = z.enum([
|
|
42
|
+
"",
|
|
43
|
+
"apple-id-enabled=yes,deviceClass=ipad",
|
|
44
|
+
"apple-id-enabled=yes,deviceClass=iphone",
|
|
45
|
+
"deviceClass=ipad",
|
|
46
|
+
"deviceClass=iphone",
|
|
47
|
+
]);
|
|
48
|
+
//# sourceMappingURL=device-identifiers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"device-identifiers.js","sourceRoot":"","sources":["../src/device-identifiers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,IAAI,CAAC;IAC7C,SAAS;IACT,SAAS;IACT,cAAc;CACf,CAAC,CAAC;AAGH;;;GAGG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAGtE;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,IAAI,CAAC;IACzC,EAAE;IACF,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;CACb,CAAC,CAAC;AAGH;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAGtE;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,IAAI,CAAC;IAC5C,EAAE;IACF,uCAAuC;IACvC,yCAAyC;IACzC,kBAAkB;IAClB,oBAAoB;CACrB,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type LegacyExecutionTargetType } from "./schema.js";
|
|
2
|
+
/**
|
|
3
|
+
* Lookup the execution target type for a given runner name.
|
|
4
|
+
* Callers must check to ensure the result is expected as this will not throw errors.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getLegacyExecutionTargetTypeByRunnerName(runnerName: string): LegacyExecutionTargetType;
|
|
7
|
+
//# sourceMappingURL=getLegacyExecutionTargetTypeByRunnerName.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getLegacyExecutionTargetTypeByRunnerName.d.ts","sourceRoot":"","sources":["../src/getLegacyExecutionTargetTypeByRunnerName.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,yBAAyB,EAE/B,MAAM,aAAa,CAAC;AAErB;;;GAGG;AACH,wBAAgB,wCAAwC,CACtD,UAAU,EAAE,MAAM,GACjB,yBAAyB,CAgB3B"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { legacyExecutionTargetSchema, } from "./schema.js";
|
|
2
|
+
/**
|
|
3
|
+
* Lookup the execution target type for a given runner name.
|
|
4
|
+
* Callers must check to ensure the result is expected as this will not throw errors.
|
|
5
|
+
*/
|
|
6
|
+
export function getLegacyExecutionTargetTypeByRunnerName(runnerName) {
|
|
7
|
+
for (const schema of legacyExecutionTargetSchema.options) {
|
|
8
|
+
const runnerNameField = schema.shape.runnerName;
|
|
9
|
+
if ((typeof runnerNameField === "string" && runnerNameField === runnerName) ||
|
|
10
|
+
("options" in runnerNameField &&
|
|
11
|
+
runnerNameField.options.includes(runnerName))) {
|
|
12
|
+
const targetType = schema.shape.type.options[0];
|
|
13
|
+
if (!targetType)
|
|
14
|
+
throw Error("Unexpectedly missing targetType in the zod schema");
|
|
15
|
+
return targetType;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return "invalid";
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=getLegacyExecutionTargetTypeByRunnerName.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getLegacyExecutionTargetTypeByRunnerName.js","sourceRoot":"","sources":["../src/getLegacyExecutionTargetTypeByRunnerName.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,2BAA2B,GAC5B,MAAM,aAAa,CAAC;AAErB;;;GAGG;AACH,MAAM,UAAU,wCAAwC,CACtD,UAAkB;IAElB,KAAK,MAAM,MAAM,IAAI,2BAA2B,CAAC,OAAO,EAAE,CAAC;QACzD,MAAM,eAAe,GAAG,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC;QAEhD,IACE,CAAC,OAAO,eAAe,KAAK,QAAQ,IAAI,eAAe,KAAK,UAAU,CAAC;YACvE,CAAC,SAAS,IAAI,eAAe;gBAC3B,eAAe,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,EAC/C,CAAC;YACD,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YAChD,IAAI,CAAC,UAAU;gBACb,MAAM,KAAK,CAAC,mDAAmD,CAAC,CAAC;YACnE,OAAO,UAAU,CAAC;QACpB,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "./browser.js";
|
|
2
|
+
export * from "./device-identifiers.js";
|
|
3
|
+
export * from "./getLegacyExecutionTargetTypeByRunnerName.js";
|
|
4
|
+
export * from "./isValidLegacyExecutionTarget.js";
|
|
5
|
+
export * from "./parseLegacyExecutionTarget.js";
|
|
6
|
+
export * from "./schema.js";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,+CAA+C,CAAC;AAC9D,cAAc,mCAAmC,CAAC;AAClD,cAAc,iCAAiC,CAAC;AAChD,cAAc,aAAa,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "./browser.js";
|
|
2
|
+
export * from "./device-identifiers.js";
|
|
3
|
+
export * from "./getLegacyExecutionTargetTypeByRunnerName.js";
|
|
4
|
+
export * from "./isValidLegacyExecutionTarget.js";
|
|
5
|
+
export * from "./parseLegacyExecutionTarget.js";
|
|
6
|
+
export * from "./schema.js";
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,+CAA+C,CAAC;AAC9D,cAAc,mCAAmC,CAAC;AAClD,cAAc,iCAAiC,CAAC;AAChD,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type LegacyExecutionTarget } from "./schema.js";
|
|
2
|
+
/**
|
|
3
|
+
* Checks if a legacy execution target is valid without throwing an error.
|
|
4
|
+
* @param target Maybe legacy execution target object
|
|
5
|
+
* @returns True if legacy target is a valid target and its type is not `invalid`
|
|
6
|
+
*/
|
|
7
|
+
export declare function isValidLegacyExecutionTarget(target: unknown): target is LegacyExecutionTarget;
|
|
8
|
+
//# sourceMappingURL=isValidLegacyExecutionTarget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isValidLegacyExecutionTarget.d.ts","sourceRoot":"","sources":["../src/isValidLegacyExecutionTarget.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,qBAAqB,EAE3B,MAAM,aAAa,CAAC;AAErB;;;;GAIG;AACH,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,OAAO,GACd,MAAM,IAAI,qBAAqB,CAGjC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { legacyExecutionTargetSchema, } from "./schema.js";
|
|
2
|
+
/**
|
|
3
|
+
* Checks if a legacy execution target is valid without throwing an error.
|
|
4
|
+
* @param target Maybe legacy execution target object
|
|
5
|
+
* @returns True if legacy target is a valid target and its type is not `invalid`
|
|
6
|
+
*/
|
|
7
|
+
export function isValidLegacyExecutionTarget(target) {
|
|
8
|
+
const result = legacyExecutionTargetSchema.safeParse(target);
|
|
9
|
+
return result.success && result.data.type !== "invalid";
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=isValidLegacyExecutionTarget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isValidLegacyExecutionTarget.js","sourceRoot":"","sources":["../src/isValidLegacyExecutionTarget.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,2BAA2B,GAC5B,MAAM,aAAa,CAAC;AAErB;;;;GAIG;AACH,MAAM,UAAU,4BAA4B,CAC1C,MAAe;IAEf,MAAM,MAAM,GAAG,2BAA2B,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAC7D,OAAO,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type LegacyExecutionTarget, type LegacyExecutionTargetWithId } from "./schema.js";
|
|
2
|
+
/**
|
|
3
|
+
* Parse an execution target object. Can transform a partial target (with type and runnerName props) into a full target.
|
|
4
|
+
*/
|
|
5
|
+
export declare function parseLegacyExecutionTarget(maybeExecutionTarget: unknown): LegacyExecutionTarget;
|
|
6
|
+
/**
|
|
7
|
+
* Parse an execution target object that was retrieved from the database. Should not be used to transform a partial target.
|
|
8
|
+
*/
|
|
9
|
+
export declare function parseLegacyExecutionTargetWithId(maybeExecutionTarget: unknown): LegacyExecutionTargetWithId;
|
|
10
|
+
//# sourceMappingURL=parseLegacyExecutionTarget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseLegacyExecutionTarget.d.ts","sourceRoot":"","sources":["../src/parseLegacyExecutionTarget.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAGjC,MAAM,aAAa,CAAC;AAErB;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,oBAAoB,EAAE,OAAO,GAC5B,qBAAqB,CAEvB;AAED;;GAEG;AACH,wBAAgB,gCAAgC,CAC9C,oBAAoB,EAAE,OAAO,GAC5B,2BAA2B,CAE7B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { legacyExecutionTargetSchema, legacyExecutionTargetWithIdSchema, } from "./schema.js";
|
|
2
|
+
/**
|
|
3
|
+
* Parse an execution target object. Can transform a partial target (with type and runnerName props) into a full target.
|
|
4
|
+
*/
|
|
5
|
+
export function parseLegacyExecutionTarget(maybeExecutionTarget) {
|
|
6
|
+
return legacyExecutionTargetSchema.parse(maybeExecutionTarget);
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Parse an execution target object that was retrieved from the database. Should not be used to transform a partial target.
|
|
10
|
+
*/
|
|
11
|
+
export function parseLegacyExecutionTargetWithId(maybeExecutionTarget) {
|
|
12
|
+
return legacyExecutionTargetWithIdSchema.parse(maybeExecutionTarget);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=parseLegacyExecutionTarget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseLegacyExecutionTarget.js","sourceRoot":"","sources":["../src/parseLegacyExecutionTarget.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,2BAA2B,EAC3B,iCAAiC,GAClC,MAAM,aAAa,CAAC;AAErB;;GAEG;AACH,MAAM,UAAU,0BAA0B,CACxC,oBAA6B;IAE7B,OAAO,2BAA2B,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;AACjE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gCAAgC,CAC9C,oBAA6B;IAE7B,OAAO,iCAAiC,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;AACvE,CAAC"}
|
package/dist/schema.d.ts
ADDED
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const legacyExecutionTargetTypeEnum: z.ZodEnum<{
|
|
3
|
+
android: "android";
|
|
4
|
+
invalid: "invalid";
|
|
5
|
+
ios: "ios";
|
|
6
|
+
playwright: "playwright";
|
|
7
|
+
none: "none";
|
|
8
|
+
}>;
|
|
9
|
+
export type LegacyExecutionTargetType = z.infer<typeof legacyExecutionTargetTypeEnum>;
|
|
10
|
+
declare const legacyExecutionTargetPlaywrightSchema: z.ZodObject<{
|
|
11
|
+
browser: z.ZodDefault<z.ZodEnum<{
|
|
12
|
+
chrome: "chrome";
|
|
13
|
+
chromium: "chromium";
|
|
14
|
+
firefox: "firefox";
|
|
15
|
+
msedge: "msedge";
|
|
16
|
+
webkit: "webkit";
|
|
17
|
+
}>>;
|
|
18
|
+
displayName: z.ZodDefault<z.ZodString>;
|
|
19
|
+
runnerName: z.ZodEnum<{
|
|
20
|
+
node20WithPlaywright: "node20WithPlaywright";
|
|
21
|
+
node20GpuWithPlaywright: "node20GpuWithPlaywright";
|
|
22
|
+
}>;
|
|
23
|
+
screenHeight: z.ZodDefault<z.ZodNumber>;
|
|
24
|
+
screenWidth: z.ZodDefault<z.ZodNumber>;
|
|
25
|
+
type: z.ZodEnum<{
|
|
26
|
+
playwright: "playwright";
|
|
27
|
+
}>;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
declare const legacyExecutionTargetAndroidSchema: z.ZodObject<{
|
|
30
|
+
deviceModel: z.ZodDefault<z.ZodString>;
|
|
31
|
+
displayName: z.ZodDefault<z.ZodString>;
|
|
32
|
+
osMajorVersion: z.ZodDefault<z.ZodString>;
|
|
33
|
+
runnerName: z.ZodEnum<{
|
|
34
|
+
node20WithAndroid: "node20WithAndroid";
|
|
35
|
+
}>;
|
|
36
|
+
screenHeight: z.ZodDefault<z.ZodNumber>;
|
|
37
|
+
screenWidth: z.ZodDefault<z.ZodNumber>;
|
|
38
|
+
type: z.ZodEnum<{
|
|
39
|
+
android: "android";
|
|
40
|
+
}>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
declare const legacyExecutionTargetIosSchema: z.ZodObject<{
|
|
43
|
+
deviceModel: z.ZodDefault<z.ZodString>;
|
|
44
|
+
displayName: z.ZodDefault<z.ZodString>;
|
|
45
|
+
extraSelectors: z.ZodDefault<z.ZodString>;
|
|
46
|
+
isDeviceGroupDedicated: z.ZodDefault<z.ZodBoolean>;
|
|
47
|
+
isTeamDedicated: z.ZodDefault<z.ZodBoolean>;
|
|
48
|
+
osMajorVersion: z.ZodDefault<z.ZodString>;
|
|
49
|
+
runnerName: z.ZodEnum<{
|
|
50
|
+
node20WithIos: "node20WithIos";
|
|
51
|
+
}>;
|
|
52
|
+
screenHeight: z.ZodDefault<z.ZodNumber>;
|
|
53
|
+
screenWidth: z.ZodDefault<z.ZodNumber>;
|
|
54
|
+
type: z.ZodEnum<{
|
|
55
|
+
ios: "ios";
|
|
56
|
+
}>;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
declare const legacyExecutionTargetNoneSchema: z.ZodObject<{
|
|
59
|
+
displayName: z.ZodDefault<z.ZodString>;
|
|
60
|
+
runnerName: z.ZodEnum<{
|
|
61
|
+
node20Basic: "node20Basic";
|
|
62
|
+
classic: "classic";
|
|
63
|
+
}>;
|
|
64
|
+
type: z.ZodEnum<{
|
|
65
|
+
none: "none";
|
|
66
|
+
}>;
|
|
67
|
+
}, z.core.$strip>;
|
|
68
|
+
declare const legacyExecutionTargetInvalidSchema: z.ZodObject<{
|
|
69
|
+
displayName: z.ZodDefault<z.ZodString>;
|
|
70
|
+
runnerName: z.ZodString;
|
|
71
|
+
type: z.ZodEnum<{
|
|
72
|
+
invalid: "invalid";
|
|
73
|
+
}>;
|
|
74
|
+
}, z.core.$strip>;
|
|
75
|
+
/**
|
|
76
|
+
* Union of configuration options for different execution targets.
|
|
77
|
+
*/
|
|
78
|
+
export declare const legacyExecutionTargetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
79
|
+
browser: z.ZodDefault<z.ZodEnum<{
|
|
80
|
+
chrome: "chrome";
|
|
81
|
+
chromium: "chromium";
|
|
82
|
+
firefox: "firefox";
|
|
83
|
+
msedge: "msedge";
|
|
84
|
+
webkit: "webkit";
|
|
85
|
+
}>>;
|
|
86
|
+
displayName: z.ZodDefault<z.ZodString>;
|
|
87
|
+
runnerName: z.ZodEnum<{
|
|
88
|
+
node20WithPlaywright: "node20WithPlaywright";
|
|
89
|
+
node20GpuWithPlaywright: "node20GpuWithPlaywright";
|
|
90
|
+
}>;
|
|
91
|
+
screenHeight: z.ZodDefault<z.ZodNumber>;
|
|
92
|
+
screenWidth: z.ZodDefault<z.ZodNumber>;
|
|
93
|
+
type: z.ZodEnum<{
|
|
94
|
+
playwright: "playwright";
|
|
95
|
+
}>;
|
|
96
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
97
|
+
deviceModel: z.ZodDefault<z.ZodString>;
|
|
98
|
+
displayName: z.ZodDefault<z.ZodString>;
|
|
99
|
+
osMajorVersion: z.ZodDefault<z.ZodString>;
|
|
100
|
+
runnerName: z.ZodEnum<{
|
|
101
|
+
node20WithAndroid: "node20WithAndroid";
|
|
102
|
+
}>;
|
|
103
|
+
screenHeight: z.ZodDefault<z.ZodNumber>;
|
|
104
|
+
screenWidth: z.ZodDefault<z.ZodNumber>;
|
|
105
|
+
type: z.ZodEnum<{
|
|
106
|
+
android: "android";
|
|
107
|
+
}>;
|
|
108
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
109
|
+
deviceModel: z.ZodDefault<z.ZodString>;
|
|
110
|
+
displayName: z.ZodDefault<z.ZodString>;
|
|
111
|
+
extraSelectors: z.ZodDefault<z.ZodString>;
|
|
112
|
+
isDeviceGroupDedicated: z.ZodDefault<z.ZodBoolean>;
|
|
113
|
+
isTeamDedicated: z.ZodDefault<z.ZodBoolean>;
|
|
114
|
+
osMajorVersion: z.ZodDefault<z.ZodString>;
|
|
115
|
+
runnerName: z.ZodEnum<{
|
|
116
|
+
node20WithIos: "node20WithIos";
|
|
117
|
+
}>;
|
|
118
|
+
screenHeight: z.ZodDefault<z.ZodNumber>;
|
|
119
|
+
screenWidth: z.ZodDefault<z.ZodNumber>;
|
|
120
|
+
type: z.ZodEnum<{
|
|
121
|
+
ios: "ios";
|
|
122
|
+
}>;
|
|
123
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
124
|
+
displayName: z.ZodDefault<z.ZodString>;
|
|
125
|
+
runnerName: z.ZodEnum<{
|
|
126
|
+
node20Basic: "node20Basic";
|
|
127
|
+
classic: "classic";
|
|
128
|
+
}>;
|
|
129
|
+
type: z.ZodEnum<{
|
|
130
|
+
none: "none";
|
|
131
|
+
}>;
|
|
132
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
133
|
+
displayName: z.ZodDefault<z.ZodString>;
|
|
134
|
+
runnerName: z.ZodString;
|
|
135
|
+
type: z.ZodEnum<{
|
|
136
|
+
invalid: "invalid";
|
|
137
|
+
}>;
|
|
138
|
+
}, z.core.$strip>], "type">;
|
|
139
|
+
export type LegacyExecutionTarget = z.infer<typeof legacyExecutionTargetSchema>;
|
|
140
|
+
declare const idAndIsDeprecatedSchema: z.ZodObject<{
|
|
141
|
+
id: z.ZodString;
|
|
142
|
+
isDeprecated: z.ZodBoolean;
|
|
143
|
+
}, z.core.$strip>;
|
|
144
|
+
type WithIdAndIsDeprecated = z.infer<typeof idAndIsDeprecatedSchema>;
|
|
145
|
+
/**
|
|
146
|
+
* Adds an ID and deprecation status to an execution target configuration.
|
|
147
|
+
* This is used for execution targets that have been loaded from the database.
|
|
148
|
+
*/
|
|
149
|
+
export declare const legacyExecutionTargetWithIdSchema: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
150
|
+
browser: z.ZodDefault<z.ZodEnum<{
|
|
151
|
+
chrome: "chrome";
|
|
152
|
+
chromium: "chromium";
|
|
153
|
+
firefox: "firefox";
|
|
154
|
+
msedge: "msedge";
|
|
155
|
+
webkit: "webkit";
|
|
156
|
+
}>>;
|
|
157
|
+
displayName: z.ZodDefault<z.ZodString>;
|
|
158
|
+
runnerName: z.ZodEnum<{
|
|
159
|
+
node20WithPlaywright: "node20WithPlaywright";
|
|
160
|
+
node20GpuWithPlaywright: "node20GpuWithPlaywright";
|
|
161
|
+
}>;
|
|
162
|
+
screenHeight: z.ZodDefault<z.ZodNumber>;
|
|
163
|
+
screenWidth: z.ZodDefault<z.ZodNumber>;
|
|
164
|
+
type: z.ZodEnum<{
|
|
165
|
+
playwright: "playwright";
|
|
166
|
+
}>;
|
|
167
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
168
|
+
deviceModel: z.ZodDefault<z.ZodString>;
|
|
169
|
+
displayName: z.ZodDefault<z.ZodString>;
|
|
170
|
+
osMajorVersion: z.ZodDefault<z.ZodString>;
|
|
171
|
+
runnerName: z.ZodEnum<{
|
|
172
|
+
node20WithAndroid: "node20WithAndroid";
|
|
173
|
+
}>;
|
|
174
|
+
screenHeight: z.ZodDefault<z.ZodNumber>;
|
|
175
|
+
screenWidth: z.ZodDefault<z.ZodNumber>;
|
|
176
|
+
type: z.ZodEnum<{
|
|
177
|
+
android: "android";
|
|
178
|
+
}>;
|
|
179
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
180
|
+
deviceModel: z.ZodDefault<z.ZodString>;
|
|
181
|
+
displayName: z.ZodDefault<z.ZodString>;
|
|
182
|
+
extraSelectors: z.ZodDefault<z.ZodString>;
|
|
183
|
+
isDeviceGroupDedicated: z.ZodDefault<z.ZodBoolean>;
|
|
184
|
+
isTeamDedicated: z.ZodDefault<z.ZodBoolean>;
|
|
185
|
+
osMajorVersion: z.ZodDefault<z.ZodString>;
|
|
186
|
+
runnerName: z.ZodEnum<{
|
|
187
|
+
node20WithIos: "node20WithIos";
|
|
188
|
+
}>;
|
|
189
|
+
screenHeight: z.ZodDefault<z.ZodNumber>;
|
|
190
|
+
screenWidth: z.ZodDefault<z.ZodNumber>;
|
|
191
|
+
type: z.ZodEnum<{
|
|
192
|
+
ios: "ios";
|
|
193
|
+
}>;
|
|
194
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
195
|
+
displayName: z.ZodDefault<z.ZodString>;
|
|
196
|
+
runnerName: z.ZodEnum<{
|
|
197
|
+
node20Basic: "node20Basic";
|
|
198
|
+
classic: "classic";
|
|
199
|
+
}>;
|
|
200
|
+
type: z.ZodEnum<{
|
|
201
|
+
none: "none";
|
|
202
|
+
}>;
|
|
203
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
204
|
+
displayName: z.ZodDefault<z.ZodString>;
|
|
205
|
+
runnerName: z.ZodString;
|
|
206
|
+
type: z.ZodEnum<{
|
|
207
|
+
invalid: "invalid";
|
|
208
|
+
}>;
|
|
209
|
+
}, z.core.$strip>], "type">, z.ZodObject<{
|
|
210
|
+
id: z.ZodString;
|
|
211
|
+
isDeprecated: z.ZodBoolean;
|
|
212
|
+
}, z.core.$strip>>;
|
|
213
|
+
export type LegacyExecutionTargetWithId = z.infer<typeof legacyExecutionTargetWithIdSchema>;
|
|
214
|
+
export type LegacyExecutionTargetPlaywright = z.infer<typeof legacyExecutionTargetPlaywrightSchema> & WithIdAndIsDeprecated;
|
|
215
|
+
export type LegacyExecutionTargetAndroid = z.infer<typeof legacyExecutionTargetAndroidSchema> & WithIdAndIsDeprecated;
|
|
216
|
+
export type LegacyExecutionTargetIos = z.infer<typeof legacyExecutionTargetIosSchema> & WithIdAndIsDeprecated;
|
|
217
|
+
export type LegacyExecutionTargetMobile = LegacyExecutionTargetAndroid | LegacyExecutionTargetIos;
|
|
218
|
+
export type LegacyExecutionTargetNone = z.infer<typeof legacyExecutionTargetNoneSchema> & WithIdAndIsDeprecated;
|
|
219
|
+
export type LegacyExecutionTargetInvalid = z.infer<typeof legacyExecutionTargetInvalidSchema> & WithIdAndIsDeprecated;
|
|
220
|
+
/** Merged partial schema for all options */
|
|
221
|
+
export declare const legacyExecutionTargetCombinedOptionsSchema: z.ZodObject<{
|
|
222
|
+
browser: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
223
|
+
chrome: "chrome";
|
|
224
|
+
chromium: "chromium";
|
|
225
|
+
firefox: "firefox";
|
|
226
|
+
msedge: "msedge";
|
|
227
|
+
webkit: "webkit";
|
|
228
|
+
}>>>;
|
|
229
|
+
displayName: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
230
|
+
screenHeight: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
231
|
+
screenWidth: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
232
|
+
deviceModel: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
233
|
+
osMajorVersion: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
234
|
+
extraSelectors: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
235
|
+
isDeviceGroupDedicated: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
236
|
+
isTeamDedicated: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
237
|
+
runnerName: z.ZodString;
|
|
238
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
239
|
+
android: "android";
|
|
240
|
+
invalid: "invalid";
|
|
241
|
+
ios: "ios";
|
|
242
|
+
playwright: "playwright";
|
|
243
|
+
none: "none";
|
|
244
|
+
}>>;
|
|
245
|
+
}, z.core.$strip>;
|
|
246
|
+
export type LegacyExecutionTargetCombinedOptions = z.infer<typeof legacyExecutionTargetCombinedOptionsSchema>;
|
|
247
|
+
export {};
|
|
248
|
+
//# sourceMappingURL=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C,CAAC,KAAK,CAChD,OAAO,kCAAkC,CAC1C,GACC,qBAAqB,CAAC;AACxB,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAC5C,OAAO,8BAA8B,CACtC,GACC,qBAAqB,CAAC;AACxB,MAAM,MAAM,2BAA2B,GACnC,4BAA4B,GAC5B,wBAAwB,CAAC;AAE7B,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,+BAA+B,CACvC,GACC,qBAAqB,CAAC;AACxB,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAChD,OAAO,kCAAkC,CAC1C,GACC,qBAAqB,CAAC;AAExB,4CAA4C;AAC5C,eAAO,MAAM,0CAA0C;;;;;;;;;;;;;;;;;;;;;;;;iBAalD,CAAC;AACN,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,KAAK,CACxD,OAAO,0CAA0C,CAClD,CAAC"}
|
package/dist/schema.js
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { browserNameSchema, defaultBrowserName } from "./browser.js";
|
|
3
|
+
// These must be kept in sync with the GraphQL types defined for the execution target resolver.
|
|
4
|
+
export const legacyExecutionTargetTypeEnum = z.enum([
|
|
5
|
+
"android",
|
|
6
|
+
"invalid",
|
|
7
|
+
"ios",
|
|
8
|
+
"playwright",
|
|
9
|
+
"none",
|
|
10
|
+
]);
|
|
11
|
+
// Beware, do not include the same property name in multiple schemas
|
|
12
|
+
// UNLESS they always have the same type/values!
|
|
13
|
+
// For historical run events/attempts, we need to set default values
|
|
14
|
+
const legacyExecutionTargetPlaywrightSchema = z.object({
|
|
15
|
+
browser: browserNameSchema.default(defaultBrowserName),
|
|
16
|
+
displayName: z.string().default("Playwright"),
|
|
17
|
+
runnerName: z.enum(["node20WithPlaywright", "node20GpuWithPlaywright"]),
|
|
18
|
+
screenHeight: z.number().default(804),
|
|
19
|
+
screenWidth: z.number().default(1288),
|
|
20
|
+
type: legacyExecutionTargetTypeEnum.extract(["playwright"]),
|
|
21
|
+
});
|
|
22
|
+
const legacyExecutionTargetAndroidSchema = z.object({
|
|
23
|
+
deviceModel: z.string().default("pixel_2"),
|
|
24
|
+
displayName: z.string().default("Android (default)"),
|
|
25
|
+
osMajorVersion: z.string().default("34"),
|
|
26
|
+
runnerName: z.enum(["node20WithAndroid"]),
|
|
27
|
+
screenHeight: z.number().default(1920),
|
|
28
|
+
screenWidth: z.number().default(1080),
|
|
29
|
+
type: legacyExecutionTargetTypeEnum.extract(["android"]),
|
|
30
|
+
});
|
|
31
|
+
// See https://gist.github.com/adamawolf/3048717 for a complete list of iPhone device models
|
|
32
|
+
const legacyExecutionTargetIosSchema = z.object({
|
|
33
|
+
// By default we leave this empty, it implies the platform will select any available device model
|
|
34
|
+
deviceModel: z.string().default(""),
|
|
35
|
+
displayName: z.string().default("iOS (default)"),
|
|
36
|
+
// Comma seperated key=value pairs for extra selectors in DeviceClaim
|
|
37
|
+
extraSelectors: z.string().default(""),
|
|
38
|
+
// If the execution target uses a device group dedicated to the team
|
|
39
|
+
isDeviceGroupDedicated: z.boolean().default(false),
|
|
40
|
+
// If the execution target uses only allowlisted devices by the team
|
|
41
|
+
isTeamDedicated: z.boolean().default(false),
|
|
42
|
+
// By default we leave this empty, it implies the platform will select any available iOS version
|
|
43
|
+
osMajorVersion: z.string().default(""),
|
|
44
|
+
runnerName: z.enum(["node20WithIos"]),
|
|
45
|
+
// Screen width and height set to largest available as of 2025-01-31 (iPhone 16 Pro Max)
|
|
46
|
+
screenHeight: z.number().default(2868),
|
|
47
|
+
screenWidth: z.number().default(1320),
|
|
48
|
+
type: legacyExecutionTargetTypeEnum.extract(["ios"]),
|
|
49
|
+
});
|
|
50
|
+
const legacyExecutionTargetNoneSchema = z.object({
|
|
51
|
+
displayName: z.string().default("Basic"),
|
|
52
|
+
runnerName: z.enum(["node20Basic", "classic"]),
|
|
53
|
+
type: legacyExecutionTargetTypeEnum.extract(["none"]),
|
|
54
|
+
});
|
|
55
|
+
const legacyExecutionTargetInvalidSchema = z.object({
|
|
56
|
+
displayName: z.string().default("Invalid"),
|
|
57
|
+
runnerName: z.string(),
|
|
58
|
+
type: legacyExecutionTargetTypeEnum.extract(["invalid"]),
|
|
59
|
+
});
|
|
60
|
+
/**
|
|
61
|
+
* Union of configuration options for different execution targets.
|
|
62
|
+
*/
|
|
63
|
+
export const legacyExecutionTargetSchema = z.discriminatedUnion("type", [
|
|
64
|
+
legacyExecutionTargetPlaywrightSchema,
|
|
65
|
+
legacyExecutionTargetAndroidSchema,
|
|
66
|
+
legacyExecutionTargetIosSchema,
|
|
67
|
+
legacyExecutionTargetNoneSchema,
|
|
68
|
+
legacyExecutionTargetInvalidSchema,
|
|
69
|
+
]);
|
|
70
|
+
const idAndIsDeprecatedSchema = z.object({
|
|
71
|
+
id: z.string(),
|
|
72
|
+
isDeprecated: z.boolean(),
|
|
73
|
+
});
|
|
74
|
+
/**
|
|
75
|
+
* Adds an ID and deprecation status to an execution target configuration.
|
|
76
|
+
* This is used for execution targets that have been loaded from the database.
|
|
77
|
+
*/
|
|
78
|
+
export const legacyExecutionTargetWithIdSchema = z.intersection(legacyExecutionTargetSchema, idAndIsDeprecatedSchema);
|
|
79
|
+
/** Merged partial schema for all options */
|
|
80
|
+
export const legacyExecutionTargetCombinedOptionsSchema = legacyExecutionTargetPlaywrightSchema
|
|
81
|
+
.merge(legacyExecutionTargetAndroidSchema)
|
|
82
|
+
.merge(legacyExecutionTargetIosSchema)
|
|
83
|
+
.merge(legacyExecutionTargetNoneSchema)
|
|
84
|
+
.merge(legacyExecutionTargetInvalidSchema)
|
|
85
|
+
.omit({ runnerName: true, type: true })
|
|
86
|
+
.partial()
|
|
87
|
+
.merge(z.object({
|
|
88
|
+
runnerName: z.string(),
|
|
89
|
+
type: legacyExecutionTargetTypeEnum.optional(),
|
|
90
|
+
}));
|
|
91
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
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EAAE;IACtB,IAAI,EAAE,6BAA6B,CAAC,QAAQ,EAAE;CAC/C,CAAC,CACH,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@qawolf/legacy-execution-targets",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"type": "module",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"files": [
|
|
16
|
+
"/dist",
|
|
17
|
+
"/LICENSE",
|
|
18
|
+
"/README.md"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "rm -rf ./dist && tsc -p tsconfig.build.json",
|
|
22
|
+
"lint:ci": "npm run lint:non-fixable; NON_FIXABLE_EXIT=$?; npm run lint:fixable && exit $NON_FIXABLE_EXIT",
|
|
23
|
+
"lint:dev": "npm run lint:fixable",
|
|
24
|
+
"lint:fixable": "eslint . --ext cjs,cts,js,jsx,mjs,ts,tsx --fix --quiet && prettier --log-level=warn --write .",
|
|
25
|
+
"lint:non-fixable": "dpdm --exit-code circular:1 --no-tree --no-warning --transform --include='.*' --exclude='/(dist|node_modules)/' '**/*'",
|
|
26
|
+
"prepublishOnly": "nx run legacy-execution-targets:build",
|
|
27
|
+
"test": "NODE_OPTIONS=\"--experimental-vm-modules\" NODE_NO_WARNINGS=1 jest --passWithNoTests",
|
|
28
|
+
"tsc:check": "tsc"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"tslib": "^2.6.2",
|
|
32
|
+
"zod": "^4.1.11"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"typescript": "^5.9.2"
|
|
36
|
+
},
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=20.19.0 <25"
|
|
39
|
+
},
|
|
40
|
+
"nx": {
|
|
41
|
+
"targets": {
|
|
42
|
+
"npm:publish": {}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|