@intuned/runtime 1.3.20 → 1.3.22
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/.claude/settings.local.json +1 -3
- package/bin/intuned +20 -2
- package/dist/commands/common/browserUtils.js +10 -1
- package/dist/common/launchBrowser.js +14 -2
- package/dist/vendor/runtime-interface.js +8 -9
- package/package.json +3 -3
- package/dist/commands/intuned-cli/commands/attempt.command.d.ts +0 -1
- package/dist/commands/intuned-cli/commands/attempt.command.js +0 -8
- package/dist/commands/intuned-cli/commands/attempt_api.command.d.ts +0 -1
- package/dist/commands/intuned-cli/commands/attempt_api.command.js +0 -30
- package/dist/commands/intuned-cli/commands/attempt_authsession.command.d.ts +0 -1
- package/dist/commands/intuned-cli/commands/attempt_authsession.command.js +0 -8
- package/dist/commands/intuned-cli/commands/attempt_authsession_check.command.d.ts +0 -1
- package/dist/commands/intuned-cli/commands/attempt_authsession_check.command.js +0 -19
- package/dist/commands/intuned-cli/commands/attempt_authsession_create.command.d.ts +0 -1
- package/dist/commands/intuned-cli/commands/attempt_authsession_create.command.js +0 -24
- package/dist/commands/intuned-cli/commands/authsession.command.d.ts +0 -1
- package/dist/commands/intuned-cli/commands/authsession.command.js +0 -8
- package/dist/commands/intuned-cli/commands/authsession_record.command.d.ts +0 -1
- package/dist/commands/intuned-cli/commands/authsession_record.command.js +0 -32
- package/dist/commands/intuned-cli/commands/authsession_scaffold.command.d.ts +0 -1
- package/dist/commands/intuned-cli/commands/authsession_scaffold.command.js +0 -16
- package/dist/commands/intuned-cli/commands/build.command.d.ts +0 -1
- package/dist/commands/intuned-cli/commands/build.command.js +0 -12
- package/dist/commands/intuned-cli/commands/command.d.ts +0 -2
- package/dist/commands/intuned-cli/commands/command.js +0 -9
- package/dist/commands/intuned-cli/commands/deploy.command.d.ts +0 -1
- package/dist/commands/intuned-cli/commands/deploy.command.js +0 -42
- package/dist/commands/intuned-cli/commands/index.d.ts +0 -18
- package/dist/commands/intuned-cli/commands/index.js +0 -203
- package/dist/commands/intuned-cli/commands/provision.command.d.ts +0 -13
- package/dist/commands/intuned-cli/commands/provision.command.js +0 -50
- package/dist/commands/intuned-cli/commands/run.command.d.ts +0 -1
- package/dist/commands/intuned-cli/commands/run.command.js +0 -8
- package/dist/commands/intuned-cli/commands/run_api.command.d.ts +0 -1
- package/dist/commands/intuned-cli/commands/run_api.command.js +0 -46
- package/dist/commands/intuned-cli/commands/run_authsession.command.d.ts +0 -35
- package/dist/commands/intuned-cli/commands/run_authsession.command.js +0 -17
- package/dist/commands/intuned-cli/commands/run_authsession_create.command.d.ts +0 -1
- package/dist/commands/intuned-cli/commands/run_authsession_create.command.js +0 -35
- package/dist/commands/intuned-cli/commands/run_authsession_update.command.d.ts +0 -1
- package/dist/commands/intuned-cli/commands/run_authsession_update.command.js +0 -35
- package/dist/commands/intuned-cli/commands/run_authsession_validate.command.d.ts +0 -1
- package/dist/commands/intuned-cli/commands/run_authsession_validate.command.js +0 -33
- package/dist/commands/intuned-cli/commands/types.d.ts +0 -39
- package/dist/commands/intuned-cli/commands/types.js +0 -33
- package/dist/commands/intuned-cli/constants/index.d.ts +0 -17
- package/dist/commands/intuned-cli/constants/index.js +0 -25
- package/dist/commands/intuned-cli/controller/__test__/api.test.js +0 -399
- package/dist/commands/intuned-cli/controller/__test__/authSession.test.js +0 -1061
- package/dist/commands/intuned-cli/controller/api.d.ts +0 -42
- package/dist/commands/intuned-cli/controller/api.js +0 -194
- package/dist/commands/intuned-cli/controller/authSession.d.ts +0 -209
- package/dist/commands/intuned-cli/controller/authSession.js +0 -425
- package/dist/commands/intuned-cli/controller/build.d.ts +0 -1
- package/dist/commands/intuned-cli/controller/build.js +0 -35
- package/dist/commands/intuned-cli/controller/deploy.d.ts +0 -5
- package/dist/commands/intuned-cli/controller/deploy.js +0 -317
- package/dist/commands/intuned-cli/controller/index.d.ts +0 -1
- package/dist/commands/intuned-cli/controller/index.js +0 -45
- package/dist/commands/intuned-cli/controller/provision.d.ts +0 -21
- package/dist/commands/intuned-cli/controller/provision.js +0 -299
- package/dist/commands/intuned-cli/controller/scaffold.d.ts +0 -1
- package/dist/commands/intuned-cli/controller/scaffold.js +0 -77
- package/dist/commands/intuned-cli/helpers/__test__/browser.test.js +0 -152
- package/dist/commands/intuned-cli/helpers/__test__/tracing.test.js +0 -41
- package/dist/commands/intuned-cli/helpers/api.d.ts +0 -3
- package/dist/commands/intuned-cli/helpers/api.js +0 -16
- package/dist/commands/intuned-cli/helpers/auth.d.ts +0 -46
- package/dist/commands/intuned-cli/helpers/auth.js +0 -147
- package/dist/commands/intuned-cli/helpers/backend.d.ts +0 -8
- package/dist/commands/intuned-cli/helpers/backend.js +0 -35
- package/dist/commands/intuned-cli/helpers/browser.d.ts +0 -14
- package/dist/commands/intuned-cli/helpers/browser.js +0 -93
- package/dist/commands/intuned-cli/helpers/context.d.ts +0 -3
- package/dist/commands/intuned-cli/helpers/context.js +0 -33
- package/dist/commands/intuned-cli/helpers/errors.d.ts +0 -16
- package/dist/commands/intuned-cli/helpers/errors.js +0 -44
- package/dist/commands/intuned-cli/helpers/index.d.ts +0 -12
- package/dist/commands/intuned-cli/helpers/index.js +0 -137
- package/dist/commands/intuned-cli/helpers/intunedJson.d.ts +0 -40
- package/dist/commands/intuned-cli/helpers/intunedJson.js +0 -20
- package/dist/commands/intuned-cli/helpers/prompts.d.ts +0 -3
- package/dist/commands/intuned-cli/helpers/prompts.js +0 -71
- package/dist/commands/intuned-cli/helpers/proxy.d.ts +0 -5
- package/dist/commands/intuned-cli/helpers/proxy.js +0 -23
- package/dist/commands/intuned-cli/helpers/terminal.d.ts +0 -5
- package/dist/commands/intuned-cli/helpers/terminal.js +0 -13
- package/dist/commands/intuned-cli/helpers/timeout.d.ts +0 -1
- package/dist/commands/intuned-cli/helpers/timeout.js +0 -23
- package/dist/commands/intuned-cli/helpers/traces.d.ts +0 -2
- package/dist/commands/intuned-cli/helpers/traces.js +0 -32
- package/dist/commands/intuned-cli/helpers/validation.d.ts +0 -2
- package/dist/commands/intuned-cli/helpers/validation.js +0 -14
- package/dist/commands/intuned-cli/helpers/wrapper.d.ts +0 -2
- package/dist/commands/intuned-cli/helpers/wrapper.js +0 -76
- package/dist/commands/intuned-cli/index.d.ts +0 -1
- package/dist/commands/intuned-cli/index.js +0 -16
- package/dist/commands/intuned-cli/main.d.ts +0 -1
- package/dist/commands/intuned-cli/main.js +0 -35
- package/dist/commands/intuned-cli/types.d.ts +0 -70
- package/dist/commands/intuned-cli/types.js +0 -22
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"permissions": {
|
|
3
3
|
"allow": [
|
|
4
|
-
"Bash(
|
|
5
|
-
"Bash(git -C /Users/yousefhanbali/Desktop/webapp/WebApp2 config --list --local)",
|
|
6
|
-
"Bash(git -C /Users/yousefhanbali/Desktop/webapp/WebApp2 config --get core.hooksPath)"
|
|
4
|
+
"Bash(npm info:*)"
|
|
7
5
|
]
|
|
8
6
|
}
|
|
9
7
|
}
|
package/bin/intuned
CHANGED
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
require("
|
|
3
|
+
// detect `intunedctl` in PATH and run it with the provided arguments
|
|
4
|
+
const spawn = require("child_process").spawn;
|
|
5
|
+
const which = require("which");
|
|
6
|
+
|
|
7
|
+
const intunedctlPath = which.sync("intunedctl", { nothrow: true });
|
|
8
|
+
|
|
9
|
+
if (!intunedctlPath) {
|
|
10
|
+
console.error(
|
|
11
|
+
"Install Intuned CLI globally with `npm install -g @intuned/cli` to run this command."
|
|
12
|
+
);
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const child = spawn(intunedctlPath, process.argv.slice(2), {
|
|
17
|
+
stdio: "inherit",
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
child.on("exit", (code) => {
|
|
21
|
+
process.exit(code ?? 0);
|
|
22
|
+
});
|
|
@@ -15,7 +15,16 @@ var _contextStorageStateHelpers = require("../../common/contextStorageStateHelpe
|
|
|
15
15
|
var playwright = _interopRequireWildcard(require("playwright"));
|
|
16
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); }
|
|
17
17
|
const REMOTE_DEBUGGING_PORT = exports.REMOTE_DEBUGGING_PORT = 9222;
|
|
18
|
-
|
|
18
|
+
function getMacKeychainBypassArgs() {
|
|
19
|
+
if (process.platform !== "darwin") {
|
|
20
|
+
return [];
|
|
21
|
+
}
|
|
22
|
+
if (process.env.INTUNED_MAC_DISABLE_KEYCHAIN_PROMPTS === "0") {
|
|
23
|
+
return [];
|
|
24
|
+
}
|
|
25
|
+
return ["--use-mock-keychain", "--password-store=basic"];
|
|
26
|
+
}
|
|
27
|
+
const getChromiumLaunchArgs = () => ["--no-sandbox", `--remote-debugging-port=${REMOTE_DEBUGGING_PORT}`, `--user-data-dir=/tmp/${Date.now()}`, "--new-window", "--start-maximized", "--disable-popup-blocking", ...getMacKeychainBypassArgs()];
|
|
19
28
|
exports.getChromiumLaunchArgs = getChromiumLaunchArgs;
|
|
20
29
|
async function getBrowser() {
|
|
21
30
|
let playwrightBrowser = null;
|
|
@@ -24,6 +24,15 @@ var _intunedJson = require("./intunedJson");
|
|
|
24
24
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
25
25
|
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); }
|
|
26
26
|
const execAsync = (0, _util.promisify)(_child_process.exec);
|
|
27
|
+
function getMacKeychainBypassArgs() {
|
|
28
|
+
if (process.platform !== "darwin") {
|
|
29
|
+
return [];
|
|
30
|
+
}
|
|
31
|
+
if (process.env.INTUNED_MAC_DISABLE_KEYCHAIN_PROMPTS === "0") {
|
|
32
|
+
return [];
|
|
33
|
+
}
|
|
34
|
+
return ["--use-mock-keychain", "--password-store=basic"];
|
|
35
|
+
}
|
|
27
36
|
async function createUserDirWithPreferences() {
|
|
28
37
|
const playwrightTempDir = await (0, _fsExtra.mkdtemp)("/tmp/pw-");
|
|
29
38
|
const userDir = (0, _path.join)(playwrightTempDir, "userdir");
|
|
@@ -87,6 +96,8 @@ async function launchChromium(options) {
|
|
|
87
96
|
} = options;
|
|
88
97
|
const defaultArgsToIgnore = ["--disable-extensions", "--disable-component-extensions-with-background-pages", "--disable-background-networking", "--disable-backgrounding-occluded-windows", "--disable-background-timer-throttling"];
|
|
89
98
|
const extraArgs = [];
|
|
99
|
+
const macKeychainBypassArgs = getMacKeychainBypassArgs();
|
|
100
|
+
extraArgs.push(...macKeychainBypassArgs);
|
|
90
101
|
const stealthConfig = await (0, _intunedJson.getStealthModeConfig)();
|
|
91
102
|
if (stealthConfig.enabled && stealthConfig.type === "intunedBrowser") {
|
|
92
103
|
extraArgs.push("--stealth-mode");
|
|
@@ -126,7 +137,8 @@ async function launchChromium(options) {
|
|
|
126
137
|
}
|
|
127
138
|
const viewport = null;
|
|
128
139
|
const userAgent = process.env.__PLAYWRIGHT_USER_AGENT_OVERRIDE ?? (await getHeadlessUserAgent({
|
|
129
|
-
executablePath
|
|
140
|
+
executablePath,
|
|
141
|
+
args: macKeychainBypassArgs
|
|
130
142
|
}));
|
|
131
143
|
const context = await playwright.chromium.launchPersistentContext(userDataDir, {
|
|
132
144
|
userAgent,
|
|
@@ -170,7 +182,7 @@ async function launchChromium(options) {
|
|
|
170
182
|
};
|
|
171
183
|
}
|
|
172
184
|
async function getIntunedBrowserExecutablePath() {
|
|
173
|
-
const intunedPath = process.env.
|
|
185
|
+
const intunedPath = process.env.INTUNED_STEALTH_CHROMIUM_PATH;
|
|
174
186
|
if (intunedPath && (await fs.exists(intunedPath))) {
|
|
175
187
|
return intunedPath;
|
|
176
188
|
}
|
|
@@ -126,6 +126,7 @@ var require_errors = __commonJS({
|
|
|
126
126
|
var AutomationError = class extends RunAutomationError {
|
|
127
127
|
constructor(error) {
|
|
128
128
|
super(exports2.automationError, `[${error?.name ?? error}] ${error?.message}`);
|
|
129
|
+
this.error = error;
|
|
129
130
|
this.details = {
|
|
130
131
|
...error,
|
|
131
132
|
name: error?.name,
|
|
@@ -384,7 +385,10 @@ var require_interfaceClient = __commonJS({
|
|
|
384
385
|
if (!(chunk instanceof Buffer)) {
|
|
385
386
|
break;
|
|
386
387
|
}
|
|
387
|
-
buffer = Buffer.concat([
|
|
388
|
+
buffer = Buffer.concat([
|
|
389
|
+
buffer,
|
|
390
|
+
chunk
|
|
391
|
+
]);
|
|
388
392
|
if (buffer.length < _SocketClient.LENGTH_HEADER_LENGTH) {
|
|
389
393
|
continue;
|
|
390
394
|
}
|
|
@@ -398,12 +402,7 @@ var require_interfaceClient = __commonJS({
|
|
|
398
402
|
}
|
|
399
403
|
}
|
|
400
404
|
async close() {
|
|
401
|
-
this.socket.
|
|
402
|
-
await Promise.race([
|
|
403
|
-
new Promise((resolve) => this.socket.once("close", resolve)),
|
|
404
|
-
new Promise((resolve) => this.socket.once("error", resolve)),
|
|
405
|
-
(0, promises_1.setTimeout)(3e3)
|
|
406
|
-
]);
|
|
405
|
+
this.socket.destroy();
|
|
407
406
|
}
|
|
408
407
|
get closed() {
|
|
409
408
|
return this.socket.closed;
|
|
@@ -445,8 +444,8 @@ var require_interfaceClient = __commonJS({
|
|
|
445
444
|
async close() {
|
|
446
445
|
this.fileStream.close();
|
|
447
446
|
await Promise.race([
|
|
448
|
-
new Promise((resolve) => this.fileStream.once("close", resolve)),
|
|
449
|
-
new Promise((resolve) => this.fileStream.once("error", resolve)),
|
|
447
|
+
new Promise((resolve) => this.fileStream.once("close", () => resolve(void 0))),
|
|
448
|
+
new Promise((resolve) => this.fileStream.once("error", () => resolve(void 0))),
|
|
450
449
|
(0, promises_1.setTimeout)(3e3)
|
|
451
450
|
]);
|
|
452
451
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intuned/runtime",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.22",
|
|
4
4
|
"description": "Intuned runtime",
|
|
5
5
|
"packageManager": "yarn@4.12.0",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -33,7 +33,6 @@
|
|
|
33
33
|
"intuned-auth-session-create": "vite-node ./src/commands/auth/run-create.ts",
|
|
34
34
|
"intuned-auth-session-load": "vite-node ./src/commands/auth/load.ts",
|
|
35
35
|
"intuned-ts-check": "yarn prepublishOnly && vite-node ./src/commands/ts-check.ts",
|
|
36
|
-
"intuned": "vite-node ./src/commands/intuned-cli/main.ts",
|
|
37
36
|
"intuned-get-headless-user-agent": "vite-node ./src/commands/get-headless-user-agent.ts",
|
|
38
37
|
"build": "rm -rf dist && tsc -p tsconfig.json && yarn copy-dts && babel src --out-dir dist --extensions '.ts' && tsup && cp -r ./src/common/assets dist/common/assets",
|
|
39
38
|
"test": "vitest run",
|
|
@@ -90,7 +89,7 @@
|
|
|
90
89
|
"prettier": "2.8.0",
|
|
91
90
|
"promptly": "3.2.0",
|
|
92
91
|
"prompts": "^2.4.2",
|
|
93
|
-
"rollup": "3.
|
|
92
|
+
"rollup": "3.30.0",
|
|
94
93
|
"smol-toml": "^1.4.2",
|
|
95
94
|
"source-map": "0.7.4",
|
|
96
95
|
"terminal-kit": "^3.1.2",
|
|
@@ -101,6 +100,7 @@
|
|
|
101
100
|
"typescript": "5.1.6",
|
|
102
101
|
"uuid": "11.1.0",
|
|
103
102
|
"wait-on": "7.2.0",
|
|
103
|
+
"which": "^6.0.1",
|
|
104
104
|
"yaml": "2.8.1",
|
|
105
105
|
"zod": "^3.21.4"
|
|
106
106
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const attemptCommand: import("commander").Command;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.attemptCommand = void 0;
|
|
7
|
-
var _command = require("./command");
|
|
8
|
-
const attemptCommand = exports.attemptCommand = _command.program.command("attempt").description("Execute an Intuned attempt");
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const attemptApiCommand: import("commander").Command;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.attemptApiCommand = void 0;
|
|
7
|
-
var _api = require("../controller/api");
|
|
8
|
-
var _controller = require("../controller");
|
|
9
|
-
var _zod = require("zod");
|
|
10
|
-
var _types = require("./types");
|
|
11
|
-
var _helpers = require("../helpers");
|
|
12
|
-
var _attempt = require("./attempt.command");
|
|
13
|
-
const argsSchema = _zod.z.tuple([_zod.z.string().min(1, "API name is required"), _zod.z.string().min(1, "Parameters are required")]);
|
|
14
|
-
const optionsSchema = _types.baseCommandOptionsSchema.extend({
|
|
15
|
-
authSession: _zod.z.string().optional(),
|
|
16
|
-
outputFile: _zod.z.string().optional()
|
|
17
|
-
});
|
|
18
|
-
const attemptApiCommand = exports.attemptApiCommand = (0, _types.withBaseOptions)(_attempt.attemptCommand.command("api").description("Execute an Intuned API attempt with parameters").argument("<api-name>", "Name of the API to run").argument("<parameters>", "Path to the JSON file containing API parameters OR the parameters as a JSON string").option("-a, --auth-session <id>", "ID of the AuthSession to use for the API. This is expected to be in ./auth-sessions-instances/<id>.json").option("-o, --output-file <path>", "output file path")).action((0, _helpers.cliCommandWrapper)(argsSchema, optionsSchema, async ([apiName, parameters], {
|
|
19
|
-
authSession,
|
|
20
|
-
...rest
|
|
21
|
-
}) => {
|
|
22
|
-
await (0, _helpers.assertAuthConsistent)(authSession);
|
|
23
|
-
const parametersData = await (0, _controller.loadParameters)(parameters);
|
|
24
|
-
await (0, _api.executeAttemptApiCLI)({
|
|
25
|
-
apiName,
|
|
26
|
-
inputData: parametersData,
|
|
27
|
-
authSessionId: authSession,
|
|
28
|
-
...rest
|
|
29
|
-
});
|
|
30
|
-
}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const attemptAuthSessionCommand: import("commander").Command;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.attemptAuthSessionCommand = void 0;
|
|
7
|
-
var _attempt = require("./attempt.command");
|
|
8
|
-
const attemptAuthSessionCommand = exports.attemptAuthSessionCommand = _attempt.attemptCommand.command("authsession").description("Manage AuthSessions");
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const attemptAuthSessionCheckCommand: import("commander").Command;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.attemptAuthSessionCheckCommand = void 0;
|
|
7
|
-
var _zod = require("zod");
|
|
8
|
-
var _authSession = require("../controller/authSession");
|
|
9
|
-
var _attempt_authsession = require("./attempt_authsession.command");
|
|
10
|
-
var _helpers = require("../helpers");
|
|
11
|
-
var _types = require("./types");
|
|
12
|
-
const argsSchema = _zod.z.tuple([_zod.z.string().min(1, "ID of the AuthSession is required")]);
|
|
13
|
-
const attemptAuthSessionCheckCommand = exports.attemptAuthSessionCheckCommand = (0, _types.withBaseOptions)(_attempt_authsession.attemptAuthSessionCommand.command("check").description("Check an existing AuthSession").argument("<id>", "ID of the AuthSession to check")).action((0, _helpers.cliCommandWrapper)(argsSchema, _types.baseCommandOptionsSchema, async ([id], options) => {
|
|
14
|
-
await (0, _helpers.assertAuthEnabled)();
|
|
15
|
-
await (0, _authSession.executeAttemptCheckAuthSessionCLI)({
|
|
16
|
-
id,
|
|
17
|
-
...options
|
|
18
|
-
});
|
|
19
|
-
}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const attemptAuthSessionCreateCommand: import("commander").Command;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.attemptAuthSessionCreateCommand = void 0;
|
|
7
|
-
var _controller = require("../controller");
|
|
8
|
-
var _zod = require("zod");
|
|
9
|
-
var _authSession = require("../controller/authSession");
|
|
10
|
-
var _attempt_authsession = require("./attempt_authsession.command");
|
|
11
|
-
var _helpers = require("../helpers");
|
|
12
|
-
var _types = require("./types");
|
|
13
|
-
const argsSchema = _zod.z.tuple([_zod.z.string().min(1, "Parameters are required")]);
|
|
14
|
-
const optionsSchema = _types.baseCommandOptionsSchema.extend({
|
|
15
|
-
id: _zod.z.string().optional()
|
|
16
|
-
});
|
|
17
|
-
const attemptAuthSessionCreateCommand = exports.attemptAuthSessionCreateCommand = (0, _types.withBaseOptions)(_attempt_authsession.attemptAuthSessionCommand.command("create").description("Create a new AuthSession").argument("<parameters>", "Parameters for the AuthSession command").option("--id <id>", "ID of the AuthSession to use for the command. Defaults to ./auth-sessions-instances/[current timestamp].json")).action((0, _helpers.cliCommandWrapper)(argsSchema, optionsSchema, async ([parameters], options) => {
|
|
18
|
-
await (0, _helpers.assertAuthEnabled)();
|
|
19
|
-
const authSessionInput = (await (0, _controller.loadParameters)(parameters)) ?? {};
|
|
20
|
-
await (0, _authSession.executeAttemptCreateAuthSessionCLI)({
|
|
21
|
-
input: authSessionInput,
|
|
22
|
-
...options
|
|
23
|
-
});
|
|
24
|
-
}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const authSessionCommand: import("commander").Command;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.authSessionCommand = void 0;
|
|
7
|
-
var _command = require("./command");
|
|
8
|
-
const authSessionCommand = exports.authSessionCommand = _command.program.command("authsession").description("Manage AuthSessions");
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const authSessionRecordCommand: import("commander").Command | null;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.authSessionRecordCommand = void 0;
|
|
7
|
-
var _zod = require("zod");
|
|
8
|
-
var _authSession = require("../controller/authSession");
|
|
9
|
-
var _helpers = require("../helpers");
|
|
10
|
-
var _authsession = require("./authsession.command");
|
|
11
|
-
var _run_authsession = require("./run_authsession.command");
|
|
12
|
-
var _types = require("./types");
|
|
13
|
-
const optionsSchema = _run_authsession.baseRunAuthSessionCommandOptionsSchema.extend({
|
|
14
|
-
id: _zod.z.string().optional()
|
|
15
|
-
});
|
|
16
|
-
const isAuthSessionRecorderEnabled = process.env.INTUNED_AUTH_SESSION_RECORDER_ENABLED === "true";
|
|
17
|
-
const authSessionRecordCommand = exports.authSessionRecordCommand = isAuthSessionRecorderEnabled ? (0, _types.withBaseOptions)(_authsession.authSessionCommand.command("record").description("Record a new AuthSession").option("--id <id>", "ID of the AuthSession to use for the command. Defaults to auth-session-[current timestamp]").option("--check-attempts <number>", "Number of attempts to check the AuthSession validity", "1")).action((0, _helpers.cliCommandWrapper)(undefined, optionsSchema, async (_, {
|
|
18
|
-
checkAttempts,
|
|
19
|
-
...rest
|
|
20
|
-
}) => {
|
|
21
|
-
await (0, _helpers.assertAuthEnabled)();
|
|
22
|
-
const {
|
|
23
|
-
startUrl,
|
|
24
|
-
finishUrl
|
|
25
|
-
} = await (0, _helpers.getAuthSessionRecorderParameters)();
|
|
26
|
-
await (0, _authSession.executeRecordAuthSessionCLI)({
|
|
27
|
-
checkRetries: checkAttempts,
|
|
28
|
-
startUrl,
|
|
29
|
-
finishUrl,
|
|
30
|
-
...rest
|
|
31
|
-
});
|
|
32
|
-
})) : null;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const authSessionScaffoldCommand: import("commander").Command;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.authSessionScaffoldCommand = void 0;
|
|
7
|
-
var _zod = require("zod");
|
|
8
|
-
var _helpers = require("../helpers");
|
|
9
|
-
var _authsession = require("./authsession.command");
|
|
10
|
-
var _types = require("./types");
|
|
11
|
-
var _scaffold = require("../controller/scaffold");
|
|
12
|
-
const optionsSchema = _zod.z.object({});
|
|
13
|
-
const authSessionScaffoldCommand = exports.authSessionScaffoldCommand = (0, _types.withBaseOptions)(_authsession.authSessionCommand.command("scaffold").description("Scaffold AuthSession files")).action((0, _helpers.cliCommandWrapper)(undefined, optionsSchema, async _ => {
|
|
14
|
-
await (0, _helpers.assertAuthEnabled)();
|
|
15
|
-
await (0, _scaffold.scaffoldAuthSessionFiles)();
|
|
16
|
-
}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const buildCommand: import("commander").Command;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.buildCommand = void 0;
|
|
7
|
-
var _command = require("./command");
|
|
8
|
-
var _build = require("../controller/build");
|
|
9
|
-
var _helpers = require("../helpers");
|
|
10
|
-
const buildCommand = exports.buildCommand = _command.program.command("build").description("Build Intuned project").action((0, _helpers.cliCommandWrapper)(undefined, undefined, async () => {
|
|
11
|
-
await (0, _build.runBuild)();
|
|
12
|
-
}));
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.program = void 0;
|
|
7
|
-
var _commander = require("commander");
|
|
8
|
-
const program = exports.program = new _commander.Command();
|
|
9
|
-
program.name("intuned").description("Intuned CLI for creating, developing and deploying Intuned projects").version("1.0.0").enablePositionalOptions(true);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const deployCommand: import("commander").Command;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.deployCommand = void 0;
|
|
7
|
-
var _command = require("./command");
|
|
8
|
-
var _dotenv = _interopRequireDefault(require("dotenv"));
|
|
9
|
-
var _provision = require("../controller/provision");
|
|
10
|
-
var _deploy = require("../controller/deploy");
|
|
11
|
-
var _helpers = require("../helpers");
|
|
12
|
-
var _provision2 = require("./provision.command");
|
|
13
|
-
var _prompts = require("../helpers/prompts");
|
|
14
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
-
_dotenv.default.config({
|
|
16
|
-
path: `.env`
|
|
17
|
-
});
|
|
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
|
-
const {
|
|
20
|
-
isValid,
|
|
21
|
-
errorMessage
|
|
22
|
-
} = await (0, _provision.validateIntunedProject)();
|
|
23
|
-
if (!isValid) {
|
|
24
|
-
const message = `^r^+Project to be deployed is not valid:^:^R ${errorMessage}:\n`;
|
|
25
|
-
throw new _helpers.CLIError(message, {
|
|
26
|
-
autoColor: false
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
const _projectName = projectName || (await (0, _helpers.loadIntunedJson)()).projectName || (await (0, _prompts.promptForProjectName)(name => {
|
|
30
|
-
const result = (0, _provision.validateProjectName)(name);
|
|
31
|
-
return result.isValid || result.errorMessage;
|
|
32
|
-
}));
|
|
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 by running 'intuned deploy <project-name>'.`);
|
|
35
|
-
}
|
|
36
|
-
const projectNameValidation = (0, _provision.validateProjectName)(_projectName);
|
|
37
|
-
if (!projectNameValidation.isValid) {
|
|
38
|
-
throw new _helpers.CLIError(`Invalid project name: ${projectNameValidation.errorMessage}`);
|
|
39
|
-
}
|
|
40
|
-
const auth = await (0, _helpers.getAuthCredentials)(options);
|
|
41
|
-
await (0, _deploy.runDeployProject)(_projectName, auth);
|
|
42
|
-
}));
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export * from "./command";
|
|
2
|
-
export * from "./build.command";
|
|
3
|
-
export * from "./deploy.command";
|
|
4
|
-
export * from "./provision.command";
|
|
5
|
-
export * from "./run.command";
|
|
6
|
-
export * from "./run_api.command";
|
|
7
|
-
export * from "./run_authsession.command";
|
|
8
|
-
export * from "./run_authsession_create.command";
|
|
9
|
-
export * from "./run_authsession_update.command";
|
|
10
|
-
export * from "./run_authsession_validate.command";
|
|
11
|
-
export * from "./attempt.command";
|
|
12
|
-
export * from "./attempt_api.command";
|
|
13
|
-
export * from "./attempt_authsession.command";
|
|
14
|
-
export * from "./attempt_authsession_create.command";
|
|
15
|
-
export * from "./attempt_authsession_check.command";
|
|
16
|
-
export * from "./authsession.command";
|
|
17
|
-
export * from "./authsession_record.command";
|
|
18
|
-
export * from "./authsession_scaffold.command";
|