@budibase/backend-core 2.22.3 → 2.22.5

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/index.js CHANGED
@@ -5333,7 +5333,7 @@ var require_extend = __commonJS({
5333
5333
  }
5334
5334
  return toStr.call(arr) === "[object Array]";
5335
5335
  };
5336
- var isPlainObject = function isPlainObject2(obj) {
5336
+ var isPlainObject2 = function isPlainObject3(obj) {
5337
5337
  if (!obj || toStr.call(obj) !== "[object Object]") {
5338
5338
  return false;
5339
5339
  }
@@ -5390,12 +5390,12 @@ var require_extend = __commonJS({
5390
5390
  src = getProperty(target, name);
5391
5391
  copy = getProperty(options2, name);
5392
5392
  if (target !== copy) {
5393
- if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {
5393
+ if (deep && copy && (isPlainObject2(copy) || (copyIsArray = isArray(copy)))) {
5394
5394
  if (copyIsArray) {
5395
5395
  copyIsArray = false;
5396
5396
  clone = src && isArray(src) ? src : [];
5397
5397
  } else {
5398
- clone = src && isPlainObject(src) ? src : {};
5398
+ clone = src && isPlainObject2(src) ? src : {};
5399
5399
  }
5400
5400
  setProperty(target, { name, newValue: extend(deep, clone, copy) });
5401
5401
  } else if (typeof copy !== "undefined") {
@@ -29687,10 +29687,10 @@ var require_util = __commonJS({
29687
29687
  return objectToString(d) === "[object Date]";
29688
29688
  }
29689
29689
  exports.isDate = isDate;
29690
- function isError(e) {
29690
+ function isError2(e) {
29691
29691
  return objectToString(e) === "[object Error]" || e instanceof Error;
29692
29692
  }
29693
- exports.isError = isError;
29693
+ exports.isError = isError2;
29694
29694
  function isFunction(arg) {
29695
29695
  return typeof arg === "function";
29696
29696
  }
@@ -57341,7 +57341,7 @@ var QueryBuilder = class _QueryBuilder {
57341
57341
  value = value.toLowerCase ? value.toLowerCase() : value;
57342
57342
  }
57343
57343
  if (!this.#noEscaping && escape && originalType === "string") {
57344
- value = `${value}`.replace(/[ \/#+\-&|!(){}\]^"~*?:\\]/g, "\\$&");
57344
+ value = `${value}`.replace(/[ /#+\-&|!(){}\]^"~*?:\\]/g, "\\$&");
57345
57345
  }
57346
57346
  if (originalType === "string" && !isNaN(value) && !type) {
57347
57347
  value = `"${value}"`;
@@ -58312,15 +58312,51 @@ function getLogReadStream() {
58312
58312
  }
58313
58313
 
58314
58314
  // src/logging/pino/logger.ts
58315
+ function isPlainObject(obj) {
58316
+ return typeof obj === "object" && obj !== null && !(obj instanceof Error);
58317
+ }
58318
+ function isError(obj) {
58319
+ return obj instanceof Error;
58320
+ }
58321
+ function isMessage(obj) {
58322
+ return typeof obj === "string";
58323
+ }
58315
58324
  var pinoInstance;
58316
58325
  if (!environment_default.DISABLE_PINO_LOGGER) {
58317
- let isPlainObject = function(obj) {
58318
- return typeof obj === "object" && obj !== null && !(obj instanceof Error);
58319
- }, isError = function(obj) {
58320
- return obj instanceof Error;
58321
- }, isMessage = function(obj) {
58322
- return typeof obj === "string";
58323
- }, getLogParams2 = function(args) {
58326
+ const level = environment_default.LOG_LEVEL;
58327
+ const pinoOptions = {
58328
+ level,
58329
+ formatters: {
58330
+ level: (level2) => {
58331
+ return { level: level2.toUpperCase() };
58332
+ },
58333
+ bindings: () => {
58334
+ if (environment_default.SELF_HOSTED) {
58335
+ return {
58336
+ service: environment_default.SERVICE_NAME
58337
+ };
58338
+ } else {
58339
+ return {};
58340
+ }
58341
+ }
58342
+ },
58343
+ timestamp: () => `,"timestamp":"${new Date(Date.now()).toISOString()}"`
58344
+ };
58345
+ const destinations = [];
58346
+ destinations.push(
58347
+ environment_default.isDev() ? {
58348
+ stream: (0, import_pino_pretty.default)({ singleLine: true }),
58349
+ level
58350
+ } : { stream: process.stdout, level }
58351
+ );
58352
+ if (environment_default.SELF_HOSTED) {
58353
+ destinations.push({
58354
+ stream: localFileDestination(),
58355
+ level
58356
+ });
58357
+ }
58358
+ pinoInstance = destinations.length ? (0, import_pino.default)(pinoOptions, import_pino.default.multistream(destinations)) : (0, import_pino.default)(pinoOptions);
58359
+ const getLogParams2 = (args) => {
58324
58360
  let error = void 0;
58325
58361
  let objects = [];
58326
58362
  let message = "";
@@ -58374,40 +58410,6 @@ if (!environment_default.DISABLE_PINO_LOGGER) {
58374
58410
  }
58375
58411
  return [mergingObject, message];
58376
58412
  };
58377
- isPlainObject2 = isPlainObject, isError2 = isError, isMessage2 = isMessage, getLogParams3 = getLogParams2;
58378
- const level = environment_default.LOG_LEVEL;
58379
- const pinoOptions = {
58380
- level,
58381
- formatters: {
58382
- level: (level2) => {
58383
- return { level: level2.toUpperCase() };
58384
- },
58385
- bindings: () => {
58386
- if (environment_default.SELF_HOSTED) {
58387
- return {
58388
- service: environment_default.SERVICE_NAME
58389
- };
58390
- } else {
58391
- return {};
58392
- }
58393
- }
58394
- },
58395
- timestamp: () => `,"timestamp":"${new Date(Date.now()).toISOString()}"`
58396
- };
58397
- const destinations = [];
58398
- destinations.push(
58399
- environment_default.isDev() ? {
58400
- stream: (0, import_pino_pretty.default)({ singleLine: true }),
58401
- level
58402
- } : { stream: process.stdout, level }
58403
- );
58404
- if (environment_default.SELF_HOSTED) {
58405
- destinations.push({
58406
- stream: localFileDestination(),
58407
- level
58408
- });
58409
- }
58410
- pinoInstance = destinations.length ? (0, import_pino.default)(pinoOptions, import_pino.default.multistream(destinations)) : (0, import_pino.default)(pinoOptions);
58411
58413
  console.log = (...arg) => {
58412
58414
  const [obj, msg] = getLogParams2(arg);
58413
58415
  pinoInstance?.info(obj, msg);
@@ -58468,10 +58470,6 @@ if (!environment_default.DISABLE_PINO_LOGGER) {
58468
58470
  return identity;
58469
58471
  };
58470
58472
  }
58471
- var isPlainObject2;
58472
- var isError2;
58473
- var isMessage2;
58474
- var getLogParams3;
58475
58473
  var logger = pinoInstance;
58476
58474
 
58477
58475
  // src/logging/alerts.ts
@@ -65069,7 +65067,6 @@ var buildMatcherRegex = (patterns) => {
65069
65067
  return patterns.map((pattern) => {
65070
65068
  let route = pattern.route;
65071
65069
  const method = pattern.method;
65072
- const strict = pattern.strict ? pattern.strict : false;
65073
65070
  const matches2 = route.match(PARAM_REGEX);
65074
65071
  if (matches2) {
65075
65072
  for (let match of matches2) {
@@ -65078,17 +65075,12 @@ var buildMatcherRegex = (patterns) => {
65078
65075
  route = route.replace(match, pattern2);
65079
65076
  }
65080
65077
  }
65081
- return { regex: new RegExp(route), method, strict, route };
65078
+ return { regex: new RegExp(route), method, route };
65082
65079
  });
65083
65080
  };
65084
65081
  var matches = (ctx, options2) => {
65085
- return options2.find(({ regex, method, strict, route }) => {
65086
- let urlMatch;
65087
- if (strict) {
65088
- urlMatch = ctx.request.url === route;
65089
- } else {
65090
- urlMatch = regex.test(ctx.request.url);
65091
- }
65082
+ return options2.find(({ regex, method, route }) => {
65083
+ const urlMatch = regex.test(ctx.request.url);
65092
65084
  const methodMatch = method === "ALL" ? true : ctx.request.method.toLowerCase() === method.toLowerCase();
65093
65085
  return urlMatch && methodMatch;
65094
65086
  });