@base44-preview/cli 0.0.41-pr.251.81e7ce8 → 0.0.41-pr.380.3494f7e
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 +112 -237
- package/dist/cli/index.js.map +19 -18
- package/package.json +85 -86
package/dist/cli/index.js
CHANGED
|
@@ -18062,7 +18062,7 @@ var require_lodash = __commonJS((exports, module) => {
|
|
|
18062
18062
|
function nth(array2, n2) {
|
|
18063
18063
|
return array2 && array2.length ? baseNth(array2, toInteger(n2)) : undefined2;
|
|
18064
18064
|
}
|
|
18065
|
-
var
|
|
18065
|
+
var pull = baseRest(pullAll);
|
|
18066
18066
|
function pullAll(array2, values2) {
|
|
18067
18067
|
return array2 && array2.length && values2 && values2.length ? basePullAll(array2, values2) : array2;
|
|
18068
18068
|
}
|
|
@@ -19827,7 +19827,7 @@ __p += '`;
|
|
|
19827
19827
|
lodash.pickBy = pickBy;
|
|
19828
19828
|
lodash.property = property;
|
|
19829
19829
|
lodash.propertyOf = propertyOf;
|
|
19830
|
-
lodash.pull =
|
|
19830
|
+
lodash.pull = pull;
|
|
19831
19831
|
lodash.pullAll = pullAll;
|
|
19832
19832
|
lodash.pullAllBy = pullAllBy;
|
|
19833
19833
|
lodash.pullAllWith = pullAllWith;
|
|
@@ -230612,10 +230612,6 @@ var GoogleBigQueryConnectorSchema = exports_external.object({
|
|
|
230612
230612
|
type: exports_external.literal("googlebigquery"),
|
|
230613
230613
|
scopes: exports_external.array(exports_external.string()).default([])
|
|
230614
230614
|
});
|
|
230615
|
-
var StripeConnectorSchema = exports_external.object({
|
|
230616
|
-
type: exports_external.literal("stripe"),
|
|
230617
|
-
scopes: exports_external.array(exports_external.string()).default([])
|
|
230618
|
-
});
|
|
230619
230615
|
var CustomTypeSchema = exports_external.string().min(1).regex(/^[a-z0-9_-]+$/i);
|
|
230620
230616
|
var GenericConnectorSchema = exports_external.object({
|
|
230621
230617
|
type: CustomTypeSchema,
|
|
@@ -230635,7 +230631,6 @@ var ConnectorResourceSchema = exports_external.union([
|
|
|
230635
230631
|
HubspotConnectorSchema,
|
|
230636
230632
|
LinkedInConnectorSchema,
|
|
230637
230633
|
TikTokConnectorSchema,
|
|
230638
|
-
StripeConnectorSchema,
|
|
230639
230634
|
GenericConnectorSchema
|
|
230640
230635
|
]);
|
|
230641
230636
|
var KnownIntegrationTypes = [
|
|
@@ -230651,8 +230646,7 @@ var KnownIntegrationTypes = [
|
|
|
230651
230646
|
"salesforce",
|
|
230652
230647
|
"hubspot",
|
|
230653
230648
|
"linkedin",
|
|
230654
|
-
"tiktok"
|
|
230655
|
-
"stripe"
|
|
230649
|
+
"tiktok"
|
|
230656
230650
|
];
|
|
230657
230651
|
var IntegrationTypeSchema = exports_external.union([
|
|
230658
230652
|
exports_external.enum(KnownIntegrationTypes),
|
|
@@ -230705,18 +230699,6 @@ var RemoveConnectorResponseSchema = exports_external.object({
|
|
|
230705
230699
|
status: data.status,
|
|
230706
230700
|
integrationType: data.integration_type
|
|
230707
230701
|
}));
|
|
230708
|
-
var STRIPE_CONNECTOR_TYPE = "stripe";
|
|
230709
|
-
var InstallStripeResponseSchema = exports_external.object({
|
|
230710
|
-
already_installed: exports_external.boolean(),
|
|
230711
|
-
claim_url: exports_external.string().nullable()
|
|
230712
|
-
});
|
|
230713
|
-
var StripeStatusResponseSchema = exports_external.object({
|
|
230714
|
-
stripe_mode: exports_external.enum(["sandbox", "live"]).nullable(),
|
|
230715
|
-
sandbox_claim_url: exports_external.string().nullable().optional()
|
|
230716
|
-
});
|
|
230717
|
-
var RemoveStripeResponseSchema = exports_external.object({
|
|
230718
|
-
success: exports_external.boolean()
|
|
230719
|
-
});
|
|
230720
230702
|
|
|
230721
230703
|
// src/core/resources/connector/api.ts
|
|
230722
230704
|
async function listConnectors() {
|
|
@@ -230784,54 +230766,6 @@ async function removeConnector(integrationType) {
|
|
|
230784
230766
|
}
|
|
230785
230767
|
return result.data;
|
|
230786
230768
|
}
|
|
230787
|
-
async function installStripe() {
|
|
230788
|
-
const appClient = getAppClient();
|
|
230789
|
-
let response;
|
|
230790
|
-
try {
|
|
230791
|
-
response = await appClient.post("payments/stripe/install", {
|
|
230792
|
-
timeout: 60000
|
|
230793
|
-
});
|
|
230794
|
-
} catch (error48) {
|
|
230795
|
-
throw await ApiError.fromHttpError(error48, "installing Stripe");
|
|
230796
|
-
}
|
|
230797
|
-
const result = InstallStripeResponseSchema.safeParse(await response.json());
|
|
230798
|
-
if (!result.success) {
|
|
230799
|
-
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
230800
|
-
}
|
|
230801
|
-
return result.data;
|
|
230802
|
-
}
|
|
230803
|
-
async function getStripeStatus() {
|
|
230804
|
-
const appClient = getAppClient();
|
|
230805
|
-
let response;
|
|
230806
|
-
try {
|
|
230807
|
-
response = await appClient.get("payments/stripe/status", {
|
|
230808
|
-
timeout: 60000
|
|
230809
|
-
});
|
|
230810
|
-
} catch (error48) {
|
|
230811
|
-
throw await ApiError.fromHttpError(error48, "checking Stripe integration status");
|
|
230812
|
-
}
|
|
230813
|
-
const result = StripeStatusResponseSchema.safeParse(await response.json());
|
|
230814
|
-
if (!result.success) {
|
|
230815
|
-
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
230816
|
-
}
|
|
230817
|
-
return result.data;
|
|
230818
|
-
}
|
|
230819
|
-
async function removeStripe() {
|
|
230820
|
-
const appClient = getAppClient();
|
|
230821
|
-
let response;
|
|
230822
|
-
try {
|
|
230823
|
-
response = await appClient.delete("payments/stripe", {
|
|
230824
|
-
timeout: 60000
|
|
230825
|
-
});
|
|
230826
|
-
} catch (error48) {
|
|
230827
|
-
throw await ApiError.fromHttpError(error48, "removing Stripe integration");
|
|
230828
|
-
}
|
|
230829
|
-
const result = RemoveStripeResponseSchema.safeParse(await response.json());
|
|
230830
|
-
if (!result.success) {
|
|
230831
|
-
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
230832
|
-
}
|
|
230833
|
-
return result.data;
|
|
230834
|
-
}
|
|
230835
230769
|
// src/core/resources/connector/config.ts
|
|
230836
230770
|
import { join as join4 } from "node:path";
|
|
230837
230771
|
import { isDeepStrictEqual as isDeepStrictEqual2 } from "node:util";
|
|
@@ -230880,7 +230814,7 @@ async function readAllConnectors(connectorsDir) {
|
|
|
230880
230814
|
async function writeConnectors(connectorsDir, remoteConnectors) {
|
|
230881
230815
|
const entries = await readConnectorFiles(connectorsDir);
|
|
230882
230816
|
const typeToEntry = buildTypeToEntryMap(entries);
|
|
230883
|
-
const newTypes = new Set(remoteConnectors.map((c) => c.
|
|
230817
|
+
const newTypes = new Set(remoteConnectors.map((c) => c.integrationType));
|
|
230884
230818
|
const deleted = [];
|
|
230885
230819
|
for (const [type, entry] of typeToEntry) {
|
|
230886
230820
|
if (!newTypes.has(type)) {
|
|
@@ -230890,44 +230824,22 @@ async function writeConnectors(connectorsDir, remoteConnectors) {
|
|
|
230890
230824
|
}
|
|
230891
230825
|
const written = [];
|
|
230892
230826
|
for (const connector of remoteConnectors) {
|
|
230893
|
-
const existing = typeToEntry.get(connector.
|
|
230894
|
-
|
|
230827
|
+
const existing = typeToEntry.get(connector.integrationType);
|
|
230828
|
+
const localConnector = {
|
|
230829
|
+
type: connector.integrationType,
|
|
230830
|
+
scopes: connector.scopes
|
|
230831
|
+
};
|
|
230832
|
+
if (existing && isDeepStrictEqual2(existing.data, localConnector)) {
|
|
230895
230833
|
continue;
|
|
230896
230834
|
}
|
|
230897
|
-
const filePath = existing?.filePath ?? join4(connectorsDir, `${connector.
|
|
230898
|
-
await writeJsonFile(filePath,
|
|
230899
|
-
written.push(connector.
|
|
230835
|
+
const filePath = existing?.filePath ?? join4(connectorsDir, `${connector.integrationType}.${CONFIG_FILE_EXTENSION}`);
|
|
230836
|
+
await writeJsonFile(filePath, localConnector);
|
|
230837
|
+
written.push(connector.integrationType);
|
|
230900
230838
|
}
|
|
230901
230839
|
return { written, deleted };
|
|
230902
230840
|
}
|
|
230903
|
-
// src/core/resources/connector/pull.ts
|
|
230904
|
-
async function pullAllConnectors() {
|
|
230905
|
-
const [oauthResponse, stripeStatus] = await Promise.all([
|
|
230906
|
-
listConnectors(),
|
|
230907
|
-
getStripeStatus()
|
|
230908
|
-
]);
|
|
230909
|
-
const connectors = oauthResponse.integrations.map((i) => ({
|
|
230910
|
-
type: i.integrationType,
|
|
230911
|
-
scopes: i.scopes
|
|
230912
|
-
}));
|
|
230913
|
-
if (stripeStatus.stripe_mode !== null) {
|
|
230914
|
-
connectors.push({ type: STRIPE_CONNECTOR_TYPE, scopes: [] });
|
|
230915
|
-
}
|
|
230916
|
-
return connectors;
|
|
230917
|
-
}
|
|
230918
230841
|
// src/core/resources/connector/push.ts
|
|
230919
230842
|
async function pushConnectors(connectors) {
|
|
230920
|
-
const stripeConnector = connectors.find((c) => c.type === STRIPE_CONNECTOR_TYPE);
|
|
230921
|
-
const oauthConnectors = connectors.filter((c) => c.type !== STRIPE_CONNECTOR_TYPE);
|
|
230922
|
-
const oauthResults = await syncOAuthConnectors(oauthConnectors);
|
|
230923
|
-
const stripeResult = await syncStripeConnector(stripeConnector);
|
|
230924
|
-
const results = [...oauthResults];
|
|
230925
|
-
if (stripeResult) {
|
|
230926
|
-
results.push(stripeResult);
|
|
230927
|
-
}
|
|
230928
|
-
return { results };
|
|
230929
|
-
}
|
|
230930
|
-
async function syncOAuthConnectors(connectors) {
|
|
230931
230843
|
const results = [];
|
|
230932
230844
|
const upstream = await listConnectors();
|
|
230933
230845
|
const localTypes = new Set(connectors.map((c) => c.type));
|
|
@@ -230960,62 +230872,7 @@ async function syncOAuthConnectors(connectors) {
|
|
|
230960
230872
|
}
|
|
230961
230873
|
}
|
|
230962
230874
|
}
|
|
230963
|
-
return results;
|
|
230964
|
-
}
|
|
230965
|
-
async function syncStripeConnector(localStripe) {
|
|
230966
|
-
const remoteStatus = await fetchStripeRemoteStatus();
|
|
230967
|
-
if (remoteStatus === "error") {
|
|
230968
|
-
return localStripe ? stripeError("Failed to check Stripe integration status") : null;
|
|
230969
|
-
}
|
|
230970
|
-
const isRemoteInstalled = remoteStatus.stripe_mode !== null;
|
|
230971
|
-
const needsInstall = localStripe && !isRemoteInstalled;
|
|
230972
|
-
const alreadySynced = localStripe && isRemoteInstalled;
|
|
230973
|
-
const needsRemoval = !localStripe && isRemoteInstalled;
|
|
230974
|
-
if (needsInstall) {
|
|
230975
|
-
return handleStripeInstall();
|
|
230976
|
-
}
|
|
230977
|
-
if (alreadySynced) {
|
|
230978
|
-
return stripeSynced();
|
|
230979
|
-
}
|
|
230980
|
-
if (needsRemoval) {
|
|
230981
|
-
return handleStripeRemoval();
|
|
230982
|
-
}
|
|
230983
|
-
return null;
|
|
230984
|
-
}
|
|
230985
|
-
async function fetchStripeRemoteStatus() {
|
|
230986
|
-
try {
|
|
230987
|
-
return await getStripeStatus();
|
|
230988
|
-
} catch {
|
|
230989
|
-
return "error";
|
|
230990
|
-
}
|
|
230991
|
-
}
|
|
230992
|
-
async function handleStripeInstall() {
|
|
230993
|
-
try {
|
|
230994
|
-
const result = await installStripe();
|
|
230995
|
-
return stripeProvisioned(result.claim_url ?? undefined);
|
|
230996
|
-
} catch (err) {
|
|
230997
|
-
return stripeError(err instanceof Error ? err.message : String(err));
|
|
230998
|
-
}
|
|
230999
|
-
}
|
|
231000
|
-
async function handleStripeRemoval() {
|
|
231001
|
-
try {
|
|
231002
|
-
await removeStripe();
|
|
231003
|
-
return stripeRemoved();
|
|
231004
|
-
} catch (err) {
|
|
231005
|
-
return stripeError(err instanceof Error ? err.message : String(err));
|
|
231006
|
-
}
|
|
231007
|
-
}
|
|
231008
|
-
function stripeSynced() {
|
|
231009
|
-
return { type: STRIPE_CONNECTOR_TYPE, action: "synced" };
|
|
231010
|
-
}
|
|
231011
|
-
function stripeProvisioned(claimUrl) {
|
|
231012
|
-
return { type: STRIPE_CONNECTOR_TYPE, action: "provisioned", claimUrl };
|
|
231013
|
-
}
|
|
231014
|
-
function stripeRemoved() {
|
|
231015
|
-
return { type: STRIPE_CONNECTOR_TYPE, action: "removed" };
|
|
231016
|
-
}
|
|
231017
|
-
function stripeError(error48) {
|
|
231018
|
-
return { type: STRIPE_CONNECTOR_TYPE, action: "error", error: error48 };
|
|
230875
|
+
return { results };
|
|
231019
230876
|
}
|
|
231020
230877
|
function getConnectorSyncResult(type, response) {
|
|
231021
230878
|
if (response.error === "different_user") {
|
|
@@ -231033,7 +230890,7 @@ function getConnectorSyncResult(type, response) {
|
|
|
231033
230890
|
type,
|
|
231034
230891
|
action: "needs_oauth",
|
|
231035
230892
|
redirectUrl: response.redirectUrl,
|
|
231036
|
-
connectionId: response.connectionId ??
|
|
230893
|
+
connectionId: response.connectionId ?? undefined
|
|
231037
230894
|
};
|
|
231038
230895
|
}
|
|
231039
230896
|
return { type, action: "synced" };
|
|
@@ -231275,6 +231132,21 @@ var DeployFunctionsResponseSchema = exports_external.object({
|
|
|
231275
231132
|
skipped: exports_external.array(exports_external.string()).optional().nullable(),
|
|
231276
231133
|
errors: exports_external.array(exports_external.object({ name: exports_external.string(), message: exports_external.string() })).nullable()
|
|
231277
231134
|
});
|
|
231135
|
+
var FunctionAutomationInfoSchema = exports_external.object({
|
|
231136
|
+
name: exports_external.string(),
|
|
231137
|
+
type: exports_external.string(),
|
|
231138
|
+
is_active: exports_external.boolean()
|
|
231139
|
+
});
|
|
231140
|
+
var FunctionInfoSchema = exports_external.object({
|
|
231141
|
+
name: exports_external.string(),
|
|
231142
|
+
deployment_id: exports_external.string(),
|
|
231143
|
+
entry: exports_external.string(),
|
|
231144
|
+
files: exports_external.array(FunctionFileSchema),
|
|
231145
|
+
automations: exports_external.array(FunctionAutomationInfoSchema)
|
|
231146
|
+
});
|
|
231147
|
+
var ListFunctionsResponseSchema = exports_external.object({
|
|
231148
|
+
functions: exports_external.array(FunctionInfoSchema)
|
|
231149
|
+
});
|
|
231278
231150
|
var LogLevelSchema = exports_external.enum(["info", "warning", "error", "debug"]);
|
|
231279
231151
|
var FunctionLogEntrySchema = exports_external.object({
|
|
231280
231152
|
time: exports_external.string(),
|
|
@@ -231348,6 +231220,20 @@ async function fetchFunctionLogs(functionName, filters = {}) {
|
|
|
231348
231220
|
}
|
|
231349
231221
|
return result.data;
|
|
231350
231222
|
}
|
|
231223
|
+
async function listDeployedFunctions() {
|
|
231224
|
+
const appClient = getAppClient();
|
|
231225
|
+
let response;
|
|
231226
|
+
try {
|
|
231227
|
+
response = await appClient.get("backend-functions", { timeout: 30000 });
|
|
231228
|
+
} catch (error48) {
|
|
231229
|
+
throw await ApiError.fromHttpError(error48, "listing deployed functions");
|
|
231230
|
+
}
|
|
231231
|
+
const result = ListFunctionsResponseSchema.safeParse(await response.json());
|
|
231232
|
+
if (!result.success) {
|
|
231233
|
+
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
231234
|
+
}
|
|
231235
|
+
return result.data;
|
|
231236
|
+
}
|
|
231351
231237
|
// src/core/resources/function/config.ts
|
|
231352
231238
|
import { basename as basename2, dirname as dirname3, join as join5, relative } from "node:path";
|
|
231353
231239
|
async function readFunctionConfig(configPath) {
|
|
@@ -231614,10 +231500,10 @@ var package_default = {
|
|
|
231614
231500
|
dev: "./bin/dev.ts",
|
|
231615
231501
|
start: "./bin/run.js",
|
|
231616
231502
|
clean: "rm -rf dist && mkdir -p dist",
|
|
231617
|
-
lint: "biome check src tests",
|
|
231618
|
-
"lint:fix": "biome check --write src tests",
|
|
231619
231503
|
test: "vitest run",
|
|
231620
231504
|
"test:watch": "vitest",
|
|
231505
|
+
lint: "cd ../.. && bun run lint",
|
|
231506
|
+
"lint:fix": "cd ../.. && bun run lint:fix",
|
|
231621
231507
|
"build:binaries": "bun run infra/build-binaries.ts",
|
|
231622
231508
|
"package:binaries": "bun run infra/package-binaries.ts"
|
|
231623
231509
|
},
|
|
@@ -231633,7 +231519,6 @@ var package_default = {
|
|
|
231633
231519
|
url: "https://github.com/base44/cli"
|
|
231634
231520
|
},
|
|
231635
231521
|
devDependencies: {
|
|
231636
|
-
"@biomejs/biome": "^2.0.0",
|
|
231637
231522
|
"@clack/prompts": "^1.0.1",
|
|
231638
231523
|
"@seald-io/nedb": "^4.1.2",
|
|
231639
231524
|
"@types/bun": "^1.2.15",
|
|
@@ -239530,10 +239415,6 @@ function getDashboardUrl(projectId) {
|
|
|
239530
239415
|
const id = projectId ?? getAppConfig().id;
|
|
239531
239416
|
return `${getBase44ApiUrl()}/apps/${id}/editor/workspace/overview`;
|
|
239532
239417
|
}
|
|
239533
|
-
function getConnectorsUrl(projectId) {
|
|
239534
|
-
const id = projectId ?? getAppConfig().id;
|
|
239535
|
-
return `${getBase44ApiUrl()}/apps/${id}/editor/workspace/app-connections`;
|
|
239536
|
-
}
|
|
239537
239418
|
// src/cli/commands/agents/pull.ts
|
|
239538
239419
|
async function pullAgentsAction() {
|
|
239539
239420
|
const { project: project2 } = await readProjectConfig();
|
|
@@ -239638,13 +239519,13 @@ async function pullConnectorsAction() {
|
|
|
239638
239519
|
const configDir = dirname8(project2.configPath);
|
|
239639
239520
|
const connectorsDir = join11(configDir, project2.connectorsDir);
|
|
239640
239521
|
const remoteConnectors = await runTask("Fetching connectors from Base44", async () => {
|
|
239641
|
-
return await
|
|
239522
|
+
return await listConnectors();
|
|
239642
239523
|
}, {
|
|
239643
239524
|
successMessage: "Connectors fetched successfully",
|
|
239644
239525
|
errorMessage: "Failed to fetch connectors"
|
|
239645
239526
|
});
|
|
239646
239527
|
const { written, deleted } = await runTask("Syncing connector files", async () => {
|
|
239647
|
-
return await writeConnectors(connectorsDir, remoteConnectors);
|
|
239528
|
+
return await writeConnectors(connectorsDir, remoteConnectors.integrations);
|
|
239648
239529
|
}, {
|
|
239649
239530
|
successMessage: "Connector files synced successfully",
|
|
239650
239531
|
errorMessage: "Failed to sync connector files"
|
|
@@ -239659,7 +239540,7 @@ async function pullConnectorsAction() {
|
|
|
239659
239540
|
R2.info("All connectors are already up to date");
|
|
239660
239541
|
}
|
|
239661
239542
|
return {
|
|
239662
|
-
outroMessage: `Pulled ${remoteConnectors.length} connectors to ${connectorsDir}`
|
|
239543
|
+
outroMessage: `Pulled ${remoteConnectors.integrations.length} connectors to ${connectorsDir}`
|
|
239663
239544
|
};
|
|
239664
239545
|
}
|
|
239665
239546
|
function getConnectorsPullCommand(context) {
|
|
@@ -240278,7 +240159,7 @@ var open_default = open;
|
|
|
240278
240159
|
var POLL_INTERVAL_MS = 2000;
|
|
240279
240160
|
var POLL_TIMEOUT_MS = 2 * 60 * 1000;
|
|
240280
240161
|
function filterPendingOAuth(results) {
|
|
240281
|
-
return results.filter((r) => r.action === "needs_oauth" && !!r.connectionId);
|
|
240162
|
+
return results.filter((r) => r.action === "needs_oauth" && !!r.redirectUrl && !!r.connectionId);
|
|
240282
240163
|
}
|
|
240283
240164
|
async function runOAuthFlowWithSkip(connector2) {
|
|
240284
240165
|
await open_default(connector2.redirectUrl);
|
|
@@ -240358,49 +240239,32 @@ async function promptOAuthFlows(pending, options) {
|
|
|
240358
240239
|
function printSummary(results, oauthOutcomes) {
|
|
240359
240240
|
const synced = [];
|
|
240360
240241
|
const added = [];
|
|
240361
|
-
let provisioned;
|
|
240362
240242
|
const removed = [];
|
|
240363
240243
|
const skipped = [];
|
|
240364
240244
|
const failed = [];
|
|
240365
240245
|
for (const r of results) {
|
|
240366
|
-
|
|
240367
|
-
|
|
240368
|
-
|
|
240369
|
-
|
|
240370
|
-
|
|
240371
|
-
|
|
240372
|
-
|
|
240373
|
-
|
|
240374
|
-
|
|
240375
|
-
|
|
240376
|
-
|
|
240377
|
-
|
|
240378
|
-
|
|
240379
|
-
|
|
240380
|
-
|
|
240381
|
-
|
|
240382
|
-
|
|
240383
|
-
|
|
240384
|
-
skipped.push(r.type);
|
|
240385
|
-
} else if (oauthStatus === "PENDING") {
|
|
240386
|
-
failed.push({ type: r.type, error: "authorization timed out" });
|
|
240387
|
-
} else if (oauthStatus === "FAILED") {
|
|
240388
|
-
failed.push({ type: r.type, error: "authorization failed" });
|
|
240389
|
-
} else {
|
|
240390
|
-
failed.push({ type: r.type, error: "needs authorization" });
|
|
240391
|
-
}
|
|
240392
|
-
break;
|
|
240246
|
+
const oauthStatus = oauthOutcomes.get(r.type);
|
|
240247
|
+
if (r.action === "synced") {
|
|
240248
|
+
synced.push(r.type);
|
|
240249
|
+
} else if (r.action === "removed") {
|
|
240250
|
+
removed.push(r.type);
|
|
240251
|
+
} else if (r.action === "error") {
|
|
240252
|
+
failed.push({ type: r.type, error: r.error });
|
|
240253
|
+
} else if (r.action === "needs_oauth") {
|
|
240254
|
+
if (oauthStatus === "ACTIVE") {
|
|
240255
|
+
added.push(r.type);
|
|
240256
|
+
} else if (oauthStatus === "SKIPPED") {
|
|
240257
|
+
skipped.push(r.type);
|
|
240258
|
+
} else if (oauthStatus === "PENDING") {
|
|
240259
|
+
failed.push({ type: r.type, error: "authorization timed out" });
|
|
240260
|
+
} else if (oauthStatus === "FAILED") {
|
|
240261
|
+
failed.push({ type: r.type, error: "authorization failed" });
|
|
240262
|
+
} else {
|
|
240263
|
+
failed.push({ type: r.type, error: "needs authorization" });
|
|
240393
240264
|
}
|
|
240394
240265
|
}
|
|
240395
240266
|
}
|
|
240396
240267
|
R2.info(theme.styles.bold("Summary:"));
|
|
240397
|
-
if (provisioned) {
|
|
240398
|
-
R2.success("Stripe sandbox provisioned");
|
|
240399
|
-
if (provisioned.claimUrl) {
|
|
240400
|
-
R2.info(` Claim your Stripe sandbox: ${theme.colors.links(provisioned.claimUrl)}`);
|
|
240401
|
-
}
|
|
240402
|
-
R2.info(` Connectors dashboard: ${theme.colors.links(getConnectorsUrl())}`);
|
|
240403
|
-
}
|
|
240404
240268
|
if (synced.length > 0) {
|
|
240405
240269
|
R2.success(`Synced: ${synced.join(", ")}`);
|
|
240406
240270
|
}
|
|
@@ -240414,7 +240278,7 @@ function printSummary(results, oauthOutcomes) {
|
|
|
240414
240278
|
R2.warn(`Skipped: ${skipped.join(", ")}`);
|
|
240415
240279
|
}
|
|
240416
240280
|
for (const r of failed) {
|
|
240417
|
-
R2.error(`Failed: ${r.type} - ${r.error}`);
|
|
240281
|
+
R2.error(`Failed: ${r.type}${r.error ? ` - ${r.error}` : ""}`);
|
|
240418
240282
|
}
|
|
240419
240283
|
}
|
|
240420
240284
|
async function pushConnectorsAction(isNonInteractive) {
|
|
@@ -240448,7 +240312,7 @@ function getConnectorsPushCommand(context) {
|
|
|
240448
240312
|
|
|
240449
240313
|
// src/cli/commands/connectors/index.ts
|
|
240450
240314
|
function getConnectorsCommand(context) {
|
|
240451
|
-
return new Command("connectors").description("Manage project connectors").addCommand(getConnectorsPullCommand(context)).addCommand(getConnectorsPushCommand(context));
|
|
240315
|
+
return new Command("connectors").description("Manage project connectors (OAuth integrations)").addCommand(getConnectorsPullCommand(context)).addCommand(getConnectorsPushCommand(context));
|
|
240452
240316
|
}
|
|
240453
240317
|
|
|
240454
240318
|
// src/cli/commands/dashboard/open.ts
|
|
@@ -240533,10 +240397,36 @@ async function deployFunctionsAction() {
|
|
|
240533
240397
|
}
|
|
240534
240398
|
return { outroMessage: "Functions deployed to Base44" };
|
|
240535
240399
|
}
|
|
240536
|
-
function
|
|
240537
|
-
return new Command("
|
|
240400
|
+
function getDeployCommand(context) {
|
|
240401
|
+
return new Command("deploy").description("Deploy local functions to Base44").action(async () => {
|
|
240538
240402
|
await runCommand(deployFunctionsAction, { requireAuth: true }, context);
|
|
240539
|
-
})
|
|
240403
|
+
});
|
|
240404
|
+
}
|
|
240405
|
+
|
|
240406
|
+
// src/cli/commands/functions/list.ts
|
|
240407
|
+
async function listFunctionsAction() {
|
|
240408
|
+
const { functions } = await listDeployedFunctions();
|
|
240409
|
+
if (functions.length === 0) {
|
|
240410
|
+
return { outroMessage: "No functions on remote" };
|
|
240411
|
+
}
|
|
240412
|
+
for (const fn of functions) {
|
|
240413
|
+
const autoCount = fn.automations.length;
|
|
240414
|
+
const autoLabel = autoCount > 0 ? theme.styles.dim(` (${autoCount} automation${autoCount > 1 ? "s" : ""})`) : "";
|
|
240415
|
+
R2.message(` ${fn.name}${autoLabel}`);
|
|
240416
|
+
}
|
|
240417
|
+
return {
|
|
240418
|
+
outroMessage: `${functions.length} function${functions.length !== 1 ? "s" : ""} on remote`
|
|
240419
|
+
};
|
|
240420
|
+
}
|
|
240421
|
+
function getListCommand(context) {
|
|
240422
|
+
return new Command("list").description("List all deployed functions").action(async () => {
|
|
240423
|
+
await runCommand(listFunctionsAction, { requireAuth: true }, context);
|
|
240424
|
+
});
|
|
240425
|
+
}
|
|
240426
|
+
|
|
240427
|
+
// src/cli/commands/functions/index.ts
|
|
240428
|
+
function getFunctionsCommand(context) {
|
|
240429
|
+
return new Command("functions").description("Manage backend functions").addCommand(getDeployCommand(context)).addCommand(getListCommand(context));
|
|
240540
240430
|
}
|
|
240541
240431
|
|
|
240542
240432
|
// src/cli/commands/project/create.ts
|
|
@@ -240762,11 +240652,15 @@ ${summaryLines.join(`
|
|
|
240762
240652
|
successMessage: theme.colors.base44Orange("Deployment completed"),
|
|
240763
240653
|
errorMessage: "Deployment failed"
|
|
240764
240654
|
});
|
|
240765
|
-
const
|
|
240766
|
-
|
|
240767
|
-
|
|
240768
|
-
|
|
240769
|
-
|
|
240655
|
+
const needsOAuth = filterPendingOAuth(result.connectorResults ?? []);
|
|
240656
|
+
if (needsOAuth.length > 0) {
|
|
240657
|
+
const oauthOutcomes = await promptOAuthFlows(needsOAuth, {
|
|
240658
|
+
skipPrompt: options.yes || options.isNonInteractive
|
|
240659
|
+
});
|
|
240660
|
+
const allAuthorized = oauthOutcomes.size > 0 && [...oauthOutcomes.values()].every((s) => s === "ACTIVE");
|
|
240661
|
+
if (!allAuthorized) {
|
|
240662
|
+
R2.info("Some connectors still require authorization. Run 'base44 connectors push' or open the links above in your browser.");
|
|
240663
|
+
}
|
|
240770
240664
|
}
|
|
240771
240665
|
R2.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl())}`);
|
|
240772
240666
|
if (result.appUrl) {
|
|
@@ -240774,7 +240668,7 @@ ${summaryLines.join(`
|
|
|
240774
240668
|
}
|
|
240775
240669
|
return { outroMessage: "App deployed successfully" };
|
|
240776
240670
|
}
|
|
240777
|
-
function
|
|
240671
|
+
function getDeployCommand2(context) {
|
|
240778
240672
|
return new Command("deploy").description("Deploy all project resources (entities, functions, agents, connectors, and site)").option("-y, --yes", "Skip confirmation prompt").action(async (options) => {
|
|
240779
240673
|
await runCommand(() => deployAction({
|
|
240780
240674
|
...options,
|
|
@@ -240782,25 +240676,6 @@ function getDeployCommand(context) {
|
|
|
240782
240676
|
}), { requireAuth: true }, context);
|
|
240783
240677
|
});
|
|
240784
240678
|
}
|
|
240785
|
-
async function handleOAuthConnectors(connectorResults, options) {
|
|
240786
|
-
const needsOAuth = filterPendingOAuth(connectorResults);
|
|
240787
|
-
if (needsOAuth.length === 0)
|
|
240788
|
-
return;
|
|
240789
|
-
const oauthOutcomes = await promptOAuthFlows(needsOAuth, {
|
|
240790
|
-
skipPrompt: options.yes || options.isNonInteractive
|
|
240791
|
-
});
|
|
240792
|
-
const allAuthorized = oauthOutcomes.size > 0 && [...oauthOutcomes.values()].every((s) => s === "ACTIVE");
|
|
240793
|
-
if (!allAuthorized) {
|
|
240794
|
-
R2.info("Some connectors still require authorization. Run 'base44 connectors push' or open the links above in your browser.");
|
|
240795
|
-
}
|
|
240796
|
-
}
|
|
240797
|
-
function printStripeResult(r) {
|
|
240798
|
-
R2.success("Stripe sandbox provisioned");
|
|
240799
|
-
if (r.claimUrl) {
|
|
240800
|
-
R2.info(` Claim your Stripe sandbox: ${theme.colors.links(r.claimUrl)}`);
|
|
240801
|
-
}
|
|
240802
|
-
R2.info(` Connectors dashboard: ${theme.colors.links(getConnectorsUrl())}`);
|
|
240803
|
-
}
|
|
240804
240679
|
|
|
240805
240680
|
// src/cli/commands/project/link.ts
|
|
240806
240681
|
function validateNonInteractiveFlags2(command) {
|
|
@@ -244030,13 +243905,13 @@ function createProgram(context) {
|
|
|
244030
243905
|
program2.addCommand(getLogoutCommand(context));
|
|
244031
243906
|
program2.addCommand(getCreateCommand(context));
|
|
244032
243907
|
program2.addCommand(getDashboardCommand(context));
|
|
244033
|
-
program2.addCommand(
|
|
243908
|
+
program2.addCommand(getDeployCommand2(context));
|
|
244034
243909
|
program2.addCommand(getLinkCommand(context));
|
|
244035
243910
|
program2.addCommand(getEjectCommand(context));
|
|
244036
243911
|
program2.addCommand(getEntitiesPushCommand(context));
|
|
244037
243912
|
program2.addCommand(getAgentsCommand(context));
|
|
244038
243913
|
program2.addCommand(getConnectorsCommand(context));
|
|
244039
|
-
program2.addCommand(
|
|
243914
|
+
program2.addCommand(getFunctionsCommand(context));
|
|
244040
243915
|
program2.addCommand(getSecretsCommand(context));
|
|
244041
243916
|
program2.addCommand(getSiteCommand(context));
|
|
244042
243917
|
program2.addCommand(getTypesCommand(context));
|
|
@@ -248282,4 +248157,4 @@ export {
|
|
|
248282
248157
|
CLIExitError
|
|
248283
248158
|
};
|
|
248284
248159
|
|
|
248285
|
-
//# debugId=
|
|
248160
|
+
//# debugId=3F388910E27CD6A764756E2164756E21
|