@budibase/backend-core 2.28.5 → 2.28.7
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 +262 -159
- package/dist/index.js.map +3 -3
- package/dist/index.js.meta.json +1 -1
- package/dist/package.json +4 -4
- package/dist/plugins.js.map +2 -2
- package/dist/plugins.js.meta.json +1 -1
- package/dist/src/sql/sql.js +2 -2
- package/dist/src/sql/sql.js.map +1 -1
- package/package.json +4 -4
- package/src/sql/sql.ts +3 -3
package/dist/index.js
CHANGED
|
@@ -61,7 +61,7 @@ var require_dayjs_min = __commonJS({
|
|
|
61
61
|
} }, g = "en", D = {};
|
|
62
62
|
D[g] = M;
|
|
63
63
|
var p = "$isDayjsObject", S = function(t2) {
|
|
64
|
-
return t2 instanceof
|
|
64
|
+
return t2 instanceof _3 || !(!t2 || !t2[p]);
|
|
65
65
|
}, w = function t2(e2, n2, r2) {
|
|
66
66
|
var i2;
|
|
67
67
|
if (!e2)
|
|
@@ -81,12 +81,12 @@ var require_dayjs_min = __commonJS({
|
|
|
81
81
|
if (S(t2))
|
|
82
82
|
return t2.clone();
|
|
83
83
|
var n2 = "object" == typeof e2 ? e2 : {};
|
|
84
|
-
return n2.date = t2, n2.args = arguments, new
|
|
84
|
+
return n2.date = t2, n2.args = arguments, new _3(n2);
|
|
85
85
|
}, b = v;
|
|
86
86
|
b.l = w, b.i = S, b.w = function(t2, e2) {
|
|
87
87
|
return O(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
|
|
88
88
|
};
|
|
89
|
-
var
|
|
89
|
+
var _3 = function() {
|
|
90
90
|
function M2(t2) {
|
|
91
91
|
this.$L = w(t2.locale, null, true), this.parse(t2), this.$x = this.$x || t2.x || {}, this[p] = true;
|
|
92
92
|
}
|
|
@@ -311,13 +311,13 @@ var require_dayjs_min = __commonJS({
|
|
|
311
311
|
}, m2.toString = function() {
|
|
312
312
|
return this.$d.toUTCString();
|
|
313
313
|
}, M2;
|
|
314
|
-
}(), k =
|
|
314
|
+
}(), k = _3.prototype;
|
|
315
315
|
return O.prototype = k, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", c], ["$y", h], ["$D", d]].forEach(function(t2) {
|
|
316
316
|
k[t2[1]] = function(e2) {
|
|
317
317
|
return this.$g(e2, t2[0], t2[1]);
|
|
318
318
|
};
|
|
319
319
|
}), O.extend = function(t2, e2) {
|
|
320
|
-
return t2.$i || (t2(e2,
|
|
320
|
+
return t2.$i || (t2(e2, _3, O), t2.$i = true), O;
|
|
321
321
|
}, O.locale = w, O.isDayjs = S, O.unix = function(t2) {
|
|
322
322
|
return O(1e3 * t2);
|
|
323
323
|
}, O.en = D[g], O.Ls = D, O.p = {}, O;
|
|
@@ -797,12 +797,12 @@ var require_nanoclone = __commonJS({
|
|
|
797
797
|
var map;
|
|
798
798
|
try {
|
|
799
799
|
map = Map;
|
|
800
|
-
} catch (
|
|
800
|
+
} catch (_3) {
|
|
801
801
|
}
|
|
802
802
|
var set2;
|
|
803
803
|
try {
|
|
804
804
|
set2 = Set;
|
|
805
|
-
} catch (
|
|
805
|
+
} catch (_3) {
|
|
806
806
|
}
|
|
807
807
|
function baseClone(src, circulars, clones) {
|
|
808
808
|
if (!src || typeof src !== "object" || typeof src === "function") {
|
|
@@ -1110,7 +1110,7 @@ var require_ValidationError = __commonJS({
|
|
|
1110
1110
|
path: path3
|
|
1111
1111
|
});
|
|
1112
1112
|
if (typeof message === "string")
|
|
1113
|
-
return message.replace(strReg, (
|
|
1113
|
+
return message.replace(strReg, (_3, key) => (0, _printValue.default)(params2[key]));
|
|
1114
1114
|
if (typeof message === "function")
|
|
1115
1115
|
return message(params2);
|
|
1116
1116
|
return message;
|
|
@@ -1171,7 +1171,7 @@ var require_runTests = __commonJS({
|
|
|
1171
1171
|
args,
|
|
1172
1172
|
value,
|
|
1173
1173
|
errors,
|
|
1174
|
-
sort,
|
|
1174
|
+
sort: sort2,
|
|
1175
1175
|
path: path3
|
|
1176
1176
|
} = options2;
|
|
1177
1177
|
let callback = once(cb);
|
|
@@ -1195,8 +1195,8 @@ var require_runTests = __commonJS({
|
|
|
1195
1195
|
}
|
|
1196
1196
|
if (--count <= 0) {
|
|
1197
1197
|
if (nestedErrors.length) {
|
|
1198
|
-
if (
|
|
1199
|
-
nestedErrors.sort(
|
|
1198
|
+
if (sort2)
|
|
1199
|
+
nestedErrors.sort(sort2);
|
|
1200
1200
|
if (errors.length)
|
|
1201
1201
|
nestedErrors.push(...errors);
|
|
1202
1202
|
errors = nestedErrors;
|
|
@@ -2654,7 +2654,7 @@ var require_date = __commonJS({
|
|
|
2654
2654
|
return param2;
|
|
2655
2655
|
}
|
|
2656
2656
|
min(min, message = _locale.date.min) {
|
|
2657
|
-
let
|
|
2657
|
+
let limit2 = this.prepareParam(min, "min");
|
|
2658
2658
|
return this.test({
|
|
2659
2659
|
message,
|
|
2660
2660
|
name: "min",
|
|
@@ -2663,12 +2663,12 @@ var require_date = __commonJS({
|
|
|
2663
2663
|
min
|
|
2664
2664
|
},
|
|
2665
2665
|
test(value) {
|
|
2666
|
-
return (0, _isAbsent.default)(value) || value >= this.resolve(
|
|
2666
|
+
return (0, _isAbsent.default)(value) || value >= this.resolve(limit2);
|
|
2667
2667
|
}
|
|
2668
2668
|
});
|
|
2669
2669
|
}
|
|
2670
2670
|
max(max, message = _locale.date.max) {
|
|
2671
|
-
var
|
|
2671
|
+
var limit2 = this.prepareParam(max, "max");
|
|
2672
2672
|
return this.test({
|
|
2673
2673
|
message,
|
|
2674
2674
|
name: "max",
|
|
@@ -2677,7 +2677,7 @@ var require_date = __commonJS({
|
|
|
2677
2677
|
max
|
|
2678
2678
|
},
|
|
2679
2679
|
test(value) {
|
|
2680
|
-
return (0, _isAbsent.default)(value) || value <= this.resolve(
|
|
2680
|
+
return (0, _isAbsent.default)(value) || value <= this.resolve(limit2);
|
|
2681
2681
|
}
|
|
2682
2682
|
});
|
|
2683
2683
|
}
|
|
@@ -2989,7 +2989,7 @@ var require_object = __commonJS({
|
|
|
2989
2989
|
return;
|
|
2990
2990
|
}
|
|
2991
2991
|
originalValue = originalValue || value;
|
|
2992
|
-
let tests = this._nodes.map((key) => (
|
|
2992
|
+
let tests = this._nodes.map((key) => (_3, cb) => {
|
|
2993
2993
|
let path3 = key.indexOf(".") === -1 ? (opts.path ? `${opts.path}.` : "") + key : `${opts.path || ""}["${key}"]`;
|
|
2994
2994
|
let field = this.fields[key];
|
|
2995
2995
|
if (field && "validate" in field) {
|
|
@@ -3133,7 +3133,7 @@ var require_object = __commonJS({
|
|
|
3133
3133
|
return this.noUnknown(!allow, message);
|
|
3134
3134
|
}
|
|
3135
3135
|
transformKeys(fn) {
|
|
3136
|
-
return this.transform((obj) => obj && (0, _mapKeys.default)(obj, (
|
|
3136
|
+
return this.transform((obj) => obj && (0, _mapKeys.default)(obj, (_3, key) => fn(key)));
|
|
3137
3137
|
}
|
|
3138
3138
|
camelCase() {
|
|
3139
3139
|
return this.transformKeys(_camelCase.default);
|
|
@@ -3266,7 +3266,7 @@ var require_array = __commonJS({
|
|
|
3266
3266
|
index: idx,
|
|
3267
3267
|
originalValue: originalValue[idx]
|
|
3268
3268
|
});
|
|
3269
|
-
tests[idx] = (
|
|
3269
|
+
tests[idx] = (_3, cb) => innerType.validate(item, innerOptions, cb);
|
|
3270
3270
|
}
|
|
3271
3271
|
(0, _runTests.default)({
|
|
3272
3272
|
sync,
|
|
@@ -25741,12 +25741,12 @@ var require_ssh_private = __commonJS({
|
|
|
25741
25741
|
var o = 0;
|
|
25742
25742
|
o += buf.write("-----BEGIN " + header + "-----\n", o);
|
|
25743
25743
|
for (var i = 0; i < tmp.length; ) {
|
|
25744
|
-
var
|
|
25745
|
-
if (
|
|
25746
|
-
|
|
25747
|
-
o += buf.write(tmp.slice(i,
|
|
25744
|
+
var limit2 = i + 70;
|
|
25745
|
+
if (limit2 > tmp.length)
|
|
25746
|
+
limit2 = tmp.length;
|
|
25747
|
+
o += buf.write(tmp.slice(i, limit2), o);
|
|
25748
25748
|
buf[o++] = 10;
|
|
25749
|
-
i =
|
|
25749
|
+
i = limit2;
|
|
25750
25750
|
}
|
|
25751
25751
|
o += buf.write("-----END " + header + "-----\n", o);
|
|
25752
25752
|
return buf.slice(0, o);
|
|
@@ -26002,12 +26002,12 @@ var require_pem = __commonJS({
|
|
|
26002
26002
|
var o = 0;
|
|
26003
26003
|
o += buf.write("-----BEGIN " + header + "-----\n", o);
|
|
26004
26004
|
for (var i = 0; i < tmp.length; ) {
|
|
26005
|
-
var
|
|
26006
|
-
if (
|
|
26007
|
-
|
|
26008
|
-
o += buf.write(tmp.slice(i,
|
|
26005
|
+
var limit2 = i + 64;
|
|
26006
|
+
if (limit2 > tmp.length)
|
|
26007
|
+
limit2 = tmp.length;
|
|
26008
|
+
o += buf.write(tmp.slice(i, limit2), o);
|
|
26009
26009
|
buf[o++] = 10;
|
|
26010
|
-
i =
|
|
26010
|
+
i = limit2;
|
|
26011
26011
|
}
|
|
26012
26012
|
o += buf.write("-----END " + header + "-----\n", o);
|
|
26013
26013
|
return buf.slice(0, o);
|
|
@@ -28137,12 +28137,12 @@ var require_x509_pem = __commonJS({
|
|
|
28137
28137
|
var o = 0;
|
|
28138
28138
|
o += buf.write("-----BEGIN " + header + "-----\n", o);
|
|
28139
28139
|
for (var i = 0; i < tmp.length; ) {
|
|
28140
|
-
var
|
|
28141
|
-
if (
|
|
28142
|
-
|
|
28143
|
-
o += buf.write(tmp.slice(i,
|
|
28140
|
+
var limit2 = i + 64;
|
|
28141
|
+
if (limit2 > tmp.length)
|
|
28142
|
+
limit2 = tmp.length;
|
|
28143
|
+
o += buf.write(tmp.slice(i, limit2), o);
|
|
28144
28144
|
buf[o++] = 10;
|
|
28145
|
-
i =
|
|
28145
|
+
i = limit2;
|
|
28146
28146
|
}
|
|
28147
28147
|
o += buf.write("-----END " + header + "-----\n", o);
|
|
28148
28148
|
return buf.slice(0, o);
|
|
@@ -40992,7 +40992,7 @@ var require_stringify2 = __commonJS({
|
|
|
40992
40992
|
skipNulls: false,
|
|
40993
40993
|
strictNullHandling: false
|
|
40994
40994
|
};
|
|
40995
|
-
var stringify = function stringify2(object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter,
|
|
40995
|
+
var stringify = function stringify2(object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort2, allowDots, serializeDate, formatter, encodeValuesOnly) {
|
|
40996
40996
|
var obj = object;
|
|
40997
40997
|
if (typeof filter === "function") {
|
|
40998
40998
|
obj = filter(prefix, obj);
|
|
@@ -41021,7 +41021,7 @@ var require_stringify2 = __commonJS({
|
|
|
41021
41021
|
objKeys = filter;
|
|
41022
41022
|
} else {
|
|
41023
41023
|
var keys2 = Object.keys(obj);
|
|
41024
|
-
objKeys =
|
|
41024
|
+
objKeys = sort2 ? keys2.sort(sort2) : keys2;
|
|
41025
41025
|
}
|
|
41026
41026
|
for (var i = 0; i < objKeys.length; ++i) {
|
|
41027
41027
|
var key = objKeys[i];
|
|
@@ -41037,7 +41037,7 @@ var require_stringify2 = __commonJS({
|
|
|
41037
41037
|
skipNulls,
|
|
41038
41038
|
encoder,
|
|
41039
41039
|
filter,
|
|
41040
|
-
|
|
41040
|
+
sort2,
|
|
41041
41041
|
allowDots,
|
|
41042
41042
|
serializeDate,
|
|
41043
41043
|
formatter,
|
|
@@ -41052,7 +41052,7 @@ var require_stringify2 = __commonJS({
|
|
|
41052
41052
|
skipNulls,
|
|
41053
41053
|
encoder,
|
|
41054
41054
|
filter,
|
|
41055
|
-
|
|
41055
|
+
sort2,
|
|
41056
41056
|
allowDots,
|
|
41057
41057
|
serializeDate,
|
|
41058
41058
|
formatter,
|
|
@@ -41073,7 +41073,7 @@ var require_stringify2 = __commonJS({
|
|
|
41073
41073
|
var skipNulls = typeof options2.skipNulls === "boolean" ? options2.skipNulls : defaults.skipNulls;
|
|
41074
41074
|
var encode = typeof options2.encode === "boolean" ? options2.encode : defaults.encode;
|
|
41075
41075
|
var encoder = typeof options2.encoder === "function" ? options2.encoder : defaults.encoder;
|
|
41076
|
-
var
|
|
41076
|
+
var sort2 = typeof options2.sort === "function" ? options2.sort : null;
|
|
41077
41077
|
var allowDots = typeof options2.allowDots === "undefined" ? false : options2.allowDots;
|
|
41078
41078
|
var serializeDate = typeof options2.serializeDate === "function" ? options2.serializeDate : defaults.serializeDate;
|
|
41079
41079
|
var encodeValuesOnly = typeof options2.encodeValuesOnly === "boolean" ? options2.encodeValuesOnly : defaults.encodeValuesOnly;
|
|
@@ -41108,8 +41108,8 @@ var require_stringify2 = __commonJS({
|
|
|
41108
41108
|
if (!objKeys) {
|
|
41109
41109
|
objKeys = Object.keys(obj);
|
|
41110
41110
|
}
|
|
41111
|
-
if (
|
|
41112
|
-
objKeys.sort(
|
|
41111
|
+
if (sort2) {
|
|
41112
|
+
objKeys.sort(sort2);
|
|
41113
41113
|
}
|
|
41114
41114
|
for (var i = 0; i < objKeys.length; ++i) {
|
|
41115
41115
|
var key = objKeys[i];
|
|
@@ -41124,7 +41124,7 @@ var require_stringify2 = __commonJS({
|
|
|
41124
41124
|
skipNulls,
|
|
41125
41125
|
encode ? encoder : null,
|
|
41126
41126
|
filter,
|
|
41127
|
-
|
|
41127
|
+
sort2,
|
|
41128
41128
|
allowDots,
|
|
41129
41129
|
serializeDate,
|
|
41130
41130
|
formatter,
|
|
@@ -41158,8 +41158,8 @@ var require_parse = __commonJS({
|
|
|
41158
41158
|
var parseValues = function parseQueryStringValues(str, options2) {
|
|
41159
41159
|
var obj = {};
|
|
41160
41160
|
var cleanStr = options2.ignoreQueryPrefix ? str.replace(/^\?/, "") : str;
|
|
41161
|
-
var
|
|
41162
|
-
var parts = cleanStr.split(options2.delimiter,
|
|
41161
|
+
var limit2 = options2.parameterLimit === Infinity ? void 0 : options2.parameterLimit;
|
|
41162
|
+
var parts = cleanStr.split(options2.delimiter, limit2);
|
|
41163
41163
|
for (var i = 0; i < parts.length; ++i) {
|
|
41164
41164
|
var part = parts[i];
|
|
41165
41165
|
var bracketEqualsPos = part.indexOf("]=");
|
|
@@ -41945,7 +41945,7 @@ var require_uri_all = __commonJS({
|
|
|
41945
41945
|
uriTokens.push("@");
|
|
41946
41946
|
}
|
|
41947
41947
|
if (components.host !== void 0) {
|
|
41948
|
-
uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, function(
|
|
41948
|
+
uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, function(_3, $1, $2) {
|
|
41949
41949
|
return "[" + $1 + ($2 ? "%25" + $2 : "") + "]";
|
|
41950
41950
|
}));
|
|
41951
41951
|
}
|
|
@@ -42869,13 +42869,13 @@ var require_resolve = __commonJS({
|
|
|
42869
42869
|
"required",
|
|
42870
42870
|
"enum"
|
|
42871
42871
|
]);
|
|
42872
|
-
function inlineRef(schema,
|
|
42873
|
-
if (
|
|
42872
|
+
function inlineRef(schema, limit2) {
|
|
42873
|
+
if (limit2 === false)
|
|
42874
42874
|
return false;
|
|
42875
|
-
if (
|
|
42875
|
+
if (limit2 === void 0 || limit2 === true)
|
|
42876
42876
|
return checkNoRef(schema);
|
|
42877
|
-
else if (
|
|
42878
|
-
return countKeys(schema) <=
|
|
42877
|
+
else if (limit2)
|
|
42878
|
+
return countKeys(schema) <= limit2;
|
|
42879
42879
|
}
|
|
42880
42880
|
function checkNoRef(schema) {
|
|
42881
42881
|
var item;
|
|
@@ -54876,13 +54876,14 @@ var SqlNumberTypeRangeMap = {
|
|
|
54876
54876
|
var filters_exports = {};
|
|
54877
54877
|
__export(filters_exports, {
|
|
54878
54878
|
NoEmptyFilterStrings: () => NoEmptyFilterStrings,
|
|
54879
|
-
|
|
54879
|
+
buildQuery: () => buildQuery,
|
|
54880
54880
|
getValidOperatorsForType: () => getValidOperatorsForType,
|
|
54881
54881
|
hasFilters: () => hasFilters,
|
|
54882
|
-
|
|
54883
|
-
luceneSort: () => luceneSort,
|
|
54882
|
+
limit: () => limit,
|
|
54884
54883
|
removeKeyNumbering: () => removeKeyNumbering,
|
|
54885
|
-
|
|
54884
|
+
runQuery: () => runQuery,
|
|
54885
|
+
search: () => search,
|
|
54886
|
+
sort: () => sort
|
|
54886
54887
|
});
|
|
54887
54888
|
var import_dayjs = __toESM(require_dayjs_min());
|
|
54888
54889
|
|
|
@@ -55034,6 +55035,7 @@ function isRequired(constraints) {
|
|
|
55034
55035
|
}
|
|
55035
55036
|
|
|
55036
55037
|
// ../shared-core/src/filters.ts
|
|
55038
|
+
var import_lodash = __toESM(require("lodash"));
|
|
55037
55039
|
var HBS_REGEX = /{{([^{].*?)}}/g;
|
|
55038
55040
|
var getValidOperatorsForType = (fieldType, field, datasource2) => {
|
|
55039
55041
|
const Op = OperatorOptions;
|
|
@@ -55118,7 +55120,7 @@ var removeKeyNumbering = (key) => {
|
|
|
55118
55120
|
return key;
|
|
55119
55121
|
}
|
|
55120
55122
|
};
|
|
55121
|
-
var
|
|
55123
|
+
var buildQuery = (filter) => {
|
|
55122
55124
|
let query = {
|
|
55123
55125
|
string: {},
|
|
55124
55126
|
fuzzy: {},
|
|
@@ -55210,7 +55212,17 @@ var buildLuceneQuery = (filter) => {
|
|
|
55210
55212
|
});
|
|
55211
55213
|
return query;
|
|
55212
55214
|
};
|
|
55213
|
-
var
|
|
55215
|
+
var search = (docs, query) => {
|
|
55216
|
+
let result = runQuery(docs, query.query);
|
|
55217
|
+
if (query.sort) {
|
|
55218
|
+
result = sort(result, query.sort, query.sortOrder || "ascending" /* ASCENDING */);
|
|
55219
|
+
}
|
|
55220
|
+
if (query.limit) {
|
|
55221
|
+
result = limit(result, query.limit.toString());
|
|
55222
|
+
}
|
|
55223
|
+
return result;
|
|
55224
|
+
};
|
|
55225
|
+
var runQuery = (docs, query) => {
|
|
55214
55226
|
if (!docs || !Array.isArray(docs)) {
|
|
55215
55227
|
return [];
|
|
55216
55228
|
}
|
|
@@ -55218,12 +55230,15 @@ var runLuceneQuery = (docs, query) => {
|
|
|
55218
55230
|
return docs;
|
|
55219
55231
|
}
|
|
55220
55232
|
query = cleanupQuery(query);
|
|
55221
|
-
|
|
55222
|
-
|
|
55223
|
-
|
|
55224
|
-
|
|
55225
|
-
|
|
55226
|
-
|
|
55233
|
+
if (!hasFilters(query) && query.onEmptyFilter === "none" /* RETURN_NONE */) {
|
|
55234
|
+
return [];
|
|
55235
|
+
}
|
|
55236
|
+
const match = (type, test) => (doc) => {
|
|
55237
|
+
for (const [key, testValue] of Object.entries(query[type] || {})) {
|
|
55238
|
+
const result = test(deepGet(doc, removeKeyNumbering(key)), testValue);
|
|
55239
|
+
if (query.allOr && result) {
|
|
55240
|
+
return true;
|
|
55241
|
+
} else if (!query.allOr && !result) {
|
|
55227
55242
|
return false;
|
|
55228
55243
|
}
|
|
55229
55244
|
}
|
|
@@ -55232,54 +55247,110 @@ var runLuceneQuery = (docs, query) => {
|
|
|
55232
55247
|
const stringMatch = match(
|
|
55233
55248
|
"string" /* STRING */,
|
|
55234
55249
|
(docValue, testValue) => {
|
|
55235
|
-
|
|
55250
|
+
if (!(typeof docValue === "string")) {
|
|
55251
|
+
return false;
|
|
55252
|
+
}
|
|
55253
|
+
if (!(typeof testValue === "string")) {
|
|
55254
|
+
return false;
|
|
55255
|
+
}
|
|
55256
|
+
return docValue.toLowerCase().startsWith(testValue.toLowerCase());
|
|
55236
55257
|
}
|
|
55237
55258
|
);
|
|
55238
55259
|
const fuzzyMatch = match(
|
|
55239
55260
|
"fuzzy" /* FUZZY */,
|
|
55240
55261
|
(docValue, testValue) => {
|
|
55241
|
-
|
|
55262
|
+
if (!(typeof docValue === "string")) {
|
|
55263
|
+
return false;
|
|
55264
|
+
}
|
|
55265
|
+
if (!(typeof testValue === "string")) {
|
|
55266
|
+
return false;
|
|
55267
|
+
}
|
|
55268
|
+
return docValue.toLowerCase().includes(testValue.toLowerCase());
|
|
55242
55269
|
}
|
|
55243
55270
|
);
|
|
55244
55271
|
const rangeMatch = match(
|
|
55245
55272
|
"range" /* RANGE */,
|
|
55246
55273
|
(docValue, testValue) => {
|
|
55247
55274
|
if (docValue == null || docValue === "") {
|
|
55248
|
-
return
|
|
55275
|
+
return false;
|
|
55276
|
+
}
|
|
55277
|
+
if (import_lodash.default.isObject(testValue.low) && import_lodash.default.isEmpty(testValue.low)) {
|
|
55278
|
+
testValue.low = void 0;
|
|
55249
55279
|
}
|
|
55250
|
-
if (
|
|
55251
|
-
|
|
55280
|
+
if (import_lodash.default.isObject(testValue.high) && import_lodash.default.isEmpty(testValue.high)) {
|
|
55281
|
+
testValue.high = void 0;
|
|
55282
|
+
}
|
|
55283
|
+
if (testValue.low == null && testValue.high == null) {
|
|
55284
|
+
return false;
|
|
55252
55285
|
}
|
|
55253
|
-
|
|
55254
|
-
|
|
55286
|
+
const docNum = +docValue;
|
|
55287
|
+
if (!isNaN(docNum)) {
|
|
55288
|
+
const lowNum = +testValue.low;
|
|
55289
|
+
const highNum = +testValue.high;
|
|
55290
|
+
if (!isNaN(lowNum) && !isNaN(highNum)) {
|
|
55291
|
+
return docNum >= lowNum && docNum <= highNum;
|
|
55292
|
+
} else if (!isNaN(lowNum)) {
|
|
55293
|
+
return docNum >= lowNum;
|
|
55294
|
+
} else if (!isNaN(highNum)) {
|
|
55295
|
+
return docNum <= highNum;
|
|
55296
|
+
}
|
|
55297
|
+
}
|
|
55298
|
+
const docDate = (0, import_dayjs.default)(docValue);
|
|
55299
|
+
if (docDate.isValid()) {
|
|
55300
|
+
const lowDate = (0, import_dayjs.default)(testValue.low || "0000-00-00T00:00:00.000Z");
|
|
55301
|
+
const highDate = (0, import_dayjs.default)(testValue.high || "9999-00-00T00:00:00.000Z");
|
|
55302
|
+
if (lowDate.isValid() && highDate.isValid()) {
|
|
55303
|
+
return docDate.isAfter(lowDate) && docDate.isBefore(highDate) || docDate.isSame(lowDate) || docDate.isSame(highDate);
|
|
55304
|
+
} else if (lowDate.isValid()) {
|
|
55305
|
+
return docDate.isAfter(lowDate) || docDate.isSame(lowDate);
|
|
55306
|
+
} else if (highDate.isValid()) {
|
|
55307
|
+
return docDate.isBefore(highDate) || docDate.isSame(highDate);
|
|
55308
|
+
}
|
|
55309
|
+
}
|
|
55310
|
+
if (testValue.low != null && testValue.high != null) {
|
|
55311
|
+
return docValue >= testValue.low && docValue <= testValue.high;
|
|
55312
|
+
} else if (testValue.low != null) {
|
|
55313
|
+
return docValue >= testValue.low;
|
|
55314
|
+
} else if (testValue.high != null) {
|
|
55315
|
+
return docValue <= testValue.high;
|
|
55255
55316
|
}
|
|
55256
55317
|
return false;
|
|
55257
55318
|
}
|
|
55258
55319
|
);
|
|
55259
|
-
const
|
|
55260
|
-
|
|
55261
|
-
|
|
55262
|
-
|
|
55320
|
+
const _valueMatches = (docValue, testValue) => {
|
|
55321
|
+
if (Array.isArray(docValue)) {
|
|
55322
|
+
for (const item of docValue) {
|
|
55323
|
+
if (_valueMatches(item, testValue)) {
|
|
55324
|
+
return true;
|
|
55325
|
+
}
|
|
55326
|
+
}
|
|
55327
|
+
return false;
|
|
55263
55328
|
}
|
|
55264
|
-
|
|
55329
|
+
if (docValue && typeof docValue === "object" && typeof testValue === "string") {
|
|
55330
|
+
return docValue._id === testValue;
|
|
55331
|
+
}
|
|
55332
|
+
return docValue === testValue;
|
|
55333
|
+
};
|
|
55334
|
+
const not = (f) => (...args) => !f(...args);
|
|
55335
|
+
const equalMatch = match("equal" /* EQUAL */, _valueMatches);
|
|
55265
55336
|
const notEqualMatch = match(
|
|
55266
55337
|
"notEqual" /* NOT_EQUAL */,
|
|
55267
|
-
(
|
|
55268
|
-
return testValue != null && testValue !== "" && docValue === testValue;
|
|
55269
|
-
}
|
|
55338
|
+
not(_valueMatches)
|
|
55270
55339
|
);
|
|
55271
|
-
const
|
|
55272
|
-
"
|
|
55273
|
-
|
|
55274
|
-
return docValue != null && docValue !== "";
|
|
55340
|
+
const _empty = (docValue) => {
|
|
55341
|
+
if (typeof docValue === "string") {
|
|
55342
|
+
return docValue === "";
|
|
55275
55343
|
}
|
|
55276
|
-
|
|
55277
|
-
|
|
55278
|
-
"notEmpty" /* NOT_EMPTY */,
|
|
55279
|
-
(docValue) => {
|
|
55280
|
-
return docValue == null || docValue === "";
|
|
55344
|
+
if (Array.isArray(docValue)) {
|
|
55345
|
+
return docValue.length === 0;
|
|
55281
55346
|
}
|
|
55282
|
-
|
|
55347
|
+
if (typeof docValue === "object") {
|
|
55348
|
+
return Object.keys(docValue).length === 0;
|
|
55349
|
+
}
|
|
55350
|
+
return docValue == null;
|
|
55351
|
+
};
|
|
55352
|
+
const emptyMatch = match("empty" /* EMPTY */, _empty);
|
|
55353
|
+
const notEmptyMatch = match("notEmpty" /* NOT_EMPTY */, not(_empty));
|
|
55283
55354
|
const oneOf = match(
|
|
55284
55355
|
"oneOf" /* ONE_OF */,
|
|
55285
55356
|
(docValue, testValue) => {
|
|
@@ -55289,27 +55360,52 @@ var runLuceneQuery = (docs, query) => {
|
|
|
55289
55360
|
testValue = testValue.map((item) => parseFloat(item));
|
|
55290
55361
|
}
|
|
55291
55362
|
}
|
|
55292
|
-
|
|
55363
|
+
if (!Array.isArray(testValue)) {
|
|
55364
|
+
return false;
|
|
55365
|
+
}
|
|
55366
|
+
return testValue.some((item) => _valueMatches(docValue, item));
|
|
55293
55367
|
}
|
|
55294
55368
|
);
|
|
55295
|
-
const
|
|
55296
|
-
|
|
55297
|
-
|
|
55298
|
-
return !docValue?.includes(...testValue);
|
|
55369
|
+
const _contains = (f) => (docValue, testValue) => {
|
|
55370
|
+
if (!Array.isArray(docValue)) {
|
|
55371
|
+
return false;
|
|
55299
55372
|
}
|
|
55300
|
-
|
|
55373
|
+
if (typeof testValue === "string") {
|
|
55374
|
+
testValue = testValue.split(",");
|
|
55375
|
+
if (typeof docValue[0] === "number") {
|
|
55376
|
+
testValue = testValue.map((item) => parseFloat(item));
|
|
55377
|
+
}
|
|
55378
|
+
}
|
|
55379
|
+
if (!Array.isArray(testValue)) {
|
|
55380
|
+
return false;
|
|
55381
|
+
}
|
|
55382
|
+
if (testValue.length === 0) {
|
|
55383
|
+
return true;
|
|
55384
|
+
}
|
|
55385
|
+
return testValue[f]((item) => _valueMatches(docValue, item));
|
|
55386
|
+
};
|
|
55301
55387
|
const contains = match(
|
|
55302
55388
|
"contains" /* CONTAINS */,
|
|
55303
55389
|
(docValue, testValue) => {
|
|
55304
|
-
|
|
55390
|
+
if (Array.isArray(testValue) && testValue.length === 0) {
|
|
55391
|
+
return true;
|
|
55392
|
+
}
|
|
55393
|
+
return _contains("every")(docValue, testValue);
|
|
55305
55394
|
}
|
|
55306
55395
|
);
|
|
55307
55396
|
const notContains = match(
|
|
55308
55397
|
"notContains" /* NOT_CONTAINS */,
|
|
55309
55398
|
(docValue, testValue) => {
|
|
55310
|
-
|
|
55399
|
+
if (Array.isArray(testValue) && testValue.length === 0) {
|
|
55400
|
+
return true;
|
|
55401
|
+
}
|
|
55402
|
+
return not(_contains("every"))(docValue, testValue);
|
|
55311
55403
|
}
|
|
55312
55404
|
);
|
|
55405
|
+
const containsAny = match(
|
|
55406
|
+
"containsAny" /* CONTAINS_ANY */,
|
|
55407
|
+
_contains("some")
|
|
55408
|
+
);
|
|
55313
55409
|
const docMatch = (doc) => {
|
|
55314
55410
|
const filterFunctions = {
|
|
55315
55411
|
string: stringMatch,
|
|
@@ -55324,11 +55420,10 @@ var runLuceneQuery = (docs, query) => {
|
|
|
55324
55420
|
containsAny,
|
|
55325
55421
|
notContains
|
|
55326
55422
|
};
|
|
55327
|
-
const
|
|
55423
|
+
const results = Object.entries(query || {}).filter(
|
|
55328
55424
|
([key, value]) => !["allOr", "onEmptyFilter"].includes(key) && value && Object.keys(value).length > 0
|
|
55329
|
-
).map(([key]) =>
|
|
55330
|
-
|
|
55331
|
-
return filterFunctions[filterKey]?.(doc) ?? false;
|
|
55425
|
+
).map(([key]) => {
|
|
55426
|
+
return filterFunctions[key]?.(doc) ?? false;
|
|
55332
55427
|
});
|
|
55333
55428
|
if (query.allOr) {
|
|
55334
55429
|
return results.some((result) => result === true);
|
|
@@ -55338,23 +55433,31 @@ var runLuceneQuery = (docs, query) => {
|
|
|
55338
55433
|
};
|
|
55339
55434
|
return docs.filter(docMatch);
|
|
55340
55435
|
};
|
|
55341
|
-
var
|
|
55342
|
-
if (!
|
|
55436
|
+
var sort = (docs, sort2, sortOrder, sortType = "string" /* STRING */) => {
|
|
55437
|
+
if (!sort2 || !sortOrder || !sortType) {
|
|
55343
55438
|
return docs;
|
|
55344
55439
|
}
|
|
55345
|
-
const parse2 =
|
|
55440
|
+
const parse2 = (x) => {
|
|
55441
|
+
if (x == null) {
|
|
55442
|
+
return x;
|
|
55443
|
+
}
|
|
55444
|
+
if (sortType === "string") {
|
|
55445
|
+
return `${x}`;
|
|
55446
|
+
}
|
|
55447
|
+
return parseFloat(x);
|
|
55448
|
+
};
|
|
55346
55449
|
return docs.slice().sort((a, b) => {
|
|
55347
|
-
const colA = parse2(a[
|
|
55348
|
-
const colB = parse2(b[
|
|
55450
|
+
const colA = parse2(a[sort2]);
|
|
55451
|
+
const colB = parse2(b[sort2]);
|
|
55452
|
+
const result = colB == null || colA > colB ? 1 : -1;
|
|
55349
55453
|
if (sortOrder.toLowerCase() === "descending") {
|
|
55350
|
-
return
|
|
55351
|
-
} else {
|
|
55352
|
-
return colA > colB ? 1 : -1;
|
|
55454
|
+
return result * -1;
|
|
55353
55455
|
}
|
|
55456
|
+
return result;
|
|
55354
55457
|
});
|
|
55355
55458
|
};
|
|
55356
|
-
var
|
|
55357
|
-
const numLimit = parseFloat(
|
|
55459
|
+
var limit = (docs, limit2) => {
|
|
55460
|
+
const numLimit = parseFloat(limit2);
|
|
55358
55461
|
if (isNaN(numLimit)) {
|
|
55359
55462
|
return docs;
|
|
55360
55463
|
}
|
|
@@ -55487,7 +55590,7 @@ __export(users_exports, {
|
|
|
55487
55590
|
isCreator: () => isCreator,
|
|
55488
55591
|
isGlobalBuilder: () => isGlobalBuilder
|
|
55489
55592
|
});
|
|
55490
|
-
var
|
|
55593
|
+
var _2 = __toESM(require("lodash/fp"));
|
|
55491
55594
|
function isBuilder(user, appId) {
|
|
55492
55595
|
if (!user) {
|
|
55493
55596
|
return false;
|
|
@@ -55529,10 +55632,10 @@ function hasAppCreatorPermissions(user) {
|
|
|
55529
55632
|
if (!user) {
|
|
55530
55633
|
return false;
|
|
55531
55634
|
}
|
|
55532
|
-
return
|
|
55533
|
-
|
|
55534
|
-
|
|
55535
|
-
|
|
55635
|
+
return _2.flow(
|
|
55636
|
+
_2.get("roles"),
|
|
55637
|
+
_2.values,
|
|
55638
|
+
_2.find((x) => ["CREATOR", "ADMIN"].includes(x)),
|
|
55536
55639
|
(x) => !!x
|
|
55537
55640
|
)(user);
|
|
55538
55641
|
}
|
|
@@ -58008,15 +58111,15 @@ var QueryBuilder = class _QueryBuilder {
|
|
|
58008
58111
|
this.#query.equal.tableId = tableId;
|
|
58009
58112
|
return this;
|
|
58010
58113
|
}
|
|
58011
|
-
setLimit(
|
|
58012
|
-
if (
|
|
58013
|
-
this.#limit =
|
|
58114
|
+
setLimit(limit2) {
|
|
58115
|
+
if (limit2 != null) {
|
|
58116
|
+
this.#limit = limit2;
|
|
58014
58117
|
}
|
|
58015
58118
|
return this;
|
|
58016
58119
|
}
|
|
58017
|
-
setSort(
|
|
58018
|
-
if (
|
|
58019
|
-
this.#sort =
|
|
58120
|
+
setSort(sort2) {
|
|
58121
|
+
if (sort2 != null) {
|
|
58122
|
+
this.#sort = sort2;
|
|
58020
58123
|
}
|
|
58021
58124
|
return this;
|
|
58022
58125
|
}
|
|
@@ -58387,18 +58490,18 @@ var QueryBuilder = class _QueryBuilder {
|
|
|
58387
58490
|
const fullPath = `${url}/${this.#dbName}/_design/database/_search/${this.#index}`;
|
|
58388
58491
|
const body2 = this.buildSearchBody();
|
|
58389
58492
|
try {
|
|
58390
|
-
return await
|
|
58493
|
+
return await runQuery2(fullPath, body2, cookie);
|
|
58391
58494
|
} catch (err) {
|
|
58392
58495
|
if (err.status === 404 && this.#indexBuilder) {
|
|
58393
58496
|
await this.#indexBuilder();
|
|
58394
|
-
return await
|
|
58497
|
+
return await runQuery2(fullPath, body2, cookie);
|
|
58395
58498
|
} else {
|
|
58396
58499
|
throw err;
|
|
58397
58500
|
}
|
|
58398
58501
|
}
|
|
58399
58502
|
}
|
|
58400
58503
|
};
|
|
58401
|
-
async function
|
|
58504
|
+
async function runQuery2(url, body2, cookie) {
|
|
58402
58505
|
const response = await (0, import_node_fetch2.default)(url, {
|
|
58403
58506
|
body: JSON.stringify(body2),
|
|
58404
58507
|
method: "POST",
|
|
@@ -58455,44 +58558,44 @@ async function recursiveSearch(dbName, index2, query, params2) {
|
|
|
58455
58558
|
return await recursiveSearch(dbName, index2, query, newParams);
|
|
58456
58559
|
}
|
|
58457
58560
|
async function paginatedSearch(dbName, index2, query, params2) {
|
|
58458
|
-
let
|
|
58459
|
-
if (
|
|
58460
|
-
|
|
58561
|
+
let limit2 = params2.limit;
|
|
58562
|
+
if (limit2 == null || isNaN(limit2) || limit2 < 0) {
|
|
58563
|
+
limit2 = 50;
|
|
58461
58564
|
}
|
|
58462
|
-
|
|
58463
|
-
const
|
|
58565
|
+
limit2 = Math.min(limit2, QueryBuilder.maxLimit);
|
|
58566
|
+
const search2 = new QueryBuilder(dbName, index2, query);
|
|
58464
58567
|
if (params2.version) {
|
|
58465
|
-
|
|
58568
|
+
search2.setVersion(params2.version);
|
|
58466
58569
|
}
|
|
58467
58570
|
if (params2.tableId) {
|
|
58468
|
-
|
|
58571
|
+
search2.setTable(params2.tableId);
|
|
58469
58572
|
}
|
|
58470
58573
|
if (params2.sort) {
|
|
58471
|
-
|
|
58574
|
+
search2.setSort(params2.sort).setSortOrder(params2.sortOrder).setSortType(params2.sortType);
|
|
58472
58575
|
}
|
|
58473
58576
|
if (params2.indexer) {
|
|
58474
|
-
|
|
58577
|
+
search2.setIndexBuilder(params2.indexer);
|
|
58475
58578
|
}
|
|
58476
58579
|
if (params2.disableEscaping) {
|
|
58477
|
-
|
|
58580
|
+
search2.disableEscaping();
|
|
58478
58581
|
}
|
|
58479
|
-
const searchResults = await
|
|
58480
|
-
|
|
58582
|
+
const searchResults = await search2.setBookmark(params2.bookmark).setLimit(limit2).run();
|
|
58583
|
+
search2.setBookmark(searchResults.bookmark).setLimit(1);
|
|
58481
58584
|
if (params2.tableId) {
|
|
58482
|
-
|
|
58585
|
+
search2.setTable(params2.tableId);
|
|
58483
58586
|
}
|
|
58484
|
-
const nextResults = await
|
|
58587
|
+
const nextResults = await search2.run();
|
|
58485
58588
|
return {
|
|
58486
58589
|
...searchResults,
|
|
58487
58590
|
hasNextPage: nextResults.rows && nextResults.rows.length > 0
|
|
58488
58591
|
};
|
|
58489
58592
|
}
|
|
58490
58593
|
async function fullSearch(dbName, index2, query, params2) {
|
|
58491
|
-
let
|
|
58492
|
-
if (
|
|
58493
|
-
|
|
58594
|
+
let limit2 = params2.limit;
|
|
58595
|
+
if (limit2 == null || isNaN(limit2) || limit2 < 0) {
|
|
58596
|
+
limit2 = 1e3;
|
|
58494
58597
|
}
|
|
58495
|
-
params2.limit = Math.min(
|
|
58598
|
+
params2.limit = Math.min(limit2, 1e3);
|
|
58496
58599
|
const rows = await recursiveSearch(dbName, index2, query, params2);
|
|
58497
58600
|
return { rows };
|
|
58498
58601
|
}
|
|
@@ -61552,8 +61655,8 @@ var limited = async (event) => {
|
|
|
61552
61655
|
const cachedEvent = await readEvent(event);
|
|
61553
61656
|
if (cachedEvent) {
|
|
61554
61657
|
const timestamp = new Date(cachedEvent.timestamp);
|
|
61555
|
-
const
|
|
61556
|
-
switch (
|
|
61658
|
+
const limit2 = RATE_LIMITS[event];
|
|
61659
|
+
switch (limit2) {
|
|
61557
61660
|
case "calendarDay" /* CALENDAR_DAY */: {
|
|
61558
61661
|
timestamp.setDate(timestamp.getDate() + 1);
|
|
61559
61662
|
timestamp.setHours(0, 0, 0, 0);
|
|
@@ -61584,9 +61687,9 @@ var readEvent = async (event) => {
|
|
|
61584
61687
|
};
|
|
61585
61688
|
var recordEvent = async (event, properties) => {
|
|
61586
61689
|
const key = eventKey(event);
|
|
61587
|
-
const
|
|
61690
|
+
const limit2 = RATE_LIMITS[event];
|
|
61588
61691
|
let ttl;
|
|
61589
|
-
switch (
|
|
61692
|
+
switch (limit2) {
|
|
61590
61693
|
case "calendarDay" /* CALENDAR_DAY */: {
|
|
61591
61694
|
ttl = 86400 /* ONE_DAY */;
|
|
61592
61695
|
}
|
|
@@ -63906,15 +64009,15 @@ var environmentVariable_default = {
|
|
|
63906
64009
|
};
|
|
63907
64010
|
|
|
63908
64011
|
// src/events/publishers/auditLog.ts
|
|
63909
|
-
async function filtered(
|
|
64012
|
+
async function filtered(search2) {
|
|
63910
64013
|
const properties = {
|
|
63911
|
-
filters:
|
|
64014
|
+
filters: search2
|
|
63912
64015
|
};
|
|
63913
64016
|
await publishEvent("audit_log:filtered" /* AUDIT_LOGS_FILTERED */, properties);
|
|
63914
64017
|
}
|
|
63915
|
-
async function downloaded(
|
|
64018
|
+
async function downloaded(search2) {
|
|
63916
64019
|
const properties = {
|
|
63917
|
-
filters:
|
|
64020
|
+
filters: search2
|
|
63918
64021
|
};
|
|
63919
64022
|
await publishEvent("audit_log:downloaded" /* AUDIT_LOGS_DOWNLOADED */, properties);
|
|
63920
64023
|
}
|
|
@@ -64708,10 +64811,10 @@ async function paginatedUsers({
|
|
|
64708
64811
|
bookmark,
|
|
64709
64812
|
query,
|
|
64710
64813
|
appId,
|
|
64711
|
-
limit
|
|
64814
|
+
limit: limit2
|
|
64712
64815
|
} = {}) {
|
|
64713
64816
|
const db = getGlobalDB();
|
|
64714
|
-
const pageSize =
|
|
64817
|
+
const pageSize = limit2 ?? PAGE_LIMIT;
|
|
64715
64818
|
const pageLimit = pageSize + 1;
|
|
64716
64819
|
const opts = {
|
|
64717
64820
|
include_docs: true,
|
|
@@ -67636,17 +67739,17 @@ var InternalBuilder = class {
|
|
|
67636
67739
|
return query;
|
|
67637
67740
|
}
|
|
67638
67741
|
addSorting(query, json) {
|
|
67639
|
-
let { sort, paginate } = json;
|
|
67742
|
+
let { sort: sort2, paginate } = json;
|
|
67640
67743
|
const table = json.meta.table;
|
|
67641
67744
|
const tableName = getTableName(table);
|
|
67642
67745
|
const aliases = json.tableAliases;
|
|
67643
67746
|
const aliased = tableName && aliases?.[tableName] ? aliases[tableName] : table?.name;
|
|
67644
|
-
if (
|
|
67645
|
-
for (let [key, value] of Object.entries(
|
|
67646
|
-
const direction = value.direction === "
|
|
67747
|
+
if (sort2 && Object.keys(sort2 || {}).length > 0) {
|
|
67748
|
+
for (let [key, value] of Object.entries(sort2)) {
|
|
67749
|
+
const direction = value.direction === "ascending" /* ASCENDING */ ? "asc" : "desc";
|
|
67647
67750
|
let nulls;
|
|
67648
67751
|
if (this.client === "pg" /* POSTGRES */) {
|
|
67649
|
-
nulls = value.direction === "
|
|
67752
|
+
nulls = value.direction === "ascending" /* ASCENDING */ ? "first" : "last";
|
|
67650
67753
|
}
|
|
67651
67754
|
query = query.orderBy(`${aliased}.${key}`, direction, nulls);
|
|
67652
67755
|
}
|
|
@@ -67757,7 +67860,7 @@ var InternalBuilder = class {
|
|
|
67757
67860
|
const parsedBody = body2.map((row) => parseBody(row));
|
|
67758
67861
|
return query.insert(parsedBody);
|
|
67759
67862
|
}
|
|
67760
|
-
read(knex3, json,
|
|
67863
|
+
read(knex3, json, limit2) {
|
|
67761
67864
|
let { endpoint, resource, filters, paginate, relationships, tableAliases } = json;
|
|
67762
67865
|
const tableName = endpoint.entityId;
|
|
67763
67866
|
if (!resource) {
|
|
@@ -67767,7 +67870,7 @@ var InternalBuilder = class {
|
|
|
67767
67870
|
if (resource.fields && resource.fields.length > 0) {
|
|
67768
67871
|
selectStatement = generateSelectStatement(json, knex3);
|
|
67769
67872
|
}
|
|
67770
|
-
let foundLimit =
|
|
67873
|
+
let foundLimit = limit2 || BASE_LIMIT;
|
|
67771
67874
|
let foundOffset = null;
|
|
67772
67875
|
if (paginate && paginate.page && paginate.limit) {
|
|
67773
67876
|
const page = paginate.page <= 1 ? 0 : paginate.page - 1;
|
|
@@ -67833,9 +67936,9 @@ var InternalBuilder = class {
|
|
|
67833
67936
|
};
|
|
67834
67937
|
var SqlQueryBuilder = class extends sqlTable_default {
|
|
67835
67938
|
// pass through client to get flavour of SQL
|
|
67836
|
-
constructor(client,
|
|
67939
|
+
constructor(client, limit2 = BASE_LIMIT) {
|
|
67837
67940
|
super(client);
|
|
67838
|
-
this.limit =
|
|
67941
|
+
this.limit = limit2;
|
|
67839
67942
|
}
|
|
67840
67943
|
/**
|
|
67841
67944
|
* @param json The JSON query DSL which is to be converted to SQL.
|