refactor(builder): move zalo, tiktok, telegram, webchat, smtp data access into business - #1097
Open
realcodesiman wants to merge 1 commit into
Open
refactor(builder): move zalo, tiktok, telegram, webchat, smtp data access into business#1097realcodesiman wants to merge 1 commit into
realcodesiman wants to merge 1 commit into
Conversation
…cess into business Removes direct db usage from the non-Meta channel integrations (zalo, tiktok, telegram, webchat, smtp, google-sheets, the AI integration gate and the public webchat page) per .agents/rules/data-access.md. - add connect/disconnect/list methods to the existing integration services; disconnect methods open their own transaction when no tx is supplied - telegram connect keeps webhook registration inside the transaction via an onConnected callback so a failed registration still rolls back - smtp: transport verification and host/port resolution stay in the builder (business does not depend on @chatbotx.io/mail or @chatbotx.io/integration-smtp); services/ dir replaced by lib/ - delete dead exports findIntegrationZalo/Tiktok/Telegram/Smtp and listAIIntegrations (zero callers)
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
db.*call from the non-Meta channel integrations in the builder (Zalo, TikTok, Telegram, webchat, SMTP, Google Sheets disconnect, the AI-integration gate, and the public webchat widget page) per.agents/rules/data-access.md.main. This one needs no barrel edits at all.Changes
packages/business/src/integration-{zalo,tiktok,telegram,webchat,smtp,google-sheet,integration}/service.ts: newconnect/disconnect/list*/findBy*/updatemethods appended to the existing services. Disconnect methods open their own transaction when notxis supplied.connectkeeps webhook registration inside the transaction through anonConnectedcallback, so a failed registration still rolls back (pinned bypackages/business/__tests__/integration-telegram-service.test.ts).apps/builder/src/features/integration-smtp/lib/because business does not depend on@chatbotx.io/mailor@chatbotx.io/integration-smtp. The ad-hocservices/directory is removed.findIntegrationZalo,findIntegrationTiktok,findIntegrationTelegram,findIntegrationSmtp,listAIIntegrations.packages/business/__tests__/integration-{zalo,tiktok,telegram,webchat,smtp}-service.test.ts,apps/builder/__tests__/{smtp-actions-thin,google-sheets-disconnect-action}.test.ts.Notes for reviewers
integration-zalo/actions/toggle-tag-sync.action.tsstill usesdband was not in this scope's file list.Test plan
pnpm --filter @chatbotx.io/database check-types && testpnpm --filter @chatbotx.io/business check-types && test(only the pre-existingads-conversion-rule.service.test.tsfailures remain, also red onmain)pnpm --filter builder check-types && testpnpm lint/settings/channels/{zalo,tiktok,telegram,smtp,webchat}