@intuned/runtime-dev 1.3.18-interface.13 → 1.3.18-interface.16
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 +27 -0
- package/.claude/settings.local.json +7 -0
- package/.eslintignore +10 -0
- package/.eslintrc.js +39 -0
- package/InterfaceTemplate/__utils.ts +3 -1
- package/WebTemplate.zip +0 -0
- package/dist/commands/api/run.d.ts +1 -3
- package/dist/commands/api/run.js +64 -2039
- package/dist/commands/auth-sessions/load.d.ts +1 -0
- package/dist/commands/auth-sessions/load.js +28 -1552
- package/dist/commands/auth-sessions/run-check.d.ts +1 -0
- package/dist/commands/auth-sessions/run-check.js +71 -1961
- package/dist/commands/auth-sessions/run-create.d.ts +1 -0
- package/dist/commands/auth-sessions/run-create.js +65 -1955
- package/dist/commands/browser/save-state.d.ts +1 -0
- package/dist/commands/browser/save-state.js +11 -102
- package/dist/commands/browser/start-browser.d.ts +1 -0
- package/dist/commands/browser/start-browser.js +9 -62
- package/dist/commands/build.d.ts +1 -2
- package/dist/commands/build.js +52 -172
- package/dist/commands/common/browserUtils.d.ts +14 -0
- package/dist/commands/common/browserUtils.js +57 -0
- package/dist/commands/common/getFirstLineNumber.d.ts +9 -0
- package/dist/commands/common/getFirstLineNumber.js +101 -0
- package/dist/commands/common/getFirstLineNumber.test.js +227 -0
- package/dist/commands/common/projectExclusions.d.ts +2 -0
- package/dist/commands/common/projectExclusions.js +8 -0
- package/dist/commands/common/sendMessageToClient.d.ts +1 -0
- package/dist/commands/common/sendMessageToClient.js +10 -0
- package/dist/commands/common/tsNodeImport.d.ts +2 -5
- package/dist/commands/common/tsNodeImport.js +15 -55
- package/dist/commands/common/utils/fileUtils.d.ts +6 -0
- package/dist/commands/common/utils/fileUtils.js +32 -0
- package/dist/commands/common/utils/interfaceClient.d.ts +31 -0
- package/dist/commands/common/utils/interfaceClient.js +98 -0
- package/dist/commands/common/utils/settings.d.ts +2 -0
- package/dist/commands/common/utils/settings.js +31 -0
- package/dist/commands/common/utils/template.d.ts +2 -0
- package/dist/commands/common/utils/template.js +30 -0
- package/dist/commands/get-headless-user-agent.d.ts +1 -2
- package/dist/commands/get-headless-user-agent.js +12 -348
- package/dist/commands/interface/pingPong.d.ts +2 -0
- package/dist/commands/interface/pingPong.js +11 -0
- package/dist/commands/interface/run.d.ts +1 -3
- package/dist/commands/interface/run.js +139 -2034
- package/dist/commands/interface/runApi.d.ts +1 -0
- package/dist/commands/interface/runApi.js +102 -0
- package/dist/commands/intuned-cli/commands/attempt.command.d.ts +1 -0
- package/dist/commands/intuned-cli/commands/attempt.command.js +8 -0
- package/dist/commands/intuned-cli/commands/attempt_api.command.d.ts +1 -0
- package/dist/commands/intuned-cli/commands/attempt_api.command.js +30 -0
- package/dist/commands/intuned-cli/commands/attempt_authsession.command.d.ts +1 -0
- package/dist/commands/intuned-cli/commands/attempt_authsession.command.js +8 -0
- package/dist/commands/intuned-cli/commands/attempt_authsession_check.command.d.ts +1 -0
- package/dist/commands/intuned-cli/commands/attempt_authsession_check.command.js +19 -0
- package/dist/commands/intuned-cli/commands/attempt_authsession_create.command.d.ts +1 -0
- package/dist/commands/intuned-cli/commands/attempt_authsession_create.command.js +24 -0
- package/dist/commands/intuned-cli/commands/authsession.command.d.ts +1 -0
- package/dist/commands/intuned-cli/commands/authsession.command.js +8 -0
- package/dist/commands/intuned-cli/commands/authsession_record.command.d.ts +1 -0
- package/dist/commands/intuned-cli/commands/authsession_record.command.js +32 -0
- package/dist/commands/intuned-cli/commands/authsession_scaffold.command.d.ts +1 -0
- package/dist/commands/intuned-cli/commands/authsession_scaffold.command.js +16 -0
- package/dist/commands/intuned-cli/commands/build.command.d.ts +1 -0
- package/dist/commands/intuned-cli/commands/build.command.js +12 -0
- package/dist/commands/intuned-cli/commands/command.d.ts +2 -0
- package/dist/commands/intuned-cli/commands/command.js +9 -0
- package/dist/commands/intuned-cli/commands/deploy.command.d.ts +1 -0
- package/dist/commands/intuned-cli/commands/deploy.command.js +42 -0
- package/dist/commands/intuned-cli/commands/index.d.ts +18 -0
- package/dist/commands/intuned-cli/commands/index.js +203 -0
- package/dist/commands/intuned-cli/commands/provision.command.d.ts +13 -0
- package/dist/commands/intuned-cli/commands/provision.command.js +50 -0
- package/dist/commands/intuned-cli/commands/run.command.d.ts +1 -0
- package/dist/commands/intuned-cli/commands/run.command.js +8 -0
- package/dist/commands/intuned-cli/commands/run_api.command.d.ts +1 -0
- package/dist/commands/intuned-cli/commands/run_api.command.js +46 -0
- package/dist/commands/intuned-cli/commands/run_authsession.command.d.ts +35 -0
- package/dist/commands/intuned-cli/commands/run_authsession.command.js +17 -0
- package/dist/commands/intuned-cli/commands/run_authsession_create.command.d.ts +1 -0
- package/dist/commands/intuned-cli/commands/run_authsession_create.command.js +35 -0
- package/dist/commands/intuned-cli/commands/run_authsession_update.command.d.ts +1 -0
- package/dist/commands/intuned-cli/commands/run_authsession_update.command.js +35 -0
- package/dist/commands/intuned-cli/commands/run_authsession_validate.command.d.ts +1 -0
- package/dist/commands/intuned-cli/commands/run_authsession_validate.command.js +33 -0
- package/dist/commands/intuned-cli/commands/types.d.ts +39 -0
- package/dist/commands/intuned-cli/commands/types.js +33 -0
- package/dist/commands/intuned-cli/constants/index.d.ts +17 -0
- package/dist/commands/intuned-cli/constants/index.js +25 -0
- package/dist/commands/intuned-cli/controller/__test__/api.test.js +398 -0
- package/dist/commands/intuned-cli/controller/__test__/authSession.test.js +1060 -0
- package/dist/commands/intuned-cli/controller/api.d.ts +42 -0
- package/dist/commands/intuned-cli/controller/api.js +194 -0
- package/dist/commands/intuned-cli/controller/authSession.d.ts +209 -0
- package/dist/commands/intuned-cli/controller/authSession.js +425 -0
- package/dist/commands/intuned-cli/controller/build.d.ts +1 -0
- package/dist/commands/intuned-cli/controller/build.js +35 -0
- package/dist/commands/intuned-cli/controller/deploy.d.ts +5 -0
- package/dist/commands/intuned-cli/controller/deploy.js +317 -0
- package/dist/commands/intuned-cli/controller/index.d.ts +1 -0
- package/dist/commands/intuned-cli/controller/index.js +45 -0
- package/dist/commands/intuned-cli/controller/provision.d.ts +21 -0
- package/dist/commands/intuned-cli/controller/provision.js +299 -0
- package/dist/commands/intuned-cli/controller/scaffold.d.ts +1 -0
- package/dist/commands/intuned-cli/controller/scaffold.js +77 -0
- package/dist/commands/intuned-cli/helpers/__test__/browser.test.js +152 -0
- package/dist/commands/intuned-cli/helpers/__test__/tracing.test.js +41 -0
- package/dist/commands/intuned-cli/helpers/api.d.ts +3 -0
- package/dist/commands/intuned-cli/helpers/api.js +16 -0
- package/dist/commands/intuned-cli/helpers/auth.d.ts +46 -0
- package/dist/commands/intuned-cli/helpers/auth.js +147 -0
- package/dist/commands/intuned-cli/helpers/backend.d.ts +8 -0
- package/dist/commands/intuned-cli/helpers/backend.js +35 -0
- package/dist/commands/intuned-cli/helpers/browser.d.ts +14 -0
- package/dist/commands/intuned-cli/helpers/browser.js +93 -0
- package/dist/commands/intuned-cli/helpers/context.d.ts +3 -0
- package/dist/commands/intuned-cli/helpers/context.js +33 -0
- package/dist/commands/intuned-cli/helpers/errors.d.ts +16 -0
- package/dist/commands/intuned-cli/helpers/errors.js +44 -0
- package/dist/commands/intuned-cli/helpers/index.d.ts +12 -0
- package/dist/commands/intuned-cli/helpers/index.js +137 -0
- package/dist/commands/intuned-cli/helpers/intunedJson.d.ts +39 -0
- package/dist/commands/intuned-cli/helpers/intunedJson.js +20 -0
- package/dist/commands/intuned-cli/helpers/prompts.d.ts +3 -0
- package/dist/commands/intuned-cli/helpers/prompts.js +71 -0
- package/dist/commands/intuned-cli/helpers/proxy.d.ts +5 -0
- package/dist/commands/intuned-cli/helpers/proxy.js +23 -0
- package/dist/commands/intuned-cli/helpers/terminal.d.ts +5 -0
- package/dist/commands/intuned-cli/helpers/terminal.js +13 -0
- package/dist/commands/intuned-cli/helpers/timeout.d.ts +1 -0
- package/dist/commands/intuned-cli/helpers/timeout.js +23 -0
- package/dist/commands/intuned-cli/helpers/traces.d.ts +2 -0
- package/dist/commands/intuned-cli/helpers/traces.js +32 -0
- package/dist/commands/intuned-cli/helpers/validation.d.ts +2 -0
- package/dist/commands/intuned-cli/helpers/validation.js +14 -0
- package/dist/commands/intuned-cli/helpers/wrapper.d.ts +2 -0
- package/dist/commands/intuned-cli/helpers/wrapper.js +76 -0
- package/dist/commands/intuned-cli/index.d.ts +1 -0
- package/dist/commands/intuned-cli/index.js +16 -0
- package/dist/commands/intuned-cli/main.d.ts +1 -2
- package/dist/commands/intuned-cli/main.js +24 -5392
- package/dist/commands/intuned-cli/types.d.ts +70 -0
- package/dist/commands/intuned-cli/types.js +22 -0
- package/dist/commands/ts-check.d.ts +1 -0
- package/dist/commands/ts-check.js +28 -131
- package/dist/common/Logger/Logger/index.d.ts +12 -0
- package/dist/common/Logger/Logger/index.js +60 -0
- package/dist/common/Logger/Logger/types.d.ts +8 -0
- package/dist/common/Logger/Logger/types.js +5 -0
- package/dist/common/Logger/index.d.ts +12 -0
- package/dist/common/Logger/index.js +60 -0
- package/dist/common/Logger/types.d.ts +8 -0
- package/dist/common/Logger/types.js +5 -0
- package/dist/common/asyncLocalStorage/index.d.ts +8 -9
- package/dist/common/asyncLocalStorage/index.js +9 -33
- package/dist/common/backendFunctions/getAuthSessionParameters.d.ts +1 -0
- package/dist/common/backendFunctions/getAuthSessionParameters.js +38 -0
- package/dist/common/binStartupScript.d.ts +1 -2
- package/dist/common/binStartupScript.js +10 -126
- package/dist/common/browserTabs.d.ts +72 -0
- package/dist/common/browserTabs.js +74 -0
- package/dist/common/cleanEnvironmentVariables.d.ts +1 -3
- package/dist/common/cleanEnvironmentVariables.js +7 -29
- package/dist/common/constants.d.ts +11 -13
- package/dist/common/constants.js +15 -57
- package/dist/common/contextStorageStateHelpers.d.ts +6 -8
- package/dist/common/contextStorageStateHelpers.js +22 -46
- package/dist/common/extension/extensionsHelpers.d.ts +11 -0
- package/dist/common/extension/extensionsHelpers.js +147 -0
- package/dist/common/extension/intunedExtensionServer.d.ts +24 -0
- package/dist/common/extension/intunedExtensionServer.js +178 -0
- package/dist/common/extension/types.d.ts +219 -0
- package/dist/common/extension/types.js +51 -0
- package/dist/common/formatZodError.d.ts +2 -0
- package/dist/common/formatZodError.js +18 -0
- package/dist/common/intunedJson.d.ts +229 -0
- package/dist/common/intunedJson.js +132 -0
- package/dist/common/jwtTokenManager.d.ts +4 -6
- package/dist/common/jwtTokenManager.js +40 -107
- package/dist/common/launchBrowser.d.ts +34 -0
- package/dist/common/launchBrowser.js +247 -0
- package/dist/common/playwrightContext.d.ts +29 -0
- package/dist/common/playwrightContext.js +148 -0
- package/dist/common/runApi/importUsingImportFunction.d.ts +7 -0
- package/dist/common/runApi/importUsingImportFunction.js +46 -0
- package/dist/common/runApi/index.d.ts +6 -9
- package/dist/common/runApi/index.js +70 -1765
- package/dist/common/settingsSchema.d.ts +6 -9
- package/dist/common/settingsSchema.js +18 -53
- package/dist/common/setupContextHook.d.ts +16 -0
- package/dist/common/setupContextHook.js +22 -0
- package/dist/common/telemetry.d.ts +3 -6
- package/dist/common/telemetry.js +8 -40
- package/dist/index.d.ts +4 -6
- package/dist/index.js +92 -783
- package/dist/runtime/RunError.d.ts +5 -0
- package/dist/runtime/RunError.js +19 -0
- package/dist/runtime/attemptStore.d.ts +2 -0
- package/dist/runtime/attemptStore.js +23 -0
- package/dist/runtime/captcha.d.ts +15 -0
- package/dist/runtime/captcha.js +191 -0
- package/dist/runtime/captcha.test.js +821 -0
- package/dist/runtime/downloadDirectory.d.ts +1 -0
- package/dist/runtime/downloadDirectory.js +19 -0
- package/dist/runtime/enums.d.js +5 -0
- package/dist/runtime/enums.d.ts +11 -0
- package/dist/runtime/enums.js +18 -0
- package/dist/runtime/executionHelpers.test.js +52 -0
- package/dist/runtime/export.d.js +5 -0
- package/dist/runtime/export.d.ts +284 -0
- package/dist/runtime/extendPayload.d.ts +2 -0
- package/dist/runtime/extendPayload.js +21 -0
- package/dist/runtime/extendTimeout.d.ts +1 -0
- package/dist/runtime/extendTimeout.js +23 -0
- package/dist/runtime/getAiGatewayConfig.d.ts +10 -0
- package/dist/runtime/getAiGatewayConfig.js +16 -0
- package/dist/runtime/getAuthSessionParameters.d.ts +1 -0
- package/dist/runtime/getAuthSessionParameters.js +20 -0
- package/dist/runtime/index.d.ts +10 -168
- package/dist/runtime/index.js +88 -778
- package/dist/runtime/persistentStore.d.ts +2 -0
- package/dist/runtime/persistentStore.js +37 -0
- package/dist/runtime/persistentStore.test.js +101 -0
- package/dist/runtime/runInfo.d.ts +2 -0
- package/dist/runtime/runInfo.js +21 -0
- package/dist/vendor/runtime-interface.d.ts +1 -0
- package/dist/vendor/runtime-interface.js +474 -0
- package/package.json +18 -72
- package/template.tsconfig.json +11 -0
- package/tsconfig.eslint.json +5 -0
- package/tsconfig.json +25 -0
- package/tsup.config.ts +11 -0
- package/typedoc.json +49 -0
- package/dist/export.d-BAUMB-lG.d.ts +0 -140
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import * as z from
|
|
2
|
-
|
|
3
|
-
declare const captchaSolverSettingsSchema: z.ZodDefault<z.ZodObject<{
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
export declare const captchaSolverSettingsSchema: z.ZodDefault<z.ZodObject<{
|
|
4
3
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
5
4
|
port: z.ZodOptional<z.ZodNumber>;
|
|
6
5
|
cloudflare: z.ZodOptional<z.ZodObject<{
|
|
@@ -200,8 +199,8 @@ declare const captchaSolverSettingsSchema: z.ZodDefault<z.ZodObject<{
|
|
|
200
199
|
timeout?: number | undefined;
|
|
201
200
|
} | undefined;
|
|
202
201
|
}>>;
|
|
203
|
-
type CaptchaSolverSettings = z.infer<typeof captchaSolverSettingsSchema>;
|
|
204
|
-
type CaptchaSolverSettingsWithRunContext = CaptchaSolverSettings & {
|
|
202
|
+
export type CaptchaSolverSettings = z.infer<typeof captchaSolverSettingsSchema>;
|
|
203
|
+
export type CaptchaSolverSettingsWithRunContext = CaptchaSolverSettings & {
|
|
205
204
|
workspaceId: string;
|
|
206
205
|
projectId: string;
|
|
207
206
|
baseUrl: string;
|
|
@@ -213,7 +212,7 @@ type CaptchaSolverSettingsWithRunContext = CaptchaSolverSettings & {
|
|
|
213
212
|
token?: string;
|
|
214
213
|
};
|
|
215
214
|
};
|
|
216
|
-
declare const settingsSchema: z.ZodObject<{
|
|
215
|
+
export declare const settingsSchema: z.ZodObject<{
|
|
217
216
|
authSessions: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
218
217
|
enabled: z.ZodBoolean;
|
|
219
218
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -535,6 +534,4 @@ declare const settingsSchema: z.ZodObject<{
|
|
|
535
534
|
} | undefined;
|
|
536
535
|
} | undefined;
|
|
537
536
|
}>;
|
|
538
|
-
type IntunedSettings = z.infer<typeof settingsSchema>;
|
|
539
|
-
|
|
540
|
-
export { type CaptchaSolverSettings, type CaptchaSolverSettingsWithRunContext, type IntunedSettings, captchaSolverSettingsSchema, settingsSchema };
|
|
537
|
+
export type IntunedSettings = z.infer<typeof settingsSchema>;
|
|
@@ -1,59 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
"use strict";
|
|
28
2
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
__export(settingsSchema_exports, {
|
|
32
|
-
captchaSolverSettingsSchema: () => captchaSolverSettingsSchema,
|
|
33
|
-
settingsSchema: () => settingsSchema
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
34
5
|
});
|
|
35
|
-
|
|
36
|
-
var z =
|
|
37
|
-
var
|
|
6
|
+
exports.settingsSchema = exports.captchaSolverSettingsSchema = void 0;
|
|
7
|
+
var z = _interopRequireWildcard(require("zod"));
|
|
8
|
+
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
|
+
const baseCaptchaSchema = z.object({
|
|
38
10
|
enabled: z.boolean()
|
|
39
11
|
});
|
|
40
|
-
|
|
12
|
+
const customCaptchaSchema = baseCaptchaSchema.extend({
|
|
41
13
|
imageLocators: z.array(z.string()).min(1, "At least one image locator is required"),
|
|
42
14
|
submitLocators: z.array(z.string()).min(1, "At least one submit locator is required"),
|
|
43
15
|
inputLocators: z.array(z.string()).min(1, "At least one input locator is required")
|
|
44
16
|
});
|
|
45
|
-
|
|
17
|
+
const textCaptchaSchema = baseCaptchaSchema.extend({
|
|
46
18
|
labelLocators: z.array(z.string()).min(1, "At least one image locator is required"),
|
|
47
19
|
submitLocators: z.array(z.string()).min(1, "At least one submit locator is required"),
|
|
48
20
|
inputLocators: z.array(z.string()).min(1, "At least one input locator is required")
|
|
49
21
|
});
|
|
50
|
-
|
|
22
|
+
const captchaSolverSolveSettingsSchema = z.object({
|
|
51
23
|
autoSolve: z.boolean().default(true),
|
|
52
|
-
solveDelay: z.number().min(0).default(
|
|
24
|
+
solveDelay: z.number().min(0).default(2000),
|
|
53
25
|
maxRetries: z.number().min(0).default(3),
|
|
54
|
-
timeout: z.number().min(0).default(
|
|
26
|
+
timeout: z.number().min(0).default(30000)
|
|
55
27
|
});
|
|
56
|
-
|
|
28
|
+
const captchaSolverSettingsSchema = exports.captchaSolverSettingsSchema = z.object({
|
|
57
29
|
enabled: z.boolean().default(false),
|
|
58
30
|
port: z.number().int().min(1).max(65535).optional(),
|
|
59
31
|
cloudflare: baseCaptchaSchema.optional(),
|
|
@@ -66,27 +38,20 @@ var captchaSolverSettingsSchema = z.object({
|
|
|
66
38
|
lemin: baseCaptchaSchema.optional(),
|
|
67
39
|
customCaptcha: customCaptchaSchema.optional(),
|
|
68
40
|
text: textCaptchaSchema.optional(),
|
|
69
|
-
settings: captchaSolverSolveSettingsSchema.default(
|
|
70
|
-
captchaSolverSolveSettingsSchema.parse({})
|
|
71
|
-
)
|
|
41
|
+
settings: captchaSolverSolveSettingsSchema.default(captchaSolverSolveSettingsSchema.parse({}))
|
|
72
42
|
}).default({});
|
|
73
|
-
|
|
43
|
+
const authSessionsSchema = z.object({
|
|
74
44
|
enabled: z.boolean()
|
|
75
45
|
}).optional().default({
|
|
76
46
|
enabled: false
|
|
77
47
|
});
|
|
78
|
-
|
|
48
|
+
const stealthModeSchema = z.object({
|
|
79
49
|
enabled: z.boolean()
|
|
80
50
|
}).optional().default({
|
|
81
51
|
enabled: false
|
|
82
52
|
});
|
|
83
|
-
|
|
53
|
+
const settingsSchema = exports.settingsSchema = z.object({
|
|
84
54
|
authSessions: authSessionsSchema,
|
|
85
55
|
stealthMode: stealthModeSchema,
|
|
86
56
|
captchaSolver: captchaSolverSettingsSchema.optional()
|
|
87
|
-
});
|
|
88
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
89
|
-
0 && (module.exports = {
|
|
90
|
-
captchaSolverSettingsSchema,
|
|
91
|
-
settingsSchema
|
|
92
|
-
});
|
|
57
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type * as playwright from "playwright";
|
|
2
|
+
import { type Err, type Ok } from "neverthrow";
|
|
3
|
+
import { ImportFunction, type RunAutomationError } from "@intuned/runtime-interface";
|
|
4
|
+
export type InitializeContextHookOptions = {
|
|
5
|
+
apiName: string;
|
|
6
|
+
apiParameters: any;
|
|
7
|
+
cdpUrl: string;
|
|
8
|
+
};
|
|
9
|
+
export type SetupContextHook = (options: InitializeContextHookOptions) => Promise<{
|
|
10
|
+
page: playwright.Page | null;
|
|
11
|
+
context: playwright.BrowserContext;
|
|
12
|
+
cleanup?: () => Promise<void>;
|
|
13
|
+
} | null>;
|
|
14
|
+
export declare function loadSetupContextHook({ importFunction, }: {
|
|
15
|
+
importFunction: ImportFunction;
|
|
16
|
+
}): Promise<Ok<SetupContextHook | null, any> | Err<any, RunAutomationError>>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.loadSetupContextHook = loadSetupContextHook;
|
|
7
|
+
var _neverthrow = require("neverthrow");
|
|
8
|
+
var _importUsingImportFunction = require("./runApi/importUsingImportFunction");
|
|
9
|
+
var _runtimeInterface = require("../vendor/runtime-interface");
|
|
10
|
+
const setupContextHookPath = "hooks/setupContext";
|
|
11
|
+
async function loadSetupContextHook({
|
|
12
|
+
importFunction
|
|
13
|
+
}) {
|
|
14
|
+
const importedFunctionResult = await (0, _importUsingImportFunction.importUsingImportFunction)({
|
|
15
|
+
path: setupContextHookPath,
|
|
16
|
+
importFunction
|
|
17
|
+
});
|
|
18
|
+
if (importedFunctionResult.isErr() && importedFunctionResult.error instanceof _runtimeInterface.ApiNotFoundError) {
|
|
19
|
+
return (0, _neverthrow.ok)(null);
|
|
20
|
+
}
|
|
21
|
+
return importedFunctionResult;
|
|
22
|
+
}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import * as appInsights from
|
|
2
|
-
|
|
3
|
-
declare function
|
|
4
|
-
declare function getTelemetryClient(): appInsights.TelemetryClient | undefined;
|
|
5
|
-
|
|
6
|
-
export { getTelemetryClient, initializeAppInsights };
|
|
1
|
+
import * as appInsights from "applicationinsights";
|
|
2
|
+
export declare function initializeAppInsights(): void;
|
|
3
|
+
export declare function getTelemetryClient(): appInsights.TelemetryClient | undefined;
|
package/dist/common/telemetry.js
CHANGED
|
@@ -1,39 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
"use strict";
|
|
28
2
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
__export(telemetry_exports, {
|
|
32
|
-
getTelemetryClient: () => getTelemetryClient,
|
|
33
|
-
initializeAppInsights: () => initializeAppInsights
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
34
5
|
});
|
|
35
|
-
|
|
36
|
-
|
|
6
|
+
exports.getTelemetryClient = getTelemetryClient;
|
|
7
|
+
exports.initializeAppInsights = initializeAppInsights;
|
|
8
|
+
var appInsights = _interopRequireWildcard(require("applicationinsights"));
|
|
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); }
|
|
37
10
|
function gracefulShutdown() {
|
|
38
11
|
console.log("Shutting down, so flushing app insights.");
|
|
39
12
|
appInsights.defaultClient.flush();
|
|
@@ -55,9 +28,4 @@ function initializeAppInsights() {
|
|
|
55
28
|
}
|
|
56
29
|
function getTelemetryClient() {
|
|
57
30
|
return appInsights.defaultClient;
|
|
58
|
-
}
|
|
59
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
60
|
-
0 && (module.exports = {
|
|
61
|
-
getTelemetryClient,
|
|
62
|
-
initializeAppInsights
|
|
63
|
-
});
|
|
31
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { getExecutionContext,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import 'zod';
|
|
6
|
-
import 'node:async_hooks';
|
|
1
|
+
export { extendPayload, extendTimeout, runInfo, RunError, getAuthSessionParameters, attemptStore, persistentStore, getAiGatewayConfig, } from "./runtime";
|
|
2
|
+
export { runWithContext, getExecutionContext, } from "./common/asyncLocalStorage";
|
|
3
|
+
export { getDownloadDirectoryPath } from "./runtime/downloadDirectory";
|
|
4
|
+
export { waitForCaptchaSolve, withWaitForCaptchaSolve, onCaptchaEvent, onceCaptchaEvent, removeCaptchaEventListener, pauseCaptchaSolver, resumeCaptchaSolver, } from "./runtime/captcha";
|