@base44-preview/cli 0.0.3-pr.28.837cbfa → 0.0.3-pr.28.9b60b50

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.
Files changed (2) hide show
  1. package/dist/cli/index.js +15 -8
  2. package/package.json +1 -1
package/dist/cli/index.js CHANGED
@@ -18579,12 +18579,20 @@ const base44Color = source_default.bgHex("#E86B3C");
18579
18579
  * .action(async () => {
18580
18580
  * await runCommand(myAction);
18581
18581
  * });
18582
+ *
18583
+ * @example
18584
+ * // Command requiring authentication
18585
+ * export const myCommand = new Command("my-command")
18586
+ * .action(async () => {
18587
+ * await runCommand(myAction, { requireAuth: true });
18588
+ * });
18582
18589
  */
18583
18590
  async function runCommand(commandFn, options) {
18584
18591
  if (options?.fullBanner) printBanner();
18585
18592
  else Ie(base44Color(" Base 44 "));
18586
18593
  await loadProjectEnv();
18587
18594
  try {
18595
+ if (options?.requireAuth) await requireAuth();
18588
18596
  await commandFn();
18589
18597
  } catch (e$1) {
18590
18598
  if (e$1 instanceof Error) M.error(e$1.stack ?? e$1.message);
@@ -18703,23 +18711,21 @@ const loginCommand = new Command("login").description("Authenticate with Base44"
18703
18711
  //#endregion
18704
18712
  //#region src/cli/commands/auth/whoami.ts
18705
18713
  async function whoami() {
18706
- await requireAuth();
18707
18714
  const auth = await readAuth();
18708
18715
  M.info(`Logged in as: ${auth.name} (${auth.email})`);
18709
18716
  }
18710
18717
  const whoamiCommand = new Command("whoami").description("Display current authenticated user").action(async () => {
18711
- await runCommand(whoami);
18718
+ await runCommand(whoami, { requireAuth: true });
18712
18719
  });
18713
18720
 
18714
18721
  //#endregion
18715
18722
  //#region src/cli/commands/auth/logout.ts
18716
18723
  async function logout() {
18717
- await requireAuth();
18718
18724
  await deleteAuth();
18719
18725
  M.info("Logged out successfully");
18720
18726
  }
18721
18727
  const logoutCommand = new Command("logout").description("Logout from current device").action(async () => {
18722
- await runCommand(logout);
18728
+ await runCommand(logout, { requireAuth: true });
18723
18729
  });
18724
18730
 
18725
18731
  //#endregion
@@ -18741,7 +18747,6 @@ const showProjectCommand = new Command("show-project").description("Display proj
18741
18747
  //#endregion
18742
18748
  //#region src/cli/commands/entities/push.ts
18743
18749
  async function pushEntitiesAction() {
18744
- await requireAuth();
18745
18750
  const { entities } = await readProjectConfig();
18746
18751
  if (entities.length === 0) {
18747
18752
  M.warn("No entities found in project");
@@ -18760,7 +18765,7 @@ async function pushEntitiesAction() {
18760
18765
  if (result.created.length === 0 && result.updated.length === 0 && result.deleted.length === 0) M.info("No changes detected");
18761
18766
  }
18762
18767
  const entitiesPushCommand = new Command("entities").description("Manage project entities").addCommand(new Command("push").description("Push local entities to Base44").action(async () => {
18763
- await runCommand(pushEntitiesAction);
18768
+ await runCommand(pushEntitiesAction, { requireAuth: true });
18764
18769
  }));
18765
18770
 
18766
18771
  //#endregion
@@ -19275,7 +19280,6 @@ var require_lodash = /* @__PURE__ */ __commonJSMin(((exports, module) => {
19275
19280
  //#region src/cli/commands/project/create.ts
19276
19281
  var import_lodash = /* @__PURE__ */ __toESM(require_lodash(), 1);
19277
19282
  async function create() {
19278
- await requireAuth();
19279
19283
  const templateOptions = (await listTemplates()).map((t) => ({
19280
19284
  value: t,
19281
19285
  label: t.name,
@@ -19322,7 +19326,10 @@ async function create() {
19322
19326
  M.success(`Dashboard link:\n${source_default.bold(`${getBase44ApiUrl()}/apps/${projectId}/editor/preview`)}`);
19323
19327
  }
19324
19328
  const createCommand = new Command("create").description("Create a new Base44 project").action(async () => {
19325
- await runCommand(create, { fullBanner: true });
19329
+ await runCommand(create, {
19330
+ fullBanner: true,
19331
+ requireAuth: true
19332
+ });
19326
19333
  });
19327
19334
 
19328
19335
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base44-preview/cli",
3
- "version": "0.0.3-pr.28.837cbfa",
3
+ "version": "0.0.3-pr.28.9b60b50",
4
4
  "description": "Base44 CLI - Unified interface for managing Base44 applications",
5
5
  "type": "module",
6
6
  "main": "./dist/cli/index.js",