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

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;
@@ -260,6 +260,7 @@ async function importUsingImportFunction(path, importFunction) {
260
260
  });
261
261
  }
262
262
  if (imported.default.constructor.name === "AsyncFunction") {
263
+ (0, _asyncLocalStorage.getExecutionContext)();
263
264
  return (0, _neverthrow.ok)({
264
265
  type: "async",
265
266
  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.4",
4
4
  "description": "Intuned runtime",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",