@intuned/runtime-dev 1.3.1-api-token.6 → 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.
- package/dist/commands/api/run.js +5 -3
- package/dist/commands/auth-sessions/load.js +3 -3
- package/dist/commands/auth-sessions/run-check.js +1 -2
- package/dist/commands/auth-sessions/run-create.js +12 -35
- package/dist/commands/interface/run.d.ts +1 -1
- package/dist/commands/interface/run.js +14 -40
- package/dist/commands/intuned-cli/controller/__test__/api.test.js +1 -2
- package/dist/commands/intuned-cli/controller/api.js +1 -2
- package/dist/commands/intuned-cli/controller/authSession.js +3 -4
- package/dist/commands/intuned-cli/controller/save.js +27 -28
- package/dist/commands/intuned-cli/helpers/errors.d.ts +2 -2
- package/dist/commands/intuned-cli/helpers/errors.js +8 -4
- package/dist/commands/intuned-cli/main.js +2 -2
- package/dist/common/asyncLocalStorage/index.d.ts +1 -0
- package/dist/common/constants.d.ts +1 -0
- package/dist/common/constants.js +2 -1
- package/dist/common/extensionsHelpers.d.ts +15 -0
- package/dist/common/extensionsHelpers.js +81 -0
- package/dist/common/playwrightContext.d.ts +54 -0
- package/dist/common/playwrightContext.js +274 -0
- package/dist/common/runApi/importUsingImportFunction.d.ts +9 -0
- package/dist/common/runApi/importUsingImportFunction.js +46 -0
- package/dist/common/runApi/index.d.ts +2 -7
- package/dist/common/runApi/index.js +92 -177
- package/dist/common/runApi/types.d.ts +1 -5
- package/dist/common/runApi/types.js +1 -2
- package/dist/common/settingsSchema.d.ts +513 -0
- package/dist/common/settingsSchema.js +40 -2
- package/dist/common/setupContextHook.d.ts +17 -0
- package/dist/common/setupContextHook.js +22 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +13 -19
- package/dist/runtime/attemptStore.d.ts +2 -0
- package/dist/runtime/attemptStore.js +23 -0
- package/dist/runtime/export.d.ts +51 -41
- package/dist/runtime/index.d.ts +1 -2
- package/dist/runtime/index.js +7 -13
- package/package.json +3 -1
- package/WebTemplate.zip +0 -0
- package/dist/common/getPlaywrightConstructs.d.ts +0 -30
- package/dist/common/getPlaywrightConstructs.js +0 -188
- package/dist/runtime/requestMoreInfo.d.ts +0 -18
- package/dist/runtime/requestMoreInfo.js +0 -25
|
@@ -580,7 +580,6 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
580
580
|
}[] | undefined;
|
|
581
581
|
} | null | undefined;
|
|
582
582
|
}>]>;
|
|
583
|
-
runCheck: z.ZodDefault<z.ZodBoolean>;
|
|
584
583
|
}, "strip", z.ZodTypeAny, {
|
|
585
584
|
session: {
|
|
586
585
|
path: string;
|
|
@@ -614,7 +613,6 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
614
613
|
}[] | undefined;
|
|
615
614
|
} | null | undefined;
|
|
616
615
|
};
|
|
617
|
-
runCheck: boolean;
|
|
618
616
|
}, {
|
|
619
617
|
session: {
|
|
620
618
|
path: string;
|
|
@@ -648,7 +646,6 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
648
646
|
}[] | undefined;
|
|
649
647
|
} | null | undefined;
|
|
650
648
|
};
|
|
651
|
-
runCheck?: boolean | undefined;
|
|
652
649
|
}>>;
|
|
653
650
|
runOptions: z.ZodDefault<z.ZodDiscriminatedUnion<"environment", [z.ZodObject<{
|
|
654
651
|
environment: z.ZodLiteral<"standalone">;
|
|
@@ -754,7 +751,6 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
754
751
|
}[] | undefined;
|
|
755
752
|
} | null | undefined;
|
|
756
753
|
};
|
|
757
|
-
runCheck: boolean;
|
|
758
754
|
} | undefined;
|
|
759
755
|
}, {
|
|
760
756
|
automationFunction: {
|
|
@@ -800,7 +796,6 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
800
796
|
}[] | undefined;
|
|
801
797
|
} | null | undefined;
|
|
802
798
|
};
|
|
803
|
-
runCheck?: boolean | undefined;
|
|
804
799
|
} | undefined;
|
|
805
800
|
runOptions?: {
|
|
806
801
|
environment: "standalone";
|
|
@@ -837,3 +832,4 @@ export type RunApiResultWithSessionOk<R = any> = RunApiResultOk<R> & {
|
|
|
837
832
|
session: RunApiStorageState;
|
|
838
833
|
};
|
|
839
834
|
export type RunApiResult<R = any, FullResult extends RunApiResultOk<R> = RunApiResultOk<R>> = Result<FullResult, RunAutomationError>;
|
|
835
|
+
export type { ImportFunction } from "./importUsingImportFunction";
|
|
@@ -53,8 +53,7 @@ const runApiParametersSchema = exports.runApiParametersSchema = _zod.default.obj
|
|
|
53
53
|
enabled: false
|
|
54
54
|
}),
|
|
55
55
|
auth: _zod.default.object({
|
|
56
|
-
session: runApiSessionSchema
|
|
57
|
-
runCheck: _zod.default.boolean().default(false)
|
|
56
|
+
session: runApiSessionSchema
|
|
58
57
|
}).optional(),
|
|
59
58
|
runOptions: _zod.default.discriminatedUnion("environment", [_zod.default.object({
|
|
60
59
|
environment: _zod.default.literal("standalone"),
|
|
@@ -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
|
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type * as playwright from "playwright";
|
|
2
|
+
import { type RunAutomationError } from "./runApi/errors";
|
|
3
|
+
import { type Err, type Ok } from "neverthrow";
|
|
4
|
+
import { type ImportFunction } from "./runApi/importUsingImportFunction";
|
|
5
|
+
export type InitializeContextHookOptions = {
|
|
6
|
+
apiName: string;
|
|
7
|
+
apiParameters: any;
|
|
8
|
+
cdpUrl: string;
|
|
9
|
+
};
|
|
10
|
+
export type SetupContextHook = (options: InitializeContextHookOptions) => Promise<{
|
|
11
|
+
page: playwright.Page | null;
|
|
12
|
+
context: playwright.BrowserContext;
|
|
13
|
+
cleanup?: () => Promise<void>;
|
|
14
|
+
} | null>;
|
|
15
|
+
export declare function loadSetupContextHook({ importFunction, }: {
|
|
16
|
+
importFunction: ImportFunction;
|
|
17
|
+
}): 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 _errors = require("./runApi/errors");
|
|
8
|
+
var _neverthrow = require("neverthrow");
|
|
9
|
+
var _importUsingImportFunction = require("./runApi/importUsingImportFunction");
|
|
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 _errors.ApiNotFoundError) {
|
|
19
|
+
return (0, _neverthrow.ok)(null);
|
|
20
|
+
}
|
|
21
|
+
return importedFunctionResult;
|
|
22
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { extendPayload, extendTimeout, runInfo, RunError,
|
|
1
|
+
export { extendPayload, extendTimeout, runInfo, RunError, getAuthSessionParameters, attemptStore, } from "./runtime";
|
|
2
2
|
export { runWithContext, getExecutionContext, } from "./common/asyncLocalStorage";
|
|
3
3
|
export { getDownloadDirectoryPath } from "./runtime/downloadDirectory";
|
|
4
|
-
export {
|
|
4
|
+
export { withPlaywrightContext } from "./common/playwrightContext";
|