Repository navigation
feat: add analyticsPages, retryAfter on server errors and the latest API types - #37
Merged
Merged
Conversation
Spec: lettermint/lettermint@bff20c7d86. - POST /analytics documents 503 and 504. - POST /messages/{messageId}/cancel documents 403. - The analytics filter dimension loses smtp_response_group. The API rejects it as a filter; it stays a group dimension. - Description updates.
- analyticsPages(query) follows pagination.next_cursor and yields one whole analytics response per request. - ServerError carries retryAfter when a 5xx response has a Retry-After header, as an analytics 503 can. - Document analytics in the README and test it against realistic responses.
bjornftw
approved these changes
Oct 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
A non-breaking update for 3.1.0, with one exception in analytics (see below).
lettermint.analyticsPages(query, options?)is new. It followspagination.next_cursorand yields one wholeAnalyticsResponseper request, so each page keeps itsmetaandpagination. It never changes the query you pass in, and it stops when the API returns no cursor or repeats one.ServerError.retryAfteris new. It holds the seconds from aRetry-Afterheader on any 5xx response; an analytics503can send one. It isundefinedwithout the header.retryAfteronServerError.API changes in the regenerated types
POST /analytics503and504POST /messages/{messageId}/cancel403AnalyticsCatalogueDimension(filter dimensions)'smtp_response_group'The one breaking change: analytics filter dimension
'smtp_response_group'is no longer a member ofAnalyticsCatalogueDimension. The API rejects it as a filter with a422; it is still valid ingroup_by.AnalyticsDimensionis an open union (AnalyticsCatalogueDimension | string), so code that passes the value still compiles; only code that names the literal throughAnalyticsCatalogueDimensionis affected.Compared with the published 3.0.0 type declarations, that is the only removal. The rest of the difference is the new method, the new property and the added error statuses.
Checks
npm run lint,npm run type-check,npm run generate:check: pass.npm run test:coverage: 313 tests pass (13 new).npm run buildandnpm run test:smoke(ESM, CJS and type declarations): pass.--strictagainst this branch: 42 of 42 pass, the same as the 3.0.0 baseline.Suggested release tag:
v3.1.0.🤖 Generated with Claude Code