@intuned/runtime 1.3.0 → 1.3.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.
Files changed (51) hide show
  1. package/WebTemplate.zip +0 -0
  2. package/dist/commands/api/run.js +5 -3
  3. package/dist/commands/auth-sessions/load.js +3 -3
  4. package/dist/commands/auth-sessions/run-check.js +1 -2
  5. package/dist/commands/auth-sessions/run-create.js +12 -35
  6. package/dist/commands/interface/run.d.ts +1 -1
  7. package/dist/commands/interface/run.js +14 -40
  8. package/dist/commands/intuned-cli/commands/deploy.command.js +6 -9
  9. package/dist/commands/intuned-cli/commands/index.d.ts +1 -0
  10. package/dist/commands/intuned-cli/commands/index.js +11 -0
  11. package/dist/commands/intuned-cli/commands/run_authsession.command.d.ts +2 -1
  12. package/dist/commands/intuned-cli/commands/save.command.d.ts +12 -0
  13. package/dist/commands/intuned-cli/commands/save.command.js +46 -0
  14. package/dist/commands/intuned-cli/commands/types.d.ts +1 -1
  15. package/dist/commands/intuned-cli/controller/__test__/api.test.js +1 -2
  16. package/dist/commands/intuned-cli/controller/api.js +1 -2
  17. package/dist/commands/intuned-cli/controller/authSession.js +3 -4
  18. package/dist/commands/intuned-cli/controller/deploy.d.ts +1 -12
  19. package/dist/commands/intuned-cli/controller/deploy.js +9 -284
  20. package/dist/commands/intuned-cli/controller/save.d.ts +14 -0
  21. package/dist/commands/intuned-cli/controller/save.js +364 -0
  22. package/dist/commands/intuned-cli/helpers/backend.js +4 -3
  23. package/dist/commands/intuned-cli/helpers/errors.d.ts +2 -2
  24. package/dist/commands/intuned-cli/helpers/errors.js +8 -4
  25. package/dist/commands/intuned-cli/main.js +7 -0
  26. package/dist/common/asyncLocalStorage/index.d.ts +1 -0
  27. package/dist/common/constants.d.ts +6 -0
  28. package/dist/common/constants.js +8 -2
  29. package/dist/common/jwtTokenManager.d.ts +1 -0
  30. package/dist/common/jwtTokenManager.js +37 -7
  31. package/dist/common/playwrightContext.d.ts +54 -0
  32. package/dist/common/{getPlaywrightConstructs.js → playwrightContext.js} +148 -79
  33. package/dist/common/runApi/importUsingImportFunction.d.ts +9 -0
  34. package/dist/common/runApi/importUsingImportFunction.js +46 -0
  35. package/dist/common/runApi/index.d.ts +2 -7
  36. package/dist/common/runApi/index.js +92 -178
  37. package/dist/common/runApi/types.d.ts +3 -7
  38. package/dist/common/runApi/types.js +1 -2
  39. package/dist/common/setupContextHook.d.ts +17 -0
  40. package/dist/common/setupContextHook.js +22 -0
  41. package/dist/index.d.ts +2 -2
  42. package/dist/index.js +13 -19
  43. package/dist/runtime/attemptStore.d.ts +2 -0
  44. package/dist/runtime/attemptStore.js +23 -0
  45. package/dist/runtime/export.d.ts +51 -41
  46. package/dist/runtime/index.d.ts +1 -2
  47. package/dist/runtime/index.js +7 -13
  48. package/package.json +3 -1
  49. package/dist/common/getPlaywrightConstructs.d.ts +0 -30
  50. package/dist/runtime/requestMoreInfo.d.ts +0 -18
  51. package/dist/runtime/requestMoreInfo.js +0 -25
@@ -1,8 +1,7 @@
1
1
  export { extendPayload } from "./extendPayload";
2
2
  export { extendTimeout } from "./extendTimeout";
3
+ export { attemptStore } from "./attemptStore";
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,6 +9,12 @@ Object.defineProperty(exports, "RunError", {
9
9
  return _RunError.RunError;
10
10
  }
11
11
  });
12
+ Object.defineProperty(exports, "attemptStore", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _attemptStore.attemptStore;
16
+ }
17
+ });
12
18
  Object.defineProperty(exports, "extendPayload", {
13
19
  enumerable: true,
14
20
  get: function () {
@@ -33,18 +39,6 @@ Object.defineProperty(exports, "getDownloadDirectoryPath", {
33
39
  return _downloadDirectory.getDownloadDirectoryPath;
34
40
  }
35
41
  });
36
- Object.defineProperty(exports, "requestMultipleChoice", {
37
- enumerable: true,
38
- get: function () {
39
- return _requestMoreInfo.requestMultipleChoice;
40
- }
41
- });
42
- Object.defineProperty(exports, "requestOTP", {
43
- enumerable: true,
44
- get: function () {
45
- return _requestMoreInfo.requestOTP;
46
- }
47
- });
48
42
  Object.defineProperty(exports, "runInfo", {
49
43
  enumerable: true,
50
44
  get: function () {
@@ -53,8 +47,8 @@ Object.defineProperty(exports, "runInfo", {
53
47
  });
54
48
  var _extendPayload = require("./extendPayload");
55
49
  var _extendTimeout = require("./extendTimeout");
50
+ var _attemptStore = require("./attemptStore");
56
51
  var _getAuthSessionParameters = require("./getAuthSessionParameters");
57
52
  var _runInfo = require("./runInfo");
58
53
  var _RunError = require("./RunError");
59
- var _requestMoreInfo = require("./requestMoreInfo");
60
54
  var _downloadDirectory = require("./downloadDirectory");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intuned/runtime",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Intuned runtime",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",
@@ -79,6 +79,7 @@
79
79
  "nanoid": "3",
80
80
  "neverthrow": "6.1.0",
81
81
  "playwright-extra": "4.3.6",
82
+ "portfinder": "^1.0.37",
82
83
  "prettier": "2.8.0",
83
84
  "promptly": "3.2.0",
84
85
  "rollup": "3.26.2",
@@ -118,6 +119,7 @@
118
119
  "eslint-plugin-deprecation": "^1.3.3",
119
120
  "eslint-plugin-prettier": "^4.2.1",
120
121
  "msw": "^2.1.2",
122
+ "playwright": "^1.55.0",
121
123
  "typedoc": "^0.25.13",
122
124
  "typedoc-plugin-frontmatter": "^1.0.0",
123
125
  "typedoc-plugin-markdown": "^4.0.2",
@@ -1,30 +0,0 @@
1
- import * as playwright from "playwright";
2
- import type { RunApiSession } from "./runApi";
3
- 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
- }
14
- export declare function getProductionPlaywrightConstructs({ proxy, headless, storageState, downloadsPath, }: GetPlaywrightConstructsOptions): Promise<{
15
- page: playwright.Page;
16
- context: playwright.BrowserContext;
17
- }>;
18
- export declare function getPlaywrightConstructsForMode(mode: "vanilla" | "playwright" | "playwright-standalone" | "playwright-headless", cdpAddress: string | undefined, authSession?: RunApiSession): Promise<{
19
- page: playwright.Page;
20
- context: playwright.BrowserContext;
21
- }>;
22
- export declare function loadSessionToContext({ context, session, }: {
23
- context: playwright.BrowserContext;
24
- session: RunApiSession;
25
- }): Promise<void>;
26
- export declare function getRemotePlaywrightContext(cdpAddress: string): Promise<{
27
- browser: playwright.Browser;
28
- context: playwright.BrowserContext;
29
- }>;
30
- export {};
@@ -1,18 +0,0 @@
1
- interface RequestMoreInfoReturnTypeBase {
2
- [REQUEST_MORE_INFO_KEY]: true;
3
- action: "request_more_info";
4
- }
5
- interface RequestMultipleChoiceReturnType extends RequestMoreInfoReturnTypeBase {
6
- messageToUser: string;
7
- choices: string[];
8
- requestType: "multiple_choice";
9
- }
10
- interface RequestOtpReturnType extends RequestMoreInfoReturnTypeBase {
11
- messageToUser: string;
12
- requestType: "otp";
13
- }
14
- declare const REQUEST_MORE_INFO_KEY: unique symbol;
15
- export declare function requestOTP(messageToUser: string): RequestOtpReturnType;
16
- export declare function requestMultipleChoice(messageToUser: string, choices: string[]): RequestMultipleChoiceReturnType;
17
- export type RequestMoreInfoDetails = RequestMultipleChoiceReturnType | RequestOtpReturnType;
18
- export {};
@@ -1,25 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.requestMultipleChoice = requestMultipleChoice;
7
- exports.requestOTP = requestOTP;
8
- const REQUEST_MORE_INFO_KEY = Symbol("REQUEST_MORE_INFO");
9
- function requestOTP(messageToUser) {
10
- return {
11
- [REQUEST_MORE_INFO_KEY]: true,
12
- action: "request_more_info",
13
- messageToUser,
14
- requestType: "otp"
15
- };
16
- }
17
- function requestMultipleChoice(messageToUser, choices) {
18
- return {
19
- [REQUEST_MORE_INFO_KEY]: true,
20
- action: "request_more_info",
21
- messageToUser,
22
- requestType: "multiple_choice",
23
- choices
24
- };
25
- }