@dcupl/common 2.0.0-beta.1 → 2.0.0-beta.3
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/esm/deep-query.service.d.ts +25 -0
- package/dist/esm/index.js +277 -199
- package/dist/esm/index.js.map +1 -1
- package/dist/node/index.cjs +2 -2
- package/dist/node/index.cjs.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { cloneDeep as y, get as
|
|
2
|
-
function
|
|
3
|
-
const e =
|
|
4
|
-
return
|
|
1
|
+
import { cloneDeep as y, get as D, every as B, findIndex as E, size as L, isEqual as O, differenceBy as q, startsWith as H, endsWith as U, isEqualWith as b, isMatch as V, find as J } from "lodash-es";
|
|
2
|
+
function Q(o) {
|
|
3
|
+
const e = S(o);
|
|
4
|
+
return Z(e);
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function S(o) {
|
|
7
7
|
if (typeof o != "object" || o === null)
|
|
8
8
|
return String(o);
|
|
9
9
|
if (Array.isArray(o))
|
|
10
|
-
return "[" + o.map(
|
|
10
|
+
return "[" + o.map(S).join(",") + "]";
|
|
11
11
|
const e = Object.keys(o).sort();
|
|
12
12
|
let t = "{";
|
|
13
13
|
for (let r = 0; r < e.length; r++) {
|
|
14
14
|
const s = e[r];
|
|
15
|
-
t += s + ":" +
|
|
15
|
+
t += s + ":" + S(o[s]), r < e.length - 1 && (t += ",");
|
|
16
16
|
}
|
|
17
17
|
return t += "}", t;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function Z(o) {
|
|
20
20
|
let e = 0;
|
|
21
21
|
for (let t = 0; t < o.length; t++) {
|
|
22
22
|
const r = o.charCodeAt(t);
|
|
@@ -41,7 +41,7 @@ const x = {
|
|
|
41
41
|
return performance.getEntriesByType(o);
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
|
-
class
|
|
44
|
+
class Se {
|
|
45
45
|
data;
|
|
46
46
|
enabled = !1;
|
|
47
47
|
constructor() {
|
|
@@ -114,11 +114,11 @@ class De {
|
|
|
114
114
|
getKey(e, t) {
|
|
115
115
|
if (!t)
|
|
116
116
|
return e;
|
|
117
|
-
const r =
|
|
117
|
+
const r = Q(t);
|
|
118
118
|
return e + "_" + r;
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
let
|
|
121
|
+
let Y = class T {
|
|
122
122
|
nodes;
|
|
123
123
|
edges;
|
|
124
124
|
nodeKinds = /* @__PURE__ */ new Map();
|
|
@@ -408,11 +408,11 @@ let Z = class T {
|
|
|
408
408
|
return { addedNodes: s, removedNodes: i, addedEdges: u, removedEdges: c, kindChanges: f };
|
|
409
409
|
}
|
|
410
410
|
};
|
|
411
|
-
class
|
|
411
|
+
class Ie {
|
|
412
412
|
graph;
|
|
413
413
|
nodeIndex;
|
|
414
414
|
constructor() {
|
|
415
|
-
this.graph = new
|
|
415
|
+
this.graph = new Y(), this.nodeIndex = /* @__PURE__ */ new Map();
|
|
416
416
|
}
|
|
417
417
|
/**
|
|
418
418
|
* Creates a unique ID for an attribute node
|
|
@@ -600,7 +600,7 @@ class Ke {
|
|
|
600
600
|
};
|
|
601
601
|
}
|
|
602
602
|
}
|
|
603
|
-
const
|
|
603
|
+
const $ = {
|
|
604
604
|
silent: 0,
|
|
605
605
|
error: 1,
|
|
606
606
|
warn: 2,
|
|
@@ -663,7 +663,7 @@ class p {
|
|
|
663
663
|
}
|
|
664
664
|
shouldLog(e) {
|
|
665
665
|
const t = this.getEffectiveLevel();
|
|
666
|
-
return
|
|
666
|
+
return $[e] <= $[t];
|
|
667
667
|
}
|
|
668
668
|
formatMessage(e) {
|
|
669
669
|
if (this.config.format === "json") {
|
|
@@ -799,8 +799,8 @@ class p {
|
|
|
799
799
|
Object.assign(this.config, e);
|
|
800
800
|
}
|
|
801
801
|
}
|
|
802
|
-
const
|
|
803
|
-
class
|
|
802
|
+
const X = new p();
|
|
803
|
+
class Qe {
|
|
804
804
|
constructor(e) {
|
|
805
805
|
this.enabled = e, this.cache = /* @__PURE__ */ new Map(), this.cacheDependencies = /* @__PURE__ */ new Map();
|
|
806
806
|
}
|
|
@@ -810,7 +810,7 @@ class Se {
|
|
|
810
810
|
// Track cache hits and misses for statistics
|
|
811
811
|
hitCount = 0;
|
|
812
812
|
missCount = 0;
|
|
813
|
-
log =
|
|
813
|
+
log = X.child({ prefix: "CacheController" });
|
|
814
814
|
get(e, t) {
|
|
815
815
|
if (!this.enabled) return;
|
|
816
816
|
const r = this.getCacheName(e, t);
|
|
@@ -921,7 +921,7 @@ class Se {
|
|
|
921
921
|
}
|
|
922
922
|
}
|
|
923
923
|
getCacheName(e, t) {
|
|
924
|
-
const r =
|
|
924
|
+
const r = Q(t);
|
|
925
925
|
return e + "_" + r;
|
|
926
926
|
}
|
|
927
927
|
/**
|
|
@@ -939,7 +939,7 @@ class Se {
|
|
|
939
939
|
};
|
|
940
940
|
}
|
|
941
941
|
}
|
|
942
|
-
const
|
|
942
|
+
const Me = (o, e = "") => `${o}#${e}`, Ne = (o) => `${o.gt}_${o.gte}_${o.lt}_${o.lte}_${o.eq}_${o.ne}`, ke = (o) => `${o.gt}_${o.gte}_${o.lt}_${o.lte}_${o.eq}_${o.ne}`, Ce = (o, e) => {
|
|
943
943
|
const t = typeof e == "function" ? e : (r) => r[e];
|
|
944
944
|
return [
|
|
945
945
|
...o.reduce((r, s) => {
|
|
@@ -947,24 +947,24 @@ const Ie = (o, e = "") => `${o}#${e}`, Qe = (o) => `${o.gt}_${o.gte}_${o.lt}_${o
|
|
|
947
947
|
return r.has(i) || r.set(i, s), r;
|
|
948
948
|
}, /* @__PURE__ */ new Map()).values()
|
|
949
949
|
];
|
|
950
|
-
},
|
|
950
|
+
}, Ee = (o, e) => o.reduce(function(t, r) {
|
|
951
951
|
const s = typeof e == "function" ? e(r) : r[e];
|
|
952
952
|
return Object.prototype.hasOwnProperty.call(t, s) || (t[s] = []), t[s].push(r), t;
|
|
953
953
|
}, {});
|
|
954
|
-
function
|
|
954
|
+
function ee(o = 10) {
|
|
955
955
|
let e = "";
|
|
956
956
|
const t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
957
957
|
for (let r = 0; r < o; r++) e += t.charAt(Math.floor(Math.random() * t.length));
|
|
958
958
|
return e;
|
|
959
959
|
}
|
|
960
|
-
const
|
|
960
|
+
const Oe = (o) => o.replace(/\/+$/, ""), te = (o) => typeof o != "string" ? "" : o.replace(/[[\]{}()*+?.,\\^$|#]/g, "\\$&"), qe = (o) => typeof o != "string" ? "" : o.replace(/\\([[\]{}()*+?.,\\^$|#])/g, "$1"), $e = (o, e) => {
|
|
961
961
|
try {
|
|
962
|
-
return
|
|
962
|
+
return re(o, e) >= 0;
|
|
963
963
|
} catch {
|
|
964
964
|
return !1;
|
|
965
965
|
}
|
|
966
|
-
},
|
|
967
|
-
if (
|
|
966
|
+
}, re = (o, e) => {
|
|
967
|
+
if (!F(o) || !F(e))
|
|
968
968
|
throw new Error(`Invalid version format: v1="${o}", v2="${e}". Expected format: "x.y.z"`);
|
|
969
969
|
const t = o.split(".").map(Number), r = e.split(".").map(Number);
|
|
970
970
|
for (let s = 0; s < 3; s++) {
|
|
@@ -973,8 +973,8 @@ const Ce = (o) => o.replace(/\/+$/, ""), ee = (o) => typeof o != "string" ? "" :
|
|
|
973
973
|
if (i < n) return -1;
|
|
974
974
|
}
|
|
975
975
|
return 0;
|
|
976
|
-
},
|
|
977
|
-
class
|
|
976
|
+
}, F = (o) => /^\d+(\.\d+){0,2}$/.test(o);
|
|
977
|
+
class Fe {
|
|
978
978
|
key;
|
|
979
979
|
parentCd;
|
|
980
980
|
dcuplInitOptions;
|
|
@@ -1010,9 +1010,9 @@ class Oe {
|
|
|
1010
1010
|
};
|
|
1011
1011
|
}
|
|
1012
1012
|
}
|
|
1013
|
-
const
|
|
1013
|
+
const P = (o, e) => e ? typeof structuredClone < "u" ? structuredClone(o) : y(o) : o, G = (o, e, t, r, s, i) => {
|
|
1014
1014
|
try {
|
|
1015
|
-
const n = !!e.dcuplInitOptions.performance?.clone?.enabled && !!t.cloneResult, a =
|
|
1015
|
+
const n = !!e.dcuplInitOptions.performance?.clone?.enabled && !!t.cloneResult, a = P(i, n);
|
|
1016
1016
|
if (t.scope === "list" && (t.listKey = o.cdRef?.key || o.key, t.modelKey = o.model?.key || o.modelKey), t.type === "list_created" && t.args[0].listKey.startsWith("__global_list__") || t.listKey?.startsWith("__global_list__"))
|
|
1017
1017
|
return a;
|
|
1018
1018
|
const u = x.now(), c = u - r, f = Math.round(c * 1e3) / 1e3;
|
|
@@ -1033,12 +1033,12 @@ const j = (o, e) => e ? typeof structuredClone < "u" ? structuredClone(o) : y(o)
|
|
|
1033
1033
|
} catch {
|
|
1034
1034
|
return i;
|
|
1035
1035
|
}
|
|
1036
|
-
},
|
|
1036
|
+
}, Ge = (o) => (t, r, s) => {
|
|
1037
1037
|
const i = s.value;
|
|
1038
1038
|
return s.value = function(...n) {
|
|
1039
|
-
const a = x.now(), u = this.cdRef, c =
|
|
1039
|
+
const a = x.now(), u = this.cdRef, c = P(o, !0);
|
|
1040
1040
|
c.key || (u.increaseCounter(), c.key = u.getCounter());
|
|
1041
|
-
const f =
|
|
1041
|
+
const f = ee();
|
|
1042
1042
|
u.analyticsController.mark({
|
|
1043
1043
|
name: `${c.type}:start`,
|
|
1044
1044
|
context: f
|
|
@@ -1046,10 +1046,10 @@ const j = (o, e) => e ? typeof structuredClone < "u" ? structuredClone(o) : y(o)
|
|
|
1046
1046
|
const d = this.model?.key;
|
|
1047
1047
|
!c.originCdRefKey && u.key && (c.originCdRefKey = u.key), d && (c.modelKey = d);
|
|
1048
1048
|
const l = i.apply(this, n);
|
|
1049
|
-
return c.method = r, c.args = n, l && typeof l == "object" && "then" in l ? l.then((h) =>
|
|
1049
|
+
return c.method = r, c.args = n, l && typeof l == "object" && "then" in l ? l.then((h) => G(this, u, c, a, f, h)) : G(this, u, c, a, f, l);
|
|
1050
1050
|
}, s;
|
|
1051
1051
|
};
|
|
1052
|
-
function
|
|
1052
|
+
function je(o, e, t, r) {
|
|
1053
1053
|
t.max || (t.max = 20);
|
|
1054
1054
|
const s = [], i = t.transform ? r.transformValue(t.value, t.transform) : t.value;
|
|
1055
1055
|
for (const [n, a] of e.entries()) {
|
|
@@ -1091,13 +1091,13 @@ function Fe(o, e, t, r) {
|
|
|
1091
1091
|
}
|
|
1092
1092
|
return s;
|
|
1093
1093
|
}
|
|
1094
|
-
function
|
|
1094
|
+
function se(o) {
|
|
1095
1095
|
return o instanceof Date;
|
|
1096
1096
|
}
|
|
1097
|
-
function
|
|
1097
|
+
function ne(o) {
|
|
1098
1098
|
return o instanceof Date && !isNaN(o.getTime());
|
|
1099
1099
|
}
|
|
1100
|
-
const
|
|
1100
|
+
const ie = {
|
|
1101
1101
|
yyyy: { type: "year", pattern: "yyyy", regex: "(\\d{4})" },
|
|
1102
1102
|
yy: { type: "year", pattern: "yy", regex: "(\\d{2})" },
|
|
1103
1103
|
MM: { type: "month", pattern: "MM", regex: "(\\d{2})" },
|
|
@@ -1112,11 +1112,11 @@ const ne = {
|
|
|
1112
1112
|
s: { type: "second", pattern: "s", regex: "(\\d{1,2})" },
|
|
1113
1113
|
SSS: { type: "millisecond", pattern: "SSS", regex: "(\\d{3})" }
|
|
1114
1114
|
};
|
|
1115
|
-
function
|
|
1115
|
+
function oe(o) {
|
|
1116
1116
|
let e = "^";
|
|
1117
1117
|
const t = [];
|
|
1118
1118
|
let r = o;
|
|
1119
|
-
const s = Object.entries(
|
|
1119
|
+
const s = Object.entries(ie).sort((i, n) => n[0].length - i[0].length);
|
|
1120
1120
|
for (; r.length > 0; ) {
|
|
1121
1121
|
let i = !1;
|
|
1122
1122
|
for (const [n, a] of s)
|
|
@@ -1133,7 +1133,7 @@ function ie(o) {
|
|
|
1133
1133
|
}
|
|
1134
1134
|
return e += "$", { regex: new RegExp(e), tokenOrder: t };
|
|
1135
1135
|
}
|
|
1136
|
-
function
|
|
1136
|
+
function ae(o, e) {
|
|
1137
1137
|
const t = {
|
|
1138
1138
|
year: 1970,
|
|
1139
1139
|
month: 1,
|
|
@@ -1152,7 +1152,7 @@ function oe(o, e) {
|
|
|
1152
1152
|
}
|
|
1153
1153
|
return t;
|
|
1154
1154
|
}
|
|
1155
|
-
function
|
|
1155
|
+
function ue(o) {
|
|
1156
1156
|
if (o.month < 1 || o.month > 12)
|
|
1157
1157
|
return /* @__PURE__ */ new Date(NaN);
|
|
1158
1158
|
if (o.day < 1 || o.day > 31)
|
|
@@ -1174,9 +1174,9 @@ function ae(o) {
|
|
|
1174
1174
|
o.second,
|
|
1175
1175
|
o.millisecond
|
|
1176
1176
|
);
|
|
1177
|
-
return
|
|
1177
|
+
return ne(e) ? e.getFullYear() !== o.year || e.getMonth() !== o.month - 1 || e.getDate() !== o.day ? /* @__PURE__ */ new Date(NaN) : e : /* @__PURE__ */ new Date(NaN);
|
|
1178
1178
|
}
|
|
1179
|
-
function
|
|
1179
|
+
function Be(o, e, t) {
|
|
1180
1180
|
if (o = o.trim(), e === "t") {
|
|
1181
1181
|
const a = Number(o);
|
|
1182
1182
|
return isNaN(a) ? /* @__PURE__ */ new Date(NaN) : new Date(a * 1e3);
|
|
@@ -1185,13 +1185,13 @@ function Ge(o, e, t) {
|
|
|
1185
1185
|
const a = Number(o);
|
|
1186
1186
|
return isNaN(a) ? /* @__PURE__ */ new Date(NaN) : new Date(a);
|
|
1187
1187
|
}
|
|
1188
|
-
const { regex: r, tokenOrder: s } =
|
|
1188
|
+
const { regex: r, tokenOrder: s } = oe(e), i = o.match(r);
|
|
1189
1189
|
if (!i)
|
|
1190
1190
|
return /* @__PURE__ */ new Date(NaN);
|
|
1191
|
-
const n =
|
|
1192
|
-
return
|
|
1191
|
+
const n = ae(i, s);
|
|
1192
|
+
return ue(n);
|
|
1193
1193
|
}
|
|
1194
|
-
class
|
|
1194
|
+
class ce {
|
|
1195
1195
|
cache;
|
|
1196
1196
|
maxSize;
|
|
1197
1197
|
accessOrder;
|
|
@@ -1234,7 +1234,7 @@ class ue {
|
|
|
1234
1234
|
};
|
|
1235
1235
|
}
|
|
1236
1236
|
}
|
|
1237
|
-
class
|
|
1237
|
+
class fe {
|
|
1238
1238
|
graph;
|
|
1239
1239
|
constructor() {
|
|
1240
1240
|
this.graph = /* @__PURE__ */ new Map();
|
|
@@ -1270,13 +1270,13 @@ class ce {
|
|
|
1270
1270
|
this.graph.clear();
|
|
1271
1271
|
}
|
|
1272
1272
|
}
|
|
1273
|
-
class
|
|
1273
|
+
class de {
|
|
1274
1274
|
parseCache;
|
|
1275
1275
|
circularRefDetector;
|
|
1276
1276
|
cacheHits = 0;
|
|
1277
1277
|
cacheMisses = 0;
|
|
1278
1278
|
constructor(e = 1e3) {
|
|
1279
|
-
this.parseCache = new
|
|
1279
|
+
this.parseCache = new ce(e), this.circularRefDetector = new fe();
|
|
1280
1280
|
}
|
|
1281
1281
|
/**
|
|
1282
1282
|
* Parse an attribute string into its components
|
|
@@ -1435,8 +1435,42 @@ class fe {
|
|
|
1435
1435
|
return this.getPathSegments(e).length;
|
|
1436
1436
|
}
|
|
1437
1437
|
}
|
|
1438
|
-
const g = new
|
|
1439
|
-
function
|
|
1438
|
+
const g = new de();
|
|
1439
|
+
function v(o, e) {
|
|
1440
|
+
if (e.includes("[*]")) {
|
|
1441
|
+
const i = e.indexOf("[*]"), n = e.substring(0, i), a = e.substring(i + 3), u = n ? D(o, n) : o;
|
|
1442
|
+
if (!Array.isArray(u)) return [];
|
|
1443
|
+
const c = [];
|
|
1444
|
+
for (const f of u)
|
|
1445
|
+
!a || a === "" ? f !== void 0 && c.push(f) : a.startsWith(".") && c.push(...v(f, a.slice(1)));
|
|
1446
|
+
return c;
|
|
1447
|
+
}
|
|
1448
|
+
const t = e.split(".");
|
|
1449
|
+
let r = [o];
|
|
1450
|
+
for (const i of t) {
|
|
1451
|
+
const n = [];
|
|
1452
|
+
for (const a of r)
|
|
1453
|
+
if (a != null)
|
|
1454
|
+
if (Array.isArray(a))
|
|
1455
|
+
for (const u of a) {
|
|
1456
|
+
if (u == null) continue;
|
|
1457
|
+
const c = u[i];
|
|
1458
|
+
c !== void 0 && n.push(c);
|
|
1459
|
+
}
|
|
1460
|
+
else {
|
|
1461
|
+
const u = a[i];
|
|
1462
|
+
u !== void 0 && n.push(u);
|
|
1463
|
+
}
|
|
1464
|
+
if (r = n, r.length === 0) return [];
|
|
1465
|
+
}
|
|
1466
|
+
const s = [];
|
|
1467
|
+
for (const i of r)
|
|
1468
|
+
if (Array.isArray(i))
|
|
1469
|
+
for (const n of i) n !== void 0 && s.push(n);
|
|
1470
|
+
else i !== void 0 && s.push(i);
|
|
1471
|
+
return s;
|
|
1472
|
+
}
|
|
1473
|
+
function K(o) {
|
|
1440
1474
|
let e = 0;
|
|
1441
1475
|
for (let t of o) {
|
|
1442
1476
|
const r = t.toString().split(".")[1];
|
|
@@ -1444,13 +1478,13 @@ function D(o) {
|
|
|
1444
1478
|
}
|
|
1445
1479
|
return Math.pow(10, e);
|
|
1446
1480
|
}
|
|
1447
|
-
function
|
|
1481
|
+
function j(o, e, t) {
|
|
1448
1482
|
return (o * t + e * t) / t;
|
|
1449
1483
|
}
|
|
1450
|
-
function
|
|
1484
|
+
function le(o, e, t) {
|
|
1451
1485
|
return o * t / (e * t);
|
|
1452
1486
|
}
|
|
1453
|
-
const
|
|
1487
|
+
const M = (o, e, t, r) => {
|
|
1454
1488
|
if (!r)
|
|
1455
1489
|
throw new Error("Attribute not found");
|
|
1456
1490
|
const s = {
|
|
@@ -1458,22 +1492,42 @@ const Q = (o, e, t, r) => {
|
|
|
1458
1492
|
types: o.types
|
|
1459
1493
|
};
|
|
1460
1494
|
let i;
|
|
1461
|
-
(s.types.includes("sum") || s.types.includes("avg")
|
|
1495
|
+
(s.types.includes("sum") || s.types.includes("avg")) && (i = ye(r, e));
|
|
1462
1496
|
let n;
|
|
1463
|
-
return (s.types.includes("min") || s.types.includes("max")) && (n =
|
|
1464
|
-
a === "sum" ? s.sum = i?.sum : a === "avg" ? s.avg = i?.average : a === "count" ? s.count =
|
|
1497
|
+
return (s.types.includes("min") || s.types.includes("max")) && (n = pe(r, e)), o.types.forEach((a) => {
|
|
1498
|
+
a === "sum" ? s.sum = i?.sum : a === "avg" ? s.avg = i?.average : a === "count" ? s.count = he(r, e) : a === "min" ? s.min = n && n[0] : a === "max" ? s.max = n && n[1] : a === "distinct" ? s.distinct = me(o, e, t) : a === "group" && (s.group = ge(o, e));
|
|
1465
1499
|
}), s;
|
|
1466
|
-
},
|
|
1500
|
+
}, he = (o, e) => {
|
|
1501
|
+
const r = g.parse(o).isDeepQuery;
|
|
1502
|
+
let s = 0;
|
|
1503
|
+
for (const i of e.values())
|
|
1504
|
+
if (i)
|
|
1505
|
+
if (r)
|
|
1506
|
+
s += v(i, o).filter((n) => n != null).length;
|
|
1507
|
+
else {
|
|
1508
|
+
const n = i[o];
|
|
1509
|
+
if (n == null) continue;
|
|
1510
|
+
Array.isArray(n) ? s += n.filter((a) => a != null).length : s++;
|
|
1511
|
+
}
|
|
1512
|
+
return s;
|
|
1513
|
+
}, pe = (o, e) => {
|
|
1467
1514
|
let t, r;
|
|
1468
1515
|
const i = g.parse(o).isDeepQuery;
|
|
1469
|
-
for (const n of e.values())
|
|
1470
|
-
if (n)
|
|
1471
|
-
|
|
1472
|
-
|
|
1516
|
+
for (const n of e.values()) {
|
|
1517
|
+
if (!n) continue;
|
|
1518
|
+
let a;
|
|
1519
|
+
if (i)
|
|
1520
|
+
a = v(n, o);
|
|
1521
|
+
else {
|
|
1522
|
+
const u = n[o];
|
|
1523
|
+
u === void 0 ? a = [] : Array.isArray(u) ? a = u.filter((c) => c !== void 0) : a = [u];
|
|
1473
1524
|
}
|
|
1525
|
+
for (const u of a)
|
|
1526
|
+
u == null || typeof u == "object" || ((t === void 0 || u < t) && (t = u), (r === void 0 || u > r) && (r = u));
|
|
1527
|
+
}
|
|
1474
1528
|
if (!(t === void 0 || r === void 0))
|
|
1475
1529
|
return [t, r];
|
|
1476
|
-
},
|
|
1530
|
+
}, ge = (o, e) => {
|
|
1477
1531
|
const t = [];
|
|
1478
1532
|
o.groupOptions?.groups?.forEach((n) => {
|
|
1479
1533
|
t.push({
|
|
@@ -1488,28 +1542,39 @@ const Q = (o, e, t, r) => {
|
|
|
1488
1542
|
keys: []
|
|
1489
1543
|
}, i = g.parse(o.attribute).isDeepQuery;
|
|
1490
1544
|
for (const n of e.values()) {
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1545
|
+
let a;
|
|
1546
|
+
i ? a = v(n, o.attribute) : a = [n[o.attribute]];
|
|
1547
|
+
let u = !1;
|
|
1548
|
+
for (const c of a)
|
|
1549
|
+
for (const f of t)
|
|
1550
|
+
(typeof f.option.value < "u" && f.option.value.includes(c) || typeof f.option.from < "u" && f.option.from < c && typeof f.option.to < "u" && f.option.to > c) && (f.keys.includes(n.key) || (f.count++, f.keys.push(n.key)), u = !0);
|
|
1551
|
+
!u && o?.groupOptions?.calculateNotFound && (r.count++, r.keys.push(n.key));
|
|
1494
1552
|
}
|
|
1495
1553
|
return o?.groupOptions?.calculateNotFound && t.push(r), t;
|
|
1496
|
-
},
|
|
1554
|
+
}, ye = (o, e) => {
|
|
1497
1555
|
let t = 0, r = 0;
|
|
1498
1556
|
const i = g.parse(o).isDeepQuery;
|
|
1499
|
-
for (const
|
|
1500
|
-
if (!
|
|
1501
|
-
|
|
1502
|
-
if (
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1557
|
+
for (const a of e.values()) {
|
|
1558
|
+
if (!a) continue;
|
|
1559
|
+
let u;
|
|
1560
|
+
if (i)
|
|
1561
|
+
u = v(a, o);
|
|
1562
|
+
else {
|
|
1563
|
+
const c = a[o];
|
|
1564
|
+
c === void 0 ? u = [] : Array.isArray(c) ? u = c : u = [c];
|
|
1565
|
+
}
|
|
1566
|
+
for (const c of u)
|
|
1567
|
+
if (Array.isArray(c))
|
|
1568
|
+
for (const f of c)
|
|
1569
|
+
typeof f == "number" && (t = j(t, f, K([t, f])), r++);
|
|
1570
|
+
else typeof c == "number" && (t = j(t, c, K([t, c])), r++);
|
|
1571
|
+
}
|
|
1572
|
+
return r === 0 ? void 0 : {
|
|
1573
|
+
average: le(t, r, K([t, r])),
|
|
1574
|
+
count: r,
|
|
1510
1575
|
sum: t
|
|
1511
1576
|
};
|
|
1512
|
-
},
|
|
1577
|
+
}, me = (o, e, t) => {
|
|
1513
1578
|
const r = [];
|
|
1514
1579
|
for (const [s, i] of t)
|
|
1515
1580
|
if (!(o.excludeUndefineds && typeof s > "u") && Array.from(i).find((n) => e.has(n))) {
|
|
@@ -1529,7 +1594,7 @@ class w extends Error {
|
|
|
1529
1594
|
super(r), this.query = t, this.name = "DcuplQueryError";
|
|
1530
1595
|
}
|
|
1531
1596
|
}
|
|
1532
|
-
class
|
|
1597
|
+
class R {
|
|
1533
1598
|
_defaultQueryOptions = {
|
|
1534
1599
|
modelKey: "",
|
|
1535
1600
|
groupKey: "root",
|
|
@@ -1682,7 +1747,7 @@ class P {
|
|
|
1682
1747
|
(s) => this.isQueryGroup(s) && s.groupKey === e.attribute
|
|
1683
1748
|
);
|
|
1684
1749
|
if (r > -1) {
|
|
1685
|
-
const s = t.queries[r], i =
|
|
1750
|
+
const s = t.queries[r], i = E(s.queries, e);
|
|
1686
1751
|
i > -1 && s.queries.splice(i, 1), s.queries.length === 0 && t.queries.splice(r, 1);
|
|
1687
1752
|
}
|
|
1688
1753
|
} else if (this.isQueryGroup(e)) {
|
|
@@ -1695,7 +1760,7 @@ class P {
|
|
|
1695
1760
|
else {
|
|
1696
1761
|
const s = t.queries[r];
|
|
1697
1762
|
for (const i of e.queries) {
|
|
1698
|
-
const n =
|
|
1763
|
+
const n = E(s.queries, i);
|
|
1699
1764
|
n > -1 && s.queries.splice(n, 1);
|
|
1700
1765
|
}
|
|
1701
1766
|
s.queries.length === 0 && t.queries.splice(r, 1);
|
|
@@ -2210,48 +2275,48 @@ class P {
|
|
|
2210
2275
|
return e(this.currentQuery.queries);
|
|
2211
2276
|
}
|
|
2212
2277
|
}
|
|
2213
|
-
const
|
|
2214
|
-
function
|
|
2215
|
-
const a = [], u =
|
|
2278
|
+
const I = new R();
|
|
2279
|
+
function Te(o, e, t, r, s, i, n) {
|
|
2280
|
+
const a = [], u = I.removeQuery({ groupKey: s }, y(r)), c = n.queryData(o, u, !1, i), f = e ? [...e.keys()] : [], d = new Set(f), l = i.get(s);
|
|
2216
2281
|
if (!t.excludeUnresolved)
|
|
2217
2282
|
for (const h of l.keys())
|
|
2218
2283
|
d.add(h);
|
|
2219
2284
|
t.excludeUndefineds ? d.delete(void 0) : d.add(void 0);
|
|
2220
2285
|
for (const h of d.values()) {
|
|
2221
|
-
const A = /* @__PURE__ */ new Map(),
|
|
2222
|
-
for (const
|
|
2223
|
-
const
|
|
2224
|
-
if (
|
|
2286
|
+
const A = /* @__PURE__ */ new Map(), W = l.get(h) || /* @__PURE__ */ new Set();
|
|
2287
|
+
for (const k of W) {
|
|
2288
|
+
const C = c.get(k);
|
|
2289
|
+
if (C && (A.set(k, C), !t?.calculateFacets))
|
|
2225
2290
|
break;
|
|
2226
2291
|
}
|
|
2227
|
-
const
|
|
2292
|
+
const N = {
|
|
2228
2293
|
key: String(h),
|
|
2229
2294
|
value: h,
|
|
2230
|
-
selected:
|
|
2295
|
+
selected: ve(s, h, r),
|
|
2231
2296
|
enabled: A.size > 0,
|
|
2232
2297
|
size: A.size,
|
|
2233
2298
|
entry: e.get(h),
|
|
2234
2299
|
resultKeys: Array.from(A.keys())
|
|
2235
2300
|
};
|
|
2236
|
-
if (!(t?.excludeZeros &&
|
|
2301
|
+
if (!(t?.excludeZeros && N.size === 0)) {
|
|
2237
2302
|
if (t?.count && a.length === t?.count)
|
|
2238
2303
|
return a;
|
|
2239
|
-
a.push(
|
|
2304
|
+
a.push(N);
|
|
2240
2305
|
}
|
|
2241
2306
|
}
|
|
2242
2307
|
return a;
|
|
2243
2308
|
}
|
|
2244
|
-
const
|
|
2245
|
-
const r = t.queries.findIndex((s) =>
|
|
2309
|
+
const ve = (o, e, t) => {
|
|
2310
|
+
const r = t.queries.findIndex((s) => I.isQueryGroup(s) && s.groupKey === o);
|
|
2246
2311
|
return r > -1 ? !!t.queries[r].queries.find((i) => {
|
|
2247
|
-
if (
|
|
2312
|
+
if (I.isQuery(i)) {
|
|
2248
2313
|
const n = i.value?.key || i.value;
|
|
2249
2314
|
return i.attribute === o && n === e;
|
|
2250
2315
|
}
|
|
2251
2316
|
return !1;
|
|
2252
2317
|
}) : !1;
|
|
2253
2318
|
};
|
|
2254
|
-
class
|
|
2319
|
+
class we {
|
|
2255
2320
|
indexMap = /* @__PURE__ */ new Map();
|
|
2256
2321
|
// Possible performance gain*
|
|
2257
2322
|
dataMap = /* @__PURE__ */ new Map();
|
|
@@ -2322,15 +2387,15 @@ class me {
|
|
|
2322
2387
|
this.reset(s), this.indexMap.set(s, /* @__PURE__ */ new Map());
|
|
2323
2388
|
const u = g.parse(e).isDeepQuery;
|
|
2324
2389
|
for (const c of t.values()) {
|
|
2325
|
-
|
|
2326
|
-
this.fillInverseIndex(s, c.key,
|
|
2390
|
+
let f;
|
|
2391
|
+
u ? (f = v(c, e), f.length === 0 && (f = [void 0])) : f = [c[e]], this.fillInverseIndex(s, c.key, f), this.fillDataMap(s, f);
|
|
2327
2392
|
}
|
|
2328
2393
|
i = this.getIndex(s) || /* @__PURE__ */ new Map();
|
|
2329
2394
|
}
|
|
2330
2395
|
return i;
|
|
2331
2396
|
}
|
|
2332
2397
|
getIndexName(e, t) {
|
|
2333
|
-
return t ? e + "_" +
|
|
2398
|
+
return t ? e + "_" + Q(t) : e;
|
|
2334
2399
|
}
|
|
2335
2400
|
// ========== PARTIAL UPDATE METHODS ==========
|
|
2336
2401
|
/**
|
|
@@ -2500,7 +2565,7 @@ class me {
|
|
|
2500
2565
|
}
|
|
2501
2566
|
}
|
|
2502
2567
|
const m = "__";
|
|
2503
|
-
function
|
|
2568
|
+
function z(o, e, t = { key: "root" }, r = "root", s = new we(), i) {
|
|
2504
2569
|
const n = i || o;
|
|
2505
2570
|
for (const a of e.columns)
|
|
2506
2571
|
a.attribute && (g.parse(a.attribute), s.getOrCreateIndex(a.attribute, n));
|
|
@@ -2510,24 +2575,24 @@ function R(o, e, t = { key: "root" }, r = "root", s = new me(), i) {
|
|
|
2510
2575
|
a.attribute && (g.parse(a.attribute), s.getOrCreateIndex(a.attribute, n));
|
|
2511
2576
|
if (e.rows && e.rows.length > 0) {
|
|
2512
2577
|
t.rows = t.rows || [];
|
|
2513
|
-
const a =
|
|
2578
|
+
const a = xe(o, e.rows[0], e, s, r, i);
|
|
2514
2579
|
t.rows.push(a);
|
|
2515
2580
|
}
|
|
2516
2581
|
if (e.columns && e.columns.length > 0) {
|
|
2517
2582
|
t.columns = t.columns || [];
|
|
2518
|
-
const a =
|
|
2583
|
+
const a = _(o, e.columns[0], e, s, r, i);
|
|
2519
2584
|
t.columns.push(a);
|
|
2520
2585
|
}
|
|
2521
2586
|
if (t.key === "root")
|
|
2522
2587
|
for (const a of e.values) {
|
|
2523
2588
|
if (t.values = t.values || [], r === "root" && e.options?.calculateTotals === !1)
|
|
2524
2589
|
continue;
|
|
2525
|
-
const u =
|
|
2590
|
+
const u = M(a, o, s.getIndex(a.attribute), a.attribute);
|
|
2526
2591
|
t.values.push(u);
|
|
2527
2592
|
}
|
|
2528
2593
|
return t;
|
|
2529
2594
|
}
|
|
2530
|
-
function
|
|
2595
|
+
function xe(o, e, t, r, s = "", i) {
|
|
2531
2596
|
const n = { key: e.attribute }, a = r.getIndex(e.attribute);
|
|
2532
2597
|
if (!a)
|
|
2533
2598
|
return n;
|
|
@@ -2542,12 +2607,12 @@ function ve(o, e, t, r, s = "", i) {
|
|
|
2542
2607
|
for (const l of t.values) {
|
|
2543
2608
|
if (f.values = f.values || [], s === "root" && e?.calculateTotals === !1)
|
|
2544
2609
|
continue;
|
|
2545
|
-
const h =
|
|
2610
|
+
const h = M(l, d, r.getIndex(l.attribute), l.attribute);
|
|
2546
2611
|
f.values.push(h);
|
|
2547
2612
|
}
|
|
2548
2613
|
if (n.rows = n.rows || [], n.rows.push(f), t.rows.length > 1) {
|
|
2549
2614
|
const l = { ...t, rows: t.rows.slice(1) };
|
|
2550
|
-
|
|
2615
|
+
z(
|
|
2551
2616
|
d,
|
|
2552
2617
|
l,
|
|
2553
2618
|
f,
|
|
@@ -2558,7 +2623,7 @@ function ve(o, e, t, r, s = "", i) {
|
|
|
2558
2623
|
} else if (t.columns)
|
|
2559
2624
|
for (const l of t.columns) {
|
|
2560
2625
|
f.columns = f.columns || [];
|
|
2561
|
-
const h =
|
|
2626
|
+
const h = _(
|
|
2562
2627
|
d,
|
|
2563
2628
|
l,
|
|
2564
2629
|
t,
|
|
@@ -2572,7 +2637,7 @@ function ve(o, e, t, r, s = "", i) {
|
|
|
2572
2637
|
}
|
|
2573
2638
|
return n;
|
|
2574
2639
|
}
|
|
2575
|
-
function
|
|
2640
|
+
function _(o, e, t, r, s = "", i) {
|
|
2576
2641
|
const n = { key: e.attribute }, a = r.getIndex(e.attribute);
|
|
2577
2642
|
if (!a)
|
|
2578
2643
|
return n;
|
|
@@ -2587,12 +2652,12 @@ function z(o, e, t, r, s = "", i) {
|
|
|
2587
2652
|
for (const l of t.values) {
|
|
2588
2653
|
if (f.values = f.values || [], s === "root" && e?.calculateTotals === !1)
|
|
2589
2654
|
continue;
|
|
2590
|
-
const h =
|
|
2655
|
+
const h = M(l, d, r.getIndex(l.attribute), l.attribute);
|
|
2591
2656
|
f.values.push(h);
|
|
2592
2657
|
}
|
|
2593
2658
|
if (n.columns = n.columns || [], n.columns.push(f), t.columns.length > 1) {
|
|
2594
2659
|
const l = { ...t, columns: t.columns.slice(1) };
|
|
2595
|
-
|
|
2660
|
+
z(
|
|
2596
2661
|
d,
|
|
2597
2662
|
l,
|
|
2598
2663
|
f,
|
|
@@ -2605,11 +2670,11 @@ function z(o, e, t, r, s = "", i) {
|
|
|
2605
2670
|
}
|
|
2606
2671
|
return n;
|
|
2607
2672
|
}
|
|
2608
|
-
const
|
|
2673
|
+
const Pe = (o, e) => {
|
|
2609
2674
|
const t = [];
|
|
2610
2675
|
for (const r of o) {
|
|
2611
2676
|
for (const [s, i] of Object.entries(r)) {
|
|
2612
|
-
const n = t.find((u) => u.key === s), a =
|
|
2677
|
+
const n = t.find((u) => u.key === s), a = De(i);
|
|
2613
2678
|
if (n)
|
|
2614
2679
|
n.type !== a && (n.type = "any");
|
|
2615
2680
|
else {
|
|
@@ -2624,21 +2689,21 @@ const Te = (o, e) => {
|
|
|
2624
2689
|
break;
|
|
2625
2690
|
}
|
|
2626
2691
|
return t;
|
|
2627
|
-
},
|
|
2692
|
+
}, Ae = (o) => Number(o) === o && o % 1 === 0, be = (o) => Number(o) === o && o % 1 !== 0, De = (o) => {
|
|
2628
2693
|
switch (typeof o) {
|
|
2629
2694
|
case "string":
|
|
2630
2695
|
return "string";
|
|
2631
2696
|
case "number":
|
|
2632
|
-
return
|
|
2697
|
+
return Ae(o) ? "int" : be(o) ? "float" : "any";
|
|
2633
2698
|
case "boolean":
|
|
2634
2699
|
return "boolean";
|
|
2635
2700
|
case "object":
|
|
2636
|
-
return
|
|
2701
|
+
return se(o) ? "date" : "json";
|
|
2637
2702
|
default:
|
|
2638
2703
|
return "any";
|
|
2639
2704
|
}
|
|
2640
|
-
},
|
|
2641
|
-
const t =
|
|
2705
|
+
}, Re = (o, e) => {
|
|
2706
|
+
const t = te(o.text || ""), r = e?.attributeKey || o.filterKey;
|
|
2642
2707
|
let s;
|
|
2643
2708
|
const i = e?.comparisonType || "containsIgnoreCase";
|
|
2644
2709
|
return i === "containsIgnoreCase" ? s = {
|
|
@@ -2701,7 +2766,7 @@ const Te = (o, e) => {
|
|
|
2701
2766
|
}
|
|
2702
2767
|
]
|
|
2703
2768
|
}), s;
|
|
2704
|
-
},
|
|
2769
|
+
}, ze = (o, e) => {
|
|
2705
2770
|
const t = e?.attributeKey || o.filterKey;
|
|
2706
2771
|
return {
|
|
2707
2772
|
groupKey: o.filterKey,
|
|
@@ -2714,7 +2779,7 @@ const Te = (o, e) => {
|
|
|
2714
2779
|
}
|
|
2715
2780
|
]
|
|
2716
2781
|
};
|
|
2717
|
-
},
|
|
2782
|
+
}, _e = (o, e) => {
|
|
2718
2783
|
const t = e?.attributeKey || o.filterKey, r = {
|
|
2719
2784
|
groupKey: o.filterKey,
|
|
2720
2785
|
queries: []
|
|
@@ -2729,7 +2794,7 @@ const Te = (o, e) => {
|
|
|
2729
2794
|
operator: "eq",
|
|
2730
2795
|
options: { invert: !0 }
|
|
2731
2796
|
})), typeof o.gt < "u" && (r.groupType = "and", r.queries.push({ attribute: t, value: o.gt, operator: "gt" })), typeof o.lt < "u" && (r.groupType = "and", r.queries.push({ attribute: t, value: o.lt, operator: "lt" })), typeof o.gte < "u" && (r.groupType = "and", r.queries.push({ attribute: t, value: o.gte, operator: "gte" })), typeof o.lte < "u" && (r.groupType = "and", r.queries.push({ attribute: t, value: o.lte, operator: "lte" })), r;
|
|
2732
|
-
},
|
|
2797
|
+
}, We = (o, e) => {
|
|
2733
2798
|
const t = e?.attributeKey || o.filterKey, r = {
|
|
2734
2799
|
groupKey: o.filterKey,
|
|
2735
2800
|
queries: []
|
|
@@ -2742,13 +2807,13 @@ const Te = (o, e) => {
|
|
|
2742
2807
|
operator: "eq"
|
|
2743
2808
|
});
|
|
2744
2809
|
}), r;
|
|
2745
|
-
},
|
|
2746
|
-
class
|
|
2810
|
+
}, Le = (o) => !(typeof o.modelKey != "string" || !Array.isArray(o.queries));
|
|
2811
|
+
class He {
|
|
2747
2812
|
constructor(e, t, r) {
|
|
2748
2813
|
this.scriptController = e, this.globalItemService = t, this.modelParser = r;
|
|
2749
2814
|
}
|
|
2750
2815
|
registeredCustomOperator = /* @__PURE__ */ new Map();
|
|
2751
|
-
queryBuilder = new
|
|
2816
|
+
queryBuilder = new R();
|
|
2752
2817
|
registerCustomOperator(e, t) {
|
|
2753
2818
|
this.registeredCustomOperator.set(e, t);
|
|
2754
2819
|
}
|
|
@@ -2764,11 +2829,11 @@ class We {
|
|
|
2764
2829
|
evaluateQuery(e, t) {
|
|
2765
2830
|
let r, s = e.value;
|
|
2766
2831
|
const i = e.options?.arrayValueHandling || "some";
|
|
2767
|
-
if (Array.isArray(e.options?.transform) && e.options.transform.length > 0 && (s = this.transformValue(s, e.options.transform)), e.attribute.includes(".") || e.attribute.includes("[") ? r =
|
|
2832
|
+
if (Array.isArray(e.options?.transform) && e.options.transform.length > 0 && (s = this.transformValue(s, e.options.transform)), e.attribute.includes(".") || e.attribute.includes("[") ? r = D(t, e.attribute) : r = t[e.attribute], Array.isArray(e.options?.transform) && e.options.transform.length > 0 && (r = this.transformValue(r, e.options.transform)), (typeof r > "u" || r === null) && !["typeof", "isTruthy", "eq"].includes(e.operator))
|
|
2768
2833
|
return !1;
|
|
2769
2834
|
switch (e.operator) {
|
|
2770
2835
|
case "eq":
|
|
2771
|
-
return e.options?.invert ? !
|
|
2836
|
+
return e.options?.invert ? !O(r, s) : O(r, s);
|
|
2772
2837
|
case "find":
|
|
2773
2838
|
return e.options?.invert ? !this.queryFind(r, s, i) : this.queryFind(r, s, i);
|
|
2774
2839
|
case "lt":
|
|
@@ -2784,7 +2849,7 @@ class We {
|
|
|
2784
2849
|
case "isTruthy":
|
|
2785
2850
|
return s === !0 ? Array.isArray(r) ? i === "some" ? r.some((n) => typeof !!n) : r.every((n) => typeof !!n) : !!r : !r;
|
|
2786
2851
|
case "size":
|
|
2787
|
-
return typeof r == "string" ? r.length === s :
|
|
2852
|
+
return typeof r == "string" ? r.length === s : L(r) === s;
|
|
2788
2853
|
default:
|
|
2789
2854
|
if (this.scriptController.hasScript(e.operator))
|
|
2790
2855
|
return this.scriptController.executeScript(e.operator, "operator", { query: e, item: t });
|
|
@@ -2831,16 +2896,16 @@ class We {
|
|
|
2831
2896
|
return i;
|
|
2832
2897
|
}
|
|
2833
2898
|
equalRegexFn(e, t) {
|
|
2834
|
-
if (typeof t == "string" &&
|
|
2899
|
+
if (typeof t == "string" && H(t, "/") && U(t, "/"))
|
|
2835
2900
|
try {
|
|
2836
2901
|
return new RegExp(t.slice(1, -1)).test(e);
|
|
2837
2902
|
} catch {
|
|
2838
2903
|
return !1;
|
|
2839
2904
|
}
|
|
2840
|
-
else return Array.isArray(e) ? !!e.find((r) => b(r, t, this.equalRegexFn)) : typeof t == "object" ?
|
|
2905
|
+
else return Array.isArray(e) ? !!e.find((r) => b(r, t, this.equalRegexFn)) : typeof t == "object" ? V(e, t) : e === t;
|
|
2841
2906
|
}
|
|
2842
2907
|
queryFind(e, t, r) {
|
|
2843
|
-
return Array.isArray(e) ? typeof t == "string" || typeof t == "number" || typeof t == "boolean" ? r === "some" ? e.some((s) => b(s, t, this.equalRegexFn)) : e.every((s) => b(s, t, this.equalRegexFn)) : !!
|
|
2908
|
+
return Array.isArray(e) ? typeof t == "string" || typeof t == "number" || typeof t == "boolean" ? r === "some" ? e.some((s) => b(s, t, this.equalRegexFn)) : e.every((s) => b(s, t, this.equalRegexFn)) : !!J(e, t) : b(e, t, this.equalRegexFn);
|
|
2844
2909
|
}
|
|
2845
2910
|
validateQuery(e) {
|
|
2846
2911
|
if (this.queryBuilder.isQuery(e)) {
|
|
@@ -2857,24 +2922,35 @@ class We {
|
|
|
2857
2922
|
}
|
|
2858
2923
|
getEvaluatedQueryDataset(e, t, r, s) {
|
|
2859
2924
|
const i = /* @__PURE__ */ new Map();
|
|
2860
|
-
if (t.attribute.includes("[*]"))
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2925
|
+
if (t.attribute.includes("[*]")) {
|
|
2926
|
+
const n = t.options?.invert === !0, a = /* @__PURE__ */ new Set();
|
|
2927
|
+
for (let u of r.values()) {
|
|
2928
|
+
const c = this.queryBuilder.extractQueryAttributes({ queries: [t] });
|
|
2929
|
+
if (c.some((l) => l.isDeepQuery)) {
|
|
2930
|
+
const l = this.queryBuilder.getProjectionForAttributeEntries(
|
|
2931
|
+
c.filter((h) => h.isDeepQuery)
|
|
2866
2932
|
);
|
|
2867
|
-
|
|
2868
|
-
|
|
2933
|
+
u = this.globalItemService.getProjectedData(
|
|
2934
|
+
l,
|
|
2869
2935
|
this.modelParser.models.get(e.modelKey),
|
|
2870
|
-
|
|
2936
|
+
u
|
|
2871
2937
|
);
|
|
2872
2938
|
}
|
|
2873
|
-
const
|
|
2874
|
-
|
|
2875
|
-
|
|
2939
|
+
const f = this.handleArrayStarQuery(t, u);
|
|
2940
|
+
let d = !1;
|
|
2941
|
+
for (const l of f.queries) {
|
|
2942
|
+
const h = { ...l, options: { ...l.options, invert: !1 } };
|
|
2943
|
+
if (this.evaluateQuery(h, u)) {
|
|
2944
|
+
d = !0;
|
|
2945
|
+
break;
|
|
2946
|
+
}
|
|
2947
|
+
}
|
|
2948
|
+
d && (a.add(u.key), n || i.set(u.key, u));
|
|
2876
2949
|
}
|
|
2877
|
-
|
|
2950
|
+
if (n)
|
|
2951
|
+
for (const [u, c] of r)
|
|
2952
|
+
a.has(u) || i.set(u, c);
|
|
2953
|
+
} else {
|
|
2878
2954
|
if (t.operator === "eq")
|
|
2879
2955
|
return this.evaluateEqOperator(e, t, r, s);
|
|
2880
2956
|
for (let [n, a] of r) {
|
|
@@ -2901,14 +2977,15 @@ class We {
|
|
|
2901
2977
|
queries: []
|
|
2902
2978
|
};
|
|
2903
2979
|
if (r !== -1) {
|
|
2904
|
-
const i = e.attribute.substring(0, r), n = t[i];
|
|
2980
|
+
const i = e.attribute.substring(0, r), n = i.includes(".") ? D(t, i) : t[i];
|
|
2905
2981
|
if (Array.isArray(n))
|
|
2906
2982
|
for (let a = 0; a < n.length; a++) {
|
|
2907
2983
|
const u = e.attribute.replace("[*]", `[${a}]`);
|
|
2908
2984
|
s.queries.push({
|
|
2909
2985
|
attribute: u,
|
|
2910
2986
|
operator: e.operator,
|
|
2911
|
-
value: e.value
|
|
2987
|
+
value: e.value,
|
|
2988
|
+
options: e.options
|
|
2912
2989
|
});
|
|
2913
2990
|
}
|
|
2914
2991
|
}
|
|
@@ -2971,7 +3048,7 @@ class We {
|
|
|
2971
3048
|
// }
|
|
2972
3049
|
// }
|
|
2973
3050
|
}
|
|
2974
|
-
class
|
|
3051
|
+
class Ue {
|
|
2975
3052
|
scripts = /* @__PURE__ */ new Map();
|
|
2976
3053
|
scriptFunctions = /* @__PURE__ */ new Map();
|
|
2977
3054
|
constructor() {
|
|
@@ -3014,10 +3091,10 @@ class Le {
|
|
|
3014
3091
|
return this.getScriptAsFn(e, i)(t, ...n);
|
|
3015
3092
|
}
|
|
3016
3093
|
}
|
|
3017
|
-
const
|
|
3094
|
+
const Ve = (o, e) => o ? (e || (e = {}), o.replace(/\$\{(.*?)\}/g, (t, r) => D(e, r.trim(), ""))) : "", Je = (o) => {
|
|
3018
3095
|
const e = /* @__PURE__ */ new Set();
|
|
3019
3096
|
return o.replace(/\$\{(.*?)\}/g, (r, s) => (e.add(s.trim()), "")), { variables: Array.from(e).map((r) => ({ name: r })) };
|
|
3020
|
-
},
|
|
3097
|
+
}, Ze = [
|
|
3021
3098
|
"any",
|
|
3022
3099
|
"Array<date>",
|
|
3023
3100
|
"Array<float>",
|
|
@@ -3029,7 +3106,7 @@ const He = (o, e) => o ? (e || (e = {}), o.replace(/\$\{(.*?)\}/g, (t, r) => v(e
|
|
|
3029
3106
|
"int",
|
|
3030
3107
|
"json",
|
|
3031
3108
|
"string"
|
|
3032
|
-
],
|
|
3109
|
+
], Ye = ["int", "float", "Array<int>", "Array<float>"], Xe = ["date", "Array<date>"], et = [
|
|
3033
3110
|
"eq",
|
|
3034
3111
|
"find",
|
|
3035
3112
|
"gt",
|
|
@@ -3041,56 +3118,57 @@ const He = (o, e) => o ? (e || (e = {}), o.replace(/\$\{(.*?)\}/g, (t, r) => v(e
|
|
|
3041
3118
|
"size"
|
|
3042
3119
|
];
|
|
3043
3120
|
export {
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3121
|
+
Se as AnalyticsController,
|
|
3122
|
+
Ie as AttributeDependencyGraph,
|
|
3123
|
+
Qe as CacheController,
|
|
3124
|
+
Fe as ChangeDetector,
|
|
3125
|
+
Xe as DatePropertyTypes,
|
|
3126
|
+
R as DcuplQueryBuilder,
|
|
3127
|
+
et as DcuplQueryOperatorsAsArray,
|
|
3128
|
+
de as DeepQueryService,
|
|
3129
|
+
Y as DependencyGraph,
|
|
3130
|
+
we as IndicesController,
|
|
3054
3131
|
p as Logger,
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3132
|
+
Ye as NumberPropertyTypes,
|
|
3133
|
+
Ze as PropertyTypesAsArray,
|
|
3134
|
+
He as QueryManager,
|
|
3135
|
+
Ue as ScriptController,
|
|
3136
|
+
P as clone,
|
|
3137
|
+
re as compareVersions,
|
|
3138
|
+
je as computeSuggestions,
|
|
3062
3139
|
g as deepQueryService,
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3140
|
+
te as escapeRegExp,
|
|
3141
|
+
Ve as evaluateTemplate,
|
|
3142
|
+
ze as generateBooleanQuery,
|
|
3143
|
+
ee as generateKey,
|
|
3144
|
+
_e as generateNumberAndDateQuery,
|
|
3145
|
+
We as generateReferenceQuery,
|
|
3146
|
+
Re as generateTextQuery,
|
|
3147
|
+
M as getAggregation,
|
|
3148
|
+
ke as getDateConstraintUid,
|
|
3149
|
+
De as getDcuplPropertyTypeForNativeType,
|
|
3150
|
+
v as getDeepPathValues,
|
|
3151
|
+
me as getDistinct,
|
|
3152
|
+
Te as getFacets,
|
|
3153
|
+
Me as getFilterEntryId,
|
|
3154
|
+
Ne as getNumberConstraintUid,
|
|
3155
|
+
Pe as getPropertiesForData,
|
|
3156
|
+
Ee as groupBy,
|
|
3157
|
+
$e as hasMinimumVersion,
|
|
3158
|
+
se as isDateInstance,
|
|
3159
|
+
be as isFloat,
|
|
3160
|
+
Ae as isInt,
|
|
3161
|
+
ne as isValidDate,
|
|
3162
|
+
Le as isValidQueryStatement,
|
|
3163
|
+
F as isValidVersion,
|
|
3164
|
+
X as logger,
|
|
3165
|
+
Be as parseDate,
|
|
3166
|
+
Je as parseTemplate,
|
|
3089
3167
|
x as perf,
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3168
|
+
z as pivot,
|
|
3169
|
+
Oe as removeTrailingSlash,
|
|
3170
|
+
Ge as trigger,
|
|
3171
|
+
qe as unescapeRegExp,
|
|
3172
|
+
Ce as uniqBy
|
|
3095
3173
|
};
|
|
3096
3174
|
//# sourceMappingURL=index.js.map
|