@base44-preview/cli 0.0.49-pr.370.093ccc2 → 0.0.49-pr.441.dc5bedd

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 CHANGED
@@ -138434,11 +138434,11 @@ var require_normalizer = __commonJS((exports) => {
138434
138434
  (0, applySchemaTyping_1.applySchemaTyping)(schema10);
138435
138435
  }
138436
138436
  });
138437
- function normalize(rootSchema, dereferencedPaths, filename, options8) {
138437
+ function normalize2(rootSchema, dereferencedPaths, filename, options8) {
138438
138438
  rules.forEach((rule) => (0, utils_1.traverse)(rootSchema, (schema10, key2) => rule(schema10, filename, options8, key2, dereferencedPaths)));
138439
138439
  return rootSchema;
138440
138440
  }
138441
- exports.normalize = normalize;
138441
+ exports.normalize = normalize2;
138442
138442
  });
138443
138443
 
138444
138444
  // ../../node_modules/json-schema-to-typescript/dist/src/optimizer.js
@@ -157265,7 +157265,7 @@ var require_type_is = __commonJS((exports, module) => {
157265
157265
  module.exports = typeofrequest;
157266
157266
  module.exports.is = typeis;
157267
157267
  module.exports.hasBody = hasbody;
157268
- module.exports.normalize = normalize;
157268
+ module.exports.normalize = normalize2;
157269
157269
  module.exports.match = mimeMatch;
157270
157270
  function typeis(value, types_) {
157271
157271
  var i5;
@@ -157285,7 +157285,7 @@ var require_type_is = __commonJS((exports, module) => {
157285
157285
  }
157286
157286
  var type;
157287
157287
  for (i5 = 0;i5 < types.length; i5++) {
157288
- if (mimeMatch(normalize(type = types[i5]), val)) {
157288
+ if (mimeMatch(normalize2(type = types[i5]), val)) {
157289
157289
  return type[0] === "+" || type.indexOf("*") !== -1 ? val : type;
157290
157290
  }
157291
157291
  }
@@ -157301,7 +157301,7 @@ var require_type_is = __commonJS((exports, module) => {
157301
157301
  var value = req.headers["content-type"];
157302
157302
  return typeis(value, types);
157303
157303
  }
157304
- function normalize(type) {
157304
+ function normalize2(type) {
157305
157305
  if (typeof type !== "string") {
157306
157306
  return false;
157307
157307
  }
@@ -164165,7 +164165,7 @@ var require_send = __commonJS((exports, module) => {
164165
164165
  var util2 = __require("util");
164166
164166
  var extname2 = path18.extname;
164167
164167
  var join21 = path18.join;
164168
- var normalize = path18.normalize;
164168
+ var normalize2 = path18.normalize;
164169
164169
  var resolve6 = path18.resolve;
164170
164170
  var sep = path18.sep;
164171
164171
  var BYTES_RANGE_REGEXP = /^ *bytes=/;
@@ -164328,7 +164328,7 @@ var require_send = __commonJS((exports, module) => {
164328
164328
  var parts;
164329
164329
  if (root2 !== null) {
164330
164330
  if (path19) {
164331
- path19 = normalize("." + sep + path19);
164331
+ path19 = normalize2("." + sep + path19);
164332
164332
  }
164333
164333
  if (UP_PATH_REGEXP.test(path19)) {
164334
164334
  debug('malicious path "%s"', path19);
@@ -164336,14 +164336,14 @@ var require_send = __commonJS((exports, module) => {
164336
164336
  return res;
164337
164337
  }
164338
164338
  parts = path19.split(sep);
164339
- path19 = normalize(join21(root2, path19));
164339
+ path19 = normalize2(join21(root2, path19));
164340
164340
  } else {
164341
164341
  if (UP_PATH_REGEXP.test(path19)) {
164342
164342
  debug('malicious path "%s"', path19);
164343
164343
  this.error(403);
164344
164344
  return res;
164345
164345
  }
164346
- parts = normalize(path19).split(sep);
164346
+ parts = normalize2(path19).split(sep);
164347
164347
  path19 = resolve6(path19);
164348
164348
  }
164349
164349
  if (containsDotFile(parts)) {
@@ -210086,7 +210086,7 @@ var require_type_is2 = __commonJS((exports, module) => {
210086
210086
  module.exports = typeofrequest;
210087
210087
  module.exports.is = typeis;
210088
210088
  module.exports.hasBody = hasbody;
210089
- module.exports.normalize = normalize;
210089
+ module.exports.normalize = normalize2;
210090
210090
  module.exports.match = mimeMatch;
210091
210091
  function typeis(value, types_) {
210092
210092
  var i5;
@@ -210106,7 +210106,7 @@ var require_type_is2 = __commonJS((exports, module) => {
210106
210106
  }
210107
210107
  var type;
210108
210108
  for (i5 = 0;i5 < types.length; i5++) {
210109
- if (mimeMatch(normalize(type = types[i5]), val)) {
210109
+ if (mimeMatch(normalize2(type = types[i5]), val)) {
210110
210110
  return type[0] === "+" || type.indexOf("*") !== -1 ? val : type;
210111
210111
  }
210112
210112
  }
@@ -210129,7 +210129,7 @@ var require_type_is2 = __commonJS((exports, module) => {
210129
210129
  var value = req.headers["content-type"];
210130
210130
  return typeis(value, types);
210131
210131
  }
210132
- function normalize(type) {
210132
+ function normalize2(type) {
210133
210133
  if (typeof type !== "string") {
210134
210134
  return false;
210135
210135
  }
@@ -234565,15 +234565,11 @@ var SiteConfigSchema = exports_external.object({
234565
234565
  outputDirectory: exports_external.string().optional(),
234566
234566
  installCommand: exports_external.string().optional()
234567
234567
  });
234568
- var VisibilitySchema = exports_external.enum(["public", "private", "workspace"], {
234569
- error: 'Invalid visibility value. Allowed values: "public", "private", "workspace"'
234570
- });
234571
234568
  var ProjectConfigSchema = exports_external.object({
234572
234569
  name: exports_external.string({
234573
234570
  error: "App name cannot be empty"
234574
234571
  }).min(1, "App name cannot be empty"),
234575
234572
  description: exports_external.string().optional(),
234576
- visibility: VisibilitySchema.optional(),
234577
234573
  site: SiteConfigSchema.optional(),
234578
234574
  entitiesDir: exports_external.string().optional().default("entities"),
234579
234575
  functionsDir: exports_external.string().optional().default("functions"),
@@ -234687,6 +234683,21 @@ class UserError extends CLIError {
234687
234683
 
234688
234684
  class SystemError extends CLIError {
234689
234685
  }
234686
+ class AuthExpiredError extends UserError {
234687
+ code = "AUTH_EXPIRED";
234688
+ constructor(message = "Authentication has expired", options) {
234689
+ super(message, {
234690
+ hints: options?.hints ?? [
234691
+ {
234692
+ message: "Run 'base44 login' to re-authenticate",
234693
+ command: "base44 login"
234694
+ }
234695
+ ],
234696
+ cause: options?.cause
234697
+ });
234698
+ }
234699
+ }
234700
+
234690
234701
  class ConfigNotFoundError extends UserError {
234691
234702
  code = "CONFIG_NOT_FOUND";
234692
234703
  constructor(message = "No Base44 project found in this directory", options) {
@@ -241583,7 +241594,7 @@ async function fetchAgents() {
241583
241594
  return result.data;
241584
241595
  }
241585
241596
  // src/core/resources/agent/config.ts
241586
- import { join as join3 } from "node:path";
241597
+ import { join as join3, normalize } from "node:path";
241587
241598
  import { isDeepStrictEqual } from "node:util";
241588
241599
  async function readAgentFile(agentPath) {
241589
241600
  const raw2 = await readJsonFile(agentPath);
@@ -241653,7 +241664,7 @@ async function writeAgents(agentsDir, remoteAgents) {
241653
241664
  const claimedPaths = new Set;
241654
241665
  for (const [name2, entry] of nameToEntry) {
241655
241666
  if (newNames.has(name2)) {
241656
- claimedPaths.add(entry.filePath);
241667
+ claimedPaths.add(normalize(entry.filePath));
241657
241668
  }
241658
241669
  }
241659
241670
  const written = [];
@@ -241663,7 +241674,7 @@ async function writeAgents(agentsDir, remoteAgents) {
241663
241674
  continue;
241664
241675
  }
241665
241676
  const filePath = existing?.filePath ?? findAvailablePath(agentsDir, agent.name, claimedPaths);
241666
- claimedPaths.add(filePath);
241677
+ claimedPaths.add(normalize(filePath));
241667
241678
  await writeJsonFile(filePath, agent);
241668
241679
  written.push(agent.name);
241669
241680
  }
@@ -243069,7 +243080,7 @@ async function createProject(projectName, description) {
243069
243080
  name: projectName,
243070
243081
  user_description: description ?? `Backend for '${projectName}'`,
243071
243082
  is_managed_source_code: false,
243072
- public_settings: "private_with_login"
243083
+ public_settings: "public_without_login"
243073
243084
  }
243074
243085
  });
243075
243086
  } catch (error48) {
@@ -243083,23 +243094,6 @@ async function createProject(projectName, description) {
243083
243094
  projectId: result.data.id
243084
243095
  };
243085
243096
  }
243086
- var VISIBILITY_TO_PUBLIC_SETTINGS = {
243087
- public: "public_without_login",
243088
- private: "private_with_login",
243089
- workspace: "workspace_with_login"
243090
- };
243091
- async function updateProjectVisibility(visibility) {
243092
- const { id } = getAppConfig();
243093
- try {
243094
- await base44Client.put(`api/apps/${id}`, {
243095
- json: {
243096
- public_settings: VISIBILITY_TO_PUBLIC_SETTINGS[visibility]
243097
- }
243098
- });
243099
- } catch (error48) {
243100
- throw await ApiError.fromHttpError(error48, "updating project visibility");
243101
- }
243102
- }
243103
243097
  async function listProjects() {
243104
243098
  let response;
243105
243099
  try {
@@ -243433,9 +243427,6 @@ async function deployAll(projectData, options) {
243433
243427
  await agentResource.push(agents);
243434
243428
  await authConfigResource.push(authConfig);
243435
243429
  const { results: connectorResults } = await pushConnectors(connectors);
243436
- if (project.visibility) {
243437
- await updateProjectVisibility(project.visibility);
243438
- }
243439
243430
  if (project.site?.outputDirectory) {
243440
243431
  const outputDir = resolve(project.root, project.site.outputDirectory);
243441
243432
  const { appUrl } = await deploySite(outputDir);
@@ -243621,7 +243612,7 @@ async function getUserInfo(accessToken) {
243621
243612
  return result.data;
243622
243613
  }
243623
243614
  // src/cli/commands/auth/login-flow.ts
243624
- async function generateAndDisplayDeviceCode(log) {
243615
+ async function generateAndDisplayDeviceCode(log, runTask) {
243625
243616
  const deviceCodeResponse = await runTask("Generating device code...", async () => {
243626
243617
  return await generateDeviceCode();
243627
243618
  }, {
@@ -243632,7 +243623,7 @@ async function generateAndDisplayDeviceCode(log) {
243632
243623
  Please confirm this code at: ${deviceCodeResponse.verificationUri}`);
243633
243624
  return deviceCodeResponse;
243634
243625
  }
243635
- async function waitForAuthentication(deviceCode, expiresIn, interval) {
243626
+ async function waitForAuthentication(deviceCode, expiresIn, interval, runTask) {
243636
243627
  let tokenResponse;
243637
243628
  try {
243638
243629
  await runTask("Waiting for authentication...", async () => {
@@ -243653,12 +243644,12 @@ async function waitForAuthentication(deviceCode, expiresIn, interval) {
243653
243644
  });
243654
243645
  } catch (error48) {
243655
243646
  if (error48 instanceof Error && error48.message.includes("timed out")) {
243656
- throw new Error("Authentication timed out. Please try again.");
243647
+ throw new AuthExpiredError("Authentication timed out. Please try again.");
243657
243648
  }
243658
243649
  throw error48;
243659
243650
  }
243660
243651
  if (tokenResponse === undefined) {
243661
- throw new Error("Failed to retrieve authentication token.");
243652
+ throw new InternalError("Failed to retrieve authentication token.");
243662
243653
  }
243663
243654
  return tokenResponse;
243664
243655
  }
@@ -243672,9 +243663,12 @@ async function saveAuthData(response, userInfo) {
243672
243663
  name: userInfo.name
243673
243664
  });
243674
243665
  }
243675
- async function login({ log }) {
243676
- const deviceCodeResponse = await generateAndDisplayDeviceCode(log);
243677
- const token = await waitForAuthentication(deviceCodeResponse.deviceCode, deviceCodeResponse.expiresIn, deviceCodeResponse.interval);
243666
+ async function login({
243667
+ log,
243668
+ runTask
243669
+ }) {
243670
+ const deviceCodeResponse = await generateAndDisplayDeviceCode(log, runTask);
243671
+ const token = await waitForAuthentication(deviceCodeResponse.deviceCode, deviceCodeResponse.expiresIn, deviceCodeResponse.interval, runTask);
243678
243672
  const userInfo = await getUserInfo(token.accessToken);
243679
243673
  await saveAuthData(token, userInfo);
243680
243674
  return {
@@ -250407,20 +250401,6 @@ var onPromptCancel = () => {
250407
250401
  Ne("Operation cancelled.");
250408
250402
  throw new CLIExitError(0);
250409
250403
  };
250410
- // src/cli/utils/runTask.ts
250411
- async function runTask(startMessage, operation, options) {
250412
- const s = bt2();
250413
- s.start(startMessage);
250414
- const updateMessage = (message) => s.message(message);
250415
- try {
250416
- const result = await operation(updateMessage);
250417
- s.stop(options?.successMessage || startMessage);
250418
- return result;
250419
- } catch (error48) {
250420
- s.error(options?.errorMessage || "Failed");
250421
- throw error48;
250422
- }
250423
- }
250424
250404
  // src/cli/utils/urls.ts
250425
250405
  function getDashboardUrl(projectId) {
250426
250406
  const id = projectId ?? getAppConfig().id;
@@ -250573,7 +250553,8 @@ async function parseEnvFile(filePath) {
250573
250553
  }
250574
250554
  // src/cli/commands/agents/pull.ts
250575
250555
  async function pullAgentsAction({
250576
- log
250556
+ log,
250557
+ runTask
250577
250558
  }) {
250578
250559
  const { project: project2 } = await readProjectConfig();
250579
250560
  const configDir = dirname7(project2.configPath);
@@ -250609,7 +250590,8 @@ function getAgentsPullCommand() {
250609
250590
 
250610
250591
  // src/cli/commands/agents/push.ts
250611
250592
  async function pushAgentsAction({
250612
- log
250593
+ log,
250594
+ runTask
250613
250595
  }) {
250614
250596
  const { agents } = await readProjectConfig();
250615
250597
  log.info(agents.length === 0 ? "No local agents found - this will delete all remote agents" : `Found ${agents.length} agents to push`);
@@ -250657,7 +250639,7 @@ function validateAction(action) {
250657
250639
  });
250658
250640
  }
250659
250641
  }
250660
- async function passwordLoginAction({ log }, action) {
250642
+ async function passwordLoginAction({ log, runTask }, action) {
250661
250643
  validateAction(action);
250662
250644
  const shouldEnable = action === "enable";
250663
250645
  const { project: project2 } = await readProjectConfig();
@@ -250683,7 +250665,10 @@ function getPasswordLoginCommand() {
250683
250665
 
250684
250666
  // src/cli/commands/auth/pull.ts
250685
250667
  import { dirname as dirname9, join as join14 } from "node:path";
250686
- async function pullAuthAction({ log }) {
250668
+ async function pullAuthAction({
250669
+ log,
250670
+ runTask
250671
+ }) {
250687
250672
  const { project: project2 } = await readProjectConfig();
250688
250673
  const configDir = dirname9(project2.configPath);
250689
250674
  const authDir = join14(configDir, project2.authDir);
@@ -250713,7 +250698,7 @@ function getAuthPullCommand() {
250713
250698
  }
250714
250699
 
250715
250700
  // src/cli/commands/auth/push.ts
250716
- async function pushAuthAction({ isNonInteractive, log }, options) {
250701
+ async function pushAuthAction({ isNonInteractive, log, runTask }, options) {
250717
250702
  const { authConfig } = await readProjectConfig();
250718
250703
  if (authConfig.length === 0) {
250719
250704
  log.info("No local auth config found");
@@ -250785,7 +250770,8 @@ function getWhoamiCommand() {
250785
250770
 
250786
250771
  // src/cli/commands/connectors/list-available.ts
250787
250772
  async function listAvailableAction({
250788
- log
250773
+ log,
250774
+ runTask
250789
250775
  }) {
250790
250776
  const { integrations } = await runTask("Fetching available integrations from Base44", async () => {
250791
250777
  return await listAvailableIntegrations();
@@ -250814,7 +250800,8 @@ function getConnectorsListAvailableCommand() {
250814
250800
  // src/cli/commands/connectors/pull.ts
250815
250801
  import { dirname as dirname10, join as join15 } from "node:path";
250816
250802
  async function pullConnectorsAction({
250817
- log
250803
+ log,
250804
+ runTask
250818
250805
  }) {
250819
250806
  const { project: project2 } = await readProjectConfig();
250820
250807
  const configDir = dirname10(project2.configPath);
@@ -251603,7 +251590,8 @@ function printSummary(results, oauthOutcomes, log) {
251603
251590
  }
251604
251591
  async function pushConnectorsAction({
251605
251592
  isNonInteractive,
251606
- log
251593
+ log,
251594
+ runTask
251607
251595
  }) {
251608
251596
  const { connectors } = await readProjectConfig();
251609
251597
  if (connectors.length === 0) {
@@ -251657,7 +251645,8 @@ function getDashboardCommand() {
251657
251645
 
251658
251646
  // src/cli/commands/entities/push.ts
251659
251647
  async function pushEntitiesAction({
251660
- log
251648
+ log,
251649
+ runTask
251661
251650
  }) {
251662
251651
  const { entities } = await readProjectConfig();
251663
251652
  if (entities.length === 0) {
@@ -251687,7 +251676,7 @@ function getEntitiesPushCommand() {
251687
251676
  }
251688
251677
 
251689
251678
  // src/cli/commands/functions/delete.ts
251690
- async function deleteFunctionsAction(_ctx, names) {
251679
+ async function deleteFunctionsAction({ runTask }, names) {
251691
251680
  let deleted = 0;
251692
251681
  let notFound = 0;
251693
251682
  let errors5 = 0;
@@ -251850,7 +251839,8 @@ function getDeployCommand() {
251850
251839
 
251851
251840
  // src/cli/commands/functions/list.ts
251852
251841
  async function listFunctionsAction({
251853
- log
251842
+ log,
251843
+ runTask
251854
251844
  }) {
251855
251845
  const { functions } = await runTask("Fetching functions...", async () => listDeployedFunctions(), { errorMessage: "Failed to fetch functions" });
251856
251846
  if (functions.length === 0) {
@@ -251871,7 +251861,7 @@ function getListCommand() {
251871
251861
 
251872
251862
  // src/cli/commands/functions/pull.ts
251873
251863
  import { dirname as dirname11, join as join16 } from "node:path";
251874
- async function pullFunctionsAction({ log }, name2) {
251864
+ async function pullFunctionsAction({ log, runTask }, name2) {
251875
251865
  const { project: project2 } = await readProjectConfig();
251876
251866
  const configDir = dirname11(project2.configPath);
251877
251867
  const functionsDir = join16(configDir, project2.functionsDir);
@@ -251937,7 +251927,7 @@ function validateNonInteractiveFlags(command2) {
251937
251927
  command2.error("--path requires a project name argument. Usage: base44 create <name> --path <path>");
251938
251928
  }
251939
251929
  }
251940
- async function createInteractive(options, log) {
251930
+ async function createInteractive(options, ctx) {
251941
251931
  const templates = await listTemplates();
251942
251932
  const templateOptions = templates.map((t) => ({
251943
251933
  value: t,
@@ -251979,10 +251969,10 @@ async function createInteractive(options, log) {
251979
251969
  deploy: options.deploy,
251980
251970
  skills: options.skills,
251981
251971
  isInteractive: true
251982
- }, log);
251972
+ }, ctx);
251983
251973
  }
251984
- async function createNonInteractive(options, log) {
251985
- log.info(`Creating a new project at ${resolve2(options.path)}`);
251974
+ async function createNonInteractive(options, ctx) {
251975
+ ctx.log.info(`Creating a new project at ${resolve2(options.path)}`);
251986
251976
  const template2 = await getTemplateById(options.template ?? DEFAULT_TEMPLATE_ID);
251987
251977
  return await executeCreate({
251988
251978
  template: template2,
@@ -251991,7 +251981,7 @@ async function createNonInteractive(options, log) {
251991
251981
  deploy: options.deploy,
251992
251982
  skills: options.skills,
251993
251983
  isInteractive: false
251994
- }, log);
251984
+ }, ctx);
251995
251985
  }
251996
251986
  async function executeCreate({
251997
251987
  template: template2,
@@ -252001,7 +251991,7 @@ async function executeCreate({
252001
251991
  deploy: deploy5,
252002
251992
  skills,
252003
251993
  isInteractive
252004
- }, log) {
251994
+ }, { log, runTask }) {
252005
251995
  const name2 = rawName.trim();
252006
251996
  const resolvedPath = resolve2(projectPath);
252007
251997
  const { projectId } = await runTask("Setting up your project...", async () => {
@@ -252083,7 +252073,7 @@ async function executeCreate({
252083
252073
  }
252084
252074
  return { outroMessage: "Your project is set up and ready to use" };
252085
252075
  }
252086
- async function createAction({ log, isNonInteractive }, name2, options) {
252076
+ async function createAction({ log, runTask, isNonInteractive }, name2, options) {
252087
252077
  if (name2 && !options.path) {
252088
252078
  options.path = `./${import_kebabCase.default(name2)}`;
252089
252079
  }
@@ -252097,10 +252087,11 @@ async function createAction({ log, isNonInteractive }, name2, options) {
252097
252087
  ]
252098
252088
  });
252099
252089
  }
252090
+ const ctx = { log, runTask };
252100
252091
  if (skipPrompts) {
252101
- return await createNonInteractive({ name: options.name ?? name2, ...options }, log);
252092
+ return await createNonInteractive({ name: options.name ?? name2, ...options }, ctx);
252102
252093
  }
252103
- return await createInteractive({ name: name2, ...options }, log);
252094
+ return await createInteractive({ name: name2, ...options }, ctx);
252104
252095
  }
252105
252096
  function getCreateCommand() {
252106
252097
  return new Base44Command("create", {
@@ -252280,7 +252271,7 @@ async function promptForExistingProject(linkableProjects) {
252280
252271
  return selectedProject;
252281
252272
  }
252282
252273
  async function link(ctx, options) {
252283
- const { log, isNonInteractive } = ctx;
252274
+ const { log, runTask, isNonInteractive } = ctx;
252284
252275
  const skipPrompts = !!options.create || !!options.projectId;
252285
252276
  if (!skipPrompts && isNonInteractive) {
252286
252277
  throw new InvalidInputError("--create with --name, or --projectId, is required in non-interactive mode");
@@ -252476,7 +252467,7 @@ function getLogsCommand() {
252476
252467
  }
252477
252468
 
252478
252469
  // src/cli/commands/secrets/delete.ts
252479
- async function deleteSecretAction(_ctx, key) {
252470
+ async function deleteSecretAction({ runTask }, key) {
252480
252471
  await runTask(`Deleting secret "${key}"`, async () => {
252481
252472
  return await deleteSecret(key);
252482
252473
  }, {
@@ -252493,7 +252484,8 @@ function getSecretsDeleteCommand() {
252493
252484
 
252494
252485
  // src/cli/commands/secrets/list.ts
252495
252486
  async function listSecretsAction({
252496
- log
252487
+ log,
252488
+ runTask
252497
252489
  }) {
252498
252490
  const secrets = await runTask("Fetching secrets from Base44", async () => {
252499
252491
  return await listSecrets();
@@ -252544,7 +252536,7 @@ function validateInput(entries, options) {
252544
252536
  throw new InvalidInputError("Provide KEY=VALUE pairs or --env-file, but not both.");
252545
252537
  }
252546
252538
  }
252547
- async function setSecretsAction({ log }, entries, options) {
252539
+ async function setSecretsAction({ log, runTask }, entries, options) {
252548
252540
  validateInput(entries, options);
252549
252541
  let secrets;
252550
252542
  if (options.envFile) {
@@ -252578,7 +252570,7 @@ function getSecretsCommand() {
252578
252570
 
252579
252571
  // src/cli/commands/site/deploy.ts
252580
252572
  import { resolve as resolve4 } from "node:path";
252581
- async function deployAction2({ isNonInteractive }, options) {
252573
+ async function deployAction2({ isNonInteractive, runTask }, options) {
252582
252574
  if (isNonInteractive && !options.yes) {
252583
252575
  throw new InvalidInputError("--yes is required in non-interactive mode");
252584
252576
  }
@@ -252742,7 +252734,9 @@ async function updateProjectConfig(projectRoot) {
252742
252734
  }
252743
252735
  // src/cli/commands/types/generate.ts
252744
252736
  var TYPES_FILE_PATH = "base44/.types/types.d.ts";
252745
- async function generateTypesAction(_ctx) {
252737
+ async function generateTypesAction({
252738
+ runTask
252739
+ }) {
252746
252740
  const { entities, functions, agents, connectors, project: project2 } = await readProjectConfig();
252747
252741
  await runTask("Generating types", async () => {
252748
252742
  await generateTypesFile({ entities, functions, agents, connectors });
@@ -255782,7 +255776,7 @@ Examples:
255782
255776
  import { resolve as resolve8 } from "node:path";
255783
255777
  var import_kebabCase2 = __toESM(require_kebabCase(), 1);
255784
255778
  async function eject(ctx, options8) {
255785
- const { log, isNonInteractive } = ctx;
255779
+ const { log, runTask, isNonInteractive } = ctx;
255786
255780
  if (isNonInteractive && !options8.projectId) {
255787
255781
  throw new InvalidInputError("--project-id is required in non-interactive mode");
255788
255782
  }
@@ -260113,6 +260107,37 @@ function addCommandInfoToErrorReporter(program2, errorReporter) {
260113
260107
  });
260114
260108
  });
260115
260109
  }
260110
+ // src/cli/utils/runTask.ts
260111
+ function createInteractiveRunTask() {
260112
+ return async (startMessage, operation, options8) => {
260113
+ const s5 = bt2();
260114
+ s5.start(startMessage);
260115
+ const updateMessage = (message) => s5.message(message);
260116
+ try {
260117
+ const result = await operation(updateMessage);
260118
+ s5.stop(options8?.successMessage || startMessage);
260119
+ return result;
260120
+ } catch (error48) {
260121
+ s5.error(options8?.errorMessage || "Failed");
260122
+ throw error48;
260123
+ }
260124
+ };
260125
+ }
260126
+ function createSimpleRunTask(log) {
260127
+ return async (startMessage, operation, options8) => {
260128
+ log.info(startMessage);
260129
+ const updateMessage = (message) => log.info(message);
260130
+ try {
260131
+ const result = await operation(updateMessage);
260132
+ log.success(options8?.successMessage || startMessage);
260133
+ return result;
260134
+ } catch (error48) {
260135
+ log.error(options8?.errorMessage || "Failed");
260136
+ throw error48;
260137
+ }
260138
+ };
260139
+ }
260140
+
260116
260141
  // src/cli/index.ts
260117
260142
  var __dirname4 = dirname18(fileURLToPath6(import.meta.url));
260118
260143
  async function runCLI(options8) {
@@ -260121,11 +260146,13 @@ async function runCLI(options8) {
260121
260146
  errorReporter.registerProcessErrorHandlers();
260122
260147
  const isNonInteractive = !process.stdin.isTTY || !process.stdout.isTTY;
260123
260148
  const log = isNonInteractive ? new SimpleLogger : new ClackLogger;
260149
+ const runTask = isNonInteractive ? createSimpleRunTask(log) : createInteractiveRunTask();
260124
260150
  const context = {
260125
260151
  errorReporter,
260126
260152
  isNonInteractive,
260127
260153
  distribution: options8?.distribution ?? "npm",
260128
- log
260154
+ log,
260155
+ runTask
260129
260156
  };
260130
260157
  const program2 = createProgram(context);
260131
260158
  try {
@@ -260151,4 +260178,4 @@ export {
260151
260178
  CLIExitError
260152
260179
  };
260153
260180
 
260154
- //# debugId=7ACE5F88D7EDD98A64756E2164756E21
260181
+ //# debugId=823E14BF12CB32BE64756E2164756E21