@intuned/runtime-dev 1.0.6-cli.8.0.3 → 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,16 @@ _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
- console.log(options);
18
16
  try {
17
+ const inputData = await (0, _utils.loadParameters)(options.parametersFile);
18
+ const outputFileId = options.outputFile;
19
19
  const result = await (0, _asyncLocalStorage.runWithContext)({
20
20
  runEnvironment: _enums.RunEnvironment.IDE,
21
21
  extendedPayloads: [],
22
22
  runId: (0, _nanoid.nanoid)()
23
- }, () => (0, _utils.runApiViaCLI)(apiName, inputData, options));
23
+ }, () => (0, _utils.runApiViaCLI)(apiName, inputData, {
24
+ outputFileId
25
+ }));
24
26
  if (!result) {
25
27
  console.log(_chalk.default.yellow("No result returned from the API"));
26
28
  return;
@@ -29,7 +31,6 @@ _commander.program.name("intuned-run").description("Run an Intuned API with para
29
31
  console.log(_chalk.default.green(`✓ API executed successfully`));
30
32
  return;
31
33
  }
32
- const outputFileId = options.outputFile;
33
34
  await (0, _utils.writeResultToFile)(outputFileId, result);
34
35
  process.exit(0);
35
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
  }
@@ -46,7 +46,6 @@ async function writeResultToFile(outputFileId, result, runId) {
46
46
  spaces: 2
47
47
  });
48
48
  console.log(_chalk.default.green(`✓ API executed successfully. Result written to ${outputPath}`));
49
- _Logger.logger.info(`Result written to ${outputPath}`);
50
49
  } catch (error) {
51
50
  _Logger.logger.error(`Failed to write result to file: ${error.message}`);
52
51
  }
@@ -75,7 +74,6 @@ async function runApiViaCLI(apiName, inputData, options) {
75
74
  extendedPayloads: payloadToAppend
76
75
  } = runApiResult.value;
77
76
  const hasPayloadToAppend = payloadToAppend && payloadToAppend.length > 0;
78
- console.log("result:", result);
79
77
  if (hasPayloadToAppend && options.outputFileId) {
80
78
  const fileKey = `${options.outputFileId}-payloads-to-append.json`;
81
79
  const outputPath = _path.default.join(process.cwd(), fileKey);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intuned/runtime-dev",
3
- "version": "1.0.6-cli.8.0.3",
3
+ "version": "1.0.6-cli.8.0.5",
4
4
  "description": "Intuned runtime",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",