@lukoweb/apitogo 0.1.120 → 0.1.121

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/cli/cli.js +128 -1
  2. package/package.json +1 -1
package/dist/cli/cli.js CHANGED
@@ -5802,7 +5802,7 @@ import {
5802
5802
  // package.json
5803
5803
  var package_default = {
5804
5804
  name: "@lukoweb/apitogo",
5805
- version: "0.1.120",
5805
+ version: "0.1.121",
5806
5806
  type: "module",
5807
5807
  sideEffects: [
5808
5808
  "**/*.css",
@@ -21439,6 +21439,133 @@ async function handleVerifyDevPortalLive(client, config2, args) {
21439
21439
  );
21440
21440
  }
21441
21441
 
21442
+ // src/cli/apply/human-output.ts
21443
+ function formatSucceededResultForHuman(parsed) {
21444
+ const lines = [
21445
+ typeof parsed.message === "string" ? parsed.message : "Deploy succeeded."
21446
+ ];
21447
+ const siteUrl = typeof parsed.siteUrl === "string" ? parsed.siteUrl : void 0;
21448
+ if (siteUrl) lines.push(` Site: ${siteUrl}`);
21449
+ const gatewayUrl = typeof parsed.gatewayUrl === "string" ? parsed.gatewayUrl : void 0;
21450
+ if (gatewayUrl) lines.push(` Gateway: ${gatewayUrl}`);
21451
+ const backendFqdn = typeof parsed.backendFqdn === "string" ? parsed.backendFqdn : void 0;
21452
+ if (backendFqdn) lines.push(` Backend: ${backendFqdn}`);
21453
+ if (Array.isArray(parsed.plans)) {
21454
+ lines.push(` Plans: ${parsed.plans.length}`);
21455
+ }
21456
+ const validation = parsed.validation;
21457
+ if (validation && validation.passed === false) {
21458
+ lines.push("", "Live checks did not all pass yet:");
21459
+ for (const warning of validation.warnings ?? []) {
21460
+ lines.push(` - ${warning}`);
21461
+ }
21462
+ lines.push(
21463
+ "Run `apitogo status` to re-check once the platform finishes setting up."
21464
+ );
21465
+ }
21466
+ const checklist = parsed.postPublishChecklist;
21467
+ if (Array.isArray(checklist) && checklist.length > 0) {
21468
+ lines.push("", "Post-publish checklist:");
21469
+ for (const item of checklist) {
21470
+ if (typeof item.label !== "string") continue;
21471
+ const marker = item.required === false ? "-" : "*";
21472
+ const url2 = typeof item.url === "string" && item.url ? ` (${item.url})` : "";
21473
+ lines.push(` ${marker} ${item.label}${url2}`);
21474
+ }
21475
+ }
21476
+ if (typeof parsed.userMessage === "string" && parsed.userMessage) {
21477
+ lines.push("", parsed.userMessage);
21478
+ }
21479
+ if (typeof parsed.recoveryHint === "string" && parsed.recoveryHint) {
21480
+ lines.push("", parsed.recoveryHint);
21481
+ }
21482
+ if (Array.isArray(parsed.warnings) && parsed.warnings.length > 0) {
21483
+ lines.push("", "Warnings:");
21484
+ for (const warning of parsed.warnings) {
21485
+ if (typeof warning === "string") lines.push(` - ${warning}`);
21486
+ }
21487
+ }
21488
+ lines.push(
21489
+ "",
21490
+ "Run `apitogo deploy --json` to see the full report (checks, timings, plan details) as data."
21491
+ );
21492
+ return lines;
21493
+ }
21494
+ function formatBlockedOrFailedResultForHuman(parsed) {
21495
+ const status2 = parsed.status;
21496
+ if (status2 === "blocked" && parsed.reason === "platform_plan_unselected") {
21497
+ const lines = [
21498
+ "Deploy is blocked: this project doesn't have an API ToGo platform hosting plan yet."
21499
+ ];
21500
+ if (typeof parsed.freeProjectsQuotaHint === "string") {
21501
+ lines.push(parsed.freeProjectsQuotaHint);
21502
+ }
21503
+ lines.push(
21504
+ "Pick a plan and re-run:",
21505
+ " apitogo deploy --platform-plan free",
21506
+ " apitogo deploy --platform-plan starter",
21507
+ " apitogo deploy --platform-plan professional",
21508
+ "Run `apitogo deploy --json` to see full plan details (pricing, limits) as data."
21509
+ );
21510
+ return lines;
21511
+ }
21512
+ if (status2 === "blocked" && parsed.reason === "project_not_found") {
21513
+ const projectId = typeof parsed.projectId === "string" ? parsed.projectId : void 0;
21514
+ const lines = [
21515
+ typeof parsed.userMessage === "string" ? parsed.userMessage : `Deploy is blocked: project${projectId ? ` ${projectId}` : ""} was not found.`
21516
+ ];
21517
+ lines.push(
21518
+ "This usually means the project was deleted, or it belongs to a different account than the one you're logged in as.",
21519
+ "",
21520
+ "To fix this:",
21521
+ " Run `apitogo login` and confirm you're using the right account, then re-run `apitogo deploy`",
21522
+ ' Or create a new project: remove "projectId" from apitogo.config.json and re-run `apitogo deploy`'
21523
+ );
21524
+ return lines;
21525
+ }
21526
+ if (status2 === "blocked" && parsed.reason === "paid_gateway_plans_require_starter") {
21527
+ const lines = [];
21528
+ lines.push(
21529
+ typeof parsed.userMessage === "string" ? parsed.userMessage : "Deploy is blocked: your Free platform plan can't host paid API plans."
21530
+ );
21531
+ lines.push(
21532
+ "Choose one:",
21533
+ " apitogo deploy --platform-plan starter # or professional, to keep the paid plans",
21534
+ " Edit apitogo.config.json to remove those plans or set their price to 0, then re-run apitogo deploy"
21535
+ );
21536
+ return lines;
21537
+ }
21538
+ if (status2 === "blocked") {
21539
+ return [
21540
+ typeof parsed.userMessage === "string" ? parsed.userMessage : `Deploy is blocked${typeof parsed.reason === "string" ? `: ${parsed.reason}` : "."}`
21541
+ ];
21542
+ }
21543
+ if (status2 === "failed") {
21544
+ const lines = [
21545
+ `Deploy failed${typeof parsed.failedStep === "string" ? ` at step "${parsed.failedStep}"` : ""}.`
21546
+ ];
21547
+ if (typeof parsed.error === "string") {
21548
+ lines.push(parsed.error);
21549
+ }
21550
+ if (typeof parsed.recoveryHint === "string") {
21551
+ lines.push(parsed.recoveryHint);
21552
+ }
21553
+ if (typeof parsed.failedStep === "string") {
21554
+ lines.push(
21555
+ `To retry from there: apitogo deploy --resume-from ${parsed.failedStep}`
21556
+ );
21557
+ }
21558
+ return lines;
21559
+ }
21560
+ return [];
21561
+ }
21562
+ function formatResultForHuman(parsed) {
21563
+ if (parsed.status === "succeeded") {
21564
+ return formatSucceededResultForHuman(parsed);
21565
+ }
21566
+ return formatBlockedOrFailedResultForHuman(parsed);
21567
+ }
21568
+
21442
21569
  // src/cli/apply/platform-plan-prompt.ts
21443
21570
  import { stdin as input3, stdout as output2 } from "node:process";
21444
21571
  import { createInterface as createInterface2 } from "node:readline/promises";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lukoweb/apitogo",
3
- "version": "0.1.120",
3
+ "version": "0.1.121",
4
4
  "type": "module",
5
5
  "sideEffects": [
6
6
  "**/*.css",