@base44-preview/cli 0.0.40-pr.388.1a9b91d → 0.0.41-pr.380.73b00fc

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
@@ -231132,6 +231132,21 @@ var DeployFunctionsResponseSchema = exports_external.object({
231132
231132
  skipped: exports_external.array(exports_external.string()).optional().nullable(),
231133
231133
  errors: exports_external.array(exports_external.object({ name: exports_external.string(), message: exports_external.string() })).nullable()
231134
231134
  });
231135
+ var FunctionAutomationInfoSchema = exports_external.object({
231136
+ name: exports_external.string(),
231137
+ type: exports_external.string(),
231138
+ is_active: exports_external.boolean()
231139
+ });
231140
+ var FunctionInfoSchema = exports_external.object({
231141
+ name: exports_external.string(),
231142
+ deployment_id: exports_external.string(),
231143
+ entry: exports_external.string(),
231144
+ files: exports_external.array(FunctionFileSchema),
231145
+ automations: exports_external.array(FunctionAutomationInfoSchema)
231146
+ });
231147
+ var ListFunctionsResponseSchema = exports_external.object({
231148
+ functions: exports_external.array(FunctionInfoSchema)
231149
+ });
231135
231150
  var LogLevelSchema = exports_external.enum(["info", "warning", "error", "debug"]);
231136
231151
  var FunctionLogEntrySchema = exports_external.object({
231137
231152
  time: exports_external.string(),
@@ -231205,6 +231220,20 @@ async function fetchFunctionLogs(functionName, filters = {}) {
231205
231220
  }
231206
231221
  return result.data;
231207
231222
  }
231223
+ async function listDeployedFunctions() {
231224
+ const appClient = getAppClient();
231225
+ let response;
231226
+ try {
231227
+ response = await appClient.get("backend-functions", { timeout: 30000 });
231228
+ } catch (error48) {
231229
+ throw await ApiError.fromHttpError(error48, "listing deployed functions");
231230
+ }
231231
+ const result = ListFunctionsResponseSchema.safeParse(await response.json());
231232
+ if (!result.success) {
231233
+ throw new SchemaValidationError("Invalid response from server", result.error);
231234
+ }
231235
+ return result.data;
231236
+ }
231208
231237
  // src/core/resources/function/config.ts
231209
231238
  import { basename as basename2, dirname as dirname3, join as join5, relative } from "node:path";
231210
231239
  async function readFunctionConfig(configPath) {
@@ -231453,7 +231482,7 @@ import { join as join7 } from "node:path";
231453
231482
  // package.json
231454
231483
  var package_default = {
231455
231484
  name: "base44",
231456
- version: "0.0.40",
231485
+ version: "0.0.41",
231457
231486
  description: "Base44 CLI - Unified interface for managing Base44 applications",
231458
231487
  type: "module",
231459
231488
  bin: {
@@ -240369,10 +240398,36 @@ async function deployFunctionsAction() {
240369
240398
  }
240370
240399
  return { outroMessage: "Functions deployed to Base44" };
240371
240400
  }
240372
- function getFunctionsDeployCommand(context) {
240373
- return new Command("functions").description("Manage project functions").addCommand(new Command("deploy").description("Deploy local functions to Base44").action(async () => {
240401
+ function getDeployCommand(context) {
240402
+ return new Command("deploy").description("Deploy local functions to Base44").action(async () => {
240374
240403
  await runCommand(deployFunctionsAction, { requireAuth: true }, context);
240375
- }));
240404
+ });
240405
+ }
240406
+
240407
+ // src/cli/commands/functions/list.ts
240408
+ async function listFunctionsAction() {
240409
+ const { functions } = await listDeployedFunctions();
240410
+ if (functions.length === 0) {
240411
+ return { outroMessage: "No functions on remote" };
240412
+ }
240413
+ for (const fn of functions) {
240414
+ const autoCount = fn.automations.length;
240415
+ const autoLabel = autoCount > 0 ? theme.styles.dim(` (${autoCount} automation${autoCount > 1 ? "s" : ""})`) : "";
240416
+ R2.message(` ${fn.name}${autoLabel}`);
240417
+ }
240418
+ return {
240419
+ outroMessage: `${functions.length} function${functions.length !== 1 ? "s" : ""} on remote`
240420
+ };
240421
+ }
240422
+ function getListCommand(context) {
240423
+ return new Command("list").description("List all deployed functions").action(async () => {
240424
+ await runCommand(listFunctionsAction, { requireAuth: true }, context);
240425
+ });
240426
+ }
240427
+
240428
+ // src/cli/commands/functions/index.ts
240429
+ function getFunctionsCommand(context) {
240430
+ return new Command("functions").description("Manage backend functions").addCommand(getDeployCommand(context)).addCommand(getListCommand(context));
240376
240431
  }
240377
240432
 
240378
240433
  // src/cli/commands/project/create.ts
@@ -240614,7 +240669,7 @@ ${summaryLines.join(`
240614
240669
  }
240615
240670
  return { outroMessage: "App deployed successfully" };
240616
240671
  }
240617
- function getDeployCommand(context) {
240672
+ function getDeployCommand2(context) {
240618
240673
  return new Command("deploy").description("Deploy all project resources (entities, functions, agents, connectors, and site)").option("-y, --yes", "Skip confirmation prompt").action(async (options) => {
240619
240674
  await runCommand(() => deployAction({
240620
240675
  ...options,
@@ -243851,13 +243906,13 @@ function createProgram(context) {
243851
243906
  program2.addCommand(getLogoutCommand(context));
243852
243907
  program2.addCommand(getCreateCommand(context));
243853
243908
  program2.addCommand(getDashboardCommand(context));
243854
- program2.addCommand(getDeployCommand(context));
243909
+ program2.addCommand(getDeployCommand2(context));
243855
243910
  program2.addCommand(getLinkCommand(context));
243856
243911
  program2.addCommand(getEjectCommand(context));
243857
243912
  program2.addCommand(getEntitiesPushCommand(context));
243858
243913
  program2.addCommand(getAgentsCommand(context));
243859
243914
  program2.addCommand(getConnectorsCommand(context));
243860
- program2.addCommand(getFunctionsDeployCommand(context));
243915
+ program2.addCommand(getFunctionsCommand(context));
243861
243916
  program2.addCommand(getSecretsCommand(context));
243862
243917
  program2.addCommand(getSiteCommand(context));
243863
243918
  program2.addCommand(getTypesCommand(context));
@@ -248103,4 +248158,4 @@ export {
248103
248158
  CLIExitError
248104
248159
  };
248105
248160
 
248106
- //# debugId=B1A9A7CE6BA5120664756E2164756E21
248161
+ //# debugId=1CB047BBC03A3D1264756E2164756E21