@base44-preview/cli 0.0.35-pr.339.6c754d1 → 0.0.36-pr.339.19d2ed8

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
@@ -4,25 +4,43 @@ var __getProtoOf = Object.getPrototypeOf;
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ function __accessProp(key) {
8
+ return this[key];
9
+ }
10
+ var __toESMCache_node;
11
+ var __toESMCache_esm;
7
12
  var __toESM = (mod, isNodeMode, target) => {
13
+ var canCache = mod != null && typeof mod === "object";
14
+ if (canCache) {
15
+ var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
16
+ var cached = cache.get(mod);
17
+ if (cached)
18
+ return cached;
19
+ }
8
20
  target = mod != null ? __create(__getProtoOf(mod)) : {};
9
21
  const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
10
22
  for (let key of __getOwnPropNames(mod))
11
23
  if (!__hasOwnProp.call(to, key))
12
24
  __defProp(to, key, {
13
- get: () => mod[key],
25
+ get: __accessProp.bind(mod, key),
14
26
  enumerable: true
15
27
  });
28
+ if (canCache)
29
+ cache.set(mod, to);
16
30
  return to;
17
31
  };
18
32
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
33
+ var __returnValue = (v) => v;
34
+ function __exportSetter(name, newValue) {
35
+ this[name] = __returnValue.bind(null, newValue);
36
+ }
19
37
  var __export = (target, all) => {
20
38
  for (var name in all)
21
39
  __defProp(target, name, {
22
40
  get: all[name],
23
41
  enumerable: true,
24
42
  configurable: true,
25
- set: (newValue) => all[name] = () => newValue
43
+ set: __exportSetter.bind(all, name)
26
44
  });
27
45
  };
28
46
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
@@ -241110,7 +241128,7 @@ var {
241110
241128
  // package.json
241111
241129
  var package_default = {
241112
241130
  name: "base44",
241113
- version: "0.0.35",
241131
+ version: "0.0.36",
241114
241132
  description: "Base44 CLI - Unified interface for managing Base44 applications",
241115
241133
  type: "module",
241116
241134
  bin: {
@@ -243746,7 +243764,7 @@ var import_multer = __toESM(require_multer(), 1);
243746
243764
  import { randomUUID as randomUUID2 } from "node:crypto";
243747
243765
  import fs28 from "node:fs";
243748
243766
  import path18 from "node:path";
243749
- function createIntegrationRoutes(mediaFilesDir, baseUrl, logger) {
243767
+ function createIntegrationRoutes(mediaFilesDir, baseUrl, remoteProxy, logger) {
243750
243768
  const router = import_express3.Router({ mergeParams: true });
243751
243769
  const parseBody = import_express3.json();
243752
243770
  fs28.mkdirSync(mediaFilesDir, { recursive: true });
@@ -243757,7 +243775,8 @@ function createIntegrationRoutes(mediaFilesDir, baseUrl, logger) {
243757
243775
  cb2(null, `${randomUUID2()}${ext}`);
243758
243776
  }
243759
243777
  });
243760
- const upload = import_multer.default({ storage });
243778
+ const MAX_FILE_SIZE = 50 * 1024 * 1024;
243779
+ const upload = import_multer.default({ storage, limits: { fileSize: MAX_FILE_SIZE } });
243761
243780
  router.post("/Core/UploadFile", upload.single("file"), (req, res) => {
243762
243781
  if (!req.file) {
243763
243782
  res.status(400).json({ error: "No file uploaded" });
@@ -243784,13 +243803,22 @@ function createIntegrationRoutes(mediaFilesDir, baseUrl, logger) {
243784
243803
  const signed_url = `${baseUrl}/media/${file_uri}?signature=${signature}`;
243785
243804
  res.json({ signed_url });
243786
243805
  });
243787
- router.post("/Core/:endpointName", (req, res) => {
243806
+ router.post("/Core/:endpointName", (req, res, next) => {
243788
243807
  logger.warn(`Core.${req.params.endpointName} is not supported in local development`);
243789
- res.json({});
243808
+ req.url = req.originalUrl;
243809
+ remoteProxy(req, res, next);
243790
243810
  });
243791
- router.post("/installable/:packageName/integration-endpoints/:endpointName", (req, res) => {
243811
+ router.post("/installable/:packageName/integration-endpoints/:endpointName", (req, res, next) => {
243792
243812
  logger.warn(`${req.params.packageName}.${req.params.endpointName} is not supported in local development`);
243793
- res.json({});
243813
+ req.url = req.originalUrl;
243814
+ remoteProxy(req, res, next);
243815
+ });
243816
+ router.use((err, _req, res, next) => {
243817
+ if (err instanceof import_multer.default.MulterError) {
243818
+ res.status(err.code === "LIMIT_FILE_SIZE" ? 413 : 400).json({ error: err.message });
243819
+ return;
243820
+ }
243821
+ next(err);
243794
243822
  });
243795
243823
  return router;
243796
243824
  }
@@ -243846,12 +243874,13 @@ async function createDevServer(options8) {
243846
243874
  const configDir = dirname12(project2.configPath);
243847
243875
  const mediaFilesDir = join16(configDir, "tmp", "files");
243848
243876
  app.use("/media", import_express4.default.static(mediaFilesDir));
243849
- const integrationRoutes = createIntegrationRoutes(mediaFilesDir, baseUrl, devLogger);
243877
+ const integrationRoutes = createIntegrationRoutes(mediaFilesDir, baseUrl, remoteProxy, devLogger);
243850
243878
  app.use("/api/apps/:appId/integration-endpoints", integrationRoutes);
243851
243879
  const customIntegrationRoutes = createCustomIntegrationRoutes(remoteProxy, devLogger);
243852
243880
  app.use("/api/apps/:appId/integrations/custom", customIntegrationRoutes);
243853
243881
  app.use((req, res, next) => {
243854
- return remoteProxy(req, res, next);
243882
+ devLogger.warn(`"${req.originalUrl}" is not supported in local development, passing call to production`);
243883
+ remoteProxy(req, res, next);
243855
243884
  });
243856
243885
  return new Promise((resolve6, reject) => {
243857
243886
  const server = app.listen(port, "127.0.0.1", (err) => {
@@ -248254,4 +248283,4 @@ export {
248254
248283
  CLIExitError
248255
248284
  };
248256
248285
 
248257
- //# debugId=5B40E6B93843414964756E2164756E21
248286
+ //# debugId=0C27EB9C7EC17CAE64756E2164756E21