@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
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createCommand } from '../../../../types';
|
|
3
|
+
import * as tui from '../../../../tui';
|
|
4
|
+
import { createScheduleAdapter } from '../util';
|
|
5
|
+
import { getCommand } from '../../../../command-prefix';
|
|
6
|
+
|
|
7
|
+
const DeliveryListResponseSchema = z.object({
|
|
8
|
+
deliveries: z.array(
|
|
9
|
+
z.object({
|
|
10
|
+
id: z.string(),
|
|
11
|
+
date: z.string(),
|
|
12
|
+
schedule_id: z.string(),
|
|
13
|
+
schedule_destination_id: z.string(),
|
|
14
|
+
status: z.enum(['pending', 'success', 'failed']),
|
|
15
|
+
retries: z.number(),
|
|
16
|
+
error: z.string().nullable(),
|
|
17
|
+
response: z.record(z.string(), z.unknown()).nullable(),
|
|
18
|
+
})
|
|
19
|
+
),
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export const listSubcommand = createCommand({
|
|
23
|
+
name: 'list',
|
|
24
|
+
aliases: ['ls'],
|
|
25
|
+
description: 'List deliveries for a schedule',
|
|
26
|
+
tags: ['read-only', 'fast', 'requires-auth'],
|
|
27
|
+
requires: { auth: true },
|
|
28
|
+
idempotent: true,
|
|
29
|
+
examples: [
|
|
30
|
+
{
|
|
31
|
+
command: getCommand('cloud schedule delivery list sched_abc123 --limit 50'),
|
|
32
|
+
description: 'List schedule deliveries',
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
schema: {
|
|
36
|
+
args: z.object({
|
|
37
|
+
schedule_id: z.string().min(1).describe('Schedule ID'),
|
|
38
|
+
}),
|
|
39
|
+
options: z.object({
|
|
40
|
+
limit: z.coerce.number().min(0).optional().describe('Maximum number of deliveries'),
|
|
41
|
+
offset: z.coerce.number().min(0).optional().describe('Pagination offset'),
|
|
42
|
+
}),
|
|
43
|
+
response: DeliveryListResponseSchema,
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
async handler(ctx) {
|
|
47
|
+
const { args, opts, options } = ctx;
|
|
48
|
+
const schedule = await createScheduleAdapter(ctx);
|
|
49
|
+
const result = await schedule.listDeliveries(args.schedule_id, {
|
|
50
|
+
limit: opts.limit,
|
|
51
|
+
offset: opts.offset,
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
if (!options.json) {
|
|
55
|
+
if (result.deliveries.length === 0) {
|
|
56
|
+
tui.info('No deliveries found');
|
|
57
|
+
} else {
|
|
58
|
+
tui.table(
|
|
59
|
+
result.deliveries.map((delivery: {
|
|
60
|
+
id: string;
|
|
61
|
+
date: string;
|
|
62
|
+
status: 'pending' | 'success' | 'failed';
|
|
63
|
+
retries: number;
|
|
64
|
+
schedule_destination_id: string;
|
|
65
|
+
}) => ({
|
|
66
|
+
ID: delivery.id,
|
|
67
|
+
Date: new Date(delivery.date).toLocaleString(),
|
|
68
|
+
Status: delivery.status,
|
|
69
|
+
Retries: delivery.retries,
|
|
70
|
+
'Destination ID': delivery.schedule_destination_id,
|
|
71
|
+
})),
|
|
72
|
+
['ID', 'Date', 'Status', 'Retries', 'Destination ID']
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return result;
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
export default listSubcommand;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createCommand } from '../../../../types';
|
|
3
|
+
import * as tui from '../../../../tui';
|
|
4
|
+
import { createScheduleAdapter } from '../util';
|
|
5
|
+
import { getCommand } from '../../../../command-prefix';
|
|
6
|
+
|
|
7
|
+
const CreateDestinationResponseSchema = z.object({
|
|
8
|
+
destination: z.object({
|
|
9
|
+
id: z.string(),
|
|
10
|
+
schedule_id: z.string(),
|
|
11
|
+
created_at: z.string(),
|
|
12
|
+
updated_at: z.string(),
|
|
13
|
+
created_by: z.string(),
|
|
14
|
+
type: z.enum(['url', 'sandbox']),
|
|
15
|
+
config: z.record(z.string(), z.unknown()),
|
|
16
|
+
}),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export const createSubcommand = createCommand({
|
|
20
|
+
name: 'create',
|
|
21
|
+
description: 'Create destination for a schedule',
|
|
22
|
+
tags: ['mutating', 'creates-resource', 'requires-auth'],
|
|
23
|
+
requires: { auth: true },
|
|
24
|
+
examples: [
|
|
25
|
+
{
|
|
26
|
+
command: getCommand('cloud schedule destination create url sched_abc123 https://example.com'),
|
|
27
|
+
description: 'Create URL destination',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
command: getCommand('cloud schedule destination create url sched_abc123 https://example.com --method POST'),
|
|
31
|
+
description: 'Create URL destination with POST method',
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
schema: {
|
|
35
|
+
args: z.object({
|
|
36
|
+
type: z.enum(['url', 'sandbox']).describe('Destination type (url or sandbox)'),
|
|
37
|
+
schedule_id: z.string().min(1).describe('Schedule ID'),
|
|
38
|
+
target: z.string().min(1).describe('Destination URL or sandbox ID'),
|
|
39
|
+
}),
|
|
40
|
+
options: z.object({
|
|
41
|
+
method: z.string().optional().describe('HTTP method for URL destination'),
|
|
42
|
+
timeout: z.coerce.number().optional().describe('Request timeout in milliseconds'),
|
|
43
|
+
config: z.string().optional().describe('Additional config as JSON object'),
|
|
44
|
+
}),
|
|
45
|
+
response: CreateDestinationResponseSchema,
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
async handler(ctx) {
|
|
49
|
+
const { args, opts, options } = ctx;
|
|
50
|
+
const schedule = await createScheduleAdapter(ctx);
|
|
51
|
+
|
|
52
|
+
if (args.type === 'sandbox' && !args.target.startsWith('sbx_')) {
|
|
53
|
+
tui.fatal('Sandbox target must start with "sbx_"');
|
|
54
|
+
}
|
|
55
|
+
if (args.type === 'url' && !args.target.startsWith('http://') && !args.target.startsWith('https://')) {
|
|
56
|
+
tui.fatal('URL target must start with http:// or https://');
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
let parsedConfig: Record<string, unknown> = {};
|
|
60
|
+
if (opts.config) {
|
|
61
|
+
try {
|
|
62
|
+
parsedConfig = JSON.parse(opts.config) as Record<string, unknown>;
|
|
63
|
+
} catch (e) {
|
|
64
|
+
tui.fatal(`Invalid JSON in --config: ${e instanceof Error ? e.message : String(e)}`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const config: Record<string, unknown> = {
|
|
69
|
+
...parsedConfig,
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
if (args.type === 'url') {
|
|
73
|
+
config.url = args.target;
|
|
74
|
+
}
|
|
75
|
+
if (args.type === 'sandbox') {
|
|
76
|
+
config.sandbox_id = args.target;
|
|
77
|
+
}
|
|
78
|
+
if (opts.method && args.type === 'url') {
|
|
79
|
+
config.method = opts.method;
|
|
80
|
+
}
|
|
81
|
+
if (opts.timeout !== undefined && args.type === 'url') {
|
|
82
|
+
config.timeout = opts.timeout;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const result = await schedule.createDestination(args.schedule_id, {
|
|
86
|
+
type: args.type,
|
|
87
|
+
config,
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
if (!options.json) {
|
|
91
|
+
tui.success(`Created destination: ${result.destination.id}`);
|
|
92
|
+
tui.table(
|
|
93
|
+
[
|
|
94
|
+
{
|
|
95
|
+
ID: result.destination.id,
|
|
96
|
+
Type: result.destination.type,
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
undefined,
|
|
100
|
+
{ layout: 'vertical' }
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
if (result.destination.config && Object.keys(result.destination.config).length > 0) {
|
|
104
|
+
tui.newline();
|
|
105
|
+
tui.header('Config');
|
|
106
|
+
tui.json(result.destination.config);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return result;
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
export default createSubcommand;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createCommand } from '../../../../types';
|
|
3
|
+
import * as tui from '../../../../tui';
|
|
4
|
+
import { createScheduleAdapter } from '../util';
|
|
5
|
+
import { getCommand } from '../../../../command-prefix';
|
|
6
|
+
|
|
7
|
+
const DestinationDeleteResponseSchema = z.object({
|
|
8
|
+
success: z.boolean(),
|
|
9
|
+
destination_id: z.string(),
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export const deleteSubcommand = createCommand({
|
|
13
|
+
name: 'delete',
|
|
14
|
+
aliases: ['rm'],
|
|
15
|
+
description: 'Delete a destination',
|
|
16
|
+
tags: ['destructive', 'deletes-resource', 'slow', 'requires-auth'],
|
|
17
|
+
requires: { auth: true },
|
|
18
|
+
idempotent: true,
|
|
19
|
+
examples: [
|
|
20
|
+
{
|
|
21
|
+
command: getCommand('cloud schedule destination delete sdest_abc456'),
|
|
22
|
+
description: 'Delete destination',
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
schema: {
|
|
26
|
+
args: z.object({
|
|
27
|
+
destination_id: z.string().min(1).describe('Destination ID'),
|
|
28
|
+
}),
|
|
29
|
+
response: DestinationDeleteResponseSchema,
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
async handler(ctx) {
|
|
33
|
+
const { args, options } = ctx;
|
|
34
|
+
const schedule = await createScheduleAdapter(ctx);
|
|
35
|
+
await schedule.deleteDestination(args.destination_id);
|
|
36
|
+
|
|
37
|
+
if (!options.json) {
|
|
38
|
+
tui.success(`Deleted destination: ${args.destination_id}`);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return { success: true, destination_id: args.destination_id };
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
export default deleteSubcommand;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createCommand } from '../../../../types';
|
|
3
|
+
import * as tui from '../../../../tui';
|
|
4
|
+
import { createScheduleAdapter } from '../util';
|
|
5
|
+
import { getCommand } from '../../../../command-prefix';
|
|
6
|
+
|
|
7
|
+
const DestinationGetResponseSchema = z.object({
|
|
8
|
+
destination: z.object({
|
|
9
|
+
id: z.string(),
|
|
10
|
+
schedule_id: z.string(),
|
|
11
|
+
created_at: z.string(),
|
|
12
|
+
updated_at: z.string(),
|
|
13
|
+
created_by: z.string(),
|
|
14
|
+
type: z.enum(['url', 'sandbox']),
|
|
15
|
+
config: z.record(z.string(), z.unknown()),
|
|
16
|
+
}),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export const getSubcommand = createCommand({
|
|
20
|
+
name: 'get',
|
|
21
|
+
description: 'Get destination details',
|
|
22
|
+
tags: ['read-only', 'fast', 'requires-auth'],
|
|
23
|
+
requires: { auth: true },
|
|
24
|
+
idempotent: true,
|
|
25
|
+
examples: [
|
|
26
|
+
{
|
|
27
|
+
command: getCommand('cloud schedule destination get sched_abc123 sdest_abc456'),
|
|
28
|
+
description: 'Get destination details',
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
schema: {
|
|
32
|
+
args: z.object({
|
|
33
|
+
schedule_id: z.string().min(1).describe('Schedule ID'),
|
|
34
|
+
destination_id: z.string().min(1).describe('Destination ID'),
|
|
35
|
+
}),
|
|
36
|
+
response: DestinationGetResponseSchema,
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
async handler(ctx) {
|
|
40
|
+
const { args, options } = ctx;
|
|
41
|
+
const schedule = await createScheduleAdapter(ctx);
|
|
42
|
+
const destination = await schedule.getDestination(args.schedule_id, args.destination_id);
|
|
43
|
+
|
|
44
|
+
if (!options.json) {
|
|
45
|
+
const details: Record<string, unknown> = {
|
|
46
|
+
ID: destination.id,
|
|
47
|
+
'Schedule ID': destination.schedule_id,
|
|
48
|
+
Type: destination.type,
|
|
49
|
+
Created: new Date(destination.created_at).toLocaleString(),
|
|
50
|
+
Updated: new Date(destination.updated_at).toLocaleString(),
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
tui.table([details], undefined, { layout: 'vertical' });
|
|
54
|
+
|
|
55
|
+
if (destination.config && Object.keys(destination.config).length > 0) {
|
|
56
|
+
tui.newline();
|
|
57
|
+
tui.header('Config');
|
|
58
|
+
tui.json(destination.config);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return { destination };
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
export default getSubcommand;
|
|
@@ -0,0 +1,27 @@
|
|
|
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 { getCommand } from '../../../../command-prefix';
|
|
7
|
+
|
|
8
|
+
export const command = createCommand({
|
|
9
|
+
name: 'destination',
|
|
10
|
+
aliases: ['dest'],
|
|
11
|
+
description: 'Manage schedule destinations',
|
|
12
|
+
tags: ['requires-auth'],
|
|
13
|
+
requires: { auth: true },
|
|
14
|
+
subcommands: [createSubcommand, listSubcommand, getSubcommand, deleteSubcommand],
|
|
15
|
+
examples: [
|
|
16
|
+
{
|
|
17
|
+
command: getCommand('cloud schedule destination list sched_abc123'),
|
|
18
|
+
description: 'List destinations',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
command: getCommand('cloud schedule destination create url sched_abc123 https://example.com'),
|
|
22
|
+
description: 'Create URL destination',
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export default command;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createCommand } from '../../../../types';
|
|
3
|
+
import * as tui from '../../../../tui';
|
|
4
|
+
import { createScheduleAdapter } from '../util';
|
|
5
|
+
import { getCommand } from '../../../../command-prefix';
|
|
6
|
+
|
|
7
|
+
const DestinationListResponseSchema = z.object({
|
|
8
|
+
destinations: z.array(
|
|
9
|
+
z.object({
|
|
10
|
+
id: z.string(),
|
|
11
|
+
schedule_id: z.string(),
|
|
12
|
+
created_at: z.string(),
|
|
13
|
+
updated_at: z.string(),
|
|
14
|
+
created_by: z.string(),
|
|
15
|
+
type: z.enum(['url', 'sandbox']),
|
|
16
|
+
config: z.record(z.string(), z.unknown()),
|
|
17
|
+
})
|
|
18
|
+
),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export const listSubcommand = createCommand({
|
|
22
|
+
name: 'list',
|
|
23
|
+
aliases: ['ls'],
|
|
24
|
+
description: 'List destinations for a schedule',
|
|
25
|
+
tags: ['read-only', 'fast', 'requires-auth'],
|
|
26
|
+
requires: { auth: true },
|
|
27
|
+
idempotent: true,
|
|
28
|
+
examples: [
|
|
29
|
+
{
|
|
30
|
+
command: getCommand('cloud schedule destination list sched_abc123'),
|
|
31
|
+
description: 'List schedule destinations',
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
schema: {
|
|
35
|
+
args: z.object({
|
|
36
|
+
schedule_id: z.string().min(1).describe('Schedule ID'),
|
|
37
|
+
}),
|
|
38
|
+
response: DestinationListResponseSchema,
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
async handler(ctx) {
|
|
42
|
+
const { args, options } = ctx;
|
|
43
|
+
const schedule = await createScheduleAdapter(ctx);
|
|
44
|
+
const result = await schedule.get(args.schedule_id);
|
|
45
|
+
|
|
46
|
+
if (!options.json) {
|
|
47
|
+
if (result.destinations.length === 0) {
|
|
48
|
+
tui.info('No destinations configured');
|
|
49
|
+
} else {
|
|
50
|
+
tui.table(
|
|
51
|
+
result.destinations.map((destination: {
|
|
52
|
+
id: string;
|
|
53
|
+
type: 'url' | 'sandbox';
|
|
54
|
+
config: Record<string, unknown>;
|
|
55
|
+
created_at: string;
|
|
56
|
+
}) => {
|
|
57
|
+
const configDisplay =
|
|
58
|
+
destination.type === 'url' && destination.config?.url
|
|
59
|
+
? String(destination.config.url)
|
|
60
|
+
: JSON.stringify(destination.config);
|
|
61
|
+
return {
|
|
62
|
+
ID: destination.id,
|
|
63
|
+
Type: destination.type,
|
|
64
|
+
URL: configDisplay,
|
|
65
|
+
Created: new Date(destination.created_at).toLocaleString(),
|
|
66
|
+
};
|
|
67
|
+
}),
|
|
68
|
+
['ID', 'Type', 'URL', 'Created']
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return { destinations: result.destinations };
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
export default listSubcommand;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createCommand } from '../../../types';
|
|
3
|
+
import * as tui from '../../../tui';
|
|
4
|
+
import { createScheduleAdapter } from './util';
|
|
5
|
+
import { getCommand } from '../../../command-prefix';
|
|
6
|
+
|
|
7
|
+
const ScheduleGetResponseSchema = z.object({
|
|
8
|
+
schedule: z.object({
|
|
9
|
+
id: z.string(),
|
|
10
|
+
created_at: z.string(),
|
|
11
|
+
updated_at: z.string(),
|
|
12
|
+
created_by: z.string(),
|
|
13
|
+
name: z.string(),
|
|
14
|
+
description: z.string().nullable(),
|
|
15
|
+
expression: z.string(),
|
|
16
|
+
due_date: z.string(),
|
|
17
|
+
}),
|
|
18
|
+
destinations: z.array(
|
|
19
|
+
z.object({
|
|
20
|
+
id: z.string(),
|
|
21
|
+
schedule_id: z.string(),
|
|
22
|
+
created_at: z.string(),
|
|
23
|
+
updated_at: z.string(),
|
|
24
|
+
created_by: z.string(),
|
|
25
|
+
type: z.enum(['url', 'sandbox']),
|
|
26
|
+
config: z.record(z.string(), z.unknown()),
|
|
27
|
+
})
|
|
28
|
+
),
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export const getSubcommand = createCommand({
|
|
32
|
+
name: 'get',
|
|
33
|
+
description: 'Get schedule details',
|
|
34
|
+
tags: ['read-only', 'fast', 'requires-auth'],
|
|
35
|
+
requires: { auth: true },
|
|
36
|
+
idempotent: true,
|
|
37
|
+
examples: [
|
|
38
|
+
{ command: getCommand('cloud schedule get sched_abc123'), description: 'Get schedule details' },
|
|
39
|
+
],
|
|
40
|
+
schema: {
|
|
41
|
+
args: z.object({
|
|
42
|
+
schedule_id: z.string().min(1).describe('Schedule ID'),
|
|
43
|
+
}),
|
|
44
|
+
response: ScheduleGetResponseSchema,
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
async handler(ctx) {
|
|
48
|
+
const { args, options } = ctx;
|
|
49
|
+
const schedule = await createScheduleAdapter(ctx);
|
|
50
|
+
const result = await schedule.get(args.schedule_id);
|
|
51
|
+
|
|
52
|
+
if (!options.json) {
|
|
53
|
+
const details: Record<string, unknown> = {
|
|
54
|
+
Name: result.schedule.name,
|
|
55
|
+
ID: result.schedule.id,
|
|
56
|
+
Expression: result.schedule.expression,
|
|
57
|
+
Description: result.schedule.description || '-',
|
|
58
|
+
'Next Due': result.schedule.due_date,
|
|
59
|
+
Created: new Date(result.schedule.created_at).toLocaleString(),
|
|
60
|
+
Updated: new Date(result.schedule.updated_at).toLocaleString(),
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
tui.table([details], undefined, { layout: 'vertical', padStart: ' ' });
|
|
64
|
+
|
|
65
|
+
tui.newline();
|
|
66
|
+
tui.header('Destinations');
|
|
67
|
+
if (result.destinations.length === 0) {
|
|
68
|
+
tui.info('No destinations configured');
|
|
69
|
+
} else {
|
|
70
|
+
tui.table(
|
|
71
|
+
result.destinations.map((destination: {
|
|
72
|
+
id: string;
|
|
73
|
+
type: 'url' | 'sandbox';
|
|
74
|
+
config: Record<string, unknown>;
|
|
75
|
+
created_at: string;
|
|
76
|
+
}) => {
|
|
77
|
+
const configDisplay =
|
|
78
|
+
destination.type === 'url' && destination.config?.url
|
|
79
|
+
? String(destination.config.url)
|
|
80
|
+
: JSON.stringify(destination.config);
|
|
81
|
+
return {
|
|
82
|
+
ID: destination.id,
|
|
83
|
+
Type: destination.type,
|
|
84
|
+
URL: configDisplay,
|
|
85
|
+
Created: new Date(destination.created_at).toLocaleString(),
|
|
86
|
+
};
|
|
87
|
+
}),
|
|
88
|
+
['ID', 'Type', 'URL', 'Created']
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return result;
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
export default getSubcommand;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { createCommand } from '../../../types';
|
|
2
|
+
import { listSubcommand } from './list';
|
|
3
|
+
import { createSubcommand } from './create';
|
|
4
|
+
import { getSubcommand } from './get';
|
|
5
|
+
import { deleteSubcommand } from './delete';
|
|
6
|
+
import { updateSubcommand } from './update';
|
|
7
|
+
import destinationSubcommand from './destination';
|
|
8
|
+
import deliverySubcommand from './delivery';
|
|
9
|
+
import { statsSubcommand } from './stats';
|
|
10
|
+
import { getCommand } from '../../../command-prefix';
|
|
11
|
+
|
|
12
|
+
export const command = createCommand({
|
|
13
|
+
name: 'schedule',
|
|
14
|
+
aliases: ['schedules', 'sched'],
|
|
15
|
+
description: 'Manage scheduled tasks',
|
|
16
|
+
tags: ['requires-auth'],
|
|
17
|
+
requires: { auth: true },
|
|
18
|
+
subcommands: [
|
|
19
|
+
listSubcommand,
|
|
20
|
+
createSubcommand,
|
|
21
|
+
getSubcommand,
|
|
22
|
+
deleteSubcommand,
|
|
23
|
+
updateSubcommand,
|
|
24
|
+
destinationSubcommand,
|
|
25
|
+
deliverySubcommand,
|
|
26
|
+
statsSubcommand,
|
|
27
|
+
],
|
|
28
|
+
examples: [
|
|
29
|
+
{ command: getCommand('cloud schedule list'), description: 'List schedules' },
|
|
30
|
+
{
|
|
31
|
+
command: getCommand("cloud schedule create --name nightly --expression '0 0 * * *'"),
|
|
32
|
+
description: 'Create a schedule',
|
|
33
|
+
},
|
|
34
|
+
{ command: getCommand('cloud schedule get sched_abc123'), description: 'Get schedule details' },
|
|
35
|
+
],
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export default command;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createCommand } from '../../../types';
|
|
3
|
+
import * as tui from '../../../tui';
|
|
4
|
+
import { createScheduleAdapter } from './util';
|
|
5
|
+
import { getCommand } from '../../../command-prefix';
|
|
6
|
+
|
|
7
|
+
const ScheduleListResponseSchema = z.object({
|
|
8
|
+
schedules: z.array(
|
|
9
|
+
z.object({
|
|
10
|
+
id: z.string(),
|
|
11
|
+
created_at: z.string(),
|
|
12
|
+
updated_at: z.string(),
|
|
13
|
+
created_by: z.string(),
|
|
14
|
+
name: z.string(),
|
|
15
|
+
description: z.string().nullable(),
|
|
16
|
+
expression: z.string(),
|
|
17
|
+
due_date: z.string(),
|
|
18
|
+
})
|
|
19
|
+
),
|
|
20
|
+
total: z.number(),
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export const listSubcommand = createCommand({
|
|
24
|
+
name: 'list',
|
|
25
|
+
aliases: ['ls'],
|
|
26
|
+
description: 'List schedules',
|
|
27
|
+
tags: ['read-only', 'fast', 'requires-auth'],
|
|
28
|
+
requires: { auth: true },
|
|
29
|
+
idempotent: true,
|
|
30
|
+
examples: [
|
|
31
|
+
{ command: getCommand('cloud schedule list'), description: 'List schedules' },
|
|
32
|
+
{ command: getCommand('cloud schedule list --limit 20'), description: 'List 20 schedules' },
|
|
33
|
+
],
|
|
34
|
+
schema: {
|
|
35
|
+
options: z.object({
|
|
36
|
+
limit: z.coerce.number().min(0).optional().describe('Maximum number of schedules'),
|
|
37
|
+
offset: z.coerce.number().min(0).optional().describe('Pagination offset'),
|
|
38
|
+
}),
|
|
39
|
+
response: ScheduleListResponseSchema,
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
async handler(ctx) {
|
|
43
|
+
const { opts, options } = ctx;
|
|
44
|
+
const schedule = await createScheduleAdapter(ctx);
|
|
45
|
+
const result = await schedule.list({ limit: opts.limit, offset: opts.offset });
|
|
46
|
+
|
|
47
|
+
if (!options.json) {
|
|
48
|
+
if (result.schedules.length === 0) {
|
|
49
|
+
tui.info('No schedules found');
|
|
50
|
+
} else {
|
|
51
|
+
tui.table(
|
|
52
|
+
result.schedules.map((item: {
|
|
53
|
+
id: string;
|
|
54
|
+
created_at: string;
|
|
55
|
+
updated_at: string;
|
|
56
|
+
created_by: string;
|
|
57
|
+
name: string;
|
|
58
|
+
description: string | null;
|
|
59
|
+
expression: string;
|
|
60
|
+
due_date: string;
|
|
61
|
+
}) => ({
|
|
62
|
+
Name: item.name,
|
|
63
|
+
ID: item.id,
|
|
64
|
+
Expression: item.expression,
|
|
65
|
+
'Next Due': item.due_date,
|
|
66
|
+
Created: new Date(item.created_at).toLocaleString(),
|
|
67
|
+
})),
|
|
68
|
+
['Name', 'ID', 'Expression', 'Next Due', 'Created']
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return result;
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
export default listSubcommand;
|
|
@@ -0,0 +1,74 @@
|
|
|
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.schedule;
|
|
16
|
+
if (!svc) {
|
|
17
|
+
tui.info('No schedule data found.');
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
tui.header('Schedule Statistics');
|
|
21
|
+
tui.newline();
|
|
22
|
+
console.log(
|
|
23
|
+
` ${tui.muted('Schedules:')} ${formatNumber(svc.scheduleCount)}`
|
|
24
|
+
);
|
|
25
|
+
console.log(
|
|
26
|
+
` ${tui.muted('Deliveries:')} ${formatNumber(svc.totalDeliveries)} (${svc.successDeliveries} ok, ${svc.failedDeliveries} failed)`
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const statsSubcommand = createCommand({
|
|
31
|
+
name: 'stats',
|
|
32
|
+
description: 'View schedule statistics',
|
|
33
|
+
tags: ['read-only', 'requires-auth'],
|
|
34
|
+
requires: { auth: true, org: true },
|
|
35
|
+
examples: [
|
|
36
|
+
{
|
|
37
|
+
command: getCommand('cloud schedule stats'),
|
|
38
|
+
description: 'View schedule statistics',
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
schema: {
|
|
42
|
+
options: z.object({
|
|
43
|
+
start: z.string().optional().describe('Start time (ISO 8601)'),
|
|
44
|
+
end: z.string().optional().describe('End time (ISO 8601)'),
|
|
45
|
+
}),
|
|
46
|
+
},
|
|
47
|
+
idempotent: true,
|
|
48
|
+
|
|
49
|
+
async handler(ctx) {
|
|
50
|
+
const { opts, options } = ctx;
|
|
51
|
+
const client = await getGlobalCatalystAPIClient(ctx.logger, ctx.auth, ctx.config?.name);
|
|
52
|
+
const orgId = ctx.orgId ?? ctx.options.orgId ?? ctx.config?.preferences?.orgId;
|
|
53
|
+
|
|
54
|
+
if (!orgId) {
|
|
55
|
+
ctx.logger.fatal('Organization ID is required. Use --org-id or set a preferred org.');
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const data = await getServiceStats(client, orgId, {
|
|
60
|
+
service: 'schedule',
|
|
61
|
+
start: opts.start,
|
|
62
|
+
end: opts.end,
|
|
63
|
+
orgIdHeader: orgId,
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
if (!options.json) {
|
|
67
|
+
displayStats(data);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return data;
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
export default statsSubcommand;
|