@autoposting.ai/cli 0.5.0 → 0.5.1

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.
package/dist/cli.cjs CHANGED
@@ -132,7 +132,7 @@ var init_dist = __esm({
132
132
  );
133
133
  }
134
134
  };
135
- VERSION = "0.5.0";
135
+ VERSION = "0.5.1";
136
136
  AutopostingError = class extends Error {
137
137
  status;
138
138
  code;
@@ -2936,6 +2936,10 @@ function createBillingCommand() {
2936
2936
  const client = new Autoposting({ apiKey: cred.apiKey });
2937
2937
  const credits = await client.billing.credits();
2938
2938
  spinner.stop();
2939
+ if (!printer.isTty()) {
2940
+ printer.log(credits);
2941
+ return;
2942
+ }
2939
2943
  printer.table(
2940
2944
  [
2941
2945
  {
@@ -4479,6 +4483,10 @@ function createUsageCommand() {
4479
4483
  const client = new Autoposting({ apiKey: cred.apiKey });
4480
4484
  const summary = await client.usage.summary();
4481
4485
  spinner.stop();
4486
+ if (!printer.isTty()) {
4487
+ printer.log(summary);
4488
+ return;
4489
+ }
4482
4490
  printer.log(`Period: ${summary.range.from.slice(0, 10)} \u2192 ${summary.range.to.slice(0, 10)}`);
4483
4491
  printer.table(
4484
4492
  [