@intuned/runtime 1.3.14 → 1.3.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/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/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 +212 -0
- package/dist/common/extension/types.js +51 -0
- package/dist/common/launchBrowser.js +15 -3
- package/dist/common/runApi/types.d.ts +20 -20
- package/dist/common/settingsSchema.d.ts +17 -2
- package/dist/common/settingsSchema.js +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +50 -1
- 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/index.d.ts +1 -0
- package/dist/runtime/index.js +43 -0
- package/package.json +2 -1
- package/dist/common/extensionsHelpers.d.ts +0 -8
- package/dist/common/extensionsHelpers.js +0 -80
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const captchaTypeSchema: z.ZodEnum<["aws", "cloudflare", "customcaptcha", "funcaptcha", "geetest", "hcaptcha", "lemincaptcha", "recaptcha", "textcaptcha"]>;
|
|
3
|
+
export type CaptchaType = z.infer<typeof captchaTypeSchema>;
|
|
4
|
+
export declare const captchaStatusSchema: z.ZodEnum<["attached", "solving", "solved", "error", "detached"]>;
|
|
5
|
+
export type CaptchaStatus = z.infer<typeof captchaStatusSchema>;
|
|
6
|
+
export declare const captchaErrorCodeSchema: z.ZodEnum<["HIT_LIMIT", "MAX_RETRIES", "UNEXPECTED_SERVER_RESPONSE", "UNEXPECTED_ERROR"]>;
|
|
7
|
+
export type CaptchaErrorCode = z.infer<typeof captchaErrorCodeSchema>;
|
|
8
|
+
export declare const captchaErrorSchema: z.ZodObject<{
|
|
9
|
+
code: z.ZodEnum<["HIT_LIMIT", "MAX_RETRIES", "UNEXPECTED_SERVER_RESPONSE", "UNEXPECTED_ERROR"]>;
|
|
10
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
code: "HIT_LIMIT" | "MAX_RETRIES" | "UNEXPECTED_SERVER_RESPONSE" | "UNEXPECTED_ERROR";
|
|
13
|
+
error?: unknown;
|
|
14
|
+
}, {
|
|
15
|
+
code: "HIT_LIMIT" | "MAX_RETRIES" | "UNEXPECTED_SERVER_RESPONSE" | "UNEXPECTED_ERROR";
|
|
16
|
+
error?: unknown;
|
|
17
|
+
}>;
|
|
18
|
+
export type CaptchaError = z.infer<typeof captchaErrorSchema>;
|
|
19
|
+
declare const captchaBaseSchema: z.ZodObject<{
|
|
20
|
+
id: z.ZodString;
|
|
21
|
+
tabId: z.ZodNumber;
|
|
22
|
+
type: z.ZodEnum<["aws", "cloudflare", "customcaptcha", "funcaptcha", "geetest", "hcaptcha", "lemincaptcha", "recaptcha", "textcaptcha"]>;
|
|
23
|
+
retryCount: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
}, "strip", z.ZodTypeAny, {
|
|
25
|
+
type: "aws" | "cloudflare" | "customcaptcha" | "funcaptcha" | "geetest" | "hcaptcha" | "lemincaptcha" | "recaptcha" | "textcaptcha";
|
|
26
|
+
id: string;
|
|
27
|
+
tabId: number;
|
|
28
|
+
retryCount?: number | undefined;
|
|
29
|
+
}, {
|
|
30
|
+
type: "aws" | "cloudflare" | "customcaptcha" | "funcaptcha" | "geetest" | "hcaptcha" | "lemincaptcha" | "recaptcha" | "textcaptcha";
|
|
31
|
+
id: string;
|
|
32
|
+
tabId: number;
|
|
33
|
+
retryCount?: number | undefined;
|
|
34
|
+
}>;
|
|
35
|
+
export type CaptchaBase = z.infer<typeof captchaBaseSchema>;
|
|
36
|
+
declare const captchaNonErrorSchema: z.ZodObject<{
|
|
37
|
+
type: z.ZodEnum<["aws", "cloudflare", "customcaptcha", "funcaptcha", "geetest", "hcaptcha", "lemincaptcha", "recaptcha", "textcaptcha"]>;
|
|
38
|
+
id: z.ZodString;
|
|
39
|
+
tabId: z.ZodNumber;
|
|
40
|
+
retryCount: z.ZodOptional<z.ZodNumber>;
|
|
41
|
+
status: z.ZodEnum<["attached", "solving", "solved", "detached"]>;
|
|
42
|
+
}, "strip", z.ZodTypeAny, {
|
|
43
|
+
type: "aws" | "cloudflare" | "customcaptcha" | "funcaptcha" | "geetest" | "hcaptcha" | "lemincaptcha" | "recaptcha" | "textcaptcha";
|
|
44
|
+
status: "attached" | "solving" | "solved" | "detached";
|
|
45
|
+
id: string;
|
|
46
|
+
tabId: number;
|
|
47
|
+
retryCount?: number | undefined;
|
|
48
|
+
}, {
|
|
49
|
+
type: "aws" | "cloudflare" | "customcaptcha" | "funcaptcha" | "geetest" | "hcaptcha" | "lemincaptcha" | "recaptcha" | "textcaptcha";
|
|
50
|
+
status: "attached" | "solving" | "solved" | "detached";
|
|
51
|
+
id: string;
|
|
52
|
+
tabId: number;
|
|
53
|
+
retryCount?: number | undefined;
|
|
54
|
+
}>;
|
|
55
|
+
export type CaptchaNonError = z.infer<typeof captchaNonErrorSchema>;
|
|
56
|
+
declare const captchaErrorStatusSchema: z.ZodObject<{
|
|
57
|
+
type: z.ZodEnum<["aws", "cloudflare", "customcaptcha", "funcaptcha", "geetest", "hcaptcha", "lemincaptcha", "recaptcha", "textcaptcha"]>;
|
|
58
|
+
id: z.ZodString;
|
|
59
|
+
tabId: z.ZodNumber;
|
|
60
|
+
retryCount: z.ZodOptional<z.ZodNumber>;
|
|
61
|
+
status: z.ZodLiteral<"error">;
|
|
62
|
+
error: z.ZodObject<{
|
|
63
|
+
code: z.ZodEnum<["HIT_LIMIT", "MAX_RETRIES", "UNEXPECTED_SERVER_RESPONSE", "UNEXPECTED_ERROR"]>;
|
|
64
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
65
|
+
}, "strip", z.ZodTypeAny, {
|
|
66
|
+
code: "HIT_LIMIT" | "MAX_RETRIES" | "UNEXPECTED_SERVER_RESPONSE" | "UNEXPECTED_ERROR";
|
|
67
|
+
error?: unknown;
|
|
68
|
+
}, {
|
|
69
|
+
code: "HIT_LIMIT" | "MAX_RETRIES" | "UNEXPECTED_SERVER_RESPONSE" | "UNEXPECTED_ERROR";
|
|
70
|
+
error?: unknown;
|
|
71
|
+
}>;
|
|
72
|
+
}, "strip", z.ZodTypeAny, {
|
|
73
|
+
error: {
|
|
74
|
+
code: "HIT_LIMIT" | "MAX_RETRIES" | "UNEXPECTED_SERVER_RESPONSE" | "UNEXPECTED_ERROR";
|
|
75
|
+
error?: unknown;
|
|
76
|
+
};
|
|
77
|
+
type: "aws" | "cloudflare" | "customcaptcha" | "funcaptcha" | "geetest" | "hcaptcha" | "lemincaptcha" | "recaptcha" | "textcaptcha";
|
|
78
|
+
status: "error";
|
|
79
|
+
id: string;
|
|
80
|
+
tabId: number;
|
|
81
|
+
retryCount?: number | undefined;
|
|
82
|
+
}, {
|
|
83
|
+
error: {
|
|
84
|
+
code: "HIT_LIMIT" | "MAX_RETRIES" | "UNEXPECTED_SERVER_RESPONSE" | "UNEXPECTED_ERROR";
|
|
85
|
+
error?: unknown;
|
|
86
|
+
};
|
|
87
|
+
type: "aws" | "cloudflare" | "customcaptcha" | "funcaptcha" | "geetest" | "hcaptcha" | "lemincaptcha" | "recaptcha" | "textcaptcha";
|
|
88
|
+
status: "error";
|
|
89
|
+
id: string;
|
|
90
|
+
tabId: number;
|
|
91
|
+
retryCount?: number | undefined;
|
|
92
|
+
}>;
|
|
93
|
+
export type CaptchaErrorStatus = z.infer<typeof captchaErrorStatusSchema>;
|
|
94
|
+
export declare const captchaSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
|
|
95
|
+
type: z.ZodEnum<["aws", "cloudflare", "customcaptcha", "funcaptcha", "geetest", "hcaptcha", "lemincaptcha", "recaptcha", "textcaptcha"]>;
|
|
96
|
+
id: z.ZodString;
|
|
97
|
+
tabId: z.ZodNumber;
|
|
98
|
+
retryCount: z.ZodOptional<z.ZodNumber>;
|
|
99
|
+
status: z.ZodLiteral<"attached">;
|
|
100
|
+
}, "strip", z.ZodTypeAny, {
|
|
101
|
+
type: "aws" | "cloudflare" | "customcaptcha" | "funcaptcha" | "geetest" | "hcaptcha" | "lemincaptcha" | "recaptcha" | "textcaptcha";
|
|
102
|
+
status: "attached";
|
|
103
|
+
id: string;
|
|
104
|
+
tabId: number;
|
|
105
|
+
retryCount?: number | undefined;
|
|
106
|
+
}, {
|
|
107
|
+
type: "aws" | "cloudflare" | "customcaptcha" | "funcaptcha" | "geetest" | "hcaptcha" | "lemincaptcha" | "recaptcha" | "textcaptcha";
|
|
108
|
+
status: "attached";
|
|
109
|
+
id: string;
|
|
110
|
+
tabId: number;
|
|
111
|
+
retryCount?: number | undefined;
|
|
112
|
+
}>, z.ZodObject<{
|
|
113
|
+
type: z.ZodEnum<["aws", "cloudflare", "customcaptcha", "funcaptcha", "geetest", "hcaptcha", "lemincaptcha", "recaptcha", "textcaptcha"]>;
|
|
114
|
+
id: z.ZodString;
|
|
115
|
+
tabId: z.ZodNumber;
|
|
116
|
+
retryCount: z.ZodOptional<z.ZodNumber>;
|
|
117
|
+
status: z.ZodLiteral<"solving">;
|
|
118
|
+
}, "strip", z.ZodTypeAny, {
|
|
119
|
+
type: "aws" | "cloudflare" | "customcaptcha" | "funcaptcha" | "geetest" | "hcaptcha" | "lemincaptcha" | "recaptcha" | "textcaptcha";
|
|
120
|
+
status: "solving";
|
|
121
|
+
id: string;
|
|
122
|
+
tabId: number;
|
|
123
|
+
retryCount?: number | undefined;
|
|
124
|
+
}, {
|
|
125
|
+
type: "aws" | "cloudflare" | "customcaptcha" | "funcaptcha" | "geetest" | "hcaptcha" | "lemincaptcha" | "recaptcha" | "textcaptcha";
|
|
126
|
+
status: "solving";
|
|
127
|
+
id: string;
|
|
128
|
+
tabId: number;
|
|
129
|
+
retryCount?: number | undefined;
|
|
130
|
+
}>, z.ZodObject<{
|
|
131
|
+
type: z.ZodEnum<["aws", "cloudflare", "customcaptcha", "funcaptcha", "geetest", "hcaptcha", "lemincaptcha", "recaptcha", "textcaptcha"]>;
|
|
132
|
+
id: z.ZodString;
|
|
133
|
+
tabId: z.ZodNumber;
|
|
134
|
+
retryCount: z.ZodOptional<z.ZodNumber>;
|
|
135
|
+
status: z.ZodLiteral<"solved">;
|
|
136
|
+
}, "strip", z.ZodTypeAny, {
|
|
137
|
+
type: "aws" | "cloudflare" | "customcaptcha" | "funcaptcha" | "geetest" | "hcaptcha" | "lemincaptcha" | "recaptcha" | "textcaptcha";
|
|
138
|
+
status: "solved";
|
|
139
|
+
id: string;
|
|
140
|
+
tabId: number;
|
|
141
|
+
retryCount?: number | undefined;
|
|
142
|
+
}, {
|
|
143
|
+
type: "aws" | "cloudflare" | "customcaptcha" | "funcaptcha" | "geetest" | "hcaptcha" | "lemincaptcha" | "recaptcha" | "textcaptcha";
|
|
144
|
+
status: "solved";
|
|
145
|
+
id: string;
|
|
146
|
+
tabId: number;
|
|
147
|
+
retryCount?: number | undefined;
|
|
148
|
+
}>, z.ZodObject<{
|
|
149
|
+
type: z.ZodEnum<["aws", "cloudflare", "customcaptcha", "funcaptcha", "geetest", "hcaptcha", "lemincaptcha", "recaptcha", "textcaptcha"]>;
|
|
150
|
+
id: z.ZodString;
|
|
151
|
+
tabId: z.ZodNumber;
|
|
152
|
+
retryCount: z.ZodOptional<z.ZodNumber>;
|
|
153
|
+
status: z.ZodLiteral<"detached">;
|
|
154
|
+
}, "strip", z.ZodTypeAny, {
|
|
155
|
+
type: "aws" | "cloudflare" | "customcaptcha" | "funcaptcha" | "geetest" | "hcaptcha" | "lemincaptcha" | "recaptcha" | "textcaptcha";
|
|
156
|
+
status: "detached";
|
|
157
|
+
id: string;
|
|
158
|
+
tabId: number;
|
|
159
|
+
retryCount?: number | undefined;
|
|
160
|
+
}, {
|
|
161
|
+
type: "aws" | "cloudflare" | "customcaptcha" | "funcaptcha" | "geetest" | "hcaptcha" | "lemincaptcha" | "recaptcha" | "textcaptcha";
|
|
162
|
+
status: "detached";
|
|
163
|
+
id: string;
|
|
164
|
+
tabId: number;
|
|
165
|
+
retryCount?: number | undefined;
|
|
166
|
+
}>, z.ZodObject<{
|
|
167
|
+
type: z.ZodEnum<["aws", "cloudflare", "customcaptcha", "funcaptcha", "geetest", "hcaptcha", "lemincaptcha", "recaptcha", "textcaptcha"]>;
|
|
168
|
+
id: z.ZodString;
|
|
169
|
+
tabId: z.ZodNumber;
|
|
170
|
+
retryCount: z.ZodOptional<z.ZodNumber>;
|
|
171
|
+
status: z.ZodLiteral<"error">;
|
|
172
|
+
error: z.ZodObject<{
|
|
173
|
+
code: z.ZodEnum<["HIT_LIMIT", "MAX_RETRIES", "UNEXPECTED_SERVER_RESPONSE", "UNEXPECTED_ERROR"]>;
|
|
174
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
175
|
+
}, "strip", z.ZodTypeAny, {
|
|
176
|
+
code: "HIT_LIMIT" | "MAX_RETRIES" | "UNEXPECTED_SERVER_RESPONSE" | "UNEXPECTED_ERROR";
|
|
177
|
+
error?: unknown;
|
|
178
|
+
}, {
|
|
179
|
+
code: "HIT_LIMIT" | "MAX_RETRIES" | "UNEXPECTED_SERVER_RESPONSE" | "UNEXPECTED_ERROR";
|
|
180
|
+
error?: unknown;
|
|
181
|
+
}>;
|
|
182
|
+
}, "strip", z.ZodTypeAny, {
|
|
183
|
+
error: {
|
|
184
|
+
code: "HIT_LIMIT" | "MAX_RETRIES" | "UNEXPECTED_SERVER_RESPONSE" | "UNEXPECTED_ERROR";
|
|
185
|
+
error?: unknown;
|
|
186
|
+
};
|
|
187
|
+
type: "aws" | "cloudflare" | "customcaptcha" | "funcaptcha" | "geetest" | "hcaptcha" | "lemincaptcha" | "recaptcha" | "textcaptcha";
|
|
188
|
+
status: "error";
|
|
189
|
+
id: string;
|
|
190
|
+
tabId: number;
|
|
191
|
+
retryCount?: number | undefined;
|
|
192
|
+
}, {
|
|
193
|
+
error: {
|
|
194
|
+
code: "HIT_LIMIT" | "MAX_RETRIES" | "UNEXPECTED_SERVER_RESPONSE" | "UNEXPECTED_ERROR";
|
|
195
|
+
error?: unknown;
|
|
196
|
+
};
|
|
197
|
+
type: "aws" | "cloudflare" | "customcaptcha" | "funcaptcha" | "geetest" | "hcaptcha" | "lemincaptcha" | "recaptcha" | "textcaptcha";
|
|
198
|
+
status: "error";
|
|
199
|
+
id: string;
|
|
200
|
+
tabId: number;
|
|
201
|
+
retryCount?: number | undefined;
|
|
202
|
+
}>]>;
|
|
203
|
+
export type Captcha = z.infer<typeof captchaSchema>;
|
|
204
|
+
export type CaptchaCallback = (captcha: Captcha) => Promise<void> | void;
|
|
205
|
+
export declare class CaptchaSolveError extends Error {
|
|
206
|
+
error: CaptchaError;
|
|
207
|
+
constructor(message: string, error: CaptchaError);
|
|
208
|
+
}
|
|
209
|
+
export declare class TimeoutError extends Error {
|
|
210
|
+
constructor(message: string);
|
|
211
|
+
}
|
|
212
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.captchaTypeSchema = exports.captchaStatusSchema = exports.captchaSchema = exports.captchaErrorSchema = exports.captchaErrorCodeSchema = exports.TimeoutError = exports.CaptchaSolveError = void 0;
|
|
7
|
+
var _zod = require("zod");
|
|
8
|
+
const captchaTypeSchema = exports.captchaTypeSchema = _zod.z.enum(["aws", "cloudflare", "customcaptcha", "funcaptcha", "geetest", "hcaptcha", "lemincaptcha", "recaptcha", "textcaptcha"]);
|
|
9
|
+
const captchaStatusSchema = exports.captchaStatusSchema = _zod.z.enum(["attached", "solving", "solved", "error", "detached"]);
|
|
10
|
+
const captchaErrorCodeSchema = exports.captchaErrorCodeSchema = _zod.z.enum(["HIT_LIMIT", "MAX_RETRIES", "UNEXPECTED_SERVER_RESPONSE", "UNEXPECTED_ERROR"]);
|
|
11
|
+
const captchaErrorSchema = exports.captchaErrorSchema = _zod.z.object({
|
|
12
|
+
code: captchaErrorCodeSchema,
|
|
13
|
+
error: _zod.z.unknown().optional()
|
|
14
|
+
});
|
|
15
|
+
const captchaBaseSchema = _zod.z.object({
|
|
16
|
+
id: _zod.z.string().min(1),
|
|
17
|
+
tabId: _zod.z.number().int().positive(),
|
|
18
|
+
type: captchaTypeSchema,
|
|
19
|
+
retryCount: _zod.z.number().int().nonnegative().optional()
|
|
20
|
+
});
|
|
21
|
+
const captchaNonErrorSchema = captchaBaseSchema.extend({
|
|
22
|
+
status: captchaStatusSchema.exclude(["error"])
|
|
23
|
+
});
|
|
24
|
+
const captchaErrorStatusSchema = captchaBaseSchema.extend({
|
|
25
|
+
status: _zod.z.literal("error"),
|
|
26
|
+
error: captchaErrorSchema
|
|
27
|
+
});
|
|
28
|
+
const captchaSchema = exports.captchaSchema = _zod.z.discriminatedUnion("status", [captchaBaseSchema.extend({
|
|
29
|
+
status: _zod.z.literal("attached")
|
|
30
|
+
}), captchaBaseSchema.extend({
|
|
31
|
+
status: _zod.z.literal("solving")
|
|
32
|
+
}), captchaBaseSchema.extend({
|
|
33
|
+
status: _zod.z.literal("solved")
|
|
34
|
+
}), captchaBaseSchema.extend({
|
|
35
|
+
status: _zod.z.literal("detached")
|
|
36
|
+
}), captchaErrorStatusSchema]);
|
|
37
|
+
class CaptchaSolveError extends Error {
|
|
38
|
+
constructor(message, error) {
|
|
39
|
+
super(message);
|
|
40
|
+
this.error = error;
|
|
41
|
+
this.name = "CaptchaSolveError";
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.CaptchaSolveError = CaptchaSolveError;
|
|
45
|
+
class TimeoutError extends Error {
|
|
46
|
+
constructor(message) {
|
|
47
|
+
super(message);
|
|
48
|
+
this.name = "TimeoutError";
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.TimeoutError = TimeoutError;
|
|
@@ -14,7 +14,8 @@ 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("./extensionsHelpers");
|
|
17
|
+
var _extensionsHelpers = require("./extension/extensionsHelpers");
|
|
18
|
+
var _intunedExtensionServer = require("./extension/intunedExtensionServer");
|
|
18
19
|
var _util = require("util");
|
|
19
20
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
20
21
|
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); }
|
|
@@ -37,6 +38,9 @@ async function createUserDirWithPreferences() {
|
|
|
37
38
|
}
|
|
38
39
|
async function launchChromium(options) {
|
|
39
40
|
if ("cdpAddress" in options) {
|
|
41
|
+
if (await (0, _extensionsHelpers.isIntunedExtensionEnabled)()) {
|
|
42
|
+
await (0, _intunedExtensionServer.setupIntunedExtensionServer)();
|
|
43
|
+
}
|
|
40
44
|
const browser = await playwright.chromium.connectOverCDP(options.cdpAddress);
|
|
41
45
|
if (browser.contexts().length === 0) {
|
|
42
46
|
throw new Error("No browser contexts found in the connected browser");
|
|
@@ -64,12 +68,17 @@ async function launchChromium(options) {
|
|
|
64
68
|
const defaultArgsToIgnore = ["--disable-extensions", "--disable-component-extensions-with-background-pages", "--disable-background-networking", "--disable-backgrounding-occluded-windows", "--disable-background-timer-throttling"];
|
|
65
69
|
const extraArgs = [];
|
|
66
70
|
const userDataDir = await createUserDirWithPreferences();
|
|
67
|
-
if ((0, _extensionsHelpers.
|
|
71
|
+
if ((0, _extensionsHelpers.isIntunedExtensionLoaded)()) {
|
|
68
72
|
const extensionsList = (0, _extensionsHelpers.buildExtensionsList)();
|
|
69
73
|
const extensions = extensionsList.join(",");
|
|
70
74
|
extraArgs.push(`--disable-extensions-except=${extensions}`);
|
|
71
75
|
extraArgs.push(`--load-extension=${extensions}`);
|
|
76
|
+
}
|
|
77
|
+
if (await (0, _extensionsHelpers.isIntunedExtensionEnabled)()) {
|
|
72
78
|
await (0, _extensionsHelpers.setupIntunedExtension)();
|
|
79
|
+
if (proxy) {
|
|
80
|
+
extraArgs.push('--proxy-bypass-list="<-loopback>"');
|
|
81
|
+
}
|
|
73
82
|
}
|
|
74
83
|
if (cdpPort) {
|
|
75
84
|
extraArgs.push(`--remote-debugging-port=${cdpPort}`);
|
|
@@ -110,6 +119,9 @@ async function launchChromium(options) {
|
|
|
110
119
|
retryDelay: 1000,
|
|
111
120
|
maxRetries: 5
|
|
112
121
|
});
|
|
122
|
+
if (await (0, _extensionsHelpers.isIntunedExtensionEnabled)()) {
|
|
123
|
+
await (0, _intunedExtensionServer.cleanIntunedExtensionServer)();
|
|
124
|
+
}
|
|
113
125
|
} catch (error) {
|
|
114
126
|
console.error("Failed to remove user data dir", error);
|
|
115
127
|
}
|
|
@@ -119,7 +131,7 @@ async function launchChromium(options) {
|
|
|
119
131
|
await waitOnCdpAddress(createdCdpAddress);
|
|
120
132
|
}
|
|
121
133
|
const page = context.pages().at(0) ?? (await context.newPage());
|
|
122
|
-
if ((0, _extensionsHelpers.isIntunedExtensionEnabled)()) {
|
|
134
|
+
if (await (0, _extensionsHelpers.isIntunedExtensionEnabled)()) {
|
|
123
135
|
await (0, _extensionsHelpers.getIntunedExtensionWorker)(context);
|
|
124
136
|
}
|
|
125
137
|
return {
|
|
@@ -38,8 +38,8 @@ export declare const runApiStorageStateSchema: z.ZodObject<{
|
|
|
38
38
|
}, "strip", z.ZodTypeAny, {
|
|
39
39
|
path: string;
|
|
40
40
|
value: string;
|
|
41
|
-
name: string;
|
|
42
41
|
domain: string;
|
|
42
|
+
name: 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
|
-
name: string;
|
|
51
50
|
domain: string;
|
|
51
|
+
name: 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
|
-
name: string;
|
|
112
111
|
domain: string;
|
|
112
|
+
name: 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
|
-
name: string;
|
|
137
136
|
domain: string;
|
|
137
|
+
name: 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
|
-
name: string;
|
|
184
183
|
domain: string;
|
|
184
|
+
name: 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
|
-
name: string;
|
|
193
192
|
domain: string;
|
|
193
|
+
name: 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
|
-
name: string;
|
|
254
253
|
domain: string;
|
|
254
|
+
name: 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
|
-
name: string;
|
|
279
278
|
domain: string;
|
|
279
|
+
name: 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
|
-
name: string;
|
|
307
306
|
domain: string;
|
|
307
|
+
name: 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
|
-
name: string;
|
|
335
334
|
domain: string;
|
|
335
|
+
name: 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
|
-
name: string;
|
|
410
409
|
domain: string;
|
|
410
|
+
name: 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
|
-
name: string;
|
|
419
418
|
domain: string;
|
|
419
|
+
name: 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
|
-
name: string;
|
|
480
479
|
domain: string;
|
|
480
|
+
name: 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
|
-
name: string;
|
|
505
504
|
domain: string;
|
|
505
|
+
name: 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
|
-
name: string;
|
|
533
532
|
domain: string;
|
|
533
|
+
name: 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
|
-
name: string;
|
|
561
560
|
domain: string;
|
|
561
|
+
name: 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
|
-
name: string;
|
|
594
593
|
domain: string;
|
|
594
|
+
name: 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
|
-
name: string;
|
|
627
626
|
domain: string;
|
|
627
|
+
name: 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
|
-
name: string;
|
|
728
727
|
domain: string;
|
|
728
|
+
name: 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
|
-
name: string;
|
|
773
772
|
domain: string;
|
|
773
|
+
name: string;
|
|
774
774
|
expires: number;
|
|
775
775
|
httpOnly: boolean;
|
|
776
776
|
secure: boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
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>;
|
|
4
5
|
cloudflare: z.ZodOptional<z.ZodObject<{
|
|
5
6
|
enabled: z.ZodBoolean;
|
|
6
7
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -113,6 +114,7 @@ export declare const captchaSolverSettingsSchema: z.ZodDefault<z.ZodObject<{
|
|
|
113
114
|
maxRetries: number;
|
|
114
115
|
timeout: number;
|
|
115
116
|
};
|
|
117
|
+
port?: number | undefined;
|
|
116
118
|
cloudflare?: {
|
|
117
119
|
enabled: boolean;
|
|
118
120
|
} | undefined;
|
|
@@ -151,6 +153,7 @@ export declare const captchaSolverSettingsSchema: z.ZodDefault<z.ZodObject<{
|
|
|
151
153
|
} | undefined;
|
|
152
154
|
}, {
|
|
153
155
|
enabled?: boolean | undefined;
|
|
156
|
+
port?: number | undefined;
|
|
154
157
|
cloudflare?: {
|
|
155
158
|
enabled: boolean;
|
|
156
159
|
} | undefined;
|
|
@@ -194,11 +197,18 @@ export declare const captchaSolverSettingsSchema: z.ZodDefault<z.ZodObject<{
|
|
|
194
197
|
timeout?: number | undefined;
|
|
195
198
|
} | undefined;
|
|
196
199
|
}>>;
|
|
197
|
-
export type
|
|
200
|
+
export type CaptchaSolverSettings = z.infer<typeof captchaSolverSettingsSchema>;
|
|
201
|
+
export type CaptchaSolverSettingsWithRunContext = CaptchaSolverSettings & {
|
|
198
202
|
workspaceId: string;
|
|
199
203
|
projectId: string;
|
|
200
204
|
baseUrl: string;
|
|
201
|
-
|
|
205
|
+
authentication: {
|
|
206
|
+
type: "apiKey";
|
|
207
|
+
apiKey: string;
|
|
208
|
+
} | {
|
|
209
|
+
type: "basic" | "bearer";
|
|
210
|
+
token?: string;
|
|
211
|
+
};
|
|
202
212
|
};
|
|
203
213
|
export declare const settingsSchema: z.ZodObject<{
|
|
204
214
|
authSessions: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
@@ -217,6 +227,7 @@ export declare const settingsSchema: z.ZodObject<{
|
|
|
217
227
|
}>>>;
|
|
218
228
|
captchaSolver: z.ZodOptional<z.ZodDefault<z.ZodObject<{
|
|
219
229
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
230
|
+
port: z.ZodOptional<z.ZodNumber>;
|
|
220
231
|
cloudflare: z.ZodOptional<z.ZodObject<{
|
|
221
232
|
enabled: z.ZodBoolean;
|
|
222
233
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -329,6 +340,7 @@ export declare const settingsSchema: z.ZodObject<{
|
|
|
329
340
|
maxRetries: number;
|
|
330
341
|
timeout: number;
|
|
331
342
|
};
|
|
343
|
+
port?: number | undefined;
|
|
332
344
|
cloudflare?: {
|
|
333
345
|
enabled: boolean;
|
|
334
346
|
} | undefined;
|
|
@@ -367,6 +379,7 @@ export declare const settingsSchema: z.ZodObject<{
|
|
|
367
379
|
} | undefined;
|
|
368
380
|
}, {
|
|
369
381
|
enabled?: boolean | undefined;
|
|
382
|
+
port?: number | undefined;
|
|
370
383
|
cloudflare?: {
|
|
371
384
|
enabled: boolean;
|
|
372
385
|
} | undefined;
|
|
@@ -425,6 +438,7 @@ export declare const settingsSchema: z.ZodObject<{
|
|
|
425
438
|
maxRetries: number;
|
|
426
439
|
timeout: number;
|
|
427
440
|
};
|
|
441
|
+
port?: number | undefined;
|
|
428
442
|
cloudflare?: {
|
|
429
443
|
enabled: boolean;
|
|
430
444
|
} | undefined;
|
|
@@ -471,6 +485,7 @@ export declare const settingsSchema: z.ZodObject<{
|
|
|
471
485
|
} | undefined;
|
|
472
486
|
captchaSolver?: {
|
|
473
487
|
enabled?: boolean | undefined;
|
|
488
|
+
port?: number | undefined;
|
|
474
489
|
cloudflare?: {
|
|
475
490
|
enabled: boolean;
|
|
476
491
|
} | undefined;
|
|
@@ -28,6 +28,7 @@ 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(),
|
|
31
32
|
cloudflare: baseCaptchaSchema.optional(),
|
|
32
33
|
googleRecaptchaV2: baseCaptchaSchema.optional(),
|
|
33
34
|
googleRecaptchaV3: baseCaptchaSchema.optional(),
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { extendPayload, extendTimeout, runInfo, RunError, getAuthSessionParameters, attemptStore, persistentStore, } from "./runtime";
|
|
1
|
+
export { extendPayload, extendTimeout, runInfo, RunError, getAuthSessionParameters, attemptStore, persistentStore, getAiGatewayConfig, } from "./runtime";
|
|
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";
|