@sisense/sdk-ui 2.17.0 → 2.18.0
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/ai.cjs +2 -2
- package/dist/ai.js +6 -6
- package/dist/analytics-composer/node.cjs +1 -1
- package/dist/analytics-composer/node.js +515 -454
- package/dist/analytics-composer.cjs +1 -1
- package/dist/analytics-composer.js +6 -6
- package/dist/{derive-chart-family-DkuTQGOE.js → derive-chart-family-BEjUaaLD.js} +398 -390
- package/dist/{derive-chart-family-B_cR1yhw.cjs → derive-chart-family-C3PTAfzX.cjs} +13 -13
- package/dist/{dimensions-Gma5tFmd.js → dimensions-CETtX6B1.js} +1 -1
- package/dist/{dimensions-DI9h9IJH.cjs → dimensions-_D0C3KY2.cjs} +1 -1
- package/dist/{execute-query-l7jejslh.js → execute-query-CUf3Nz7H.js} +86 -87
- package/dist/execute-query-tRu-NooT.cjs +1 -0
- package/dist/index.cjs +424 -424
- package/dist/index.js +15791 -16145
- package/dist/index.umd.js +605 -605
- package/dist/packages/sdk-ui/src/analytics-composer/nlq-v3-translator/common.d.ts +25 -3
- package/dist/packages/sdk-ui/src/analytics-composer/nlq-v3-translator/types.d.ts +22 -10
- package/dist/packages/sdk-ui/src/chart-options-processor/data-points.d.ts +3 -2
- package/dist/packages/sdk-ui/src/common-filters/utils.d.ts +19 -0
- package/dist/packages/sdk-ui/src/dashboard/components/editable-layout/components/editable-layout-row.d.ts +11 -0
- package/dist/packages/sdk-ui/src/dashboard/hooks/index.d.ts +12 -0
- package/dist/packages/sdk-ui/src/dashboard/utils.d.ts +15 -0
- package/dist/packages/sdk-ui/src/filters/components/member-filter-tile/index.d.ts +0 -1
- package/dist/packages/sdk-ui/src/filters/components/member-filter-tile/member-list.d.ts +5 -0
- package/dist/packages/sdk-ui/src/filters/components/member-filter-tile/pill-section.d.ts +1 -2
- package/dist/packages/sdk-ui/src/filters/hooks/use-get-filter-members.d.ts +6 -0
- package/dist/packages/sdk-ui/src/models/widget/widget-model.d.ts +2 -2
- package/dist/packages/sdk-ui/src/props.d.ts +15 -7
- package/dist/packages/sdk-ui/src/query/date-formats/fiscal-date-format-replacers.d.ts +1 -0
- package/dist/packages/sdk-ui/src/query-execution/types.d.ts +6 -0
- package/dist/packages/sdk-ui/src/types.d.ts +62 -8
- package/dist/packages/sdk-ui/src/utils/data-option-location/get-data-option-by-location.d.ts +43 -0
- package/dist/packages/sdk-ui/src/utils/data-option-location/get-data-option-location.d.ts +46 -0
- package/dist/packages/sdk-ui/src/utils/data-option-location/index.d.ts +3 -0
- package/dist/packages/sdk-ui/src/utils/data-option-location/set-data-option-at-location.d.ts +39 -0
- package/dist/packages/sdk-ui/src/widget-by-id/translate-widget-drilldown-options.d.ts +2 -2
- package/dist/packages/sdk-ui/src/widget-by-id/translate-widget-style-options/tabber.d.ts +3 -3
- package/dist/packages/sdk-ui/src/widget-by-id/types.d.ts +34 -7
- package/dist/packages/sdk-ui/src/widgets/{chart-widget.d.ts → chart-widget/chart-widget.d.ts} +1 -1
- package/dist/packages/sdk-ui/src/widgets/chart-widget/index.d.ts +1 -0
- package/dist/packages/sdk-ui/src/widgets/{hooks/use-with-drilldown.d.ts → chart-widget/use-with-chart-widget-drilldown.d.ts} +4 -3
- package/dist/packages/sdk-ui/src/widgets/common/use-drilldown-core.d.ts +1 -1
- package/dist/packages/sdk-ui/src/widgets/hooks/use-drilldown.d.ts +4 -3
- package/dist/packages/sdk-ui/src/widgets/hooks/use-synced-drilldown-paths-manager.d.ts +113 -0
- package/dist/packages/sdk-ui/src/widgets/hooks/{use-synced-hierarchies.d.ts → use-synced-drilldown-paths.d.ts} +1 -1
- package/dist/packages/sdk-ui/src/widgets/pivot-table-widget/index.d.ts +1 -0
- package/dist/packages/sdk-ui/src/widgets/{pivot-table-widget.d.ts → pivot-table-widget/pivot-table-widget.d.ts} +1 -1
- package/dist/packages/sdk-ui/src/widgets/pivot-table-widget/use-with-pivot-table-widget-drilldown.d.ts +14 -0
- package/dist/packages/sdk-ui/src/widgets/pivot-table-widget/utils.d.ts +22 -0
- package/dist/packages/sdk-ui/src/widgets/tabber/tabber-buttons-widget.d.ts +19 -1
- package/dist/packages/sdk-ui/src/widgets/tabber/types.d.ts +22 -5
- package/dist/{types-Hki4GrUY.cjs → types-BfWl5jz9.cjs} +1 -1
- package/dist/{types-ofTjqFFK.js → types-CHqDjeeH.js} +1 -1
- package/dist/{use-common-filters-Bh4KYWy_.cjs → use-common-filters-BGLYpqmt.cjs} +108 -108
- package/dist/{use-common-filters-D5yiZCTg.js → use-common-filters-BhFFlOqU.js} +7662 -7541
- package/dist/{widget-composer-By61s921.js → widget-composer-Cuky3UiC.js} +3 -3
- package/dist/{widget-composer-BzzTf8UH.cjs → widget-composer-DsBF8OC2.cjs} +1 -1
- package/package.json +8 -8
- package/dist/execute-query-CdhSHTTA.cjs +0 -1
- package/dist/packages/sdk-ui/src/filters/components/member-filter-tile/basic-member-filter-tile.d.ts +0 -56
- package/dist/packages/sdk-ui/src/filters/components/member-filter-tile/use-members.d.ts +0 -14
- package/dist/packages/sdk-ui/src/filters/components/member-filter-tile/use-validate-members.d.ts +0 -8
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
1
|
+
var _e = Object.defineProperty, Ve = Object.defineProperties;
|
|
2
|
+
var Ue = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var le = Object.getOwnPropertySymbols;
|
|
4
|
+
var We = Object.prototype.hasOwnProperty, Je = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var ce = (e, r, t) => r in e ? _e(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t, b = (e, r) => {
|
|
6
6
|
for (var t in r || (r = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var t of
|
|
10
|
-
|
|
7
|
+
We.call(r, t) && ce(e, t, r[t]);
|
|
8
|
+
if (le)
|
|
9
|
+
for (var t of le(r))
|
|
10
|
+
Je.call(r, t) && ce(e, t, r[t]);
|
|
11
11
|
return e;
|
|
12
|
-
}, q = (e, r) =>
|
|
13
|
-
import { f as
|
|
14
|
-
import { b as oi, E as ui, a as li, i as ci, e as fi, d as di } from "../types-
|
|
15
|
-
import {
|
|
16
|
-
import { i as
|
|
17
|
-
class
|
|
12
|
+
}, q = (e, r) => Ve(e, Ue(r));
|
|
13
|
+
import { f as je, J as Ke } from "../types-CHqDjeeH.js";
|
|
14
|
+
import { b as oi, E as ui, a as li, i as ci, e as fi, d as di } from "../types-CHqDjeeH.js";
|
|
15
|
+
import { bW as Qe, bA as Ye, bX as ve, bY as He, bZ as Ge, aw as X, b_ as Xe, av as Ze, b$ as er, b7 as rr, ax as tr, c0 as ir, ba as sr, b8 as nr, aK as ar, b6 as or, b9 as ur, e as lr, d as cr, l as fr, c1 as dr, c2 as mr, c3 as pr, c4 as yr, c5 as gr, c6 as hr, c7 as br, c8 as Fr, c9 as wr, ca as qr, cb as Er, au as xr, cc as Ar, cd as Cr, S as $r, i as Dr, s as Z, c as _, M as S, ce as Mr, cf as Rr, cg as Nr, ch as Tr, aG as Sr, an as fe, am as zr, ci as Ir, x as Or, w as Br } from "../execute-query-CUf3Nz7H.js";
|
|
16
|
+
import { i as Pr, b as kr, D as Lr, d as _r, a as Vr } from "../dimensions-CETtX6B1.js";
|
|
17
|
+
class Ur {
|
|
18
18
|
constructor() {
|
|
19
19
|
this.keyToValue = /* @__PURE__ */ new Map(), this.valueToKey = /* @__PURE__ */ new Map();
|
|
20
20
|
}
|
|
@@ -31,9 +31,9 @@ class Jr {
|
|
|
31
31
|
this.keyToValue.clear(), this.valueToKey.clear();
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
class
|
|
34
|
+
class he {
|
|
35
35
|
constructor(r) {
|
|
36
|
-
this.generateIdentifier = r, this.kv = new
|
|
36
|
+
this.generateIdentifier = r, this.kv = new Ur();
|
|
37
37
|
}
|
|
38
38
|
register(r, t) {
|
|
39
39
|
this.kv.getByValue(r) || (t || (t = this.generateIdentifier(r)), this.kv.set(t, r));
|
|
@@ -48,7 +48,7 @@ class be {
|
|
|
48
48
|
return this.kv.getByKey(r);
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
class
|
|
51
|
+
class Wr extends he {
|
|
52
52
|
constructor() {
|
|
53
53
|
super((r) => r.name), this.classToAllowedProps = /* @__PURE__ */ new Map();
|
|
54
54
|
}
|
|
@@ -59,7 +59,7 @@ class jr extends be {
|
|
|
59
59
|
return this.classToAllowedProps.get(r);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function Jr(e) {
|
|
63
63
|
if ("values" in Object)
|
|
64
64
|
return Object.values(e);
|
|
65
65
|
const r = [];
|
|
@@ -67,8 +67,8 @@ function Wr(e) {
|
|
|
67
67
|
e.hasOwnProperty(t) && r.push(e[t]);
|
|
68
68
|
return r;
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
const t =
|
|
70
|
+
function jr(e, r) {
|
|
71
|
+
const t = Jr(e);
|
|
72
72
|
if ("find" in t)
|
|
73
73
|
return t.find(r);
|
|
74
74
|
const i = t;
|
|
@@ -78,20 +78,20 @@ function Kr(e, r) {
|
|
|
78
78
|
return a;
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function z(e, r) {
|
|
82
82
|
Object.entries(e).forEach(([t, i]) => r(i, t));
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function V(e, r) {
|
|
85
85
|
return e.indexOf(r) !== -1;
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function de(e, r) {
|
|
88
88
|
for (let t = 0; t < e.length; t++) {
|
|
89
89
|
const i = e[t];
|
|
90
90
|
if (r(i))
|
|
91
91
|
return i;
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
-
class
|
|
94
|
+
class Kr {
|
|
95
95
|
constructor() {
|
|
96
96
|
this.transfomers = {};
|
|
97
97
|
}
|
|
@@ -99,13 +99,13 @@ class Qr {
|
|
|
99
99
|
this.transfomers[r.name] = r;
|
|
100
100
|
}
|
|
101
101
|
findApplicable(r) {
|
|
102
|
-
return
|
|
102
|
+
return jr(this.transfomers, (t) => t.isApplicable(r));
|
|
103
103
|
}
|
|
104
104
|
findByName(r) {
|
|
105
105
|
return this.transfomers[r];
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
const
|
|
108
|
+
const Qr = (e) => Object.prototype.toString.call(e).slice(8, -1), be = (e) => typeof e == "undefined", Yr = (e) => e === null, B = (e) => typeof e != "object" || e === null || e === Object.prototype ? !1 : Object.getPrototypeOf(e) === null ? !0 : Object.getPrototypeOf(e) === Object.prototype, Y = (e) => B(e) && Object.keys(e).length === 0, $ = (e) => Array.isArray(e), vr = (e) => typeof e == "string", Hr = (e) => typeof e == "number" && !isNaN(e), Gr = (e) => typeof e == "boolean", Xr = (e) => e instanceof RegExp, P = (e) => e instanceof Map, k = (e) => e instanceof Set, Fe = (e) => Qr(e) === "Symbol", Zr = (e) => e instanceof Date && !isNaN(e.valueOf()), et = (e) => e instanceof Error, me = (e) => typeof e == "number" && isNaN(e), rt = (e) => Gr(e) || Yr(e) || be(e) || Hr(e) || vr(e) || Fe(e), tt = (e) => typeof e == "bigint", it = (e) => e === 1 / 0 || e === -1 / 0, st = (e) => ArrayBuffer.isView(e) && !(e instanceof DataView), nt = (e) => e instanceof URL, we = (e) => e.replace(/\./g, "\\."), j = (e) => e.map(String).map(we).join("."), O = (e) => {
|
|
109
109
|
const r = [];
|
|
110
110
|
let t = "";
|
|
111
111
|
for (let s = 0; s < e.length; s++) {
|
|
@@ -123,7 +123,7 @@ const Yr = (e) => Object.prototype.toString.call(e).slice(8, -1), he = (e) => ty
|
|
|
123
123
|
const i = t;
|
|
124
124
|
return r.push(i), r;
|
|
125
125
|
};
|
|
126
|
-
function
|
|
126
|
+
function x(e, r, t, i) {
|
|
127
127
|
return {
|
|
128
128
|
isApplicable: e,
|
|
129
129
|
annotation: r,
|
|
@@ -131,12 +131,12 @@ function E(e, r, t, i) {
|
|
|
131
131
|
untransform: i
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
|
-
const
|
|
135
|
-
|
|
134
|
+
const qe = [
|
|
135
|
+
x(be, "undefined", () => null, () => {
|
|
136
136
|
}),
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
137
|
+
x(tt, "bigint", (e) => e.toString(), (e) => typeof BigInt != "undefined" ? BigInt(e) : (console.error("Please add a BigInt polyfill."), e)),
|
|
138
|
+
x(Zr, "Date", (e) => e.toISOString(), (e) => new Date(e)),
|
|
139
|
+
x(et, "Error", (e, r) => {
|
|
140
140
|
const t = {
|
|
141
141
|
name: e.name,
|
|
142
142
|
message: e.message
|
|
@@ -150,24 +150,24 @@ const we = [
|
|
|
150
150
|
t[i] = e[i];
|
|
151
151
|
}), t;
|
|
152
152
|
}),
|
|
153
|
-
|
|
153
|
+
x(Xr, "regexp", (e) => "" + e, (e) => {
|
|
154
154
|
const r = e.slice(1, e.lastIndexOf("/")), t = e.slice(e.lastIndexOf("/") + 1);
|
|
155
155
|
return new RegExp(r, t);
|
|
156
156
|
}),
|
|
157
|
-
|
|
158
|
-
|
|
157
|
+
x(
|
|
158
|
+
k,
|
|
159
159
|
"set",
|
|
160
160
|
// (sets only exist in es6+)
|
|
161
161
|
// eslint-disable-next-line es5/no-es6-methods
|
|
162
162
|
(e) => [...e.values()],
|
|
163
163
|
(e) => new Set(e)
|
|
164
164
|
),
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
165
|
+
x(P, "map", (e) => [...e.entries()], (e) => new Map(e)),
|
|
166
|
+
x((e) => me(e) || it(e), "number", (e) => me(e) ? "NaN" : e > 0 ? "Infinity" : "-Infinity", Number),
|
|
167
|
+
x((e) => e === 0 && 1 / e === -1 / 0, "number", () => "-0", Number),
|
|
168
|
+
x(nt, "URL", (e) => e.toString(), (e) => new URL(e))
|
|
169
169
|
];
|
|
170
|
-
function
|
|
170
|
+
function U(e, r, t, i) {
|
|
171
171
|
return {
|
|
172
172
|
isApplicable: e,
|
|
173
173
|
annotation: r,
|
|
@@ -175,12 +175,12 @@ function V(e, r, t, i) {
|
|
|
175
175
|
untransform: i
|
|
176
176
|
};
|
|
177
177
|
}
|
|
178
|
-
const Ee =
|
|
178
|
+
const Ee = U((e, r) => Fe(e) ? !!r.symbolRegistry.getIdentifier(e) : !1, (e, r) => ["symbol", r.symbolRegistry.getIdentifier(e)], (e) => e.description, (e, r, t) => {
|
|
179
179
|
const i = t.symbolRegistry.getValue(r[1]);
|
|
180
180
|
if (!i)
|
|
181
181
|
throw new Error("Trying to deserialize unknown symbol");
|
|
182
182
|
return i;
|
|
183
|
-
}),
|
|
183
|
+
}), at = [
|
|
184
184
|
Int8Array,
|
|
185
185
|
Uint8Array,
|
|
186
186
|
Int16Array,
|
|
@@ -190,19 +190,19 @@ const Ee = V((e, r) => Fe(e) ? !!r.symbolRegistry.getIdentifier(e) : !1, (e, r)
|
|
|
190
190
|
Float32Array,
|
|
191
191
|
Float64Array,
|
|
192
192
|
Uint8ClampedArray
|
|
193
|
-
].reduce((e, r) => (e[r.name] = r, e), {}),
|
|
194
|
-
const t =
|
|
193
|
+
].reduce((e, r) => (e[r.name] = r, e), {}), xe = U(st, (e) => ["typed-array", e.constructor.name], (e) => [...e], (e, r) => {
|
|
194
|
+
const t = at[r[1]];
|
|
195
195
|
if (!t)
|
|
196
196
|
throw new Error("Trying to deserialize unknown typed array");
|
|
197
197
|
return new t(e);
|
|
198
198
|
});
|
|
199
|
-
function
|
|
199
|
+
function Ae(e, r) {
|
|
200
200
|
return e != null && e.constructor ? !!r.classRegistry.getIdentifier(e.constructor) : !1;
|
|
201
201
|
}
|
|
202
|
-
const Ce =
|
|
202
|
+
const Ce = U(Ae, (e, r) => ["class", r.classRegistry.getIdentifier(e.constructor)], (e, r) => {
|
|
203
203
|
const t = r.classRegistry.getAllowedProps(e.constructor);
|
|
204
204
|
if (!t)
|
|
205
|
-
return
|
|
205
|
+
return b({}, e);
|
|
206
206
|
const i = {};
|
|
207
207
|
return t.forEach((s) => {
|
|
208
208
|
i[s] = e[s];
|
|
@@ -212,29 +212,29 @@ const Ce = V(xe, (e, r) => ["class", r.classRegistry.getIdentifier(e.constructor
|
|
|
212
212
|
if (!i)
|
|
213
213
|
throw new Error(`Trying to deserialize unknown class '${r[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);
|
|
214
214
|
return Object.assign(Object.create(i.prototype), e);
|
|
215
|
-
}), $e =
|
|
215
|
+
}), $e = U((e, r) => !!r.customTransformerRegistry.findApplicable(e), (e, r) => ["custom", r.customTransformerRegistry.findApplicable(e).name], (e, r) => r.customTransformerRegistry.findApplicable(e).serialize(e), (e, r, t) => {
|
|
216
216
|
const i = t.customTransformerRegistry.findByName(r[1]);
|
|
217
217
|
if (!i)
|
|
218
218
|
throw new Error("Trying to deserialize unknown custom value");
|
|
219
219
|
return i.deserialize(e);
|
|
220
|
-
}),
|
|
221
|
-
const t =
|
|
220
|
+
}), ot = [Ce, Ee, $e, xe], pe = (e, r) => {
|
|
221
|
+
const t = de(ot, (s) => s.isApplicable(e, r));
|
|
222
222
|
if (t)
|
|
223
223
|
return {
|
|
224
224
|
value: t.transform(e, r),
|
|
225
225
|
type: t.annotation(e, r)
|
|
226
226
|
};
|
|
227
|
-
const i =
|
|
227
|
+
const i = de(qe, (s) => s.isApplicable(e, r));
|
|
228
228
|
if (i)
|
|
229
229
|
return {
|
|
230
230
|
value: i.transform(e, r),
|
|
231
231
|
type: i.annotation
|
|
232
232
|
};
|
|
233
233
|
}, De = {};
|
|
234
|
-
|
|
234
|
+
qe.forEach((e) => {
|
|
235
235
|
De[e.annotation] = e;
|
|
236
236
|
});
|
|
237
|
-
const
|
|
237
|
+
const ut = (e, r, t) => {
|
|
238
238
|
if ($(r))
|
|
239
239
|
switch (r[0]) {
|
|
240
240
|
case "symbol":
|
|
@@ -244,7 +244,7 @@ const lt = (e, r, t) => {
|
|
|
244
244
|
case "custom":
|
|
245
245
|
return $e.untransform(e, r, t);
|
|
246
246
|
case "typed-array":
|
|
247
|
-
return
|
|
247
|
+
return xe.untransform(e, r, t);
|
|
248
248
|
default:
|
|
249
249
|
throw new Error("Unknown transformation: " + r);
|
|
250
250
|
}
|
|
@@ -254,7 +254,7 @@ const lt = (e, r, t) => {
|
|
|
254
254
|
throw new Error("Unknown transformation: " + r);
|
|
255
255
|
return i.untransform(e, t);
|
|
256
256
|
}
|
|
257
|
-
},
|
|
257
|
+
}, T = (e, r) => {
|
|
258
258
|
if (r > e.size)
|
|
259
259
|
throw new Error("index out of bounds");
|
|
260
260
|
const t = e.keys();
|
|
@@ -263,21 +263,21 @@ const lt = (e, r, t) => {
|
|
|
263
263
|
return t.next().value;
|
|
264
264
|
};
|
|
265
265
|
function Me(e) {
|
|
266
|
-
if (
|
|
266
|
+
if (V(e, "__proto__"))
|
|
267
267
|
throw new Error("__proto__ is not allowed as a property");
|
|
268
|
-
if (
|
|
268
|
+
if (V(e, "prototype"))
|
|
269
269
|
throw new Error("prototype is not allowed as a property");
|
|
270
|
-
if (
|
|
270
|
+
if (V(e, "constructor"))
|
|
271
271
|
throw new Error("constructor is not allowed as a property");
|
|
272
272
|
}
|
|
273
|
-
const
|
|
273
|
+
const lt = (e, r) => {
|
|
274
274
|
Me(r);
|
|
275
275
|
for (let t = 0; t < r.length; t++) {
|
|
276
276
|
const i = r[t];
|
|
277
|
-
if (
|
|
278
|
-
e =
|
|
279
|
-
else if (
|
|
280
|
-
const s = +i, a = +r[++t] == 0 ? "key" : "value", n =
|
|
277
|
+
if (k(e))
|
|
278
|
+
e = T(e, +i);
|
|
279
|
+
else if (P(e)) {
|
|
280
|
+
const s = +i, a = +r[++t] == 0 ? "key" : "value", n = T(e, s);
|
|
281
281
|
switch (a) {
|
|
282
282
|
case "key":
|
|
283
283
|
e = n;
|
|
@@ -290,7 +290,7 @@ const ct = (e, r) => {
|
|
|
290
290
|
e = e[i];
|
|
291
291
|
}
|
|
292
292
|
return e;
|
|
293
|
-
},
|
|
293
|
+
}, v = (e, r, t) => {
|
|
294
294
|
if (Me(r), r.length === 0)
|
|
295
295
|
return t(e);
|
|
296
296
|
let i = e;
|
|
@@ -299,32 +299,32 @@ const ct = (e, r) => {
|
|
|
299
299
|
if ($(i)) {
|
|
300
300
|
const o = +n;
|
|
301
301
|
i = i[o];
|
|
302
|
-
} else if (
|
|
302
|
+
} else if (B(i))
|
|
303
303
|
i = i[n];
|
|
304
|
-
else if (
|
|
304
|
+
else if (k(i)) {
|
|
305
305
|
const o = +n;
|
|
306
|
-
i =
|
|
307
|
-
} else if (
|
|
306
|
+
i = T(i, o);
|
|
307
|
+
} else if (P(i)) {
|
|
308
308
|
if (a === r.length - 2)
|
|
309
309
|
break;
|
|
310
|
-
const u = +n, c = +r[++a] == 0 ? "key" : "value",
|
|
310
|
+
const u = +n, c = +r[++a] == 0 ? "key" : "value", p = T(i, u);
|
|
311
311
|
switch (c) {
|
|
312
312
|
case "key":
|
|
313
|
-
i =
|
|
313
|
+
i = p;
|
|
314
314
|
break;
|
|
315
315
|
case "value":
|
|
316
|
-
i = i.get(
|
|
316
|
+
i = i.get(p);
|
|
317
317
|
break;
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
321
|
const s = r[r.length - 1];
|
|
322
|
-
if ($(i) ? i[+s] = t(i[+s]) :
|
|
323
|
-
const a =
|
|
322
|
+
if ($(i) ? i[+s] = t(i[+s]) : B(i) && (i[s] = t(i[s])), k(i)) {
|
|
323
|
+
const a = T(i, +s), n = t(a);
|
|
324
324
|
a !== n && (i.delete(a), i.add(n));
|
|
325
325
|
}
|
|
326
|
-
if (
|
|
327
|
-
const a = +r[r.length - 2], n =
|
|
326
|
+
if (P(i)) {
|
|
327
|
+
const a = +r[r.length - 2], n = T(i, a);
|
|
328
328
|
switch (+s == 0 ? "key" : "value") {
|
|
329
329
|
case "key": {
|
|
330
330
|
const u = t(n);
|
|
@@ -339,45 +339,45 @@ const ct = (e, r) => {
|
|
|
339
339
|
}
|
|
340
340
|
return e;
|
|
341
341
|
};
|
|
342
|
-
function
|
|
342
|
+
function H(e, r, t = []) {
|
|
343
343
|
if (!e)
|
|
344
344
|
return;
|
|
345
345
|
if (!$(e)) {
|
|
346
|
-
|
|
346
|
+
z(e, (a, n) => H(a, r, [...t, ...O(n)]));
|
|
347
347
|
return;
|
|
348
348
|
}
|
|
349
349
|
const [i, s] = e;
|
|
350
|
-
s &&
|
|
351
|
-
|
|
350
|
+
s && z(s, (a, n) => {
|
|
351
|
+
H(a, r, [...t, ...O(n)]);
|
|
352
352
|
}), r(i, t);
|
|
353
353
|
}
|
|
354
|
-
function
|
|
355
|
-
return
|
|
356
|
-
e =
|
|
354
|
+
function ct(e, r, t) {
|
|
355
|
+
return H(r, (i, s) => {
|
|
356
|
+
e = v(e, s, (a) => ut(a, i, t));
|
|
357
357
|
}), e;
|
|
358
358
|
}
|
|
359
|
-
function
|
|
359
|
+
function ft(e, r) {
|
|
360
360
|
function t(i, s) {
|
|
361
|
-
const a =
|
|
362
|
-
i.map(
|
|
363
|
-
e =
|
|
361
|
+
const a = lt(e, O(s));
|
|
362
|
+
i.map(O).forEach((n) => {
|
|
363
|
+
e = v(e, n, () => a);
|
|
364
364
|
});
|
|
365
365
|
}
|
|
366
366
|
if ($(r)) {
|
|
367
367
|
const [i, s] = r;
|
|
368
368
|
i.forEach((a) => {
|
|
369
|
-
e =
|
|
370
|
-
}), s &&
|
|
369
|
+
e = v(e, O(a), () => e);
|
|
370
|
+
}), s && z(s, t);
|
|
371
371
|
} else
|
|
372
|
-
|
|
372
|
+
z(r, t);
|
|
373
373
|
return e;
|
|
374
374
|
}
|
|
375
|
-
const
|
|
376
|
-
function
|
|
375
|
+
const dt = (e, r) => B(e) || $(e) || P(e) || k(e) || Ae(e, r);
|
|
376
|
+
function mt(e, r, t) {
|
|
377
377
|
const i = t.get(e);
|
|
378
378
|
i ? i.push(r) : t.set(e, [r]);
|
|
379
379
|
}
|
|
380
|
-
function
|
|
380
|
+
function pt(e, r) {
|
|
381
381
|
const t = {};
|
|
382
382
|
let i;
|
|
383
383
|
return e.forEach((s) => {
|
|
@@ -385,50 +385,50 @@ function mt(e, r) {
|
|
|
385
385
|
return;
|
|
386
386
|
r || (s = s.map((o) => o.map(String)).sort((o, u) => o.length - u.length));
|
|
387
387
|
const [a, ...n] = s;
|
|
388
|
-
a.length === 0 ? i = n.map(
|
|
388
|
+
a.length === 0 ? i = n.map(j) : t[j(a)] = n.map(j);
|
|
389
389
|
}), i ? Y(t) ? [i] : [i, t] : Y(t) ? void 0 : t;
|
|
390
390
|
}
|
|
391
391
|
const Re = (e, r, t, i, s = [], a = [], n = /* @__PURE__ */ new Map()) => {
|
|
392
|
-
var
|
|
393
|
-
const o =
|
|
392
|
+
var y;
|
|
393
|
+
const o = rt(e);
|
|
394
394
|
if (!o) {
|
|
395
|
-
|
|
396
|
-
const
|
|
397
|
-
if (
|
|
395
|
+
mt(e, s, r);
|
|
396
|
+
const d = n.get(e);
|
|
397
|
+
if (d)
|
|
398
398
|
return i ? {
|
|
399
399
|
transformedValue: null
|
|
400
|
-
} :
|
|
400
|
+
} : d;
|
|
401
401
|
}
|
|
402
|
-
if (!
|
|
403
|
-
const
|
|
404
|
-
transformedValue:
|
|
405
|
-
annotations: [
|
|
402
|
+
if (!dt(e, t)) {
|
|
403
|
+
const d = pe(e, t), g = d ? {
|
|
404
|
+
transformedValue: d.value,
|
|
405
|
+
annotations: [d.type]
|
|
406
406
|
} : {
|
|
407
407
|
transformedValue: e
|
|
408
408
|
};
|
|
409
|
-
return o || n.set(e,
|
|
409
|
+
return o || n.set(e, g), g;
|
|
410
410
|
}
|
|
411
|
-
if (
|
|
411
|
+
if (V(a, e))
|
|
412
412
|
return {
|
|
413
413
|
transformedValue: null
|
|
414
414
|
};
|
|
415
|
-
const u = pe(e, t), c = (
|
|
416
|
-
|
|
417
|
-
if (
|
|
418
|
-
throw new Error(`Detected property ${
|
|
419
|
-
const C = Re(
|
|
420
|
-
|
|
421
|
-
|
|
415
|
+
const u = pe(e, t), c = (y = u == null ? void 0 : u.value) != null ? y : e, p = $(c) ? [] : {}, f = {};
|
|
416
|
+
z(c, (d, g) => {
|
|
417
|
+
if (g === "__proto__" || g === "constructor" || g === "prototype")
|
|
418
|
+
throw new Error(`Detected property ${g}. This is a prototype pollution risk, please remove it from your object.`);
|
|
419
|
+
const C = Re(d, r, t, i, [...s, g], [...a, e], n);
|
|
420
|
+
p[g] = C.transformedValue, $(C.annotations) ? f[g] = C.annotations : B(C.annotations) && z(C.annotations, (I, N) => {
|
|
421
|
+
f[we(g) + "." + N] = I;
|
|
422
422
|
});
|
|
423
423
|
});
|
|
424
|
-
const
|
|
425
|
-
transformedValue:
|
|
424
|
+
const m = Y(f) ? {
|
|
425
|
+
transformedValue: p,
|
|
426
426
|
annotations: u ? [u.type] : void 0
|
|
427
427
|
} : {
|
|
428
|
-
transformedValue:
|
|
429
|
-
annotations: u ? [u.type,
|
|
428
|
+
transformedValue: p,
|
|
429
|
+
annotations: u ? [u.type, f] : f
|
|
430
430
|
};
|
|
431
|
-
return o || n.set(e,
|
|
431
|
+
return o || n.set(e, m), m;
|
|
432
432
|
};
|
|
433
433
|
function Ne(e) {
|
|
434
434
|
return Object.prototype.toString.call(e).slice(8, -1);
|
|
@@ -436,13 +436,13 @@ function Ne(e) {
|
|
|
436
436
|
function ye(e) {
|
|
437
437
|
return Ne(e) === "Array";
|
|
438
438
|
}
|
|
439
|
-
function
|
|
439
|
+
function yt(e) {
|
|
440
440
|
if (Ne(e) !== "Object")
|
|
441
441
|
return !1;
|
|
442
442
|
const r = Object.getPrototypeOf(e);
|
|
443
443
|
return !!r && r.constructor === Object && r === Object.prototype;
|
|
444
444
|
}
|
|
445
|
-
function
|
|
445
|
+
function gt(e, r, t, i, s) {
|
|
446
446
|
const a = {}.propertyIsEnumerable.call(i, r) ? "enumerable" : "nonenumerable";
|
|
447
447
|
a === "enumerable" && (e[r] = t), s && a === "nonenumerable" && Object.defineProperty(e, r, {
|
|
448
448
|
value: t,
|
|
@@ -451,17 +451,17 @@ function bt(e, r, t, i, s) {
|
|
|
451
451
|
configurable: !0
|
|
452
452
|
});
|
|
453
453
|
}
|
|
454
|
-
function
|
|
454
|
+
function G(e, r = {}) {
|
|
455
455
|
if (ye(e))
|
|
456
|
-
return e.map((s) =>
|
|
457
|
-
if (!
|
|
456
|
+
return e.map((s) => G(s, r));
|
|
457
|
+
if (!yt(e))
|
|
458
458
|
return e;
|
|
459
459
|
const t = Object.getOwnPropertyNames(e), i = Object.getOwnPropertySymbols(e);
|
|
460
460
|
return [...t, ...i].reduce((s, a) => {
|
|
461
461
|
if (ye(r.props) && !r.props.includes(a))
|
|
462
462
|
return s;
|
|
463
|
-
const n = e[a], o =
|
|
464
|
-
return
|
|
463
|
+
const n = e[a], o = G(n, r);
|
|
464
|
+
return gt(s, a, o, e, r.nonenumerable), s;
|
|
465
465
|
}, {});
|
|
466
466
|
}
|
|
467
467
|
class l {
|
|
@@ -469,27 +469,27 @@ class l {
|
|
|
469
469
|
* @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.
|
|
470
470
|
*/
|
|
471
471
|
constructor({ dedupe: r = !1 } = {}) {
|
|
472
|
-
this.classRegistry = new
|
|
472
|
+
this.classRegistry = new Wr(), this.symbolRegistry = new he((t) => {
|
|
473
473
|
var i;
|
|
474
474
|
return (i = t.description) != null ? i : "";
|
|
475
|
-
}), this.customTransformerRegistry = new
|
|
475
|
+
}), this.customTransformerRegistry = new Kr(), this.allowedErrorProps = [], this.dedupe = r;
|
|
476
476
|
}
|
|
477
477
|
serialize(r) {
|
|
478
478
|
const t = /* @__PURE__ */ new Map(), i = Re(r, t, this, this.dedupe), s = {
|
|
479
479
|
json: i.transformedValue
|
|
480
480
|
};
|
|
481
|
-
i.annotations && (s.meta = q(
|
|
481
|
+
i.annotations && (s.meta = q(b({}, s.meta), {
|
|
482
482
|
values: i.annotations
|
|
483
483
|
}));
|
|
484
|
-
const a =
|
|
485
|
-
return a && (s.meta = q(
|
|
484
|
+
const a = pt(t, this.dedupe);
|
|
485
|
+
return a && (s.meta = q(b({}, s.meta), {
|
|
486
486
|
referentialEqualities: a
|
|
487
487
|
})), s;
|
|
488
488
|
}
|
|
489
489
|
deserialize(r) {
|
|
490
490
|
const { json: t, meta: i } = r;
|
|
491
|
-
let s =
|
|
492
|
-
return i != null && i.values && (s =
|
|
491
|
+
let s = G(t);
|
|
492
|
+
return i != null && i.values && (s = ct(s, i.values, this)), i != null && i.referentialEqualities && (s = ft(s, i.referentialEqualities)), s;
|
|
493
493
|
}
|
|
494
494
|
stringify(r) {
|
|
495
495
|
return JSON.stringify(this.serialize(r));
|
|
@@ -504,7 +504,7 @@ class l {
|
|
|
504
504
|
this.symbolRegistry.register(r, t);
|
|
505
505
|
}
|
|
506
506
|
registerCustom(r, t) {
|
|
507
|
-
this.customTransformerRegistry.register(
|
|
507
|
+
this.customTransformerRegistry.register(b({
|
|
508
508
|
name: t
|
|
509
509
|
}, r));
|
|
510
510
|
}
|
|
@@ -521,7 +521,7 @@ l.registerClass = l.defaultInstance.registerClass.bind(l.defaultInstance);
|
|
|
521
521
|
l.registerSymbol = l.defaultInstance.registerSymbol.bind(l.defaultInstance);
|
|
522
522
|
l.registerCustom = l.defaultInstance.registerCustom.bind(l.defaultInstance);
|
|
523
523
|
l.allowErrorProps = l.defaultInstance.allowErrorProps.bind(l.defaultInstance);
|
|
524
|
-
const R = (e) => e === void 0 ?
|
|
524
|
+
const R = (e) => e === void 0 ? $r.None : e, ht = (e) => new Ke(e.metadataItem, e.type), ee = (e) => new lr(
|
|
525
525
|
e.name,
|
|
526
526
|
e.expression,
|
|
527
527
|
e.type,
|
|
@@ -529,7 +529,7 @@ const R = (e) => e === void 0 ? Dr.None : e, ht = (e) => new Qe(e.metadataItem,
|
|
|
529
529
|
R(e.sort),
|
|
530
530
|
e.dataSource,
|
|
531
531
|
e.composeCode
|
|
532
|
-
),
|
|
532
|
+
), re = (e) => new cr(
|
|
533
533
|
e.name,
|
|
534
534
|
e.expression,
|
|
535
535
|
e.granularity,
|
|
@@ -538,71 +538,71 @@ const R = (e) => e === void 0 ? Dr.None : e, ht = (e) => new Qe(e.metadataItem,
|
|
|
538
538
|
R(e.sort),
|
|
539
539
|
e.dataSource,
|
|
540
540
|
e.composeCode
|
|
541
|
-
),
|
|
541
|
+
), w = (e) => {
|
|
542
542
|
switch (e.__serializable) {
|
|
543
543
|
case "DimensionalAttribute":
|
|
544
|
-
return v(e);
|
|
545
|
-
case "DimensionalLevelAttribute":
|
|
546
544
|
return ee(e);
|
|
545
|
+
case "DimensionalLevelAttribute":
|
|
546
|
+
return re(e);
|
|
547
547
|
default:
|
|
548
548
|
return e;
|
|
549
549
|
}
|
|
550
|
-
},
|
|
550
|
+
}, Te = (e) => new Lr(
|
|
551
551
|
e.name,
|
|
552
552
|
e.expression,
|
|
553
|
-
e.attributes.map(
|
|
554
|
-
e.dimensions.map(
|
|
553
|
+
e.attributes.map(w),
|
|
554
|
+
e.dimensions.map(bt),
|
|
555
555
|
e.type,
|
|
556
556
|
e.description,
|
|
557
557
|
R(e.sort),
|
|
558
558
|
e.dataSource,
|
|
559
559
|
e.composeCode,
|
|
560
|
-
e.defaultAttribute ?
|
|
561
|
-
),
|
|
560
|
+
e.defaultAttribute ? w(e.defaultAttribute) : void 0
|
|
561
|
+
), Se = (e) => new _r(
|
|
562
562
|
e.name,
|
|
563
563
|
e.expression,
|
|
564
564
|
e.description,
|
|
565
565
|
R(e.sort),
|
|
566
566
|
e.dataSource,
|
|
567
567
|
e.composeCode
|
|
568
|
-
),
|
|
568
|
+
), bt = (e) => {
|
|
569
569
|
switch (e.__serializable) {
|
|
570
570
|
case "DimensionalDimension":
|
|
571
|
-
return
|
|
571
|
+
return Te(e);
|
|
572
572
|
case "DimensionalDateDimension":
|
|
573
|
-
return
|
|
573
|
+
return Se(e);
|
|
574
574
|
default:
|
|
575
575
|
return e;
|
|
576
576
|
}
|
|
577
|
-
},
|
|
577
|
+
}, te = (e) => new fr(
|
|
578
578
|
e.name,
|
|
579
|
-
|
|
579
|
+
w(e.attribute),
|
|
580
580
|
e.aggregation,
|
|
581
581
|
e.format,
|
|
582
582
|
e.description,
|
|
583
583
|
R(e.sort),
|
|
584
584
|
e.dataSource,
|
|
585
585
|
e.composeCode
|
|
586
|
-
),
|
|
586
|
+
), ie = (e) => {
|
|
587
587
|
const r = Object.fromEntries(
|
|
588
588
|
Object.entries(e.context).map(([t, i]) => {
|
|
589
589
|
if (i && typeof i == "object" && "__serializable" in i)
|
|
590
590
|
switch (i.__serializable) {
|
|
591
591
|
case "DimensionalAttribute":
|
|
592
|
-
return [t, v(i)];
|
|
593
|
-
case "DimensionalLevelAttribute":
|
|
594
592
|
return [t, ee(i)];
|
|
595
|
-
case "
|
|
593
|
+
case "DimensionalLevelAttribute":
|
|
596
594
|
return [t, re(i)];
|
|
597
|
-
case "
|
|
595
|
+
case "DimensionalBaseMeasure":
|
|
598
596
|
return [t, te(i)];
|
|
597
|
+
case "DimensionalCalculatedMeasure":
|
|
598
|
+
return [t, ie(i)];
|
|
599
599
|
default:
|
|
600
600
|
return [t, i];
|
|
601
601
|
}
|
|
602
602
|
return [t, i];
|
|
603
603
|
})
|
|
604
604
|
);
|
|
605
|
-
return new
|
|
605
|
+
return new dr(
|
|
606
606
|
e.name,
|
|
607
607
|
e.expression,
|
|
608
608
|
r,
|
|
@@ -612,9 +612,9 @@ const R = (e) => e === void 0 ? Dr.None : e, ht = (e) => new Qe(e.metadataItem,
|
|
|
612
612
|
e.dataSource,
|
|
613
613
|
e.composeCode
|
|
614
614
|
);
|
|
615
|
-
},
|
|
615
|
+
}, ze = (e) => new mr(
|
|
616
616
|
e.name,
|
|
617
|
-
|
|
617
|
+
w(e.attribute),
|
|
618
618
|
e.format,
|
|
619
619
|
e.description,
|
|
620
620
|
R(e.sort),
|
|
@@ -623,46 +623,46 @@ const R = (e) => e === void 0 ? Dr.None : e, ht = (e) => new Qe(e.metadataItem,
|
|
|
623
623
|
), K = (e) => {
|
|
624
624
|
switch (e.__serializable) {
|
|
625
625
|
case "DimensionalBaseMeasure":
|
|
626
|
-
return re(e);
|
|
627
|
-
case "DimensionalCalculatedMeasure":
|
|
628
626
|
return te(e);
|
|
627
|
+
case "DimensionalCalculatedMeasure":
|
|
628
|
+
return ie(e);
|
|
629
629
|
case "DimensionalMeasureTemplate":
|
|
630
|
-
return
|
|
630
|
+
return ze(e);
|
|
631
631
|
default:
|
|
632
632
|
return e;
|
|
633
633
|
}
|
|
634
|
-
},
|
|
634
|
+
}, h = (e) => {
|
|
635
635
|
switch (e.__serializable) {
|
|
636
636
|
case "MembersFilter":
|
|
637
|
-
return new
|
|
638
|
-
|
|
637
|
+
return new Cr(
|
|
638
|
+
w(e.attribute),
|
|
639
639
|
e.members,
|
|
640
|
-
e.config.backgroundFilter ? q(
|
|
640
|
+
e.config.backgroundFilter ? q(b({}, e.config), { backgroundFilter: h(e.config.backgroundFilter) }) : e.config,
|
|
641
641
|
e.composeCode
|
|
642
642
|
);
|
|
643
643
|
case "LogicalAttributeFilter":
|
|
644
|
-
return new
|
|
645
|
-
e.filters.map((t) =>
|
|
644
|
+
return new Ar(
|
|
645
|
+
e.filters.map((t) => h(t)),
|
|
646
646
|
e.operator,
|
|
647
647
|
e.config,
|
|
648
648
|
e.composeCode
|
|
649
649
|
);
|
|
650
650
|
case "CascadingFilter":
|
|
651
651
|
return new xr(
|
|
652
|
-
e._filters.map((t) =>
|
|
652
|
+
e._filters.map((t) => h(t)),
|
|
653
653
|
e.config,
|
|
654
654
|
e.composeCode
|
|
655
655
|
);
|
|
656
656
|
case "ExcludeFilter":
|
|
657
|
-
return new
|
|
658
|
-
|
|
659
|
-
e.input ?
|
|
657
|
+
return new Er(
|
|
658
|
+
h(e.filter),
|
|
659
|
+
e.input ? h(e.input) : void 0,
|
|
660
660
|
e.config,
|
|
661
661
|
e.composeCode
|
|
662
662
|
);
|
|
663
663
|
case "MeasureFilter":
|
|
664
|
-
return new
|
|
665
|
-
|
|
664
|
+
return new qr(
|
|
665
|
+
w(e.attribute),
|
|
666
666
|
K(e.measure),
|
|
667
667
|
e.operatorA,
|
|
668
668
|
e.valueA,
|
|
@@ -673,7 +673,7 @@ const R = (e) => e === void 0 ? Dr.None : e, ht = (e) => new Qe(e.metadataItem,
|
|
|
673
673
|
);
|
|
674
674
|
case "RankingFilter":
|
|
675
675
|
return new wr(
|
|
676
|
-
|
|
676
|
+
w(e.attribute),
|
|
677
677
|
K(e.measure),
|
|
678
678
|
e.operator,
|
|
679
679
|
e.count,
|
|
@@ -681,7 +681,7 @@ const R = (e) => e === void 0 ? Dr.None : e, ht = (e) => new Qe(e.metadataItem,
|
|
|
681
681
|
e.composeCode
|
|
682
682
|
);
|
|
683
683
|
case "MeasureRankingFilter":
|
|
684
|
-
return new
|
|
684
|
+
return new Fr(
|
|
685
685
|
K(e.measure),
|
|
686
686
|
e.operator,
|
|
687
687
|
e.count,
|
|
@@ -689,8 +689,8 @@ const R = (e) => e === void 0 ? Dr.None : e, ht = (e) => new Qe(e.metadataItem,
|
|
|
689
689
|
e.composeCode
|
|
690
690
|
);
|
|
691
691
|
case "NumericFilter":
|
|
692
|
-
return new
|
|
693
|
-
|
|
692
|
+
return new br(
|
|
693
|
+
w(e.attribute),
|
|
694
694
|
e.operatorA,
|
|
695
695
|
e.valueA,
|
|
696
696
|
e.operatorB,
|
|
@@ -700,7 +700,7 @@ const R = (e) => e === void 0 ? Dr.None : e, ht = (e) => new Qe(e.metadataItem,
|
|
|
700
700
|
);
|
|
701
701
|
case "TextFilter":
|
|
702
702
|
return new hr(
|
|
703
|
-
|
|
703
|
+
w(e.attribute),
|
|
704
704
|
e.operatorA,
|
|
705
705
|
e.valueA,
|
|
706
706
|
e.config,
|
|
@@ -708,8 +708,8 @@ const R = (e) => e === void 0 ? Dr.None : e, ht = (e) => new Qe(e.metadataItem,
|
|
|
708
708
|
);
|
|
709
709
|
case "DateRangeFilter": {
|
|
710
710
|
const { valueA: t, valueB: i } = e;
|
|
711
|
-
return new
|
|
712
|
-
|
|
711
|
+
return new gr(
|
|
712
|
+
w(e.attribute),
|
|
713
713
|
t,
|
|
714
714
|
i,
|
|
715
715
|
e.config,
|
|
@@ -717,8 +717,8 @@ const R = (e) => e === void 0 ? Dr.None : e, ht = (e) => new Qe(e.metadataItem,
|
|
|
717
717
|
);
|
|
718
718
|
}
|
|
719
719
|
case "RelativeDateFilter":
|
|
720
|
-
return new
|
|
721
|
-
|
|
720
|
+
return new yr(
|
|
721
|
+
w(e.attribute),
|
|
722
722
|
e.offset,
|
|
723
723
|
e.count,
|
|
724
724
|
e.operator,
|
|
@@ -727,8 +727,8 @@ const R = (e) => e === void 0 ? Dr.None : e, ht = (e) => new Qe(e.metadataItem,
|
|
|
727
727
|
e.composeCode
|
|
728
728
|
);
|
|
729
729
|
case "CustomFilter":
|
|
730
|
-
return new
|
|
731
|
-
|
|
730
|
+
return new pr(
|
|
731
|
+
w(e.attribute),
|
|
732
732
|
e.jaqlExpression,
|
|
733
733
|
e.config,
|
|
734
734
|
e.composeCode
|
|
@@ -739,7 +739,7 @@ const R = (e) => e === void 0 ? Dr.None : e, ht = (e) => new Qe(e.metadataItem,
|
|
|
739
739
|
};
|
|
740
740
|
l.registerCustom(
|
|
741
741
|
{
|
|
742
|
-
isApplicable:
|
|
742
|
+
isApplicable: je,
|
|
743
743
|
serialize: (e) => e.serialize(),
|
|
744
744
|
deserialize: (e) => ht(e)
|
|
745
745
|
},
|
|
@@ -747,49 +747,49 @@ l.registerCustom(
|
|
|
747
747
|
);
|
|
748
748
|
l.registerCustom(
|
|
749
749
|
{
|
|
750
|
-
isApplicable:
|
|
750
|
+
isApplicable: Qe,
|
|
751
751
|
serialize: (e) => e.serialize(),
|
|
752
|
-
deserialize: (e) =>
|
|
752
|
+
deserialize: (e) => ee(e)
|
|
753
753
|
},
|
|
754
754
|
"DimensionalAttribute"
|
|
755
755
|
);
|
|
756
756
|
l.registerCustom(
|
|
757
757
|
{
|
|
758
|
-
isApplicable:
|
|
758
|
+
isApplicable: Ye,
|
|
759
759
|
serialize: (e) => e.serialize(),
|
|
760
|
-
deserialize: (e) =>
|
|
760
|
+
deserialize: (e) => re(e)
|
|
761
761
|
},
|
|
762
762
|
"DimensionalLevelAttribute"
|
|
763
763
|
);
|
|
764
764
|
l.registerCustom(
|
|
765
765
|
{
|
|
766
|
-
isApplicable:
|
|
766
|
+
isApplicable: Pr,
|
|
767
767
|
serialize: (e) => e.serialize(),
|
|
768
|
-
deserialize: (e) =>
|
|
768
|
+
deserialize: (e) => Te(e)
|
|
769
769
|
},
|
|
770
770
|
"DimensionalDimension"
|
|
771
771
|
);
|
|
772
772
|
l.registerCustom(
|
|
773
773
|
{
|
|
774
|
-
isApplicable:
|
|
774
|
+
isApplicable: kr,
|
|
775
775
|
serialize: (e) => e.serialize(),
|
|
776
|
-
deserialize: (e) =>
|
|
776
|
+
deserialize: (e) => Se(e)
|
|
777
777
|
},
|
|
778
778
|
"DimensionalDateDimension"
|
|
779
779
|
);
|
|
780
780
|
l.registerCustom(
|
|
781
781
|
{
|
|
782
|
-
isApplicable:
|
|
782
|
+
isApplicable: ve,
|
|
783
783
|
serialize: (e) => e.serialize(),
|
|
784
|
-
deserialize: (e) =>
|
|
784
|
+
deserialize: (e) => te(e)
|
|
785
785
|
},
|
|
786
786
|
"DimensionalBaseMeasure"
|
|
787
787
|
);
|
|
788
788
|
l.registerCustom(
|
|
789
789
|
{
|
|
790
|
-
isApplicable:
|
|
790
|
+
isApplicable: He,
|
|
791
791
|
serialize: (e) => e.serialize(),
|
|
792
|
-
deserialize: (e) =>
|
|
792
|
+
deserialize: (e) => ie(e)
|
|
793
793
|
},
|
|
794
794
|
"DimensionalCalculatedMeasure"
|
|
795
795
|
);
|
|
@@ -797,189 +797,251 @@ l.registerCustom(
|
|
|
797
797
|
{
|
|
798
798
|
isApplicable: Ge,
|
|
799
799
|
serialize: (e) => e.serialize(),
|
|
800
|
-
deserialize: (e) =>
|
|
800
|
+
deserialize: (e) => ze(e)
|
|
801
801
|
},
|
|
802
802
|
"DimensionalMeasureTemplate"
|
|
803
803
|
);
|
|
804
804
|
l.registerCustom(
|
|
805
805
|
{
|
|
806
|
-
isApplicable:
|
|
806
|
+
isApplicable: X,
|
|
807
807
|
serialize: (e) => e.serialize(),
|
|
808
|
-
deserialize: (e) =>
|
|
808
|
+
deserialize: (e) => h(e)
|
|
809
809
|
},
|
|
810
810
|
"MembersFilter"
|
|
811
811
|
);
|
|
812
812
|
l.registerCustom(
|
|
813
813
|
{
|
|
814
|
-
isApplicable:
|
|
814
|
+
isApplicable: Xe,
|
|
815
815
|
serialize: (e) => e.serialize(),
|
|
816
|
-
deserialize: (e) =>
|
|
816
|
+
deserialize: (e) => h(e)
|
|
817
817
|
},
|
|
818
818
|
"LogicalAttributeFilter"
|
|
819
819
|
);
|
|
820
820
|
l.registerCustom(
|
|
821
821
|
{
|
|
822
|
-
isApplicable:
|
|
822
|
+
isApplicable: Ze,
|
|
823
823
|
serialize: (e) => e.serialize(),
|
|
824
|
-
deserialize: (e) =>
|
|
824
|
+
deserialize: (e) => h(e)
|
|
825
825
|
},
|
|
826
826
|
"CascadingFilter"
|
|
827
827
|
);
|
|
828
828
|
l.registerCustom(
|
|
829
829
|
{
|
|
830
|
-
isApplicable:
|
|
830
|
+
isApplicable: er,
|
|
831
831
|
serialize: (e) => e.serialize(),
|
|
832
|
-
deserialize: (e) =>
|
|
832
|
+
deserialize: (e) => h(e)
|
|
833
833
|
},
|
|
834
834
|
"ExcludeFilter"
|
|
835
835
|
);
|
|
836
836
|
l.registerCustom(
|
|
837
837
|
{
|
|
838
|
-
isApplicable:
|
|
838
|
+
isApplicable: rr,
|
|
839
839
|
serialize: (e) => e.serialize(),
|
|
840
|
-
deserialize: (e) =>
|
|
840
|
+
deserialize: (e) => h(e)
|
|
841
841
|
},
|
|
842
842
|
"MeasureFilter"
|
|
843
843
|
);
|
|
844
844
|
l.registerCustom(
|
|
845
845
|
{
|
|
846
|
-
isApplicable:
|
|
846
|
+
isApplicable: tr,
|
|
847
847
|
serialize: (e) => e.serialize(),
|
|
848
|
-
deserialize: (e) =>
|
|
848
|
+
deserialize: (e) => h(e)
|
|
849
849
|
},
|
|
850
850
|
"RankingFilter"
|
|
851
851
|
);
|
|
852
852
|
l.registerCustom(
|
|
853
853
|
{
|
|
854
|
-
isApplicable:
|
|
854
|
+
isApplicable: ir,
|
|
855
855
|
serialize: (e) => e.serialize(),
|
|
856
|
-
deserialize: (e) =>
|
|
856
|
+
deserialize: (e) => h(e)
|
|
857
857
|
},
|
|
858
858
|
"MeasureRankingFilter"
|
|
859
859
|
);
|
|
860
860
|
l.registerCustom(
|
|
861
861
|
{
|
|
862
|
-
isApplicable:
|
|
862
|
+
isApplicable: sr,
|
|
863
863
|
serialize: (e) => e.serialize(),
|
|
864
|
-
deserialize: (e) =>
|
|
864
|
+
deserialize: (e) => h(e)
|
|
865
865
|
},
|
|
866
866
|
"NumericFilter"
|
|
867
867
|
);
|
|
868
868
|
l.registerCustom(
|
|
869
869
|
{
|
|
870
|
-
isApplicable:
|
|
870
|
+
isApplicable: nr,
|
|
871
871
|
serialize: (e) => e.serialize(),
|
|
872
|
-
deserialize: (e) =>
|
|
872
|
+
deserialize: (e) => h(e)
|
|
873
873
|
},
|
|
874
874
|
"TextFilter"
|
|
875
875
|
);
|
|
876
876
|
l.registerCustom(
|
|
877
877
|
{
|
|
878
|
-
isApplicable:
|
|
878
|
+
isApplicable: ar,
|
|
879
879
|
serialize: (e) => e.serialize(),
|
|
880
|
-
deserialize: (e) =>
|
|
880
|
+
deserialize: (e) => h(e)
|
|
881
881
|
},
|
|
882
882
|
"DateRangeFilter"
|
|
883
883
|
);
|
|
884
884
|
l.registerCustom(
|
|
885
885
|
{
|
|
886
|
-
isApplicable:
|
|
886
|
+
isApplicable: or,
|
|
887
887
|
serialize: (e) => e.serialize(),
|
|
888
|
-
deserialize: (e) =>
|
|
888
|
+
deserialize: (e) => h(e)
|
|
889
889
|
},
|
|
890
890
|
"RelativeDateFilter"
|
|
891
891
|
);
|
|
892
892
|
l.registerCustom(
|
|
893
893
|
{
|
|
894
|
-
isApplicable:
|
|
894
|
+
isApplicable: ur,
|
|
895
895
|
serialize: (e) => e.serialize(),
|
|
896
|
-
deserialize: (e) =>
|
|
896
|
+
deserialize: (e) => h(e)
|
|
897
897
|
},
|
|
898
898
|
"CustomFilter"
|
|
899
899
|
);
|
|
900
|
-
const ti = l,
|
|
900
|
+
const ti = l, F = "DM.";
|
|
901
901
|
function A(e) {
|
|
902
902
|
return typeof e == "object" && e !== null && "function" in e && "args" in e;
|
|
903
903
|
}
|
|
904
|
-
function
|
|
904
|
+
function se(e) {
|
|
905
905
|
return e.every(A);
|
|
906
906
|
}
|
|
907
|
-
function
|
|
907
|
+
function W(e) {
|
|
908
908
|
return "attribute" in e && "config" in e;
|
|
909
909
|
}
|
|
910
|
-
function
|
|
910
|
+
function L(e) {
|
|
911
911
|
return "left" in e && "right" in e && "operator" in e;
|
|
912
912
|
}
|
|
913
|
-
function
|
|
914
|
-
return !
|
|
913
|
+
function Ie(e) {
|
|
914
|
+
return !W(e) && !L(e);
|
|
915
915
|
}
|
|
916
|
-
function
|
|
916
|
+
function Ft(e) {
|
|
917
917
|
return e.every((r) => typeof r == "string");
|
|
918
918
|
}
|
|
919
|
-
function
|
|
920
|
-
const r = e.
|
|
921
|
-
|
|
919
|
+
function wt(e) {
|
|
920
|
+
const r = [...e].sort((a, n) => n.name.length - a.name.length), t = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
|
|
921
|
+
for (const a of e) {
|
|
922
|
+
t.set(a.name, a);
|
|
923
|
+
const n = [...a.columns].sort((u, c) => c.name.length - u.name.length);
|
|
924
|
+
s.set(a.name, n);
|
|
925
|
+
const o = /* @__PURE__ */ new Map();
|
|
926
|
+
for (const u of a.columns)
|
|
927
|
+
o.set(u.name, u);
|
|
928
|
+
i.set(a.name, o);
|
|
929
|
+
}
|
|
930
|
+
return {
|
|
931
|
+
sortedTables: r,
|
|
932
|
+
tableColumnMap: s,
|
|
933
|
+
tableMap: t,
|
|
934
|
+
columnMap: i
|
|
935
|
+
};
|
|
936
|
+
}
|
|
937
|
+
function Oe(e, r) {
|
|
938
|
+
if (!e.startsWith(F))
|
|
939
|
+
throw new Error(
|
|
940
|
+
`Invalid dimensional element name format: "${e}". Expected format: "${F}TableName.ColumnName[.Level]"`
|
|
941
|
+
);
|
|
942
|
+
const t = e.slice(F.length);
|
|
943
|
+
if (!t)
|
|
922
944
|
throw new Error(
|
|
923
|
-
`Invalid dimensional element name format: "${e}". Expected format: "${
|
|
945
|
+
`Invalid dimensional element name format: "${e}". Expected format: "${F}TableName.ColumnName[.Level]"`
|
|
924
946
|
);
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
947
|
+
let i, s;
|
|
948
|
+
for (const f of r.sortedTables)
|
|
949
|
+
if (t.startsWith(f.name + ".")) {
|
|
950
|
+
const m = t.slice(f.name.length + 1);
|
|
951
|
+
if (!m)
|
|
952
|
+
throw new Error(
|
|
953
|
+
`Invalid dimensional element name format: "${e}". Expected format: "${F}TableName.ColumnName[.Level]"`
|
|
954
|
+
);
|
|
955
|
+
i = f, s = m;
|
|
956
|
+
break;
|
|
957
|
+
}
|
|
958
|
+
if (!i) {
|
|
959
|
+
const f = t.indexOf(".");
|
|
960
|
+
if (f === -1)
|
|
961
|
+
throw new Error(
|
|
962
|
+
`Invalid dimensional element name format: "${e}". Expected format: "${F}TableName.ColumnName[.Level]"`
|
|
963
|
+
);
|
|
964
|
+
const m = t.slice(0, f);
|
|
965
|
+
throw new Error(`Table "${m}" not found in the data model`);
|
|
966
|
+
}
|
|
967
|
+
const a = r.tableColumnMap.get(i.name);
|
|
968
|
+
if (!a)
|
|
969
|
+
throw new Error(`Table "${i.name}" found but has no columns`);
|
|
970
|
+
let n, o;
|
|
971
|
+
const u = _.all;
|
|
972
|
+
for (const f of a) {
|
|
973
|
+
if (s === f.name)
|
|
974
|
+
return { table: i, column: f };
|
|
975
|
+
if (!s.startsWith(f.name + "."))
|
|
976
|
+
continue;
|
|
977
|
+
const m = s.slice(f.name.length + 1);
|
|
978
|
+
if (!m)
|
|
979
|
+
continue;
|
|
980
|
+
const y = u.includes(m), d = Z(f.dataType);
|
|
981
|
+
if (y) {
|
|
982
|
+
if (d)
|
|
983
|
+
return { table: i, column: f, level: m };
|
|
984
|
+
n || (n = f, o = m);
|
|
985
|
+
continue;
|
|
986
|
+
}
|
|
987
|
+
d && !n && (n = f, o = m);
|
|
988
|
+
}
|
|
989
|
+
if (n && o)
|
|
990
|
+
throw u.includes(o) ? new Error(
|
|
991
|
+
`Invalid date level "${o}" in dimensional element "${e}". Column "${i.name}.${n.name}" is not a datetime column`
|
|
992
|
+
) : new Error(
|
|
993
|
+
`Invalid date level "${o}" in dimensional element "${e}". Valid levels are: ${u.join(
|
|
994
|
+
", "
|
|
995
|
+
)}`
|
|
996
|
+
);
|
|
997
|
+
const c = s.indexOf("."), p = c === -1 ? s : s.slice(0, c);
|
|
998
|
+
throw new Error(`Column "${p}" not found in table "${i.name}"`);
|
|
928
999
|
}
|
|
929
|
-
function
|
|
930
|
-
const
|
|
931
|
-
if (!i)
|
|
932
|
-
throw new Error(`Table "${e}" not found in the data model`);
|
|
933
|
-
const s = i.columns.find((a) => a.name === r);
|
|
934
|
-
if (!s)
|
|
935
|
-
throw new Error(`Column "${r}" not found in table "${e}"`);
|
|
936
|
-
return { table: i, column: s };
|
|
937
|
-
}
|
|
938
|
-
function wt(e, r) {
|
|
939
|
-
const { tableName: t, columnName: i, level: s } = Be(e), { column: a } = Pe(t, i, r);
|
|
1000
|
+
function qt(e, r) {
|
|
1001
|
+
const { table: t, column: i, level: s } = Oe(e, r);
|
|
940
1002
|
if (s) {
|
|
941
|
-
if (!
|
|
1003
|
+
if (!Z(i.dataType))
|
|
942
1004
|
throw new Error(
|
|
943
|
-
`Invalid date level "${s}" in dimensional element "${e}". Column "${t}.${i}" is not a datetime column`
|
|
1005
|
+
`Invalid date level "${s}" in dimensional element "${e}". Column "${t.name}.${i.name}" is not a datetime column`
|
|
944
1006
|
);
|
|
945
|
-
const
|
|
946
|
-
if (!
|
|
1007
|
+
const a = _.all;
|
|
1008
|
+
if (!a.includes(s))
|
|
947
1009
|
throw new Error(
|
|
948
|
-
`Invalid date level "${s}" in dimensional element "${e}". Valid levels are: ${
|
|
1010
|
+
`Invalid date level "${s}" in dimensional element "${e}". Valid levels are: ${a.join(
|
|
949
1011
|
", "
|
|
950
1012
|
)}`
|
|
951
1013
|
);
|
|
952
|
-
const
|
|
953
|
-
if (
|
|
1014
|
+
const n = _.dateOnly;
|
|
1015
|
+
if (i.dataType === "date" && !n.includes(s))
|
|
954
1016
|
throw new Error(
|
|
955
|
-
`Invalid level "${s}" in dimensional element "${e}". Column "${t}.${i}" is only a date column, not a datetime column`
|
|
1017
|
+
`Invalid level "${s}" in dimensional element "${e}". Column "${t.name}.${i.name}" is only a date column, not a datetime column`
|
|
956
1018
|
);
|
|
957
|
-
const
|
|
958
|
-
if (
|
|
1019
|
+
const o = _.timeOnly;
|
|
1020
|
+
if (i.dataType === "time" && !o.includes(s))
|
|
959
1021
|
throw new Error(
|
|
960
|
-
`Invalid level "${s}" in dimensional element "${e}". Column "${t}.${i}" is only a time column, not a date column`
|
|
1022
|
+
`Invalid level "${s}" in dimensional element "${e}". Column "${t.name}.${i.name}" is only a time column, not a date column`
|
|
961
1023
|
);
|
|
962
1024
|
}
|
|
963
|
-
return { column:
|
|
1025
|
+
return { column: i, level: s };
|
|
964
1026
|
}
|
|
965
|
-
function
|
|
966
|
-
return e.type ===
|
|
1027
|
+
function Be(e) {
|
|
1028
|
+
return e.type === S.TextAttribute;
|
|
967
1029
|
}
|
|
968
|
-
function
|
|
969
|
-
return e.type ===
|
|
1030
|
+
function Pe(e) {
|
|
1031
|
+
return e.type === S.NumericAttribute;
|
|
970
1032
|
}
|
|
971
1033
|
function Et(e) {
|
|
972
|
-
return e.type ===
|
|
1034
|
+
return e.type === S.DateLevel;
|
|
973
1035
|
}
|
|
974
|
-
function
|
|
975
|
-
return
|
|
1036
|
+
function xt(e) {
|
|
1037
|
+
return Be(e) || Pe(e);
|
|
976
1038
|
}
|
|
977
1039
|
function J(e) {
|
|
978
|
-
return e.type ===
|
|
1040
|
+
return e.type === S.TextAttribute ? "text" : e.type === S.NumericAttribute ? "numeric" : e.type === S.DateLevel ? "date/datetime" : "unknown";
|
|
979
1041
|
}
|
|
980
|
-
function
|
|
981
|
-
const { column: i, level: s } =
|
|
982
|
-
return
|
|
1042
|
+
function ne(e, r, t) {
|
|
1043
|
+
const { column: i, level: s } = qt(e, t);
|
|
1044
|
+
return Dr({
|
|
983
1045
|
expression: i.expression,
|
|
984
1046
|
dataType: i.dataType,
|
|
985
1047
|
granularity: s,
|
|
@@ -988,28 +1050,27 @@ function se(e, r, t) {
|
|
|
988
1050
|
dataSource: r
|
|
989
1051
|
});
|
|
990
1052
|
}
|
|
991
|
-
function
|
|
992
|
-
const {
|
|
993
|
-
if (
|
|
1053
|
+
function At(e, r, t) {
|
|
1054
|
+
const { column: i, level: s } = Oe(e, t);
|
|
1055
|
+
if (s)
|
|
994
1056
|
throw new Error(
|
|
995
|
-
`Invalid DateDimension name format: "${e}". Expected format: "${
|
|
1057
|
+
`Invalid DateDimension name format: "${e}". Expected format: "${F}TableName.ColumnName"`
|
|
996
1058
|
);
|
|
997
|
-
|
|
998
|
-
if (!ge(n.dataType))
|
|
1059
|
+
if (!Z(i.dataType))
|
|
999
1060
|
throw new Error(
|
|
1000
|
-
`Invalid DateDimension name "${e}". Column "${i}
|
|
1061
|
+
`Invalid DateDimension name "${e}". Column "${i.name}" is not a datetime column (got ${i.dataType}).`
|
|
1001
1062
|
);
|
|
1002
|
-
return
|
|
1003
|
-
name:
|
|
1004
|
-
expression:
|
|
1063
|
+
return Vr({
|
|
1064
|
+
name: i.name,
|
|
1065
|
+
expression: i.expression,
|
|
1005
1066
|
dataSource: r
|
|
1006
1067
|
});
|
|
1007
1068
|
}
|
|
1008
1069
|
const Ct = (e) => {
|
|
1009
|
-
const { data: r } = e, { dataSource: t,
|
|
1070
|
+
const { data: r } = e, { dataSource: t, schemaIndex: i } = e.context;
|
|
1010
1071
|
if (!r)
|
|
1011
1072
|
return { success: !0, data: [] };
|
|
1012
|
-
if (!
|
|
1073
|
+
if (!Ft(r))
|
|
1013
1074
|
return {
|
|
1014
1075
|
success: !1,
|
|
1015
1076
|
errors: [
|
|
@@ -1029,37 +1090,37 @@ const Ct = (e) => {
|
|
|
1029
1090
|
input: n
|
|
1030
1091
|
};
|
|
1031
1092
|
try {
|
|
1032
|
-
const c =
|
|
1093
|
+
const c = ne(n, t, i);
|
|
1033
1094
|
s.push(c);
|
|
1034
1095
|
} catch (c) {
|
|
1035
|
-
const
|
|
1036
|
-
a.push(q(
|
|
1096
|
+
const p = c instanceof Error ? c.message : "Unknown error";
|
|
1097
|
+
a.push(q(b({}, u), { message: p }));
|
|
1037
1098
|
}
|
|
1038
1099
|
}), a.length > 0 ? { success: !1, errors: a } : { success: !0, data: s };
|
|
1039
1100
|
};
|
|
1040
|
-
function
|
|
1101
|
+
function ae(e, r) {
|
|
1041
1102
|
const t = Reflect.get(e, r);
|
|
1042
1103
|
if (typeof t != "function")
|
|
1043
1104
|
throw new Error(`Function "${r}" not found or is not a function`);
|
|
1044
1105
|
return t;
|
|
1045
1106
|
}
|
|
1046
1107
|
function $t(e, r) {
|
|
1047
|
-
const t = e.replace("measureFactory.", ""), s =
|
|
1048
|
-
if (!
|
|
1108
|
+
const t = e.replace("measureFactory.", ""), s = ae(Mr, t)(...r);
|
|
1109
|
+
if (!Ie(s))
|
|
1049
1110
|
throw new Error(`Function "${e}" did not return a valid Measure`);
|
|
1050
1111
|
return s;
|
|
1051
1112
|
}
|
|
1052
1113
|
function Dt(e, r) {
|
|
1053
|
-
const t = e.replace("filterFactory.logic.", ""), s =
|
|
1054
|
-
if (!
|
|
1114
|
+
const t = e.replace("filterFactory.logic.", ""), s = ae(Rr, t)(...r);
|
|
1115
|
+
if (!L(s))
|
|
1055
1116
|
throw new Error(`Function "${e}" did not return a valid FilterRelations`);
|
|
1056
1117
|
return s;
|
|
1057
1118
|
}
|
|
1058
1119
|
function Mt(e, r) {
|
|
1059
1120
|
if (e.startsWith("filterFactory.logic."))
|
|
1060
1121
|
return Dt(e, r);
|
|
1061
|
-
const t = e.replace("filterFactory.", ""), s =
|
|
1062
|
-
if (!
|
|
1122
|
+
const t = e.replace("filterFactory.", ""), s = ae(Nr, t)(...r);
|
|
1123
|
+
if (!W(s) && !L(s))
|
|
1063
1124
|
throw new Error(`Function "${e}" did not return a valid Filter or FilterRelations`);
|
|
1064
1125
|
return s;
|
|
1065
1126
|
}
|
|
@@ -1074,7 +1135,7 @@ function Rt(e, r) {
|
|
|
1074
1135
|
);
|
|
1075
1136
|
}
|
|
1076
1137
|
const Nt = /\[([a-zA-Z_][a-zA-Z0-9_.-]*)\]/g;
|
|
1077
|
-
function
|
|
1138
|
+
function Tt(e, r, t = {}) {
|
|
1078
1139
|
const {
|
|
1079
1140
|
warnUnusedContext: i = !0,
|
|
1080
1141
|
errorOnUnusedContext: s = !0,
|
|
@@ -1094,46 +1155,46 @@ function St(e, r, t = {}) {
|
|
|
1094
1155
|
return o.errors.push(
|
|
1095
1156
|
`${n}args[2]: Context cannot be empty - custom formulas require context definitions`
|
|
1096
1157
|
), o.isValid = !1, o;
|
|
1097
|
-
const c = Nt,
|
|
1098
|
-
let
|
|
1099
|
-
for (; (
|
|
1100
|
-
const
|
|
1101
|
-
|
|
1158
|
+
const c = Nt, p = /* @__PURE__ */ new Set();
|
|
1159
|
+
let f;
|
|
1160
|
+
for (; (f = c.exec(e)) !== null; ) {
|
|
1161
|
+
const y = f[1];
|
|
1162
|
+
p.add(y);
|
|
1102
1163
|
}
|
|
1103
|
-
o.references = Array.from(
|
|
1164
|
+
o.references = Array.from(p), o.references.length === 0 && o.warnings.push(
|
|
1104
1165
|
`${n}args[1]: No bracket references found in formula - ensure this is intentional`
|
|
1105
1166
|
);
|
|
1106
|
-
const
|
|
1107
|
-
for (const
|
|
1108
|
-
u.includes(
|
|
1109
|
-
if (
|
|
1110
|
-
`${n}args[1]: Reference [${
|
|
1167
|
+
const m = [];
|
|
1168
|
+
for (const y of o.references)
|
|
1169
|
+
u.includes(y) || m.push(y);
|
|
1170
|
+
if (m.length > 0 && (o.isValid = !1, m.length === 1 ? o.errors.push(
|
|
1171
|
+
`${n}args[1]: Reference [${m[0]}] not found in context. Available keys: ${u.join(", ")}`
|
|
1111
1172
|
) : o.errors.push(
|
|
1112
|
-
`${n}args[1]: References [${
|
|
1173
|
+
`${n}args[1]: References [${m.join(
|
|
1113
1174
|
"], ["
|
|
1114
1175
|
)}] not found in context. Available keys: ${u.join(", ")}`
|
|
1115
1176
|
)), (i || s) && u.length > 0) {
|
|
1116
|
-
const
|
|
1117
|
-
if (o.unusedContextKeys =
|
|
1118
|
-
const
|
|
1177
|
+
const y = u.filter((d) => !o.references.includes(d));
|
|
1178
|
+
if (o.unusedContextKeys = y, y.length > 0) {
|
|
1179
|
+
const d = `${n}args[2]: Context keys [${y.join(
|
|
1119
1180
|
", "
|
|
1120
1181
|
)}] are defined but not used in formula`;
|
|
1121
|
-
s ? (o.errors.push(
|
|
1182
|
+
s ? (o.errors.push(d), o.isValid = !1) : i && o.warnings.push(d);
|
|
1122
1183
|
}
|
|
1123
1184
|
}
|
|
1124
1185
|
return o;
|
|
1125
1186
|
}
|
|
1126
|
-
function
|
|
1127
|
-
const i =
|
|
1187
|
+
function St(e, r, t = {}) {
|
|
1188
|
+
const i = Tt(e, r, t);
|
|
1128
1189
|
if (!i.isValid)
|
|
1129
1190
|
throw new Error(i.errors.join("; "));
|
|
1130
1191
|
i.warnings.length > 0 && console.warn("Formula validation warnings:", i.warnings.join("; "));
|
|
1131
1192
|
}
|
|
1132
|
-
function
|
|
1193
|
+
function zt(e, r) {
|
|
1133
1194
|
if (e.length < 3)
|
|
1134
1195
|
throw new Error(`${r.pathPrefix}Expected at least 3 arguments for customFormula`);
|
|
1135
1196
|
const t = e[1], i = e[2];
|
|
1136
|
-
|
|
1197
|
+
St(t, i, {
|
|
1137
1198
|
errorPrefix: `${r.pathPrefix}`,
|
|
1138
1199
|
errorOnUnusedContext: !0,
|
|
1139
1200
|
// Strict validation: all context keys must be used
|
|
@@ -1144,20 +1205,20 @@ function Ot(e, r) {
|
|
|
1144
1205
|
for (const [a, n] of Object.entries(i)) {
|
|
1145
1206
|
const o = `args[2].${a}`;
|
|
1146
1207
|
if (A(n))
|
|
1147
|
-
s[`${a}`] =
|
|
1208
|
+
s[`${a}`] = E({
|
|
1148
1209
|
data: n,
|
|
1149
1210
|
context: {
|
|
1150
1211
|
dataSource: r.dataSource,
|
|
1151
|
-
|
|
1212
|
+
schemaIndex: r.schemaIndex,
|
|
1152
1213
|
pathPrefix: o
|
|
1153
1214
|
}
|
|
1154
1215
|
});
|
|
1155
|
-
else if (typeof n == "string" && n.startsWith(
|
|
1216
|
+
else if (typeof n == "string" && n.startsWith(F))
|
|
1156
1217
|
try {
|
|
1157
|
-
s[`${a}`] =
|
|
1218
|
+
s[`${a}`] = ne(
|
|
1158
1219
|
n,
|
|
1159
1220
|
r.dataSource,
|
|
1160
|
-
r.
|
|
1221
|
+
r.schemaIndex
|
|
1161
1222
|
);
|
|
1162
1223
|
} catch (u) {
|
|
1163
1224
|
const c = u instanceof Error ? u.message : "Unknown error";
|
|
@@ -1167,20 +1228,20 @@ function Ot(e, r) {
|
|
|
1167
1228
|
s[`${a}`] = n;
|
|
1168
1229
|
else
|
|
1169
1230
|
throw new Error(
|
|
1170
|
-
`${o}: Invalid context value for key '${a}'. Expected a function call or attribute reference (${
|
|
1231
|
+
`${o}: Invalid context value for key '${a}'. Expected a function call or attribute reference (${F}...), but got: ${typeof n}`
|
|
1171
1232
|
);
|
|
1172
1233
|
}
|
|
1173
1234
|
e[2] = s;
|
|
1174
1235
|
}
|
|
1175
|
-
function
|
|
1236
|
+
function oe(e, r) {
|
|
1176
1237
|
const t = e[0];
|
|
1177
1238
|
if (!t || typeof t != "object" || !("type" in t))
|
|
1178
1239
|
throw new Error(`${r.pathPrefix}args[0]: Expected attribute as first argument`);
|
|
1179
1240
|
return t;
|
|
1180
1241
|
}
|
|
1181
|
-
function
|
|
1182
|
-
const t =
|
|
1183
|
-
if (!
|
|
1242
|
+
function ge(e, r) {
|
|
1243
|
+
const t = oe(e, r);
|
|
1244
|
+
if (!xt(t))
|
|
1184
1245
|
throw new Error(
|
|
1185
1246
|
`${r.pathPrefix}args[0]: Attribute must be string or numeric type, got ${J(
|
|
1186
1247
|
t
|
|
@@ -1188,8 +1249,8 @@ function me(e, r) {
|
|
|
1188
1249
|
);
|
|
1189
1250
|
}
|
|
1190
1251
|
function D(e, r) {
|
|
1191
|
-
const t =
|
|
1192
|
-
if (!
|
|
1252
|
+
const t = oe(e, r);
|
|
1253
|
+
if (!Pe(t))
|
|
1193
1254
|
throw new Error(
|
|
1194
1255
|
`${r.pathPrefix}args[0]: Attribute must be numeric type, got ${J(
|
|
1195
1256
|
t
|
|
@@ -1197,32 +1258,32 @@ function D(e, r) {
|
|
|
1197
1258
|
);
|
|
1198
1259
|
}
|
|
1199
1260
|
function M(e, r) {
|
|
1200
|
-
const t =
|
|
1201
|
-
if (!
|
|
1261
|
+
const t = oe(e, r);
|
|
1262
|
+
if (!Be(t))
|
|
1202
1263
|
throw new Error(
|
|
1203
1264
|
`${r.pathPrefix}args[0]: Attribute must be string type, got ${J(
|
|
1204
1265
|
t
|
|
1205
1266
|
)} attribute`
|
|
1206
1267
|
);
|
|
1207
1268
|
}
|
|
1208
|
-
function
|
|
1269
|
+
function It(e, r) {
|
|
1209
1270
|
const t = e[0];
|
|
1210
1271
|
if (!t || typeof t != "object" || !("attribute" in t))
|
|
1211
1272
|
throw new Error(`${r.pathPrefix}args[0]: Expected filter as first argument`);
|
|
1212
1273
|
return t;
|
|
1213
1274
|
}
|
|
1214
|
-
function
|
|
1215
|
-
const t =
|
|
1216
|
-
if (!
|
|
1275
|
+
function Ot(e, r) {
|
|
1276
|
+
const t = It(e, r);
|
|
1277
|
+
if (!X(t))
|
|
1217
1278
|
throw new Error(
|
|
1218
1279
|
`${r.pathPrefix}args[0]: exclude filter only accepts members filter, got ${t.__serializable || "unknown"} filter`
|
|
1219
1280
|
);
|
|
1220
1281
|
}
|
|
1221
|
-
const
|
|
1222
|
-
"measureFactory.customFormula":
|
|
1282
|
+
const Bt = {
|
|
1283
|
+
"measureFactory.customFormula": zt,
|
|
1223
1284
|
// String | Number filters
|
|
1224
|
-
"filterFactory.equals":
|
|
1225
|
-
"filterFactory.doesntEqual":
|
|
1285
|
+
"filterFactory.equals": ge,
|
|
1286
|
+
"filterFactory.doesntEqual": ge,
|
|
1226
1287
|
// Numeric filters
|
|
1227
1288
|
"filterFactory.greaterThan": D,
|
|
1228
1289
|
"filterFactory.greaterThanOrEqual": D,
|
|
@@ -1240,12 +1301,12 @@ const Pt = {
|
|
|
1240
1301
|
"filterFactory.doesntEndWith": M,
|
|
1241
1302
|
"filterFactory.like": M,
|
|
1242
1303
|
// Exclude filter
|
|
1243
|
-
"filterFactory.exclude":
|
|
1304
|
+
"filterFactory.exclude": Ot
|
|
1244
1305
|
};
|
|
1245
|
-
function
|
|
1246
|
-
return
|
|
1306
|
+
function Pt(e) {
|
|
1307
|
+
return Bt[`${e}`];
|
|
1247
1308
|
}
|
|
1248
|
-
const
|
|
1309
|
+
const kt = {
|
|
1249
1310
|
// ==================== MEASURE FACTORY FUNCTIONS ====================
|
|
1250
1311
|
// Basic aggregations
|
|
1251
1312
|
"measureFactory.sum": [
|
|
@@ -1768,15 +1829,15 @@ const It = {
|
|
|
1768
1829
|
{ type: "FilterRelationsNode", required: !0 }
|
|
1769
1830
|
]
|
|
1770
1831
|
};
|
|
1771
|
-
function
|
|
1772
|
-
return
|
|
1832
|
+
function ue(e) {
|
|
1833
|
+
return kt[`${e}`];
|
|
1773
1834
|
}
|
|
1774
|
-
function
|
|
1775
|
-
const r =
|
|
1835
|
+
function Lt(e) {
|
|
1836
|
+
const r = ue(e);
|
|
1776
1837
|
return r ? r.filter((t) => t.required).length : 0;
|
|
1777
1838
|
}
|
|
1778
|
-
function
|
|
1779
|
-
const r =
|
|
1839
|
+
function _t(e) {
|
|
1840
|
+
const r = ue(e);
|
|
1780
1841
|
return r ? r.length : 0;
|
|
1781
1842
|
}
|
|
1782
1843
|
function Vt(e) {
|
|
@@ -1789,31 +1850,31 @@ function Vt(e) {
|
|
|
1789
1850
|
return !isNaN(i.getTime());
|
|
1790
1851
|
}
|
|
1791
1852
|
function Q(e, r, t, i) {
|
|
1792
|
-
if (e.startsWith(
|
|
1853
|
+
if (e.startsWith(F))
|
|
1793
1854
|
try {
|
|
1794
|
-
return
|
|
1855
|
+
return ne(e, r, t);
|
|
1795
1856
|
} catch (s) {
|
|
1796
1857
|
const a = s instanceof Error ? s.message : "Unknown error";
|
|
1797
1858
|
throw new Error(`${i}: ${a}`);
|
|
1798
1859
|
}
|
|
1799
1860
|
throw new Error(
|
|
1800
|
-
`${i}: Invalid attribute "${e}". Expected format: "${
|
|
1861
|
+
`${i}: Invalid attribute "${e}". Expected format: "${F}TableName.ColumnName[.Level]"`
|
|
1801
1862
|
);
|
|
1802
1863
|
}
|
|
1803
1864
|
function Ut(e, r, t, i) {
|
|
1804
|
-
if (e.startsWith(
|
|
1865
|
+
if (e.startsWith(F))
|
|
1805
1866
|
try {
|
|
1806
|
-
return
|
|
1867
|
+
return At(e, r, t);
|
|
1807
1868
|
} catch (s) {
|
|
1808
1869
|
const a = s instanceof Error ? s.message : "Unknown error";
|
|
1809
1870
|
throw new Error(`${i}: ${a}`);
|
|
1810
1871
|
}
|
|
1811
1872
|
throw new Error(
|
|
1812
|
-
`${i}: Invalid date dimension string "${e}". Expected format: "${
|
|
1873
|
+
`${i}: Invalid date dimension string "${e}". Expected format: "${F}TableName.ColumnName"`
|
|
1813
1874
|
);
|
|
1814
1875
|
}
|
|
1815
|
-
function
|
|
1816
|
-
const r = e.data, { argSchema: t, dataSource: i,
|
|
1876
|
+
function Wt(e) {
|
|
1877
|
+
const r = e.data, { argSchema: t, dataSource: i, schemaIndex: s, pathPrefix: a } = e.context, n = a;
|
|
1817
1878
|
if (r === void 0) {
|
|
1818
1879
|
if (t.required)
|
|
1819
1880
|
throw new Error(`${n}: Required argument is missing (expected ${t.type})`);
|
|
@@ -1874,9 +1935,9 @@ function Jt(e) {
|
|
|
1874
1935
|
throw new Error(
|
|
1875
1936
|
`${n}: Expected measure function call, got ${typeof r}. Example: {"function": "measureFactory.sum", "args": ["DM.Commerce.Revenue"]}`
|
|
1876
1937
|
);
|
|
1877
|
-
return
|
|
1938
|
+
return E({
|
|
1878
1939
|
data: r,
|
|
1879
|
-
context: { dataSource: i,
|
|
1940
|
+
context: { dataSource: i, schemaIndex: s, pathPrefix: n }
|
|
1880
1941
|
});
|
|
1881
1942
|
case "Measure[]":
|
|
1882
1943
|
if (!Array.isArray(r))
|
|
@@ -1888,9 +1949,9 @@ function Jt(e) {
|
|
|
1888
1949
|
throw new Error(
|
|
1889
1950
|
`${n}[${u}]: Expected measure function call, got ${typeof o}`
|
|
1890
1951
|
);
|
|
1891
|
-
return
|
|
1952
|
+
return E({
|
|
1892
1953
|
data: o,
|
|
1893
|
-
context: { dataSource: i,
|
|
1954
|
+
context: { dataSource: i, schemaIndex: s, pathPrefix: `${n}[${u}]: ` }
|
|
1894
1955
|
});
|
|
1895
1956
|
});
|
|
1896
1957
|
case "Filter":
|
|
@@ -1898,9 +1959,9 @@ function Jt(e) {
|
|
|
1898
1959
|
throw new Error(
|
|
1899
1960
|
`${n}: Expected filter function call, got ${typeof r}. Example: {"function": "filterFactory.contains", "args": ["DM.Brand.Brand", "Apple"]}`
|
|
1900
1961
|
);
|
|
1901
|
-
return
|
|
1962
|
+
return E({
|
|
1902
1963
|
data: r,
|
|
1903
|
-
context: { dataSource: i,
|
|
1964
|
+
context: { dataSource: i, schemaIndex: s, pathPrefix: n }
|
|
1904
1965
|
});
|
|
1905
1966
|
case "Filter[]":
|
|
1906
1967
|
if (!Array.isArray(r))
|
|
@@ -1912,9 +1973,9 @@ function Jt(e) {
|
|
|
1912
1973
|
throw new Error(
|
|
1913
1974
|
`${n}[${u}]: Expected filter function call, got ${typeof o}`
|
|
1914
1975
|
);
|
|
1915
|
-
return
|
|
1976
|
+
return E({
|
|
1916
1977
|
data: o,
|
|
1917
|
-
context: { dataSource: i,
|
|
1978
|
+
context: { dataSource: i, schemaIndex: s, pathPrefix: `${n}[${u}]: ` }
|
|
1918
1979
|
});
|
|
1919
1980
|
});
|
|
1920
1981
|
case "FilterRelationsNode":
|
|
@@ -1924,15 +1985,15 @@ function Jt(e) {
|
|
|
1924
1985
|
throw new Error(
|
|
1925
1986
|
`${n}[${u}]: Expected filter function call, got ${typeof o}`
|
|
1926
1987
|
);
|
|
1927
|
-
return
|
|
1988
|
+
return E({
|
|
1928
1989
|
data: o,
|
|
1929
|
-
context: { dataSource: i,
|
|
1990
|
+
context: { dataSource: i, schemaIndex: s, pathPrefix: `${n}[${u}]: ` }
|
|
1930
1991
|
});
|
|
1931
1992
|
});
|
|
1932
1993
|
if (A(r))
|
|
1933
|
-
return
|
|
1994
|
+
return E({
|
|
1934
1995
|
data: r,
|
|
1935
|
-
context: { dataSource: i,
|
|
1996
|
+
context: { dataSource: i, schemaIndex: s, pathPrefix: n }
|
|
1936
1997
|
});
|
|
1937
1998
|
throw new Error(
|
|
1938
1999
|
`${n}: Expected filter function call or array of filters, got ${typeof r}`
|
|
@@ -1966,9 +2027,9 @@ function Jt(e) {
|
|
|
1966
2027
|
if (typeof r == "number")
|
|
1967
2028
|
return r;
|
|
1968
2029
|
if (A(r))
|
|
1969
|
-
return
|
|
2030
|
+
return E({
|
|
1970
2031
|
data: r,
|
|
1971
|
-
context: { dataSource: i,
|
|
2032
|
+
context: { dataSource: i, schemaIndex: s, pathPrefix: n }
|
|
1972
2033
|
});
|
|
1973
2034
|
throw new Error(
|
|
1974
2035
|
`${n}: Expected measure function call or number, got ${typeof r}`
|
|
@@ -2002,69 +2063,69 @@ function Jt(e) {
|
|
|
2002
2063
|
return r;
|
|
2003
2064
|
}
|
|
2004
2065
|
}
|
|
2005
|
-
function
|
|
2006
|
-
const { data: r } = e, { dataSource: t,
|
|
2066
|
+
function E(e) {
|
|
2067
|
+
const { data: r } = e, { dataSource: t, schemaIndex: i, pathPrefix: s } = e.context, { function: a, args: n } = r, o = s ? `${s}.` : "", u = ue(a);
|
|
2007
2068
|
if (!u)
|
|
2008
2069
|
throw new Error(`${o}function: Unknown function "${a}"`);
|
|
2009
|
-
const c =
|
|
2070
|
+
const c = Lt(a), p = _t(a);
|
|
2010
2071
|
if (n.length < c)
|
|
2011
2072
|
throw new Error(
|
|
2012
2073
|
`${o}function: Expected at least ${c} arguments, got ${n.length}`
|
|
2013
2074
|
);
|
|
2014
|
-
if (n.length >
|
|
2075
|
+
if (n.length > p)
|
|
2015
2076
|
throw new Error(
|
|
2016
|
-
`${o}function: Expected at most ${
|
|
2077
|
+
`${o}function: Expected at most ${p} arguments, got ${n.length}`
|
|
2017
2078
|
);
|
|
2018
|
-
const
|
|
2019
|
-
for (let
|
|
2020
|
-
const
|
|
2079
|
+
const f = [], m = [];
|
|
2080
|
+
for (let d = 0; d < Math.max(n.length, u.length); d++) {
|
|
2081
|
+
const g = u[`${d}`], C = n[`${d}`], I = o ? `${o}args[${d}]` : `args[${d}]`;
|
|
2021
2082
|
if (C === void 0) {
|
|
2022
|
-
|
|
2083
|
+
g != null && g.required && m.push(`${I}: Missing required argument (expected ${g.type})`);
|
|
2023
2084
|
continue;
|
|
2024
2085
|
}
|
|
2025
|
-
if (!
|
|
2026
|
-
|
|
2086
|
+
if (!g) {
|
|
2087
|
+
m.push(`${I}: Unexpected argument`);
|
|
2027
2088
|
continue;
|
|
2028
2089
|
}
|
|
2029
2090
|
try {
|
|
2030
|
-
const N =
|
|
2091
|
+
const N = Wt({
|
|
2031
2092
|
data: C,
|
|
2032
2093
|
context: {
|
|
2033
2094
|
dataSource: t,
|
|
2034
|
-
|
|
2035
|
-
pathPrefix:
|
|
2036
|
-
argSchema:
|
|
2095
|
+
schemaIndex: i,
|
|
2096
|
+
pathPrefix: I,
|
|
2097
|
+
argSchema: g
|
|
2037
2098
|
}
|
|
2038
2099
|
});
|
|
2039
|
-
|
|
2100
|
+
f.push(N);
|
|
2040
2101
|
} catch (N) {
|
|
2041
2102
|
const Le = N instanceof Error ? N.message : "Unknown error";
|
|
2042
|
-
|
|
2103
|
+
m.push(Le);
|
|
2043
2104
|
}
|
|
2044
2105
|
}
|
|
2045
|
-
if (
|
|
2046
|
-
const
|
|
2047
|
-
throw new Error(
|
|
2106
|
+
if (m.length > 0) {
|
|
2107
|
+
const d = m.join("; ");
|
|
2108
|
+
throw new Error(d);
|
|
2048
2109
|
}
|
|
2049
|
-
const
|
|
2050
|
-
if (
|
|
2110
|
+
const y = Pt(a);
|
|
2111
|
+
if (y)
|
|
2051
2112
|
try {
|
|
2052
|
-
|
|
2113
|
+
y(f, {
|
|
2053
2114
|
dataSource: t,
|
|
2054
|
-
|
|
2115
|
+
schemaIndex: i,
|
|
2055
2116
|
pathPrefix: o
|
|
2056
2117
|
});
|
|
2057
|
-
} catch (
|
|
2058
|
-
const
|
|
2059
|
-
throw new Error(
|
|
2118
|
+
} catch (d) {
|
|
2119
|
+
const g = d instanceof Error ? d.message : "Unknown validation error";
|
|
2120
|
+
throw new Error(g);
|
|
2060
2121
|
}
|
|
2061
|
-
return Rt(a,
|
|
2122
|
+
return Rt(a, f);
|
|
2062
2123
|
}
|
|
2063
|
-
function
|
|
2124
|
+
function ke(e) {
|
|
2064
2125
|
const { attribute: r, config: t } = e;
|
|
2065
|
-
if (
|
|
2126
|
+
if (X(e) && Tr(r)) {
|
|
2066
2127
|
const { granularity: i } = r;
|
|
2067
|
-
return
|
|
2128
|
+
return Sr(
|
|
2068
2129
|
r,
|
|
2069
2130
|
e.members.map((s) => i === "Years" && !isNaN(Number(s)) ? `${s}-01-01T00:00:00` : s),
|
|
2070
2131
|
t
|
|
@@ -2072,14 +2133,14 @@ function _e(e) {
|
|
|
2072
2133
|
}
|
|
2073
2134
|
return e;
|
|
2074
2135
|
}
|
|
2075
|
-
function
|
|
2136
|
+
function Jt(e) {
|
|
2076
2137
|
let r = [];
|
|
2077
2138
|
for (const t of e)
|
|
2078
|
-
|
|
2139
|
+
L(t) ? r = fe(t, r) : r = fe([ke(t)], r);
|
|
2079
2140
|
return r != null ? r : [];
|
|
2080
2141
|
}
|
|
2081
|
-
const
|
|
2082
|
-
const { data: r } = e, { dataSource: t,
|
|
2142
|
+
const jt = (e) => {
|
|
2143
|
+
const { data: r } = e, { dataSource: t, schemaIndex: i } = e.context, s = [], a = [];
|
|
2083
2144
|
return r.forEach((n, o) => {
|
|
2084
2145
|
const u = {
|
|
2085
2146
|
category: "filters",
|
|
@@ -2087,21 +2148,21 @@ const Wt = (e) => {
|
|
|
2087
2148
|
input: n
|
|
2088
2149
|
};
|
|
2089
2150
|
try {
|
|
2090
|
-
const c =
|
|
2151
|
+
const c = E({
|
|
2091
2152
|
data: n,
|
|
2092
|
-
context: { dataSource: t,
|
|
2153
|
+
context: { dataSource: t, schemaIndex: i, pathPrefix: "" }
|
|
2093
2154
|
});
|
|
2094
|
-
!
|
|
2155
|
+
!L(c) && !W(c) ? a.push(q(b({}, u), { message: "Invalid filter JSON" })) : s.push(c);
|
|
2095
2156
|
} catch (c) {
|
|
2096
|
-
const
|
|
2097
|
-
a.push(q(
|
|
2157
|
+
const p = c instanceof Error ? c.message : "Unknown error";
|
|
2158
|
+
a.push(q(b({}, u), { message: p }));
|
|
2098
2159
|
}
|
|
2099
|
-
}), a.length > 0 ? { success: !1, errors: a } : { success: !0, data:
|
|
2160
|
+
}), a.length > 0 ? { success: !1, errors: a } : { success: !0, data: Jt(s) };
|
|
2100
2161
|
}, Kt = (e) => {
|
|
2101
|
-
const { data: r } = e, { dataSource: t,
|
|
2102
|
-
return r ?
|
|
2162
|
+
const { data: r } = e, { dataSource: t, schemaIndex: i } = e.context;
|
|
2163
|
+
return r ? se(r) ? jt({
|
|
2103
2164
|
data: r,
|
|
2104
|
-
context: { dataSource: t,
|
|
2165
|
+
context: { dataSource: t, schemaIndex: i }
|
|
2105
2166
|
}) : {
|
|
2106
2167
|
success: !1,
|
|
2107
2168
|
errors: [
|
|
@@ -2114,7 +2175,7 @@ const Wt = (e) => {
|
|
|
2114
2175
|
]
|
|
2115
2176
|
} : { success: !0, data: [] };
|
|
2116
2177
|
}, Qt = (e) => {
|
|
2117
|
-
const { data: r } = e, { dataSource: t,
|
|
2178
|
+
const { data: r } = e, { dataSource: t, schemaIndex: i } = e.context, s = [], a = [];
|
|
2118
2179
|
return r.forEach((n, o) => {
|
|
2119
2180
|
const u = {
|
|
2120
2181
|
category: "highlights",
|
|
@@ -2122,21 +2183,21 @@ const Wt = (e) => {
|
|
|
2122
2183
|
input: n
|
|
2123
2184
|
};
|
|
2124
2185
|
try {
|
|
2125
|
-
const c =
|
|
2186
|
+
const c = E({
|
|
2126
2187
|
data: n,
|
|
2127
|
-
context: { dataSource: t,
|
|
2188
|
+
context: { dataSource: t, schemaIndex: i, pathPrefix: "" }
|
|
2128
2189
|
});
|
|
2129
|
-
|
|
2190
|
+
W(c) ? s.push(ke(c)) : a.push(q(b({}, u), { message: "Invalid filter JSON" }));
|
|
2130
2191
|
} catch (c) {
|
|
2131
|
-
const
|
|
2132
|
-
a.push(q(
|
|
2192
|
+
const p = c instanceof Error ? c.message : "Unknown error";
|
|
2193
|
+
a.push(q(b({}, u), { message: p }));
|
|
2133
2194
|
}
|
|
2134
2195
|
}), a.length > 0 ? { success: !1, errors: a } : { success: !0, data: s };
|
|
2135
2196
|
}, Yt = (e) => {
|
|
2136
|
-
const { data: r } = e, { dataSource: t,
|
|
2137
|
-
return r ?
|
|
2197
|
+
const { data: r } = e, { dataSource: t, schemaIndex: i } = e.context;
|
|
2198
|
+
return r ? se(r) ? Qt({
|
|
2138
2199
|
data: r,
|
|
2139
|
-
context: { dataSource: t,
|
|
2200
|
+
context: { dataSource: t, schemaIndex: i }
|
|
2140
2201
|
}) : {
|
|
2141
2202
|
success: !1,
|
|
2142
2203
|
errors: [
|
|
@@ -2148,8 +2209,8 @@ const Wt = (e) => {
|
|
|
2148
2209
|
}
|
|
2149
2210
|
]
|
|
2150
2211
|
} : { success: !0, data: [] };
|
|
2151
|
-
},
|
|
2152
|
-
const { data: r } = e, { dataSource: t,
|
|
2212
|
+
}, vt = (e) => {
|
|
2213
|
+
const { data: r } = e, { dataSource: t, schemaIndex: i } = e.context, s = [], a = [];
|
|
2153
2214
|
return r.forEach((n, o) => {
|
|
2154
2215
|
const u = {
|
|
2155
2216
|
category: "measures",
|
|
@@ -2157,21 +2218,21 @@ const Wt = (e) => {
|
|
|
2157
2218
|
input: n
|
|
2158
2219
|
};
|
|
2159
2220
|
try {
|
|
2160
|
-
const c =
|
|
2221
|
+
const c = E({
|
|
2161
2222
|
data: n,
|
|
2162
|
-
context: { dataSource: t,
|
|
2223
|
+
context: { dataSource: t, schemaIndex: i, pathPrefix: "" }
|
|
2163
2224
|
});
|
|
2164
|
-
|
|
2225
|
+
Ie(c) ? s.push(c) : a.push(q(b({}, u), { message: "Invalid measure JSON" }));
|
|
2165
2226
|
} catch (c) {
|
|
2166
|
-
const
|
|
2167
|
-
a.push(q(
|
|
2227
|
+
const p = c instanceof Error ? c.message : "Unknown error";
|
|
2228
|
+
a.push(q(b({}, u), { message: p }));
|
|
2168
2229
|
}
|
|
2169
2230
|
}), a.length > 0 ? { success: !1, errors: a } : { success: !0, data: s };
|
|
2170
|
-
},
|
|
2171
|
-
const { data: r } = e, { dataSource: t,
|
|
2172
|
-
return r ?
|
|
2231
|
+
}, Ht = (e) => {
|
|
2232
|
+
const { data: r } = e, { dataSource: t, schemaIndex: i } = e.context;
|
|
2233
|
+
return r ? se(r) ? vt({
|
|
2173
2234
|
data: r,
|
|
2174
|
-
context: { dataSource: t,
|
|
2235
|
+
context: { dataSource: t, schemaIndex: i }
|
|
2175
2236
|
}) : {
|
|
2176
2237
|
success: !1,
|
|
2177
2238
|
errors: [
|
|
@@ -2184,46 +2245,46 @@ const Wt = (e) => {
|
|
|
2184
2245
|
]
|
|
2185
2246
|
} : { success: !0, data: [] };
|
|
2186
2247
|
}, ii = (e) => {
|
|
2187
|
-
const { data: r } = e, { dataSource: t, tables: i } = e.context, s = [],
|
|
2188
|
-
const y =
|
|
2189
|
-
return y.success ? y.data : (
|
|
2190
|
-
},
|
|
2248
|
+
const { data: r } = e, { dataSource: t, tables: i } = e.context, s = wt(i), a = [], n = (m) => {
|
|
2249
|
+
const y = m();
|
|
2250
|
+
return y.success ? y.data : (a.push(...y.errors), null);
|
|
2251
|
+
}, o = n(
|
|
2191
2252
|
() => Ct({
|
|
2192
2253
|
data: r.dimensions || [],
|
|
2193
|
-
context: { dataSource: t,
|
|
2254
|
+
context: { dataSource: t, schemaIndex: s }
|
|
2194
2255
|
})
|
|
2195
|
-
),
|
|
2196
|
-
() =>
|
|
2256
|
+
), u = n(
|
|
2257
|
+
() => Ht({
|
|
2197
2258
|
data: r.measures || [],
|
|
2198
|
-
context: { dataSource: t,
|
|
2259
|
+
context: { dataSource: t, schemaIndex: s }
|
|
2199
2260
|
})
|
|
2200
|
-
),
|
|
2261
|
+
), c = n(
|
|
2201
2262
|
() => Kt({
|
|
2202
2263
|
data: r.filters || [],
|
|
2203
|
-
context: { dataSource: t,
|
|
2264
|
+
context: { dataSource: t, schemaIndex: s }
|
|
2204
2265
|
})
|
|
2205
2266
|
);
|
|
2206
|
-
let
|
|
2207
|
-
return r.highlights && (
|
|
2267
|
+
let p = null;
|
|
2268
|
+
return r.highlights && (p = n(
|
|
2208
2269
|
() => Yt({
|
|
2209
2270
|
data: r.highlights || [],
|
|
2210
|
-
context: { dataSource: t,
|
|
2271
|
+
context: { dataSource: t, schemaIndex: s }
|
|
2211
2272
|
})
|
|
2212
|
-
)),
|
|
2273
|
+
)), a.length > 0 ? {
|
|
2213
2274
|
success: !1,
|
|
2214
|
-
errors:
|
|
2275
|
+
errors: a
|
|
2215
2276
|
} : {
|
|
2216
2277
|
success: !0,
|
|
2217
|
-
data:
|
|
2218
|
-
dataSource:
|
|
2219
|
-
dimensions:
|
|
2220
|
-
measures:
|
|
2221
|
-
filters:
|
|
2222
|
-
},
|
|
2278
|
+
data: b({
|
|
2279
|
+
dataSource: zr(t),
|
|
2280
|
+
dimensions: o || [],
|
|
2281
|
+
measures: u || [],
|
|
2282
|
+
filters: c || []
|
|
2283
|
+
}, p && { highlights: p })
|
|
2223
2284
|
};
|
|
2224
2285
|
};
|
|
2225
|
-
function
|
|
2226
|
-
const { filters: r, relations: t } =
|
|
2286
|
+
function Gt(e) {
|
|
2287
|
+
const { filters: r, relations: t } = Br(
|
|
2227
2288
|
e.filters || []
|
|
2228
2289
|
);
|
|
2229
2290
|
return {
|
|
@@ -2237,8 +2298,8 @@ function Zt(e) {
|
|
|
2237
2298
|
};
|
|
2238
2299
|
}
|
|
2239
2300
|
function si(e, r, t = !1) {
|
|
2240
|
-
const i =
|
|
2241
|
-
return
|
|
2301
|
+
const i = Gt(e), s = Ir(i, r);
|
|
2302
|
+
return Or(s, t);
|
|
2242
2303
|
}
|
|
2243
2304
|
export {
|
|
2244
2305
|
ti as CustomSuperJSON,
|