@intuned/runtime-dev 1.3.9-deploy.0 → 1.3.9-dev10
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.playwright.ts +1 -0
- package/bin/intuned +2 -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/dist/commands/common/utils/settings.js +3 -0
- package/dist/commands/intuned-cli/commands/attempt_api.command.js +1 -1
- package/dist/commands/intuned-cli/commands/attempt_authsession_create.command.js +1 -1
- package/dist/commands/intuned-cli/commands/run_api.command.js +1 -1
- package/dist/commands/intuned-cli/controller/deploy.d.ts +0 -1
- package/dist/commands/intuned-cli/controller/deploy.js +6 -143
- package/dist/commands/intuned-cli/controller/save.d.ts +1 -4
- package/dist/commands/intuned-cli/controller/save.js +2 -8
- package/dist/commands/intuned-cli/helpers/backend.js +1 -1
- package/dist/commands/intuned-cli/helpers/errors.d.ts +0 -3
- package/dist/commands/intuned-cli/helpers/errors.js +1 -8
- package/dist/commands/intuned-cli/helpers/intunedJson.d.ts +11 -113
- package/dist/commands/intuned-cli/helpers/intunedJson.js +3 -19
- package/dist/commands/intuned-cli/helpers/wrapper.js +0 -5
- package/dist/common/binStartupScript.d.ts +1 -0
- package/dist/common/binStartupScript.js +34 -0
- package/dist/common/settingsSchema.d.ts +13 -0
- package/dist/common/settingsSchema.js +6 -0
- package/package/dist/commands/api/run.d.ts +6 -0
- package/package/dist/commands/api/run.js +123 -0
- package/package/dist/commands/auth-sessions/load.d.ts +2 -0
- package/package/dist/commands/auth-sessions/load.js +35 -0
- package/package/dist/commands/auth-sessions/run-check.d.ts +2 -0
- package/package/dist/commands/auth-sessions/run-check.js +74 -0
- package/package/dist/commands/auth-sessions/run-create.d.ts +2 -0
- package/package/dist/commands/auth-sessions/run-create.js +78 -0
- package/package/dist/commands/browser/save-state.d.ts +2 -0
- package/package/dist/commands/browser/save-state.js +17 -0
- package/package/dist/commands/browser/start-browser.d.ts +2 -0
- package/package/dist/commands/browser/start-browser.js +14 -0
- package/package/dist/commands/build.d.ts +1 -0
- package/package/dist/commands/build.js +84 -0
- package/package/dist/commands/common/browserUtils.d.ts +14 -0
- package/package/dist/commands/common/browserUtils.js +58 -0
- package/package/dist/commands/common/getFirstLineNumber.d.ts +9 -0
- package/package/dist/commands/common/getFirstLineNumber.js +101 -0
- package/package/dist/commands/common/getFirstLineNumber.test.js +228 -0
- package/package/dist/commands/common/projectExclusions.d.ts +2 -0
- package/package/dist/commands/common/projectExclusions.js +8 -0
- package/package/dist/commands/common/sendMessageToClient.d.ts +1 -0
- package/package/dist/commands/common/sendMessageToClient.js +10 -0
- package/package/dist/commands/common/tsNodeImport.d.ts +2 -0
- package/package/dist/commands/common/tsNodeImport.js +34 -0
- package/package/dist/commands/common/utils/fileUtils.d.ts +6 -0
- package/package/dist/commands/common/utils/fileUtils.js +33 -0
- package/package/dist/commands/common/utils/settings.d.ts +2 -0
- package/package/dist/commands/common/utils/settings.js +31 -0
- package/package/dist/commands/common/utils/template.d.ts +2 -0
- package/package/dist/commands/common/utils/template.js +31 -0
- package/package/dist/commands/common/utils/unixSocket.d.ts +9 -0
- package/package/dist/commands/common/utils/unixSocket.js +44 -0
- package/package/dist/commands/interface/run.d.ts +1 -0
- package/package/dist/commands/interface/run.js +216 -0
- package/package/dist/commands/intuned-cli/commands/attempt.command.d.ts +1 -0
- package/package/dist/commands/intuned-cli/commands/attempt.command.js +8 -0
- package/package/dist/commands/intuned-cli/commands/attempt_api.command.d.ts +1 -0
- package/package/dist/commands/intuned-cli/commands/attempt_api.command.js +30 -0
- package/package/dist/commands/intuned-cli/commands/attempt_authsession.command.d.ts +1 -0
- package/package/dist/commands/intuned-cli/commands/attempt_authsession.command.js +8 -0
- package/package/dist/commands/intuned-cli/commands/attempt_authsession_check.command.d.ts +1 -0
- package/package/dist/commands/intuned-cli/commands/attempt_authsession_check.command.js +19 -0
- package/package/dist/commands/intuned-cli/commands/attempt_authsession_create.command.d.ts +1 -0
- package/package/dist/commands/intuned-cli/commands/attempt_authsession_create.command.js +24 -0
- package/package/dist/commands/intuned-cli/commands/authsession.command.d.ts +1 -0
- package/package/dist/commands/intuned-cli/commands/authsession.command.js +8 -0
- package/package/dist/commands/intuned-cli/commands/authsession_record.command.d.ts +1 -0
- package/package/dist/commands/intuned-cli/commands/authsession_record.command.js +31 -0
- package/package/dist/commands/intuned-cli/commands/build.command.d.ts +1 -0
- package/package/dist/commands/intuned-cli/commands/build.command.js +12 -0
- package/package/dist/commands/intuned-cli/commands/command.d.ts +2 -0
- package/package/dist/commands/intuned-cli/commands/command.js +9 -0
- package/package/dist/commands/intuned-cli/commands/deploy.command.d.ts +1 -0
- package/package/dist/commands/intuned-cli/commands/deploy.command.js +38 -0
- package/package/dist/commands/intuned-cli/commands/index.d.ts +18 -0
- package/package/dist/commands/intuned-cli/commands/index.js +203 -0
- package/package/dist/commands/intuned-cli/commands/init.command.d.ts +1 -0
- package/package/dist/commands/intuned-cli/commands/init.command.js +13 -0
- package/package/dist/commands/intuned-cli/commands/run.command.d.ts +1 -0
- package/package/dist/commands/intuned-cli/commands/run.command.js +8 -0
- package/package/dist/commands/intuned-cli/commands/run_api.command.d.ts +1 -0
- package/package/dist/commands/intuned-cli/commands/run_api.command.js +46 -0
- package/package/dist/commands/intuned-cli/commands/run_authsession.command.d.ts +28 -0
- package/package/dist/commands/intuned-cli/commands/run_authsession.command.js +17 -0
- package/package/dist/commands/intuned-cli/commands/run_authsession_create.command.d.ts +1 -0
- package/package/dist/commands/intuned-cli/commands/run_authsession_create.command.js +35 -0
- package/package/dist/commands/intuned-cli/commands/run_authsession_update.command.d.ts +1 -0
- package/package/dist/commands/intuned-cli/commands/run_authsession_update.command.js +35 -0
- package/package/dist/commands/intuned-cli/commands/run_authsession_validate.command.d.ts +1 -0
- package/package/dist/commands/intuned-cli/commands/run_authsession_validate.command.js +33 -0
- package/package/dist/commands/intuned-cli/commands/save.command.d.ts +13 -0
- package/package/dist/commands/intuned-cli/commands/save.command.js +42 -0
- package/package/dist/commands/intuned-cli/commands/types.d.ts +31 -0
- package/package/dist/commands/intuned-cli/commands/types.js +29 -0
- package/package/dist/commands/intuned-cli/constants/index.d.ts +17 -0
- package/package/dist/commands/intuned-cli/constants/index.js +25 -0
- package/package/dist/commands/intuned-cli/controller/__test__/api.test.js +397 -0
- package/package/dist/commands/intuned-cli/controller/__test__/authSession.test.js +1059 -0
- package/package/dist/commands/intuned-cli/controller/api.d.ts +42 -0
- package/package/dist/commands/intuned-cli/controller/api.js +189 -0
- package/package/dist/commands/intuned-cli/controller/authSession.d.ts +209 -0
- package/package/dist/commands/intuned-cli/controller/authSession.js +420 -0
- package/package/dist/commands/intuned-cli/controller/build.d.ts +1 -0
- package/package/dist/commands/intuned-cli/controller/build.js +36 -0
- package/package/dist/commands/intuned-cli/controller/deploy.d.ts +4 -0
- package/package/dist/commands/intuned-cli/controller/deploy.js +139 -0
- package/package/dist/commands/intuned-cli/controller/index.d.ts +1 -0
- package/package/dist/commands/intuned-cli/controller/index.js +46 -0
- package/package/dist/commands/intuned-cli/controller/save.d.ts +14 -0
- package/package/dist/commands/intuned-cli/controller/save.js +345 -0
- package/package/dist/commands/intuned-cli/helpers/__test__/browser.test.js +103 -0
- package/package/dist/commands/intuned-cli/helpers/__test__/tracing.test.js +40 -0
- package/package/dist/commands/intuned-cli/helpers/api.d.ts +3 -0
- package/package/dist/commands/intuned-cli/helpers/api.js +19 -0
- package/package/dist/commands/intuned-cli/helpers/auth.d.ts +46 -0
- package/package/dist/commands/intuned-cli/helpers/auth.js +144 -0
- package/package/dist/commands/intuned-cli/helpers/backend.d.ts +8 -0
- package/package/dist/commands/intuned-cli/helpers/backend.js +27 -0
- package/package/dist/commands/intuned-cli/helpers/browser.d.ts +14 -0
- package/package/dist/commands/intuned-cli/helpers/browser.js +57 -0
- package/package/dist/commands/intuned-cli/helpers/context.d.ts +3 -0
- package/package/dist/commands/intuned-cli/helpers/context.js +33 -0
- package/package/dist/commands/intuned-cli/helpers/errors.d.ts +13 -0
- package/package/dist/commands/intuned-cli/helpers/errors.js +37 -0
- package/package/dist/commands/intuned-cli/helpers/index.d.ts +12 -0
- package/package/dist/commands/intuned-cli/helpers/index.js +137 -0
- package/package/dist/commands/intuned-cli/helpers/intunedJson.d.ts +69 -0
- package/package/dist/commands/intuned-cli/helpers/intunedJson.js +71 -0
- package/package/dist/commands/intuned-cli/helpers/proxy.d.ts +5 -0
- package/package/dist/commands/intuned-cli/helpers/proxy.js +23 -0
- package/package/dist/commands/intuned-cli/helpers/terminal.d.ts +5 -0
- package/package/dist/commands/intuned-cli/helpers/terminal.js +13 -0
- package/package/dist/commands/intuned-cli/helpers/timeout.d.ts +1 -0
- package/package/dist/commands/intuned-cli/helpers/timeout.js +23 -0
- package/package/dist/commands/intuned-cli/helpers/traces.d.ts +2 -0
- package/package/dist/commands/intuned-cli/helpers/traces.js +32 -0
- package/package/dist/commands/intuned-cli/helpers/validation.d.ts +2 -0
- package/package/dist/commands/intuned-cli/helpers/validation.js +14 -0
- package/package/dist/commands/intuned-cli/helpers/wrapper.d.ts +2 -0
- package/package/dist/commands/intuned-cli/helpers/wrapper.js +60 -0
- package/package/dist/commands/intuned-cli/index.d.ts +1 -0
- package/package/dist/commands/intuned-cli/index.js +16 -0
- package/package/dist/commands/intuned-cli/main.d.ts +1 -0
- package/package/dist/commands/intuned-cli/main.js +22 -0
- package/package/dist/commands/intuned-cli/types.d.ts +41 -0
- package/package/dist/commands/intuned-cli/types.js +12 -0
- package/package/dist/commands/ts-check.d.ts +2 -0
- package/package/dist/commands/ts-check.js +56 -0
- package/package/dist/common/Logger/Logger/index.d.ts +12 -0
- package/package/dist/common/Logger/Logger/index.js +60 -0
- package/package/dist/common/Logger/Logger/types.d.ts +8 -0
- package/package/dist/common/Logger/Logger/types.js +5 -0
- package/package/dist/common/Logger/index.d.ts +12 -0
- package/package/dist/common/Logger/index.js +60 -0
- package/package/dist/common/Logger/types.d.ts +8 -0
- package/package/dist/common/Logger/types.js +5 -0
- package/package/dist/common/assets/browser_scripts.js +2580 -0
- package/package/dist/common/asyncLocalStorage/index.d.ts +16 -0
- package/package/dist/common/asyncLocalStorage/index.js +17 -0
- package/package/dist/common/backendFunctions/getAuthSessionParameters.d.ts +1 -0
- package/package/dist/common/backendFunctions/getAuthSessionParameters.js +38 -0
- package/package/dist/common/cleanEnvironmentVariables.d.ts +1 -0
- package/package/dist/common/cleanEnvironmentVariables.js +16 -0
- package/package/dist/common/constants.d.ts +10 -0
- package/package/dist/common/constants.js +16 -0
- package/package/dist/common/contextStorageStateHelpers.d.ts +21 -0
- package/package/dist/common/contextStorageStateHelpers.js +81 -0
- package/package/dist/common/extensionsHelpers.d.ts +8 -0
- package/package/dist/common/extensionsHelpers.js +80 -0
- package/package/dist/common/formatZodError.d.ts +2 -0
- package/package/dist/common/formatZodError.js +18 -0
- package/package/dist/common/jwtTokenManager.d.ts +17 -0
- package/package/dist/common/jwtTokenManager.js +109 -0
- package/package/dist/common/launchBrowser.d.ts +25 -0
- package/package/dist/common/launchBrowser.js +172 -0
- package/package/dist/common/playwrightContext.d.ts +31 -0
- package/package/dist/common/playwrightContext.js +144 -0
- package/package/dist/common/runApi/errors.d.ts +72 -0
- package/package/dist/common/runApi/errors.js +169 -0
- package/package/dist/common/runApi/importUsingImportFunction.d.ts +9 -0
- package/package/dist/common/runApi/importUsingImportFunction.js +46 -0
- package/package/dist/common/runApi/index.d.ts +11 -0
- package/package/dist/common/runApi/index.js +199 -0
- package/package/dist/common/runApi/types.d.ts +830 -0
- package/package/dist/common/runApi/types.js +73 -0
- package/package/dist/common/settingsSchema.d.ts +518 -0
- package/package/dist/common/settingsSchema.js +57 -0
- package/package/dist/common/setupContextHook.d.ts +17 -0
- package/package/dist/common/setupContextHook.js +22 -0
- package/package/dist/common/telemetry.d.ts +3 -0
- package/package/dist/common/telemetry.js +32 -0
- package/package/dist/index.d.ts +4 -0
- package/package/dist/index.js +69 -0
- package/package/dist/runtime/RunError.d.ts +5 -0
- package/package/dist/runtime/RunError.js +19 -0
- package/package/dist/runtime/attemptStore.d.ts +2 -0
- package/package/dist/runtime/attemptStore.js +23 -0
- package/package/dist/runtime/downloadDirectory.d.ts +1 -0
- package/package/dist/runtime/downloadDirectory.js +19 -0
- package/package/dist/runtime/enums.d.js +5 -0
- package/package/dist/runtime/enums.d.ts +11 -0
- package/package/dist/runtime/enums.js +18 -0
- package/package/dist/runtime/executionHelpers.test.js +52 -0
- package/package/dist/runtime/export.d.js +5 -0
- package/package/dist/runtime/export.d.ts +228 -0
- package/package/dist/runtime/extendPayload.d.ts +2 -0
- package/package/dist/runtime/extendPayload.js +21 -0
- package/package/dist/runtime/extendTimeout.d.ts +1 -0
- package/package/dist/runtime/extendTimeout.js +23 -0
- package/package/dist/runtime/getAuthSessionParameters.d.ts +1 -0
- package/package/dist/runtime/getAuthSessionParameters.js +20 -0
- package/package/dist/runtime/index.d.ts +7 -0
- package/package/dist/runtime/index.js +54 -0
- package/package/dist/runtime/runInfo.d.ts +2 -0
- package/package/dist/runtime/runInfo.js +21 -0
- package/package.json +3 -5
- package/WebTemplate.zip +0 -0
- package/bin/intuned-auth-session-refresh +0 -2
|
@@ -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 && {}.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, getAuthSessionParameters, attemptStore, } from "./runtime";
|
|
2
|
+
export { runWithContext, getExecutionContext, } from "./common/asyncLocalStorage";
|
|
3
|
+
export { getDownloadDirectoryPath } from "./runtime/downloadDirectory";
|
|
4
|
+
export { withPlaywrightContext } from "./common/playwrightContext";
|
|
@@ -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, "attemptStore", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _runtime.attemptStore;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "extendPayload", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _runtime.extendPayload;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "extendTimeout", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _runtime.extendTimeout;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "getAuthSessionParameters", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _runtime.getAuthSessionParameters;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "getDownloadDirectoryPath", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _downloadDirectory.getDownloadDirectoryPath;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "getExecutionContext", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _asyncLocalStorage.getExecutionContext;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "runInfo", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _runtime.runInfo;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "runWithContext", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _asyncLocalStorage.runWithContext;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "withPlaywrightContext", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () {
|
|
63
|
+
return _playwrightContext.withPlaywrightContext;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
var _runtime = require("./runtime");
|
|
67
|
+
var _asyncLocalStorage = require("./common/asyncLocalStorage");
|
|
68
|
+
var _downloadDirectory = require("./runtime/downloadDirectory");
|
|
69
|
+
var _playwrightContext = require("./common/playwrightContext");
|
|
@@ -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,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.attemptStore = void 0;
|
|
7
|
+
var _asyncLocalStorage = require("../common/asyncLocalStorage");
|
|
8
|
+
const attemptStore = exports.attemptStore = 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
|
+
});
|
|
@@ -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,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _vitest = require("vitest");
|
|
4
|
+
var _asyncLocalStorage = require("../common/asyncLocalStorage");
|
|
5
|
+
var _ = require(".");
|
|
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, _.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
|
+
(0, _vitest.expect)((0, _asyncLocalStorage.getExecutionContext)()?.extendedPayloads).toEqual([]);
|
|
28
|
+
(0, _.extendPayload)({
|
|
29
|
+
api: "test-api",
|
|
30
|
+
parameters: {}
|
|
31
|
+
});
|
|
32
|
+
(0, _vitest.expect)((0, _asyncLocalStorage.getExecutionContext)()?.extendedPayloads).toEqual([{
|
|
33
|
+
api: "test-api",
|
|
34
|
+
parameters: {}
|
|
35
|
+
}]);
|
|
36
|
+
(0, _.extendPayload)({
|
|
37
|
+
api: "test-api",
|
|
38
|
+
parameters: {}
|
|
39
|
+
});
|
|
40
|
+
(0, _.extendPayload)({
|
|
41
|
+
api: "test-api",
|
|
42
|
+
parameters: {}
|
|
43
|
+
});
|
|
44
|
+
(0, _.extendPayload)({
|
|
45
|
+
api: "test-api",
|
|
46
|
+
parameters: {}
|
|
47
|
+
});
|
|
48
|
+
const context = (0, _asyncLocalStorage.getExecutionContext)();
|
|
49
|
+
(0, _vitest.expect)(context?.extendedPayloads).toHaveLength(4);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
});
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { RunEnvironment } from "./enums";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## Description
|
|
5
|
+
* In the context of a job, extendTimeout will increase the timeout of the currently executing payload.
|
|
6
|
+
* This is useful when the payload is expected to take a long time. For example, when running pagination code.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript Example
|
|
10
|
+
* import { extendTimeout } from "@intuned/sdk/runtime"
|
|
11
|
+
*
|
|
12
|
+
* extendTimeout();
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
export declare function extendTimeout(): void;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* ## Description
|
|
20
|
+
* In the context of a job or queue execution, extendPayload appends new payloads to the end of the queue of job.
|
|
21
|
+
* Calling extendPayload will also call extendTimeout.
|
|
22
|
+
*
|
|
23
|
+
* @param {Payload | Payload[]} payload - The payload or array of payloads to extend. you can specify the api name and what parameters you want to pass it, the new added apis will use the same proxy and auth-session settings as the api that extended them
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript Single payload
|
|
27
|
+
* import { extendPayload } from "@intuned/sdk/runtime"
|
|
28
|
+
*
|
|
29
|
+
* // this function will append the exampleApi to the end of the queue or job it's executing in.
|
|
30
|
+
* extendPayload({ api: 'exampleApi', parameters: { key: 'value' } });
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```typescript Array of payloads
|
|
35
|
+
* import { extendPayload } from "@intuned/sdk/runtime"
|
|
36
|
+
*
|
|
37
|
+
* const payloadArray: Payload[] = [
|
|
38
|
+
* { api: 'exampleApi1', parameters: { key1: 'value1' } },
|
|
39
|
+
* { api: 'exampleApi2', parameters: { key2: 'value2' } }
|
|
40
|
+
* ];
|
|
41
|
+
*
|
|
42
|
+
* // this function will append 2 apis to the end of the queue or job it's executing in.
|
|
43
|
+
* extendPayload(payloadArray);
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export declare function extendPayload(payload: Payload | Payload[]): void;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* @interface Payload
|
|
50
|
+
* @property {string} api - The API path you want to extend.
|
|
51
|
+
* @property {Record<string, any>} parameters - A record of key-value pairs representing the parameters to be sent to the API
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
*
|
|
55
|
+
* ```typescript payload
|
|
56
|
+
* import { Payload } from "@intuned/sdk/runtime"
|
|
57
|
+
*
|
|
58
|
+
* const payload: Payload = {
|
|
59
|
+
* api: 'exampleApi',
|
|
60
|
+
* parameters: {
|
|
61
|
+
* key1: 'value1',
|
|
62
|
+
* key2: 'value2'
|
|
63
|
+
* }
|
|
64
|
+
* };
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
export interface Payload {
|
|
68
|
+
api: string;
|
|
69
|
+
parameters: Record<string, any>;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Retrieves information about the current run environment.
|
|
74
|
+
*
|
|
75
|
+
* @returns {RunInfo} An object containing details about the run environment and the run ID.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```typescript runInfo
|
|
79
|
+
* import { runInfo } from "@intuned/sdk/runtime"
|
|
80
|
+
*
|
|
81
|
+
* const info = runInfo();
|
|
82
|
+
* console.log(info.runEnvironment); // Outputs the run environment, IDE or DEPLOYED
|
|
83
|
+
* console.log(info.runId); // Outputs the run ID, if available, in IDE run id will be undefined
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
export declare function runInfo(): RunInfo;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Represents information about the current run.
|
|
90
|
+
*
|
|
91
|
+
* @interface RunInfo
|
|
92
|
+
* @property {RunEnvironment} runEnvironment - the run environment `IDE` or `DEPLOYED`
|
|
93
|
+
* @property {string} [runId] - Optional. The ID of the current run, in IDE environment, run id will be undefined
|
|
94
|
+
*/
|
|
95
|
+
export interface RunInfo {
|
|
96
|
+
runEnvironment: RunEnvironment;
|
|
97
|
+
runId?: string;
|
|
98
|
+
jobId?: string;
|
|
99
|
+
jobRunId?: string;
|
|
100
|
+
queueId?: string;
|
|
101
|
+
proxy?: string;
|
|
102
|
+
authSessionId?: string;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* @interface RunErrorOptions
|
|
107
|
+
* @property {boolean} [retryable] - Optional. Indicates whether the error is retryable.
|
|
108
|
+
* @property {number} [status_code] - Optional. The HTTP status code associated with the error.
|
|
109
|
+
* @property {string} [error_code] - Optional. A specific error code to identify the type of error.
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* ```typescript RunErrorOptions
|
|
113
|
+
* import { RunErrorOptions } from "@intuned/sdk/runtime"
|
|
114
|
+
*
|
|
115
|
+
* const options: RunErrorOptions = {
|
|
116
|
+
* retryable: true,
|
|
117
|
+
* status_code: 500,
|
|
118
|
+
* error_code: 'SERVER_ERROR'
|
|
119
|
+
* };
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
export interface RunErrorOptions {
|
|
123
|
+
retryable?: boolean;
|
|
124
|
+
status_code?: number;
|
|
125
|
+
error_code?: string;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* @deprecated This error is deprecated. it will be treated like any normal error
|
|
130
|
+
*
|
|
131
|
+
* Represents an error that occurs during a run.
|
|
132
|
+
*
|
|
133
|
+
* @class
|
|
134
|
+
* @extends Error
|
|
135
|
+
*
|
|
136
|
+
* @param {string} message - The error message.
|
|
137
|
+
* @param {RunErrorOptions} [options] - Optional. Additional options for the error.
|
|
138
|
+
*
|
|
139
|
+
* @property {RunErrorOptions} options - The options associated with the error.
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* ```typescript RunError
|
|
143
|
+
* import { RunError } from "@intuned/sdk/runtime"
|
|
144
|
+
*
|
|
145
|
+
* throw new RunError('An error occurred', {
|
|
146
|
+
* retryable: true,
|
|
147
|
+
* status_code: 500,
|
|
148
|
+
* error_code: 'SERVER_ERROR'
|
|
149
|
+
* });
|
|
150
|
+
*
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
153
|
+
export declare class RunError extends Error {
|
|
154
|
+
constructor(message: string, options?: RunErrorOptions);
|
|
155
|
+
options: RunErrorOptions;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Retrieves the parameters for the authentication session currently being used.
|
|
160
|
+
*
|
|
161
|
+
* @returns {AuthSessionParameters} An object containing the parameters for the current authentication session.
|
|
162
|
+
*
|
|
163
|
+
* @example
|
|
164
|
+
* ```typescript getAuthSessionParameters
|
|
165
|
+
* import { getAuthSessionParameters } from "@intuned/sdk/runtime"
|
|
166
|
+
*
|
|
167
|
+
* const authSessionParams = getAuthSessionParameters();
|
|
168
|
+
* console.log(authSessionParams);
|
|
169
|
+
* ```
|
|
170
|
+
*/
|
|
171
|
+
export declare function getAuthSessionParameters(): Promise<any>;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* @interface Store
|
|
175
|
+
* @property {function} get - Retrieves a value from the store by key
|
|
176
|
+
* @property {function} set - Sets a value in the store by key
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* ```typescript Store usage
|
|
180
|
+
* import { store } from "@intuned/sdk/runtime"
|
|
181
|
+
*
|
|
182
|
+
* // Set a value in the store
|
|
183
|
+
* store.set('userPreference', { theme: 'dark' });
|
|
184
|
+
*
|
|
185
|
+
* // Get a value from the store
|
|
186
|
+
* const preference = store.get('userPreference');
|
|
187
|
+
* ```
|
|
188
|
+
*/
|
|
189
|
+
export interface Store {
|
|
190
|
+
/**
|
|
191
|
+
* Retrieves a value from the store by key.
|
|
192
|
+
*
|
|
193
|
+
* @param {string} key - The key to retrieve the value for
|
|
194
|
+
* @returns {any} The value associated with the key, or undefined if not found
|
|
195
|
+
*/
|
|
196
|
+
get(key: string): any;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Sets a value in the store by key.
|
|
200
|
+
*
|
|
201
|
+
* @param {string} key - The key to set the value for
|
|
202
|
+
* @param {any} value - The value to store
|
|
203
|
+
* @throws {Error} Throws an error if the store operation fails
|
|
204
|
+
*/
|
|
205
|
+
set(key: string, value: any): void;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* ## Description
|
|
210
|
+
* A persistent key-value store that maintains data within the execution context.
|
|
211
|
+
* This store allows you to share data between different parts of your API execution.
|
|
212
|
+
*
|
|
213
|
+
* @example
|
|
214
|
+
* ```typescript Store usage
|
|
215
|
+
* import { store } from "@intuned/sdk/runtime"
|
|
216
|
+
*
|
|
217
|
+
* // Set a value in the store
|
|
218
|
+
* store.set('sessionData', { userId: '123', token: 'abc' });
|
|
219
|
+
*
|
|
220
|
+
* // Get a value from the store
|
|
221
|
+
* const sessionData = store.get('sessionData');
|
|
222
|
+
* console.log(sessionData.userId); // '123'
|
|
223
|
+
*
|
|
224
|
+
* // Handle missing values
|
|
225
|
+
* const missingData = store.get('nonexistent'); // undefined
|
|
226
|
+
* ```
|
|
227
|
+
*/
|
|
228
|
+
export declare const attemptStore: Store;
|
|
@@ -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?.extendedPayloads.push(...items);
|
|
20
|
+
(0, _extendTimeout.extendTimeout)();
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function extendTimeout(): void;
|
|
@@ -0,0 +1,23 @@
|
|
|
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.extendTimeoutCallback !== undefined) {
|
|
21
|
+
void timeoutInfo.extendTimeoutCallback().catch(() => undefined);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -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,7 @@
|
|
|
1
|
+
export { extendPayload } from "./extendPayload";
|
|
2
|
+
export { extendTimeout } from "./extendTimeout";
|
|
3
|
+
export { attemptStore } from "./attemptStore";
|
|
4
|
+
export { getAuthSessionParameters } from "./getAuthSessionParameters";
|
|
5
|
+
export { runInfo } from "./runInfo";
|
|
6
|
+
export { RunError } from "./RunError";
|
|
7
|
+
export { getDownloadDirectoryPath } from "./downloadDirectory";
|
|
@@ -0,0 +1,54 @@
|
|
|
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, "attemptStore", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _attemptStore.attemptStore;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "extendPayload", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _extendPayload.extendPayload;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "extendTimeout", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _extendTimeout.extendTimeout;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "getAuthSessionParameters", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _getAuthSessionParameters.getAuthSessionParameters;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "getDownloadDirectoryPath", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _downloadDirectory.getDownloadDirectoryPath;
|
|
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 _attemptStore = require("./attemptStore");
|
|
51
|
+
var _getAuthSessionParameters = require("./getAuthSessionParameters");
|
|
52
|
+
var _runInfo = require("./runInfo");
|
|
53
|
+
var _RunError = require("./RunError");
|
|
54
|
+
var _downloadDirectory = require("./downloadDirectory");
|
|
@@ -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
|
+
}
|