@dcupl/common 2.0.0-beta.2 → 2.0.0-beta.21
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/analytics.controller.d.ts +1 -1
- package/dist/esm/changeDetection.d.ts +2 -2
- package/dist/esm/computeSuggestions.d.ts +2 -2
- package/dist/esm/deep-query.service.d.ts +1 -1
- package/dist/esm/getAggregation.d.ts +1 -1
- package/dist/esm/getFacets.d.ts +26 -3
- package/dist/esm/helper.d.ts +11 -1
- package/dist/esm/index.d.ts +25 -22
- package/dist/esm/index.js +1004 -690
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/indices.controller.d.ts +7 -1
- package/dist/esm/logger/index.d.ts +2 -2
- package/dist/esm/pivot.d.ts +2 -2
- package/dist/esm/property-parser.d.ts +27 -2
- package/dist/esm/query-builder.d.ts +15 -5
- package/dist/esm/query.helper.d.ts +1 -1
- package/dist/esm/queryData.d.ts +53 -3
- package/dist/esm/redact-url.d.ts +9 -0
- package/dist/esm/resource-id.d.ts +43 -0
- package/dist/esm/scheduling.d.ts +17 -0
- package/dist/esm/types/app-loader.types.d.ts +94 -4
- package/dist/esm/types/data.types.d.ts +7 -3
- package/dist/esm/types/dcupl.types.d.ts +26 -12
- package/dist/esm/types/facets.types.d.ts +14 -1
- package/dist/esm/types/filter.types.d.ts +3 -3
- package/dist/esm/types/group-by.types.d.ts +2 -2
- package/dist/esm/types/index.d.ts +17 -16
- package/dist/esm/types/internal.types.d.ts +1 -1
- package/dist/esm/types/key-property.types.d.ts +11 -0
- package/dist/esm/types/list.types.d.ts +25 -4
- package/dist/esm/types/model.types.d.ts +54 -5
- package/dist/esm/types/quality.types.d.ts +87 -1
- package/dist/esm/types/query.types.d.ts +115 -20
- package/dist/esm/types/section.types.d.ts +2 -2
- package/dist/esm/types/suggestion.types.d.ts +6 -1
- package/dist/node/index.cjs +2 -2
- package/dist/node/index.cjs.map +1 -1
- package/package.json +2 -4
package/dist/esm/index.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { cloneDeep as
|
|
2
|
-
function
|
|
3
|
-
const e =
|
|
1
|
+
import { cloneDeep as v, get as I, every as z, findIndex as $, size as V, isEqual as H, differenceBy as O, isEqualWith as k, isMatch as q, find as J } from "lodash-es";
|
|
2
|
+
function D(n) {
|
|
3
|
+
const e = N(n);
|
|
4
4
|
return Z(e);
|
|
5
5
|
}
|
|
6
|
-
function
|
|
7
|
-
if (typeof
|
|
8
|
-
return String(
|
|
9
|
-
if (Array.isArray(
|
|
10
|
-
return "[" +
|
|
11
|
-
const e = Object.keys(
|
|
6
|
+
function N(n) {
|
|
7
|
+
if (typeof n != "object" || n === null)
|
|
8
|
+
return String(n);
|
|
9
|
+
if (Array.isArray(n))
|
|
10
|
+
return "[" + n.map(N).join(",") + "]";
|
|
11
|
+
const e = Object.keys(n).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 + ":" + N(n[s]), r < e.length - 1 && (t += ",");
|
|
16
16
|
}
|
|
17
17
|
return t += "}", t;
|
|
18
18
|
}
|
|
19
|
-
function Z(
|
|
19
|
+
function Z(n) {
|
|
20
20
|
let e = 0;
|
|
21
|
-
for (let t = 0; t <
|
|
22
|
-
const r =
|
|
21
|
+
for (let t = 0; t < n.length; t++) {
|
|
22
|
+
const r = n.charCodeAt(t);
|
|
23
23
|
e = (e << 5) - e + r, e |= 0;
|
|
24
24
|
}
|
|
25
25
|
return e.toString(16);
|
|
26
26
|
}
|
|
27
|
-
const
|
|
27
|
+
const b = {
|
|
28
28
|
now: () => typeof performance < "u" && performance.now ? performance.now() : (/* @__PURE__ */ new Date()).getTime(),
|
|
29
|
-
mark: (
|
|
30
|
-
typeof performance < "u" && performance.mark && performance.mark(
|
|
29
|
+
mark: (n) => {
|
|
30
|
+
typeof performance < "u" && performance.mark && performance.mark(n);
|
|
31
31
|
},
|
|
32
|
-
measure: (
|
|
33
|
-
typeof performance < "u" && performance.measure && performance.measure(
|
|
32
|
+
measure: (n, e, t) => {
|
|
33
|
+
typeof performance < "u" && performance.measure && performance.measure(n, e, t);
|
|
34
34
|
},
|
|
35
|
-
getEntriesByName(
|
|
35
|
+
getEntriesByName(n) {
|
|
36
36
|
if (typeof performance < "u" && performance.getEntriesByName)
|
|
37
|
-
return performance.getEntriesByName(
|
|
37
|
+
return performance.getEntriesByName(n);
|
|
38
38
|
},
|
|
39
|
-
getEntriesByType(
|
|
39
|
+
getEntriesByType(n) {
|
|
40
40
|
if (typeof performance < "u" && performance.getEntriesByType)
|
|
41
|
-
return performance.getEntriesByType(
|
|
41
|
+
return performance.getEntriesByType(n);
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
|
-
class
|
|
44
|
+
class Fe {
|
|
45
45
|
data;
|
|
46
46
|
enabled = !1;
|
|
47
47
|
constructor() {
|
|
@@ -59,7 +59,7 @@ class Ke {
|
|
|
59
59
|
const t = this.getKey(e.name, e.context), r = {
|
|
60
60
|
name: e.name,
|
|
61
61
|
type: "mark",
|
|
62
|
-
value:
|
|
62
|
+
value: b.now(),
|
|
63
63
|
createdAt: Date.now()
|
|
64
64
|
};
|
|
65
65
|
return this.data.set(t, r), r;
|
|
@@ -69,21 +69,21 @@ class Ke {
|
|
|
69
69
|
const t = this.getKey(e.name, e.context), r = this.data.get(this.getKey(e.start, e.context)), s = this.data.get(this.getKey(e.end, e.context));
|
|
70
70
|
if (!r || !s)
|
|
71
71
|
return;
|
|
72
|
-
const i = s.value - r.value,
|
|
72
|
+
const i = s.value - r.value, o = Math.round(i * 100) / 100, a = this.data.get(t);
|
|
73
73
|
if (a && e.sum) {
|
|
74
|
-
const
|
|
74
|
+
const u = a.value + o, f = {
|
|
75
75
|
...a,
|
|
76
|
-
value:
|
|
76
|
+
value: u
|
|
77
77
|
};
|
|
78
|
-
return this.data.set(t,
|
|
78
|
+
return this.data.set(t, f), f;
|
|
79
79
|
}
|
|
80
|
-
const
|
|
80
|
+
const c = {
|
|
81
81
|
name: e.name,
|
|
82
82
|
type: "measure",
|
|
83
|
-
value:
|
|
83
|
+
value: o,
|
|
84
84
|
createdAt: Date.now()
|
|
85
85
|
};
|
|
86
|
-
return e.detail && (
|
|
86
|
+
return e.detail && (c.detail = e.detail), this.data.set(t, c), c;
|
|
87
87
|
}
|
|
88
88
|
update(e) {
|
|
89
89
|
if (!this.enabled) return e.value;
|
|
@@ -96,7 +96,7 @@ class Ke {
|
|
|
96
96
|
return this.data.get(t);
|
|
97
97
|
}
|
|
98
98
|
getResourceInfosFromPerformanceAPI() {
|
|
99
|
-
return typeof performance > "u" ? [] :
|
|
99
|
+
return typeof performance > "u" ? [] : b.getEntriesByType("resource");
|
|
100
100
|
}
|
|
101
101
|
get(e) {
|
|
102
102
|
const t = this.getKey(e.name, e.context);
|
|
@@ -114,11 +114,11 @@ class Ke {
|
|
|
114
114
|
getKey(e, t) {
|
|
115
115
|
if (!t)
|
|
116
116
|
return e;
|
|
117
|
-
const r =
|
|
117
|
+
const r = D(t);
|
|
118
118
|
return e + "_" + r;
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
let
|
|
121
|
+
let X = class j {
|
|
122
122
|
nodes;
|
|
123
123
|
edges;
|
|
124
124
|
nodeKinds = /* @__PURE__ */ new Map();
|
|
@@ -200,8 +200,8 @@ let Y = class j {
|
|
|
200
200
|
t.add(s);
|
|
201
201
|
const i = this.edges.get(s);
|
|
202
202
|
if (i) {
|
|
203
|
-
for (let
|
|
204
|
-
if (r(
|
|
203
|
+
for (let o of i)
|
|
204
|
+
if (r(o))
|
|
205
205
|
return !0;
|
|
206
206
|
}
|
|
207
207
|
return t.delete(s), e.add(s), !1;
|
|
@@ -225,24 +225,24 @@ let Y = class j {
|
|
|
225
225
|
return r.slice(a).concat([i]);
|
|
226
226
|
}
|
|
227
227
|
t.add(i), r.push(i);
|
|
228
|
-
const
|
|
229
|
-
if (
|
|
230
|
-
for (let a of
|
|
231
|
-
const
|
|
232
|
-
if (
|
|
233
|
-
return
|
|
228
|
+
const o = this.edges.get(i);
|
|
229
|
+
if (o)
|
|
230
|
+
for (let a of o) {
|
|
231
|
+
const c = s(a);
|
|
232
|
+
if (c)
|
|
233
|
+
return c;
|
|
234
234
|
}
|
|
235
235
|
return r.pop(), t.delete(i), e.add(i), null;
|
|
236
236
|
};
|
|
237
237
|
for (let i of this.nodes) {
|
|
238
|
-
const
|
|
239
|
-
if (
|
|
240
|
-
return { hasCycle: !0, path:
|
|
238
|
+
const o = s(i);
|
|
239
|
+
if (o)
|
|
240
|
+
return { hasCycle: !0, path: o };
|
|
241
241
|
}
|
|
242
242
|
return { hasCycle: !1 };
|
|
243
243
|
}
|
|
244
244
|
order(e) {
|
|
245
|
-
const t = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), s = [], i = e?.allowCycles ?? !1,
|
|
245
|
+
const t = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), s = [], i = e?.allowCycles ?? !1, o = (a) => {
|
|
246
246
|
if (t.has(a))
|
|
247
247
|
return;
|
|
248
248
|
if (r.has(a)) {
|
|
@@ -251,14 +251,14 @@ let Y = class j {
|
|
|
251
251
|
throw new Error("Graph has a cycle.");
|
|
252
252
|
}
|
|
253
253
|
r.add(a);
|
|
254
|
-
const
|
|
255
|
-
if (
|
|
256
|
-
for (let
|
|
257
|
-
|
|
254
|
+
const c = this.edges.get(a);
|
|
255
|
+
if (c)
|
|
256
|
+
for (let u of c)
|
|
257
|
+
o(u);
|
|
258
258
|
r.delete(a), t.add(a), s.push(a);
|
|
259
259
|
};
|
|
260
260
|
for (let a of this.nodes)
|
|
261
|
-
t.has(a) ||
|
|
261
|
+
t.has(a) || o(a);
|
|
262
262
|
return s;
|
|
263
263
|
}
|
|
264
264
|
clear() {
|
|
@@ -326,30 +326,30 @@ let Y = class j {
|
|
|
326
326
|
*/
|
|
327
327
|
plan(e) {
|
|
328
328
|
const t = /* @__PURE__ */ new Map();
|
|
329
|
-
for (const
|
|
330
|
-
for (const
|
|
331
|
-
for (const a of
|
|
329
|
+
for (const o of this.nodes) t.set(o, 0);
|
|
330
|
+
for (const o of this.edges.values())
|
|
331
|
+
for (const a of o) t.set(a, (t.get(a) || 0) + 1);
|
|
332
332
|
const r = [];
|
|
333
|
-
let s = Array.from(this.nodes).filter((
|
|
333
|
+
let s = Array.from(this.nodes).filter((o) => (t.get(o) || 0) === 0);
|
|
334
334
|
const i = /* @__PURE__ */ new Set();
|
|
335
335
|
for (; s.length > 0; ) {
|
|
336
|
-
const
|
|
337
|
-
r.push(
|
|
338
|
-
for (const a of
|
|
336
|
+
const o = s.slice();
|
|
337
|
+
r.push(o), s = [];
|
|
338
|
+
for (const a of o) {
|
|
339
339
|
if (i.has(a)) continue;
|
|
340
340
|
i.add(a);
|
|
341
|
-
const
|
|
342
|
-
if (
|
|
343
|
-
for (const
|
|
344
|
-
t.set(
|
|
341
|
+
const c = this.edges.get(a);
|
|
342
|
+
if (c)
|
|
343
|
+
for (const u of c)
|
|
344
|
+
t.set(u, (t.get(u) || 0) - 1), (t.get(u) || 0) === 0 && s.push(u);
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
347
|
if (i.size !== this.nodes.size)
|
|
348
348
|
throw new Error("Graph has a cycle.");
|
|
349
349
|
if (e?.filterKinds && e.filterKinds.length > 0) {
|
|
350
|
-
const
|
|
350
|
+
const o = new Set(e.filterKinds);
|
|
351
351
|
return {
|
|
352
|
-
batches: r.map((a) => a.filter((
|
|
352
|
+
batches: r.map((a) => a.filter((c) => o.has(this.nodeKinds.get(c))))
|
|
353
353
|
};
|
|
354
354
|
}
|
|
355
355
|
return { batches: r };
|
|
@@ -362,26 +362,26 @@ let Y = class j {
|
|
|
362
362
|
* - 'both': union of upstream and downstream
|
|
363
363
|
*/
|
|
364
364
|
getImpactedNodes(e, t = "downstream", r) {
|
|
365
|
-
const s = new Set(e), i = (
|
|
366
|
-
const
|
|
367
|
-
for (;
|
|
368
|
-
const d =
|
|
365
|
+
const s = new Set(e), i = (u) => !r || r.length === 0 || r.includes(this.nodeKinds.get(u) ?? void 0), o = () => {
|
|
366
|
+
const u = /* @__PURE__ */ new Set(), f = Array.from(s);
|
|
367
|
+
for (; f.length; ) {
|
|
368
|
+
const d = f.shift();
|
|
369
369
|
for (const [l, h] of this.edges)
|
|
370
|
-
h.has(d) && !
|
|
370
|
+
h.has(d) && !u.has(l) && (u.add(l), f.push(l));
|
|
371
371
|
}
|
|
372
|
-
return
|
|
372
|
+
return u;
|
|
373
373
|
}, a = () => {
|
|
374
|
-
const
|
|
375
|
-
for (;
|
|
376
|
-
const d =
|
|
374
|
+
const u = /* @__PURE__ */ new Set(), f = Array.from(s);
|
|
375
|
+
for (; f.length; ) {
|
|
376
|
+
const d = f.shift(), l = this.edges.get(d);
|
|
377
377
|
if (l)
|
|
378
378
|
for (const h of l)
|
|
379
|
-
|
|
379
|
+
u.has(h) || (u.add(h), f.push(h));
|
|
380
380
|
}
|
|
381
|
-
return
|
|
381
|
+
return u;
|
|
382
382
|
};
|
|
383
|
-
let
|
|
384
|
-
return t === "both" ?
|
|
383
|
+
let c;
|
|
384
|
+
return t === "both" ? c = /* @__PURE__ */ new Set([...o(), ...a()]) : t === "upstream" ? c = a() : c = o(), Array.from(c).filter(i);
|
|
385
385
|
}
|
|
386
386
|
toJSON() {
|
|
387
387
|
const e = Array.from(this.nodes).map((r) => ({
|
|
@@ -400,19 +400,19 @@ let Y = class j {
|
|
|
400
400
|
return t;
|
|
401
401
|
}
|
|
402
402
|
diff(e) {
|
|
403
|
-
const t = new Set(this.getNodes()), r = new Set(e.getNodes()), s = Array.from(r).filter((d) => !t.has(d)), i = Array.from(t).filter((d) => !r.has(d)),
|
|
403
|
+
const t = new Set(this.getNodes()), r = new Set(e.getNodes()), s = Array.from(r).filter((d) => !t.has(d)), i = Array.from(t).filter((d) => !r.has(d)), o = new Set(this.getAllEdges().map((d) => d.join("→"))), a = new Set(e.getAllEdges().map((d) => d.join("→"))), c = Array.from(a).filter((d) => !o.has(d)).map((d) => d.split("→")), u = Array.from(o).filter((d) => !a.has(d)).map((d) => d.split("→")), f = [];
|
|
404
404
|
for (const d of /* @__PURE__ */ new Set([...t, ...r])) {
|
|
405
405
|
const l = this.nodeKinds.get(d), h = e.nodeKinds.get(d);
|
|
406
|
-
l !== h &&
|
|
406
|
+
l !== h && f.push({ name: d, from: l, to: h });
|
|
407
407
|
}
|
|
408
|
-
return { addedNodes: s, removedNodes: i, addedEdges:
|
|
408
|
+
return { addedNodes: s, removedNodes: i, addedEdges: c, removedEdges: u, kindChanges: f };
|
|
409
409
|
}
|
|
410
410
|
};
|
|
411
|
-
class
|
|
411
|
+
class Ge {
|
|
412
412
|
graph;
|
|
413
413
|
nodeIndex;
|
|
414
414
|
constructor() {
|
|
415
|
-
this.graph = new
|
|
415
|
+
this.graph = new X(), this.nodeIndex = /* @__PURE__ */ new Map();
|
|
416
416
|
}
|
|
417
417
|
/**
|
|
418
418
|
* Creates a unique ID for an attribute node
|
|
@@ -454,10 +454,10 @@ class Se {
|
|
|
454
454
|
* @returns Array of all impacted attribute nodes (including the changed ones)
|
|
455
455
|
*/
|
|
456
456
|
getImpactedAttributes(e) {
|
|
457
|
-
const t = e.map((a) => this.getNodeId(a.modelKey, a.attributeKey)), s = this.graph.getImpactedNodes(t, "downstream").map((a) => this.nodeIndex.get(a)).filter((a) => a !== void 0), i = [...e, ...s],
|
|
457
|
+
const t = e.map((a) => this.getNodeId(a.modelKey, a.attributeKey)), s = this.graph.getImpactedNodes(t, "downstream").map((a) => this.nodeIndex.get(a)).filter((a) => a !== void 0), i = [...e, ...s], o = /* @__PURE__ */ new Set();
|
|
458
458
|
return i.filter((a) => {
|
|
459
|
-
const
|
|
460
|
-
return
|
|
459
|
+
const c = this.getNodeId(a.modelKey, a.attributeKey);
|
|
460
|
+
return o.has(c) ? !1 : (o.add(c), !0);
|
|
461
461
|
});
|
|
462
462
|
}
|
|
463
463
|
/**
|
|
@@ -470,10 +470,10 @@ class Se {
|
|
|
470
470
|
getProcessingOrder(e) {
|
|
471
471
|
const t = /* @__PURE__ */ new Map(), r = [...e].sort((s, i) => s.processingStep - i.processingStep);
|
|
472
472
|
for (const s of r) {
|
|
473
|
-
const { modelKey: i, attributeKey:
|
|
473
|
+
const { modelKey: i, attributeKey: o, processingStep: a } = s;
|
|
474
474
|
t.has(i) || t.set(i, /* @__PURE__ */ new Map());
|
|
475
|
-
const
|
|
476
|
-
|
|
475
|
+
const c = t.get(i);
|
|
476
|
+
c.has(a) || c.set(a, /* @__PURE__ */ new Set()), c.get(a).add(o);
|
|
477
477
|
}
|
|
478
478
|
return t;
|
|
479
479
|
}
|
|
@@ -530,12 +530,12 @@ class Se {
|
|
|
530
530
|
s.add(r);
|
|
531
531
|
const i = this.graph.getDependencies(r);
|
|
532
532
|
if (i.length === 0) return 1;
|
|
533
|
-
let
|
|
533
|
+
let o = 0;
|
|
534
534
|
for (const a of i) {
|
|
535
|
-
const
|
|
536
|
-
|
|
535
|
+
const c = t(a, new Set(s));
|
|
536
|
+
o = Math.max(o, c);
|
|
537
537
|
}
|
|
538
|
-
return
|
|
538
|
+
return o + 1;
|
|
539
539
|
};
|
|
540
540
|
for (const r of this.graph.getNodes()) {
|
|
541
541
|
const s = t(r);
|
|
@@ -555,8 +555,8 @@ class Se {
|
|
|
555
555
|
const t = [];
|
|
556
556
|
for (const [r, s] of e)
|
|
557
557
|
for (const i of s) {
|
|
558
|
-
const
|
|
559
|
-
this.hasNode(
|
|
558
|
+
const o = this.getNodeId(r, i);
|
|
559
|
+
this.hasNode(o) || t.push({ modelKey: r, attributeKey: i });
|
|
560
560
|
}
|
|
561
561
|
return {
|
|
562
562
|
isComplete: t.length === 0,
|
|
@@ -600,36 +600,36 @@ class Se {
|
|
|
600
600
|
};
|
|
601
601
|
}
|
|
602
602
|
}
|
|
603
|
-
const
|
|
603
|
+
const R = {
|
|
604
604
|
silent: 0,
|
|
605
605
|
error: 1,
|
|
606
606
|
warn: 2,
|
|
607
607
|
info: 3,
|
|
608
608
|
debug: 4
|
|
609
609
|
};
|
|
610
|
-
class
|
|
610
|
+
class g {
|
|
611
611
|
config;
|
|
612
612
|
static globalConfig = {};
|
|
613
613
|
constructor(e = {}) {
|
|
614
614
|
this.config = {
|
|
615
|
-
level: e.level ??
|
|
616
|
-
format: e.format ??
|
|
615
|
+
level: e.level ?? g.globalConfig.level ?? this.getDefaultLevel(),
|
|
616
|
+
format: e.format ?? g.globalConfig.format ?? this.getDefaultFormat(),
|
|
617
617
|
prefix: e.prefix,
|
|
618
|
-
onLog: e.onLog ??
|
|
619
|
-
onTrackError: e.onTrackError ??
|
|
618
|
+
onLog: e.onLog ?? g.globalConfig.onLog,
|
|
619
|
+
onTrackError: e.onTrackError ?? g.globalConfig.onTrackError
|
|
620
620
|
};
|
|
621
621
|
}
|
|
622
622
|
/**
|
|
623
623
|
* Set global logger configuration (affects all logger instances)
|
|
624
624
|
*/
|
|
625
625
|
static setGlobalConfig(e) {
|
|
626
|
-
|
|
626
|
+
g.globalConfig = { ...g.globalConfig, ...e };
|
|
627
627
|
}
|
|
628
628
|
/**
|
|
629
629
|
* Get the global logger configuration
|
|
630
630
|
*/
|
|
631
631
|
static getGlobalConfig() {
|
|
632
|
-
return { ...
|
|
632
|
+
return { ...g.globalConfig };
|
|
633
633
|
}
|
|
634
634
|
/**
|
|
635
635
|
* Configure module-specific log levels
|
|
@@ -638,14 +638,14 @@ class p {
|
|
|
638
638
|
* logger.setModuleLevel('Catalog', 'warn');
|
|
639
639
|
*/
|
|
640
640
|
static setModuleLevel(e, t) {
|
|
641
|
-
|
|
641
|
+
g.globalConfig.onLog || (g.globalConfig.onLog = void 0), g._moduleOverrides || (g._moduleOverrides = /* @__PURE__ */ new Map()), g._moduleOverrides.set(e, t);
|
|
642
642
|
}
|
|
643
643
|
/**
|
|
644
644
|
* Get module-specific log level
|
|
645
645
|
*/
|
|
646
646
|
static getModuleLevel(e) {
|
|
647
|
-
if (!(!e || !
|
|
648
|
-
return
|
|
647
|
+
if (!(!e || !g._moduleOverrides))
|
|
648
|
+
return g._moduleOverrides.get(e);
|
|
649
649
|
}
|
|
650
650
|
getDefaultLevel() {
|
|
651
651
|
return "info";
|
|
@@ -655,7 +655,7 @@ class p {
|
|
|
655
655
|
}
|
|
656
656
|
getEffectiveLevel() {
|
|
657
657
|
if (this.config.prefix) {
|
|
658
|
-
const e =
|
|
658
|
+
const e = g.getModuleLevel(this.config.prefix);
|
|
659
659
|
if (e)
|
|
660
660
|
return e;
|
|
661
661
|
}
|
|
@@ -663,20 +663,20 @@ class p {
|
|
|
663
663
|
}
|
|
664
664
|
shouldLog(e) {
|
|
665
665
|
const t = this.getEffectiveLevel();
|
|
666
|
-
return
|
|
666
|
+
return R[e] <= R[t];
|
|
667
667
|
}
|
|
668
668
|
formatMessage(e) {
|
|
669
669
|
if (this.config.format === "json") {
|
|
670
|
-
const
|
|
670
|
+
const o = {
|
|
671
671
|
timestamp: new Date(e.timestamp).toISOString(),
|
|
672
672
|
level: e.level,
|
|
673
673
|
message: e.message
|
|
674
674
|
};
|
|
675
|
-
return e.prefix && (
|
|
675
|
+
return e.prefix && (o.module = e.prefix), e.context && (o.context = e.context), e.error && (o.error = {
|
|
676
676
|
name: e.error.name,
|
|
677
677
|
message: e.error.message,
|
|
678
678
|
stack: e.error.stack
|
|
679
|
-
}), JSON.stringify(
|
|
679
|
+
}), JSON.stringify(o);
|
|
680
680
|
}
|
|
681
681
|
const t = new Date(e.timestamp).toISOString().substring(11, 23), r = e.prefix ? `[${e.prefix}]` : "", s = this.getLevelIcon(e.level), i = e.context ? ` ${JSON.stringify(e.context)}` : "";
|
|
682
682
|
return `${t} ${s} ${r} ${e.message}${i}`.trim();
|
|
@@ -710,20 +710,20 @@ class p {
|
|
|
710
710
|
this.config.onLog(i);
|
|
711
711
|
return;
|
|
712
712
|
}
|
|
713
|
-
const
|
|
713
|
+
const o = this.formatMessage(i);
|
|
714
714
|
if (typeof console < "u")
|
|
715
715
|
switch (e) {
|
|
716
716
|
case "error":
|
|
717
|
-
s ? console.error(
|
|
717
|
+
s ? console.error(o, s) : console.error(o);
|
|
718
718
|
break;
|
|
719
719
|
case "warn":
|
|
720
|
-
console.warn(
|
|
720
|
+
console.warn(o);
|
|
721
721
|
break;
|
|
722
722
|
case "debug":
|
|
723
|
-
console.debug ? console.debug(
|
|
723
|
+
console.debug ? console.debug(o) : console.log(o);
|
|
724
724
|
break;
|
|
725
725
|
default:
|
|
726
|
-
console.log(
|
|
726
|
+
console.log(o);
|
|
727
727
|
}
|
|
728
728
|
}
|
|
729
729
|
/**
|
|
@@ -790,7 +790,7 @@ class p {
|
|
|
790
790
|
// Handle prefix concatenation for nested children
|
|
791
791
|
prefix: e.prefix ? this.config.prefix ? `${this.config.prefix}:${e.prefix}` : e.prefix : this.config.prefix
|
|
792
792
|
};
|
|
793
|
-
return new
|
|
793
|
+
return new g(t);
|
|
794
794
|
}
|
|
795
795
|
/**
|
|
796
796
|
* Update this logger's configuration
|
|
@@ -799,18 +799,19 @@ class p {
|
|
|
799
799
|
Object.assign(this.config, e);
|
|
800
800
|
}
|
|
801
801
|
}
|
|
802
|
-
const
|
|
803
|
-
class
|
|
802
|
+
const Y = new g();
|
|
803
|
+
class _e {
|
|
804
804
|
constructor(e) {
|
|
805
805
|
this.enabled = e, this.cache = /* @__PURE__ */ new Map(), this.cacheDependencies = /* @__PURE__ */ new Map();
|
|
806
806
|
}
|
|
807
|
+
enabled;
|
|
807
808
|
cache;
|
|
808
809
|
// Track which models and attributes each cache entry depends on
|
|
809
810
|
cacheDependencies;
|
|
810
811
|
// Track cache hits and misses for statistics
|
|
811
812
|
hitCount = 0;
|
|
812
813
|
missCount = 0;
|
|
813
|
-
log =
|
|
814
|
+
log = Y.child({ prefix: "CacheController" });
|
|
814
815
|
get(e, t) {
|
|
815
816
|
if (!this.enabled) return;
|
|
816
817
|
const r = this.getCacheName(e, t);
|
|
@@ -838,12 +839,12 @@ class Ie {
|
|
|
838
839
|
const t = [];
|
|
839
840
|
for (const [r, s] of this.cacheDependencies) {
|
|
840
841
|
let i = !1;
|
|
841
|
-
for (const [
|
|
842
|
-
if (s.models.has(
|
|
843
|
-
if (s.modelAttributes.has(
|
|
844
|
-
const
|
|
845
|
-
for (const
|
|
846
|
-
if (
|
|
842
|
+
for (const [o, a] of e) {
|
|
843
|
+
if (s.models.has(o))
|
|
844
|
+
if (s.modelAttributes.has(o)) {
|
|
845
|
+
const c = s.modelAttributes.get(o);
|
|
846
|
+
for (const u of a)
|
|
847
|
+
if (c.has(u)) {
|
|
847
848
|
i = !0;
|
|
848
849
|
break;
|
|
849
850
|
}
|
|
@@ -864,8 +865,8 @@ class Ie {
|
|
|
864
865
|
if (!this.enabled) return;
|
|
865
866
|
const t = new Set(e), r = [];
|
|
866
867
|
for (const [s, i] of this.cacheDependencies)
|
|
867
|
-
for (const
|
|
868
|
-
if (i.models.has(
|
|
868
|
+
for (const o of t)
|
|
869
|
+
if (i.models.has(o)) {
|
|
869
870
|
r.push(s);
|
|
870
871
|
break;
|
|
871
872
|
}
|
|
@@ -915,13 +916,13 @@ class Ie {
|
|
|
915
916
|
}
|
|
916
917
|
generateContext(e) {
|
|
917
918
|
try {
|
|
918
|
-
return
|
|
919
|
+
return v(e);
|
|
919
920
|
} catch (t) {
|
|
920
921
|
return this.log.error("Error in cache generateContext", t), e;
|
|
921
922
|
}
|
|
922
923
|
}
|
|
923
924
|
getCacheName(e, t) {
|
|
924
|
-
const r =
|
|
925
|
+
const r = D(t);
|
|
925
926
|
return e + "_" + r;
|
|
926
927
|
}
|
|
927
928
|
/**
|
|
@@ -939,42 +940,45 @@ class Ie {
|
|
|
939
940
|
};
|
|
940
941
|
}
|
|
941
942
|
}
|
|
942
|
-
const
|
|
943
|
+
const P = (n, e = "") => {
|
|
944
|
+
if (!(typeof n != "string" || !n.startsWith("/") || !n.endsWith("/")))
|
|
945
|
+
return { pattern: n.slice(1, -1), flags: e };
|
|
946
|
+
}, ze = (n, e = "") => `${n}#${e}`, je = (n) => `${n.gt}_${n.gte}_${n.lt}_${n.lte}_${n.eq}_${n.ne}`, Pe = (n) => `${n.gt}_${n.gte}_${n.lt}_${n.lte}_${n.eq}_${n.ne}`, Be = (n, e) => {
|
|
943
947
|
const t = typeof e == "function" ? e : (r) => r[e];
|
|
944
948
|
return [
|
|
945
|
-
...
|
|
949
|
+
...n.reduce((r, s) => {
|
|
946
950
|
const i = s == null ? s : t(s);
|
|
947
951
|
return r.has(i) || r.set(i, s), r;
|
|
948
952
|
}, /* @__PURE__ */ new Map()).values()
|
|
949
953
|
];
|
|
950
|
-
},
|
|
954
|
+
}, Le = (n, e) => n.reduce(function(t, r) {
|
|
951
955
|
const s = typeof e == "function" ? e(r) : r[e];
|
|
952
956
|
return Object.prototype.hasOwnProperty.call(t, s) || (t[s] = []), t[s].push(r), t;
|
|
953
957
|
}, {});
|
|
954
|
-
function ee(
|
|
958
|
+
function ee(n = 10) {
|
|
955
959
|
let e = "";
|
|
956
960
|
const t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
957
|
-
for (let r = 0; r <
|
|
961
|
+
for (let r = 0; r < n; r++) e += t.charAt(Math.floor(Math.random() * t.length));
|
|
958
962
|
return e;
|
|
959
963
|
}
|
|
960
|
-
const
|
|
964
|
+
const Ue = (n) => n.replace(/\/+$/, ""), te = (n) => typeof n != "string" ? "" : n.replace(/[[\]{}()*+?.,\\^$|#]/g, "\\$&"), We = (n) => typeof n != "string" ? "" : n.replace(/\\([[\]{}()*+?.,\\^$|#])/g, "$1"), Ve = (n, e) => {
|
|
961
965
|
try {
|
|
962
|
-
return re(
|
|
966
|
+
return re(n, e) >= 0;
|
|
963
967
|
} catch {
|
|
964
968
|
return !1;
|
|
965
969
|
}
|
|
966
|
-
}, re = (
|
|
967
|
-
if (!
|
|
968
|
-
throw new Error(`Invalid version format: v1="${
|
|
969
|
-
const t =
|
|
970
|
+
}, re = (n, e) => {
|
|
971
|
+
if (!T(n) || !T(e))
|
|
972
|
+
throw new Error(`Invalid version format: v1="${n}", v2="${e}". Expected format: "x.y.z"`);
|
|
973
|
+
const t = n.split(".").map(Number), r = e.split(".").map(Number);
|
|
970
974
|
for (let s = 0; s < 3; s++) {
|
|
971
|
-
const i = t[s] || 0,
|
|
972
|
-
if (i >
|
|
973
|
-
if (i <
|
|
975
|
+
const i = t[s] || 0, o = r[s] || 0;
|
|
976
|
+
if (i > o) return 1;
|
|
977
|
+
if (i < o) return -1;
|
|
974
978
|
}
|
|
975
979
|
return 0;
|
|
976
|
-
},
|
|
977
|
-
class
|
|
980
|
+
}, T = (n) => /^\d+(\.\d+){0,2}$/.test(n);
|
|
981
|
+
class He {
|
|
978
982
|
key;
|
|
979
983
|
parentCd;
|
|
980
984
|
dcuplInitOptions;
|
|
@@ -1000,7 +1004,7 @@ class $e {
|
|
|
1000
1004
|
this.off && this.off();
|
|
1001
1005
|
}
|
|
1002
1006
|
trigger(e) {
|
|
1003
|
-
e.originCdRefKey || (e.originCdRefKey = this.key), e.key || (this.increaseCounter(), e.key = this.getCounter()), e.end || (e.end =
|
|
1007
|
+
e.originCdRefKey || (e.originCdRefKey = this.key), e.key || (this.increaseCounter(), e.key = this.getCounter()), e.end || (e.end = b.now(), e.duration = e.start - e.end), this.updateListener.forEach((t) => {
|
|
1004
1008
|
t(e);
|
|
1005
1009
|
});
|
|
1006
1010
|
}
|
|
@@ -1010,13 +1014,13 @@ class $e {
|
|
|
1010
1014
|
};
|
|
1011
1015
|
}
|
|
1012
1016
|
}
|
|
1013
|
-
const
|
|
1017
|
+
const B = (n, e) => e ? typeof structuredClone < "u" ? structuredClone(n) : v(n) : n, F = (n, e, t, r, s, i) => {
|
|
1014
1018
|
try {
|
|
1015
|
-
const
|
|
1016
|
-
if (t.scope === "list" && (t.listKey =
|
|
1019
|
+
const o = !!e.dcuplInitOptions.performance?.clone?.enabled && !!t.cloneResult, a = B(i, o);
|
|
1020
|
+
if (t.scope === "list" && (t.listKey = n.cdRef?.key || n.key, t.modelKey = n.model?.key || n.modelKey), t.type === "list_created" && t.args[0].listKey.startsWith("__global_list__") || t.listKey?.startsWith("__global_list__"))
|
|
1017
1021
|
return a;
|
|
1018
|
-
const
|
|
1019
|
-
t.duration =
|
|
1022
|
+
const c = b.now(), u = c - r, f = Math.round(u * 1e3) / 1e3;
|
|
1023
|
+
t.duration = f, t.start = r, t.end = c;
|
|
1020
1024
|
const d = {
|
|
1021
1025
|
duration: t.duration
|
|
1022
1026
|
};
|
|
@@ -1033,57 +1037,57 @@ const P = (o, e) => e ? typeof structuredClone < "u" ? structuredClone(o) : m(o)
|
|
|
1033
1037
|
} catch {
|
|
1034
1038
|
return i;
|
|
1035
1039
|
}
|
|
1036
|
-
},
|
|
1040
|
+
}, Je = (n) => (t, r, s) => {
|
|
1037
1041
|
const i = s.value;
|
|
1038
|
-
return s.value = function(...
|
|
1039
|
-
const a =
|
|
1040
|
-
|
|
1041
|
-
const
|
|
1042
|
-
|
|
1043
|
-
name: `${
|
|
1044
|
-
context:
|
|
1042
|
+
return s.value = function(...o) {
|
|
1043
|
+
const a = b.now(), c = this.cdRef, u = B(n, !0);
|
|
1044
|
+
u.key || (c.increaseCounter(), u.key = c.getCounter());
|
|
1045
|
+
const f = ee();
|
|
1046
|
+
c.analyticsController.mark({
|
|
1047
|
+
name: `${u.type}:start`,
|
|
1048
|
+
context: f
|
|
1045
1049
|
});
|
|
1046
1050
|
const d = this.model?.key;
|
|
1047
|
-
!
|
|
1048
|
-
const l = i.apply(this,
|
|
1049
|
-
return
|
|
1051
|
+
!u.originCdRefKey && c.key && (u.originCdRefKey = c.key), d && (u.modelKey = d);
|
|
1052
|
+
const l = i.apply(this, o);
|
|
1053
|
+
return u.method = r, u.args = o, l && typeof l == "object" && "then" in l ? l.then((h) => F(this, c, u, a, f, h)) : F(this, c, u, a, f, l);
|
|
1050
1054
|
}, s;
|
|
1051
1055
|
};
|
|
1052
|
-
function
|
|
1056
|
+
function Ze(n, e, t, r) {
|
|
1053
1057
|
t.max || (t.max = 20);
|
|
1054
1058
|
const s = [], i = t.transform ? r.transformValue(t.value, t.transform) : t.value;
|
|
1055
|
-
for (const [
|
|
1056
|
-
const
|
|
1057
|
-
if (!(t.excludeUndefineds && typeof
|
|
1058
|
-
if (
|
|
1059
|
-
const
|
|
1060
|
-
value:
|
|
1059
|
+
for (const [o, a] of e.entries()) {
|
|
1060
|
+
const c = Array.from(a).some((f) => n.has(f)), u = t.transform ? r.transformValue(o, t.transform) : o;
|
|
1061
|
+
if (!(t.excludeUndefineds && typeof o > "u") && !(t.excludeNulls && o === null)) {
|
|
1062
|
+
if (c && (i === "" || i === "//")) {
|
|
1063
|
+
const f = {
|
|
1064
|
+
value: o,
|
|
1061
1065
|
keys: t.calculateResultKeys ? Array.from(a) : []
|
|
1062
1066
|
};
|
|
1063
|
-
s.push(
|
|
1064
|
-
} else if (
|
|
1065
|
-
if (r.queryFind(
|
|
1066
|
-
const
|
|
1067
|
-
value:
|
|
1067
|
+
s.push(f);
|
|
1068
|
+
} else if (c && P(i)) {
|
|
1069
|
+
if (r.queryFind(u, i, "some", t.regexFlags)) {
|
|
1070
|
+
const f = {
|
|
1071
|
+
value: o,
|
|
1068
1072
|
keys: t.calculateResultKeys ? Array.from(a) : []
|
|
1069
1073
|
};
|
|
1070
|
-
s.push(
|
|
1074
|
+
s.push(f);
|
|
1071
1075
|
}
|
|
1072
|
-
} else if (
|
|
1073
|
-
const
|
|
1074
|
-
if (
|
|
1076
|
+
} else if (c && typeof i == "string") {
|
|
1077
|
+
const f = String(u ?? ""), d = i;
|
|
1078
|
+
if (f.toLowerCase().startsWith(d.toLowerCase())) {
|
|
1075
1079
|
const l = {
|
|
1076
|
-
value:
|
|
1080
|
+
value: o,
|
|
1077
1081
|
keys: t.calculateResultKeys ? Array.from(a) : []
|
|
1078
1082
|
};
|
|
1079
1083
|
s.push(l);
|
|
1080
1084
|
}
|
|
1081
|
-
} else if (
|
|
1082
|
-
const
|
|
1083
|
-
value:
|
|
1085
|
+
} else if (c && r.queryFind(u, i, "some")) {
|
|
1086
|
+
const f = {
|
|
1087
|
+
value: o,
|
|
1084
1088
|
keys: t.calculateResultKeys ? Array.from(a) : []
|
|
1085
1089
|
};
|
|
1086
|
-
s.push(
|
|
1090
|
+
s.push(f);
|
|
1087
1091
|
}
|
|
1088
1092
|
if (s.length === t.max)
|
|
1089
1093
|
break;
|
|
@@ -1091,11 +1095,11 @@ function Ge(o, e, t, r) {
|
|
|
1091
1095
|
}
|
|
1092
1096
|
return s;
|
|
1093
1097
|
}
|
|
1094
|
-
function se(
|
|
1095
|
-
return
|
|
1098
|
+
function se(n) {
|
|
1099
|
+
return n instanceof Date;
|
|
1096
1100
|
}
|
|
1097
|
-
function ne(
|
|
1098
|
-
return
|
|
1101
|
+
function ne(n) {
|
|
1102
|
+
return n instanceof Date && !isNaN(n.getTime());
|
|
1099
1103
|
}
|
|
1100
1104
|
const ie = {
|
|
1101
1105
|
yyyy: { type: "year", pattern: "yyyy", regex: "(\\d{4})" },
|
|
@@ -1112,28 +1116,28 @@ const ie = {
|
|
|
1112
1116
|
s: { type: "second", pattern: "s", regex: "(\\d{1,2})" },
|
|
1113
1117
|
SSS: { type: "millisecond", pattern: "SSS", regex: "(\\d{3})" }
|
|
1114
1118
|
};
|
|
1115
|
-
function oe(
|
|
1119
|
+
function oe(n) {
|
|
1116
1120
|
let e = "^";
|
|
1117
1121
|
const t = [];
|
|
1118
|
-
let r =
|
|
1119
|
-
const s = Object.entries(ie).sort((i,
|
|
1122
|
+
let r = n;
|
|
1123
|
+
const s = Object.entries(ie).sort((i, o) => o[0].length - i[0].length);
|
|
1120
1124
|
for (; r.length > 0; ) {
|
|
1121
1125
|
let i = !1;
|
|
1122
|
-
for (const [
|
|
1123
|
-
if (r.startsWith(
|
|
1124
|
-
e += a.regex, t.push({ type: a.type, pattern:
|
|
1126
|
+
for (const [o, a] of s)
|
|
1127
|
+
if (r.startsWith(o)) {
|
|
1128
|
+
e += a.regex, t.push({ type: a.type, pattern: o }), r = r.slice(o.length), i = !0;
|
|
1125
1129
|
break;
|
|
1126
1130
|
}
|
|
1127
1131
|
if (!i) {
|
|
1128
|
-
const
|
|
1129
|
-
if (!
|
|
1132
|
+
const o = r[0];
|
|
1133
|
+
if (!o)
|
|
1130
1134
|
break;
|
|
1131
|
-
e +=
|
|
1135
|
+
e += o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), r = r.slice(1);
|
|
1132
1136
|
}
|
|
1133
1137
|
}
|
|
1134
1138
|
return e += "$", { regex: new RegExp(e), tokenOrder: t };
|
|
1135
1139
|
}
|
|
1136
|
-
function ae(
|
|
1140
|
+
function ae(n, e) {
|
|
1137
1141
|
const t = {
|
|
1138
1142
|
year: 1970,
|
|
1139
1143
|
month: 1,
|
|
@@ -1144,54 +1148,54 @@ function ae(o, e) {
|
|
|
1144
1148
|
millisecond: 0
|
|
1145
1149
|
};
|
|
1146
1150
|
for (let r = 0; r < e.length; r++) {
|
|
1147
|
-
const s =
|
|
1151
|
+
const s = n[r + 1];
|
|
1148
1152
|
if (!s)
|
|
1149
1153
|
continue;
|
|
1150
|
-
const i = parseInt(s, 10),
|
|
1151
|
-
|
|
1154
|
+
const i = parseInt(s, 10), o = e[r];
|
|
1155
|
+
o && (o.type === "year" && o.pattern === "yy" ? t.year = 2e3 + i : t[o.type] = i);
|
|
1152
1156
|
}
|
|
1153
1157
|
return t;
|
|
1154
1158
|
}
|
|
1155
|
-
function
|
|
1156
|
-
if (
|
|
1159
|
+
function ce(n) {
|
|
1160
|
+
if (n.month < 1 || n.month > 12)
|
|
1157
1161
|
return /* @__PURE__ */ new Date(NaN);
|
|
1158
|
-
if (
|
|
1162
|
+
if (n.day < 1 || n.day > 31)
|
|
1159
1163
|
return /* @__PURE__ */ new Date(NaN);
|
|
1160
|
-
if (
|
|
1164
|
+
if (n.hour < 0 || n.hour > 23)
|
|
1161
1165
|
return /* @__PURE__ */ new Date(NaN);
|
|
1162
|
-
if (
|
|
1166
|
+
if (n.minute < 0 || n.minute > 59)
|
|
1163
1167
|
return /* @__PURE__ */ new Date(NaN);
|
|
1164
|
-
if (
|
|
1168
|
+
if (n.second < 0 || n.second > 59)
|
|
1165
1169
|
return /* @__PURE__ */ new Date(NaN);
|
|
1166
|
-
if (
|
|
1170
|
+
if (n.millisecond < 0 || n.millisecond > 999)
|
|
1167
1171
|
return /* @__PURE__ */ new Date(NaN);
|
|
1168
1172
|
const e = new Date(
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1173
|
+
n.year,
|
|
1174
|
+
n.month - 1,
|
|
1175
|
+
n.day,
|
|
1176
|
+
n.hour,
|
|
1177
|
+
n.minute,
|
|
1178
|
+
n.second,
|
|
1179
|
+
n.millisecond
|
|
1176
1180
|
);
|
|
1177
|
-
return ne(e) ? e.getFullYear() !==
|
|
1181
|
+
return ne(e) ? e.getFullYear() !== n.year || e.getMonth() !== n.month - 1 || e.getDate() !== n.day ? /* @__PURE__ */ new Date(NaN) : e : /* @__PURE__ */ new Date(NaN);
|
|
1178
1182
|
}
|
|
1179
|
-
function
|
|
1180
|
-
if (
|
|
1181
|
-
const a = Number(
|
|
1183
|
+
function Xe(n, e, t) {
|
|
1184
|
+
if (n = n.trim(), e === "t") {
|
|
1185
|
+
const a = Number(n);
|
|
1182
1186
|
return isNaN(a) ? /* @__PURE__ */ new Date(NaN) : new Date(a * 1e3);
|
|
1183
1187
|
}
|
|
1184
1188
|
if (e === "T") {
|
|
1185
|
-
const a = Number(
|
|
1189
|
+
const a = Number(n);
|
|
1186
1190
|
return isNaN(a) ? /* @__PURE__ */ new Date(NaN) : new Date(a);
|
|
1187
1191
|
}
|
|
1188
|
-
const { regex: r, tokenOrder: s } = oe(e), i =
|
|
1192
|
+
const { regex: r, tokenOrder: s } = oe(e), i = n.match(r);
|
|
1189
1193
|
if (!i)
|
|
1190
1194
|
return /* @__PURE__ */ new Date(NaN);
|
|
1191
|
-
const
|
|
1192
|
-
return
|
|
1195
|
+
const o = ae(i, s);
|
|
1196
|
+
return ce(o);
|
|
1193
1197
|
}
|
|
1194
|
-
class
|
|
1198
|
+
class ue {
|
|
1195
1199
|
cache;
|
|
1196
1200
|
maxSize;
|
|
1197
1201
|
accessOrder;
|
|
@@ -1246,9 +1250,9 @@ class fe {
|
|
|
1246
1250
|
if (e.length === 0) return !1;
|
|
1247
1251
|
const t = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), s = (i) => {
|
|
1248
1252
|
t.add(i), r.add(i);
|
|
1249
|
-
const
|
|
1250
|
-
if (
|
|
1251
|
-
for (const a of
|
|
1253
|
+
const o = this.graph.get(i);
|
|
1254
|
+
if (o) {
|
|
1255
|
+
for (const a of o)
|
|
1252
1256
|
if (t.has(a)) {
|
|
1253
1257
|
if (r.has(a))
|
|
1254
1258
|
return !0;
|
|
@@ -1258,8 +1262,8 @@ class fe {
|
|
|
1258
1262
|
return r.delete(i), !1;
|
|
1259
1263
|
};
|
|
1260
1264
|
for (let i = 0; i < e.length - 1; i++) {
|
|
1261
|
-
const
|
|
1262
|
-
|
|
1265
|
+
const o = e[i], a = e[i + 1];
|
|
1266
|
+
o && a && this.addDependency(o, a);
|
|
1263
1267
|
}
|
|
1264
1268
|
for (const i of e)
|
|
1265
1269
|
if (!t.has(i) && s(i))
|
|
@@ -1276,7 +1280,7 @@ class de {
|
|
|
1276
1280
|
cacheHits = 0;
|
|
1277
1281
|
cacheMisses = 0;
|
|
1278
1282
|
constructor(e = 1e3) {
|
|
1279
|
-
this.parseCache = new
|
|
1283
|
+
this.parseCache = new ue(e), this.circularRefDetector = new fe();
|
|
1280
1284
|
}
|
|
1281
1285
|
/**
|
|
1282
1286
|
* Parse an attribute string into its components
|
|
@@ -1301,18 +1305,21 @@ class de {
|
|
|
1301
1305
|
return this.cacheHits++, this.parseCache.get(e);
|
|
1302
1306
|
this.cacheMisses++;
|
|
1303
1307
|
let t, r;
|
|
1304
|
-
const s = e.includes("."), i = e.includes("["),
|
|
1305
|
-
if (
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1308
|
+
const s = e.includes("."), i = e.includes("["), o = s || i;
|
|
1309
|
+
if (o) {
|
|
1310
|
+
r = e.split(/[.[]/)[0];
|
|
1311
|
+
const c = e.indexOf("."), u = e.indexOf("[");
|
|
1312
|
+
if (i && (c === -1 || u < c)) {
|
|
1313
|
+
const d = e.indexOf("]");
|
|
1314
|
+
if (d > -1) {
|
|
1315
|
+
const l = e.indexOf(".", d + 1);
|
|
1316
|
+
l > -1 ? t = e.substring(l + 1) : t = void 0;
|
|
1317
|
+
} else s && (t = e.substring(c + 1));
|
|
1318
|
+
} else s && (t = e.substring(c + 1));
|
|
1319
|
+
}
|
|
1313
1320
|
const a = {
|
|
1314
1321
|
attribute: e,
|
|
1315
|
-
isDeepQuery:
|
|
1322
|
+
isDeepQuery: o
|
|
1316
1323
|
};
|
|
1317
1324
|
return r && (a.reference = r), typeof t < "u" && t !== "" && (a.referenceAttribute = t), this.parseCache.set(e, a), a;
|
|
1318
1325
|
}
|
|
@@ -1367,16 +1374,16 @@ class de {
|
|
|
1367
1374
|
(e.startsWith(".") || e.endsWith(".")) && r.push(`Invalid path: Leading or trailing dots are not allowed: ${e}`), e.includes("..") && r.push(`Invalid path: Consecutive dots are not allowed: ${e}`);
|
|
1368
1375
|
const s = (e.match(/\[/g) || []).length, i = (e.match(/]/g) || []).length;
|
|
1369
1376
|
s !== i && r.push(`Invalid bracket notation: Mismatched brackets in ${e}`), e.includes("[]") && r.push(`Invalid bracket notation: Empty brackets not allowed: ${e}`);
|
|
1370
|
-
const
|
|
1377
|
+
const o = /\[([^\]]+)\]/g;
|
|
1371
1378
|
let a;
|
|
1372
|
-
for (; (a =
|
|
1373
|
-
const
|
|
1374
|
-
|
|
1379
|
+
for (; (a = o.exec(e)) !== null; ) {
|
|
1380
|
+
const f = a[1];
|
|
1381
|
+
f && f !== "*" && !/^\d+$/.test(f) && r.push(`Invalid bracket content: Must be a number or '*', got '${f}' in ${e}`);
|
|
1375
1382
|
}
|
|
1376
|
-
const
|
|
1377
|
-
|
|
1378
|
-
const
|
|
1379
|
-
return
|
|
1383
|
+
const c = (e.match(/\./g) || []).length + 1;
|
|
1384
|
+
c > t && r.push(`Path too deep: Maximum depth is ${t}, got ${c} in ${e}`);
|
|
1385
|
+
const u = e.match(/[^a-zA-Z0-9._[\]*-]/g);
|
|
1386
|
+
return u && r.push(`Invalid characters in path: ${u.join(", ")} in ${e}`), {
|
|
1380
1387
|
valid: r.length === 0,
|
|
1381
1388
|
errors: r.length > 0 ? r : void 0
|
|
1382
1389
|
};
|
|
@@ -1435,69 +1442,103 @@ class de {
|
|
|
1435
1442
|
return this.getPathSegments(e).length;
|
|
1436
1443
|
}
|
|
1437
1444
|
}
|
|
1438
|
-
const
|
|
1439
|
-
function
|
|
1440
|
-
if (
|
|
1441
|
-
const
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1445
|
+
const m = new de();
|
|
1446
|
+
function w(n, e) {
|
|
1447
|
+
if (e.includes("[*]")) {
|
|
1448
|
+
const i = e.indexOf("[*]"), o = e.substring(0, i), a = e.substring(i + 3), c = o ? I(n, o) : n;
|
|
1449
|
+
if (!Array.isArray(c)) return [];
|
|
1450
|
+
const u = [];
|
|
1451
|
+
for (const f of c)
|
|
1452
|
+
!a || a === "" ? f !== void 0 && u.push(f) : a.startsWith(".") && u.push(...w(f, a.slice(1)));
|
|
1453
|
+
return u;
|
|
1454
|
+
}
|
|
1455
|
+
const t = e.split(".");
|
|
1456
|
+
let r = [n];
|
|
1457
|
+
for (const i of t) {
|
|
1458
|
+
const o = [];
|
|
1459
|
+
for (const a of r)
|
|
1460
|
+
if (a != null)
|
|
1461
|
+
if (Array.isArray(a))
|
|
1462
|
+
for (const c of a) {
|
|
1463
|
+
if (c == null) continue;
|
|
1464
|
+
const u = c[i];
|
|
1465
|
+
u !== void 0 && o.push(u);
|
|
1466
|
+
}
|
|
1467
|
+
else {
|
|
1468
|
+
const c = a[i];
|
|
1469
|
+
c !== void 0 && o.push(c);
|
|
1470
|
+
}
|
|
1471
|
+
if (r = o, r.length === 0) return [];
|
|
1472
|
+
}
|
|
1473
|
+
const s = [];
|
|
1474
|
+
for (const i of r)
|
|
1475
|
+
if (Array.isArray(i))
|
|
1476
|
+
for (const o of i) o !== void 0 && s.push(o);
|
|
1477
|
+
else i !== void 0 && s.push(i);
|
|
1478
|
+
return s;
|
|
1450
1479
|
}
|
|
1451
|
-
function
|
|
1480
|
+
function M(n) {
|
|
1452
1481
|
let e = 0;
|
|
1453
|
-
for (let t of
|
|
1482
|
+
for (let t of n) {
|
|
1454
1483
|
const r = t.toString().split(".")[1];
|
|
1455
1484
|
r && (e = Math.max(e, r.length));
|
|
1456
1485
|
}
|
|
1457
1486
|
return Math.pow(10, e);
|
|
1458
1487
|
}
|
|
1459
|
-
function
|
|
1460
|
-
return (
|
|
1488
|
+
function G(n, e, t) {
|
|
1489
|
+
return (n * t + e * t) / t;
|
|
1461
1490
|
}
|
|
1462
|
-
function le(
|
|
1463
|
-
return
|
|
1491
|
+
function le(n, e, t) {
|
|
1492
|
+
return n * t / (e * t);
|
|
1464
1493
|
}
|
|
1465
|
-
const
|
|
1494
|
+
const C = (n, e, t, r) => {
|
|
1466
1495
|
if (!r)
|
|
1467
1496
|
throw new Error("Attribute not found");
|
|
1468
1497
|
const s = {
|
|
1469
1498
|
attribute: r,
|
|
1470
|
-
types:
|
|
1499
|
+
types: n.types
|
|
1471
1500
|
};
|
|
1472
1501
|
let i;
|
|
1473
|
-
(s.types.includes("sum") || s.types.includes("avg")
|
|
1474
|
-
let
|
|
1475
|
-
return (s.types.includes("min") || s.types.includes("max")) && (
|
|
1476
|
-
a === "sum" ? s.sum = i?.sum : a === "avg" ? s.avg = i?.average : a === "count" ? s.count =
|
|
1502
|
+
(s.types.includes("sum") || s.types.includes("avg")) && (i = ye(r, e));
|
|
1503
|
+
let o;
|
|
1504
|
+
return (s.types.includes("min") || s.types.includes("max")) && (o = pe(r, e)), n.types.forEach((a) => {
|
|
1505
|
+
a === "sum" ? s.sum = i?.sum : a === "avg" ? s.avg = i?.average : a === "count" ? s.count = he(r, e) : a === "min" ? s.min = o && o[0] : a === "max" ? s.max = o && o[1] : a === "distinct" ? s.distinct = me(n, e, t) : a === "group" && (s.group = ge(n, e));
|
|
1477
1506
|
}), s;
|
|
1478
|
-
}, he = (
|
|
1507
|
+
}, he = (n, e) => {
|
|
1508
|
+
const r = m.parse(n).isDeepQuery;
|
|
1509
|
+
let s = 0;
|
|
1510
|
+
for (const i of e.values())
|
|
1511
|
+
if (i)
|
|
1512
|
+
if (r)
|
|
1513
|
+
s += w(i, n).filter((o) => o != null).length;
|
|
1514
|
+
else {
|
|
1515
|
+
const o = i[n];
|
|
1516
|
+
if (o == null) continue;
|
|
1517
|
+
Array.isArray(o) ? s += o.filter((a) => a != null).length : s++;
|
|
1518
|
+
}
|
|
1519
|
+
return s;
|
|
1520
|
+
}, pe = (n, e) => {
|
|
1479
1521
|
let t, r;
|
|
1480
|
-
const i =
|
|
1481
|
-
for (const
|
|
1482
|
-
if (
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
} else
|
|
1490
|
-
a = n[o] !== void 0 ? [n[o]] : [];
|
|
1491
|
-
for (const u of a)
|
|
1492
|
-
(t === void 0 || u < t) && (t = u), (r === void 0 || u > r) && (r = u);
|
|
1522
|
+
const i = m.parse(n).isDeepQuery;
|
|
1523
|
+
for (const o of e.values()) {
|
|
1524
|
+
if (!o) continue;
|
|
1525
|
+
let a;
|
|
1526
|
+
if (i)
|
|
1527
|
+
a = w(o, n);
|
|
1528
|
+
else {
|
|
1529
|
+
const c = o[n];
|
|
1530
|
+
c === void 0 ? a = [] : Array.isArray(c) ? a = c.filter((u) => u !== void 0) : a = [c];
|
|
1493
1531
|
}
|
|
1532
|
+
for (const c of a)
|
|
1533
|
+
c == null || typeof c == "object" || ((t === void 0 || c < t) && (t = c), (r === void 0 || c > r) && (r = c));
|
|
1534
|
+
}
|
|
1494
1535
|
if (!(t === void 0 || r === void 0))
|
|
1495
1536
|
return [t, r];
|
|
1496
|
-
},
|
|
1537
|
+
}, ge = (n, e) => {
|
|
1497
1538
|
const t = [];
|
|
1498
|
-
|
|
1539
|
+
n.groupOptions?.groups?.forEach((o) => {
|
|
1499
1540
|
t.push({
|
|
1500
|
-
option:
|
|
1541
|
+
option: o,
|
|
1501
1542
|
count: 0,
|
|
1502
1543
|
keys: []
|
|
1503
1544
|
});
|
|
@@ -1506,68 +1547,61 @@ const M = (o, e, t, r) => {
|
|
|
1506
1547
|
option: { value: ["$dcupl_not_found"] },
|
|
1507
1548
|
count: 0,
|
|
1508
1549
|
keys: []
|
|
1509
|
-
}, i =
|
|
1510
|
-
for (const
|
|
1550
|
+
}, i = m.parse(n.attribute).isDeepQuery;
|
|
1551
|
+
for (const o of e.values()) {
|
|
1511
1552
|
let a;
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
const f
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
for (const c of t)
|
|
1522
|
-
(typeof c.option.value < "u" && c.option.value.includes(f) || typeof c.option.from < "u" && c.option.from < f && typeof c.option.to < "u" && c.option.to > f) && (c.keys.includes(n.key) || (c.count++, c.keys.push(n.key)), u = !0);
|
|
1523
|
-
!u && o?.groupOptions?.calculateNotFound && (r.count++, r.keys.push(n.key));
|
|
1524
|
-
}
|
|
1525
|
-
return o?.groupOptions?.calculateNotFound && t.push(r), t;
|
|
1526
|
-
}, ge = (o, e) => {
|
|
1553
|
+
i ? a = w(o, n.attribute) : a = [o[n.attribute]];
|
|
1554
|
+
let c = !1;
|
|
1555
|
+
for (const u of a)
|
|
1556
|
+
for (const f of t)
|
|
1557
|
+
(typeof f.option.value < "u" && f.option.value.includes(u) || typeof f.option.from < "u" && f.option.from < u && typeof f.option.to < "u" && f.option.to > u) && (f.keys.includes(o.key) || (f.count++, f.keys.push(o.key)), c = !0);
|
|
1558
|
+
!c && n?.groupOptions?.calculateNotFound && (r.count++, r.keys.push(o.key));
|
|
1559
|
+
}
|
|
1560
|
+
return n?.groupOptions?.calculateNotFound && t.push(r), t;
|
|
1561
|
+
}, ye = (n, e) => {
|
|
1527
1562
|
let t = 0, r = 0;
|
|
1528
|
-
const i =
|
|
1529
|
-
for (const
|
|
1530
|
-
if (!
|
|
1531
|
-
let
|
|
1532
|
-
if (i
|
|
1533
|
-
|
|
1534
|
-
else
|
|
1535
|
-
const
|
|
1536
|
-
|
|
1537
|
-
}
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
else typeof c == "number" && (t = B(t, c, K([t, c])), r++);
|
|
1563
|
+
const i = m.parse(n).isDeepQuery;
|
|
1564
|
+
for (const a of e.values()) {
|
|
1565
|
+
if (!a) continue;
|
|
1566
|
+
let c;
|
|
1567
|
+
if (i)
|
|
1568
|
+
c = w(a, n);
|
|
1569
|
+
else {
|
|
1570
|
+
const u = a[n];
|
|
1571
|
+
u === void 0 ? c = [] : Array.isArray(u) ? c = u : c = [u];
|
|
1572
|
+
}
|
|
1573
|
+
for (const u of c)
|
|
1574
|
+
if (Array.isArray(u))
|
|
1575
|
+
for (const f of u)
|
|
1576
|
+
typeof f == "number" && (t = G(t, f, M([t, f])), r++);
|
|
1577
|
+
else typeof u == "number" && (t = G(t, u, M([t, u])), r++);
|
|
1544
1578
|
}
|
|
1545
1579
|
return r === 0 ? void 0 : {
|
|
1546
|
-
average: le(t, r,
|
|
1547
|
-
count:
|
|
1580
|
+
average: le(t, r, M([t, r])),
|
|
1581
|
+
count: r,
|
|
1548
1582
|
sum: t
|
|
1549
1583
|
};
|
|
1550
|
-
},
|
|
1584
|
+
}, me = (n, e, t) => {
|
|
1551
1585
|
const r = [];
|
|
1552
1586
|
for (const [s, i] of t)
|
|
1553
|
-
if (!(
|
|
1554
|
-
const
|
|
1587
|
+
if (!(n.excludeUndefineds && typeof s > "u") && Array.from(i).find((o) => e.has(o))) {
|
|
1588
|
+
const o = {
|
|
1555
1589
|
value: s,
|
|
1556
1590
|
count: i.size
|
|
1557
1591
|
};
|
|
1558
|
-
if (
|
|
1592
|
+
if (n.distinctOptions?.skipKeys || (o.keys = Array.from(i)), r.push(o), n.distinctOptions?.limit && r.length >= n.distinctOptions.limit)
|
|
1559
1593
|
break;
|
|
1560
1594
|
}
|
|
1561
1595
|
return r;
|
|
1562
1596
|
};
|
|
1563
|
-
class
|
|
1597
|
+
class x extends Error {
|
|
1564
1598
|
query;
|
|
1565
1599
|
constructor(e, t) {
|
|
1566
1600
|
const r = `Query Error: ${e} in ${JSON.stringify(t, null, 2)}`;
|
|
1567
1601
|
super(r), this.query = t, this.name = "DcuplQueryError";
|
|
1568
1602
|
}
|
|
1569
1603
|
}
|
|
1570
|
-
class
|
|
1604
|
+
class L {
|
|
1571
1605
|
_defaultQueryOptions = {
|
|
1572
1606
|
modelKey: "",
|
|
1573
1607
|
groupKey: "root",
|
|
@@ -1575,10 +1609,10 @@ class R {
|
|
|
1575
1609
|
queries: []
|
|
1576
1610
|
};
|
|
1577
1611
|
_initOptions;
|
|
1578
|
-
currentQuery =
|
|
1612
|
+
currentQuery = v(this._defaultQueryOptions);
|
|
1579
1613
|
deepQueryService;
|
|
1580
1614
|
constructor(e) {
|
|
1581
|
-
this.deepQueryService = e ||
|
|
1615
|
+
this.deepQueryService = e || m;
|
|
1582
1616
|
}
|
|
1583
1617
|
/**
|
|
1584
1618
|
* Initialize the query builder.
|
|
@@ -1604,7 +1638,7 @@ class R {
|
|
|
1604
1638
|
* });
|
|
1605
1639
|
*/
|
|
1606
1640
|
init(e) {
|
|
1607
|
-
this._initOptions =
|
|
1641
|
+
this._initOptions = v(e), this.currentQuery = v(this._defaultQueryOptions), this.currentQuery.modelKey = e.modelKey, "queries" in e && Array.isArray(e.queries) && (e.groupType && (this.currentQuery.groupType = e.groupType), e.queries && (this.currentQuery.queries = v(e.queries)), e.count !== void 0 && (this.currentQuery.count = e.count), e.start !== void 0 && (this.currentQuery.start = e.start), e.sort && (this.currentQuery.sort = e.sort), e.projection && (this.currentQuery.projection = e.projection));
|
|
1608
1642
|
}
|
|
1609
1643
|
reset() {
|
|
1610
1644
|
return this.init(this._initOptions), this.getQuery();
|
|
@@ -1613,7 +1647,7 @@ class R {
|
|
|
1613
1647
|
return "attribute" in e;
|
|
1614
1648
|
}
|
|
1615
1649
|
isQueryGroup(e) {
|
|
1616
|
-
return "groupKey" in e;
|
|
1650
|
+
return "queries" in e || "groupKey" in e;
|
|
1617
1651
|
}
|
|
1618
1652
|
isRootQueryGroup(e) {
|
|
1619
1653
|
return this.isQueryGroup(e) && e.groupKey === "root";
|
|
@@ -1622,7 +1656,7 @@ class R {
|
|
|
1622
1656
|
return this.currentQuery.queries.find((t) => this.isQueryGroup(t) && t.groupKey === e);
|
|
1623
1657
|
}
|
|
1624
1658
|
getQuery() {
|
|
1625
|
-
return
|
|
1659
|
+
return v(this.currentQuery);
|
|
1626
1660
|
}
|
|
1627
1661
|
hasQueryGroup(e) {
|
|
1628
1662
|
return this.currentQuery.queries.some((t) => this.isQueryGroup(t) && t.groupKey === e);
|
|
@@ -1638,7 +1672,7 @@ class R {
|
|
|
1638
1672
|
}
|
|
1639
1673
|
validate(e) {
|
|
1640
1674
|
const t = e.queries.map((s) => this.validateQuery(s));
|
|
1641
|
-
return { valid:
|
|
1675
|
+
return { valid: z(t, (s) => s.valid), errors: t.map((s) => s.errors).flat() };
|
|
1642
1676
|
}
|
|
1643
1677
|
applyOptions(e, t = "update") {
|
|
1644
1678
|
return t === "set" ? (this.currentQuery.count = e.count, this.currentQuery.start = e.start, this.currentQuery.sort = e.sort, this.currentQuery.projection = e.projection) : (typeof e?.sort < "u" && (this.currentQuery.sort = e.sort), typeof e?.count < "u" && (this.currentQuery.count = e.count), typeof e?.start < "u" && (this.currentQuery.start = e?.start), typeof e?.projection < "u" && (this.currentQuery.projection = e?.projection)), this.getQuery();
|
|
@@ -1658,7 +1692,8 @@ class R {
|
|
|
1658
1692
|
* - {@link replaceQuery} - Replace complete query
|
|
1659
1693
|
*
|
|
1660
1694
|
* @param queryToApply - Query, condition, or array to apply
|
|
1661
|
-
* @param options - Mode: 'add' (default) or 'set' (replace)
|
|
1695
|
+
* @param options - Mode: 'add' (default) or 'set' (replace). In 'add' mode a group
|
|
1696
|
+
* without `groupKey` is always appended as a new group, never merged into another.
|
|
1662
1697
|
* @param relevantQuery - Target query (defaults to current)
|
|
1663
1698
|
* @returns Updated query
|
|
1664
1699
|
*/
|
|
@@ -1682,12 +1717,12 @@ class R {
|
|
|
1682
1717
|
queries: [e]
|
|
1683
1718
|
});
|
|
1684
1719
|
} else if (this.isQueryGroup(e)) {
|
|
1685
|
-
const
|
|
1686
|
-
(
|
|
1720
|
+
const i = e.groupKey === void 0 && t?.mode !== "set" ? -1 : r.queries.findIndex(
|
|
1721
|
+
(o) => this.isQueryGroup(o) && o.groupKey === e.groupKey
|
|
1687
1722
|
);
|
|
1688
|
-
if (
|
|
1689
|
-
const
|
|
1690
|
-
e.groupType && (
|
|
1723
|
+
if (i > -1) {
|
|
1724
|
+
const o = r.queries[i];
|
|
1725
|
+
e.groupType && (o.groupType = e.groupType), t?.mode === "set" ? r.queries[i] = e : o.queries = [...o.queries, ...e.queries];
|
|
1691
1726
|
} else
|
|
1692
1727
|
r.queries.push({
|
|
1693
1728
|
groupKey: e.groupKey,
|
|
@@ -1720,7 +1755,7 @@ class R {
|
|
|
1720
1755
|
(s) => this.isQueryGroup(s) && s.groupKey === e.attribute
|
|
1721
1756
|
);
|
|
1722
1757
|
if (r > -1) {
|
|
1723
|
-
const s = t.queries[r], i =
|
|
1758
|
+
const s = t.queries[r], i = $(s.queries, e);
|
|
1724
1759
|
i > -1 && s.queries.splice(i, 1), s.queries.length === 0 && t.queries.splice(r, 1);
|
|
1725
1760
|
}
|
|
1726
1761
|
} else if (this.isQueryGroup(e)) {
|
|
@@ -1733,8 +1768,8 @@ class R {
|
|
|
1733
1768
|
else {
|
|
1734
1769
|
const s = t.queries[r];
|
|
1735
1770
|
for (const i of e.queries) {
|
|
1736
|
-
const
|
|
1737
|
-
|
|
1771
|
+
const o = $(s.queries, i);
|
|
1772
|
+
o > -1 && s.queries.splice(o, 1);
|
|
1738
1773
|
}
|
|
1739
1774
|
s.queries.length === 0 && t.queries.splice(r, 1);
|
|
1740
1775
|
}
|
|
@@ -1744,12 +1779,12 @@ class R {
|
|
|
1744
1779
|
validateQuery(e) {
|
|
1745
1780
|
const t = [];
|
|
1746
1781
|
if (this.isQuery(e))
|
|
1747
|
-
return e.attribute || t.push(new
|
|
1782
|
+
return e.attribute || t.push(new x("Missing attribute", e)), e.operator || t.push(new x("Missing operator", e)), typeof e.value > "u" && t.push(new x("Missing value", e)), e.operator === "find" && Array.isArray(e.value) && t.push(new x("find operator cannot have array value", e)), e.operator === "in" && typeof e.value < "u" && !Array.isArray(e.value) && t.push(new x("in operator needs an array value", e)), t.length > 0 ? { valid: !1, errors: t } : { valid: !0 };
|
|
1748
1783
|
if (this.isQueryGroup(e)) {
|
|
1749
|
-
const i = e.queries.map((
|
|
1784
|
+
const i = e.queries.map((o) => this.validateQuery(o)).filter((o) => !o.valid).map((o) => o.errors).flat();
|
|
1750
1785
|
return i.length > 0 ? { valid: !1, errors: i } : { valid: !0 };
|
|
1751
1786
|
}
|
|
1752
|
-
return t.push(new
|
|
1787
|
+
return t.push(new x("Invalid query definition", e)), { valid: !1, errors: t };
|
|
1753
1788
|
}
|
|
1754
1789
|
/**
|
|
1755
1790
|
* Get all attribute names used in the query.
|
|
@@ -1760,8 +1795,8 @@ class R {
|
|
|
1760
1795
|
*/
|
|
1761
1796
|
getQueryAttributes(e) {
|
|
1762
1797
|
const t = [], r = /* @__PURE__ */ new Set(), s = (i) => {
|
|
1763
|
-
for (const
|
|
1764
|
-
this.isQuery(
|
|
1798
|
+
for (const o of i)
|
|
1799
|
+
this.isQuery(o) ? o.attribute && !r.has(o.attribute) && (t.push(o.attribute), r.add(o.attribute)) : this.isQueryGroup(o) && s(o.queries);
|
|
1765
1800
|
};
|
|
1766
1801
|
return s(e?.queries || this.currentQuery.queries), t;
|
|
1767
1802
|
}
|
|
@@ -1774,13 +1809,13 @@ class R {
|
|
|
1774
1809
|
*/
|
|
1775
1810
|
extractQueryAttributes(e) {
|
|
1776
1811
|
const t = [], r = /* @__PURE__ */ new Set(), s = (i) => {
|
|
1777
|
-
for (const
|
|
1778
|
-
if (this.isQuery(
|
|
1779
|
-
if (
|
|
1780
|
-
const a = this.getQueryAttributeForString(
|
|
1781
|
-
t.push(a), r.add(
|
|
1812
|
+
for (const o of i)
|
|
1813
|
+
if (this.isQuery(o)) {
|
|
1814
|
+
if (o.attribute && !r.has(o.attribute)) {
|
|
1815
|
+
const a = this.getQueryAttributeForString(o.attribute);
|
|
1816
|
+
t.push(a), r.add(o.attribute);
|
|
1782
1817
|
}
|
|
1783
|
-
} else this.isQueryGroup(
|
|
1818
|
+
} else this.isQueryGroup(o) && s(o.queries);
|
|
1784
1819
|
};
|
|
1785
1820
|
return s(e?.queries || this.currentQuery.queries), t;
|
|
1786
1821
|
}
|
|
@@ -1822,8 +1857,8 @@ class R {
|
|
|
1822
1857
|
const s = this.deepQueryService.parse(r.referenceAttribute);
|
|
1823
1858
|
if (s.isDeepQuery && r.reference) {
|
|
1824
1859
|
const i = this.getProjectionForAttributeEntries([s]);
|
|
1825
|
-
Object.keys(i).forEach((
|
|
1826
|
-
|
|
1860
|
+
Object.keys(i).forEach((o) => {
|
|
1861
|
+
o !== "$" && r.reference && (t[r.reference][o] = i[o]);
|
|
1827
1862
|
});
|
|
1828
1863
|
} else r.reference && (t[r.reference][r.referenceAttribute] = !0);
|
|
1829
1864
|
} else
|
|
@@ -1907,7 +1942,10 @@ class R {
|
|
|
1907
1942
|
/**
|
|
1908
1943
|
* Add query condition(s) to the current query.
|
|
1909
1944
|
* Accepts single condition or array of conditions.
|
|
1910
|
-
* Each condition is added to its respective attribute group
|
|
1945
|
+
* Each condition is added to its respective attribute group (the group whose
|
|
1946
|
+
* groupKey equals the condition's attribute; created as an `'or'` group if missing).
|
|
1947
|
+
* To combine conditions in an unkeyed group, use {@link addGroup} — unkeyed groups
|
|
1948
|
+
* are always appended as new groups and never merged.
|
|
1911
1949
|
*
|
|
1912
1950
|
* Clearer alternative to `applyQuery(condition, { mode: 'add' })`.
|
|
1913
1951
|
*
|
|
@@ -1931,7 +1969,13 @@ class R {
|
|
|
1931
1969
|
}
|
|
1932
1970
|
/**
|
|
1933
1971
|
* Add a query group to the current query.
|
|
1934
|
-
*
|
|
1972
|
+
* - Keyed group (`groupKey` set): if a group with the same groupKey exists, its queries
|
|
1973
|
+
* are extended and its groupType is replaced by the given one (if set); otherwise a new
|
|
1974
|
+
* group is created.
|
|
1975
|
+
* - Unkeyed group (no `groupKey`): always appended as a new group; it is never merged
|
|
1976
|
+
* into another group, so each unkeyed group keeps its own groupType.
|
|
1977
|
+
*
|
|
1978
|
+
* A newly created group without `groupType` is stored as `'or'`.
|
|
1935
1979
|
*
|
|
1936
1980
|
* @param group - Query group to add
|
|
1937
1981
|
* @returns Updated query
|
|
@@ -2122,8 +2166,8 @@ class R {
|
|
|
2122
2166
|
for (const s of r)
|
|
2123
2167
|
if (this.isQuery(s)) {
|
|
2124
2168
|
let i = !0;
|
|
2125
|
-
for (const
|
|
2126
|
-
if (s[
|
|
2169
|
+
for (const o in e)
|
|
2170
|
+
if (s[o] !== e[o]) {
|
|
2127
2171
|
i = !1;
|
|
2128
2172
|
break;
|
|
2129
2173
|
}
|
|
@@ -2248,48 +2292,95 @@ class R {
|
|
|
2248
2292
|
return e(this.currentQuery.queries);
|
|
2249
2293
|
}
|
|
2250
2294
|
}
|
|
2251
|
-
const
|
|
2252
|
-
function
|
|
2253
|
-
const a =
|
|
2295
|
+
const E = new L();
|
|
2296
|
+
function Ye(n, e, t, r, s, i, o) {
|
|
2297
|
+
const a = t.excludeGroup ?? s, c = E.removeQuery({ groupKey: a }, v(r)), u = o.queryData(n, c, !1, i), f = e ? [...e.keys()] : [], d = new Set(f), l = i.get(s) ?? /* @__PURE__ */ new Map();
|
|
2254
2298
|
if (!t.excludeUnresolved)
|
|
2255
|
-
for (const
|
|
2256
|
-
d.add(
|
|
2257
|
-
t.excludeUndefineds ? d.delete(void 0) : d.add(void 0)
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2299
|
+
for (const p of l.keys())
|
|
2300
|
+
d.add(p);
|
|
2301
|
+
if (t.excludeUndefineds ? d.delete(void 0) : d.add(void 0), t.sort) {
|
|
2302
|
+
const p = [];
|
|
2303
|
+
for (const K of d.values())
|
|
2304
|
+
p.push(
|
|
2305
|
+
_(
|
|
2306
|
+
K,
|
|
2307
|
+
l,
|
|
2308
|
+
u,
|
|
2309
|
+
e,
|
|
2310
|
+
s,
|
|
2311
|
+
a,
|
|
2312
|
+
r,
|
|
2313
|
+
!0
|
|
2314
|
+
)
|
|
2315
|
+
);
|
|
2316
|
+
const y = t.excludeZeros ? p.filter((K) => K.size > 0) : p;
|
|
2317
|
+
return y.sort(ve(t.sort)), t.count ? y.slice(0, t.count) : y;
|
|
2318
|
+
}
|
|
2319
|
+
const h = [];
|
|
2320
|
+
for (const p of d.values()) {
|
|
2321
|
+
const y = _(
|
|
2322
|
+
p,
|
|
2323
|
+
l,
|
|
2324
|
+
u,
|
|
2325
|
+
e,
|
|
2326
|
+
s,
|
|
2327
|
+
a,
|
|
2328
|
+
r,
|
|
2329
|
+
!!t?.calculateFacets
|
|
2330
|
+
);
|
|
2331
|
+
if (!(t?.excludeZeros && y.size === 0)) {
|
|
2332
|
+
if (t?.count && h.length === t?.count)
|
|
2333
|
+
return h;
|
|
2334
|
+
h.push(y);
|
|
2278
2335
|
}
|
|
2279
2336
|
}
|
|
2280
|
-
return
|
|
2337
|
+
return h;
|
|
2281
2338
|
}
|
|
2282
|
-
|
|
2283
|
-
const
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2339
|
+
function _(n, e, t, r, s, i, o, a) {
|
|
2340
|
+
const c = /* @__PURE__ */ new Map(), u = e.get(n) || /* @__PURE__ */ new Set();
|
|
2341
|
+
for (const f of u) {
|
|
2342
|
+
const d = t.get(f);
|
|
2343
|
+
if (d && (c.set(f, d), !a))
|
|
2344
|
+
break;
|
|
2345
|
+
}
|
|
2346
|
+
return {
|
|
2347
|
+
key: String(n),
|
|
2348
|
+
value: n,
|
|
2349
|
+
selected: we(i, s, n, o),
|
|
2350
|
+
enabled: c.size > 0,
|
|
2351
|
+
size: c.size,
|
|
2352
|
+
entry: r?.get(n),
|
|
2353
|
+
resultKeys: Array.from(c.keys())
|
|
2354
|
+
};
|
|
2355
|
+
}
|
|
2356
|
+
function S(n, e) {
|
|
2357
|
+
if (n === void 0 && e === void 0) return 0;
|
|
2358
|
+
if (n === void 0) return 1;
|
|
2359
|
+
if (e === void 0) return -1;
|
|
2360
|
+
const t = typeof n, r = typeof e;
|
|
2361
|
+
if (t !== r) return t < r ? -1 : 1;
|
|
2362
|
+
if (t === "number") return n - e;
|
|
2363
|
+
if (t === "string") return n.localeCompare(e);
|
|
2364
|
+
const s = String(n), i = String(e);
|
|
2365
|
+
return s < i ? -1 : s > i ? 1 : 0;
|
|
2366
|
+
}
|
|
2367
|
+
function ve(n) {
|
|
2368
|
+
switch (n) {
|
|
2369
|
+
case "size-desc":
|
|
2370
|
+
return (e, t) => t.size - e.size || S(e.value, t.value);
|
|
2371
|
+
case "size-asc":
|
|
2372
|
+
return (e, t) => e.size - t.size || S(e.value, t.value);
|
|
2373
|
+
case "value-asc":
|
|
2374
|
+
return (e, t) => S(e.value, t.value);
|
|
2375
|
+
case "value-desc":
|
|
2376
|
+
return (e, t) => e.value === void 0 && t.value === void 0 ? 0 : e.value === void 0 ? 1 : t.value === void 0 ? -1 : -S(e.value, t.value);
|
|
2377
|
+
}
|
|
2378
|
+
}
|
|
2379
|
+
const we = (n, e, t, r) => {
|
|
2380
|
+
const s = r.queries.findIndex((i) => E.isQueryGroup(i) && i.groupKey === n);
|
|
2381
|
+
return s > -1 ? !!r.queries[s].queries.find((o) => E.isQuery(o) ? o.attribute !== e ? !1 : (o.operator === "in" && Array.isArray(o.value) ? o.value : [o.value]).some((c) => (c?.key || c) === t) : !1) : !1;
|
|
2291
2382
|
};
|
|
2292
|
-
class
|
|
2383
|
+
class xe {
|
|
2293
2384
|
indexMap = /* @__PURE__ */ new Map();
|
|
2294
2385
|
// Possible performance gain*
|
|
2295
2386
|
dataMap = /* @__PURE__ */ new Map();
|
|
@@ -2299,6 +2390,15 @@ class ve {
|
|
|
2299
2390
|
reset(e) {
|
|
2300
2391
|
e ? (this.indexMap.delete(e), this.dataMap.delete(e), this.indexMetadata.delete(e)) : (this.indexMap.clear(), this.dataMap.clear(), this.indexMetadata.clear());
|
|
2301
2392
|
}
|
|
2393
|
+
/**
|
|
2394
|
+
* Removes every index the predicate selects. Used to drop indices that
|
|
2395
|
+
* were built from now-stale data; the next read lazily rebuilds them via
|
|
2396
|
+
* {@link getOrCreateIndex}.
|
|
2397
|
+
*/
|
|
2398
|
+
resetIndicesWhere(e) {
|
|
2399
|
+
for (const t of Array.from(this.indexMap.keys()))
|
|
2400
|
+
e(t) && this.reset(t);
|
|
2401
|
+
}
|
|
2302
2402
|
fillDataMap(e, t) {
|
|
2303
2403
|
let r = this.dataMap.get(e);
|
|
2304
2404
|
r || (r = /* @__PURE__ */ new Map(), this.dataMap.set(e, r));
|
|
@@ -2311,8 +2411,8 @@ class ve {
|
|
|
2311
2411
|
this.fillDataMap(e, [a]);
|
|
2312
2412
|
return;
|
|
2313
2413
|
} else s instanceof Date ? i = s.toISOString() : i = s;
|
|
2314
|
-
let
|
|
2315
|
-
|
|
2414
|
+
let o = r.get(i);
|
|
2415
|
+
o || (o = { key: i }, this.dataMap.get(e)?.set(i, o));
|
|
2316
2416
|
}
|
|
2317
2417
|
}
|
|
2318
2418
|
fillInverseIndex(e, t, r) {
|
|
@@ -2320,16 +2420,16 @@ class ve {
|
|
|
2320
2420
|
return;
|
|
2321
2421
|
const s = this.indexMap.get(e) || /* @__PURE__ */ new Map();
|
|
2322
2422
|
for (const i of r) {
|
|
2323
|
-
let
|
|
2423
|
+
let o;
|
|
2324
2424
|
if (typeof i == "object" && i && i.key)
|
|
2325
|
-
|
|
2425
|
+
o = i.key;
|
|
2326
2426
|
else if (Array.isArray(i)) {
|
|
2327
|
-
for (const
|
|
2328
|
-
this.fillInverseIndex(e, t, [
|
|
2427
|
+
for (const c of i)
|
|
2428
|
+
this.fillInverseIndex(e, t, [c]);
|
|
2329
2429
|
return;
|
|
2330
|
-
} else i instanceof Date ?
|
|
2331
|
-
let a = s.get(
|
|
2332
|
-
a || (a = /* @__PURE__ */ new Set(), s.set(
|
|
2430
|
+
} else i instanceof Date ? o = i.toISOString() : o = i;
|
|
2431
|
+
let a = s.get(o);
|
|
2432
|
+
a || (a = /* @__PURE__ */ new Set(), s.set(o, a)), a.add(t);
|
|
2333
2433
|
}
|
|
2334
2434
|
this.indexMap.set(e, s);
|
|
2335
2435
|
}
|
|
@@ -2344,31 +2444,31 @@ class ve {
|
|
|
2344
2444
|
getOrCreateIndex(e, t, r) {
|
|
2345
2445
|
const s = this.getIndexName(e, r);
|
|
2346
2446
|
let i = this.getIndex(s);
|
|
2347
|
-
const
|
|
2348
|
-
if (
|
|
2349
|
-
|
|
2447
|
+
const o = this.indexMetadata.get(s);
|
|
2448
|
+
if (o)
|
|
2449
|
+
o.lastAccessedAt = Date.now();
|
|
2350
2450
|
else if (!i) {
|
|
2351
|
-
const
|
|
2451
|
+
const c = m.parse(e).isDeepQuery ?? !1;
|
|
2352
2452
|
this.indexMetadata.set(s, {
|
|
2353
2453
|
createdAt: Date.now(),
|
|
2354
2454
|
lastAccessedAt: Date.now(),
|
|
2355
2455
|
context: r,
|
|
2356
|
-
type:
|
|
2456
|
+
type: c ? "deep" : "shallow"
|
|
2357
2457
|
});
|
|
2358
2458
|
}
|
|
2359
2459
|
if (!i) {
|
|
2360
2460
|
this.reset(s), this.indexMap.set(s, /* @__PURE__ */ new Map());
|
|
2361
|
-
const
|
|
2362
|
-
for (const
|
|
2363
|
-
let
|
|
2364
|
-
|
|
2461
|
+
const c = m.parse(e).isDeepQuery;
|
|
2462
|
+
for (const u of t.values()) {
|
|
2463
|
+
let f;
|
|
2464
|
+
c ? (f = w(u, e), f.length === 0 && (f = [void 0])) : f = [u[e]], this.fillInverseIndex(s, u.key, f), this.fillDataMap(s, f);
|
|
2365
2465
|
}
|
|
2366
2466
|
i = this.getIndex(s) || /* @__PURE__ */ new Map();
|
|
2367
2467
|
}
|
|
2368
2468
|
return i;
|
|
2369
2469
|
}
|
|
2370
2470
|
getIndexName(e, t) {
|
|
2371
|
-
return t ? e + "_" +
|
|
2471
|
+
return t ? e + "_" + D(t) : e;
|
|
2372
2472
|
}
|
|
2373
2473
|
// ========== PARTIAL UPDATE METHODS ==========
|
|
2374
2474
|
/**
|
|
@@ -2381,16 +2481,16 @@ class ve {
|
|
|
2381
2481
|
const s = this.indexMap.get(e);
|
|
2382
2482
|
if (s)
|
|
2383
2483
|
for (const i of r) {
|
|
2384
|
-
let
|
|
2484
|
+
let o;
|
|
2385
2485
|
if (typeof i == "object" && i && i.key)
|
|
2386
|
-
|
|
2486
|
+
o = i.key;
|
|
2387
2487
|
else if (Array.isArray(i)) {
|
|
2388
|
-
for (const
|
|
2389
|
-
this.removeFromInverseIndex(e, t, [
|
|
2488
|
+
for (const c of i)
|
|
2489
|
+
this.removeFromInverseIndex(e, t, [c]);
|
|
2390
2490
|
return;
|
|
2391
|
-
} else i instanceof Date ?
|
|
2392
|
-
const a = s.get(
|
|
2393
|
-
a && (a.delete(t), a.size === 0 && s.delete(
|
|
2491
|
+
} else i instanceof Date ? o = i.toISOString() : o = i;
|
|
2492
|
+
const a = s.get(o);
|
|
2493
|
+
a && (a.delete(t), a.size === 0 && s.delete(o));
|
|
2394
2494
|
}
|
|
2395
2495
|
}
|
|
2396
2496
|
/**
|
|
@@ -2416,8 +2516,8 @@ class ve {
|
|
|
2416
2516
|
if (typeof s == "object" && s && s.key)
|
|
2417
2517
|
i = s.key;
|
|
2418
2518
|
else if (Array.isArray(s)) {
|
|
2419
|
-
for (const
|
|
2420
|
-
this.removeFromDataMap(e, [
|
|
2519
|
+
for (const o of s)
|
|
2520
|
+
this.removeFromDataMap(e, [o]);
|
|
2421
2521
|
return;
|
|
2422
2522
|
} else s instanceof Date ? i = s.toISOString() : i = s;
|
|
2423
2523
|
r.delete(i);
|
|
@@ -2462,7 +2562,7 @@ class ve {
|
|
|
2462
2562
|
isDeepQueryIndex(e) {
|
|
2463
2563
|
const t = e.includes("_") ? e.split("_")[0] : e;
|
|
2464
2564
|
try {
|
|
2465
|
-
return
|
|
2565
|
+
return m.parse(t).isDeepQuery ?? !1;
|
|
2466
2566
|
} catch {
|
|
2467
2567
|
return !1;
|
|
2468
2568
|
}
|
|
@@ -2523,8 +2623,8 @@ class ve {
|
|
|
2523
2623
|
getStats() {
|
|
2524
2624
|
const e = this.getIndexCount(), t = Date.now();
|
|
2525
2625
|
let r = 0, s = 0;
|
|
2526
|
-
for (const
|
|
2527
|
-
const a = t -
|
|
2626
|
+
for (const o of this.indexMetadata.values()) {
|
|
2627
|
+
const a = t - o.createdAt;
|
|
2528
2628
|
r += a, a > s && (s = a);
|
|
2529
2629
|
}
|
|
2530
2630
|
const i = this.indexMetadata.size > 0 ? r / this.indexMetadata.size : 0;
|
|
@@ -2537,153 +2637,165 @@ class ve {
|
|
|
2537
2637
|
};
|
|
2538
2638
|
}
|
|
2539
2639
|
}
|
|
2540
|
-
const
|
|
2541
|
-
function
|
|
2542
|
-
const
|
|
2640
|
+
const A = "__";
|
|
2641
|
+
function U(n, e, t = { key: "root" }, r = "root", s = new xe(), i) {
|
|
2642
|
+
const o = i || n;
|
|
2543
2643
|
for (const a of e.columns)
|
|
2544
|
-
a.attribute && (
|
|
2644
|
+
a.attribute && (m.parse(a.attribute), s.getOrCreateIndex(a.attribute, o));
|
|
2545
2645
|
for (const a of e.rows)
|
|
2546
|
-
a.attribute && (
|
|
2646
|
+
a.attribute && (m.parse(a.attribute), s.getOrCreateIndex(a.attribute, o));
|
|
2547
2647
|
for (const a of e.values)
|
|
2548
|
-
a.attribute && (
|
|
2648
|
+
a.attribute && (m.parse(a.attribute), s.getOrCreateIndex(a.attribute, o));
|
|
2549
2649
|
if (e.rows && e.rows.length > 0) {
|
|
2550
2650
|
t.rows = t.rows || [];
|
|
2551
|
-
const a =
|
|
2651
|
+
const a = Ae(n, e.rows[0], e, s, r, i);
|
|
2552
2652
|
t.rows.push(a);
|
|
2553
2653
|
}
|
|
2554
2654
|
if (e.columns && e.columns.length > 0) {
|
|
2555
2655
|
t.columns = t.columns || [];
|
|
2556
|
-
const a =
|
|
2656
|
+
const a = W(n, e.columns[0], e, s, r, i);
|
|
2557
2657
|
t.columns.push(a);
|
|
2558
2658
|
}
|
|
2559
2659
|
if (t.key === "root")
|
|
2560
2660
|
for (const a of e.values) {
|
|
2561
2661
|
if (t.values = t.values || [], r === "root" && e.options?.calculateTotals === !1)
|
|
2562
2662
|
continue;
|
|
2563
|
-
const
|
|
2564
|
-
t.values.push(
|
|
2663
|
+
const c = C(a, n, s.getIndex(a.attribute), a.attribute);
|
|
2664
|
+
t.values.push(c);
|
|
2565
2665
|
}
|
|
2566
2666
|
return t;
|
|
2567
2667
|
}
|
|
2568
|
-
function
|
|
2569
|
-
const
|
|
2668
|
+
function Ae(n, e, t, r, s = "", i) {
|
|
2669
|
+
const o = { key: e.attribute }, a = r.getIndex(e.attribute);
|
|
2570
2670
|
if (!a)
|
|
2571
|
-
return
|
|
2572
|
-
for (const [
|
|
2573
|
-
const
|
|
2574
|
-
key:
|
|
2575
|
-
value:
|
|
2671
|
+
return o;
|
|
2672
|
+
for (const [c, u] of a.entries()) {
|
|
2673
|
+
const f = {
|
|
2674
|
+
key: c,
|
|
2675
|
+
value: c
|
|
2576
2676
|
}, d = /* @__PURE__ */ new Map();
|
|
2577
|
-
for (const l of
|
|
2578
|
-
|
|
2677
|
+
for (const l of u)
|
|
2678
|
+
n.has(l) && d.set(l, n.get(l));
|
|
2579
2679
|
if (d.size) {
|
|
2580
2680
|
for (const l of t.values) {
|
|
2581
|
-
if (
|
|
2681
|
+
if (f.values = f.values || [], s === "root" && e?.calculateTotals === !1)
|
|
2582
2682
|
continue;
|
|
2583
|
-
const h =
|
|
2584
|
-
|
|
2683
|
+
const h = C(l, d, r.getIndex(l.attribute), l.attribute);
|
|
2684
|
+
f.values.push(h);
|
|
2585
2685
|
}
|
|
2586
|
-
if (
|
|
2686
|
+
if (o.rows = o.rows || [], o.rows.push(f), t.rows.length > 1) {
|
|
2587
2687
|
const l = { ...t, rows: t.rows.slice(1) };
|
|
2588
|
-
|
|
2688
|
+
U(
|
|
2589
2689
|
d,
|
|
2590
2690
|
l,
|
|
2591
|
-
|
|
2592
|
-
s +
|
|
2691
|
+
f,
|
|
2692
|
+
s + A + e.attribute + A + c,
|
|
2593
2693
|
r,
|
|
2594
2694
|
i
|
|
2595
2695
|
);
|
|
2596
2696
|
} else if (t.columns)
|
|
2597
2697
|
for (const l of t.columns) {
|
|
2598
|
-
|
|
2599
|
-
const h =
|
|
2698
|
+
f.columns = f.columns || [];
|
|
2699
|
+
const h = W(
|
|
2600
2700
|
d,
|
|
2601
2701
|
l,
|
|
2602
2702
|
t,
|
|
2603
2703
|
r,
|
|
2604
|
-
s +
|
|
2704
|
+
s + A + e.attribute + A + c,
|
|
2605
2705
|
i
|
|
2606
2706
|
);
|
|
2607
|
-
|
|
2707
|
+
f.columns.push(h);
|
|
2608
2708
|
}
|
|
2609
2709
|
}
|
|
2610
2710
|
}
|
|
2611
|
-
return
|
|
2711
|
+
return o;
|
|
2612
2712
|
}
|
|
2613
|
-
function
|
|
2614
|
-
const
|
|
2713
|
+
function W(n, e, t, r, s = "", i) {
|
|
2714
|
+
const o = { key: e.attribute }, a = r.getIndex(e.attribute);
|
|
2615
2715
|
if (!a)
|
|
2616
|
-
return
|
|
2617
|
-
for (const [
|
|
2618
|
-
const
|
|
2619
|
-
key:
|
|
2620
|
-
value:
|
|
2716
|
+
return o;
|
|
2717
|
+
for (const [c, u] of a.entries()) {
|
|
2718
|
+
const f = {
|
|
2719
|
+
key: c,
|
|
2720
|
+
value: c
|
|
2621
2721
|
}, d = /* @__PURE__ */ new Map();
|
|
2622
|
-
for (const l of
|
|
2623
|
-
|
|
2722
|
+
for (const l of u)
|
|
2723
|
+
n.has(l) && d.set(l, n.get(l));
|
|
2624
2724
|
if (d.size) {
|
|
2625
2725
|
for (const l of t.values) {
|
|
2626
|
-
if (
|
|
2726
|
+
if (f.values = f.values || [], s === "root" && e?.calculateTotals === !1)
|
|
2627
2727
|
continue;
|
|
2628
|
-
const h =
|
|
2629
|
-
|
|
2728
|
+
const h = C(l, d, r.getIndex(l.attribute), l.attribute);
|
|
2729
|
+
f.values.push(h);
|
|
2630
2730
|
}
|
|
2631
|
-
if (
|
|
2731
|
+
if (o.columns = o.columns || [], o.columns.push(f), t.columns.length > 1) {
|
|
2632
2732
|
const l = { ...t, columns: t.columns.slice(1) };
|
|
2633
|
-
|
|
2733
|
+
U(
|
|
2634
2734
|
d,
|
|
2635
2735
|
l,
|
|
2636
|
-
|
|
2637
|
-
s +
|
|
2736
|
+
f,
|
|
2737
|
+
s + A + e.attribute + A + c,
|
|
2638
2738
|
r,
|
|
2639
2739
|
i
|
|
2640
2740
|
);
|
|
2641
2741
|
}
|
|
2642
2742
|
}
|
|
2643
2743
|
}
|
|
2644
|
-
return
|
|
2744
|
+
return o;
|
|
2645
2745
|
}
|
|
2646
|
-
const
|
|
2647
|
-
const
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2746
|
+
const be = /^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:\d{2})?)?$/, Se = /^-?\d+$/, Ie = /^-?\d+\.\d+$/, De = /^\d{1,2}([/.-])\d{1,2}\1\d{2,4}$/, Ke = (n) => n === "true" || n === "false" ? "boolean" : Se.test(n) ? "int" : Ie.test(n) ? "float" : be.test(n) && !Number.isNaN(Date.parse(n)) ? "date" : "string", ke = (n) => De.test(n), Me = (n) => n == null || n === "", Qe = (n) => {
|
|
2747
|
+
const e = [...n];
|
|
2748
|
+
return e.length <= 1 ? { type: e[0] ?? "any", conflict: !1 } : e.every((t) => t === "int" || t === "float") ? { type: "float", conflict: !1 } : { type: "any", conflict: !0 };
|
|
2749
|
+
}, Ne = (n, e = {}) => {
|
|
2750
|
+
const r = e.deep ?? (e.sampleSize !== void 0 && e.sampleSize > 1) ? e.sampleSize ?? 1 / 0 : 1, s = e.coerceStrings ?? !0, i = /* @__PURE__ */ new Map(), o = [], a = Math.min(n.length, r);
|
|
2751
|
+
for (let f = 0; f < a; f++) {
|
|
2752
|
+
const d = n[f];
|
|
2753
|
+
if (d)
|
|
2754
|
+
for (const [l, h] of Object.entries(d)) {
|
|
2755
|
+
let p = i.get(l);
|
|
2756
|
+
if (p || (p = { observed: /* @__PURE__ */ new Set(), empty: 0, scanned: 0 }, i.set(l, p), o.push(l)), p.scanned++, Me(h)) {
|
|
2757
|
+
p.empty++;
|
|
2758
|
+
continue;
|
|
2759
|
+
}
|
|
2760
|
+
let y;
|
|
2761
|
+
typeof h == "string" && s ? (y = Ke(h), y === "string" && !p.hint && ke(h) && (p.hint = "column looks date-like (non-ISO) — review manually")) : y = $e(h), p.observed.add(y);
|
|
2659
2762
|
}
|
|
2660
|
-
}
|
|
2661
|
-
if (!e)
|
|
2662
|
-
break;
|
|
2663
2763
|
}
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2764
|
+
const c = [], u = [];
|
|
2765
|
+
for (const f of o) {
|
|
2766
|
+
const d = i.get(f), { type: l, conflict: h } = Qe(d.observed.size ? d.observed : /* @__PURE__ */ new Set(["string"]));
|
|
2767
|
+
c.push({ key: f, type: l }), u.push({
|
|
2768
|
+
column: f,
|
|
2769
|
+
inferredType: l,
|
|
2770
|
+
observedTypes: [...d.observed].sort(),
|
|
2771
|
+
emptyRate: d.scanned === 0 ? 0 : d.empty / d.scanned,
|
|
2772
|
+
conflict: h,
|
|
2773
|
+
hint: d.hint
|
|
2774
|
+
});
|
|
2775
|
+
}
|
|
2776
|
+
return { properties: c, diagnostics: u };
|
|
2777
|
+
}, et = (n, e = !1) => Ne(n, typeof e == "boolean" ? { deep: e } : e).properties, Ee = (n) => Number(n) === n && n % 1 === 0, Ce = (n) => Number(n) === n && n % 1 !== 0, $e = (n) => {
|
|
2778
|
+
switch (typeof n) {
|
|
2667
2779
|
case "string":
|
|
2668
2780
|
return "string";
|
|
2669
2781
|
case "number":
|
|
2670
|
-
return
|
|
2782
|
+
return Ee(n) ? "int" : Ce(n) ? "float" : "any";
|
|
2671
2783
|
case "boolean":
|
|
2672
2784
|
return "boolean";
|
|
2673
2785
|
case "object":
|
|
2674
|
-
return se(
|
|
2786
|
+
return se(n) ? "date" : "json";
|
|
2675
2787
|
default:
|
|
2676
2788
|
return "any";
|
|
2677
2789
|
}
|
|
2678
|
-
},
|
|
2679
|
-
const t = te(
|
|
2790
|
+
}, tt = (n, e) => {
|
|
2791
|
+
const t = te(n.text || ""), r = e?.attributeKey || n.filterKey;
|
|
2680
2792
|
let s;
|
|
2681
2793
|
const i = e?.comparisonType || "containsIgnoreCase";
|
|
2682
2794
|
return i === "containsIgnoreCase" ? s = {
|
|
2683
|
-
groupKey:
|
|
2795
|
+
groupKey: n.filterKey,
|
|
2684
2796
|
queries: [
|
|
2685
2797
|
{
|
|
2686
|
-
queryKey:
|
|
2798
|
+
queryKey: n.text,
|
|
2687
2799
|
attribute: r,
|
|
2688
2800
|
value: `/${t}/`,
|
|
2689
2801
|
operator: "find",
|
|
@@ -2693,10 +2805,10 @@ const je = (o, e) => {
|
|
|
2693
2805
|
}
|
|
2694
2806
|
]
|
|
2695
2807
|
} : i === "containsIgnoreCaseAndWhitespace" ? s = {
|
|
2696
|
-
groupKey:
|
|
2808
|
+
groupKey: n.filterKey,
|
|
2697
2809
|
queries: [
|
|
2698
2810
|
{
|
|
2699
|
-
queryKey:
|
|
2811
|
+
queryKey: n.text,
|
|
2700
2812
|
attribute: r,
|
|
2701
2813
|
value: `/${t}/`,
|
|
2702
2814
|
operator: "find",
|
|
@@ -2706,32 +2818,32 @@ const je = (o, e) => {
|
|
|
2706
2818
|
}
|
|
2707
2819
|
]
|
|
2708
2820
|
} : i === "contains" ? s = {
|
|
2709
|
-
groupKey:
|
|
2821
|
+
groupKey: n.filterKey,
|
|
2710
2822
|
queries: [
|
|
2711
2823
|
{
|
|
2712
|
-
queryKey:
|
|
2824
|
+
queryKey: n.text,
|
|
2713
2825
|
attribute: r,
|
|
2714
2826
|
value: `/${t}/`,
|
|
2715
2827
|
operator: "find"
|
|
2716
2828
|
}
|
|
2717
2829
|
]
|
|
2718
2830
|
} : i === "equal" ? s = {
|
|
2719
|
-
groupKey:
|
|
2831
|
+
groupKey: n.filterKey,
|
|
2720
2832
|
queries: [
|
|
2721
2833
|
{
|
|
2722
|
-
queryKey:
|
|
2834
|
+
queryKey: n.text,
|
|
2723
2835
|
attribute: r,
|
|
2724
|
-
value:
|
|
2836
|
+
value: n.text,
|
|
2725
2837
|
operator: "eq"
|
|
2726
2838
|
}
|
|
2727
2839
|
]
|
|
2728
2840
|
} : i === "equalIgnoreCase" && (s = {
|
|
2729
|
-
groupKey:
|
|
2841
|
+
groupKey: n.filterKey,
|
|
2730
2842
|
queries: [
|
|
2731
2843
|
{
|
|
2732
|
-
queryKey:
|
|
2844
|
+
queryKey: n.text,
|
|
2733
2845
|
attribute: r,
|
|
2734
|
-
value:
|
|
2846
|
+
value: n.text,
|
|
2735
2847
|
operator: "eq",
|
|
2736
2848
|
options: {
|
|
2737
2849
|
transform: ["lowercase"]
|
|
@@ -2739,40 +2851,40 @@ const je = (o, e) => {
|
|
|
2739
2851
|
}
|
|
2740
2852
|
]
|
|
2741
2853
|
}), s;
|
|
2742
|
-
},
|
|
2743
|
-
const t = e?.attributeKey ||
|
|
2854
|
+
}, rt = (n, e) => {
|
|
2855
|
+
const t = e?.attributeKey || n.filterKey;
|
|
2744
2856
|
return {
|
|
2745
|
-
groupKey:
|
|
2857
|
+
groupKey: n.filterKey,
|
|
2746
2858
|
queries: [
|
|
2747
2859
|
{
|
|
2748
|
-
queryKey:
|
|
2860
|
+
queryKey: n.value,
|
|
2749
2861
|
attribute: t,
|
|
2750
|
-
value:
|
|
2862
|
+
value: n.value,
|
|
2751
2863
|
operator: "eq"
|
|
2752
2864
|
}
|
|
2753
2865
|
]
|
|
2754
2866
|
};
|
|
2755
|
-
},
|
|
2756
|
-
const t = e?.attributeKey ||
|
|
2757
|
-
groupKey:
|
|
2867
|
+
}, st = (n, e) => {
|
|
2868
|
+
const t = e?.attributeKey || n.filterKey, r = {
|
|
2869
|
+
groupKey: n.filterKey,
|
|
2758
2870
|
queries: []
|
|
2759
2871
|
};
|
|
2760
|
-
return typeof
|
|
2872
|
+
return typeof n.eq < "u" && (r.groupType = "or", Array.isArray(n.eq) ? n.eq.forEach((s) => {
|
|
2761
2873
|
r.queries.push({ attribute: t, value: s, operator: "eq" });
|
|
2762
|
-
}) : r.queries.push({ attribute: t, value:
|
|
2874
|
+
}) : r.queries.push({ attribute: t, value: n.eq, operator: "eq" })), typeof n.ne < "u" && (r.groupType = "and", Array.isArray(n.ne) ? n.ne.forEach((s) => {
|
|
2763
2875
|
r.queries.push({ attribute: t, value: s, operator: "eq", options: { invert: !0 } });
|
|
2764
2876
|
}) : r.queries.push({
|
|
2765
2877
|
attribute: t,
|
|
2766
|
-
value:
|
|
2878
|
+
value: n.ne,
|
|
2767
2879
|
operator: "eq",
|
|
2768
2880
|
options: { invert: !0 }
|
|
2769
|
-
})), typeof
|
|
2770
|
-
},
|
|
2771
|
-
const t = e?.attributeKey ||
|
|
2772
|
-
groupKey:
|
|
2881
|
+
})), typeof n.gt < "u" && (r.groupType = "and", r.queries.push({ attribute: t, value: n.gt, operator: "gt" })), typeof n.lt < "u" && (r.groupType = "and", r.queries.push({ attribute: t, value: n.lt, operator: "lt" })), typeof n.gte < "u" && (r.groupType = "and", r.queries.push({ attribute: t, value: n.gte, operator: "gte" })), typeof n.lte < "u" && (r.groupType = "and", r.queries.push({ attribute: t, value: n.lte, operator: "lte" })), r;
|
|
2882
|
+
}, nt = (n, e) => {
|
|
2883
|
+
const t = e?.attributeKey || n.filterKey, r = {
|
|
2884
|
+
groupKey: n.filterKey,
|
|
2773
2885
|
queries: []
|
|
2774
2886
|
};
|
|
2775
|
-
return
|
|
2887
|
+
return n.itemKeys.forEach((s) => {
|
|
2776
2888
|
r.queries.push({
|
|
2777
2889
|
queryKey: s,
|
|
2778
2890
|
attribute: t,
|
|
@@ -2780,13 +2892,16 @@ const je = (o, e) => {
|
|
|
2780
2892
|
operator: "eq"
|
|
2781
2893
|
});
|
|
2782
2894
|
}), r;
|
|
2783
|
-
},
|
|
2784
|
-
class
|
|
2895
|
+
}, it = (n) => !(typeof n.modelKey != "string" || !Array.isArray(n.queries));
|
|
2896
|
+
class ot {
|
|
2785
2897
|
constructor(e, t, r) {
|
|
2786
2898
|
this.scriptController = e, this.globalItemService = t, this.modelParser = r;
|
|
2787
2899
|
}
|
|
2900
|
+
scriptController;
|
|
2901
|
+
globalItemService;
|
|
2902
|
+
modelParser;
|
|
2788
2903
|
registeredCustomOperator = /* @__PURE__ */ new Map();
|
|
2789
|
-
queryBuilder = new
|
|
2904
|
+
queryBuilder = new L();
|
|
2790
2905
|
registerCustomOperator(e, t) {
|
|
2791
2906
|
this.registeredCustomOperator.set(e, t);
|
|
2792
2907
|
}
|
|
@@ -2800,85 +2915,235 @@ class Le {
|
|
|
2800
2915
|
return e;
|
|
2801
2916
|
}
|
|
2802
2917
|
evaluateQuery(e, t) {
|
|
2803
|
-
let r
|
|
2804
|
-
const
|
|
2805
|
-
|
|
2918
|
+
let r = e.value;
|
|
2919
|
+
const s = e.options?.arrayValueHandling || "some";
|
|
2920
|
+
Array.isArray(e.options?.transform) && e.options.transform.length > 0 && (r = this.transformValue(r, e.options.transform));
|
|
2921
|
+
let i = this.getAttributeValue(t, e.attribute);
|
|
2922
|
+
if (Array.isArray(e.options?.transform) && e.options.transform.length > 0 && (i = this.transformValue(i, e.options.transform)), (typeof i > "u" || i === null) && !["typeof", "isTruthy", "eq", "in"].includes(e.operator))
|
|
2806
2923
|
return !1;
|
|
2924
|
+
let o;
|
|
2807
2925
|
switch (e.operator) {
|
|
2808
2926
|
case "eq":
|
|
2809
|
-
|
|
2927
|
+
o = this.queryEq(i, r, s);
|
|
2928
|
+
break;
|
|
2929
|
+
case "in":
|
|
2930
|
+
o = this.queryIn(i, r, s);
|
|
2931
|
+
break;
|
|
2810
2932
|
case "find":
|
|
2811
|
-
|
|
2933
|
+
o = this.queryFind(i, r, s, e.options?.regexFlags);
|
|
2934
|
+
break;
|
|
2812
2935
|
case "lt":
|
|
2813
|
-
return Array.isArray(r) ? i === "some" ? r.some((n) => n < s) : r.every((n) => n < s) : r < s;
|
|
2814
2936
|
case "gt":
|
|
2815
|
-
return Array.isArray(r) ? i === "some" ? r.some((n) => n > s) : r.every((n) => n > s) : r > s;
|
|
2816
2937
|
case "lte":
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2938
|
+
case "gte": {
|
|
2939
|
+
const a = e.operator;
|
|
2940
|
+
o = this.matchValues(
|
|
2941
|
+
i,
|
|
2942
|
+
s,
|
|
2943
|
+
(c) => this.compareValue(a, c, r)
|
|
2944
|
+
);
|
|
2945
|
+
break;
|
|
2946
|
+
}
|
|
2820
2947
|
case "typeof":
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2948
|
+
o = this.matchValues(i, s, (a) => typeof a === r);
|
|
2949
|
+
break;
|
|
2950
|
+
case "isTruthy": {
|
|
2951
|
+
const a = r === !0;
|
|
2952
|
+
o = this.matchValues(i, s, (c) => !!c === a);
|
|
2953
|
+
break;
|
|
2954
|
+
}
|
|
2824
2955
|
case "size":
|
|
2825
|
-
|
|
2956
|
+
typeof i == "string" ? o = i.length === r : o = V(i) === r;
|
|
2957
|
+
break;
|
|
2826
2958
|
default:
|
|
2827
2959
|
if (this.scriptController.hasScript(e.operator))
|
|
2828
2960
|
return this.scriptController.executeScript(e.operator, "operator", { query: e, item: t });
|
|
2829
2961
|
if (this.registeredCustomOperator.has(e.operator)) {
|
|
2830
|
-
const
|
|
2831
|
-
if (typeof
|
|
2832
|
-
return
|
|
2962
|
+
const a = this.registeredCustomOperator.get(e.operator);
|
|
2963
|
+
if (typeof a == "function")
|
|
2964
|
+
return a(e, t);
|
|
2833
2965
|
}
|
|
2966
|
+
return !1;
|
|
2834
2967
|
}
|
|
2835
|
-
return !
|
|
2968
|
+
return e.options?.invert ? !o : o;
|
|
2969
|
+
}
|
|
2970
|
+
/** A missing value never compares — in JS `null >= 0` is true. */
|
|
2971
|
+
compareValue(e, t, r) {
|
|
2972
|
+
if (t == null)
|
|
2973
|
+
return !1;
|
|
2974
|
+
switch (e) {
|
|
2975
|
+
case "lt":
|
|
2976
|
+
return t < r;
|
|
2977
|
+
case "gt":
|
|
2978
|
+
return t > r;
|
|
2979
|
+
case "lte":
|
|
2980
|
+
return t <= r;
|
|
2981
|
+
case "gte":
|
|
2982
|
+
return t >= r;
|
|
2983
|
+
}
|
|
2984
|
+
}
|
|
2985
|
+
/**
|
|
2986
|
+
* The value a condition compares against. A dotted path that runs through a
|
|
2987
|
+
* list (a multi-valued reference, e.g. `memberships.role`) fans out into the
|
|
2988
|
+
* list of leaf values, the same values the attribute's inverse index holds —
|
|
2989
|
+
* `lodash.get` cannot step into an array and would answer `undefined`. An
|
|
2990
|
+
* index (`tags.0`) or `length` still reads the list itself, as with `get`.
|
|
2991
|
+
*/
|
|
2992
|
+
getAttributeValue(e, t) {
|
|
2993
|
+
if (t in e || !(t.includes(".") || t.includes("[")))
|
|
2994
|
+
return e[t];
|
|
2995
|
+
if (t.includes("["))
|
|
2996
|
+
return I(e, t);
|
|
2997
|
+
const r = t.split(".");
|
|
2998
|
+
let s = e;
|
|
2999
|
+
for (let i = 0; i < r.length; i++) {
|
|
3000
|
+
const o = r[i];
|
|
3001
|
+
if (s == null)
|
|
3002
|
+
return;
|
|
3003
|
+
if (Array.isArray(s) && o !== "length" && !/^\d+$/.test(o))
|
|
3004
|
+
return w(s, r.slice(i).join("."));
|
|
3005
|
+
s = s[o];
|
|
3006
|
+
}
|
|
3007
|
+
return s;
|
|
3008
|
+
}
|
|
3009
|
+
/**
|
|
3010
|
+
* Applies `predicate` to a single value, or to each value of a list per
|
|
3011
|
+
* `arrayValueHandling`. `every` needs at least one value: an empty list
|
|
3012
|
+
* matches nothing (and so matches under `invert`).
|
|
3013
|
+
*/
|
|
3014
|
+
matchValues(e, t, r) {
|
|
3015
|
+
return Array.isArray(e) ? t === "every" ? e.length > 0 && e.every(r) : e.some(r) : r(e);
|
|
3016
|
+
}
|
|
3017
|
+
/**
|
|
3018
|
+
* `eq` against a list compares each value, as the inverse index does; a
|
|
3019
|
+
* query value that is itself a list still compares the whole list.
|
|
3020
|
+
*/
|
|
3021
|
+
queryEq(e, t, r) {
|
|
3022
|
+
return Array.isArray(e) && !Array.isArray(t) ? this.matchValues(e, r, (s) => this.equalsQueryValue(s, t)) : this.equalsQueryValue(e, t);
|
|
3023
|
+
}
|
|
3024
|
+
/**
|
|
3025
|
+
* `in`: a value matches if it equals (as `eq` compares) any listed value; a
|
|
3026
|
+
* list of values matches per `arrayValueHandling`. An empty list matches nothing.
|
|
3027
|
+
*/
|
|
3028
|
+
queryIn(e, t, r) {
|
|
3029
|
+
return !Array.isArray(t) || t.length === 0 ? !1 : this.matchValues(
|
|
3030
|
+
e,
|
|
3031
|
+
r,
|
|
3032
|
+
(s) => t.some((i) => this.equalsQueryValue(s, i))
|
|
3033
|
+
);
|
|
3034
|
+
}
|
|
3035
|
+
/**
|
|
3036
|
+
* The inverse-index key a query value looks up: a string, or the key of a
|
|
3037
|
+
* `{ key }` object. Anything else has no key and is compared by a scan.
|
|
3038
|
+
*/
|
|
3039
|
+
getIndexKey(e) {
|
|
3040
|
+
if (typeof e == "string")
|
|
3041
|
+
return e;
|
|
3042
|
+
if (e?.key && Object.keys(e).length === 1)
|
|
3043
|
+
return e.key;
|
|
3044
|
+
}
|
|
3045
|
+
/**
|
|
3046
|
+
* Equality the way the inverse index keys values: a string (or `{ key }`)
|
|
3047
|
+
* query value matches a reference by its key and a date by its ISO string.
|
|
3048
|
+
*/
|
|
3049
|
+
equalsQueryValue(e, t) {
|
|
3050
|
+
const r = this.getIndexKey(t);
|
|
3051
|
+
return typeof r > "u" ? H(e, t) : e instanceof Date ? !isNaN(e.getTime()) && e.toISOString() === r : typeof e == "object" && e?.key ? e.key === r : e === r;
|
|
3052
|
+
}
|
|
3053
|
+
/**
|
|
3054
|
+
* An inverse index answers `eq` as "some value equals", untransformed — only
|
|
3055
|
+
* use it when that is the question.
|
|
3056
|
+
*/
|
|
3057
|
+
canUseIndex(e) {
|
|
3058
|
+
return e.options?.arrayValueHandling !== "every" && !e.options?.transform?.length;
|
|
2836
3059
|
}
|
|
2837
3060
|
evaluateEqOperator(e, t, r, s) {
|
|
2838
|
-
const i = /* @__PURE__ */ new Map(),
|
|
2839
|
-
if (
|
|
2840
|
-
|
|
2841
|
-
if (typeof
|
|
2842
|
-
const
|
|
2843
|
-
if (
|
|
2844
|
-
if (
|
|
2845
|
-
r.has(
|
|
3061
|
+
const i = /* @__PURE__ */ new Map(), o = this.canUseIndex(t) ? s.get(t.attribute) : void 0;
|
|
3062
|
+
if (o) {
|
|
3063
|
+
const a = this.getIndexKey(t.value);
|
|
3064
|
+
if (typeof a < "u") {
|
|
3065
|
+
const c = o.get(a);
|
|
3066
|
+
if (c)
|
|
3067
|
+
if (c.forEach((u) => {
|
|
3068
|
+
r.has(u) && i.set(u, r.get(u));
|
|
2846
3069
|
}), t.options?.invert) {
|
|
2847
|
-
const
|
|
2848
|
-
return
|
|
2849
|
-
|
|
2850
|
-
}),
|
|
3070
|
+
const u = O(Array.from(r.values()), Array.from(i.values()), "key"), f = /* @__PURE__ */ new Map();
|
|
3071
|
+
return u.forEach((d) => {
|
|
3072
|
+
f.set(d.key, d);
|
|
3073
|
+
}), f;
|
|
2851
3074
|
} else
|
|
2852
3075
|
return i;
|
|
2853
3076
|
}
|
|
2854
3077
|
}
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
3078
|
+
return this.scanDataset(e, t, r);
|
|
3079
|
+
}
|
|
3080
|
+
/**
|
|
3081
|
+
* `in` from the inverse index when it can answer: the union of the index
|
|
3082
|
+
* sets of the listed values. A value the index cannot look up (not a string
|
|
3083
|
+
* or `{ key }`, or not in the index) is answered by a scan of the rest, so
|
|
3084
|
+
* the result equals the scan's.
|
|
3085
|
+
*/
|
|
3086
|
+
evaluateInOperator(e, t, r, s) {
|
|
3087
|
+
const i = this.canUseIndex(t) ? s.get(t.attribute) : void 0;
|
|
3088
|
+
if (!i)
|
|
3089
|
+
return this.scanDataset(e, t, r);
|
|
3090
|
+
const o = /* @__PURE__ */ new Map(), a = [];
|
|
3091
|
+
for (const u of t.value) {
|
|
3092
|
+
const f = this.getIndexKey(u), d = typeof f < "u" ? i.get(f) : void 0;
|
|
3093
|
+
if (!d) {
|
|
3094
|
+
a.push(u);
|
|
3095
|
+
continue;
|
|
2866
3096
|
}
|
|
2867
|
-
|
|
3097
|
+
d.forEach((l) => {
|
|
3098
|
+
const h = r.get(l);
|
|
3099
|
+
h && o.set(l, h);
|
|
3100
|
+
});
|
|
2868
3101
|
}
|
|
2869
|
-
|
|
3102
|
+
if (a.length > 0) {
|
|
3103
|
+
const u = /* @__PURE__ */ new Map();
|
|
3104
|
+
r.forEach((d, l) => {
|
|
3105
|
+
o.has(l) || u.set(l, d);
|
|
3106
|
+
});
|
|
3107
|
+
const f = {
|
|
3108
|
+
...t,
|
|
3109
|
+
value: a,
|
|
3110
|
+
options: { ...t.options, invert: !1 }
|
|
3111
|
+
};
|
|
3112
|
+
this.scanDataset(e, f, u).forEach((d, l) => o.set(l, d));
|
|
3113
|
+
}
|
|
3114
|
+
if (!t.options?.invert)
|
|
3115
|
+
return o;
|
|
3116
|
+
const c = /* @__PURE__ */ new Map();
|
|
3117
|
+
return r.forEach((u, f) => {
|
|
3118
|
+
o.has(f) || c.set(f, u);
|
|
3119
|
+
}), c;
|
|
3120
|
+
}
|
|
3121
|
+
/** Evaluates `query` on each item, resolving a deep path's references first. */
|
|
3122
|
+
scanDataset(e, t, r) {
|
|
3123
|
+
const s = /* @__PURE__ */ new Map(), i = this.queryBuilder.extractQueryAttributes({ queries: [t] }).filter((a) => a.isDeepQuery), o = i.length > 0 ? this.queryBuilder.getProjectionForAttributeEntries(i) : void 0;
|
|
3124
|
+
for (let [a, c] of r)
|
|
3125
|
+
o && (c = this.globalItemService.getProjectedData(
|
|
3126
|
+
o,
|
|
3127
|
+
this.modelParser.models.get(e.modelKey),
|
|
3128
|
+
c
|
|
3129
|
+
)), this.evaluateQuery(t, c) && s.set(a, c);
|
|
3130
|
+
return s;
|
|
2870
3131
|
}
|
|
2871
|
-
equalRegexFn(e, t) {
|
|
2872
|
-
|
|
3132
|
+
equalRegexFn(e, t, r) {
|
|
3133
|
+
const s = P(t, r);
|
|
3134
|
+
if (s)
|
|
2873
3135
|
try {
|
|
2874
|
-
return new RegExp(
|
|
3136
|
+
return new RegExp(s.pattern, s.flags).test(e);
|
|
2875
3137
|
} catch {
|
|
2876
3138
|
return !1;
|
|
2877
3139
|
}
|
|
2878
|
-
else return Array.isArray(e) ? !!e.find(
|
|
3140
|
+
else return Array.isArray(e) ? !!e.find(
|
|
3141
|
+
(i) => k(i, t, (o, a) => this.equalRegexFn(o, a, r))
|
|
3142
|
+
) : typeof t == "object" ? q(e, t) : e === t;
|
|
2879
3143
|
}
|
|
2880
|
-
queryFind(e, t, r) {
|
|
2881
|
-
|
|
3144
|
+
queryFind(e, t, r, s) {
|
|
3145
|
+
const i = (o, a) => this.equalRegexFn(o, a, s);
|
|
3146
|
+
return Array.isArray(e) ? typeof t == "string" || typeof t == "number" || typeof t == "boolean" ? this.matchValues(e, r, (o) => k(o, t, i)) : t !== null && typeof t == "object" ? this.matchValues(e, r, (o) => q(o, t)) : !!J(e, t) : k(e, t, i);
|
|
2882
3147
|
}
|
|
2883
3148
|
validateQuery(e) {
|
|
2884
3149
|
if (this.queryBuilder.isQuery(e)) {
|
|
@@ -2886,61 +3151,45 @@ class Le {
|
|
|
2886
3151
|
throw new Error("invalid query - missing attribute or operator");
|
|
2887
3152
|
if (e.operator === "find" && Array.isArray(e.value))
|
|
2888
3153
|
throw new Error("invalid query - find operator cannot have array value");
|
|
3154
|
+
if (e.operator === "in" && !Array.isArray(e.value))
|
|
3155
|
+
throw new Error("invalid query - in operator needs an array value");
|
|
2889
3156
|
return !0;
|
|
2890
3157
|
} else {
|
|
2891
3158
|
if (this.queryBuilder.isQueryGroup(e))
|
|
2892
|
-
return
|
|
3159
|
+
return z(e.queries, (t) => this.validateQuery(t));
|
|
2893
3160
|
throw new Error("invalid query - missing query or attribute");
|
|
2894
3161
|
}
|
|
2895
3162
|
}
|
|
2896
3163
|
getEvaluatedQueryDataset(e, t, r, s) {
|
|
2897
3164
|
const i = /* @__PURE__ */ new Map();
|
|
2898
3165
|
if (t.attribute.includes("[*]")) {
|
|
2899
|
-
const
|
|
2900
|
-
for (let
|
|
2901
|
-
const f = this.queryBuilder.extractQueryAttributes({ queries: [t] });
|
|
2902
|
-
if (f.some((l) => l.isDeepQuery)) {
|
|
2903
|
-
const l = this.queryBuilder.getProjectionForAttributeEntries(
|
|
2904
|
-
f.filter((h) => h.isDeepQuery)
|
|
2905
|
-
);
|
|
2906
|
-
u = this.globalItemService.getProjectedData(
|
|
2907
|
-
l,
|
|
2908
|
-
this.modelParser.models.get(e.modelKey),
|
|
2909
|
-
u
|
|
2910
|
-
);
|
|
2911
|
-
}
|
|
2912
|
-
const c = this.handleArrayStarQuery(t, u);
|
|
2913
|
-
let d = !1;
|
|
2914
|
-
for (const l of c.queries) {
|
|
2915
|
-
const h = { ...l, options: { ...l.options, invert: !1 } };
|
|
2916
|
-
if (this.evaluateQuery(h, u)) {
|
|
2917
|
-
d = !0;
|
|
2918
|
-
break;
|
|
2919
|
-
}
|
|
2920
|
-
}
|
|
2921
|
-
d && (a.add(u.key), n || i.set(u.key, u));
|
|
2922
|
-
}
|
|
2923
|
-
if (n)
|
|
2924
|
-
for (const [u, f] of r)
|
|
2925
|
-
a.has(u) || i.set(u, f);
|
|
2926
|
-
} else {
|
|
2927
|
-
if (t.operator === "eq")
|
|
2928
|
-
return this.evaluateEqOperator(e, t, r, s);
|
|
2929
|
-
for (let [n, a] of r) {
|
|
3166
|
+
const o = t.options?.invert === !0, a = /* @__PURE__ */ new Set();
|
|
3167
|
+
for (let c of r.values()) {
|
|
2930
3168
|
const u = this.queryBuilder.extractQueryAttributes({ queries: [t] });
|
|
2931
|
-
if (u.some((
|
|
2932
|
-
const
|
|
2933
|
-
u.filter((
|
|
3169
|
+
if (u.some((h) => h.isDeepQuery)) {
|
|
3170
|
+
const h = this.queryBuilder.getProjectionForAttributeEntries(
|
|
3171
|
+
u.filter((p) => p.isDeepQuery)
|
|
2934
3172
|
);
|
|
2935
|
-
|
|
2936
|
-
|
|
3173
|
+
c = this.globalItemService.getProjectedData(
|
|
3174
|
+
h,
|
|
2937
3175
|
this.modelParser.models.get(e.modelKey),
|
|
2938
|
-
|
|
3176
|
+
c
|
|
2939
3177
|
);
|
|
2940
3178
|
}
|
|
2941
|
-
this.
|
|
3179
|
+
const d = this.handleArrayStarQuery(t, c).queries.map((h) => ({
|
|
3180
|
+
...h,
|
|
3181
|
+
options: { ...h.options, invert: !1 }
|
|
3182
|
+
}));
|
|
3183
|
+
this.matchValues(
|
|
3184
|
+
d,
|
|
3185
|
+
t.options?.arrayValueHandling || "some",
|
|
3186
|
+
(h) => this.evaluateQuery(h, c)
|
|
3187
|
+
) && (a.add(c.key), o || i.set(c.key, c));
|
|
2942
3188
|
}
|
|
2943
|
-
|
|
3189
|
+
if (o)
|
|
3190
|
+
for (const [c, u] of r)
|
|
3191
|
+
a.has(c) || i.set(c, u);
|
|
3192
|
+
} else return t.operator === "eq" ? this.evaluateEqOperator(e, t, r, s) : t.operator === "in" ? this.evaluateInOperator(e, t, r, s) : this.scanDataset(e, t, r);
|
|
2944
3193
|
return i;
|
|
2945
3194
|
}
|
|
2946
3195
|
handleArrayStarQuery(e, t) {
|
|
@@ -2950,12 +3199,12 @@ class Le {
|
|
|
2950
3199
|
queries: []
|
|
2951
3200
|
};
|
|
2952
3201
|
if (r !== -1) {
|
|
2953
|
-
const i = e.attribute.substring(0, r),
|
|
2954
|
-
if (Array.isArray(
|
|
2955
|
-
for (let a = 0; a <
|
|
2956
|
-
const
|
|
3202
|
+
const i = e.attribute.substring(0, r), o = i.includes(".") ? I(t, i) : t[i];
|
|
3203
|
+
if (Array.isArray(o))
|
|
3204
|
+
for (let a = 0; a < o.length; a++) {
|
|
3205
|
+
const c = e.attribute.replace("[*]", `[${a}]`);
|
|
2957
3206
|
s.queries.push({
|
|
2958
|
-
attribute:
|
|
3207
|
+
attribute: c,
|
|
2959
3208
|
operator: e.operator,
|
|
2960
3209
|
value: e.value,
|
|
2961
3210
|
options: e.options
|
|
@@ -2965,27 +3214,29 @@ class Le {
|
|
|
2965
3214
|
return s;
|
|
2966
3215
|
}
|
|
2967
3216
|
evaluateQueryGroup(e, t, r, s, i) {
|
|
2968
|
-
let
|
|
3217
|
+
let o = /* @__PURE__ */ new Map(), a = r;
|
|
2969
3218
|
if (!t.queries || t.queries?.length === 0)
|
|
2970
3219
|
return a;
|
|
2971
|
-
for (const
|
|
2972
|
-
let
|
|
2973
|
-
if (this.queryBuilder.isQuery(
|
|
2974
|
-
|
|
2975
|
-
|
|
3220
|
+
for (const c of t.queries) {
|
|
3221
|
+
let u = /* @__PURE__ */ new Map();
|
|
3222
|
+
if (this.queryBuilder.isQuery(c) ? u = this.getEvaluatedQueryDataset(e, c, a, i) : u = this.evaluateQueryGroup(e, c, a, s, i), o.size === 0 && (o = u), t.groupType === "or")
|
|
3223
|
+
u.forEach((f) => {
|
|
3224
|
+
o.set(f.key, f);
|
|
2976
3225
|
});
|
|
2977
3226
|
else {
|
|
2978
|
-
const
|
|
2979
|
-
for (const d of
|
|
2980
|
-
|
|
3227
|
+
const f = O(Array.from(o.values()), Array.from(u.values()), "key");
|
|
3228
|
+
for (const d of f)
|
|
3229
|
+
o.delete(d.key);
|
|
2981
3230
|
}
|
|
2982
|
-
t.groupType === "and" ? a =
|
|
3231
|
+
t.groupType === "and" ? a = o : a = r;
|
|
2983
3232
|
}
|
|
2984
|
-
return
|
|
3233
|
+
return o;
|
|
2985
3234
|
}
|
|
2986
3235
|
queryData(e, t, r, s) {
|
|
3236
|
+
if (t.queries.length === 0)
|
|
3237
|
+
return e;
|
|
2987
3238
|
const i = new Map(e);
|
|
2988
|
-
return t.
|
|
3239
|
+
return t.groupKey || (t.groupKey = "root"), t.groupType || (t.groupType = "and"), t.queries || (t.queries = []), this.validateQuery(t), this.evaluateQueryGroup(t, t, i, r, s);
|
|
2989
3240
|
}
|
|
2990
3241
|
// public getRelevantQueryData(data: any, options: DcuplGlobalQueryOptions<any>, model: DcuplModel<ListItem>) {
|
|
2991
3242
|
// // detect if any of the query attributes are a deep query.
|
|
@@ -3021,7 +3272,59 @@ class Le {
|
|
|
3021
3272
|
// }
|
|
3022
3273
|
// }
|
|
3023
3274
|
}
|
|
3024
|
-
|
|
3275
|
+
const Oe = /* @__PURE__ */ new Set([
|
|
3276
|
+
"apikey",
|
|
3277
|
+
"api-key",
|
|
3278
|
+
"managerkey",
|
|
3279
|
+
"token",
|
|
3280
|
+
"proxy-key",
|
|
3281
|
+
"proxykey",
|
|
3282
|
+
"manager-key",
|
|
3283
|
+
"sdk-key"
|
|
3284
|
+
]);
|
|
3285
|
+
function at(n) {
|
|
3286
|
+
const e = n.indexOf("?");
|
|
3287
|
+
if (e < 0) return n;
|
|
3288
|
+
const t = n.slice(e + 1).split("&").map((r) => {
|
|
3289
|
+
const s = r.indexOf("=");
|
|
3290
|
+
if (s < 0) return r;
|
|
3291
|
+
const i = r.slice(0, s);
|
|
3292
|
+
return Oe.has(i.toLowerCase()) ? `${i}=<redacted>` : r;
|
|
3293
|
+
}).join("&");
|
|
3294
|
+
return `${n.slice(0, e)}?${t}`;
|
|
3295
|
+
}
|
|
3296
|
+
const qe = "k:", Re = "h:";
|
|
3297
|
+
function Q(n, e = 0) {
|
|
3298
|
+
if (n.key)
|
|
3299
|
+
return `${qe}${n.key}`;
|
|
3300
|
+
const t = D({
|
|
3301
|
+
type: n.type,
|
|
3302
|
+
url: n.rawUrl ?? n.url,
|
|
3303
|
+
model: n.model ?? "",
|
|
3304
|
+
occurrence: e
|
|
3305
|
+
});
|
|
3306
|
+
return `${Re}${t}`;
|
|
3307
|
+
}
|
|
3308
|
+
function ct(n) {
|
|
3309
|
+
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set();
|
|
3310
|
+
return n.map((r) => {
|
|
3311
|
+
const s = `${r.key ?? ""}|${r.type}|${r.rawUrl ?? r.url}|${r.model ?? ""}`;
|
|
3312
|
+
let i = e.get(s) ?? 0, o = Q(r, i);
|
|
3313
|
+
for (; t.has(o); )
|
|
3314
|
+
i += 1, o = r.key ? `${Q(r)}#${i}` : Q(r, i);
|
|
3315
|
+
return e.set(s, i + 1), t.add(o), o;
|
|
3316
|
+
});
|
|
3317
|
+
}
|
|
3318
|
+
function ut() {
|
|
3319
|
+
const n = globalThis;
|
|
3320
|
+
return typeof n.scheduler?.yield == "function" ? n.scheduler.yield() : typeof n.setImmediate == "function" ? new Promise((e) => n.setImmediate(() => e())) : typeof n.MessageChannel == "function" ? new Promise((e) => {
|
|
3321
|
+
const t = new n.MessageChannel();
|
|
3322
|
+
t.port1.onmessage = () => {
|
|
3323
|
+
t.port1.close(), e();
|
|
3324
|
+
}, t.port2.postMessage(null);
|
|
3325
|
+
}) : new Promise((e) => setTimeout(e, 0));
|
|
3326
|
+
}
|
|
3327
|
+
class ft {
|
|
3025
3328
|
scripts = /* @__PURE__ */ new Map();
|
|
3026
3329
|
scriptFunctions = /* @__PURE__ */ new Map();
|
|
3027
3330
|
constructor() {
|
|
@@ -3060,14 +3363,14 @@ class He {
|
|
|
3060
3363
|
if (!this.getScript(e))
|
|
3061
3364
|
throw new Error(`Script ${e} not found`);
|
|
3062
3365
|
r.context || (r.context = r.options || {});
|
|
3063
|
-
const i = Object.keys(r),
|
|
3064
|
-
return this.getScriptAsFn(e, i)(t, ...
|
|
3366
|
+
const i = Object.keys(r), o = Object.values(r);
|
|
3367
|
+
return this.getScriptAsFn(e, i)(t, ...o);
|
|
3065
3368
|
}
|
|
3066
3369
|
}
|
|
3067
|
-
const
|
|
3370
|
+
const dt = (n, e) => n ? (e || (e = {}), n.replace(/\$\{(.*?)\}/g, (t, r) => I(e, r.trim(), ""))) : "", lt = (n) => {
|
|
3068
3371
|
const e = /* @__PURE__ */ new Set();
|
|
3069
|
-
return
|
|
3070
|
-
},
|
|
3372
|
+
return n.replace(/\$\{(.*?)\}/g, (r, s) => (e.add(s.trim()), "")), { variables: Array.from(e).map((r) => ({ name: r })) };
|
|
3373
|
+
}, ht = [
|
|
3071
3374
|
"any",
|
|
3072
3375
|
"Array<date>",
|
|
3073
3376
|
"Array<float>",
|
|
@@ -3079,8 +3382,9 @@ const Ue = (o, e) => o ? (e || (e = {}), o.replace(/\$\{(.*?)\}/g, (t, r) => y(e
|
|
|
3079
3382
|
"int",
|
|
3080
3383
|
"json",
|
|
3081
3384
|
"string"
|
|
3082
|
-
],
|
|
3385
|
+
], pt = ["int", "float", "Array<int>", "Array<float>"], gt = ["date", "Array<date>"], yt = [
|
|
3083
3386
|
"eq",
|
|
3387
|
+
"in",
|
|
3084
3388
|
"find",
|
|
3085
3389
|
"gt",
|
|
3086
3390
|
"gte",
|
|
@@ -3091,57 +3395,67 @@ const Ue = (o, e) => o ? (e || (e = {}), o.replace(/\$\{(.*?)\}/g, (t, r) => y(e
|
|
|
3091
3395
|
"size"
|
|
3092
3396
|
];
|
|
3093
3397
|
export {
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3398
|
+
qe as AUTHORED_RESOURCE_ID_PREFIX,
|
|
3399
|
+
Fe as AnalyticsController,
|
|
3400
|
+
Ge as AttributeDependencyGraph,
|
|
3401
|
+
_e as CacheController,
|
|
3402
|
+
He as ChangeDetector,
|
|
3403
|
+
Re as DERIVED_RESOURCE_ID_PREFIX,
|
|
3404
|
+
gt as DatePropertyTypes,
|
|
3405
|
+
L as DcuplQueryBuilder,
|
|
3406
|
+
yt as DcuplQueryOperatorsAsArray,
|
|
3101
3407
|
de as DeepQueryService,
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3408
|
+
X as DependencyGraph,
|
|
3409
|
+
xe as IndicesController,
|
|
3410
|
+
g as Logger,
|
|
3411
|
+
pt as NumberPropertyTypes,
|
|
3412
|
+
ht as PropertyTypesAsArray,
|
|
3413
|
+
ot as QueryManager,
|
|
3414
|
+
ft as ScriptController,
|
|
3415
|
+
B as clone,
|
|
3416
|
+
Ke as coerceStringType,
|
|
3110
3417
|
re as compareVersions,
|
|
3111
|
-
|
|
3112
|
-
|
|
3418
|
+
Ze as computeSuggestions,
|
|
3419
|
+
m as deepQueryService,
|
|
3113
3420
|
te as escapeRegExp,
|
|
3114
|
-
|
|
3115
|
-
|
|
3421
|
+
dt as evaluateTemplate,
|
|
3422
|
+
rt as generateBooleanQuery,
|
|
3116
3423
|
ee as generateKey,
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3424
|
+
st as generateNumberAndDateQuery,
|
|
3425
|
+
nt as generateReferenceQuery,
|
|
3426
|
+
tt as generateTextQuery,
|
|
3427
|
+
C as getAggregation,
|
|
3428
|
+
Pe as getDateConstraintUid,
|
|
3429
|
+
$e as getDcuplPropertyTypeForNativeType,
|
|
3430
|
+
w as getDeepPathValues,
|
|
3431
|
+
me as getDistinct,
|
|
3432
|
+
Ye as getFacets,
|
|
3433
|
+
ze as getFilterEntryId,
|
|
3434
|
+
je as getNumberConstraintUid,
|
|
3435
|
+
et as getPropertiesForData,
|
|
3436
|
+
Le as groupBy,
|
|
3437
|
+
Ve as hasMinimumVersion,
|
|
3438
|
+
Ne as inferModel,
|
|
3131
3439
|
se as isDateInstance,
|
|
3132
|
-
|
|
3133
|
-
|
|
3440
|
+
Ce as isFloat,
|
|
3441
|
+
Ee as isInt,
|
|
3134
3442
|
ne as isValidDate,
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3443
|
+
it as isValidQueryStatement,
|
|
3444
|
+
T as isValidVersion,
|
|
3445
|
+
Y as logger,
|
|
3446
|
+
ke as looksDateLike,
|
|
3447
|
+
Xe as parseDate,
|
|
3448
|
+
P as parseRegexLiteral,
|
|
3449
|
+
lt as parseTemplate,
|
|
3450
|
+
b as perf,
|
|
3451
|
+
U as pivot,
|
|
3452
|
+
at as redactUrl,
|
|
3453
|
+
Ue as removeTrailingSlash,
|
|
3454
|
+
Q as resolveResourceId,
|
|
3455
|
+
ct as resolveResourceIds,
|
|
3456
|
+
Je as trigger,
|
|
3457
|
+
We as unescapeRegExp,
|
|
3458
|
+
Be as uniqBy,
|
|
3459
|
+
ut as yieldToEventLoop
|
|
3146
3460
|
};
|
|
3147
3461
|
//# sourceMappingURL=index.js.map
|