@base44-preview/cli 0.0.45-pr.425.a892fc8 → 0.0.45-pr.425.bdf59d4
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 +123 -133
- package/dist/cli/index.js.map +32 -32
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -238855,7 +238855,7 @@ async function saveAuthData(response, userInfo) {
|
|
|
238855
238855
|
name: userInfo.name
|
|
238856
238856
|
});
|
|
238857
238857
|
}
|
|
238858
|
-
async function login(logger) {
|
|
238858
|
+
async function login({ logger }) {
|
|
238859
238859
|
const deviceCodeResponse = await generateAndDisplayDeviceCode(logger);
|
|
238860
238860
|
const token = await waitForAuthentication(deviceCodeResponse.deviceCode, deviceCodeResponse.expiresIn, deviceCodeResponse.interval);
|
|
238861
238861
|
const userInfo = await getUserInfo(token.accessToken);
|
|
@@ -238866,22 +238866,22 @@ async function login(logger) {
|
|
|
238866
238866
|
}
|
|
238867
238867
|
|
|
238868
238868
|
// src/cli/utils/command/middleware.ts
|
|
238869
|
-
async function ensureAuth(
|
|
238869
|
+
async function ensureAuth(ctx) {
|
|
238870
238870
|
const loggedIn = await isLoggedIn();
|
|
238871
238871
|
if (!loggedIn) {
|
|
238872
|
-
logger.info("You need to login first to continue.");
|
|
238873
|
-
await login(
|
|
238872
|
+
ctx.logger.info("You need to login first to continue.");
|
|
238873
|
+
await login(ctx);
|
|
238874
238874
|
}
|
|
238875
238875
|
try {
|
|
238876
238876
|
const userInfo = await readAuth();
|
|
238877
|
-
errorReporter.setContext({
|
|
238877
|
+
ctx.errorReporter.setContext({
|
|
238878
238878
|
user: { email: userInfo.email, name: userInfo.name }
|
|
238879
238879
|
});
|
|
238880
238880
|
} catch {}
|
|
238881
238881
|
}
|
|
238882
|
-
async function ensureAppConfig(
|
|
238882
|
+
async function ensureAppConfig(ctx) {
|
|
238883
238883
|
const appConfig = await initAppConfig();
|
|
238884
|
-
errorReporter.setContext({ appId: appConfig.id });
|
|
238884
|
+
ctx.errorReporter.setContext({ appId: appConfig.id });
|
|
238885
238885
|
}
|
|
238886
238886
|
|
|
238887
238887
|
// ../../node_modules/@clack/core/dist/index.mjs
|
|
@@ -246611,12 +246611,6 @@ class Base44Command extends Command {
|
|
|
246611
246611
|
setContext(context) {
|
|
246612
246612
|
this._context = context;
|
|
246613
246613
|
}
|
|
246614
|
-
get isNonInteractive() {
|
|
246615
|
-
return this._context?.isNonInteractive ?? false;
|
|
246616
|
-
}
|
|
246617
|
-
get logger() {
|
|
246618
|
-
return this.context.logger;
|
|
246619
|
-
}
|
|
246620
246614
|
get context() {
|
|
246621
246615
|
if (!this._context) {
|
|
246622
246616
|
throw new Error("Base44Command context not set. Ensure the command is registered via createProgram().");
|
|
@@ -246632,12 +246626,12 @@ class Base44Command extends Command {
|
|
|
246632
246626
|
const upgradeCheckPromise = startUpgradeCheck();
|
|
246633
246627
|
try {
|
|
246634
246628
|
if (this._commandOptions.requireAuth) {
|
|
246635
|
-
await ensureAuth(this.context
|
|
246629
|
+
await ensureAuth(this.context);
|
|
246636
246630
|
}
|
|
246637
246631
|
if (this._commandOptions.requireAppConfig) {
|
|
246638
|
-
await ensureAppConfig(this.context
|
|
246632
|
+
await ensureAppConfig(this.context);
|
|
246639
246633
|
}
|
|
246640
|
-
const result = await fn(...args) ?? {};
|
|
246634
|
+
const result = await fn(this.context, ...args) ?? {};
|
|
246641
246635
|
if (!quiet) {
|
|
246642
246636
|
await showCommandEnd(result, upgradeCheckPromise, this.context.distribution);
|
|
246643
246637
|
} else {
|
|
@@ -246879,7 +246873,9 @@ async function parseEnvFile(filePath) {
|
|
|
246879
246873
|
return import_dotenv.parse(content);
|
|
246880
246874
|
}
|
|
246881
246875
|
// src/cli/commands/agents/pull.ts
|
|
246882
|
-
async function pullAgentsAction(
|
|
246876
|
+
async function pullAgentsAction({
|
|
246877
|
+
logger: logger2
|
|
246878
|
+
}) {
|
|
246883
246879
|
const { project: project2 } = await readProjectConfig();
|
|
246884
246880
|
const configDir = dirname7(project2.configPath);
|
|
246885
246881
|
const agentsDir = join11(configDir, project2.agentsDir);
|
|
@@ -246909,11 +246905,13 @@ async function pullAgentsAction(logger2) {
|
|
|
246909
246905
|
};
|
|
246910
246906
|
}
|
|
246911
246907
|
function getAgentsPullCommand() {
|
|
246912
|
-
return new Base44Command("pull").description("Pull agents from Base44 to local files (replaces all local agent configs)").action(
|
|
246908
|
+
return new Base44Command("pull").description("Pull agents from Base44 to local files (replaces all local agent configs)").action(pullAgentsAction);
|
|
246913
246909
|
}
|
|
246914
246910
|
|
|
246915
246911
|
// src/cli/commands/agents/push.ts
|
|
246916
|
-
async function pushAgentsAction(
|
|
246912
|
+
async function pushAgentsAction({
|
|
246913
|
+
logger: logger2
|
|
246914
|
+
}) {
|
|
246917
246915
|
const { agents } = await readProjectConfig();
|
|
246918
246916
|
logger2.info(agents.length === 0 ? "No local agents found - this will delete all remote agents" : `Found ${agents.length} agents to push`);
|
|
246919
246917
|
const result = await runTask("Pushing agents to Base44", async () => {
|
|
@@ -246934,7 +246932,7 @@ async function pushAgentsAction(logger2) {
|
|
|
246934
246932
|
return { outroMessage: "Agents pushed to Base44" };
|
|
246935
246933
|
}
|
|
246936
246934
|
function getAgentsPushCommand() {
|
|
246937
|
-
return new Base44Command("push").description("Push local agents to Base44 (replaces all remote agent configs)").action(
|
|
246935
|
+
return new Base44Command("push").description("Push local agents to Base44 (replaces all remote agent configs)").action(pushAgentsAction);
|
|
246938
246936
|
}
|
|
246939
246937
|
|
|
246940
246938
|
// src/cli/commands/agents/index.ts
|
|
@@ -246947,11 +246945,11 @@ function getLoginCommand() {
|
|
|
246947
246945
|
return new Base44Command("login", {
|
|
246948
246946
|
requireAuth: false,
|
|
246949
246947
|
requireAppConfig: false
|
|
246950
|
-
}).description("Authenticate with Base44").action(
|
|
246948
|
+
}).description("Authenticate with Base44").action(login);
|
|
246951
246949
|
}
|
|
246952
246950
|
|
|
246953
246951
|
// src/cli/commands/auth/logout.ts
|
|
246954
|
-
async function logout() {
|
|
246952
|
+
async function logout(_ctx) {
|
|
246955
246953
|
await deleteAuth();
|
|
246956
246954
|
return { outroMessage: "Logged out successfully" };
|
|
246957
246955
|
}
|
|
@@ -246963,7 +246961,7 @@ function getLogoutCommand() {
|
|
|
246963
246961
|
}
|
|
246964
246962
|
|
|
246965
246963
|
// src/cli/commands/auth/whoami.ts
|
|
246966
|
-
async function whoami() {
|
|
246964
|
+
async function whoami(_ctx) {
|
|
246967
246965
|
const auth2 = await readAuth();
|
|
246968
246966
|
return { outroMessage: `Logged in as: ${theme.styles.bold(auth2.email)}` };
|
|
246969
246967
|
}
|
|
@@ -246972,7 +246970,9 @@ function getWhoamiCommand() {
|
|
|
246972
246970
|
}
|
|
246973
246971
|
|
|
246974
246972
|
// src/cli/commands/connectors/list-available.ts
|
|
246975
|
-
async function listAvailableAction(
|
|
246973
|
+
async function listAvailableAction({
|
|
246974
|
+
logger: logger2
|
|
246975
|
+
}) {
|
|
246976
246976
|
const { integrations } = await runTask("Fetching available integrations from Base44", async () => {
|
|
246977
246977
|
return await listAvailableIntegrations();
|
|
246978
246978
|
}, {
|
|
@@ -246994,12 +246994,14 @@ ${pad}`)}`);
|
|
|
246994
246994
|
};
|
|
246995
246995
|
}
|
|
246996
246996
|
function getConnectorsListAvailableCommand() {
|
|
246997
|
-
return new Base44Command("list-available").description("List all available integration types").action(
|
|
246997
|
+
return new Base44Command("list-available").description("List all available integration types").action(listAvailableAction);
|
|
246998
246998
|
}
|
|
246999
246999
|
|
|
247000
247000
|
// src/cli/commands/connectors/pull.ts
|
|
247001
247001
|
import { dirname as dirname8, join as join12 } from "node:path";
|
|
247002
|
-
async function pullConnectorsAction(
|
|
247002
|
+
async function pullConnectorsAction({
|
|
247003
|
+
logger: logger2
|
|
247004
|
+
}) {
|
|
247003
247005
|
const { project: project2 } = await readProjectConfig();
|
|
247004
247006
|
const configDir = dirname8(project2.configPath);
|
|
247005
247007
|
const connectorsDir = join12(configDir, project2.connectorsDir);
|
|
@@ -247029,7 +247031,7 @@ async function pullConnectorsAction(logger2) {
|
|
|
247029
247031
|
};
|
|
247030
247032
|
}
|
|
247031
247033
|
function getConnectorsPullCommand() {
|
|
247032
|
-
return new Base44Command("pull").description("Pull connectors from Base44 to local files (replaces all local connector configs)").action(
|
|
247034
|
+
return new Base44Command("pull").description("Pull connectors from Base44 to local files (replaces all local connector configs)").action(pullConnectorsAction);
|
|
247033
247035
|
}
|
|
247034
247036
|
|
|
247035
247037
|
// ../../node_modules/open/index.js
|
|
@@ -247785,7 +247787,10 @@ function printSummary(results, oauthOutcomes, logger2) {
|
|
|
247785
247787
|
logger2.error(`Failed: ${r.type} - ${r.error}`);
|
|
247786
247788
|
}
|
|
247787
247789
|
}
|
|
247788
|
-
async function pushConnectorsAction(
|
|
247790
|
+
async function pushConnectorsAction({
|
|
247791
|
+
isNonInteractive,
|
|
247792
|
+
logger: logger2
|
|
247793
|
+
}) {
|
|
247789
247794
|
const { connectors } = await readProjectConfig();
|
|
247790
247795
|
if (connectors.length === 0) {
|
|
247791
247796
|
logger2.info("No local connectors found - checking for remote connectors to remove");
|
|
@@ -247809,9 +247814,7 @@ async function pushConnectorsAction(isNonInteractive, logger2) {
|
|
|
247809
247814
|
return { outroMessage };
|
|
247810
247815
|
}
|
|
247811
247816
|
function getConnectorsPushCommand() {
|
|
247812
|
-
return new Base44Command("push").description("Push local connectors to Base44 (overwrites connectors on Base44)").action(
|
|
247813
|
-
return await pushConnectorsAction(command2.isNonInteractive, command2.logger);
|
|
247814
|
-
});
|
|
247817
|
+
return new Base44Command("push").description("Push local connectors to Base44 (overwrites connectors on Base44)").action(pushConnectorsAction);
|
|
247815
247818
|
}
|
|
247816
247819
|
|
|
247817
247820
|
// src/cli/commands/connectors/index.ts
|
|
@@ -247820,7 +247823,9 @@ function getConnectorsCommand() {
|
|
|
247820
247823
|
}
|
|
247821
247824
|
|
|
247822
247825
|
// src/cli/commands/dashboard/open.ts
|
|
247823
|
-
async function openDashboard(
|
|
247826
|
+
async function openDashboard({
|
|
247827
|
+
isNonInteractive
|
|
247828
|
+
}) {
|
|
247824
247829
|
const dashboardUrl = getDashboardUrl();
|
|
247825
247830
|
if (!isNonInteractive) {
|
|
247826
247831
|
await open_default(dashboardUrl);
|
|
@@ -247828,9 +247833,7 @@ async function openDashboard(isNonInteractive) {
|
|
|
247828
247833
|
return { outroMessage: `Dashboard opened at ${dashboardUrl}` };
|
|
247829
247834
|
}
|
|
247830
247835
|
function getDashboardOpenCommand() {
|
|
247831
|
-
return new Base44Command("open").description("Open the app dashboard in your browser").action(
|
|
247832
|
-
return await openDashboard(command2.isNonInteractive);
|
|
247833
|
-
});
|
|
247836
|
+
return new Base44Command("open").description("Open the app dashboard in your browser").action(openDashboard);
|
|
247834
247837
|
}
|
|
247835
247838
|
|
|
247836
247839
|
// src/cli/commands/dashboard/index.ts
|
|
@@ -247839,7 +247842,9 @@ function getDashboardCommand() {
|
|
|
247839
247842
|
}
|
|
247840
247843
|
|
|
247841
247844
|
// src/cli/commands/entities/push.ts
|
|
247842
|
-
async function pushEntitiesAction(
|
|
247845
|
+
async function pushEntitiesAction({
|
|
247846
|
+
logger: logger2
|
|
247847
|
+
}) {
|
|
247843
247848
|
const { entities } = await readProjectConfig();
|
|
247844
247849
|
if (entities.length === 0) {
|
|
247845
247850
|
return { outroMessage: "No entities found in project" };
|
|
@@ -247864,11 +247869,11 @@ async function pushEntitiesAction(logger2) {
|
|
|
247864
247869
|
return { outroMessage: "Entities pushed to Base44" };
|
|
247865
247870
|
}
|
|
247866
247871
|
function getEntitiesPushCommand() {
|
|
247867
|
-
return new Command("entities").description("Manage project entities").addCommand(new Base44Command("push").description("Push local entities to Base44").action(
|
|
247872
|
+
return new Command("entities").description("Manage project entities").addCommand(new Base44Command("push").description("Push local entities to Base44").action(pushEntitiesAction));
|
|
247868
247873
|
}
|
|
247869
247874
|
|
|
247870
247875
|
// src/cli/commands/functions/delete.ts
|
|
247871
|
-
async function deleteFunctionsAction(names) {
|
|
247876
|
+
async function deleteFunctionsAction(_ctx, names) {
|
|
247872
247877
|
let deleted = 0;
|
|
247873
247878
|
let notFound = 0;
|
|
247874
247879
|
let errors5 = 0;
|
|
@@ -247914,9 +247919,9 @@ function validateNames(command2) {
|
|
|
247914
247919
|
}
|
|
247915
247920
|
}
|
|
247916
247921
|
function getDeleteCommand() {
|
|
247917
|
-
return new Base44Command("delete").description("Delete deployed functions").argument("<names...>", "Function names to delete").hook("preAction", validateNames).action(async (rawNames) => {
|
|
247922
|
+
return new Base44Command("delete").description("Delete deployed functions").argument("<names...>", "Function names to delete").hook("preAction", validateNames).action(async (ctx, rawNames) => {
|
|
247918
247923
|
const names = parseNames(rawNames);
|
|
247919
|
-
return deleteFunctionsAction(names);
|
|
247924
|
+
return deleteFunctionsAction(ctx, names);
|
|
247920
247925
|
});
|
|
247921
247926
|
}
|
|
247922
247927
|
|
|
@@ -247977,7 +247982,7 @@ function buildDeploySummary(results) {
|
|
|
247977
247982
|
parts.push(`${failed} error${failed !== 1 ? "s" : ""}`);
|
|
247978
247983
|
return parts.join(", ") || "No functions deployed";
|
|
247979
247984
|
}
|
|
247980
|
-
async function deployFunctionsAction(names, options
|
|
247985
|
+
async function deployFunctionsAction({ logger: logger2 }, names, options) {
|
|
247981
247986
|
if (options.force && names.length > 0) {
|
|
247982
247987
|
throw new InvalidInputError("--force cannot be used when specifying function names");
|
|
247983
247988
|
}
|
|
@@ -248023,14 +248028,16 @@ async function deployFunctionsAction(names, options, logger2) {
|
|
|
248023
248028
|
return { outroMessage: buildDeploySummary(results) };
|
|
248024
248029
|
}
|
|
248025
248030
|
function getDeployCommand() {
|
|
248026
|
-
return new Base44Command("deploy").description("Deploy functions to Base44").argument("[names...]", "Function names to deploy (deploys all if omitted)").option("--force", "Delete remote functions not found locally").action(async (rawNames, options
|
|
248031
|
+
return new Base44Command("deploy").description("Deploy functions to Base44").argument("[names...]", "Function names to deploy (deploys all if omitted)").option("--force", "Delete remote functions not found locally").action(async (ctx, rawNames, options) => {
|
|
248027
248032
|
const names = parseNames2(rawNames);
|
|
248028
|
-
return deployFunctionsAction(names, options
|
|
248033
|
+
return deployFunctionsAction(ctx, names, options);
|
|
248029
248034
|
});
|
|
248030
248035
|
}
|
|
248031
248036
|
|
|
248032
248037
|
// src/cli/commands/functions/list.ts
|
|
248033
|
-
async function listFunctionsAction(
|
|
248038
|
+
async function listFunctionsAction({
|
|
248039
|
+
logger: logger2
|
|
248040
|
+
}) {
|
|
248034
248041
|
const { functions } = await runTask("Fetching functions...", async () => listDeployedFunctions(), { errorMessage: "Failed to fetch functions" });
|
|
248035
248042
|
if (functions.length === 0) {
|
|
248036
248043
|
return { outroMessage: "No functions on remote" };
|
|
@@ -248045,12 +248052,12 @@ async function listFunctionsAction(logger2) {
|
|
|
248045
248052
|
};
|
|
248046
248053
|
}
|
|
248047
248054
|
function getListCommand() {
|
|
248048
|
-
return new Base44Command("list").description("List all deployed functions").action(
|
|
248055
|
+
return new Base44Command("list").description("List all deployed functions").action(listFunctionsAction);
|
|
248049
248056
|
}
|
|
248050
248057
|
|
|
248051
248058
|
// src/cli/commands/functions/pull.ts
|
|
248052
248059
|
import { dirname as dirname9, join as join13 } from "node:path";
|
|
248053
|
-
async function pullFunctionsAction(
|
|
248060
|
+
async function pullFunctionsAction({ logger: logger2 }, name2) {
|
|
248054
248061
|
const { project: project2 } = await readProjectConfig();
|
|
248055
248062
|
const configDir = dirname9(project2.configPath);
|
|
248056
248063
|
const functionsDir = join13(configDir, project2.functionsDir);
|
|
@@ -248087,9 +248094,7 @@ async function pullFunctionsAction(name2, logger2) {
|
|
|
248087
248094
|
};
|
|
248088
248095
|
}
|
|
248089
248096
|
function getPullCommand() {
|
|
248090
|
-
return new Base44Command("pull").description("Pull deployed functions from Base44").argument("[name]", "Function name to pull (pulls all if omitted)").action(
|
|
248091
|
-
return pullFunctionsAction(name2, command2.logger);
|
|
248092
|
-
});
|
|
248097
|
+
return new Base44Command("pull").description("Pull deployed functions from Base44").argument("[name]", "Function name to pull (pulls all if omitted)").action(pullFunctionsAction);
|
|
248093
248098
|
}
|
|
248094
248099
|
|
|
248095
248100
|
// src/cli/commands/functions/index.ts
|
|
@@ -248264,6 +248269,25 @@ async function executeCreate({
|
|
|
248264
248269
|
}
|
|
248265
248270
|
return { outroMessage: "Your project is set up and ready to use" };
|
|
248266
248271
|
}
|
|
248272
|
+
async function createAction({ logger: logger2, isNonInteractive }, name2, options) {
|
|
248273
|
+
if (name2 && !options.path) {
|
|
248274
|
+
options.path = `./${import_kebabCase.default(name2)}`;
|
|
248275
|
+
}
|
|
248276
|
+
const skipPrompts = !!(options.name ?? name2) && !!options.path;
|
|
248277
|
+
if (!skipPrompts && isNonInteractive) {
|
|
248278
|
+
throw new InvalidInputError("Project name and --path are required in non-interactive mode", {
|
|
248279
|
+
hints: [
|
|
248280
|
+
{
|
|
248281
|
+
message: "Usage: base44 create <name> --path <path>"
|
|
248282
|
+
}
|
|
248283
|
+
]
|
|
248284
|
+
});
|
|
248285
|
+
}
|
|
248286
|
+
if (skipPrompts) {
|
|
248287
|
+
return await createNonInteractive({ name: options.name ?? name2, ...options }, logger2);
|
|
248288
|
+
}
|
|
248289
|
+
return await createInteractive({ name: name2, ...options }, logger2);
|
|
248290
|
+
}
|
|
248267
248291
|
function getCreateCommand() {
|
|
248268
248292
|
return new Base44Command("create", {
|
|
248269
248293
|
requireAppConfig: false,
|
|
@@ -248272,33 +248296,14 @@ function getCreateCommand() {
|
|
|
248272
248296
|
Examples:
|
|
248273
248297
|
$ base44 create my-app Creates a base44 project at ./my-app
|
|
248274
248298
|
$ base44 create my-todo-app --template backend-and-client Creates a base44 backend-and-client project at ./my-todo-app
|
|
248275
|
-
$ base44 create my-app --path ./projects/my-app --deploy Creates a base44 project at ./project/my-app and deploys it`).hook("preAction", validateNonInteractiveFlags).action(
|
|
248276
|
-
if (name2 && !options.path) {
|
|
248277
|
-
options.path = `./${import_kebabCase.default(name2)}`;
|
|
248278
|
-
}
|
|
248279
|
-
const skipPrompts = !!(options.name ?? name2) && !!options.path;
|
|
248280
|
-
if (!skipPrompts && command2.isNonInteractive) {
|
|
248281
|
-
throw new InvalidInputError("Project name and --path are required in non-interactive mode", {
|
|
248282
|
-
hints: [
|
|
248283
|
-
{
|
|
248284
|
-
message: "Usage: base44 create <name> --path <path>"
|
|
248285
|
-
}
|
|
248286
|
-
]
|
|
248287
|
-
});
|
|
248288
|
-
}
|
|
248289
|
-
if (skipPrompts) {
|
|
248290
|
-
return await createNonInteractive({
|
|
248291
|
-
name: options.name ?? name2,
|
|
248292
|
-
...options
|
|
248293
|
-
}, command2.logger);
|
|
248294
|
-
}
|
|
248295
|
-
return await createInteractive({ name: name2, ...options }, command2.logger);
|
|
248296
|
-
});
|
|
248299
|
+
$ base44 create my-app --path ./projects/my-app --deploy Creates a base44 project at ./project/my-app and deploys it`).hook("preAction", validateNonInteractiveFlags).action(createAction);
|
|
248297
248300
|
}
|
|
248298
248301
|
|
|
248299
248302
|
// src/cli/commands/project/deploy.ts
|
|
248300
|
-
async function deployAction(options) {
|
|
248301
|
-
|
|
248303
|
+
async function deployAction({ isNonInteractive, logger: logger2 }, options = {}) {
|
|
248304
|
+
if (isNonInteractive && !options.yes) {
|
|
248305
|
+
throw new InvalidInputError("--yes is required in non-interactive mode");
|
|
248306
|
+
}
|
|
248302
248307
|
const projectData = await readProjectConfig(options.projectRoot);
|
|
248303
248308
|
if (!hasResourcesToDeploy(projectData)) {
|
|
248304
248309
|
return {
|
|
@@ -248350,7 +248355,7 @@ ${summaryLines.join(`
|
|
|
248350
248355
|
}
|
|
248351
248356
|
});
|
|
248352
248357
|
const connectorResults = result.connectorResults ?? [];
|
|
248353
|
-
await handleOAuthConnectors(connectorResults, options, logger2);
|
|
248358
|
+
await handleOAuthConnectors(connectorResults, isNonInteractive, options, logger2);
|
|
248354
248359
|
const stripeResult = connectorResults.find((r) => r.type === "stripe");
|
|
248355
248360
|
if (stripeResult?.action === "provisioned") {
|
|
248356
248361
|
printStripeResult(stripeResult, logger2);
|
|
@@ -248362,23 +248367,14 @@ ${summaryLines.join(`
|
|
|
248362
248367
|
return { outroMessage: "App deployed successfully" };
|
|
248363
248368
|
}
|
|
248364
248369
|
function getDeployCommand2() {
|
|
248365
|
-
return new Base44Command("deploy").description("Deploy all project resources (entities, functions, agents, connectors, and site)").option("-y, --yes", "Skip confirmation prompt").action(
|
|
248366
|
-
if (command2.isNonInteractive && !options.yes) {
|
|
248367
|
-
throw new InvalidInputError("--yes is required in non-interactive mode");
|
|
248368
|
-
}
|
|
248369
|
-
return await deployAction({
|
|
248370
|
-
...options,
|
|
248371
|
-
isNonInteractive: command2.isNonInteractive,
|
|
248372
|
-
logger: command2.logger
|
|
248373
|
-
});
|
|
248374
|
-
});
|
|
248370
|
+
return new Base44Command("deploy").description("Deploy all project resources (entities, functions, agents, connectors, and site)").option("-y, --yes", "Skip confirmation prompt").action(deployAction);
|
|
248375
248371
|
}
|
|
248376
|
-
async function handleOAuthConnectors(connectorResults, options, logger2) {
|
|
248372
|
+
async function handleOAuthConnectors(connectorResults, isNonInteractive, options, logger2) {
|
|
248377
248373
|
const needsOAuth = filterPendingOAuth(connectorResults);
|
|
248378
248374
|
if (needsOAuth.length === 0)
|
|
248379
248375
|
return;
|
|
248380
248376
|
const oauthOutcomes = await promptOAuthFlows(needsOAuth, logger2, {
|
|
248381
|
-
skipPrompt: options.yes ||
|
|
248377
|
+
skipPrompt: options.yes || isNonInteractive
|
|
248382
248378
|
});
|
|
248383
248379
|
const allAuthorized = oauthOutcomes.size > 0 && [...oauthOutcomes.values()].every((s) => s === "ACTIVE");
|
|
248384
248380
|
if (!allAuthorized) {
|
|
@@ -248466,7 +248462,12 @@ async function promptForExistingProject(linkableProjects) {
|
|
|
248466
248462
|
}
|
|
248467
248463
|
return selectedProject;
|
|
248468
248464
|
}
|
|
248469
|
-
async function link(
|
|
248465
|
+
async function link(ctx, options) {
|
|
248466
|
+
const { logger: logger2, isNonInteractive } = ctx;
|
|
248467
|
+
const skipPrompts = !!options.create || !!options.projectId;
|
|
248468
|
+
if (!skipPrompts && isNonInteractive) {
|
|
248469
|
+
throw new InvalidInputError("--create with --name, or --projectId, is required in non-interactive mode");
|
|
248470
|
+
}
|
|
248470
248471
|
const projectRoot = await findProjectRoot();
|
|
248471
248472
|
if (!projectRoot) {
|
|
248472
248473
|
throw new ConfigNotFoundError("No Base44 project found. Run this command from a project directory with a config.jsonc file.");
|
|
@@ -248534,13 +248535,7 @@ async function link(options, logger2) {
|
|
|
248534
248535
|
return { outroMessage: "Project linked" };
|
|
248535
248536
|
}
|
|
248536
248537
|
function getLinkCommand() {
|
|
248537
|
-
return new Base44Command("link", { requireAppConfig: false }).description("Link a local project to a Base44 project (create new or link existing)").option("-c, --create", "Create a new project (skip selection prompt)").option("-n, --name <name>", "Project name (required when --create is used)").option("-d, --description <description>", "Project description").option("-p, --projectId <id>", "Project ID to link to an existing project (skips selection prompt)").hook("preAction", validateNonInteractiveFlags2).action(
|
|
248538
|
-
const skipPrompts = !!options.create || !!options.projectId;
|
|
248539
|
-
if (!skipPrompts && command2.isNonInteractive) {
|
|
248540
|
-
throw new InvalidInputError("--create with --name, or --projectId, is required in non-interactive mode");
|
|
248541
|
-
}
|
|
248542
|
-
return await link(options, command2.logger);
|
|
248543
|
-
});
|
|
248538
|
+
return new Base44Command("link", { requireAppConfig: false }).description("Link a local project to a Base44 project (create new or link existing)").option("-c, --create", "Create a new project (skip selection prompt)").option("-n, --name <name>", "Project name (required when --create is used)").option("-d, --description <description>", "Project description").option("-p, --projectId <id>", "Project ID to link to an existing project (skips selection prompt)").hook("preAction", validateNonInteractiveFlags2).action(link);
|
|
248544
248539
|
}
|
|
248545
248540
|
|
|
248546
248541
|
// src/cli/commands/project/logs.ts
|
|
@@ -248642,7 +248637,7 @@ function validateLimit(limit) {
|
|
|
248642
248637
|
throw new InvalidInputError(`Invalid limit: "${limit}". Must be a number between 1 and 1000.`);
|
|
248643
248638
|
}
|
|
248644
248639
|
}
|
|
248645
|
-
async function logsAction(options) {
|
|
248640
|
+
async function logsAction(_ctx, options) {
|
|
248646
248641
|
validateLimit(options.limit);
|
|
248647
248642
|
const specifiedFunctions = parseFunctionNames(options.function);
|
|
248648
248643
|
const allProjectFunctions = await getAllFunctionNames();
|
|
@@ -248664,7 +248659,7 @@ function getLogsCommand() {
|
|
|
248664
248659
|
}
|
|
248665
248660
|
|
|
248666
248661
|
// src/cli/commands/secrets/delete.ts
|
|
248667
|
-
async function deleteSecretAction(key) {
|
|
248662
|
+
async function deleteSecretAction(_ctx, key) {
|
|
248668
248663
|
await runTask(`Deleting secret "${key}"`, async () => {
|
|
248669
248664
|
return await deleteSecret(key);
|
|
248670
248665
|
}, {
|
|
@@ -248680,7 +248675,9 @@ function getSecretsDeleteCommand() {
|
|
|
248680
248675
|
}
|
|
248681
248676
|
|
|
248682
248677
|
// src/cli/commands/secrets/list.ts
|
|
248683
|
-
async function listSecretsAction(
|
|
248678
|
+
async function listSecretsAction({
|
|
248679
|
+
logger: logger2
|
|
248680
|
+
}) {
|
|
248684
248681
|
const secrets = await runTask("Fetching secrets from Base44", async () => {
|
|
248685
248682
|
return await listSecrets();
|
|
248686
248683
|
}, {
|
|
@@ -248699,7 +248696,7 @@ async function listSecretsAction(logger2) {
|
|
|
248699
248696
|
};
|
|
248700
248697
|
}
|
|
248701
248698
|
function getSecretsListCommand() {
|
|
248702
|
-
return new Base44Command("list").description("List secret names").action(
|
|
248699
|
+
return new Base44Command("list").description("List secret names").action(listSecretsAction);
|
|
248703
248700
|
}
|
|
248704
248701
|
|
|
248705
248702
|
// src/cli/commands/secrets/set.ts
|
|
@@ -248730,7 +248727,7 @@ function validateInput(entries, options) {
|
|
|
248730
248727
|
throw new InvalidInputError("Provide KEY=VALUE pairs or --env-file, but not both.");
|
|
248731
248728
|
}
|
|
248732
248729
|
}
|
|
248733
|
-
async function setSecretsAction(entries, options
|
|
248730
|
+
async function setSecretsAction({ logger: logger2 }, entries, options) {
|
|
248734
248731
|
validateInput(entries, options);
|
|
248735
248732
|
let secrets;
|
|
248736
248733
|
if (options.envFile) {
|
|
@@ -248754,9 +248751,7 @@ async function setSecretsAction(entries, options, logger2) {
|
|
|
248754
248751
|
};
|
|
248755
248752
|
}
|
|
248756
248753
|
function getSecretsSetCommand() {
|
|
248757
|
-
return new Base44Command("set").description("Set one or more secrets (KEY=VALUE format)").argument("[entries...]", "KEY=VALUE pairs (e.g. KEY1=VALUE1 KEY2=VALUE2)").option("--env-file <path>", "Path to .env file").action(
|
|
248758
|
-
return await setSecretsAction(entries, options, command2.logger);
|
|
248759
|
-
});
|
|
248754
|
+
return new Base44Command("set").description("Set one or more secrets (KEY=VALUE format)").argument("[entries...]", "KEY=VALUE pairs (e.g. KEY1=VALUE1 KEY2=VALUE2)").option("--env-file <path>", "Path to .env file").action(setSecretsAction);
|
|
248760
248755
|
}
|
|
248761
248756
|
|
|
248762
248757
|
// src/cli/commands/secrets/index.ts
|
|
@@ -248766,7 +248761,10 @@ function getSecretsCommand() {
|
|
|
248766
248761
|
|
|
248767
248762
|
// src/cli/commands/site/deploy.ts
|
|
248768
248763
|
import { resolve as resolve4 } from "node:path";
|
|
248769
|
-
async function deployAction2(options) {
|
|
248764
|
+
async function deployAction2({ isNonInteractive }, options) {
|
|
248765
|
+
if (isNonInteractive && !options.yes) {
|
|
248766
|
+
throw new InvalidInputError("--yes is required in non-interactive mode");
|
|
248767
|
+
}
|
|
248770
248768
|
const { project: project2 } = await readProjectConfig();
|
|
248771
248769
|
if (!project2.site?.outputDirectory) {
|
|
248772
248770
|
throw new ConfigNotFoundError("No site configuration found.", {
|
|
@@ -248795,19 +248793,13 @@ async function deployAction2(options) {
|
|
|
248795
248793
|
return { outroMessage: `Visit your site at: ${result.appUrl}` };
|
|
248796
248794
|
}
|
|
248797
248795
|
function getSiteDeployCommand() {
|
|
248798
|
-
return new Base44Command("deploy").description("Deploy built site files to Base44 hosting").option("-y, --yes", "Skip confirmation prompt").action(
|
|
248799
|
-
if (command2.isNonInteractive && !options.yes) {
|
|
248800
|
-
throw new InvalidInputError("--yes is required in non-interactive mode");
|
|
248801
|
-
}
|
|
248802
|
-
return await deployAction2({
|
|
248803
|
-
...options,
|
|
248804
|
-
isNonInteractive: command2.isNonInteractive
|
|
248805
|
-
});
|
|
248806
|
-
});
|
|
248796
|
+
return new Base44Command("deploy").description("Deploy built site files to Base44 hosting").option("-y, --yes", "Skip confirmation prompt").action(deployAction2);
|
|
248807
248797
|
}
|
|
248808
248798
|
|
|
248809
248799
|
// src/cli/commands/site/open.ts
|
|
248810
|
-
async function openAction(
|
|
248800
|
+
async function openAction({
|
|
248801
|
+
isNonInteractive
|
|
248802
|
+
}) {
|
|
248811
248803
|
const siteUrl = await getSiteUrl();
|
|
248812
248804
|
if (!isNonInteractive) {
|
|
248813
248805
|
await open_default(siteUrl);
|
|
@@ -248815,9 +248807,7 @@ async function openAction(isNonInteractive) {
|
|
|
248815
248807
|
return { outroMessage: `Site opened at ${siteUrl}` };
|
|
248816
248808
|
}
|
|
248817
248809
|
function getSiteOpenCommand() {
|
|
248818
|
-
return new Base44Command("open").description("Open the published site in your browser").action(
|
|
248819
|
-
return await openAction(command2.isNonInteractive);
|
|
248820
|
-
});
|
|
248810
|
+
return new Base44Command("open").description("Open the published site in your browser").action(openAction);
|
|
248821
248811
|
}
|
|
248822
248812
|
|
|
248823
248813
|
// src/cli/commands/site/index.ts
|
|
@@ -248935,7 +248925,7 @@ async function updateProjectConfig(projectRoot) {
|
|
|
248935
248925
|
}
|
|
248936
248926
|
// src/cli/commands/types/generate.ts
|
|
248937
248927
|
var TYPES_FILE_PATH = "base44/.types/types.d.ts";
|
|
248938
|
-
async function generateTypesAction() {
|
|
248928
|
+
async function generateTypesAction(_ctx) {
|
|
248939
248929
|
const { entities, functions, agents, connectors, project: project2 } = await readProjectConfig();
|
|
248940
248930
|
await runTask("Generating types", async () => {
|
|
248941
248931
|
await generateTypesFile({ entities, functions, agents, connectors });
|
|
@@ -248955,9 +248945,9 @@ function getTypesCommand() {
|
|
|
248955
248945
|
}
|
|
248956
248946
|
|
|
248957
248947
|
// src/cli/dev/dev-server/main.ts
|
|
248958
|
-
import { dirname as dirname14, join as join20 } from "node:path";
|
|
248959
248948
|
var import_cors = __toESM(require_lib4(), 1);
|
|
248960
248949
|
var import_express4 = __toESM(require_express(), 1);
|
|
248950
|
+
import { dirname as dirname14, join as join20 } from "node:path";
|
|
248961
248951
|
|
|
248962
248952
|
// ../../node_modules/get-port/index.js
|
|
248963
248953
|
import net from "node:net";
|
|
@@ -251618,12 +251608,12 @@ async function createDevServer(options8) {
|
|
|
251618
251608
|
const functionRoutes = createFunctionRouter(functionManager, devLogger);
|
|
251619
251609
|
app.use("/api/apps/:appId/functions", functionRoutes);
|
|
251620
251610
|
if (functionManager.getFunctionNames().length > 0) {
|
|
251621
|
-
|
|
251611
|
+
options8.logger.info(`Loaded functions: ${functionManager.getFunctionNames().join(", ")}`);
|
|
251622
251612
|
}
|
|
251623
251613
|
const db2 = new Database;
|
|
251624
251614
|
db2.load(entities);
|
|
251625
251615
|
if (db2.getCollectionNames().length > 0) {
|
|
251626
|
-
|
|
251616
|
+
options8.logger.info(`Loaded entities: ${db2.getCollectionNames().join(", ")}`);
|
|
251627
251617
|
}
|
|
251628
251618
|
let emitEntityEvent = () => {};
|
|
251629
251619
|
const entityRoutes = createEntityRoutes(db2, devLogger, remoteProxy, (...args) => emitEntityEvent(...args));
|
|
@@ -251719,9 +251709,10 @@ async function createDevServer(options8) {
|
|
|
251719
251709
|
}
|
|
251720
251710
|
|
|
251721
251711
|
// src/cli/commands/dev.ts
|
|
251722
|
-
async function devAction(options8) {
|
|
251712
|
+
async function devAction({ logger: logger2 }, options8) {
|
|
251723
251713
|
const port = options8.port ? Number(options8.port) : undefined;
|
|
251724
251714
|
const { port: resolvedPort } = await createDevServer({
|
|
251715
|
+
logger: logger2,
|
|
251725
251716
|
port,
|
|
251726
251717
|
denoWrapperPath: getDenoWrapperPath(),
|
|
251727
251718
|
loadResources: async () => {
|
|
@@ -251740,7 +251731,14 @@ function getDevCommand() {
|
|
|
251740
251731
|
// src/cli/commands/project/eject.ts
|
|
251741
251732
|
import { resolve as resolve8 } from "node:path";
|
|
251742
251733
|
var import_kebabCase2 = __toESM(require_kebabCase(), 1);
|
|
251743
|
-
async function eject(
|
|
251734
|
+
async function eject(ctx, options8) {
|
|
251735
|
+
const { logger: logger2, isNonInteractive } = ctx;
|
|
251736
|
+
if (isNonInteractive && !options8.projectId) {
|
|
251737
|
+
throw new InvalidInputError("--project-id is required in non-interactive mode");
|
|
251738
|
+
}
|
|
251739
|
+
if (isNonInteractive && !options8.path) {
|
|
251740
|
+
throw new InvalidInputError("--path is required in non-interactive mode");
|
|
251741
|
+
}
|
|
251744
251742
|
const projects = await listProjects();
|
|
251745
251743
|
const ejectableProjects = projects.filter((p4) => p4.isManagedSourceCode !== false);
|
|
251746
251744
|
let selectedProject;
|
|
@@ -251820,21 +251818,13 @@ async function eject(options8, logger2) {
|
|
|
251820
251818
|
successMessage: theme.colors.base44Orange("Project built successfully"),
|
|
251821
251819
|
errorMessage: "Failed to build project"
|
|
251822
251820
|
});
|
|
251823
|
-
await deployAction({ yes: true, projectRoot: resolvedPath
|
|
251821
|
+
await deployAction(ctx, { yes: true, projectRoot: resolvedPath });
|
|
251824
251822
|
}
|
|
251825
251823
|
}
|
|
251826
251824
|
return { outroMessage: "Your new project is set and ready to use" };
|
|
251827
251825
|
}
|
|
251828
251826
|
function getEjectCommand() {
|
|
251829
|
-
return new Base44Command("eject", { requireAppConfig: false }).description("Download the code for an existing Base44 project").option("-p, --path <path>", "Path where to write the project").option("--project-id <id>", "Project ID to eject (skips interactive selection)").option("-y, --yes", "Skip confirmation prompts").action(
|
|
251830
|
-
if (command2.isNonInteractive && !options8.projectId) {
|
|
251831
|
-
throw new InvalidInputError("--project-id is required in non-interactive mode");
|
|
251832
|
-
}
|
|
251833
|
-
if (command2.isNonInteractive && !options8.path) {
|
|
251834
|
-
throw new InvalidInputError("--path is required in non-interactive mode");
|
|
251835
|
-
}
|
|
251836
|
-
return await eject({ ...options8, isNonInteractive: command2.isNonInteractive }, command2.logger);
|
|
251837
|
-
});
|
|
251827
|
+
return new Base44Command("eject", { requireAppConfig: false }).description("Download the code for an existing Base44 project").option("-p, --path <path>", "Path where to write the project").option("--project-id <id>", "Project ID to eject (skips interactive selection)").option("-y, --yes", "Skip confirmation prompts").action(eject);
|
|
251838
251828
|
}
|
|
251839
251829
|
|
|
251840
251830
|
// src/cli/program.ts
|
|
@@ -256109,4 +256099,4 @@ export {
|
|
|
256109
256099
|
CLIExitError
|
|
256110
256100
|
};
|
|
256111
256101
|
|
|
256112
|
-
//# debugId=
|
|
256102
|
+
//# debugId=391F13E14962933D64756E2164756E21
|