Skip to content

Conversation

@Paveltarno
Copy link
Collaborator

@Paveltarno Paveltarno commented Feb 9, 2026

Note

Description

Adds a new connectors pull command that syncs connector configurations from the Base44 server to local files. This command fetches remote connectors via the API and intelligently writes/updates/deletes local connector files to match the server state, preserving custom file names and comments where possible.

Related Issue

None

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Other (please describe):

Changes Made

  • Added connectors pull command that fetches connectors from Base44 and syncs to local files
  • Implemented writeConnectors() function in connector/config.ts that handles intelligent file writing:
    • Creates/updates connector files based on remote state
    • Deletes local files for connectors that no longer exist remotely
    • Preserves existing file names (e.g., my-slack.jsonc) when updating connectors by type
    • Skips writing when data is unchanged to preserve comments and formatting
  • Added fetchConnectors() API wrapper function as alias for listConnectors()
  • Refactored connector reading logic to track file paths for intelligent updates
  • Added comprehensive unit tests for writeConnectors() covering edge cases (duplicate types, file preservation, empty lists)
  • Added CLI integration tests for the new pull command

Testing

  • I have tested these changes locally
  • I have added/updated tests as needed
  • All tests pass (npm test)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • I have updated AGENTS.md if I made architectural changes

Additional Notes

The writeConnectors() function uses deep equality comparison to detect changes, ensuring local files are only rewritten when the data actually differs. This preserves user comments and custom formatting in connector config files. The function also handles type-based file matching rather than filename-based matching, allowing users to name their connector files however they prefer.


🤖 Generated by Claude | 2026-02-11 23:47 UTC

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/cli@0.0.30-pr.214.4036a54

Prefer not to change any import paths? Install using npm alias so your code still imports base44:

npm i "base44@npm:@base44-preview/cli@0.0.30-pr.214.4036a54"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "base44": "npm:@base44-preview/cli@0.0.30-pr.214.4036a54"
  }
}

Preview published to npm registry — try new features instantly!

@dor-chaouat dor-chaouat moved this from Backlog to In progress in CLI Development Feb 9, 2026
Paveltarno and others added 7 commits February 10, 2026 13:59
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>
Paveltarno and others added 7 commits February 10, 2026 14:05
Implements fetchConnectors() API, writeConnectors() for file sync,
and the CLI pull command following the agents pull pattern.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@Paveltarno Paveltarno force-pushed the task-1-connectors-pull branch from f4d2ac1 to 02d5fd7 Compare February 11, 2026 08:34
@base44 base44 deleted a comment from claude bot Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

1 participant