@base44-preview/cli 0.0.56-pr.552.afe1aea → 0.0.57-pr.551.55c14e2

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
@@ -243487,6 +243487,9 @@ function buildLogsQueryString(filters) {
243487
243487
  if (filters.order) {
243488
243488
  params.set("order", filters.order);
243489
243489
  }
243490
+ if (filters.env) {
243491
+ params.set("env", filters.env);
243492
+ }
243490
243493
  return params;
243491
243494
  }
243492
243495
  async function fetchFunctionLogs(functionName, filters = {}) {
@@ -243891,7 +243894,7 @@ import { join as join11 } from "node:path";
243891
243894
  // package.json
243892
243895
  var package_default = {
243893
243896
  name: "base44",
243894
- version: "0.0.56",
243897
+ version: "0.0.57",
243895
243898
  description: "Base44 CLI - Unified interface for managing Base44 applications",
243896
243899
  type: "module",
243897
243900
  bin: {
@@ -253499,6 +253502,9 @@ function parseFunctionFilters(options) {
253499
253502
  if (options.order) {
253500
253503
  filters.order = options.order.toLowerCase();
253501
253504
  }
253505
+ if (options.env) {
253506
+ filters.env = options.env;
253507
+ }
253502
253508
  return filters;
253503
253509
  }
253504
253510
  function parseFunctionNames(option) {
@@ -253521,8 +253527,12 @@ function formatEntry(entry) {
253521
253527
  const message = entry.message.trim();
253522
253528
  return `${time3} ${level} ${message}`;
253523
253529
  }
253524
- function formatLogs(entries) {
253530
+ function formatLogs(entries, env3) {
253525
253531
  if (entries.length === 0) {
253532
+ if (env3 === "prod") {
253533
+ return `No production logs found. Has this app been published? Try --env preview to see draft logs.
253534
+ `;
253535
+ }
253526
253536
  return `No logs found matching the filters.
253527
253537
  `;
253528
253538
  }
@@ -253603,8 +253613,9 @@ async function logsAction(ctx, options) {
253603
253613
  if (limit !== undefined && entries.length > limit) {
253604
253614
  entries = entries.slice(0, limit);
253605
253615
  }
253616
+ const env3 = options.env ?? "preview";
253606
253617
  const logsOutput = options.json ? `${JSON.stringify(entries, null, 2)}
253607
- ` : formatLogs(entries);
253618
+ ` : formatLogs(entries, env3);
253608
253619
  const shouldOutputOutroMessage = !options.json;
253609
253620
  return {
253610
253621
  outroMessage: shouldOutputOutroMessage ? "Fetched logs" : undefined,
@@ -253612,7 +253623,7 @@ async function logsAction(ctx, options) {
253612
253623
  };
253613
253624
  }
253614
253625
  function getLogsCommand() {
253615
- return new Base44Command("logs").description("Fetch function logs for this app").option("--function <names>", "Filter by function name(s), comma-separated. If omitted, fetches logs for all project functions").option("--since <datetime>", "Show logs from this time. ISO datetime or relative shorthand (e.g. 1h, 30m, 2d)", normalizeDatetime).option("--until <datetime>", "Show logs until this time. ISO datetime or relative shorthand (e.g. 1h, 30m, 2d)", normalizeDatetime).addOption(new Option("--level <level>", "Filter by log level").choices([...LogLevelSchema.options]).hideHelp()).option("-n, --limit <n>", "Results per page (1-1000, default: 50)").addOption(new Option("--order <order>", "Sort order").choices(["asc", "desc"])).option("--json", "Output as JSON (clean stdout, safe to pipe to jq)").action(logsAction);
253626
+ return new Base44Command("logs").description("Fetch function logs for this app").option("--function <names>", "Filter by function name(s), comma-separated. If omitted, fetches logs for all project functions").option("--since <datetime>", "Show logs from this time. ISO datetime or relative shorthand (e.g. 1h, 30m, 2d)", normalizeDatetime).option("--until <datetime>", "Show logs until this time. ISO datetime or relative shorthand (e.g. 1h, 30m, 2d)", normalizeDatetime).addOption(new Option("--level <level>", "Filter by log level").choices([...LogLevelSchema.options]).hideHelp()).option("-n, --limit <n>", "Results per page (1-1000, default: 50)").addOption(new Option("--order <order>", "Sort order").choices(["asc", "desc"])).addOption(new Option("--env <env>", "Environment to fetch logs from (default: preview)").choices(["preview", "prod"])).option("--json", "Output as JSON (clean stdout, safe to pipe to jq)").action(logsAction);
253616
253627
  }
253617
253628
 
253618
253629
  // src/cli/commands/project/scaffold.ts
@@ -261988,4 +261999,4 @@ export {
261988
261999
  CLIExitError
261989
262000
  };
261990
262001
 
261991
- //# debugId=17F87141520B3B1764756E2164756E21
262002
+ //# debugId=6D525E02881278EA64756E2164756E21