farm-runner 1.1.10 → 1.1.12
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 +77 -2
- package/dist/src/bundle.js +1 -1
- package/dist/src/cli.js +96 -0
- package/dist/src/config/node.config.d.ts +88 -0
- package/dist/src/config/node.config.d.ts.map +1 -0
- package/dist/src/config/node.config.js +180 -0
- package/dist/src/config/node.config.js.map +1 -0
- package/dist/src/scripts/prepare-wda.d.ts +48 -11
- package/dist/src/scripts/prepare-wda.d.ts.map +1 -1
- package/dist/src/scripts/prepare-wda.js +203 -322
- package/dist/src/scripts/prepare-wda.js.map +1 -1
- package/package.json +23 -6
- package/dist/src/scripts/prepare-wda-cli.d.ts +0 -14
- package/dist/src/scripts/prepare-wda-cli.d.ts.map +0 -1
- package/dist/src/scripts/prepare-wda-cli.js +0 -71
- package/dist/src/scripts/prepare-wda-cli.js.map +0 -1
package/dist/src/cli.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
/**
|
|
4
|
+
* Farm Runner CLI
|
|
5
|
+
*
|
|
6
|
+
* Main entry point for the farm-runner CLI tool
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* farm-runner [command] [options]
|
|
10
|
+
*
|
|
11
|
+
* Commands:
|
|
12
|
+
* start Start the node server (default)
|
|
13
|
+
* --help, -h Show help message
|
|
14
|
+
*/
|
|
15
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
const child_process_1 = require("child_process");
|
|
20
|
+
const fs_1 = __importDefault(require("fs"));
|
|
21
|
+
const path_1 = __importDefault(require("path"));
|
|
22
|
+
/**
|
|
23
|
+
* Parse CLI arguments
|
|
24
|
+
*/
|
|
25
|
+
function parseArgs() {
|
|
26
|
+
const args = process.argv.slice(2);
|
|
27
|
+
if (args.length === 0 || args[0] === 'start') {
|
|
28
|
+
return { command: 'start', args: args.slice(1) };
|
|
29
|
+
}
|
|
30
|
+
if (args[0] === '--help' || args[0] === '-h') {
|
|
31
|
+
return { command: 'help', args: [] };
|
|
32
|
+
}
|
|
33
|
+
// If no recognized command, treat as start with all args
|
|
34
|
+
return { command: 'start', args };
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Show help message
|
|
38
|
+
*/
|
|
39
|
+
function showHelp() {
|
|
40
|
+
console.log(`
|
|
41
|
+
Farm Runner - Device Farm Node Server
|
|
42
|
+
|
|
43
|
+
Usage:
|
|
44
|
+
farm-runner [command] [options]
|
|
45
|
+
|
|
46
|
+
Commands:
|
|
47
|
+
start Start the node server (default)
|
|
48
|
+
--help, -h Show this help message
|
|
49
|
+
|
|
50
|
+
Examples:
|
|
51
|
+
farm-runner # Start the server
|
|
52
|
+
farm-runner start # Start the server
|
|
53
|
+
farm-runner start --config ./node.config.json # Start with custom config
|
|
54
|
+
|
|
55
|
+
For more information, visit: https://github.com/your-repo/device-farm
|
|
56
|
+
`);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Start the node server
|
|
60
|
+
*/
|
|
61
|
+
function startServer(args) {
|
|
62
|
+
// In production, use the bundled version if available
|
|
63
|
+
// In development, fall back to server.js
|
|
64
|
+
const bundlePath = path_1.default.join(__dirname, 'bundle.js');
|
|
65
|
+
const serverPath = path_1.default.join(__dirname, 'server.js');
|
|
66
|
+
const targetPath = fs_1.default.existsSync(bundlePath) ? bundlePath : serverPath;
|
|
67
|
+
const child = (0, child_process_1.spawn)('node', [targetPath, ...args], {
|
|
68
|
+
stdio: 'inherit',
|
|
69
|
+
env: process.env,
|
|
70
|
+
});
|
|
71
|
+
child.on('exit', code => {
|
|
72
|
+
process.exit(code || 0);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Main CLI handler
|
|
77
|
+
*/
|
|
78
|
+
function main() {
|
|
79
|
+
const { command, args } = parseArgs();
|
|
80
|
+
switch (command) {
|
|
81
|
+
case 'help':
|
|
82
|
+
showHelp();
|
|
83
|
+
process.exit(0);
|
|
84
|
+
break;
|
|
85
|
+
case 'start':
|
|
86
|
+
startServer(args);
|
|
87
|
+
break;
|
|
88
|
+
default:
|
|
89
|
+
console.error(`❌ Unknown command: ${command}`);
|
|
90
|
+
console.log('Run "farm-runner --help" for usage information.');
|
|
91
|
+
process.exit(1);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
// Run the CLI
|
|
95
|
+
main();
|
|
96
|
+
//# sourceMappingURL=cli.js.map
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export interface AppiumServerConfig {
|
|
2
|
+
/** Enable embedded Appium server */
|
|
3
|
+
enabled?: boolean;
|
|
4
|
+
/**
|
|
5
|
+
* Appium server arguments - pass everything here exactly as Appium expects
|
|
6
|
+
* All server configuration goes in this object and will be passed directly to Appium
|
|
7
|
+
*
|
|
8
|
+
* Defaults (applied if not specified):
|
|
9
|
+
* - "log-level": "debug" (for complete log visibility including ADB commands, proxying, etc.)
|
|
10
|
+
* - "log-timestamp": true (shows timestamps in logs)
|
|
11
|
+
*
|
|
12
|
+
* Common options:
|
|
13
|
+
* - port: 4723 (if not specified, will auto-detect)
|
|
14
|
+
* - address: '0.0.0.0' or '127.0.0.1'
|
|
15
|
+
* - "allow-cors": true
|
|
16
|
+
* - "use-drivers": ["uiautomator2", "xcuitest"]
|
|
17
|
+
* - "use-plugins": ["images", "relaxed-caps"]
|
|
18
|
+
* - "relaxed-security": true
|
|
19
|
+
* - "session-override": true
|
|
20
|
+
* - "base-path": "/wd/hub"
|
|
21
|
+
* - "log-level": "debug" (or "info", "warn", "error")
|
|
22
|
+
* - "log-timestamp": true
|
|
23
|
+
* - "allow-insecure": ["adb_shell"]
|
|
24
|
+
* - "default-capabilities": { key: "value" }
|
|
25
|
+
* - appiumHome: "/path/to/.appium"
|
|
26
|
+
*
|
|
27
|
+
* For all available options, see:
|
|
28
|
+
* @see https://appium.io/docs/en/latest/guides/config/
|
|
29
|
+
*/
|
|
30
|
+
serverArgs?: Record<string, unknown>;
|
|
31
|
+
}
|
|
32
|
+
export interface NodeConfig {
|
|
33
|
+
hubUrl: string;
|
|
34
|
+
accessKey: string;
|
|
35
|
+
token: string;
|
|
36
|
+
name: string;
|
|
37
|
+
host: string;
|
|
38
|
+
os: string;
|
|
39
|
+
tags: string | null;
|
|
40
|
+
capabilityPortRange?: {
|
|
41
|
+
min: number;
|
|
42
|
+
max: number;
|
|
43
|
+
};
|
|
44
|
+
chromeDriverPath?: string;
|
|
45
|
+
platform?: 'android' | 'ios' | 'both';
|
|
46
|
+
bootedSimulators?: boolean;
|
|
47
|
+
/** iOS device type filter */
|
|
48
|
+
iosDeviceType?: 'real' | 'simulated' | 'both';
|
|
49
|
+
/** Android device type filter */
|
|
50
|
+
androidDeviceType?: 'real' | 'simulated' | 'both';
|
|
51
|
+
/** Appium server configuration */
|
|
52
|
+
appiumServer?: AppiumServerConfig;
|
|
53
|
+
/** Temporary session logs directory (default: './tmp') - logs are uploaded to hub after session ends */
|
|
54
|
+
tempLogsDir?: string;
|
|
55
|
+
/** Absolute path to store WDA resigned IPA files (default: ~/.cache/device-farm) */
|
|
56
|
+
wdaResignedIpaPath?: string;
|
|
57
|
+
/** List of Android app package names to uninstall after session ends (e.g., ["com.example.app1", "com.example.app2"]) */
|
|
58
|
+
androidCleanUpApps?: string[];
|
|
59
|
+
/** List of iOS app bundle IDs to uninstall after session ends (e.g., ["com.example.app1", "com.example.app2"]) */
|
|
60
|
+
iosCleanUpApps?: string[];
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Load configuration from file or return default
|
|
64
|
+
*/
|
|
65
|
+
export declare function loadConfig(configPath?: string): Partial<NodeConfig>;
|
|
66
|
+
/**
|
|
67
|
+
* Save configuration to file
|
|
68
|
+
*/
|
|
69
|
+
export declare function saveConfig(config: NodeConfig, configPath?: string): void;
|
|
70
|
+
/**
|
|
71
|
+
* Parse CLI arguments
|
|
72
|
+
*/
|
|
73
|
+
export declare function parseCLIArgs(): Partial<NodeConfig>;
|
|
74
|
+
/**
|
|
75
|
+
* Get config file path from CLI arguments
|
|
76
|
+
*/
|
|
77
|
+
export declare function getConfigPathFromCLI(): string | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Merge config from file, CLI args, and environment variables
|
|
80
|
+
*/
|
|
81
|
+
export declare function getMergedConfig(configPath?: string): NodeConfig;
|
|
82
|
+
/**
|
|
83
|
+
* Get the temporary logs directory path
|
|
84
|
+
* @param configPath - Optional config path override
|
|
85
|
+
* @returns Absolute path to temp logs directory
|
|
86
|
+
*/
|
|
87
|
+
export declare function getTempLogsDir(configPath?: string): string;
|
|
88
|
+
//# sourceMappingURL=node.config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.config.d.ts","sourceRoot":"","sources":["../../../src/config/node.config.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,kBAAkB;IACjC,oCAAoC;IACpC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,mBAAmB,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IACnD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,SAAS,GAAG,KAAK,GAAG,MAAM,CAAC;IACtC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,6BAA6B;IAC7B,aAAa,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;IAC9C,iCAAiC;IACjC,iBAAiB,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;IAClD,kCAAkC;IAClC,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC,wGAAwG;IACxG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oFAAoF;IACpF,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,yHAAyH;IACzH,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,kHAAkH;IAClH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAiBnE;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CASxE;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAAC,UAAU,CAAC,CAyElD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,GAAG,SAAS,CAQzD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,UAAU,CAkC/D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAS1D"}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.loadConfig = loadConfig;
|
|
7
|
+
exports.saveConfig = saveConfig;
|
|
8
|
+
exports.parseCLIArgs = parseCLIArgs;
|
|
9
|
+
exports.getConfigPathFromCLI = getConfigPathFromCLI;
|
|
10
|
+
exports.getMergedConfig = getMergedConfig;
|
|
11
|
+
exports.getTempLogsDir = getTempLogsDir;
|
|
12
|
+
const fs_1 = __importDefault(require("fs"));
|
|
13
|
+
const path_1 = __importDefault(require("path"));
|
|
14
|
+
/**
|
|
15
|
+
* Load configuration from file or return default
|
|
16
|
+
*/
|
|
17
|
+
function loadConfig(configPath) {
|
|
18
|
+
const defaultConfigPath = path_1.default.resolve(process.cwd(), 'node.config.json');
|
|
19
|
+
const configFile = configPath || defaultConfigPath;
|
|
20
|
+
let config = {};
|
|
21
|
+
// Try to load from file if it exists
|
|
22
|
+
if (fs_1.default.existsSync(configFile)) {
|
|
23
|
+
try {
|
|
24
|
+
const fileContent = fs_1.default.readFileSync(configFile, 'utf-8');
|
|
25
|
+
config = JSON.parse(fileContent);
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
console.warn(`Warning: Failed to parse config file ${configFile}:`, error);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return config;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Save configuration to file
|
|
35
|
+
*/
|
|
36
|
+
function saveConfig(config, configPath) {
|
|
37
|
+
const defaultConfigPath = path_1.default.resolve(process.cwd(), 'node.config.json');
|
|
38
|
+
const configFile = configPath || defaultConfigPath;
|
|
39
|
+
try {
|
|
40
|
+
fs_1.default.writeFileSync(configFile, JSON.stringify(config, null, 2), 'utf-8');
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
console.error(`Failed to save config file ${configFile}:`, error);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Parse CLI arguments
|
|
48
|
+
*/
|
|
49
|
+
function parseCLIArgs() {
|
|
50
|
+
const args = process.argv.slice(2);
|
|
51
|
+
const config = {};
|
|
52
|
+
for (let i = 0; i < args.length; i++) {
|
|
53
|
+
const arg = args[i];
|
|
54
|
+
const nextArg = args[i + 1];
|
|
55
|
+
switch (arg) {
|
|
56
|
+
case '--hub-url':
|
|
57
|
+
case '-u':
|
|
58
|
+
if (nextArg) {
|
|
59
|
+
config.hubUrl = nextArg;
|
|
60
|
+
i++;
|
|
61
|
+
}
|
|
62
|
+
break;
|
|
63
|
+
case '--access-key':
|
|
64
|
+
case '-a':
|
|
65
|
+
if (nextArg) {
|
|
66
|
+
config.accessKey = nextArg;
|
|
67
|
+
i++;
|
|
68
|
+
}
|
|
69
|
+
break;
|
|
70
|
+
case '--token':
|
|
71
|
+
case '-t':
|
|
72
|
+
if (nextArg) {
|
|
73
|
+
config.token = nextArg;
|
|
74
|
+
i++;
|
|
75
|
+
}
|
|
76
|
+
break;
|
|
77
|
+
case '--name':
|
|
78
|
+
case '-n':
|
|
79
|
+
if (nextArg) {
|
|
80
|
+
config.name = nextArg;
|
|
81
|
+
i++;
|
|
82
|
+
}
|
|
83
|
+
break;
|
|
84
|
+
case '--host':
|
|
85
|
+
case '-h':
|
|
86
|
+
if (nextArg) {
|
|
87
|
+
config.host = nextArg;
|
|
88
|
+
i++;
|
|
89
|
+
}
|
|
90
|
+
break;
|
|
91
|
+
case '--os':
|
|
92
|
+
if (nextArg) {
|
|
93
|
+
config.os = nextArg;
|
|
94
|
+
i++;
|
|
95
|
+
}
|
|
96
|
+
break;
|
|
97
|
+
case '--tags':
|
|
98
|
+
if (nextArg) {
|
|
99
|
+
config.tags = nextArg;
|
|
100
|
+
i++;
|
|
101
|
+
}
|
|
102
|
+
break;
|
|
103
|
+
case '--temp-logs-dir':
|
|
104
|
+
if (nextArg) {
|
|
105
|
+
config.tempLogsDir = nextArg;
|
|
106
|
+
i++;
|
|
107
|
+
}
|
|
108
|
+
break;
|
|
109
|
+
case '--config':
|
|
110
|
+
case '-c':
|
|
111
|
+
if (nextArg) {
|
|
112
|
+
// This will be handled separately
|
|
113
|
+
i++;
|
|
114
|
+
}
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return config;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Get config file path from CLI arguments
|
|
122
|
+
*/
|
|
123
|
+
function getConfigPathFromCLI() {
|
|
124
|
+
const args = process.argv.slice(2);
|
|
125
|
+
for (let i = 0; i < args.length; i++) {
|
|
126
|
+
if ((args[i] === '--config' || args[i] === '-c') && args[i + 1]) {
|
|
127
|
+
return args[i + 1];
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return undefined;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Merge config from file, CLI args, and environment variables
|
|
134
|
+
*/
|
|
135
|
+
function getMergedConfig(configPath) {
|
|
136
|
+
// Get config path from CLI if not provided
|
|
137
|
+
const cliConfigPath = getConfigPathFromCLI();
|
|
138
|
+
const finalConfigPath = configPath || cliConfigPath;
|
|
139
|
+
// Load from file
|
|
140
|
+
const baseConfig = finalConfigPath ? loadConfig(finalConfigPath) : loadConfig();
|
|
141
|
+
// Parse CLI args (excluding config path)
|
|
142
|
+
const cliConfig = parseCLIArgs();
|
|
143
|
+
// Merge: file config < CLI args < environment variables
|
|
144
|
+
const merged = {
|
|
145
|
+
hubUrl: process.env.HUB_URL || cliConfig.hubUrl || baseConfig.hubUrl || '',
|
|
146
|
+
accessKey: process.env.ACCESS_KEY || cliConfig.accessKey || baseConfig.accessKey || '',
|
|
147
|
+
token: process.env.TOKEN || cliConfig.token || baseConfig.token || '',
|
|
148
|
+
name: cliConfig.name || baseConfig.name || '',
|
|
149
|
+
host: cliConfig.host || baseConfig.host || '',
|
|
150
|
+
os: cliConfig.os || baseConfig.os || '',
|
|
151
|
+
tags: cliConfig.tags !== undefined ? cliConfig.tags : (baseConfig.tags ?? null),
|
|
152
|
+
capabilityPortRange: cliConfig.capabilityPortRange || baseConfig.capabilityPortRange,
|
|
153
|
+
chromeDriverPath: cliConfig.chromeDriverPath || baseConfig.chromeDriverPath,
|
|
154
|
+
platform: baseConfig.platform,
|
|
155
|
+
bootedSimulators: baseConfig.bootedSimulators,
|
|
156
|
+
iosDeviceType: baseConfig.iosDeviceType,
|
|
157
|
+
androidDeviceType: baseConfig.androidDeviceType,
|
|
158
|
+
appiumServer: cliConfig.appiumServer || baseConfig.appiumServer,
|
|
159
|
+
tempLogsDir: cliConfig.tempLogsDir || baseConfig.tempLogsDir,
|
|
160
|
+
wdaResignedIpaPath: process.env.WDA_RESIGNED_IPA_PATH || baseConfig.wdaResignedIpaPath,
|
|
161
|
+
androidCleanUpApps: baseConfig.androidCleanUpApps,
|
|
162
|
+
iosCleanUpApps: baseConfig.iosCleanUpApps,
|
|
163
|
+
};
|
|
164
|
+
return merged;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Get the temporary logs directory path
|
|
168
|
+
* @param configPath - Optional config path override
|
|
169
|
+
* @returns Absolute path to temp logs directory
|
|
170
|
+
*/
|
|
171
|
+
function getTempLogsDir(configPath) {
|
|
172
|
+
const config = getMergedConfig(configPath);
|
|
173
|
+
const tempLogsDir = config.tempLogsDir || './tmp';
|
|
174
|
+
// If it's a relative path, resolve it from cwd
|
|
175
|
+
if (!path_1.default.isAbsolute(tempLogsDir)) {
|
|
176
|
+
return path_1.default.resolve(process.cwd(), tempLogsDir);
|
|
177
|
+
}
|
|
178
|
+
return tempLogsDir;
|
|
179
|
+
}
|
|
180
|
+
//# sourceMappingURL=node.config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.config.js","sourceRoot":"","sources":["../../../src/config/node.config.ts"],"names":[],"mappings":";;;;;AAkEA,gCAiBC;AAKD,gCASC;AAKD,oCAyEC;AAKD,oDAQC;AAKD,0CAkCC;AAOD,wCASC;AAnPD,4CAAoB;AACpB,gDAAwB;AA8DxB;;GAEG;AACH,SAAgB,UAAU,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OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,UAAU,CAAC,kBAAkB;QACtF,kBAAkB,EAAE,UAAU,CAAC,kBAAkB;QACjD,cAAc,EAAE,UAAU,CAAC,cAAc;KAC1C,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,SAAgB,cAAc,CAAC,UAAmB;IAChD,MAAM,MAAM,GAAG,eAAe,CAAC,UAAU,CAAC,CAAC;IAC3C,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,IAAI,OAAO,CAAC;IAElD,+CAA+C;IAC/C,IAAI,CAAC,cAAI,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;QAClC,OAAO,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,WAAW,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
|
@@ -1,22 +1,59 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* WebDriverAgent (WDA) Preparation
|
|
2
|
+
* WebDriverAgent (WDA) Preparation Module
|
|
3
3
|
*
|
|
4
|
-
* This
|
|
5
|
-
* It
|
|
4
|
+
* This module provides functionality to build, sign, and package WebDriverAgent for iOS devices.
|
|
5
|
+
* It is used via the WebSocket API from the hub UI, not as a CLI command.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* The prepareWda function is called with the following options:
|
|
8
|
+
* - provisioningUUID: UUID of the provisioning profile to use (REQUIRED)
|
|
9
|
+
* - isFreeAccount: Whether this is a free or enterprise account (REQUIRED)
|
|
10
|
+
* - outputFileName: Custom output filename without .ipa extension (optional, defaults to 'wda-resign')
|
|
11
|
+
* - uploadToHub: Whether to upload to hub after build (optional, defaults to true)
|
|
12
|
+
* - setAsDefault: Whether to set as default WDA (optional, defaults to false)
|
|
13
|
+
* - wdaProjectPath: Path to WebDriverAgent xcode project (optional, auto-detected if not provided)
|
|
14
|
+
* - platform: Platform type: ios, tvos, or both (optional, defaults to 'ios')
|
|
15
|
+
* - onProgress: Callback for progress updates (optional)
|
|
11
16
|
*/
|
|
12
|
-
interface PrepareWdaOptions {
|
|
17
|
+
export interface PrepareWdaOptions {
|
|
13
18
|
mobileProvisioningFile?: string;
|
|
19
|
+
provisioningUUID: string;
|
|
20
|
+
isFreeAccount: boolean;
|
|
21
|
+
outputFileName?: string;
|
|
22
|
+
uploadToHub?: boolean;
|
|
23
|
+
setAsDefault?: boolean;
|
|
14
24
|
wdaProjectPath?: string;
|
|
15
25
|
platform?: 'ios' | 'tvos' | 'both';
|
|
26
|
+
onProgress?: (step: string, message: string, progress?: number) => void;
|
|
16
27
|
}
|
|
28
|
+
export interface PrepareWdaResult {
|
|
29
|
+
success: boolean;
|
|
30
|
+
message: string;
|
|
31
|
+
ipaPath?: string;
|
|
32
|
+
wdaId?: string;
|
|
33
|
+
bundleId?: string;
|
|
34
|
+
error?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Get provisioning profile path based on Xcode version
|
|
38
|
+
*/
|
|
39
|
+
export declare function getProvisioningProfilePath(): Promise<string>;
|
|
40
|
+
/**
|
|
41
|
+
* Main function to prepare WDA (non-interactive, API-driven)
|
|
42
|
+
*
|
|
43
|
+
* This function is called via WebSocket from the hub UI. All parameters
|
|
44
|
+
* must be provided - there are no interactive prompts.
|
|
45
|
+
*/
|
|
46
|
+
export declare function prepareWda(options: PrepareWdaOptions): Promise<PrepareWdaResult>;
|
|
17
47
|
/**
|
|
18
|
-
*
|
|
48
|
+
* List available provisioning profiles on this machine
|
|
49
|
+
* Used by the hub UI to populate the profile selection dropdown
|
|
19
50
|
*/
|
|
20
|
-
export declare function
|
|
21
|
-
|
|
51
|
+
export declare function listProvisioningProfiles(): Promise<{
|
|
52
|
+
profiles: Array<{
|
|
53
|
+
uuid: string;
|
|
54
|
+
name: string;
|
|
55
|
+
teamName: string;
|
|
56
|
+
filePath: string;
|
|
57
|
+
}>;
|
|
58
|
+
}>;
|
|
22
59
|
//# sourceMappingURL=prepare-wda.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepare-wda.d.ts","sourceRoot":"","sources":["../../../src/scripts/prepare-wda.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"prepare-wda.d.ts","sourceRoot":"","sources":["../../../src/scripts/prepare-wda.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAkBH,MAAM,WAAW,iBAAiB;IAChC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,OAAO,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;IACnC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACzE;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA4BD;;GAEG;AACH,wBAAsB,0BAA0B,IAAI,OAAO,CAAC,MAAM,CAAC,CAQlE;AA6OD;;;;;GAKG;AACH,wBAAsB,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA2LtF;AAED;;;GAGG;AACH,wBAAsB,wBAAwB,I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