@base44-preview/cli 0.1.5-pr.572.2976402 → 0.1.5-pr.573.8f87fa4
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 +54 -31
- package/dist/cli/index.js.map +8 -7
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -251342,6 +251342,25 @@ class Base44Command extends Command {
|
|
|
251342
251342
|
});
|
|
251343
251343
|
}
|
|
251344
251344
|
}
|
|
251345
|
+
// src/cli/utils/confirm-push.ts
|
|
251346
|
+
async function confirmPush({
|
|
251347
|
+
isNonInteractive,
|
|
251348
|
+
yes,
|
|
251349
|
+
log,
|
|
251350
|
+
warning
|
|
251351
|
+
}) {
|
|
251352
|
+
if (isNonInteractive && !yes) {
|
|
251353
|
+
throw new InvalidInputError("--yes is required in non-interactive mode");
|
|
251354
|
+
}
|
|
251355
|
+
if (yes) {
|
|
251356
|
+
return true;
|
|
251357
|
+
}
|
|
251358
|
+
log.warn(warning);
|
|
251359
|
+
const proceed = await Re({
|
|
251360
|
+
message: "Are you sure you want to continue?"
|
|
251361
|
+
});
|
|
251362
|
+
return !Ct(proceed) && proceed;
|
|
251363
|
+
}
|
|
251345
251364
|
// src/cli/utils/json.ts
|
|
251346
251365
|
function toJsonStdout(result) {
|
|
251347
251366
|
return `${JSON.stringify(result, null, 2)}
|
|
@@ -251634,12 +251653,18 @@ function getAgentsPullCommand() {
|
|
|
251634
251653
|
}
|
|
251635
251654
|
|
|
251636
251655
|
// src/cli/commands/agents/push.ts
|
|
251637
|
-
async function pushAgentsAction({
|
|
251638
|
-
log,
|
|
251639
|
-
runTask: runTask2
|
|
251640
|
-
}) {
|
|
251656
|
+
async function pushAgentsAction({ isNonInteractive, log, runTask: runTask2 }, options) {
|
|
251641
251657
|
const { agents } = await readProjectConfig();
|
|
251642
251658
|
log.info(agents.length === 0 ? "No local agents found - this will delete all remote agents" : `Found ${agents.length} agents to push`);
|
|
251659
|
+
const proceed = await confirmPush({
|
|
251660
|
+
isNonInteractive,
|
|
251661
|
+
yes: options.yes,
|
|
251662
|
+
log,
|
|
251663
|
+
warning: "This replaces all remote agent configs with your local agents. Remote agents not present locally will be deleted."
|
|
251664
|
+
});
|
|
251665
|
+
if (!proceed) {
|
|
251666
|
+
return { outroMessage: "Push cancelled" };
|
|
251667
|
+
}
|
|
251643
251668
|
const result = await runTask2("Pushing agents to Base44", async () => {
|
|
251644
251669
|
return await pushAgents(agents);
|
|
251645
251670
|
}, {
|
|
@@ -251658,7 +251683,7 @@ async function pushAgentsAction({
|
|
|
251658
251683
|
return { outroMessage: "Agents pushed to Base44" };
|
|
251659
251684
|
}
|
|
251660
251685
|
function getAgentsPushCommand() {
|
|
251661
|
-
return new Base44Command("push").description("Push local agents to Base44 (replaces all remote agent configs)").action(pushAgentsAction);
|
|
251686
|
+
return new Base44Command("push").description("Push local agents to Base44 (replaces all remote agent configs)").option("-y, --yes", "Skip confirmation prompt").action(pushAgentsAction);
|
|
251662
251687
|
}
|
|
251663
251688
|
|
|
251664
251689
|
// src/cli/commands/agents/index.ts
|
|
@@ -253023,6 +253048,15 @@ async function pushConnectorsAction({ isNonInteractive, log, runTask: runTask2,
|
|
|
253023
253048
|
log.info(`Found ${connectors.length} connectors to push: ${connectorNames}`);
|
|
253024
253049
|
}
|
|
253025
253050
|
}
|
|
253051
|
+
const proceed = await confirmPush({
|
|
253052
|
+
isNonInteractive,
|
|
253053
|
+
yes: options.yes,
|
|
253054
|
+
log,
|
|
253055
|
+
warning: "This overwrites your app's connectors with your local copy. Remote connectors not present locally will be removed."
|
|
253056
|
+
});
|
|
253057
|
+
if (!proceed) {
|
|
253058
|
+
return { outroMessage: "Push cancelled" };
|
|
253059
|
+
}
|
|
253026
253060
|
const { results } = await runTask2("Pushing connectors to Base44", async () => {
|
|
253027
253061
|
return await pushConnectors(connectors);
|
|
253028
253062
|
});
|
|
@@ -253046,7 +253080,7 @@ async function pushConnectorsAction({ isNonInteractive, log, runTask: runTask2,
|
|
|
253046
253080
|
return { outroMessage };
|
|
253047
253081
|
}
|
|
253048
253082
|
function getConnectorsPushCommand() {
|
|
253049
|
-
return new Base44Command("push").description("Push local connectors to Base44 (overwrites connectors on Base44)").option("--dir <path>", "Directory to read connector files from (default: ./connectors when using --app-id)").action(pushConnectorsAction);
|
|
253083
|
+
return new Base44Command("push").description("Push local connectors to Base44 (overwrites connectors on Base44)").option("--dir <path>", "Directory to read connector files from (default: ./connectors when using --app-id)").option("-y, --yes", "Skip confirmation prompt").action(pushConnectorsAction);
|
|
253050
253084
|
}
|
|
253051
253085
|
|
|
253052
253086
|
// src/cli/commands/connectors/index.ts
|
|
@@ -253074,16 +253108,22 @@ function getDashboardCommand() {
|
|
|
253074
253108
|
}
|
|
253075
253109
|
|
|
253076
253110
|
// src/cli/commands/entities/push.ts
|
|
253077
|
-
async function pushEntitiesAction({
|
|
253078
|
-
log,
|
|
253079
|
-
runTask: runTask2
|
|
253080
|
-
}) {
|
|
253111
|
+
async function pushEntitiesAction({ isNonInteractive, log, runTask: runTask2 }, options) {
|
|
253081
253112
|
const { entities } = await readProjectConfig();
|
|
253082
253113
|
if (entities.length === 0) {
|
|
253083
253114
|
return { outroMessage: "No entities found in project" };
|
|
253084
253115
|
}
|
|
253085
253116
|
const entityNames = entities.map((e2) => e2.name).join(", ");
|
|
253086
253117
|
log.info(`Found ${entities.length} entities to push: ${entityNames}`);
|
|
253118
|
+
const proceed = await confirmPush({
|
|
253119
|
+
isNonInteractive,
|
|
253120
|
+
yes: options.yes,
|
|
253121
|
+
log,
|
|
253122
|
+
warning: "This overwrites your app's entities with your local copy. Remote entities not present locally will be deleted."
|
|
253123
|
+
});
|
|
253124
|
+
if (!proceed) {
|
|
253125
|
+
return { outroMessage: "Push cancelled" };
|
|
253126
|
+
}
|
|
253087
253127
|
const result = await runTask2("Pushing entities to Base44", async () => {
|
|
253088
253128
|
return await pushEntities(entities);
|
|
253089
253129
|
}, {
|
|
@@ -253102,7 +253142,7 @@ async function pushEntitiesAction({
|
|
|
253102
253142
|
return { outroMessage: "Entities pushed to Base44" };
|
|
253103
253143
|
}
|
|
253104
253144
|
function getEntitiesPushCommand() {
|
|
253105
|
-
return new Command("entities").description("Manage project entities").addCommand(new Base44Command("push").description("Push local entities to Base44").action(pushEntitiesAction));
|
|
253145
|
+
return new Command("entities").description("Manage project entities").addCommand(new Base44Command("push").description("Push local entities to Base44").option("-y, --yes", "Skip confirmation prompt").action(pushEntitiesAction));
|
|
253106
253146
|
}
|
|
253107
253147
|
|
|
253108
253148
|
// src/cli/commands/functions/delete.ts
|
|
@@ -253457,22 +253497,9 @@ function printProjectSummary({ name: name2, dashboardUrl, appUrl }, log) {
|
|
|
253457
253497
|
}
|
|
253458
253498
|
|
|
253459
253499
|
// src/cli/commands/project/workspace-select.ts
|
|
253460
|
-
function isWorkspaceListForbidden(error48) {
|
|
253461
|
-
return error48 instanceof ApiError && error48.statusCode === 403;
|
|
253462
|
-
}
|
|
253463
253500
|
function fetchWorkspaces(ctx) {
|
|
253464
|
-
return ctx.runTask("Fetching workspaces...",
|
|
253465
|
-
|
|
253466
|
-
return await listWorkspaces();
|
|
253467
|
-
} catch (error48) {
|
|
253468
|
-
if (isWorkspaceListForbidden(error48)) {
|
|
253469
|
-
updateMessage("Using your default workspace");
|
|
253470
|
-
return null;
|
|
253471
|
-
}
|
|
253472
|
-
throw error48;
|
|
253473
|
-
}
|
|
253474
|
-
}, {
|
|
253475
|
-
successMessage: "Workspaces checked",
|
|
253501
|
+
return ctx.runTask("Fetching workspaces...", () => listWorkspaces(), {
|
|
253502
|
+
successMessage: "Workspaces fetched",
|
|
253476
253503
|
errorMessage: "Failed to fetch workspaces"
|
|
253477
253504
|
});
|
|
253478
253505
|
}
|
|
@@ -253488,10 +253515,6 @@ async function resolveWorkspaceId(ctx, flagWorkspaceId, isInteractive) {
|
|
|
253488
253515
|
return;
|
|
253489
253516
|
}
|
|
253490
253517
|
const workspaces = await fetchWorkspaces(ctx);
|
|
253491
|
-
if (workspaces === null) {
|
|
253492
|
-
ctx.log.warn("Couldn't list your workspaces with this login, so the default workspace will be used. Pass --workspace <id> to target a specific one.");
|
|
253493
|
-
return;
|
|
253494
|
-
}
|
|
253495
253518
|
if (workspaces.length <= 1) {
|
|
253496
253519
|
return;
|
|
253497
253520
|
}
|
|
@@ -262969,4 +262992,4 @@ export {
|
|
|
262969
262992
|
CLIExitError
|
|
262970
262993
|
};
|
|
262971
262994
|
|
|
262972
|
-
//# debugId=
|
|
262995
|
+
//# debugId=90826EFBD09EACF564756E2164756E21
|