@base44-preview/cli 0.0.56-pr.549.8becca0 → 0.0.56-pr.550.b83f0ca

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.
@@ -6,6 +6,8 @@
6
6
  "name": "<%= name %>"<% if (description) { %>,
7
7
  "description": "<%= description %>"<% } %>,
8
8
 
9
+ "visibility": "public",
10
+
9
11
  // Site/hosting configuration for the client application
10
12
  // Docs: https://docs.base44.com/configuration/hosting
11
13
  "site": {
@@ -4,7 +4,9 @@
4
4
 
5
5
  {
6
6
  "name": "<%= name %>"<% if (description) { %>,
7
- "description": "<%= description %>"<% } %>
7
+ "description": "<%= description %>"<% } %>,
8
+
9
+ "visibility": "public"
8
10
 
9
11
  // Site/hosting configuration
10
12
  // Docs: https://docs.base44.com/configuration/hosting
package/dist/cli/index.js CHANGED
@@ -233809,6 +233809,9 @@ class ApiError extends SystemError {
233809
233809
  }
233810
233810
  ];
233811
233811
  }
233812
+ if (statusCode && statusCode < 500) {
233813
+ return [];
233814
+ }
233812
233815
  return [{ message: "Check your network connection and try again" }];
233813
233816
  }
233814
233817
  static getReasonHints(parsedResponse) {
@@ -236012,11 +236015,13 @@ var PluginMetadataSchema = exports_external.object({
236012
236015
  var PluginReferenceSchema = exports_external.object({
236013
236016
  source: exports_external.string().min(1, "Plugin source cannot be empty")
236014
236017
  });
236018
+ var VISIBILITY_LEVELS = ["public", "private", "workspace"];
236015
236019
  var ProjectConfigSchema = exports_external.object({
236016
236020
  name: exports_external.string({
236017
236021
  error: "App name cannot be empty"
236018
236022
  }).min(1, "App name cannot be empty"),
236019
236023
  description: exports_external.string().optional(),
236024
+ visibility: exports_external.enum(VISIBILITY_LEVELS).optional(),
236020
236025
  site: SiteConfigSchema.optional(),
236021
236026
  entitiesDir: exports_external.string().optional().default("entities"),
236022
236027
  functionsDir: exports_external.string().optional().default("functions"),
@@ -241799,6 +241804,11 @@ var PublishedUrlResponseSchema = exports_external.object({
241799
241804
  });
241800
241805
 
241801
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
+ };
241802
241812
  async function createProject(projectName, description) {
241803
241813
  let response;
241804
241814
  try {
@@ -241807,7 +241817,7 @@ async function createProject(projectName, description) {
241807
241817
  name: projectName,
241808
241818
  user_description: description ?? `Backend for '${projectName}'`,
241809
241819
  is_managed_source_code: false,
241810
- public_settings: "public_without_login"
241820
+ public_settings: PUBLIC_SETTINGS.public
241811
241821
  }
241812
241822
  });
241813
241823
  } catch (error48) {
@@ -241821,6 +241831,18 @@ async function createProject(projectName, description) {
241821
241831
  projectId: result.data.id
241822
241832
  };
241823
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
+ }
241824
241846
  async function listProjects() {
241825
241847
  let response;
241826
241848
  try {
@@ -243426,7 +243448,7 @@ var ListFunctionsResponseSchema = exports_external.object({
243426
243448
  var LogLevelSchema = exports_external.enum(["info", "warning", "error", "debug"]);
243427
243449
  var FunctionLogEntrySchema = exports_external.object({
243428
243450
  time: exports_external.string(),
243429
- level: exports_external.preprocess((v) => v === "warn" ? "warning" : v, LogLevelSchema),
243451
+ level: LogLevelSchema,
243430
243452
  message: exports_external.string()
243431
243453
  });
243432
243454
  var FunctionLogsResponseSchema = exports_external.array(FunctionLogEntrySchema);
@@ -244175,10 +244197,12 @@ function hasResourcesToDeploy(projectData) {
244175
244197
  const hasAgents = agents.length > 0;
244176
244198
  const hasConnectors = connectors.length > 0;
244177
244199
  const hasAuthConfig = authConfig.length > 0;
244178
- return hasEntities || hasFunctions || hasAgents || hasConnectors || hasAuthConfig || hasSite;
244200
+ const hasVisibility = Boolean(project.visibility);
244201
+ return hasEntities || hasFunctions || hasAgents || hasConnectors || hasAuthConfig || hasVisibility || hasSite;
244179
244202
  }
244180
244203
  async function deployAll(projectData, options) {
244181
244204
  const { project, entities, functions, agents, connectors, authConfig } = projectData;
244205
+ await setAppVisibility(project.visibility);
244182
244206
  await entityResource.push(entities);
244183
244207
  await deployFunctionsSequentially(functions, {
244184
244208
  onStart: options?.onFunctionStart,
@@ -244194,6 +244218,14 @@ async function deployAll(projectData, options) {
244194
244218
  }
244195
244219
  return { connectorResults };
244196
244220
  }
244221
+ // src/core/project/visibility.ts
244222
+ async function writeVisibilityToConfig(configPath, visibility) {
244223
+ const text = await readTextFile(configPath);
244224
+ const existing = /("visibility"\s*:\s*")(?:public|private|workspace)(")/;
244225
+ const next = existing.test(text) ? text.replace(existing, `$1${visibility}$2`) : text.replace(/^[ \t]*\{/m, (brace) => `${brace}
244226
+ "visibility": "${visibility}",`);
244227
+ await writeFile(configPath, next);
244228
+ }
244197
244229
  // src/core/clients/base44-client.ts
244198
244230
  var retriedRequests = new WeakSet;
244199
244231
  async function captureRequestBody(request, options) {
@@ -253240,6 +253272,9 @@ async function deployAction({ isNonInteractive, log }, options = {}) {
253240
253272
  if (authConfig.length > 0) {
253241
253273
  summaryLines.push(" - Auth config");
253242
253274
  }
253275
+ if (project2.visibility) {
253276
+ summaryLines.push(` - Visibility: ${project2.visibility}`);
253277
+ }
253243
253278
  if (project2.site?.outputDirectory) {
253244
253279
  summaryLines.push(` - Site from ${project2.site.outputDirectory}`);
253245
253280
  }
@@ -253659,6 +253694,20 @@ Examples:
253659
253694
  $ base44 scaffold my-app --app-id app_123 Scaffolds the current dir, named "my-app"`).action(scaffoldAction);
253660
253695
  }
253661
253696
 
253697
+ // src/cli/commands/project/visibility.ts
253698
+ async function visibilityAction({ runTask: runTask2 }, level) {
253699
+ const { project: project2 } = await readProjectConfig();
253700
+ await runTask2("Updating local config", () => writeVisibilityToConfig(project2.configPath, level));
253701
+ return {
253702
+ outroMessage: `Visibility set to ${level} in local config. Run \`base44 deploy\` to apply.`
253703
+ };
253704
+ }
253705
+ function getVisibilityCommand() {
253706
+ return new Base44Command("visibility").description("Set app visibility (public, private, or workspace)").addArgument(new Argument("<level>", "Visibility level").choices([
253707
+ ...VISIBILITY_LEVELS
253708
+ ])).action(visibilityAction);
253709
+ }
253710
+
253662
253711
  // src/cli/commands/secrets/delete.ts
253663
253712
  async function deleteSecretAction({ runTask: runTask2 }, key) {
253664
253713
  await runTask2(`Deleting secret "${key}"`, async () => {
@@ -257720,6 +257769,7 @@ function createProgram(context) {
257720
257769
  program2.addCommand(getScaffoldCommand());
257721
257770
  program2.addCommand(getDashboardCommand());
257722
257771
  program2.addCommand(getDeployCommand2());
257772
+ program2.addCommand(getVisibilityCommand());
257723
257773
  program2.addCommand(getLinkCommand());
257724
257774
  program2.addCommand(getEjectCommand());
257725
257775
  program2.addCommand(getEntitiesPushCommand());
@@ -261978,4 +262028,4 @@ export {
261978
262028
  CLIExitError
261979
262029
  };
261980
262030
 
261981
- //# debugId=FA0D67C1B29AA28264756E2164756E21
262031
+ //# debugId=94516F32702CC42464756E2164756E21