feat(webhooks): events + logs subcommands, agent scope, expanded even… - #4
Conversation
…t catalog (0.3.0)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughWebhook commands now support expanded event catalogs, agent-scoped subscriptions, wildcard events, live catalog retrieval, account-wide delivery logs, pagination, filtering, and revised delivery statistics. ChangesWebhook command expansion
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant CLI
participant webhooksEventsCommand
participant WebhookAPI
participant CLIOutput
CLI->>webhooksEventsCommand: Run events command
webhooksEventsCommand->>WebhookAPI: Fetch live event catalog
WebhookAPI-->>webhooksEventsCommand: Return catalog response
webhooksEventsCommand->>CLIOutput: Render sorted table or JSON
sequenceDiagram
participant CLI
participant webhooksLogsCommand
participant WebhookAPI
participant CLIOutput
CLI->>webhooksLogsCommand: Run logs with filters and cursor
webhooksLogsCommand->>webhooksLogsCommand: Validate filters before I/O
webhooksLogsCommand->>WebhookAPI: Query account-wide delivery logs
WebhookAPI-->>webhooksLogsCommand: Return deliveries and pagination state
webhooksLogsCommand->>CLIOutput: Render results and next-page hints
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/commands/webhooks.ts`:
- Around line 648-658: Update the webhook CLI help text near the events
description to generate its event-name list from the existing ALLOWED_EVENTS
symbol instead of maintaining a hardcoded duplicate. Preserve the documented
wildcard syntax and formatting while ensuring future additions to ALLOWED_EVENTS
are reflected automatically.
- Line 537: Validate flags.status in the webhook command before constructing or
sending the API request, accepting only retrying, success, and failed. Throw
UsageError for any other value, and add a regression test verifying invalid
status input makes no API request.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 3b6950d6-c2b3-46ff-8a89-651573c00768
📒 Files selected for processing (3)
package.jsonsrc/commands/webhooks.tstest/webhooks.test.ts
- validate --status before any network call (pending/retrying/success/failed) - derive the webhooks help event list from ALLOWED_EVENTS to prevent drift
…t catalog (0.3.0)
Summary by CodeRabbit