@intuned/runtime-dev 1.0.6-cli.8.0.4 → 1.0.6-cli.8.0.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.
@@ -13,14 +13,15 @@ _dotenv.default.config({
13
13
  path: `.env`
14
14
  });
15
15
  _commander.program.name("intuned-run").description("Run an Intuned API with parameters").argument("<api-name>", "Name of the API to run").option("-p, --parameters-file <file>", "JSON file containing API parameters").option("-o, --output-file <file>", "File to write the API output to").action(async (apiName, options) => {
16
- const inputData = await (0, _utils.loadParameters)(options.parametersFile);
17
16
  try {
17
+ const inputData = await (0, _utils.loadParameters)(options.parametersFile);
18
+ const outputFileId = options.outputFile;
18
19
  const result = await (0, _asyncLocalStorage.runWithContext)({
19
20
  runEnvironment: _enums.RunEnvironment.IDE,
20
21
  extendedPayloads: [],
21
22
  runId: (0, _nanoid.nanoid)()
22
23
  }, () => (0, _utils.runApiViaCLI)(apiName, inputData, {
23
- outputFileId: options.outputFile
24
+ outputFileId
24
25
  }));
25
26
  if (!result) {
26
27
  console.log(_chalk.default.yellow("No result returned from the API"));
@@ -30,7 +31,6 @@ _commander.program.name("intuned-run").description("Run an Intuned API with para
30
31
  console.log(_chalk.default.green(`✓ API executed successfully`));
31
32
  return;
32
33
  }
33
- const outputFileId = options.outputFile;
34
34
  await (0, _utils.writeResultToFile)(outputFileId, result);
35
35
  process.exit(0);
36
36
  } catch (error) {
@@ -24,7 +24,7 @@ async function loadParameters(parametersFile) {
24
24
  await fs.access(filePath);
25
25
  let inputData = null;
26
26
  if (parametersFile) {
27
- inputData = await fs.readJSON(parametersFile);
27
+ inputData = await fs.readJSON(filePath);
28
28
  } else {
29
29
  inputData = {};
30
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intuned/runtime-dev",
3
- "version": "1.0.6-cli.8.0.4",
3
+ "version": "1.0.6-cli.8.0.5",
4
4
  "description": "Intuned runtime",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",