Skip to content

feat: add analyticsPages, retryAfter on server errors and the latest API types - #37

Merged
bjarn merged 2 commits into
mainfrom
feat/spec-update-2026-10
Oct 11, 2026
Merged

bjarn merged 2 commits into
mainfrom
feat/spec-update-2026-10

Conversation

@bjarn

@bjarn bjarn commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

What changed

A non-breaking update for 3.1.0, with one exception in analytics (see below).

  • Types regenerated from the latest Lettermint API specification.
  • lettermint.analyticsPages(query, options?) is new. It follows pagination.next_cursor and yields one whole AnalyticsResponse per request, so each page keeps its meta and pagination. It never changes the query you pass in, and it stops when the API returns no cursor or repeats one.
  • ServerError.retryAfter is new. It holds the seconds from a Retry-After header on any 5xx response; an analytics 503 can send one. It is undefined without the header.
  • README has an Analytics section, and the Errors table lists retryAfter on ServerError.

API changes in the regenerated types

Where Change
POST /analytics Documents 503 and 504
POST /messages/{messageId}/cancel Documents 403
AnalyticsCatalogueDimension (filter dimensions) Loses 'smtp_response_group'
Other Description updates only

The one breaking change: analytics filter dimension

'smtp_response_group' is no longer a member of AnalyticsCatalogueDimension. The API rejects it as a filter with a 422; it is still valid in group_by. AnalyticsDimension is an open union (AnalyticsCatalogueDimension | string), so code that passes the value still compiles; only code that names the literal through AnalyticsCatalogueDimension is 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 build and npm run test:smoke (ESM, CJS and type declarations): pass.
  • Conformance suite, --strict against this branch: 42 of 42 pass, the same as the 3.0.0 baseline.

Suggested release tag: v3.1.0.

🤖 Generated with Claude Code

bjarn added 2 commits October 10, 2026 20:32
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.
@bjarn
bjarn requested a review from a team as a code owner October 10, 2026 18:40
@bjarn
bjarn merged commit de8b03b into main Oct 11, 2026
4 checks passed
@bjarn
bjarn deleted the feat/spec-update-2026-10 branch October 11, 2026 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants