@intuned/runtime-dev 1.3.18-dev.6 → 1.3.18-dev.8
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/dist/commands/intuned-cli/commands/run_authsession.command.d.ts +2 -2
- package/dist/commands/intuned-cli/commands/types.d.ts +3 -3
- package/dist/commands/intuned-cli/commands/types.js +1 -1
- package/dist/commands/intuned-cli/helpers/browser.js +2 -0
- package/dist/common/launchBrowser.js +15 -2
- package/package.json +1 -1
|
@@ -7,19 +7,19 @@ export declare const baseRunAuthSessionCommandOptionsSchema: import("zod").ZodOb
|
|
|
7
7
|
keepBrowserOpen: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
8
8
|
cdpUrl: import("zod").ZodOptional<import("zod").ZodString>;
|
|
9
9
|
cdpTabId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
10
|
-
ignoreHttpErrors: import("zod").
|
|
10
|
+
ignoreHttpErrors: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
11
11
|
} & {
|
|
12
12
|
checkAttempts: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
13
13
|
createAttempts: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
14
14
|
}, "strip", import("zod").ZodTypeAny, {
|
|
15
15
|
timeout: number;
|
|
16
|
-
ignoreHttpErrors: boolean;
|
|
17
16
|
trace: boolean;
|
|
18
17
|
headless: boolean;
|
|
19
18
|
keepBrowserOpen: boolean;
|
|
20
19
|
checkAttempts: number;
|
|
21
20
|
createAttempts: number;
|
|
22
21
|
proxy?: string | undefined;
|
|
22
|
+
ignoreHttpErrors?: boolean | undefined;
|
|
23
23
|
cdpUrl?: string | undefined;
|
|
24
24
|
cdpTabId?: string | undefined;
|
|
25
25
|
}, {
|
|
@@ -10,7 +10,7 @@ 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
12
|
export declare const cdpTabIdSchema: z.ZodOptional<z.ZodString>;
|
|
13
|
-
export declare const ignoreHttpErrorsSchema: z.
|
|
13
|
+
export declare const ignoreHttpErrorsSchema: z.ZodOptional<z.ZodBoolean>;
|
|
14
14
|
export declare const baseCommandOptionsSchema: z.ZodObject<{
|
|
15
15
|
proxy: z.ZodOptional<z.ZodString>;
|
|
16
16
|
timeout: z.ZodEffects<z.ZodEffects<z.ZodDefault<z.ZodString>, ms.StringValue, string | undefined>, number, string | undefined>;
|
|
@@ -19,14 +19,14 @@ export declare const baseCommandOptionsSchema: z.ZodObject<{
|
|
|
19
19
|
keepBrowserOpen: z.ZodDefault<z.ZodBoolean>;
|
|
20
20
|
cdpUrl: z.ZodOptional<z.ZodString>;
|
|
21
21
|
cdpTabId: z.ZodOptional<z.ZodString>;
|
|
22
|
-
ignoreHttpErrors: z.
|
|
22
|
+
ignoreHttpErrors: z.ZodOptional<z.ZodBoolean>;
|
|
23
23
|
}, "strip", z.ZodTypeAny, {
|
|
24
24
|
timeout: number;
|
|
25
|
-
ignoreHttpErrors: boolean;
|
|
26
25
|
trace: boolean;
|
|
27
26
|
headless: boolean;
|
|
28
27
|
keepBrowserOpen: boolean;
|
|
29
28
|
proxy?: string | undefined;
|
|
29
|
+
ignoreHttpErrors?: boolean | undefined;
|
|
30
30
|
cdpUrl?: string | undefined;
|
|
31
31
|
cdpTabId?: string | undefined;
|
|
32
32
|
}, {
|
|
@@ -19,7 +19,7 @@ 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
21
|
const cdpTabIdSchema = exports.cdpTabIdSchema = _zod.z.string().min(1).optional();
|
|
22
|
-
const ignoreHttpErrorsSchema = exports.ignoreHttpErrorsSchema = _zod.z.boolean().
|
|
22
|
+
const ignoreHttpErrorsSchema = exports.ignoreHttpErrorsSchema = _zod.z.boolean().optional();
|
|
23
23
|
const baseCommandOptionsSchema = exports.baseCommandOptionsSchema = _zod.z.object({
|
|
24
24
|
proxy: proxySchema,
|
|
25
25
|
timeout: timeoutSchema,
|
|
@@ -30,7 +30,9 @@ async function getCLIRunOptions({
|
|
|
30
30
|
if (context) {
|
|
31
31
|
await closeCliBrowser();
|
|
32
32
|
}
|
|
33
|
+
console.log(`[ignore_http_errors] getCLIRunOptions: CLI flag=${cliIgnoreHttpErrors}`);
|
|
33
34
|
const ignoreHttpErrors = await (0, _launchBrowser.getIgnoreHttpErrorsFromConfig)(cliIgnoreHttpErrors);
|
|
35
|
+
console.log(`[ignore_http_errors] getCLIRunOptions: resolved=${ignoreHttpErrors}`);
|
|
34
36
|
if (cdpUrl) {
|
|
35
37
|
return {
|
|
36
38
|
environment: "cdp",
|
|
@@ -22,6 +22,7 @@ var _util = require("util");
|
|
|
22
22
|
var _neverthrow = require("neverthrow");
|
|
23
23
|
var _zod = require("zod");
|
|
24
24
|
var _intunedJson = require("./intunedJson");
|
|
25
|
+
var _env = require("./env");
|
|
25
26
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
26
27
|
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); }
|
|
27
28
|
const execAsync = (0, _util.promisify)(_child_process.exec);
|
|
@@ -41,19 +42,25 @@ async function createUserDirWithPreferences() {
|
|
|
41
42
|
return userDir;
|
|
42
43
|
}
|
|
43
44
|
async function getIgnoreHttpErrorsFromConfig(cliOption) {
|
|
45
|
+
console.log(`[ignore_http_errors] getIgnoreHttpErrorsFromConfig: cliOption=${cliOption}`);
|
|
44
46
|
if (cliOption !== undefined) {
|
|
47
|
+
console.log(`[ignore_http_errors] getIgnoreHttpErrorsFromConfig: using CLI option=${cliOption}`);
|
|
45
48
|
return cliOption;
|
|
46
49
|
}
|
|
47
50
|
try {
|
|
48
51
|
const intunedJsonResult = await (0, _intunedJson.loadIntunedJson)();
|
|
49
52
|
if (intunedJsonResult.isOk() && intunedJsonResult.value.ignoreHttpErrors !== undefined) {
|
|
53
|
+
console.log(`[ignore_http_errors] getIgnoreHttpErrorsFromConfig: using intuned.json=${intunedJsonResult.value.ignoreHttpErrors}`);
|
|
50
54
|
return intunedJsonResult.value.ignoreHttpErrors;
|
|
51
55
|
}
|
|
52
56
|
} catch (error) {}
|
|
53
57
|
const envValue = process.env.IGNORE_HTTP_ERRORS;
|
|
54
58
|
if (envValue !== undefined) {
|
|
55
|
-
|
|
59
|
+
const result = envValue.toLowerCase() === "true" || envValue === "1" || envValue.toLowerCase() === "yes";
|
|
60
|
+
console.log(`[ignore_http_errors] getIgnoreHttpErrorsFromConfig: using env var IGNORE_HTTP_ERRORS=${envValue}, parsed=${result}`);
|
|
61
|
+
return result;
|
|
56
62
|
}
|
|
63
|
+
console.log(`[ignore_http_errors] getIgnoreHttpErrorsFromConfig: using default=false`);
|
|
57
64
|
return false;
|
|
58
65
|
}
|
|
59
66
|
async function launchChromium(options) {
|
|
@@ -99,7 +106,13 @@ async function launchChromium(options) {
|
|
|
99
106
|
let {
|
|
100
107
|
executablePath
|
|
101
108
|
} = options;
|
|
102
|
-
const
|
|
109
|
+
const envIgnoreHttpErrors = (0, _env.getIgnoreHttpErrors)();
|
|
110
|
+
console.log(`[ignore_http_errors] launchChromium: param=${ignoreHttpErrorsParam}, env=${envIgnoreHttpErrors}`);
|
|
111
|
+
let ignoreHttpErrors = ignoreHttpErrorsParam;
|
|
112
|
+
if (envIgnoreHttpErrors === true && ignoreHttpErrors === undefined) {
|
|
113
|
+
ignoreHttpErrors = true;
|
|
114
|
+
}
|
|
115
|
+
console.log(`[ignore_http_errors] launchChromium: final=${ignoreHttpErrors}`);
|
|
103
116
|
const defaultArgsToIgnore = ["--disable-extensions", "--disable-component-extensions-with-background-pages", "--disable-background-networking", "--disable-backgrounding-occluded-windows", "--disable-background-timer-throttling"];
|
|
104
117
|
const extraArgs = [];
|
|
105
118
|
const userDataDir = await createUserDirWithPreferences();
|