@base44-preview/cli 0.0.32-pr.251.2056a80 → 0.0.32-pr.252.0c10d75
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/dist/cli/index.js +78 -265
- package/dist/cli/index.js.map +14 -15
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -17468,7 +17468,7 @@ var require_lodash2 = __commonJS((exports, module) => {
|
|
|
17468
17468
|
function nth(array2, n2) {
|
|
17469
17469
|
return array2 && array2.length ? baseNth(array2, toInteger(n2)) : undefined2;
|
|
17470
17470
|
}
|
|
17471
|
-
var
|
|
17471
|
+
var pull = baseRest(pullAll);
|
|
17472
17472
|
function pullAll(array2, values2) {
|
|
17473
17473
|
return array2 && array2.length && values2 && values2.length ? basePullAll(array2, values2) : array2;
|
|
17474
17474
|
}
|
|
@@ -19233,7 +19233,7 @@ __p += '`;
|
|
|
19233
19233
|
lodash.pickBy = pickBy;
|
|
19234
19234
|
lodash.property = property;
|
|
19235
19235
|
lodash.propertyOf = propertyOf;
|
|
19236
|
-
lodash.pull =
|
|
19236
|
+
lodash.pull = pull;
|
|
19237
19237
|
lodash.pullAll = pullAll;
|
|
19238
19238
|
lodash.pullAllBy = pullAllBy;
|
|
19239
19239
|
lodash.pullAllWith = pullAllWith;
|
|
@@ -185051,8 +185051,8 @@ var TikTokConnectorSchema = exports_external.object({
|
|
|
185051
185051
|
type: exports_external.literal("tiktok"),
|
|
185052
185052
|
scopes: exports_external.array(exports_external.string()).default([])
|
|
185053
185053
|
});
|
|
185054
|
-
var
|
|
185055
|
-
type: exports_external.literal("
|
|
185054
|
+
var GoogleBigQueryConnectorSchema = exports_external.object({
|
|
185055
|
+
type: exports_external.literal("googlebigquery"),
|
|
185056
185056
|
scopes: exports_external.array(exports_external.string()).default([])
|
|
185057
185057
|
});
|
|
185058
185058
|
var CustomTypeSchema = exports_external.string().min(1).regex(/^[a-z0-9_-]+$/i);
|
|
@@ -185067,13 +185067,13 @@ var ConnectorResourceSchema = exports_external.union([
|
|
|
185067
185067
|
GoogleSheetsConnectorSchema,
|
|
185068
185068
|
GoogleDocsConnectorSchema,
|
|
185069
185069
|
GoogleSlidesConnectorSchema,
|
|
185070
|
+
GoogleBigQueryConnectorSchema,
|
|
185070
185071
|
SlackConnectorSchema,
|
|
185071
185072
|
NotionConnectorSchema,
|
|
185072
185073
|
SalesforceConnectorSchema,
|
|
185073
185074
|
HubspotConnectorSchema,
|
|
185074
185075
|
LinkedInConnectorSchema,
|
|
185075
185076
|
TikTokConnectorSchema,
|
|
185076
|
-
StripeConnectorSchema,
|
|
185077
185077
|
GenericConnectorSchema
|
|
185078
185078
|
]);
|
|
185079
185079
|
var KnownIntegrationTypes = [
|
|
@@ -185083,13 +185083,13 @@ var KnownIntegrationTypes = [
|
|
|
185083
185083
|
"googlesheets",
|
|
185084
185084
|
"googledocs",
|
|
185085
185085
|
"googleslides",
|
|
185086
|
+
"googlebigquery",
|
|
185086
185087
|
"slack",
|
|
185087
185088
|
"notion",
|
|
185088
185089
|
"salesforce",
|
|
185089
185090
|
"hubspot",
|
|
185090
185091
|
"linkedin",
|
|
185091
|
-
"tiktok"
|
|
185092
|
-
"stripe"
|
|
185092
|
+
"tiktok"
|
|
185093
185093
|
];
|
|
185094
185094
|
var IntegrationTypeSchema = exports_external.union([
|
|
185095
185095
|
exports_external.enum(KnownIntegrationTypes),
|
|
@@ -185142,18 +185142,6 @@ var RemoveConnectorResponseSchema = exports_external.object({
|
|
|
185142
185142
|
status: data.status,
|
|
185143
185143
|
integrationType: data.integration_type
|
|
185144
185144
|
}));
|
|
185145
|
-
var STRIPE_CONNECTOR_TYPE = "stripe";
|
|
185146
|
-
var InstallStripeResponseSchema = exports_external.object({
|
|
185147
|
-
already_installed: exports_external.boolean(),
|
|
185148
|
-
claim_url: exports_external.string().nullable()
|
|
185149
|
-
});
|
|
185150
|
-
var StripeStatusResponseSchema = exports_external.object({
|
|
185151
|
-
stripe_mode: exports_external.enum(["sandbox", "live"]).nullable(),
|
|
185152
|
-
sandbox_claim_url: exports_external.string().nullable().optional()
|
|
185153
|
-
});
|
|
185154
|
-
var RemoveStripeResponseSchema = exports_external.object({
|
|
185155
|
-
success: exports_external.boolean()
|
|
185156
|
-
});
|
|
185157
185145
|
|
|
185158
185146
|
// src/core/resources/connector/api.ts
|
|
185159
185147
|
async function listConnectors() {
|
|
@@ -185221,54 +185209,6 @@ async function removeConnector(integrationType) {
|
|
|
185221
185209
|
}
|
|
185222
185210
|
return result.data;
|
|
185223
185211
|
}
|
|
185224
|
-
async function installStripe() {
|
|
185225
|
-
const appClient = getAppClient();
|
|
185226
|
-
let response;
|
|
185227
|
-
try {
|
|
185228
|
-
response = await appClient.post("payments/stripe/install", {
|
|
185229
|
-
timeout: 60000
|
|
185230
|
-
});
|
|
185231
|
-
} catch (error48) {
|
|
185232
|
-
throw await ApiError.fromHttpError(error48, "installing Stripe");
|
|
185233
|
-
}
|
|
185234
|
-
const result = InstallStripeResponseSchema.safeParse(await response.json());
|
|
185235
|
-
if (!result.success) {
|
|
185236
|
-
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
185237
|
-
}
|
|
185238
|
-
return result.data;
|
|
185239
|
-
}
|
|
185240
|
-
async function getStripeStatus() {
|
|
185241
|
-
const appClient = getAppClient();
|
|
185242
|
-
let response;
|
|
185243
|
-
try {
|
|
185244
|
-
response = await appClient.get("payments/stripe/status", {
|
|
185245
|
-
timeout: 60000
|
|
185246
|
-
});
|
|
185247
|
-
} catch (error48) {
|
|
185248
|
-
throw await ApiError.fromHttpError(error48, "checking Stripe integration status");
|
|
185249
|
-
}
|
|
185250
|
-
const result = StripeStatusResponseSchema.safeParse(await response.json());
|
|
185251
|
-
if (!result.success) {
|
|
185252
|
-
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
185253
|
-
}
|
|
185254
|
-
return result.data;
|
|
185255
|
-
}
|
|
185256
|
-
async function removeStripe() {
|
|
185257
|
-
const appClient = getAppClient();
|
|
185258
|
-
let response;
|
|
185259
|
-
try {
|
|
185260
|
-
response = await appClient.delete("payments/stripe", {
|
|
185261
|
-
timeout: 60000
|
|
185262
|
-
});
|
|
185263
|
-
} catch (error48) {
|
|
185264
|
-
throw await ApiError.fromHttpError(error48, "removing Stripe integration");
|
|
185265
|
-
}
|
|
185266
|
-
const result = RemoveStripeResponseSchema.safeParse(await response.json());
|
|
185267
|
-
if (!result.success) {
|
|
185268
|
-
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
185269
|
-
}
|
|
185270
|
-
return result.data;
|
|
185271
|
-
}
|
|
185272
185212
|
// src/core/resources/connector/config.ts
|
|
185273
185213
|
import { join as join4 } from "node:path";
|
|
185274
185214
|
import { isDeepStrictEqual } from "node:util";
|
|
@@ -185317,7 +185257,7 @@ async function readAllConnectors(connectorsDir) {
|
|
|
185317
185257
|
async function writeConnectors(connectorsDir, remoteConnectors) {
|
|
185318
185258
|
const entries = await readConnectorFiles(connectorsDir);
|
|
185319
185259
|
const typeToEntry = buildTypeToEntryMap(entries);
|
|
185320
|
-
const newTypes = new Set(remoteConnectors.map((c) => c.
|
|
185260
|
+
const newTypes = new Set(remoteConnectors.map((c) => c.integrationType));
|
|
185321
185261
|
const deleted = [];
|
|
185322
185262
|
for (const [type, entry] of typeToEntry) {
|
|
185323
185263
|
if (!newTypes.has(type)) {
|
|
@@ -185327,44 +185267,22 @@ async function writeConnectors(connectorsDir, remoteConnectors) {
|
|
|
185327
185267
|
}
|
|
185328
185268
|
const written = [];
|
|
185329
185269
|
for (const connector of remoteConnectors) {
|
|
185330
|
-
const existing = typeToEntry.get(connector.
|
|
185331
|
-
|
|
185270
|
+
const existing = typeToEntry.get(connector.integrationType);
|
|
185271
|
+
const localConnector = {
|
|
185272
|
+
type: connector.integrationType,
|
|
185273
|
+
scopes: connector.scopes
|
|
185274
|
+
};
|
|
185275
|
+
if (existing && isDeepStrictEqual(existing.data, localConnector)) {
|
|
185332
185276
|
continue;
|
|
185333
185277
|
}
|
|
185334
|
-
const filePath = existing?.filePath ?? join4(connectorsDir, `${connector.
|
|
185335
|
-
await writeJsonFile(filePath,
|
|
185336
|
-
written.push(connector.
|
|
185278
|
+
const filePath = existing?.filePath ?? join4(connectorsDir, `${connector.integrationType}.${CONFIG_FILE_EXTENSION}`);
|
|
185279
|
+
await writeJsonFile(filePath, localConnector);
|
|
185280
|
+
written.push(connector.integrationType);
|
|
185337
185281
|
}
|
|
185338
185282
|
return { written, deleted };
|
|
185339
185283
|
}
|
|
185340
|
-
// src/core/resources/connector/pull.ts
|
|
185341
|
-
async function pullAllConnectors() {
|
|
185342
|
-
const [oauthResponse, stripeStatus] = await Promise.all([
|
|
185343
|
-
listConnectors(),
|
|
185344
|
-
getStripeStatus()
|
|
185345
|
-
]);
|
|
185346
|
-
const connectors = oauthResponse.integrations.map((i) => ({
|
|
185347
|
-
type: i.integrationType,
|
|
185348
|
-
scopes: i.scopes
|
|
185349
|
-
}));
|
|
185350
|
-
if (stripeStatus.stripe_mode !== null) {
|
|
185351
|
-
connectors.push({ type: STRIPE_CONNECTOR_TYPE, scopes: [] });
|
|
185352
|
-
}
|
|
185353
|
-
return connectors;
|
|
185354
|
-
}
|
|
185355
185284
|
// src/core/resources/connector/push.ts
|
|
185356
185285
|
async function pushConnectors(connectors) {
|
|
185357
|
-
const stripeConnector = connectors.find((c) => c.type === STRIPE_CONNECTOR_TYPE);
|
|
185358
|
-
const oauthConnectors = connectors.filter((c) => c.type !== STRIPE_CONNECTOR_TYPE);
|
|
185359
|
-
const oauthResults = await syncOAuthConnectors(oauthConnectors);
|
|
185360
|
-
const stripeResult = await syncStripeConnector(stripeConnector);
|
|
185361
|
-
const results = [...oauthResults];
|
|
185362
|
-
if (stripeResult) {
|
|
185363
|
-
results.push(stripeResult);
|
|
185364
|
-
}
|
|
185365
|
-
return { results };
|
|
185366
|
-
}
|
|
185367
|
-
async function syncOAuthConnectors(connectors) {
|
|
185368
185286
|
const results = [];
|
|
185369
185287
|
const upstream = await listConnectors();
|
|
185370
185288
|
const localTypes = new Set(connectors.map((c) => c.type));
|
|
@@ -185397,69 +185315,7 @@ async function syncOAuthConnectors(connectors) {
|
|
|
185397
185315
|
}
|
|
185398
185316
|
}
|
|
185399
185317
|
}
|
|
185400
|
-
return results;
|
|
185401
|
-
}
|
|
185402
|
-
async function syncStripeConnector(localStripe) {
|
|
185403
|
-
const remoteStatus = await fetchStripeRemoteStatus();
|
|
185404
|
-
if (remoteStatus === "error") {
|
|
185405
|
-
return localStripe ? stripeError("Failed to check Stripe integration status") : null;
|
|
185406
|
-
}
|
|
185407
|
-
const isRemoteInstalled = remoteStatus.stripe_mode !== null;
|
|
185408
|
-
const needsInstall = localStripe && !isRemoteInstalled;
|
|
185409
|
-
const alreadySynced = localStripe && isRemoteInstalled;
|
|
185410
|
-
const needsRemoval = !localStripe && isRemoteInstalled;
|
|
185411
|
-
if (needsInstall) {
|
|
185412
|
-
return handleStripeInstall();
|
|
185413
|
-
}
|
|
185414
|
-
if (alreadySynced) {
|
|
185415
|
-
const mode = remoteStatus.stripe_mode;
|
|
185416
|
-
const hasUnclaimedSandbox = mode === "sandbox" && remoteStatus.sandbox_claim_url;
|
|
185417
|
-
return hasUnclaimedSandbox ? stripeProvisioned(mode, remoteStatus.sandbox_claim_url ?? undefined) : stripeSynced();
|
|
185418
|
-
}
|
|
185419
|
-
if (needsRemoval) {
|
|
185420
|
-
return handleStripeRemoval();
|
|
185421
|
-
}
|
|
185422
|
-
return null;
|
|
185423
|
-
}
|
|
185424
|
-
async function fetchStripeRemoteStatus() {
|
|
185425
|
-
try {
|
|
185426
|
-
const status = await getStripeStatus();
|
|
185427
|
-
if (!status)
|
|
185428
|
-
return "error";
|
|
185429
|
-
return status;
|
|
185430
|
-
} catch {
|
|
185431
|
-
return "error";
|
|
185432
|
-
}
|
|
185433
|
-
}
|
|
185434
|
-
async function handleStripeInstall() {
|
|
185435
|
-
try {
|
|
185436
|
-
const result = await installStripe();
|
|
185437
|
-
const status = await fetchStripeRemoteStatus();
|
|
185438
|
-
const mode = status !== "error" && status.stripe_mode ? status.stripe_mode : "sandbox";
|
|
185439
|
-
return stripeProvisioned(mode, result.claim_url ?? undefined);
|
|
185440
|
-
} catch (err) {
|
|
185441
|
-
return stripeError(err instanceof Error ? err.message : String(err));
|
|
185442
|
-
}
|
|
185443
|
-
}
|
|
185444
|
-
async function handleStripeRemoval() {
|
|
185445
|
-
try {
|
|
185446
|
-
await removeStripe();
|
|
185447
|
-
return stripeRemoved();
|
|
185448
|
-
} catch (err) {
|
|
185449
|
-
return stripeError(err instanceof Error ? err.message : String(err));
|
|
185450
|
-
}
|
|
185451
|
-
}
|
|
185452
|
-
function stripeSynced() {
|
|
185453
|
-
return { type: STRIPE_CONNECTOR_TYPE, action: "synced" };
|
|
185454
|
-
}
|
|
185455
|
-
function stripeProvisioned(mode, claimUrl) {
|
|
185456
|
-
return { type: STRIPE_CONNECTOR_TYPE, action: "provisioned", mode, claimUrl };
|
|
185457
|
-
}
|
|
185458
|
-
function stripeRemoved() {
|
|
185459
|
-
return { type: STRIPE_CONNECTOR_TYPE, action: "removed" };
|
|
185460
|
-
}
|
|
185461
|
-
function stripeError(error48) {
|
|
185462
|
-
return { type: STRIPE_CONNECTOR_TYPE, action: "error", error: error48 };
|
|
185318
|
+
return { results };
|
|
185463
185319
|
}
|
|
185464
185320
|
function getConnectorSyncResult(type, response) {
|
|
185465
185321
|
if (response.error === "different_user") {
|
|
@@ -185477,7 +185333,7 @@ function getConnectorSyncResult(type, response) {
|
|
|
185477
185333
|
type,
|
|
185478
185334
|
action: "needs_oauth",
|
|
185479
185335
|
redirectUrl: response.redirectUrl,
|
|
185480
|
-
connectionId: response.connectionId ??
|
|
185336
|
+
connectionId: response.connectionId ?? undefined
|
|
185481
185337
|
};
|
|
185482
185338
|
}
|
|
185483
185339
|
return { type, action: "synced" };
|
|
@@ -185490,7 +185346,10 @@ var connectorResource = {
|
|
|
185490
185346
|
// src/core/resources/entity/schema.ts
|
|
185491
185347
|
var FieldConditionSchema = exports_external.union([
|
|
185492
185348
|
exports_external.string(),
|
|
185493
|
-
exports_external.
|
|
185349
|
+
exports_external.number(),
|
|
185350
|
+
exports_external.boolean(),
|
|
185351
|
+
exports_external.null(),
|
|
185352
|
+
exports_external.looseObject({
|
|
185494
185353
|
$in: exports_external.unknown().optional(),
|
|
185495
185354
|
$nin: exports_external.unknown().optional(),
|
|
185496
185355
|
$ne: exports_external.unknown().optional(),
|
|
@@ -185507,6 +185366,15 @@ var rlsConditionAllowedKeys = new Set([
|
|
|
185507
185366
|
"user_condition",
|
|
185508
185367
|
"created_by",
|
|
185509
185368
|
"created_by_id",
|
|
185369
|
+
"id",
|
|
185370
|
+
"_id",
|
|
185371
|
+
"created_date",
|
|
185372
|
+
"updated_date",
|
|
185373
|
+
"app_id",
|
|
185374
|
+
"entity_name",
|
|
185375
|
+
"is_deleted",
|
|
185376
|
+
"deleted_date",
|
|
185377
|
+
"environment",
|
|
185510
185378
|
"$or",
|
|
185511
185379
|
"$and",
|
|
185512
185380
|
"$nor"
|
|
@@ -185539,56 +185407,37 @@ var RefineRLSConditionSchema = RLSConditionSchema.refine((val) => Object.entries
|
|
|
185539
185407
|
if (rlsConditionAllowedKeys.has(key)) {
|
|
185540
185408
|
return true;
|
|
185541
185409
|
}
|
|
185542
|
-
if (
|
|
185543
|
-
return
|
|
185410
|
+
if (key.startsWith("data.")) {
|
|
185411
|
+
return isValidFieldCondition(value);
|
|
185544
185412
|
}
|
|
185545
185413
|
return isValidFieldCondition(value);
|
|
185546
185414
|
}), "Keys must be known RLS keys or match data.* pattern with valid value");
|
|
185547
185415
|
var RLSRuleSchema = exports_external.union([exports_external.boolean(), RefineRLSConditionSchema]);
|
|
185548
|
-
var EntityRLSSchema = exports_external.
|
|
185416
|
+
var EntityRLSSchema = exports_external.looseObject({
|
|
185549
185417
|
create: RLSRuleSchema.optional(),
|
|
185550
185418
|
read: RLSRuleSchema.optional(),
|
|
185551
185419
|
update: RLSRuleSchema.optional(),
|
|
185552
185420
|
delete: RLSRuleSchema.optional(),
|
|
185553
185421
|
write: RLSRuleSchema.optional()
|
|
185554
185422
|
});
|
|
185555
|
-
var FieldRLSSchema = exports_external.
|
|
185423
|
+
var FieldRLSSchema = exports_external.looseObject({
|
|
185556
185424
|
read: RLSRuleSchema.optional(),
|
|
185557
185425
|
write: RLSRuleSchema.optional(),
|
|
185558
185426
|
create: RLSRuleSchema.optional(),
|
|
185559
185427
|
update: RLSRuleSchema.optional(),
|
|
185560
185428
|
delete: RLSRuleSchema.optional()
|
|
185561
185429
|
});
|
|
185562
|
-
var
|
|
185563
|
-
|
|
185564
|
-
"number",
|
|
185565
|
-
"integer",
|
|
185566
|
-
"boolean",
|
|
185567
|
-
"array",
|
|
185568
|
-
"object"
|
|
185569
|
-
]);
|
|
185570
|
-
var StringFormatSchema = exports_external.enum([
|
|
185571
|
-
"date",
|
|
185572
|
-
"date-time",
|
|
185573
|
-
"time",
|
|
185574
|
-
"email",
|
|
185575
|
-
"uri",
|
|
185576
|
-
"hostname",
|
|
185577
|
-
"ipv4",
|
|
185578
|
-
"ipv6",
|
|
185579
|
-
"uuid"
|
|
185580
|
-
]);
|
|
185581
|
-
var PropertyDefinitionSchema = exports_external.object({
|
|
185582
|
-
type: PropertyTypeSchema,
|
|
185430
|
+
var PropertyDefinitionSchema = exports_external.looseObject({
|
|
185431
|
+
type: exports_external.string().optional(),
|
|
185583
185432
|
title: exports_external.string().optional(),
|
|
185584
185433
|
description: exports_external.string().optional(),
|
|
185585
185434
|
minLength: exports_external.number().int().min(0).optional(),
|
|
185586
185435
|
maxLength: exports_external.number().int().min(0).optional(),
|
|
185587
185436
|
pattern: exports_external.string().optional(),
|
|
185588
|
-
format:
|
|
185437
|
+
format: exports_external.string().optional(),
|
|
185589
185438
|
minimum: exports_external.number().optional(),
|
|
185590
185439
|
maximum: exports_external.number().optional(),
|
|
185591
|
-
enum: exports_external.array(exports_external.
|
|
185440
|
+
enum: exports_external.array(exports_external.unknown()).optional(),
|
|
185592
185441
|
enumNames: exports_external.array(exports_external.string()).optional(),
|
|
185593
185442
|
default: exports_external.unknown().optional(),
|
|
185594
185443
|
$ref: exports_external.string().optional(),
|
|
@@ -185601,12 +185450,12 @@ var PropertyDefinitionSchema = exports_external.object({
|
|
|
185601
185450
|
return exports_external.record(exports_external.string(), PropertyDefinitionSchema).optional();
|
|
185602
185451
|
}
|
|
185603
185452
|
});
|
|
185604
|
-
var EntitySchema = exports_external.
|
|
185605
|
-
type: exports_external.literal("object"),
|
|
185606
|
-
name: exports_external.string().regex(/^[a-zA-Z0-9]+$/, "Entity name must be alphanumeric only"),
|
|
185453
|
+
var EntitySchema = exports_external.looseObject({
|
|
185454
|
+
type: exports_external.literal("object").default("object"),
|
|
185455
|
+
name: exports_external.string().min(1).regex(/^[a-zA-Z0-9]+$/, "Entity name must be alphanumeric only"),
|
|
185607
185456
|
title: exports_external.string().optional(),
|
|
185608
185457
|
description: exports_external.string().optional(),
|
|
185609
|
-
properties: exports_external.record(exports_external.string(), PropertyDefinitionSchema),
|
|
185458
|
+
properties: exports_external.record(exports_external.string(), PropertyDefinitionSchema).default({}),
|
|
185610
185459
|
required: exports_external.array(exports_external.string()).optional(),
|
|
185611
185460
|
rls: EntityRLSSchema.optional()
|
|
185612
185461
|
});
|
|
@@ -193786,10 +193635,6 @@ function getDashboardUrl(projectId) {
|
|
|
193786
193635
|
const id = projectId ?? getAppConfig().id;
|
|
193787
193636
|
return `${getBase44ApiUrl()}/apps/${id}/editor/workspace/overview`;
|
|
193788
193637
|
}
|
|
193789
|
-
function getConnectorsUrl(projectId) {
|
|
193790
|
-
const id = projectId ?? getAppConfig().id;
|
|
193791
|
-
return `${getBase44ApiUrl()}/apps/${id}/editor/workspace/app-connections`;
|
|
193792
|
-
}
|
|
193793
193638
|
// src/cli/commands/agents/pull.ts
|
|
193794
193639
|
async function pullAgentsAction() {
|
|
193795
193640
|
const { project: project2 } = await readProjectConfig();
|
|
@@ -193894,13 +193739,13 @@ async function pullConnectorsAction() {
|
|
|
193894
193739
|
const configDir = dirname8(project2.configPath);
|
|
193895
193740
|
const connectorsDir = join10(configDir, project2.connectorsDir);
|
|
193896
193741
|
const remoteConnectors = await runTask("Fetching connectors from Base44", async () => {
|
|
193897
|
-
return await
|
|
193742
|
+
return await listConnectors();
|
|
193898
193743
|
}, {
|
|
193899
193744
|
successMessage: "Connectors fetched successfully",
|
|
193900
193745
|
errorMessage: "Failed to fetch connectors"
|
|
193901
193746
|
});
|
|
193902
193747
|
const { written, deleted } = await runTask("Syncing connector files", async () => {
|
|
193903
|
-
return await writeConnectors(connectorsDir, remoteConnectors);
|
|
193748
|
+
return await writeConnectors(connectorsDir, remoteConnectors.integrations);
|
|
193904
193749
|
}, {
|
|
193905
193750
|
successMessage: "Connector files synced successfully",
|
|
193906
193751
|
errorMessage: "Failed to sync connector files"
|
|
@@ -193915,7 +193760,7 @@ async function pullConnectorsAction() {
|
|
|
193915
193760
|
M2.info("All connectors are already up to date");
|
|
193916
193761
|
}
|
|
193917
193762
|
return {
|
|
193918
|
-
outroMessage: `Pulled ${remoteConnectors.length} connectors to ${connectorsDir}`
|
|
193763
|
+
outroMessage: `Pulled ${remoteConnectors.integrations.length} connectors to ${connectorsDir}`
|
|
193919
193764
|
};
|
|
193920
193765
|
}
|
|
193921
193766
|
function getConnectorsPullCommand(context) {
|
|
@@ -194534,7 +194379,7 @@ var open_default = open;
|
|
|
194534
194379
|
var POLL_INTERVAL_MS = 2000;
|
|
194535
194380
|
var POLL_TIMEOUT_MS = 2 * 60 * 1000;
|
|
194536
194381
|
function filterPendingOAuth(results) {
|
|
194537
|
-
return results.filter((r2) => r2.action === "needs_oauth");
|
|
194382
|
+
return results.filter((r2) => r2.action === "needs_oauth" && !!r2.redirectUrl && !!r2.connectionId);
|
|
194538
194383
|
}
|
|
194539
194384
|
async function runOAuthFlowWithSkip(connector2) {
|
|
194540
194385
|
await open_default(connector2.redirectUrl);
|
|
@@ -194616,49 +194461,32 @@ Opening browser for ${connector2.type}...`);
|
|
|
194616
194461
|
function printSummary(results, oauthOutcomes) {
|
|
194617
194462
|
const synced = [];
|
|
194618
194463
|
const added = [];
|
|
194619
|
-
const provisioned = [];
|
|
194620
194464
|
const removed = [];
|
|
194621
194465
|
const skipped = [];
|
|
194622
194466
|
const failed = [];
|
|
194623
194467
|
for (const r2 of results) {
|
|
194624
|
-
|
|
194625
|
-
|
|
194626
|
-
|
|
194627
|
-
|
|
194628
|
-
|
|
194629
|
-
|
|
194630
|
-
|
|
194631
|
-
|
|
194632
|
-
|
|
194633
|
-
|
|
194634
|
-
|
|
194635
|
-
|
|
194636
|
-
|
|
194637
|
-
|
|
194638
|
-
|
|
194639
|
-
|
|
194640
|
-
|
|
194641
|
-
|
|
194642
|
-
skipped.push(r2.type);
|
|
194643
|
-
} else if (oauthStatus === "PENDING") {
|
|
194644
|
-
failed.push({ type: r2.type, error: "authorization timed out" });
|
|
194645
|
-
} else if (oauthStatus === "FAILED") {
|
|
194646
|
-
failed.push({ type: r2.type, error: "authorization failed" });
|
|
194647
|
-
} else {
|
|
194648
|
-
failed.push({ type: r2.type, error: "needs authorization" });
|
|
194649
|
-
}
|
|
194650
|
-
break;
|
|
194468
|
+
const oauthStatus = oauthOutcomes.get(r2.type);
|
|
194469
|
+
if (r2.action === "synced") {
|
|
194470
|
+
synced.push(r2.type);
|
|
194471
|
+
} else if (r2.action === "removed") {
|
|
194472
|
+
removed.push(r2.type);
|
|
194473
|
+
} else if (r2.action === "error") {
|
|
194474
|
+
failed.push({ type: r2.type, error: r2.error });
|
|
194475
|
+
} else if (r2.action === "needs_oauth") {
|
|
194476
|
+
if (oauthStatus === "ACTIVE") {
|
|
194477
|
+
added.push(r2.type);
|
|
194478
|
+
} else if (oauthStatus === "SKIPPED") {
|
|
194479
|
+
skipped.push(r2.type);
|
|
194480
|
+
} else if (oauthStatus === "PENDING") {
|
|
194481
|
+
failed.push({ type: r2.type, error: "authorization timed out" });
|
|
194482
|
+
} else if (oauthStatus === "FAILED") {
|
|
194483
|
+
failed.push({ type: r2.type, error: "authorization failed" });
|
|
194484
|
+
} else {
|
|
194485
|
+
failed.push({ type: r2.type, error: "needs authorization" });
|
|
194651
194486
|
}
|
|
194652
194487
|
}
|
|
194653
194488
|
}
|
|
194654
194489
|
M2.info(theme.styles.bold("Summary:"));
|
|
194655
|
-
for (const i2 of provisioned) {
|
|
194656
|
-
M2.success(`Provisioned: ${i2.type} (${i2.mode})`);
|
|
194657
|
-
if (i2.claimUrl) {
|
|
194658
|
-
M2.info(` Claim your Stripe account: ${theme.colors.links(i2.claimUrl)}`);
|
|
194659
|
-
}
|
|
194660
|
-
M2.info(` Connectors dashboard: ${theme.colors.links(getConnectorsUrl())}`);
|
|
194661
|
-
}
|
|
194662
194490
|
if (synced.length > 0) {
|
|
194663
194491
|
M2.success(`Synced: ${synced.join(", ")}`);
|
|
194664
194492
|
}
|
|
@@ -194672,7 +194500,7 @@ function printSummary(results, oauthOutcomes) {
|
|
|
194672
194500
|
M2.warn(`Skipped: ${skipped.join(", ")}`);
|
|
194673
194501
|
}
|
|
194674
194502
|
for (const r2 of failed) {
|
|
194675
|
-
M2.error(`Failed: ${r2.type} - ${r2.error}`);
|
|
194503
|
+
M2.error(`Failed: ${r2.type}${r2.error ? ` - ${r2.error}` : ""}`);
|
|
194676
194504
|
}
|
|
194677
194505
|
}
|
|
194678
194506
|
async function pushConnectorsAction() {
|
|
@@ -194706,7 +194534,7 @@ function getConnectorsPushCommand(context) {
|
|
|
194706
194534
|
|
|
194707
194535
|
// src/cli/commands/connectors/index.ts
|
|
194708
194536
|
function getConnectorsCommand(context) {
|
|
194709
|
-
return new Command("connectors").description("Manage project connectors").addCommand(getConnectorsPullCommand(context)).addCommand(getConnectorsPushCommand(context));
|
|
194537
|
+
return new Command("connectors").description("Manage project connectors (OAuth integrations)").addCommand(getConnectorsPullCommand(context)).addCommand(getConnectorsPushCommand(context));
|
|
194710
194538
|
}
|
|
194711
194539
|
|
|
194712
194540
|
// src/cli/commands/dashboard/open.ts
|
|
@@ -195022,11 +194850,15 @@ ${summaryLines.join(`
|
|
|
195022
194850
|
successMessage: theme.colors.base44Orange("Deployment completed"),
|
|
195023
194851
|
errorMessage: "Deployment failed"
|
|
195024
194852
|
});
|
|
195025
|
-
const
|
|
195026
|
-
|
|
195027
|
-
|
|
195028
|
-
|
|
195029
|
-
|
|
194853
|
+
const needsOAuth = filterPendingOAuth(result.connectorResults ?? []);
|
|
194854
|
+
if (needsOAuth.length > 0) {
|
|
194855
|
+
const oauthOutcomes = await promptOAuthFlows(needsOAuth, {
|
|
194856
|
+
skipPrompt: options.yes || !!process.env.CI
|
|
194857
|
+
});
|
|
194858
|
+
const allAuthorized = oauthOutcomes.size > 0 && [...oauthOutcomes.values()].every((s) => s === "ACTIVE");
|
|
194859
|
+
if (!allAuthorized) {
|
|
194860
|
+
M2.info("Some connectors still require authorization. Run 'base44 connectors push' or open the links above in your browser.");
|
|
194861
|
+
}
|
|
195030
194862
|
}
|
|
195031
194863
|
M2.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl())}`);
|
|
195032
194864
|
if (result.appUrl) {
|
|
@@ -195039,25 +194871,6 @@ function getDeployCommand(context) {
|
|
|
195039
194871
|
await runCommand(() => deployAction(options), { requireAuth: true }, context);
|
|
195040
194872
|
});
|
|
195041
194873
|
}
|
|
195042
|
-
async function handleOAuthConnectors(connectorResults, options) {
|
|
195043
|
-
const needsOAuth = filterPendingOAuth(connectorResults);
|
|
195044
|
-
if (needsOAuth.length === 0)
|
|
195045
|
-
return;
|
|
195046
|
-
const oauthOutcomes = await promptOAuthFlows(needsOAuth, {
|
|
195047
|
-
skipPrompt: options.yes || !!process.env.CI
|
|
195048
|
-
});
|
|
195049
|
-
const allAuthorized = oauthOutcomes.size > 0 && [...oauthOutcomes.values()].every((s) => s === "ACTIVE");
|
|
195050
|
-
if (!allAuthorized) {
|
|
195051
|
-
M2.info("Some connectors still require authorization. Run 'base44 connectors push' or open the links above in your browser.");
|
|
195052
|
-
}
|
|
195053
|
-
}
|
|
195054
|
-
function printStripeResult(r2) {
|
|
195055
|
-
M2.success(`Provisioned: Stripe (${r2.mode})`);
|
|
195056
|
-
if (r2.claimUrl) {
|
|
195057
|
-
M2.info(` Claim your Stripe account: ${theme.colors.links(r2.claimUrl)}`);
|
|
195058
|
-
}
|
|
195059
|
-
M2.info(` Connectors dashboard: ${theme.colors.links(getConnectorsUrl())}`);
|
|
195060
|
-
}
|
|
195061
194874
|
|
|
195062
194875
|
// src/cli/commands/project/link.ts
|
|
195063
194876
|
function validateNonInteractiveFlags2(command) {
|
|
@@ -199946,4 +199759,4 @@ export {
|
|
|
199946
199759
|
CLIExitError
|
|
199947
199760
|
};
|
|
199948
199761
|
|
|
199949
|
-
//# debugId=
|
|
199762
|
+
//# debugId=3407164C3C9C2E3964756E2164756E21
|