@base44-preview/cli 0.0.45-pr.425.c43f1ad → 0.0.45-pr.425.ce72a21
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 +111 -109
- package/dist/cli/index.js.map +24 -24
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -238804,14 +238804,14 @@ async function getUserInfo(accessToken) {
|
|
|
238804
238804
|
return result.data;
|
|
238805
238805
|
}
|
|
238806
238806
|
// src/cli/commands/auth/login-flow.ts
|
|
238807
|
-
async function generateAndDisplayDeviceCode(
|
|
238807
|
+
async function generateAndDisplayDeviceCode(logger) {
|
|
238808
238808
|
const deviceCodeResponse = await runTask("Generating device code...", async () => {
|
|
238809
238809
|
return await generateDeviceCode();
|
|
238810
238810
|
}, {
|
|
238811
238811
|
successMessage: "Device code generated",
|
|
238812
238812
|
errorMessage: "Failed to generate device code"
|
|
238813
238813
|
});
|
|
238814
|
-
|
|
238814
|
+
logger.info(`Verification code: ${theme.styles.bold(deviceCodeResponse.userCode)}` + `
|
|
238815
238815
|
Please confirm this code at: ${deviceCodeResponse.verificationUri}`);
|
|
238816
238816
|
return deviceCodeResponse;
|
|
238817
238817
|
}
|
|
@@ -238855,8 +238855,10 @@ async function saveAuthData(response, userInfo) {
|
|
|
238855
238855
|
name: userInfo.name
|
|
238856
238856
|
});
|
|
238857
238857
|
}
|
|
238858
|
-
async function login({
|
|
238859
|
-
|
|
238858
|
+
async function login({
|
|
238859
|
+
log: logger
|
|
238860
|
+
}) {
|
|
238861
|
+
const deviceCodeResponse = await generateAndDisplayDeviceCode(logger);
|
|
238860
238862
|
const token = await waitForAuthentication(deviceCodeResponse.deviceCode, deviceCodeResponse.expiresIn, deviceCodeResponse.interval);
|
|
238861
238863
|
const userInfo = await getUserInfo(token.accessToken);
|
|
238862
238864
|
await saveAuthData(token, userInfo);
|
|
@@ -246874,7 +246876,7 @@ async function parseEnvFile(filePath) {
|
|
|
246874
246876
|
}
|
|
246875
246877
|
// src/cli/commands/agents/pull.ts
|
|
246876
246878
|
async function pullAgentsAction({
|
|
246877
|
-
log
|
|
246879
|
+
log: logger2
|
|
246878
246880
|
}) {
|
|
246879
246881
|
const { project: project2 } = await readProjectConfig();
|
|
246880
246882
|
const configDir = dirname7(project2.configPath);
|
|
@@ -246892,13 +246894,13 @@ async function pullAgentsAction({
|
|
|
246892
246894
|
errorMessage: "Failed to sync agent files"
|
|
246893
246895
|
});
|
|
246894
246896
|
if (written.length > 0) {
|
|
246895
|
-
|
|
246897
|
+
logger2.success(`Written: ${written.join(", ")}`);
|
|
246896
246898
|
}
|
|
246897
246899
|
if (deleted.length > 0) {
|
|
246898
|
-
|
|
246900
|
+
logger2.warn(`Deleted: ${deleted.join(", ")}`);
|
|
246899
246901
|
}
|
|
246900
246902
|
if (written.length === 0 && deleted.length === 0) {
|
|
246901
|
-
|
|
246903
|
+
logger2.info("All agents are already up to date");
|
|
246902
246904
|
}
|
|
246903
246905
|
return {
|
|
246904
246906
|
outroMessage: `Pulled ${remoteAgents.total} agents to ${agentsDir}`
|
|
@@ -246910,10 +246912,10 @@ function getAgentsPullCommand() {
|
|
|
246910
246912
|
|
|
246911
246913
|
// src/cli/commands/agents/push.ts
|
|
246912
246914
|
async function pushAgentsAction({
|
|
246913
|
-
log
|
|
246915
|
+
log: logger2
|
|
246914
246916
|
}) {
|
|
246915
246917
|
const { agents } = await readProjectConfig();
|
|
246916
|
-
|
|
246918
|
+
logger2.info(agents.length === 0 ? "No local agents found - this will delete all remote agents" : `Found ${agents.length} agents to push`);
|
|
246917
246919
|
const result = await runTask("Pushing agents to Base44", async () => {
|
|
246918
246920
|
return await pushAgents(agents);
|
|
246919
246921
|
}, {
|
|
@@ -246921,13 +246923,13 @@ async function pushAgentsAction({
|
|
|
246921
246923
|
errorMessage: "Failed to push agents"
|
|
246922
246924
|
});
|
|
246923
246925
|
if (result.created.length > 0) {
|
|
246924
|
-
|
|
246926
|
+
logger2.success(`Created: ${result.created.join(", ")}`);
|
|
246925
246927
|
}
|
|
246926
246928
|
if (result.updated.length > 0) {
|
|
246927
|
-
|
|
246929
|
+
logger2.success(`Updated: ${result.updated.join(", ")}`);
|
|
246928
246930
|
}
|
|
246929
246931
|
if (result.deleted.length > 0) {
|
|
246930
|
-
|
|
246932
|
+
logger2.warn(`Deleted: ${result.deleted.join(", ")}`);
|
|
246931
246933
|
}
|
|
246932
246934
|
return { outroMessage: "Agents pushed to Base44" };
|
|
246933
246935
|
}
|
|
@@ -246971,7 +246973,7 @@ function getWhoamiCommand() {
|
|
|
246971
246973
|
|
|
246972
246974
|
// src/cli/commands/connectors/list-available.ts
|
|
246973
246975
|
async function listAvailableAction({
|
|
246974
|
-
log
|
|
246976
|
+
log: logger2
|
|
246975
246977
|
}) {
|
|
246976
246978
|
const { integrations } = await runTask("Fetching available integrations from Base44", async () => {
|
|
246977
246979
|
return await listAvailableIntegrations();
|
|
@@ -246985,7 +246987,7 @@ async function listAvailableAction({
|
|
|
246985
246987
|
for (const { displayName, ...rest } of integrations) {
|
|
246986
246988
|
const yaml2 = formatYaml(rest);
|
|
246987
246989
|
const pad = " ".repeat(YAML_INDENT);
|
|
246988
|
-
|
|
246990
|
+
logger2.info(`${displayName}
|
|
246989
246991
|
${pad}${yaml2.replace(/\n/g, `
|
|
246990
246992
|
${pad}`)}`);
|
|
246991
246993
|
}
|
|
@@ -247000,7 +247002,7 @@ function getConnectorsListAvailableCommand() {
|
|
|
247000
247002
|
// src/cli/commands/connectors/pull.ts
|
|
247001
247003
|
import { dirname as dirname8, join as join12 } from "node:path";
|
|
247002
247004
|
async function pullConnectorsAction({
|
|
247003
|
-
log
|
|
247005
|
+
log: logger2
|
|
247004
247006
|
}) {
|
|
247005
247007
|
const { project: project2 } = await readProjectConfig();
|
|
247006
247008
|
const configDir = dirname8(project2.configPath);
|
|
@@ -247018,13 +247020,13 @@ async function pullConnectorsAction({
|
|
|
247018
247020
|
errorMessage: "Failed to sync connector files"
|
|
247019
247021
|
});
|
|
247020
247022
|
if (written.length > 0) {
|
|
247021
|
-
|
|
247023
|
+
logger2.success(`Written: ${written.join(", ")}`);
|
|
247022
247024
|
}
|
|
247023
247025
|
if (deleted.length > 0) {
|
|
247024
|
-
|
|
247026
|
+
logger2.warn(`Deleted: ${deleted.join(", ")}`);
|
|
247025
247027
|
}
|
|
247026
247028
|
if (written.length === 0 && deleted.length === 0) {
|
|
247027
|
-
|
|
247029
|
+
logger2.info("All connectors are already up to date");
|
|
247028
247030
|
}
|
|
247029
247031
|
return {
|
|
247030
247032
|
outroMessage: `Pulled ${remoteConnectors.length} connectors to ${connectorsDir}`
|
|
@@ -247693,14 +247695,14 @@ async function runOAuthFlowWithSkip(connector2) {
|
|
|
247693
247695
|
}
|
|
247694
247696
|
return finalStatus;
|
|
247695
247697
|
}
|
|
247696
|
-
async function promptOAuthFlows(pending,
|
|
247698
|
+
async function promptOAuthFlows(pending, logger2, options) {
|
|
247697
247699
|
const outcomes = new Map;
|
|
247698
247700
|
if (pending.length === 0) {
|
|
247699
247701
|
return outcomes;
|
|
247700
247702
|
}
|
|
247701
|
-
|
|
247703
|
+
logger2.warn(`${pending.length} connector(s) require authorization in your browser:`);
|
|
247702
247704
|
for (const connector2 of pending) {
|
|
247703
|
-
|
|
247705
|
+
logger2.info(` ${connector2.type}: ${theme.styles.dim(connector2.redirectUrl)}`);
|
|
247704
247706
|
}
|
|
247705
247707
|
if (options?.skipPrompt) {
|
|
247706
247708
|
return outcomes;
|
|
@@ -247713,11 +247715,11 @@ async function promptOAuthFlows(pending, log, options) {
|
|
|
247713
247715
|
}
|
|
247714
247716
|
for (const connector2 of pending) {
|
|
247715
247717
|
try {
|
|
247716
|
-
|
|
247718
|
+
logger2.info(`Opening browser for ${connector2.type}...`);
|
|
247717
247719
|
const status = await runOAuthFlowWithSkip(connector2);
|
|
247718
247720
|
outcomes.set(connector2.type, status);
|
|
247719
247721
|
} catch (err) {
|
|
247720
|
-
|
|
247722
|
+
logger2.error(`Failed to authorize ${connector2.type}: ${err instanceof Error ? err.message : String(err)}`);
|
|
247721
247723
|
outcomes.set(connector2.type, "FAILED");
|
|
247722
247724
|
}
|
|
247723
247725
|
}
|
|
@@ -247725,7 +247727,7 @@ async function promptOAuthFlows(pending, log, options) {
|
|
|
247725
247727
|
}
|
|
247726
247728
|
|
|
247727
247729
|
// src/cli/commands/connectors/push.ts
|
|
247728
|
-
function printSummary(results, oauthOutcomes,
|
|
247730
|
+
function printSummary(results, oauthOutcomes, logger2) {
|
|
247729
247731
|
const synced = [];
|
|
247730
247732
|
const added = [];
|
|
247731
247733
|
let provisioned;
|
|
@@ -247763,54 +247765,54 @@ function printSummary(results, oauthOutcomes, log) {
|
|
|
247763
247765
|
}
|
|
247764
247766
|
}
|
|
247765
247767
|
}
|
|
247766
|
-
|
|
247768
|
+
logger2.info(theme.styles.bold("Summary:"));
|
|
247767
247769
|
if (provisioned) {
|
|
247768
|
-
|
|
247770
|
+
logger2.success("Stripe sandbox provisioned");
|
|
247769
247771
|
if (provisioned.claimUrl) {
|
|
247770
|
-
|
|
247772
|
+
logger2.info(` Claim your Stripe sandbox: ${theme.colors.links(provisioned.claimUrl)}`);
|
|
247771
247773
|
}
|
|
247772
|
-
|
|
247774
|
+
logger2.info(` Connectors dashboard: ${theme.colors.links(getConnectorsUrl())}`);
|
|
247773
247775
|
}
|
|
247774
247776
|
if (synced.length > 0) {
|
|
247775
|
-
|
|
247777
|
+
logger2.success(`Synced: ${synced.join(", ")}`);
|
|
247776
247778
|
}
|
|
247777
247779
|
if (added.length > 0) {
|
|
247778
|
-
|
|
247780
|
+
logger2.success(`Added: ${added.join(", ")}`);
|
|
247779
247781
|
}
|
|
247780
247782
|
if (removed.length > 0) {
|
|
247781
|
-
|
|
247783
|
+
logger2.info(theme.styles.dim(`Removed: ${removed.join(", ")}`));
|
|
247782
247784
|
}
|
|
247783
247785
|
if (skipped.length > 0) {
|
|
247784
|
-
|
|
247786
|
+
logger2.warn(`Skipped: ${skipped.join(", ")}`);
|
|
247785
247787
|
}
|
|
247786
247788
|
for (const r of failed) {
|
|
247787
|
-
|
|
247789
|
+
logger2.error(`Failed: ${r.type} - ${r.error}`);
|
|
247788
247790
|
}
|
|
247789
247791
|
}
|
|
247790
247792
|
async function pushConnectorsAction({
|
|
247791
247793
|
isNonInteractive,
|
|
247792
|
-
log
|
|
247794
|
+
log: logger2
|
|
247793
247795
|
}) {
|
|
247794
247796
|
const { connectors } = await readProjectConfig();
|
|
247795
247797
|
if (connectors.length === 0) {
|
|
247796
|
-
|
|
247798
|
+
logger2.info("No local connectors found - checking for remote connectors to remove");
|
|
247797
247799
|
} else {
|
|
247798
247800
|
const connectorNames = connectors.map((c3) => c3.type).join(", ");
|
|
247799
|
-
|
|
247801
|
+
logger2.info(`Found ${connectors.length} connectors to push: ${connectorNames}`);
|
|
247800
247802
|
}
|
|
247801
247803
|
const { results } = await runTask("Pushing connectors to Base44", async () => {
|
|
247802
247804
|
return await pushConnectors(connectors);
|
|
247803
247805
|
});
|
|
247804
247806
|
const needsOAuth = filterPendingOAuth(results);
|
|
247805
247807
|
let outroMessage = "Connectors pushed to Base44";
|
|
247806
|
-
const oauthOutcomes = await promptOAuthFlows(needsOAuth,
|
|
247808
|
+
const oauthOutcomes = await promptOAuthFlows(needsOAuth, logger2, {
|
|
247807
247809
|
skipPrompt: isNonInteractive
|
|
247808
247810
|
});
|
|
247809
247811
|
const allAuthorized = oauthOutcomes.size > 0 && [...oauthOutcomes.values()].every((s) => s === "ACTIVE");
|
|
247810
247812
|
if (needsOAuth.length > 0 && !allAuthorized) {
|
|
247811
247813
|
outroMessage = isNonInteractive ? "Skipped OAuth in non-interactive mode. Run 'base44 connectors push' locally or open the links above to authorize." : "Some connectors still require authorization. Run 'base44 connectors push' or open the links above to authorize.";
|
|
247812
247814
|
}
|
|
247813
|
-
printSummary(results, oauthOutcomes,
|
|
247815
|
+
printSummary(results, oauthOutcomes, logger2);
|
|
247814
247816
|
return { outroMessage };
|
|
247815
247817
|
}
|
|
247816
247818
|
function getConnectorsPushCommand() {
|
|
@@ -247843,14 +247845,14 @@ function getDashboardCommand() {
|
|
|
247843
247845
|
|
|
247844
247846
|
// src/cli/commands/entities/push.ts
|
|
247845
247847
|
async function pushEntitiesAction({
|
|
247846
|
-
log
|
|
247848
|
+
log: logger2
|
|
247847
247849
|
}) {
|
|
247848
247850
|
const { entities } = await readProjectConfig();
|
|
247849
247851
|
if (entities.length === 0) {
|
|
247850
247852
|
return { outroMessage: "No entities found in project" };
|
|
247851
247853
|
}
|
|
247852
247854
|
const entityNames = entities.map((e2) => e2.name).join(", ");
|
|
247853
|
-
|
|
247855
|
+
logger2.info(`Found ${entities.length} entities to push: ${entityNames}`);
|
|
247854
247856
|
const result = await runTask("Pushing entities to Base44", async () => {
|
|
247855
247857
|
return await pushEntities(entities);
|
|
247856
247858
|
}, {
|
|
@@ -247858,13 +247860,13 @@ async function pushEntitiesAction({
|
|
|
247858
247860
|
errorMessage: "Failed to push entities"
|
|
247859
247861
|
});
|
|
247860
247862
|
if (result.created.length > 0) {
|
|
247861
|
-
|
|
247863
|
+
logger2.success(`Created: ${result.created.join(", ")}`);
|
|
247862
247864
|
}
|
|
247863
247865
|
if (result.updated.length > 0) {
|
|
247864
|
-
|
|
247866
|
+
logger2.success(`Updated: ${result.updated.join(", ")}`);
|
|
247865
247867
|
}
|
|
247866
247868
|
if (result.deleted.length > 0) {
|
|
247867
|
-
|
|
247869
|
+
logger2.warn(`Deleted: ${result.deleted.join(", ")}`);
|
|
247868
247870
|
}
|
|
247869
247871
|
return { outroMessage: "Entities pushed to Base44" };
|
|
247870
247872
|
}
|
|
@@ -247929,15 +247931,15 @@ function getDeleteCommand() {
|
|
|
247929
247931
|
function formatDuration(ms) {
|
|
247930
247932
|
return `${(ms / 1000).toFixed(1)}s`;
|
|
247931
247933
|
}
|
|
247932
|
-
function formatDeployResult(result,
|
|
247934
|
+
function formatDeployResult(result, logger2) {
|
|
247933
247935
|
const label = result.name.padEnd(25);
|
|
247934
247936
|
if (result.status === "deployed") {
|
|
247935
247937
|
const timing = result.durationMs ? theme.styles.dim(` (${formatDuration(result.durationMs)})`) : "";
|
|
247936
|
-
|
|
247938
|
+
logger2.success(`${label} deployed${timing}`);
|
|
247937
247939
|
} else if (result.status === "unchanged") {
|
|
247938
|
-
|
|
247940
|
+
logger2.success(`${label} unchanged`);
|
|
247939
247941
|
} else {
|
|
247940
|
-
|
|
247942
|
+
logger2.error(`${label} error: ${result.error}`);
|
|
247941
247943
|
}
|
|
247942
247944
|
}
|
|
247943
247945
|
|
|
@@ -247956,17 +247958,17 @@ function resolveFunctionsToDeploy(names, allFunctions) {
|
|
|
247956
247958
|
}
|
|
247957
247959
|
return allFunctions.filter((f) => names.includes(f.name));
|
|
247958
247960
|
}
|
|
247959
|
-
function formatPruneResult(pruneResult,
|
|
247961
|
+
function formatPruneResult(pruneResult, logger2) {
|
|
247960
247962
|
if (pruneResult.deleted) {
|
|
247961
|
-
|
|
247963
|
+
logger2.success(`${pruneResult.name.padEnd(25)} deleted`);
|
|
247962
247964
|
} else {
|
|
247963
|
-
|
|
247965
|
+
logger2.error(`${pruneResult.name.padEnd(25)} error: ${pruneResult.error}`);
|
|
247964
247966
|
}
|
|
247965
247967
|
}
|
|
247966
|
-
function formatPruneSummary(pruneResults,
|
|
247968
|
+
function formatPruneSummary(pruneResults, logger2) {
|
|
247967
247969
|
if (pruneResults.length > 0) {
|
|
247968
247970
|
const pruned = pruneResults.filter((r) => r.deleted).length;
|
|
247969
|
-
|
|
247971
|
+
logger2.info(`${pruned} deleted`);
|
|
247970
247972
|
}
|
|
247971
247973
|
}
|
|
247972
247974
|
function buildDeploySummary(results) {
|
|
@@ -247982,7 +247984,7 @@ function buildDeploySummary(results) {
|
|
|
247982
247984
|
parts.push(`${failed} error${failed !== 1 ? "s" : ""}`);
|
|
247983
247985
|
return parts.join(", ") || "No functions deployed";
|
|
247984
247986
|
}
|
|
247985
|
-
async function deployFunctionsAction({ log }, names, options) {
|
|
247987
|
+
async function deployFunctionsAction({ log: logger2 }, names, options) {
|
|
247986
247988
|
if (options.force && names.length > 0) {
|
|
247987
247989
|
throw new InvalidInputError("--force cannot be used when specifying function names");
|
|
247988
247990
|
}
|
|
@@ -247993,17 +247995,17 @@ async function deployFunctionsAction({ log }, names, options) {
|
|
|
247993
247995
|
outroMessage: "No functions found. Create functions in the 'functions' directory."
|
|
247994
247996
|
};
|
|
247995
247997
|
}
|
|
247996
|
-
|
|
247998
|
+
logger2.info(`Found ${toDeploy.length} ${toDeploy.length === 1 ? "function" : "functions"} to deploy`);
|
|
247997
247999
|
let completed = 0;
|
|
247998
248000
|
const total = toDeploy.length;
|
|
247999
248001
|
const results = await deployFunctionsSequentially(toDeploy, {
|
|
248000
248002
|
onStart: (startNames) => {
|
|
248001
248003
|
const label = startNames.length === 1 ? startNames[0] : `${startNames.length} functions`;
|
|
248002
|
-
|
|
248004
|
+
logger2.step(theme.styles.dim(`[${completed + 1}/${total}] Deploying ${label}...`));
|
|
248003
248005
|
},
|
|
248004
248006
|
onResult: (result) => {
|
|
248005
248007
|
completed++;
|
|
248006
|
-
formatDeployResult(result,
|
|
248008
|
+
formatDeployResult(result, logger2);
|
|
248007
248009
|
}
|
|
248008
248010
|
});
|
|
248009
248011
|
if (options.force) {
|
|
@@ -248014,16 +248016,16 @@ async function deployFunctionsAction({ log }, names, options) {
|
|
|
248014
248016
|
onStart: (total2) => {
|
|
248015
248017
|
pruneTotal = total2;
|
|
248016
248018
|
if (total2 > 0) {
|
|
248017
|
-
|
|
248019
|
+
logger2.info(`Found ${total2} remote ${total2 === 1 ? "function" : "functions"} to delete`);
|
|
248018
248020
|
}
|
|
248019
248021
|
},
|
|
248020
248022
|
onBeforeDelete: (name2) => {
|
|
248021
248023
|
pruneCompleted++;
|
|
248022
|
-
|
|
248024
|
+
logger2.step(theme.styles.dim(`[${pruneCompleted}/${pruneTotal}] Deleting ${name2}...`));
|
|
248023
248025
|
},
|
|
248024
|
-
onResult: (r) => formatPruneResult(r,
|
|
248026
|
+
onResult: (r) => formatPruneResult(r, logger2)
|
|
248025
248027
|
});
|
|
248026
|
-
formatPruneSummary(pruneResults,
|
|
248028
|
+
formatPruneSummary(pruneResults, logger2);
|
|
248027
248029
|
}
|
|
248028
248030
|
return { outroMessage: buildDeploySummary(results) };
|
|
248029
248031
|
}
|
|
@@ -248036,7 +248038,7 @@ function getDeployCommand() {
|
|
|
248036
248038
|
|
|
248037
248039
|
// src/cli/commands/functions/list.ts
|
|
248038
248040
|
async function listFunctionsAction({
|
|
248039
|
-
log
|
|
248041
|
+
log: logger2
|
|
248040
248042
|
}) {
|
|
248041
248043
|
const { functions } = await runTask("Fetching functions...", async () => listDeployedFunctions(), { errorMessage: "Failed to fetch functions" });
|
|
248042
248044
|
if (functions.length === 0) {
|
|
@@ -248045,7 +248047,7 @@ async function listFunctionsAction({
|
|
|
248045
248047
|
for (const fn of functions) {
|
|
248046
248048
|
const automationCount = fn.automations.length;
|
|
248047
248049
|
const automationLabel = automationCount > 0 ? theme.styles.dim(` (${automationCount} automation${automationCount > 1 ? "s" : ""})`) : "";
|
|
248048
|
-
|
|
248050
|
+
logger2.message(` ${fn.name}${automationLabel}`);
|
|
248049
248051
|
}
|
|
248050
248052
|
return {
|
|
248051
248053
|
outroMessage: `${functions.length} function${functions.length !== 1 ? "s" : ""} on remote`
|
|
@@ -248057,7 +248059,7 @@ function getListCommand() {
|
|
|
248057
248059
|
|
|
248058
248060
|
// src/cli/commands/functions/pull.ts
|
|
248059
248061
|
import { dirname as dirname9, join as join13 } from "node:path";
|
|
248060
|
-
async function pullFunctionsAction({ log }, name2) {
|
|
248062
|
+
async function pullFunctionsAction({ log: logger2 }, name2) {
|
|
248061
248063
|
const { project: project2 } = await readProjectConfig();
|
|
248062
248064
|
const configDir = dirname9(project2.configPath);
|
|
248063
248065
|
const functionsDir = join13(configDir, project2.functionsDir);
|
|
@@ -248084,10 +248086,10 @@ async function pullFunctionsAction({ log }, name2) {
|
|
|
248084
248086
|
errorMessage: "Failed to write function files"
|
|
248085
248087
|
});
|
|
248086
248088
|
for (const name3 of written) {
|
|
248087
|
-
|
|
248089
|
+
logger2.success(`${name3.padEnd(25)} written`);
|
|
248088
248090
|
}
|
|
248089
248091
|
for (const name3 of skipped) {
|
|
248090
|
-
|
|
248092
|
+
logger2.info(`${name3.padEnd(25)} unchanged`);
|
|
248091
248093
|
}
|
|
248092
248094
|
return {
|
|
248093
248095
|
outroMessage: `Pulled ${toPull.length} function${toPull.length !== 1 ? "s" : ""} to ${functionsDir}`
|
|
@@ -248123,7 +248125,7 @@ function validateNonInteractiveFlags(command2) {
|
|
|
248123
248125
|
command2.error("--path requires a project name argument. Usage: base44 create <name> --path <path>");
|
|
248124
248126
|
}
|
|
248125
248127
|
}
|
|
248126
|
-
async function createInteractive(options,
|
|
248128
|
+
async function createInteractive(options, logger2) {
|
|
248127
248129
|
const templates = await listTemplates();
|
|
248128
248130
|
const templateOptions = templates.map((t) => ({
|
|
248129
248131
|
value: t,
|
|
@@ -248165,10 +248167,10 @@ async function createInteractive(options, log) {
|
|
|
248165
248167
|
deploy: options.deploy,
|
|
248166
248168
|
skills: options.skills,
|
|
248167
248169
|
isInteractive: true
|
|
248168
|
-
},
|
|
248170
|
+
}, logger2);
|
|
248169
248171
|
}
|
|
248170
|
-
async function createNonInteractive(options,
|
|
248171
|
-
|
|
248172
|
+
async function createNonInteractive(options, logger2) {
|
|
248173
|
+
logger2.info(`Creating a new project at ${resolve2(options.path)}`);
|
|
248172
248174
|
const template2 = await getTemplateById(options.template ?? DEFAULT_TEMPLATE_ID);
|
|
248173
248175
|
return await executeCreate({
|
|
248174
248176
|
template: template2,
|
|
@@ -248177,7 +248179,7 @@ async function createNonInteractive(options, log) {
|
|
|
248177
248179
|
deploy: options.deploy,
|
|
248178
248180
|
skills: options.skills,
|
|
248179
248181
|
isInteractive: false
|
|
248180
|
-
},
|
|
248182
|
+
}, logger2);
|
|
248181
248183
|
}
|
|
248182
248184
|
async function executeCreate({
|
|
248183
248185
|
template: template2,
|
|
@@ -248187,7 +248189,7 @@ async function executeCreate({
|
|
|
248187
248189
|
deploy: deploy5,
|
|
248188
248190
|
skills,
|
|
248189
248191
|
isInteractive
|
|
248190
|
-
},
|
|
248192
|
+
}, logger2) {
|
|
248191
248193
|
const name2 = rawName.trim();
|
|
248192
248194
|
const resolvedPath = resolve2(projectPath);
|
|
248193
248195
|
const { projectId } = await runTask("Setting up your project...", async () => {
|
|
@@ -248262,14 +248264,14 @@ async function executeCreate({
|
|
|
248262
248264
|
});
|
|
248263
248265
|
} catch {}
|
|
248264
248266
|
}
|
|
248265
|
-
|
|
248266
|
-
|
|
248267
|
+
logger2.message(`${theme.styles.header("Project")}: ${theme.colors.base44Orange(name2)}`);
|
|
248268
|
+
logger2.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl(projectId))}`);
|
|
248267
248269
|
if (finalAppUrl) {
|
|
248268
|
-
|
|
248270
|
+
logger2.message(`${theme.styles.header("Site")}: ${theme.colors.links(finalAppUrl)}`);
|
|
248269
248271
|
}
|
|
248270
248272
|
return { outroMessage: "Your project is set up and ready to use" };
|
|
248271
248273
|
}
|
|
248272
|
-
async function createAction({ log, isNonInteractive }, name2, options) {
|
|
248274
|
+
async function createAction({ log: logger2, isNonInteractive }, name2, options) {
|
|
248273
248275
|
if (name2 && !options.path) {
|
|
248274
248276
|
options.path = `./${import_kebabCase.default(name2)}`;
|
|
248275
248277
|
}
|
|
@@ -248284,9 +248286,9 @@ async function createAction({ log, isNonInteractive }, name2, options) {
|
|
|
248284
248286
|
});
|
|
248285
248287
|
}
|
|
248286
248288
|
if (skipPrompts) {
|
|
248287
|
-
return await createNonInteractive({ name: options.name ?? name2, ...options },
|
|
248289
|
+
return await createNonInteractive({ name: options.name ?? name2, ...options }, logger2);
|
|
248288
248290
|
}
|
|
248289
|
-
return await createInteractive({ name: name2, ...options },
|
|
248291
|
+
return await createInteractive({ name: name2, ...options }, logger2);
|
|
248290
248292
|
}
|
|
248291
248293
|
function getCreateCommand() {
|
|
248292
248294
|
return new Base44Command("create", {
|
|
@@ -248300,7 +248302,7 @@ Examples:
|
|
|
248300
248302
|
}
|
|
248301
248303
|
|
|
248302
248304
|
// src/cli/commands/project/deploy.ts
|
|
248303
|
-
async function deployAction({ isNonInteractive, log }, options = {}) {
|
|
248305
|
+
async function deployAction({ isNonInteractive, log: logger2 }, options = {}) {
|
|
248304
248306
|
if (isNonInteractive && !options.yes) {
|
|
248305
248307
|
throw new InvalidInputError("--yes is required in non-interactive mode");
|
|
248306
248308
|
}
|
|
@@ -248328,7 +248330,7 @@ async function deployAction({ isNonInteractive, log }, options = {}) {
|
|
|
248328
248330
|
summaryLines.push(` - Site from ${project2.site.outputDirectory}`);
|
|
248329
248331
|
}
|
|
248330
248332
|
if (!options.yes) {
|
|
248331
|
-
|
|
248333
|
+
logger2.warn(`This will update your Base44 app with:
|
|
248332
248334
|
${summaryLines.join(`
|
|
248333
248335
|
`)}`);
|
|
248334
248336
|
const shouldDeploy = await Re({
|
|
@@ -248338,7 +248340,7 @@ ${summaryLines.join(`
|
|
|
248338
248340
|
return { outroMessage: "Deployment cancelled" };
|
|
248339
248341
|
}
|
|
248340
248342
|
} else {
|
|
248341
|
-
|
|
248343
|
+
logger2.info(`Deploying:
|
|
248342
248344
|
${summaryLines.join(`
|
|
248343
248345
|
`)}`);
|
|
248344
248346
|
}
|
|
@@ -248347,46 +248349,46 @@ ${summaryLines.join(`
|
|
|
248347
248349
|
const result = await deployAll(projectData, {
|
|
248348
248350
|
onFunctionStart: (names) => {
|
|
248349
248351
|
const label = names.length === 1 ? names[0] : `${names.length} functions`;
|
|
248350
|
-
|
|
248352
|
+
logger2.step(theme.styles.dim(`[${functionCompleted + 1}/${functionTotal}] Deploying ${label}...`));
|
|
248351
248353
|
},
|
|
248352
248354
|
onFunctionResult: (r) => {
|
|
248353
248355
|
functionCompleted++;
|
|
248354
|
-
formatDeployResult(r,
|
|
248356
|
+
formatDeployResult(r, logger2);
|
|
248355
248357
|
}
|
|
248356
248358
|
});
|
|
248357
248359
|
const connectorResults = result.connectorResults ?? [];
|
|
248358
|
-
await handleOAuthConnectors(connectorResults, isNonInteractive, options,
|
|
248360
|
+
await handleOAuthConnectors(connectorResults, isNonInteractive, options, logger2);
|
|
248359
248361
|
const stripeResult = connectorResults.find((r) => r.type === "stripe");
|
|
248360
248362
|
if (stripeResult?.action === "provisioned") {
|
|
248361
|
-
printStripeResult(stripeResult,
|
|
248363
|
+
printStripeResult(stripeResult, logger2);
|
|
248362
248364
|
}
|
|
248363
|
-
|
|
248365
|
+
logger2.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl())}`);
|
|
248364
248366
|
if (result.appUrl) {
|
|
248365
|
-
|
|
248367
|
+
logger2.message(`${theme.styles.header("App URL")}: ${theme.colors.links(result.appUrl)}`);
|
|
248366
248368
|
}
|
|
248367
248369
|
return { outroMessage: "App deployed successfully" };
|
|
248368
248370
|
}
|
|
248369
248371
|
function getDeployCommand2() {
|
|
248370
248372
|
return new Base44Command("deploy").description("Deploy all project resources (entities, functions, agents, connectors, and site)").option("-y, --yes", "Skip confirmation prompt").action(deployAction);
|
|
248371
248373
|
}
|
|
248372
|
-
async function handleOAuthConnectors(connectorResults, isNonInteractive, options,
|
|
248374
|
+
async function handleOAuthConnectors(connectorResults, isNonInteractive, options, logger2) {
|
|
248373
248375
|
const needsOAuth = filterPendingOAuth(connectorResults);
|
|
248374
248376
|
if (needsOAuth.length === 0)
|
|
248375
248377
|
return;
|
|
248376
|
-
const oauthOutcomes = await promptOAuthFlows(needsOAuth,
|
|
248378
|
+
const oauthOutcomes = await promptOAuthFlows(needsOAuth, logger2, {
|
|
248377
248379
|
skipPrompt: options.yes || isNonInteractive
|
|
248378
248380
|
});
|
|
248379
248381
|
const allAuthorized = oauthOutcomes.size > 0 && [...oauthOutcomes.values()].every((s) => s === "ACTIVE");
|
|
248380
248382
|
if (!allAuthorized) {
|
|
248381
|
-
|
|
248383
|
+
logger2.info("Some connectors still require authorization. Run 'base44 connectors push' or open the links above in your browser.");
|
|
248382
248384
|
}
|
|
248383
248385
|
}
|
|
248384
|
-
function printStripeResult(r,
|
|
248385
|
-
|
|
248386
|
+
function printStripeResult(r, logger2) {
|
|
248387
|
+
logger2.success("Stripe sandbox provisioned");
|
|
248386
248388
|
if (r.claimUrl) {
|
|
248387
|
-
|
|
248389
|
+
logger2.info(` Claim your Stripe sandbox: ${theme.colors.links(r.claimUrl)}`);
|
|
248388
248390
|
}
|
|
248389
|
-
|
|
248391
|
+
logger2.info(` Connectors dashboard: ${theme.colors.links(getConnectorsUrl())}`);
|
|
248390
248392
|
}
|
|
248391
248393
|
|
|
248392
248394
|
// src/cli/commands/project/link.ts
|
|
@@ -248463,7 +248465,7 @@ async function promptForExistingProject(linkableProjects) {
|
|
|
248463
248465
|
return selectedProject;
|
|
248464
248466
|
}
|
|
248465
248467
|
async function link(ctx, options) {
|
|
248466
|
-
const { log, isNonInteractive } = ctx;
|
|
248468
|
+
const { log: logger2, isNonInteractive } = ctx;
|
|
248467
248469
|
const skipPrompts = !!options.create || !!options.projectId;
|
|
248468
248470
|
if (!skipPrompts && isNonInteractive) {
|
|
248469
248471
|
throw new InvalidInputError("--create with --name, or --projectId, is required in non-interactive mode");
|
|
@@ -248531,7 +248533,7 @@ async function link(ctx, options) {
|
|
|
248531
248533
|
setAppConfig({ id: projectId, projectRoot: projectRoot.root });
|
|
248532
248534
|
finalProjectId = projectId;
|
|
248533
248535
|
}
|
|
248534
|
-
|
|
248536
|
+
logger2.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl(finalProjectId))}`);
|
|
248535
248537
|
return { outroMessage: "Project linked" };
|
|
248536
248538
|
}
|
|
248537
248539
|
function getLinkCommand() {
|
|
@@ -248676,7 +248678,7 @@ function getSecretsDeleteCommand() {
|
|
|
248676
248678
|
|
|
248677
248679
|
// src/cli/commands/secrets/list.ts
|
|
248678
248680
|
async function listSecretsAction({
|
|
248679
|
-
log
|
|
248681
|
+
log: logger2
|
|
248680
248682
|
}) {
|
|
248681
248683
|
const secrets = await runTask("Fetching secrets from Base44", async () => {
|
|
248682
248684
|
return await listSecrets();
|
|
@@ -248689,7 +248691,7 @@ async function listSecretsAction({
|
|
|
248689
248691
|
return { outroMessage: "No secrets configured." };
|
|
248690
248692
|
}
|
|
248691
248693
|
for (const name2 of names) {
|
|
248692
|
-
|
|
248694
|
+
logger2.info(name2);
|
|
248693
248695
|
}
|
|
248694
248696
|
return {
|
|
248695
248697
|
outroMessage: `Found ${names.length} secrets.`
|
|
@@ -248727,7 +248729,7 @@ function validateInput(entries, options) {
|
|
|
248727
248729
|
throw new InvalidInputError("Provide KEY=VALUE pairs or --env-file, but not both.");
|
|
248728
248730
|
}
|
|
248729
248731
|
}
|
|
248730
|
-
async function setSecretsAction({ log }, entries, options) {
|
|
248732
|
+
async function setSecretsAction({ log: logger2 }, entries, options) {
|
|
248731
248733
|
validateInput(entries, options);
|
|
248732
248734
|
let secrets;
|
|
248733
248735
|
if (options.envFile) {
|
|
@@ -248745,7 +248747,7 @@ async function setSecretsAction({ log }, entries, options) {
|
|
|
248745
248747
|
successMessage: `${names.length} secrets set successfully`,
|
|
248746
248748
|
errorMessage: "Failed to set secrets"
|
|
248747
248749
|
});
|
|
248748
|
-
|
|
248750
|
+
logger2.info(`Set: ${names.join(", ")}`);
|
|
248749
248751
|
return {
|
|
248750
248752
|
outroMessage: "Secrets set successfully."
|
|
248751
248753
|
};
|
|
@@ -251608,12 +251610,12 @@ async function createDevServer(options8) {
|
|
|
251608
251610
|
const functionRoutes = createFunctionRouter(functionManager, devLogger);
|
|
251609
251611
|
app.use("/api/apps/:appId/functions", functionRoutes);
|
|
251610
251612
|
if (functionManager.getFunctionNames().length > 0) {
|
|
251611
|
-
options8.
|
|
251613
|
+
options8.logger.info(`Loaded functions: ${functionManager.getFunctionNames().join(", ")}`);
|
|
251612
251614
|
}
|
|
251613
251615
|
const db2 = new Database;
|
|
251614
251616
|
db2.load(entities);
|
|
251615
251617
|
if (db2.getCollectionNames().length > 0) {
|
|
251616
|
-
options8.
|
|
251618
|
+
options8.logger.info(`Loaded entities: ${db2.getCollectionNames().join(", ")}`);
|
|
251617
251619
|
}
|
|
251618
251620
|
let emitEntityEvent = () => {};
|
|
251619
251621
|
const entityRoutes = createEntityRoutes(db2, devLogger, remoteProxy, (...args) => emitEntityEvent(...args));
|
|
@@ -251709,10 +251711,10 @@ async function createDevServer(options8) {
|
|
|
251709
251711
|
}
|
|
251710
251712
|
|
|
251711
251713
|
// src/cli/commands/dev.ts
|
|
251712
|
-
async function devAction({ log }, options8) {
|
|
251714
|
+
async function devAction({ log: logger2 }, options8) {
|
|
251713
251715
|
const port = options8.port ? Number(options8.port) : undefined;
|
|
251714
251716
|
const { port: resolvedPort } = await createDevServer({
|
|
251715
|
-
|
|
251717
|
+
logger: logger2,
|
|
251716
251718
|
port,
|
|
251717
251719
|
denoWrapperPath: getDenoWrapperPath(),
|
|
251718
251720
|
loadResources: async () => {
|
|
@@ -251732,7 +251734,7 @@ function getDevCommand() {
|
|
|
251732
251734
|
import { resolve as resolve8 } from "node:path";
|
|
251733
251735
|
var import_kebabCase2 = __toESM(require_kebabCase(), 1);
|
|
251734
251736
|
async function eject(ctx, options8) {
|
|
251735
|
-
const { log, isNonInteractive } = ctx;
|
|
251737
|
+
const { log: logger2, isNonInteractive } = ctx;
|
|
251736
251738
|
if (isNonInteractive && !options8.projectId) {
|
|
251737
251739
|
throw new InvalidInputError("--project-id is required in non-interactive mode");
|
|
251738
251740
|
}
|
|
@@ -251754,7 +251756,7 @@ async function eject(ctx, options8) {
|
|
|
251754
251756
|
});
|
|
251755
251757
|
}
|
|
251756
251758
|
selectedProject = foundProject;
|
|
251757
|
-
|
|
251759
|
+
logger2.info(`Selected project: ${theme.styles.bold(selectedProject.name)}`);
|
|
251758
251760
|
} else {
|
|
251759
251761
|
if (ejectableProjects.length === 0) {
|
|
251760
251762
|
return { outroMessage: "No projects available to eject." };
|
|
@@ -256068,12 +256070,12 @@ async function runCLI(options8) {
|
|
|
256068
256070
|
const errorReporter = new ErrorReporter;
|
|
256069
256071
|
errorReporter.registerProcessErrorHandlers();
|
|
256070
256072
|
const isNonInteractive = !process.stdin.isTTY || !process.stdout.isTTY;
|
|
256071
|
-
const
|
|
256073
|
+
const logger3 = isNonInteractive ? new SimpleLogger : new ClackLogger;
|
|
256072
256074
|
const context = {
|
|
256073
256075
|
errorReporter,
|
|
256074
256076
|
isNonInteractive,
|
|
256075
256077
|
distribution: options8?.distribution ?? "npm",
|
|
256076
|
-
log
|
|
256078
|
+
log: logger3
|
|
256077
256079
|
};
|
|
256078
256080
|
const program2 = createProgram(context);
|
|
256079
256081
|
try {
|
|
@@ -256099,4 +256101,4 @@ export {
|
|
|
256099
256101
|
CLIExitError
|
|
256100
256102
|
};
|
|
256101
256103
|
|
|
256102
|
-
//# debugId=
|
|
256104
|
+
//# debugId=4B557C4731F0681C64756E2164756E21
|