feat: add monthly granularity to emails.metrics()
Merged
DI
3mo ago+1+1+0123456789-1-1-0123456789
Summary
- Adds
'monthly'toEmailMetricsGranularity, matching the API's newgranularity=monthlyoption onGET /emails/metrics. - Straight passthrough (no client-side branching on this value), same as the existing
hourly/daily/weeklyoptions — no new test added, consistent with how those are covered. - Depends on resend/resend-monorepo#7953 (and resend/resend-analytics#118) being live before
monthlyrequests return correctly. - Based on
preview-headless-dashboardsince that's the branch carryingemails.metrics().
Test plan
-
pnpm run lint— passes -
pnpm run typecheck— pre-existingmoduleResolution=node10deprecation 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#7953andresend/resend-analytics#118to be live for monthly results to return.
- Requires backend support in