@intuned/runtime-dev 1.3.17-source.0 → 1.3.17
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/.babelrc +6 -0
- package/InterfaceTemplate/{utils.ts → __utils.ts} +3 -1
- package/InterfaceTemplate/index.playwright.ts +1 -1
- package/bin/intuned +0 -0
- package/bin/intuned-interface +7 -0
- package/dist/commands/api/run.js +3 -3
- package/dist/commands/auth-sessions/run-check.js +3 -3
- package/dist/commands/auth-sessions/run-create.js +3 -3
- package/dist/commands/build.js +1 -3
- package/dist/commands/common/browserUtils.d.ts +3 -3
- package/dist/commands/common/browserUtils.js +3 -4
- package/dist/commands/common/getFirstLineNumber.test.js +1 -2
- package/dist/commands/common/tsNodeImport.d.ts +1 -1
- package/dist/commands/common/tsNodeImport.js +1 -2
- package/dist/commands/common/utils/fileUtils.js +1 -2
- package/dist/commands/common/utils/{unixSocket.d.ts → interfaceClient.d.ts} +10 -2
- package/dist/commands/common/utils/{unixSocket.js → interfaceClient.js} +16 -5
- package/dist/commands/common/utils/template.js +1 -2
- package/dist/commands/interface/run.js +23 -49
- package/dist/commands/intuned-cli/commands/deploy.command.js +2 -2
- package/dist/commands/intuned-cli/commands/provision.command.d.ts +2 -2
- package/dist/commands/intuned-cli/commands/provision.command.js +1 -1
- package/dist/commands/intuned-cli/commands/run_authsession.command.d.ts +5 -1
- package/dist/commands/intuned-cli/commands/types.d.ts +5 -1
- package/dist/commands/intuned-cli/commands/types.js +5 -3
- package/dist/commands/intuned-cli/controller/__test__/api.test.js +6 -5
- package/dist/commands/intuned-cli/controller/__test__/authSession.test.js +6 -5
- package/dist/commands/intuned-cli/controller/api.d.ts +2 -2
- package/dist/commands/intuned-cli/controller/api.js +3 -3
- package/dist/commands/intuned-cli/controller/authSession.d.ts +13 -13
- package/dist/commands/intuned-cli/controller/authSession.js +3 -2
- package/dist/commands/intuned-cli/controller/build.js +1 -2
- package/dist/commands/intuned-cli/controller/deploy.js +1 -2
- package/dist/commands/intuned-cli/controller/index.js +1 -2
- package/dist/commands/intuned-cli/controller/provision.js +1 -2
- package/dist/commands/intuned-cli/helpers/__test__/browser.test.js +39 -2
- package/dist/commands/intuned-cli/helpers/__test__/tracing.test.js +3 -3
- package/dist/commands/intuned-cli/helpers/auth.d.ts +4 -4
- package/dist/commands/intuned-cli/helpers/auth.js +2 -2
- package/dist/commands/intuned-cli/helpers/browser.d.ts +3 -4
- package/dist/commands/intuned-cli/helpers/browser.js +31 -2
- package/dist/commands/intuned-cli/helpers/errors.d.ts +1 -1
- package/dist/commands/intuned-cli/helpers/errors.js +2 -2
- package/dist/commands/intuned-cli/helpers/intunedJson.d.ts +6 -5
- package/dist/commands/intuned-cli/helpers/timeout.js +2 -2
- package/dist/commands/intuned-cli/helpers/traces.d.ts +1 -1
- package/dist/commands/intuned-cli/helpers/wrapper.js +2 -2
- package/dist/commands/intuned-cli/main.js +1 -2
- package/dist/commands/intuned-cli/types.d.ts +8 -8
- package/dist/commands/ts-check.js +1 -2
- package/dist/common/binStartupScript.js +16 -7
- package/dist/common/browserTabs.d.ts +72 -0
- package/dist/common/browserTabs.js +74 -0
- package/dist/common/constants.d.ts +1 -0
- package/dist/common/constants.js +2 -1
- package/dist/common/contextStorageStateHelpers.d.ts +4 -3
- package/dist/common/contextStorageStateHelpers.js +4 -1
- package/dist/common/extension/extensionsHelpers.d.ts +1 -1
- package/dist/common/extension/types.d.ts +14 -7
- package/dist/common/formatZodError.d.ts +1 -1
- package/dist/common/intunedJson.d.ts +29 -14
- package/dist/common/intunedJson.js +24 -3
- package/dist/common/jwtTokenManager.js +10 -6
- package/dist/common/launchBrowser.d.ts +1 -0
- package/dist/common/launchBrowser.js +32 -5
- package/dist/common/playwrightContext.d.ts +3 -5
- package/dist/common/playwrightContext.js +9 -11
- package/dist/common/runApi/importUsingImportFunction.d.ts +1 -3
- package/dist/common/runApi/importUsingImportFunction.js +7 -7
- package/dist/common/runApi/index.d.ts +3 -6
- package/dist/common/runApi/index.js +25 -51
- package/dist/common/settingsSchema.d.ts +49 -45
- package/dist/common/settingsSchema.js +1 -2
- package/dist/common/setupContextHook.d.ts +1 -2
- package/dist/common/setupContextHook.js +2 -2
- package/dist/common/telemetry.js +1 -2
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -7
- package/dist/runtime/downloadDirectory.js +2 -2
- package/dist/vendor/runtime-interface.d.ts +1 -0
- package/dist/vendor/runtime-interface.js +491 -0
- package/package.json +17 -10
- package/tsup.config.ts +12 -0
- package/WebTemplate.zip +0 -0
- package/dist/common/runApi/errors.d.ts +0 -72
- package/dist/common/runApi/errors.js +0 -169
- package/dist/common/runApi/types.d.ts +0 -830
- package/dist/common/runApi/types.js +0 -73
package/.babelrc
CHANGED
|
@@ -13,6 +13,12 @@
|
|
|
13
13
|
"@babel/preset-typescript"
|
|
14
14
|
],
|
|
15
15
|
"plugins": [
|
|
16
|
+
["module-resolver", {
|
|
17
|
+
"root": ["./src"],
|
|
18
|
+
"alias": {
|
|
19
|
+
"@intuned/runtime-interface": "./src/vendor/runtime-interface"
|
|
20
|
+
}
|
|
21
|
+
}],
|
|
16
22
|
"babel-plugin-macros",
|
|
17
23
|
"@babel/plugin-transform-export-namespace-from"
|
|
18
24
|
],
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import type { ImportFunction } from "@intuned/runtime-interface";
|
|
3
|
+
|
|
2
4
|
import { err, ok } from "neverthrow";
|
|
3
5
|
|
|
4
6
|
export const importModule: ImportFunction = async (path: string) => {
|
package/bin/intuned
CHANGED
|
File without changes
|
package/dist/commands/api/run.js
CHANGED
|
@@ -16,12 +16,12 @@ var _Logger = require("../../common/Logger");
|
|
|
16
16
|
var _nanoid = require("nanoid");
|
|
17
17
|
var _chalk = _interopRequireDefault(require("chalk"));
|
|
18
18
|
var _runApi = require("../../common/runApi");
|
|
19
|
+
var _runtimeInterface = require("../../vendor/runtime-interface");
|
|
19
20
|
var _tsNodeImport = require("../common/tsNodeImport");
|
|
20
21
|
var _isNil = _interopRequireDefault(require("lodash/isNil"));
|
|
21
22
|
var _constants = require("../../common/constants");
|
|
22
23
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
23
|
-
function
|
|
24
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
24
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
25
25
|
_dotenv.default.config({
|
|
26
26
|
path: `.env`
|
|
27
27
|
});
|
|
@@ -57,7 +57,7 @@ async function executeCLI(apiName, mode, inputData, options) {
|
|
|
57
57
|
importFunction: _tsNodeImport.tsNodeImport
|
|
58
58
|
});
|
|
59
59
|
if (runApiResult.isErr()) {
|
|
60
|
-
if (runApiResult.error instanceof
|
|
60
|
+
if (runApiResult.error instanceof _runtimeInterface.AutomationError) {
|
|
61
61
|
throw runApiResult.error.error;
|
|
62
62
|
}
|
|
63
63
|
console.error(runApiResult.error);
|
|
@@ -8,14 +8,14 @@ var _settings = require("../common/utils/settings");
|
|
|
8
8
|
var _dotenv = _interopRequireDefault(require("dotenv"));
|
|
9
9
|
var _constants = require("../../common/constants");
|
|
10
10
|
var _runApi = require("../../common/runApi");
|
|
11
|
+
var _runtimeInterface = require("../../vendor/runtime-interface");
|
|
11
12
|
var _tsNodeImport = require("../common/tsNodeImport");
|
|
12
13
|
var _enums = require("../../runtime/enums");
|
|
13
14
|
var _nanoid = require("nanoid");
|
|
14
15
|
var _asyncLocalStorage = require("../../common/asyncLocalStorage");
|
|
15
16
|
var _isNil = _interopRequireDefault(require("lodash/isNil"));
|
|
16
17
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
-
function
|
|
18
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
19
19
|
_dotenv.default.config({
|
|
20
20
|
path: `.env`
|
|
21
21
|
});
|
|
@@ -58,7 +58,7 @@ _commander.program.description("run AuthSession check").option("--cdpAddress <cd
|
|
|
58
58
|
importFunction: _tsNodeImport.tsNodeImport
|
|
59
59
|
}));
|
|
60
60
|
if (runApiResult.isErr()) {
|
|
61
|
-
if (runApiResult.error instanceof
|
|
61
|
+
if (runApiResult.error instanceof _runtimeInterface.AutomationError) {
|
|
62
62
|
throw runApiResult.error.error;
|
|
63
63
|
}
|
|
64
64
|
console.error(runApiResult.error);
|
|
@@ -8,13 +8,13 @@ var _settings = require("../common/utils/settings");
|
|
|
8
8
|
var _dotenv = _interopRequireDefault(require("dotenv"));
|
|
9
9
|
var _constants = require("../../common/constants");
|
|
10
10
|
var _runApi = require("../../common/runApi");
|
|
11
|
+
var _runtimeInterface = require("../../vendor/runtime-interface");
|
|
11
12
|
var _asyncLocalStorage = require("../../common/asyncLocalStorage");
|
|
12
13
|
var _nanoid = require("nanoid");
|
|
13
14
|
var _enums = require("../../runtime/enums");
|
|
14
15
|
var _tsNodeImport = require("../common/tsNodeImport");
|
|
15
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
-
function
|
|
17
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
17
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
18
18
|
_dotenv.default.config({
|
|
19
19
|
path: `.env`
|
|
20
20
|
});
|
|
@@ -54,7 +54,7 @@ _commander.program.description("run AuthSession create").option("--cdpAddress <c
|
|
|
54
54
|
importFunction: _tsNodeImport.tsNodeImport
|
|
55
55
|
});
|
|
56
56
|
if (result.isErr()) {
|
|
57
|
-
if (result.error instanceof
|
|
57
|
+
if (result.error instanceof _runtimeInterface.AutomationError) {
|
|
58
58
|
throw result.error.error;
|
|
59
59
|
}
|
|
60
60
|
console.error(result.error);
|
package/dist/commands/build.js
CHANGED
|
@@ -11,8 +11,7 @@ var fs = _interopRequireWildcard(require("fs-extra"));
|
|
|
11
11
|
var path = _interopRequireWildcard(require("path"));
|
|
12
12
|
var _template = require("./common/utils/template");
|
|
13
13
|
var _dotenv = _interopRequireDefault(require("dotenv"));
|
|
14
|
-
function
|
|
15
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
16
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
16
|
function isThirdPartyWarning(warning) {
|
|
18
17
|
if (warning.id && /node_modules/.test(warning.id)) return true;
|
|
@@ -69,7 +68,6 @@ async function build(outfile, mode, template) {
|
|
|
69
68
|
await bundle.write({
|
|
70
69
|
format: "cjs",
|
|
71
70
|
file: outfile,
|
|
72
|
-
sourcemap: "inline",
|
|
73
71
|
inlineDynamicImports: true
|
|
74
72
|
});
|
|
75
73
|
console.log(`✨ Build succeeded: ${outfile}`);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as playwright from "playwright";
|
|
2
2
|
export declare const REMOTE_DEBUGGING_PORT = 9222;
|
|
3
3
|
export declare const getChromiumLaunchArgs: () => string[];
|
|
4
4
|
export declare function startOrRestartBrowser(): Promise<void>;
|
|
@@ -10,5 +10,5 @@ export interface SessionState {
|
|
|
10
10
|
}>;
|
|
11
11
|
}
|
|
12
12
|
export declare function saveSessionFromOpenedBrowser(path: string): Promise<void>;
|
|
13
|
-
export declare function loadState(path: string, context: BrowserContext): Promise<void>;
|
|
14
|
-
export declare function saveSession(path: string, context: BrowserContext): Promise<void>;
|
|
13
|
+
export declare function loadState(path: string, context: playwright.BrowserContext): Promise<void>;
|
|
14
|
+
export declare function saveSession(path: string, context: playwright.BrowserContext): Promise<void>;
|
|
@@ -9,12 +9,11 @@ exports.saveSession = saveSession;
|
|
|
9
9
|
exports.saveSessionFromOpenedBrowser = saveSessionFromOpenedBrowser;
|
|
10
10
|
exports.startOrRestartBrowser = startOrRestartBrowser;
|
|
11
11
|
var _child_process = require("child_process");
|
|
12
|
-
var playwright = _interopRequireWildcard(require("playwright"));
|
|
13
12
|
var fs = _interopRequireWildcard(require("fs-extra"));
|
|
14
13
|
var _fileUtils = require("./utils/fileUtils");
|
|
15
14
|
var _contextStorageStateHelpers = require("../../common/contextStorageStateHelpers");
|
|
16
|
-
|
|
17
|
-
function _interopRequireWildcard(e, r) { if (!
|
|
15
|
+
var playwright = _interopRequireWildcard(require("playwright"));
|
|
16
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
18
17
|
const REMOTE_DEBUGGING_PORT = exports.REMOTE_DEBUGGING_PORT = 9222;
|
|
19
18
|
const getChromiumLaunchArgs = () => ["--no-sandbox", `--remote-debugging-port=${REMOTE_DEBUGGING_PORT}`, `--user-data-dir=/tmp/${Date.now()}`, "--new-window", "--start-maximized", "--disable-popup-blocking"];
|
|
20
19
|
exports.getChromiumLaunchArgs = getChromiumLaunchArgs;
|
|
@@ -28,7 +27,7 @@ async function getBrowser() {
|
|
|
28
27
|
return playwrightBrowser;
|
|
29
28
|
}
|
|
30
29
|
async function startOrRestartBrowser() {
|
|
31
|
-
const chromiumPath =
|
|
30
|
+
const chromiumPath = playwright.chromium.executablePath();
|
|
32
31
|
const chromeInstanceProcess = (0, _child_process.spawn)(chromiumPath, getChromiumLaunchArgs());
|
|
33
32
|
chromeInstanceProcess.stdout.on("data", data => {
|
|
34
33
|
console.log(`Chrome stdout: ${data}`);
|
|
@@ -4,8 +4,7 @@ var _vitest = require("vitest");
|
|
|
4
4
|
var _getFirstLineNumber = _interopRequireDefault(require("./getFirstLineNumber"));
|
|
5
5
|
var fs = _interopRequireWildcard(require("fs"));
|
|
6
6
|
var path = _interopRequireWildcard(require("path"));
|
|
7
|
-
function
|
|
8
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
7
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
9
8
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
9
|
(0, _vitest.describe)("getFirstLineNumber", () => {
|
|
11
10
|
const testFilesDir = path.join(__dirname, "testFiles");
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ExtendedRunApiParameters } from "
|
|
1
|
+
import { ExtendedRunApiParameters } from "@intuned/runtime-interface";
|
|
2
2
|
export declare const tsNodeImport: ExtendedRunApiParameters["importFunction"];
|
|
@@ -6,8 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.tsNodeImport = void 0;
|
|
7
7
|
var _neverthrow = require("neverthrow");
|
|
8
8
|
var _fileUtils = require("./utils/fileUtils");
|
|
9
|
-
function
|
|
10
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
9
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
11
10
|
const tsNodeImport = async apiName => {
|
|
12
11
|
require("ts-node").register({
|
|
13
12
|
transpileOnly: true,
|
|
@@ -9,8 +9,7 @@ var path = _interopRequireWildcard(require("path"));
|
|
|
9
9
|
var fs = _interopRequireWildcard(require("fs-extra"));
|
|
10
10
|
var _dotenv = _interopRequireDefault(require("dotenv"));
|
|
11
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
function
|
|
13
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
13
|
_dotenv.default.config();
|
|
15
14
|
function getFullPathInProject(...paths) {
|
|
16
15
|
return path.resolve(process.cwd(), process.env.ROOT || "./", ...paths);
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import * as net from "net";
|
|
1
3
|
export interface InterfaceClient {
|
|
2
4
|
sendJSON(data: any): void;
|
|
3
5
|
receiveJSON(): AsyncGenerator<any, void, unknown>;
|
|
@@ -6,13 +8,19 @@ export interface InterfaceClient {
|
|
|
6
8
|
}
|
|
7
9
|
export declare class SocketClient implements InterfaceClient {
|
|
8
10
|
static readonly LENGTH_HEADER_LENGTH = 4;
|
|
9
|
-
|
|
10
|
-
constructor(
|
|
11
|
+
protected readonly socket: net.Socket;
|
|
12
|
+
constructor(socket: net.Socket);
|
|
11
13
|
sendJSON(data: any): void;
|
|
12
14
|
receiveJSON(): AsyncGenerator<any, void, unknown>;
|
|
13
15
|
close(): Promise<void>;
|
|
14
16
|
get closed(): boolean;
|
|
15
17
|
}
|
|
18
|
+
export declare class UnixSocketClient extends SocketClient {
|
|
19
|
+
constructor(path: string);
|
|
20
|
+
}
|
|
21
|
+
export declare class TCPSocketClient extends SocketClient {
|
|
22
|
+
constructor(host: string, port: number);
|
|
23
|
+
}
|
|
16
24
|
export declare class JSONLFileClient implements InterfaceClient {
|
|
17
25
|
private readonly fileStream;
|
|
18
26
|
constructor(filePath: string);
|
|
@@ -3,17 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.SocketClient = exports.JSONLFileClient = void 0;
|
|
6
|
+
exports.UnixSocketClient = exports.TCPSocketClient = exports.SocketClient = exports.JSONLFileClient = void 0;
|
|
7
7
|
var net = _interopRequireWildcard(require("net"));
|
|
8
8
|
var fs = _interopRequireWildcard(require("fs-extra"));
|
|
9
9
|
var _readline = require("readline");
|
|
10
10
|
var _promises = require("timers/promises");
|
|
11
|
-
function
|
|
12
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
13
12
|
class SocketClient {
|
|
14
13
|
static LENGTH_HEADER_LENGTH = 4;
|
|
15
|
-
constructor(
|
|
16
|
-
this.socket =
|
|
14
|
+
constructor(socket) {
|
|
15
|
+
this.socket = socket;
|
|
17
16
|
}
|
|
18
17
|
sendJSON(data) {
|
|
19
18
|
const dataToSend = JSON.stringify(data);
|
|
@@ -55,6 +54,18 @@ class SocketClient {
|
|
|
55
54
|
}
|
|
56
55
|
}
|
|
57
56
|
exports.SocketClient = SocketClient;
|
|
57
|
+
class UnixSocketClient extends SocketClient {
|
|
58
|
+
constructor(path) {
|
|
59
|
+
super(net.createConnection(path));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.UnixSocketClient = UnixSocketClient;
|
|
63
|
+
class TCPSocketClient extends SocketClient {
|
|
64
|
+
constructor(host, port) {
|
|
65
|
+
super(net.createConnection(port, host));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.TCPSocketClient = TCPSocketClient;
|
|
58
69
|
class JSONLFileClient {
|
|
59
70
|
constructor(filePath) {
|
|
60
71
|
this.fileStream = fs.createReadStream(filePath, {
|
|
@@ -7,8 +7,7 @@ exports.moveTemplateFiles = void 0;
|
|
|
7
7
|
var fs = _interopRequireWildcard(require("fs-extra"));
|
|
8
8
|
var path = _interopRequireWildcard(require("path"));
|
|
9
9
|
var _fileUtils = require("./fileUtils");
|
|
10
|
-
function
|
|
11
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
10
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
12
11
|
const moveTemplateFiles = async templateName => {
|
|
13
12
|
await fs.remove("./intuned");
|
|
14
13
|
await fs.ensureDir("./intuned");
|
|
@@ -7,64 +7,27 @@ exports.runAutomationCLI = runAutomationCLI;
|
|
|
7
7
|
var _commander = require("commander");
|
|
8
8
|
var _dotenv = _interopRequireDefault(require("dotenv"));
|
|
9
9
|
var _asyncLocalStorage = require("../../common/asyncLocalStorage");
|
|
10
|
-
var _zod = _interopRequireDefault(require("zod"));
|
|
11
10
|
var _runApi = require("../../common/runApi");
|
|
12
11
|
var _enums = require("../../runtime/enums");
|
|
13
|
-
var _unixSocket = require("../common/utils/unixSocket");
|
|
14
12
|
var _promises = require("timers/promises");
|
|
15
13
|
var _jwtTokenManager = require("../../common/jwtTokenManager");
|
|
16
14
|
var _formatZodError = require("../../common/formatZodError");
|
|
17
15
|
var _neverthrow = require("neverthrow");
|
|
18
16
|
var _getAuthSessionParameters = require("../../common/backendFunctions/getAuthSessionParameters");
|
|
17
|
+
var _runtimeInterface = require("../../vendor/runtime-interface");
|
|
19
18
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
20
|
-
function
|
|
21
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
22
|
-
const startRunApiSchema = _zod.default.object({
|
|
23
|
-
type: _zod.default.literal("start"),
|
|
24
|
-
parameters: _runApi.runApiParametersSchema.extend({
|
|
25
|
-
retrieveSession: _zod.default.boolean(),
|
|
26
|
-
functionsToken: _zod.default.string().optional(),
|
|
27
|
-
context: _zod.default.object({
|
|
28
|
-
jobId: _zod.default.string().optional(),
|
|
29
|
-
jobRunId: _zod.default.string().optional(),
|
|
30
|
-
runId: _zod.default.string().optional(),
|
|
31
|
-
queueId: _zod.default.string().optional(),
|
|
32
|
-
authSessionId: _zod.default.string().optional()
|
|
33
|
-
}).optional()
|
|
34
|
-
})
|
|
35
|
-
});
|
|
36
|
-
const nextRunApiSchema = _zod.default.object({
|
|
37
|
-
type: _zod.default.literal("next"),
|
|
38
|
-
parameters: _zod.default.object({
|
|
39
|
-
value: _zod.default.string()
|
|
40
|
-
})
|
|
41
|
-
});
|
|
42
|
-
const abortRunApiSchema = _zod.default.object({
|
|
43
|
-
type: _zod.default.literal("abort"),
|
|
44
|
-
parameters: _zod.default.object({}).optional()
|
|
45
|
-
});
|
|
46
|
-
const tokenUpdateSchema = _zod.default.object({
|
|
47
|
-
type: _zod.default.literal("tokenUpdate"),
|
|
48
|
-
parameters: _zod.default.object({
|
|
49
|
-
functionsToken: _zod.default.string()
|
|
50
|
-
})
|
|
51
|
-
});
|
|
52
|
-
const pingSchema = _zod.default.object({
|
|
53
|
-
type: _zod.default.literal("ping"),
|
|
54
|
-
parameters: _zod.default.object({}).optional()
|
|
55
|
-
});
|
|
56
|
-
const inputSchema = _zod.default.union([startRunApiSchema, nextRunApiSchema, abortRunApiSchema, tokenUpdateSchema, pingSchema]);
|
|
19
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
57
20
|
_dotenv.default.config({
|
|
58
21
|
path: `.env`
|
|
59
22
|
});
|
|
60
23
|
function runAutomationCLI(importFunction) {
|
|
61
|
-
_commander.program.description("run user automation and communicate using unix socket").argument("<
|
|
62
|
-
|
|
24
|
+
_commander.program.description("run user automation and communicate using unix socket").argument("<input>", "In unix socket mode: path to the unix socket. In jsonl mode: path to the jsonl file. In tcp socket mode: host:port").option("--mode [mode]", "Communication mode: unix, jsonl, or tcp").action(async (input, {
|
|
25
|
+
mode = "unix"
|
|
63
26
|
}) => {
|
|
64
27
|
let context;
|
|
65
28
|
const throttleTime = 60 * 1000;
|
|
66
29
|
let timeoutTimestamp = Date.now();
|
|
67
|
-
const client =
|
|
30
|
+
const client = createClient(mode, input);
|
|
68
31
|
const abortController = new AbortController();
|
|
69
32
|
const interruptSignalHandler = async () => {
|
|
70
33
|
abortController.abort();
|
|
@@ -80,12 +43,12 @@ function runAutomationCLI(importFunction) {
|
|
|
80
43
|
if (data.done) {
|
|
81
44
|
return;
|
|
82
45
|
}
|
|
83
|
-
const inputParseResult =
|
|
46
|
+
const inputParseResult = _runtimeInterface.runApiInputSchema.safeParse(data.value);
|
|
84
47
|
if (!inputParseResult.success) {
|
|
85
48
|
console.error("Validation error:", (0, _formatZodError.formatZodError)(inputParseResult.error));
|
|
86
49
|
return {
|
|
87
50
|
type: "error",
|
|
88
|
-
error: new
|
|
51
|
+
error: new _runtimeInterface.InternalInvalidInputError("Invalid input", (0, _formatZodError.formatZodError)(inputParseResult.error))
|
|
89
52
|
};
|
|
90
53
|
}
|
|
91
54
|
const input = inputParseResult.data;
|
|
@@ -128,9 +91,6 @@ function runAutomationCLI(importFunction) {
|
|
|
128
91
|
});
|
|
129
92
|
return;
|
|
130
93
|
}
|
|
131
|
-
if (message.type === "next") {
|
|
132
|
-
throw new Error("next not supported anymore");
|
|
133
|
-
}
|
|
134
94
|
}
|
|
135
95
|
let receiveMessagesPromise = receiveMessages();
|
|
136
96
|
while (true) {
|
|
@@ -196,10 +156,10 @@ function getProxyUrlFromRunOptions(runOptions) {
|
|
|
196
156
|
}
|
|
197
157
|
const _defaultImport = async path => {
|
|
198
158
|
try {
|
|
199
|
-
const imported = await (specifier => new Promise(r => r(specifier)).then(s => _interopRequireWildcard(require(s))))(
|
|
159
|
+
const imported = await (specifier => new Promise(r => r(specifier)).then(s => _interopRequireWildcard(require(s))))(`${process.cwd()}/${path}`);
|
|
200
160
|
return (0, _neverthrow.ok)(imported);
|
|
201
161
|
} catch (e) {
|
|
202
|
-
if ("code" in e && e.code === "MODULE_NOT_FOUND") {
|
|
162
|
+
if ("code" in e && e.code === "MODULE_NOT_FOUND" || e.code === "ERR_MODULE_NOT_FOUND") {
|
|
203
163
|
return (0, _neverthrow.err)({
|
|
204
164
|
type: "not_found"
|
|
205
165
|
});
|
|
@@ -210,6 +170,20 @@ const _defaultImport = async path => {
|
|
|
210
170
|
});
|
|
211
171
|
}
|
|
212
172
|
};
|
|
173
|
+
function createClient(mode, input) {
|
|
174
|
+
if (mode === "jsonl") {
|
|
175
|
+
return new _runtimeInterface.JSONLFileClient(input);
|
|
176
|
+
}
|
|
177
|
+
if (mode === "tcp") {
|
|
178
|
+
const [host, portString] = input.split(":");
|
|
179
|
+
const port = Number(portString);
|
|
180
|
+
if (!host || isNaN(port)) {
|
|
181
|
+
throw new Error("Invalid tcp input, expected format host:port");
|
|
182
|
+
}
|
|
183
|
+
return new _runtimeInterface.TCPSocketClient(host, port);
|
|
184
|
+
}
|
|
185
|
+
return new _runtimeInterface.UnixSocketClient(input);
|
|
186
|
+
}
|
|
213
187
|
if (require.main === module) {
|
|
214
188
|
runAutomationCLI();
|
|
215
189
|
}
|
|
@@ -15,7 +15,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
15
15
|
_dotenv.default.config({
|
|
16
16
|
path: `.env`
|
|
17
17
|
});
|
|
18
|
-
const deployCommand = exports.deployCommand = _command.program.command("deploy").description("
|
|
18
|
+
const deployCommand = exports.deployCommand = _command.program.command("deploy").description("Deploy an Intuned project to the platform").argument("[project-name]", "Name of the project to deploy").option("-w, --workspace-id <id>", "Your Intuned workspace ID").option("-k, --api-key <key>", "Your Intuned API key").action((0, _helpers.cliCommandWrapper)(_provision2.saveOrDeployArgsSchema, _provision2.saveOrDeployOptionsSchema, async ([projectName], options) => {
|
|
19
19
|
const {
|
|
20
20
|
isValid,
|
|
21
21
|
errorMessage
|
|
@@ -31,7 +31,7 @@ const deployCommand = exports.deployCommand = _command.program.command("deploy")
|
|
|
31
31
|
return result.isValid || result.errorMessage;
|
|
32
32
|
}));
|
|
33
33
|
if (!_projectName) {
|
|
34
|
-
throw new _helpers.CLIError(`Project name is required. Set it in ${await (0, _helpers.getIntunedSettingsFile)()} or provide it as an argument.`);
|
|
34
|
+
throw new _helpers.CLIError(`Project name is required. Set it in ${await (0, _helpers.getIntunedSettingsFile)()} or provide it as an argument by running 'intuned deploy <project-name>'.`);
|
|
35
35
|
}
|
|
36
36
|
const projectNameValidation = (0, _provision.validateProjectName)(_projectName);
|
|
37
37
|
if (!projectNameValidation.isValid) {
|
|
@@ -4,10 +4,10 @@ export declare const saveOrDeployOptionsSchema: z.ZodObject<{
|
|
|
4
4
|
workspaceId: z.ZodOptional<z.ZodString>;
|
|
5
5
|
apiKey: z.ZodOptional<z.ZodString>;
|
|
6
6
|
}, "strip", z.ZodTypeAny, {
|
|
7
|
-
workspaceId?: string | undefined;
|
|
8
7
|
apiKey?: string | undefined;
|
|
9
|
-
}, {
|
|
10
8
|
workspaceId?: string | undefined;
|
|
9
|
+
}, {
|
|
11
10
|
apiKey?: string | undefined;
|
|
11
|
+
workspaceId?: string | undefined;
|
|
12
12
|
}>;
|
|
13
13
|
export declare const provisionCommand: import("commander").Command, saveCommand: import("commander").Command;
|
|
@@ -37,7 +37,7 @@ const [provisionCommand, saveCommand] = commands.map(command => command.argument
|
|
|
37
37
|
return result.isValid || result.errorMessage;
|
|
38
38
|
}));
|
|
39
39
|
if (!_projectName) {
|
|
40
|
-
throw new _helpers.CLIError(`Project name is required. Set it in ${await (0, _helpers.getIntunedSettingsFile)()} or provide it as an argument.`);
|
|
40
|
+
throw new _helpers.CLIError(`Project name is required. Set it in ${await (0, _helpers.getIntunedSettingsFile)()} or provide it as an argument by running 'intuned provision <project-name>'.`);
|
|
41
41
|
}
|
|
42
42
|
const projectNameValidation = (0, _provision.validateProjectName)(_projectName);
|
|
43
43
|
if (!projectNameValidation.isValid) {
|
|
@@ -2,10 +2,12 @@ import { Command } from "commander";
|
|
|
2
2
|
export declare const baseRunAuthSessionCommandOptionsSchema: import("zod").ZodObject<{
|
|
3
3
|
proxy: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4
4
|
timeout: import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodDefault<import("zod").ZodString>, import("ms").StringValue, string | undefined>, number, string | undefined>;
|
|
5
|
-
trace: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
6
5
|
headless: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
6
|
+
trace: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
7
7
|
keepBrowserOpen: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
8
8
|
cdpUrl: import("zod").ZodOptional<import("zod").ZodString>;
|
|
9
|
+
cdpTabId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
10
|
+
} & {
|
|
9
11
|
checkAttempts: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
10
12
|
createAttempts: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
11
13
|
}, "strip", import("zod").ZodTypeAny, {
|
|
@@ -17,6 +19,7 @@ export declare const baseRunAuthSessionCommandOptionsSchema: import("zod").ZodOb
|
|
|
17
19
|
createAttempts: number;
|
|
18
20
|
proxy?: string | undefined;
|
|
19
21
|
cdpUrl?: string | undefined;
|
|
22
|
+
cdpTabId?: string | undefined;
|
|
20
23
|
}, {
|
|
21
24
|
proxy?: string | undefined;
|
|
22
25
|
timeout?: string | undefined;
|
|
@@ -24,6 +27,7 @@ export declare const baseRunAuthSessionCommandOptionsSchema: import("zod").ZodOb
|
|
|
24
27
|
headless?: boolean | undefined;
|
|
25
28
|
keepBrowserOpen?: boolean | undefined;
|
|
26
29
|
cdpUrl?: string | undefined;
|
|
30
|
+
cdpTabId?: string | undefined;
|
|
27
31
|
checkAttempts?: number | undefined;
|
|
28
32
|
createAttempts?: number | undefined;
|
|
29
33
|
}>;
|
|
@@ -9,6 +9,7 @@ export declare const headlessSchema: z.ZodDefault<z.ZodBoolean>;
|
|
|
9
9
|
export declare const traceSchema: z.ZodDefault<z.ZodBoolean>;
|
|
10
10
|
export declare const keepBrowserOpenSchema: z.ZodDefault<z.ZodBoolean>;
|
|
11
11
|
export declare const cdpUrlSchema: z.ZodOptional<z.ZodString>;
|
|
12
|
+
export declare const cdpTabIdSchema: z.ZodOptional<z.ZodString>;
|
|
12
13
|
export declare const baseCommandOptionsSchema: z.ZodObject<{
|
|
13
14
|
proxy: z.ZodOptional<z.ZodString>;
|
|
14
15
|
timeout: z.ZodEffects<z.ZodEffects<z.ZodDefault<z.ZodString>, ms.StringValue, string | undefined>, number, string | undefined>;
|
|
@@ -16,6 +17,7 @@ export declare const baseCommandOptionsSchema: z.ZodObject<{
|
|
|
16
17
|
trace: z.ZodDefault<z.ZodBoolean>;
|
|
17
18
|
keepBrowserOpen: z.ZodDefault<z.ZodBoolean>;
|
|
18
19
|
cdpUrl: z.ZodOptional<z.ZodString>;
|
|
20
|
+
cdpTabId: z.ZodOptional<z.ZodString>;
|
|
19
21
|
}, "strip", z.ZodTypeAny, {
|
|
20
22
|
timeout: number;
|
|
21
23
|
trace: boolean;
|
|
@@ -23,13 +25,15 @@ export declare const baseCommandOptionsSchema: z.ZodObject<{
|
|
|
23
25
|
keepBrowserOpen: boolean;
|
|
24
26
|
proxy?: string | undefined;
|
|
25
27
|
cdpUrl?: string | undefined;
|
|
28
|
+
cdpTabId?: string | undefined;
|
|
26
29
|
}, {
|
|
27
30
|
proxy?: string | undefined;
|
|
28
31
|
timeout?: string | undefined;
|
|
29
|
-
headless?: boolean | undefined;
|
|
30
32
|
trace?: boolean | undefined;
|
|
33
|
+
headless?: boolean | undefined;
|
|
31
34
|
keepBrowserOpen?: boolean | undefined;
|
|
32
35
|
cdpUrl?: string | undefined;
|
|
36
|
+
cdpTabId?: string | undefined;
|
|
33
37
|
}>;
|
|
34
38
|
export type BaseCommandOptions = z.infer<typeof baseCommandOptionsSchema>;
|
|
35
39
|
export declare function withBaseOptions(command: Command): Command;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.traceSchema = exports.timeoutSchema = exports.proxySchema = exports.keepBrowserOpenSchema = exports.headlessSchema = exports.cdpUrlSchema = exports.baseCommandOptionsSchema = exports.authSessionCreateAttemptsSchema = exports.authSessionCheckAttemptsSchema = void 0;
|
|
6
|
+
exports.traceSchema = exports.timeoutSchema = exports.proxySchema = exports.keepBrowserOpenSchema = exports.headlessSchema = exports.cdpUrlSchema = exports.cdpTabIdSchema = exports.baseCommandOptionsSchema = exports.authSessionCreateAttemptsSchema = exports.authSessionCheckAttemptsSchema = void 0;
|
|
7
7
|
exports.withBaseOptions = withBaseOptions;
|
|
8
8
|
var _ms = _interopRequireDefault(require("ms"));
|
|
9
9
|
var _zod = require("zod");
|
|
@@ -18,14 +18,16 @@ const headlessSchema = exports.headlessSchema = _zod.z.boolean().default(false);
|
|
|
18
18
|
const traceSchema = exports.traceSchema = _zod.z.boolean().default(false);
|
|
19
19
|
const keepBrowserOpenSchema = exports.keepBrowserOpenSchema = _zod.z.boolean().default(false);
|
|
20
20
|
const cdpUrlSchema = exports.cdpUrlSchema = _zod.z.string().url().optional();
|
|
21
|
+
const cdpTabIdSchema = exports.cdpTabIdSchema = _zod.z.string().min(1).optional();
|
|
21
22
|
const baseCommandOptionsSchema = exports.baseCommandOptionsSchema = _zod.z.object({
|
|
22
23
|
proxy: proxySchema,
|
|
23
24
|
timeout: timeoutSchema,
|
|
24
25
|
headless: headlessSchema,
|
|
25
26
|
trace: traceSchema,
|
|
26
27
|
keepBrowserOpen: keepBrowserOpenSchema,
|
|
27
|
-
cdpUrl: cdpUrlSchema
|
|
28
|
+
cdpUrl: cdpUrlSchema,
|
|
29
|
+
cdpTabId: cdpTabIdSchema
|
|
28
30
|
});
|
|
29
31
|
function withBaseOptions(command) {
|
|
30
|
-
return command.option("--proxy <url>", "Proxy URL to use for browser").option("--timeout <time>", "Timeout for each attempt - milliseconds or ms-formatted string", "10 mins").option("--headless", "Run the attempts in a headless browser (default: false). This will not open a browser window.").option("--trace", "Capture a trace of each attempt, useful for debugging.").option("--keep-browser-open", "Keep the last browser open after the command completes, useful for debugging.").option("--cdp-url <url>", "
|
|
32
|
+
return command.option("--proxy <url>", "Proxy URL to use for browser").option("--timeout <time>", "Timeout for each attempt - milliseconds or ms-formatted string", "10 mins").option("--headless", "Run the attempts in a headless browser (default: false). This will not open a browser window.").option("--trace", "Capture a trace of each attempt, useful for debugging.").option("--keep-browser-open", "Keep the last browser open after the command completes, useful for debugging.").option("--cdp-url <url>", "Chrome DevTools Protocol URL to connect to an existing browser instance. Disables proxy, headless, keep_browser_open options.").option("--cdp-tab-id <tab_id>", "Browser tab ID to execute on. Requires --cdp-url. If not specified, uses the first tab. Defaults to None.");
|
|
31
33
|
}
|