feat(broadcasts): add recipients command - #369
Conversation
There was a problem hiding this comment.
1 issue found across 7 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="tests/commands/broadcasts/recipients.test.ts">
<violation number="1" location="tests/commands/broadcasts/recipients.test.ts:138">
P3: The interactive path is never exercised: every test forces non-interactive mode (setupOutputSpies/setNonInteractive), so the table rendering (renderBroadcastRecipientsTable) and the pagination-hint branch of printPaginationHint called from the recipients command are untested. The mock also always returns has_more:false. Add one test with isTTY true (interactive) and has_more:true asserting the table output and the ‘Fetch the next page’ hint including --type/--limit flags.</violation>
</file>
Tip: instead of fixing issues one by one fix them all with cubic
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 3 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 1 file (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Fix all with cubic | Re-trigger cubic
| 'resend broadcasts send d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6', | ||
| 'resend broadcasts send d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --scheduled-at "in 1 hour"', | ||
| 'resend broadcasts get d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6', | ||
| 'resend broadcasts recipients d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --type opened', |
There was a problem hiding this comment.
i don't think we can do much about this, or have another option, and this is probably the pattern for the other commands, but it feels slightly weird to put the broadcast ID right after the recipients command
There was a problem hiding this comment.
yeah, I think in this case worth a redesign of all commands to actually receive it as --broadcast-id param? I also found it not very intuitive. but would be a breaking change how other commands are working, still worth a major version updating it, not the best API design.
List a broadcast's recipients filtered by event type (sent, delivered, opened, clicked, bounced, complained, unsubscribed, suppressed), with optional email substring and bounce-type filters plus cursor pagination. Bumps the resend dependency to 6.22.0, which introduces broadcasts.recipients().
0210d86 to
3e42538
Compare
Adds `resend broadcasts recipients ` for GET /broadcasts/{id}/recipients.
Tests: 1114 passed. Lint/typecheck clean.
Summary by cubic
Adds
resend broadcasts recipients <id>to list a broadcast’s recipients by event type, enabling recipient inspection that was previously not possible. Usesresend6.22.0 to callbroadcasts.recipients().--typeis required (non-interactive) withsent|delivered|opened|clicked|bounced|complained|unsubscribed|suppressed. Optional--email(substring filter) and--bounce-type(permanent|transient|undetermined, only meaningful with--type bounced).--limit(1–100, default 20),--after,--before. Interactive mode prints a table and pagination hints; hints do not shell-quote--email. Table renders missing counts as-.count,bounce_type,clicked_links). Adds docs and tests for validation, pagination, and SDK errors. Note: responses may be cached for up to 15 minutes.Written for commit 3e42538. Summary will update on new commits.