@intuned/runtime 1.0.5

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.
Files changed (110) hide show
  1. package/.babelrc +21 -0
  2. package/.eslintignore +10 -0
  3. package/.eslintrc.js +39 -0
  4. package/CHANGELOG.md +7 -0
  5. package/InterfaceTemplate/index.playwright.ts +5 -0
  6. package/InterfaceTemplate/utils.ts +39 -0
  7. package/bin/intuned-api-run +2 -0
  8. package/bin/intuned-auth-session-check +2 -0
  9. package/bin/intuned-auth-session-create +2 -0
  10. package/bin/intuned-auth-session-load +2 -0
  11. package/bin/intuned-auth-session-refresh +2 -0
  12. package/bin/intuned-browser-save-state +2 -0
  13. package/bin/intuned-browser-start +2 -0
  14. package/bin/intuned-build +2 -0
  15. package/bin/intuned-ts-check +2 -0
  16. package/dist/commands/api/run.d.ts +6 -0
  17. package/dist/commands/api/run.js +115 -0
  18. package/dist/commands/auth-sessions/load.d.ts +2 -0
  19. package/dist/commands/auth-sessions/load.js +32 -0
  20. package/dist/commands/auth-sessions/run-check.d.ts +2 -0
  21. package/dist/commands/auth-sessions/run-check.js +62 -0
  22. package/dist/commands/auth-sessions/run-create.d.ts +2 -0
  23. package/dist/commands/auth-sessions/run-create.js +101 -0
  24. package/dist/commands/browser/save-state.d.ts +2 -0
  25. package/dist/commands/browser/save-state.js +17 -0
  26. package/dist/commands/browser/start-browser.d.ts +2 -0
  27. package/dist/commands/browser/start-browser.js +14 -0
  28. package/dist/commands/build.d.ts +1 -0
  29. package/dist/commands/build.js +84 -0
  30. package/dist/commands/common/browserUtils.d.ts +14 -0
  31. package/dist/commands/common/browserUtils.js +58 -0
  32. package/dist/commands/common/getFirstLineNumber.d.ts +9 -0
  33. package/dist/commands/common/getFirstLineNumber.js +103 -0
  34. package/dist/commands/common/getFirstLineNumber.test.js +228 -0
  35. package/dist/commands/common/sendMessageToClient.d.ts +1 -0
  36. package/dist/commands/common/sendMessageToClient.js +10 -0
  37. package/dist/commands/common/tsNodeImport.d.ts +1 -0
  38. package/dist/commands/common/tsNodeImport.js +20 -0
  39. package/dist/commands/common/utils/fileUtils.d.ts +6 -0
  40. package/dist/commands/common/utils/fileUtils.js +33 -0
  41. package/dist/commands/common/utils/settings.d.ts +2 -0
  42. package/dist/commands/common/utils/settings.js +28 -0
  43. package/dist/commands/common/utils/template.d.ts +2 -0
  44. package/dist/commands/common/utils/template.js +31 -0
  45. package/dist/commands/common/utils/unixSocket.d.ts +9 -0
  46. package/dist/commands/common/utils/unixSocket.js +44 -0
  47. package/dist/commands/interface/run.d.ts +1 -0
  48. package/dist/commands/interface/run.js +214 -0
  49. package/dist/commands/ts-check.d.ts +2 -0
  50. package/dist/commands/ts-check.js +56 -0
  51. package/dist/common/Logger/Logger/index.d.ts +12 -0
  52. package/dist/common/Logger/Logger/index.js +60 -0
  53. package/dist/common/Logger/Logger/types.d.ts +8 -0
  54. package/dist/common/Logger/Logger/types.js +5 -0
  55. package/dist/common/Logger/index.d.ts +12 -0
  56. package/dist/common/Logger/index.js +60 -0
  57. package/dist/common/Logger/types.d.ts +8 -0
  58. package/dist/common/Logger/types.js +5 -0
  59. package/dist/common/assets/browser_scripts.js +2214 -0
  60. package/dist/common/asyncLocalStorage/index.d.ts +16 -0
  61. package/dist/common/asyncLocalStorage/index.js +17 -0
  62. package/dist/common/cleanEnvironmentVariables.d.ts +1 -0
  63. package/dist/common/cleanEnvironmentVariables.js +16 -0
  64. package/dist/common/constants.d.ts +1 -0
  65. package/dist/common/constants.js +7 -0
  66. package/dist/common/contextStorageStateHelpers.d.ts +21 -0
  67. package/dist/common/contextStorageStateHelpers.js +81 -0
  68. package/dist/common/formatZodError.d.ts +2 -0
  69. package/dist/common/formatZodError.js +18 -0
  70. package/dist/common/getPlaywrightConstructs.d.ts +30 -0
  71. package/dist/common/getPlaywrightConstructs.js +196 -0
  72. package/dist/common/jwtTokenManager.d.ts +16 -0
  73. package/dist/common/jwtTokenManager.js +81 -0
  74. package/dist/common/runApi/errors.d.ts +65 -0
  75. package/dist/common/runApi/errors.js +156 -0
  76. package/dist/common/runApi/index.d.ts +12 -0
  77. package/dist/common/runApi/index.js +265 -0
  78. package/dist/common/runApi/types.d.ts +702 -0
  79. package/dist/common/runApi/types.js +74 -0
  80. package/dist/common/settingsSchema.d.ts +19 -0
  81. package/dist/common/settingsSchema.js +17 -0
  82. package/dist/common/telemetry.d.ts +3 -0
  83. package/dist/common/telemetry.js +32 -0
  84. package/dist/index.d.ts +4 -0
  85. package/dist/index.js +69 -0
  86. package/dist/runtime/RunError.d.ts +5 -0
  87. package/dist/runtime/RunError.js +19 -0
  88. package/dist/runtime/downloadDirectory.d.ts +1 -0
  89. package/dist/runtime/downloadDirectory.js +19 -0
  90. package/dist/runtime/enums.d.js +5 -0
  91. package/dist/runtime/enums.d.ts +11 -0
  92. package/dist/runtime/enums.js +18 -0
  93. package/dist/runtime/executionHelpers.test.js +53 -0
  94. package/dist/runtime/export.d.js +5 -0
  95. package/dist/runtime/export.d.ts +202 -0
  96. package/dist/runtime/extendPayload.d.ts +2 -0
  97. package/dist/runtime/extendPayload.js +21 -0
  98. package/dist/runtime/extendTimeout.d.ts +1 -0
  99. package/dist/runtime/extendTimeout.js +30 -0
  100. package/dist/runtime/index.d.ts +7 -0
  101. package/dist/runtime/index.js +53 -0
  102. package/dist/runtime/requestMoreInfo.d.ts +18 -0
  103. package/dist/runtime/requestMoreInfo.js +25 -0
  104. package/dist/runtime/runInfo.d.ts +2 -0
  105. package/dist/runtime/runInfo.js +21 -0
  106. package/package.json +136 -0
  107. package/template.tsconfig.json +14 -0
  108. package/tsconfig.eslint.json +5 -0
  109. package/tsconfig.json +24 -0
  110. package/typedoc.json +49 -0
@@ -0,0 +1,702 @@
1
+ import type { StorageState } from "../contextStorageStateHelpers";
2
+ import type { Payload } from "../../runtime/export";
3
+ import type { Result } from "neverthrow";
4
+ import type { RunAutomationError } from "./errors";
5
+ import z from "zod";
6
+ export interface PayloadToAppend {
7
+ apiName: string;
8
+ parameters: Record<string, any>;
9
+ }
10
+ export interface RunAutomationSuccessResult {
11
+ result: any;
12
+ status: number;
13
+ payloadToAppend: PayloadToAppend[] | null;
14
+ session?: StorageState;
15
+ }
16
+ export interface RunAutomationErrorResult {
17
+ error: string;
18
+ message: string;
19
+ status?: number;
20
+ details?: any;
21
+ [key: string]: any;
22
+ }
23
+ export type RunAutomationResult = RunAutomationSuccessResult | RunAutomationErrorResult;
24
+ export interface RunAutomationResponse {
25
+ status: number;
26
+ body: RunAutomationResult;
27
+ }
28
+ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
29
+ type: z.ZodLiteral<"file">;
30
+ path: z.ZodString;
31
+ }, "strip", z.ZodTypeAny, {
32
+ type: "file";
33
+ path: string;
34
+ }, {
35
+ type: "file";
36
+ path: string;
37
+ }>, z.ZodObject<{
38
+ type: z.ZodLiteral<"state">;
39
+ state: z.ZodOptional<z.ZodNullable<z.ZodObject<{
40
+ cookies: z.ZodArray<z.ZodObject<{
41
+ name: z.ZodString;
42
+ value: z.ZodString;
43
+ domain: z.ZodString;
44
+ path: z.ZodString;
45
+ expires: z.ZodNumber;
46
+ httpOnly: z.ZodBoolean;
47
+ secure: z.ZodBoolean;
48
+ sameSite: z.ZodEnum<["Strict", "Lax", "None"]>;
49
+ }, "strip", z.ZodTypeAny, {
50
+ value: string;
51
+ name: string;
52
+ path: string;
53
+ domain: string;
54
+ expires: number;
55
+ httpOnly: boolean;
56
+ secure: boolean;
57
+ sameSite: "Strict" | "Lax" | "None";
58
+ }, {
59
+ value: string;
60
+ name: string;
61
+ path: string;
62
+ domain: string;
63
+ expires: number;
64
+ httpOnly: boolean;
65
+ secure: boolean;
66
+ sameSite: "Strict" | "Lax" | "None";
67
+ }>, "many">;
68
+ origins: z.ZodArray<z.ZodObject<{
69
+ origin: z.ZodString;
70
+ localStorage: z.ZodArray<z.ZodObject<{
71
+ name: z.ZodString;
72
+ value: z.ZodString;
73
+ }, "strip", z.ZodTypeAny, {
74
+ value: string;
75
+ name: string;
76
+ }, {
77
+ value: string;
78
+ name: string;
79
+ }>, "many">;
80
+ }, "strip", z.ZodTypeAny, {
81
+ origin: string;
82
+ localStorage: {
83
+ value: string;
84
+ name: string;
85
+ }[];
86
+ }, {
87
+ origin: string;
88
+ localStorage: {
89
+ value: string;
90
+ name: string;
91
+ }[];
92
+ }>, "many">;
93
+ sessionStorage: z.ZodOptional<z.ZodArray<z.ZodObject<{
94
+ origin: z.ZodString;
95
+ sessionStorage: z.ZodArray<z.ZodObject<{
96
+ name: z.ZodString;
97
+ value: z.ZodString;
98
+ }, "strip", z.ZodTypeAny, {
99
+ value: string;
100
+ name: string;
101
+ }, {
102
+ value: string;
103
+ name: string;
104
+ }>, "many">;
105
+ }, "strip", z.ZodTypeAny, {
106
+ sessionStorage: {
107
+ value: string;
108
+ name: string;
109
+ }[];
110
+ origin: string;
111
+ }, {
112
+ sessionStorage: {
113
+ value: string;
114
+ name: string;
115
+ }[];
116
+ origin: string;
117
+ }>, "many">>;
118
+ }, "strip", z.ZodTypeAny, {
119
+ cookies: {
120
+ value: string;
121
+ name: string;
122
+ path: string;
123
+ domain: string;
124
+ expires: number;
125
+ httpOnly: boolean;
126
+ secure: boolean;
127
+ sameSite: "Strict" | "Lax" | "None";
128
+ }[];
129
+ origins: {
130
+ origin: string;
131
+ localStorage: {
132
+ value: string;
133
+ name: string;
134
+ }[];
135
+ }[];
136
+ sessionStorage?: {
137
+ sessionStorage: {
138
+ value: string;
139
+ name: string;
140
+ }[];
141
+ origin: string;
142
+ }[] | undefined;
143
+ }, {
144
+ cookies: {
145
+ value: string;
146
+ name: string;
147
+ path: string;
148
+ domain: string;
149
+ expires: number;
150
+ httpOnly: boolean;
151
+ secure: boolean;
152
+ sameSite: "Strict" | "Lax" | "None";
153
+ }[];
154
+ origins: {
155
+ origin: string;
156
+ localStorage: {
157
+ value: string;
158
+ name: string;
159
+ }[];
160
+ }[];
161
+ sessionStorage?: {
162
+ sessionStorage: {
163
+ value: string;
164
+ name: string;
165
+ }[];
166
+ origin: string;
167
+ }[] | undefined;
168
+ }>>>;
169
+ }, "strip", z.ZodTypeAny, {
170
+ type: "state";
171
+ state?: {
172
+ cookies: {
173
+ value: string;
174
+ name: string;
175
+ path: string;
176
+ domain: string;
177
+ expires: number;
178
+ httpOnly: boolean;
179
+ secure: boolean;
180
+ sameSite: "Strict" | "Lax" | "None";
181
+ }[];
182
+ origins: {
183
+ origin: string;
184
+ localStorage: {
185
+ value: string;
186
+ name: string;
187
+ }[];
188
+ }[];
189
+ sessionStorage?: {
190
+ sessionStorage: {
191
+ value: string;
192
+ name: string;
193
+ }[];
194
+ origin: string;
195
+ }[] | undefined;
196
+ } | null | undefined;
197
+ }, {
198
+ type: "state";
199
+ state?: {
200
+ cookies: {
201
+ value: string;
202
+ name: string;
203
+ path: string;
204
+ domain: string;
205
+ expires: number;
206
+ httpOnly: boolean;
207
+ secure: boolean;
208
+ sameSite: "Strict" | "Lax" | "None";
209
+ }[];
210
+ origins: {
211
+ origin: string;
212
+ localStorage: {
213
+ value: string;
214
+ name: string;
215
+ }[];
216
+ }[];
217
+ sessionStorage?: {
218
+ sessionStorage: {
219
+ value: string;
220
+ name: string;
221
+ }[];
222
+ origin: string;
223
+ }[] | undefined;
224
+ } | null | undefined;
225
+ }>]>;
226
+ export declare const runApiParametersSchema: z.ZodObject<{
227
+ automationFunction: z.ZodObject<{
228
+ name: z.ZodString;
229
+ params: z.ZodOptional<z.ZodAny>;
230
+ }, "strip", z.ZodTypeAny, {
231
+ name: string;
232
+ params?: any;
233
+ }, {
234
+ name: string;
235
+ params?: any;
236
+ }>;
237
+ tracing: z.ZodDefault<z.ZodOptional<z.ZodDiscriminatedUnion<"enabled", [z.ZodObject<{
238
+ enabled: z.ZodLiteral<false>;
239
+ }, "strip", z.ZodTypeAny, {
240
+ enabled: false;
241
+ }, {
242
+ enabled: false;
243
+ }>, z.ZodObject<{
244
+ enabled: z.ZodLiteral<true>;
245
+ filePath: z.ZodString;
246
+ }, "strip", z.ZodTypeAny, {
247
+ enabled: true;
248
+ filePath: string;
249
+ }, {
250
+ enabled: true;
251
+ filePath: string;
252
+ }>]>>>;
253
+ auth: z.ZodOptional<z.ZodObject<{
254
+ session: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
255
+ type: z.ZodLiteral<"file">;
256
+ path: z.ZodString;
257
+ }, "strip", z.ZodTypeAny, {
258
+ type: "file";
259
+ path: string;
260
+ }, {
261
+ type: "file";
262
+ path: string;
263
+ }>, z.ZodObject<{
264
+ type: z.ZodLiteral<"state">;
265
+ state: z.ZodOptional<z.ZodNullable<z.ZodObject<{
266
+ cookies: z.ZodArray<z.ZodObject<{
267
+ name: z.ZodString;
268
+ value: z.ZodString;
269
+ domain: z.ZodString;
270
+ path: z.ZodString;
271
+ expires: z.ZodNumber;
272
+ httpOnly: z.ZodBoolean;
273
+ secure: z.ZodBoolean;
274
+ sameSite: z.ZodEnum<["Strict", "Lax", "None"]>;
275
+ }, "strip", z.ZodTypeAny, {
276
+ value: string;
277
+ name: string;
278
+ path: string;
279
+ domain: string;
280
+ expires: number;
281
+ httpOnly: boolean;
282
+ secure: boolean;
283
+ sameSite: "Strict" | "Lax" | "None";
284
+ }, {
285
+ value: string;
286
+ name: string;
287
+ path: string;
288
+ domain: string;
289
+ expires: number;
290
+ httpOnly: boolean;
291
+ secure: boolean;
292
+ sameSite: "Strict" | "Lax" | "None";
293
+ }>, "many">;
294
+ origins: z.ZodArray<z.ZodObject<{
295
+ origin: z.ZodString;
296
+ localStorage: z.ZodArray<z.ZodObject<{
297
+ name: z.ZodString;
298
+ value: z.ZodString;
299
+ }, "strip", z.ZodTypeAny, {
300
+ value: string;
301
+ name: string;
302
+ }, {
303
+ value: string;
304
+ name: string;
305
+ }>, "many">;
306
+ }, "strip", z.ZodTypeAny, {
307
+ origin: string;
308
+ localStorage: {
309
+ value: string;
310
+ name: string;
311
+ }[];
312
+ }, {
313
+ origin: string;
314
+ localStorage: {
315
+ value: string;
316
+ name: string;
317
+ }[];
318
+ }>, "many">;
319
+ sessionStorage: z.ZodOptional<z.ZodArray<z.ZodObject<{
320
+ origin: z.ZodString;
321
+ sessionStorage: z.ZodArray<z.ZodObject<{
322
+ name: z.ZodString;
323
+ value: z.ZodString;
324
+ }, "strip", z.ZodTypeAny, {
325
+ value: string;
326
+ name: string;
327
+ }, {
328
+ value: string;
329
+ name: string;
330
+ }>, "many">;
331
+ }, "strip", z.ZodTypeAny, {
332
+ sessionStorage: {
333
+ value: string;
334
+ name: string;
335
+ }[];
336
+ origin: string;
337
+ }, {
338
+ sessionStorage: {
339
+ value: string;
340
+ name: string;
341
+ }[];
342
+ origin: string;
343
+ }>, "many">>;
344
+ }, "strip", z.ZodTypeAny, {
345
+ cookies: {
346
+ value: string;
347
+ name: string;
348
+ path: string;
349
+ domain: string;
350
+ expires: number;
351
+ httpOnly: boolean;
352
+ secure: boolean;
353
+ sameSite: "Strict" | "Lax" | "None";
354
+ }[];
355
+ origins: {
356
+ origin: string;
357
+ localStorage: {
358
+ value: string;
359
+ name: string;
360
+ }[];
361
+ }[];
362
+ sessionStorage?: {
363
+ sessionStorage: {
364
+ value: string;
365
+ name: string;
366
+ }[];
367
+ origin: string;
368
+ }[] | undefined;
369
+ }, {
370
+ cookies: {
371
+ value: string;
372
+ name: string;
373
+ path: string;
374
+ domain: string;
375
+ expires: number;
376
+ httpOnly: boolean;
377
+ secure: boolean;
378
+ sameSite: "Strict" | "Lax" | "None";
379
+ }[];
380
+ origins: {
381
+ origin: string;
382
+ localStorage: {
383
+ value: string;
384
+ name: string;
385
+ }[];
386
+ }[];
387
+ sessionStorage?: {
388
+ sessionStorage: {
389
+ value: string;
390
+ name: string;
391
+ }[];
392
+ origin: string;
393
+ }[] | undefined;
394
+ }>>>;
395
+ }, "strip", z.ZodTypeAny, {
396
+ type: "state";
397
+ state?: {
398
+ cookies: {
399
+ value: string;
400
+ name: string;
401
+ path: string;
402
+ domain: string;
403
+ expires: number;
404
+ httpOnly: boolean;
405
+ secure: boolean;
406
+ sameSite: "Strict" | "Lax" | "None";
407
+ }[];
408
+ origins: {
409
+ origin: string;
410
+ localStorage: {
411
+ value: string;
412
+ name: string;
413
+ }[];
414
+ }[];
415
+ sessionStorage?: {
416
+ sessionStorage: {
417
+ value: string;
418
+ name: string;
419
+ }[];
420
+ origin: string;
421
+ }[] | undefined;
422
+ } | null | undefined;
423
+ }, {
424
+ type: "state";
425
+ state?: {
426
+ cookies: {
427
+ value: string;
428
+ name: string;
429
+ path: string;
430
+ domain: string;
431
+ expires: number;
432
+ httpOnly: boolean;
433
+ secure: boolean;
434
+ sameSite: "Strict" | "Lax" | "None";
435
+ }[];
436
+ origins: {
437
+ origin: string;
438
+ localStorage: {
439
+ value: string;
440
+ name: string;
441
+ }[];
442
+ }[];
443
+ sessionStorage?: {
444
+ sessionStorage: {
445
+ value: string;
446
+ name: string;
447
+ }[];
448
+ origin: string;
449
+ }[] | undefined;
450
+ } | null | undefined;
451
+ }>]>;
452
+ runCheck: z.ZodDefault<z.ZodBoolean>;
453
+ }, "strip", z.ZodTypeAny, {
454
+ session: {
455
+ type: "file";
456
+ path: string;
457
+ } | {
458
+ type: "state";
459
+ state?: {
460
+ cookies: {
461
+ value: string;
462
+ name: string;
463
+ path: string;
464
+ domain: string;
465
+ expires: number;
466
+ httpOnly: boolean;
467
+ secure: boolean;
468
+ sameSite: "Strict" | "Lax" | "None";
469
+ }[];
470
+ origins: {
471
+ origin: string;
472
+ localStorage: {
473
+ value: string;
474
+ name: string;
475
+ }[];
476
+ }[];
477
+ sessionStorage?: {
478
+ sessionStorage: {
479
+ value: string;
480
+ name: string;
481
+ }[];
482
+ origin: string;
483
+ }[] | undefined;
484
+ } | null | undefined;
485
+ };
486
+ runCheck: boolean;
487
+ }, {
488
+ session: {
489
+ type: "file";
490
+ path: string;
491
+ } | {
492
+ type: "state";
493
+ state?: {
494
+ cookies: {
495
+ value: string;
496
+ name: string;
497
+ path: string;
498
+ domain: string;
499
+ expires: number;
500
+ httpOnly: boolean;
501
+ secure: boolean;
502
+ sameSite: "Strict" | "Lax" | "None";
503
+ }[];
504
+ origins: {
505
+ origin: string;
506
+ localStorage: {
507
+ value: string;
508
+ name: string;
509
+ }[];
510
+ }[];
511
+ sessionStorage?: {
512
+ sessionStorage: {
513
+ value: string;
514
+ name: string;
515
+ }[];
516
+ origin: string;
517
+ }[] | undefined;
518
+ } | null | undefined;
519
+ };
520
+ runCheck?: boolean | undefined;
521
+ }>>;
522
+ runOptions: z.ZodDefault<z.ZodDiscriminatedUnion<"environment", [z.ZodObject<{
523
+ environment: z.ZodLiteral<"standalone">;
524
+ headless: z.ZodDefault<z.ZodBoolean>;
525
+ proxy: z.ZodOptional<z.ZodObject<{
526
+ server: z.ZodString;
527
+ username: z.ZodString;
528
+ password: z.ZodString;
529
+ }, "strip", z.ZodTypeAny, {
530
+ server: string;
531
+ username: string;
532
+ password: string;
533
+ }, {
534
+ server: string;
535
+ username: string;
536
+ password: string;
537
+ }>>;
538
+ }, "strip", z.ZodTypeAny, {
539
+ environment: "standalone";
540
+ headless: boolean;
541
+ proxy?: {
542
+ server: string;
543
+ username: string;
544
+ password: string;
545
+ } | undefined;
546
+ }, {
547
+ environment: "standalone";
548
+ headless?: boolean | undefined;
549
+ proxy?: {
550
+ server: string;
551
+ username: string;
552
+ password: string;
553
+ } | undefined;
554
+ }>, z.ZodObject<{
555
+ environment: z.ZodLiteral<"cdp">;
556
+ cdpAddress: z.ZodString;
557
+ mode: z.ZodUnion<[z.ZodLiteral<"vanilla">, z.ZodLiteral<"playwright">, z.ZodLiteral<"playwright-standalone">, z.ZodLiteral<"playwright-headless">]>;
558
+ }, "strip", z.ZodTypeAny, {
559
+ mode: "vanilla" | "playwright" | "playwright-standalone" | "playwright-headless";
560
+ environment: "cdp";
561
+ cdpAddress: string;
562
+ }, {
563
+ mode: "vanilla" | "playwright" | "playwright-standalone" | "playwright-headless";
564
+ environment: "cdp";
565
+ cdpAddress: string;
566
+ }>]>>;
567
+ retrieveSession: z.ZodDefault<z.ZodBoolean>;
568
+ }, "strip", z.ZodTypeAny, {
569
+ automationFunction: {
570
+ name: string;
571
+ params?: any;
572
+ };
573
+ tracing: {
574
+ enabled: false;
575
+ } | {
576
+ enabled: true;
577
+ filePath: string;
578
+ };
579
+ runOptions: {
580
+ environment: "standalone";
581
+ headless: boolean;
582
+ proxy?: {
583
+ server: string;
584
+ username: string;
585
+ password: string;
586
+ } | undefined;
587
+ } | {
588
+ mode: "vanilla" | "playwright" | "playwright-standalone" | "playwright-headless";
589
+ environment: "cdp";
590
+ cdpAddress: string;
591
+ };
592
+ retrieveSession: boolean;
593
+ auth?: {
594
+ session: {
595
+ type: "file";
596
+ path: string;
597
+ } | {
598
+ type: "state";
599
+ state?: {
600
+ cookies: {
601
+ value: string;
602
+ name: string;
603
+ path: string;
604
+ domain: string;
605
+ expires: number;
606
+ httpOnly: boolean;
607
+ secure: boolean;
608
+ sameSite: "Strict" | "Lax" | "None";
609
+ }[];
610
+ origins: {
611
+ origin: string;
612
+ localStorage: {
613
+ value: string;
614
+ name: string;
615
+ }[];
616
+ }[];
617
+ sessionStorage?: {
618
+ sessionStorage: {
619
+ value: string;
620
+ name: string;
621
+ }[];
622
+ origin: string;
623
+ }[] | undefined;
624
+ } | null | undefined;
625
+ };
626
+ runCheck: boolean;
627
+ } | undefined;
628
+ }, {
629
+ automationFunction: {
630
+ name: string;
631
+ params?: any;
632
+ };
633
+ tracing?: {
634
+ enabled: false;
635
+ } | {
636
+ enabled: true;
637
+ filePath: string;
638
+ } | undefined;
639
+ auth?: {
640
+ session: {
641
+ type: "file";
642
+ path: string;
643
+ } | {
644
+ type: "state";
645
+ state?: {
646
+ cookies: {
647
+ value: string;
648
+ name: string;
649
+ path: string;
650
+ domain: string;
651
+ expires: number;
652
+ httpOnly: boolean;
653
+ secure: boolean;
654
+ sameSite: "Strict" | "Lax" | "None";
655
+ }[];
656
+ origins: {
657
+ origin: string;
658
+ localStorage: {
659
+ value: string;
660
+ name: string;
661
+ }[];
662
+ }[];
663
+ sessionStorage?: {
664
+ sessionStorage: {
665
+ value: string;
666
+ name: string;
667
+ }[];
668
+ origin: string;
669
+ }[] | undefined;
670
+ } | null | undefined;
671
+ };
672
+ runCheck?: boolean | undefined;
673
+ } | undefined;
674
+ runOptions?: {
675
+ environment: "standalone";
676
+ headless?: boolean | undefined;
677
+ proxy?: {
678
+ server: string;
679
+ username: string;
680
+ password: string;
681
+ } | undefined;
682
+ } | {
683
+ mode: "vanilla" | "playwright" | "playwright-standalone" | "playwright-headless";
684
+ environment: "cdp";
685
+ cdpAddress: string;
686
+ } | undefined;
687
+ retrieveSession?: boolean | undefined;
688
+ }>;
689
+ export type RunApiSession = z.infer<typeof runApiSessionSchema>;
690
+ export type RunApiParameters = z.input<typeof runApiParametersSchema>;
691
+ export type ExtendedRunApiParameters = RunApiParameters & {
692
+ abortSignal?: AbortSignal;
693
+ importFunction?: (name: string) => Promise<any> | undefined;
694
+ };
695
+ export type RunApiResultOk<R = any> = {
696
+ result: R;
697
+ extendedPayloads?: Payload[];
698
+ };
699
+ export type RunApiResultWithSessionOk<R = any> = RunApiResultOk<R> & {
700
+ session: StorageState;
701
+ };
702
+ export type RunApiResult<R = any, FullResult extends RunApiResultOk<R> = RunApiResultOk<R>> = Result<FullResult, RunAutomationError>;