@budibase/backend-core 2.24.0 → 2.24.2

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
@@ -30185,7 +30185,7 @@ var require_jsprim = __commonJS({
30185
30185
  var mod_jsonschema = require_validate();
30186
30186
  exports.deepCopy = deepCopy;
30187
30187
  exports.deepEqual = deepEqual;
30188
- exports.isEmpty = isEmpty;
30188
+ exports.isEmpty = isEmpty2;
30189
30189
  exports.hasKey = hasKey;
30190
30190
  exports.forEachKey = forEachKey;
30191
30191
  exports.pluck = pluck;
@@ -30255,7 +30255,7 @@ var require_jsprim = __commonJS({
30255
30255
  }
30256
30256
  return true;
30257
30257
  }
30258
- function isEmpty(obj) {
30258
+ function isEmpty2(obj) {
30259
30259
  var key;
30260
30260
  for (key in obj)
30261
30261
  return false;
@@ -52796,7 +52796,7 @@ var require_xml2js = __commonJS({
52796
52796
  "../../node_modules/webfinger/node_modules/xml2js/lib/xml2js.js"(exports) {
52797
52797
  "use strict";
52798
52798
  (function() {
52799
- var events2, isEmpty, sax, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) {
52799
+ var events2, isEmpty2, sax, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) {
52800
52800
  for (var key in parent) {
52801
52801
  if (__hasProp.call(parent, key))
52802
52802
  child[key] = parent[key];
@@ -52815,7 +52815,7 @@ var require_xml2js = __commonJS({
52815
52815
  };
52816
52816
  sax = require_sax();
52817
52817
  events2 = require("events");
52818
- isEmpty = function(thing) {
52818
+ isEmpty2 = function(thing) {
52819
52819
  return typeof thing === "object" && thing != null && Object.keys(thing).length === 0;
52820
52820
  };
52821
52821
  exports.defaults = {
@@ -52935,7 +52935,7 @@ var require_xml2js = __commonJS({
52935
52935
  obj = obj[charkey];
52936
52936
  }
52937
52937
  }
52938
- if (_this.options.emptyTag !== void 0 && isEmpty(obj)) {
52938
+ if (_this.options.emptyTag !== void 0 && isEmpty2(obj)) {
52939
52939
  obj = _this.options.emptyTag;
52940
52940
  }
52941
52941
  if (_this.options.validator != null) {
@@ -57623,6 +57623,9 @@ var Replication_default = Replication;
57623
57623
  // src/db/lucene.ts
57624
57624
  var import_node_fetch2 = __toESM(require("node-fetch"));
57625
57625
  var removeKeyNumbering2 = filters_exports.removeKeyNumbering;
57626
+ function isEmpty(value) {
57627
+ return value == null || value === "";
57628
+ }
57626
57629
  var QueryBuilder = class _QueryBuilder {
57627
57630
  #dbName;
57628
57631
  #index;
@@ -57843,13 +57846,13 @@ var QueryBuilder = class _QueryBuilder {
57843
57846
  delete this.#query.equal.tableId;
57844
57847
  }
57845
57848
  const equal = (key, value) => {
57846
- if (!value && value !== 0) {
57849
+ if (isEmpty(value)) {
57847
57850
  return null;
57848
57851
  }
57849
57852
  return `${key}:${builder.preprocess(value, allPreProcessingOpts)}`;
57850
57853
  };
57851
57854
  const contains = (key, value, mode = "AND") => {
57852
- if (!value || Array.isArray(value) && value.length === 0) {
57855
+ if (isEmpty(value)) {
57853
57856
  return null;
57854
57857
  }
57855
57858
  if (!Array.isArray(value)) {
@@ -57864,7 +57867,7 @@ var QueryBuilder = class _QueryBuilder {
57864
57867
  return `${key}:(${statement})`;
57865
57868
  };
57866
57869
  const fuzzy = (key, value) => {
57867
- if (!value) {
57870
+ if (isEmpty(value)) {
57868
57871
  return null;
57869
57872
  }
57870
57873
  value = builder.preprocess(value, {
@@ -57883,7 +57886,7 @@ var QueryBuilder = class _QueryBuilder {
57883
57886
  return contains(key, value, "OR");
57884
57887
  };
57885
57888
  const oneOf = (key, value) => {
57886
- if (!value) {
57889
+ if (isEmpty(value)) {
57887
57890
  return `*:*`;
57888
57891
  }
57889
57892
  if (!Array.isArray(value)) {
@@ -57930,7 +57933,7 @@ var QueryBuilder = class _QueryBuilder {
57930
57933
  }
57931
57934
  if (this.#query.string) {
57932
57935
  build(this.#query.string, (key, value) => {
57933
- if (!value) {
57936
+ if (isEmpty(value)) {
57934
57937
  return null;
57935
57938
  }
57936
57939
  value = builder.preprocess(value, {
@@ -57943,7 +57946,7 @@ var QueryBuilder = class _QueryBuilder {
57943
57946
  }
57944
57947
  if (this.#query.range) {
57945
57948
  build(this.#query.range, (key, value) => {
57946
- if (!value) {
57949
+ if (isEmpty(value)) {
57947
57950
  return null;
57948
57951
  }
57949
57952
  if (value.low == null || value.low === "") {
@@ -57965,7 +57968,7 @@ var QueryBuilder = class _QueryBuilder {
57965
57968
  }
57966
57969
  if (this.#query.notEqual) {
57967
57970
  build(this.#query.notEqual, (key, value) => {
57968
- if (!value) {
57971
+ if (isEmpty(value)) {
57969
57972
  return null;
57970
57973
  }
57971
57974
  if (typeof value === "boolean") {
@@ -57975,10 +57978,16 @@ var QueryBuilder = class _QueryBuilder {
57975
57978
  });
57976
57979
  }
57977
57980
  if (this.#query.empty) {
57978
- build(this.#query.empty, (key) => `(*:* -${key}:["" TO *])`);
57981
+ build(this.#query.empty, (key) => {
57982
+ allFiltersEmpty = false;
57983
+ return `(*:* -${key}:["" TO *])`;
57984
+ });
57979
57985
  }
57980
57986
  if (this.#query.notEmpty) {
57981
- build(this.#query.notEmpty, (key) => `${key}:["" TO *]`);
57987
+ build(this.#query.notEmpty, (key) => {
57988
+ allFiltersEmpty = false;
57989
+ return `${key}:["" TO *]`;
57990
+ });
57982
57991
  }
57983
57992
  if (this.#query.oneOf) {
57984
57993
  build(this.#query.oneOf, oneOf);