@intuned/runtime-dev 1.2.0-dev-peer → 1.2.1-hooks.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/.babelrc +2 -2
- package/.npmrc.wtf +1 -0
- package/CHANGELOG.md +5 -1
- package/WebTemplate.zip +0 -0
- package/bin/intuned +2 -0
- package/dist/commands/api/run.js +10 -3
- package/dist/commands/auth-sessions/run-check.js +18 -4
- package/dist/commands/auth-sessions/run-create.js +2 -1
- package/dist/commands/common/browserUtils.d.ts +1 -1
- package/dist/commands/common/browserUtils.js +1 -1
- package/dist/commands/common/getFirstLineNumber.js +2 -4
- package/dist/commands/interface/run.js +7 -6
- package/dist/commands/intuned-cli/commands/attempt.command.d.ts +1 -0
- package/dist/commands/intuned-cli/commands/attempt.command.js +8 -0
- package/dist/commands/intuned-cli/commands/attempt_api.command.d.ts +1 -0
- package/dist/commands/intuned-cli/commands/attempt_api.command.js +40 -0
- package/dist/commands/intuned-cli/commands/attempt_authsession.command.d.ts +1 -0
- package/dist/commands/intuned-cli/commands/attempt_authsession.command.js +8 -0
- package/dist/commands/intuned-cli/commands/attempt_authsession_check.command.d.ts +1 -0
- package/dist/commands/intuned-cli/commands/attempt_authsession_check.command.js +24 -0
- package/dist/commands/intuned-cli/commands/attempt_authsession_create.command.d.ts +1 -0
- package/dist/commands/intuned-cli/commands/attempt_authsession_create.command.js +36 -0
- package/dist/commands/intuned-cli/commands/build.command.d.ts +1 -0
- package/dist/commands/intuned-cli/commands/build.command.js +12 -0
- package/dist/commands/intuned-cli/commands/command.d.ts +2 -0
- package/dist/commands/intuned-cli/commands/command.js +9 -0
- package/dist/commands/intuned-cli/commands/deploy.command.d.ts +1 -0
- package/dist/commands/intuned-cli/commands/deploy.command.js +46 -0
- package/dist/commands/intuned-cli/commands/index.d.ts +15 -0
- package/dist/commands/intuned-cli/commands/index.js +170 -0
- package/dist/commands/intuned-cli/commands/init.command.d.ts +1 -0
- package/dist/commands/intuned-cli/commands/init.command.js +13 -0
- package/dist/commands/intuned-cli/commands/run.command.d.ts +1 -0
- package/dist/commands/intuned-cli/commands/run.command.js +8 -0
- package/dist/commands/intuned-cli/commands/run_api.command.d.ts +1 -0
- package/dist/commands/intuned-cli/commands/run_api.command.js +54 -0
- package/dist/commands/intuned-cli/commands/run_authsession.command.d.ts +20 -0
- package/dist/commands/intuned-cli/commands/run_authsession.command.js +13 -0
- package/dist/commands/intuned-cli/commands/run_authsession_create.command.d.ts +1 -0
- package/dist/commands/intuned-cli/commands/run_authsession_create.command.js +39 -0
- package/dist/commands/intuned-cli/commands/run_authsession_update.command.d.ts +1 -0
- package/dist/commands/intuned-cli/commands/run_authsession_update.command.js +39 -0
- package/dist/commands/intuned-cli/commands/run_authsession_validate.command.d.ts +1 -0
- package/dist/commands/intuned-cli/commands/run_authsession_validate.command.js +37 -0
- package/dist/commands/intuned-cli/commands/types.d.ts +21 -0
- package/dist/commands/intuned-cli/commands/types.js +21 -0
- package/dist/commands/intuned-cli/constants/index.d.ts +17 -0
- package/dist/commands/intuned-cli/constants/index.js +25 -0
- package/dist/commands/intuned-cli/controller/__test__/api.test.js +280 -0
- package/dist/commands/intuned-cli/controller/__test__/authSession.test.js +676 -0
- package/dist/commands/intuned-cli/controller/api.d.ts +44 -0
- package/dist/commands/intuned-cli/controller/api.js +181 -0
- package/dist/commands/intuned-cli/controller/authSession.d.ts +198 -0
- package/dist/commands/intuned-cli/controller/authSession.js +292 -0
- package/dist/commands/intuned-cli/controller/build.d.ts +1 -0
- package/dist/commands/intuned-cli/controller/build.js +36 -0
- package/dist/commands/intuned-cli/controller/deploy.d.ts +15 -0
- package/dist/commands/{deploy/utils.js → intuned-cli/controller/deploy.js} +115 -109
- package/dist/commands/intuned-cli/controller/index.d.ts +1 -0
- package/dist/commands/intuned-cli/controller/index.js +46 -0
- package/dist/commands/intuned-cli/helpers/api.d.ts +3 -0
- package/dist/commands/intuned-cli/helpers/api.js +19 -0
- package/dist/commands/intuned-cli/helpers/auth.d.ts +41 -0
- package/dist/commands/intuned-cli/helpers/auth.js +129 -0
- package/dist/commands/intuned-cli/helpers/backend.d.ts +8 -0
- package/dist/commands/intuned-cli/helpers/backend.js +26 -0
- package/dist/commands/intuned-cli/helpers/context.d.ts +3 -0
- package/dist/commands/intuned-cli/helpers/context.js +33 -0
- package/dist/commands/intuned-cli/helpers/errors.d.ts +14 -0
- package/dist/commands/intuned-cli/helpers/errors.js +55 -0
- package/dist/commands/intuned-cli/helpers/index.d.ts +10 -0
- package/dist/commands/intuned-cli/helpers/index.js +115 -0
- package/dist/commands/intuned-cli/helpers/intunedJson.d.ts +1 -0
- package/dist/{common/cli/utils.js → commands/intuned-cli/helpers/intunedJson.js} +0 -16
- package/dist/commands/intuned-cli/helpers/proxy.d.ts +5 -0
- package/dist/commands/intuned-cli/helpers/proxy.js +23 -0
- package/dist/commands/intuned-cli/helpers/terminal.d.ts +5 -0
- package/dist/commands/intuned-cli/helpers/terminal.js +13 -0
- package/dist/commands/intuned-cli/helpers/timeout.d.ts +1 -0
- package/dist/commands/intuned-cli/helpers/timeout.js +23 -0
- package/dist/commands/intuned-cli/helpers/validation.d.ts +2 -0
- package/dist/commands/intuned-cli/helpers/validation.js +12 -0
- package/dist/commands/intuned-cli/index.d.ts +1 -0
- package/dist/commands/intuned-cli/index.js +16 -0
- package/dist/commands/intuned-cli/main.d.ts +1 -0
- package/dist/commands/intuned-cli/main.js +15 -0
- package/dist/{common/cli → commands/intuned-cli}/types.d.ts +1 -34
- package/dist/{common/cli → commands/intuned-cli}/types.js +1 -2
- package/dist/common/assets/browser_scripts.js +2509 -2143
- package/dist/common/asyncLocalStorage/index.d.ts +2 -2
- package/dist/common/backendFunctions/getAuthSessionParameters.d.ts +1 -0
- package/dist/common/backendFunctions/getAuthSessionParameters.js +38 -0
- package/dist/common/constants.d.ts +1 -0
- package/dist/common/constants.js +2 -1
- package/dist/common/getPlaywrightConstructs.d.ts +6 -5
- package/dist/common/getPlaywrightConstructs.js +73 -37
- package/dist/common/jwtTokenManager.js +3 -5
- package/dist/common/runApi/errors.d.ts +1 -1
- package/dist/common/runApi/errors.js +4 -5
- package/dist/common/runApi/index.d.ts +4 -1
- package/dist/common/runApi/index.js +22 -21
- package/dist/common/runApi/types.d.ts +144 -13
- package/dist/common/runApi/types.js +28 -27
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -0
- package/dist/runtime/executionHelpers.test.js +3 -4
- package/dist/runtime/export.d.ts +18 -0
- package/dist/runtime/extendPayload.js +1 -1
- package/dist/runtime/extendTimeout.js +0 -7
- package/dist/runtime/getAuthSessionParameters.d.ts +1 -0
- package/dist/runtime/getAuthSessionParameters.js +20 -0
- package/dist/runtime/getCdpAddress.d.ts +1 -0
- package/dist/runtime/getCdpAddress.js +11 -0
- package/dist/runtime/index.d.ts +2 -0
- package/dist/runtime/index.js +15 -1
- package/package.json +11 -10
- package/template.tsconfig.json +4 -7
- package/tsconfig.json +2 -1
- package/bin/check-auth-session +0 -3
- package/bin/cli-build +0 -3
- package/bin/create-auth-session +0 -3
- package/bin/deploy +0 -3
- package/bin/init +0 -3
- package/bin/run-api +0 -3
- package/dist/commands/cli-auth-sessions/check.d.ts +0 -2
- package/dist/commands/cli-auth-sessions/check.js +0 -40
- package/dist/commands/cli-auth-sessions/create.d.ts +0 -2
- package/dist/commands/cli-auth-sessions/create.js +0 -53
- package/dist/commands/cli-auth-sessions/utils.d.ts +0 -28
- package/dist/commands/cli-auth-sessions/utils.js +0 -285
- package/dist/commands/cli-build/cli-build.d.ts +0 -2
- package/dist/commands/cli-build/cli-build.js +0 -20
- package/dist/commands/deploy/deploy.d.ts +0 -2
- package/dist/commands/deploy/deploy.js +0 -47
- package/dist/commands/deploy/utils.d.ts +0 -16
- package/dist/commands/init/init.d.ts +0 -2
- package/dist/commands/init/init.js +0 -22
- package/dist/commands/init/utils.d.ts +0 -11
- package/dist/commands/init/utils.js +0 -181
- package/dist/commands/run-api-cli/run-api.d.ts +0 -2
- package/dist/commands/run-api-cli/run-api.js +0 -57
- package/dist/commands/run-api-cli/utils.d.ts +0 -9
- package/dist/commands/run-api-cli/utils.js +0 -144
- package/dist/common/cli/cliReadme.d.ts +0 -1
- package/dist/common/cli/cliReadme.js +0 -92
- package/dist/common/cli/constants.d.ts +0 -33
- package/dist/common/cli/constants.js +0 -39
- package/dist/common/cli/utils.d.ts +0 -6
|
@@ -25,15 +25,146 @@ export interface RunAutomationResponse {
|
|
|
25
25
|
status: number;
|
|
26
26
|
body: RunAutomationResult;
|
|
27
27
|
}
|
|
28
|
+
export declare const runApiStorageStateSchema: z.ZodObject<{
|
|
29
|
+
cookies: z.ZodArray<z.ZodObject<{
|
|
30
|
+
name: z.ZodString;
|
|
31
|
+
value: z.ZodString;
|
|
32
|
+
domain: z.ZodString;
|
|
33
|
+
path: z.ZodString;
|
|
34
|
+
expires: z.ZodNumber;
|
|
35
|
+
httpOnly: z.ZodBoolean;
|
|
36
|
+
secure: z.ZodBoolean;
|
|
37
|
+
sameSite: z.ZodEnum<["Strict", "Lax", "None"]>;
|
|
38
|
+
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
value: string;
|
|
40
|
+
name: string;
|
|
41
|
+
path: string;
|
|
42
|
+
domain: string;
|
|
43
|
+
expires: number;
|
|
44
|
+
httpOnly: boolean;
|
|
45
|
+
secure: boolean;
|
|
46
|
+
sameSite: "Strict" | "Lax" | "None";
|
|
47
|
+
}, {
|
|
48
|
+
value: string;
|
|
49
|
+
name: string;
|
|
50
|
+
path: string;
|
|
51
|
+
domain: string;
|
|
52
|
+
expires: number;
|
|
53
|
+
httpOnly: boolean;
|
|
54
|
+
secure: boolean;
|
|
55
|
+
sameSite: "Strict" | "Lax" | "None";
|
|
56
|
+
}>, "many">;
|
|
57
|
+
origins: z.ZodArray<z.ZodObject<{
|
|
58
|
+
origin: z.ZodString;
|
|
59
|
+
localStorage: z.ZodArray<z.ZodObject<{
|
|
60
|
+
name: z.ZodString;
|
|
61
|
+
value: z.ZodString;
|
|
62
|
+
}, "strip", z.ZodTypeAny, {
|
|
63
|
+
value: string;
|
|
64
|
+
name: string;
|
|
65
|
+
}, {
|
|
66
|
+
value: string;
|
|
67
|
+
name: string;
|
|
68
|
+
}>, "many">;
|
|
69
|
+
}, "strip", z.ZodTypeAny, {
|
|
70
|
+
origin: string;
|
|
71
|
+
localStorage: {
|
|
72
|
+
value: string;
|
|
73
|
+
name: string;
|
|
74
|
+
}[];
|
|
75
|
+
}, {
|
|
76
|
+
origin: string;
|
|
77
|
+
localStorage: {
|
|
78
|
+
value: string;
|
|
79
|
+
name: string;
|
|
80
|
+
}[];
|
|
81
|
+
}>, "many">;
|
|
82
|
+
sessionStorage: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
83
|
+
origin: z.ZodString;
|
|
84
|
+
sessionStorage: z.ZodArray<z.ZodObject<{
|
|
85
|
+
name: z.ZodString;
|
|
86
|
+
value: z.ZodString;
|
|
87
|
+
}, "strip", z.ZodTypeAny, {
|
|
88
|
+
value: string;
|
|
89
|
+
name: string;
|
|
90
|
+
}, {
|
|
91
|
+
value: string;
|
|
92
|
+
name: string;
|
|
93
|
+
}>, "many">;
|
|
94
|
+
}, "strip", z.ZodTypeAny, {
|
|
95
|
+
sessionStorage: {
|
|
96
|
+
value: string;
|
|
97
|
+
name: string;
|
|
98
|
+
}[];
|
|
99
|
+
origin: string;
|
|
100
|
+
}, {
|
|
101
|
+
sessionStorage: {
|
|
102
|
+
value: string;
|
|
103
|
+
name: string;
|
|
104
|
+
}[];
|
|
105
|
+
origin: string;
|
|
106
|
+
}>, "many">>;
|
|
107
|
+
}, "strip", z.ZodTypeAny, {
|
|
108
|
+
cookies: {
|
|
109
|
+
value: string;
|
|
110
|
+
name: string;
|
|
111
|
+
path: string;
|
|
112
|
+
domain: string;
|
|
113
|
+
expires: number;
|
|
114
|
+
httpOnly: boolean;
|
|
115
|
+
secure: boolean;
|
|
116
|
+
sameSite: "Strict" | "Lax" | "None";
|
|
117
|
+
}[];
|
|
118
|
+
origins: {
|
|
119
|
+
origin: string;
|
|
120
|
+
localStorage: {
|
|
121
|
+
value: string;
|
|
122
|
+
name: string;
|
|
123
|
+
}[];
|
|
124
|
+
}[];
|
|
125
|
+
sessionStorage?: {
|
|
126
|
+
sessionStorage: {
|
|
127
|
+
value: string;
|
|
128
|
+
name: string;
|
|
129
|
+
}[];
|
|
130
|
+
origin: string;
|
|
131
|
+
}[] | undefined;
|
|
132
|
+
}, {
|
|
133
|
+
cookies: {
|
|
134
|
+
value: string;
|
|
135
|
+
name: string;
|
|
136
|
+
path: string;
|
|
137
|
+
domain: string;
|
|
138
|
+
expires: number;
|
|
139
|
+
httpOnly: boolean;
|
|
140
|
+
secure: boolean;
|
|
141
|
+
sameSite: "Strict" | "Lax" | "None";
|
|
142
|
+
}[];
|
|
143
|
+
origins: {
|
|
144
|
+
origin: string;
|
|
145
|
+
localStorage: {
|
|
146
|
+
value: string;
|
|
147
|
+
name: string;
|
|
148
|
+
}[];
|
|
149
|
+
}[];
|
|
150
|
+
sessionStorage?: {
|
|
151
|
+
sessionStorage: {
|
|
152
|
+
value: string;
|
|
153
|
+
name: string;
|
|
154
|
+
}[];
|
|
155
|
+
origin: string;
|
|
156
|
+
}[] | undefined;
|
|
157
|
+
}>;
|
|
158
|
+
export type RunApiStorageState = z.input<typeof runApiStorageStateSchema>;
|
|
28
159
|
export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
29
160
|
type: z.ZodLiteral<"file">;
|
|
30
161
|
path: z.ZodString;
|
|
31
162
|
}, "strip", z.ZodTypeAny, {
|
|
32
|
-
type: "file";
|
|
33
163
|
path: string;
|
|
34
|
-
}, {
|
|
35
164
|
type: "file";
|
|
165
|
+
}, {
|
|
36
166
|
path: string;
|
|
167
|
+
type: "file";
|
|
37
168
|
}>, z.ZodObject<{
|
|
38
169
|
type: z.ZodLiteral<"state">;
|
|
39
170
|
state: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
@@ -255,11 +386,11 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
255
386
|
type: z.ZodLiteral<"file">;
|
|
256
387
|
path: z.ZodString;
|
|
257
388
|
}, "strip", z.ZodTypeAny, {
|
|
258
|
-
type: "file";
|
|
259
389
|
path: string;
|
|
260
|
-
}, {
|
|
261
390
|
type: "file";
|
|
391
|
+
}, {
|
|
262
392
|
path: string;
|
|
393
|
+
type: "file";
|
|
263
394
|
}>, z.ZodObject<{
|
|
264
395
|
type: z.ZodLiteral<"state">;
|
|
265
396
|
state: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
@@ -452,8 +583,8 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
452
583
|
runCheck: z.ZodDefault<z.ZodBoolean>;
|
|
453
584
|
}, "strip", z.ZodTypeAny, {
|
|
454
585
|
session: {
|
|
455
|
-
type: "file";
|
|
456
586
|
path: string;
|
|
587
|
+
type: "file";
|
|
457
588
|
} | {
|
|
458
589
|
type: "state";
|
|
459
590
|
state?: {
|
|
@@ -486,8 +617,8 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
486
617
|
runCheck: boolean;
|
|
487
618
|
}, {
|
|
488
619
|
session: {
|
|
489
|
-
type: "file";
|
|
490
620
|
path: string;
|
|
621
|
+
type: "file";
|
|
491
622
|
} | {
|
|
492
623
|
type: "state";
|
|
493
624
|
state?: {
|
|
@@ -556,13 +687,13 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
556
687
|
cdpAddress: z.ZodString;
|
|
557
688
|
mode: z.ZodUnion<[z.ZodLiteral<"vanilla">, z.ZodLiteral<"playwright">, z.ZodLiteral<"playwright-standalone">, z.ZodLiteral<"playwright-headless">]>;
|
|
558
689
|
}, "strip", z.ZodTypeAny, {
|
|
690
|
+
cdpAddress: string;
|
|
559
691
|
mode: "vanilla" | "playwright" | "playwright-standalone" | "playwright-headless";
|
|
560
692
|
environment: "cdp";
|
|
561
|
-
cdpAddress: string;
|
|
562
693
|
}, {
|
|
694
|
+
cdpAddress: string;
|
|
563
695
|
mode: "vanilla" | "playwright" | "playwright-standalone" | "playwright-headless";
|
|
564
696
|
environment: "cdp";
|
|
565
|
-
cdpAddress: string;
|
|
566
697
|
}>]>>;
|
|
567
698
|
retrieveSession: z.ZodDefault<z.ZodBoolean>;
|
|
568
699
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -585,15 +716,15 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
585
716
|
password: string;
|
|
586
717
|
} | undefined;
|
|
587
718
|
} | {
|
|
719
|
+
cdpAddress: string;
|
|
588
720
|
mode: "vanilla" | "playwright" | "playwright-standalone" | "playwright-headless";
|
|
589
721
|
environment: "cdp";
|
|
590
|
-
cdpAddress: string;
|
|
591
722
|
};
|
|
592
723
|
retrieveSession: boolean;
|
|
593
724
|
auth?: {
|
|
594
725
|
session: {
|
|
595
|
-
type: "file";
|
|
596
726
|
path: string;
|
|
727
|
+
type: "file";
|
|
597
728
|
} | {
|
|
598
729
|
type: "state";
|
|
599
730
|
state?: {
|
|
@@ -638,8 +769,8 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
638
769
|
} | undefined;
|
|
639
770
|
auth?: {
|
|
640
771
|
session: {
|
|
641
|
-
type: "file";
|
|
642
772
|
path: string;
|
|
773
|
+
type: "file";
|
|
643
774
|
} | {
|
|
644
775
|
type: "state";
|
|
645
776
|
state?: {
|
|
@@ -680,9 +811,9 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
680
811
|
password: string;
|
|
681
812
|
} | undefined;
|
|
682
813
|
} | {
|
|
814
|
+
cdpAddress: string;
|
|
683
815
|
mode: "vanilla" | "playwright" | "playwright-standalone" | "playwright-headless";
|
|
684
816
|
environment: "cdp";
|
|
685
|
-
cdpAddress: string;
|
|
686
817
|
} | undefined;
|
|
687
818
|
retrieveSession?: boolean | undefined;
|
|
688
819
|
}>;
|
|
@@ -703,6 +834,6 @@ export type RunApiResultOk<R = any> = {
|
|
|
703
834
|
extendedPayloads?: Payload[];
|
|
704
835
|
};
|
|
705
836
|
export type RunApiResultWithSessionOk<R = any> = RunApiResultOk<R> & {
|
|
706
|
-
session:
|
|
837
|
+
session: RunApiStorageState;
|
|
707
838
|
};
|
|
708
839
|
export type RunApiResult<R = any, FullResult extends RunApiResultOk<R> = RunApiResultOk<R>> = Result<FullResult, RunAutomationError>;
|
|
@@ -3,40 +3,41 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.runApiSessionSchema = exports.runApiParametersSchema = void 0;
|
|
6
|
+
exports.runApiStorageStateSchema = exports.runApiSessionSchema = exports.runApiParametersSchema = void 0;
|
|
7
7
|
var _zod = _interopRequireDefault(require("zod"));
|
|
8
8
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
const runApiStorageStateSchema = exports.runApiStorageStateSchema = _zod.default.object({
|
|
10
|
+
cookies: _zod.default.array(_zod.default.object({
|
|
11
|
+
name: _zod.default.string(),
|
|
12
|
+
value: _zod.default.string(),
|
|
13
|
+
domain: _zod.default.string(),
|
|
14
|
+
path: _zod.default.string(),
|
|
15
|
+
expires: _zod.default.number(),
|
|
16
|
+
httpOnly: _zod.default.boolean(),
|
|
17
|
+
secure: _zod.default.boolean(),
|
|
18
|
+
sameSite: _zod.default.enum(["Strict", "Lax", "None"])
|
|
19
|
+
})),
|
|
20
|
+
origins: _zod.default.array(_zod.default.object({
|
|
21
|
+
origin: _zod.default.string(),
|
|
22
|
+
localStorage: _zod.default.array(_zod.default.object({
|
|
23
|
+
name: _zod.default.string(),
|
|
24
|
+
value: _zod.default.string()
|
|
25
|
+
}))
|
|
26
|
+
})),
|
|
27
|
+
sessionStorage: _zod.default.array(_zod.default.object({
|
|
28
|
+
origin: _zod.default.string(),
|
|
29
|
+
sessionStorage: _zod.default.array(_zod.default.object({
|
|
30
|
+
name: _zod.default.string(),
|
|
31
|
+
value: _zod.default.string()
|
|
32
|
+
}))
|
|
33
|
+
})).optional()
|
|
34
|
+
});
|
|
9
35
|
const runApiSessionSchema = exports.runApiSessionSchema = _zod.default.discriminatedUnion("type", [_zod.default.object({
|
|
10
36
|
type: _zod.default.literal("file"),
|
|
11
37
|
path: _zod.default.string()
|
|
12
38
|
}), _zod.default.object({
|
|
13
39
|
type: _zod.default.literal("state"),
|
|
14
|
-
state:
|
|
15
|
-
cookies: _zod.default.array(_zod.default.object({
|
|
16
|
-
name: _zod.default.string(),
|
|
17
|
-
value: _zod.default.string(),
|
|
18
|
-
domain: _zod.default.string(),
|
|
19
|
-
path: _zod.default.string(),
|
|
20
|
-
expires: _zod.default.number(),
|
|
21
|
-
httpOnly: _zod.default.boolean(),
|
|
22
|
-
secure: _zod.default.boolean(),
|
|
23
|
-
sameSite: _zod.default.enum(["Strict", "Lax", "None"])
|
|
24
|
-
})),
|
|
25
|
-
origins: _zod.default.array(_zod.default.object({
|
|
26
|
-
origin: _zod.default.string(),
|
|
27
|
-
localStorage: _zod.default.array(_zod.default.object({
|
|
28
|
-
name: _zod.default.string(),
|
|
29
|
-
value: _zod.default.string()
|
|
30
|
-
}))
|
|
31
|
-
})),
|
|
32
|
-
sessionStorage: _zod.default.array(_zod.default.object({
|
|
33
|
-
origin: _zod.default.string(),
|
|
34
|
-
sessionStorage: _zod.default.array(_zod.default.object({
|
|
35
|
-
name: _zod.default.string(),
|
|
36
|
-
value: _zod.default.string()
|
|
37
|
-
}))
|
|
38
|
-
})).optional()
|
|
39
|
-
}).nullable().optional()
|
|
40
|
+
state: runApiStorageStateSchema.nullable().optional()
|
|
40
41
|
})]);
|
|
41
42
|
const runApiParametersSchema = exports.runApiParametersSchema = _zod.default.object({
|
|
42
43
|
automationFunction: _zod.default.object({
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { extendPayload, extendTimeout, runInfo, RunError, requestMultipleChoice, requestOTP, } from "./runtime";
|
|
1
|
+
export { extendPayload, extendTimeout, runInfo, RunError, requestMultipleChoice, requestOTP, getAuthSessionParameters, } from "./runtime";
|
|
2
2
|
export { runWithContext, getExecutionContext, } from "./common/asyncLocalStorage";
|
|
3
3
|
export { getDownloadDirectoryPath } from "./runtime/downloadDirectory";
|
|
4
4
|
export { getProductionPlaywrightConstructs } from "./common/getPlaywrightConstructs";
|
package/dist/index.js
CHANGED
|
@@ -21,6 +21,12 @@ Object.defineProperty(exports, "extendTimeout", {
|
|
|
21
21
|
return _runtime.extendTimeout;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
+
Object.defineProperty(exports, "getAuthSessionParameters", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _runtime.getAuthSessionParameters;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
24
30
|
Object.defineProperty(exports, "getDownloadDirectoryPath", {
|
|
25
31
|
enumerable: true,
|
|
26
32
|
get: function () {
|
|
@@ -24,13 +24,12 @@ var _enums = require("./enums");
|
|
|
24
24
|
runId: "test-run-id",
|
|
25
25
|
extendedPayloads: []
|
|
26
26
|
}, () => {
|
|
27
|
-
|
|
28
|
-
(0, _vitest.expect)((_getExecutionContext = (0, _asyncLocalStorage.getExecutionContext)()) === null || _getExecutionContext === void 0 ? void 0 : _getExecutionContext.extendedPayloads).toEqual([]);
|
|
27
|
+
(0, _vitest.expect)((0, _asyncLocalStorage.getExecutionContext)()?.extendedPayloads).toEqual([]);
|
|
29
28
|
(0, _.extendPayload)({
|
|
30
29
|
api: "test-api",
|
|
31
30
|
parameters: {}
|
|
32
31
|
});
|
|
33
|
-
(0, _vitest.expect)((
|
|
32
|
+
(0, _vitest.expect)((0, _asyncLocalStorage.getExecutionContext)()?.extendedPayloads).toEqual([{
|
|
34
33
|
api: "test-api",
|
|
35
34
|
parameters: {}
|
|
36
35
|
}]);
|
|
@@ -47,7 +46,7 @@ var _enums = require("./enums");
|
|
|
47
46
|
parameters: {}
|
|
48
47
|
});
|
|
49
48
|
const context = (0, _asyncLocalStorage.getExecutionContext)();
|
|
50
|
-
(0, _vitest.expect)(context
|
|
49
|
+
(0, _vitest.expect)(context?.extendedPayloads).toHaveLength(4);
|
|
51
50
|
});
|
|
52
51
|
});
|
|
53
52
|
});
|
package/dist/runtime/export.d.ts
CHANGED
|
@@ -99,6 +99,7 @@ export interface RunInfo {
|
|
|
99
99
|
jobRunId?: string;
|
|
100
100
|
queueId?: string;
|
|
101
101
|
proxy?: string;
|
|
102
|
+
authSessionId?: string;
|
|
102
103
|
}
|
|
103
104
|
|
|
104
105
|
/**
|
|
@@ -200,3 +201,20 @@ export declare function requestMultipleChoice(
|
|
|
200
201
|
* ```
|
|
201
202
|
*/
|
|
202
203
|
export declare function requestOTP(message: string): unknown;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Retrieves the parameters for the authentication session currently being used.
|
|
207
|
+
*
|
|
208
|
+
* @returns {AuthSessionParameters} An object containing the parameters for the current authentication session.
|
|
209
|
+
*
|
|
210
|
+
* @example
|
|
211
|
+
* ```typescript getAuthSessionParameters
|
|
212
|
+
* import { getAuthSessionParameters } from "@intuned/sdk/runtime"
|
|
213
|
+
*
|
|
214
|
+
* const authSessionParams = getAuthSessionParameters();
|
|
215
|
+
* console.log(authSessionParams);
|
|
216
|
+
* ```
|
|
217
|
+
*/
|
|
218
|
+
export declare function getAuthSessionParameters(): Promise<any>;
|
|
219
|
+
|
|
220
|
+
export declare function getCdpAddress(): string | undefined;
|
|
@@ -16,6 +16,6 @@ function extendPayload(payload) {
|
|
|
16
16
|
context.extendedPayloads = [...items];
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
|
-
context
|
|
19
|
+
context?.extendedPayloads.push(...items);
|
|
20
20
|
(0, _extendTimeout.extendTimeout)();
|
|
21
21
|
}
|
|
@@ -17,13 +17,6 @@ function extendTimeout() {
|
|
|
17
17
|
if (!timeoutInfo) {
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
|
-
if (timeoutInfo.timeoutTimestamp !== undefined && timeoutInfo.timeoutDuration !== undefined) {
|
|
21
|
-
const newTimeoutStamp = Date.now() + timeoutInfo.timeoutDuration;
|
|
22
|
-
if (newTimeoutStamp - timeoutInfo.timeoutTimestamp < _DEBOUNCE_TIME) {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
timeoutInfo.timeoutTimestamp = newTimeoutStamp;
|
|
26
|
-
}
|
|
27
20
|
if (timeoutInfo.extendTimeoutCallback !== undefined) {
|
|
28
21
|
void timeoutInfo.extendTimeoutCallback().catch(() => undefined);
|
|
29
22
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getAuthSessionParameters(): Promise<any>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getAuthSessionParameters = getAuthSessionParameters;
|
|
7
|
+
var _asyncLocalStorage = require("../common/asyncLocalStorage");
|
|
8
|
+
async function getAuthSessionParameters() {
|
|
9
|
+
const context = (0, _asyncLocalStorage.getExecutionContext)();
|
|
10
|
+
if (!context) {
|
|
11
|
+
throw new Error("getAuthSessionParameters failed due to an internal error (context was not found).");
|
|
12
|
+
}
|
|
13
|
+
const {
|
|
14
|
+
getAuthSessionParameters
|
|
15
|
+
} = context;
|
|
16
|
+
if (!getAuthSessionParameters) {
|
|
17
|
+
throw new Error("getAuthSessionParameters failed due to an internal error (helper was not found on context).");
|
|
18
|
+
}
|
|
19
|
+
return await getAuthSessionParameters();
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getCdpAddress(): string | undefined;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getCdpAddress = getCdpAddress;
|
|
7
|
+
var _asyncLocalStorage = require("../common/asyncLocalStorage");
|
|
8
|
+
function getCdpAddress() {
|
|
9
|
+
const context = (0, _asyncLocalStorage.getExecutionContext)();
|
|
10
|
+
return context?.cdpAddress;
|
|
11
|
+
}
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export { extendPayload } from "./extendPayload";
|
|
2
2
|
export { extendTimeout } from "./extendTimeout";
|
|
3
|
+
export { getAuthSessionParameters } from "./getAuthSessionParameters";
|
|
3
4
|
export { runInfo } from "./runInfo";
|
|
4
5
|
export { RunError } from "./RunError";
|
|
5
6
|
export { requestMultipleChoice, requestOTP } from "./requestMoreInfo";
|
|
6
7
|
export type { RequestMoreInfoDetails } from "./requestMoreInfo";
|
|
7
8
|
export { getDownloadDirectoryPath } from "./downloadDirectory";
|
|
9
|
+
export { getCdpAddress } from "./getCdpAddress";
|
package/dist/runtime/index.js
CHANGED
|
@@ -21,6 +21,18 @@ Object.defineProperty(exports, "extendTimeout", {
|
|
|
21
21
|
return _extendTimeout.extendTimeout;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
+
Object.defineProperty(exports, "getAuthSessionParameters", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _getAuthSessionParameters.getAuthSessionParameters;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "getCdpAddress", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _getCdpAddress.getCdpAddress;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
24
36
|
Object.defineProperty(exports, "getDownloadDirectoryPath", {
|
|
25
37
|
enumerable: true,
|
|
26
38
|
get: function () {
|
|
@@ -47,7 +59,9 @@ Object.defineProperty(exports, "runInfo", {
|
|
|
47
59
|
});
|
|
48
60
|
var _extendPayload = require("./extendPayload");
|
|
49
61
|
var _extendTimeout = require("./extendTimeout");
|
|
62
|
+
var _getAuthSessionParameters = require("./getAuthSessionParameters");
|
|
50
63
|
var _runInfo = require("./runInfo");
|
|
51
64
|
var _RunError = require("./RunError");
|
|
52
65
|
var _requestMoreInfo = require("./requestMoreInfo");
|
|
53
|
-
var _downloadDirectory = require("./downloadDirectory");
|
|
66
|
+
var _downloadDirectory = require("./downloadDirectory");
|
|
67
|
+
var _getCdpAddress = require("./getCdpAddress");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intuned/runtime-dev",
|
|
3
|
-
"version": "1.2.0
|
|
3
|
+
"version": "1.2.1-hooks.0",
|
|
4
4
|
"description": "Intuned runtime",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dist/index.js",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"intuned-auth-session-refresh": "vite-node ./src/commands/auth/run-refresh.ts",
|
|
30
30
|
"intuned-auth-session-load": "vite-node ./src/commands/auth/load.ts",
|
|
31
31
|
"intuned-ts-check": "yarn prepublishOnly && vite-node ./src/commands/ts-check.ts",
|
|
32
|
+
"intuned": "vite-node ./src/commands/intuned-cli/main.ts",
|
|
32
33
|
"build": "rm -rf dist && tsc -p tsconfig.json && yarn copy-dts && babel src --out-dir dist --extensions '.ts' && cp -r ./src/common/assets dist/common/assets",
|
|
33
34
|
"test": "vitest run",
|
|
34
35
|
"test:watch": "vitest",
|
|
@@ -50,12 +51,7 @@
|
|
|
50
51
|
"intuned-browser-start": "./bin/intuned-browser-start",
|
|
51
52
|
"intuned-browser-save-state": "./bin/intuned-browser-save-state",
|
|
52
53
|
"intuned-ts-check": "./bin/intuned-ts-check",
|
|
53
|
-
"
|
|
54
|
-
"run-api": "./bin/run-api",
|
|
55
|
-
"deploy": "./bin/deploy",
|
|
56
|
-
"cli-build": "./bin/cli-build",
|
|
57
|
-
"create-auth-session": "./bin/create-auth-session",
|
|
58
|
-
"check-auth-session": "./bin/check-auth-session"
|
|
54
|
+
"intuned": "./bin/intuned"
|
|
59
55
|
},
|
|
60
56
|
"dependencies": {
|
|
61
57
|
"@babel/plugin-syntax-dynamic-import": "7.8.3",
|
|
@@ -69,12 +65,12 @@
|
|
|
69
65
|
"@types/node": "20.4.1",
|
|
70
66
|
"applicationinsights": "2.9.2",
|
|
71
67
|
"babel-plugin-dynamic-import-node": "2.3.3",
|
|
72
|
-
"boxen": "8.0.1",
|
|
73
68
|
"chalk": "^4.1.2",
|
|
74
|
-
"commander": "
|
|
69
|
+
"commander": "14.0.0",
|
|
75
70
|
"cross-fetch": "^4.0.0",
|
|
76
71
|
"dotenv": "^16.3.1",
|
|
77
72
|
"fs-extra": "^11.3.0",
|
|
73
|
+
"get-port": "^7.1.0",
|
|
78
74
|
"image-size": "^1.1.1",
|
|
79
75
|
"inquirer": "12.6.0",
|
|
80
76
|
"jsonwebtoken": "9.0.2",
|
|
@@ -83,10 +79,12 @@
|
|
|
83
79
|
"minimatch": "10.0.1",
|
|
84
80
|
"nanoid": "3",
|
|
85
81
|
"neverthrow": "6.1.0",
|
|
82
|
+
"playwright-extra": "4.3.6",
|
|
86
83
|
"prettier": "2.8.0",
|
|
87
84
|
"promptly": "3.2.0",
|
|
88
85
|
"rollup": "3.26.2",
|
|
89
86
|
"source-map": "0.7.4",
|
|
87
|
+
"terminal-kit": "^3.1.2",
|
|
90
88
|
"ts-morph": "21.0.1",
|
|
91
89
|
"ts-node": "10.9.1",
|
|
92
90
|
"tslib": "2.6.0",
|
|
@@ -105,7 +103,9 @@
|
|
|
105
103
|
"@ngneat/falso": "^7.2.0",
|
|
106
104
|
"@types/jest": "^29.5.3",
|
|
107
105
|
"@types/jsdom": "^21.1.1",
|
|
106
|
+
"@types/ms": "^2.1.0",
|
|
108
107
|
"@types/promptly": "^3.0.4",
|
|
108
|
+
"@types/terminal-kit": "^2.5.7",
|
|
109
109
|
"@types/wait-on": "^5.3.4",
|
|
110
110
|
"@typescript-eslint/eslint-plugin": "^5.47.1",
|
|
111
111
|
"@typescript-eslint/parser": "^7.5.0",
|
|
@@ -119,6 +119,7 @@
|
|
|
119
119
|
"eslint-plugin-deprecation": "^1.3.3",
|
|
120
120
|
"eslint-plugin-prettier": "^4.2.1",
|
|
121
121
|
"msw": "^2.1.2",
|
|
122
|
+
"playwright": "^1.55.0",
|
|
122
123
|
"typedoc": "^0.25.13",
|
|
123
124
|
"typedoc-plugin-frontmatter": "^1.0.0",
|
|
124
125
|
"typedoc-plugin-markdown": "^4.0.2",
|
|
@@ -131,4 +132,4 @@
|
|
|
131
132
|
"peerDependencies": {
|
|
132
133
|
"playwright": "*"
|
|
133
134
|
}
|
|
134
|
-
}
|
|
135
|
+
}
|
package/template.tsconfig.json
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"module": "ESNext",
|
|
4
3
|
"target": "ES2021",
|
|
5
|
-
"lib": [
|
|
6
|
-
"dom",
|
|
7
|
-
"es2021"
|
|
8
|
-
],
|
|
4
|
+
"lib": ["dom", "es2021"],
|
|
9
5
|
"resolveJsonModule": true,
|
|
10
6
|
"esModuleInterop": true,
|
|
11
|
-
"moduleResolution": "
|
|
7
|
+
"moduleResolution": "bundler",
|
|
8
|
+
"module": "esnext",
|
|
12
9
|
"skipLibCheck": true
|
|
13
10
|
}
|
|
14
|
-
}
|
|
11
|
+
}
|
package/tsconfig.json
CHANGED
package/bin/check-auth-session
DELETED
package/bin/cli-build
DELETED
package/bin/create-auth-session
DELETED
package/bin/deploy
DELETED
package/bin/init
DELETED
package/bin/run-api
DELETED