@base44-preview/cli 0.0.41-pr.381.1f738ba → 0.0.41-pr.381.a8fd299
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 +68 -259
- package/dist/cli/index.js.map +14 -15
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -16481,7 +16481,7 @@ var require_lodash = __commonJS((exports, module) => {
|
|
|
16481
16481
|
function nth(array2, n2) {
|
|
16482
16482
|
return array2 && array2.length ? baseNth(array2, toInteger(n2)) : undefined2;
|
|
16483
16483
|
}
|
|
16484
|
-
var
|
|
16484
|
+
var pull = baseRest(pullAll);
|
|
16485
16485
|
function pullAll(array2, values2) {
|
|
16486
16486
|
return array2 && array2.length && values2 && values2.length ? basePullAll(array2, values2) : array2;
|
|
16487
16487
|
}
|
|
@@ -18246,7 +18246,7 @@ __p += '`;
|
|
|
18246
18246
|
lodash.pickBy = pickBy;
|
|
18247
18247
|
lodash.property = property;
|
|
18248
18248
|
lodash.propertyOf = propertyOf;
|
|
18249
|
-
lodash.pull =
|
|
18249
|
+
lodash.pull = pull;
|
|
18250
18250
|
lodash.pullAll = pullAll;
|
|
18251
18251
|
lodash.pullAllBy = pullAllBy;
|
|
18252
18252
|
lodash.pullAllWith = pullAllWith;
|
|
@@ -237514,10 +237514,6 @@ var GoogleBigQueryConnectorSchema = exports_external.object({
|
|
|
237514
237514
|
type: exports_external.literal("googlebigquery"),
|
|
237515
237515
|
scopes: exports_external.array(exports_external.string()).default([])
|
|
237516
237516
|
});
|
|
237517
|
-
var StripeConnectorSchema = exports_external.object({
|
|
237518
|
-
type: exports_external.literal("stripe"),
|
|
237519
|
-
scopes: exports_external.array(exports_external.string()).default([])
|
|
237520
|
-
});
|
|
237521
237517
|
var CustomTypeSchema = exports_external.string().min(1).regex(/^[a-z0-9_-]+$/i);
|
|
237522
237518
|
var GenericConnectorSchema = exports_external.object({
|
|
237523
237519
|
type: CustomTypeSchema,
|
|
@@ -237537,7 +237533,6 @@ var ConnectorResourceSchema = exports_external.union([
|
|
|
237537
237533
|
HubspotConnectorSchema,
|
|
237538
237534
|
LinkedInConnectorSchema,
|
|
237539
237535
|
TikTokConnectorSchema,
|
|
237540
|
-
StripeConnectorSchema,
|
|
237541
237536
|
GenericConnectorSchema
|
|
237542
237537
|
]);
|
|
237543
237538
|
var KnownIntegrationTypes = [
|
|
@@ -237553,8 +237548,7 @@ var KnownIntegrationTypes = [
|
|
|
237553
237548
|
"salesforce",
|
|
237554
237549
|
"hubspot",
|
|
237555
237550
|
"linkedin",
|
|
237556
|
-
"tiktok"
|
|
237557
|
-
"stripe"
|
|
237551
|
+
"tiktok"
|
|
237558
237552
|
];
|
|
237559
237553
|
var IntegrationTypeSchema = exports_external.union([
|
|
237560
237554
|
exports_external.enum(KnownIntegrationTypes),
|
|
@@ -237607,24 +237601,6 @@ var RemoveConnectorResponseSchema = exports_external.object({
|
|
|
237607
237601
|
status: data.status,
|
|
237608
237602
|
integrationType: data.integration_type
|
|
237609
237603
|
}));
|
|
237610
|
-
var STRIPE_CONNECTOR_TYPE = "stripe";
|
|
237611
|
-
var InstallStripeResponseSchema = exports_external.object({
|
|
237612
|
-
already_installed: exports_external.boolean(),
|
|
237613
|
-
claim_url: exports_external.string().nullable()
|
|
237614
|
-
}).transform((data) => ({
|
|
237615
|
-
alreadyInstalled: data.already_installed,
|
|
237616
|
-
claimUrl: data.claim_url
|
|
237617
|
-
}));
|
|
237618
|
-
var StripeStatusResponseSchema = exports_external.object({
|
|
237619
|
-
stripe_mode: exports_external.enum(["sandbox", "live"]).nullable(),
|
|
237620
|
-
sandbox_claim_url: exports_external.string().nullable().optional()
|
|
237621
|
-
}).transform((data) => ({
|
|
237622
|
-
stripeMode: data.stripe_mode,
|
|
237623
|
-
sandboxClaimUrl: data.sandbox_claim_url
|
|
237624
|
-
}));
|
|
237625
|
-
var RemoveStripeResponseSchema = exports_external.object({
|
|
237626
|
-
success: exports_external.boolean()
|
|
237627
|
-
});
|
|
237628
237604
|
var ConnectionConfigFieldSchema = exports_external.object({
|
|
237629
237605
|
name: exports_external.string(),
|
|
237630
237606
|
display_name: exports_external.string(),
|
|
@@ -237739,54 +237715,6 @@ async function removeConnector(integrationType) {
|
|
|
237739
237715
|
}
|
|
237740
237716
|
return result.data;
|
|
237741
237717
|
}
|
|
237742
|
-
async function installStripe() {
|
|
237743
|
-
const appClient = getAppClient();
|
|
237744
|
-
let response;
|
|
237745
|
-
try {
|
|
237746
|
-
response = await appClient.post("payments/stripe/install", {
|
|
237747
|
-
timeout: 60000
|
|
237748
|
-
});
|
|
237749
|
-
} catch (error48) {
|
|
237750
|
-
throw await ApiError.fromHttpError(error48, "installing Stripe");
|
|
237751
|
-
}
|
|
237752
|
-
const result = InstallStripeResponseSchema.safeParse(await response.json());
|
|
237753
|
-
if (!result.success) {
|
|
237754
|
-
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
237755
|
-
}
|
|
237756
|
-
return result.data;
|
|
237757
|
-
}
|
|
237758
|
-
async function getStripeStatus() {
|
|
237759
|
-
const appClient = getAppClient();
|
|
237760
|
-
let response;
|
|
237761
|
-
try {
|
|
237762
|
-
response = await appClient.get("payments/stripe/status", {
|
|
237763
|
-
timeout: 60000
|
|
237764
|
-
});
|
|
237765
|
-
} catch (error48) {
|
|
237766
|
-
throw await ApiError.fromHttpError(error48, "checking Stripe integration status");
|
|
237767
|
-
}
|
|
237768
|
-
const result = StripeStatusResponseSchema.safeParse(await response.json());
|
|
237769
|
-
if (!result.success) {
|
|
237770
|
-
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
237771
|
-
}
|
|
237772
|
-
return result.data;
|
|
237773
|
-
}
|
|
237774
|
-
async function removeStripe() {
|
|
237775
|
-
const appClient = getAppClient();
|
|
237776
|
-
let response;
|
|
237777
|
-
try {
|
|
237778
|
-
response = await appClient.delete("payments/stripe", {
|
|
237779
|
-
timeout: 60000
|
|
237780
|
-
});
|
|
237781
|
-
} catch (error48) {
|
|
237782
|
-
throw await ApiError.fromHttpError(error48, "removing Stripe integration");
|
|
237783
|
-
}
|
|
237784
|
-
const result = RemoveStripeResponseSchema.safeParse(await response.json());
|
|
237785
|
-
if (!result.success) {
|
|
237786
|
-
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
237787
|
-
}
|
|
237788
|
-
return result.data;
|
|
237789
|
-
}
|
|
237790
237718
|
// src/core/resources/connector/config.ts
|
|
237791
237719
|
import { join as join4 } from "node:path";
|
|
237792
237720
|
import { isDeepStrictEqual as isDeepStrictEqual2 } from "node:util";
|
|
@@ -237835,7 +237763,7 @@ async function readAllConnectors(connectorsDir) {
|
|
|
237835
237763
|
async function writeConnectors(connectorsDir, remoteConnectors) {
|
|
237836
237764
|
const entries = await readConnectorFiles(connectorsDir);
|
|
237837
237765
|
const typeToEntry = buildTypeToEntryMap(entries);
|
|
237838
|
-
const newTypes = new Set(remoteConnectors.map((c) => c.
|
|
237766
|
+
const newTypes = new Set(remoteConnectors.map((c) => c.integrationType));
|
|
237839
237767
|
const deleted = [];
|
|
237840
237768
|
for (const [type, entry] of typeToEntry) {
|
|
237841
237769
|
if (!newTypes.has(type)) {
|
|
@@ -237845,105 +237773,22 @@ async function writeConnectors(connectorsDir, remoteConnectors) {
|
|
|
237845
237773
|
}
|
|
237846
237774
|
const written = [];
|
|
237847
237775
|
for (const connector of remoteConnectors) {
|
|
237848
|
-
const existing = typeToEntry.get(connector.
|
|
237849
|
-
|
|
237776
|
+
const existing = typeToEntry.get(connector.integrationType);
|
|
237777
|
+
const localConnector = {
|
|
237778
|
+
type: connector.integrationType,
|
|
237779
|
+
scopes: connector.scopes
|
|
237780
|
+
};
|
|
237781
|
+
if (existing && isDeepStrictEqual2(existing.data, localConnector)) {
|
|
237850
237782
|
continue;
|
|
237851
237783
|
}
|
|
237852
|
-
const filePath = existing?.filePath ?? join4(connectorsDir, `${connector.
|
|
237853
|
-
await writeJsonFile(filePath,
|
|
237854
|
-
written.push(connector.
|
|
237784
|
+
const filePath = existing?.filePath ?? join4(connectorsDir, `${connector.integrationType}.${CONFIG_FILE_EXTENSION}`);
|
|
237785
|
+
await writeJsonFile(filePath, localConnector);
|
|
237786
|
+
written.push(connector.integrationType);
|
|
237855
237787
|
}
|
|
237856
237788
|
return { written, deleted };
|
|
237857
237789
|
}
|
|
237858
|
-
// src/core/resources/connector/stripe.ts
|
|
237859
|
-
async function syncStripeConnector(localStripe) {
|
|
237860
|
-
const remoteStatus = await fetchStripeRemoteStatus();
|
|
237861
|
-
if (remoteStatus === "error") {
|
|
237862
|
-
return localStripe ? stripeError("Failed to check Stripe integration status") : null;
|
|
237863
|
-
}
|
|
237864
|
-
const isRemoteInstalled = remoteStatus.stripeMode !== null;
|
|
237865
|
-
const needsInstall = localStripe && !isRemoteInstalled;
|
|
237866
|
-
const alreadySynced = localStripe && isRemoteInstalled;
|
|
237867
|
-
const needsRemoval = !localStripe && isRemoteInstalled;
|
|
237868
|
-
if (needsInstall) {
|
|
237869
|
-
return handleStripeInstall();
|
|
237870
|
-
}
|
|
237871
|
-
if (alreadySynced) {
|
|
237872
|
-
return stripeSynced();
|
|
237873
|
-
}
|
|
237874
|
-
if (needsRemoval) {
|
|
237875
|
-
return handleStripeRemoval();
|
|
237876
|
-
}
|
|
237877
|
-
return null;
|
|
237878
|
-
}
|
|
237879
|
-
async function isStripeInstalled() {
|
|
237880
|
-
const status = await getStripeStatus();
|
|
237881
|
-
return status.stripeMode !== null;
|
|
237882
|
-
}
|
|
237883
|
-
async function fetchStripeRemoteStatus() {
|
|
237884
|
-
try {
|
|
237885
|
-
return await getStripeStatus();
|
|
237886
|
-
} catch {
|
|
237887
|
-
return "error";
|
|
237888
|
-
}
|
|
237889
|
-
}
|
|
237890
|
-
async function handleStripeInstall() {
|
|
237891
|
-
try {
|
|
237892
|
-
const result = await installStripe();
|
|
237893
|
-
return stripeProvisioned(result.claimUrl ?? undefined);
|
|
237894
|
-
} catch (err) {
|
|
237895
|
-
return stripeError(err instanceof Error ? err.message : String(err));
|
|
237896
|
-
}
|
|
237897
|
-
}
|
|
237898
|
-
async function handleStripeRemoval() {
|
|
237899
|
-
try {
|
|
237900
|
-
await removeStripe();
|
|
237901
|
-
return stripeRemoved();
|
|
237902
|
-
} catch (err) {
|
|
237903
|
-
return stripeError(err instanceof Error ? err.message : String(err));
|
|
237904
|
-
}
|
|
237905
|
-
}
|
|
237906
|
-
function stripeSynced() {
|
|
237907
|
-
return { type: STRIPE_CONNECTOR_TYPE, action: "synced" };
|
|
237908
|
-
}
|
|
237909
|
-
function stripeProvisioned(claimUrl) {
|
|
237910
|
-
return { type: STRIPE_CONNECTOR_TYPE, action: "provisioned", claimUrl };
|
|
237911
|
-
}
|
|
237912
|
-
function stripeRemoved() {
|
|
237913
|
-
return { type: STRIPE_CONNECTOR_TYPE, action: "removed" };
|
|
237914
|
-
}
|
|
237915
|
-
function stripeError(error48) {
|
|
237916
|
-
return { type: STRIPE_CONNECTOR_TYPE, action: "error", error: error48 };
|
|
237917
|
-
}
|
|
237918
|
-
|
|
237919
|
-
// src/core/resources/connector/pull.ts
|
|
237920
|
-
async function pullAllConnectors() {
|
|
237921
|
-
const [oauthResponse, stripeInstalled] = await Promise.all([
|
|
237922
|
-
listConnectors(),
|
|
237923
|
-
isStripeInstalled()
|
|
237924
|
-
]);
|
|
237925
|
-
const connectors = oauthResponse.integrations.map((i) => ({
|
|
237926
|
-
type: i.integrationType,
|
|
237927
|
-
scopes: i.scopes
|
|
237928
|
-
}));
|
|
237929
|
-
if (stripeInstalled) {
|
|
237930
|
-
connectors.push({ type: STRIPE_CONNECTOR_TYPE, scopes: [] });
|
|
237931
|
-
}
|
|
237932
|
-
return connectors;
|
|
237933
|
-
}
|
|
237934
237790
|
// src/core/resources/connector/push.ts
|
|
237935
237791
|
async function pushConnectors(connectors) {
|
|
237936
|
-
const stripeConnector = connectors.find((c) => c.type === STRIPE_CONNECTOR_TYPE);
|
|
237937
|
-
const oauthConnectors = connectors.filter((c) => c.type !== STRIPE_CONNECTOR_TYPE);
|
|
237938
|
-
const oauthResults = await syncOAuthConnectors(oauthConnectors);
|
|
237939
|
-
const stripeResult = await syncStripeConnector(stripeConnector);
|
|
237940
|
-
const results = [...oauthResults];
|
|
237941
|
-
if (stripeResult) {
|
|
237942
|
-
results.push(stripeResult);
|
|
237943
|
-
}
|
|
237944
|
-
return { results };
|
|
237945
|
-
}
|
|
237946
|
-
async function syncOAuthConnectors(connectors) {
|
|
237947
237792
|
const results = [];
|
|
237948
237793
|
const upstream = await listConnectors();
|
|
237949
237794
|
const localTypes = new Set(connectors.map((c) => c.type));
|
|
@@ -237976,7 +237821,7 @@ async function syncOAuthConnectors(connectors) {
|
|
|
237976
237821
|
}
|
|
237977
237822
|
}
|
|
237978
237823
|
}
|
|
237979
|
-
return results;
|
|
237824
|
+
return { results };
|
|
237980
237825
|
}
|
|
237981
237826
|
function getConnectorSyncResult(type, response) {
|
|
237982
237827
|
if (response.error === "different_user") {
|
|
@@ -246502,10 +246347,6 @@ function getDashboardUrl(projectId) {
|
|
|
246502
246347
|
const id = projectId ?? getAppConfig().id;
|
|
246503
246348
|
return `${getBase44ApiUrl()}/apps/${id}/editor/workspace/overview`;
|
|
246504
246349
|
}
|
|
246505
|
-
function getConnectorsUrl(projectId) {
|
|
246506
|
-
const id = projectId ?? getAppConfig().id;
|
|
246507
|
-
return `${getBase44ApiUrl()}/apps/${id}/editor/workspace/app-connections`;
|
|
246508
|
-
}
|
|
246509
246350
|
// src/cli/utils/yaml.ts
|
|
246510
246351
|
var import_lodash = __toESM(require_lodash(), 1);
|
|
246511
246352
|
|
|
@@ -246701,13 +246542,13 @@ async function pullConnectorsAction() {
|
|
|
246701
246542
|
const configDir = dirname8(project2.configPath);
|
|
246702
246543
|
const connectorsDir = join11(configDir, project2.connectorsDir);
|
|
246703
246544
|
const remoteConnectors = await runTask("Fetching connectors from Base44", async () => {
|
|
246704
|
-
return await
|
|
246545
|
+
return await listConnectors();
|
|
246705
246546
|
}, {
|
|
246706
246547
|
successMessage: "Connectors fetched successfully",
|
|
246707
246548
|
errorMessage: "Failed to fetch connectors"
|
|
246708
246549
|
});
|
|
246709
246550
|
const { written, deleted } = await runTask("Syncing connector files", async () => {
|
|
246710
|
-
return await writeConnectors(connectorsDir, remoteConnectors);
|
|
246551
|
+
return await writeConnectors(connectorsDir, remoteConnectors.integrations);
|
|
246711
246552
|
}, {
|
|
246712
246553
|
successMessage: "Connector files synced successfully",
|
|
246713
246554
|
errorMessage: "Failed to sync connector files"
|
|
@@ -246722,7 +246563,7 @@ async function pullConnectorsAction() {
|
|
|
246722
246563
|
R2.info("All connectors are already up to date");
|
|
246723
246564
|
}
|
|
246724
246565
|
return {
|
|
246725
|
-
outroMessage: `Pulled ${remoteConnectors.length} connectors to ${connectorsDir}`
|
|
246566
|
+
outroMessage: `Pulled ${remoteConnectors.integrations.length} connectors to ${connectorsDir}`
|
|
246726
246567
|
};
|
|
246727
246568
|
}
|
|
246728
246569
|
function getConnectorsPullCommand(context) {
|
|
@@ -247341,7 +247182,7 @@ var open_default = open;
|
|
|
247341
247182
|
var POLL_INTERVAL_MS = 2000;
|
|
247342
247183
|
var POLL_TIMEOUT_MS = 2 * 60 * 1000;
|
|
247343
247184
|
function filterPendingOAuth(results) {
|
|
247344
|
-
return results.filter((r) => r.action === "needs_oauth" && !!r.connectionId);
|
|
247185
|
+
return results.filter((r) => r.action === "needs_oauth" && !!r.redirectUrl && !!r.connectionId);
|
|
247345
247186
|
}
|
|
247346
247187
|
async function runOAuthFlowWithSkip(connector2) {
|
|
247347
247188
|
await open_default(connector2.redirectUrl);
|
|
@@ -247359,10 +247200,6 @@ async function runOAuthFlowWithSkip(connector2) {
|
|
|
247359
247200
|
finalStatus = "SKIPPED";
|
|
247360
247201
|
return true;
|
|
247361
247202
|
}
|
|
247362
|
-
if (!connector2.connectionId) {
|
|
247363
|
-
finalStatus = "FAILED";
|
|
247364
|
-
return true;
|
|
247365
|
-
}
|
|
247366
247203
|
const response = await getOAuthStatus(connector2.type, connector2.connectionId);
|
|
247367
247204
|
finalStatus = response.status;
|
|
247368
247205
|
return response.status !== "PENDING";
|
|
@@ -247425,49 +247262,32 @@ async function promptOAuthFlows(pending, options) {
|
|
|
247425
247262
|
function printSummary(results, oauthOutcomes) {
|
|
247426
247263
|
const synced = [];
|
|
247427
247264
|
const added = [];
|
|
247428
|
-
let provisioned;
|
|
247429
247265
|
const removed = [];
|
|
247430
247266
|
const skipped = [];
|
|
247431
247267
|
const failed = [];
|
|
247432
247268
|
for (const r of results) {
|
|
247433
|
-
|
|
247434
|
-
|
|
247435
|
-
|
|
247436
|
-
|
|
247437
|
-
|
|
247438
|
-
|
|
247439
|
-
|
|
247440
|
-
|
|
247441
|
-
|
|
247442
|
-
|
|
247443
|
-
|
|
247444
|
-
|
|
247445
|
-
|
|
247446
|
-
|
|
247447
|
-
|
|
247448
|
-
|
|
247449
|
-
|
|
247450
|
-
|
|
247451
|
-
skipped.push(r.type);
|
|
247452
|
-
} else if (oauthStatus === "PENDING") {
|
|
247453
|
-
failed.push({ type: r.type, error: "authorization timed out" });
|
|
247454
|
-
} else if (oauthStatus === "FAILED") {
|
|
247455
|
-
failed.push({ type: r.type, error: "authorization failed" });
|
|
247456
|
-
} else {
|
|
247457
|
-
failed.push({ type: r.type, error: "needs authorization" });
|
|
247458
|
-
}
|
|
247459
|
-
break;
|
|
247269
|
+
const oauthStatus = oauthOutcomes.get(r.type);
|
|
247270
|
+
if (r.action === "synced") {
|
|
247271
|
+
synced.push(r.type);
|
|
247272
|
+
} else if (r.action === "removed") {
|
|
247273
|
+
removed.push(r.type);
|
|
247274
|
+
} else if (r.action === "error") {
|
|
247275
|
+
failed.push({ type: r.type, error: r.error });
|
|
247276
|
+
} else if (r.action === "needs_oauth") {
|
|
247277
|
+
if (oauthStatus === "ACTIVE") {
|
|
247278
|
+
added.push(r.type);
|
|
247279
|
+
} else if (oauthStatus === "SKIPPED") {
|
|
247280
|
+
skipped.push(r.type);
|
|
247281
|
+
} else if (oauthStatus === "PENDING") {
|
|
247282
|
+
failed.push({ type: r.type, error: "authorization timed out" });
|
|
247283
|
+
} else if (oauthStatus === "FAILED") {
|
|
247284
|
+
failed.push({ type: r.type, error: "authorization failed" });
|
|
247285
|
+
} else {
|
|
247286
|
+
failed.push({ type: r.type, error: "needs authorization" });
|
|
247460
247287
|
}
|
|
247461
247288
|
}
|
|
247462
247289
|
}
|
|
247463
247290
|
R2.info(theme.styles.bold("Summary:"));
|
|
247464
|
-
if (provisioned) {
|
|
247465
|
-
R2.success("Stripe sandbox provisioned");
|
|
247466
|
-
if (provisioned.claimUrl) {
|
|
247467
|
-
R2.info(` Claim your Stripe sandbox: ${theme.colors.links(provisioned.claimUrl)}`);
|
|
247468
|
-
}
|
|
247469
|
-
R2.info(` Connectors dashboard: ${theme.colors.links(getConnectorsUrl())}`);
|
|
247470
|
-
}
|
|
247471
247291
|
if (synced.length > 0) {
|
|
247472
247292
|
R2.success(`Synced: ${synced.join(", ")}`);
|
|
247473
247293
|
}
|
|
@@ -247481,7 +247301,7 @@ function printSummary(results, oauthOutcomes) {
|
|
|
247481
247301
|
R2.warn(`Skipped: ${skipped.join(", ")}`);
|
|
247482
247302
|
}
|
|
247483
247303
|
for (const r of failed) {
|
|
247484
|
-
R2.error(`Failed: ${r.type} - ${r.error}`);
|
|
247304
|
+
R2.error(`Failed: ${r.type}${r.error ? ` - ${r.error}` : ""}`);
|
|
247485
247305
|
}
|
|
247486
247306
|
}
|
|
247487
247307
|
async function pushConnectorsAction(isNonInteractive) {
|
|
@@ -247568,25 +247388,34 @@ function getEntitiesPushCommand(context) {
|
|
|
247568
247388
|
}));
|
|
247569
247389
|
}
|
|
247570
247390
|
|
|
247391
|
+
// src/cli/utils/parseNames.ts
|
|
247392
|
+
function parseNames(args) {
|
|
247393
|
+
return args.flatMap((arg) => arg.split(",")).map((n2) => n2.trim()).filter(Boolean);
|
|
247394
|
+
}
|
|
247395
|
+
|
|
247571
247396
|
// src/cli/commands/functions/delete.ts
|
|
247572
247397
|
async function deleteFunctionsAction(names) {
|
|
247573
247398
|
let deleted = 0;
|
|
247574
247399
|
let notFound = 0;
|
|
247575
247400
|
let errors5 = 0;
|
|
247401
|
+
let completed = 0;
|
|
247402
|
+
const total = names.length;
|
|
247576
247403
|
for (const name2 of names) {
|
|
247404
|
+
R2.step(theme.styles.dim(`[${completed + 1}/${total}] Deleting ${name2}...`));
|
|
247577
247405
|
try {
|
|
247578
|
-
await
|
|
247579
|
-
|
|
247580
|
-
errorMessage: `Failed to delete ${name2}`
|
|
247581
|
-
});
|
|
247406
|
+
await deleteSingleFunction(name2);
|
|
247407
|
+
R2.success(`${name2.padEnd(25)} deleted`);
|
|
247582
247408
|
deleted++;
|
|
247583
247409
|
} catch (error48) {
|
|
247584
247410
|
if (error48 instanceof ApiError && error48.statusCode === 404) {
|
|
247411
|
+
R2.warn(`${name2.padEnd(25)} not found`);
|
|
247585
247412
|
notFound++;
|
|
247586
247413
|
} else {
|
|
247414
|
+
R2.error(`${name2.padEnd(25)} error: ${error48 instanceof Error ? error48.message : String(error48)}`);
|
|
247587
247415
|
errors5++;
|
|
247588
247416
|
}
|
|
247589
247417
|
}
|
|
247418
|
+
completed++;
|
|
247590
247419
|
}
|
|
247591
247420
|
if (names.length === 1) {
|
|
247592
247421
|
if (deleted)
|
|
@@ -247595,7 +247424,6 @@ async function deleteFunctionsAction(names) {
|
|
|
247595
247424
|
return { outroMessage: `Function "${names[0]}" not found` };
|
|
247596
247425
|
return { outroMessage: `Failed to delete "${names[0]}"` };
|
|
247597
247426
|
}
|
|
247598
|
-
const total = names.length;
|
|
247599
247427
|
const parts = [];
|
|
247600
247428
|
if (deleted > 0)
|
|
247601
247429
|
parts.push(`${deleted}/${total} deleted`);
|
|
@@ -247605,19 +247433,15 @@ async function deleteFunctionsAction(names) {
|
|
|
247605
247433
|
parts.push(`${errors5} error${errors5 !== 1 ? "s" : ""}`);
|
|
247606
247434
|
return { outroMessage: parts.join(", ") };
|
|
247607
247435
|
}
|
|
247608
|
-
function parseNames(args) {
|
|
247609
|
-
return args.flatMap((arg) => arg.split(",")).map((n2) => n2.trim()).filter(Boolean);
|
|
247610
|
-
}
|
|
247611
|
-
function validateNames(command) {
|
|
247612
|
-
const names = parseNames(command.args);
|
|
247613
|
-
if (names.length === 0) {
|
|
247614
|
-
command.error("At least one function name is required");
|
|
247615
|
-
}
|
|
247616
|
-
}
|
|
247617
247436
|
function getDeleteCommand(context) {
|
|
247618
|
-
return new Command("delete").description("Delete deployed functions").argument("<names...>", "Function names to delete").
|
|
247619
|
-
|
|
247620
|
-
|
|
247437
|
+
return new Command("delete").description("Delete deployed functions").argument("<names...>", "Function names to delete").action(async (rawNames) => {
|
|
247438
|
+
await runCommand(() => {
|
|
247439
|
+
const names = parseNames(rawNames);
|
|
247440
|
+
if (names.length === 0) {
|
|
247441
|
+
throw new InvalidInputError("At least one function name is required");
|
|
247442
|
+
}
|
|
247443
|
+
return deleteFunctionsAction(names);
|
|
247444
|
+
}, { requireAuth: true }, context);
|
|
247621
247445
|
});
|
|
247622
247446
|
}
|
|
247623
247447
|
|
|
@@ -247887,11 +247711,15 @@ ${summaryLines.join(`
|
|
|
247887
247711
|
successMessage: theme.colors.base44Orange("Deployment completed"),
|
|
247888
247712
|
errorMessage: "Deployment failed"
|
|
247889
247713
|
});
|
|
247890
|
-
const
|
|
247891
|
-
|
|
247892
|
-
|
|
247893
|
-
|
|
247894
|
-
|
|
247714
|
+
const needsOAuth = filterPendingOAuth(result.connectorResults ?? []);
|
|
247715
|
+
if (needsOAuth.length > 0) {
|
|
247716
|
+
const oauthOutcomes = await promptOAuthFlows(needsOAuth, {
|
|
247717
|
+
skipPrompt: options.yes || options.isNonInteractive
|
|
247718
|
+
});
|
|
247719
|
+
const allAuthorized = oauthOutcomes.size > 0 && [...oauthOutcomes.values()].every((s) => s === "ACTIVE");
|
|
247720
|
+
if (!allAuthorized) {
|
|
247721
|
+
R2.info("Some connectors still require authorization. Run 'base44 connectors push' or open the links above in your browser.");
|
|
247722
|
+
}
|
|
247895
247723
|
}
|
|
247896
247724
|
R2.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl())}`);
|
|
247897
247725
|
if (result.appUrl) {
|
|
@@ -247907,25 +247735,6 @@ function getDeployCommand2(context) {
|
|
|
247907
247735
|
}), { requireAuth: true }, context);
|
|
247908
247736
|
});
|
|
247909
247737
|
}
|
|
247910
|
-
async function handleOAuthConnectors(connectorResults, options) {
|
|
247911
|
-
const needsOAuth = filterPendingOAuth(connectorResults);
|
|
247912
|
-
if (needsOAuth.length === 0)
|
|
247913
|
-
return;
|
|
247914
|
-
const oauthOutcomes = await promptOAuthFlows(needsOAuth, {
|
|
247915
|
-
skipPrompt: options.yes || options.isNonInteractive
|
|
247916
|
-
});
|
|
247917
|
-
const allAuthorized = oauthOutcomes.size > 0 && [...oauthOutcomes.values()].every((s) => s === "ACTIVE");
|
|
247918
|
-
if (!allAuthorized) {
|
|
247919
|
-
R2.info("Some connectors still require authorization. Run 'base44 connectors push' or open the links above in your browser.");
|
|
247920
|
-
}
|
|
247921
|
-
}
|
|
247922
|
-
function printStripeResult(r) {
|
|
247923
|
-
R2.success("Stripe sandbox provisioned");
|
|
247924
|
-
if (r.claimUrl) {
|
|
247925
|
-
R2.info(` Claim your Stripe sandbox: ${theme.colors.links(r.claimUrl)}`);
|
|
247926
|
-
}
|
|
247927
|
-
R2.info(` Connectors dashboard: ${theme.colors.links(getConnectorsUrl())}`);
|
|
247928
|
-
}
|
|
247929
247738
|
|
|
247930
247739
|
// src/cli/commands/project/link.ts
|
|
247931
247740
|
function validateNonInteractiveFlags2(command) {
|
|
@@ -255443,4 +255252,4 @@ export {
|
|
|
255443
255252
|
CLIExitError
|
|
255444
255253
|
};
|
|
255445
255254
|
|
|
255446
|
-
//# debugId=
|
|
255255
|
+
//# debugId=7404C8E105703E2F64756E2164756E21
|