@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.
- package/dist/commands/auth/whoami.js +1 -0
- package/dist/commands/auth/whoami.js.map +1 -1
- package/dist/commands/billing/__tests__/status.test.js +552 -0
- package/dist/commands/billing/__tests__/status.test.js.map +1 -0
- package/dist/commands/billing/__tests__/subscribe.test.js +580 -0
- package/dist/commands/billing/__tests__/subscribe.test.js.map +1 -0
- package/dist/commands/billing/__tests__/top-up.test.js +729 -0
- package/dist/commands/billing/__tests__/top-up.test.js.map +1 -0
- package/dist/commands/billing/cancel.js +8 -7
- package/dist/commands/billing/cancel.js.map +1 -1
- package/dist/commands/billing/status.js +25 -19
- package/dist/commands/billing/status.js.map +1 -1
- package/dist/commands/billing/subscribe.js +43 -14
- package/dist/commands/billing/subscribe.js.map +1 -1
- package/dist/commands/billing/top-up.js +491 -0
- package/dist/commands/billing/top-up.js.map +1 -0
- package/dist/commands/compute/app/create.js +1 -0
- package/dist/commands/compute/app/create.js.map +1 -1
- package/dist/commands/compute/app/deploy.js +62 -23
- package/dist/commands/compute/app/deploy.js.map +1 -1
- package/dist/commands/compute/app/info.js +32 -31
- package/dist/commands/compute/app/info.js.map +1 -1
- package/dist/commands/compute/app/list.js +31 -30
- package/dist/commands/compute/app/list.js.map +1 -1
- package/dist/commands/compute/app/logs.js +2 -1
- package/dist/commands/compute/app/logs.js.map +1 -1
- package/dist/commands/compute/app/profile/set.js +6 -5
- package/dist/commands/compute/app/profile/set.js.map +1 -1
- package/dist/commands/compute/app/releases.js +18 -17
- package/dist/commands/compute/app/releases.js.map +1 -1
- package/dist/commands/compute/app/start.js +6 -5
- package/dist/commands/compute/app/start.js.map +1 -1
- package/dist/commands/compute/app/stop.js +6 -5
- package/dist/commands/compute/app/stop.js.map +1 -1
- package/dist/commands/compute/app/terminate.js +6 -5
- package/dist/commands/compute/app/terminate.js.map +1 -1
- package/dist/commands/compute/app/upgrade.js +51 -22
- package/dist/commands/compute/app/upgrade.js.map +1 -1
- package/dist/commands/compute/build/info.js +16 -15
- package/dist/commands/compute/build/info.js.map +1 -1
- package/dist/commands/compute/build/list.js +13 -12
- package/dist/commands/compute/build/list.js.map +1 -1
- package/dist/commands/compute/build/logs.js +4 -3
- package/dist/commands/compute/build/logs.js.map +1 -1
- package/dist/commands/compute/build/status.js +9 -8
- package/dist/commands/compute/build/status.js.map +1 -1
- package/dist/commands/compute/build/submit.js +16 -15
- package/dist/commands/compute/build/submit.js.map +1 -1
- package/dist/commands/compute/build/verify.js +10 -9
- package/dist/commands/compute/build/verify.js.map +1 -1
- package/dist/commands/compute/environment/set.js +1 -0
- package/dist/commands/compute/environment/set.js.map +1 -1
- package/dist/commands/compute/undelegate.js +6 -5
- package/dist/commands/compute/undelegate.js.map +1 -1
- package/package.json +3 -2
- 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
|
|
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 `${
|
|
316
|
+
return `${chalk2.green("\u2713 Active")}`;
|
|
316
317
|
case "trialing":
|
|
317
|
-
return `${
|
|
318
|
+
return `${chalk2.green("\u2713 Trial")}`;
|
|
318
319
|
case "past_due":
|
|
319
|
-
return `${
|
|
320
|
+
return `${chalk2.yellow("\u26A0 Past Due")}`;
|
|
320
321
|
case "canceled":
|
|
321
|
-
return `${
|
|
322
|
+
return `${chalk2.red("\u2717 Canceled")}`;
|
|
322
323
|
case "inactive":
|
|
323
|
-
return `${
|
|
324
|
+
return `${chalk2.gray("\u2717 Inactive")}`;
|
|
324
325
|
case "incomplete":
|
|
325
|
-
return `${
|
|
326
|
+
return `${chalk2.yellow("\u26A0 Incomplete")}`;
|
|
326
327
|
case "incomplete_expired":
|
|
327
|
-
return `${
|
|
328
|
+
return `${chalk2.red("\u2717 Expired")}`;
|
|
328
329
|
case "unpaid":
|
|
329
|
-
return `${
|
|
330
|
+
return `${chalk2.yellow("\u26A0 Unpaid")}`;
|
|
330
331
|
case "paused":
|
|
331
|
-
return `${
|
|
332
|
+
return `${chalk2.yellow("\u26A0 Paused")}`;
|
|
332
333
|
default:
|
|
333
334
|
return status;
|
|
334
335
|
}
|
|
335
336
|
};
|
|
336
337
|
this.log(`
|
|
337
|
-
${
|
|
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
|
-
${
|
|
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
|
-
${
|
|
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: ${
|
|
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
|
-
${
|
|
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
|
-
` ${
|
|
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
|
-
${
|
|
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
|
-
${
|
|
391
|
-
this.log(` ${
|
|
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
|
});
|