@base44-preview/cli 0.0.32-pr.252.7bf9ea3 → 0.0.32-pr.253.9725863

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
@@ -185349,7 +185349,7 @@ var FieldConditionSchema = exports_external.union([
185349
185349
  exports_external.number(),
185350
185350
  exports_external.boolean(),
185351
185351
  exports_external.null(),
185352
- exports_external.object({
185352
+ exports_external.looseObject({
185353
185353
  $in: exports_external.unknown().optional(),
185354
185354
  $nin: exports_external.unknown().optional(),
185355
185355
  $ne: exports_external.unknown().optional(),
@@ -185403,24 +185403,16 @@ var isValidFieldCondition = (value) => {
185403
185403
  }
185404
185404
  return false;
185405
185405
  };
185406
- var RefineRLSConditionSchema = RLSConditionSchema.refine((val) => Object.entries(val).every(([key, value]) => {
185407
- if (rlsConditionAllowedKeys.has(key)) {
185408
- return true;
185409
- }
185410
- if (key.startsWith("data.")) {
185411
- return isValidFieldCondition(value);
185412
- }
185413
- return isValidFieldCondition(value);
185414
- }), "Keys must be known RLS keys or match data.* pattern with valid value");
185406
+ var RefineRLSConditionSchema = RLSConditionSchema.refine((val) => Object.entries(val).every(([key, value]) => rlsConditionAllowedKeys.has(key) || isValidFieldCondition(value)), "Field condition values must be a primitive or an operator object ($in, $nin, $ne, $all)");
185415
185407
  var RLSRuleSchema = exports_external.union([exports_external.boolean(), RefineRLSConditionSchema]);
185416
- var EntityRLSSchema = exports_external.strictObject({
185408
+ var EntityRLSSchema = exports_external.looseObject({
185417
185409
  create: RLSRuleSchema.optional(),
185418
185410
  read: RLSRuleSchema.optional(),
185419
185411
  update: RLSRuleSchema.optional(),
185420
185412
  delete: RLSRuleSchema.optional(),
185421
185413
  write: RLSRuleSchema.optional()
185422
185414
  });
185423
- var FieldRLSSchema = exports_external.strictObject({
185415
+ var FieldRLSSchema = exports_external.looseObject({
185424
185416
  read: RLSRuleSchema.optional(),
185425
185417
  write: RLSRuleSchema.optional(),
185426
185418
  create: RLSRuleSchema.optional(),
@@ -185428,7 +185420,7 @@ var FieldRLSSchema = exports_external.strictObject({
185428
185420
  delete: RLSRuleSchema.optional()
185429
185421
  });
185430
185422
  var PropertyDefinitionSchema = exports_external.looseObject({
185431
- type: exports_external.string(),
185423
+ type: exports_external.string().optional(),
185432
185424
  title: exports_external.string().optional(),
185433
185425
  description: exports_external.string().optional(),
185434
185426
  minLength: exports_external.number().int().min(0).optional(),
@@ -185452,7 +185444,7 @@ var PropertyDefinitionSchema = exports_external.looseObject({
185452
185444
  });
185453
185445
  var EntitySchema = exports_external.looseObject({
185454
185446
  type: exports_external.literal("object").default("object"),
185455
- name: exports_external.string().min(1).regex(/^[a-zA-Z0-9_-]+$/, "Entity name must contain only letters, digits, underscores, or hyphens"),
185447
+ name: exports_external.string().min(1).regex(/^[a-zA-Z0-9]+$/, "Entity name must be alphanumeric only"),
185456
185448
  title: exports_external.string().optional(),
185457
185449
  description: exports_external.string().optional(),
185458
185450
  properties: exports_external.record(exports_external.string(), PropertyDefinitionSchema).default({}),
@@ -186764,12 +186756,12 @@ var BANNER_LINES = [
186764
186756
  "██████╔╝██║ ██║███████║███████╗ ██║ ██║",
186765
186757
  "╚═════╝ ╚═╝ ╚═╝╚══════╝╚══════╝ ╚═╝ ╚═╝"
186766
186758
  ];
186767
- async function printBanner() {
186768
- if (process.stdout.isTTY) {
186769
- await printAnimatedLines(BANNER_LINES);
186770
- } else {
186759
+ async function printBanner(isNonInteractive) {
186760
+ if (isNonInteractive) {
186771
186761
  console.log(theme.colors.base44Orange(BANNER_LINES.join(`
186772
186762
  `)));
186763
+ } else {
186764
+ await printAnimatedLines(BANNER_LINES);
186773
186765
  }
186774
186766
  }
186775
186767
  // src/cli/errors.ts
@@ -193573,7 +193565,7 @@ async function printUpgradeNotificationIfAvailable() {
193573
193565
  async function runCommand(commandFn, options, context) {
193574
193566
  console.log();
193575
193567
  if (options?.fullBanner) {
193576
- await printBanner();
193568
+ await printBanner(context.isNonInteractive);
193577
193569
  Ie("");
193578
193570
  } else {
193579
193571
  Ie(theme.colors.base44OrangeBackground(" Base 44 "));
@@ -194503,7 +194495,7 @@ function printSummary(results, oauthOutcomes) {
194503
194495
  M2.error(`Failed: ${r2.type}${r2.error ? ` - ${r2.error}` : ""}`);
194504
194496
  }
194505
194497
  }
194506
- async function pushConnectorsAction() {
194498
+ async function pushConnectorsAction(isNonInteractive) {
194507
194499
  const { connectors } = await readProjectConfig();
194508
194500
  if (connectors.length === 0) {
194509
194501
  M2.info("No local connectors found - checking for remote connectors to remove");
@@ -194517,18 +194509,18 @@ async function pushConnectorsAction() {
194517
194509
  const needsOAuth = filterPendingOAuth(results);
194518
194510
  let outroMessage = "Connectors pushed to Base44";
194519
194511
  const oauthOutcomes = await promptOAuthFlows(needsOAuth, {
194520
- skipPrompt: !!process.env.CI
194512
+ skipPrompt: isNonInteractive
194521
194513
  });
194522
194514
  const allAuthorized = oauthOutcomes.size > 0 && [...oauthOutcomes.values()].every((s) => s === "ACTIVE");
194523
194515
  if (needsOAuth.length > 0 && !allAuthorized) {
194524
- outroMessage = process.env.CI ? "Skipped OAuth in CI. 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.";
194516
+ 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.";
194525
194517
  }
194526
194518
  printSummary(results, oauthOutcomes);
194527
194519
  return { outroMessage };
194528
194520
  }
194529
194521
  function getConnectorsPushCommand(context) {
194530
194522
  return new Command("push").description("Push local connectors to Base44 (overwrites connectors on Base44)").action(async () => {
194531
- await runCommand(pushConnectorsAction, { requireAuth: true }, context);
194523
+ await runCommand(() => pushConnectorsAction(context.isNonInteractive), { requireAuth: true }, context);
194532
194524
  });
194533
194525
  }
194534
194526
 
@@ -194538,16 +194530,16 @@ function getConnectorsCommand(context) {
194538
194530
  }
194539
194531
 
194540
194532
  // src/cli/commands/dashboard/open.ts
194541
- async function openDashboard() {
194533
+ async function openDashboard(isNonInteractive) {
194542
194534
  const dashboardUrl = getDashboardUrl();
194543
- if (!process.env.CI) {
194535
+ if (!isNonInteractive) {
194544
194536
  await open_default(dashboardUrl);
194545
194537
  }
194546
194538
  return { outroMessage: `Dashboard opened at ${dashboardUrl}` };
194547
194539
  }
194548
194540
  function getDashboardOpenCommand(context) {
194549
194541
  return new Command("open").description("Open the app dashboard in your browser").action(async () => {
194550
- await runCommand(openDashboard, { requireAuth: true }, context);
194542
+ await runCommand(() => openDashboard(context.isNonInteractive), { requireAuth: true }, context);
194551
194543
  });
194552
194544
  }
194553
194545
 
@@ -194853,7 +194845,7 @@ ${summaryLines.join(`
194853
194845
  const needsOAuth = filterPendingOAuth(result.connectorResults ?? []);
194854
194846
  if (needsOAuth.length > 0) {
194855
194847
  const oauthOutcomes = await promptOAuthFlows(needsOAuth, {
194856
- skipPrompt: options.yes || !!process.env.CI
194848
+ skipPrompt: options.yes || options.isNonInteractive
194857
194849
  });
194858
194850
  const allAuthorized = oauthOutcomes.size > 0 && [...oauthOutcomes.values()].every((s) => s === "ACTIVE");
194859
194851
  if (!allAuthorized) {
@@ -194868,7 +194860,10 @@ ${summaryLines.join(`
194868
194860
  }
194869
194861
  function getDeployCommand(context) {
194870
194862
  return new Command("deploy").description("Deploy all project resources (entities, functions, agents, connectors, and site)").option("-y, --yes", "Skip confirmation prompt").action(async (options) => {
194871
- await runCommand(() => deployAction(options), { requireAuth: true }, context);
194863
+ await runCommand(() => deployAction({
194864
+ ...options,
194865
+ isNonInteractive: context.isNonInteractive
194866
+ }), { requireAuth: true }, context);
194872
194867
  });
194873
194868
  }
194874
194869
 
@@ -195050,21 +195045,24 @@ async function deployAction2(options) {
195050
195045
  }
195051
195046
  function getSiteDeployCommand(context) {
195052
195047
  return new Command("deploy").description("Deploy built site files to Base44 hosting").option("-y, --yes", "Skip confirmation prompt").action(async (options) => {
195053
- await runCommand(() => deployAction2(options), { requireAuth: true }, context);
195048
+ await runCommand(() => deployAction2({
195049
+ ...options,
195050
+ isNonInteractive: context.isNonInteractive
195051
+ }), { requireAuth: true }, context);
195054
195052
  });
195055
195053
  }
195056
195054
 
195057
195055
  // src/cli/commands/site/open.ts
195058
- async function openAction() {
195056
+ async function openAction(isNonInteractive) {
195059
195057
  const siteUrl = await getSiteUrl();
195060
- if (!process.env.CI) {
195058
+ if (!isNonInteractive) {
195061
195059
  await open_default(siteUrl);
195062
195060
  }
195063
195061
  return { outroMessage: `Site opened at ${siteUrl}` };
195064
195062
  }
195065
195063
  function getSiteOpenCommand(context) {
195066
195064
  return new Command("open").description("Open the published site in your browser").action(async () => {
195067
- await runCommand(openAction, { requireAuth: true }, context);
195065
+ await runCommand(() => openAction(context.isNonInteractive), { requireAuth: true }, context);
195068
195066
  });
195069
195067
  }
195070
195068
 
@@ -195467,7 +195465,7 @@ async function eject(options8) {
195467
195465
  }
195468
195466
  function getEjectCommand(context) {
195469
195467
  return new Command("eject").description("Download the code for an existing Base44 project").option("-p, --path <path>", "Path where to write the project").option("--project-id <id>", "Project ID to eject (skips interactive selection)").option("-y, --yes", "Skip confirmation prompts").action(async (options8) => {
195470
- await runCommand(() => eject(options8), { requireAuth: true, requireAppConfig: false }, context);
195468
+ await runCommand(() => eject({ ...options8, isNonInteractive: context.isNonInteractive }), { requireAuth: true, requireAppConfig: false }, context);
195471
195469
  });
195472
195470
  }
195473
195471
 
@@ -199734,7 +199732,8 @@ function addCommandInfoToErrorReporter(program2, errorReporter) {
199734
199732
  async function runCLI() {
199735
199733
  const errorReporter = new ErrorReporter;
199736
199734
  errorReporter.registerProcessErrorHandlers();
199737
- const context = { errorReporter };
199735
+ const isNonInteractive = !process.stdin.isTTY || !process.stdout.isTTY;
199736
+ const context = { errorReporter, isNonInteractive };
199738
199737
  const program2 = createProgram(context);
199739
199738
  try {
199740
199739
  const userInfo = await readAuth();
@@ -199759,4 +199758,4 @@ export {
199759
199758
  CLIExitError
199760
199759
  };
199761
199760
 
199762
- //# debugId=E8152088344F478464756E2164756E21
199761
+ //# debugId=8F512541E4B9E47964756E2164756E21