@pol-studios/db 1.0.47 → 1.0.49
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/{DataLayerContext-DWlohoEg.d.ts → DataLayerContext--jqUiEMX.d.ts} +39 -2
- package/dist/auth/context.js +3 -3
- package/dist/auth/hooks.js +4 -4
- package/dist/auth/index.js +4 -4
- package/dist/chunk-CTRY7JDP.js +4112 -0
- package/dist/chunk-CTRY7JDP.js.map +1 -0
- package/dist/{chunk-5TWB3SMJ.js → chunk-DKUF2FKB.js} +2 -2
- package/dist/{chunk-UCXYYGFG.js → chunk-FLGHJCW3.js} +2 -2
- package/dist/{chunk-HJXJIBXC.js → chunk-GAJHPZ6N.js} +14 -11
- package/dist/chunk-GAJHPZ6N.js.map +1 -0
- package/dist/{chunk-POU4MVXN.js → chunk-GY7HDOBA.js} +3 -3
- package/dist/chunk-INEUG6MC.js +521 -0
- package/dist/chunk-INEUG6MC.js.map +1 -0
- package/dist/{chunk-LF3V3ERS.js → chunk-OKYHI6JG.js} +3 -3
- package/dist/{chunk-AKIRHA4Q.js → chunk-UJWETW36.js} +418 -527
- package/dist/chunk-UJWETW36.js.map +1 -0
- package/dist/{chunk-5KZ5ZB7B.js → chunk-V4MNSMMA.js} +70 -13
- package/dist/chunk-V4MNSMMA.js.map +1 -0
- package/dist/{chunk-FI6JAD5G.js → chunk-YA6MUTA7.js} +3 -3
- package/dist/{chunk-Z456IHCB.js → chunk-Z3EJX3VG.js} +3 -3
- package/dist/{chunk-WM25QE7E.js → chunk-ZGQ7Q4ZU.js} +2 -2
- package/dist/hooks/index.d.ts +2 -2
- package/dist/{index-CvAHE2Y2.d.ts → index-CJ8GAb_-.d.ts} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +11 -11
- package/dist/index.native.d.ts +5 -5
- package/dist/index.native.js +11 -11
- package/dist/index.web.d.ts +6 -6
- package/dist/index.web.js +11 -11
- package/dist/mutation/index.js +3 -3
- package/dist/parser/index.js +3 -3
- package/dist/query/index.js +4 -4
- package/dist/realtime/index.js +3 -3
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.js +4 -4
- package/dist/{useDbCount-Chl9uuR1.d.ts → useDbCount-DeXtNH0E.d.ts} +1 -1
- package/dist/{useResolveFeedback-lNxMVfUw.d.ts → useResolveFeedback-HTdDM4AQ.d.ts} +3 -3
- package/dist/with-auth/index.js +5 -5
- package/package.json +1 -1
- package/dist/chunk-5KZ5ZB7B.js.map +0 -1
- package/dist/chunk-AKIRHA4Q.js.map +0 -1
- package/dist/chunk-HJXJIBXC.js.map +0 -1
- package/dist/chunk-JOULSXOI.js +0 -415
- package/dist/chunk-JOULSXOI.js.map +0 -1
- package/dist/chunk-YUX6RGLZ.js +0 -1858
- package/dist/chunk-YUX6RGLZ.js.map +0 -1
- /package/dist/{chunk-5TWB3SMJ.js.map → chunk-DKUF2FKB.js.map} +0 -0
- /package/dist/{chunk-UCXYYGFG.js.map → chunk-FLGHJCW3.js.map} +0 -0
- /package/dist/{chunk-POU4MVXN.js.map → chunk-GY7HDOBA.js.map} +0 -0
- /package/dist/{chunk-LF3V3ERS.js.map → chunk-OKYHI6JG.js.map} +0 -0
- /package/dist/{chunk-FI6JAD5G.js.map → chunk-YA6MUTA7.js.map} +0 -0
- /package/dist/{chunk-Z456IHCB.js.map → chunk-Z3EJX3VG.js.map} +0 -0
- /package/dist/{chunk-WM25QE7E.js.map → chunk-ZGQ7Q4ZU.js.map} +0 -0
|
@@ -1,11 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
deepEqual,
|
|
3
|
+
flatten
|
|
4
|
+
} from "./chunk-INEUG6MC.js";
|
|
1
5
|
import {
|
|
2
6
|
__commonJS,
|
|
3
7
|
__toESM
|
|
4
8
|
} from "./chunk-7D4SUZUM.js";
|
|
5
9
|
|
|
6
|
-
// ../../../node_modules/.pnpm/xregexp@5.1.
|
|
10
|
+
// ../../../node_modules/.pnpm/xregexp@5.1.2/node_modules/xregexp/tools/output/categories.js
|
|
7
11
|
var require_categories = __commonJS({
|
|
8
|
-
"../../../node_modules/.pnpm/xregexp@5.1.
|
|
12
|
+
"../../../node_modules/.pnpm/xregexp@5.1.2/node_modules/xregexp/tools/output/categories.js"(exports, module) {
|
|
9
13
|
module.exports = [
|
|
10
14
|
{
|
|
11
15
|
"name": "C",
|
|
@@ -227,9 +231,9 @@ var require_categories = __commonJS({
|
|
|
227
231
|
}
|
|
228
232
|
});
|
|
229
233
|
|
|
230
|
-
// ../../../node_modules/.pnpm/xregexp@5.1.
|
|
234
|
+
// ../../../node_modules/.pnpm/xregexp@5.1.2/node_modules/xregexp/tools/output/properties.js
|
|
231
235
|
var require_properties = __commonJS({
|
|
232
|
-
"../../../node_modules/.pnpm/xregexp@5.1.
|
|
236
|
+
"../../../node_modules/.pnpm/xregexp@5.1.2/node_modules/xregexp/tools/output/properties.js"(exports, module) {
|
|
233
237
|
module.exports = [
|
|
234
238
|
{
|
|
235
239
|
"name": "ASCII",
|
|
@@ -274,9 +278,9 @@ var require_properties = __commonJS({
|
|
|
274
278
|
}
|
|
275
279
|
});
|
|
276
280
|
|
|
277
|
-
// ../../../node_modules/.pnpm/xregexp@5.1.
|
|
281
|
+
// ../../../node_modules/.pnpm/xregexp@5.1.2/node_modules/xregexp/tools/output/scripts.js
|
|
278
282
|
var require_scripts = __commonJS({
|
|
279
|
-
"../../../node_modules/.pnpm/xregexp@5.1.
|
|
283
|
+
"../../../node_modules/.pnpm/xregexp@5.1.2/node_modules/xregexp/tools/output/scripts.js"(exports, module) {
|
|
280
284
|
module.exports = [
|
|
281
285
|
{
|
|
282
286
|
"name": "Adlam",
|
|
@@ -942,15 +946,90 @@ var require_scripts = __commonJS({
|
|
|
942
946
|
}
|
|
943
947
|
});
|
|
944
948
|
|
|
945
|
-
//
|
|
949
|
+
// src/parser/lib/sort-search-param.ts
|
|
950
|
+
var sortSearchParams = (params) => new URLSearchParams(Array.from(params.entries()).sort((a, b) => {
|
|
951
|
+
const x = `${a[0]}${a[1]}`;
|
|
952
|
+
const y = `${b[0]}${b[1]}`;
|
|
953
|
+
return x > y ? 1 : -1;
|
|
954
|
+
}));
|
|
955
|
+
|
|
956
|
+
// src/parser/lib/encode-object.ts
|
|
957
|
+
var encodeObject = (obj) => {
|
|
958
|
+
const sortedEntries = Object.entries(flatten(obj)).sort(([a], [b]) => a.length - b.length);
|
|
959
|
+
const bodyParams = new URLSearchParams();
|
|
960
|
+
sortedEntries.forEach(([key, value]) => {
|
|
961
|
+
bodyParams.append(key, String(value));
|
|
962
|
+
});
|
|
963
|
+
return sortSearchParams(bodyParams).toString();
|
|
964
|
+
};
|
|
965
|
+
|
|
966
|
+
// src/parser/lib/is-object.ts
|
|
967
|
+
var isObject = (v) => typeof v === "object" && !Array.isArray(v) && v !== null;
|
|
968
|
+
|
|
969
|
+
// src/parser/lib/find-last-index.ts
|
|
970
|
+
function findLastIndex(array, predicate) {
|
|
971
|
+
let l = array.length;
|
|
972
|
+
while (l--) {
|
|
973
|
+
if (predicate(array[l], l, array)) return l;
|
|
974
|
+
}
|
|
975
|
+
return -1;
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
// src/parser/lib/is-not-null.ts
|
|
979
|
+
var isNotNull = (i) => i !== null;
|
|
980
|
+
|
|
981
|
+
// src/parser/lib/operators.ts
|
|
982
|
+
var buildLikeRegex = (search) => new RegExp(`^${search.replace(/%/g, ".*")}$`);
|
|
983
|
+
var textSearch = (c, v) => {
|
|
984
|
+
const regExp = `^${v.split("&").map((v2) => v2.trim().toLowerCase()).join("|").replace(/:\*/g, ".*")}$`;
|
|
985
|
+
const tokens2 = c.match(/'(.*?)'/g).map((t) => t.replace(/'/g, "").toLowerCase());
|
|
986
|
+
return tokens2.some((t) => new RegExp(regExp).test(t));
|
|
987
|
+
};
|
|
988
|
+
var ifDateGetTime = (v) => v instanceof Date ? v.getTime() : v;
|
|
989
|
+
var enclose = (v, char) => {
|
|
990
|
+
if (!v.startsWith(char)) v = `${char}${v}`;
|
|
991
|
+
if (!v.endsWith(char)) v = `${v}${char}`;
|
|
992
|
+
return v;
|
|
993
|
+
};
|
|
994
|
+
var OPERATOR_MAP = {
|
|
995
|
+
eq: (c, v) => ifDateGetTime(c) === ifDateGetTime(v),
|
|
996
|
+
neq: (c, v) => ifDateGetTime(c) !== ifDateGetTime(v),
|
|
997
|
+
gt: (c, v) => c > v,
|
|
998
|
+
gte: (c, v) => c >= v,
|
|
999
|
+
lt: (c, v) => c < v,
|
|
1000
|
+
lte: (c, v) => c <= v,
|
|
1001
|
+
like: (c, v) => buildLikeRegex(v).test(c.toString()),
|
|
1002
|
+
ilike: (c, v) => buildLikeRegex(v.toLowerCase()).test(c.toString().toLowerCase()),
|
|
1003
|
+
is: (c, v) => c === v,
|
|
1004
|
+
in: (c, v) => {
|
|
1005
|
+
const parsedValue = v.slice(1, -1).split(",");
|
|
1006
|
+
return parsedValue.some((i) => i === c);
|
|
1007
|
+
},
|
|
1008
|
+
// contains
|
|
1009
|
+
cs: (c, v) => {
|
|
1010
|
+
if (!Array.isArray(c)) return false;
|
|
1011
|
+
if (!Array.isArray(v)) v = v.slice(1, -1).split(",");
|
|
1012
|
+
return v.every((i) => c.some((colVal) => deepEqual(colVal, i)));
|
|
1013
|
+
},
|
|
1014
|
+
// containedBy
|
|
1015
|
+
cd: (c, v) => {
|
|
1016
|
+
if (!Array.isArray(c)) return false;
|
|
1017
|
+
if (!Array.isArray(v)) v = v.slice(1, -1).split(",");
|
|
1018
|
+
return c.every((i) => v.some((cmpVal) => deepEqual(cmpVal, i)));
|
|
1019
|
+
},
|
|
1020
|
+
fts: textSearch,
|
|
1021
|
+
plfts: (c, v) => buildLikeRegex(enclose(v.toLowerCase(), "%")).test(c.toString().toLowerCase())
|
|
1022
|
+
};
|
|
1023
|
+
|
|
1024
|
+
// ../../../node_modules/.pnpm/xregexp@5.1.2/node_modules/xregexp/src/xregexp.js
|
|
946
1025
|
var REGEX_DATA = "xregexp";
|
|
947
1026
|
var features = {
|
|
948
1027
|
astral: false,
|
|
949
1028
|
namespacing: true
|
|
950
1029
|
};
|
|
951
1030
|
var fixed = {};
|
|
952
|
-
var regexCache =
|
|
953
|
-
var patternCache =
|
|
1031
|
+
var regexCache = /* @__PURE__ */ Object.create(null);
|
|
1032
|
+
var patternCache = /* @__PURE__ */ Object.create(null);
|
|
954
1033
|
var tokens = [];
|
|
955
1034
|
var defaultScope = "default";
|
|
956
1035
|
var classScope = "class";
|
|
@@ -1256,7 +1335,7 @@ function XRegExp(pattern, flags) {
|
|
|
1256
1335
|
);
|
|
1257
1336
|
}
|
|
1258
1337
|
XRegExp.prototype = new RegExp();
|
|
1259
|
-
XRegExp.version = "5.1.
|
|
1338
|
+
XRegExp.version = "5.1.2";
|
|
1260
1339
|
XRegExp._clipDuplicates = clipDuplicates;
|
|
1261
1340
|
XRegExp._hasNativeFlag = hasNativeFlag;
|
|
1262
1341
|
XRegExp._dec = dec;
|
|
@@ -1296,9 +1375,9 @@ XRegExp.cache = (pattern, flags) => {
|
|
|
1296
1375
|
};
|
|
1297
1376
|
XRegExp.cache.flush = (cacheName) => {
|
|
1298
1377
|
if (cacheName === "patterns") {
|
|
1299
|
-
patternCache =
|
|
1378
|
+
patternCache = /* @__PURE__ */ Object.create(null);
|
|
1300
1379
|
} else {
|
|
1301
|
-
regexCache =
|
|
1380
|
+
regexCache = /* @__PURE__ */ Object.create(null);
|
|
1302
1381
|
}
|
|
1303
1382
|
};
|
|
1304
1383
|
XRegExp.escape = (str) => String(nullThrows(str)).replace(/[\\\[\]{}()*+?.^$|]/g, "\\$&").replace(/[\s#\-,]/g, (match) => `\\u${pad4(hex(match.charCodeAt(0)))}`);
|
|
@@ -1751,7 +1830,7 @@ XRegExp.addToken(
|
|
|
1751
1830
|
);
|
|
1752
1831
|
var xregexp_default = XRegExp;
|
|
1753
1832
|
|
|
1754
|
-
// ../../../node_modules/.pnpm/xregexp@5.1.
|
|
1833
|
+
// ../../../node_modules/.pnpm/xregexp@5.1.2/node_modules/xregexp/src/addons/build.js
|
|
1755
1834
|
var build_default = (XRegExp2) => {
|
|
1756
1835
|
const REGEX_DATA2 = "xregexp";
|
|
1757
1836
|
const subParts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g;
|
|
@@ -1875,7 +1954,7 @@ var build_default = (XRegExp2) => {
|
|
|
1875
1954
|
};
|
|
1876
1955
|
};
|
|
1877
1956
|
|
|
1878
|
-
// ../../../node_modules/.pnpm/xregexp@5.1.
|
|
1957
|
+
// ../../../node_modules/.pnpm/xregexp@5.1.2/node_modules/xregexp/src/addons/matchrecursive.js
|
|
1879
1958
|
var matchrecursive_default = (XRegExp2) => {
|
|
1880
1959
|
function row(name, value, start, end) {
|
|
1881
1960
|
return {
|
|
@@ -2005,7 +2084,7 @@ var matchrecursive_default = (XRegExp2) => {
|
|
|
2005
2084
|
};
|
|
2006
2085
|
};
|
|
2007
2086
|
|
|
2008
|
-
// ../../../node_modules/.pnpm/xregexp@5.1.
|
|
2087
|
+
// ../../../node_modules/.pnpm/xregexp@5.1.2/node_modules/xregexp/src/addons/unicode-base.js
|
|
2009
2088
|
var unicode_base_default = (XRegExp2) => {
|
|
2010
2089
|
const unicode = {};
|
|
2011
2090
|
const unicodeTypes = {};
|
|
@@ -2157,7 +2236,7 @@ var unicode_base_default = (XRegExp2) => {
|
|
|
2157
2236
|
};
|
|
2158
2237
|
};
|
|
2159
2238
|
|
|
2160
|
-
// ../../../node_modules/.pnpm/xregexp@5.1.
|
|
2239
|
+
// ../../../node_modules/.pnpm/xregexp@5.1.2/node_modules/xregexp/src/addons/unicode-categories.js
|
|
2161
2240
|
var import_categories = __toESM(require_categories());
|
|
2162
2241
|
var unicode_categories_default = (XRegExp2) => {
|
|
2163
2242
|
if (!XRegExp2.addUnicodeData) {
|
|
@@ -2166,7 +2245,7 @@ var unicode_categories_default = (XRegExp2) => {
|
|
|
2166
2245
|
XRegExp2.addUnicodeData(import_categories.default);
|
|
2167
2246
|
};
|
|
2168
2247
|
|
|
2169
|
-
// ../../../node_modules/.pnpm/xregexp@5.1.
|
|
2248
|
+
// ../../../node_modules/.pnpm/xregexp@5.1.2/node_modules/xregexp/src/addons/unicode-properties.js
|
|
2170
2249
|
var import_properties = __toESM(require_properties());
|
|
2171
2250
|
var unicode_properties_default = (XRegExp2) => {
|
|
2172
2251
|
if (!XRegExp2.addUnicodeData) {
|
|
@@ -2182,7 +2261,7 @@ var unicode_properties_default = (XRegExp2) => {
|
|
|
2182
2261
|
XRegExp2.addUnicodeData(unicodeData);
|
|
2183
2262
|
};
|
|
2184
2263
|
|
|
2185
|
-
// ../../../node_modules/.pnpm/xregexp@5.1.
|
|
2264
|
+
// ../../../node_modules/.pnpm/xregexp@5.1.2/node_modules/xregexp/src/addons/unicode-scripts.js
|
|
2186
2265
|
var import_scripts = __toESM(require_scripts());
|
|
2187
2266
|
var unicode_scripts_default = (XRegExp2) => {
|
|
2188
2267
|
if (!XRegExp2.addUnicodeData) {
|
|
@@ -2191,7 +2270,7 @@ var unicode_scripts_default = (XRegExp2) => {
|
|
|
2191
2270
|
XRegExp2.addUnicodeData(import_scripts.default, "Script");
|
|
2192
2271
|
};
|
|
2193
2272
|
|
|
2194
|
-
// ../../../node_modules/.pnpm/xregexp@5.1.
|
|
2273
|
+
// ../../../node_modules/.pnpm/xregexp@5.1.2/node_modules/xregexp/src/index.js
|
|
2195
2274
|
build_default(xregexp_default);
|
|
2196
2275
|
matchrecursive_default(xregexp_default);
|
|
2197
2276
|
unicode_base_default(xregexp_default);
|
|
@@ -2200,560 +2279,372 @@ unicode_properties_default(xregexp_default);
|
|
|
2200
2279
|
unicode_scripts_default(xregexp_default);
|
|
2201
2280
|
var src_default = xregexp_default;
|
|
2202
2281
|
|
|
2203
|
-
//
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
}
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
const isarray = opts.safe && Array.isArray(value);
|
|
2221
|
-
const type = Object.prototype.toString.call(value);
|
|
2222
|
-
const isbuffer = isBuffer(value);
|
|
2223
|
-
const isobject = type === "[object Object]" || type === "[object Array]";
|
|
2224
|
-
const newKey = prev ? prev + delimiter + transformKey(key) : transformKey(key);
|
|
2225
|
-
if (!isarray && !isbuffer && isobject && Object.keys(value).length && (!opts.maxDepth || currentDepth < maxDepth)) {
|
|
2226
|
-
return step(value, newKey, currentDepth + 1);
|
|
2227
|
-
}
|
|
2228
|
-
output[newKey] = value;
|
|
2229
|
-
});
|
|
2230
|
-
}
|
|
2231
|
-
step(target);
|
|
2232
|
-
return output;
|
|
2233
|
-
}
|
|
2234
|
-
function unflatten(target, opts) {
|
|
2235
|
-
opts = opts || {};
|
|
2236
|
-
const delimiter = opts.delimiter || ".";
|
|
2237
|
-
const overwrite = opts.overwrite || false;
|
|
2238
|
-
const transformKey = opts.transformKey || keyIdentity;
|
|
2239
|
-
const result = {};
|
|
2240
|
-
const isbuffer = isBuffer(target);
|
|
2241
|
-
if (isbuffer || Object.prototype.toString.call(target) !== "[object Object]") {
|
|
2242
|
-
return target;
|
|
2243
|
-
}
|
|
2244
|
-
function getkey(key) {
|
|
2245
|
-
const parsedKey = Number(key);
|
|
2246
|
-
return isNaN(parsedKey) || key.indexOf(".") !== -1 || opts.object ? key : parsedKey;
|
|
2247
|
-
}
|
|
2248
|
-
function addKeys(keyPrefix, recipient, target2) {
|
|
2249
|
-
return Object.keys(target2).reduce(function(result2, key) {
|
|
2250
|
-
result2[keyPrefix + delimiter + key] = target2[key];
|
|
2251
|
-
return result2;
|
|
2252
|
-
}, recipient);
|
|
2253
|
-
}
|
|
2254
|
-
function isEmpty(val) {
|
|
2255
|
-
const type = Object.prototype.toString.call(val);
|
|
2256
|
-
const isArray2 = type === "[object Array]";
|
|
2257
|
-
const isObject = type === "[object Object]";
|
|
2258
|
-
if (!val) {
|
|
2259
|
-
return true;
|
|
2260
|
-
} else if (isArray2) {
|
|
2261
|
-
return !val.length;
|
|
2262
|
-
} else if (isObject) {
|
|
2263
|
-
return !Object.keys(val).length;
|
|
2264
|
-
}
|
|
2265
|
-
}
|
|
2266
|
-
target = Object.keys(target).reduce(function(result2, key) {
|
|
2267
|
-
const type = Object.prototype.toString.call(target[key]);
|
|
2268
|
-
const isObject = type === "[object Object]" || type === "[object Array]";
|
|
2269
|
-
if (!isObject || isEmpty(target[key])) {
|
|
2270
|
-
result2[key] = target[key];
|
|
2271
|
-
return result2;
|
|
2272
|
-
} else {
|
|
2273
|
-
return addKeys(
|
|
2274
|
-
key,
|
|
2275
|
-
result2,
|
|
2276
|
-
flatten(target[key], opts)
|
|
2277
|
-
);
|
|
2282
|
+
// src/parser/lib/parse-select-param.ts
|
|
2283
|
+
var parseSelectParam = (s, currentPath) => {
|
|
2284
|
+
s = s.replace(/\s/g, "");
|
|
2285
|
+
const foreignTables = src_default.matchRecursive(`,${s}`, ",[^,]*\\(", "\\)", "g", {
|
|
2286
|
+
valueNames: {
|
|
2287
|
+
"0": null,
|
|
2288
|
+
"1": "tableName",
|
|
2289
|
+
"2": "selectedColumns",
|
|
2290
|
+
"3": null
|
|
2291
|
+
}
|
|
2292
|
+
}).reduce((prev, curr, idx, matches) => {
|
|
2293
|
+
if (curr.name === "selectedColumns") {
|
|
2294
|
+
const name = matches[idx - 1].value.slice(1, -1);
|
|
2295
|
+
prev = {
|
|
2296
|
+
...prev,
|
|
2297
|
+
[name]: curr.value
|
|
2298
|
+
};
|
|
2278
2299
|
}
|
|
2300
|
+
return prev;
|
|
2279
2301
|
}, {});
|
|
2280
|
-
Object.
|
|
2281
|
-
const split =
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
}
|
|
2289
|
-
const type = Object.prototype.toString.call(recipient[key1]);
|
|
2290
|
-
const isobject = type === "[object Object]" || type === "[object Array]";
|
|
2291
|
-
if (!overwrite && !isobject && typeof recipient[key1] !== "undefined") {
|
|
2292
|
-
return;
|
|
2293
|
-
}
|
|
2294
|
-
if (overwrite && !isobject || !overwrite && recipient[key1] == null) {
|
|
2295
|
-
recipient[key1] = typeof key2 === "number" && !opts.object ? [] : {};
|
|
2296
|
-
}
|
|
2297
|
-
recipient = recipient[key1];
|
|
2298
|
-
if (split.length > 0) {
|
|
2299
|
-
key1 = getkey(split.shift());
|
|
2300
|
-
key2 = getkey(split[0]);
|
|
2301
|
-
}
|
|
2302
|
-
}
|
|
2303
|
-
recipient[key1] = unflatten(target[key], opts);
|
|
2302
|
+
const columns = s.replace(new RegExp(`${Object.entries(foreignTables).map(([table, selectedColumns]) => `${table}(${selectedColumns})`.replace(/\(/g, "\\(").replace(/\)/g, "\\)")).join("|")}`, "g"), "").replace(/(,)\1+/g, ",").split(",").filter((c) => c.length > 0).map((c) => {
|
|
2303
|
+
const split = c.split(":");
|
|
2304
|
+
const hasAlias = split.length > 1;
|
|
2305
|
+
return {
|
|
2306
|
+
declaration: [currentPath?.declaration, c].filter(Boolean).join("."),
|
|
2307
|
+
alias: hasAlias || currentPath?.alias ? [currentPath?.alias ?? currentPath?.path, split[0]].filter(Boolean).join(".") : void 0,
|
|
2308
|
+
path: [currentPath?.path, split[hasAlias ? 1 : 0]].filter(Boolean).join(".")
|
|
2309
|
+
};
|
|
2304
2310
|
});
|
|
2305
|
-
return
|
|
2306
|
-
|
|
2311
|
+
return [...columns, ...Object.entries(foreignTables).flatMap(([currentDeclaration, selectedColumns]) => {
|
|
2312
|
+
const aliasSplit = currentDeclaration.split(":");
|
|
2313
|
+
const currentAliasElem = aliasSplit.length > 1 ? aliasSplit[0] : void 0;
|
|
2314
|
+
const currentPathDeclaration = aliasSplit[aliasSplit.length - 1];
|
|
2315
|
+
const currentPathElem = currentPathDeclaration.split("!")[0];
|
|
2316
|
+
const path = [currentPath?.path, currentPathElem].filter(Boolean).join(".");
|
|
2317
|
+
const alias = [currentPath?.alias ?? currentPath?.path, currentAliasElem ?? currentPathElem].filter(Boolean).join(".");
|
|
2318
|
+
const declaration = [currentPath?.declaration, currentDeclaration].filter(Boolean).join(".");
|
|
2319
|
+
return parseSelectParam(`${selectedColumns}`, {
|
|
2320
|
+
path,
|
|
2321
|
+
alias: currentPath?.alias || currentAliasElem ? alias : void 0,
|
|
2322
|
+
declaration
|
|
2323
|
+
});
|
|
2324
|
+
})];
|
|
2325
|
+
};
|
|
2307
2326
|
|
|
2308
|
-
//
|
|
2309
|
-
var
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
return
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
}
|
|
2317
|
-
|
|
2318
|
-
return function isCircular(a, b, state) {
|
|
2319
|
-
if (!a || !b || typeof a !== "object" || typeof b !== "object") {
|
|
2320
|
-
return areItemsEqual(a, b, state);
|
|
2321
|
-
}
|
|
2322
|
-
var cache = state.cache;
|
|
2323
|
-
var cachedA = cache.get(a);
|
|
2324
|
-
var cachedB = cache.get(b);
|
|
2325
|
-
if (cachedA && cachedB) {
|
|
2326
|
-
return cachedA === b && cachedB === a;
|
|
2327
|
-
}
|
|
2328
|
-
cache.set(a, b);
|
|
2329
|
-
cache.set(b, a);
|
|
2330
|
-
var result = areItemsEqual(a, b, state);
|
|
2331
|
-
cache.delete(a);
|
|
2332
|
-
cache.delete(b);
|
|
2333
|
-
return result;
|
|
2334
|
-
};
|
|
2335
|
-
}
|
|
2336
|
-
function getStrictProperties(object) {
|
|
2337
|
-
return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));
|
|
2338
|
-
}
|
|
2339
|
-
var hasOwn = Object.hasOwn || (function(object, property) {
|
|
2340
|
-
return hasOwnProperty.call(object, property);
|
|
2341
|
-
});
|
|
2342
|
-
function sameValueZeroEqual(a, b) {
|
|
2343
|
-
return a === b || !a && !b && a !== a && b !== b;
|
|
2344
|
-
}
|
|
2345
|
-
var PREACT_VNODE = "__v";
|
|
2346
|
-
var PREACT_OWNER = "__o";
|
|
2347
|
-
var REACT_OWNER = "_owner";
|
|
2348
|
-
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
2349
|
-
var keys = Object.keys;
|
|
2350
|
-
function areArraysEqual(a, b, state) {
|
|
2351
|
-
var index = a.length;
|
|
2352
|
-
if (b.length !== index) {
|
|
2353
|
-
return false;
|
|
2354
|
-
}
|
|
2355
|
-
while (index-- > 0) {
|
|
2356
|
-
if (!state.equals(a[index], b[index], index, index, a, b, state)) {
|
|
2357
|
-
return false;
|
|
2358
|
-
}
|
|
2359
|
-
}
|
|
2360
|
-
return true;
|
|
2361
|
-
}
|
|
2362
|
-
function areDatesEqual(a, b) {
|
|
2363
|
-
return sameValueZeroEqual(a.getTime(), b.getTime());
|
|
2364
|
-
}
|
|
2365
|
-
function areErrorsEqual(a, b) {
|
|
2366
|
-
return a.name === b.name && a.message === b.message && a.cause === b.cause && a.stack === b.stack;
|
|
2367
|
-
}
|
|
2368
|
-
function areFunctionsEqual(a, b) {
|
|
2369
|
-
return a === b;
|
|
2370
|
-
}
|
|
2371
|
-
function areMapsEqual(a, b, state) {
|
|
2372
|
-
var size = a.size;
|
|
2373
|
-
if (size !== b.size) {
|
|
2374
|
-
return false;
|
|
2375
|
-
}
|
|
2376
|
-
if (!size) {
|
|
2377
|
-
return true;
|
|
2378
|
-
}
|
|
2379
|
-
var matchedIndices = new Array(size);
|
|
2380
|
-
var aIterable = a.entries();
|
|
2381
|
-
var aResult;
|
|
2382
|
-
var bResult;
|
|
2383
|
-
var index = 0;
|
|
2384
|
-
while (aResult = aIterable.next()) {
|
|
2385
|
-
if (aResult.done) {
|
|
2386
|
-
break;
|
|
2387
|
-
}
|
|
2388
|
-
var bIterable = b.entries();
|
|
2389
|
-
var hasMatch = false;
|
|
2390
|
-
var matchIndex = 0;
|
|
2391
|
-
while (bResult = bIterable.next()) {
|
|
2392
|
-
if (bResult.done) {
|
|
2393
|
-
break;
|
|
2394
|
-
}
|
|
2395
|
-
if (matchedIndices[matchIndex]) {
|
|
2396
|
-
matchIndex++;
|
|
2397
|
-
continue;
|
|
2398
|
-
}
|
|
2399
|
-
var aEntry = aResult.value;
|
|
2400
|
-
var bEntry = bResult.value;
|
|
2401
|
-
if (state.equals(aEntry[0], bEntry[0], index, matchIndex, a, b, state) && state.equals(aEntry[1], bEntry[1], aEntry[0], bEntry[0], a, b, state)) {
|
|
2402
|
-
hasMatch = matchedIndices[matchIndex] = true;
|
|
2403
|
-
break;
|
|
2404
|
-
}
|
|
2405
|
-
matchIndex++;
|
|
2406
|
-
}
|
|
2407
|
-
if (!hasMatch) {
|
|
2408
|
-
return false;
|
|
2409
|
-
}
|
|
2410
|
-
index++;
|
|
2327
|
+
// src/parser/lib/is-iso-date-string.ts
|
|
2328
|
+
var isISODateString = (v) => typeof v === "string" && /(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/.test(v);
|
|
2329
|
+
|
|
2330
|
+
// src/parser/lib/parse-value.ts
|
|
2331
|
+
var parseValue = (v) => {
|
|
2332
|
+
if (isISODateString(v)) return new Date(v);
|
|
2333
|
+
try {
|
|
2334
|
+
return JSON.parse(v);
|
|
2335
|
+
} catch {
|
|
2336
|
+
return v;
|
|
2411
2337
|
}
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
}
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2338
|
+
};
|
|
2339
|
+
|
|
2340
|
+
// src/parser/postgrest-query-parser.ts
|
|
2341
|
+
var SUPPORTED_OPERATORS = ["or", ...Object.keys(OPERATOR_MAP)];
|
|
2342
|
+
var PostgrestQueryParser = class {
|
|
2343
|
+
constructor(query, opts) {
|
|
2344
|
+
this.opts = opts;
|
|
2345
|
+
this._params = new URLSearchParams(query);
|
|
2346
|
+
}
|
|
2347
|
+
_params;
|
|
2348
|
+
_filters;
|
|
2349
|
+
_paths;
|
|
2350
|
+
/**
|
|
2351
|
+
* Getter that returns the paths and their aliases that the query selects. Will do the computation only once.
|
|
2352
|
+
*
|
|
2353
|
+
* ```js
|
|
2354
|
+
* const p = new PostgrestParser(
|
|
2355
|
+
* supabaseClient.from("test")
|
|
2356
|
+
* .select(
|
|
2357
|
+
* `name,
|
|
2358
|
+
* city:cities (
|
|
2359
|
+
* test:name
|
|
2360
|
+
* ),
|
|
2361
|
+
* countries (
|
|
2362
|
+
* capital,
|
|
2363
|
+
* population,
|
|
2364
|
+
* some_ref (
|
|
2365
|
+
* test:first,
|
|
2366
|
+
* second
|
|
2367
|
+
* )
|
|
2368
|
+
* )`
|
|
2369
|
+
* );
|
|
2370
|
+
* console.log(p.paths);
|
|
2371
|
+
* // [
|
|
2372
|
+
* // { alias: undefined, path: "name" },
|
|
2373
|
+
* // { alias: "city.test", path: "cities.name" },
|
|
2374
|
+
* // { alias: undefined, path: "countries.capital" },
|
|
2375
|
+
* // { alias: undefined, path: "countries.population" },
|
|
2376
|
+
* // {
|
|
2377
|
+
* // alias: "countries.some_ref.test",
|
|
2378
|
+
* // path: "countries.some_ref.first",
|
|
2379
|
+
* // },
|
|
2380
|
+
* // { alias: undefined, path: "countries.some_ref.second" },
|
|
2381
|
+
* // ];
|
|
2382
|
+
* ```
|
|
2383
|
+
*
|
|
2384
|
+
* @returns an array of paths that the query selects, containing the columns and aliases
|
|
2385
|
+
*/
|
|
2386
|
+
get paths() {
|
|
2387
|
+
if (!this._paths) {
|
|
2388
|
+
const select = this._params.get("select");
|
|
2389
|
+
this._paths = select ? parseSelectParam(select) : [];
|
|
2390
|
+
}
|
|
2391
|
+
return this._paths;
|
|
2392
|
+
}
|
|
2393
|
+
/**
|
|
2394
|
+
* Getter that returns the filters that this query applies in a json object.
|
|
2395
|
+
*
|
|
2396
|
+
* ```js
|
|
2397
|
+
* const p = new PostgrestParser(
|
|
2398
|
+
* supabaseClient.from("test").select('*')
|
|
2399
|
+
* .or("full_name.eq.20,test.neq.true,and(full_name.eq.Test Name,email.eq.test@mail.com)")
|
|
2400
|
+
* .eq("id", "123")
|
|
2401
|
+
* .contains("id", "456")
|
|
2402
|
+
* );
|
|
2403
|
+
*
|
|
2404
|
+
* console.log(p.filters);
|
|
2405
|
+
*
|
|
2406
|
+
* // [
|
|
2407
|
+
* // {
|
|
2408
|
+
* // or: [
|
|
2409
|
+
* // {
|
|
2410
|
+
* // path: "full_name",
|
|
2411
|
+
* // negate: false,
|
|
2412
|
+
* // operator: "eq",
|
|
2413
|
+
* // value: 20,
|
|
2414
|
+
* // },
|
|
2415
|
+
* // {
|
|
2416
|
+
* // path: "test",
|
|
2417
|
+
* // negate: false,
|
|
2418
|
+
* // operator: "neq",
|
|
2419
|
+
* // value: true,
|
|
2420
|
+
* // },
|
|
2421
|
+
* // {
|
|
2422
|
+
* // and: [
|
|
2423
|
+
* // {
|
|
2424
|
+
* // path: "full_name",
|
|
2425
|
+
* // negate: false,
|
|
2426
|
+
* // operator: "eq",
|
|
2427
|
+
* // value: "Test Name",
|
|
2428
|
+
* // },
|
|
2429
|
+
* // {
|
|
2430
|
+
* // path: "email",
|
|
2431
|
+
* // negate: false,
|
|
2432
|
+
* // operator: "eq",
|
|
2433
|
+
* // value: "test@mail.com",
|
|
2434
|
+
* // },
|
|
2435
|
+
* // ],
|
|
2436
|
+
* // },
|
|
2437
|
+
* // ],
|
|
2438
|
+
* // },
|
|
2439
|
+
* // {
|
|
2440
|
+
* // path: "id",
|
|
2441
|
+
* // negate: false,
|
|
2442
|
+
* // operator: "eq",
|
|
2443
|
+
* // value: 123,
|
|
2444
|
+
* // },
|
|
2445
|
+
* // {
|
|
2446
|
+
* // path: "id",
|
|
2447
|
+
* // negate: false,
|
|
2448
|
+
* // operator: "cs",
|
|
2449
|
+
* // value: 456,
|
|
2450
|
+
* // },
|
|
2451
|
+
* // ];
|
|
2452
|
+
* ```
|
|
2453
|
+
*
|
|
2454
|
+
* @returns a FilterDefinitions object
|
|
2455
|
+
*/
|
|
2456
|
+
get filters() {
|
|
2457
|
+
if (!this._filters) {
|
|
2458
|
+
const filters = [];
|
|
2459
|
+
this._params.forEach((value, key) => {
|
|
2460
|
+
if (SUPPORTED_OPERATORS.some((f) => key === f || value.split(".").includes(f))) {
|
|
2461
|
+
const filter = this.parseFilterString(`${key}.${value}`, void 0);
|
|
2462
|
+
if (filter !== null) filters.push(filter);
|
|
2463
|
+
}
|
|
2464
|
+
});
|
|
2465
|
+
this._filters = filters;
|
|
2424
2466
|
}
|
|
2467
|
+
return this._filters;
|
|
2425
2468
|
}
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
}
|
|
2434
|
-
var property;
|
|
2435
|
-
var descriptorA;
|
|
2436
|
-
var descriptorB;
|
|
2437
|
-
while (index-- > 0) {
|
|
2438
|
-
property = properties2[index];
|
|
2439
|
-
if (!isPropertyEqual(a, b, state, property)) {
|
|
2440
|
-
return false;
|
|
2441
|
-
}
|
|
2442
|
-
descriptorA = getOwnPropertyDescriptor(a, property);
|
|
2443
|
-
descriptorB = getOwnPropertyDescriptor(b, property);
|
|
2444
|
-
if ((descriptorA || descriptorB) && (!descriptorA || !descriptorB || descriptorA.configurable !== descriptorB.configurable || descriptorA.enumerable !== descriptorB.enumerable || descriptorA.writable !== descriptorB.writable)) {
|
|
2445
|
-
return false;
|
|
2469
|
+
parseFilterString(filter, prefix) {
|
|
2470
|
+
if (filter.startsWith("and(") && filter.endsWith(")")) {
|
|
2471
|
+
const andFilters = filter.slice(4, -1).split(",").map((s) => this.parseFilterString(s, prefix)).filter(isNotNull);
|
|
2472
|
+
if (andFilters.length === 0) return null;
|
|
2473
|
+
else return {
|
|
2474
|
+
and: andFilters
|
|
2475
|
+
};
|
|
2446
2476
|
}
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
}
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
var aIterable = a.values();
|
|
2466
|
-
var aResult;
|
|
2467
|
-
var bResult;
|
|
2468
|
-
while (aResult = aIterable.next()) {
|
|
2469
|
-
if (aResult.done) {
|
|
2470
|
-
break;
|
|
2477
|
+
const split = filter.split(".");
|
|
2478
|
+
if ([split[0], split[1]].includes("or")) {
|
|
2479
|
+
let foreignTable;
|
|
2480
|
+
if (split[1] === "or") {
|
|
2481
|
+
foreignTable = split[0];
|
|
2482
|
+
}
|
|
2483
|
+
const orFilters = filter.slice(4 + (foreignTable ? foreignTable.length + 1 : 0), -1).split(",").reduce((prev, curr, idx, filters) => {
|
|
2484
|
+
if (curr.startsWith("and(")) {
|
|
2485
|
+
prev = [...prev, [curr, filters[idx + 1]].join()];
|
|
2486
|
+
} else if (!curr.endsWith(")")) {
|
|
2487
|
+
prev = [...prev, curr];
|
|
2488
|
+
}
|
|
2489
|
+
return prev;
|
|
2490
|
+
}, []).map((s) => this.parseFilterString(s, foreignTable)).filter(isNotNull);
|
|
2491
|
+
if (orFilters.length === 0) return null;
|
|
2492
|
+
else return {
|
|
2493
|
+
or: orFilters
|
|
2494
|
+
};
|
|
2471
2495
|
}
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2496
|
+
const operatorIdx = findLastIndex(split, (s) => SUPPORTED_OPERATORS.includes(s));
|
|
2497
|
+
if (operatorIdx === -1) throw new Error(`Could not find a valid operator in ${split.join(".")}. Supported are ${SUPPORTED_OPERATORS.join(",")}.`);
|
|
2498
|
+
const negate = split[operatorIdx - 1] === "not";
|
|
2499
|
+
const pathOrAlias = [prefix, ...split.slice(0, negate ? operatorIdx - 1 : operatorIdx)].filter(Boolean).join(".").replace(/\s/g, "");
|
|
2500
|
+
let path = pathOrAlias;
|
|
2501
|
+
let alias;
|
|
2502
|
+
for (const p of this.paths) {
|
|
2503
|
+
if (p.path === pathOrAlias) {
|
|
2504
|
+
alias = p.alias;
|
|
2477
2505
|
break;
|
|
2478
2506
|
}
|
|
2479
|
-
if (
|
|
2480
|
-
|
|
2507
|
+
if (p.alias === pathOrAlias) {
|
|
2508
|
+
path = p.path;
|
|
2509
|
+
alias = p.alias;
|
|
2481
2510
|
break;
|
|
2482
2511
|
}
|
|
2483
|
-
matchIndex++;
|
|
2484
2512
|
}
|
|
2485
|
-
if (!
|
|
2486
|
-
return
|
|
2513
|
+
if (this.opts && Array.isArray(this.opts.exclusivePaths) && !this.opts.exclusivePaths.includes(path)) {
|
|
2514
|
+
return null;
|
|
2487
2515
|
}
|
|
2516
|
+
const operator = split[operatorIdx];
|
|
2517
|
+
const value = split.slice(operatorIdx + 1).join(".");
|
|
2518
|
+
return {
|
|
2519
|
+
path,
|
|
2520
|
+
alias,
|
|
2521
|
+
negate,
|
|
2522
|
+
operator,
|
|
2523
|
+
value: parseValue(value)
|
|
2524
|
+
};
|
|
2488
2525
|
}
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
if (type !== typeof b) {
|
|
2538
|
-
return false;
|
|
2539
|
-
}
|
|
2540
|
-
if (type !== "object") {
|
|
2541
|
-
if (type === "number") {
|
|
2542
|
-
return areNumbersEqual2(a, b, state);
|
|
2543
|
-
}
|
|
2544
|
-
if (type === "function") {
|
|
2545
|
-
return areFunctionsEqual2(a, b, state);
|
|
2526
|
+
};
|
|
2527
|
+
|
|
2528
|
+
// src/parser/PostgrestParser.ts
|
|
2529
|
+
var PostgrestParser = class extends PostgrestQueryParser {
|
|
2530
|
+
constructor(fb, opts) {
|
|
2531
|
+
super(new URL(fb["url"]).searchParams.toString(), opts);
|
|
2532
|
+
this.opts = opts;
|
|
2533
|
+
this._url = new URL(fb["url"]);
|
|
2534
|
+
const headers = fb["headers"];
|
|
2535
|
+
this._headers = Object.fromEntries(headers.entries());
|
|
2536
|
+
this._body = isObject(fb["body"]) ? {
|
|
2537
|
+
...fb["body"]
|
|
2538
|
+
} : void 0;
|
|
2539
|
+
this.method = fb["method"];
|
|
2540
|
+
this.searchParams = this._url.searchParams;
|
|
2541
|
+
this.queryKey = sortSearchParams(this._url.searchParams).toString();
|
|
2542
|
+
this.select = this._url.searchParams.get("select")?.toString() ?? "*";
|
|
2543
|
+
this.table = this._url.toString().split("/rest/v1/").pop().split("?").shift();
|
|
2544
|
+
if (this._body) {
|
|
2545
|
+
this.bodyKey = encodeObject(this._body);
|
|
2546
|
+
}
|
|
2547
|
+
const preferHeaders = (this._headers["Prefer"] ?? "").split(",").reduce((prev, curr) => {
|
|
2548
|
+
const s = curr.split("=");
|
|
2549
|
+
return {
|
|
2550
|
+
...prev,
|
|
2551
|
+
[s[0]]: s[1]
|
|
2552
|
+
};
|
|
2553
|
+
}, {});
|
|
2554
|
+
this.count = preferHeaders["count"] ?? null;
|
|
2555
|
+
this.schema = fb["schema"];
|
|
2556
|
+
this.isHead = this.method === "HEAD";
|
|
2557
|
+
const limit = this._url.searchParams.get("limit");
|
|
2558
|
+
this.limit = limit ? Number(limit) : void 0;
|
|
2559
|
+
const offset = this._url.searchParams.get("offset");
|
|
2560
|
+
this.offset = offset ? Number(offset) : void 0;
|
|
2561
|
+
this._url.searchParams.forEach((value, key) => {
|
|
2562
|
+
const split = key.split(".");
|
|
2563
|
+
if (split[split.length === 2 ? 1 : 0] === "order") {
|
|
2564
|
+
const orderByDefs = value.split(",");
|
|
2565
|
+
orderByDefs.forEach((def) => {
|
|
2566
|
+
const [column, ascending, nullsFirst] = def.split(".");
|
|
2567
|
+
this.orderBy.push({
|
|
2568
|
+
ascending: ascending === "asc",
|
|
2569
|
+
column,
|
|
2570
|
+
nullsFirst: nullsFirst === "nullsfirst",
|
|
2571
|
+
foreignTable: split.length === 2 ? split[0] : void 0
|
|
2572
|
+
});
|
|
2573
|
+
});
|
|
2546
2574
|
}
|
|
2547
|
-
return false;
|
|
2548
|
-
}
|
|
2549
|
-
var constructor = a.constructor;
|
|
2550
|
-
if (constructor !== b.constructor) {
|
|
2551
|
-
return false;
|
|
2552
|
-
}
|
|
2553
|
-
if (constructor === Object) {
|
|
2554
|
-
return areObjectsEqual2(a, b, state);
|
|
2555
|
-
}
|
|
2556
|
-
if (isArray(a)) {
|
|
2557
|
-
return areArraysEqual2(a, b, state);
|
|
2558
|
-
}
|
|
2559
|
-
if (isTypedArray != null && isTypedArray(a)) {
|
|
2560
|
-
return areTypedArraysEqual2(a, b, state);
|
|
2561
|
-
}
|
|
2562
|
-
if (constructor === Date) {
|
|
2563
|
-
return areDatesEqual2(a, b, state);
|
|
2564
|
-
}
|
|
2565
|
-
if (constructor === RegExp) {
|
|
2566
|
-
return areRegExpsEqual2(a, b, state);
|
|
2567
|
-
}
|
|
2568
|
-
if (constructor === Map) {
|
|
2569
|
-
return areMapsEqual2(a, b, state);
|
|
2570
|
-
}
|
|
2571
|
-
if (constructor === Set) {
|
|
2572
|
-
return areSetsEqual2(a, b, state);
|
|
2573
|
-
}
|
|
2574
|
-
var tag = getTag(a);
|
|
2575
|
-
if (tag === DATE_TAG) {
|
|
2576
|
-
return areDatesEqual2(a, b, state);
|
|
2577
|
-
}
|
|
2578
|
-
if (tag === REG_EXP_TAG) {
|
|
2579
|
-
return areRegExpsEqual2(a, b, state);
|
|
2580
|
-
}
|
|
2581
|
-
if (tag === MAP_TAG) {
|
|
2582
|
-
return areMapsEqual2(a, b, state);
|
|
2583
|
-
}
|
|
2584
|
-
if (tag === SET_TAG) {
|
|
2585
|
-
return areSetsEqual2(a, b, state);
|
|
2586
|
-
}
|
|
2587
|
-
if (tag === OBJECT_TAG) {
|
|
2588
|
-
return typeof a.then !== "function" && typeof b.then !== "function" && areObjectsEqual2(a, b, state);
|
|
2589
|
-
}
|
|
2590
|
-
if (tag === URL_TAG) {
|
|
2591
|
-
return areUrlsEqual2(a, b, state);
|
|
2592
|
-
}
|
|
2593
|
-
if (tag === ERROR_TAG) {
|
|
2594
|
-
return areErrorsEqual2(a, b, state);
|
|
2595
|
-
}
|
|
2596
|
-
if (tag === ARGUMENTS_TAG) {
|
|
2597
|
-
return areObjectsEqual2(a, b, state);
|
|
2598
|
-
}
|
|
2599
|
-
if (tag === BOOLEAN_TAG || tag === NUMBER_TAG || tag === STRING_TAG) {
|
|
2600
|
-
return arePrimitiveWrappersEqual2(a, b, state);
|
|
2601
|
-
}
|
|
2602
|
-
return false;
|
|
2603
|
-
};
|
|
2604
|
-
}
|
|
2605
|
-
function createEqualityComparatorConfig(_a) {
|
|
2606
|
-
var circular = _a.circular, createCustomConfig = _a.createCustomConfig, strict = _a.strict;
|
|
2607
|
-
var config = {
|
|
2608
|
-
areArraysEqual: strict ? areObjectsEqualStrict : areArraysEqual,
|
|
2609
|
-
areDatesEqual,
|
|
2610
|
-
areErrorsEqual,
|
|
2611
|
-
areFunctionsEqual,
|
|
2612
|
-
areMapsEqual: strict ? combineComparators(areMapsEqual, areObjectsEqualStrict) : areMapsEqual,
|
|
2613
|
-
areNumbersEqual,
|
|
2614
|
-
areObjectsEqual: strict ? areObjectsEqualStrict : areObjectsEqual,
|
|
2615
|
-
arePrimitiveWrappersEqual,
|
|
2616
|
-
areRegExpsEqual,
|
|
2617
|
-
areSetsEqual: strict ? combineComparators(areSetsEqual, areObjectsEqualStrict) : areSetsEqual,
|
|
2618
|
-
areTypedArraysEqual: strict ? areObjectsEqualStrict : areTypedArraysEqual,
|
|
2619
|
-
areUrlsEqual
|
|
2620
|
-
};
|
|
2621
|
-
if (createCustomConfig) {
|
|
2622
|
-
config = assign({}, config, createCustomConfig(config));
|
|
2623
|
-
}
|
|
2624
|
-
if (circular) {
|
|
2625
|
-
var areArraysEqual$1 = createIsCircular(config.areArraysEqual);
|
|
2626
|
-
var areMapsEqual$1 = createIsCircular(config.areMapsEqual);
|
|
2627
|
-
var areObjectsEqual$1 = createIsCircular(config.areObjectsEqual);
|
|
2628
|
-
var areSetsEqual$1 = createIsCircular(config.areSetsEqual);
|
|
2629
|
-
config = assign({}, config, {
|
|
2630
|
-
areArraysEqual: areArraysEqual$1,
|
|
2631
|
-
areMapsEqual: areMapsEqual$1,
|
|
2632
|
-
areObjectsEqual: areObjectsEqual$1,
|
|
2633
|
-
areSetsEqual: areSetsEqual$1
|
|
2634
2575
|
});
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
}
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
cache: /* @__PURE__ */ new WeakMap(),
|
|
2660
|
-
equals,
|
|
2661
|
-
meta: void 0,
|
|
2662
|
-
strict
|
|
2663
|
-
});
|
|
2664
|
-
};
|
|
2665
|
-
}
|
|
2666
|
-
var state = {
|
|
2667
|
-
cache: void 0,
|
|
2668
|
-
equals,
|
|
2669
|
-
meta: void 0,
|
|
2670
|
-
strict
|
|
2671
|
-
};
|
|
2672
|
-
return function isEqual(a, b) {
|
|
2673
|
-
return comparator(a, b, state);
|
|
2674
|
-
};
|
|
2675
|
-
}
|
|
2676
|
-
var deepEqual = createCustomEqual();
|
|
2677
|
-
var strictDeepEqual = createCustomEqual({ strict: true });
|
|
2678
|
-
var circularDeepEqual = createCustomEqual({ circular: true });
|
|
2679
|
-
var strictCircularDeepEqual = createCustomEqual({
|
|
2680
|
-
circular: true,
|
|
2681
|
-
strict: true
|
|
2682
|
-
});
|
|
2683
|
-
var shallowEqual = createCustomEqual({
|
|
2684
|
-
createInternalComparator: function() {
|
|
2685
|
-
return sameValueZeroEqual;
|
|
2686
|
-
}
|
|
2687
|
-
});
|
|
2688
|
-
var strictShallowEqual = createCustomEqual({
|
|
2689
|
-
strict: true,
|
|
2690
|
-
createInternalComparator: function() {
|
|
2691
|
-
return sameValueZeroEqual;
|
|
2692
|
-
}
|
|
2693
|
-
});
|
|
2694
|
-
var circularShallowEqual = createCustomEqual({
|
|
2695
|
-
circular: true,
|
|
2696
|
-
createInternalComparator: function() {
|
|
2697
|
-
return sameValueZeroEqual;
|
|
2698
|
-
}
|
|
2699
|
-
});
|
|
2700
|
-
var strictCircularShallowEqual = createCustomEqual({
|
|
2701
|
-
circular: true,
|
|
2702
|
-
createInternalComparator: function() {
|
|
2703
|
-
return sameValueZeroEqual;
|
|
2704
|
-
},
|
|
2705
|
-
strict: true
|
|
2706
|
-
});
|
|
2707
|
-
function createCustomEqual(options) {
|
|
2708
|
-
if (options === void 0) {
|
|
2709
|
-
options = {};
|
|
2710
|
-
}
|
|
2711
|
-
var _a = options.circular, circular = _a === void 0 ? false : _a, createCustomInternalComparator = options.createInternalComparator, createState = options.createState, _b = options.strict, strict = _b === void 0 ? false : _b;
|
|
2712
|
-
var config = createEqualityComparatorConfig(options);
|
|
2713
|
-
var comparator = createEqualityComparator(config);
|
|
2714
|
-
var equals = createCustomInternalComparator ? createCustomInternalComparator(comparator) : createInternalEqualityComparator(comparator);
|
|
2715
|
-
return createIsEqual({ circular, comparator, createState, equals, strict });
|
|
2716
|
-
}
|
|
2576
|
+
this.orderByKey = this.orderBy.map(({
|
|
2577
|
+
column,
|
|
2578
|
+
ascending,
|
|
2579
|
+
nullsFirst,
|
|
2580
|
+
foreignTable
|
|
2581
|
+
}) => `${foreignTable ? `${foreignTable}.` : ""}${column}:${ascending ? "asc" : "desc"}.${nullsFirst ? "nullsFirst" : "nullsLast"}`).join("|");
|
|
2582
|
+
}
|
|
2583
|
+
_url;
|
|
2584
|
+
_headers;
|
|
2585
|
+
_body;
|
|
2586
|
+
method;
|
|
2587
|
+
select;
|
|
2588
|
+
queryKey;
|
|
2589
|
+
bodyKey;
|
|
2590
|
+
count;
|
|
2591
|
+
schema;
|
|
2592
|
+
table;
|
|
2593
|
+
isHead;
|
|
2594
|
+
limit;
|
|
2595
|
+
offset;
|
|
2596
|
+
orderBy = [];
|
|
2597
|
+
orderByKey;
|
|
2598
|
+
searchParams;
|
|
2599
|
+
};
|
|
2717
2600
|
|
|
2718
2601
|
export {
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2602
|
+
sortSearchParams,
|
|
2603
|
+
encodeObject,
|
|
2604
|
+
isObject,
|
|
2605
|
+
findLastIndex,
|
|
2606
|
+
isNotNull,
|
|
2607
|
+
OPERATOR_MAP,
|
|
2608
|
+
parseSelectParam,
|
|
2609
|
+
isISODateString,
|
|
2610
|
+
parseValue,
|
|
2611
|
+
SUPPORTED_OPERATORS,
|
|
2612
|
+
PostgrestQueryParser,
|
|
2613
|
+
PostgrestParser
|
|
2723
2614
|
};
|
|
2724
2615
|
/*! Bundled license information:
|
|
2725
2616
|
|
|
2726
2617
|
xregexp/src/xregexp.js:
|
|
2727
2618
|
(*!
|
|
2728
|
-
* XRegExp 5.1.
|
|
2619
|
+
* XRegExp 5.1.2
|
|
2729
2620
|
* <xregexp.com>
|
|
2730
2621
|
* Steven Levithan (c) 2007-present MIT License
|
|
2731
2622
|
*)
|
|
2732
2623
|
|
|
2733
2624
|
xregexp/src/addons/build.js:
|
|
2734
2625
|
(*!
|
|
2735
|
-
* XRegExp.build 5.1.
|
|
2626
|
+
* XRegExp.build 5.1.2
|
|
2736
2627
|
* <xregexp.com>
|
|
2737
2628
|
* Steven Levithan (c) 2012-present MIT License
|
|
2738
2629
|
*)
|
|
2739
2630
|
|
|
2740
2631
|
xregexp/src/addons/matchrecursive.js:
|
|
2741
2632
|
(*!
|
|
2742
|
-
* XRegExp.matchRecursive 5.1.
|
|
2633
|
+
* XRegExp.matchRecursive 5.1.2
|
|
2743
2634
|
* <xregexp.com>
|
|
2744
2635
|
* Steven Levithan (c) 2009-present MIT License
|
|
2745
2636
|
*)
|
|
2746
2637
|
|
|
2747
2638
|
xregexp/src/addons/unicode-base.js:
|
|
2748
2639
|
(*!
|
|
2749
|
-
* XRegExp Unicode Base 5.1.
|
|
2640
|
+
* XRegExp Unicode Base 5.1.2
|
|
2750
2641
|
* <xregexp.com>
|
|
2751
2642
|
* Steven Levithan (c) 2008-present MIT License
|
|
2752
2643
|
*)
|
|
2753
2644
|
|
|
2754
2645
|
xregexp/src/addons/unicode-categories.js:
|
|
2755
2646
|
(*!
|
|
2756
|
-
* XRegExp Unicode Categories 5.1.
|
|
2647
|
+
* XRegExp Unicode Categories 5.1.2
|
|
2757
2648
|
* <xregexp.com>
|
|
2758
2649
|
* Steven Levithan (c) 2010-present MIT License
|
|
2759
2650
|
* Unicode data by Mathias Bynens <mathiasbynens.be>
|
|
@@ -2761,7 +2652,7 @@ xregexp/src/addons/unicode-categories.js:
|
|
|
2761
2652
|
|
|
2762
2653
|
xregexp/src/addons/unicode-properties.js:
|
|
2763
2654
|
(*!
|
|
2764
|
-
* XRegExp Unicode Properties 5.1.
|
|
2655
|
+
* XRegExp Unicode Properties 5.1.2
|
|
2765
2656
|
* <xregexp.com>
|
|
2766
2657
|
* Steven Levithan (c) 2012-present MIT License
|
|
2767
2658
|
* Unicode data by Mathias Bynens <mathiasbynens.be>
|
|
@@ -2769,10 +2660,10 @@ xregexp/src/addons/unicode-properties.js:
|
|
|
2769
2660
|
|
|
2770
2661
|
xregexp/src/addons/unicode-scripts.js:
|
|
2771
2662
|
(*!
|
|
2772
|
-
* XRegExp Unicode Scripts 5.1.
|
|
2663
|
+
* XRegExp Unicode Scripts 5.1.2
|
|
2773
2664
|
* <xregexp.com>
|
|
2774
2665
|
* Steven Levithan (c) 2010-present MIT License
|
|
2775
2666
|
* Unicode data by Mathias Bynens <mathiasbynens.be>
|
|
2776
2667
|
*)
|
|
2777
2668
|
*/
|
|
2778
|
-
//# sourceMappingURL=chunk-
|
|
2669
|
+
//# sourceMappingURL=chunk-UJWETW36.js.map
|