@base44-preview/cli 0.0.55-pr.540.1e017a6 → 0.0.55-pr.540.6a4c0e6

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
@@ -253566,20 +253566,10 @@ async function fetchLogsForFunctions(functionNames, options, availableFunctionNa
253566
253566
  }
253567
253567
  return allEntries;
253568
253568
  }
253569
- async function getAllFunctionNames() {
253570
- const { functions } = await readProjectConfig();
253569
+ async function getProjectFunctionNames(projectRoot) {
253570
+ const { functions } = await readProjectConfig(projectRoot);
253571
253571
  return functions.map((fn) => fn.name);
253572
253572
  }
253573
- async function getProjectFunctionNamesIfAvailable() {
253574
- try {
253575
- return await getAllFunctionNames();
253576
- } catch (error48) {
253577
- if (error48 instanceof ConfigNotFoundError) {
253578
- return null;
253579
- }
253580
- throw error48;
253581
- }
253582
- }
253583
253573
  async function getRemoteFunctionNames() {
253584
253574
  const { functions } = await listDeployedFunctions();
253585
253575
  return functions.map((fn) => fn.name);
@@ -253592,17 +253582,18 @@ function validateLimit(limit) {
253592
253582
  throw new InvalidInputError(`Invalid limit: "${limit}". Must be a number between 1 and 1000.`);
253593
253583
  }
253594
253584
  }
253595
- async function logsAction(_ctx, options) {
253585
+ async function logsAction(ctx, options) {
253596
253586
  validateLimit(options.limit);
253597
253587
  const specifiedFunctions = parseFunctionNames(options.function);
253598
- const allProjectFunctions = specifiedFunctions.length > 0 ? await getProjectFunctionNamesIfAvailable() ?? [] : await getProjectFunctionNamesIfAvailable();
253599
- const functionNames = specifiedFunctions.length > 0 ? specifiedFunctions : allProjectFunctions ?? await getRemoteFunctionNames();
253588
+ const localProjectRoot = ctx.app?.projectRoot;
253589
+ const availableFunctionNames = localProjectRoot ? await getProjectFunctionNames(localProjectRoot) : await getRemoteFunctionNames();
253590
+ const functionNames = specifiedFunctions.length > 0 ? specifiedFunctions : availableFunctionNames;
253600
253591
  if (functionNames.length === 0) {
253601
253592
  return {
253602
- outroMessage: allProjectFunctions ? "No functions found in this project." : "No functions found in this app."
253593
+ outroMessage: localProjectRoot ? "No functions found in this project." : "No functions found in this app."
253603
253594
  };
253604
253595
  }
253605
- let entries = await fetchLogsForFunctions(functionNames, options, allProjectFunctions ?? functionNames);
253596
+ let entries = await fetchLogsForFunctions(functionNames, options, availableFunctionNames);
253606
253597
  const limit = options.limit ? Number.parseInt(options.limit, 10) : undefined;
253607
253598
  if (limit !== undefined && entries.length > limit) {
253608
253599
  entries = entries.slice(0, limit);
@@ -261842,4 +261833,4 @@ export {
261842
261833
  CLIExitError
261843
261834
  };
261844
261835
 
261845
- //# debugId=51EFACBA13CCECB164756E2164756E21
261836
+ //# debugId=1AFC96DD14EFBB4A64756E2164756E21