feat: add monthly granularity to emails.metrics()

Merged
DI
3mo ago
+1-1

Summary

  • Adds 'monthly' to EmailMetricsGranularity, matching the API's new granularity=monthly option on GET /emails/metrics.
  • Straight passthrough (no client-side branching on this value), same as the existing hourly/daily/weekly options — no new test added, consistent with how those are covered.
  • Depends on resend/resend-monorepo#7953 (and resend/resend-analytics#118) being live before monthly requests return correctly.
  • Based on preview-headless-dashboard since that's the branch carrying emails.metrics().

Test plan

  • pnpm run lint — passes
  • pnpm run typecheck — pre-existing moduleResolution=node10 deprecation warning unrelated to this change; no new errors

Summary by cubic

Adds monthly granularity to emails.metrics() to match GET /emails/metrics?granularity=monthly. Passthrough change with no client-side branching.

  • Dependencies
    • Requires backend support in resend/resend-monorepo#7953 and resend/resend-analytics#118 to be live for monthly results to return.