@intuned/runtime-dev 1.0.4-stuck.1 → 1.0.6-cli-auth.0.0.1
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/InterfaceTemplate/utils.ts +53 -31
- package/bin/cli-build +3 -0
- package/bin/create-auth-session +3 -0
- package/bin/deploy +3 -0
- package/bin/init +3 -0
- package/bin/run-api +3 -0
- package/dist/commands/api/run.js +2 -2
- package/dist/commands/auth-sessions/load.js +1 -1
- package/dist/commands/auth-sessions/run-check.js +2 -2
- package/dist/commands/auth-sessions/run-create.js +2 -2
- package/dist/commands/browser/save-state.js +1 -1
- package/dist/commands/browser/start-browser.js +1 -1
- package/dist/commands/build.js +4 -4
- package/dist/commands/cli-auth-sessions/check.d.ts +0 -0
- package/dist/commands/cli-auth-sessions/check.js +1 -0
- package/dist/commands/cli-auth-sessions/create.d.ts +2 -0
- package/dist/commands/cli-auth-sessions/create.js +28 -0
- package/dist/commands/cli-auth-sessions/utils.d.ts +4 -0
- package/dist/commands/cli-auth-sessions/utils.js +55 -0
- package/dist/commands/cli-build/cli-build.d.ts +2 -0
- package/dist/commands/cli-build/cli-build.js +20 -0
- package/dist/commands/common/browserUtils.d.ts +1 -1
- package/dist/commands/common/browserUtils.js +3 -3
- package/dist/commands/common/getFirstLineNumber.test.js +2 -2
- package/dist/commands/common/projectExclusions.d.ts +2 -0
- package/dist/commands/common/projectExclusions.js +8 -0
- package/dist/commands/common/tsNodeImport.d.ts +2 -1
- package/dist/commands/common/tsNodeImport.js +20 -6
- package/dist/commands/common/utils/fileUtils.js +2 -2
- package/dist/commands/common/utils/settings.js +1 -1
- package/dist/commands/common/utils/template.d.ts +1 -1
- package/dist/commands/common/utils/template.js +1 -1
- package/dist/commands/deploy/deploy.d.ts +2 -0
- package/dist/commands/deploy/deploy.js +47 -0
- package/dist/commands/deploy/utils.d.ts +16 -0
- package/dist/commands/deploy/utils.js +350 -0
- package/dist/commands/init/init.d.ts +2 -0
- package/dist/commands/init/init.js +22 -0
- package/dist/commands/init/utils.d.ts +9 -0
- package/dist/commands/init/utils.js +179 -0
- package/dist/commands/interface/run.js +141 -94
- package/dist/commands/run-api-cli/run-api.d.ts +2 -0
- package/dist/commands/run-api-cli/run-api.js +48 -0
- package/dist/commands/run-api-cli/utils.d.ts +10 -0
- package/dist/commands/run-api-cli/utils.js +98 -0
- package/dist/commands/ts-check.js +2 -2
- package/dist/common/Logger/Logger/index.js +1 -1
- package/dist/common/Logger/index.js +1 -1
- package/dist/common/asyncLocalStorage/index.d.ts +1 -1
- package/dist/common/asyncLocalStorage/index.js +2 -2
- package/dist/common/cli/cliReadme.d.ts +1 -0
- package/dist/common/cli/cliReadme.js +69 -0
- package/dist/common/cli/constants.d.ts +24 -0
- package/dist/common/cli/constants.js +30 -0
- package/dist/common/cli/types.d.ts +52 -0
- package/dist/common/cli/types.js +7 -0
- package/dist/common/cli/utils.d.ts +6 -0
- package/dist/common/cli/utils.js +35 -0
- package/dist/common/contextStorageStateHelpers.d.ts +20 -13
- package/dist/common/contextStorageStateHelpers.js +69 -42
- package/dist/common/getPlaywrightConstructs.d.ts +1 -1
- package/dist/common/getPlaywrightConstructs.js +5 -5
- package/dist/common/jwtTokenManager.js +2 -2
- package/dist/common/runApi/errors.d.ts +0 -11
- package/dist/common/runApi/errors.js +2 -41
- package/dist/common/runApi/index.d.ts +2 -1
- package/dist/common/runApi/index.js +11 -4
- package/dist/common/runApi/types.d.ts +82 -76
- package/dist/common/runApi/types.js +1 -1
- package/dist/common/settingsSchema.js +1 -1
- package/dist/common/telemetry.js +1 -1
- package/package.json +14 -6
- package/WebTemplate/accessKeyHelpers.ts +0 -28
- package/WebTemplate/api.ts +0 -139
- package/WebTemplate/app.ts +0 -18
- package/WebTemplate/controllers/async.ts +0 -142
- package/WebTemplate/controllers/authSessions/check.ts +0 -61
- package/WebTemplate/controllers/authSessions/create.ts +0 -101
- package/WebTemplate/controllers/authSessions/index.ts +0 -41
- package/WebTemplate/controllers/authSessions/killOperation.ts +0 -35
- package/WebTemplate/controllers/authSessions/resumeOperation.ts +0 -56
- package/WebTemplate/controllers/authSessions/store.ts +0 -19
- package/WebTemplate/controllers/controllers.ts +0 -73
- package/WebTemplate/controllers/runApi/helpers.ts +0 -128
- package/WebTemplate/controllers/runApi/index.ts +0 -68
- package/WebTemplate/controllers/runApi/types.ts +0 -13
- package/WebTemplate/controllers/traces.ts +0 -151
- package/WebTemplate/features.ts +0 -8
- package/WebTemplate/headers.ts +0 -6
- package/WebTemplate/index.playwright.ts +0 -47
- package/WebTemplate/index.vanilla.ts +0 -26
- package/WebTemplate/jobs.ts +0 -356
- package/WebTemplate/shutdown.ts +0 -64
- package/WebTemplate/utils.ts +0 -257
- package/WebTemplate.zip +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { StorageState } from "../contextStorageStateHelpers";
|
|
2
2
|
import type { Payload } from "../../runtime/export";
|
|
3
3
|
import type { Result } from "neverthrow";
|
|
4
4
|
import type { RunAutomationError } from "./errors";
|
|
@@ -11,7 +11,7 @@ export interface RunAutomationSuccessResult {
|
|
|
11
11
|
result: any;
|
|
12
12
|
status: number;
|
|
13
13
|
payloadToAppend: PayloadToAppend[] | null;
|
|
14
|
-
session?:
|
|
14
|
+
session?: StorageState;
|
|
15
15
|
}
|
|
16
16
|
export interface RunAutomationErrorResult {
|
|
17
17
|
error: string;
|
|
@@ -47,8 +47,8 @@ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
|
|
|
47
47
|
secure: z.ZodBoolean;
|
|
48
48
|
sameSite: z.ZodEnum<["Strict", "Lax", "None"]>;
|
|
49
49
|
}, "strip", z.ZodTypeAny, {
|
|
50
|
-
name: string;
|
|
51
50
|
value: string;
|
|
51
|
+
name: string;
|
|
52
52
|
path: string;
|
|
53
53
|
domain: string;
|
|
54
54
|
expires: number;
|
|
@@ -56,8 +56,8 @@ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
|
|
|
56
56
|
secure: boolean;
|
|
57
57
|
sameSite: "Strict" | "Lax" | "None";
|
|
58
58
|
}, {
|
|
59
|
-
name: string;
|
|
60
59
|
value: string;
|
|
60
|
+
name: string;
|
|
61
61
|
path: string;
|
|
62
62
|
domain: string;
|
|
63
63
|
expires: number;
|
|
@@ -71,23 +71,23 @@ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
|
|
|
71
71
|
name: z.ZodString;
|
|
72
72
|
value: z.ZodString;
|
|
73
73
|
}, "strip", z.ZodTypeAny, {
|
|
74
|
-
name: string;
|
|
75
74
|
value: string;
|
|
76
|
-
}, {
|
|
77
75
|
name: string;
|
|
76
|
+
}, {
|
|
78
77
|
value: string;
|
|
78
|
+
name: string;
|
|
79
79
|
}>, "many">;
|
|
80
80
|
}, "strip", z.ZodTypeAny, {
|
|
81
81
|
origin: string;
|
|
82
82
|
localStorage: {
|
|
83
|
-
name: string;
|
|
84
83
|
value: string;
|
|
84
|
+
name: string;
|
|
85
85
|
}[];
|
|
86
86
|
}, {
|
|
87
87
|
origin: string;
|
|
88
88
|
localStorage: {
|
|
89
|
-
name: string;
|
|
90
89
|
value: string;
|
|
90
|
+
name: string;
|
|
91
91
|
}[];
|
|
92
92
|
}>, "many">;
|
|
93
93
|
sessionStorage: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -96,29 +96,29 @@ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
|
|
|
96
96
|
name: z.ZodString;
|
|
97
97
|
value: z.ZodString;
|
|
98
98
|
}, "strip", z.ZodTypeAny, {
|
|
99
|
-
name: string;
|
|
100
99
|
value: string;
|
|
101
|
-
}, {
|
|
102
100
|
name: string;
|
|
101
|
+
}, {
|
|
103
102
|
value: string;
|
|
103
|
+
name: string;
|
|
104
104
|
}>, "many">;
|
|
105
105
|
}, "strip", z.ZodTypeAny, {
|
|
106
|
-
origin: string;
|
|
107
106
|
sessionStorage: {
|
|
108
|
-
name: string;
|
|
109
107
|
value: string;
|
|
108
|
+
name: string;
|
|
110
109
|
}[];
|
|
111
|
-
}, {
|
|
112
110
|
origin: string;
|
|
111
|
+
}, {
|
|
113
112
|
sessionStorage: {
|
|
114
|
-
name: string;
|
|
115
113
|
value: string;
|
|
114
|
+
name: string;
|
|
116
115
|
}[];
|
|
116
|
+
origin: string;
|
|
117
117
|
}>, "many">>;
|
|
118
118
|
}, "strip", z.ZodTypeAny, {
|
|
119
119
|
cookies: {
|
|
120
|
-
name: string;
|
|
121
120
|
value: string;
|
|
121
|
+
name: string;
|
|
122
122
|
path: string;
|
|
123
123
|
domain: string;
|
|
124
124
|
expires: number;
|
|
@@ -129,21 +129,21 @@ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
|
|
|
129
129
|
origins: {
|
|
130
130
|
origin: string;
|
|
131
131
|
localStorage: {
|
|
132
|
-
name: string;
|
|
133
132
|
value: string;
|
|
133
|
+
name: string;
|
|
134
134
|
}[];
|
|
135
135
|
}[];
|
|
136
136
|
sessionStorage?: {
|
|
137
|
-
origin: string;
|
|
138
137
|
sessionStorage: {
|
|
139
|
-
name: string;
|
|
140
138
|
value: string;
|
|
139
|
+
name: string;
|
|
141
140
|
}[];
|
|
141
|
+
origin: string;
|
|
142
142
|
}[] | undefined;
|
|
143
143
|
}, {
|
|
144
144
|
cookies: {
|
|
145
|
-
name: string;
|
|
146
145
|
value: string;
|
|
146
|
+
name: string;
|
|
147
147
|
path: string;
|
|
148
148
|
domain: string;
|
|
149
149
|
expires: number;
|
|
@@ -154,24 +154,24 @@ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
|
|
|
154
154
|
origins: {
|
|
155
155
|
origin: string;
|
|
156
156
|
localStorage: {
|
|
157
|
-
name: string;
|
|
158
157
|
value: string;
|
|
158
|
+
name: string;
|
|
159
159
|
}[];
|
|
160
160
|
}[];
|
|
161
161
|
sessionStorage?: {
|
|
162
|
-
origin: string;
|
|
163
162
|
sessionStorage: {
|
|
164
|
-
name: string;
|
|
165
163
|
value: string;
|
|
164
|
+
name: string;
|
|
166
165
|
}[];
|
|
166
|
+
origin: string;
|
|
167
167
|
}[] | undefined;
|
|
168
168
|
}>>>;
|
|
169
169
|
}, "strip", z.ZodTypeAny, {
|
|
170
170
|
type: "state";
|
|
171
171
|
state?: {
|
|
172
172
|
cookies: {
|
|
173
|
-
name: string;
|
|
174
173
|
value: string;
|
|
174
|
+
name: string;
|
|
175
175
|
path: string;
|
|
176
176
|
domain: string;
|
|
177
177
|
expires: number;
|
|
@@ -182,24 +182,24 @@ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
|
|
|
182
182
|
origins: {
|
|
183
183
|
origin: string;
|
|
184
184
|
localStorage: {
|
|
185
|
-
name: string;
|
|
186
185
|
value: string;
|
|
186
|
+
name: string;
|
|
187
187
|
}[];
|
|
188
188
|
}[];
|
|
189
189
|
sessionStorage?: {
|
|
190
|
-
origin: string;
|
|
191
190
|
sessionStorage: {
|
|
192
|
-
name: string;
|
|
193
191
|
value: string;
|
|
192
|
+
name: string;
|
|
194
193
|
}[];
|
|
194
|
+
origin: string;
|
|
195
195
|
}[] | undefined;
|
|
196
196
|
} | null | undefined;
|
|
197
197
|
}, {
|
|
198
198
|
type: "state";
|
|
199
199
|
state?: {
|
|
200
200
|
cookies: {
|
|
201
|
-
name: string;
|
|
202
201
|
value: string;
|
|
202
|
+
name: string;
|
|
203
203
|
path: string;
|
|
204
204
|
domain: string;
|
|
205
205
|
expires: number;
|
|
@@ -210,16 +210,16 @@ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
|
|
|
210
210
|
origins: {
|
|
211
211
|
origin: string;
|
|
212
212
|
localStorage: {
|
|
213
|
-
name: string;
|
|
214
213
|
value: string;
|
|
214
|
+
name: string;
|
|
215
215
|
}[];
|
|
216
216
|
}[];
|
|
217
217
|
sessionStorage?: {
|
|
218
|
-
origin: string;
|
|
219
218
|
sessionStorage: {
|
|
220
|
-
name: string;
|
|
221
219
|
value: string;
|
|
220
|
+
name: string;
|
|
222
221
|
}[];
|
|
222
|
+
origin: string;
|
|
223
223
|
}[] | undefined;
|
|
224
224
|
} | null | undefined;
|
|
225
225
|
}>]>;
|
|
@@ -273,8 +273,8 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
273
273
|
secure: z.ZodBoolean;
|
|
274
274
|
sameSite: z.ZodEnum<["Strict", "Lax", "None"]>;
|
|
275
275
|
}, "strip", z.ZodTypeAny, {
|
|
276
|
-
name: string;
|
|
277
276
|
value: string;
|
|
277
|
+
name: string;
|
|
278
278
|
path: string;
|
|
279
279
|
domain: string;
|
|
280
280
|
expires: number;
|
|
@@ -282,8 +282,8 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
282
282
|
secure: boolean;
|
|
283
283
|
sameSite: "Strict" | "Lax" | "None";
|
|
284
284
|
}, {
|
|
285
|
-
name: string;
|
|
286
285
|
value: string;
|
|
286
|
+
name: string;
|
|
287
287
|
path: string;
|
|
288
288
|
domain: string;
|
|
289
289
|
expires: number;
|
|
@@ -297,23 +297,23 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
297
297
|
name: z.ZodString;
|
|
298
298
|
value: z.ZodString;
|
|
299
299
|
}, "strip", z.ZodTypeAny, {
|
|
300
|
-
name: string;
|
|
301
300
|
value: string;
|
|
302
|
-
}, {
|
|
303
301
|
name: string;
|
|
302
|
+
}, {
|
|
304
303
|
value: string;
|
|
304
|
+
name: string;
|
|
305
305
|
}>, "many">;
|
|
306
306
|
}, "strip", z.ZodTypeAny, {
|
|
307
307
|
origin: string;
|
|
308
308
|
localStorage: {
|
|
309
|
-
name: string;
|
|
310
309
|
value: string;
|
|
310
|
+
name: string;
|
|
311
311
|
}[];
|
|
312
312
|
}, {
|
|
313
313
|
origin: string;
|
|
314
314
|
localStorage: {
|
|
315
|
-
name: string;
|
|
316
315
|
value: string;
|
|
316
|
+
name: string;
|
|
317
317
|
}[];
|
|
318
318
|
}>, "many">;
|
|
319
319
|
sessionStorage: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -322,29 +322,29 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
322
322
|
name: z.ZodString;
|
|
323
323
|
value: z.ZodString;
|
|
324
324
|
}, "strip", z.ZodTypeAny, {
|
|
325
|
-
name: string;
|
|
326
325
|
value: string;
|
|
327
|
-
}, {
|
|
328
326
|
name: string;
|
|
327
|
+
}, {
|
|
329
328
|
value: string;
|
|
329
|
+
name: string;
|
|
330
330
|
}>, "many">;
|
|
331
331
|
}, "strip", z.ZodTypeAny, {
|
|
332
|
-
origin: string;
|
|
333
332
|
sessionStorage: {
|
|
334
|
-
name: string;
|
|
335
333
|
value: string;
|
|
334
|
+
name: string;
|
|
336
335
|
}[];
|
|
337
|
-
}, {
|
|
338
336
|
origin: string;
|
|
337
|
+
}, {
|
|
339
338
|
sessionStorage: {
|
|
340
|
-
name: string;
|
|
341
339
|
value: string;
|
|
340
|
+
name: string;
|
|
342
341
|
}[];
|
|
342
|
+
origin: string;
|
|
343
343
|
}>, "many">>;
|
|
344
344
|
}, "strip", z.ZodTypeAny, {
|
|
345
345
|
cookies: {
|
|
346
|
-
name: string;
|
|
347
346
|
value: string;
|
|
347
|
+
name: string;
|
|
348
348
|
path: string;
|
|
349
349
|
domain: string;
|
|
350
350
|
expires: number;
|
|
@@ -355,21 +355,21 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
355
355
|
origins: {
|
|
356
356
|
origin: string;
|
|
357
357
|
localStorage: {
|
|
358
|
-
name: string;
|
|
359
358
|
value: string;
|
|
359
|
+
name: string;
|
|
360
360
|
}[];
|
|
361
361
|
}[];
|
|
362
362
|
sessionStorage?: {
|
|
363
|
-
origin: string;
|
|
364
363
|
sessionStorage: {
|
|
365
|
-
name: string;
|
|
366
364
|
value: string;
|
|
365
|
+
name: string;
|
|
367
366
|
}[];
|
|
367
|
+
origin: string;
|
|
368
368
|
}[] | undefined;
|
|
369
369
|
}, {
|
|
370
370
|
cookies: {
|
|
371
|
-
name: string;
|
|
372
371
|
value: string;
|
|
372
|
+
name: string;
|
|
373
373
|
path: string;
|
|
374
374
|
domain: string;
|
|
375
375
|
expires: number;
|
|
@@ -380,24 +380,24 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
380
380
|
origins: {
|
|
381
381
|
origin: string;
|
|
382
382
|
localStorage: {
|
|
383
|
-
name: string;
|
|
384
383
|
value: string;
|
|
384
|
+
name: string;
|
|
385
385
|
}[];
|
|
386
386
|
}[];
|
|
387
387
|
sessionStorage?: {
|
|
388
|
-
origin: string;
|
|
389
388
|
sessionStorage: {
|
|
390
|
-
name: string;
|
|
391
389
|
value: string;
|
|
390
|
+
name: string;
|
|
392
391
|
}[];
|
|
392
|
+
origin: string;
|
|
393
393
|
}[] | undefined;
|
|
394
394
|
}>>>;
|
|
395
395
|
}, "strip", z.ZodTypeAny, {
|
|
396
396
|
type: "state";
|
|
397
397
|
state?: {
|
|
398
398
|
cookies: {
|
|
399
|
-
name: string;
|
|
400
399
|
value: string;
|
|
400
|
+
name: string;
|
|
401
401
|
path: string;
|
|
402
402
|
domain: string;
|
|
403
403
|
expires: number;
|
|
@@ -408,24 +408,24 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
408
408
|
origins: {
|
|
409
409
|
origin: string;
|
|
410
410
|
localStorage: {
|
|
411
|
-
name: string;
|
|
412
411
|
value: string;
|
|
412
|
+
name: string;
|
|
413
413
|
}[];
|
|
414
414
|
}[];
|
|
415
415
|
sessionStorage?: {
|
|
416
|
-
origin: string;
|
|
417
416
|
sessionStorage: {
|
|
418
|
-
name: string;
|
|
419
417
|
value: string;
|
|
418
|
+
name: string;
|
|
420
419
|
}[];
|
|
420
|
+
origin: string;
|
|
421
421
|
}[] | undefined;
|
|
422
422
|
} | null | undefined;
|
|
423
423
|
}, {
|
|
424
424
|
type: "state";
|
|
425
425
|
state?: {
|
|
426
426
|
cookies: {
|
|
427
|
-
name: string;
|
|
428
427
|
value: string;
|
|
428
|
+
name: string;
|
|
429
429
|
path: string;
|
|
430
430
|
domain: string;
|
|
431
431
|
expires: number;
|
|
@@ -436,16 +436,16 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
436
436
|
origins: {
|
|
437
437
|
origin: string;
|
|
438
438
|
localStorage: {
|
|
439
|
-
name: string;
|
|
440
439
|
value: string;
|
|
440
|
+
name: string;
|
|
441
441
|
}[];
|
|
442
442
|
}[];
|
|
443
443
|
sessionStorage?: {
|
|
444
|
-
origin: string;
|
|
445
444
|
sessionStorage: {
|
|
446
|
-
name: string;
|
|
447
445
|
value: string;
|
|
446
|
+
name: string;
|
|
448
447
|
}[];
|
|
448
|
+
origin: string;
|
|
449
449
|
}[] | undefined;
|
|
450
450
|
} | null | undefined;
|
|
451
451
|
}>]>;
|
|
@@ -458,8 +458,8 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
458
458
|
type: "state";
|
|
459
459
|
state?: {
|
|
460
460
|
cookies: {
|
|
461
|
-
name: string;
|
|
462
461
|
value: string;
|
|
462
|
+
name: string;
|
|
463
463
|
path: string;
|
|
464
464
|
domain: string;
|
|
465
465
|
expires: number;
|
|
@@ -470,16 +470,16 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
470
470
|
origins: {
|
|
471
471
|
origin: string;
|
|
472
472
|
localStorage: {
|
|
473
|
-
name: string;
|
|
474
473
|
value: string;
|
|
474
|
+
name: string;
|
|
475
475
|
}[];
|
|
476
476
|
}[];
|
|
477
477
|
sessionStorage?: {
|
|
478
|
-
origin: string;
|
|
479
478
|
sessionStorage: {
|
|
480
|
-
name: string;
|
|
481
479
|
value: string;
|
|
480
|
+
name: string;
|
|
482
481
|
}[];
|
|
482
|
+
origin: string;
|
|
483
483
|
}[] | undefined;
|
|
484
484
|
} | null | undefined;
|
|
485
485
|
};
|
|
@@ -492,8 +492,8 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
492
492
|
type: "state";
|
|
493
493
|
state?: {
|
|
494
494
|
cookies: {
|
|
495
|
-
name: string;
|
|
496
495
|
value: string;
|
|
496
|
+
name: string;
|
|
497
497
|
path: string;
|
|
498
498
|
domain: string;
|
|
499
499
|
expires: number;
|
|
@@ -504,16 +504,16 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
504
504
|
origins: {
|
|
505
505
|
origin: string;
|
|
506
506
|
localStorage: {
|
|
507
|
-
name: string;
|
|
508
507
|
value: string;
|
|
508
|
+
name: string;
|
|
509
509
|
}[];
|
|
510
510
|
}[];
|
|
511
511
|
sessionStorage?: {
|
|
512
|
-
origin: string;
|
|
513
512
|
sessionStorage: {
|
|
514
|
-
name: string;
|
|
515
513
|
value: string;
|
|
514
|
+
name: string;
|
|
516
515
|
}[];
|
|
516
|
+
origin: string;
|
|
517
517
|
}[] | undefined;
|
|
518
518
|
} | null | undefined;
|
|
519
519
|
};
|
|
@@ -598,8 +598,8 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
598
598
|
type: "state";
|
|
599
599
|
state?: {
|
|
600
600
|
cookies: {
|
|
601
|
-
name: string;
|
|
602
601
|
value: string;
|
|
602
|
+
name: string;
|
|
603
603
|
path: string;
|
|
604
604
|
domain: string;
|
|
605
605
|
expires: number;
|
|
@@ -610,16 +610,16 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
610
610
|
origins: {
|
|
611
611
|
origin: string;
|
|
612
612
|
localStorage: {
|
|
613
|
-
name: string;
|
|
614
613
|
value: string;
|
|
614
|
+
name: string;
|
|
615
615
|
}[];
|
|
616
616
|
}[];
|
|
617
617
|
sessionStorage?: {
|
|
618
|
-
origin: string;
|
|
619
618
|
sessionStorage: {
|
|
620
|
-
name: string;
|
|
621
619
|
value: string;
|
|
620
|
+
name: string;
|
|
622
621
|
}[];
|
|
622
|
+
origin: string;
|
|
623
623
|
}[] | undefined;
|
|
624
624
|
} | null | undefined;
|
|
625
625
|
};
|
|
@@ -644,8 +644,8 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
644
644
|
type: "state";
|
|
645
645
|
state?: {
|
|
646
646
|
cookies: {
|
|
647
|
-
name: string;
|
|
648
647
|
value: string;
|
|
648
|
+
name: string;
|
|
649
649
|
path: string;
|
|
650
650
|
domain: string;
|
|
651
651
|
expires: number;
|
|
@@ -656,16 +656,16 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
656
656
|
origins: {
|
|
657
657
|
origin: string;
|
|
658
658
|
localStorage: {
|
|
659
|
-
name: string;
|
|
660
659
|
value: string;
|
|
660
|
+
name: string;
|
|
661
661
|
}[];
|
|
662
662
|
}[];
|
|
663
663
|
sessionStorage?: {
|
|
664
|
-
origin: string;
|
|
665
664
|
sessionStorage: {
|
|
666
|
-
name: string;
|
|
667
665
|
value: string;
|
|
666
|
+
name: string;
|
|
668
667
|
}[];
|
|
668
|
+
origin: string;
|
|
669
669
|
}[] | undefined;
|
|
670
670
|
} | null | undefined;
|
|
671
671
|
};
|
|
@@ -688,15 +688,21 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
688
688
|
}>;
|
|
689
689
|
export type RunApiSession = z.infer<typeof runApiSessionSchema>;
|
|
690
690
|
export type RunApiParameters = z.input<typeof runApiParametersSchema>;
|
|
691
|
+
export type ImportFunctionError = {
|
|
692
|
+
type: "not_found";
|
|
693
|
+
} | {
|
|
694
|
+
type: "other";
|
|
695
|
+
error: any;
|
|
696
|
+
};
|
|
691
697
|
export type ExtendedRunApiParameters = RunApiParameters & {
|
|
692
698
|
abortSignal?: AbortSignal;
|
|
693
|
-
importFunction
|
|
699
|
+
importFunction: (name: string) => Promise<Result<any, ImportFunctionError>>;
|
|
694
700
|
};
|
|
695
701
|
export type RunApiResultOk<R = any> = {
|
|
696
702
|
result: R;
|
|
697
703
|
extendedPayloads?: Payload[];
|
|
698
704
|
};
|
|
699
705
|
export type RunApiResultWithSessionOk<R = any> = RunApiResultOk<R> & {
|
|
700
|
-
session:
|
|
706
|
+
session: StorageState;
|
|
701
707
|
};
|
|
702
708
|
export type RunApiResult<R = any, FullResult extends RunApiResultOk<R> = RunApiResultOk<R>> = Result<FullResult, RunAutomationError>;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.runApiSessionSchema = exports.runApiParametersSchema = void 0;
|
|
7
7
|
var _zod = _interopRequireDefault(require("zod"));
|
|
8
|
-
function _interopRequireDefault(
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
9
|
const runApiSessionSchema = exports.runApiSessionSchema = _zod.default.discriminatedUnion("type", [_zod.default.object({
|
|
10
10
|
type: _zod.default.literal("file"),
|
|
11
11
|
path: _zod.default.string()
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.settingsSchema = 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
|
-
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 &&
|
|
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
10
|
const authSessionsSchema = z.object({
|
|
11
11
|
enabled: z.boolean()
|
|
12
12
|
}).optional().default({
|
package/dist/common/telemetry.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.getTelemetryClient = getTelemetryClient;
|
|
|
7
7
|
exports.initializeAppInsights = initializeAppInsights;
|
|
8
8
|
var appInsights = _interopRequireWildcard(require("applicationinsights"));
|
|
9
9
|
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); }
|
|
10
|
-
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 &&
|
|
10
|
+
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; }
|
|
11
11
|
function gracefulShutdown() {
|
|
12
12
|
console.log("Shutting down, so flushing app insights.");
|
|
13
13
|
appInsights.defaultClient.flush();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intuned/runtime-dev",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6-cli-auth.0.0.1",
|
|
4
4
|
"description": "Intuned runtime",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dist/index.js",
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
"./dist/common/asyncLocalStorage": "./dist/common/asyncLocalStorage/index.js",
|
|
14
14
|
"./dist/common/cleanEnvironmentVariables": "./dist/common/cleanEnvironmentVariables.js",
|
|
15
15
|
"./dist/common/constants": "./dist/common/constants.js",
|
|
16
|
-
"./dist/commands/interface/run": "./dist/commands/interface/run.js"
|
|
16
|
+
"./dist/commands/interface/run": "./dist/commands/interface/run.js",
|
|
17
|
+
"./dist/commands/intuned-run/intuned-run": "./dist/commands/intuned-run/intuned-run.js"
|
|
17
18
|
},
|
|
18
19
|
"types": "./dist/index.d.ts",
|
|
19
20
|
"author": "Intuned Team",
|
|
@@ -48,12 +49,15 @@
|
|
|
48
49
|
"intuned-build": "./bin/intuned-build",
|
|
49
50
|
"intuned-browser-start": "./bin/intuned-browser-start",
|
|
50
51
|
"intuned-browser-save-state": "./bin/intuned-browser-save-state",
|
|
51
|
-
"intuned-ts-check": "./bin/intuned-ts-check"
|
|
52
|
+
"intuned-ts-check": "./bin/intuned-ts-check",
|
|
53
|
+
"init": "./bin/init",
|
|
54
|
+
"run-api": "./bin/run-api",
|
|
55
|
+
"deploy": "./bin/deploy",
|
|
56
|
+
"cli-build": "./bin/cli-build",
|
|
57
|
+
"create-auth-session": "./bin/create-auth-session"
|
|
52
58
|
},
|
|
53
59
|
"dependencies": {
|
|
54
60
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
55
|
-
"@intuned/playwright": "^1.44.1-4",
|
|
56
|
-
"@intuned/playwright-core": "^1.44.1-4",
|
|
57
61
|
"@rollup/plugin-commonjs": "^25.0.2",
|
|
58
62
|
"@rollup/plugin-dynamic-import-vars": "^2.0.4",
|
|
59
63
|
"@rollup/plugin-json": "^6.0.0",
|
|
@@ -67,6 +71,7 @@
|
|
|
67
71
|
"applicationinsights": "^2.9.2",
|
|
68
72
|
"async-retry": "^1.3.3",
|
|
69
73
|
"babel-plugin-dynamic-import-node": "^2.3.3",
|
|
74
|
+
"boxen": "8.0.1",
|
|
70
75
|
"chalk": "^4.1.2",
|
|
71
76
|
"commander": "^11.0.0",
|
|
72
77
|
"cross-fetch": "^4.0.0",
|
|
@@ -77,12 +82,15 @@
|
|
|
77
82
|
"fs-extra": "^11.3.0",
|
|
78
83
|
"https-proxy-agent": "^7.0.5",
|
|
79
84
|
"image-size": "^1.1.1",
|
|
85
|
+
"inquirer": "12.6.0",
|
|
80
86
|
"jsonwebtoken": "^9.0.2",
|
|
81
87
|
"lodash": "^4.17.21",
|
|
82
88
|
"milliparsec": "^2.3.0",
|
|
89
|
+
"minimatch": "10.0.1",
|
|
83
90
|
"ms": "^2.1.3",
|
|
84
91
|
"nanoid": "3",
|
|
85
92
|
"neverthrow": "^6.1.0",
|
|
93
|
+
"playwright": "1.44.1",
|
|
86
94
|
"playwright-extra": "^4.3.6",
|
|
87
95
|
"prettier": "^2.8.0",
|
|
88
96
|
"promptly": "^3.2.0",
|
|
@@ -134,4 +142,4 @@
|
|
|
134
142
|
"peerDependencies": {
|
|
135
143
|
"@intuned/runtime": "*"
|
|
136
144
|
}
|
|
137
|
-
}
|
|
145
|
+
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { createHash } from "crypto";
|
|
2
|
-
|
|
3
|
-
function hashToken(token: string) {
|
|
4
|
-
// This has to match the logic from the workflow that saves adds the token to fly io App.
|
|
5
|
-
return createHash("sha256").update(token).digest("hex");
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export const accessKeyValidatorMiddleware = (req: any, res: any, next: any) => {
|
|
9
|
-
const authHeader = req.headers.authorization;
|
|
10
|
-
|
|
11
|
-
if (!authHeader || !authHeader.startsWith("Bearer ")) {
|
|
12
|
-
return res.status(401).send("Unauthorized");
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const token = authHeader.split(" ")[1];
|
|
16
|
-
|
|
17
|
-
// Create a hash of the provided token
|
|
18
|
-
const hashedToken = hashToken(token);
|
|
19
|
-
|
|
20
|
-
const hashedTokenFromEnv = process.env.HASHED_ACCESS_KEY;
|
|
21
|
-
|
|
22
|
-
if (hashedToken !== hashedTokenFromEnv) {
|
|
23
|
-
console.log("Token mismatch", hashedToken, hashedTokenFromEnv);
|
|
24
|
-
return res.status(401).send("Unauthorized");
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
next();
|
|
28
|
-
};
|