@base44-preview/cli 0.0.17-pr.104.57e16fe → 0.0.17-pr.104.ad47aa8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +210 -47
- package/dist/{index.js → cli/index.js} +90 -91
- package/package.json +8 -7
- package/bin/dev.js +0 -12
- package/bin/run.js +0 -12
- /package/dist/{templates → cli/templates}/backend-and-client/.nvmrc +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/README.md +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/base44/app.jsonc.ejs +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/base44/config.jsonc.ejs +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/base44/entities/task.jsonc +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/components.json +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/index.html +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/jsconfig.json +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/package.json +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/postcss.config.js +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/src/App.jsx +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/src/api/base44Client.js.ejs +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/src/components/Base44Logo.jsx +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/src/components/ui/button.jsx +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/src/components/ui/checkbox.jsx +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/src/components/ui/input.jsx +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/src/index.css +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/src/main.jsx +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/tailwind.config.js +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/vite.config.js +0 -0
- /package/dist/{templates → cli/templates}/backend-only/base44/app.jsonc.ejs +0 -0
- /package/dist/{templates → cli/templates}/backend-only/base44/config.jsonc.ejs +0 -0
- /package/dist/{templates → cli/templates}/templates.json +0 -0
package/README.md
CHANGED
|
@@ -1,84 +1,247 @@
|
|
|
1
1
|
# Base44 CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A unified command-line interface for managing Base44 applications, entities, functions, deployments, and related services.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
- **Create projects** from templates.
|
|
8
|
-
- **Sync** resources defined in local code with your Base44 backend.
|
|
9
|
-
- **Deploy sites** to Base44's hosting platform.
|
|
10
|
-
|
|
11
|
-
To get started, see the full list of commands below or check out the [documentation](https://docs.base44.com/developers/references/cli/get-started/overview).
|
|
5
|
+
**Zero dependencies** - installs in seconds with no dependency resolution.
|
|
12
6
|
|
|
13
7
|
## Installation
|
|
14
8
|
|
|
15
9
|
```bash
|
|
10
|
+
# Using npm (globally)
|
|
16
11
|
npm install -g base44
|
|
12
|
+
|
|
13
|
+
# Or run directly with npx
|
|
14
|
+
npx base44 <command>
|
|
17
15
|
```
|
|
18
16
|
|
|
19
|
-
|
|
17
|
+
## Quick Start
|
|
20
18
|
|
|
21
19
|
```bash
|
|
22
|
-
|
|
20
|
+
# 1. Login to Base44
|
|
21
|
+
base44 login
|
|
22
|
+
|
|
23
|
+
# 2. Create a new project
|
|
24
|
+
base44 create
|
|
25
|
+
|
|
26
|
+
# 3. Deploy everything (entities, functions, and site)
|
|
27
|
+
npm run build
|
|
28
|
+
base44 deploy
|
|
23
29
|
```
|
|
24
30
|
|
|
25
|
-
|
|
31
|
+
## Commands
|
|
32
|
+
|
|
33
|
+
### Authentication
|
|
34
|
+
|
|
35
|
+
| Command | Description |
|
|
36
|
+
|---------|-------------|
|
|
37
|
+
| `base44 login` | Authenticate with Base44 using device code flow |
|
|
38
|
+
| `base44 whoami` | Display current authenticated user |
|
|
39
|
+
| `base44 logout` | Logout from current device |
|
|
40
|
+
|
|
41
|
+
### Project Management
|
|
42
|
+
|
|
43
|
+
| Command | Description |
|
|
44
|
+
|---------|-------------|
|
|
45
|
+
| `base44 create` | Create a new Base44 project from a template |
|
|
46
|
+
| `base44 link` | Link a local project to Base44 (create new or link existing) |
|
|
47
|
+
| `base44 dashboard` | Open the app dashboard in your browser |
|
|
48
|
+
|
|
49
|
+
#### Link Command Options
|
|
26
50
|
|
|
27
|
-
|
|
51
|
+
The `link` command supports both creating new projects and linking to existing ones:
|
|
28
52
|
|
|
29
53
|
```bash
|
|
30
|
-
#
|
|
31
|
-
base44
|
|
54
|
+
# Interactive mode - choose to create new or link existing
|
|
55
|
+
base44 link
|
|
32
56
|
|
|
33
|
-
# Create a project
|
|
34
|
-
base44 create
|
|
57
|
+
# Create a new project (non-interactive)
|
|
58
|
+
base44 link --create --name "my-app" --description "My app description"
|
|
59
|
+
|
|
60
|
+
# Link to an existing project by ID (non-interactive)
|
|
61
|
+
base44 link --projectId <app-id>
|
|
35
62
|
```
|
|
36
63
|
|
|
37
|
-
|
|
64
|
+
| Option | Description |
|
|
65
|
+
|--------|-------------|
|
|
66
|
+
| `-c, --create` | Create a new project (skip selection prompt) |
|
|
67
|
+
| `-n, --name <name>` | Project name (required with --create) |
|
|
68
|
+
| `-d, --description <desc>` | Project description (optional) |
|
|
69
|
+
| `-p, --projectId <id>` | Link to an existing project by ID (skips selection prompt) |
|
|
38
70
|
|
|
39
|
-
|
|
40
|
-
- [React](https://docs.base44.com/developers/backend/quickstart/quickstart-with-react) — full-stack with Vite + React
|
|
71
|
+
### Deployment
|
|
41
72
|
|
|
42
|
-
|
|
73
|
+
| Command | Description |
|
|
74
|
+
|---------|-------------|
|
|
75
|
+
| `base44 deploy` | Deploy all resources (entities, functions, and site) |
|
|
76
|
+
|
|
77
|
+
### Entities
|
|
78
|
+
|
|
79
|
+
| Command | Description |
|
|
80
|
+
|---------|-------------|
|
|
81
|
+
| `base44 entities push` | Push local entity schemas to Base44 |
|
|
82
|
+
|
|
83
|
+
### Functions
|
|
84
|
+
|
|
85
|
+
| Command | Description |
|
|
86
|
+
|---------|-------------|
|
|
87
|
+
| `base44 functions deploy` | Deploy local functions to Base44 |
|
|
88
|
+
|
|
89
|
+
### Site
|
|
90
|
+
|
|
91
|
+
| Command | Description |
|
|
92
|
+
|---------|-------------|
|
|
93
|
+
| `base44 site deploy` | Deploy built site files to Base44 hosting |
|
|
94
|
+
|
|
95
|
+
### Connectors
|
|
96
|
+
|
|
97
|
+
Manage OAuth integrations to connect your app with external services. Connectors are stored in the `connectors` property of your project's `config.jsonc` file.
|
|
43
98
|
|
|
44
99
|
| Command | Description |
|
|
45
|
-
|
|
46
|
-
|
|
|
47
|
-
|
|
|
48
|
-
|
|
|
49
|
-
|
|
|
50
|
-
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
100
|
+
|---------|-------------|
|
|
101
|
+
| `base44 connectors add [type]` | Add and connect an OAuth integration |
|
|
102
|
+
| `base44 connectors list` | List all connectors (local and connected) |
|
|
103
|
+
| `base44 connectors push` | Sync connectors with backend (connect new, remove missing) |
|
|
104
|
+
| `base44 connectors remove [type]` | Remove an integration |
|
|
105
|
+
| `base44 connectors remove [type] --hard` | Permanently remove an integration |
|
|
106
|
+
|
|
107
|
+
**Supported integrations:** Slack, Google Calendar, Google Drive, Gmail, Google Sheets, Google Docs, Google Slides, Notion, Salesforce, HubSpot, LinkedIn, TikTok
|
|
108
|
+
|
|
109
|
+
**Example workflow:**
|
|
110
|
+
```bash
|
|
111
|
+
# Add a connector interactively (saves to config.jsonc and opens OAuth)
|
|
112
|
+
base44 connectors add slack
|
|
113
|
+
|
|
114
|
+
# List connectors showing local vs connected status
|
|
115
|
+
base44 connectors list
|
|
116
|
+
# Output:
|
|
117
|
+
# ● Slack - user@example.com
|
|
118
|
+
# ○ Google Calendar (not connected)
|
|
119
|
+
|
|
120
|
+
# Sync all connectors (connects new, removes missing from config)
|
|
121
|
+
base44 connectors push
|
|
122
|
+
# Output:
|
|
123
|
+
# 1 connector to connect:
|
|
124
|
+
# + Google Calendar
|
|
125
|
+
# 1 connector to remove:
|
|
126
|
+
# - Notion (user@example.com)
|
|
127
|
+
# Apply 2 changes? (Y/n)
|
|
128
|
+
|
|
129
|
+
# Remove a single connector
|
|
130
|
+
base44 connectors remove slack
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**Configuration** (`base44/config.jsonc`):
|
|
134
|
+
```jsonc
|
|
135
|
+
{
|
|
136
|
+
"name": "my-app",
|
|
137
|
+
"connectors": {
|
|
138
|
+
"slack": {},
|
|
139
|
+
"googlecalendar": { "scopes": ["calendar.readonly"] }
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Once connected, use the SDK's `connectors.getAccessToken()` to retrieve tokens:
|
|
145
|
+
```javascript
|
|
146
|
+
const token = await base44.connectors.getAccessToken("slack");
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## Configuration
|
|
150
|
+
|
|
151
|
+
### Project Configuration
|
|
152
|
+
|
|
153
|
+
Base44 projects are configured via a `config.jsonc` (or `config.json`) file in the `base44/` subdirectory:
|
|
154
|
+
|
|
155
|
+
```jsonc
|
|
156
|
+
// base44/config.jsonc
|
|
157
|
+
{
|
|
158
|
+
"name": "My Project",
|
|
159
|
+
"entitiesDir": "./entities", // Default: ./entities
|
|
160
|
+
"functionsDir": "./functions", // Default: ./functions
|
|
161
|
+
"site": {
|
|
162
|
+
"outputDirectory": "../dist" // Path to built site files
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### App Configuration
|
|
168
|
+
|
|
169
|
+
Your app ID is stored in a `.app.jsonc` file in the `base44/` directory. This file is created automatically when you run `base44 create` or `base44 link`:
|
|
170
|
+
|
|
171
|
+
```jsonc
|
|
172
|
+
// base44/.app.jsonc
|
|
173
|
+
{
|
|
174
|
+
"id": "your-app-id"
|
|
175
|
+
}
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## Project Structure
|
|
179
|
+
|
|
180
|
+
A typical Base44 project has this structure:
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
my-project/
|
|
184
|
+
├── base44/
|
|
185
|
+
│ ├── config.jsonc # Project configuration
|
|
186
|
+
│ ├── .app.jsonc # App ID (git-ignored)
|
|
187
|
+
│ ├── entities/ # Entity schema files
|
|
188
|
+
│ │ ├── user.jsonc
|
|
189
|
+
│ │ └── product.jsonc
|
|
190
|
+
│ └── functions/ # Backend functions
|
|
191
|
+
│ └── my-function/
|
|
192
|
+
│ ├── config.jsonc
|
|
193
|
+
│ └── index.js
|
|
194
|
+
├── src/ # Your frontend code
|
|
195
|
+
├── dist/ # Built site files (for deployment)
|
|
196
|
+
└── package.json
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
## Development
|
|
200
|
+
|
|
201
|
+
### Prerequisites
|
|
202
|
+
|
|
203
|
+
- Node.js >= 20.19.0
|
|
204
|
+
- npm
|
|
205
|
+
|
|
206
|
+
### Setup
|
|
65
207
|
|
|
66
208
|
```bash
|
|
67
|
-
|
|
68
|
-
|
|
209
|
+
# Clone the repository
|
|
210
|
+
git clone https://github.com/base44/cli.git
|
|
211
|
+
cd cli
|
|
212
|
+
|
|
213
|
+
# Install dependencies
|
|
214
|
+
npm install
|
|
215
|
+
|
|
216
|
+
# Build
|
|
217
|
+
npm run build
|
|
218
|
+
|
|
219
|
+
# Run in development mode
|
|
220
|
+
npm run dev -- <command>
|
|
69
221
|
```
|
|
70
222
|
|
|
71
|
-
|
|
223
|
+
### Available Scripts
|
|
72
224
|
|
|
73
225
|
```bash
|
|
74
|
-
|
|
226
|
+
npm run build # Build with tsdown
|
|
227
|
+
npm run typecheck # Type check with tsc
|
|
228
|
+
npm run dev # Run in development mode with tsx
|
|
229
|
+
npm run lint # Lint with ESLint
|
|
230
|
+
npm test # Run tests with Vitest
|
|
75
231
|
```
|
|
76
232
|
|
|
77
|
-
|
|
233
|
+
### Running the Built CLI
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
# After building
|
|
237
|
+
npm start -- <command>
|
|
78
238
|
|
|
79
|
-
|
|
239
|
+
# Or directly
|
|
240
|
+
./dist/cli/index.js <command>
|
|
241
|
+
```
|
|
242
|
+
## Contributing
|
|
80
243
|
|
|
81
|
-
|
|
244
|
+
See [AGENTS.md](./AGENTS.md) for development guidelines and architecture documentation.
|
|
82
245
|
|
|
83
246
|
## License
|
|
84
247
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
1
2
|
import { createRequire } from "node:module";
|
|
2
3
|
import { EventEmitter, addAbortListener, on, once, setMaxListeners } from "node:events";
|
|
3
4
|
import childProcess, { ChildProcess, execFile, spawn, spawnSync } from "node:child_process";
|
|
@@ -30740,21 +30741,6 @@ async function getUserInfo(accessToken) {
|
|
|
30740
30741
|
return result.data;
|
|
30741
30742
|
}
|
|
30742
30743
|
|
|
30743
|
-
//#endregion
|
|
30744
|
-
//#region src/cli/errors.ts
|
|
30745
|
-
/**
|
|
30746
|
-
* Error thrown to signal a controlled CLI exit with a specific exit code.
|
|
30747
|
-
* This allows proper error propagation without calling process.exit() directly,
|
|
30748
|
-
* making the code more testable and maintaining a single exit point.
|
|
30749
|
-
*/
|
|
30750
|
-
var CLIExitError = class extends Error {
|
|
30751
|
-
constructor(code$1) {
|
|
30752
|
-
super(`CLI exited with code ${code$1}`);
|
|
30753
|
-
this.code = code$1;
|
|
30754
|
-
this.name = "CLIExitError";
|
|
30755
|
-
}
|
|
30756
|
-
};
|
|
30757
|
-
|
|
30758
30744
|
//#endregion
|
|
30759
30745
|
//#region node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
30760
30746
|
const ANSI_BACKGROUND_OFFSET = 10;
|
|
@@ -31324,7 +31310,7 @@ async function runCommand(commandFn, options) {
|
|
|
31324
31310
|
} catch (e$1) {
|
|
31325
31311
|
if (e$1 instanceof Error) M.error(e$1.stack ?? e$1.message);
|
|
31326
31312
|
else M.error(String(e$1));
|
|
31327
|
-
|
|
31313
|
+
process.exit(1);
|
|
31328
31314
|
}
|
|
31329
31315
|
}
|
|
31330
31316
|
|
|
@@ -39260,48 +39246,6 @@ function getIntegrationDisplayName(type) {
|
|
|
39260
39246
|
return type;
|
|
39261
39247
|
}
|
|
39262
39248
|
|
|
39263
|
-
//#endregion
|
|
39264
|
-
//#region src/core/connectors/oauth.ts
|
|
39265
|
-
/**
|
|
39266
|
-
* Polls for OAuth completion status.
|
|
39267
|
-
* Returns when status becomes ACTIVE or FAILED, or times out.
|
|
39268
|
-
*/
|
|
39269
|
-
async function waitForOAuthCompletion(integrationType, connectionId, options) {
|
|
39270
|
-
let accountEmail;
|
|
39271
|
-
let error;
|
|
39272
|
-
try {
|
|
39273
|
-
await pWaitFor(async () => {
|
|
39274
|
-
const status = await checkOAuthStatus(integrationType, connectionId);
|
|
39275
|
-
if (status.status === "ACTIVE") {
|
|
39276
|
-
accountEmail = status.accountEmail ?? void 0;
|
|
39277
|
-
return true;
|
|
39278
|
-
}
|
|
39279
|
-
if (status.status === "FAILED") {
|
|
39280
|
-
error = status.error || "Authorization failed";
|
|
39281
|
-
throw new Error(error);
|
|
39282
|
-
}
|
|
39283
|
-
options?.onPending?.();
|
|
39284
|
-
return false;
|
|
39285
|
-
}, {
|
|
39286
|
-
interval: OAUTH_POLL_INTERVAL_MS,
|
|
39287
|
-
timeout: OAUTH_POLL_TIMEOUT_MS
|
|
39288
|
-
});
|
|
39289
|
-
return {
|
|
39290
|
-
success: true,
|
|
39291
|
-
accountEmail
|
|
39292
|
-
};
|
|
39293
|
-
} catch (err) {
|
|
39294
|
-
if (err instanceof Error && err.message.includes("timed out")) return {
|
|
39295
|
-
success: false,
|
|
39296
|
-
error: "Authorization timed out. Please try again."
|
|
39297
|
-
};
|
|
39298
|
-
return {
|
|
39299
|
-
success: false,
|
|
39300
|
-
error: error || (err instanceof Error ? err.message : "Unknown error")
|
|
39301
|
-
};
|
|
39302
|
-
}
|
|
39303
|
-
}
|
|
39304
|
-
|
|
39305
39249
|
//#endregion
|
|
39306
39250
|
//#region src/core/connectors/config.ts
|
|
39307
39251
|
/**
|
|
@@ -39363,20 +39307,6 @@ async function removeLocalConnector(type, projectRoot) {
|
|
|
39363
39307
|
return await writeLocalConnectors(filtered, projectRoot);
|
|
39364
39308
|
}
|
|
39365
39309
|
|
|
39366
|
-
//#endregion
|
|
39367
|
-
//#region src/core/connectors/state.ts
|
|
39368
|
-
/**
|
|
39369
|
-
* Fetches both local config and backend connectors in parallel.
|
|
39370
|
-
* Gracefully handles failures by returning empty arrays.
|
|
39371
|
-
*/
|
|
39372
|
-
async function fetchConnectorState() {
|
|
39373
|
-
const [local, backend] = await Promise.all([readLocalConnectors().catch(() => []), listConnectors().catch(() => [])]);
|
|
39374
|
-
return {
|
|
39375
|
-
local,
|
|
39376
|
-
backend
|
|
39377
|
-
};
|
|
39378
|
-
}
|
|
39379
|
-
|
|
39380
39310
|
//#endregion
|
|
39381
39311
|
//#region src/cli/commands/connectors/add.ts
|
|
39382
39312
|
function validateIntegrationType(type) {
|
|
@@ -39400,13 +39330,45 @@ async function promptForIntegrationType() {
|
|
|
39400
39330
|
}
|
|
39401
39331
|
return selected;
|
|
39402
39332
|
}
|
|
39403
|
-
async function
|
|
39404
|
-
|
|
39405
|
-
|
|
39406
|
-
|
|
39407
|
-
|
|
39408
|
-
|
|
39409
|
-
|
|
39333
|
+
async function waitForOAuthCompletion(integrationType, connectionId) {
|
|
39334
|
+
let accountEmail;
|
|
39335
|
+
let error;
|
|
39336
|
+
try {
|
|
39337
|
+
await runTask("Waiting for authorization...", async (updateMessage) => {
|
|
39338
|
+
await pWaitFor(async () => {
|
|
39339
|
+
const status = await checkOAuthStatus(integrationType, connectionId);
|
|
39340
|
+
if (status.status === "ACTIVE") {
|
|
39341
|
+
accountEmail = status.accountEmail ?? void 0;
|
|
39342
|
+
return true;
|
|
39343
|
+
}
|
|
39344
|
+
if (status.status === "FAILED") {
|
|
39345
|
+
error = status.error || "Authorization failed";
|
|
39346
|
+
throw new Error(error);
|
|
39347
|
+
}
|
|
39348
|
+
updateMessage("Waiting for authorization in browser...");
|
|
39349
|
+
return false;
|
|
39350
|
+
}, {
|
|
39351
|
+
interval: OAUTH_POLL_INTERVAL_MS,
|
|
39352
|
+
timeout: OAUTH_POLL_TIMEOUT_MS
|
|
39353
|
+
});
|
|
39354
|
+
}, {
|
|
39355
|
+
successMessage: "Authorization completed!",
|
|
39356
|
+
errorMessage: "Authorization failed"
|
|
39357
|
+
});
|
|
39358
|
+
return {
|
|
39359
|
+
success: true,
|
|
39360
|
+
accountEmail
|
|
39361
|
+
};
|
|
39362
|
+
} catch (err) {
|
|
39363
|
+
if (err instanceof Error && err.message.includes("timed out")) return {
|
|
39364
|
+
success: false,
|
|
39365
|
+
error: "Authorization timed out. Please try again."
|
|
39366
|
+
};
|
|
39367
|
+
return {
|
|
39368
|
+
success: false,
|
|
39369
|
+
error: error || (err instanceof Error ? err.message : "Unknown error")
|
|
39370
|
+
};
|
|
39371
|
+
}
|
|
39410
39372
|
}
|
|
39411
39373
|
async function addConnector(integrationType) {
|
|
39412
39374
|
const selectedType = integrationType ? validateIntegrationType(integrationType) : await promptForIntegrationType();
|
|
@@ -39424,7 +39386,7 @@ async function addConnector(integrationType) {
|
|
|
39424
39386
|
if (initiateResponse.error === "different_user" && initiateResponse.other_user_email) throw new Error(`This app is already connected to ${displayName} by ${initiateResponse.other_user_email}`);
|
|
39425
39387
|
if (!initiateResponse.redirect_url || !initiateResponse.connection_id) throw new Error("Invalid response from server: missing redirect URL or connection ID");
|
|
39426
39388
|
M.info(`Please authorize ${displayName} at:\n${theme.colors.links(initiateResponse.redirect_url)}`);
|
|
39427
|
-
const result = await
|
|
39389
|
+
const result = await waitForOAuthCompletion(selectedType, initiateResponse.connection_id);
|
|
39428
39390
|
if (!result.success) throw new Error(result.error || "Authorization failed");
|
|
39429
39391
|
await addLocalConnector(selectedType);
|
|
39430
39392
|
const accountInfo = result.accountEmail ? ` as ${theme.styles.bold(result.accountEmail)}` : "";
|
|
@@ -39488,7 +39450,10 @@ function formatConnectorLine(connector) {
|
|
|
39488
39450
|
return `${bullet} ${displayName}${statusText}`;
|
|
39489
39451
|
}
|
|
39490
39452
|
async function listConnectorsCommand() {
|
|
39491
|
-
const
|
|
39453
|
+
const [localConnectors, backendConnectors] = await runTask("Fetching connectors...", async () => {
|
|
39454
|
+
const [local, backend] = await Promise.all([readLocalConnectors().catch(() => []), listConnectors().catch(() => [])]);
|
|
39455
|
+
return [local, backend];
|
|
39456
|
+
}, {
|
|
39492
39457
|
successMessage: "Connectors loaded",
|
|
39493
39458
|
errorMessage: "Failed to fetch connectors"
|
|
39494
39459
|
});
|
|
@@ -39548,15 +39513,45 @@ async function connectSingleConnector(connector) {
|
|
|
39548
39513
|
error: "Invalid response from server"
|
|
39549
39514
|
};
|
|
39550
39515
|
M.info(`Please authorize ${displayName} at:\n${theme.colors.links(initiateResponse.redirect_url)}`);
|
|
39551
|
-
|
|
39552
|
-
|
|
39553
|
-
|
|
39554
|
-
|
|
39555
|
-
|
|
39556
|
-
|
|
39516
|
+
let accountEmail;
|
|
39517
|
+
try {
|
|
39518
|
+
await runTask("Waiting for authorization...", async () => {
|
|
39519
|
+
await pWaitFor(async () => {
|
|
39520
|
+
const status = await checkOAuthStatus(type, initiateResponse.connection_id);
|
|
39521
|
+
if (status.status === "ACTIVE") {
|
|
39522
|
+
accountEmail = status.accountEmail ?? void 0;
|
|
39523
|
+
return true;
|
|
39524
|
+
}
|
|
39525
|
+
if (status.status === "FAILED") throw new Error(status.error || "Authorization failed");
|
|
39526
|
+
return false;
|
|
39527
|
+
}, {
|
|
39528
|
+
interval: OAUTH_POLL_INTERVAL_MS,
|
|
39529
|
+
timeout: OAUTH_POLL_TIMEOUT_MS
|
|
39530
|
+
});
|
|
39531
|
+
}, {
|
|
39532
|
+
successMessage: "Authorization completed!",
|
|
39533
|
+
errorMessage: "Authorization failed"
|
|
39534
|
+
});
|
|
39535
|
+
return {
|
|
39536
|
+
success: true,
|
|
39537
|
+
accountEmail
|
|
39538
|
+
};
|
|
39539
|
+
} catch (err) {
|
|
39540
|
+
if (err instanceof Error && err.message.includes("timed out")) return {
|
|
39541
|
+
success: false,
|
|
39542
|
+
error: "Authorization timed out. Please try again."
|
|
39543
|
+
};
|
|
39544
|
+
return {
|
|
39545
|
+
success: false,
|
|
39546
|
+
error: err instanceof Error ? err.message : "Unknown error"
|
|
39547
|
+
};
|
|
39548
|
+
}
|
|
39557
39549
|
}
|
|
39558
39550
|
async function pushConnectorsCommand() {
|
|
39559
|
-
const
|
|
39551
|
+
const [localConnectors, backendConnectors] = await runTask("Checking connector status...", async () => {
|
|
39552
|
+
const [local, backend] = await Promise.all([readLocalConnectors(), listConnectors().catch(() => [])]);
|
|
39553
|
+
return [local, backend];
|
|
39554
|
+
}, {
|
|
39560
39555
|
successMessage: "Status checked",
|
|
39561
39556
|
errorMessage: "Failed to check status"
|
|
39562
39557
|
});
|
|
@@ -39680,7 +39675,10 @@ async function promptForConnectorToRemove(connectors) {
|
|
|
39680
39675
|
}
|
|
39681
39676
|
async function removeConnectorCommand(integrationType, options = {}) {
|
|
39682
39677
|
const isHardDelete = options.hard === true;
|
|
39683
|
-
const
|
|
39678
|
+
const [localConnectors, backendConnectors] = await runTask("Fetching connectors...", async () => {
|
|
39679
|
+
const [local, backend] = await Promise.all([readLocalConnectors().catch(() => []), listConnectors().catch(() => [])]);
|
|
39680
|
+
return [local, backend];
|
|
39681
|
+
}, {
|
|
39684
39682
|
successMessage: "Connectors loaded",
|
|
39685
39683
|
errorMessage: "Failed to fetch connectors"
|
|
39686
39684
|
});
|
|
@@ -39725,7 +39723,7 @@ const connectorsCommand = new Command("connectors").description("Manage OAuth co
|
|
|
39725
39723
|
var version = "0.0.17";
|
|
39726
39724
|
|
|
39727
39725
|
//#endregion
|
|
39728
|
-
//#region src/cli/
|
|
39726
|
+
//#region src/cli/index.ts
|
|
39729
39727
|
const program = new Command();
|
|
39730
39728
|
program.name("base44").description("Base44 CLI - Unified interface for managing Base44 applications").version(version);
|
|
39731
39729
|
program.configureHelp({ sortSubcommands: true });
|
|
@@ -39740,6 +39738,7 @@ program.addCommand(entitiesPushCommand);
|
|
|
39740
39738
|
program.addCommand(functionsDeployCommand);
|
|
39741
39739
|
program.addCommand(siteDeployCommand);
|
|
39742
39740
|
program.addCommand(connectorsCommand);
|
|
39741
|
+
program.parse();
|
|
39743
39742
|
|
|
39744
39743
|
//#endregion
|
|
39745
|
-
export {
|
|
39744
|
+
export { };
|
package/package.json
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@base44-preview/cli",
|
|
3
|
-
"version": "0.0.17-pr.104.
|
|
3
|
+
"version": "0.0.17-pr.104.ad47aa8",
|
|
4
4
|
"description": "Base44 CLI - Unified interface for managing Base44 applications",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"
|
|
7
|
-
|
|
6
|
+
"main": "./dist/cli/index.js",
|
|
7
|
+
"bin": "./dist/cli/index.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./dist/cli/index.js"
|
|
8
10
|
},
|
|
9
11
|
"files": [
|
|
10
|
-
"dist"
|
|
11
|
-
"bin"
|
|
12
|
+
"dist"
|
|
12
13
|
],
|
|
13
14
|
"scripts": {
|
|
14
15
|
"build": "tsdown",
|
|
15
16
|
"typecheck": "tsc --noEmit",
|
|
16
|
-
"dev": "
|
|
17
|
-
"start": "
|
|
17
|
+
"dev": "tsx src/cli/index.ts",
|
|
18
|
+
"start": "node dist/cli/index.js",
|
|
18
19
|
"clean": "rm -rf dist",
|
|
19
20
|
"lint": "eslint src",
|
|
20
21
|
"test": "vitest run",
|
package/bin/dev.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env tsx
|
|
2
|
-
import { program, CLIExitError } from "../src/cli/index.ts";
|
|
3
|
-
|
|
4
|
-
try {
|
|
5
|
-
await program.parseAsync();
|
|
6
|
-
} catch (error) {
|
|
7
|
-
if (error instanceof CLIExitError) {
|
|
8
|
-
process.exit(error.code);
|
|
9
|
-
}
|
|
10
|
-
console.error(error);
|
|
11
|
-
process.exit(1);
|
|
12
|
-
}
|
package/bin/run.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { program, CLIExitError } from "../dist/index.js";
|
|
3
|
-
|
|
4
|
-
try {
|
|
5
|
-
await program.parseAsync();
|
|
6
|
-
} catch (error) {
|
|
7
|
-
if (error instanceof CLIExitError) {
|
|
8
|
-
process.exit(error.code);
|
|
9
|
-
}
|
|
10
|
-
console.error(error);
|
|
11
|
-
process.exit(1);
|
|
12
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|