@intuned/runtime 1.3.6 → 1.3.7

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,15 +1,8 @@
1
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
- };
2
+ import { CaptchaSolverSettingsWithRunContext } from "./settingsSchema";
9
3
  export declare function buildExtensionsList(): string[];
10
4
  export declare function getIntunedExtensionPath(): string;
11
5
  export declare function isIntunedExtensionEnabled(): boolean;
12
6
  export declare function getIntunedExtensionWorker(context: playwright.BrowserContext): Promise<playwright.Worker | null>;
13
7
  export declare function getIntunedExtensionSettings(): Promise<CaptchaSolverSettingsWithRunContext>;
14
8
  export declare function setupIntunedExtension(): Promise<void>;
15
- export {};
@@ -56,18 +56,17 @@ async function getIntunedExtensionWorker(context) {
56
56
  }
57
57
  async function getIntunedExtensionSettings() {
58
58
  const settings = await (0, _settings.getSettings)();
59
- const captchaSolverSettings = settings.captchaSolver ?? _settingsSchema.captchaSolverSettingsSchema.parse({});
60
59
  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
60
  if (!domain || !workspaceId || !projectId) {
62
61
  const missingEnvVars = [domain && "FUNCTIONS_DOMAIN", workspaceId && _constants.WORKSPACE_ID_ENV_VAR_KEY, projectId && `INTUNED_INTEGRATION_ID OR ${_constants.PROJECT_ID_ENV_VAR_KEY}`];
63
62
  throw new Error(`Missing required environment variables: ${missingEnvVars}`);
64
63
  }
65
64
  return {
66
- ...captchaSolverSettings,
67
- baseUrl: domain,
68
- token: _jwtTokenManager.backendFunctionsTokenManager.token,
65
+ ...(settings.captchaSolver ?? _settingsSchema.captchaSolverSettingsSchema.parse({})),
69
66
  workspaceId,
70
- projectId
67
+ projectId,
68
+ baseUrl: domain,
69
+ token: _jwtTokenManager.backendFunctionsTokenManager.token
71
70
  };
72
71
  }
73
72
  async function setupIntunedExtension() {
@@ -1,10 +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
- 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
4
  cloudflare: z.ZodOptional<z.ZodObject<{
9
5
  enabled: z.ZodBoolean;
10
6
  }, "strip", z.ZodTypeAny, {
@@ -93,7 +89,7 @@ export declare const captchaSolverSettingsSchema: z.ZodDefault<z.ZodObject<{
93
89
  inputLocators: string[];
94
90
  labelLocators: string[];
95
91
  }>>;
96
- settings: z.ZodDefault<z.ZodOptional<z.ZodObject<{
92
+ settings: z.ZodDefault<z.ZodObject<{
97
93
  autoSolve: z.ZodDefault<z.ZodBoolean>;
98
94
  solveDelay: z.ZodDefault<z.ZodNumber>;
99
95
  maxRetries: z.ZodDefault<z.ZodNumber>;
@@ -108,7 +104,7 @@ export declare const captchaSolverSettingsSchema: z.ZodDefault<z.ZodObject<{
108
104
  solveDelay?: number | undefined;
109
105
  maxRetries?: number | undefined;
110
106
  timeout?: number | undefined;
111
- }>>>;
107
+ }>>;
112
108
  }, "strip", z.ZodTypeAny, {
113
109
  enabled: boolean;
114
110
  settings: {
@@ -117,10 +113,6 @@ export declare const captchaSolverSettingsSchema: z.ZodDefault<z.ZodObject<{
117
113
  maxRetries: number;
118
114
  timeout: number;
119
115
  };
120
- workspaceId?: string | null | undefined;
121
- projectId?: string | null | undefined;
122
- baseUrl?: string | null | undefined;
123
- token?: string | null | undefined;
124
116
  cloudflare?: {
125
117
  enabled: boolean;
126
118
  } | undefined;
@@ -159,10 +151,6 @@ export declare const captchaSolverSettingsSchema: z.ZodDefault<z.ZodObject<{
159
151
  } | undefined;
160
152
  }, {
161
153
  enabled?: boolean | undefined;
162
- workspaceId?: string | null | undefined;
163
- projectId?: string | null | undefined;
164
- baseUrl?: string | null | undefined;
165
- token?: string | null | undefined;
166
154
  cloudflare?: {
167
155
  enabled: boolean;
168
156
  } | undefined;
@@ -206,7 +194,12 @@ export declare const captchaSolverSettingsSchema: z.ZodDefault<z.ZodObject<{
206
194
  timeout?: number | undefined;
207
195
  } | undefined;
208
196
  }>>;
209
- export type CaptchaSolverSettings = z.infer<typeof captchaSolverSettingsSchema>;
197
+ export type CaptchaSolverSettingsWithRunContext = z.infer<typeof captchaSolverSettingsSchema> & {
198
+ workspaceId: string;
199
+ projectId: string;
200
+ baseUrl: string;
201
+ token?: string;
202
+ };
210
203
  export declare const settingsSchema: z.ZodObject<{
211
204
  authSessions: z.ZodDefault<z.ZodOptional<z.ZodObject<{
212
205
  enabled: z.ZodBoolean;
@@ -217,10 +210,6 @@ export declare const settingsSchema: z.ZodObject<{
217
210
  }>>>;
218
211
  captchaSolver: z.ZodOptional<z.ZodDefault<z.ZodObject<{
219
212
  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
213
  cloudflare: z.ZodOptional<z.ZodObject<{
225
214
  enabled: z.ZodBoolean;
226
215
  }, "strip", z.ZodTypeAny, {
@@ -309,7 +298,7 @@ export declare const settingsSchema: z.ZodObject<{
309
298
  inputLocators: string[];
310
299
  labelLocators: string[];
311
300
  }>>;
312
- settings: z.ZodDefault<z.ZodOptional<z.ZodObject<{
301
+ settings: z.ZodDefault<z.ZodObject<{
313
302
  autoSolve: z.ZodDefault<z.ZodBoolean>;
314
303
  solveDelay: z.ZodDefault<z.ZodNumber>;
315
304
  maxRetries: z.ZodDefault<z.ZodNumber>;
@@ -324,7 +313,7 @@ export declare const settingsSchema: z.ZodObject<{
324
313
  solveDelay?: number | undefined;
325
314
  maxRetries?: number | undefined;
326
315
  timeout?: number | undefined;
327
- }>>>;
316
+ }>>;
328
317
  }, "strip", z.ZodTypeAny, {
329
318
  enabled: boolean;
330
319
  settings: {
@@ -333,10 +322,6 @@ export declare const settingsSchema: z.ZodObject<{
333
322
  maxRetries: number;
334
323
  timeout: number;
335
324
  };
336
- workspaceId?: string | null | undefined;
337
- projectId?: string | null | undefined;
338
- baseUrl?: string | null | undefined;
339
- token?: string | null | undefined;
340
325
  cloudflare?: {
341
326
  enabled: boolean;
342
327
  } | undefined;
@@ -375,10 +360,6 @@ export declare const settingsSchema: z.ZodObject<{
375
360
  } | undefined;
376
361
  }, {
377
362
  enabled?: boolean | undefined;
378
- workspaceId?: string | null | undefined;
379
- projectId?: string | null | undefined;
380
- baseUrl?: string | null | undefined;
381
- token?: string | null | undefined;
382
363
  cloudflare?: {
383
364
  enabled: boolean;
384
365
  } | undefined;
@@ -434,10 +415,6 @@ export declare const settingsSchema: z.ZodObject<{
434
415
  maxRetries: number;
435
416
  timeout: number;
436
417
  };
437
- workspaceId?: string | null | undefined;
438
- projectId?: string | null | undefined;
439
- baseUrl?: string | null | undefined;
440
- token?: string | null | undefined;
441
418
  cloudflare?: {
442
419
  enabled: boolean;
443
420
  } | undefined;
@@ -481,10 +458,6 @@ export declare const settingsSchema: z.ZodObject<{
481
458
  } | undefined;
482
459
  captchaSolver?: {
483
460
  enabled?: boolean | undefined;
484
- workspaceId?: string | null | undefined;
485
- projectId?: string | null | undefined;
486
- baseUrl?: string | null | undefined;
487
- token?: string | null | undefined;
488
461
  cloudflare?: {
489
462
  enabled: boolean;
490
463
  } | undefined;
@@ -28,10 +28,6 @@ const captchaSolverSolveSettingsSchema = z.object({
28
28
  });
29
29
  const captchaSolverSettingsSchema = exports.captchaSolverSettingsSchema = z.object({
30
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
31
  cloudflare: baseCaptchaSchema.optional(),
36
32
  googleRecaptchaV2: baseCaptchaSchema.optional(),
37
33
  googleRecaptchaV3: baseCaptchaSchema.optional(),
@@ -42,7 +38,7 @@ const captchaSolverSettingsSchema = exports.captchaSolverSettingsSchema = z.obje
42
38
  lemin: baseCaptchaSchema.optional(),
43
39
  customCaptcha: customCaptchaSchema.optional(),
44
40
  text: textCaptchaSchema.optional(),
45
- settings: captchaSolverSolveSettingsSchema.optional().default({})
41
+ settings: captchaSolverSolveSettingsSchema.default(captchaSolverSolveSettingsSchema.parse({}))
46
42
  }).default({});
47
43
  const authSessionsSchema = z.object({
48
44
  enabled: z.boolean()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intuned/runtime",
3
- "version": "1.3.6",
3
+ "version": "1.3.7",
4
4
  "description": "Intuned runtime",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",
package/WebTemplate.zip DELETED
Binary file