run402 1.35.4 → 1.36.1

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/lib/webhooks.mjs CHANGED
@@ -21,6 +21,47 @@ Examples:
21
21
  run402 email webhooks delete whk_123
22
22
  `;
23
23
 
24
+ const SUB_HELP = {
25
+ update: `run402 email webhooks update — Update an existing webhook
26
+
27
+ Usage:
28
+ run402 email webhooks update <webhook_id> [--url <url>] [--events <e1,e2>] [--project <id>]
29
+
30
+ Arguments:
31
+ <webhook_id> Webhook ID to update
32
+
33
+ Options:
34
+ --url <url> New delivery URL for the webhook
35
+ --events <e1,e2> Comma-separated event list to replace the current events
36
+ Valid: delivery, bounced, complained, reply_received
37
+ --project <id> Project ID (defaults to the active project)
38
+
39
+ Notes:
40
+ - Provide at least one of --url or --events
41
+
42
+ Examples:
43
+ run402 email webhooks update whk_123 --url https://new.example.com/hook
44
+ run402 email webhooks update whk_123 --events delivery,bounced
45
+ `,
46
+ register: `run402 email webhooks register — Register a new webhook
47
+
48
+ Usage:
49
+ run402 email webhooks register --url <url> --events <e1,e2> [--project <id>]
50
+
51
+ Options:
52
+ --url <url> Delivery URL for the webhook (required)
53
+ --events <e1,e2> Comma-separated event list (required)
54
+ Valid: delivery, bounced, complained, reply_received
55
+ --project <id> Project ID (defaults to the active project)
56
+
57
+ Examples:
58
+ run402 email webhooks register --url https://example.com/hook \\
59
+ --events delivery,bounced
60
+ run402 email webhooks register --url https://example.com/hook \\
61
+ --events reply_received --project proj123
62
+ `,
63
+ };
64
+
24
65
  function parseFlag(args, flag) {
25
66
  for (let i = 0; i < args.length; i++) {
26
67
  if (args[i] === flag && args[i + 1]) return args[i + 1];
@@ -207,6 +248,7 @@ async function register(args) {
207
248
 
208
249
  export async function run(sub, args) {
209
250
  if (!sub || sub === '--help' || sub === '-h') { console.log(HELP); process.exit(0); }
251
+ if (Array.isArray(args) && (args.includes("--help") || args.includes("-h"))) { console.log(SUB_HELP[sub] || HELP); process.exit(0); }
210
252
  switch (sub) {
211
253
  case "list": await list(args); break;
212
254
  case "get": await get(args); break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "run402",
3
- "version": "1.35.4",
3
+ "version": "1.36.1",
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": {