@intuned/runtime-dev 1.0.6-cli.3 → 1.0.6-cli.5

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.
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.tsNodeImport = void 0;
7
7
  var _neverthrow = require("neverthrow");
8
8
  var _fileUtils = require("./utils/fileUtils");
9
+ var _asyncLocalStorage = require("../../common/asyncLocalStorage");
9
10
  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
11
  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
12
  const tsNodeImport = async apiName => {
@@ -18,6 +19,7 @@ const tsNodeImport = async apiName => {
18
19
  const path = (0, _fileUtils.getFullPathInProject)(...apiName.split("/"));
19
20
  try {
20
21
  const imported = await (specifier => new Promise(r => r(`${specifier}`)).then(s => _interopRequireWildcard(require(s))))(path);
22
+ (0, _asyncLocalStorage.getExecutionContext)();
21
23
  return (0, _neverthrow.ok)(imported);
22
24
  } catch (e) {
23
25
  if ("code" in e && e.code === "MODULE_NOT_FOUND") {
@@ -15,7 +15,10 @@ _commander.program.name("intuned-run").description("Run an Intuned API with para
15
15
  runEnvironment: _enums.RunEnvironment.IDE,
16
16
  extendedPayloads: [],
17
17
  runId: (0, _nanoid.nanoid)()
18
- }, async () => await (0, _utils.runApiViaCLI)(apiName, inputData, options));
18
+ }, async () => {
19
+ const result = await (0, _utils.runApiViaCLI)(apiName, inputData, options);
20
+ return result;
21
+ });
19
22
  if (!result) {
20
23
  console.log(_chalk.default.yellow("No result returned from the API"));
21
24
  return;
@@ -181,6 +181,7 @@ async function* runApiGenerator({
181
181
  break;
182
182
  }
183
183
  } else {
184
+ (0, _asyncLocalStorage.getExecutionContext)();
184
185
  result = await importedModule.func(...automationFunctionParameters);
185
186
  }
186
187
  return (0, _neverthrow.ok)({
@@ -260,6 +261,7 @@ async function importUsingImportFunction(path, importFunction) {
260
261
  });
261
262
  }
262
263
  if (imported.default.constructor.name === "AsyncFunction") {
264
+ (0, _asyncLocalStorage.getExecutionContext)();
263
265
  return (0, _neverthrow.ok)({
264
266
  type: "async",
265
267
  func: imported.default
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intuned/runtime-dev",
3
- "version": "1.0.6-cli.3",
3
+ "version": "1.0.6-cli.5",
4
4
  "description": "Intuned runtime",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",
@@ -13,7 +13,8 @@
13
13
  "./dist/common/asyncLocalStorage": "./dist/common/asyncLocalStorage/index.js",
14
14
  "./dist/common/cleanEnvironmentVariables": "./dist/common/cleanEnvironmentVariables.js",
15
15
  "./dist/common/constants": "./dist/common/constants.js",
16
- "./dist/commands/interface/run": "./dist/commands/interface/run.js"
16
+ "./dist/commands/interface/run": "./dist/commands/interface/run.js",
17
+ "./dist/commands/intuned-run/intuned-run": "./dist/commands/intuned-run/intuned-run.js"
17
18
  },
18
19
  "types": "./dist/index.d.ts",
19
20
  "author": "Intuned Team",