appium-webdriveragent 14.2.0 → 15.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/CHANGELOG.md +17 -0
- package/WebDriverAgentLib/Info.plist +2 -2
- package/build/lib/types.d.ts +44 -4
- package/build/lib/types.d.ts.map +1 -1
- package/build/lib/utils/index.d.ts +11 -0
- package/build/lib/utils/index.d.ts.map +1 -0
- package/build/lib/utils/index.js +27 -0
- package/build/lib/utils/index.js.map +1 -0
- package/build/lib/utils/module.d.ts +6 -0
- package/build/lib/utils/module.d.ts.map +1 -0
- package/build/lib/utils/module.js +31 -0
- package/build/lib/utils/module.js.map +1 -0
- package/build/lib/utils/platform.d.ts +7 -0
- package/build/lib/utils/platform.d.ts.map +1 -0
- package/build/lib/utils/platform.js +13 -0
- package/build/lib/utils/platform.js.map +1 -0
- package/build/lib/utils/processes.d.ts +23 -0
- package/build/lib/utils/processes.d.ts.map +1 -0
- package/build/lib/utils/processes.js +132 -0
- package/build/lib/utils/processes.js.map +1 -0
- package/build/lib/utils/security.d.ts +5 -0
- package/build/lib/utils/security.d.ts.map +1 -0
- package/build/lib/utils/security.js +15 -0
- package/build/lib/utils/security.js.map +1 -0
- package/build/lib/utils/xctestrun.d.ts +51 -0
- package/build/lib/utils/xctestrun.d.ts.map +1 -0
- package/build/lib/utils/xctestrun.js +120 -0
- package/build/lib/utils/xctestrun.js.map +1 -0
- package/build/lib/wda-strategies.d.ts +69 -0
- package/build/lib/wda-strategies.d.ts.map +1 -0
- package/build/lib/wda-strategies.js +253 -0
- package/build/lib/wda-strategies.js.map +1 -0
- package/build/lib/webdriveragent.d.ts +3 -14
- package/build/lib/webdriveragent.d.ts.map +1 -1
- package/build/lib/webdriveragent.js +78 -127
- package/build/lib/webdriveragent.js.map +1 -1
- package/build/lib/xcodebuild.d.ts.map +1 -1
- package/build/lib/xcodebuild.js +29 -7
- package/build/lib/xcodebuild.js.map +1 -1
- package/lib/types.ts +58 -4
- package/lib/utils/index.ts +20 -0
- package/lib/utils/module.ts +29 -0
- package/lib/utils/platform.ts +10 -0
- package/lib/utils/processes.ts +135 -0
- package/lib/utils/security.ts +15 -0
- package/lib/utils/xctestrun.ts +160 -0
- package/lib/wda-strategies.ts +340 -0
- package/lib/webdriveragent.ts +89 -163
- package/lib/xcodebuild.ts +34 -17
- package/package.json +3 -4
- package/build/lib/utils.d.ts +0 -105
- package/build/lib/utils.d.ts.map +0 -1
- package/build/lib/utils.js +0 -413
- package/build/lib/utils.js.map +0 -1
- package/lib/utils.ts +0 -442
package/build/lib/utils.js
DELETED
|
@@ -1,413 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.BOOTSTRAP_PATH = void 0;
|
|
40
|
-
exports.killAppUsingPattern = killAppUsingPattern;
|
|
41
|
-
exports.isTvOS = isTvOS;
|
|
42
|
-
exports.setRealDeviceSecurity = setRealDeviceSecurity;
|
|
43
|
-
exports.setXctestrunFile = setXctestrunFile;
|
|
44
|
-
exports.getAdditionalRunContent = getAdditionalRunContent;
|
|
45
|
-
exports.getXctestrunFilePath = getXctestrunFilePath;
|
|
46
|
-
exports.getXctestrunFileName = getXctestrunFileName;
|
|
47
|
-
exports.killProcess = killProcess;
|
|
48
|
-
exports.randomInt = randomInt;
|
|
49
|
-
exports.getWDAUpgradeTimestamp = getWDAUpgradeTimestamp;
|
|
50
|
-
exports.escapeRegExp = escapeRegExp;
|
|
51
|
-
exports.truncateString = truncateString;
|
|
52
|
-
exports.resetTestProcesses = resetTestProcesses;
|
|
53
|
-
exports.getPIDsListeningOnPort = getPIDsListeningOnPort;
|
|
54
|
-
const support_1 = require("@appium/support");
|
|
55
|
-
const teen_process_1 = require("teen_process");
|
|
56
|
-
const node_path_1 = __importStar(require("node:path"));
|
|
57
|
-
const node_url_1 = require("node:url");
|
|
58
|
-
const logger_1 = require("./logger");
|
|
59
|
-
const constants_1 = require("./constants");
|
|
60
|
-
const node_fs_1 = __importDefault(require("node:fs"));
|
|
61
|
-
const asyncbox_1 = require("asyncbox");
|
|
62
|
-
const node_os_1 = require("node:os");
|
|
63
|
-
// Get current filename - works in both CommonJS and ESM
|
|
64
|
-
const currentFilename = typeof __filename !== 'undefined'
|
|
65
|
-
? __filename
|
|
66
|
-
: (0, node_url_1.fileURLToPath)(new Function('return import.meta.url')());
|
|
67
|
-
const currentDirname = (0, node_path_1.dirname)(currentFilename);
|
|
68
|
-
let moduleRootCache;
|
|
69
|
-
/**
|
|
70
|
-
* Calculates the path to the current module's root folder
|
|
71
|
-
*
|
|
72
|
-
* @returns {string} The full path to module root
|
|
73
|
-
* @throws {Error} If the current module root folder cannot be determined
|
|
74
|
-
*/
|
|
75
|
-
const getModuleRoot = function getModuleRoot() {
|
|
76
|
-
if (moduleRootCache) {
|
|
77
|
-
return moduleRootCache;
|
|
78
|
-
}
|
|
79
|
-
let currentDir = currentDirname;
|
|
80
|
-
let isAtFsRoot = false;
|
|
81
|
-
while (!isAtFsRoot) {
|
|
82
|
-
const manifestPath = node_path_1.default.join(currentDir, 'package.json');
|
|
83
|
-
try {
|
|
84
|
-
if (node_fs_1.default.existsSync(manifestPath) &&
|
|
85
|
-
JSON.parse(node_fs_1.default.readFileSync(manifestPath, 'utf8')).name === 'appium-webdriveragent') {
|
|
86
|
-
moduleRootCache = currentDir;
|
|
87
|
-
return currentDir;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
catch { }
|
|
91
|
-
currentDir = node_path_1.default.dirname(currentDir);
|
|
92
|
-
isAtFsRoot = currentDir.length <= node_path_1.default.dirname(currentDir).length;
|
|
93
|
-
}
|
|
94
|
-
throw new Error('Cannot find the root folder of the appium-webdriveragent Node.js module');
|
|
95
|
-
};
|
|
96
|
-
exports.BOOTSTRAP_PATH = getModuleRoot();
|
|
97
|
-
/**
|
|
98
|
-
* Find and terminate all processes matching the given pgrep pattern.
|
|
99
|
-
*/
|
|
100
|
-
async function killAppUsingPattern(pgrepPattern) {
|
|
101
|
-
const signals = [2, 15, 9];
|
|
102
|
-
for (const signal of signals) {
|
|
103
|
-
const matchedPids = await getPIDsUsingPattern(pgrepPattern);
|
|
104
|
-
if (matchedPids.length === 0) {
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
const args = [`-${signal}`, ...matchedPids];
|
|
108
|
-
try {
|
|
109
|
-
await (0, teen_process_1.exec)('kill', args);
|
|
110
|
-
}
|
|
111
|
-
catch (err) {
|
|
112
|
-
logger_1.log.debug(`kill ${args.join(' ')} -> ${err.message}`);
|
|
113
|
-
}
|
|
114
|
-
if (signal === signals[signals.length - 1]) {
|
|
115
|
-
// there is no need to wait after SIGKILL
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
try {
|
|
119
|
-
await (0, asyncbox_1.waitForCondition)(async () => {
|
|
120
|
-
const pidCheckPromises = matchedPids.map(async (pid) => {
|
|
121
|
-
try {
|
|
122
|
-
await (0, teen_process_1.exec)('kill', ['-0', pid]);
|
|
123
|
-
// the process is still alive
|
|
124
|
-
return false;
|
|
125
|
-
}
|
|
126
|
-
catch {
|
|
127
|
-
// the process is dead
|
|
128
|
-
return true;
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
return (await Promise.all(pidCheckPromises)).every((x) => x === true);
|
|
132
|
-
}, {
|
|
133
|
-
waitMs: 1000,
|
|
134
|
-
intervalMs: 100,
|
|
135
|
-
});
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
catch {
|
|
139
|
-
// try the next signal
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Return true if the platformName is tvOS
|
|
145
|
-
* @param platformName The name of the platorm
|
|
146
|
-
* @returns Return true if the platformName is tvOS
|
|
147
|
-
*/
|
|
148
|
-
function isTvOS(platformName) {
|
|
149
|
-
return platformName?.toLowerCase() === constants_1.PLATFORM_NAME_TVOS.toLowerCase();
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Configure keychain access required for real-device code signing.
|
|
153
|
-
*/
|
|
154
|
-
async function setRealDeviceSecurity(keychainPath, keychainPassword) {
|
|
155
|
-
logger_1.log.debug('Setting security for iOS device');
|
|
156
|
-
await (0, teen_process_1.exec)('security', ['-v', 'list-keychains', '-s', keychainPath]);
|
|
157
|
-
await (0, teen_process_1.exec)('security', ['-v', 'unlock-keychain', '-p', keychainPassword, keychainPath]);
|
|
158
|
-
await (0, teen_process_1.exec)('security', ['set-keychain-settings', '-t', '3600', '-l', keychainPath]);
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* Creates xctestrun file per device & platform version.
|
|
162
|
-
* We expects to have WebDriverAgentRunner_iphoneos${sdkVersion|platformVersion}-arm64.xctestrun for real device
|
|
163
|
-
* and WebDriverAgentRunner_iphonesimulator${sdkVersion|platformVersion}-${x86_64|arm64}.xctestrun for simulator located @bootstrapPath
|
|
164
|
-
* Newer Xcode (Xcode 10.0 at least) generate xctestrun file following sdkVersion.
|
|
165
|
-
* e.g. Xcode which has iOS SDK Version 12.2 on an intel Mac host machine generates WebDriverAgentRunner_iphonesimulator.2-x86_64.xctestrun
|
|
166
|
-
* even if the cap has platform version 11.4
|
|
167
|
-
*
|
|
168
|
-
* @param args
|
|
169
|
-
* @return returns xctestrunFilePath for given device
|
|
170
|
-
* @throws if WebDriverAgentRunner_iphoneos${sdkVersion|platformVersion}-arm64.xctestrun for real device
|
|
171
|
-
* or WebDriverAgentRunner_iphonesimulator${sdkVersion|platformVersion}-x86_64.xctestrun for simulator is not found @bootstrapPath,
|
|
172
|
-
* then it will throw a file not found exception
|
|
173
|
-
*/
|
|
174
|
-
async function setXctestrunFile(args) {
|
|
175
|
-
const { deviceInfo, sdkVersion, bootstrapPath, wdaRemotePort, wdaBindingIP, maxHttpRequestBodySize, } = args;
|
|
176
|
-
const xctestrunFilePath = await getXctestrunFilePath(deviceInfo, sdkVersion, bootstrapPath);
|
|
177
|
-
const xctestRunContent = await support_1.plist.parsePlistFile(xctestrunFilePath);
|
|
178
|
-
const updateWDAPort = getAdditionalRunContent(deviceInfo.platformName, wdaRemotePort, wdaBindingIP, maxHttpRequestBodySize);
|
|
179
|
-
const newXctestRunContent = mergeObjects(xctestRunContent, updateWDAPort);
|
|
180
|
-
await support_1.plist.updatePlistFile(xctestrunFilePath, newXctestRunContent, true);
|
|
181
|
-
return xctestrunFilePath;
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* Return the WDA object which appends existing xctest runner content
|
|
185
|
-
* @param platformName - The name of the platform
|
|
186
|
-
* @param wdaRemotePort - The remote port number
|
|
187
|
-
* @param wdaBindingIP - The IP address to bind to. If not given, it binds to all interfaces.
|
|
188
|
-
* @param maxHttpRequestBodySize - The maximum HTTP request body size in bytes.
|
|
189
|
-
* @return returns a runner object which has USE_PORT and optionally USE_IP
|
|
190
|
-
*/
|
|
191
|
-
function getAdditionalRunContent(platformName, wdaRemotePort, wdaBindingIP, maxHttpRequestBodySize) {
|
|
192
|
-
const runner = `WebDriverAgentRunner${isTvOS(platformName) ? '_tvOS' : ''}`;
|
|
193
|
-
return {
|
|
194
|
-
[runner]: {
|
|
195
|
-
EnvironmentVariables: {
|
|
196
|
-
// USE_PORT must be 'string'
|
|
197
|
-
USE_PORT: `${wdaRemotePort}`,
|
|
198
|
-
...(wdaBindingIP ? { USE_IP: wdaBindingIP } : {}),
|
|
199
|
-
...(maxHttpRequestBodySize
|
|
200
|
-
? { MAX_HTTP_REQUEST_BODY_SIZE: `${maxHttpRequestBodySize}` }
|
|
201
|
-
: {}),
|
|
202
|
-
},
|
|
203
|
-
},
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
/**
|
|
207
|
-
* Return the path of xctestrun if it exists
|
|
208
|
-
* @param deviceInfo
|
|
209
|
-
* @param sdkVersion - The Xcode SDK version of OS.
|
|
210
|
-
* @param bootstrapPath - The folder path containing xctestrun file.
|
|
211
|
-
*/
|
|
212
|
-
async function getXctestrunFilePath(deviceInfo, sdkVersion, bootstrapPath) {
|
|
213
|
-
// First try the SDK path, for Xcode 10 (at least)
|
|
214
|
-
const sdkBased = [
|
|
215
|
-
node_path_1.default.resolve(bootstrapPath, `${deviceInfo.udid}_${sdkVersion}.xctestrun`),
|
|
216
|
-
sdkVersion,
|
|
217
|
-
];
|
|
218
|
-
// Next try Platform path, for earlier Xcode versions
|
|
219
|
-
const platformBased = [
|
|
220
|
-
node_path_1.default.resolve(bootstrapPath, `${deviceInfo.udid}_${deviceInfo.platformVersion}.xctestrun`),
|
|
221
|
-
deviceInfo.platformVersion,
|
|
222
|
-
];
|
|
223
|
-
for (const [filePath, version] of [sdkBased, platformBased]) {
|
|
224
|
-
if (await support_1.fs.exists(filePath)) {
|
|
225
|
-
logger_1.log.info(`Using '${filePath}' as xctestrun file`);
|
|
226
|
-
return filePath;
|
|
227
|
-
}
|
|
228
|
-
const originalXctestrunFile = node_path_1.default.resolve(bootstrapPath, getXctestrunFileName(deviceInfo, version));
|
|
229
|
-
if (await support_1.fs.exists(originalXctestrunFile)) {
|
|
230
|
-
// If this is first time run for given device, then first generate xctestrun file for device.
|
|
231
|
-
// We need to have a xctestrun file **per device** because we cant not have same wda port for all devices.
|
|
232
|
-
await support_1.fs.copyFile(originalXctestrunFile, filePath);
|
|
233
|
-
logger_1.log.info(`Using '${filePath}' as xctestrun file copied by '${originalXctestrunFile}'`);
|
|
234
|
-
return filePath;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
throw new Error(`If you are using 'useXctestrunFile' capability then you ` +
|
|
238
|
-
`need to have a xctestrun file (expected: ` +
|
|
239
|
-
`'${node_path_1.default.resolve(bootstrapPath, getXctestrunFileName(deviceInfo, sdkVersion))}')`);
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* Return the name of xctestrun file
|
|
243
|
-
* @param deviceInfo
|
|
244
|
-
* @param version - The Xcode SDK version of OS.
|
|
245
|
-
* @return returns xctestrunFilePath for given device
|
|
246
|
-
*/
|
|
247
|
-
function getXctestrunFileName(deviceInfo, version) {
|
|
248
|
-
const archSuffix = deviceInfo.isRealDevice
|
|
249
|
-
? `os${version}-arm64`
|
|
250
|
-
: `simulator${version}-${(0, node_os_1.arch)() === 'arm64' ? 'arm64' : 'x86_64'}`;
|
|
251
|
-
return `WebDriverAgentRunner_${isTvOS(deviceInfo.platformName) ? 'tvOS_appletv' : 'iphone'}${archSuffix}.xctestrun`;
|
|
252
|
-
}
|
|
253
|
-
/**
|
|
254
|
-
* Ensures the process is killed after the timeout
|
|
255
|
-
*/
|
|
256
|
-
async function killProcess(name, proc) {
|
|
257
|
-
if (!proc || !proc.isRunning) {
|
|
258
|
-
return;
|
|
259
|
-
}
|
|
260
|
-
logger_1.log.info(`Shutting down '${name}' process (pid '${proc.proc?.pid}')`);
|
|
261
|
-
logger_1.log.info(`Sending 'SIGTERM'...`);
|
|
262
|
-
try {
|
|
263
|
-
await proc.stop('SIGTERM', 1000);
|
|
264
|
-
return;
|
|
265
|
-
}
|
|
266
|
-
catch (err) {
|
|
267
|
-
if (!err.message.includes(`Process didn't end after`)) {
|
|
268
|
-
throw err;
|
|
269
|
-
}
|
|
270
|
-
logger_1.log.debug(`${name} process did not end in a timely fashion: '${err.message}'.`);
|
|
271
|
-
}
|
|
272
|
-
logger_1.log.info(`Sending 'SIGKILL'...`);
|
|
273
|
-
try {
|
|
274
|
-
await proc.stop('SIGKILL');
|
|
275
|
-
}
|
|
276
|
-
catch (err) {
|
|
277
|
-
if (err.message.includes('not currently running')) {
|
|
278
|
-
// the process ended but for some reason we were not informed
|
|
279
|
-
return;
|
|
280
|
-
}
|
|
281
|
-
throw err;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
/**
|
|
285
|
-
* Generate a random integer in range [low, high). `low` is inclusive and `high` is exclusive.
|
|
286
|
-
*/
|
|
287
|
-
function randomInt(low, high) {
|
|
288
|
-
return Math.floor(Math.random() * (high - low) + low);
|
|
289
|
-
}
|
|
290
|
-
/**
|
|
291
|
-
* Retrieves WDA upgrade timestamp. The manifest only gets modified on package upgrade.
|
|
292
|
-
*/
|
|
293
|
-
async function getWDAUpgradeTimestamp() {
|
|
294
|
-
const packageManifest = node_path_1.default.resolve(getModuleRoot(), 'package.json');
|
|
295
|
-
if (!(await support_1.fs.exists(packageManifest))) {
|
|
296
|
-
return null;
|
|
297
|
-
}
|
|
298
|
-
const { mtime } = await support_1.fs.stat(packageManifest);
|
|
299
|
-
return mtime.getTime();
|
|
300
|
-
}
|
|
301
|
-
/**
|
|
302
|
-
* Escape regular expression metacharacters in a string.
|
|
303
|
-
*/
|
|
304
|
-
function escapeRegExp(value) {
|
|
305
|
-
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
306
|
-
}
|
|
307
|
-
/**
|
|
308
|
-
* Truncate a string to the given length and append ellipsis if needed.
|
|
309
|
-
*/
|
|
310
|
-
function truncateString(value, length) {
|
|
311
|
-
if (value.length <= length) {
|
|
312
|
-
return value;
|
|
313
|
-
}
|
|
314
|
-
return `${value.slice(0, Math.max(0, length - 1))}…`;
|
|
315
|
-
}
|
|
316
|
-
/**
|
|
317
|
-
* Kills running XCTest processes for the particular device.
|
|
318
|
-
*/
|
|
319
|
-
async function resetTestProcesses(udid, isSimulator) {
|
|
320
|
-
const processPatterns = [`xcodebuild.*${udid}`];
|
|
321
|
-
if (isSimulator) {
|
|
322
|
-
processPatterns.push(`${udid}.*XCTRunner`);
|
|
323
|
-
// Some XCTest launches might not include xcodebuild in their command line
|
|
324
|
-
processPatterns.push(`xctest.*${udid}`);
|
|
325
|
-
}
|
|
326
|
-
logger_1.log.debug(`Killing running processes '${processPatterns.join(', ')}' for the device ${udid}...`);
|
|
327
|
-
await Promise.all(processPatterns.map(killAppUsingPattern));
|
|
328
|
-
}
|
|
329
|
-
/**
|
|
330
|
-
* Get the IDs of processes listening on the particular system port.
|
|
331
|
-
* It is also possible to apply additional filtering based on the
|
|
332
|
-
* process command line.
|
|
333
|
-
*
|
|
334
|
-
* @param port - The port number.
|
|
335
|
-
* @param filteringFunc - Optional lambda function, which
|
|
336
|
-
* receives command line string of the particular process
|
|
337
|
-
* listening on given port, and is expected to return
|
|
338
|
-
* either true or false to include/exclude the corresponding PID
|
|
339
|
-
* from the resulting array.
|
|
340
|
-
* @returns - the list of matched process ids.
|
|
341
|
-
*/
|
|
342
|
-
async function getPIDsListeningOnPort(port, filteringFunc = null) {
|
|
343
|
-
const result = [];
|
|
344
|
-
try {
|
|
345
|
-
// This only works since Mac OS X El Capitan
|
|
346
|
-
const { stdout } = await (0, teen_process_1.exec)('lsof', ['-ti', `tcp:${port}`]);
|
|
347
|
-
result.push(...stdout.trim().split(/\n+/));
|
|
348
|
-
}
|
|
349
|
-
catch (e) {
|
|
350
|
-
if (e.code !== 1) {
|
|
351
|
-
// code 1 means no processes. Other errors need reporting
|
|
352
|
-
logger_1.log.debug(`Error getting processes listening on port '${port}': ${e.stderr || e.message}`);
|
|
353
|
-
}
|
|
354
|
-
return result;
|
|
355
|
-
}
|
|
356
|
-
if (typeof filteringFunc !== 'function') {
|
|
357
|
-
return result;
|
|
358
|
-
}
|
|
359
|
-
const filtered = await Promise.all(result.map(async (pid) => {
|
|
360
|
-
let stdout;
|
|
361
|
-
try {
|
|
362
|
-
({ stdout } = await (0, teen_process_1.exec)('ps', ['-p', pid, '-o', 'command']));
|
|
363
|
-
}
|
|
364
|
-
catch (e) {
|
|
365
|
-
if (e.code === 1) {
|
|
366
|
-
// The process does not exist anymore, there's nothing to filter
|
|
367
|
-
return null;
|
|
368
|
-
}
|
|
369
|
-
throw e;
|
|
370
|
-
}
|
|
371
|
-
return (await filteringFunc(stdout)) ? pid : null;
|
|
372
|
-
}));
|
|
373
|
-
return filtered.filter((pid) => Boolean(pid));
|
|
374
|
-
}
|
|
375
|
-
// Private functions
|
|
376
|
-
async function getPIDsUsingPattern(pattern) {
|
|
377
|
-
const args = [
|
|
378
|
-
'-if', // case insensitive, full cmdline match
|
|
379
|
-
pattern,
|
|
380
|
-
];
|
|
381
|
-
try {
|
|
382
|
-
const { stdout } = await (0, teen_process_1.exec)('pgrep', args);
|
|
383
|
-
return stdout
|
|
384
|
-
.split(/\s+/)
|
|
385
|
-
.map((x) => parseInt(x, 10))
|
|
386
|
-
.filter(Number.isInteger)
|
|
387
|
-
.map((x) => `${x}`);
|
|
388
|
-
}
|
|
389
|
-
catch (err) {
|
|
390
|
-
logger_1.log.debug(`'pgrep ${args.join(' ')}' didn't detect any matching processes. Return code: ${err.code}`);
|
|
391
|
-
return [];
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
function mergeObjects(target, source) {
|
|
395
|
-
const output = { ...target };
|
|
396
|
-
for (const [key, sourceValue] of Object.entries(source)) {
|
|
397
|
-
const targetValue = output[key];
|
|
398
|
-
if (isPlainObject(targetValue) && isPlainObject(sourceValue)) {
|
|
399
|
-
output[key] = mergeObjects(targetValue, sourceValue);
|
|
400
|
-
continue;
|
|
401
|
-
}
|
|
402
|
-
output[key] = sourceValue;
|
|
403
|
-
}
|
|
404
|
-
return output;
|
|
405
|
-
}
|
|
406
|
-
function isPlainObject(value) {
|
|
407
|
-
if (value == null || typeof value !== 'object' || Array.isArray(value)) {
|
|
408
|
-
return false;
|
|
409
|
-
}
|
|
410
|
-
const prototype = Object.getPrototypeOf(value);
|
|
411
|
-
return prototype === Object.prototype || prototype === null;
|
|
412
|
-
}
|
|
413
|
-
//# sourceMappingURL=utils.js.map
|
package/build/lib/utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../lib/utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoEA,kDA0CC;AAOD,wBAEC;AAKD,sDAQC;AAgBD,4CAqBC;AAUD,0DAmBC;AAQD,oDAuCC;AAQD,oDAKC;AAKD,kCA+BC;AAKD,8BAEC;AAKD,wDAOC;AAKD,oCAEC;AAKD,wCAKC;AAKD,gDASC;AAeD,wDAoCC;AA3YD,6CAA0C;AAC1C,+C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