feat(connectors): implement push logic for syncing connectors#191
feat(connectors): implement push logic for syncing connectors#191Paveltarno merged 2 commits intopavelta-connectors-1from
Conversation
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/cli@0.0.28-pr.191.545b03aPrefer not to change any import paths? Install using npm alias so your code still imports npm i "base44@npm:@base44-preview/cli@0.0.28-pr.191.545b03a"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.0.28-pr.191.545b03a"
}
}
Preview published to npm registry — try new features instantly! |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
|
@claude rebase with |
|
Claude finished @Paveltarno's task in 23s —— View job Task: Rebase with
|
|
@claude rebase against branch pavelta-connectors-1 |
|
Claude finished @Paveltarno's task in 37s —— View job Task: Rebase against branch
|
Add pushConnectors function that: - Syncs all local connectors via /sync endpoint - Removes upstream-only connectors not in local config - Returns typed results (synced, removed, needs_oauth, error) Includes unit tests covering all scenarios. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…olling (#192) * feat(connectors): add OAuth flow handling with browser redirect and polling Add runOAuthFlow function that: - Opens OAuth redirect URL in browser - Polls getOAuthStatus until ACTIVE or FAILED - Returns PENDING on timeout (5 minutes) Uses p-wait-for TimeoutError for robust timeout detection. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * connectors: base44 connectors push (#194) * final connector work sofi 1 * scopes --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
28ddeee to
067f194
Compare
* feat(connectors): implement push logic for syncing connectors Add pushConnectors function that: - Syncs all local connectors via /sync endpoint - Removes upstream-only connectors not in local config - Returns typed results (synced, removed, needs_oauth, error) Includes unit tests covering all scenarios. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(connectors): add OAuth flow handling with browser redirect and polling (#192) * feat(connectors): add OAuth flow handling with browser redirect and polling Add runOAuthFlow function that: - Opens OAuth redirect URL in browser - Polls getOAuthStatus until ACTIVE or FAILED - Returns PENDING on timeout (5 minutes) Uses p-wait-for TimeoutError for robust timeout detection. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * connectors: base44 connectors push (#194) * final connector work sofi 1 * scopes --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

Note
Description
This PR implements the push synchronization logic for OAuth connectors in the Base44 CLI, enabling the
base44 connectors pushcommand. The implementation handles creating/updating connectors, removing upstream-only connectors, and managing OAuth authorization flows with browser redirect and polling. It includes comprehensive error handling for conflict scenarios like different-user connections.Related Issue
None
Type of Change
Changes Made
Core Logic:
push.tsmodule withpushConnectors()function that syncs local connector configs to the APIoauth.tsmodule withrunOAuthFlow()function for handling browser-based OAuth authorization with pollingConnectorSyncResultinterface to track sync outcomes (synced, removed, needs_oauth, error)API Updates:
syncConnector()tosetConnector()and updated endpoint from POST to PUTSyncConnectorResponsetoSetConnectorResponsegetOAuthStatus()CLI Command:
connectors pushcommand undersrc/cli/commands/connectors/Project Integration:
ProjectDatainterface to includeconnectors: ConnectorResource[]connectorsDirfield to project config schema (defaults to "connectors")readProjectConfig()functionTesting:
connectors_push.spec.ts) covering success cases, errors, OAuth flows, and conflict detectionconnectors.spec.ts) forpushConnectors()andrunOAuthFlow()functionsconnector-type-mismatchfixtureTesting
npm test)Checklist
Additional Notes
The implementation follows the Resource pattern established for entities, functions, and agents. The push logic handles three main scenarios: syncing local connectors to the API, removing upstream connectors not present locally, and managing OAuth authorization flows when needed. Error handling ensures graceful degradation when individual operations fail.
Key implementation details:
process.env.CI), OAuth prompt is skippedPOST /external-auth/synctoPUT /external-auth/integrations/{type}🤖 Generated by Claude | 2026-02-08 06:21 UTC