feat(api): add inbox-scoped public API for conversations, messages, saved replies, and teams - #1131
Open
realcodesiman wants to merge 1 commit into
Open
feat(api): add inbox-scoped public API for conversations, messages, saved replies, and teams#1131realcodesiman wants to merge 1 commit into
realcodesiman wants to merge 1 commit into
Conversation
…aved replies, and teams Adds workspace-token endpoints under the `inbox` scope covering conversation assignment/archiving/read-follow-bot actions, conversation-scoped messages (list/get/create/edit/delete/attributes), saved replies CRUD, and enterprise team CRUD/membership — each handler delegates to the same business-layer service method the private UI action already calls. Also fixes a missing workspaceId scope on conversationService.updateAssignment's bulk WHERE clause, which would have made the new assignment endpoint a cross-tenant write. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Summary
inboxAPI scope: conversation actions (assign, archive/unarchive, read/unread, follow/unfollow, enable/disable bot), conversation-scoped messages (list/get/create/edit/delete/attributes), saved replies CRUD, and enterprise team CRUD/membership.conversationService.updateAssignment's bulkWHEREclause, which was missing aworkspaceIdscope — an oversight that would have made the new public assignment endpoint a cross-tenant write.Changes
apps/builder/src/features/conversations/api/public.ts,schema/public.ts— conversation action endpointsapps/builder/src/features/messages/api/public.ts,schema/public.ts— message CRUD endpoints (new)apps/builder/src/features/saved-replies/api/public.ts— saved reply CRUD endpointsapps/builder/src/enterprise/features/inbox-teams/api/public.ts— team CRUD/membership endpointsapps/builder/src/routers/public.ts— registers the newmessagespublic routerpackages/business/src/conversation/service.ts— scopesupdateAssignment's WHERE byworkspaceIdpackages/business/src/enterprise/inbox-team/service.ts—createnow returns the created teampackages/business/src/saved-reply/service.ts— addsfindByIdOrFaildocs/developer/workspace-api-tokens.md— documents the inbox scope endpoint-to-scope table and invariants__tests__/conversations-public-api.test.ts,conversations-public-scope.test.ts,inbox-teams-public-api.test.ts,messages-public-api.test.ts,saved-replies-public-api.test.tsTest plan
pnpm lintpnpm --filter builder check-typespnpm --filter builder vitest runon the new/changed test files (58 passed)pnpm --filter @chatbotx.io/business testfor conversation/saved-reply/inbox-team services (2144 passed)🤖 Generated with Claude Code