-
Notifications
You must be signed in to change notification settings - Fork 3
feat(connectors): add connectors to deploy command #211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: pavelta-connectors-1
Are you sure you want to change the base?
Conversation
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/cli@0.0.30-pr.211.475080dPrefer not to change any import paths? Install using npm alias so your code still imports npm i "base44@npm:@base44-preview/cli@0.0.30-pr.211.475080d"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.0.30-pr.211.475080d"
}
}
Preview published to npm registry — try new features instantly! |
Code ReviewFound 1 issue that needs attention: Missing API mock in testFile: tests/cli/deploy.spec.ts When deployAll() calls connectorResource.push(connectors), it executes pushConnectors() which calls setConnector() for each connector. Without mocking these API calls, the test will fail because MSW doesn't have a handler for the unmocked requests. Fix: Add mockConnectorSet() call after line 130 (after mockConnectorsList) and before the t.run() call: t.api.mockConnectorSet({
redirect_url: null,
connection_id: null,
already_authorized: true,
});See: cli/tests/cli/connectors_push.spec.ts Lines 31 to 35 in 68ece4e
All other changes look good:
|
Add connector resource module supporting 12 OAuth providers: googlecalendar, googledrive, gmail, googlesheets, googledocs, googleslides, slack, notion, salesforce, hubspot, linkedin, tiktok. - Zod discriminated union schema with type discriminator per provider - JSDoc links to official OAuth scope documentation for each provider - JSONC file reading with validation (filename must match type field) - API response schemas for upstream connector state - Unit tests with fixtures for valid, invalid, and mismatched connectors Part of: #184 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add API client methods for OAuth connector operations: - listConnectors: list all connectors for current app - syncConnector: sync connector with exact scope matching - getOAuthStatus: poll OAuth authorization status - removeConnector: remove a connector integration Also update response schemas and clean up verbose comments. Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* 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>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Change provider field from closed enum to flexible union that accepts both known providers (googlecalendar, notion, slack, etc.) and any arbitrary provider string. This enables users to configure custom OAuth providers without waiting for first-class Base44 support. Schema changes: - Add GenericConnectorSchema for arbitrary provider types - Update ConnectorResourceSchema to union of specific + generic schemas - Update IntegrationTypeSchema to accept known enum OR any non-empty string - Only reject empty strings Test coverage: - Verify known providers continue to work - Verify arbitrary providers are accepted - Verify empty strings are rejected - All 137 tests passing Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
7bfb43f to
7b418ac
Compare
- Update deployAll() to push connectors alongside entities, functions, and agents - Update hasResourcesToDeploy() to check for connectors - Display connector count in deployment summary - Add test for connector deployment Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
68ece4e to
11d6ca5
Compare
Extract the OAuth prompt flow from connectors/push.ts into a shared helper (oauth-prompt.ts) so both `connectors push` and `deploy` can reuse it. The deploy command now surfaces connector results from deployAll() and prompts the user to authorize when not in -y/CI mode. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The oauth-prompt helper should not know about process.env.CI — callers pass skipPrompt: true when they detect CI, keeping the helper generic. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Code reviewFound 1 issue that needs attention: Unused variable in OAuth handling (src/cli/commands/project/deploy.ts:98) Compare with the analogous code in Suggested fix: log.info(
`To authorize, run 'base44 connectors push' or open the links above in your browser.`
);To: log.info(
`Pending: ${pending}. To authorize, run 'base44 connectors push' or open the links above in your browser.`
);This will provide users with actionable information about which specific connectors require their attention. Checked for bugs and CLAUDE.md compliance. All other changes follow the established patterns correctly. |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The connector names are already shown in the authorization URLs above, so repeating them in the skip message is unnecessary. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0d6430f to
3fc2e0c
Compare
Note
Description
This PR refactors the OAuth authorization prompt logic into a reusable module and enhances connector deployment messaging. The new
oauth-prompt.tsmodule provides generic OAuth flow utilities that are shared betweenconnectors pushanddeploycommands. The refactoring improves the user experience by providing clearer messages about pending OAuth authorizations and offering multiple ways to complete authorization (re-run command or manually open links).Related Issue
None
Type of Change
Changes Made
src/cli/commands/connectors/oauth-prompt.tsmodule with reusable OAuth flow utilities:filterPendingOAuth()- Type-safe filtering of connector results that need OAuthpromptOAuthFlows()- Interactive OAuth authorization prompts withskipPromptoptionPendingOAuthResulttype for type-safe OAuth handlingsrc/cli/commands/connectors/push.tsto use the new OAuth prompt module:promptOAuthFlows()skipPrompt: truewhenprocess.env.CIis detectedsrc/cli/commands/project/deploy.tsto handle connector OAuth flows:promptOAuthFlows()after deployment when connectors need authorization-yflag and CI environment to skip interactive promptssrc/core/project/deploy.ts:connectorResultsinDeployAllResultinterface for OAuth handlingtests/cli/deploy.spec.ts:-yflag (verifies skip message)connectorsListendpointTesting
bun test)Checklist
Additional Notes
This PR builds on the connector infrastructure added in the target branch (
pavelta-connectors-1). Key design decisions:oauth-promptmodule doesn't checkprocess.env.CIdirectly. Instead, callers passskipPrompt: truebased on their context, making the helper more testable and reusable across different commands.-yflag or CI environment), users now see clearer messages with both the authorization URLs and instructions for multiple authorization methods (re-run command or manually open links).filterPendingOAuth) to ensure type-safe handling of OAuth results throughout the flow.🤖 Generated by Claude | 2026-02-11 20:15 UTC