You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 423bfa2
Browse filesBrowse the repository at this point in the historyBrowse files
feat: update @sentry/api to 0.133.0 and adopt pagination improvements (#915)
Update `@sentry/api` from 0.113.0 to 0.133.0 and adopt the new
pagination type improvements. This eliminates 5 unsafe `as { cursor?:
string }` casts, replaces 2 manual pagination loops with `autoPaginate`,
and adds `prevCursor` support to `PaginatedResponse`.
## Changes
- **`@sentry/api` ^0.133.0** — includes pagination wrappers
(`fetchPage_*`, `paginateAll_*`, `paginateUpTo_*`), widened query types
(`cursor` + `per_page` now typed), and `prevCursor` in link header
parsing
- **infrastructure.ts** — `PaginatedResponse<T>` gains `prevCursor?:
string`; `unwrapPaginatedResult` passes it through
- **projects.ts** — manual 30-line pagination loop → `autoPaginate`
one-liner; casts cleaned up
- **repositories.ts** — manual 15-line pagination loop → `autoPaginate`;
casts cleaned up
- **teams.ts, releases.ts, issues.ts, events.ts** — `as { cursor?:
string }` casts narrowed/removed; multi-line result casts collapsed
## What's NOT migrated (follow-up)
`traces.ts`, `discover.ts`, and `dashboards.ts` widget queries stay on
raw `apiRequestToRegion` — they use Zod validation schemas and the SDK
wrappers' error handling (plain `Error`) is incompatible with the CLI's
`ApiError`/`AuthError` pipeline.
## Testing
- `bun test test/lib/api-client.coverage.test.ts` — 91/91 pass
- `npx tsc --noEmit` — clean (no new errors)
<!--
## Plan
1. Bump @sentry/api from 0.113.0 to 0.133.0
2. Add prevCursor to PaginatedResponse type and unwrapPaginatedResult
3. Replace manual pagination loops in listProjects() and
listAllRepositories() with autoPaginate
4. Clean up as { cursor?: string } casts — cursor and per_page are now
in SDK query types
5. Remove unnecessary multi-line result casts
6. Keep CLI's own unwrapPaginatedResult (not SDK's) for
ApiError/AuthError preservation
7. Leave traces.ts/discover.ts/dashboards.ts raw call sites for
follow-up (Zod validation + error type incompatibility)
-->
---------
Co-authored-by: Sentry Bot <bot@sentry.io>
0 commit comments