Repository navigation
feat(api): Add a type-only ApiRoutes map by path and method - #131221
Merged
Merged
Conversation
Generate ApiRoutes from the SDK operations: each canonical path and HTTP method maps to the operation's name, Data type, and status-keyed Responses and Errors. Callers that build requests from a path, such as the frontend's apiOptions, can infer types without importing an operation function. Refs #131202 Co-Authored-By: BYK <[email protected]>
BYK
approved these changes
Nov 16, 2026
2 tasks done
This branch was successfully deployed
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.
This is the SDK half of #131202.
@sentry/apinow exportsApiRoutes, a type-only interface generated from the SDK operations. It's keyed by canonical path (relative toAPI_BASE_PATH) and then by HTTP method. Each entry gives the operation's name, its<Operation>Datatype, and its status-keyed<Operation>Responsesand<Operation>Errors. Operations with no documented errors get{}.scripts/generate-api-routes.mjsbuilds the interface with the TypeScript factory fromsdk.gen.tsandtypes.gen.ts. It runs as a build step, and the root entry re-exports it withexport type, so it adds no runtime code.A separate frontend PR will use this map in
apiOptions/apiOptionsInfinite. That PR maps{organization_id_or_slug}to the frontend's$organizationIdOrSlugroutes and removes thetodo: infer the actual data type from the ApiMappingcomments that the map covers.via @BYK.
--
View Session [Sentry]