@intuned/runtime-dev 1.3.14-ts-runtime-helpers-1 → 1.3.15-hook.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/WebTemplate.zip +0 -0
- package/dist/commands/intuned-cli/commands/run_authsession.command.d.ts +6 -6
- package/dist/commands/intuned-cli/commands/types.d.ts +2 -2
- package/dist/commands/intuned-cli/controller/authSession.d.ts +6 -6
- package/dist/commands/intuned-cli/helpers/auth.d.ts +1 -1
- package/dist/commands/intuned-cli/helpers/intunedJson.d.ts +1 -1
- package/dist/common/constants.d.ts +0 -2
- package/dist/common/constants.js +2 -4
- package/dist/common/{extension/extensionsHelpers.d.ts → extensionsHelpers.d.ts} +1 -1
- package/dist/common/{extension/extensionsHelpers.js → extensionsHelpers.js} +6 -62
- package/dist/common/intunedJson.d.ts +6 -6
- package/dist/common/launchBrowser.js +1 -3
- package/dist/common/playwrightContext.js +1 -1
- package/dist/common/runApi/index.js +0 -6
- package/dist/common/runApi/types.d.ts +20 -20
- package/dist/common/settingsSchema.d.ts +1 -15
- package/dist/common/settingsSchema.js +0 -1
- package/dist/common/setupContextHook.d.ts +2 -2
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -44
- package/dist/runtime/getAiGatewayConfig.d.ts +10 -0
- package/dist/runtime/getAiGatewayConfig.js +16 -0
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.js +7 -43
- package/package.json +3 -4
- package/dist/common/extension/intunedExtensionServer.d.ts +0 -25
- package/dist/common/extension/intunedExtensionServer.js +0 -164
- package/dist/common/extension/types.d.ts +0 -21
- package/dist/common/extension/types.js +0 -5
- package/dist/runtime/captcha.d.ts +0 -18
- package/dist/runtime/captcha.js +0 -190
- package/dist/runtime/captcha.test.js +0 -214
package/WebTemplate.zip
ADDED
|
Binary file
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
2
|
export declare const baseRunAuthSessionCommandOptionsSchema: import("zod").ZodObject<{
|
|
3
3
|
proxy: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4
|
-
trace: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
5
|
-
timeout: import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodDefault<import("zod").ZodString>, import("ms").StringValue, string | undefined>, number, string | undefined>;
|
|
6
4
|
headless: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
5
|
+
timeout: import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodDefault<import("zod").ZodString>, import("ms").StringValue, string | undefined>, number, string | undefined>;
|
|
7
6
|
keepBrowserOpen: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
8
7
|
cdpUrl: import("zod").ZodOptional<import("zod").ZodString>;
|
|
8
|
+
trace: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
9
9
|
checkAttempts: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
10
10
|
createAttempts: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
11
11
|
}, "strip", import("zod").ZodTypeAny, {
|
|
12
|
-
trace: boolean;
|
|
13
|
-
timeout: number;
|
|
14
12
|
headless: boolean;
|
|
13
|
+
timeout: number;
|
|
15
14
|
keepBrowserOpen: boolean;
|
|
15
|
+
trace: boolean;
|
|
16
16
|
checkAttempts: number;
|
|
17
17
|
createAttempts: number;
|
|
18
18
|
proxy?: string | undefined;
|
|
19
19
|
cdpUrl?: string | undefined;
|
|
20
20
|
}, {
|
|
21
21
|
proxy?: string | undefined;
|
|
22
|
-
trace?: boolean | undefined;
|
|
23
|
-
timeout?: string | undefined;
|
|
24
22
|
headless?: boolean | undefined;
|
|
23
|
+
timeout?: string | undefined;
|
|
25
24
|
keepBrowserOpen?: boolean | undefined;
|
|
26
25
|
cdpUrl?: string | undefined;
|
|
26
|
+
trace?: boolean | undefined;
|
|
27
27
|
checkAttempts?: number | undefined;
|
|
28
28
|
createAttempts?: number | undefined;
|
|
29
29
|
}>;
|
|
@@ -17,10 +17,10 @@ export declare const baseCommandOptionsSchema: z.ZodObject<{
|
|
|
17
17
|
keepBrowserOpen: z.ZodDefault<z.ZodBoolean>;
|
|
18
18
|
cdpUrl: z.ZodOptional<z.ZodString>;
|
|
19
19
|
}, "strip", z.ZodTypeAny, {
|
|
20
|
-
trace: boolean;
|
|
21
|
-
timeout: number;
|
|
22
20
|
headless: boolean;
|
|
21
|
+
timeout: number;
|
|
23
22
|
keepBrowserOpen: boolean;
|
|
23
|
+
trace: boolean;
|
|
24
24
|
proxy?: string | undefined;
|
|
25
25
|
cdpUrl?: string | undefined;
|
|
26
26
|
}, {
|
|
@@ -18,8 +18,8 @@ export declare function executeRunCreateAuthSessionCLI({ id, input, checkRetries
|
|
|
18
18
|
cookies: {
|
|
19
19
|
path: string;
|
|
20
20
|
value: string;
|
|
21
|
-
domain: string;
|
|
22
21
|
name: string;
|
|
22
|
+
domain: string;
|
|
23
23
|
expires: number;
|
|
24
24
|
httpOnly: boolean;
|
|
25
25
|
secure: boolean;
|
|
@@ -49,8 +49,8 @@ export declare function executeRunUpdateAuthSessionCLI({ id, input, checkRetries
|
|
|
49
49
|
cookies: {
|
|
50
50
|
path: string;
|
|
51
51
|
value: string;
|
|
52
|
-
domain: string;
|
|
53
52
|
name: string;
|
|
53
|
+
domain: string;
|
|
54
54
|
expires: number;
|
|
55
55
|
httpOnly: boolean;
|
|
56
56
|
secure: boolean;
|
|
@@ -78,8 +78,8 @@ export declare function executeAttemptCreateAuthSessionCLI({ id, input, ...rest
|
|
|
78
78
|
cookies: {
|
|
79
79
|
path: string;
|
|
80
80
|
value: string;
|
|
81
|
-
domain: string;
|
|
82
81
|
name: string;
|
|
82
|
+
domain: string;
|
|
83
83
|
expires: number;
|
|
84
84
|
httpOnly: boolean;
|
|
85
85
|
secure: boolean;
|
|
@@ -106,8 +106,8 @@ export declare function executeAttemptCheckAuthSessionCLI({ id, ...rest }: {
|
|
|
106
106
|
cookies: {
|
|
107
107
|
path: string;
|
|
108
108
|
value: string;
|
|
109
|
-
domain: string;
|
|
110
109
|
name: string;
|
|
110
|
+
domain: string;
|
|
111
111
|
expires: number;
|
|
112
112
|
httpOnly: boolean;
|
|
113
113
|
secure: boolean;
|
|
@@ -140,8 +140,8 @@ declare function runCreate({ authSessionInput, proxy, headless, timeout, traceId
|
|
|
140
140
|
cookies: {
|
|
141
141
|
path: string;
|
|
142
142
|
value: string;
|
|
143
|
-
domain: string;
|
|
144
143
|
name: string;
|
|
144
|
+
domain: string;
|
|
145
145
|
expires: number;
|
|
146
146
|
httpOnly: boolean;
|
|
147
147
|
secure: boolean;
|
|
@@ -177,8 +177,8 @@ declare function runCreateWithRetries({ authSessionId, authSessionInput, retries
|
|
|
177
177
|
cookies: {
|
|
178
178
|
path: string;
|
|
179
179
|
value: string;
|
|
180
|
-
domain: string;
|
|
181
180
|
name: string;
|
|
181
|
+
domain: string;
|
|
182
182
|
expires: number;
|
|
183
183
|
httpOnly: boolean;
|
|
184
184
|
secure: boolean;
|
|
@@ -8,5 +8,3 @@ export declare const API_KEY_ENV_VAR_KEY = "INTUNED_API_KEY";
|
|
|
8
8
|
export declare const API_KEY_HEADER_NAME = "x-api-key";
|
|
9
9
|
export declare const API_BASE_URL_ENV_VAR_KEY = "INTUNED_API_BASE_URL";
|
|
10
10
|
export declare const CLI_ENV_VAR_KEY = "INTUNED_CLI";
|
|
11
|
-
export declare const INTUNED_AI_GATEWAY_BASE_URL_ENV_VAR = "INTUNED_AI_GATEWAY_BASE_URL";
|
|
12
|
-
export declare const INTUNED_AI_GATEWAY_API_KEY_ENV_VAR = "INTUNED_AI_GATEWAY_API_KEY";
|
package/dist/common/constants.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.WORKSPACE_ID_ENV_VAR_KEY = exports.PROJECT_ID_ENV_VAR_KEY = exports.
|
|
6
|
+
exports.WORKSPACE_ID_ENV_VAR_KEY = exports.PROJECT_ID_ENV_VAR_KEY = exports.EXTENSION_PATH_ENV_VAR_KEY = exports.CLI_ENV_VAR_KEY = exports.AUTH_SESSIONS_INSTANCES_FOLDER_NAME = exports.AUTH_SESSIONS_FOLDER_NAME = exports.API_KEY_HEADER_NAME = exports.API_KEY_ENV_VAR_KEY = exports.API_FOLDER_NAME = exports.API_BASE_URL_ENV_VAR_KEY = void 0;
|
|
7
7
|
const API_FOLDER_NAME = exports.API_FOLDER_NAME = "api";
|
|
8
8
|
const AUTH_SESSIONS_FOLDER_NAME = exports.AUTH_SESSIONS_FOLDER_NAME = "auth-sessions";
|
|
9
9
|
const AUTH_SESSIONS_INSTANCES_FOLDER_NAME = exports.AUTH_SESSIONS_INSTANCES_FOLDER_NAME = "auth-sessions-instances";
|
|
@@ -13,6 +13,4 @@ const PROJECT_ID_ENV_VAR_KEY = exports.PROJECT_ID_ENV_VAR_KEY = "INTUNED_PROJECT
|
|
|
13
13
|
const API_KEY_ENV_VAR_KEY = exports.API_KEY_ENV_VAR_KEY = "INTUNED_API_KEY";
|
|
14
14
|
const API_KEY_HEADER_NAME = exports.API_KEY_HEADER_NAME = "x-api-key";
|
|
15
15
|
const API_BASE_URL_ENV_VAR_KEY = exports.API_BASE_URL_ENV_VAR_KEY = "INTUNED_API_BASE_URL";
|
|
16
|
-
const CLI_ENV_VAR_KEY = exports.CLI_ENV_VAR_KEY = "INTUNED_CLI";
|
|
17
|
-
const INTUNED_AI_GATEWAY_BASE_URL_ENV_VAR = exports.INTUNED_AI_GATEWAY_BASE_URL_ENV_VAR = "INTUNED_AI_GATEWAY_BASE_URL";
|
|
18
|
-
const INTUNED_AI_GATEWAY_API_KEY_ENV_VAR = exports.INTUNED_AI_GATEWAY_API_KEY_ENV_VAR = "INTUNED_AI_GATEWAY_API_KEY";
|
|
16
|
+
const CLI_ENV_VAR_KEY = exports.CLI_ENV_VAR_KEY = "INTUNED_CLI";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as playwright from "playwright";
|
|
2
|
-
import { CaptchaSolverSettingsWithRunContext } from "
|
|
2
|
+
import { CaptchaSolverSettingsWithRunContext } from "./settingsSchema";
|
|
3
3
|
export declare function buildExtensionsList(): string[];
|
|
4
4
|
export declare function getIntunedExtensionPath(): string;
|
|
5
5
|
export declare function isIntunedExtensionEnabled(): boolean;
|
|
@@ -9,42 +9,15 @@ exports.getIntunedExtensionSettings = getIntunedExtensionSettings;
|
|
|
9
9
|
exports.getIntunedExtensionWorker = getIntunedExtensionWorker;
|
|
10
10
|
exports.isIntunedExtensionEnabled = isIntunedExtensionEnabled;
|
|
11
11
|
exports.setupIntunedExtension = setupIntunedExtension;
|
|
12
|
-
var _settings = require("
|
|
13
|
-
var _settingsSchema = require("
|
|
14
|
-
var _constants = require("
|
|
15
|
-
var _jwtTokenManager = require("
|
|
12
|
+
var _settings = require("../commands/common/utils/settings");
|
|
13
|
+
var _settingsSchema = require("./settingsSchema");
|
|
14
|
+
var _constants = require("./constants");
|
|
15
|
+
var _jwtTokenManager = require("./jwtTokenManager");
|
|
16
16
|
var _path = _interopRequireDefault(require("path"));
|
|
17
17
|
var _promises = require("fs/promises");
|
|
18
|
-
var _intunedExtensionServer = require("./intunedExtensionServer");
|
|
19
|
-
var _nodeNet = _interopRequireDefault(require("node:net"));
|
|
20
18
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
21
19
|
const INTUNED_WORKER = "intunedWorker.js";
|
|
22
20
|
const INTUNED_EXTENSION_SETTINGS_FILE_NAME = "intunedSettings.json";
|
|
23
|
-
const INTUNED_CAPTCHA_EXTENSION_PORT_ENV_VAR = "INTUNED_CAPTCHA_EXTENSION_PORT";
|
|
24
|
-
function getIntunedCaptchaExtensionPortFromEnv() {
|
|
25
|
-
const raw = process.env[INTUNED_CAPTCHA_EXTENSION_PORT_ENV_VAR];
|
|
26
|
-
if (!raw) return null;
|
|
27
|
-
const parsed = Number(raw);
|
|
28
|
-
if (!Number.isFinite(parsed) || parsed <= 0 || parsed > 65535) {
|
|
29
|
-
throw new Error(`Invalid ${INTUNED_CAPTCHA_EXTENSION_PORT_ENV_VAR}: ${raw}`);
|
|
30
|
-
}
|
|
31
|
-
return parsed;
|
|
32
|
-
}
|
|
33
|
-
async function getFreeEphemeralPort() {
|
|
34
|
-
const server = _nodeNet.default.createServer();
|
|
35
|
-
server.unref();
|
|
36
|
-
await new Promise((resolve, reject) => {
|
|
37
|
-
server.once("error", reject);
|
|
38
|
-
server.listen(0, "127.0.0.1", () => resolve());
|
|
39
|
-
});
|
|
40
|
-
const address = server.address();
|
|
41
|
-
const port = typeof address === "object" && address && "port" in address ? address.port : null;
|
|
42
|
-
await new Promise(resolve => server.close(() => resolve()));
|
|
43
|
-
if (!port) {
|
|
44
|
-
throw new Error("Failed to allocate a free port for captcha extension");
|
|
45
|
-
}
|
|
46
|
-
return port;
|
|
47
|
-
}
|
|
48
21
|
function buildExtensionsList() {
|
|
49
22
|
const extensionsList = [];
|
|
50
23
|
if (isIntunedExtensionEnabled()) {
|
|
@@ -88,35 +61,12 @@ async function getIntunedExtensionSettings() {
|
|
|
88
61
|
const missingEnvVars = [domain && "FUNCTIONS_DOMAIN", workspaceId && _constants.WORKSPACE_ID_ENV_VAR_KEY, projectId && `INTUNED_INTEGRATION_ID OR ${_constants.PROJECT_ID_ENV_VAR_KEY}`];
|
|
89
62
|
throw new Error(`Missing required environment variables: ${missingEnvVars}`);
|
|
90
63
|
}
|
|
91
|
-
const authentication = (() => {
|
|
92
|
-
if (process.env.INTUNED_API_KEY) {
|
|
93
|
-
return {
|
|
94
|
-
type: "apiKey",
|
|
95
|
-
apiKey: process.env.INTUNED_API_KEY
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
if (process.env.INTUNED_BASIC_AUTH_USERNAME && process.env.INTUNED_BASIC_AUTH_PASSWORD) {
|
|
99
|
-
const credentials = `${process.env.INTUNED_BASIC_AUTH_USERNAME}:${process.env.INTUNED_BASIC_AUTH_PASSWORD}`;
|
|
100
|
-
const token = Buffer.from(credentials, "utf-8").toString("base64");
|
|
101
|
-
return {
|
|
102
|
-
type: "basic",
|
|
103
|
-
token
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
return {
|
|
107
|
-
type: "bearer",
|
|
108
|
-
token: _jwtTokenManager.backendFunctionsTokenManager.token
|
|
109
|
-
};
|
|
110
|
-
})();
|
|
111
|
-
const baseUrl = process.env.INTUNED_API_BASE_URL ?? domain;
|
|
112
|
-
const port = getIntunedCaptchaExtensionPortFromEnv() ?? (await getFreeEphemeralPort());
|
|
113
64
|
return {
|
|
114
65
|
...(settings.captchaSolver ?? _settingsSchema.captchaSolverSettingsSchema.parse({})),
|
|
115
66
|
workspaceId,
|
|
116
67
|
projectId,
|
|
117
|
-
baseUrl,
|
|
118
|
-
|
|
119
|
-
port
|
|
68
|
+
baseUrl: domain,
|
|
69
|
+
token: _jwtTokenManager.backendFunctionsTokenManager.token
|
|
120
70
|
};
|
|
121
71
|
}
|
|
122
72
|
async function setupIntunedExtension() {
|
|
@@ -126,11 +76,5 @@ async function setupIntunedExtension() {
|
|
|
126
76
|
const intunedExtensionPath = getIntunedExtensionPath();
|
|
127
77
|
const intunedExtensionSettingsPath = _path.default.join(intunedExtensionPath, INTUNED_EXTENSION_SETTINGS_FILE_NAME);
|
|
128
78
|
const settings = await getIntunedExtensionSettings();
|
|
129
|
-
if (!settings.enabled) {
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
await (0, _intunedExtensionServer.setupIntunedExtensionServer)({
|
|
133
|
-
port: settings.port ?? 9000
|
|
134
|
-
});
|
|
135
79
|
await (0, _promises.writeFile)(intunedExtensionSettingsPath, JSON.stringify(settings));
|
|
136
80
|
}
|
|
@@ -111,13 +111,13 @@ export declare const intunedJsonSchema: z.ZodIntersection<z.ZodObject<{
|
|
|
111
111
|
startUrl: z.ZodOptional<z.ZodString>;
|
|
112
112
|
finishUrl: z.ZodOptional<z.ZodString>;
|
|
113
113
|
}, "strip", z.ZodTypeAny, {
|
|
114
|
-
enabled: true;
|
|
115
114
|
type: "API" | "MANUAL";
|
|
115
|
+
enabled: true;
|
|
116
116
|
startUrl?: string | undefined;
|
|
117
117
|
finishUrl?: string | undefined;
|
|
118
118
|
}, {
|
|
119
|
-
enabled: true;
|
|
120
119
|
type: "API" | "MANUAL";
|
|
120
|
+
enabled: true;
|
|
121
121
|
startUrl?: string | undefined;
|
|
122
122
|
finishUrl?: string | undefined;
|
|
123
123
|
}>]>;
|
|
@@ -132,8 +132,8 @@ export declare const intunedJsonSchema: z.ZodIntersection<z.ZodObject<{
|
|
|
132
132
|
authSessions: {
|
|
133
133
|
enabled: false;
|
|
134
134
|
} | {
|
|
135
|
-
enabled: true;
|
|
136
135
|
type: "API" | "MANUAL";
|
|
136
|
+
enabled: true;
|
|
137
137
|
startUrl?: string | undefined;
|
|
138
138
|
finishUrl?: string | undefined;
|
|
139
139
|
};
|
|
@@ -144,8 +144,8 @@ export declare const intunedJsonSchema: z.ZodIntersection<z.ZodObject<{
|
|
|
144
144
|
authSessions: {
|
|
145
145
|
enabled: false;
|
|
146
146
|
} | {
|
|
147
|
-
enabled: true;
|
|
148
147
|
type: "API" | "MANUAL";
|
|
148
|
+
enabled: true;
|
|
149
149
|
startUrl?: string | undefined;
|
|
150
150
|
finishUrl?: string | undefined;
|
|
151
151
|
};
|
|
@@ -179,8 +179,8 @@ export declare function loadIntunedJson(): Promise<Err<never, string> | Ok<{
|
|
|
179
179
|
authSessions: {
|
|
180
180
|
enabled: false;
|
|
181
181
|
} | {
|
|
182
|
-
enabled: true;
|
|
183
182
|
type: "API" | "MANUAL";
|
|
183
|
+
enabled: true;
|
|
184
184
|
startUrl?: string | undefined;
|
|
185
185
|
finishUrl?: string | undefined;
|
|
186
186
|
};
|
|
@@ -218,8 +218,8 @@ export declare function loadIntunedJsonSync(): Err<never, string> | Ok<{
|
|
|
218
218
|
authSessions: {
|
|
219
219
|
enabled: false;
|
|
220
220
|
} | {
|
|
221
|
-
enabled: true;
|
|
222
221
|
type: "API" | "MANUAL";
|
|
222
|
+
enabled: true;
|
|
223
223
|
startUrl?: string | undefined;
|
|
224
224
|
finishUrl?: string | undefined;
|
|
225
225
|
};
|
|
@@ -14,8 +14,7 @@ var fs = _fsExtra;
|
|
|
14
14
|
var _path = require("path");
|
|
15
15
|
var _waitOn = _interopRequireDefault(require("wait-on"));
|
|
16
16
|
var _child_process = require("child_process");
|
|
17
|
-
var _extensionsHelpers = require("./
|
|
18
|
-
var _intunedExtensionServer = require("./extension/intunedExtensionServer");
|
|
17
|
+
var _extensionsHelpers = require("./extensionsHelpers");
|
|
19
18
|
var _util = require("util");
|
|
20
19
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
21
20
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
@@ -105,7 +104,6 @@ async function launchChromium(options) {
|
|
|
105
104
|
});
|
|
106
105
|
context.once("close", async () => {
|
|
107
106
|
try {
|
|
108
|
-
await (0, _intunedExtensionServer.cleanIntunedExtensionServer)();
|
|
109
107
|
await (0, _fsExtra.rm)(userDataDir, {
|
|
110
108
|
recursive: true,
|
|
111
109
|
force: true,
|
|
@@ -44,7 +44,6 @@ Object.keys(_types).forEach(function (key) {
|
|
|
44
44
|
var _formatZodError = require("../formatZodError");
|
|
45
45
|
var _cleanEnvironmentVariables = require("../cleanEnvironmentVariables");
|
|
46
46
|
var _importUsingImportFunction = require("./importUsingImportFunction");
|
|
47
|
-
var _jwtTokenManager = require("../jwtTokenManager");
|
|
48
47
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
49
48
|
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; }
|
|
50
49
|
function getObjectSizeInBytes(obj) {
|
|
@@ -54,10 +53,6 @@ function getObjectSizeInBytes(obj) {
|
|
|
54
53
|
return new TextEncoder().encode(String(obj)).length;
|
|
55
54
|
}
|
|
56
55
|
}
|
|
57
|
-
function injectRuntimeEnvVars() {
|
|
58
|
-
process.env[_constants.INTUNED_AI_GATEWAY_BASE_URL_ENV_VAR] = `${_jwtTokenManager.backendFunctionsTokenManager.backendFunctionsBaseUrl}/intuned-ai-gateway`;
|
|
59
|
-
process.env[_constants.INTUNED_AI_GATEWAY_API_KEY_ENV_VAR] = _jwtTokenManager.backendFunctionsTokenManager.token ?? process.env[_constants.API_KEY_ENV_VAR_KEY];
|
|
60
|
-
}
|
|
61
56
|
async function runApi({
|
|
62
57
|
abortSignal,
|
|
63
58
|
importFunction,
|
|
@@ -85,7 +80,6 @@ async function runApi({
|
|
|
85
80
|
resolve(abortSymbol);
|
|
86
81
|
});
|
|
87
82
|
});
|
|
88
|
-
injectRuntimeEnvVars();
|
|
89
83
|
async function runAutomation() {
|
|
90
84
|
const validatedModuleResult = await (0, _importUsingImportFunction.importUsingImportFunction)({
|
|
91
85
|
path: name,
|
|
@@ -38,8 +38,8 @@ export declare const runApiStorageStateSchema: z.ZodObject<{
|
|
|
38
38
|
}, "strip", z.ZodTypeAny, {
|
|
39
39
|
path: string;
|
|
40
40
|
value: string;
|
|
41
|
-
domain: string;
|
|
42
41
|
name: string;
|
|
42
|
+
domain: string;
|
|
43
43
|
expires: number;
|
|
44
44
|
httpOnly: boolean;
|
|
45
45
|
secure: boolean;
|
|
@@ -47,8 +47,8 @@ export declare const runApiStorageStateSchema: z.ZodObject<{
|
|
|
47
47
|
}, {
|
|
48
48
|
path: string;
|
|
49
49
|
value: string;
|
|
50
|
-
domain: string;
|
|
51
50
|
name: string;
|
|
51
|
+
domain: string;
|
|
52
52
|
expires: number;
|
|
53
53
|
httpOnly: boolean;
|
|
54
54
|
secure: boolean;
|
|
@@ -108,8 +108,8 @@ export declare const runApiStorageStateSchema: z.ZodObject<{
|
|
|
108
108
|
cookies: {
|
|
109
109
|
path: string;
|
|
110
110
|
value: string;
|
|
111
|
-
domain: string;
|
|
112
111
|
name: string;
|
|
112
|
+
domain: string;
|
|
113
113
|
expires: number;
|
|
114
114
|
httpOnly: boolean;
|
|
115
115
|
secure: boolean;
|
|
@@ -133,8 +133,8 @@ export declare const runApiStorageStateSchema: z.ZodObject<{
|
|
|
133
133
|
cookies: {
|
|
134
134
|
path: string;
|
|
135
135
|
value: string;
|
|
136
|
-
domain: string;
|
|
137
136
|
name: string;
|
|
137
|
+
domain: string;
|
|
138
138
|
expires: number;
|
|
139
139
|
httpOnly: boolean;
|
|
140
140
|
secure: boolean;
|
|
@@ -180,8 +180,8 @@ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
|
|
|
180
180
|
}, "strip", z.ZodTypeAny, {
|
|
181
181
|
path: string;
|
|
182
182
|
value: string;
|
|
183
|
-
domain: string;
|
|
184
183
|
name: string;
|
|
184
|
+
domain: string;
|
|
185
185
|
expires: number;
|
|
186
186
|
httpOnly: boolean;
|
|
187
187
|
secure: boolean;
|
|
@@ -189,8 +189,8 @@ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
|
|
|
189
189
|
}, {
|
|
190
190
|
path: string;
|
|
191
191
|
value: string;
|
|
192
|
-
domain: string;
|
|
193
192
|
name: string;
|
|
193
|
+
domain: string;
|
|
194
194
|
expires: number;
|
|
195
195
|
httpOnly: boolean;
|
|
196
196
|
secure: boolean;
|
|
@@ -250,8 +250,8 @@ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
|
|
|
250
250
|
cookies: {
|
|
251
251
|
path: string;
|
|
252
252
|
value: string;
|
|
253
|
-
domain: string;
|
|
254
253
|
name: string;
|
|
254
|
+
domain: string;
|
|
255
255
|
expires: number;
|
|
256
256
|
httpOnly: boolean;
|
|
257
257
|
secure: boolean;
|
|
@@ -275,8 +275,8 @@ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
|
|
|
275
275
|
cookies: {
|
|
276
276
|
path: string;
|
|
277
277
|
value: string;
|
|
278
|
-
domain: string;
|
|
279
278
|
name: string;
|
|
279
|
+
domain: string;
|
|
280
280
|
expires: number;
|
|
281
281
|
httpOnly: boolean;
|
|
282
282
|
secure: boolean;
|
|
@@ -303,8 +303,8 @@ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
|
|
|
303
303
|
cookies: {
|
|
304
304
|
path: string;
|
|
305
305
|
value: string;
|
|
306
|
-
domain: string;
|
|
307
306
|
name: string;
|
|
307
|
+
domain: string;
|
|
308
308
|
expires: number;
|
|
309
309
|
httpOnly: boolean;
|
|
310
310
|
secure: boolean;
|
|
@@ -331,8 +331,8 @@ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
|
|
|
331
331
|
cookies: {
|
|
332
332
|
path: string;
|
|
333
333
|
value: string;
|
|
334
|
-
domain: string;
|
|
335
334
|
name: string;
|
|
335
|
+
domain: string;
|
|
336
336
|
expires: number;
|
|
337
337
|
httpOnly: boolean;
|
|
338
338
|
secure: boolean;
|
|
@@ -406,8 +406,8 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
406
406
|
}, "strip", z.ZodTypeAny, {
|
|
407
407
|
path: string;
|
|
408
408
|
value: string;
|
|
409
|
-
domain: string;
|
|
410
409
|
name: string;
|
|
410
|
+
domain: string;
|
|
411
411
|
expires: number;
|
|
412
412
|
httpOnly: boolean;
|
|
413
413
|
secure: boolean;
|
|
@@ -415,8 +415,8 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
415
415
|
}, {
|
|
416
416
|
path: string;
|
|
417
417
|
value: string;
|
|
418
|
-
domain: string;
|
|
419
418
|
name: string;
|
|
419
|
+
domain: string;
|
|
420
420
|
expires: number;
|
|
421
421
|
httpOnly: boolean;
|
|
422
422
|
secure: boolean;
|
|
@@ -476,8 +476,8 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
476
476
|
cookies: {
|
|
477
477
|
path: string;
|
|
478
478
|
value: string;
|
|
479
|
-
domain: string;
|
|
480
479
|
name: string;
|
|
480
|
+
domain: string;
|
|
481
481
|
expires: number;
|
|
482
482
|
httpOnly: boolean;
|
|
483
483
|
secure: boolean;
|
|
@@ -501,8 +501,8 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
501
501
|
cookies: {
|
|
502
502
|
path: string;
|
|
503
503
|
value: string;
|
|
504
|
-
domain: string;
|
|
505
504
|
name: string;
|
|
505
|
+
domain: string;
|
|
506
506
|
expires: number;
|
|
507
507
|
httpOnly: boolean;
|
|
508
508
|
secure: boolean;
|
|
@@ -529,8 +529,8 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
529
529
|
cookies: {
|
|
530
530
|
path: string;
|
|
531
531
|
value: string;
|
|
532
|
-
domain: string;
|
|
533
532
|
name: string;
|
|
533
|
+
domain: string;
|
|
534
534
|
expires: number;
|
|
535
535
|
httpOnly: boolean;
|
|
536
536
|
secure: boolean;
|
|
@@ -557,8 +557,8 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
557
557
|
cookies: {
|
|
558
558
|
path: string;
|
|
559
559
|
value: string;
|
|
560
|
-
domain: string;
|
|
561
560
|
name: string;
|
|
561
|
+
domain: string;
|
|
562
562
|
expires: number;
|
|
563
563
|
httpOnly: boolean;
|
|
564
564
|
secure: boolean;
|
|
@@ -590,8 +590,8 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
590
590
|
cookies: {
|
|
591
591
|
path: string;
|
|
592
592
|
value: string;
|
|
593
|
-
domain: string;
|
|
594
593
|
name: string;
|
|
594
|
+
domain: string;
|
|
595
595
|
expires: number;
|
|
596
596
|
httpOnly: boolean;
|
|
597
597
|
secure: boolean;
|
|
@@ -623,8 +623,8 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
623
623
|
cookies: {
|
|
624
624
|
path: string;
|
|
625
625
|
value: string;
|
|
626
|
-
domain: string;
|
|
627
626
|
name: string;
|
|
627
|
+
domain: string;
|
|
628
628
|
expires: number;
|
|
629
629
|
httpOnly: boolean;
|
|
630
630
|
secure: boolean;
|
|
@@ -724,8 +724,8 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
724
724
|
cookies: {
|
|
725
725
|
path: string;
|
|
726
726
|
value: string;
|
|
727
|
-
domain: string;
|
|
728
727
|
name: string;
|
|
728
|
+
domain: string;
|
|
729
729
|
expires: number;
|
|
730
730
|
httpOnly: boolean;
|
|
731
731
|
secure: boolean;
|
|
@@ -769,8 +769,8 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
769
769
|
cookies: {
|
|
770
770
|
path: string;
|
|
771
771
|
value: string;
|
|
772
|
-
domain: string;
|
|
773
772
|
name: string;
|
|
773
|
+
domain: string;
|
|
774
774
|
expires: number;
|
|
775
775
|
httpOnly: boolean;
|
|
776
776
|
secure: boolean;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
2
|
export declare const captchaSolverSettingsSchema: z.ZodDefault<z.ZodObject<{
|
|
3
3
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
4
|
-
port: z.ZodOptional<z.ZodNumber>;
|
|
5
4
|
cloudflare: z.ZodOptional<z.ZodObject<{
|
|
6
5
|
enabled: z.ZodBoolean;
|
|
7
6
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -114,7 +113,6 @@ export declare const captchaSolverSettingsSchema: z.ZodDefault<z.ZodObject<{
|
|
|
114
113
|
maxRetries: number;
|
|
115
114
|
timeout: number;
|
|
116
115
|
};
|
|
117
|
-
port?: number | undefined;
|
|
118
116
|
cloudflare?: {
|
|
119
117
|
enabled: boolean;
|
|
120
118
|
} | undefined;
|
|
@@ -153,7 +151,6 @@ export declare const captchaSolverSettingsSchema: z.ZodDefault<z.ZodObject<{
|
|
|
153
151
|
} | undefined;
|
|
154
152
|
}, {
|
|
155
153
|
enabled?: boolean | undefined;
|
|
156
|
-
port?: number | undefined;
|
|
157
154
|
cloudflare?: {
|
|
158
155
|
enabled: boolean;
|
|
159
156
|
} | undefined;
|
|
@@ -201,13 +198,7 @@ export type CaptchaSolverSettingsWithRunContext = z.infer<typeof captchaSolverSe
|
|
|
201
198
|
workspaceId: string;
|
|
202
199
|
projectId: string;
|
|
203
200
|
baseUrl: string;
|
|
204
|
-
|
|
205
|
-
type: "apiKey";
|
|
206
|
-
apiKey: string;
|
|
207
|
-
} | {
|
|
208
|
-
type: "basic" | "bearer";
|
|
209
|
-
token?: string;
|
|
210
|
-
};
|
|
201
|
+
token?: string;
|
|
211
202
|
};
|
|
212
203
|
export declare const settingsSchema: z.ZodObject<{
|
|
213
204
|
authSessions: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
@@ -226,7 +217,6 @@ export declare const settingsSchema: z.ZodObject<{
|
|
|
226
217
|
}>>>;
|
|
227
218
|
captchaSolver: z.ZodOptional<z.ZodDefault<z.ZodObject<{
|
|
228
219
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
229
|
-
port: z.ZodOptional<z.ZodNumber>;
|
|
230
220
|
cloudflare: z.ZodOptional<z.ZodObject<{
|
|
231
221
|
enabled: z.ZodBoolean;
|
|
232
222
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -339,7 +329,6 @@ export declare const settingsSchema: z.ZodObject<{
|
|
|
339
329
|
maxRetries: number;
|
|
340
330
|
timeout: number;
|
|
341
331
|
};
|
|
342
|
-
port?: number | undefined;
|
|
343
332
|
cloudflare?: {
|
|
344
333
|
enabled: boolean;
|
|
345
334
|
} | undefined;
|
|
@@ -378,7 +367,6 @@ export declare const settingsSchema: z.ZodObject<{
|
|
|
378
367
|
} | undefined;
|
|
379
368
|
}, {
|
|
380
369
|
enabled?: boolean | undefined;
|
|
381
|
-
port?: number | undefined;
|
|
382
370
|
cloudflare?: {
|
|
383
371
|
enabled: boolean;
|
|
384
372
|
} | undefined;
|
|
@@ -437,7 +425,6 @@ export declare const settingsSchema: z.ZodObject<{
|
|
|
437
425
|
maxRetries: number;
|
|
438
426
|
timeout: number;
|
|
439
427
|
};
|
|
440
|
-
port?: number | undefined;
|
|
441
428
|
cloudflare?: {
|
|
442
429
|
enabled: boolean;
|
|
443
430
|
} | undefined;
|
|
@@ -484,7 +471,6 @@ export declare const settingsSchema: z.ZodObject<{
|
|
|
484
471
|
} | undefined;
|
|
485
472
|
captchaSolver?: {
|
|
486
473
|
enabled?: boolean | undefined;
|
|
487
|
-
port?: number | undefined;
|
|
488
474
|
cloudflare?: {
|
|
489
475
|
enabled: boolean;
|
|
490
476
|
} | undefined;
|
|
@@ -28,7 +28,6 @@ const captchaSolverSolveSettingsSchema = z.object({
|
|
|
28
28
|
});
|
|
29
29
|
const captchaSolverSettingsSchema = exports.captchaSolverSettingsSchema = z.object({
|
|
30
30
|
enabled: z.boolean().default(false),
|
|
31
|
-
port: z.number().int().min(1).max(65535).optional(),
|
|
32
31
|
cloudflare: baseCaptchaSchema.optional(),
|
|
33
32
|
googleRecaptchaV2: baseCaptchaSchema.optional(),
|
|
34
33
|
googleRecaptchaV3: baseCaptchaSchema.optional(),
|
|
@@ -8,8 +8,8 @@ export type InitializeContextHookOptions = {
|
|
|
8
8
|
cdpUrl: string;
|
|
9
9
|
};
|
|
10
10
|
export type SetupContextHook = (options: InitializeContextHookOptions) => Promise<{
|
|
11
|
-
page
|
|
12
|
-
context
|
|
11
|
+
page?: playwright.Page;
|
|
12
|
+
context?: playwright.BrowserContext;
|
|
13
13
|
cleanup?: () => Promise<void>;
|
|
14
14
|
} | null>;
|
|
15
15
|
export declare function loadSetupContextHook({ importFunction, }: {
|
package/dist/index.d.ts
CHANGED
|
@@ -2,4 +2,3 @@ export { extendPayload, extendTimeout, runInfo, RunError, getAuthSessionParamete
|
|
|
2
2
|
export { runWithContext, getExecutionContext, } from "./common/asyncLocalStorage";
|
|
3
3
|
export { getDownloadDirectoryPath } from "./runtime/downloadDirectory";
|
|
4
4
|
export { withPlaywrightContext } from "./common/playwrightContext";
|
|
5
|
-
export { waitForCaptchaSolve, withWaitForCaptchaSolve, onCaptchaEvent, onceCaptchaEvent, removeCaptchaEventListener, pauseCaptchaSolver, resumeCaptchaSolver, } from "./runtime/captcha";
|