@layr-labs/ecloud-cli 0.3.4 → 0.4.0-dev.0

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 (56) hide show
  1. package/dist/commands/auth/whoami.js +1 -0
  2. package/dist/commands/auth/whoami.js.map +1 -1
  3. package/dist/commands/billing/__tests__/status.test.js +552 -0
  4. package/dist/commands/billing/__tests__/status.test.js.map +1 -0
  5. package/dist/commands/billing/__tests__/subscribe.test.js +580 -0
  6. package/dist/commands/billing/__tests__/subscribe.test.js.map +1 -0
  7. package/dist/commands/billing/__tests__/top-up.test.js +729 -0
  8. package/dist/commands/billing/__tests__/top-up.test.js.map +1 -0
  9. package/dist/commands/billing/cancel.js +8 -7
  10. package/dist/commands/billing/cancel.js.map +1 -1
  11. package/dist/commands/billing/status.js +25 -19
  12. package/dist/commands/billing/status.js.map +1 -1
  13. package/dist/commands/billing/subscribe.js +43 -14
  14. package/dist/commands/billing/subscribe.js.map +1 -1
  15. package/dist/commands/billing/top-up.js +491 -0
  16. package/dist/commands/billing/top-up.js.map +1 -0
  17. package/dist/commands/compute/app/create.js +1 -0
  18. package/dist/commands/compute/app/create.js.map +1 -1
  19. package/dist/commands/compute/app/deploy.js +62 -23
  20. package/dist/commands/compute/app/deploy.js.map +1 -1
  21. package/dist/commands/compute/app/info.js +32 -31
  22. package/dist/commands/compute/app/info.js.map +1 -1
  23. package/dist/commands/compute/app/list.js +31 -30
  24. package/dist/commands/compute/app/list.js.map +1 -1
  25. package/dist/commands/compute/app/logs.js +2 -1
  26. package/dist/commands/compute/app/logs.js.map +1 -1
  27. package/dist/commands/compute/app/profile/set.js +6 -5
  28. package/dist/commands/compute/app/profile/set.js.map +1 -1
  29. package/dist/commands/compute/app/releases.js +18 -17
  30. package/dist/commands/compute/app/releases.js.map +1 -1
  31. package/dist/commands/compute/app/start.js +6 -5
  32. package/dist/commands/compute/app/start.js.map +1 -1
  33. package/dist/commands/compute/app/stop.js +6 -5
  34. package/dist/commands/compute/app/stop.js.map +1 -1
  35. package/dist/commands/compute/app/terminate.js +6 -5
  36. package/dist/commands/compute/app/terminate.js.map +1 -1
  37. package/dist/commands/compute/app/upgrade.js +51 -22
  38. package/dist/commands/compute/app/upgrade.js.map +1 -1
  39. package/dist/commands/compute/build/info.js +16 -15
  40. package/dist/commands/compute/build/info.js.map +1 -1
  41. package/dist/commands/compute/build/list.js +13 -12
  42. package/dist/commands/compute/build/list.js.map +1 -1
  43. package/dist/commands/compute/build/logs.js +4 -3
  44. package/dist/commands/compute/build/logs.js.map +1 -1
  45. package/dist/commands/compute/build/status.js +9 -8
  46. package/dist/commands/compute/build/status.js.map +1 -1
  47. package/dist/commands/compute/build/submit.js +16 -15
  48. package/dist/commands/compute/build/submit.js.map +1 -1
  49. package/dist/commands/compute/build/verify.js +10 -9
  50. package/dist/commands/compute/build/verify.js.map +1 -1
  51. package/dist/commands/compute/environment/set.js +1 -0
  52. package/dist/commands/compute/environment/set.js.map +1 -1
  53. package/dist/commands/compute/undelegate.js +6 -5
  54. package/dist/commands/compute/undelegate.js.map +1 -1
  55. package/package.json +3 -2
  56. package/VERSION +0 -2
@@ -20,6 +20,7 @@ import { getBuildType as getBuildType2 } from "@layr-labs/ecloud-sdk";
20
20
 
21
21
  // src/utils/prompts.ts
22
22
  import { input, select, password, confirm as inquirerConfirm } from "@inquirer/prompts";
23
+ import chalk from "chalk";
23
24
  import fs3 from "fs";
24
25
  import path3 from "path";
25
26
  import os3 from "os";
@@ -227,7 +228,7 @@ async function createBillingClient(flags) {
227
228
  }
228
229
 
229
230
  // src/commands/billing/status.ts
230
- import chalk from "chalk";
231
+ import chalk2 from "chalk";
231
232
 
232
233
  // src/telemetry.ts
233
234
  import {
@@ -312,29 +313,29 @@ var BillingStatus = class _BillingStatus extends Command {
312
313
  const formatStatus = (status) => {
313
314
  switch (status) {
314
315
  case "active":
315
- return `${chalk.green("\u2713 Active")}`;
316
+ return `${chalk2.green("\u2713 Active")}`;
316
317
  case "trialing":
317
- return `${chalk.green("\u2713 Trial")}`;
318
+ return `${chalk2.green("\u2713 Trial")}`;
318
319
  case "past_due":
319
- return `${chalk.yellow("\u26A0 Past Due")}`;
320
+ return `${chalk2.yellow("\u26A0 Past Due")}`;
320
321
  case "canceled":
321
- return `${chalk.red("\u2717 Canceled")}`;
322
+ return `${chalk2.red("\u2717 Canceled")}`;
322
323
  case "inactive":
323
- return `${chalk.gray("\u2717 Inactive")}`;
324
+ return `${chalk2.gray("\u2717 Inactive")}`;
324
325
  case "incomplete":
325
- return `${chalk.yellow("\u26A0 Incomplete")}`;
326
+ return `${chalk2.yellow("\u26A0 Incomplete")}`;
326
327
  case "incomplete_expired":
327
- return `${chalk.red("\u2717 Expired")}`;
328
+ return `${chalk2.red("\u2717 Expired")}`;
328
329
  case "unpaid":
329
- return `${chalk.yellow("\u26A0 Unpaid")}`;
330
+ return `${chalk2.yellow("\u26A0 Unpaid")}`;
330
331
  case "paused":
331
- return `${chalk.yellow("\u26A0 Paused")}`;
332
+ return `${chalk2.yellow("\u26A0 Paused")}`;
332
333
  default:
333
334
  return status;
334
335
  }
335
336
  };
336
337
  this.log(`
337
- ${chalk.bold("Subscription Status:")}`);
338
+ ${chalk2.bold("Subscription Status:")}`);
338
339
  this.log(` Wallet: ${billing.address}`);
339
340
  this.log(` Status: ${formatStatus(result.subscriptionStatus)}`);
340
341
  this.log(` Product: ${result.productId}`);
@@ -345,7 +346,7 @@ ${chalk.bold("Subscription Status:")}`);
345
346
  }
346
347
  if (result.lineItems && result.lineItems.length > 0) {
347
348
  this.log(`
348
- ${chalk.bold(" Line Items:")}`);
349
+ ${chalk2.bold(" Line Items:")}`);
349
350
  for (const item of result.lineItems) {
350
351
  const product = `${flags.product.charAt(0).toUpperCase()}${flags.product.slice(1)}`;
351
352
  const chain = item.description.toLowerCase().includes("sepolia") ? "Sepolia" : "Mainnet";
@@ -356,16 +357,16 @@ ${chalk.bold(" Line Items:")}`);
356
357
  }
357
358
  if (result.creditsApplied !== void 0 && result.creditsApplied > 0) {
358
359
  this.log(`
359
- ${chalk.bold(" Invoice Summary:")}`);
360
+ ${chalk2.bold(" Invoice Summary:")}`);
360
361
  const subtotal = result.upcomingInvoiceSubtotal ?? result.upcomingInvoiceTotal ?? 0;
361
362
  this.log(` Subtotal: $${subtotal.toFixed(2)}`);
362
- this.log(` Credits Applied: ${chalk.green(`-$${result.creditsApplied.toFixed(2)}`)}`);
363
+ this.log(` Credits Applied: ${chalk2.green(`-$${result.creditsApplied.toFixed(2)}`)}`);
363
364
  this.log(` ${"\u2500".repeat(21)}`);
364
365
  this.log(` Total Due: $${(result.upcomingInvoiceTotal ?? 0).toFixed(2)}`);
365
366
  if (result.remainingCredits !== void 0) {
366
367
  this.log(
367
368
  `
368
- ${chalk.bold("Remaining Credits:")} ${chalk.cyan(`$${result.remainingCredits.toFixed(2)}`)}${formatExpiry(result.nextCreditExpiry)}`
369
+ ${chalk2.bold("Remaining Credits:")} ${chalk2.cyan(`$${result.remainingCredits.toFixed(2)}`)}${formatExpiry(result.nextCreditExpiry)}`
369
370
  );
370
371
  }
371
372
  } else if (result.upcomingInvoiceTotal !== void 0) {
@@ -373,13 +374,13 @@ ${chalk.bold(" Invoice Summary:")}`);
373
374
  Upcoming Invoice: $${result.upcomingInvoiceTotal.toFixed(2)}`);
374
375
  if (result.remainingCredits !== void 0 && result.remainingCredits > 0) {
375
376
  this.log(
376
- ` ${chalk.bold("Available Credits:")} ${chalk.cyan(`$${result.remainingCredits.toFixed(2)}`)}${formatExpiry(result.nextCreditExpiry)}`
377
+ ` ${chalk2.bold("Available Credits:")} ${chalk2.cyan(`$${result.remainingCredits.toFixed(2)}`)}${formatExpiry(result.nextCreditExpiry)}`
377
378
  );
378
379
  }
379
380
  }
380
381
  if (result.cancelAtPeriodEnd) {
381
382
  this.log(`
382
- ${chalk.yellow("\u26A0 Subscription will cancel at period end")}`);
383
+ ${chalk2.yellow("\u26A0 Subscription will cancel at period end")}`);
383
384
  }
384
385
  if (result.canceledAt) {
385
386
  const cancelDate = new Date(result.canceledAt).toLocaleDateString();
@@ -387,8 +388,13 @@ ${chalk.bold(" Invoice Summary:")}`);
387
388
  }
388
389
  if (result.portalUrl) {
389
390
  this.log(`
390
- ${chalk.bold("Payment & Invoices:")}`);
391
- this.log(` ${chalk.cyan(result.portalUrl)}`);
391
+ ${chalk2.bold("Payment & Invoices:")}`);
392
+ this.log(` ${chalk2.cyan(result.portalUrl)}`);
393
+ }
394
+ if (result.subscriptionStatus === "inactive" || result.remainingCredits !== void 0 && result.remainingCredits < 10) {
395
+ this.log(`
396
+ ${chalk2.bold("Need more credits?")}`);
397
+ this.log(` Run ${chalk2.cyan("ecloud billing top-up")} to purchase credits.`);
392
398
  }
393
399
  this.log();
394
400
  });