run402 3.7.7 → 3.7.8

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/cli.mjs CHANGED
@@ -330,8 +330,8 @@ switch (cmd) {
330
330
  break;
331
331
  }
332
332
  case "webhook-secret": {
333
- const { runWebhookSecret } = await import("./lib/notifications.mjs");
334
- await runWebhookSecret(sub, rest);
333
+ const { run } = await import("./lib/webhook-secret.mjs");
334
+ await run(sub, rest);
335
335
  break;
336
336
  }
337
337
  case "logs": {
package/lib/archives.mjs CHANGED
@@ -23,7 +23,12 @@ export async function run(sub, rawArgs = []) {
23
23
  case "inspect": return inspect(rawArgs);
24
24
  case "verify": return verify(rawArgs);
25
25
  default:
26
- fail({ code: "BAD_USAGE", message: "Usage: run402 archives <inspect|verify> <archive-path> [--json]" });
26
+ fail({
27
+ code: "UNKNOWN_SUBCOMMAND",
28
+ message: `Unknown archives subcommand: ${sub}`,
29
+ hint: "Run `run402 archives --help` for usage.",
30
+ details: { command: "archives", subcommand: sub },
31
+ });
27
32
  }
28
33
  }
29
34
 
package/lib/cache.mjs CHANGED
@@ -100,8 +100,10 @@ export async function run(sub, args) {
100
100
  break;
101
101
  default:
102
102
  fail({
103
- code: "BAD_USAGE",
103
+ code: "UNKNOWN_SUBCOMMAND",
104
104
  message: `Unknown cache subcommand: ${sub}`,
105
+ hint: "Run `run402 cache --help` for usage.",
106
+ details: { command: "cache", subcommand: sub },
105
107
  next_actions: [editRequestAction("run402 cache --help", "Choose a supported cache subcommand.")],
106
108
  });
107
109
  }
package/lib/cloud.mjs CHANGED
@@ -56,8 +56,10 @@ export async function run(sub, args = []) {
56
56
  }
57
57
  if (sub !== "archives") {
58
58
  fail({
59
- code: "BAD_USAGE",
60
- message: "Usage: run402 cloud archives <create|download|status> ...",
59
+ code: "UNKNOWN_SUBCOMMAND",
60
+ message: `Unknown cloud subcommand: ${sub}`,
61
+ hint: "Run `run402 cloud --help` for usage.",
62
+ details: { command: "cloud", subcommand: sub },
61
63
  next_actions: [{ type: "run_command", command: "run402 cloud archives --help" }],
62
64
  });
63
65
  }
@@ -67,8 +69,10 @@ export async function run(sub, args = []) {
67
69
  if (action === "download") return download(rest);
68
70
  if (action === "status") return status(rest);
69
71
  fail({
70
- code: "BAD_USAGE",
71
- message: "Usage: run402 cloud archives <create|download|status> ...",
72
+ code: "UNKNOWN_SUBCOMMAND",
73
+ message: `Unknown cloud archives subcommand: ${action}`,
74
+ hint: "Run `run402 cloud archives --help` for usage.",
75
+ details: { command: "cloud archives", subcommand: action },
72
76
  next_actions: [{ type: "run_command", command: "run402 cloud archives --help" }],
73
77
  });
74
78
  }
package/lib/core.mjs CHANGED
@@ -28,11 +28,21 @@ export async function run(sub, args = []) {
28
28
  return;
29
29
  }
30
30
  if (sub !== "projects") {
31
- fail({ code: "BAD_USAGE", message: "Usage: run402 core projects import <archive-path> [options]" });
31
+ fail({
32
+ code: "UNKNOWN_SUBCOMMAND",
33
+ message: `Unknown core subcommand: ${sub}`,
34
+ hint: "Run `run402 core --help` for usage.",
35
+ details: { command: "core", subcommand: sub },
36
+ });
32
37
  }
33
38
  const action = args[0];
34
39
  if (action === "import") return importProject(args.slice(1));
35
- fail({ code: "BAD_USAGE", message: "Usage: run402 core projects import <archive-path> [options]" });
40
+ fail({
41
+ code: "UNKNOWN_SUBCOMMAND",
42
+ message: `Unknown core projects subcommand: ${action}`,
43
+ hint: "Run `run402 core projects --help` for usage.",
44
+ details: { command: "core projects", subcommand: action },
45
+ });
36
46
  }
37
47
 
38
48
  async function importProject(rawArgs) {
@@ -166,7 +166,12 @@ export async function run(sub, args) {
166
166
  await test(args);
167
167
  return;
168
168
  default:
169
- fail({ code: "BAD_USAGE", message: `Unknown notifications subcommand: ${sub}\n\n${HELP}` });
169
+ fail({
170
+ code: "UNKNOWN_SUBCOMMAND",
171
+ message: `Unknown notifications subcommand: ${sub}`,
172
+ hint: "Run `run402 notifications --help` for usage.",
173
+ details: { command: "notifications", subcommand: sub },
174
+ });
170
175
  }
171
176
  }
172
177
 
package/lib/operator.mjs CHANGED
@@ -767,9 +767,10 @@ export async function run(sub, args = []) {
767
767
  break;
768
768
  default:
769
769
  fail({
770
- code: "BAD_USAGE",
771
- message: `Unknown subcommand: operator ${sub}`,
772
- hint: "Run 'run402 operator --help' for usage.",
770
+ code: "UNKNOWN_SUBCOMMAND",
771
+ message: `Unknown operator subcommand: ${sub}`,
772
+ hint: "Run `run402 operator --help` for usage.",
773
+ details: { command: "operator", subcommand: sub },
773
774
  });
774
775
  }
775
776
  }
package/lib/wallets.mjs CHANGED
@@ -339,6 +339,11 @@ export async function run(sub, args = []) {
339
339
  case "import": return cmdImport(rest);
340
340
  case "rm": return cmdRm(rest);
341
341
  default:
342
- fail({ code: "BAD_USAGE", message: `Unknown wallets subcommand: ${sub}`, hint: "run402 wallets --help" });
342
+ fail({
343
+ code: "UNKNOWN_SUBCOMMAND",
344
+ message: `Unknown wallets subcommand: ${sub}`,
345
+ hint: "Run `run402 wallets --help` for usage.",
346
+ details: { command: "wallets", subcommand: sub },
347
+ });
343
348
  }
344
349
  }
@@ -28,7 +28,12 @@ export async function run(sub, args = []) {
28
28
  process.exit(0);
29
29
  }
30
30
  if (sub !== "rotate") {
31
- fail({ code: "BAD_USAGE", message: "Usage: run402 webhook-secret rotate" });
31
+ fail({
32
+ code: "UNKNOWN_SUBCOMMAND",
33
+ message: `Unknown webhook-secret subcommand: ${sub}`,
34
+ hint: "Run `run402 webhook-secret --help` for usage.",
35
+ details: { command: "webhook-secret", subcommand: sub },
36
+ });
32
37
  }
33
38
  const parsedArgs = normalizeArgv(args);
34
39
  assertKnownFlags(parsedArgs, ["--help", "-h"]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "run402",
3
- "version": "3.7.7",
3
+ "version": "3.7.8",
4
4
  "description": "CLI for Run402 — provision Postgres databases, deploy static sites, generate images, and manage wallets via x402 and MPP micropayments.",
5
5
  "type": "module",
6
6
  "bin": {