@intuned/runtime-dev 0.0.1 → 0.1.0-test.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/InterfaceTemplate/index.ts +1 -0
- package/Intuned.json +5 -0
- package/WebTemplate/api.ts +92 -90
- package/WebTemplate/controllers/authSessions/check.ts +23 -29
- package/WebTemplate/controllers/authSessions/create.ts +46 -71
- package/WebTemplate/controllers/authSessions/index.ts +4 -4
- package/WebTemplate/controllers/authSessions/killOperation.ts +1 -1
- package/WebTemplate/controllers/authSessions/resumeOperation.ts +28 -52
- package/WebTemplate/controllers/authSessions/store.ts +11 -6
- package/WebTemplate/controllers/runApi/helpers.ts +47 -146
- package/WebTemplate/index.playwright.ts +42 -32
- package/WebTemplate/index.vanilla.ts +2 -20
- package/WebTemplate/jobs.ts +2 -13
- package/WebTemplate/utils.ts +1 -85
- package/WebTemplate.zip +0 -0
- package/api/authed.ts +12 -0
- package/api/test.ts +3 -0
- package/api/test2.ts +25 -0
- package/auth-sessions/check.ts +9 -0
- package/auth-sessions/create.ts +32 -0
- package/authSessions +1 -0
- package/bin/intuned-api-run +2 -0
- package/bin/intuned-auth-session-check +2 -0
- package/bin/intuned-auth-session-create +2 -0
- package/bin/intuned-auth-session-load +2 -0
- package/bin/intuned-auth-session-refresh +2 -0
- package/bin/intuned-browser-save-state +2 -0
- package/bin/intuned-browser-start +2 -0
- package/bin/intuned-build +2 -0
- package/bin/intuned-ts-check +2 -0
- package/dist/commands/api/run.d.ts +6 -0
- package/dist/commands/api/run.js +113 -0
- package/dist/commands/auth-sessions/load.d.ts +2 -0
- package/dist/commands/auth-sessions/load.js +32 -0
- package/dist/commands/auth-sessions/run-check.d.ts +2 -0
- package/dist/commands/auth-sessions/run-check.js +56 -0
- package/dist/commands/auth-sessions/run-create.d.ts +2 -0
- package/dist/commands/auth-sessions/run-create.js +96 -0
- package/dist/commands/browser/save-state.d.ts +2 -0
- package/dist/commands/browser/save-state.js +17 -0
- package/dist/commands/browser/start-browser.d.ts +2 -0
- package/dist/commands/browser/start-browser.js +14 -0
- package/dist/commands/build.d.ts +2 -0
- package/dist/commands/build.js +83 -0
- package/dist/commands/common/browserUtils.d.ts +14 -0
- package/dist/commands/common/browserUtils.js +58 -0
- package/dist/commands/common/getDefaultExportFromFile.d.ts +1 -0
- package/dist/commands/common/getDefaultExportFromFile.js +19 -0
- package/dist/commands/common/getFirstLineNumber.d.ts +9 -0
- package/dist/commands/common/getFirstLineNumber.js +103 -0
- package/{src/commands/common/getFirstLineNumber.test.ts → dist/commands/common/getFirstLineNumber.test.js} +75 -121
- package/dist/commands/common/sendMessageToClient.d.ts +1 -0
- package/dist/commands/common/sendMessageToClient.js +10 -0
- package/dist/commands/common/utils/fileUtils.d.ts +6 -0
- package/dist/commands/common/utils/fileUtils.js +33 -0
- package/dist/commands/common/utils/settings.d.ts +2 -0
- package/dist/commands/common/utils/settings.js +28 -0
- package/dist/commands/common/utils/unixSocket.d.ts +9 -0
- package/dist/commands/common/utils/unixSocket.js +45 -0
- package/dist/commands/common/utils/webTemplate.d.ts +1 -0
- package/dist/commands/common/utils/webTemplate.js +31 -0
- package/dist/commands/interface/run.d.ts +2 -0
- package/dist/commands/interface/run.js +161 -0
- package/dist/commands/ts-check.d.ts +2 -0
- package/dist/commands/ts-check.js +54 -0
- package/dist/common/Logger/Logger/index.d.ts +12 -0
- package/dist/common/Logger/Logger/index.js +60 -0
- package/{src/common/Logger/Logger/types.ts → dist/common/Logger/Logger/types.d.ts} +4 -5
- package/dist/common/Logger/Logger/types.js +5 -0
- package/dist/common/Logger/index.d.ts +12 -0
- package/dist/common/Logger/index.js +60 -0
- package/{src/common/Logger/types.ts → dist/common/Logger/types.d.ts} +4 -5
- package/dist/common/Logger/types.js +5 -0
- package/dist/common/asyncLocalStorage/index.d.ts +16 -0
- package/dist/common/asyncLocalStorage/index.js +17 -0
- package/dist/common/cleanEnvironmentVariables.d.ts +1 -0
- package/dist/common/cleanEnvironmentVariables.js +16 -0
- package/dist/common/constants.d.ts +1 -0
- package/dist/common/constants.js +7 -0
- package/dist/common/contextStorageStateHelpers.d.ts +14 -0
- package/dist/common/contextStorageStateHelpers.js +50 -0
- package/dist/common/getPlaywrightConstructs.d.ts +30 -0
- package/dist/common/getPlaywrightConstructs.js +192 -0
- package/dist/common/jwtTokenManager.d.ts +16 -0
- package/dist/common/jwtTokenManager.js +81 -0
- package/dist/common/runApi/errors.d.ts +71 -0
- package/dist/common/runApi/errors.js +172 -0
- package/dist/common/runApi/index.d.ts +12 -0
- package/dist/common/runApi/index.js +288 -0
- package/dist/common/runApi/types.d.ts +486 -0
- package/dist/common/runApi/types.js +50 -0
- package/dist/common/settingsSchema.d.ts +19 -0
- package/dist/common/settingsSchema.js +17 -0
- package/dist/common/telemetry.d.ts +3 -0
- package/dist/common/telemetry.js +32 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +69 -0
- package/dist/runtime/RunError.d.ts +5 -0
- package/dist/runtime/RunError.js +19 -0
- package/dist/runtime/downloadDirectory.d.ts +1 -0
- package/dist/runtime/downloadDirectory.js +19 -0
- package/dist/runtime/enums.d.js +5 -0
- package/dist/runtime/enums.js +18 -0
- package/dist/runtime/executionHelpers.test.js +53 -0
- package/dist/runtime/export.d.js +5 -0
- package/dist/runtime/extendPayload.d.ts +2 -0
- package/dist/runtime/extendPayload.js +21 -0
- package/dist/runtime/extendTimeout.d.ts +1 -0
- package/dist/runtime/extendTimeout.js +30 -0
- package/{src/runtime/index.ts → dist/runtime/index.d.ts} +2 -3
- package/dist/runtime/index.js +53 -0
- package/dist/runtime/requestMoreInfo.d.ts +18 -0
- package/dist/runtime/requestMoreInfo.js +25 -0
- package/dist/runtime/runInfo.d.ts +2 -0
- package/dist/runtime/runInfo.js +21 -0
- package/output.txt +39 -0
- package/package.json +9 -7
- package/testing +0 -0
- package/tsconfig.json +2 -1
- package/.vite/deps_temp_01af7156/package.json +0 -3
- package/.vscode/extensions.json +0 -3
- package/.vscode/launch.json +0 -102
- package/.vscode/settings.json +0 -12
- package/playwright.config.ts +0 -48
- package/src/commands/api/run.ts +0 -225
- package/src/commands/auth-sessions/load.ts +0 -42
- package/src/commands/auth-sessions/run-check.ts +0 -70
- package/src/commands/auth-sessions/run-create.ts +0 -124
- package/src/commands/browser/save-state.ts +0 -22
- package/src/commands/browser/start-browser.ts +0 -17
- package/src/commands/build.ts +0 -125
- package/src/commands/common/browserUtils.ts +0 -80
- package/src/commands/common/getDefaultExportFromFile.ts +0 -13
- package/src/commands/common/getFirstLineNumber.ts +0 -146
- package/src/commands/common/sendMessageToClient.ts +0 -8
- package/src/commands/common/utils/fileUtils.ts +0 -25
- package/src/commands/common/utils/settings.ts +0 -23
- package/src/commands/common/utils/webTemplate.ts +0 -46
- package/src/commands/testing/saveVisibleHtml.ts +0 -29
- package/src/commands/ts-check.ts +0 -88
- package/src/common/Logger/Logger/index.ts +0 -64
- package/src/common/Logger/index.ts +0 -64
- package/src/common/asyncLocalStorage/index.ts +0 -29
- package/src/common/cleanEnvironmentVariables.ts +0 -13
- package/src/common/constants.ts +0 -1
- package/src/common/contextStorageStateHelpers.ts +0 -71
- package/src/common/getPlaywrightConstructs.ts +0 -283
- package/src/common/jwtTokenManager.ts +0 -111
- package/src/common/settingsSchema.ts +0 -16
- package/src/common/telemetry.ts +0 -49
- package/src/index.ts +0 -14
- package/src/runtime/RunError.ts +0 -16
- package/src/runtime/downloadDirectory.ts +0 -14
- package/src/runtime/enums.ts +0 -11
- package/src/runtime/executionHelpers.test.ts +0 -70
- package/src/runtime/extendPayload.ts +0 -22
- package/src/runtime/extendTimeout.ts +0 -32
- package/src/runtime/requestMoreInfo.ts +0 -40
- package/src/runtime/runInfo.ts +0 -19
- package/vite.config.ts +0 -17
- /package/{src → dist}/common/assets/browser_scripts.js +0 -0
- /package/{src → dist}/runtime/enums.d.ts +0 -0
- /package/{src → dist}/runtime/export.d.ts +0 -0
|
@@ -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,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,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,30 @@
|
|
|
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) {
|
|
18
|
+
return;
|
|
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
|
+
if (timeoutInfo.extendTimeoutCallback !== undefined) {
|
|
28
|
+
void timeoutInfo.extendTimeoutCallback().catch(() => undefined);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -2,7 +2,6 @@ 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 type { RequestMoreInfoDetails } from "./requestMoreInfo";
|
|
7
|
+
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,18 @@
|
|
|
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 {};
|
|
@@ -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,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
|
+
}
|