Repository navigation
ref(mcp): Call shared team and project endpoints from SentryApiService - #1828
Merged
Merged
Conversation
Adds endpoints/teams and endpoints/projects to toolkit-core's shared API client, moved as is from SentryApiService, which now calls them with its Zod schemas. Endpoint tests share a scripted-transport helper. Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
BYK
approved these changes
Nov 3, 2026
BYK
pushed a commit
that referenced
this pull request
Nov 3, 2026
#1834) Task 8.4 of the shared API client plan ([#1669](#1669)). This is stacked on #1828. This moves the project setup endpoints from `SentryApiService` into `toolkit-core`'s `api-client/endpoints/`. `SentryApiService` calls them with its Zod schemas. The code moves as is. - `endpoints/client-keys`: `listClientKeys`, `createClientKey`, and `updateClientKey`. `updateClientKey` still sends only the fields that are set, and keeps an explicit `rateLimit: null`. `SentryApiService.updateClientKey` now takes the shared `UpdateClientKeyParams` type, and its local request types are deleted. - `endpoints/repositories`: `listRepositories`, which walks every page, and `linkProjectRepository`, which sends the bulk code-mapping POST with one root mapping. - `endpoints/organizations` gains `updateAgenticOnboardingStatus`. `@sentry/api` has no operation for `POST /organizations/{org}/onboarding/agent/status/`, so that wrapper will stay hand-written. **One change in behaviour:** as with #1741, a response that fails its schema now throws the shared `ApiResponseValidationError` instead of a `ZodError`. <!-- junior-request-attribution:start --> via @BYK. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3Ab061171f2ec2e6cf6f09a6828cadc9fa --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3Ab061171f2ec2e6cf6f09a6828cadc9fa) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3Ab061171f2ec2e6cf6f09a6828cadc9fa/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
This branch was previously 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.
Task 8.4 of the shared API client plan (#1669): the next domain after organizations (#1741).
This moves the team and project endpoints from
SentryApiServiceintotoolkit-core'sapi-client/endpoints/.SentryApiServicenow calls them with its Zod schemas. The code moves as is.Changes
endpoints/teamsaddslistTeams(on@sentry/api'slistOrganizationTeams) andcreateTeam.endpoints/projectsaddslistProjects(onlistOrganizationProjects),getProject,createProject,updateProject, and the project's teams:listProjectTeams,addProjectTeam, andremoveProjectTeam.sdkClientonly sends GETs.getProjectandlistProjectTeamskeep their hand-built requests.@sentry/apihas operations for both (getProject,listProjectTeams), but moving them onto those operations is a separate change.nextPageCursor(response).listPageandlistProjectTeamsuse it, and the next domains will too.toolkit-core/src/test-utils/. That folder is left out of the browser typecheck, andorganizations.test.tsuses the helper now as well.One change in behaviour: as with #1741, a response that fails its schema in these calls now throws the shared
ApiResponseValidationErrorinstead of aZodError. Both still reach the tool error handler as unexpected errors.via @BYK.
--
View Session [Sentry]