@autifyhq/autify-cli 0.50.0 → 0.52.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/README.md +100 -37
- package/dist/autify/connect/accessPointConfig.js +2 -2
- package/dist/autify/connect/client-manager/ClientManager.d.ts +2 -2
- package/dist/autify/connect/client-manager/ClientManager.js +4 -4
- package/dist/autify/connect/client-manager/DebugServerClient.js +3 -3
- package/dist/autify/connect/installClient.d.ts +2 -2
- package/dist/autify/connect/installClient.js +12 -12
- package/dist/autify/mobile/createZip.js +4 -5
- package/dist/autify/mobile/inspectBuildFile.js +3 -3
- package/dist/autify/mobile/mobilelink/installBinary.d.ts +8 -0
- package/dist/autify/mobile/mobilelink/installBinary.js +133 -0
- package/dist/autify/mobile/mobilelink/mobile-link-manager/Logger.d.ts +11 -0
- package/dist/autify/mobile/mobilelink/mobile-link-manager/Logger.js +47 -0
- package/dist/autify/mobile/mobilelink/mobile-link-manager/MobileLinkManager.d.ts +47 -0
- package/dist/autify/mobile/mobilelink/mobile-link-manager/MobileLinkManager.js +204 -0
- package/dist/autify/mobile/mobilelink/mobile-link-manager/StateMachine.d.ts +51 -0
- package/dist/autify/mobile/mobilelink/mobile-link-manager/StateMachine.js +120 -0
- package/dist/autify/mobile/parseTestPlanUrl.js +2 -2
- package/dist/autify/mobile/parseTestResultUrl.js +2 -2
- package/dist/autify/mobile/uploadBuild.js +2 -2
- package/dist/autify/mobile/waitTestResult.js +2 -2
- package/dist/autify/web/parseAutifyTestUrl.js +2 -2
- package/dist/autify/web/parseTestResultUrl.js +2 -2
- package/dist/autify/web/runTest.js +6 -6
- package/dist/autify/web/waitTestResult.js +3 -3
- package/dist/commands/connect/access-point/set.js +2 -2
- package/dist/commands/mobile/auth/login.js +2 -2
- package/dist/commands/mobile/link/exec.d.ts +10 -0
- package/dist/commands/mobile/link/exec.js +23 -0
- package/dist/commands/mobile/link/install.d.ts +7 -0
- package/dist/commands/mobile/link/install.js +22 -0
- package/dist/commands/mobile/link/start.d.ts +11 -0
- package/dist/commands/mobile/link/start.js +37 -0
- package/dist/commands/mobile/test/run.js +2 -3
- package/dist/commands/web/auth/login.js +2 -2
- package/dist/commands/web/test/run.js +2 -3
- package/dist/config.d.ts +1 -1
- package/dist/config.js +1 -0
- package/oclif.manifest.json +727 -643
- package/package.json +30 -35
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseTestResultUrl = void 0;
|
|
4
4
|
/* eslint-disable unicorn/filename-case */
|
|
5
|
-
const
|
|
5
|
+
const core_1 = require("@oclif/core");
|
|
6
6
|
const parseTestResultUrl = (url) => {
|
|
7
7
|
var _a, _b;
|
|
8
8
|
const { pathname } = new URL(url);
|
|
@@ -11,7 +11,7 @@ const parseTestResultUrl = (url) => {
|
|
|
11
11
|
const workspaceId = (_a = match === null || match === void 0 ? void 0 : match.groups) === null || _a === void 0 ? void 0 : _a.workspaceId;
|
|
12
12
|
const resultId = (_b = match === null || match === void 0 ? void 0 : match.groups) === null || _b === void 0 ? void 0 : _b.resultId;
|
|
13
13
|
if (!workspaceId || !resultId)
|
|
14
|
-
throw new
|
|
14
|
+
throw new core_1.Errors.CLIError(`Invalid URL: ${url}`);
|
|
15
15
|
return { workspaceId, resultId };
|
|
16
16
|
};
|
|
17
17
|
exports.parseTestResultUrl = parseTestResultUrl;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.uploadBuild = void 0;
|
|
4
|
-
const
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
5
|
const inspectBuildFile_1 = require("./inspectBuildFile");
|
|
6
6
|
const uploadBuild = async (client, workspaceId, buildPath) => {
|
|
7
7
|
const [uploadPath, os] = await (0, inspectBuildFile_1.inspectBuildFile)(buildPath);
|
|
8
8
|
const res = await client.uploadBuild(workspaceId, uploadPath);
|
|
9
9
|
if (!res.data.id)
|
|
10
|
-
throw new
|
|
10
|
+
throw new core_1.Errors.CLIError(`Failed to upload ${buildPath}.`);
|
|
11
11
|
return [res.data.id, os];
|
|
12
12
|
};
|
|
13
13
|
exports.uploadBuild = uploadBuild;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.waitTestResult = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
/* eslint-disable unicorn/filename-case */
|
|
6
|
-
const
|
|
6
|
+
const core_1 = require("@oclif/core");
|
|
7
7
|
const listr_1 = tslib_1.__importDefault(require("listr"));
|
|
8
8
|
const promises_1 = require("node:timers/promises");
|
|
9
9
|
const emoji = tslib_1.__importStar(require("node-emoji"));
|
|
@@ -15,7 +15,7 @@ const waitUntil = async (callback, timeoutSecond, intervalSecond, verbose) => {
|
|
|
15
15
|
for await (const startTime of (0, promises_1.setInterval)(intervalSecond * 1000, Date.now())) {
|
|
16
16
|
const now = Date.now();
|
|
17
17
|
if (now - startTime > timeoutSecond * 1000) {
|
|
18
|
-
throw new
|
|
18
|
+
throw new core_1.Errors.CLIError(`Timeout after ${timeoutSecond} seconds.`);
|
|
19
19
|
}
|
|
20
20
|
const result = await callback(task);
|
|
21
21
|
if (result) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseAutifyTestUrl = void 0;
|
|
4
4
|
/* eslint-disable unicorn/filename-case */
|
|
5
|
-
const
|
|
5
|
+
const core_1 = require("@oclif/core");
|
|
6
6
|
const parseTestScenarioUrl = (url) => {
|
|
7
7
|
var _a, _b, _c, _d;
|
|
8
8
|
const { pathname } = new URL(url);
|
|
@@ -32,6 +32,6 @@ const parseAutifyTestUrl = (url) => {
|
|
|
32
32
|
return testScenario;
|
|
33
33
|
if (testPlan)
|
|
34
34
|
return testPlan;
|
|
35
|
-
throw new
|
|
35
|
+
throw new core_1.Errors.CLIError(`Invalid URL: ${url}`);
|
|
36
36
|
};
|
|
37
37
|
exports.parseAutifyTestUrl = parseAutifyTestUrl;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseTestResultUrl = void 0;
|
|
4
4
|
/* eslint-disable unicorn/filename-case */
|
|
5
|
-
const
|
|
5
|
+
const core_1 = require("@oclif/core");
|
|
6
6
|
const parseTestResultUrl = (url) => {
|
|
7
7
|
var _a, _b, _c, _d;
|
|
8
8
|
const { pathname } = new URL(url);
|
|
@@ -11,7 +11,7 @@ const parseTestResultUrl = (url) => {
|
|
|
11
11
|
const workspaceId = Number.parseInt((_b = (_a = match === null || match === void 0 ? void 0 : match.groups) === null || _a === void 0 ? void 0 : _a.workspaceId) !== null && _b !== void 0 ? _b : "", 10);
|
|
12
12
|
const resultId = Number.parseInt((_d = (_c = match === null || match === void 0 ? void 0 : match.groups) === null || _c === void 0 ? void 0 : _c.resultId) !== null && _d !== void 0 ? _d : "", 10);
|
|
13
13
|
if (!workspaceId || !resultId)
|
|
14
|
-
throw new
|
|
14
|
+
throw new core_1.Errors.CLIError(`Invalid URL: ${url}`);
|
|
15
15
|
return { workspaceId, resultId };
|
|
16
16
|
};
|
|
17
17
|
exports.parseTestResultUrl = parseTestResultUrl;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.runTest = void 0;
|
|
4
4
|
/* eslint-disable unicorn/filename-case */
|
|
5
|
-
const
|
|
5
|
+
const core_1 = require("@oclif/core");
|
|
6
6
|
const isCapabilitySpecified = (option) => {
|
|
7
7
|
return Object.values(option).some(Boolean);
|
|
8
8
|
};
|
|
@@ -19,9 +19,9 @@ const getCapability = async (client, workspaceId, option) => {
|
|
|
19
19
|
.filter((c) => !option.device || c.device === option.device)
|
|
20
20
|
.filter((c) => !option.device_type || c.device_type === option.device_type);
|
|
21
21
|
if (candidates.length === 0)
|
|
22
|
-
throw new
|
|
22
|
+
throw new core_1.Errors.CLIError(`No capability is available for: ${JSON.stringify(option)}`);
|
|
23
23
|
if (candidates.length > 1)
|
|
24
|
-
throw new
|
|
24
|
+
throw new core_1.Errors.CLIError(`Multiple capabilities are available for: ${JSON.stringify(option)} => ${JSON.stringify(candidates)}`);
|
|
25
25
|
return candidates[0];
|
|
26
26
|
};
|
|
27
27
|
/* eslint-disable camelcase */
|
|
@@ -54,9 +54,9 @@ const runTest = async (client, parsedTest, { option, name, urlReplacements, auti
|
|
|
54
54
|
}
|
|
55
55
|
if (testPlanId) {
|
|
56
56
|
if (isCapabilitySpecified(option))
|
|
57
|
-
throw new
|
|
57
|
+
throw new core_1.Errors.CLIError(`Running TestPlan doesn't support capability override: ${JSON.stringify(option)}`);
|
|
58
58
|
if (name)
|
|
59
|
-
throw new
|
|
59
|
+
throw new core_1.Errors.CLIError(`Running TestPlan doesn't support --name: ${name}`);
|
|
60
60
|
const urlReplacementIds = [];
|
|
61
61
|
for await (const urlReplacement of urlReplacements !== null && urlReplacements !== void 0 ? urlReplacements : []) {
|
|
62
62
|
const res = await client.createUrlReplacement(testPlanId, urlReplacement);
|
|
@@ -78,6 +78,6 @@ const runTest = async (client, parsedTest, { option, name, urlReplacements, auti
|
|
|
78
78
|
capability: "configured by test plan",
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
|
-
throw new
|
|
81
|
+
throw new core_1.Errors.CLIError("testScenarioId or testPlanId is required.");
|
|
82
82
|
};
|
|
83
83
|
exports.runTest = runTest;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.waitTestResult = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
/* eslint-disable unicorn/filename-case */
|
|
6
|
-
const
|
|
6
|
+
const core_1 = require("@oclif/core");
|
|
7
7
|
const listr_1 = tslib_1.__importDefault(require("listr"));
|
|
8
8
|
const promises_1 = require("node:timers/promises");
|
|
9
9
|
const emoji = tslib_1.__importStar(require("node-emoji"));
|
|
@@ -21,10 +21,10 @@ const waitUntil = async (callback, timeoutSecond, intervalSecond, verbose) => {
|
|
|
21
21
|
});
|
|
22
22
|
for await (const startTime of (0, promises_1.setInterval)(intervalSecond * 1000, Date.now())) {
|
|
23
23
|
if (killed)
|
|
24
|
-
throw new
|
|
24
|
+
throw new core_1.Errors.CLIError(`Process was killed by ${killed}.`);
|
|
25
25
|
const now = Date.now();
|
|
26
26
|
if (now - startTime > timeoutSecond * 1000) {
|
|
27
|
-
throw new
|
|
27
|
+
throw new core_1.Errors.CLIError(`Timeout after ${timeoutSecond} seconds.`);
|
|
28
28
|
}
|
|
29
29
|
const result = await callback(task);
|
|
30
30
|
if (result) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
|
-
const
|
|
5
|
+
const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
|
|
6
6
|
const accessPointConfig_1 = require("../../../autify/connect/accessPointConfig");
|
|
7
7
|
class ConnectAccessPointSet extends core_1.Command {
|
|
8
8
|
async run() {
|
|
@@ -14,7 +14,7 @@ class ConnectAccessPointSet extends core_1.Command {
|
|
|
14
14
|
this.log((0, accessPointConfig_1.saveAccessPoint)(configDir, name, key));
|
|
15
15
|
}
|
|
16
16
|
async readKeyFromStdin() {
|
|
17
|
-
const res = await
|
|
17
|
+
const res = await inquirer_1.default.prompt([
|
|
18
18
|
{
|
|
19
19
|
name: "key",
|
|
20
20
|
message: "Enter Autify Connect Access Point Key",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
|
-
const
|
|
5
|
+
const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
|
|
6
6
|
const config_1 = require("../../../config");
|
|
7
7
|
class MobileAuthLogin extends core_1.Command {
|
|
8
8
|
async run() {
|
|
@@ -11,7 +11,7 @@ class MobileAuthLogin extends core_1.Command {
|
|
|
11
11
|
(0, config_1.set)(this.config.configDir, "AUTIFY_MOBILE_ACCESS_TOKEN", token);
|
|
12
12
|
}
|
|
13
13
|
async readTokenFromStdin() {
|
|
14
|
-
const res = await
|
|
14
|
+
const res = await inquirer_1.default.prompt([
|
|
15
15
|
{
|
|
16
16
|
name: "token",
|
|
17
17
|
message: "Enter Access Token",
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Command } from "@oclif/core";
|
|
2
|
+
export default class MobileLinkExec extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
things: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static strict: boolean;
|
|
9
|
+
run(): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const MobileLinkManager_1 = require("../../../autify/mobile/mobilelink/mobile-link-manager/MobileLinkManager");
|
|
5
|
+
class MobileLinkExec extends core_1.Command {
|
|
6
|
+
async run() {
|
|
7
|
+
const { configDir, cacheDir } = this.config;
|
|
8
|
+
const mobileLinkManager = new MobileLinkManager_1.MobileLinkManager({
|
|
9
|
+
configDir,
|
|
10
|
+
cacheDir,
|
|
11
|
+
});
|
|
12
|
+
await mobileLinkManager.exec(this.argv);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
MobileLinkExec.description = "Execute arbitrary MobileLink subcommand";
|
|
16
|
+
MobileLinkExec.examples = [
|
|
17
|
+
"Pass subcommand arguments to mobilelink:\n<%= config.bin %> <%= command.id %> ABC XYZ",
|
|
18
|
+
];
|
|
19
|
+
MobileLinkExec.args = {
|
|
20
|
+
things: core_1.Args.string(),
|
|
21
|
+
};
|
|
22
|
+
MobileLinkExec.strict = false;
|
|
23
|
+
exports.default = MobileLinkExec;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const installBinary_1 = require("../../../autify/mobile/mobilelink/installBinary");
|
|
5
|
+
class MobileLinkInstall extends core_1.Command {
|
|
6
|
+
async run() {
|
|
7
|
+
const { configDir, cacheDir } = this.config;
|
|
8
|
+
const url = (0, installBinary_1.getMobileLinkSourceUrl)(configDir);
|
|
9
|
+
core_1.ux.action.start(`Installing Mobile Link from ${url})`, "installing", {
|
|
10
|
+
stdout: true,
|
|
11
|
+
});
|
|
12
|
+
const { version, path } = await (0, installBinary_1.installBinary)(cacheDir, url);
|
|
13
|
+
core_1.ux.action.stop();
|
|
14
|
+
this.log(`Successfully installed Mobile Link (path: ${path}, version: ${version})`);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
MobileLinkInstall.description = "Install Mobile Link";
|
|
18
|
+
MobileLinkInstall.examples = [
|
|
19
|
+
"(Recommended) Install the stable version:\n<%= config.bin %> <%= command.id %>",
|
|
20
|
+
];
|
|
21
|
+
MobileLinkInstall.flags = {};
|
|
22
|
+
exports.default = MobileLinkInstall;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Command } from "@oclif/core";
|
|
2
|
+
export default class MobileLinkStart extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {};
|
|
6
|
+
static args: {
|
|
7
|
+
workspaceId: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
8
|
+
};
|
|
9
|
+
static strict: boolean;
|
|
10
|
+
run(): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const MobileLinkManager_1 = require("../../../autify/mobile/mobilelink/mobile-link-manager/MobileLinkManager");
|
|
5
|
+
class MobileLinkStart extends core_1.Command {
|
|
6
|
+
async run() {
|
|
7
|
+
var _a;
|
|
8
|
+
const { args } = await this.parse(MobileLinkStart);
|
|
9
|
+
const { configDir, cacheDir } = this.config;
|
|
10
|
+
const mobileLinkManager = new MobileLinkManager_1.MobileLinkManager({
|
|
11
|
+
configDir,
|
|
12
|
+
cacheDir,
|
|
13
|
+
});
|
|
14
|
+
this.log("Starting MobileLink...");
|
|
15
|
+
await mobileLinkManager.start(args.workspaceId);
|
|
16
|
+
this.log("Waiting until MobileLink is ready...");
|
|
17
|
+
await mobileLinkManager.onceReady();
|
|
18
|
+
this.log("Waiting for terminating (forever)...");
|
|
19
|
+
await mobileLinkManager.onceTerminating();
|
|
20
|
+
this.log("Waiting until MobileLink exits...");
|
|
21
|
+
const exitCode = (_a = (await mobileLinkManager.onceDone())) !== null && _a !== void 0 ? _a : 1;
|
|
22
|
+
this.log(`Exiting this command with the same exit code(${exitCode})...`);
|
|
23
|
+
this.exit(exitCode);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
MobileLinkStart.description = "Start MobileLink session";
|
|
27
|
+
MobileLinkStart.examples = [
|
|
28
|
+
"Pass subcommand arguments to mobilelink:\n<%= config.bin %> <%= command.id %> ABC XYZ",
|
|
29
|
+
];
|
|
30
|
+
MobileLinkStart.flags = {};
|
|
31
|
+
MobileLinkStart.args = {
|
|
32
|
+
workspaceId: core_1.Args.string({
|
|
33
|
+
description: "Specify the target version of Autify Connect Client.",
|
|
34
|
+
}),
|
|
35
|
+
};
|
|
36
|
+
MobileLinkStart.strict = false;
|
|
37
|
+
exports.default = MobileLinkStart;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
|
-
const errors_1 = require("@oclif/errors");
|
|
6
5
|
const emoji = tslib_1.__importStar(require("node-emoji"));
|
|
7
6
|
const getMobileClient_1 = require("../../../autify/mobile/getMobileClient");
|
|
8
7
|
const getTestResultUrl_1 = require("../../../autify/mobile/getTestResultUrl");
|
|
@@ -29,7 +28,7 @@ class MobileTestRun extends core_1.Command {
|
|
|
29
28
|
build_id: buildId,
|
|
30
29
|
});
|
|
31
30
|
if (!res.data.id)
|
|
32
|
-
throw new
|
|
31
|
+
throw new core_1.Errors.CLIError(`Failed to run a test plan.`);
|
|
33
32
|
const testResultUrl = (0, getTestResultUrl_1.getMobileTestResultUrl)(configDir, workspaceId, res.data.id);
|
|
34
33
|
this.log(`${emoji.get("white_check_mark")} Successfully started: ${testResultUrl}`);
|
|
35
34
|
return testResultUrl;
|
|
@@ -48,7 +47,7 @@ class MobileTestRun extends core_1.Command {
|
|
|
48
47
|
return null;
|
|
49
48
|
return error;
|
|
50
49
|
}
|
|
51
|
-
throw new
|
|
50
|
+
throw new core_1.Errors.CLIError(`Unexpected behavior.`);
|
|
52
51
|
};
|
|
53
52
|
const maxRetryCount = flags["max-retry-count"];
|
|
54
53
|
let error;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
|
-
const
|
|
5
|
+
const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
|
|
6
6
|
const config_1 = require("../../../config");
|
|
7
7
|
class WebAuthLogin extends core_1.Command {
|
|
8
8
|
async run() {
|
|
@@ -11,7 +11,7 @@ class WebAuthLogin extends core_1.Command {
|
|
|
11
11
|
(0, config_1.set)(this.config.configDir, "AUTIFY_WEB_ACCESS_TOKEN", token);
|
|
12
12
|
}
|
|
13
13
|
async readTokenFromStdin() {
|
|
14
|
-
const res = await
|
|
14
|
+
const res = await inquirer_1.default.prompt([
|
|
15
15
|
{
|
|
16
16
|
name: "token",
|
|
17
17
|
message: "Enter Access Token",
|
|
@@ -6,7 +6,6 @@ const emoji = tslib_1.__importStar(require("node-emoji"));
|
|
|
6
6
|
const runTest_1 = require("../../../autify/web/runTest");
|
|
7
7
|
const getTestResultUrl_1 = require("../../../autify/web/getTestResultUrl");
|
|
8
8
|
const wait_1 = tslib_1.__importDefault(require("./wait"));
|
|
9
|
-
const errors_1 = require("@oclif/errors");
|
|
10
9
|
const parseAutifyTestUrl_1 = require("../../../autify/web/parseAutifyTestUrl");
|
|
11
10
|
const ClientManager_1 = require("../../../autify/connect/client-manager/ClientManager");
|
|
12
11
|
const getWebClient_1 = require("../../../autify/web/getWebClient");
|
|
@@ -83,7 +82,7 @@ class WebTestRun extends core_1.Command {
|
|
|
83
82
|
return null;
|
|
84
83
|
return error;
|
|
85
84
|
}
|
|
86
|
-
throw new
|
|
85
|
+
throw new core_1.Errors.CLIError(`Unexpected behavior.`);
|
|
87
86
|
};
|
|
88
87
|
const maxRetryCount = flags["max-retry-count"];
|
|
89
88
|
let error;
|
|
@@ -138,7 +137,7 @@ class WebTestRun extends core_1.Command {
|
|
|
138
137
|
`Use space instead (--url-replacements "${pattern_url} ${replacement_url}").`);
|
|
139
138
|
}
|
|
140
139
|
else {
|
|
141
|
-
throw new
|
|
140
|
+
throw new core_1.Errors.CLIError(`Can't parse ${s} as --url-replacements option. Please make sure it has a space as a delimiter and surrounded by quotes. (e.g. --url-replacements "https://example.com https://example.net")`);
|
|
142
141
|
}
|
|
143
142
|
// eslint-disable-next-line camelcase
|
|
144
143
|
return { pattern_url, replacement_url };
|
package/dist/config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type Variable = "AUTIFY_WEB_ACCESS_TOKEN" | "AUTIFY_WEB_BASE_PATH" | "AUTIFY_MOBILE_ACCESS_TOKEN" | "AUTIFY_MOBILE_BASE_PATH" | "AUTIFY_CONNECT_ACCESS_POINT_NAME" | "AUTIFY_CONNECT_ACCESS_POINT_KEY" | "AUTIFY_CONNECT_CLIENT_MODE" | "AUTIFY_CONNECT_CLIENT_SOURCE_URL" | "AUTIFY_CLI_USER_AGENT_SUFFIX" | "AUTIFY_TEST_WAIT_INTERVAL_SECOND";
|
|
1
|
+
type Variable = "AUTIFY_WEB_ACCESS_TOKEN" | "AUTIFY_WEB_BASE_PATH" | "AUTIFY_MOBILE_ACCESS_TOKEN" | "AUTIFY_MOBILE_BASE_PATH" | "AUTIFY_MOBILE_LINK_SOURCE_URL" | "AUTIFY_CONNECT_ACCESS_POINT_NAME" | "AUTIFY_CONNECT_ACCESS_POINT_KEY" | "AUTIFY_CONNECT_CLIENT_MODE" | "AUTIFY_CONNECT_CLIENT_SOURCE_URL" | "AUTIFY_CLI_USER_AGENT_SUFFIX" | "AUTIFY_TEST_WAIT_INTERVAL_SECOND";
|
|
2
2
|
export declare const set: (configDir: string, key: Variable, value: string | undefined) => void;
|
|
3
3
|
export declare const get: (configDir: string, key: Variable) => string | undefined;
|
|
4
4
|
export declare const getOrThrow: (configDir: string, key: Variable) => string;
|
package/dist/config.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getOrThrow = exports.get = exports.set = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
/* eslint-disable unicorn/import-style */
|
|
5
6
|
const envfile = tslib_1.__importStar(require("envfile"));
|
|
6
7
|
const fs = tslib_1.__importStar(require("node:fs"));
|
|
7
8
|
const path = tslib_1.__importStar(require("node:path"));
|