@intuned/runtime-dev 1.3.3-fix.0 → 1.3.4-dev.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.
@@ -1,8 +1,7 @@
1
1
  export declare const baseRunAuthSessionCommandOptionsSchema: import("zod").ZodObject<{
2
2
  proxy: import("zod").ZodOptional<import("zod").ZodString>;
3
- timeout: import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodDefault<import("zod").ZodString>, import("ms").StringValue, string | undefined>, number, string | undefined>;
4
3
  headless: import("zod").ZodDefault<import("zod").ZodBoolean>;
5
- } & {
4
+ timeout: import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodDefault<import("zod").ZodString>, import("ms").StringValue, string | undefined>, number, string | undefined>;
6
5
  checkAttempts: import("zod").ZodDefault<import("zod").ZodNumber>;
7
6
  createAttempts: import("zod").ZodDefault<import("zod").ZodNumber>;
8
7
  }, "strip", import("zod").ZodTypeAny, {
@@ -15,7 +15,7 @@ export declare const baseCommandOptionsSchema: z.ZodObject<{
15
15
  proxy?: string | undefined;
16
16
  }, {
17
17
  proxy?: string | undefined;
18
- headless?: boolean | undefined;
19
18
  timeout?: string | undefined;
19
+ headless?: boolean | undefined;
20
20
  }>;
21
21
  export type BaseCommandOptions = z.infer<typeof baseCommandOptionsSchema>;
@@ -2,6 +2,7 @@ export declare const API_FOLDER_NAME = "api";
2
2
  export declare const AUTH_SESSIONS_FOLDER_NAME = "auth-sessions";
3
3
  export declare const AUTH_SESSIONS_INSTANCES_FOLDER_NAME = "auth-sessions-instances";
4
4
  export declare const WORKSPACE_ID_ENV_VAR_KEY = "INTUNED_WORKSPACE_ID";
5
+ export declare const EXTENSION_PATH_ENV_VAR_KEY = "INTUNED_EXTENSION_PATH";
5
6
  export declare const PROJECT_ID_ENV_VAR_KEY = "INTUNED_PROJECT_ID";
6
7
  export declare const API_KEY_ENV_VAR_KEY = "INTUNED_API_KEY";
7
8
  export declare const API_KEY_HEADER_NAME = "x-api-key";
@@ -3,11 +3,12 @@
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.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;
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";
10
10
  const WORKSPACE_ID_ENV_VAR_KEY = exports.WORKSPACE_ID_ENV_VAR_KEY = "INTUNED_WORKSPACE_ID";
11
+ const EXTENSION_PATH_ENV_VAR_KEY = exports.EXTENSION_PATH_ENV_VAR_KEY = "INTUNED_EXTENSION_PATH";
11
12
  const PROJECT_ID_ENV_VAR_KEY = exports.PROJECT_ID_ENV_VAR_KEY = "INTUNED_PROJECT_ID";
12
13
  const API_KEY_ENV_VAR_KEY = exports.API_KEY_ENV_VAR_KEY = "INTUNED_API_KEY";
13
14
  const API_KEY_HEADER_NAME = exports.API_KEY_HEADER_NAME = "x-api-key";
@@ -0,0 +1,15 @@
1
+ import * as playwright from "playwright";
2
+ import { CaptchaSolverSettings } from "./settingsSchema";
3
+ type CaptchaSolverSettingsWithRunContext = CaptchaSolverSettings & {
4
+ workspaceId: string;
5
+ projectId: string;
6
+ baseUrl: string;
7
+ token?: string;
8
+ };
9
+ export declare function buildExtensionsList(): string[];
10
+ export declare function getIntunedExtensionPath(): string;
11
+ export declare function isIntunedExtensionEnabled(): boolean;
12
+ export declare function getIntunedExtensionWorker(context: playwright.BrowserContext): Promise<playwright.Worker | null>;
13
+ export declare function getIntunedExtensionSettings(): Promise<CaptchaSolverSettingsWithRunContext>;
14
+ export declare function setupIntunedExtension(): Promise<void>;
15
+ export {};
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.buildExtensionsList = buildExtensionsList;
7
+ exports.getIntunedExtensionPath = getIntunedExtensionPath;
8
+ exports.getIntunedExtensionSettings = getIntunedExtensionSettings;
9
+ exports.getIntunedExtensionWorker = getIntunedExtensionWorker;
10
+ exports.isIntunedExtensionEnabled = isIntunedExtensionEnabled;
11
+ exports.setupIntunedExtension = setupIntunedExtension;
12
+ var _settings = require("../commands/common/utils/settings");
13
+ var _settingsSchema = require("./settingsSchema");
14
+ var _constants = require("./constants");
15
+ var _jwtTokenManager = require("./jwtTokenManager");
16
+ var _path = _interopRequireDefault(require("path"));
17
+ var _promises = require("fs/promises");
18
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
19
+ const INTUNED_WORKER = "intunedWorker.js";
20
+ const INTUNED_EXTENSION_SETTINGS_FILE_NAME = "intunedSettings.json";
21
+ function buildExtensionsList() {
22
+ const extensionsList = [];
23
+ if (isIntunedExtensionEnabled()) {
24
+ const intunedExtensionPath = getIntunedExtensionPath();
25
+ extensionsList.push(intunedExtensionPath);
26
+ }
27
+ return extensionsList;
28
+ }
29
+ function getIntunedExtensionPath() {
30
+ return process.env.INTUNED_EXTENSION_PATH;
31
+ }
32
+ function isIntunedExtensionEnabled() {
33
+ return !!getIntunedExtensionPath();
34
+ }
35
+ async function getIntunedExtensionWorker(context) {
36
+ if (!isIntunedExtensionEnabled()) {
37
+ return null;
38
+ }
39
+ let attemptCount = 0;
40
+ while (attemptCount < 4) {
41
+ const intunedServiceWorker = context.serviceWorkers().find(serviceWorker => serviceWorker.url().includes(INTUNED_WORKER));
42
+ if (intunedServiceWorker) {
43
+ return intunedServiceWorker;
44
+ }
45
+ try {
46
+ await context.waitForEvent("serviceworker", {
47
+ timeout: 3000
48
+ });
49
+ } catch (err) {
50
+ attemptCount++;
51
+ console.log(`Error accessing service workers (attempt ${attemptCount})`);
52
+ }
53
+ }
54
+ console.error("Failed to get intuned worker after 5 attmepts");
55
+ return null;
56
+ }
57
+ async function getIntunedExtensionSettings() {
58
+ const settings = await (0, _settings.getSettings)();
59
+ const captchaSolverSettings = settings.captchaSolver ?? _settingsSchema.captchaSolverSettingsSchema.parse({});
60
+ const [domain, workspaceId, projectId] = [process.env.FUNCTIONS_DOMAIN, process.env[_constants.WORKSPACE_ID_ENV_VAR_KEY], process.env.INTUNED_INTEGRATION_ID ?? process.env[_constants.PROJECT_ID_ENV_VAR_KEY]];
61
+ if (!domain || !workspaceId || !projectId) {
62
+ const missingEnvVars = [domain && "FUNCTIONS_DOMAIN", workspaceId && _constants.WORKSPACE_ID_ENV_VAR_KEY, projectId && `INTUNED_INTEGRATION_ID OR ${_constants.PROJECT_ID_ENV_VAR_KEY}`];
63
+ throw new Error(`Missing required environment variables: ${missingEnvVars}`);
64
+ }
65
+ return {
66
+ ...captchaSolverSettings,
67
+ baseUrl: domain,
68
+ token: _jwtTokenManager.backendFunctionsTokenManager.token,
69
+ workspaceId,
70
+ projectId
71
+ };
72
+ }
73
+ async function setupIntunedExtension() {
74
+ if (!isIntunedExtensionEnabled()) {
75
+ return;
76
+ }
77
+ const intunedExtensionPath = getIntunedExtensionPath();
78
+ const intunedExtensionSettingsPath = _path.default.join(intunedExtensionPath, INTUNED_EXTENSION_SETTINGS_FILE_NAME);
79
+ const settings = await getIntunedExtensionSettings();
80
+ await (0, _promises.writeFile)(intunedExtensionSettingsPath, JSON.stringify(settings));
81
+ }
@@ -19,6 +19,7 @@ var _errors = require("./runApi/errors");
19
19
  var _neverthrow = require("neverthrow");
20
20
  var _setupContextHook = require("./setupContextHook");
21
21
  var _portfinder = require("portfinder");
22
+ var _extensionsHelpers = require("./extensionsHelpers");
22
23
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
23
24
  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); }
24
25
  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; }
@@ -59,17 +60,30 @@ async function launchChromium({
59
60
  context
60
61
  };
61
62
  }
63
+ const defaultArgsToIgnore = ["--disable-extensions", "--disable-component-extensions-with-background-pages", "--disable-background-networking", "--disable-backgrounding-occluded-windows", "--disable-background-timer-throttling"];
62
64
  const extraArgs = [];
63
65
  const userDataDir = await createUserDirWithPreferences();
66
+ if ((0, _extensionsHelpers.isIntunedExtensionEnabled)()) {
67
+ const extensionsList = (0, _extensionsHelpers.buildExtensionsList)();
68
+ const extensions = extensionsList.join(",");
69
+ extraArgs.push(`--disable-extensions-except=${extensions}`);
70
+ extraArgs.push(`--load-extension=${extensions}`);
71
+ await (0, _extensionsHelpers.setupIntunedExtension)();
72
+ }
64
73
  if (cdpPort) {
65
74
  extraArgs.push(`--remote-debugging-port=${cdpPort}`);
66
75
  }
76
+ if (headless) {
77
+ defaultArgsToIgnore.push("--headless=old");
78
+ extraArgs.push("--headless=new");
79
+ }
67
80
  const context = await playwright.chromium.launchPersistentContext(userDataDir, {
68
81
  headless,
69
82
  viewport: null,
70
83
  proxy,
71
84
  downloadsPath,
72
- args: extraArgs
85
+ args: extraArgs,
86
+ ignoreDefaultArgs: defaultArgsToIgnore
73
87
  });
74
88
  context.once("close", async () => {
75
89
  try {
@@ -83,6 +97,9 @@ async function launchChromium({
83
97
  console.error("Failed to remove user data dir", error);
84
98
  }
85
99
  });
100
+ if ((0, _extensionsHelpers.isIntunedExtensionEnabled)()) {
101
+ await (0, _extensionsHelpers.getIntunedExtensionWorker)(context);
102
+ }
86
103
  if (cdpPort) {
87
104
  const createdCdpAddress = getLocalCdpAddress(cdpPort);
88
105
  await waitOnCdpAddress(createdCdpAddress);
@@ -673,12 +673,12 @@ export declare const runApiParametersSchema: z.ZodObject<{
673
673
  } | undefined;
674
674
  }, {
675
675
  environment: "standalone";
676
+ headless?: boolean | undefined;
676
677
  proxy?: {
677
678
  server: string;
678
679
  username: string;
679
680
  password: string;
680
681
  } | undefined;
681
- headless?: boolean | undefined;
682
682
  }>, z.ZodObject<{
683
683
  environment: z.ZodLiteral<"cdp">;
684
684
  cdpAddress: z.ZodString;
@@ -799,12 +799,12 @@ export declare const runApiParametersSchema: z.ZodObject<{
799
799
  } | undefined;
800
800
  runOptions?: {
801
801
  environment: "standalone";
802
+ headless?: boolean | undefined;
802
803
  proxy?: {
803
804
  server: string;
804
805
  username: string;
805
806
  password: string;
806
807
  } | undefined;
807
- headless?: boolean | undefined;
808
808
  } | {
809
809
  mode: "vanilla" | "playwright" | "playwright-standalone" | "playwright-headless";
810
810
  environment: "cdp";
@@ -1,4 +1,212 @@
1
1
  import * as z from "zod";
2
+ export declare const captchaSolverSettingsSchema: z.ZodDefault<z.ZodObject<{
3
+ enabled: z.ZodDefault<z.ZodBoolean>;
4
+ workspaceId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
5
+ projectId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
6
+ baseUrl: z.ZodNullable<z.ZodOptional<z.ZodString>>;
7
+ token: z.ZodNullable<z.ZodOptional<z.ZodString>>;
8
+ cloudflare: z.ZodOptional<z.ZodObject<{
9
+ enabled: z.ZodBoolean;
10
+ }, "strip", z.ZodTypeAny, {
11
+ enabled: boolean;
12
+ }, {
13
+ enabled: boolean;
14
+ }>>;
15
+ googleRecaptchaV2: z.ZodOptional<z.ZodObject<{
16
+ enabled: z.ZodBoolean;
17
+ }, "strip", z.ZodTypeAny, {
18
+ enabled: boolean;
19
+ }, {
20
+ enabled: boolean;
21
+ }>>;
22
+ googleRecaptchaV3: z.ZodOptional<z.ZodObject<{
23
+ enabled: z.ZodBoolean;
24
+ }, "strip", z.ZodTypeAny, {
25
+ enabled: boolean;
26
+ }, {
27
+ enabled: boolean;
28
+ }>>;
29
+ awscaptcha: z.ZodOptional<z.ZodObject<{
30
+ enabled: z.ZodBoolean;
31
+ }, "strip", z.ZodTypeAny, {
32
+ enabled: boolean;
33
+ }, {
34
+ enabled: boolean;
35
+ }>>;
36
+ hcaptcha: z.ZodOptional<z.ZodObject<{
37
+ enabled: z.ZodBoolean;
38
+ }, "strip", z.ZodTypeAny, {
39
+ enabled: boolean;
40
+ }, {
41
+ enabled: boolean;
42
+ }>>;
43
+ funcaptcha: z.ZodOptional<z.ZodObject<{
44
+ enabled: z.ZodBoolean;
45
+ }, "strip", z.ZodTypeAny, {
46
+ enabled: boolean;
47
+ }, {
48
+ enabled: boolean;
49
+ }>>;
50
+ geetest: z.ZodOptional<z.ZodObject<{
51
+ enabled: z.ZodBoolean;
52
+ }, "strip", z.ZodTypeAny, {
53
+ enabled: boolean;
54
+ }, {
55
+ enabled: boolean;
56
+ }>>;
57
+ lemin: z.ZodOptional<z.ZodObject<{
58
+ enabled: z.ZodBoolean;
59
+ }, "strip", z.ZodTypeAny, {
60
+ enabled: boolean;
61
+ }, {
62
+ enabled: boolean;
63
+ }>>;
64
+ customCaptcha: z.ZodOptional<z.ZodObject<{
65
+ enabled: z.ZodBoolean;
66
+ imageLocators: z.ZodArray<z.ZodString, "many">;
67
+ submitLocators: z.ZodArray<z.ZodString, "many">;
68
+ inputLocators: z.ZodArray<z.ZodString, "many">;
69
+ }, "strip", z.ZodTypeAny, {
70
+ enabled: boolean;
71
+ imageLocators: string[];
72
+ submitLocators: string[];
73
+ inputLocators: string[];
74
+ }, {
75
+ enabled: boolean;
76
+ imageLocators: string[];
77
+ submitLocators: string[];
78
+ inputLocators: string[];
79
+ }>>;
80
+ text: z.ZodOptional<z.ZodObject<{
81
+ enabled: z.ZodBoolean;
82
+ labelLocators: z.ZodArray<z.ZodString, "many">;
83
+ submitLocators: z.ZodArray<z.ZodString, "many">;
84
+ inputLocators: z.ZodArray<z.ZodString, "many">;
85
+ }, "strip", z.ZodTypeAny, {
86
+ enabled: boolean;
87
+ submitLocators: string[];
88
+ inputLocators: string[];
89
+ labelLocators: string[];
90
+ }, {
91
+ enabled: boolean;
92
+ submitLocators: string[];
93
+ inputLocators: string[];
94
+ labelLocators: string[];
95
+ }>>;
96
+ settings: z.ZodDefault<z.ZodOptional<z.ZodObject<{
97
+ autoSolve: z.ZodDefault<z.ZodBoolean>;
98
+ solveDelay: z.ZodDefault<z.ZodNumber>;
99
+ maxRetries: z.ZodDefault<z.ZodNumber>;
100
+ timeout: z.ZodDefault<z.ZodNumber>;
101
+ }, "strip", z.ZodTypeAny, {
102
+ autoSolve: boolean;
103
+ solveDelay: number;
104
+ maxRetries: number;
105
+ timeout: number;
106
+ }, {
107
+ autoSolve?: boolean | undefined;
108
+ solveDelay?: number | undefined;
109
+ maxRetries?: number | undefined;
110
+ timeout?: number | undefined;
111
+ }>>>;
112
+ }, "strip", z.ZodTypeAny, {
113
+ enabled: boolean;
114
+ settings: {
115
+ autoSolve: boolean;
116
+ solveDelay: number;
117
+ maxRetries: number;
118
+ timeout: number;
119
+ };
120
+ workspaceId?: string | null | undefined;
121
+ projectId?: string | null | undefined;
122
+ baseUrl?: string | null | undefined;
123
+ token?: string | null | undefined;
124
+ cloudflare?: {
125
+ enabled: boolean;
126
+ } | undefined;
127
+ googleRecaptchaV2?: {
128
+ enabled: boolean;
129
+ } | undefined;
130
+ googleRecaptchaV3?: {
131
+ enabled: boolean;
132
+ } | undefined;
133
+ awscaptcha?: {
134
+ enabled: boolean;
135
+ } | undefined;
136
+ hcaptcha?: {
137
+ enabled: boolean;
138
+ } | undefined;
139
+ funcaptcha?: {
140
+ enabled: boolean;
141
+ } | undefined;
142
+ geetest?: {
143
+ enabled: boolean;
144
+ } | undefined;
145
+ lemin?: {
146
+ enabled: boolean;
147
+ } | undefined;
148
+ customCaptcha?: {
149
+ enabled: boolean;
150
+ imageLocators: string[];
151
+ submitLocators: string[];
152
+ inputLocators: string[];
153
+ } | undefined;
154
+ text?: {
155
+ enabled: boolean;
156
+ submitLocators: string[];
157
+ inputLocators: string[];
158
+ labelLocators: string[];
159
+ } | undefined;
160
+ }, {
161
+ enabled?: boolean | undefined;
162
+ workspaceId?: string | null | undefined;
163
+ projectId?: string | null | undefined;
164
+ baseUrl?: string | null | undefined;
165
+ token?: string | null | undefined;
166
+ cloudflare?: {
167
+ enabled: boolean;
168
+ } | undefined;
169
+ googleRecaptchaV2?: {
170
+ enabled: boolean;
171
+ } | undefined;
172
+ googleRecaptchaV3?: {
173
+ enabled: boolean;
174
+ } | undefined;
175
+ awscaptcha?: {
176
+ enabled: boolean;
177
+ } | undefined;
178
+ hcaptcha?: {
179
+ enabled: boolean;
180
+ } | undefined;
181
+ funcaptcha?: {
182
+ enabled: boolean;
183
+ } | undefined;
184
+ geetest?: {
185
+ enabled: boolean;
186
+ } | undefined;
187
+ lemin?: {
188
+ enabled: boolean;
189
+ } | undefined;
190
+ customCaptcha?: {
191
+ enabled: boolean;
192
+ imageLocators: string[];
193
+ submitLocators: string[];
194
+ inputLocators: string[];
195
+ } | undefined;
196
+ text?: {
197
+ enabled: boolean;
198
+ submitLocators: string[];
199
+ inputLocators: string[];
200
+ labelLocators: string[];
201
+ } | undefined;
202
+ settings?: {
203
+ autoSolve?: boolean | undefined;
204
+ solveDelay?: number | undefined;
205
+ maxRetries?: number | undefined;
206
+ timeout?: number | undefined;
207
+ } | undefined;
208
+ }>>;
209
+ export type CaptchaSolverSettings = z.infer<typeof captchaSolverSettingsSchema>;
2
210
  export declare const settingsSchema: z.ZodObject<{
3
211
  authSessions: z.ZodDefault<z.ZodOptional<z.ZodObject<{
4
212
  enabled: z.ZodBoolean;
@@ -7,13 +215,318 @@ export declare const settingsSchema: z.ZodObject<{
7
215
  }, {
8
216
  enabled: boolean;
9
217
  }>>>;
218
+ captchaSolver: z.ZodOptional<z.ZodDefault<z.ZodObject<{
219
+ enabled: z.ZodDefault<z.ZodBoolean>;
220
+ workspaceId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
221
+ projectId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
222
+ baseUrl: z.ZodNullable<z.ZodOptional<z.ZodString>>;
223
+ token: z.ZodNullable<z.ZodOptional<z.ZodString>>;
224
+ cloudflare: z.ZodOptional<z.ZodObject<{
225
+ enabled: z.ZodBoolean;
226
+ }, "strip", z.ZodTypeAny, {
227
+ enabled: boolean;
228
+ }, {
229
+ enabled: boolean;
230
+ }>>;
231
+ googleRecaptchaV2: z.ZodOptional<z.ZodObject<{
232
+ enabled: z.ZodBoolean;
233
+ }, "strip", z.ZodTypeAny, {
234
+ enabled: boolean;
235
+ }, {
236
+ enabled: boolean;
237
+ }>>;
238
+ googleRecaptchaV3: z.ZodOptional<z.ZodObject<{
239
+ enabled: z.ZodBoolean;
240
+ }, "strip", z.ZodTypeAny, {
241
+ enabled: boolean;
242
+ }, {
243
+ enabled: boolean;
244
+ }>>;
245
+ awscaptcha: z.ZodOptional<z.ZodObject<{
246
+ enabled: z.ZodBoolean;
247
+ }, "strip", z.ZodTypeAny, {
248
+ enabled: boolean;
249
+ }, {
250
+ enabled: boolean;
251
+ }>>;
252
+ hcaptcha: z.ZodOptional<z.ZodObject<{
253
+ enabled: z.ZodBoolean;
254
+ }, "strip", z.ZodTypeAny, {
255
+ enabled: boolean;
256
+ }, {
257
+ enabled: boolean;
258
+ }>>;
259
+ funcaptcha: z.ZodOptional<z.ZodObject<{
260
+ enabled: z.ZodBoolean;
261
+ }, "strip", z.ZodTypeAny, {
262
+ enabled: boolean;
263
+ }, {
264
+ enabled: boolean;
265
+ }>>;
266
+ geetest: z.ZodOptional<z.ZodObject<{
267
+ enabled: z.ZodBoolean;
268
+ }, "strip", z.ZodTypeAny, {
269
+ enabled: boolean;
270
+ }, {
271
+ enabled: boolean;
272
+ }>>;
273
+ lemin: z.ZodOptional<z.ZodObject<{
274
+ enabled: z.ZodBoolean;
275
+ }, "strip", z.ZodTypeAny, {
276
+ enabled: boolean;
277
+ }, {
278
+ enabled: boolean;
279
+ }>>;
280
+ customCaptcha: z.ZodOptional<z.ZodObject<{
281
+ enabled: z.ZodBoolean;
282
+ imageLocators: z.ZodArray<z.ZodString, "many">;
283
+ submitLocators: z.ZodArray<z.ZodString, "many">;
284
+ inputLocators: z.ZodArray<z.ZodString, "many">;
285
+ }, "strip", z.ZodTypeAny, {
286
+ enabled: boolean;
287
+ imageLocators: string[];
288
+ submitLocators: string[];
289
+ inputLocators: string[];
290
+ }, {
291
+ enabled: boolean;
292
+ imageLocators: string[];
293
+ submitLocators: string[];
294
+ inputLocators: string[];
295
+ }>>;
296
+ text: z.ZodOptional<z.ZodObject<{
297
+ enabled: z.ZodBoolean;
298
+ labelLocators: z.ZodArray<z.ZodString, "many">;
299
+ submitLocators: z.ZodArray<z.ZodString, "many">;
300
+ inputLocators: z.ZodArray<z.ZodString, "many">;
301
+ }, "strip", z.ZodTypeAny, {
302
+ enabled: boolean;
303
+ submitLocators: string[];
304
+ inputLocators: string[];
305
+ labelLocators: string[];
306
+ }, {
307
+ enabled: boolean;
308
+ submitLocators: string[];
309
+ inputLocators: string[];
310
+ labelLocators: string[];
311
+ }>>;
312
+ settings: z.ZodDefault<z.ZodOptional<z.ZodObject<{
313
+ autoSolve: z.ZodDefault<z.ZodBoolean>;
314
+ solveDelay: z.ZodDefault<z.ZodNumber>;
315
+ maxRetries: z.ZodDefault<z.ZodNumber>;
316
+ timeout: z.ZodDefault<z.ZodNumber>;
317
+ }, "strip", z.ZodTypeAny, {
318
+ autoSolve: boolean;
319
+ solveDelay: number;
320
+ maxRetries: number;
321
+ timeout: number;
322
+ }, {
323
+ autoSolve?: boolean | undefined;
324
+ solveDelay?: number | undefined;
325
+ maxRetries?: number | undefined;
326
+ timeout?: number | undefined;
327
+ }>>>;
328
+ }, "strip", z.ZodTypeAny, {
329
+ enabled: boolean;
330
+ settings: {
331
+ autoSolve: boolean;
332
+ solveDelay: number;
333
+ maxRetries: number;
334
+ timeout: number;
335
+ };
336
+ workspaceId?: string | null | undefined;
337
+ projectId?: string | null | undefined;
338
+ baseUrl?: string | null | undefined;
339
+ token?: string | null | undefined;
340
+ cloudflare?: {
341
+ enabled: boolean;
342
+ } | undefined;
343
+ googleRecaptchaV2?: {
344
+ enabled: boolean;
345
+ } | undefined;
346
+ googleRecaptchaV3?: {
347
+ enabled: boolean;
348
+ } | undefined;
349
+ awscaptcha?: {
350
+ enabled: boolean;
351
+ } | undefined;
352
+ hcaptcha?: {
353
+ enabled: boolean;
354
+ } | undefined;
355
+ funcaptcha?: {
356
+ enabled: boolean;
357
+ } | undefined;
358
+ geetest?: {
359
+ enabled: boolean;
360
+ } | undefined;
361
+ lemin?: {
362
+ enabled: boolean;
363
+ } | undefined;
364
+ customCaptcha?: {
365
+ enabled: boolean;
366
+ imageLocators: string[];
367
+ submitLocators: string[];
368
+ inputLocators: string[];
369
+ } | undefined;
370
+ text?: {
371
+ enabled: boolean;
372
+ submitLocators: string[];
373
+ inputLocators: string[];
374
+ labelLocators: string[];
375
+ } | undefined;
376
+ }, {
377
+ enabled?: boolean | undefined;
378
+ workspaceId?: string | null | undefined;
379
+ projectId?: string | null | undefined;
380
+ baseUrl?: string | null | undefined;
381
+ token?: string | null | undefined;
382
+ cloudflare?: {
383
+ enabled: boolean;
384
+ } | undefined;
385
+ googleRecaptchaV2?: {
386
+ enabled: boolean;
387
+ } | undefined;
388
+ googleRecaptchaV3?: {
389
+ enabled: boolean;
390
+ } | undefined;
391
+ awscaptcha?: {
392
+ enabled: boolean;
393
+ } | undefined;
394
+ hcaptcha?: {
395
+ enabled: boolean;
396
+ } | undefined;
397
+ funcaptcha?: {
398
+ enabled: boolean;
399
+ } | undefined;
400
+ geetest?: {
401
+ enabled: boolean;
402
+ } | undefined;
403
+ lemin?: {
404
+ enabled: boolean;
405
+ } | undefined;
406
+ customCaptcha?: {
407
+ enabled: boolean;
408
+ imageLocators: string[];
409
+ submitLocators: string[];
410
+ inputLocators: string[];
411
+ } | undefined;
412
+ text?: {
413
+ enabled: boolean;
414
+ submitLocators: string[];
415
+ inputLocators: string[];
416
+ labelLocators: string[];
417
+ } | undefined;
418
+ settings?: {
419
+ autoSolve?: boolean | undefined;
420
+ solveDelay?: number | undefined;
421
+ maxRetries?: number | undefined;
422
+ timeout?: number | undefined;
423
+ } | undefined;
424
+ }>>>;
10
425
  }, "strip", z.ZodTypeAny, {
11
426
  authSessions: {
12
427
  enabled: boolean;
13
428
  };
429
+ captchaSolver?: {
430
+ enabled: boolean;
431
+ settings: {
432
+ autoSolve: boolean;
433
+ solveDelay: number;
434
+ maxRetries: number;
435
+ timeout: number;
436
+ };
437
+ workspaceId?: string | null | undefined;
438
+ projectId?: string | null | undefined;
439
+ baseUrl?: string | null | undefined;
440
+ token?: string | null | undefined;
441
+ cloudflare?: {
442
+ enabled: boolean;
443
+ } | undefined;
444
+ googleRecaptchaV2?: {
445
+ enabled: boolean;
446
+ } | undefined;
447
+ googleRecaptchaV3?: {
448
+ enabled: boolean;
449
+ } | undefined;
450
+ awscaptcha?: {
451
+ enabled: boolean;
452
+ } | undefined;
453
+ hcaptcha?: {
454
+ enabled: boolean;
455
+ } | undefined;
456
+ funcaptcha?: {
457
+ enabled: boolean;
458
+ } | undefined;
459
+ geetest?: {
460
+ enabled: boolean;
461
+ } | undefined;
462
+ lemin?: {
463
+ enabled: boolean;
464
+ } | undefined;
465
+ customCaptcha?: {
466
+ enabled: boolean;
467
+ imageLocators: string[];
468
+ submitLocators: string[];
469
+ inputLocators: string[];
470
+ } | undefined;
471
+ text?: {
472
+ enabled: boolean;
473
+ submitLocators: string[];
474
+ inputLocators: string[];
475
+ labelLocators: string[];
476
+ } | undefined;
477
+ } | undefined;
14
478
  }, {
15
479
  authSessions?: {
16
480
  enabled: boolean;
17
481
  } | undefined;
482
+ captchaSolver?: {
483
+ enabled?: boolean | undefined;
484
+ workspaceId?: string | null | undefined;
485
+ projectId?: string | null | undefined;
486
+ baseUrl?: string | null | undefined;
487
+ token?: string | null | undefined;
488
+ cloudflare?: {
489
+ enabled: boolean;
490
+ } | undefined;
491
+ googleRecaptchaV2?: {
492
+ enabled: boolean;
493
+ } | undefined;
494
+ googleRecaptchaV3?: {
495
+ enabled: boolean;
496
+ } | undefined;
497
+ awscaptcha?: {
498
+ enabled: boolean;
499
+ } | undefined;
500
+ hcaptcha?: {
501
+ enabled: boolean;
502
+ } | undefined;
503
+ funcaptcha?: {
504
+ enabled: boolean;
505
+ } | undefined;
506
+ geetest?: {
507
+ enabled: boolean;
508
+ } | undefined;
509
+ lemin?: {
510
+ enabled: boolean;
511
+ } | undefined;
512
+ customCaptcha?: {
513
+ enabled: boolean;
514
+ imageLocators: string[];
515
+ submitLocators: string[];
516
+ inputLocators: string[];
517
+ } | undefined;
518
+ text?: {
519
+ enabled: boolean;
520
+ submitLocators: string[];
521
+ inputLocators: string[];
522
+ labelLocators: string[];
523
+ } | undefined;
524
+ settings?: {
525
+ autoSolve?: boolean | undefined;
526
+ solveDelay?: number | undefined;
527
+ maxRetries?: number | undefined;
528
+ timeout?: number | undefined;
529
+ } | undefined;
530
+ } | undefined;
18
531
  }>;
19
532
  export type IntunedSettings = z.infer<typeof settingsSchema>;
@@ -3,15 +3,53 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.settingsSchema = void 0;
6
+ exports.settingsSchema = exports.captchaSolverSettingsSchema = void 0;
7
7
  var z = _interopRequireWildcard(require("zod"));
8
8
  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); }
9
9
  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; }
10
+ const baseCaptchaSchema = z.object({
11
+ enabled: z.boolean()
12
+ });
13
+ const customCaptchaSchema = baseCaptchaSchema.extend({
14
+ imageLocators: z.array(z.string()).min(1, "At least one image locator is required"),
15
+ submitLocators: z.array(z.string()).min(1, "At least one submit locator is required"),
16
+ inputLocators: z.array(z.string()).min(1, "At least one input locator is required")
17
+ });
18
+ const textCaptchaSchema = baseCaptchaSchema.extend({
19
+ labelLocators: z.array(z.string()).min(1, "At least one image locator is required"),
20
+ submitLocators: z.array(z.string()).min(1, "At least one submit locator is required"),
21
+ inputLocators: z.array(z.string()).min(1, "At least one input locator is required")
22
+ });
23
+ const captchaSolverSolveSettingsSchema = z.object({
24
+ autoSolve: z.boolean().default(true),
25
+ solveDelay: z.number().min(0).default(2000),
26
+ maxRetries: z.number().min(0).default(3),
27
+ timeout: z.number().min(0).default(30000)
28
+ });
29
+ const captchaSolverSettingsSchema = exports.captchaSolverSettingsSchema = z.object({
30
+ enabled: z.boolean().default(false),
31
+ workspaceId: z.string().optional().nullable(),
32
+ projectId: z.string().optional().nullable(),
33
+ baseUrl: z.string().optional().nullable(),
34
+ token: z.string().optional().nullable(),
35
+ cloudflare: baseCaptchaSchema.optional(),
36
+ googleRecaptchaV2: baseCaptchaSchema.optional(),
37
+ googleRecaptchaV3: baseCaptchaSchema.optional(),
38
+ awscaptcha: baseCaptchaSchema.optional(),
39
+ hcaptcha: baseCaptchaSchema.optional(),
40
+ funcaptcha: baseCaptchaSchema.optional(),
41
+ geetest: baseCaptchaSchema.optional(),
42
+ lemin: baseCaptchaSchema.optional(),
43
+ customCaptcha: customCaptchaSchema.optional(),
44
+ text: textCaptchaSchema.optional(),
45
+ settings: captchaSolverSolveSettingsSchema.optional().default({})
46
+ }).default({});
10
47
  const authSessionsSchema = z.object({
11
48
  enabled: z.boolean()
12
49
  }).optional().default({
13
50
  enabled: false
14
51
  });
15
52
  const settingsSchema = exports.settingsSchema = z.object({
16
- authSessions: authSessionsSchema
53
+ authSessions: authSessionsSchema,
54
+ captchaSolver: captchaSolverSettingsSchema.optional()
17
55
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intuned/runtime-dev",
3
- "version": "1.3.3-fix.0",
3
+ "version": "1.3.4-dev.0",
4
4
  "description": "Intuned runtime",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",
package/WebTemplate.zip DELETED
Binary file