@base44-preview/cli 0.0.56-pr.550.7e7ee9d → 0.0.56-pr.550.ab88218
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 +20 -44
- package/dist/cli/index.js.map +7 -9
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -241804,6 +241804,11 @@ var PublishedUrlResponseSchema = exports_external.object({
|
|
|
241804
241804
|
});
|
|
241805
241805
|
|
|
241806
241806
|
// src/core/project/api.ts
|
|
241807
|
+
var PUBLIC_SETTINGS = {
|
|
241808
|
+
public: "public_without_login",
|
|
241809
|
+
private: "private_with_login",
|
|
241810
|
+
workspace: "workspace_with_login"
|
|
241811
|
+
};
|
|
241807
241812
|
async function createProject(projectName, description) {
|
|
241808
241813
|
let response;
|
|
241809
241814
|
try {
|
|
@@ -241812,7 +241817,7 @@ async function createProject(projectName, description) {
|
|
|
241812
241817
|
name: projectName,
|
|
241813
241818
|
user_description: description ?? `Backend for '${projectName}'`,
|
|
241814
241819
|
is_managed_source_code: false,
|
|
241815
|
-
public_settings:
|
|
241820
|
+
public_settings: PUBLIC_SETTINGS.public
|
|
241816
241821
|
}
|
|
241817
241822
|
});
|
|
241818
241823
|
} catch (error48) {
|
|
@@ -241826,6 +241831,18 @@ async function createProject(projectName, description) {
|
|
|
241826
241831
|
projectId: result.data.id
|
|
241827
241832
|
};
|
|
241828
241833
|
}
|
|
241834
|
+
async function setAppVisibility(visibility) {
|
|
241835
|
+
if (!visibility)
|
|
241836
|
+
return;
|
|
241837
|
+
const { id } = getAppContext();
|
|
241838
|
+
try {
|
|
241839
|
+
await base44Client.put(`api/apps/${id}`, {
|
|
241840
|
+
json: { public_settings: PUBLIC_SETTINGS[visibility] }
|
|
241841
|
+
});
|
|
241842
|
+
} catch (error48) {
|
|
241843
|
+
throw await ApiError.fromHttpError(error48, "updating app visibility");
|
|
241844
|
+
}
|
|
241845
|
+
}
|
|
241829
241846
|
async function listProjects() {
|
|
241830
241847
|
let response;
|
|
241831
241848
|
try {
|
|
@@ -244106,30 +244123,6 @@ async function createProjectFilesForExistingProject(options) {
|
|
|
244106
244123
|
// src/core/project/deploy.ts
|
|
244107
244124
|
import { resolve as resolve2 } from "node:path";
|
|
244108
244125
|
|
|
244109
|
-
// src/core/project/visibility.ts
|
|
244110
|
-
var PUBLIC_SETTINGS = {
|
|
244111
|
-
public: "public_without_login",
|
|
244112
|
-
private: "private_with_login",
|
|
244113
|
-
workspace: "workspace_with_login"
|
|
244114
|
-
};
|
|
244115
|
-
async function setAppVisibility(visibility) {
|
|
244116
|
-
const { id } = getAppContext();
|
|
244117
|
-
try {
|
|
244118
|
-
await base44Client.put(`api/apps/${id}`, {
|
|
244119
|
-
json: { public_settings: PUBLIC_SETTINGS[visibility] }
|
|
244120
|
-
});
|
|
244121
|
-
} catch (error48) {
|
|
244122
|
-
throw await ApiError.fromHttpError(error48, "updating app visibility");
|
|
244123
|
-
}
|
|
244124
|
-
}
|
|
244125
|
-
async function writeVisibilityToConfig(configPath, visibility) {
|
|
244126
|
-
const text = await readTextFile(configPath);
|
|
244127
|
-
const existing = /("visibility"\s*:\s*")(?:public|private|workspace)(")/;
|
|
244128
|
-
const next = existing.test(text) ? text.replace(existing, `$1${visibility}$2`) : text.replace("{", `{
|
|
244129
|
-
"visibility": "${visibility}",`);
|
|
244130
|
-
await writeFile(configPath, next);
|
|
244131
|
-
}
|
|
244132
|
-
|
|
244133
244126
|
// src/core/site/api.ts
|
|
244134
244127
|
async function uploadSite(archivePath) {
|
|
244135
244128
|
const archiveBuffer = await readFile(archivePath);
|
|
@@ -244209,9 +244202,7 @@ function hasResourcesToDeploy(projectData) {
|
|
|
244209
244202
|
}
|
|
244210
244203
|
async function deployAll(projectData, options) {
|
|
244211
244204
|
const { project, entities, functions, agents, connectors, authConfig } = projectData;
|
|
244212
|
-
|
|
244213
|
-
await setAppVisibility(project.visibility);
|
|
244214
|
-
}
|
|
244205
|
+
await setAppVisibility(project.visibility);
|
|
244215
244206
|
await entityResource.push(entities);
|
|
244216
244207
|
await deployFunctionsSequentially(functions, {
|
|
244217
244208
|
onStart: options?.onFunctionStart,
|
|
@@ -253695,20 +253686,6 @@ Examples:
|
|
|
253695
253686
|
$ base44 scaffold my-app --app-id app_123 Scaffolds the current dir, named "my-app"`).action(scaffoldAction);
|
|
253696
253687
|
}
|
|
253697
253688
|
|
|
253698
|
-
// src/cli/commands/project/visibility.ts
|
|
253699
|
-
async function visibilityAction({ runTask: runTask2 }, level) {
|
|
253700
|
-
const { project: project2 } = await readProjectConfig();
|
|
253701
|
-
await runTask2("Updating local config", () => writeVisibilityToConfig(project2.configPath, level));
|
|
253702
|
-
return {
|
|
253703
|
-
outroMessage: `Visibility set to ${level} in local config. Run \`base44 deploy\` to apply.`
|
|
253704
|
-
};
|
|
253705
|
-
}
|
|
253706
|
-
function getVisibilityCommand() {
|
|
253707
|
-
return new Base44Command("visibility").description("Set app visibility (public, private, or workspace)").addArgument(new Argument("<level>", "Visibility level").choices([
|
|
253708
|
-
...VISIBILITY_LEVELS
|
|
253709
|
-
])).action(visibilityAction);
|
|
253710
|
-
}
|
|
253711
|
-
|
|
253712
253689
|
// src/cli/commands/secrets/delete.ts
|
|
253713
253690
|
async function deleteSecretAction({ runTask: runTask2 }, key) {
|
|
253714
253691
|
await runTask2(`Deleting secret "${key}"`, async () => {
|
|
@@ -257770,7 +257747,6 @@ function createProgram(context) {
|
|
|
257770
257747
|
program2.addCommand(getScaffoldCommand());
|
|
257771
257748
|
program2.addCommand(getDashboardCommand());
|
|
257772
257749
|
program2.addCommand(getDeployCommand2());
|
|
257773
|
-
program2.addCommand(getVisibilityCommand());
|
|
257774
257750
|
program2.addCommand(getLinkCommand());
|
|
257775
257751
|
program2.addCommand(getEjectCommand());
|
|
257776
257752
|
program2.addCommand(getEntitiesPushCommand());
|
|
@@ -262029,4 +262005,4 @@ export {
|
|
|
262029
262005
|
CLIExitError
|
|
262030
262006
|
};
|
|
262031
262007
|
|
|
262032
|
-
//# debugId=
|
|
262008
|
+
//# debugId=BD5686AFC654F7C164756E2164756E21
|