@intuned/runtime-dev 1.2.1-hooks.1 → 1.2.1-hooks.11
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 +1 -2
- 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/api.js +1 -2
- package/dist/commands/intuned-cli/controller/authSession.d.ts +6 -6
- package/dist/commands/intuned-cli/controller/authSession.js +3 -4
- package/dist/commands/intuned-cli/helpers/auth.d.ts +1 -1
- package/dist/commands/intuned-cli/helpers/errors.d.ts +2 -2
- package/dist/commands/intuned-cli/helpers/errors.js +8 -4
- package/dist/common/asyncLocalStorage/index.d.ts +1 -1
- package/dist/common/initializeContextHook.d.ts +16 -0
- package/dist/common/initializeContextHook.js +15 -0
- package/dist/common/playwrightContext.d.ts +49 -0
- package/dist/common/playwrightContext.js +237 -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 +87 -174
- package/dist/common/runApi/types.d.ts +25 -29
- package/dist/common/runApi/types.js +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +7 -20
- package/dist/runtime/export.d.ts +49 -43
- package/dist/runtime/index.d.ts +1 -3
- package/dist/runtime/index.js +6 -19
- package/dist/runtime/store.d.ts +2 -0
- package/dist/runtime/store.js +23 -0
- package/package.json +2 -2
- package/.npmrc.wtf +0 -1
- package/dist/common/getPlaywrightConstructs.d.ts +0 -31
- package/dist/common/getPlaywrightConstructs.js +0 -234
- package/dist/runtime/getCdpAddress.d.ts +0 -1
- package/dist/runtime/getCdpAddress.js +0 -11
- package/dist/runtime/requestMoreInfo.d.ts +0 -18
- package/dist/runtime/requestMoreInfo.js +0 -25
|
@@ -36,18 +36,18 @@ export declare const runApiStorageStateSchema: z.ZodObject<{
|
|
|
36
36
|
secure: z.ZodBoolean;
|
|
37
37
|
sameSite: z.ZodEnum<["Strict", "Lax", "None"]>;
|
|
38
38
|
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
path: string;
|
|
39
40
|
value: string;
|
|
40
41
|
name: string;
|
|
41
|
-
path: string;
|
|
42
42
|
domain: string;
|
|
43
43
|
expires: number;
|
|
44
44
|
httpOnly: boolean;
|
|
45
45
|
secure: boolean;
|
|
46
46
|
sameSite: "Strict" | "Lax" | "None";
|
|
47
47
|
}, {
|
|
48
|
+
path: string;
|
|
48
49
|
value: string;
|
|
49
50
|
name: string;
|
|
50
|
-
path: string;
|
|
51
51
|
domain: string;
|
|
52
52
|
expires: number;
|
|
53
53
|
httpOnly: boolean;
|
|
@@ -106,9 +106,9 @@ export declare const runApiStorageStateSchema: z.ZodObject<{
|
|
|
106
106
|
}>, "many">>;
|
|
107
107
|
}, "strip", z.ZodTypeAny, {
|
|
108
108
|
cookies: {
|
|
109
|
+
path: string;
|
|
109
110
|
value: string;
|
|
110
111
|
name: string;
|
|
111
|
-
path: string;
|
|
112
112
|
domain: string;
|
|
113
113
|
expires: number;
|
|
114
114
|
httpOnly: boolean;
|
|
@@ -131,9 +131,9 @@ export declare const runApiStorageStateSchema: z.ZodObject<{
|
|
|
131
131
|
}[] | undefined;
|
|
132
132
|
}, {
|
|
133
133
|
cookies: {
|
|
134
|
+
path: string;
|
|
134
135
|
value: string;
|
|
135
136
|
name: string;
|
|
136
|
-
path: string;
|
|
137
137
|
domain: string;
|
|
138
138
|
expires: number;
|
|
139
139
|
httpOnly: boolean;
|
|
@@ -178,18 +178,18 @@ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
|
|
|
178
178
|
secure: z.ZodBoolean;
|
|
179
179
|
sameSite: z.ZodEnum<["Strict", "Lax", "None"]>;
|
|
180
180
|
}, "strip", z.ZodTypeAny, {
|
|
181
|
+
path: string;
|
|
181
182
|
value: string;
|
|
182
183
|
name: string;
|
|
183
|
-
path: string;
|
|
184
184
|
domain: string;
|
|
185
185
|
expires: number;
|
|
186
186
|
httpOnly: boolean;
|
|
187
187
|
secure: boolean;
|
|
188
188
|
sameSite: "Strict" | "Lax" | "None";
|
|
189
189
|
}, {
|
|
190
|
+
path: string;
|
|
190
191
|
value: string;
|
|
191
192
|
name: string;
|
|
192
|
-
path: string;
|
|
193
193
|
domain: string;
|
|
194
194
|
expires: number;
|
|
195
195
|
httpOnly: boolean;
|
|
@@ -248,9 +248,9 @@ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
|
|
|
248
248
|
}>, "many">>;
|
|
249
249
|
}, "strip", z.ZodTypeAny, {
|
|
250
250
|
cookies: {
|
|
251
|
+
path: string;
|
|
251
252
|
value: string;
|
|
252
253
|
name: string;
|
|
253
|
-
path: string;
|
|
254
254
|
domain: string;
|
|
255
255
|
expires: number;
|
|
256
256
|
httpOnly: boolean;
|
|
@@ -273,9 +273,9 @@ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
|
|
|
273
273
|
}[] | undefined;
|
|
274
274
|
}, {
|
|
275
275
|
cookies: {
|
|
276
|
+
path: string;
|
|
276
277
|
value: string;
|
|
277
278
|
name: string;
|
|
278
|
-
path: string;
|
|
279
279
|
domain: string;
|
|
280
280
|
expires: number;
|
|
281
281
|
httpOnly: boolean;
|
|
@@ -301,9 +301,9 @@ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
|
|
|
301
301
|
type: "state";
|
|
302
302
|
state?: {
|
|
303
303
|
cookies: {
|
|
304
|
+
path: string;
|
|
304
305
|
value: string;
|
|
305
306
|
name: string;
|
|
306
|
-
path: string;
|
|
307
307
|
domain: string;
|
|
308
308
|
expires: number;
|
|
309
309
|
httpOnly: boolean;
|
|
@@ -329,9 +329,9 @@ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
|
|
|
329
329
|
type: "state";
|
|
330
330
|
state?: {
|
|
331
331
|
cookies: {
|
|
332
|
+
path: string;
|
|
332
333
|
value: string;
|
|
333
334
|
name: string;
|
|
334
|
-
path: string;
|
|
335
335
|
domain: string;
|
|
336
336
|
expires: number;
|
|
337
337
|
httpOnly: boolean;
|
|
@@ -404,18 +404,18 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
404
404
|
secure: z.ZodBoolean;
|
|
405
405
|
sameSite: z.ZodEnum<["Strict", "Lax", "None"]>;
|
|
406
406
|
}, "strip", z.ZodTypeAny, {
|
|
407
|
+
path: string;
|
|
407
408
|
value: string;
|
|
408
409
|
name: string;
|
|
409
|
-
path: string;
|
|
410
410
|
domain: string;
|
|
411
411
|
expires: number;
|
|
412
412
|
httpOnly: boolean;
|
|
413
413
|
secure: boolean;
|
|
414
414
|
sameSite: "Strict" | "Lax" | "None";
|
|
415
415
|
}, {
|
|
416
|
+
path: string;
|
|
416
417
|
value: string;
|
|
417
418
|
name: string;
|
|
418
|
-
path: string;
|
|
419
419
|
domain: string;
|
|
420
420
|
expires: number;
|
|
421
421
|
httpOnly: boolean;
|
|
@@ -474,9 +474,9 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
474
474
|
}>, "many">>;
|
|
475
475
|
}, "strip", z.ZodTypeAny, {
|
|
476
476
|
cookies: {
|
|
477
|
+
path: string;
|
|
477
478
|
value: string;
|
|
478
479
|
name: string;
|
|
479
|
-
path: string;
|
|
480
480
|
domain: string;
|
|
481
481
|
expires: number;
|
|
482
482
|
httpOnly: boolean;
|
|
@@ -499,9 +499,9 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
499
499
|
}[] | undefined;
|
|
500
500
|
}, {
|
|
501
501
|
cookies: {
|
|
502
|
+
path: string;
|
|
502
503
|
value: string;
|
|
503
504
|
name: string;
|
|
504
|
-
path: string;
|
|
505
505
|
domain: string;
|
|
506
506
|
expires: number;
|
|
507
507
|
httpOnly: boolean;
|
|
@@ -527,9 +527,9 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
527
527
|
type: "state";
|
|
528
528
|
state?: {
|
|
529
529
|
cookies: {
|
|
530
|
+
path: string;
|
|
530
531
|
value: string;
|
|
531
532
|
name: string;
|
|
532
|
-
path: string;
|
|
533
533
|
domain: string;
|
|
534
534
|
expires: number;
|
|
535
535
|
httpOnly: boolean;
|
|
@@ -555,9 +555,9 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
555
555
|
type: "state";
|
|
556
556
|
state?: {
|
|
557
557
|
cookies: {
|
|
558
|
+
path: string;
|
|
558
559
|
value: string;
|
|
559
560
|
name: string;
|
|
560
|
-
path: string;
|
|
561
561
|
domain: string;
|
|
562
562
|
expires: number;
|
|
563
563
|
httpOnly: boolean;
|
|
@@ -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;
|
|
@@ -589,9 +588,9 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
589
588
|
type: "state";
|
|
590
589
|
state?: {
|
|
591
590
|
cookies: {
|
|
591
|
+
path: string;
|
|
592
592
|
value: string;
|
|
593
593
|
name: string;
|
|
594
|
-
path: string;
|
|
595
594
|
domain: string;
|
|
596
595
|
expires: number;
|
|
597
596
|
httpOnly: boolean;
|
|
@@ -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;
|
|
@@ -623,9 +621,9 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
623
621
|
type: "state";
|
|
624
622
|
state?: {
|
|
625
623
|
cookies: {
|
|
624
|
+
path: string;
|
|
626
625
|
value: string;
|
|
627
626
|
name: string;
|
|
628
|
-
path: string;
|
|
629
627
|
domain: string;
|
|
630
628
|
expires: number;
|
|
631
629
|
httpOnly: boolean;
|
|
@@ -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">;
|
|
@@ -687,13 +684,13 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
687
684
|
cdpAddress: z.ZodString;
|
|
688
685
|
mode: z.ZodUnion<[z.ZodLiteral<"vanilla">, z.ZodLiteral<"playwright">, z.ZodLiteral<"playwright-standalone">, z.ZodLiteral<"playwright-headless">]>;
|
|
689
686
|
}, "strip", z.ZodTypeAny, {
|
|
690
|
-
cdpAddress: string;
|
|
691
687
|
mode: "vanilla" | "playwright" | "playwright-standalone" | "playwright-headless";
|
|
692
688
|
environment: "cdp";
|
|
693
|
-
}, {
|
|
694
689
|
cdpAddress: string;
|
|
690
|
+
}, {
|
|
695
691
|
mode: "vanilla" | "playwright" | "playwright-standalone" | "playwright-headless";
|
|
696
692
|
environment: "cdp";
|
|
693
|
+
cdpAddress: string;
|
|
697
694
|
}>]>>;
|
|
698
695
|
retrieveSession: z.ZodDefault<z.ZodBoolean>;
|
|
699
696
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -716,9 +713,9 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
716
713
|
password: string;
|
|
717
714
|
} | undefined;
|
|
718
715
|
} | {
|
|
719
|
-
cdpAddress: string;
|
|
720
716
|
mode: "vanilla" | "playwright" | "playwright-standalone" | "playwright-headless";
|
|
721
717
|
environment: "cdp";
|
|
718
|
+
cdpAddress: string;
|
|
722
719
|
};
|
|
723
720
|
retrieveSession: boolean;
|
|
724
721
|
auth?: {
|
|
@@ -729,9 +726,9 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
729
726
|
type: "state";
|
|
730
727
|
state?: {
|
|
731
728
|
cookies: {
|
|
729
|
+
path: string;
|
|
732
730
|
value: string;
|
|
733
731
|
name: string;
|
|
734
|
-
path: string;
|
|
735
732
|
domain: string;
|
|
736
733
|
expires: number;
|
|
737
734
|
httpOnly: boolean;
|
|
@@ -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: {
|
|
@@ -775,9 +771,9 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
775
771
|
type: "state";
|
|
776
772
|
state?: {
|
|
777
773
|
cookies: {
|
|
774
|
+
path: string;
|
|
778
775
|
value: string;
|
|
779
776
|
name: string;
|
|
780
|
-
path: string;
|
|
781
777
|
domain: string;
|
|
782
778
|
expires: number;
|
|
783
779
|
httpOnly: boolean;
|
|
@@ -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";
|
|
@@ -811,9 +806,9 @@ export declare const runApiParametersSchema: z.ZodObject<{
|
|
|
811
806
|
password: string;
|
|
812
807
|
} | undefined;
|
|
813
808
|
} | {
|
|
814
|
-
cdpAddress: string;
|
|
815
809
|
mode: "vanilla" | "playwright" | "playwright-standalone" | "playwright-headless";
|
|
816
810
|
environment: "cdp";
|
|
811
|
+
cdpAddress: string;
|
|
817
812
|
} | undefined;
|
|
818
813
|
retrieveSession?: boolean | undefined;
|
|
819
814
|
}>;
|
|
@@ -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"),
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export { extendPayload, extendTimeout, runInfo, RunError,
|
|
1
|
+
export { extendPayload, extendTimeout, runInfo, RunError, getAuthSessionParameters, store, } from "./runtime";
|
|
2
2
|
export { runWithContext, getExecutionContext, } from "./common/asyncLocalStorage";
|
|
3
3
|
export { getDownloadDirectoryPath } from "./runtime/downloadDirectory";
|
|
4
|
-
export { getProductionPlaywrightConstructs } from "./common/getPlaywrightConstructs";
|
package/dist/index.js
CHANGED
|
@@ -39,24 +39,6 @@ Object.defineProperty(exports, "getExecutionContext", {
|
|
|
39
39
|
return _asyncLocalStorage.getExecutionContext;
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
|
-
Object.defineProperty(exports, "getProductionPlaywrightConstructs", {
|
|
43
|
-
enumerable: true,
|
|
44
|
-
get: function () {
|
|
45
|
-
return _getPlaywrightConstructs.getProductionPlaywrightConstructs;
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
Object.defineProperty(exports, "requestMultipleChoice", {
|
|
49
|
-
enumerable: true,
|
|
50
|
-
get: function () {
|
|
51
|
-
return _runtime.requestMultipleChoice;
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
Object.defineProperty(exports, "requestOTP", {
|
|
55
|
-
enumerable: true,
|
|
56
|
-
get: function () {
|
|
57
|
-
return _runtime.requestOTP;
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
42
|
Object.defineProperty(exports, "runInfo", {
|
|
61
43
|
enumerable: true,
|
|
62
44
|
get: function () {
|
|
@@ -69,7 +51,12 @@ Object.defineProperty(exports, "runWithContext", {
|
|
|
69
51
|
return _asyncLocalStorage.runWithContext;
|
|
70
52
|
}
|
|
71
53
|
});
|
|
54
|
+
Object.defineProperty(exports, "store", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _runtime.store;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
72
60
|
var _runtime = require("./runtime");
|
|
73
61
|
var _asyncLocalStorage = require("./common/asyncLocalStorage");
|
|
74
|
-
var _downloadDirectory = require("./runtime/downloadDirectory");
|
|
75
|
-
var _getPlaywrightConstructs = require("./common/getPlaywrightConstructs");
|
|
62
|
+
var _downloadDirectory = require("./runtime/downloadDirectory");
|
package/dist/runtime/export.d.ts
CHANGED
|
@@ -154,67 +154,73 @@ export declare class RunError extends Error {
|
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
/**
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
* **Note:** This function is currently in beta and may be subject to changes.
|
|
157
|
+
* Retrieves the parameters for the authentication session currently being used.
|
|
160
158
|
*
|
|
161
|
-
* @
|
|
162
|
-
* @param {string[]} choices - An array of choices to present to the user.
|
|
159
|
+
* @returns {AuthSessionParameters} An object containing the parameters for the current authentication session.
|
|
163
160
|
*
|
|
164
161
|
* @example
|
|
165
|
-
* ```typescript
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
* import { requestMultipleChoice } from "@intuned/sdk/runtime"
|
|
169
|
-
*
|
|
170
|
-
* const message = "What is your favorite color?";
|
|
171
|
-
* const choices = ["Red", "Blue", "Green", "Yellow"];
|
|
172
|
-
*
|
|
173
|
-
* const selectedChoice = yield requestMultipleChoice(message, choices);
|
|
162
|
+
* ```typescript getAuthSessionParameters
|
|
163
|
+
* import { getAuthSessionParameters } from "@intuned/sdk/runtime"
|
|
174
164
|
*
|
|
175
|
-
*
|
|
165
|
+
* const authSessionParams = getAuthSessionParameters();
|
|
166
|
+
* console.log(authSessionParams);
|
|
176
167
|
* ```
|
|
177
168
|
*/
|
|
178
|
-
export declare function
|
|
179
|
-
message: string,
|
|
180
|
-
choices: string[]
|
|
181
|
-
): unknown;
|
|
169
|
+
export declare function getAuthSessionParameters(): Promise<any>;
|
|
182
170
|
|
|
183
171
|
/**
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
* @param {string} message - The message to display to the user.
|
|
172
|
+
* @interface Store
|
|
173
|
+
* @property {function} get - Retrieves a value from the store by key
|
|
174
|
+
* @property {function} set - Sets a value in the store by key
|
|
189
175
|
*
|
|
190
176
|
* @example
|
|
191
|
-
* ```typescript
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
* import { requestOTP } from "@intuned/sdk/runtime"
|
|
195
|
-
*
|
|
196
|
-
* const message = "please submit and OTP from your authenticator app";
|
|
177
|
+
* ```typescript Store usage
|
|
178
|
+
* import { store } from "@intuned/sdk/runtime"
|
|
197
179
|
*
|
|
198
|
-
*
|
|
180
|
+
* // Set a value in the store
|
|
181
|
+
* store.set('userPreference', { theme: 'dark' });
|
|
199
182
|
*
|
|
200
|
-
*
|
|
183
|
+
* // Get a value from the store
|
|
184
|
+
* const preference = store.get('userPreference');
|
|
201
185
|
* ```
|
|
202
186
|
*/
|
|
203
|
-
export
|
|
187
|
+
export interface Store {
|
|
188
|
+
/**
|
|
189
|
+
* Retrieves a value from the store by key.
|
|
190
|
+
*
|
|
191
|
+
* @param {string} key - The key to retrieve the value for
|
|
192
|
+
* @returns {any} The value associated with the key, or undefined if not found
|
|
193
|
+
*/
|
|
194
|
+
get(key: string): any;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Sets a value in the store by key.
|
|
198
|
+
*
|
|
199
|
+
* @param {string} key - The key to set the value for
|
|
200
|
+
* @param {any} value - The value to store
|
|
201
|
+
* @throws {Error} Throws an error if the store operation fails
|
|
202
|
+
*/
|
|
203
|
+
set(key: string, value: any): void;
|
|
204
|
+
}
|
|
204
205
|
|
|
205
206
|
/**
|
|
206
|
-
*
|
|
207
|
-
*
|
|
208
|
-
*
|
|
207
|
+
* ## Description
|
|
208
|
+
* A persistent key-value store that maintains data within the execution context.
|
|
209
|
+
* This store allows you to share data between different parts of your API execution.
|
|
209
210
|
*
|
|
210
211
|
* @example
|
|
211
|
-
* ```typescript
|
|
212
|
-
* import {
|
|
212
|
+
* ```typescript Store usage
|
|
213
|
+
* import { store } from "@intuned/sdk/runtime"
|
|
213
214
|
*
|
|
214
|
-
*
|
|
215
|
-
*
|
|
215
|
+
* // Set a value in the store
|
|
216
|
+
* store.set('sessionData', { userId: '123', token: 'abc' });
|
|
217
|
+
*
|
|
218
|
+
* // Get a value from the store
|
|
219
|
+
* const sessionData = store.get('sessionData');
|
|
220
|
+
* console.log(sessionData.userId); // '123'
|
|
221
|
+
*
|
|
222
|
+
* // Handle missing values
|
|
223
|
+
* const missingData = store.get('nonexistent'); // undefined
|
|
216
224
|
* ```
|
|
217
225
|
*/
|
|
218
|
-
export declare
|
|
219
|
-
|
|
220
|
-
export declare function getCdpAddress(): string | undefined;
|
|
226
|
+
export declare const store: Store;
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
export { extendPayload } from "./extendPayload";
|
|
2
2
|
export { extendTimeout } from "./extendTimeout";
|
|
3
|
+
export { store } from "./store";
|
|
3
4
|
export { getAuthSessionParameters } from "./getAuthSessionParameters";
|
|
4
5
|
export { runInfo } from "./runInfo";
|
|
5
6
|
export { RunError } from "./RunError";
|
|
6
|
-
export { requestMultipleChoice, requestOTP } from "./requestMoreInfo";
|
|
7
|
-
export type { RequestMoreInfoDetails } from "./requestMoreInfo";
|
|
8
7
|
export { getDownloadDirectoryPath } from "./downloadDirectory";
|
|
9
|
-
export { getCdpAddress } from "./getCdpAddress";
|
package/dist/runtime/index.js
CHANGED
|
@@ -27,41 +27,28 @@ Object.defineProperty(exports, "getAuthSessionParameters", {
|
|
|
27
27
|
return _getAuthSessionParameters.getAuthSessionParameters;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
-
Object.defineProperty(exports, "getCdpAddress", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function () {
|
|
33
|
-
return _getCdpAddress.getCdpAddress;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
30
|
Object.defineProperty(exports, "getDownloadDirectoryPath", {
|
|
37
31
|
enumerable: true,
|
|
38
32
|
get: function () {
|
|
39
33
|
return _downloadDirectory.getDownloadDirectoryPath;
|
|
40
34
|
}
|
|
41
35
|
});
|
|
42
|
-
Object.defineProperty(exports, "
|
|
43
|
-
enumerable: true,
|
|
44
|
-
get: function () {
|
|
45
|
-
return _requestMoreInfo.requestMultipleChoice;
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
Object.defineProperty(exports, "requestOTP", {
|
|
36
|
+
Object.defineProperty(exports, "runInfo", {
|
|
49
37
|
enumerable: true,
|
|
50
38
|
get: function () {
|
|
51
|
-
return
|
|
39
|
+
return _runInfo.runInfo;
|
|
52
40
|
}
|
|
53
41
|
});
|
|
54
|
-
Object.defineProperty(exports, "
|
|
42
|
+
Object.defineProperty(exports, "store", {
|
|
55
43
|
enumerable: true,
|
|
56
44
|
get: function () {
|
|
57
|
-
return
|
|
45
|
+
return _store.store;
|
|
58
46
|
}
|
|
59
47
|
});
|
|
60
48
|
var _extendPayload = require("./extendPayload");
|
|
61
49
|
var _extendTimeout = require("./extendTimeout");
|
|
50
|
+
var _store = require("./store");
|
|
62
51
|
var _getAuthSessionParameters = require("./getAuthSessionParameters");
|
|
63
52
|
var _runInfo = require("./runInfo");
|
|
64
53
|
var _RunError = require("./RunError");
|
|
65
|
-
var
|
|
66
|
-
var _downloadDirectory = require("./downloadDirectory");
|
|
67
|
-
var _getCdpAddress = require("./getCdpAddress");
|
|
54
|
+
var _downloadDirectory = require("./downloadDirectory");
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.store = void 0;
|
|
7
|
+
var _asyncLocalStorage = require("../common/asyncLocalStorage");
|
|
8
|
+
const store = exports.store = Object.freeze({
|
|
9
|
+
get: key => {
|
|
10
|
+
const context = (0, _asyncLocalStorage.getExecutionContext)();
|
|
11
|
+
return context?.store ? context.store[key] : undefined;
|
|
12
|
+
},
|
|
13
|
+
set: (key, value) => {
|
|
14
|
+
const context = (0, _asyncLocalStorage.getExecutionContext)();
|
|
15
|
+
if (!context) {
|
|
16
|
+
throw new Error("store.set failed due to an internal error.");
|
|
17
|
+
}
|
|
18
|
+
if (!context.store) {
|
|
19
|
+
context.store = {};
|
|
20
|
+
}
|
|
21
|
+
context.store[key] = value;
|
|
22
|
+
}
|
|
23
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intuned/runtime-dev",
|
|
3
|
-
"version": "1.2.1-hooks.
|
|
3
|
+
"version": "1.2.1-hooks.11",
|
|
4
4
|
"description": "Intuned runtime",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dist/index.js",
|
|
@@ -70,7 +70,6 @@
|
|
|
70
70
|
"cross-fetch": "^4.0.0",
|
|
71
71
|
"dotenv": "^16.3.1",
|
|
72
72
|
"fs-extra": "^11.3.0",
|
|
73
|
-
"get-port": "^7.1.0",
|
|
74
73
|
"image-size": "^1.1.1",
|
|
75
74
|
"inquirer": "12.6.0",
|
|
76
75
|
"jsonwebtoken": "9.0.2",
|
|
@@ -80,6 +79,7 @@
|
|
|
80
79
|
"nanoid": "3",
|
|
81
80
|
"neverthrow": "6.1.0",
|
|
82
81
|
"playwright-extra": "4.3.6",
|
|
82
|
+
"portfinder": "^1.0.37",
|
|
83
83
|
"prettier": "2.8.0",
|
|
84
84
|
"promptly": "3.2.0",
|
|
85
85
|
"rollup": "3.26.2",
|
package/.npmrc.wtf
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//registry.npmjs.org/:_authToken=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
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import * as playwright from "playwright";
|
|
2
|
-
import type { ImportFunction, RunApiSession } from "./runApi";
|
|
3
|
-
export interface Proxy {
|
|
4
|
-
server: string;
|
|
5
|
-
username: string;
|
|
6
|
-
password: string;
|
|
7
|
-
}
|
|
8
|
-
interface GetPlaywrightConstructsOptions {
|
|
9
|
-
proxy?: Proxy;
|
|
10
|
-
headless?: boolean;
|
|
11
|
-
storageState?: RunApiSession;
|
|
12
|
-
downloadsPath: string;
|
|
13
|
-
importFunction?: ImportFunction;
|
|
14
|
-
}
|
|
15
|
-
export declare function getProductionPlaywrightConstructs({ proxy, headless, storageState, downloadsPath, importFunction, }: GetPlaywrightConstructsOptions): Promise<{
|
|
16
|
-
page: playwright.Page;
|
|
17
|
-
context: playwright.BrowserContext;
|
|
18
|
-
}>;
|
|
19
|
-
export declare function getPlaywrightConstructsForMode(mode: "vanilla" | "playwright" | "playwright-standalone" | "playwright-headless", cdpAddress: string | undefined, authSession?: RunApiSession, importFunction?: ImportFunction): Promise<{
|
|
20
|
-
page: playwright.Page;
|
|
21
|
-
context: playwright.BrowserContext;
|
|
22
|
-
}>;
|
|
23
|
-
export declare function loadSessionToContext({ context, session, }: {
|
|
24
|
-
context: playwright.BrowserContext;
|
|
25
|
-
session: RunApiSession;
|
|
26
|
-
}): Promise<void>;
|
|
27
|
-
export declare function getRemotePlaywrightContext(cdpAddress: string): Promise<{
|
|
28
|
-
browser: playwright.Browser;
|
|
29
|
-
context: playwright.BrowserContext;
|
|
30
|
-
}>;
|
|
31
|
-
export {};
|