fix(emails): flatten metrics filter query params
Merged
DI
3mo ago+5+5+0123456789-5-5-0123456789
Summary
- The public-api's
/emails/metricsendpoint now acceptsdomain_id/email_idas flat query params instead offilter[domain_id]/filter[email_id](resend/resend-monorepo#7974). - Updates
buildMetricsQueryinsrc/emails/emails.tsto send the flat params. The public SDK option shape (filter: { domainId, emailId }) is unchanged — only the wire format sent to the API changed.
Test plan
- Updated
emails.spec.tsexpected request URLs to the flat param format -
vitest run src/emails/emails.spec.ts— 33 passing -
biome check— clean
Summary by cubic
Flattened /emails/metrics query params to use domain_id and email_id instead of filter[domain_id] and filter[email_id], matching the public API contract. Updated buildMetricsQuery to send the flat params; the SDK option shape (filter: { domainId, emailId }) remains unchanged.