@base44-preview/cli 0.0.42-pr.404.ec1a1ee → 0.0.44-pr.380.71fe077

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
@@ -238236,6 +238236,22 @@ var DeployFunctionsResponseSchema = exports_external.object({
238236
238236
  skipped: exports_external.array(exports_external.string()).optional().nullable(),
238237
238237
  errors: exports_external.array(exports_external.object({ name: exports_external.string(), message: exports_external.string() })).nullable()
238238
238238
  });
238239
+ var FunctionInfoSchema = exports_external.object({
238240
+ name: exports_external.string(),
238241
+ deployment_id: exports_external.string(),
238242
+ entry: exports_external.string(),
238243
+ files: exports_external.array(FunctionFileSchema),
238244
+ automations: exports_external.array(AutomationSchema)
238245
+ }).transform((data) => ({
238246
+ name: data.name,
238247
+ deploymentId: data.deployment_id,
238248
+ entry: data.entry,
238249
+ files: data.files,
238250
+ automations: data.automations
238251
+ }));
238252
+ var ListFunctionsResponseSchema = exports_external.object({
238253
+ functions: exports_external.array(FunctionInfoSchema)
238254
+ });
238239
238255
  var LogLevelSchema = exports_external.enum(["info", "warning", "error", "debug"]);
238240
238256
  var FunctionLogEntrySchema = exports_external.object({
238241
238257
  time: exports_external.string(),
@@ -238309,6 +238325,20 @@ async function fetchFunctionLogs(functionName, filters = {}) {
238309
238325
  }
238310
238326
  return result.data;
238311
238327
  }
238328
+ async function listDeployedFunctions() {
238329
+ const appClient = getAppClient();
238330
+ let response;
238331
+ try {
238332
+ response = await appClient.get("backend-functions", { timeout: 30000 });
238333
+ } catch (error48) {
238334
+ throw await ApiError.fromHttpError(error48, "listing deployed functions");
238335
+ }
238336
+ const result = ListFunctionsResponseSchema.safeParse(await response.json());
238337
+ if (!result.success) {
238338
+ throw new SchemaValidationError("Invalid response from server", result.error);
238339
+ }
238340
+ return result.data;
238341
+ }
238312
238342
  // src/core/resources/function/config.ts
238313
238343
  import { basename as basename2, dirname as dirname3, join as join5, relative } from "node:path";
238314
238344
  async function readFunctionConfig(configPath) {
@@ -238557,7 +238587,7 @@ import { join as join7 } from "node:path";
238557
238587
  // package.json
238558
238588
  var package_default = {
238559
238589
  name: "base44",
238560
- version: "0.0.42",
238590
+ version: "0.0.44",
238561
238591
  description: "Base44 CLI - Unified interface for managing Base44 applications",
238562
238592
  type: "module",
238563
238593
  bin: {
@@ -247590,10 +247620,36 @@ async function deployFunctionsAction() {
247590
247620
  }
247591
247621
  return { outroMessage: "Functions deployed to Base44" };
247592
247622
  }
247593
- function getFunctionsDeployCommand(context) {
247594
- return new Command("functions").description("Manage project functions").addCommand(new Command("deploy").description("Deploy local functions to Base44").action(async () => {
247623
+ function getDeployCommand(context) {
247624
+ return new Command("deploy").description("Deploy local functions to Base44").action(async () => {
247595
247625
  await runCommand(deployFunctionsAction, { requireAuth: true }, context);
247596
- }));
247626
+ });
247627
+ }
247628
+
247629
+ // src/cli/commands/functions/list.ts
247630
+ async function listFunctionsAction() {
247631
+ const { functions } = await runTask("Fetching functions...", async () => listDeployedFunctions());
247632
+ if (functions.length === 0) {
247633
+ return { outroMessage: "No functions on remote" };
247634
+ }
247635
+ for (const fn of functions) {
247636
+ const automationCount = fn.automations.length;
247637
+ const automationLabel = automationCount > 0 ? theme.styles.dim(` (${automationCount} automation${automationCount > 1 ? "s" : ""})`) : "";
247638
+ R2.message(` ${fn.name}${automationLabel}`);
247639
+ }
247640
+ return {
247641
+ outroMessage: `${functions.length} function${functions.length !== 1 ? "s" : ""} on remote`
247642
+ };
247643
+ }
247644
+ function getListCommand(context) {
247645
+ return new Command("list").description("List all deployed functions").action(async () => {
247646
+ await runCommand(listFunctionsAction, { requireAuth: true }, context);
247647
+ });
247648
+ }
247649
+
247650
+ // src/cli/commands/functions/index.ts
247651
+ function getFunctionsCommand(context) {
247652
+ return new Command("functions").description("Manage backend functions").addCommand(getDeployCommand(context)).addCommand(getListCommand(context));
247597
247653
  }
247598
247654
 
247599
247655
  // src/cli/commands/project/create.ts
@@ -247831,7 +247887,7 @@ ${summaryLines.join(`
247831
247887
  }
247832
247888
  return { outroMessage: "App deployed successfully" };
247833
247889
  }
247834
- function getDeployCommand(context) {
247890
+ function getDeployCommand2(context) {
247835
247891
  return new Command("deploy").description("Deploy all project resources (entities, functions, agents, connectors, and site)").option("-y, --yes", "Skip confirmation prompt").action(async (options) => {
247836
247892
  await runCommand(() => deployAction({
247837
247893
  ...options,
@@ -251123,13 +251179,13 @@ function createProgram(context) {
251123
251179
  program2.addCommand(getLogoutCommand(context));
251124
251180
  program2.addCommand(getCreateCommand(context));
251125
251181
  program2.addCommand(getDashboardCommand(context));
251126
- program2.addCommand(getDeployCommand(context));
251182
+ program2.addCommand(getDeployCommand2(context));
251127
251183
  program2.addCommand(getLinkCommand(context));
251128
251184
  program2.addCommand(getEjectCommand(context));
251129
251185
  program2.addCommand(getEntitiesPushCommand(context));
251130
251186
  program2.addCommand(getAgentsCommand(context));
251131
251187
  program2.addCommand(getConnectorsCommand(context));
251132
- program2.addCommand(getFunctionsDeployCommand(context));
251188
+ program2.addCommand(getFunctionsCommand(context));
251133
251189
  program2.addCommand(getSecretsCommand(context));
251134
251190
  program2.addCommand(getSiteCommand(context));
251135
251191
  program2.addCommand(getTypesCommand(context));
@@ -255375,4 +255431,4 @@ export {
255375
255431
  CLIExitError
255376
255432
  };
255377
255433
 
255378
- //# debugId=384DD458B8CE578E64756E2164756E21
255434
+ //# debugId=FD4A53B035AEBB5D64756E2164756E21