@reporting-bi/cli 0.1.5 → 0.1.6

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.
Files changed (2) hide show
  1. package/dist/index.js +25 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -11507,8 +11507,24 @@ async function exec2(id, flags) {
11507
11507
  } else if (flags.sql) {
11508
11508
  body = flags.sql;
11509
11509
  }
11510
- const result = await service.post(`exec/${id}`, body, { parseResponse: false });
11511
- process.stdout.write(result || "");
11510
+ if (flags.output) {
11511
+ const response = await service.postRaw(`exec/${id}`, body, {
11512
+ csv_delimiter: " ",
11513
+ csv_header: "1",
11514
+ csv_header_json: "1",
11515
+ csv_null_value: "NULL"
11516
+ }, { headers: { accept: "text/csv" } });
11517
+ if (!response.ok) {
11518
+ const text3 = await response.text();
11519
+ console.error(text3);
11520
+ process.exit(1);
11521
+ }
11522
+ const text2 = await response.text();
11523
+ fs8.writeFileSync(flags.output, text2);
11524
+ } else {
11525
+ const result = await service.post(`exec/${id}`, body, void 0, { parseResponse: false });
11526
+ process.stdout.write(result || "");
11527
+ }
11512
11528
  }
11513
11529
  async function search2(query, flags) {
11514
11530
  const service = await createService("etl");
@@ -35085,7 +35101,7 @@ function text(data) {
35085
35101
  async function mcp() {
35086
35102
  const server = new McpServer({
35087
35103
  name: "reporting-bi",
35088
- version: "0.1.5"
35104
+ version: "0.1.6"
35089
35105
  });
35090
35106
  server.tool(
35091
35107
  "status",
@@ -35631,8 +35647,8 @@ async function checkForUpdate() {
35631
35647
  saveUpdateCheck({ lastCheck: now });
35632
35648
  const latest = await fetchLatestVersion();
35633
35649
  if (!latest) return;
35634
- if (!isNewer(latest, "0.1.5")) return;
35635
- console.log(`\x1B[33mUpdating ${PACKAGE_NAME} ${"0.1.5"} \u2192 ${latest}...\x1B[0m`);
35650
+ if (!isNewer(latest, "0.1.6")) return;
35651
+ console.log(`\x1B[33mUpdating ${PACKAGE_NAME} ${"0.1.6"} \u2192 ${latest}...\x1B[0m`);
35636
35652
  (0, import_node_child_process3.execSync)(npmInstallCmd(latest), { stdio: "inherit" });
35637
35653
  console.log(`\x1B[32mUpdated to ${latest}.\x1B[0m`);
35638
35654
  } catch {
@@ -35644,11 +35660,11 @@ async function forceUpdate() {
35644
35660
  console.error("Could not fetch latest version from npm.");
35645
35661
  process.exit(1);
35646
35662
  }
35647
- if (!isNewer(latest, "0.1.5")) {
35648
- console.log(`Already up to date (${"0.1.5"}).`);
35663
+ if (!isNewer(latest, "0.1.6")) {
35664
+ console.log(`Already up to date (${"0.1.6"}).`);
35649
35665
  return;
35650
35666
  }
35651
- console.log(`Updating ${PACKAGE_NAME} ${"0.1.5"} \u2192 ${latest}...`);
35667
+ console.log(`Updating ${PACKAGE_NAME} ${"0.1.6"} \u2192 ${latest}...`);
35652
35668
  (0, import_node_child_process3.execSync)(npmInstallCmd(latest), { stdio: "inherit" });
35653
35669
  console.log(`\x1B[32mUpdated to ${latest}.\x1B[0m`);
35654
35670
  saveUpdateCheck({ lastCheck: Date.now() });
@@ -35798,7 +35814,7 @@ Examples:
35798
35814
  (async () => {
35799
35815
  const [command, ...args] = process.argv.slice(2);
35800
35816
  if (command === "--version" || command === "-v") {
35801
- console.log("0.1.5");
35817
+ console.log("0.1.6");
35802
35818
  return;
35803
35819
  }
35804
35820
  await checkForUpdate();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reporting-bi/cli",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "license": "UNLICENSED",
5
5
  "description": "Reporting.bi CLI — command-line interface for the Reporting.bi platform",
6
6
  "main": "./dist/index.js",