apiblaze 0.4.10 → 0.4.12

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 +15 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -28,7 +28,7 @@ var import_commander = require("commander");
28
28
  var import_chalk28 = __toESM(require("chalk"));
29
29
 
30
30
  // package.json
31
- var version = "0.4.10";
31
+ var version = "0.4.12";
32
32
 
33
33
  // src/types.ts
34
34
  var ApiError = class extends Error {
@@ -3155,17 +3155,24 @@ spec.command("set").description("Replace the stored OpenAPI spec from a local fi
3155
3155
  var HELP_GROUPS = [
3156
3156
  { title: "Chat", commands: ["agent"] },
3157
3157
  { title: "Setup", commands: ["login", "create", "dev", "claim", "team", "whoami", "logout"] },
3158
- { title: "Producer \xB7 your APIs", commands: ["projects", "tenant", "domain", "delete"] },
3159
- { title: "Producer \xB7 change a proxy", commands: ["target", "throttle", "rename", "spec"] },
3160
- { title: "Consumer \xB7 use an API", commands: ["consumer"] }
3158
+ { title: "Control plane commands", commands: ["projects", "tenant", "domain", "delete", "target", "throttle", "rename", "spec"] },
3159
+ { title: "Data plane commands", commands: [
3160
+ { parent: "consumer", sub: "login" },
3161
+ { parent: "consumer", sub: "apikeys" }
3162
+ ] }
3161
3163
  ];
3164
+ var helpLabel = (e) => typeof e === "string" ? e : `${e.parent} ${e.sub}`;
3162
3165
  function groupedCommandHelp() {
3163
3166
  const byName = new Map(program.commands.map((c) => [c.name(), c]));
3164
- const width = Math.max(...HELP_GROUPS.flatMap((g) => g.commands).map((n) => n.length)) + 2;
3167
+ const width = Math.max(...HELP_GROUPS.flatMap((g) => g.commands).map((e) => helpLabel(e).length)) + 2;
3165
3168
  return HELP_GROUPS.map((g) => {
3166
- const rows = g.commands.map((n) => {
3167
- const c = byName.get(n);
3168
- return c ? ` ${n.padEnd(width)}${c.description()}` : "";
3169
+ const rows = g.commands.map((e) => {
3170
+ if (typeof e === "string") {
3171
+ const c = byName.get(e);
3172
+ return c ? ` ${e.padEnd(width)}${c.description()}` : "";
3173
+ }
3174
+ const sub = byName.get(e.parent)?.commands.find((s) => s.name() === e.sub);
3175
+ return sub ? ` ${helpLabel(e).padEnd(width)}${sub.description()}` : "";
3169
3176
  }).filter(Boolean).join("\n");
3170
3177
  return `${import_chalk28.default.bold(g.title)}
3171
3178
  ${rows}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apiblaze",
3
- "version": "0.4.10",
3
+ "version": "0.4.12",
4
4
  "description": "Dev tunnel CLI for APIblaze — route localhost projects through your APIblaze endpoints",
5
5
  "keywords": [
6
6
  "apiblaze",