@reporting-bi/cli 0.1.4 → 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 +40 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -10278,8 +10278,21 @@ async function logout(domain2) {
10278
10278
  console.log(`Logged out from ${domain2}.`);
10279
10279
  }
10280
10280
 
10281
+ // src/logo.ts
10282
+ var LOGO = `
10283
+ \x1B[36m\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557
10284
+ \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551
10285
+ \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551
10286
+ \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2550\u255D \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551\u255A\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551
10287
+ \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2551\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551
10288
+ \u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D\x1B[0m`;
10289
+ function printLogo() {
10290
+ console.log(LOGO);
10291
+ }
10292
+
10281
10293
  // src/commands/status.ts
10282
10294
  function status() {
10295
+ printLogo();
10283
10296
  const creds = loadCredentials();
10284
10297
  const local = findLocalConfig();
10285
10298
  const domains = Object.keys(creds.connections);
@@ -11494,8 +11507,24 @@ async function exec2(id, flags) {
11494
11507
  } else if (flags.sql) {
11495
11508
  body = flags.sql;
11496
11509
  }
11497
- const result = await service.post(`exec/${id}`, body, { parseResponse: false });
11498
- 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
+ }
11499
11528
  }
11500
11529
  async function search2(query, flags) {
11501
11530
  const service = await createService("etl");
@@ -35072,7 +35101,7 @@ function text(data) {
35072
35101
  async function mcp() {
35073
35102
  const server = new McpServer({
35074
35103
  name: "reporting-bi",
35075
- version: "0.1.4"
35104
+ version: "0.1.6"
35076
35105
  });
35077
35106
  server.tool(
35078
35107
  "status",
@@ -35618,8 +35647,8 @@ async function checkForUpdate() {
35618
35647
  saveUpdateCheck({ lastCheck: now });
35619
35648
  const latest = await fetchLatestVersion();
35620
35649
  if (!latest) return;
35621
- if (!isNewer(latest, "0.1.4")) return;
35622
- console.log(`\x1B[33mUpdating ${PACKAGE_NAME} ${"0.1.4"} \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`);
35623
35652
  (0, import_node_child_process3.execSync)(npmInstallCmd(latest), { stdio: "inherit" });
35624
35653
  console.log(`\x1B[32mUpdated to ${latest}.\x1B[0m`);
35625
35654
  } catch {
@@ -35631,11 +35660,11 @@ async function forceUpdate() {
35631
35660
  console.error("Could not fetch latest version from npm.");
35632
35661
  process.exit(1);
35633
35662
  }
35634
- if (!isNewer(latest, "0.1.4")) {
35635
- console.log(`Already up to date (${"0.1.4"}).`);
35663
+ if (!isNewer(latest, "0.1.6")) {
35664
+ console.log(`Already up to date (${"0.1.6"}).`);
35636
35665
  return;
35637
35666
  }
35638
- console.log(`Updating ${PACKAGE_NAME} ${"0.1.4"} \u2192 ${latest}...`);
35667
+ console.log(`Updating ${PACKAGE_NAME} ${"0.1.6"} \u2192 ${latest}...`);
35639
35668
  (0, import_node_child_process3.execSync)(npmInstallCmd(latest), { stdio: "inherit" });
35640
35669
  console.log(`\x1B[32mUpdated to ${latest}.\x1B[0m`);
35641
35670
  saveUpdateCheck({ lastCheck: Date.now() });
@@ -35785,7 +35814,7 @@ Examples:
35785
35814
  (async () => {
35786
35815
  const [command, ...args] = process.argv.slice(2);
35787
35816
  if (command === "--version" || command === "-v") {
35788
- console.log("0.1.4");
35817
+ console.log("0.1.6");
35789
35818
  return;
35790
35819
  }
35791
35820
  await checkForUpdate();
@@ -35848,6 +35877,8 @@ Examples:
35848
35877
  init(args);
35849
35878
  break;
35850
35879
  default:
35880
+ printLogo();
35881
+ console.log();
35851
35882
  console.log(USAGE_default);
35852
35883
  break;
35853
35884
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reporting-bi/cli",
3
- "version": "0.1.4",
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",