@intuned/runtime-dev 0.0.1-split.0 → 0.0.1-split.2

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 (123) hide show
  1. package/WebTemplate/controllers/authSessions/create.ts +1 -1
  2. package/WebTemplate/controllers/runApi/helpers.ts +1 -3
  3. package/dist/commands/api/run.d.ts +6 -0
  4. package/dist/commands/api/run.js +135 -0
  5. package/dist/commands/auth-sessions/load.d.ts +2 -0
  6. package/dist/commands/auth-sessions/load.js +26 -0
  7. package/dist/commands/auth-sessions/run-check.d.ts +2 -0
  8. package/dist/commands/auth-sessions/run-check.js +42 -0
  9. package/dist/commands/auth-sessions/run-create.d.ts +2 -0
  10. package/dist/commands/auth-sessions/run-create.js +75 -0
  11. package/dist/commands/browser/save-state.d.ts +2 -0
  12. package/dist/commands/browser/save-state.js +17 -0
  13. package/dist/commands/browser/start-browser.d.ts +2 -0
  14. package/dist/commands/browser/start-browser.js +14 -0
  15. package/dist/commands/build.d.ts +2 -0
  16. package/dist/commands/build.js +80 -0
  17. package/dist/commands/common/browserUtils.d.ts +14 -0
  18. package/dist/commands/common/browserUtils.js +58 -0
  19. package/dist/commands/common/getDefaultExportFromFile.d.ts +1 -0
  20. package/dist/commands/common/getDefaultExportFromFile.js +19 -0
  21. package/dist/commands/common/getFirstLineNumber.d.ts +9 -0
  22. package/dist/commands/common/getFirstLineNumber.js +103 -0
  23. package/{src/commands/common/getFirstLineNumber.test.ts → dist/commands/common/getFirstLineNumber.test.js} +75 -121
  24. package/dist/commands/common/sendMessageToClient.d.ts +1 -0
  25. package/dist/commands/common/sendMessageToClient.js +10 -0
  26. package/dist/commands/common/utils/fileUtils.d.ts +6 -0
  27. package/dist/commands/common/utils/fileUtils.js +33 -0
  28. package/dist/commands/common/utils/settings.d.ts +2 -0
  29. package/dist/commands/common/utils/settings.js +28 -0
  30. package/dist/commands/common/utils/webTemplate.d.ts +1 -0
  31. package/dist/commands/common/utils/webTemplate.js +31 -0
  32. package/dist/commands/testing/saveVisibleHtml.d.ts +1 -0
  33. package/dist/commands/testing/saveVisibleHtml.js +24 -0
  34. package/dist/commands/ts-check.d.ts +2 -0
  35. package/dist/commands/ts-check.js +54 -0
  36. package/dist/common/Logger/Logger/index.d.ts +12 -0
  37. package/dist/common/Logger/Logger/index.js +60 -0
  38. package/{src/common/Logger/Logger/types.ts → dist/common/Logger/Logger/types.d.ts} +4 -5
  39. package/dist/common/Logger/Logger/types.js +5 -0
  40. package/dist/common/Logger/index.d.ts +12 -0
  41. package/dist/common/Logger/index.js +60 -0
  42. package/{src/common/Logger/types.ts → dist/common/Logger/types.d.ts} +4 -5
  43. package/dist/common/Logger/types.js +5 -0
  44. package/dist/common/asyncLocalStorage/index.d.ts +16 -0
  45. package/dist/common/asyncLocalStorage/index.js +17 -0
  46. package/dist/common/cleanEnvironmentVariables.d.ts +1 -0
  47. package/dist/common/cleanEnvironmentVariables.js +16 -0
  48. package/dist/common/constants.d.ts +1 -0
  49. package/dist/common/constants.js +7 -0
  50. package/dist/common/contextStorageStateHelpers.d.ts +15 -0
  51. package/dist/common/contextStorageStateHelpers.js +48 -0
  52. package/dist/common/getPlaywrightConstructs.d.ts +28 -0
  53. package/dist/common/getPlaywrightConstructs.js +175 -0
  54. package/dist/common/jwtTokenManager.d.ts +16 -0
  55. package/dist/common/jwtTokenManager.js +81 -0
  56. package/dist/common/settingsSchema.d.ts +19 -0
  57. package/dist/common/settingsSchema.js +17 -0
  58. package/dist/common/telemetry.d.ts +3 -0
  59. package/dist/common/telemetry.js +32 -0
  60. package/dist/index.d.ts +4 -0
  61. package/dist/index.js +69 -0
  62. package/dist/runtime/RunError.d.ts +5 -0
  63. package/dist/runtime/RunError.js +19 -0
  64. package/dist/runtime/downloadDirectory.d.ts +1 -0
  65. package/dist/runtime/downloadDirectory.js +19 -0
  66. package/dist/runtime/enums.d.js +5 -0
  67. package/dist/runtime/enums.js +18 -0
  68. package/dist/runtime/executionHelpers.test.js +53 -0
  69. package/dist/runtime/export.d.js +5 -0
  70. package/dist/runtime/extendPayload.d.ts +2 -0
  71. package/dist/runtime/extendPayload.js +21 -0
  72. package/dist/runtime/extendTimeout.d.ts +1 -0
  73. package/dist/runtime/extendTimeout.js +26 -0
  74. package/{src/runtime/index.ts → dist/runtime/index.d.ts} +1 -3
  75. package/dist/runtime/index.js +53 -0
  76. package/dist/runtime/requestMoreInfo.d.ts +17 -0
  77. package/dist/runtime/requestMoreInfo.js +25 -0
  78. package/dist/runtime/runInfo.d.ts +2 -0
  79. package/dist/runtime/runInfo.js +21 -0
  80. package/package.json +1 -1
  81. package/.vscode/extensions.json +0 -3
  82. package/.vscode/launch.json +0 -102
  83. package/.vscode/settings.json +0 -12
  84. package/playwright.config.ts +0 -48
  85. package/src/commands/api/run.ts +0 -225
  86. package/src/commands/auth-sessions/load.ts +0 -42
  87. package/src/commands/auth-sessions/run-check.ts +0 -70
  88. package/src/commands/auth-sessions/run-create.ts +0 -124
  89. package/src/commands/browser/save-state.ts +0 -22
  90. package/src/commands/browser/start-browser.ts +0 -17
  91. package/src/commands/build.ts +0 -125
  92. package/src/commands/common/browserUtils.ts +0 -80
  93. package/src/commands/common/getDefaultExportFromFile.ts +0 -13
  94. package/src/commands/common/getFirstLineNumber.ts +0 -146
  95. package/src/commands/common/sendMessageToClient.ts +0 -8
  96. package/src/commands/common/utils/fileUtils.ts +0 -25
  97. package/src/commands/common/utils/settings.ts +0 -23
  98. package/src/commands/common/utils/webTemplate.ts +0 -46
  99. package/src/commands/testing/saveVisibleHtml.ts +0 -29
  100. package/src/commands/ts-check.ts +0 -88
  101. package/src/common/Logger/Logger/index.ts +0 -64
  102. package/src/common/Logger/index.ts +0 -64
  103. package/src/common/asyncLocalStorage/index.ts +0 -29
  104. package/src/common/cleanEnvironmentVariables.ts +0 -13
  105. package/src/common/constants.ts +0 -1
  106. package/src/common/contextStorageStateHelpers.ts +0 -71
  107. package/src/common/getPlaywrightConstructs.ts +0 -283
  108. package/src/common/jwtTokenManager.ts +0 -111
  109. package/src/common/settingsSchema.ts +0 -16
  110. package/src/common/telemetry.ts +0 -49
  111. package/src/index.ts +0 -14
  112. package/src/runtime/RunError.ts +0 -16
  113. package/src/runtime/downloadDirectory.ts +0 -14
  114. package/src/runtime/enums.ts +0 -11
  115. package/src/runtime/executionHelpers.test.ts +0 -70
  116. package/src/runtime/extendPayload.ts +0 -22
  117. package/src/runtime/extendTimeout.ts +0 -32
  118. package/src/runtime/requestMoreInfo.ts +0 -40
  119. package/src/runtime/runInfo.ts +0 -19
  120. package/vite.config.ts +0 -17
  121. /package/{src → dist}/common/assets/browser_scripts.js +0 -0
  122. /package/{src → dist}/runtime/enums.d.ts +0 -0
  123. /package/{src → dist}/runtime/export.d.ts +0 -0
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getTelemetryClient = getTelemetryClient;
7
+ exports.initializeAppInsights = initializeAppInsights;
8
+ var appInsights = _interopRequireWildcard(require("applicationinsights"));
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 && Object.prototype.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
+ function gracefulShutdown() {
12
+ console.log("Shutting down, so flushing app insights.");
13
+ appInsights.defaultClient.flush();
14
+ process.exit();
15
+ }
16
+ function initializeAppInsights() {
17
+ const appInsightsConnectionString = process.env.APPINSIGHTS_CONNECTION_STRING;
18
+ if (appInsightsConnectionString) {
19
+ console.log("Initializing app insights.");
20
+ appInsights.setup(appInsightsConnectionString).setAutoCollectConsole(true, true).setAutoCollectDependencies(true).setAutoCollectExceptions(true).setAutoCollectHeartbeat(true).setAutoCollectPerformance(true, true).setAutoCollectRequests(true).setAutoDependencyCorrelation(true).setDistributedTracingMode(appInsights.DistributedTracingModes.AI_AND_W3C).setSendLiveMetrics(true).setUseDiskRetryCaching(true);
21
+ appInsights.defaultClient.context.tags[appInsights.defaultClient.context.keys.cloudRole] = "@intuned/sdk";
22
+ if (process.env.FLY_APP_NAME) {
23
+ appInsights.defaultClient.context.tags[appInsights.defaultClient.context.keys.cloudRoleInstance] = process.env.FLY_APP_NAME;
24
+ }
25
+ process.on("SIGTERM", gracefulShutdown);
26
+ process.on("SIGINT", gracefulShutdown);
27
+ appInsights.start();
28
+ }
29
+ }
30
+ function getTelemetryClient() {
31
+ return appInsights.defaultClient;
32
+ }
@@ -0,0 +1,4 @@
1
+ export { extendPayload, extendTimeout, runInfo, RunError, requestMultipleChoice, requestOTP, } from "./runtime";
2
+ export { runWithContext, getExecutionContext, } from "./common/asyncLocalStorage";
3
+ export { getDownloadDirectoryPath } from "./runtime/downloadDirectory";
4
+ export { getProductionPlaywrightConstructs } from "./common/getPlaywrightConstructs";
package/dist/index.js ADDED
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "RunError", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _runtime.RunError;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "extendPayload", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _runtime.extendPayload;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "extendTimeout", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _runtime.extendTimeout;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "getDownloadDirectoryPath", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _downloadDirectory.getDownloadDirectoryPath;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "getExecutionContext", {
31
+ enumerable: true,
32
+ get: function () {
33
+ return _asyncLocalStorage.getExecutionContext;
34
+ }
35
+ });
36
+ Object.defineProperty(exports, "getProductionPlaywrightConstructs", {
37
+ enumerable: true,
38
+ get: function () {
39
+ return _getPlaywrightConstructs.getProductionPlaywrightConstructs;
40
+ }
41
+ });
42
+ Object.defineProperty(exports, "requestMultipleChoice", {
43
+ enumerable: true,
44
+ get: function () {
45
+ return _runtime.requestMultipleChoice;
46
+ }
47
+ });
48
+ Object.defineProperty(exports, "requestOTP", {
49
+ enumerable: true,
50
+ get: function () {
51
+ return _runtime.requestOTP;
52
+ }
53
+ });
54
+ Object.defineProperty(exports, "runInfo", {
55
+ enumerable: true,
56
+ get: function () {
57
+ return _runtime.runInfo;
58
+ }
59
+ });
60
+ Object.defineProperty(exports, "runWithContext", {
61
+ enumerable: true,
62
+ get: function () {
63
+ return _asyncLocalStorage.runWithContext;
64
+ }
65
+ });
66
+ var _runtime = require("./runtime");
67
+ var _asyncLocalStorage = require("./common/asyncLocalStorage");
68
+ var _downloadDirectory = require("./runtime/downloadDirectory");
69
+ var _getPlaywrightConstructs = require("./common/getPlaywrightConstructs");
@@ -0,0 +1,5 @@
1
+ import { RunErrorOptions } from "./export";
2
+ export declare class RunError extends Error {
3
+ options: RunErrorOptions;
4
+ constructor(message: string, options?: RunErrorOptions);
5
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.RunError = void 0;
7
+ class RunError extends Error {
8
+ constructor(message, options) {
9
+ super(message);
10
+ this.message = message;
11
+ this.name = "USER_GENERATED_ERROR";
12
+ this.options = options ?? {
13
+ retryable: false
14
+ };
15
+ Object.setPrototypeOf(this, RunError.prototype);
16
+ }
17
+ }
18
+ exports.RunError = RunError;
19
+ new RunError("", {});
@@ -0,0 +1 @@
1
+ export declare function getDownloadDirectoryPath(): string;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getDownloadDirectoryPath = getDownloadDirectoryPath;
7
+ var _ = require("..");
8
+ var _fsExtra = require("fs-extra");
9
+ function getDownloadDirectoryPath() {
10
+ const context = (0, _.getExecutionContext)();
11
+ if (!context) {
12
+ throw new Error("ExecutionContext not found");
13
+ }
14
+ const path = `/tmp/downloads/${context.runId}`;
15
+ (0, _fsExtra.ensureDirSync)(path, {
16
+ mode: 0o2775
17
+ });
18
+ return path;
19
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.RunType = exports.RunEnvironment = void 0;
7
+ let RunEnvironment = exports.RunEnvironment = function (RunEnvironment) {
8
+ RunEnvironment["IDE"] = "IDE";
9
+ RunEnvironment["DEPLOYED"] = "DEPLOYED";
10
+ return RunEnvironment;
11
+ }({});
12
+ let RunType = exports.RunType = function (RunType) {
13
+ RunType["SYNC"] = "SYNC";
14
+ RunType["ASYNC"] = "ASYNC";
15
+ RunType["JOB"] = "JOB";
16
+ RunType["QUEUE"] = "QUEUE";
17
+ return RunType;
18
+ }({});
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+
3
+ var _vitest = require("vitest");
4
+ var _asyncLocalStorage = require("../common/asyncLocalStorage");
5
+ var _index = require("./index");
6
+ var _enums = require("./enums");
7
+ (0, _vitest.describe)("Execution Helpers", () => {
8
+ (0, _vitest.it)("should be able to get execution info", () => {
9
+ (0, _asyncLocalStorage.runWithContext)({
10
+ runEnvironment: _enums.RunEnvironment.IDE,
11
+ runId: "test-run-id",
12
+ extendedPayloads: []
13
+ }, () => {
14
+ (0, _vitest.expect)((0, _index.runInfo)().runId).toEqual("test-run-id");
15
+ });
16
+ });
17
+ (0, _vitest.it)("should be able to mutate extendedPayloads and get the accmulated value at the end ", () => {
18
+ const context = {
19
+ extendedPayloads: [],
20
+ runId: "test-run-id"
21
+ };
22
+ (0, _asyncLocalStorage.runWithContext)({
23
+ runEnvironment: _enums.RunEnvironment.IDE,
24
+ runId: "test-run-id",
25
+ extendedPayloads: []
26
+ }, () => {
27
+ var _getExecutionContext, _getExecutionContext2;
28
+ (0, _vitest.expect)((_getExecutionContext = (0, _asyncLocalStorage.getExecutionContext)()) === null || _getExecutionContext === void 0 ? void 0 : _getExecutionContext.extendedPayloads).toEqual([]);
29
+ (0, _index.extendPayload)({
30
+ api: "test-api",
31
+ parameters: {}
32
+ });
33
+ (0, _vitest.expect)((_getExecutionContext2 = (0, _asyncLocalStorage.getExecutionContext)()) === null || _getExecutionContext2 === void 0 ? void 0 : _getExecutionContext2.extendedPayloads).toEqual([{
34
+ api: "test-api",
35
+ parameters: {}
36
+ }]);
37
+ (0, _index.extendPayload)({
38
+ api: "test-api",
39
+ parameters: {}
40
+ });
41
+ (0, _index.extendPayload)({
42
+ api: "test-api",
43
+ parameters: {}
44
+ });
45
+ (0, _index.extendPayload)({
46
+ api: "test-api",
47
+ parameters: {}
48
+ });
49
+ const context = (0, _asyncLocalStorage.getExecutionContext)();
50
+ (0, _vitest.expect)(context === null || context === void 0 ? void 0 : context.extendedPayloads).toHaveLength(4);
51
+ });
52
+ });
53
+ });
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,2 @@
1
+ import { Payload } from "./export";
2
+ export declare function extendPayload(payload: Payload | Payload[]): void;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.extendPayload = extendPayload;
7
+ var _asyncLocalStorage = require("../common/asyncLocalStorage");
8
+ var _extendTimeout = require("./extendTimeout");
9
+ function extendPayload(payload) {
10
+ const context = (0, _asyncLocalStorage.getExecutionContext)();
11
+ if (!context) {
12
+ throw new Error("extendPayload failed due to an internal error.");
13
+ }
14
+ const items = Array.isArray(payload) ? payload : [payload];
15
+ if (!context.extendedPayloads) {
16
+ context.extendedPayloads = [...items];
17
+ return;
18
+ }
19
+ context === null || context === void 0 || context.extendedPayloads.push(...items);
20
+ (0, _extendTimeout.extendTimeout)();
21
+ }
@@ -0,0 +1 @@
1
+ export declare function extendTimeout(): void;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.extendTimeout = extendTimeout;
7
+ var _asyncLocalStorage = require("../common/asyncLocalStorage");
8
+ const _DEBOUNCE_TIME = 60_000;
9
+ function extendTimeout() {
10
+ const context = (0, _asyncLocalStorage.getExecutionContext)();
11
+ if (!context) {
12
+ throw new Error("extendTimeout failed due to an internal error.");
13
+ }
14
+ const {
15
+ timeoutInfo
16
+ } = context;
17
+ if (!timeoutInfo || timeoutInfo.timeoutTimestamp === undefined || timeoutInfo.timeoutDuration === undefined || timeoutInfo.extendTimeoutCallback === undefined) {
18
+ return;
19
+ }
20
+ const newTimeoutStamp = Date.now() + timeoutInfo.timeoutDuration;
21
+ if (newTimeoutStamp - timeoutInfo.timeoutTimestamp < _DEBOUNCE_TIME) {
22
+ return;
23
+ }
24
+ timeoutInfo.timeoutTimestamp = newTimeoutStamp;
25
+ void timeoutInfo.extendTimeoutCallback().catch(() => undefined);
26
+ }
@@ -2,7 +2,5 @@ export { extendPayload } from "./extendPayload";
2
2
  export { extendTimeout } from "./extendTimeout";
3
3
  export { runInfo } from "./runInfo";
4
4
  export { RunError } from "./RunError";
5
-
6
5
  export { requestMultipleChoice, requestOTP } from "./requestMoreInfo";
7
-
8
- export {getDownloadDirectoryPath} from "./downloadDirectory";
6
+ export { getDownloadDirectoryPath } from "./downloadDirectory";
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "RunError", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _RunError.RunError;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "extendPayload", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _extendPayload.extendPayload;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "extendTimeout", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _extendTimeout.extendTimeout;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "getDownloadDirectoryPath", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _downloadDirectory.getDownloadDirectoryPath;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "requestMultipleChoice", {
31
+ enumerable: true,
32
+ get: function () {
33
+ return _requestMoreInfo.requestMultipleChoice;
34
+ }
35
+ });
36
+ Object.defineProperty(exports, "requestOTP", {
37
+ enumerable: true,
38
+ get: function () {
39
+ return _requestMoreInfo.requestOTP;
40
+ }
41
+ });
42
+ Object.defineProperty(exports, "runInfo", {
43
+ enumerable: true,
44
+ get: function () {
45
+ return _runInfo.runInfo;
46
+ }
47
+ });
48
+ var _extendPayload = require("./extendPayload");
49
+ var _extendTimeout = require("./extendTimeout");
50
+ var _runInfo = require("./runInfo");
51
+ var _RunError = require("./RunError");
52
+ var _requestMoreInfo = require("./requestMoreInfo");
53
+ var _downloadDirectory = require("./downloadDirectory");
@@ -0,0 +1,17 @@
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 {};
@@ -0,0 +1,25 @@
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
+ }
@@ -0,0 +1,2 @@
1
+ import { RunInfo } from "./export";
2
+ export declare function runInfo(): RunInfo;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.runInfo = runInfo;
7
+ var _asyncLocalStorage = require("../common/asyncLocalStorage");
8
+ var _enums = require("./enums");
9
+ function runInfo() {
10
+ const context = (0, _asyncLocalStorage.getExecutionContext)();
11
+ if (!context) {
12
+ return {
13
+ runEnvironment: _enums.RunEnvironment.IDE
14
+ };
15
+ }
16
+ const {
17
+ extendedPayloads: _extendedPayloads,
18
+ ...rest
19
+ } = context;
20
+ return rest;
21
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intuned/runtime-dev",
3
- "version": "0.0.1-split.0",
3
+ "version": "0.0.1-split.2",
4
4
  "description": "Intuned runtime",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",
@@ -1,3 +0,0 @@
1
- {
2
- "recommendations": ["zixuanchen.vitest-explorer"]
3
- }
@@ -1,102 +0,0 @@
1
- {
2
- // Use IntelliSense to learn about possible attributes.
3
- // Hover to view descriptions of existing attributes.
4
- // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
- "version": "0.2.0",
6
- "configurations": [
7
- {
8
- "name": "Hiltion api",
9
- "type": "node",
10
- "request": "launch",
11
- "runtimeExecutable": "node",
12
- "runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"],
13
-
14
- "args": ["src/commands/api/run.ts", "hilton", "-j", "{}", "playwright"],
15
-
16
- "cwd": "${workspaceRoot}",
17
- "internalConsoleOptions": "openOnSessionStart",
18
- "skipFiles": ["<node_internals>/**", "node_modules/**"]
19
- },
20
- {
21
- "name": "Books Extractor",
22
- "type": "node",
23
- "request": "launch",
24
- "runtimeExecutable": "node",
25
- "runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"],
26
-
27
- "args": [
28
- "src/commands/api/run.ts",
29
- "books-array",
30
- "-j",
31
- "{}",
32
- "playwright"
33
- ],
34
-
35
- "cwd": "${workspaceRoot}",
36
- "internalConsoleOptions": "openOnSessionStart",
37
- "skipFiles": ["<node_internals>/**", "node_modules/**"]
38
- },
39
- {
40
- "name": "Run execution-info",
41
- "type": "node",
42
- "request": "launch",
43
- "runtimeExecutable": "node",
44
- "runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"],
45
-
46
- "args": [
47
- "src/commands/api/run.ts",
48
- "execution-info",
49
- "-j",
50
- "{}",
51
- "playwright"
52
- ],
53
-
54
- "cwd": "${workspaceRoot}",
55
- "internalConsoleOptions": "openOnSessionStart",
56
- "skipFiles": ["<node_internals>/**", "node_modules/**"]
57
- },
58
- {
59
- "name": "Run progressive",
60
- "type": "node",
61
- "request": "launch",
62
- "runtimeExecutable": "node",
63
- "runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"],
64
-
65
- "args": [
66
- "src/commands/api/run.ts",
67
- "progressive",
68
- "-j",
69
- "{}",
70
- "playwright"
71
- ],
72
-
73
- "cwd": "${workspaceRoot}",
74
- "internalConsoleOptions": "openOnSessionStart",
75
- "skipFiles": ["<node_internals>/**", "node_modules/**"]
76
- },
77
- {
78
- "name": "Run progressive - standalone",
79
- "type": "node",
80
- "request": "launch",
81
- "runtimeExecutable": "node",
82
- "runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"],
83
-
84
- "args": ["src/commands/api/run.ts", "progressive", "-j", "{}"],
85
- "cwd": "${workspaceRoot}",
86
- "internalConsoleOptions": "openOnSessionStart",
87
- "skipFiles": ["<node_internals>/**", "node_modules/**"]
88
- },
89
- {
90
- "name": "Run progressive extract - standalone",
91
- "type": "node",
92
- "request": "launch",
93
- "runtimeExecutable": "node",
94
- "runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"],
95
-
96
- "args": ["src/commands/api/run.ts", "progressive-extract", "-j", "{}"],
97
- "cwd": "${workspaceRoot}",
98
- "internalConsoleOptions": "openOnSessionStart",
99
- "skipFiles": ["<node_internals>/**", "node_modules/**"]
100
- }
101
- ]
102
- }
@@ -1,12 +0,0 @@
1
- {
2
- "editor.formatOnSave": true,
3
- "cSpell.words": ["backcompat", "ـget", "INFINITI", "neverthrow"],
4
- "editor.detectIndentation": true,
5
- "files.exclude": {
6
- "dist": false,
7
- "node_modules": false,
8
- "output": false,
9
- "intuned": false,
10
- "htmlFiles": true
11
- }
12
- }
@@ -1,48 +0,0 @@
1
- import { defineConfig, devices } from "@intuned/playwright-test";
2
-
3
- /**
4
- * Read environment variables from file.
5
- * https://github.com/motdotla/dotenv
6
- */
7
- // require('dotenv').config();
8
-
9
- /**
10
- * See https://playwright.dev/docs/test-configuration.
11
- */
12
- export default defineConfig({
13
- testDir: "./e2e-tests",
14
- /* Run tests in files in parallel */
15
- fullyParallel: true,
16
- /* Fail the build on CI if you accidentally left test.only in the source code. */
17
- forbidOnly: !!process.env.CI,
18
- /* Retry on CI only */
19
- retries: process.env.CI ? 2 : 0,
20
- /* Opt out of parallel tests on CI. */
21
- workers: process.env.CI ? 1 : undefined,
22
- /* Reporter to use. See https://playwright.dev/docs/test-reporters */
23
- reporter: "html",
24
- /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
25
- use: {
26
- /* Base URL to use in actions like `await page.goto('/')`. */
27
- // baseURL: 'http://127.0.0.1:3000',
28
-
29
- /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
30
- trace: "on-first-retry",
31
- // headless: false,
32
- },
33
-
34
- /* Configure projects for major browsers */
35
- projects: [
36
- {
37
- name: "chromium",
38
- use: { ...devices["Desktop Chrome"] },
39
- },
40
- ],
41
-
42
- /* Run your local dev server before starting the tests */
43
- // webServer: {
44
- // command: 'npm run start',
45
- // url: 'http://127.0.0.1:3000',
46
- // reuseExistingServer: !process.env.CI,
47
- // },
48
- });