Repository navigation
refactor(plugin-flow-builder): standardize the services clients that make calls to the backend - #3305
Open
Iru89 wants to merge 9 commits into
Open
refactor(plugin-flow-builder): standardize the services clients that make calls to the backend #3305Iru89 wants to merge 9 commits into
Iru89 wants to merge 9 commits into
Conversation
…uce SmartIntentsResolver class
…serInputResolver classes
… FlowBuilderClient for API interactions
…lient implementations for campaigns, user input, and queues
… refactor existing tests to use shared context
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Test Results46 tests 46 ✅ 1m 13s ⏱️ Results for commit 6717fd4. |
This branch has not been 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.
Description
Refactors @botonic/plugin-flow-builder so Hubtype and Flow Builder HTTP calls live in small service client classes instead of ad hoc requests spread across the package. FlowBuilderApi now delegates flow loading (and dev-only session user info) to FlowBuilderClient, while campaigns, queues, contact-info fields, smart intents, and capture-user-input each use dedicated *Client modules sharing HubtypeClientBase for auth and API URL. Resolvers and tests are updated to match the new structure, with a shared service-client-test-context helper for client unit tests.
Context
This keeps API surface behavior the same for typical bot code but makes HTTP boundaries explicit, easier to mock in tests, and consistent (token + HUBTYPE_API_URL / legacy serve). It also removes the old *-api naming in favor of *-client alongside the new FlowBuilderClient.
Approach taken / Explain the design
To document / Usage example
No change required for bots that only use FlowBuilderApi and existing plugin setup. Internally, new HTTP entry points are the *Client classes under
packages/botonic-plugin-flow-builder/src/services/; import paths and mock paths in tests follow the same*-clientnaming.Testing
The pull request...