feat(pagination): export SdkResult type for consumer use#74
Merged
Conversation
SdkResult was a private local type used only by the pagination helpers. Exporting it lets downstream consumers (e.g. sentry-mcp) write properly-typed result-unwrapping wrappers without falling back to `any`. Co-authored-by: Miguel Betegon <miguel.betegon@sentry.io>
2 tasks
MathurAditya724
added a commit
to getsentry/sentry-mcp
that referenced
this pull request
Jun 3, 2026
Bump @sentry/api to ^0.172.0 which exports the SdkResult type from getsentry/sentry-api-schema#74. The SDK functions return RequestResult whose conditional generic encoding (TData[keyof TData]) is not structurally assignable to SdkResult, so unwrapSdkResult keeps `any` for the parameter type. Updated the JSDoc to reference SdkResult as the runtime contract and explain why the type mismatch exists. Co-Authored-By: Claude (claude-opus-4-6)
dcramer
pushed a commit
to getsentry/sentry-mcp
that referenced
this pull request
Jun 12, 2026
Bump @sentry/api to ^0.172.0 which exports the SdkResult type from getsentry/sentry-api-schema#74. The SDK functions return RequestResult whose conditional generic encoding (TData[keyof TData]) is not structurally assignable to SdkResult, so unwrapSdkResult keeps `any` for the parameter type. Updated the JSDoc to reference SdkResult as the runtime contract and explain why the type mismatch exists. Co-Authored-By: Claude (claude-opus-4-6)
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
Exports
SdkResult<TData, TError>fromsentry-pagination.ts(and the package root).Previously it was a private type used only by the pagination helpers internally.
Why
Downstream consumers that call
@sentry/apiSDK functions need the result type to write tightly-typed unwrapping helpers. Without this export they fall back toresult: any, which TypeScript trusts the genericTon even though the actual discriminated-union shape is never verified.With
SdkResultexported, consumers can write:This is the immediate follow-up to getsentry/sentry-mcp#931, where
unwrapSdkResultcurrently usesresult: any.Changes
lib/sentry-pagination.ts: addexporttoSdkResultbuild.mjs: includeSdkResultin theexport type { ... }line appended tosrc/index.tsduring buildNo logic changes.
View Session in Sentry