fix(emails): flatten metrics filter query params

Merged
DI
3mo ago
+5-5

Summary

  • The public-api's /emails/metrics endpoint now accepts domain_id/email_id as flat query params instead of filter[domain_id]/filter[email_id] (resend/resend-monorepo#7974).
  • Updates buildMetricsQuery in src/emails/emails.ts to 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.ts expected 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.