@agentuity/cli 1.0.22 → 1.0.24
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/auth.d.ts.map +1 -1
- package/dist/auth.js +7 -0
- package/dist/auth.js.map +1 -1
- package/dist/cache/resource-region.d.ts +1 -1
- package/dist/cache/resource-region.d.ts.map +1 -1
- package/dist/cache/resource-region.js.map +1 -1
- package/dist/cmd/ai/claude-code/install.d.ts.map +1 -1
- package/dist/cmd/ai/claude-code/install.js +0 -1
- package/dist/cmd/ai/claude-code/install.js.map +1 -1
- package/dist/cmd/build/vite/public-asset-path-plugin.d.ts +4 -2
- package/dist/cmd/build/vite/public-asset-path-plugin.d.ts.map +1 -1
- package/dist/cmd/build/vite/public-asset-path-plugin.js +18 -4
- package/dist/cmd/build/vite/public-asset-path-plugin.js.map +1 -1
- package/dist/cmd/cloud/db/index.d.ts.map +1 -1
- package/dist/cmd/cloud/db/index.js +2 -0
- package/dist/cmd/cloud/db/index.js.map +1 -1
- package/dist/cmd/cloud/db/stats.d.ts +3 -0
- package/dist/cmd/cloud/db/stats.d.ts.map +1 -0
- package/dist/cmd/cloud/db/stats.js +66 -0
- package/dist/cmd/cloud/db/stats.js.map +1 -0
- package/dist/cmd/cloud/email/create.d.ts +3 -0
- package/dist/cmd/cloud/email/create.d.ts.map +1 -0
- package/dist/cmd/cloud/email/create.js +66 -0
- package/dist/cmd/cloud/email/create.js.map +1 -0
- package/dist/cmd/cloud/email/delete.d.ts +3 -0
- package/dist/cmd/cloud/email/delete.d.ts.map +1 -0
- package/dist/cmd/cloud/email/delete.js +47 -0
- package/dist/cmd/cloud/email/delete.js.map +1 -0
- package/dist/cmd/cloud/email/destination/delete.d.ts +3 -0
- package/dist/cmd/cloud/email/destination/delete.d.ts.map +1 -0
- package/dist/cmd/cloud/email/destination/delete.js +54 -0
- package/dist/cmd/cloud/email/destination/delete.js.map +1 -0
- package/dist/cmd/cloud/email/destination/index.d.ts +3 -0
- package/dist/cmd/cloud/email/destination/index.d.ts.map +1 -0
- package/dist/cmd/cloud/email/destination/index.js +14 -0
- package/dist/cmd/cloud/email/destination/index.js.map +1 -0
- package/dist/cmd/cloud/email/destination/list.d.ts +3 -0
- package/dist/cmd/cloud/email/destination/list.d.ts.map +1 -0
- package/dist/cmd/cloud/email/destination/list.js +39 -0
- package/dist/cmd/cloud/email/destination/list.js.map +1 -0
- package/dist/cmd/cloud/email/destination/schemas.d.ts +9 -0
- package/dist/cmd/cloud/email/destination/schemas.d.ts.map +1 -0
- package/dist/cmd/cloud/email/destination/schemas.js +9 -0
- package/dist/cmd/cloud/email/destination/schemas.js.map +1 -0
- package/dist/cmd/cloud/email/destination/url.d.ts +3 -0
- package/dist/cmd/cloud/email/destination/url.d.ts.map +1 -0
- package/dist/cmd/cloud/email/destination/url.js +65 -0
- package/dist/cmd/cloud/email/destination/url.js.map +1 -0
- package/dist/cmd/cloud/email/get.d.ts +3 -0
- package/dist/cmd/cloud/email/get.d.ts.map +1 -0
- package/dist/cmd/cloud/email/get.js +43 -0
- package/dist/cmd/cloud/email/get.js.map +1 -0
- package/dist/cmd/cloud/email/inbound/get.d.ts +3 -0
- package/dist/cmd/cloud/email/inbound/get.d.ts.map +1 -0
- package/dist/cmd/cloud/email/inbound/get.js +43 -0
- package/dist/cmd/cloud/email/inbound/get.js.map +1 -0
- package/dist/cmd/cloud/email/inbound/index.d.ts +3 -0
- package/dist/cmd/cloud/email/inbound/index.d.ts.map +1 -0
- package/dist/cmd/cloud/email/inbound/index.js +12 -0
- package/dist/cmd/cloud/email/inbound/index.js.map +1 -0
- package/dist/cmd/cloud/email/inbound/list.d.ts +3 -0
- package/dist/cmd/cloud/email/inbound/list.d.ts.map +1 -0
- package/dist/cmd/cloud/email/inbound/list.js +41 -0
- package/dist/cmd/cloud/email/inbound/list.js.map +1 -0
- package/dist/cmd/cloud/email/inbound/schemas.d.ts +13 -0
- package/dist/cmd/cloud/email/inbound/schemas.d.ts.map +1 -0
- package/dist/cmd/cloud/email/inbound/schemas.js +13 -0
- package/dist/cmd/cloud/email/inbound/schemas.js.map +1 -0
- package/dist/cmd/cloud/email/index.d.ts +3 -0
- package/dist/cmd/cloud/email/index.d.ts.map +1 -0
- package/dist/cmd/cloud/email/index.js +30 -0
- package/dist/cmd/cloud/email/index.js.map +1 -0
- package/dist/cmd/cloud/email/list.d.ts +3 -0
- package/dist/cmd/cloud/email/list.d.ts.map +1 -0
- package/dist/cmd/cloud/email/list.js +44 -0
- package/dist/cmd/cloud/email/list.js.map +1 -0
- package/dist/cmd/cloud/email/outbound/get.d.ts +3 -0
- package/dist/cmd/cloud/email/outbound/get.d.ts.map +1 -0
- package/dist/cmd/cloud/email/outbound/get.js +45 -0
- package/dist/cmd/cloud/email/outbound/get.js.map +1 -0
- package/dist/cmd/cloud/email/outbound/index.d.ts +3 -0
- package/dist/cmd/cloud/email/outbound/index.d.ts.map +1 -0
- package/dist/cmd/cloud/email/outbound/index.js +12 -0
- package/dist/cmd/cloud/email/outbound/index.js.map +1 -0
- package/dist/cmd/cloud/email/outbound/list.d.ts +3 -0
- package/dist/cmd/cloud/email/outbound/list.d.ts.map +1 -0
- package/dist/cmd/cloud/email/outbound/list.js +43 -0
- package/dist/cmd/cloud/email/outbound/list.js.map +1 -0
- package/dist/cmd/cloud/email/outbound/schemas.d.ts +15 -0
- package/dist/cmd/cloud/email/outbound/schemas.d.ts.map +1 -0
- package/dist/cmd/cloud/email/outbound/schemas.js +15 -0
- package/dist/cmd/cloud/email/outbound/schemas.js.map +1 -0
- package/dist/cmd/cloud/email/send.d.ts +3 -0
- package/dist/cmd/cloud/email/send.d.ts.map +1 -0
- package/dist/cmd/cloud/email/send.js +75 -0
- package/dist/cmd/cloud/email/send.js.map +1 -0
- package/dist/cmd/cloud/email/stats.d.ts +3 -0
- package/dist/cmd/cloud/email/stats.d.ts.map +1 -0
- package/dist/cmd/cloud/email/stats.js +65 -0
- package/dist/cmd/cloud/email/stats.js.map +1 -0
- package/dist/cmd/cloud/email/util.d.ts +23 -0
- package/dist/cmd/cloud/email/util.d.ts.map +1 -0
- package/dist/cmd/cloud/email/util.js +42 -0
- package/dist/cmd/cloud/email/util.js.map +1 -0
- package/dist/cmd/cloud/index.d.ts.map +1 -1
- package/dist/cmd/cloud/index.js +10 -0
- package/dist/cmd/cloud/index.js.map +1 -1
- package/dist/cmd/cloud/queue/get.js +4 -4
- package/dist/cmd/cloud/queue/get.js.map +1 -1
- package/dist/cmd/cloud/queue/receive.d.ts.map +1 -1
- package/dist/cmd/cloud/queue/receive.js +11 -7
- package/dist/cmd/cloud/queue/receive.js.map +1 -1
- package/dist/cmd/cloud/queue/stats.js +3 -3
- package/dist/cmd/cloud/queue/stats.js.map +1 -1
- package/dist/cmd/cloud/region-lookup.d.ts +1 -1
- package/dist/cmd/cloud/region-lookup.d.ts.map +1 -1
- package/dist/cmd/cloud/region-lookup.js +44 -2
- package/dist/cmd/cloud/region-lookup.js.map +1 -1
- package/dist/cmd/cloud/sandbox/checkpoint/create.d.ts +3 -0
- package/dist/cmd/cloud/sandbox/checkpoint/create.d.ts.map +1 -0
- package/dist/cmd/cloud/sandbox/checkpoint/create.js +71 -0
- package/dist/cmd/cloud/sandbox/checkpoint/create.js.map +1 -0
- package/dist/cmd/cloud/sandbox/checkpoint/delete.d.ts +3 -0
- package/dist/cmd/cloud/sandbox/checkpoint/delete.d.ts.map +1 -0
- package/dist/cmd/cloud/sandbox/checkpoint/delete.js +78 -0
- package/dist/cmd/cloud/sandbox/checkpoint/delete.js.map +1 -0
- package/dist/cmd/cloud/sandbox/checkpoint/index.d.ts +2 -0
- package/dist/cmd/cloud/sandbox/checkpoint/index.d.ts.map +1 -0
- package/dist/cmd/cloud/sandbox/checkpoint/index.js +33 -0
- package/dist/cmd/cloud/sandbox/checkpoint/index.js.map +1 -0
- package/dist/cmd/cloud/sandbox/checkpoint/list.d.ts +3 -0
- package/dist/cmd/cloud/sandbox/checkpoint/list.d.ts.map +1 -0
- package/dist/cmd/cloud/sandbox/checkpoint/list.js +72 -0
- package/dist/cmd/cloud/sandbox/checkpoint/list.js.map +1 -0
- package/dist/cmd/cloud/sandbox/checkpoint/restore.d.ts +3 -0
- package/dist/cmd/cloud/sandbox/checkpoint/restore.d.ts.map +1 -0
- package/dist/cmd/cloud/sandbox/checkpoint/restore.js +61 -0
- package/dist/cmd/cloud/sandbox/checkpoint/restore.js.map +1 -0
- package/dist/cmd/cloud/sandbox/get.d.ts.map +1 -1
- package/dist/cmd/cloud/sandbox/get.js +5 -3
- package/dist/cmd/cloud/sandbox/get.js.map +1 -1
- package/dist/cmd/cloud/sandbox/index.d.ts.map +1 -1
- package/dist/cmd/cloud/sandbox/index.js +4 -0
- package/dist/cmd/cloud/sandbox/index.js.map +1 -1
- package/dist/cmd/cloud/sandbox/snapshot/build.d.ts +7 -0
- package/dist/cmd/cloud/sandbox/snapshot/build.d.ts.map +1 -1
- package/dist/cmd/cloud/sandbox/snapshot/build.js +55 -37
- package/dist/cmd/cloud/sandbox/snapshot/build.js.map +1 -1
- package/dist/cmd/cloud/sandbox/snapshot/generate.d.ts.map +1 -1
- package/dist/cmd/cloud/sandbox/snapshot/generate.js +5 -1
- package/dist/cmd/cloud/sandbox/snapshot/generate.js.map +1 -1
- package/dist/cmd/cloud/sandbox/snapshot/get.js +3 -3
- package/dist/cmd/cloud/sandbox/snapshot/get.js.map +1 -1
- package/dist/cmd/cloud/sandbox/stats.d.ts +3 -0
- package/dist/cmd/cloud/sandbox/stats.d.ts.map +1 -0
- package/dist/cmd/cloud/sandbox/stats.js +72 -0
- package/dist/cmd/cloud/sandbox/stats.js.map +1 -0
- package/dist/cmd/cloud/schedule/create.d.ts +3 -0
- package/dist/cmd/cloud/schedule/create.d.ts.map +1 -0
- package/dist/cmd/cloud/schedule/create.js +71 -0
- package/dist/cmd/cloud/schedule/create.js.map +1 -0
- package/dist/cmd/cloud/schedule/delete.d.ts +3 -0
- package/dist/cmd/cloud/schedule/delete.d.ts.map +1 -0
- package/dist/cmd/cloud/schedule/delete.js +37 -0
- package/dist/cmd/cloud/schedule/delete.js.map +1 -0
- package/dist/cmd/cloud/schedule/delivery/get.d.ts +3 -0
- package/dist/cmd/cloud/schedule/delivery/get.d.ts.map +1 -0
- package/dist/cmd/cloud/schedule/delivery/get.js +77 -0
- package/dist/cmd/cloud/schedule/delivery/get.js.map +1 -0
- package/dist/cmd/cloud/schedule/delivery/index.d.ts +3 -0
- package/dist/cmd/cloud/schedule/delivery/index.d.ts.map +1 -0
- package/dist/cmd/cloud/schedule/delivery/index.js +23 -0
- package/dist/cmd/cloud/schedule/delivery/index.js.map +1 -0
- package/dist/cmd/cloud/schedule/delivery/list.d.ts +3 -0
- package/dist/cmd/cloud/schedule/delivery/list.d.ts.map +1 -0
- package/dist/cmd/cloud/schedule/delivery/list.js +66 -0
- package/dist/cmd/cloud/schedule/delivery/list.js.map +1 -0
- package/dist/cmd/cloud/schedule/destination/create.d.ts +3 -0
- package/dist/cmd/cloud/schedule/destination/create.d.ts.map +1 -0
- package/dist/cmd/cloud/schedule/destination/create.js +100 -0
- package/dist/cmd/cloud/schedule/destination/create.js.map +1 -0
- package/dist/cmd/cloud/schedule/destination/delete.d.ts +3 -0
- package/dist/cmd/cloud/schedule/destination/delete.d.ts.map +1 -0
- package/dist/cmd/cloud/schedule/destination/delete.js +40 -0
- package/dist/cmd/cloud/schedule/destination/delete.js.map +1 -0
- package/dist/cmd/cloud/schedule/destination/get.d.ts +3 -0
- package/dist/cmd/cloud/schedule/destination/get.d.ts.map +1 -0
- package/dist/cmd/cloud/schedule/destination/get.js +59 -0
- package/dist/cmd/cloud/schedule/destination/get.js.map +1 -0
- package/dist/cmd/cloud/schedule/destination/index.d.ts +3 -0
- package/dist/cmd/cloud/schedule/destination/index.d.ts.map +1 -0
- package/dist/cmd/cloud/schedule/destination/index.js +26 -0
- package/dist/cmd/cloud/schedule/destination/index.js.map +1 -0
- package/dist/cmd/cloud/schedule/destination/list.d.ts +3 -0
- package/dist/cmd/cloud/schedule/destination/list.d.ts.map +1 -0
- package/dist/cmd/cloud/schedule/destination/list.js +62 -0
- package/dist/cmd/cloud/schedule/destination/list.js.map +1 -0
- package/dist/cmd/cloud/schedule/get.d.ts +3 -0
- package/dist/cmd/cloud/schedule/get.d.ts.map +1 -0
- package/dist/cmd/cloud/schedule/get.js +80 -0
- package/dist/cmd/cloud/schedule/get.js.map +1 -0
- package/dist/cmd/cloud/schedule/index.d.ts +3 -0
- package/dist/cmd/cloud/schedule/index.d.ts.map +1 -0
- package/dist/cmd/cloud/schedule/index.js +37 -0
- package/dist/cmd/cloud/schedule/index.js.map +1 -0
- package/dist/cmd/cloud/schedule/list.d.ts +3 -0
- package/dist/cmd/cloud/schedule/list.d.ts.map +1 -0
- package/dist/cmd/cloud/schedule/list.js +59 -0
- package/dist/cmd/cloud/schedule/list.js.map +1 -0
- package/dist/cmd/cloud/schedule/stats.d.ts +3 -0
- package/dist/cmd/cloud/schedule/stats.d.ts.map +1 -0
- package/dist/cmd/cloud/schedule/stats.js +64 -0
- package/dist/cmd/cloud/schedule/stats.js.map +1 -0
- package/dist/cmd/cloud/schedule/update.d.ts +3 -0
- package/dist/cmd/cloud/schedule/update.d.ts.map +1 -0
- package/dist/cmd/cloud/schedule/update.js +65 -0
- package/dist/cmd/cloud/schedule/update.js.map +1 -0
- package/dist/cmd/cloud/schedule/util.d.ts +10 -0
- package/dist/cmd/cloud/schedule/util.d.ts.map +1 -0
- package/dist/cmd/cloud/schedule/util.js +17 -0
- package/dist/cmd/cloud/schedule/util.js.map +1 -0
- package/dist/cmd/cloud/services/index.d.ts +3 -0
- package/dist/cmd/cloud/services/index.d.ts.map +1 -0
- package/dist/cmd/cloud/services/index.js +10 -0
- package/dist/cmd/cloud/services/index.js.map +1 -0
- package/dist/cmd/cloud/services/stats.d.ts +3 -0
- package/dist/cmd/cloud/services/stats.d.ts.map +1 -0
- package/dist/cmd/cloud/services/stats.js +153 -0
- package/dist/cmd/cloud/services/stats.js.map +1 -0
- package/dist/cmd/cloud/stream/index.d.ts.map +1 -1
- package/dist/cmd/cloud/stream/index.js +2 -1
- package/dist/cmd/cloud/stream/index.js.map +1 -1
- package/dist/cmd/cloud/stream/stats.d.ts +3 -0
- package/dist/cmd/cloud/stream/stats.d.ts.map +1 -0
- package/dist/cmd/cloud/stream/stats.js +64 -0
- package/dist/cmd/cloud/stream/stats.js.map +1 -0
- package/dist/cmd/cloud/task/create.d.ts +3 -0
- package/dist/cmd/cloud/task/create.d.ts.map +1 -0
- package/dist/cmd/cloud/task/create.js +107 -0
- package/dist/cmd/cloud/task/create.js.map +1 -0
- package/dist/cmd/cloud/task/get.d.ts +3 -0
- package/dist/cmd/cloud/task/get.d.ts.map +1 -0
- package/dist/cmd/cloud/task/get.js +125 -0
- package/dist/cmd/cloud/task/get.js.map +1 -0
- package/dist/cmd/cloud/task/index.d.ts +3 -0
- package/dist/cmd/cloud/task/index.d.ts.map +1 -0
- package/dist/cmd/cloud/task/index.js +34 -0
- package/dist/cmd/cloud/task/index.js.map +1 -0
- package/dist/cmd/cloud/task/list.d.ts +3 -0
- package/dist/cmd/cloud/task/list.d.ts.map +1 -0
- package/dist/cmd/cloud/task/list.js +173 -0
- package/dist/cmd/cloud/task/list.js.map +1 -0
- package/dist/cmd/cloud/task/stats.d.ts +3 -0
- package/dist/cmd/cloud/task/stats.d.ts.map +1 -0
- package/dist/cmd/cloud/task/stats.js +66 -0
- package/dist/cmd/cloud/task/stats.js.map +1 -0
- package/dist/cmd/cloud/task/update.d.ts +3 -0
- package/dist/cmd/cloud/task/update.d.ts.map +1 -0
- package/dist/cmd/cloud/task/update.js +117 -0
- package/dist/cmd/cloud/task/update.js.map +1 -0
- package/dist/cmd/cloud/task/util.d.ts +15 -0
- package/dist/cmd/cloud/task/util.d.ts.map +1 -0
- package/dist/cmd/cloud/task/util.js +41 -0
- package/dist/cmd/cloud/task/util.js.map +1 -0
- package/dist/cmd/cloud/vector/get.d.ts.map +1 -1
- package/dist/cmd/cloud/vector/get.js +17 -12
- package/dist/cmd/cloud/vector/get.js.map +1 -1
- package/dist/cmd/cloud/vector/stats.d.ts.map +1 -1
- package/dist/cmd/cloud/vector/stats.js +10 -7
- package/dist/cmd/cloud/vector/stats.js.map +1 -1
- package/dist/cmd/cloud/webhook/create.d.ts +3 -0
- package/dist/cmd/cloud/webhook/create.d.ts.map +1 -0
- package/dist/cmd/cloud/webhook/create.js +54 -0
- package/dist/cmd/cloud/webhook/create.js.map +1 -0
- package/dist/cmd/cloud/webhook/delete.d.ts +3 -0
- package/dist/cmd/cloud/webhook/delete.d.ts.map +1 -0
- package/dist/cmd/cloud/webhook/delete.js +50 -0
- package/dist/cmd/cloud/webhook/delete.js.map +1 -0
- package/dist/cmd/cloud/webhook/deliveries.d.ts +3 -0
- package/dist/cmd/cloud/webhook/deliveries.d.ts.map +1 -0
- package/dist/cmd/cloud/webhook/deliveries.js +129 -0
- package/dist/cmd/cloud/webhook/deliveries.js.map +1 -0
- package/dist/cmd/cloud/webhook/destinations.d.ts +3 -0
- package/dist/cmd/cloud/webhook/destinations.d.ts.map +1 -0
- package/dist/cmd/cloud/webhook/destinations.js +223 -0
- package/dist/cmd/cloud/webhook/destinations.js.map +1 -0
- package/dist/cmd/cloud/webhook/get.d.ts +3 -0
- package/dist/cmd/cloud/webhook/get.d.ts.map +1 -0
- package/dist/cmd/cloud/webhook/get.js +50 -0
- package/dist/cmd/cloud/webhook/get.js.map +1 -0
- package/dist/cmd/cloud/webhook/index.d.ts +3 -0
- package/dist/cmd/cloud/webhook/index.d.ts.map +1 -0
- package/dist/cmd/cloud/webhook/index.js +45 -0
- package/dist/cmd/cloud/webhook/index.js.map +1 -0
- package/dist/cmd/cloud/webhook/list.d.ts +3 -0
- package/dist/cmd/cloud/webhook/list.d.ts.map +1 -0
- package/dist/cmd/cloud/webhook/list.js +72 -0
- package/dist/cmd/cloud/webhook/list.js.map +1 -0
- package/dist/cmd/cloud/webhook/receipts.d.ts +3 -0
- package/dist/cmd/cloud/webhook/receipts.d.ts.map +1 -0
- package/dist/cmd/cloud/webhook/receipts.js +144 -0
- package/dist/cmd/cloud/webhook/receipts.js.map +1 -0
- package/dist/cmd/cloud/webhook/util.d.ts +27 -0
- package/dist/cmd/cloud/webhook/util.d.ts.map +1 -0
- package/dist/cmd/cloud/webhook/util.js +20 -0
- package/dist/cmd/cloud/webhook/util.js.map +1 -0
- package/dist/config.d.ts +8 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/tui.d.ts +4 -0
- package/dist/tui.d.ts.map +1 -1
- package/dist/tui.js +8 -0
- package/dist/tui.js.map +1 -1
- package/dist/types.d.ts +10 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +3 -2
- package/dist/types.js.map +1 -1
- package/dist/version-check.d.ts.map +1 -1
- package/dist/version-check.js +18 -3
- package/dist/version-check.js.map +1 -1
- package/package.json +6 -6
- package/src/auth.ts +7 -0
- package/src/cache/resource-region.ts +4 -1
- package/src/cmd/ai/claude-code/install.ts +0 -3
- package/src/cmd/build/vite/public-asset-path-plugin.ts +18 -4
- package/src/cmd/cloud/db/index.ts +2 -0
- package/src/cmd/cloud/db/stats.ts +80 -0
- package/src/cmd/cloud/email/create.ts +80 -0
- package/src/cmd/cloud/email/delete.ts +53 -0
- package/src/cmd/cloud/email/destination/delete.ts +65 -0
- package/src/cmd/cloud/email/destination/index.ts +15 -0
- package/src/cmd/cloud/email/destination/list.ts +46 -0
- package/src/cmd/cloud/email/destination/schemas.ts +9 -0
- package/src/cmd/cloud/email/destination/url.ts +76 -0
- package/src/cmd/cloud/email/get.ts +52 -0
- package/src/cmd/cloud/email/inbound/get.ts +52 -0
- package/src/cmd/cloud/email/inbound/index.ts +13 -0
- package/src/cmd/cloud/email/inbound/list.ts +48 -0
- package/src/cmd/cloud/email/inbound/schemas.ts +13 -0
- package/src/cmd/cloud/email/index.ts +31 -0
- package/src/cmd/cloud/email/list.ts +51 -0
- package/src/cmd/cloud/email/outbound/get.ts +54 -0
- package/src/cmd/cloud/email/outbound/index.ts +13 -0
- package/src/cmd/cloud/email/outbound/list.ts +50 -0
- package/src/cmd/cloud/email/outbound/schemas.ts +15 -0
- package/src/cmd/cloud/email/send.ts +89 -0
- package/src/cmd/cloud/email/stats.ts +77 -0
- package/src/cmd/cloud/email/util.ts +70 -0
- package/src/cmd/cloud/index.ts +10 -0
- package/src/cmd/cloud/queue/get.ts +4 -4
- package/src/cmd/cloud/queue/receive.ts +15 -7
- package/src/cmd/cloud/queue/stats.ts +3 -3
- package/src/cmd/cloud/region-lookup.ts +58 -2
- package/src/cmd/cloud/sandbox/checkpoint/create.ts +85 -0
- package/src/cmd/cloud/sandbox/checkpoint/delete.ts +93 -0
- package/src/cmd/cloud/sandbox/checkpoint/index.ts +33 -0
- package/src/cmd/cloud/sandbox/checkpoint/list.ts +83 -0
- package/src/cmd/cloud/sandbox/checkpoint/restore.ts +72 -0
- package/src/cmd/cloud/sandbox/get.ts +6 -3
- package/src/cmd/cloud/sandbox/index.ts +4 -0
- package/src/cmd/cloud/sandbox/snapshot/build.ts +68 -64
- package/src/cmd/cloud/sandbox/snapshot/generate.ts +5 -1
- package/src/cmd/cloud/sandbox/snapshot/get.ts +3 -3
- package/src/cmd/cloud/sandbox/stats.ts +86 -0
- package/src/cmd/cloud/schedule/create.ts +82 -0
- package/src/cmd/cloud/schedule/delete.ts +42 -0
- package/src/cmd/cloud/schedule/delivery/get.ts +84 -0
- package/src/cmd/cloud/schedule/delivery/index.ts +24 -0
- package/src/cmd/cloud/schedule/delivery/list.ts +81 -0
- package/src/cmd/cloud/schedule/destination/create.ts +114 -0
- package/src/cmd/cloud/schedule/destination/delete.ts +45 -0
- package/src/cmd/cloud/schedule/destination/get.ts +66 -0
- package/src/cmd/cloud/schedule/destination/index.ts +27 -0
- package/src/cmd/cloud/schedule/destination/list.ts +77 -0
- package/src/cmd/cloud/schedule/get.ts +97 -0
- package/src/cmd/cloud/schedule/index.ts +38 -0
- package/src/cmd/cloud/schedule/list.ts +77 -0
- package/src/cmd/cloud/schedule/stats.ts +74 -0
- package/src/cmd/cloud/schedule/update.ts +74 -0
- package/src/cmd/cloud/schedule/util.ts +29 -0
- package/src/cmd/cloud/services/index.ts +11 -0
- package/src/cmd/cloud/services/stats.ts +225 -0
- package/src/cmd/cloud/stream/index.ts +2 -1
- package/src/cmd/cloud/stream/stats.ts +74 -0
- package/src/cmd/cloud/task/create.ts +123 -0
- package/src/cmd/cloud/task/get.ts +139 -0
- package/src/cmd/cloud/task/index.ts +35 -0
- package/src/cmd/cloud/task/list.ts +190 -0
- package/src/cmd/cloud/task/stats.ts +74 -0
- package/src/cmd/cloud/task/update.ts +122 -0
- package/src/cmd/cloud/task/util.ts +62 -0
- package/src/cmd/cloud/vector/get.ts +16 -11
- package/src/cmd/cloud/vector/stats.ts +10 -8
- package/src/cmd/cloud/webhook/create.ts +66 -0
- package/src/cmd/cloud/webhook/delete.ts +57 -0
- package/src/cmd/cloud/webhook/deliveries.ts +162 -0
- package/src/cmd/cloud/webhook/destinations.ts +287 -0
- package/src/cmd/cloud/webhook/get.ts +59 -0
- package/src/cmd/cloud/webhook/index.ts +46 -0
- package/src/cmd/cloud/webhook/list.ts +82 -0
- package/src/cmd/cloud/webhook/receipts.ts +170 -0
- package/src/cmd/cloud/webhook/util.ts +35 -0
- package/src/tui.ts +9 -0
- package/src/types.ts +3 -1
- package/src/version-check.ts +22 -3
|
@@ -5,6 +5,7 @@ import { deleteSubcommand } from './delete';
|
|
|
5
5
|
import { getSubcommand } from './get';
|
|
6
6
|
import { logsSubcommand } from './logs';
|
|
7
7
|
import { sqlSubcommand } from './sql';
|
|
8
|
+
import { statsSubcommand } from './stats';
|
|
8
9
|
import { getCommand } from '../../../command-prefix';
|
|
9
10
|
|
|
10
11
|
export const dbCommand = createCommand({
|
|
@@ -23,5 +24,6 @@ export const dbCommand = createCommand({
|
|
|
23
24
|
deleteSubcommand,
|
|
24
25
|
logsSubcommand,
|
|
25
26
|
sqlSubcommand,
|
|
27
|
+
statsSubcommand,
|
|
26
28
|
],
|
|
27
29
|
});
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createCommand } from '../../../types';
|
|
3
|
+
import * as tui from '../../../tui';
|
|
4
|
+
import { getGlobalCatalystAPIClient } from '../../../config';
|
|
5
|
+
import { getCommand } from '../../../command-prefix';
|
|
6
|
+
import { getServiceStats, type ServiceStatsData } from '@agentuity/server';
|
|
7
|
+
|
|
8
|
+
function formatNumber(n: number): string {
|
|
9
|
+
if (n >= 1_000_000) return `${(n / 1_000_000).toFixed(1)}M`;
|
|
10
|
+
if (n >= 1_000) return `${(n / 1_000).toFixed(1)}K`;
|
|
11
|
+
return String(n);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function displayStats(data: ServiceStatsData): void {
|
|
15
|
+
const svc = data.services.database;
|
|
16
|
+
if (!svc) {
|
|
17
|
+
tui.info('No database data found.');
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
tui.header('Database Statistics');
|
|
21
|
+
tui.newline();
|
|
22
|
+
console.log(
|
|
23
|
+
` ${tui.muted('Databases:')} ${formatNumber(svc.databaseCount)}`
|
|
24
|
+
);
|
|
25
|
+
console.log(
|
|
26
|
+
` ${tui.muted('Tables:')} ${formatNumber(svc.totalTableCount)}`
|
|
27
|
+
);
|
|
28
|
+
console.log(
|
|
29
|
+
` ${tui.muted('Records:')} ${formatNumber(svc.totalRecordCount)}`
|
|
30
|
+
);
|
|
31
|
+
console.log(
|
|
32
|
+
` ${tui.muted('Total Size:')} ${tui.formatBytes(svc.totalSizeBytes)}`
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const statsSubcommand = createCommand({
|
|
37
|
+
name: 'stats',
|
|
38
|
+
description: 'View database statistics',
|
|
39
|
+
tags: ['read-only', 'requires-auth'],
|
|
40
|
+
requires: { auth: true, org: true },
|
|
41
|
+
examples: [
|
|
42
|
+
{
|
|
43
|
+
command: getCommand('cloud db stats'),
|
|
44
|
+
description: 'View database statistics',
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
schema: {
|
|
48
|
+
options: z.object({
|
|
49
|
+
start: z.string().optional().describe('Start time (ISO 8601)'),
|
|
50
|
+
end: z.string().optional().describe('End time (ISO 8601)'),
|
|
51
|
+
}),
|
|
52
|
+
},
|
|
53
|
+
idempotent: true,
|
|
54
|
+
|
|
55
|
+
async handler(ctx) {
|
|
56
|
+
const { opts, options } = ctx;
|
|
57
|
+
const client = await getGlobalCatalystAPIClient(ctx.logger, ctx.auth, ctx.config?.name);
|
|
58
|
+
const orgId = ctx.orgId ?? ctx.options.orgId ?? ctx.config?.preferences?.orgId;
|
|
59
|
+
|
|
60
|
+
if (!orgId) {
|
|
61
|
+
ctx.logger.fatal('Organization ID is required. Use --org-id or set a preferred org.');
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const data = await getServiceStats(client, orgId, {
|
|
66
|
+
service: 'database',
|
|
67
|
+
start: opts.start,
|
|
68
|
+
end: opts.end,
|
|
69
|
+
orgIdHeader: orgId,
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
if (!options.json) {
|
|
73
|
+
displayStats(data);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return data;
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
export default statsSubcommand;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import enquirer from 'enquirer';
|
|
3
|
+
import { createCommand } from '../../../types';
|
|
4
|
+
import * as tui from '../../../tui';
|
|
5
|
+
import { setResourceInfo } from '../../../cache';
|
|
6
|
+
import { createEmailAdapter, resolveEmailOrgId, EmailAddressSchema } from './util';
|
|
7
|
+
import { defaultProfileName, getDefaultRegion } from '../../../config';
|
|
8
|
+
|
|
9
|
+
export const createSubcommand = createCommand({
|
|
10
|
+
name: 'create',
|
|
11
|
+
aliases: ['add'],
|
|
12
|
+
description: 'Create an email address',
|
|
13
|
+
tags: ['mutating', 'creates-resource', 'requires-auth'],
|
|
14
|
+
requires: { auth: true },
|
|
15
|
+
schema: {
|
|
16
|
+
options: z.object({
|
|
17
|
+
localPart: z
|
|
18
|
+
.string()
|
|
19
|
+
.optional()
|
|
20
|
+
.describe('Local part for the email address (before @)'),
|
|
21
|
+
}),
|
|
22
|
+
response: EmailAddressSchema,
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
async handler(ctx) {
|
|
26
|
+
const { opts, options, config } = ctx;
|
|
27
|
+
let localPart = opts.localPart?.trim();
|
|
28
|
+
|
|
29
|
+
if (!localPart) {
|
|
30
|
+
const answer = await enquirer.prompt<{ local_part: string }>({
|
|
31
|
+
type: 'input',
|
|
32
|
+
name: 'local_part',
|
|
33
|
+
message: 'Email address or username (e.g. "support" or "support@agentuity.email"):',
|
|
34
|
+
});
|
|
35
|
+
localPart = answer.local_part?.trim();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (!localPart) {
|
|
39
|
+
tui.fatal('Email address or username is required');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// If user entered a full email, extract just the local part
|
|
43
|
+
if (localPart.includes('@')) {
|
|
44
|
+
localPart = localPart.split('@')[0]?.trim() ?? '';
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (!localPart) {
|
|
48
|
+
tui.fatal('Email address or username is required');
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const profileName = config?.name ?? defaultProfileName;
|
|
52
|
+
const region = await getDefaultRegion(profileName, ctx.config);
|
|
53
|
+
const email = await createEmailAdapter(ctx, region);
|
|
54
|
+
const address = await email.createAddress(localPart);
|
|
55
|
+
|
|
56
|
+
const orgId = resolveEmailOrgId(ctx);
|
|
57
|
+
await setResourceInfo('email', profileName, address.id, region, orgId);
|
|
58
|
+
|
|
59
|
+
if (!options.json) {
|
|
60
|
+
tui.success(`Email Address: ${tui.bold(address.email)}`);
|
|
61
|
+
tui.table(
|
|
62
|
+
[
|
|
63
|
+
{
|
|
64
|
+
ID: address.id,
|
|
65
|
+
Email: address.email,
|
|
66
|
+
Project: address.project_id ?? '-',
|
|
67
|
+
Provider: address.provider ?? '-',
|
|
68
|
+
Created: new Date(address.created_at).toLocaleString(),
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
['ID', 'Email', 'Project', 'Provider', 'Created'],
|
|
72
|
+
{ layout: 'vertical', padStart: ' ' }
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return address;
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
export default createSubcommand;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createCommand } from '../../../types';
|
|
3
|
+
import * as tui from '../../../tui';
|
|
4
|
+
import { createEmailAdapter } from './util';
|
|
5
|
+
|
|
6
|
+
const DeleteResponseSchema = z.object({
|
|
7
|
+
success: z.boolean(),
|
|
8
|
+
id: z.string(),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export const deleteSubcommand = createCommand({
|
|
12
|
+
name: 'delete',
|
|
13
|
+
aliases: ['rm', 'del'],
|
|
14
|
+
description: 'Delete an email address',
|
|
15
|
+
tags: ['destructive', 'deletes-resource', 'requires-auth'],
|
|
16
|
+
requires: { auth: true },
|
|
17
|
+
schema: {
|
|
18
|
+
args: z.object({
|
|
19
|
+
id: z.string().min(1).describe('Email address ID (eaddr_*)'),
|
|
20
|
+
}),
|
|
21
|
+
options: z.object({
|
|
22
|
+
confirm: z.boolean().optional().default(false).describe('Skip confirmation prompt'),
|
|
23
|
+
}),
|
|
24
|
+
response: DeleteResponseSchema,
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
async handler(ctx) {
|
|
28
|
+
const { args, opts, options } = ctx;
|
|
29
|
+
if (!opts.confirm) {
|
|
30
|
+
const ok = await tui.confirm(`Delete email address ${tui.bold(args.id)}?`, false);
|
|
31
|
+
if (!ok) {
|
|
32
|
+
if (!options.json) {
|
|
33
|
+
tui.info('Cancelled');
|
|
34
|
+
}
|
|
35
|
+
return { success: false, id: args.id };
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const email = await createEmailAdapter(ctx);
|
|
40
|
+
await email.deleteAddress(args.id);
|
|
41
|
+
|
|
42
|
+
if (!options.json) {
|
|
43
|
+
tui.success(`Deleted email address ${args.id}`);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return {
|
|
47
|
+
success: true,
|
|
48
|
+
id: args.id,
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
export default deleteSubcommand;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createCommand } from '../../../../types';
|
|
3
|
+
import * as tui from '../../../../tui';
|
|
4
|
+
import { createEmailAdapter } from '../util';
|
|
5
|
+
|
|
6
|
+
const DeleteDestinationResponseSchema = z.object({
|
|
7
|
+
success: z.boolean(),
|
|
8
|
+
address_id: z.string(),
|
|
9
|
+
destination_id: z.string(),
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export const deleteSubcommand = createCommand({
|
|
13
|
+
name: 'delete',
|
|
14
|
+
aliases: ['rm', 'del'],
|
|
15
|
+
description: 'Delete a destination from an email address',
|
|
16
|
+
tags: ['destructive', 'deletes-resource', 'requires-auth'],
|
|
17
|
+
requires: { auth: true },
|
|
18
|
+
schema: {
|
|
19
|
+
args: z.object({
|
|
20
|
+
address_id: z.string().min(1).describe('Email address ID (eaddr_*)'),
|
|
21
|
+
destination_id: z.string().min(1).describe('Destination ID (edest_*)'),
|
|
22
|
+
}),
|
|
23
|
+
options: z.object({
|
|
24
|
+
confirm: z.boolean().optional().default(false).describe('Skip confirmation prompt'),
|
|
25
|
+
}),
|
|
26
|
+
response: DeleteDestinationResponseSchema,
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
async handler(ctx) {
|
|
30
|
+
const { args, opts, options } = ctx;
|
|
31
|
+
|
|
32
|
+
if (!args.address_id.startsWith('eaddr_')) {
|
|
33
|
+
tui.fatal('Invalid email address ID — must start with eaddr_');
|
|
34
|
+
}
|
|
35
|
+
if (!args.destination_id.startsWith('edest_')) {
|
|
36
|
+
tui.fatal('Invalid destination ID — must start with edest_');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (!opts.confirm && !options.json) {
|
|
40
|
+
const ok = await tui.confirm(
|
|
41
|
+
`Delete destination ${tui.bold(args.destination_id)} from address ${tui.bold(args.address_id)}?`,
|
|
42
|
+
false
|
|
43
|
+
);
|
|
44
|
+
if (!ok) {
|
|
45
|
+
tui.info('Cancelled');
|
|
46
|
+
return { success: false, address_id: args.address_id, destination_id: args.destination_id };
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const email = await createEmailAdapter(ctx);
|
|
51
|
+
await email.deleteDestination(args.address_id, args.destination_id);
|
|
52
|
+
|
|
53
|
+
if (!options.json) {
|
|
54
|
+
tui.success(`Deleted destination ${args.destination_id}`);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return {
|
|
58
|
+
success: true,
|
|
59
|
+
address_id: args.address_id,
|
|
60
|
+
destination_id: args.destination_id,
|
|
61
|
+
};
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
export default deleteSubcommand;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createCommand } from '../../../../types';
|
|
2
|
+
import { urlSubcommand } from './url';
|
|
3
|
+
import { listSubcommand } from './list';
|
|
4
|
+
import { deleteSubcommand } from './delete';
|
|
5
|
+
|
|
6
|
+
export const destinationCommand = createCommand({
|
|
7
|
+
name: 'destination',
|
|
8
|
+
aliases: ['destinations', 'dest'],
|
|
9
|
+
description: 'Manage email destinations for an address',
|
|
10
|
+
tags: ['requires-auth'],
|
|
11
|
+
requires: { auth: true },
|
|
12
|
+
subcommands: [urlSubcommand, listSubcommand, deleteSubcommand],
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export default destinationCommand;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createCommand } from '../../../../types';
|
|
3
|
+
import * as tui from '../../../../tui';
|
|
4
|
+
import { createEmailAdapter } from '../util';
|
|
5
|
+
import { DestinationSchema } from './schemas';
|
|
6
|
+
|
|
7
|
+
export const listSubcommand = createCommand({
|
|
8
|
+
name: 'list',
|
|
9
|
+
aliases: ['ls'],
|
|
10
|
+
description: 'List destinations for an email address',
|
|
11
|
+
tags: ['read-only', 'requires-auth'],
|
|
12
|
+
requires: { auth: true },
|
|
13
|
+
schema: {
|
|
14
|
+
args: z.object({
|
|
15
|
+
address_id: z.string().min(1).describe('Email address ID (eaddr_*)'),
|
|
16
|
+
}),
|
|
17
|
+
response: z.array(DestinationSchema),
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
async handler(ctx) {
|
|
21
|
+
const { args, options } = ctx;
|
|
22
|
+
const email = await createEmailAdapter(ctx);
|
|
23
|
+
const destinations = await email.listDestinations(args.address_id);
|
|
24
|
+
|
|
25
|
+
if (!options.json) {
|
|
26
|
+
tui.table(
|
|
27
|
+
destinations.map((item) => ({
|
|
28
|
+
ID: item.id,
|
|
29
|
+
Type: item.type,
|
|
30
|
+
'Config URL': typeof item.config?.url === 'string' ? item.config.url : '-',
|
|
31
|
+
Created: new Date(item.created_at).toLocaleString(),
|
|
32
|
+
})),
|
|
33
|
+
[
|
|
34
|
+
{ name: 'ID', alignment: 'left' },
|
|
35
|
+
{ name: 'Type', alignment: 'left' },
|
|
36
|
+
{ name: 'Config URL', alignment: 'left' },
|
|
37
|
+
{ name: 'Created', alignment: 'left' },
|
|
38
|
+
]
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return destinations;
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
export default listSubcommand;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createCommand } from '../../../../types';
|
|
3
|
+
import * as tui from '../../../../tui';
|
|
4
|
+
import { setResourceInfo } from '../../../../cache';
|
|
5
|
+
import { createEmailAdapter, resolveEmailOrgId } from '../util';
|
|
6
|
+
import { defaultProfileName, getDefaultRegion } from '../../../../config';
|
|
7
|
+
import { DestinationSchema } from './schemas';
|
|
8
|
+
|
|
9
|
+
export const urlSubcommand = createCommand({
|
|
10
|
+
name: 'url',
|
|
11
|
+
description: 'Add a URL destination to an email address',
|
|
12
|
+
tags: ['mutating', 'creates-resource', 'requires-auth'],
|
|
13
|
+
requires: { auth: true },
|
|
14
|
+
schema: {
|
|
15
|
+
args: z.object({
|
|
16
|
+
address_id: z.string().min(1).describe('Email address ID (eaddr_*)'),
|
|
17
|
+
url: z
|
|
18
|
+
.string()
|
|
19
|
+
.url()
|
|
20
|
+
.refine((u) => /^https?:\/\//i.test(u), {
|
|
21
|
+
message: 'URL must use http or https protocol',
|
|
22
|
+
})
|
|
23
|
+
.describe('Destination webhook URL'),
|
|
24
|
+
}),
|
|
25
|
+
options: z.object({
|
|
26
|
+
method: z
|
|
27
|
+
.enum(['POST', 'PUT', 'PATCH'])
|
|
28
|
+
.optional()
|
|
29
|
+
.default('POST')
|
|
30
|
+
.describe('HTTP method (default: POST)'),
|
|
31
|
+
}),
|
|
32
|
+
response: DestinationSchema,
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
async handler(ctx) {
|
|
36
|
+
const { args, opts, options, config } = ctx;
|
|
37
|
+
|
|
38
|
+
const destinationConfig: Record<string, unknown> = {
|
|
39
|
+
url: args.url,
|
|
40
|
+
};
|
|
41
|
+
if (opts.method && opts.method !== 'POST') {
|
|
42
|
+
destinationConfig.method = opts.method;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const profileName = config?.name ?? defaultProfileName;
|
|
46
|
+
const region = await getDefaultRegion(profileName, ctx.config);
|
|
47
|
+
const email = await createEmailAdapter(ctx, region);
|
|
48
|
+
const destination = await email.createDestination(args.address_id, 'url', destinationConfig);
|
|
49
|
+
|
|
50
|
+
const orgId = resolveEmailOrgId(ctx);
|
|
51
|
+
setResourceInfo('email', profileName, destination.id, region, orgId).catch(() => {
|
|
52
|
+
// Non-blocking: destination was already created successfully
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
if (!options.json) {
|
|
56
|
+
tui.success(`Destination created: ${tui.bold(destination.id)}`);
|
|
57
|
+
tui.table(
|
|
58
|
+
[
|
|
59
|
+
{
|
|
60
|
+
ID: destination.id,
|
|
61
|
+
Type: 'url',
|
|
62
|
+
URL: args.url,
|
|
63
|
+
Method: opts.method ?? 'POST',
|
|
64
|
+
Created: new Date(destination.created_at).toLocaleString(),
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
['ID', 'Type', 'URL', 'Method', 'Created'],
|
|
68
|
+
{ layout: 'vertical', padStart: ' ' }
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return destination;
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
export default urlSubcommand;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createCommand } from '../../../types';
|
|
3
|
+
import * as tui from '../../../tui';
|
|
4
|
+
import { createEmailAdapter, EmailAddressSchema } from './util';
|
|
5
|
+
|
|
6
|
+
export const getSubcommand = createCommand({
|
|
7
|
+
name: 'get',
|
|
8
|
+
description: 'Get an email address by ID',
|
|
9
|
+
tags: ['read-only', 'requires-auth'],
|
|
10
|
+
requires: { auth: true },
|
|
11
|
+
schema: {
|
|
12
|
+
args: z.object({
|
|
13
|
+
id: z.string().min(1).describe('Email address ID (eaddr_*)'),
|
|
14
|
+
}),
|
|
15
|
+
response: EmailAddressSchema,
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
async handler(ctx) {
|
|
19
|
+
const { args, options } = ctx;
|
|
20
|
+
const email = await createEmailAdapter(ctx);
|
|
21
|
+
const address = await email.getAddress(args.id);
|
|
22
|
+
|
|
23
|
+
if (!address) {
|
|
24
|
+
tui.fatal(`Email address not found: ${args.id}`);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (!options.json) {
|
|
28
|
+
tui.success(`Email Address: ${tui.bold(address.email)}`);
|
|
29
|
+
tui.table(
|
|
30
|
+
[
|
|
31
|
+
{
|
|
32
|
+
ID: address.id,
|
|
33
|
+
Email: address.email,
|
|
34
|
+
Project: address.project_id ?? '-',
|
|
35
|
+
Provider: address.provider ?? '-',
|
|
36
|
+
Config: address.config ? JSON.stringify(address.config) : '-',
|
|
37
|
+
Created: new Date(address.created_at).toLocaleString(),
|
|
38
|
+
Updated: address.updated_at
|
|
39
|
+
? new Date(address.updated_at).toLocaleString()
|
|
40
|
+
: '-',
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
['ID', 'Email', 'Project', 'Provider', 'Config', 'Created', 'Updated'],
|
|
44
|
+
{ layout: 'vertical', padStart: ' ' }
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return address;
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
export default getSubcommand;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createCommand } from '../../../../types';
|
|
3
|
+
import * as tui from '../../../../tui';
|
|
4
|
+
import { createEmailAdapter, truncate } from '../util';
|
|
5
|
+
import { EmailInboundSchema } from './schemas';
|
|
6
|
+
|
|
7
|
+
export const getSubcommand = createCommand({
|
|
8
|
+
name: 'get',
|
|
9
|
+
description: 'Get a received email by ID',
|
|
10
|
+
tags: ['read-only', 'requires-auth'],
|
|
11
|
+
requires: { auth: true },
|
|
12
|
+
schema: {
|
|
13
|
+
args: z.object({
|
|
14
|
+
id: z.string().min(1).describe('Inbound email ID (ein_*)'),
|
|
15
|
+
}),
|
|
16
|
+
response: EmailInboundSchema,
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
async handler(ctx) {
|
|
20
|
+
const { args, options } = ctx;
|
|
21
|
+
const email = await createEmailAdapter(ctx);
|
|
22
|
+
const inbound = await email.getInbound(args.id);
|
|
23
|
+
|
|
24
|
+
if (!inbound) {
|
|
25
|
+
tui.fatal(`Inbound email not found: ${args.id}`);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (!options.json) {
|
|
29
|
+
tui.success(`Inbound Email: ${tui.bold(inbound.id)}`);
|
|
30
|
+
tui.table(
|
|
31
|
+
[
|
|
32
|
+
{
|
|
33
|
+
ID: inbound.id,
|
|
34
|
+
From: inbound.from,
|
|
35
|
+
To: inbound.to,
|
|
36
|
+
Subject: inbound.subject ?? '-',
|
|
37
|
+
Text: truncate(inbound.text),
|
|
38
|
+
Received: inbound.received_at
|
|
39
|
+
? new Date(inbound.received_at).toLocaleString()
|
|
40
|
+
: '-',
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
['ID', 'From', 'To', 'Subject', 'Text', 'Received'],
|
|
44
|
+
{ layout: 'vertical', padStart: ' ' }
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return inbound;
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
export default getSubcommand;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createCommand } from '../../../../types';
|
|
2
|
+
import { listSubcommand } from './list';
|
|
3
|
+
import { getSubcommand } from './get';
|
|
4
|
+
|
|
5
|
+
export const inboundCommand = createCommand({
|
|
6
|
+
name: 'inbound',
|
|
7
|
+
description: 'Manage inbound (received) emails',
|
|
8
|
+
tags: ['requires-auth'],
|
|
9
|
+
requires: { auth: true },
|
|
10
|
+
subcommands: [listSubcommand, getSubcommand],
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export default inboundCommand;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createCommand } from '../../../../types';
|
|
3
|
+
import * as tui from '../../../../tui';
|
|
4
|
+
import { createEmailAdapter } from '../util';
|
|
5
|
+
import { EmailInboundSchema } from './schemas';
|
|
6
|
+
|
|
7
|
+
export const listSubcommand = createCommand({
|
|
8
|
+
name: 'list',
|
|
9
|
+
aliases: ['ls'],
|
|
10
|
+
description: 'List received emails',
|
|
11
|
+
tags: ['read-only', 'requires-auth'],
|
|
12
|
+
requires: { auth: true },
|
|
13
|
+
schema: {
|
|
14
|
+
options: z.object({
|
|
15
|
+
addressId: z.string().optional().describe('Filter by email address ID'),
|
|
16
|
+
}),
|
|
17
|
+
response: z.array(EmailInboundSchema),
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
async handler(ctx) {
|
|
21
|
+
const { opts, options } = ctx;
|
|
22
|
+
const email = await createEmailAdapter(ctx);
|
|
23
|
+
const inbound = await email.listInbound(opts.addressId);
|
|
24
|
+
|
|
25
|
+
if (!options.json) {
|
|
26
|
+
tui.table(
|
|
27
|
+
inbound.map((item) => ({
|
|
28
|
+
ID: item.id,
|
|
29
|
+
From: item.from,
|
|
30
|
+
To: item.to,
|
|
31
|
+
Subject: item.subject ?? '-',
|
|
32
|
+
Received: item.received_at ? new Date(item.received_at).toLocaleString() : '-',
|
|
33
|
+
})),
|
|
34
|
+
[
|
|
35
|
+
{ name: 'ID', alignment: 'left' },
|
|
36
|
+
{ name: 'From', alignment: 'left' },
|
|
37
|
+
{ name: 'To', alignment: 'left' },
|
|
38
|
+
{ name: 'Subject', alignment: 'left' },
|
|
39
|
+
{ name: 'Received', alignment: 'left' },
|
|
40
|
+
]
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return inbound;
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
export default listSubcommand;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export const EmailInboundSchema = z.object({
|
|
4
|
+
id: z.string(),
|
|
5
|
+
from: z.string(),
|
|
6
|
+
to: z.string(),
|
|
7
|
+
subject: z.string().optional(),
|
|
8
|
+
text: z.string().optional(),
|
|
9
|
+
html: z.string().optional(),
|
|
10
|
+
received_at: z.string().optional(),
|
|
11
|
+
headers: z.record(z.string(), z.unknown()).optional(),
|
|
12
|
+
attachments: z.array(z.unknown()).optional(),
|
|
13
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { createCommand } from '../../../types';
|
|
2
|
+
import { createSubcommand } from './create';
|
|
3
|
+
import { listSubcommand } from './list';
|
|
4
|
+
import { getSubcommand } from './get';
|
|
5
|
+
import { deleteSubcommand } from './delete';
|
|
6
|
+
import { destinationCommand } from './destination';
|
|
7
|
+
import { sendSubcommand } from './send';
|
|
8
|
+
import { inboundCommand } from './inbound';
|
|
9
|
+
import { outboundCommand } from './outbound';
|
|
10
|
+
import { statsSubcommand } from './stats';
|
|
11
|
+
|
|
12
|
+
export const emailCommand = createCommand({
|
|
13
|
+
name: 'email',
|
|
14
|
+
aliases: ['mail'],
|
|
15
|
+
description: 'Manage email addresses and messages',
|
|
16
|
+
tags: ['requires-auth'],
|
|
17
|
+
subcommands: [
|
|
18
|
+
createSubcommand,
|
|
19
|
+
listSubcommand,
|
|
20
|
+
getSubcommand,
|
|
21
|
+
deleteSubcommand,
|
|
22
|
+
destinationCommand,
|
|
23
|
+
sendSubcommand,
|
|
24
|
+
inboundCommand,
|
|
25
|
+
outboundCommand,
|
|
26
|
+
statsSubcommand,
|
|
27
|
+
],
|
|
28
|
+
requires: { auth: true },
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export default emailCommand;
|