@sisense/sdk-ui 2.16.0 → 2.17.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 +54 -54
- package/dist/ai.js +779 -741
- package/dist/analytics-composer/node.cjs +1 -1
- package/dist/analytics-composer/node.js +421 -384
- package/dist/analytics-composer.cjs +1 -1
- package/dist/analytics-composer.js +6 -6
- package/dist/{derive-chart-family-d7eaC45K.cjs → derive-chart-family-B_cR1yhw.cjs} +3 -3
- package/dist/{derive-chart-family-DLwnWblo.js → derive-chart-family-DkuTQGOE.js} +333 -333
- package/dist/{dimensions-BUWtZxix.cjs → dimensions-DI9h9IJH.cjs} +1 -1
- package/dist/{dimensions-DvDgZ8RW.js → dimensions-Gma5tFmd.js} +1 -1
- package/dist/execute-query-CdhSHTTA.cjs +1 -0
- package/dist/{execute-query-CFK2R_1S.js → execute-query-l7jejslh.js} +867 -865
- package/dist/index.cjs +970 -246
- package/dist/index.js +70584 -18085
- package/dist/index.umd.js +1269 -1267
- package/dist/packages/sdk-ui/src/ai/get-nlg-insights-from-widget.d.ts +46 -0
- package/dist/packages/sdk-ui/src/ai/index.d.ts +1 -0
- package/dist/packages/sdk-ui/src/analytics-composer/nlq-v3-translator/common.d.ts +2 -1
- package/dist/packages/sdk-ui/src/analytics-composer/nlq-v3-translator/process-function/filter-processors.d.ts +0 -9
- package/dist/packages/sdk-ui/src/analytics-composer/nlq-v3-translator/types.d.ts +1 -1
- package/dist/packages/sdk-ui/src/analytics-composer/types.d.ts +2 -2
- package/dist/packages/sdk-ui/src/api/rest-api.d.ts +1 -1
- package/dist/packages/sdk-ui/src/app/client-application.d.ts +5 -5
- package/dist/packages/sdk-ui/src/chart-options-processor/data-points.d.ts +3 -4
- package/dist/packages/sdk-ui/src/dashboard/hooks/use-jtd.d.ts +1 -2
- package/dist/packages/sdk-ui/src/data-source-dimensional-model/hooks/use-get-data-source-dimensions.d.ts +78 -0
- package/dist/packages/sdk-ui/src/data-source-dimensional-model/hooks/use-get-data-source-fields.d.ts +23 -0
- package/dist/packages/sdk-ui/src/data-source-dimensional-model/index.d.ts +2 -0
- package/dist/packages/sdk-ui/src/index.d.ts +1 -1
- package/dist/packages/sdk-ui/src/models/widget/widget-model-translator/widget-model-translator.d.ts +4 -1
- package/dist/packages/sdk-ui/src/pivot-table/formatters/data-cell-formatters/data-cell-color-formatter.d.ts +2 -1
- package/dist/packages/sdk-ui/src/pivot-table/formatters/formatter-utils.d.ts +2 -1
- package/dist/packages/sdk-ui/src/pivot-table/formatters/header-cell-formatters/header-cell-totals-formatter.d.ts +1 -1
- package/dist/packages/sdk-ui/src/pivot-table/formatters/types.d.ts +2 -1
- package/dist/packages/sdk-ui/src/pivot-table/hooks/use-apply-pivot-table-formatting.d.ts +1 -1
- package/dist/packages/sdk-ui/src/pivot-table/hooks/use-get-pivot-table-query.d.ts +1 -1
- package/dist/packages/sdk-ui/src/pivot-table/hooks/use-pivot-builder.d.ts +1 -1
- package/dist/packages/sdk-ui/src/pivot-table/hooks/use-pivot-client.d.ts +8 -0
- package/dist/packages/sdk-ui/src/pivot-table/hooks/use-pivot-data-loading.d.ts +2 -1
- package/dist/packages/sdk-ui/src/pivot-table/hooks/use-pivot-data-service.d.ts +2 -1
- package/dist/packages/sdk-ui/src/pivot-table/hooks/use-render-pivot.d.ts +1 -1
- package/dist/packages/sdk-ui/src/pivot-table/pivot-table.d.ts +32 -2
- package/dist/packages/sdk-ui/src/pivot-table/sorting-utils.d.ts +1 -1
- package/dist/packages/sdk-ui/src/props.d.ts +11 -0
- package/dist/packages/sdk-ui/src/query-execution/use-execute-pivot-query.d.ts +0 -1
- package/dist/packages/sdk-ui/src/translation/resources/en.d.ts +1 -1
- package/dist/packages/sdk-ui/src/translation/resources/index.d.ts +2 -2
- package/dist/packages/sdk-ui/src/types.d.ts +40 -25
- package/dist/packages/sdk-ui/src/widgets/pivot-table-widget.d.ts +19 -1
- package/dist/{types-Clbnx4mQ.cjs → types-Hki4GrUY.cjs} +1 -1
- package/dist/{types-D1mqt0Mg.js → types-ofTjqFFK.js} +1 -1
- package/dist/use-common-filters-Bh4KYWy_.cjs +604 -0
- package/dist/use-common-filters-D5yiZCTg.js +56547 -0
- package/dist/{widget-composer-Dhl_nmhq.js → widget-composer-By61s921.js} +3 -3
- package/dist/{widget-composer-BaOTPn5w.cjs → widget-composer-BzzTf8UH.cjs} +1 -1
- package/package.json +8 -7
- package/dist/execute-query-CB4XfUng.cjs +0 -1
- package/dist/packages/sdk-ui/src/common/hooks/fusion-endpoints/use-get-data-source-fields.d.ts +0 -17
- package/dist/use-common-filters-CkQznSEt.cjs +0 -1325
- package/dist/use-common-filters-CxoO7TzT.js +0 -103390
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
1
|
+
var Ve = Object.defineProperty, Ue = Object.defineProperties;
|
|
2
|
+
var Je = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var ue = Object.getOwnPropertySymbols;
|
|
4
|
+
var je = Object.prototype.hasOwnProperty, We = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var le = (e, r, t) => r in e ? Ve(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t, h = (e, r) => {
|
|
6
6
|
for (var t in r || (r = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var t of
|
|
10
|
-
|
|
7
|
+
je.call(r, t) && le(e, t, r[t]);
|
|
8
|
+
if (ue)
|
|
9
|
+
for (var t of ue(r))
|
|
10
|
+
We.call(r, t) && le(e, t, r[t]);
|
|
11
11
|
return e;
|
|
12
|
-
}, q = (e, r) =>
|
|
13
|
-
import { f as
|
|
14
|
-
import { b as
|
|
15
|
-
import {
|
|
16
|
-
import { i as
|
|
17
|
-
class
|
|
12
|
+
}, q = (e, r) => Ue(e, Je(r));
|
|
13
|
+
import { f as Ke, J as Qe } from "../types-ofTjqFFK.js";
|
|
14
|
+
import { b as oi, E as ui, a as li, i as ci, e as fi, d as di } from "../types-ofTjqFFK.js";
|
|
15
|
+
import { bX as Ye, bC as He, bY as Xe, bZ as Ze, b_ as Ge, aw as G, b$ as ve, av as er, c0 as rr, b7 as tr, ax as ir, c1 as sr, ba as nr, b8 as ar, aJ as or, b6 as ur, b9 as lr, e as cr, d as fr, l as dr, c2 as pr, c3 as yr, c4 as mr, c5 as gr, c6 as br, c7 as hr, c8 as Fr, c9 as qr, ca as wr, cb as Er, cc as Ar, au as xr, cd as Cr, ce as $r, S as Dr, i as Mr, s as ge, c as j, M as z, cf as Rr, cg as Nr, ch as Sr, ci as zr, aF as Or, an as ce, am as Tr, cj as Br, x as Pr, w as kr } from "../execute-query-l7jejslh.js";
|
|
16
|
+
import { i as Ir, b as _r, D as Lr, d as Vr, a as Ur } from "../dimensions-Gma5tFmd.js";
|
|
17
|
+
class Jr {
|
|
18
18
|
constructor() {
|
|
19
19
|
this.keyToValue = /* @__PURE__ */ new Map(), this.valueToKey = /* @__PURE__ */ new Map();
|
|
20
20
|
}
|
|
@@ -33,7 +33,7 @@ class Vr {
|
|
|
33
33
|
}
|
|
34
34
|
class be {
|
|
35
35
|
constructor(r) {
|
|
36
|
-
this.generateIdentifier = r, this.kv = new
|
|
36
|
+
this.generateIdentifier = r, this.kv = new Jr();
|
|
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 jr extends be {
|
|
52
52
|
constructor() {
|
|
53
53
|
super((r) => r.name), this.classToAllowedProps = /* @__PURE__ */ new Map();
|
|
54
54
|
}
|
|
@@ -59,7 +59,7 @@ class Ur extends be {
|
|
|
59
59
|
return this.classToAllowedProps.get(r);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function Wr(e) {
|
|
63
63
|
if ("values" in Object)
|
|
64
64
|
return Object.values(e);
|
|
65
65
|
const r = [];
|
|
@@ -67,8 +67,8 @@ function Jr(e) {
|
|
|
67
67
|
e.hasOwnProperty(t) && r.push(e[t]);
|
|
68
68
|
return r;
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
const t =
|
|
70
|
+
function Kr(e, r) {
|
|
71
|
+
const t = Wr(e);
|
|
72
72
|
if ("find" in t)
|
|
73
73
|
return t.find(r);
|
|
74
74
|
const i = t;
|
|
@@ -81,17 +81,17 @@ function Wr(e, r) {
|
|
|
81
81
|
function O(e, r) {
|
|
82
82
|
Object.entries(e).forEach(([t, i]) => r(i, t));
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function L(e, r) {
|
|
85
85
|
return e.indexOf(r) !== -1;
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function fe(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 Qr {
|
|
95
95
|
constructor() {
|
|
96
96
|
this.transfomers = {};
|
|
97
97
|
}
|
|
@@ -99,13 +99,13 @@ class jr {
|
|
|
99
99
|
this.transfomers[r.name] = r;
|
|
100
100
|
}
|
|
101
101
|
findApplicable(r) {
|
|
102
|
-
return
|
|
102
|
+
return Kr(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 Yr = (e) => Object.prototype.toString.call(e).slice(8, -1), he = (e) => typeof e == "undefined", Hr = (e) => e === null, P = (e) => typeof e != "object" || e === null || e === Object.prototype ? !1 : Object.getPrototypeOf(e) === null ? !0 : Object.getPrototypeOf(e) === Object.prototype, Y = (e) => P(e) && Object.keys(e).length === 0, $ = (e) => Array.isArray(e), Xr = (e) => typeof e == "string", Zr = (e) => typeof e == "number" && !isNaN(e), Gr = (e) => typeof e == "boolean", vr = (e) => e instanceof RegExp, k = (e) => e instanceof Map, I = (e) => e instanceof Set, Fe = (e) => Yr(e) === "Symbol", et = (e) => e instanceof Date && !isNaN(e.valueOf()), rt = (e) => e instanceof Error, de = (e) => typeof e == "number" && isNaN(e), tt = (e) => Gr(e) || Hr(e) || he(e) || Zr(e) || Xr(e) || Fe(e), it = (e) => typeof e == "bigint", st = (e) => e === 1 / 0 || e === -1 / 0, nt = (e) => ArrayBuffer.isView(e) && !(e instanceof DataView), at = (e) => e instanceof URL, qe = (e) => e.replace(/\./g, "\\."), W = (e) => e.map(String).map(qe).join("."), B = (e) => {
|
|
109
109
|
const r = [];
|
|
110
110
|
let t = "";
|
|
111
111
|
for (let s = 0; s < e.length; s++) {
|
|
@@ -134,9 +134,9 @@ function E(e, r, t, i) {
|
|
|
134
134
|
const we = [
|
|
135
135
|
E(he, "undefined", () => null, () => {
|
|
136
136
|
}),
|
|
137
|
-
E(
|
|
138
|
-
E(
|
|
139
|
-
E(
|
|
137
|
+
E(it, "bigint", (e) => e.toString(), (e) => typeof BigInt != "undefined" ? BigInt(e) : (console.error("Please add a BigInt polyfill."), e)),
|
|
138
|
+
E(et, "Date", (e) => e.toISOString(), (e) => new Date(e)),
|
|
139
|
+
E(rt, "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
|
-
E(
|
|
153
|
+
E(vr, "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
157
|
E(
|
|
158
|
-
|
|
158
|
+
I,
|
|
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
|
-
E(
|
|
166
|
-
E((e) =>
|
|
165
|
+
E(k, "map", (e) => [...e.entries()], (e) => new Map(e)),
|
|
166
|
+
E((e) => de(e) || st(e), "number", (e) => de(e) ? "NaN" : e > 0 ? "Infinity" : "-Infinity", Number),
|
|
167
167
|
E((e) => e === 0 && 1 / e === -1 / 0, "number", () => "-0", Number),
|
|
168
|
-
E(
|
|
168
|
+
E(at, "URL", (e) => e.toString(), (e) => new URL(e))
|
|
169
169
|
];
|
|
170
|
-
function
|
|
170
|
+
function V(e, r, t, i) {
|
|
171
171
|
return {
|
|
172
172
|
isApplicable: e,
|
|
173
173
|
annotation: r,
|
|
@@ -175,12 +175,12 @@ function U(e, r, t, i) {
|
|
|
175
175
|
untransform: i
|
|
176
176
|
};
|
|
177
177
|
}
|
|
178
|
-
const Ee =
|
|
178
|
+
const Ee = V((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
|
+
}), ot = [
|
|
184
184
|
Int8Array,
|
|
185
185
|
Uint8Array,
|
|
186
186
|
Int16Array,
|
|
@@ -190,8 +190,8 @@ const Ee = U((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), {}), Ae =
|
|
194
|
-
const t =
|
|
193
|
+
].reduce((e, r) => (e[r.name] = r, e), {}), Ae = V(nt, (e) => ["typed-array", e.constructor.name], (e) => [...e], (e, r) => {
|
|
194
|
+
const t = ot[r[1]];
|
|
195
195
|
if (!t)
|
|
196
196
|
throw new Error("Trying to deserialize unknown typed array");
|
|
197
197
|
return new t(e);
|
|
@@ -199,7 +199,7 @@ const Ee = U((e, r) => Fe(e) ? !!r.symbolRegistry.getIdentifier(e) : !1, (e, r)
|
|
|
199
199
|
function xe(e, r) {
|
|
200
200
|
return e != null && e.constructor ? !!r.classRegistry.getIdentifier(e.constructor) : !1;
|
|
201
201
|
}
|
|
202
|
-
const Ce =
|
|
202
|
+
const Ce = V(xe, (e, r) => ["class", r.classRegistry.getIdentifier(e.constructor)], (e, r) => {
|
|
203
203
|
const t = r.classRegistry.getAllowedProps(e.constructor);
|
|
204
204
|
if (!t)
|
|
205
205
|
return h({}, e);
|
|
@@ -212,19 +212,19 @@ const Ce = U(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 = V((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
|
+
}), ut = [Ce, Ee, $e, Ae], pe = (e, r) => {
|
|
221
|
+
const t = fe(ut, (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 = fe(we, (s) => s.isApplicable(e, r));
|
|
228
228
|
if (i)
|
|
229
229
|
return {
|
|
230
230
|
value: i.transform(e, r),
|
|
@@ -234,7 +234,7 @@ const Ce = U(xe, (e, r) => ["class", r.classRegistry.getIdentifier(e.constructor
|
|
|
234
234
|
we.forEach((e) => {
|
|
235
235
|
De[e.annotation] = e;
|
|
236
236
|
});
|
|
237
|
-
const
|
|
237
|
+
const lt = (e, r, t) => {
|
|
238
238
|
if ($(r))
|
|
239
239
|
switch (r[0]) {
|
|
240
240
|
case "symbol":
|
|
@@ -254,7 +254,7 @@ const ot = (e, r, t) => {
|
|
|
254
254
|
throw new Error("Unknown transformation: " + r);
|
|
255
255
|
return i.untransform(e, t);
|
|
256
256
|
}
|
|
257
|
-
},
|
|
257
|
+
}, S = (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 ot = (e, r, t) => {
|
|
|
263
263
|
return t.next().value;
|
|
264
264
|
};
|
|
265
265
|
function Me(e) {
|
|
266
|
-
if (
|
|
266
|
+
if (L(e, "__proto__"))
|
|
267
267
|
throw new Error("__proto__ is not allowed as a property");
|
|
268
|
-
if (
|
|
268
|
+
if (L(e, "prototype"))
|
|
269
269
|
throw new Error("prototype is not allowed as a property");
|
|
270
|
-
if (
|
|
270
|
+
if (L(e, "constructor"))
|
|
271
271
|
throw new Error("constructor is not allowed as a property");
|
|
272
272
|
}
|
|
273
|
-
const
|
|
273
|
+
const ct = (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 (I(e))
|
|
278
|
+
e = S(e, +i);
|
|
279
|
+
else if (k(e)) {
|
|
280
|
+
const s = +i, a = +r[++t] == 0 ? "key" : "value", n = S(e, s);
|
|
281
281
|
switch (a) {
|
|
282
282
|
case "key":
|
|
283
283
|
e = n;
|
|
@@ -290,7 +290,7 @@ const ut = (e, r) => {
|
|
|
290
290
|
e = e[i];
|
|
291
291
|
}
|
|
292
292
|
return e;
|
|
293
|
-
},
|
|
293
|
+
}, H = (e, r, t) => {
|
|
294
294
|
if (Me(r), r.length === 0)
|
|
295
295
|
return t(e);
|
|
296
296
|
let i = e;
|
|
@@ -299,15 +299,15 @@ const ut = (e, r) => {
|
|
|
299
299
|
if ($(i)) {
|
|
300
300
|
const o = +n;
|
|
301
301
|
i = i[o];
|
|
302
|
-
} else if (
|
|
302
|
+
} else if (P(i))
|
|
303
303
|
i = i[n];
|
|
304
|
-
else if (
|
|
304
|
+
else if (I(i)) {
|
|
305
305
|
const o = +n;
|
|
306
|
-
i =
|
|
307
|
-
} else if (
|
|
306
|
+
i = S(i, o);
|
|
307
|
+
} else if (k(i)) {
|
|
308
308
|
if (a === r.length - 2)
|
|
309
309
|
break;
|
|
310
|
-
const u = +n, c = +r[++a] == 0 ? "key" : "value", d =
|
|
310
|
+
const u = +n, c = +r[++a] == 0 ? "key" : "value", d = S(i, u);
|
|
311
311
|
switch (c) {
|
|
312
312
|
case "key":
|
|
313
313
|
i = d;
|
|
@@ -319,12 +319,12 @@ const ut = (e, r) => {
|
|
|
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]) : P(i) && (i[s] = t(i[s])), I(i)) {
|
|
323
|
+
const a = S(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 (k(i)) {
|
|
327
|
+
const a = +r[r.length - 2], n = S(i, a);
|
|
328
328
|
switch (+s == 0 ? "key" : "value") {
|
|
329
329
|
case "key": {
|
|
330
330
|
const u = t(n);
|
|
@@ -339,45 +339,45 @@ const ut = (e, r) => {
|
|
|
339
339
|
}
|
|
340
340
|
return e;
|
|
341
341
|
};
|
|
342
|
-
function
|
|
342
|
+
function X(e, r, t = []) {
|
|
343
343
|
if (!e)
|
|
344
344
|
return;
|
|
345
345
|
if (!$(e)) {
|
|
346
|
-
O(e, (a, n) =>
|
|
346
|
+
O(e, (a, n) => X(a, r, [...t, ...B(n)]));
|
|
347
347
|
return;
|
|
348
348
|
}
|
|
349
349
|
const [i, s] = e;
|
|
350
350
|
s && O(s, (a, n) => {
|
|
351
|
-
|
|
351
|
+
X(a, r, [...t, ...B(n)]);
|
|
352
352
|
}), r(i, t);
|
|
353
353
|
}
|
|
354
|
-
function
|
|
355
|
-
return
|
|
356
|
-
e =
|
|
354
|
+
function ft(e, r, t) {
|
|
355
|
+
return X(r, (i, s) => {
|
|
356
|
+
e = H(e, s, (a) => lt(a, i, t));
|
|
357
357
|
}), e;
|
|
358
358
|
}
|
|
359
|
-
function
|
|
359
|
+
function dt(e, r) {
|
|
360
360
|
function t(i, s) {
|
|
361
|
-
const a =
|
|
362
|
-
i.map(
|
|
363
|
-
e =
|
|
361
|
+
const a = ct(e, B(s));
|
|
362
|
+
i.map(B).forEach((n) => {
|
|
363
|
+
e = H(e, n, () => a);
|
|
364
364
|
});
|
|
365
365
|
}
|
|
366
366
|
if ($(r)) {
|
|
367
367
|
const [i, s] = r;
|
|
368
368
|
i.forEach((a) => {
|
|
369
|
-
e =
|
|
369
|
+
e = H(e, B(a), () => e);
|
|
370
370
|
}), s && O(s, t);
|
|
371
371
|
} else
|
|
372
372
|
O(r, t);
|
|
373
373
|
return e;
|
|
374
374
|
}
|
|
375
|
-
const
|
|
376
|
-
function
|
|
375
|
+
const pt = (e, r) => P(e) || $(e) || k(e) || I(e) || xe(e, r);
|
|
376
|
+
function yt(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 mt(e, r) {
|
|
381
381
|
const t = {};
|
|
382
382
|
let i;
|
|
383
383
|
return e.forEach((s) => {
|
|
@@ -385,64 +385,64 @@ function yt(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(
|
|
389
|
-
}), i ?
|
|
388
|
+
a.length === 0 ? i = n.map(W) : t[W(a)] = n.map(W);
|
|
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
392
|
var b;
|
|
393
|
-
const o =
|
|
393
|
+
const o = tt(e);
|
|
394
394
|
if (!o) {
|
|
395
|
-
|
|
395
|
+
yt(e, s, r);
|
|
396
396
|
const f = n.get(e);
|
|
397
397
|
if (f)
|
|
398
398
|
return i ? {
|
|
399
399
|
transformedValue: null
|
|
400
400
|
} : f;
|
|
401
401
|
}
|
|
402
|
-
if (!
|
|
403
|
-
const f = pe(e, t),
|
|
402
|
+
if (!pt(e, t)) {
|
|
403
|
+
const f = pe(e, t), p = f ? {
|
|
404
404
|
transformedValue: f.value,
|
|
405
405
|
annotations: [f.type]
|
|
406
406
|
} : {
|
|
407
407
|
transformedValue: e
|
|
408
408
|
};
|
|
409
|
-
return o || n.set(e,
|
|
409
|
+
return o || n.set(e, p), p;
|
|
410
410
|
}
|
|
411
|
-
if (
|
|
411
|
+
if (L(a, e))
|
|
412
412
|
return {
|
|
413
413
|
transformedValue: null
|
|
414
414
|
};
|
|
415
415
|
const u = pe(e, t), c = (b = u == null ? void 0 : u.value) != null ? b : e, d = $(c) ? [] : {}, g = {};
|
|
416
|
-
O(c, (f,
|
|
417
|
-
if (
|
|
418
|
-
throw new Error(`Detected property ${
|
|
419
|
-
const C = Re(f, r, t, i, [...s,
|
|
420
|
-
d[
|
|
421
|
-
g[qe(
|
|
416
|
+
O(c, (f, p) => {
|
|
417
|
+
if (p === "__proto__" || p === "constructor" || p === "prototype")
|
|
418
|
+
throw new Error(`Detected property ${p}. This is a prototype pollution risk, please remove it from your object.`);
|
|
419
|
+
const C = Re(f, r, t, i, [...s, p], [...a, e], n);
|
|
420
|
+
d[p] = C.transformedValue, $(C.annotations) ? g[p] = C.annotations : P(C.annotations) && O(C.annotations, (T, N) => {
|
|
421
|
+
g[qe(p) + "." + N] = T;
|
|
422
422
|
});
|
|
423
423
|
});
|
|
424
|
-
const
|
|
424
|
+
const y = Y(g) ? {
|
|
425
425
|
transformedValue: d,
|
|
426
426
|
annotations: u ? [u.type] : void 0
|
|
427
427
|
} : {
|
|
428
428
|
transformedValue: d,
|
|
429
429
|
annotations: u ? [u.type, g] : g
|
|
430
430
|
};
|
|
431
|
-
return o || n.set(e,
|
|
431
|
+
return o || n.set(e, y), y;
|
|
432
432
|
};
|
|
433
|
-
function
|
|
433
|
+
function Ne(e) {
|
|
434
434
|
return Object.prototype.toString.call(e).slice(8, -1);
|
|
435
435
|
}
|
|
436
|
-
function
|
|
437
|
-
return
|
|
436
|
+
function ye(e) {
|
|
437
|
+
return Ne(e) === "Array";
|
|
438
438
|
}
|
|
439
|
-
function
|
|
440
|
-
if (
|
|
439
|
+
function gt(e) {
|
|
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 bt(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 mt(e, r, t, i, s) {
|
|
|
451
451
|
configurable: !0
|
|
452
452
|
});
|
|
453
453
|
}
|
|
454
|
-
function
|
|
455
|
-
if (
|
|
456
|
-
return e.map((s) =>
|
|
457
|
-
if (!
|
|
454
|
+
function Z(e, r = {}) {
|
|
455
|
+
if (ye(e))
|
|
456
|
+
return e.map((s) => Z(s, r));
|
|
457
|
+
if (!gt(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
|
-
if (
|
|
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 = Z(n, r);
|
|
464
|
+
return bt(s, a, o, e, r.nonenumerable), s;
|
|
465
465
|
}, {});
|
|
466
466
|
}
|
|
467
467
|
class l {
|
|
@@ -469,10 +469,10 @@ 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 jr(), this.symbolRegistry = new be((t) => {
|
|
473
473
|
var i;
|
|
474
474
|
return (i = t.description) != null ? i : "";
|
|
475
|
-
}), this.customTransformerRegistry = new
|
|
475
|
+
}), this.customTransformerRegistry = new Qr(), 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 = {
|
|
@@ -481,15 +481,15 @@ class l {
|
|
|
481
481
|
i.annotations && (s.meta = q(h({}, s.meta), {
|
|
482
482
|
values: i.annotations
|
|
483
483
|
}));
|
|
484
|
-
const a =
|
|
484
|
+
const a = mt(t, this.dedupe);
|
|
485
485
|
return a && (s.meta = q(h({}, 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 = Z(t);
|
|
492
|
+
return i != null && i.values && (s = ft(s, i.values, this)), i != null && i.referentialEqualities && (s = dt(s, i.referentialEqualities)), s;
|
|
493
493
|
}
|
|
494
494
|
stringify(r) {
|
|
495
495
|
return JSON.stringify(this.serialize(r));
|
|
@@ -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 ? Dr.None : e, ht = (e) => new Qe(e.metadataItem, e.type), v = (e) => new cr(
|
|
525
525
|
e.name,
|
|
526
526
|
e.expression,
|
|
527
527
|
e.type,
|
|
@@ -529,7 +529,7 @@ const R = (e) => e === void 0 ? Cr.None : e, gt = (e) => new je(e.metadataItem,
|
|
|
529
529
|
R(e.sort),
|
|
530
530
|
e.dataSource,
|
|
531
531
|
e.composeCode
|
|
532
|
-
),
|
|
532
|
+
), ee = (e) => new fr(
|
|
533
533
|
e.name,
|
|
534
534
|
e.expression,
|
|
535
535
|
e.granularity,
|
|
@@ -541,40 +541,40 @@ const R = (e) => e === void 0 ? Cr.None : e, gt = (e) => new je(e.metadataItem,
|
|
|
541
541
|
), F = (e) => {
|
|
542
542
|
switch (e.__serializable) {
|
|
543
543
|
case "DimensionalAttribute":
|
|
544
|
-
return
|
|
544
|
+
return v(e);
|
|
545
545
|
case "DimensionalLevelAttribute":
|
|
546
|
-
return
|
|
546
|
+
return ee(e);
|
|
547
547
|
default:
|
|
548
548
|
return e;
|
|
549
549
|
}
|
|
550
|
-
},
|
|
550
|
+
}, Se = (e) => new Lr(
|
|
551
551
|
e.name,
|
|
552
552
|
e.expression,
|
|
553
553
|
e.attributes.map(F),
|
|
554
|
-
e.dimensions.map(
|
|
554
|
+
e.dimensions.map(Ft),
|
|
555
555
|
e.type,
|
|
556
556
|
e.description,
|
|
557
557
|
R(e.sort),
|
|
558
558
|
e.dataSource,
|
|
559
559
|
e.composeCode,
|
|
560
560
|
e.defaultAttribute ? F(e.defaultAttribute) : void 0
|
|
561
|
-
),
|
|
561
|
+
), ze = (e) => new Vr(
|
|
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
|
+
), Ft = (e) => {
|
|
569
569
|
switch (e.__serializable) {
|
|
570
570
|
case "DimensionalDimension":
|
|
571
|
-
return
|
|
571
|
+
return Se(e);
|
|
572
572
|
case "DimensionalDateDimension":
|
|
573
|
-
return
|
|
573
|
+
return ze(e);
|
|
574
574
|
default:
|
|
575
575
|
return e;
|
|
576
576
|
}
|
|
577
|
-
},
|
|
577
|
+
}, re = (e) => new dr(
|
|
578
578
|
e.name,
|
|
579
579
|
F(e.attribute),
|
|
580
580
|
e.aggregation,
|
|
@@ -583,26 +583,26 @@ const R = (e) => e === void 0 ? Cr.None : e, gt = (e) => new je(e.metadataItem,
|
|
|
583
583
|
R(e.sort),
|
|
584
584
|
e.dataSource,
|
|
585
585
|
e.composeCode
|
|
586
|
-
),
|
|
586
|
+
), te = (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,
|
|
592
|
+
return [t, v(i)];
|
|
593
593
|
case "DimensionalLevelAttribute":
|
|
594
|
-
return [t,
|
|
594
|
+
return [t, ee(i)];
|
|
595
595
|
case "DimensionalBaseMeasure":
|
|
596
|
-
return [t,
|
|
596
|
+
return [t, re(i)];
|
|
597
597
|
case "DimensionalCalculatedMeasure":
|
|
598
|
-
return [t,
|
|
598
|
+
return [t, te(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 pr(
|
|
606
606
|
e.name,
|
|
607
607
|
e.expression,
|
|
608
608
|
r,
|
|
@@ -612,7 +612,7 @@ const R = (e) => e === void 0 ? Cr.None : e, gt = (e) => new je(e.metadataItem,
|
|
|
612
612
|
e.dataSource,
|
|
613
613
|
e.composeCode
|
|
614
614
|
);
|
|
615
|
-
}, Oe = (e) => new
|
|
615
|
+
}, Oe = (e) => new yr(
|
|
616
616
|
e.name,
|
|
617
617
|
F(e.attribute),
|
|
618
618
|
e.format,
|
|
@@ -620,12 +620,12 @@ const R = (e) => e === void 0 ? Cr.None : e, gt = (e) => new je(e.metadataItem,
|
|
|
620
620
|
R(e.sort),
|
|
621
621
|
e.dataSource,
|
|
622
622
|
e.composeCode
|
|
623
|
-
),
|
|
623
|
+
), K = (e) => {
|
|
624
624
|
switch (e.__serializable) {
|
|
625
625
|
case "DimensionalBaseMeasure":
|
|
626
|
-
return
|
|
626
|
+
return re(e);
|
|
627
627
|
case "DimensionalCalculatedMeasure":
|
|
628
|
-
return
|
|
628
|
+
return te(e);
|
|
629
629
|
case "DimensionalMeasureTemplate":
|
|
630
630
|
return Oe(e);
|
|
631
631
|
default:
|
|
@@ -634,36 +634,36 @@ const R = (e) => e === void 0 ? Cr.None : e, gt = (e) => new je(e.metadataItem,
|
|
|
634
634
|
}, m = (e) => {
|
|
635
635
|
switch (e.__serializable) {
|
|
636
636
|
case "MembersFilter":
|
|
637
|
-
return new
|
|
637
|
+
return new $r(
|
|
638
638
|
F(e.attribute),
|
|
639
639
|
e.members,
|
|
640
640
|
e.config.backgroundFilter ? q(h({}, e.config), { backgroundFilter: m(e.config.backgroundFilter) }) : e.config,
|
|
641
641
|
e.composeCode
|
|
642
642
|
);
|
|
643
643
|
case "LogicalAttributeFilter":
|
|
644
|
-
return new
|
|
644
|
+
return new Cr(
|
|
645
645
|
e.filters.map((t) => m(t)),
|
|
646
646
|
e.operator,
|
|
647
647
|
e.config,
|
|
648
648
|
e.composeCode
|
|
649
649
|
);
|
|
650
650
|
case "CascadingFilter":
|
|
651
|
-
return new
|
|
651
|
+
return new xr(
|
|
652
652
|
e._filters.map((t) => m(t)),
|
|
653
653
|
e.config,
|
|
654
654
|
e.composeCode
|
|
655
655
|
);
|
|
656
656
|
case "ExcludeFilter":
|
|
657
|
-
return new
|
|
657
|
+
return new Ar(
|
|
658
658
|
m(e.filter),
|
|
659
659
|
e.input ? m(e.input) : void 0,
|
|
660
660
|
e.config,
|
|
661
661
|
e.composeCode
|
|
662
662
|
);
|
|
663
663
|
case "MeasureFilter":
|
|
664
|
-
return new
|
|
664
|
+
return new Er(
|
|
665
665
|
F(e.attribute),
|
|
666
|
-
|
|
666
|
+
K(e.measure),
|
|
667
667
|
e.operatorA,
|
|
668
668
|
e.valueA,
|
|
669
669
|
e.operatorB,
|
|
@@ -672,24 +672,24 @@ const R = (e) => e === void 0 ? Cr.None : e, gt = (e) => new je(e.metadataItem,
|
|
|
672
672
|
e.composeCode
|
|
673
673
|
);
|
|
674
674
|
case "RankingFilter":
|
|
675
|
-
return new
|
|
675
|
+
return new wr(
|
|
676
676
|
F(e.attribute),
|
|
677
|
-
|
|
677
|
+
K(e.measure),
|
|
678
678
|
e.operator,
|
|
679
679
|
e.count,
|
|
680
680
|
e.config,
|
|
681
681
|
e.composeCode
|
|
682
682
|
);
|
|
683
683
|
case "MeasureRankingFilter":
|
|
684
|
-
return new
|
|
685
|
-
|
|
684
|
+
return new qr(
|
|
685
|
+
K(e.measure),
|
|
686
686
|
e.operator,
|
|
687
687
|
e.count,
|
|
688
688
|
e.config,
|
|
689
689
|
e.composeCode
|
|
690
690
|
);
|
|
691
691
|
case "NumericFilter":
|
|
692
|
-
return new
|
|
692
|
+
return new Fr(
|
|
693
693
|
F(e.attribute),
|
|
694
694
|
e.operatorA,
|
|
695
695
|
e.valueA,
|
|
@@ -699,7 +699,7 @@ const R = (e) => e === void 0 ? Cr.None : e, gt = (e) => new je(e.metadataItem,
|
|
|
699
699
|
e.composeCode
|
|
700
700
|
);
|
|
701
701
|
case "TextFilter":
|
|
702
|
-
return new
|
|
702
|
+
return new hr(
|
|
703
703
|
F(e.attribute),
|
|
704
704
|
e.operatorA,
|
|
705
705
|
e.valueA,
|
|
@@ -708,7 +708,7 @@ const R = (e) => e === void 0 ? Cr.None : e, gt = (e) => new je(e.metadataItem,
|
|
|
708
708
|
);
|
|
709
709
|
case "DateRangeFilter": {
|
|
710
710
|
const { valueA: t, valueB: i } = e;
|
|
711
|
-
return new
|
|
711
|
+
return new br(
|
|
712
712
|
F(e.attribute),
|
|
713
713
|
t,
|
|
714
714
|
i,
|
|
@@ -717,7 +717,7 @@ const R = (e) => e === void 0 ? Cr.None : e, gt = (e) => new je(e.metadataItem,
|
|
|
717
717
|
);
|
|
718
718
|
}
|
|
719
719
|
case "RelativeDateFilter":
|
|
720
|
-
return new
|
|
720
|
+
return new gr(
|
|
721
721
|
F(e.attribute),
|
|
722
722
|
e.offset,
|
|
723
723
|
e.count,
|
|
@@ -727,7 +727,7 @@ const R = (e) => e === void 0 ? Cr.None : e, gt = (e) => new je(e.metadataItem,
|
|
|
727
727
|
e.composeCode
|
|
728
728
|
);
|
|
729
729
|
case "CustomFilter":
|
|
730
|
-
return new
|
|
730
|
+
return new mr(
|
|
731
731
|
F(e.attribute),
|
|
732
732
|
e.jaqlExpression,
|
|
733
733
|
e.config,
|
|
@@ -739,63 +739,63 @@ const R = (e) => e === void 0 ? Cr.None : e, gt = (e) => new je(e.metadataItem,
|
|
|
739
739
|
};
|
|
740
740
|
l.registerCustom(
|
|
741
741
|
{
|
|
742
|
-
isApplicable:
|
|
742
|
+
isApplicable: Ke,
|
|
743
743
|
serialize: (e) => e.serialize(),
|
|
744
|
-
deserialize: (e) =>
|
|
744
|
+
deserialize: (e) => ht(e)
|
|
745
745
|
},
|
|
746
746
|
"JaqlElement"
|
|
747
747
|
);
|
|
748
748
|
l.registerCustom(
|
|
749
749
|
{
|
|
750
|
-
isApplicable:
|
|
750
|
+
isApplicable: Ye,
|
|
751
751
|
serialize: (e) => e.serialize(),
|
|
752
|
-
deserialize: (e) =>
|
|
752
|
+
deserialize: (e) => v(e)
|
|
753
753
|
},
|
|
754
754
|
"DimensionalAttribute"
|
|
755
755
|
);
|
|
756
756
|
l.registerCustom(
|
|
757
757
|
{
|
|
758
|
-
isApplicable:
|
|
758
|
+
isApplicable: He,
|
|
759
759
|
serialize: (e) => e.serialize(),
|
|
760
|
-
deserialize: (e) =>
|
|
760
|
+
deserialize: (e) => ee(e)
|
|
761
761
|
},
|
|
762
762
|
"DimensionalLevelAttribute"
|
|
763
763
|
);
|
|
764
764
|
l.registerCustom(
|
|
765
765
|
{
|
|
766
|
-
isApplicable:
|
|
766
|
+
isApplicable: Ir,
|
|
767
767
|
serialize: (e) => e.serialize(),
|
|
768
|
-
deserialize: (e) =>
|
|
768
|
+
deserialize: (e) => Se(e)
|
|
769
769
|
},
|
|
770
770
|
"DimensionalDimension"
|
|
771
771
|
);
|
|
772
772
|
l.registerCustom(
|
|
773
773
|
{
|
|
774
|
-
isApplicable:
|
|
774
|
+
isApplicable: _r,
|
|
775
775
|
serialize: (e) => e.serialize(),
|
|
776
|
-
deserialize: (e) =>
|
|
776
|
+
deserialize: (e) => ze(e)
|
|
777
777
|
},
|
|
778
778
|
"DimensionalDateDimension"
|
|
779
779
|
);
|
|
780
780
|
l.registerCustom(
|
|
781
781
|
{
|
|
782
|
-
isApplicable:
|
|
782
|
+
isApplicable: Xe,
|
|
783
783
|
serialize: (e) => e.serialize(),
|
|
784
|
-
deserialize: (e) =>
|
|
784
|
+
deserialize: (e) => re(e)
|
|
785
785
|
},
|
|
786
786
|
"DimensionalBaseMeasure"
|
|
787
787
|
);
|
|
788
788
|
l.registerCustom(
|
|
789
789
|
{
|
|
790
|
-
isApplicable:
|
|
790
|
+
isApplicable: Ze,
|
|
791
791
|
serialize: (e) => e.serialize(),
|
|
792
|
-
deserialize: (e) =>
|
|
792
|
+
deserialize: (e) => te(e)
|
|
793
793
|
},
|
|
794
794
|
"DimensionalCalculatedMeasure"
|
|
795
795
|
);
|
|
796
796
|
l.registerCustom(
|
|
797
797
|
{
|
|
798
|
-
isApplicable:
|
|
798
|
+
isApplicable: Ge,
|
|
799
799
|
serialize: (e) => e.serialize(),
|
|
800
800
|
deserialize: (e) => Oe(e)
|
|
801
801
|
},
|
|
@@ -803,7 +803,7 @@ l.registerCustom(
|
|
|
803
803
|
);
|
|
804
804
|
l.registerCustom(
|
|
805
805
|
{
|
|
806
|
-
isApplicable:
|
|
806
|
+
isApplicable: G,
|
|
807
807
|
serialize: (e) => e.serialize(),
|
|
808
808
|
deserialize: (e) => m(e)
|
|
809
809
|
},
|
|
@@ -811,7 +811,7 @@ l.registerCustom(
|
|
|
811
811
|
);
|
|
812
812
|
l.registerCustom(
|
|
813
813
|
{
|
|
814
|
-
isApplicable:
|
|
814
|
+
isApplicable: ve,
|
|
815
815
|
serialize: (e) => e.serialize(),
|
|
816
816
|
deserialize: (e) => m(e)
|
|
817
817
|
},
|
|
@@ -819,7 +819,7 @@ l.registerCustom(
|
|
|
819
819
|
);
|
|
820
820
|
l.registerCustom(
|
|
821
821
|
{
|
|
822
|
-
isApplicable:
|
|
822
|
+
isApplicable: er,
|
|
823
823
|
serialize: (e) => e.serialize(),
|
|
824
824
|
deserialize: (e) => m(e)
|
|
825
825
|
},
|
|
@@ -827,7 +827,7 @@ l.registerCustom(
|
|
|
827
827
|
);
|
|
828
828
|
l.registerCustom(
|
|
829
829
|
{
|
|
830
|
-
isApplicable:
|
|
830
|
+
isApplicable: rr,
|
|
831
831
|
serialize: (e) => e.serialize(),
|
|
832
832
|
deserialize: (e) => m(e)
|
|
833
833
|
},
|
|
@@ -835,7 +835,7 @@ l.registerCustom(
|
|
|
835
835
|
);
|
|
836
836
|
l.registerCustom(
|
|
837
837
|
{
|
|
838
|
-
isApplicable:
|
|
838
|
+
isApplicable: tr,
|
|
839
839
|
serialize: (e) => e.serialize(),
|
|
840
840
|
deserialize: (e) => m(e)
|
|
841
841
|
},
|
|
@@ -843,7 +843,7 @@ l.registerCustom(
|
|
|
843
843
|
);
|
|
844
844
|
l.registerCustom(
|
|
845
845
|
{
|
|
846
|
-
isApplicable:
|
|
846
|
+
isApplicable: ir,
|
|
847
847
|
serialize: (e) => e.serialize(),
|
|
848
848
|
deserialize: (e) => m(e)
|
|
849
849
|
},
|
|
@@ -851,7 +851,7 @@ l.registerCustom(
|
|
|
851
851
|
);
|
|
852
852
|
l.registerCustom(
|
|
853
853
|
{
|
|
854
|
-
isApplicable:
|
|
854
|
+
isApplicable: sr,
|
|
855
855
|
serialize: (e) => e.serialize(),
|
|
856
856
|
deserialize: (e) => m(e)
|
|
857
857
|
},
|
|
@@ -859,7 +859,7 @@ l.registerCustom(
|
|
|
859
859
|
);
|
|
860
860
|
l.registerCustom(
|
|
861
861
|
{
|
|
862
|
-
isApplicable:
|
|
862
|
+
isApplicable: nr,
|
|
863
863
|
serialize: (e) => e.serialize(),
|
|
864
864
|
deserialize: (e) => m(e)
|
|
865
865
|
},
|
|
@@ -867,7 +867,7 @@ l.registerCustom(
|
|
|
867
867
|
);
|
|
868
868
|
l.registerCustom(
|
|
869
869
|
{
|
|
870
|
-
isApplicable:
|
|
870
|
+
isApplicable: ar,
|
|
871
871
|
serialize: (e) => e.serialize(),
|
|
872
872
|
deserialize: (e) => m(e)
|
|
873
873
|
},
|
|
@@ -875,7 +875,7 @@ l.registerCustom(
|
|
|
875
875
|
);
|
|
876
876
|
l.registerCustom(
|
|
877
877
|
{
|
|
878
|
-
isApplicable:
|
|
878
|
+
isApplicable: or,
|
|
879
879
|
serialize: (e) => e.serialize(),
|
|
880
880
|
deserialize: (e) => m(e)
|
|
881
881
|
},
|
|
@@ -883,7 +883,7 @@ l.registerCustom(
|
|
|
883
883
|
);
|
|
884
884
|
l.registerCustom(
|
|
885
885
|
{
|
|
886
|
-
isApplicable:
|
|
886
|
+
isApplicable: ur,
|
|
887
887
|
serialize: (e) => e.serialize(),
|
|
888
888
|
deserialize: (e) => m(e)
|
|
889
889
|
},
|
|
@@ -891,91 +891,95 @@ l.registerCustom(
|
|
|
891
891
|
);
|
|
892
892
|
l.registerCustom(
|
|
893
893
|
{
|
|
894
|
-
isApplicable:
|
|
894
|
+
isApplicable: lr,
|
|
895
895
|
serialize: (e) => e.serialize(),
|
|
896
896
|
deserialize: (e) => m(e)
|
|
897
897
|
},
|
|
898
898
|
"CustomFilter"
|
|
899
899
|
);
|
|
900
|
-
const
|
|
901
|
-
function
|
|
900
|
+
const ti = l, x = "DM.";
|
|
901
|
+
function A(e) {
|
|
902
902
|
return typeof e == "object" && e !== null && "function" in e && "args" in e;
|
|
903
903
|
}
|
|
904
|
-
function
|
|
905
|
-
return e.every(
|
|
904
|
+
function ie(e) {
|
|
905
|
+
return e.every(A);
|
|
906
906
|
}
|
|
907
|
-
function
|
|
907
|
+
function U(e) {
|
|
908
908
|
return "attribute" in e && "config" in e;
|
|
909
909
|
}
|
|
910
|
-
function
|
|
910
|
+
function _(e) {
|
|
911
911
|
return "left" in e && "right" in e && "operator" in e;
|
|
912
912
|
}
|
|
913
913
|
function Te(e) {
|
|
914
|
-
return !
|
|
914
|
+
return !U(e) && !_(e);
|
|
915
915
|
}
|
|
916
|
-
function
|
|
916
|
+
function qt(e) {
|
|
917
917
|
return e.every((r) => typeof r == "string");
|
|
918
918
|
}
|
|
919
|
-
function
|
|
919
|
+
function Be(e) {
|
|
920
920
|
const r = e.split(".");
|
|
921
|
-
if (r.length < 3 || `${r[0]}.` !==
|
|
921
|
+
if (r.length < 3 || `${r[0]}.` !== x)
|
|
922
922
|
throw new Error(
|
|
923
|
-
`Invalid
|
|
923
|
+
`Invalid dimensional element name format: "${e}". Expected format: "${x}TableName.ColumnName[.Level]"`
|
|
924
924
|
);
|
|
925
925
|
const t = r[1], i = r[2];
|
|
926
926
|
let s;
|
|
927
927
|
return r.length === 4 && (s = r[3]), { tableName: t, columnName: i, level: s };
|
|
928
928
|
}
|
|
929
|
-
function
|
|
930
|
-
const
|
|
931
|
-
if (!
|
|
932
|
-
throw new Error(`Table "${
|
|
933
|
-
const
|
|
934
|
-
if (!
|
|
935
|
-
throw new Error(`Column "${
|
|
929
|
+
function Pe(e, r, t) {
|
|
930
|
+
const i = t.find((a) => a.name === e);
|
|
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);
|
|
936
940
|
if (s) {
|
|
937
|
-
if (!
|
|
941
|
+
if (!ge(a.dataType))
|
|
938
942
|
throw new Error(
|
|
939
|
-
`Invalid date level "${s}" in
|
|
943
|
+
`Invalid date level "${s}" in dimensional element "${e}". Column "${t}.${i}" is not a datetime column`
|
|
940
944
|
);
|
|
941
|
-
const
|
|
942
|
-
if (!
|
|
945
|
+
const n = j.all;
|
|
946
|
+
if (!n.includes(s))
|
|
943
947
|
throw new Error(
|
|
944
|
-
`Invalid date level "${s}" in
|
|
948
|
+
`Invalid date level "${s}" in dimensional element "${e}". Valid levels are: ${n.join(
|
|
945
949
|
", "
|
|
946
950
|
)}`
|
|
947
951
|
);
|
|
948
|
-
const
|
|
949
|
-
if (
|
|
952
|
+
const o = j.dateOnly;
|
|
953
|
+
if (a.dataType === "date" && !o.includes(s))
|
|
950
954
|
throw new Error(
|
|
951
|
-
`Invalid level "${s}" in
|
|
955
|
+
`Invalid level "${s}" in dimensional element "${e}". Column "${t}.${i}" is only a date column, not a datetime column`
|
|
952
956
|
);
|
|
953
|
-
const
|
|
954
|
-
if (
|
|
957
|
+
const u = j.timeOnly;
|
|
958
|
+
if (a.dataType === "time" && !u.includes(s))
|
|
955
959
|
throw new Error(
|
|
956
|
-
`Invalid level "${s}" in
|
|
960
|
+
`Invalid level "${s}" in dimensional element "${e}". Column "${t}.${i}" is only a time column, not a date column`
|
|
957
961
|
);
|
|
958
962
|
}
|
|
959
|
-
return {
|
|
960
|
-
}
|
|
961
|
-
function Be(e) {
|
|
962
|
-
return e.type === N.TextAttribute;
|
|
963
|
+
return { column: a, level: s };
|
|
963
964
|
}
|
|
964
|
-
function
|
|
965
|
-
return e.type ===
|
|
965
|
+
function ke(e) {
|
|
966
|
+
return e.type === z.TextAttribute;
|
|
966
967
|
}
|
|
967
|
-
function
|
|
968
|
-
return e.type ===
|
|
968
|
+
function Ie(e) {
|
|
969
|
+
return e.type === z.NumericAttribute;
|
|
969
970
|
}
|
|
970
971
|
function Et(e) {
|
|
971
|
-
return
|
|
972
|
+
return e.type === z.DateLevel;
|
|
972
973
|
}
|
|
973
|
-
function
|
|
974
|
-
return e
|
|
974
|
+
function At(e) {
|
|
975
|
+
return ke(e) || Ie(e);
|
|
975
976
|
}
|
|
976
|
-
function
|
|
977
|
-
|
|
978
|
-
|
|
977
|
+
function J(e) {
|
|
978
|
+
return e.type === z.TextAttribute ? "text" : e.type === z.NumericAttribute ? "numeric" : e.type === z.DateLevel ? "date/datetime" : "unknown";
|
|
979
|
+
}
|
|
980
|
+
function se(e, r, t) {
|
|
981
|
+
const { column: i, level: s } = wt(e, t);
|
|
982
|
+
return Mr({
|
|
979
983
|
expression: i.expression,
|
|
980
984
|
dataType: i.dataType,
|
|
981
985
|
granularity: s,
|
|
@@ -984,11 +988,28 @@ function ae(e, r, t) {
|
|
|
984
988
|
dataSource: r
|
|
985
989
|
});
|
|
986
990
|
}
|
|
987
|
-
|
|
991
|
+
function xt(e, r, t) {
|
|
992
|
+
const { tableName: i, columnName: s, level: a } = Be(e);
|
|
993
|
+
if (a)
|
|
994
|
+
throw new Error(
|
|
995
|
+
`Invalid DateDimension name format: "${e}". Expected format: "${x}TableName.ColumnName"`
|
|
996
|
+
);
|
|
997
|
+
const { column: n } = Pe(i, s, t);
|
|
998
|
+
if (!ge(n.dataType))
|
|
999
|
+
throw new Error(
|
|
1000
|
+
`Invalid DateDimension name "${e}". Column "${i}.${s}" is not a datetime column (got ${n.dataType}).`
|
|
1001
|
+
);
|
|
1002
|
+
return Ur({
|
|
1003
|
+
name: s,
|
|
1004
|
+
expression: n.expression,
|
|
1005
|
+
dataSource: r
|
|
1006
|
+
});
|
|
1007
|
+
}
|
|
1008
|
+
const Ct = (e) => {
|
|
988
1009
|
const { data: r } = e, { dataSource: t, tables: i } = e.context;
|
|
989
1010
|
if (!r)
|
|
990
1011
|
return { success: !0, data: [] };
|
|
991
|
-
if (!
|
|
1012
|
+
if (!qt(r))
|
|
992
1013
|
return {
|
|
993
1014
|
success: !1,
|
|
994
1015
|
errors: [
|
|
@@ -1008,7 +1029,7 @@ const At = (e) => {
|
|
|
1008
1029
|
input: n
|
|
1009
1030
|
};
|
|
1010
1031
|
try {
|
|
1011
|
-
const c =
|
|
1032
|
+
const c = se(n, t, i);
|
|
1012
1033
|
s.push(c);
|
|
1013
1034
|
} catch (c) {
|
|
1014
1035
|
const d = c instanceof Error ? c.message : "Unknown error";
|
|
@@ -1016,44 +1037,44 @@ const At = (e) => {
|
|
|
1016
1037
|
}
|
|
1017
1038
|
}), a.length > 0 ? { success: !1, errors: a } : { success: !0, data: s };
|
|
1018
1039
|
};
|
|
1019
|
-
function
|
|
1040
|
+
function ne(e, r) {
|
|
1020
1041
|
const t = Reflect.get(e, r);
|
|
1021
1042
|
if (typeof t != "function")
|
|
1022
1043
|
throw new Error(`Function "${r}" not found or is not a function`);
|
|
1023
1044
|
return t;
|
|
1024
1045
|
}
|
|
1025
|
-
function
|
|
1026
|
-
const t = e.replace("measureFactory.", ""), s =
|
|
1046
|
+
function $t(e, r) {
|
|
1047
|
+
const t = e.replace("measureFactory.", ""), s = ne(Rr, t)(...r);
|
|
1027
1048
|
if (!Te(s))
|
|
1028
1049
|
throw new Error(`Function "${e}" did not return a valid Measure`);
|
|
1029
1050
|
return s;
|
|
1030
1051
|
}
|
|
1031
|
-
function
|
|
1032
|
-
const t = e.replace("filterFactory.logic.", ""), s =
|
|
1033
|
-
if (!
|
|
1052
|
+
function Dt(e, r) {
|
|
1053
|
+
const t = e.replace("filterFactory.logic.", ""), s = ne(Nr, t)(...r);
|
|
1054
|
+
if (!_(s))
|
|
1034
1055
|
throw new Error(`Function "${e}" did not return a valid FilterRelations`);
|
|
1035
1056
|
return s;
|
|
1036
1057
|
}
|
|
1037
|
-
function
|
|
1058
|
+
function Mt(e, r) {
|
|
1038
1059
|
if (e.startsWith("filterFactory.logic."))
|
|
1039
|
-
return
|
|
1040
|
-
const t = e.replace("filterFactory.", ""), s =
|
|
1041
|
-
if (!
|
|
1060
|
+
return Dt(e, r);
|
|
1061
|
+
const t = e.replace("filterFactory.", ""), s = ne(Sr, t)(...r);
|
|
1062
|
+
if (!U(s) && !_(s))
|
|
1042
1063
|
throw new Error(`Function "${e}" did not return a valid Filter or FilterRelations`);
|
|
1043
1064
|
return s;
|
|
1044
1065
|
}
|
|
1045
|
-
function
|
|
1066
|
+
function Rt(e, r) {
|
|
1046
1067
|
const i = e.split(".")[0];
|
|
1047
1068
|
if (i === "measureFactory")
|
|
1048
|
-
return xt(e, r);
|
|
1049
|
-
if (i === "filterFactory")
|
|
1050
1069
|
return $t(e, r);
|
|
1070
|
+
if (i === "filterFactory")
|
|
1071
|
+
return Mt(e, r);
|
|
1051
1072
|
throw new Error(
|
|
1052
1073
|
`Unsupported factory: "${i}". Supported factories: measureFactory, filterFactory`
|
|
1053
1074
|
);
|
|
1054
1075
|
}
|
|
1055
|
-
const
|
|
1056
|
-
function
|
|
1076
|
+
const Nt = /\[([a-zA-Z_][a-zA-Z0-9_.-]*)\]/g;
|
|
1077
|
+
function St(e, r, t = {}) {
|
|
1057
1078
|
const {
|
|
1058
1079
|
warnUnusedContext: i = !0,
|
|
1059
1080
|
errorOnUnusedContext: s = !0,
|
|
@@ -1073,7 +1094,7 @@ function Rt(e, r, t = {}) {
|
|
|
1073
1094
|
return o.errors.push(
|
|
1074
1095
|
`${n}args[2]: Context cannot be empty - custom formulas require context definitions`
|
|
1075
1096
|
), o.isValid = !1, o;
|
|
1076
|
-
const c =
|
|
1097
|
+
const c = Nt, d = /* @__PURE__ */ new Set();
|
|
1077
1098
|
let g;
|
|
1078
1099
|
for (; (g = c.exec(e)) !== null; ) {
|
|
1079
1100
|
const b = g[1];
|
|
@@ -1082,13 +1103,13 @@ function Rt(e, r, t = {}) {
|
|
|
1082
1103
|
o.references = Array.from(d), o.references.length === 0 && o.warnings.push(
|
|
1083
1104
|
`${n}args[1]: No bracket references found in formula - ensure this is intentional`
|
|
1084
1105
|
);
|
|
1085
|
-
const
|
|
1106
|
+
const y = [];
|
|
1086
1107
|
for (const b of o.references)
|
|
1087
|
-
u.includes(b) ||
|
|
1088
|
-
if (
|
|
1089
|
-
`${n}args[1]: Reference [${
|
|
1108
|
+
u.includes(b) || y.push(b);
|
|
1109
|
+
if (y.length > 0 && (o.isValid = !1, y.length === 1 ? o.errors.push(
|
|
1110
|
+
`${n}args[1]: Reference [${y[0]}] not found in context. Available keys: ${u.join(", ")}`
|
|
1090
1111
|
) : o.errors.push(
|
|
1091
|
-
`${n}args[1]: References [${
|
|
1112
|
+
`${n}args[1]: References [${y.join(
|
|
1092
1113
|
"], ["
|
|
1093
1114
|
)}] not found in context. Available keys: ${u.join(", ")}`
|
|
1094
1115
|
)), (i || s) && u.length > 0) {
|
|
@@ -1102,17 +1123,17 @@ function Rt(e, r, t = {}) {
|
|
|
1102
1123
|
}
|
|
1103
1124
|
return o;
|
|
1104
1125
|
}
|
|
1105
|
-
function
|
|
1106
|
-
const i =
|
|
1126
|
+
function zt(e, r, t = {}) {
|
|
1127
|
+
const i = St(e, r, t);
|
|
1107
1128
|
if (!i.isValid)
|
|
1108
1129
|
throw new Error(i.errors.join("; "));
|
|
1109
1130
|
i.warnings.length > 0 && console.warn("Formula validation warnings:", i.warnings.join("; "));
|
|
1110
1131
|
}
|
|
1111
|
-
function
|
|
1132
|
+
function Ot(e, r) {
|
|
1112
1133
|
if (e.length < 3)
|
|
1113
1134
|
throw new Error(`${r.pathPrefix}Expected at least 3 arguments for customFormula`);
|
|
1114
1135
|
const t = e[1], i = e[2];
|
|
1115
|
-
|
|
1136
|
+
zt(t, i, {
|
|
1116
1137
|
errorPrefix: `${r.pathPrefix}`,
|
|
1117
1138
|
errorOnUnusedContext: !0,
|
|
1118
1139
|
// Strict validation: all context keys must be used
|
|
@@ -1122,7 +1143,7 @@ function zt(e, r) {
|
|
|
1122
1143
|
const s = {};
|
|
1123
1144
|
for (const [a, n] of Object.entries(i)) {
|
|
1124
1145
|
const o = `args[2].${a}`;
|
|
1125
|
-
if (
|
|
1146
|
+
if (A(n))
|
|
1126
1147
|
s[`${a}`] = w({
|
|
1127
1148
|
data: n,
|
|
1128
1149
|
context: {
|
|
@@ -1131,9 +1152,9 @@ function zt(e, r) {
|
|
|
1131
1152
|
pathPrefix: o
|
|
1132
1153
|
}
|
|
1133
1154
|
});
|
|
1134
|
-
else if (typeof n == "string" && n.startsWith(
|
|
1155
|
+
else if (typeof n == "string" && n.startsWith(x))
|
|
1135
1156
|
try {
|
|
1136
|
-
s[`${a}`] =
|
|
1157
|
+
s[`${a}`] = se(
|
|
1137
1158
|
n,
|
|
1138
1159
|
r.dataSource,
|
|
1139
1160
|
r.tables
|
|
@@ -1146,71 +1167,62 @@ function zt(e, r) {
|
|
|
1146
1167
|
s[`${a}`] = n;
|
|
1147
1168
|
else
|
|
1148
1169
|
throw new Error(
|
|
1149
|
-
`${o}: Invalid context value for key '${a}'. Expected a function call or attribute reference (${
|
|
1170
|
+
`${o}: Invalid context value for key '${a}'. Expected a function call or attribute reference (${x}...), but got: ${typeof n}`
|
|
1150
1171
|
);
|
|
1151
1172
|
}
|
|
1152
1173
|
e[2] = s;
|
|
1153
1174
|
}
|
|
1154
|
-
function
|
|
1175
|
+
function ae(e, r) {
|
|
1155
1176
|
const t = e[0];
|
|
1156
1177
|
if (!t || typeof t != "object" || !("type" in t))
|
|
1157
1178
|
throw new Error(`${r.pathPrefix}args[0]: Expected attribute as first argument`);
|
|
1158
1179
|
return t;
|
|
1159
1180
|
}
|
|
1160
|
-
function
|
|
1161
|
-
const t =
|
|
1162
|
-
if (!
|
|
1181
|
+
function me(e, r) {
|
|
1182
|
+
const t = ae(e, r);
|
|
1183
|
+
if (!At(t))
|
|
1163
1184
|
throw new Error(
|
|
1164
|
-
`${r.pathPrefix}args[0]: Attribute must be string or numeric type, got ${
|
|
1185
|
+
`${r.pathPrefix}args[0]: Attribute must be string or numeric type, got ${J(
|
|
1165
1186
|
t
|
|
1166
1187
|
)} attribute`
|
|
1167
1188
|
);
|
|
1168
1189
|
}
|
|
1169
1190
|
function D(e, r) {
|
|
1170
|
-
const t =
|
|
1171
|
-
if (!
|
|
1191
|
+
const t = ae(e, r);
|
|
1192
|
+
if (!Ie(t))
|
|
1172
1193
|
throw new Error(
|
|
1173
|
-
`${r.pathPrefix}args[0]: Attribute must be numeric type, got ${
|
|
1194
|
+
`${r.pathPrefix}args[0]: Attribute must be numeric type, got ${J(
|
|
1174
1195
|
t
|
|
1175
1196
|
)} attribute`
|
|
1176
1197
|
);
|
|
1177
1198
|
}
|
|
1178
1199
|
function M(e, r) {
|
|
1179
|
-
const t =
|
|
1180
|
-
if (!
|
|
1181
|
-
throw new Error(
|
|
1182
|
-
`${r.pathPrefix}args[0]: Attribute must be string type, got ${W(
|
|
1183
|
-
t
|
|
1184
|
-
)} attribute`
|
|
1185
|
-
);
|
|
1186
|
-
}
|
|
1187
|
-
function A(e, r) {
|
|
1188
|
-
const t = j(e, r);
|
|
1189
|
-
if (!wt(t))
|
|
1200
|
+
const t = ae(e, r);
|
|
1201
|
+
if (!ke(t))
|
|
1190
1202
|
throw new Error(
|
|
1191
|
-
`${r.pathPrefix}args[0]: Attribute must be
|
|
1203
|
+
`${r.pathPrefix}args[0]: Attribute must be string type, got ${J(
|
|
1192
1204
|
t
|
|
1193
1205
|
)} attribute`
|
|
1194
1206
|
);
|
|
1195
1207
|
}
|
|
1196
|
-
function
|
|
1208
|
+
function Tt(e, r) {
|
|
1197
1209
|
const t = e[0];
|
|
1198
1210
|
if (!t || typeof t != "object" || !("attribute" in t))
|
|
1199
1211
|
throw new Error(`${r.pathPrefix}args[0]: Expected filter as first argument`);
|
|
1200
1212
|
return t;
|
|
1201
1213
|
}
|
|
1202
|
-
function
|
|
1203
|
-
const t =
|
|
1204
|
-
if (!
|
|
1214
|
+
function Bt(e, r) {
|
|
1215
|
+
const t = Tt(e, r);
|
|
1216
|
+
if (!G(t))
|
|
1205
1217
|
throw new Error(
|
|
1206
1218
|
`${r.pathPrefix}args[0]: exclude filter only accepts members filter, got ${t.__serializable || "unknown"} filter`
|
|
1207
1219
|
);
|
|
1208
1220
|
}
|
|
1209
|
-
const
|
|
1210
|
-
"measureFactory.customFormula":
|
|
1221
|
+
const Pt = {
|
|
1222
|
+
"measureFactory.customFormula": Ot,
|
|
1211
1223
|
// String | Number filters
|
|
1212
|
-
"filterFactory.equals":
|
|
1213
|
-
"filterFactory.doesntEqual":
|
|
1224
|
+
"filterFactory.equals": me,
|
|
1225
|
+
"filterFactory.doesntEqual": me,
|
|
1214
1226
|
// Numeric filters
|
|
1215
1227
|
"filterFactory.greaterThan": D,
|
|
1216
1228
|
"filterFactory.greaterThanOrEqual": D,
|
|
@@ -1227,24 +1239,13 @@ const Tt = {
|
|
|
1227
1239
|
"filterFactory.endsWith": M,
|
|
1228
1240
|
"filterFactory.doesntEndWith": M,
|
|
1229
1241
|
"filterFactory.like": M,
|
|
1230
|
-
// Date filters
|
|
1231
|
-
"filterFactory.dateFrom": A,
|
|
1232
|
-
"filterFactory.dateTo": A,
|
|
1233
|
-
"filterFactory.dateRange": A,
|
|
1234
|
-
"filterFactory.dateRelative": A,
|
|
1235
|
-
"filterFactory.dateRelativeFrom": A,
|
|
1236
|
-
"filterFactory.dateRelativeTo": A,
|
|
1237
|
-
"filterFactory.thisYear": A,
|
|
1238
|
-
"filterFactory.thisMonth": A,
|
|
1239
|
-
"filterFactory.thisQuarter": A,
|
|
1240
|
-
"filterFactory.today": A,
|
|
1241
1242
|
// Exclude filter
|
|
1242
|
-
"filterFactory.exclude":
|
|
1243
|
+
"filterFactory.exclude": Bt
|
|
1243
1244
|
};
|
|
1244
|
-
function
|
|
1245
|
-
return
|
|
1245
|
+
function kt(e) {
|
|
1246
|
+
return Pt[`${e}`];
|
|
1246
1247
|
}
|
|
1247
|
-
const
|
|
1248
|
+
const It = {
|
|
1248
1249
|
// ==================== MEASURE FACTORY FUNCTIONS ====================
|
|
1249
1250
|
// Basic aggregations
|
|
1250
1251
|
"measureFactory.sum": [
|
|
@@ -1635,9 +1636,9 @@ const Pt = {
|
|
|
1635
1636
|
],
|
|
1636
1637
|
"filterFactory.dateRange": [
|
|
1637
1638
|
{ type: "LevelAttribute", required: !0 },
|
|
1638
|
-
{ type: "Date | string", required: !
|
|
1639
|
+
{ type: "Date | string", required: !1 },
|
|
1639
1640
|
// from
|
|
1640
|
-
{ type: "Date | string", required: !
|
|
1641
|
+
{ type: "Date | string", required: !1 },
|
|
1641
1642
|
// to
|
|
1642
1643
|
{ type: "BaseFilterConfig", required: !1 }
|
|
1643
1644
|
],
|
|
@@ -1645,7 +1646,9 @@ const Pt = {
|
|
|
1645
1646
|
{ type: "LevelAttribute", required: !0 },
|
|
1646
1647
|
{ type: "number", required: !0 },
|
|
1647
1648
|
// offset
|
|
1648
|
-
{ type: "
|
|
1649
|
+
{ type: "number", required: !0 },
|
|
1650
|
+
// count
|
|
1651
|
+
{ type: "Date | string", required: !1 },
|
|
1649
1652
|
// anchor
|
|
1650
1653
|
{ type: "BaseFilterConfig", required: !1 }
|
|
1651
1654
|
],
|
|
@@ -1653,7 +1656,9 @@ const Pt = {
|
|
|
1653
1656
|
{ type: "LevelAttribute", required: !0 },
|
|
1654
1657
|
{ type: "number", required: !0 },
|
|
1655
1658
|
// offset
|
|
1656
|
-
{ type: "
|
|
1659
|
+
{ type: "number", required: !0 },
|
|
1660
|
+
// count
|
|
1661
|
+
{ type: "Date | string", required: !1 },
|
|
1657
1662
|
// anchor
|
|
1658
1663
|
{ type: "BaseFilterConfig", required: !1 }
|
|
1659
1664
|
],
|
|
@@ -1661,7 +1666,9 @@ const Pt = {
|
|
|
1661
1666
|
{ type: "LevelAttribute", required: !0 },
|
|
1662
1667
|
{ type: "number", required: !0 },
|
|
1663
1668
|
// offset
|
|
1664
|
-
{ type: "
|
|
1669
|
+
{ type: "number", required: !0 },
|
|
1670
|
+
// count
|
|
1671
|
+
{ type: "Date | string", required: !1 },
|
|
1665
1672
|
// anchor
|
|
1666
1673
|
{ type: "BaseFilterConfig", required: !1 }
|
|
1667
1674
|
],
|
|
@@ -1761,39 +1768,51 @@ const Pt = {
|
|
|
1761
1768
|
{ type: "FilterRelationsNode", required: !0 }
|
|
1762
1769
|
]
|
|
1763
1770
|
};
|
|
1764
|
-
function
|
|
1765
|
-
return
|
|
1771
|
+
function oe(e) {
|
|
1772
|
+
return It[`${e}`];
|
|
1766
1773
|
}
|
|
1767
|
-
function
|
|
1768
|
-
const r =
|
|
1774
|
+
function _t(e) {
|
|
1775
|
+
const r = oe(e);
|
|
1769
1776
|
return r ? r.filter((t) => t.required).length : 0;
|
|
1770
1777
|
}
|
|
1771
|
-
function
|
|
1772
|
-
const r =
|
|
1778
|
+
function Lt(e) {
|
|
1779
|
+
const r = oe(e);
|
|
1773
1780
|
return r ? r.length : 0;
|
|
1774
1781
|
}
|
|
1775
|
-
function
|
|
1776
|
-
if (typeof e != "string")
|
|
1782
|
+
function Vt(e) {
|
|
1783
|
+
if (typeof e != "string" || !/^\d{4}-\d{2}-\d{2}/.test(e))
|
|
1777
1784
|
return !1;
|
|
1778
|
-
const
|
|
1779
|
-
if (
|
|
1785
|
+
const t = Date.parse(e);
|
|
1786
|
+
if (isNaN(t) || e.length < 10)
|
|
1780
1787
|
return !1;
|
|
1781
1788
|
const i = new Date(e);
|
|
1782
|
-
return !isNaN(i.getTime())
|
|
1789
|
+
return !isNaN(i.getTime());
|
|
1783
1790
|
}
|
|
1784
|
-
function
|
|
1785
|
-
if (e.startsWith(
|
|
1791
|
+
function Q(e, r, t, i) {
|
|
1792
|
+
if (e.startsWith(x))
|
|
1786
1793
|
try {
|
|
1787
|
-
return
|
|
1794
|
+
return se(e, r, t);
|
|
1788
1795
|
} catch (s) {
|
|
1789
1796
|
const a = s instanceof Error ? s.message : "Unknown error";
|
|
1790
1797
|
throw new Error(`${i}: ${a}`);
|
|
1791
1798
|
}
|
|
1792
1799
|
throw new Error(
|
|
1793
|
-
`${i}: Invalid attribute "${e}". Expected format: "${
|
|
1800
|
+
`${i}: Invalid attribute "${e}". Expected format: "${x}TableName.ColumnName[.Level]"`
|
|
1794
1801
|
);
|
|
1795
1802
|
}
|
|
1796
|
-
function
|
|
1803
|
+
function Ut(e, r, t, i) {
|
|
1804
|
+
if (e.startsWith(x))
|
|
1805
|
+
try {
|
|
1806
|
+
return xt(e, r, t);
|
|
1807
|
+
} catch (s) {
|
|
1808
|
+
const a = s instanceof Error ? s.message : "Unknown error";
|
|
1809
|
+
throw new Error(`${i}: ${a}`);
|
|
1810
|
+
}
|
|
1811
|
+
throw new Error(
|
|
1812
|
+
`${i}: Invalid date dimension string "${e}". Expected format: "${x}TableName.ColumnName"`
|
|
1813
|
+
);
|
|
1814
|
+
}
|
|
1815
|
+
function Jt(e) {
|
|
1797
1816
|
const r = e.data, { argSchema: t, dataSource: i, tables: s, pathPrefix: a } = e.context, n = a;
|
|
1798
1817
|
if (r === void 0) {
|
|
1799
1818
|
if (t.required)
|
|
@@ -1838,7 +1857,7 @@ function Lt(e) {
|
|
|
1838
1857
|
throw new Error(
|
|
1839
1858
|
`${n}: Expected attribute string, got ${typeof r}. Example: "DM.Commerce.Revenue"`
|
|
1840
1859
|
);
|
|
1841
|
-
return
|
|
1860
|
+
return Q(r, i, s, n);
|
|
1842
1861
|
case "Attribute[]":
|
|
1843
1862
|
if (!Array.isArray(r))
|
|
1844
1863
|
throw new Error(
|
|
@@ -1847,11 +1866,11 @@ function Lt(e) {
|
|
|
1847
1866
|
return r.map((o, u) => {
|
|
1848
1867
|
if (typeof o != "string")
|
|
1849
1868
|
throw new Error(`${n}[${u}]: Expected attribute string, got ${typeof o}`);
|
|
1850
|
-
return
|
|
1869
|
+
return Q(o, i, s, `${n}[${u}]`);
|
|
1851
1870
|
});
|
|
1852
1871
|
case "Measure":
|
|
1853
1872
|
case "BaseMeasure":
|
|
1854
|
-
if (!
|
|
1873
|
+
if (!A(r))
|
|
1855
1874
|
throw new Error(
|
|
1856
1875
|
`${n}: Expected measure function call, got ${typeof r}. Example: {"function": "measureFactory.sum", "args": ["DM.Commerce.Revenue"]}`
|
|
1857
1876
|
);
|
|
@@ -1865,7 +1884,7 @@ function Lt(e) {
|
|
|
1865
1884
|
`${n}: Expected array of measure function calls, got ${typeof r}`
|
|
1866
1885
|
);
|
|
1867
1886
|
return r.map((o, u) => {
|
|
1868
|
-
if (!
|
|
1887
|
+
if (!A(o))
|
|
1869
1888
|
throw new Error(
|
|
1870
1889
|
`${n}[${u}]: Expected measure function call, got ${typeof o}`
|
|
1871
1890
|
);
|
|
@@ -1875,7 +1894,7 @@ function Lt(e) {
|
|
|
1875
1894
|
});
|
|
1876
1895
|
});
|
|
1877
1896
|
case "Filter":
|
|
1878
|
-
if (!
|
|
1897
|
+
if (!A(r))
|
|
1879
1898
|
throw new Error(
|
|
1880
1899
|
`${n}: Expected filter function call, got ${typeof r}. Example: {"function": "filterFactory.contains", "args": ["DM.Brand.Brand", "Apple"]}`
|
|
1881
1900
|
);
|
|
@@ -1889,7 +1908,7 @@ function Lt(e) {
|
|
|
1889
1908
|
`${n}: Expected array of filter function calls, got ${typeof r}`
|
|
1890
1909
|
);
|
|
1891
1910
|
return r.map((o, u) => {
|
|
1892
|
-
if (!
|
|
1911
|
+
if (!A(o))
|
|
1893
1912
|
throw new Error(
|
|
1894
1913
|
`${n}[${u}]: Expected filter function call, got ${typeof o}`
|
|
1895
1914
|
);
|
|
@@ -1901,7 +1920,7 @@ function Lt(e) {
|
|
|
1901
1920
|
case "FilterRelationsNode":
|
|
1902
1921
|
if (Array.isArray(r))
|
|
1903
1922
|
return r.map((o, u) => {
|
|
1904
|
-
if (!
|
|
1923
|
+
if (!A(o))
|
|
1905
1924
|
throw new Error(
|
|
1906
1925
|
`${n}[${u}]: Expected filter function call, got ${typeof o}`
|
|
1907
1926
|
);
|
|
@@ -1910,7 +1929,7 @@ function Lt(e) {
|
|
|
1910
1929
|
context: { dataSource: i, tables: s, pathPrefix: `${n}[${u}]: ` }
|
|
1911
1930
|
});
|
|
1912
1931
|
});
|
|
1913
|
-
if (
|
|
1932
|
+
if (A(r))
|
|
1914
1933
|
return w({
|
|
1915
1934
|
data: r,
|
|
1916
1935
|
context: { dataSource: i, tables: s, pathPrefix: n }
|
|
@@ -1919,16 +1938,34 @@ function Lt(e) {
|
|
|
1919
1938
|
`${n}: Expected filter function call or array of filters, got ${typeof r}`
|
|
1920
1939
|
);
|
|
1921
1940
|
case "DateDimension":
|
|
1922
|
-
|
|
1941
|
+
if (typeof r != "string")
|
|
1942
|
+
throw new Error(
|
|
1943
|
+
`${n}: Expected date dimension string, got ${typeof r}. Example: "DM.Commerce.Date"`
|
|
1944
|
+
);
|
|
1945
|
+
return Ut(r, i, s, n);
|
|
1946
|
+
case "LevelAttribute": {
|
|
1923
1947
|
if (typeof r != "string")
|
|
1924
1948
|
throw new Error(
|
|
1925
1949
|
`${n}: Expected date attribute string, got ${typeof r}. Example: "DM.Commerce.Date.Years"`
|
|
1926
1950
|
);
|
|
1927
|
-
|
|
1951
|
+
const o = Q(
|
|
1952
|
+
r,
|
|
1953
|
+
i,
|
|
1954
|
+
s,
|
|
1955
|
+
n
|
|
1956
|
+
);
|
|
1957
|
+
if (!Et(o))
|
|
1958
|
+
throw new Error(
|
|
1959
|
+
`${n}: Attribute must be date/datetime type, got ${J(
|
|
1960
|
+
o
|
|
1961
|
+
)} attribute`
|
|
1962
|
+
);
|
|
1963
|
+
return o;
|
|
1964
|
+
}
|
|
1928
1965
|
case "Measure | number":
|
|
1929
1966
|
if (typeof r == "number")
|
|
1930
1967
|
return r;
|
|
1931
|
-
if (
|
|
1968
|
+
if (A(r))
|
|
1932
1969
|
return w({
|
|
1933
1970
|
data: r,
|
|
1934
1971
|
context: { dataSource: i, tables: s, pathPrefix: n }
|
|
@@ -1938,7 +1975,7 @@ function Lt(e) {
|
|
|
1938
1975
|
);
|
|
1939
1976
|
case "Date | string":
|
|
1940
1977
|
if (typeof r == "string") {
|
|
1941
|
-
if (
|
|
1978
|
+
if (Vt(r))
|
|
1942
1979
|
return r;
|
|
1943
1980
|
throw new Error(
|
|
1944
1981
|
`${n}: Expected valid ISO date string or Date object, got invalid date string "${r}"`
|
|
@@ -1966,10 +2003,10 @@ function Lt(e) {
|
|
|
1966
2003
|
}
|
|
1967
2004
|
}
|
|
1968
2005
|
function w(e) {
|
|
1969
|
-
const { data: r } = e, { dataSource: t, tables: i, pathPrefix: s } = e.context, { function: a, args: n } = r, o = s ? `${s}.` : "", u =
|
|
2006
|
+
const { data: r } = e, { dataSource: t, tables: i, pathPrefix: s } = e.context, { function: a, args: n } = r, o = s ? `${s}.` : "", u = oe(a);
|
|
1970
2007
|
if (!u)
|
|
1971
2008
|
throw new Error(`${o}function: Unknown function "${a}"`);
|
|
1972
|
-
const c =
|
|
2009
|
+
const c = _t(a), d = Lt(a);
|
|
1973
2010
|
if (n.length < c)
|
|
1974
2011
|
throw new Error(
|
|
1975
2012
|
`${o}function: Expected at least ${c} arguments, got ${n.length}`
|
|
@@ -1978,38 +2015,38 @@ function w(e) {
|
|
|
1978
2015
|
throw new Error(
|
|
1979
2016
|
`${o}function: Expected at most ${d} arguments, got ${n.length}`
|
|
1980
2017
|
);
|
|
1981
|
-
const g = [],
|
|
2018
|
+
const g = [], y = [];
|
|
1982
2019
|
for (let f = 0; f < Math.max(n.length, u.length); f++) {
|
|
1983
|
-
const
|
|
2020
|
+
const p = u[`${f}`], C = n[`${f}`], T = o ? `${o}args[${f}]` : `args[${f}]`;
|
|
1984
2021
|
if (C === void 0) {
|
|
1985
|
-
|
|
2022
|
+
p != null && p.required && y.push(`${T}: Missing required argument (expected ${p.type})`);
|
|
1986
2023
|
continue;
|
|
1987
2024
|
}
|
|
1988
|
-
if (!
|
|
1989
|
-
|
|
2025
|
+
if (!p) {
|
|
2026
|
+
y.push(`${T}: Unexpected argument`);
|
|
1990
2027
|
continue;
|
|
1991
2028
|
}
|
|
1992
2029
|
try {
|
|
1993
|
-
const
|
|
2030
|
+
const N = Jt({
|
|
1994
2031
|
data: C,
|
|
1995
2032
|
context: {
|
|
1996
2033
|
dataSource: t,
|
|
1997
2034
|
tables: i,
|
|
1998
|
-
pathPrefix:
|
|
1999
|
-
argSchema:
|
|
2035
|
+
pathPrefix: T,
|
|
2036
|
+
argSchema: p
|
|
2000
2037
|
}
|
|
2001
2038
|
});
|
|
2002
|
-
g.push(
|
|
2003
|
-
} catch (
|
|
2004
|
-
const
|
|
2005
|
-
|
|
2039
|
+
g.push(N);
|
|
2040
|
+
} catch (N) {
|
|
2041
|
+
const Le = N instanceof Error ? N.message : "Unknown error";
|
|
2042
|
+
y.push(Le);
|
|
2006
2043
|
}
|
|
2007
2044
|
}
|
|
2008
|
-
if (
|
|
2009
|
-
const f =
|
|
2045
|
+
if (y.length > 0) {
|
|
2046
|
+
const f = y.join("; ");
|
|
2010
2047
|
throw new Error(f);
|
|
2011
2048
|
}
|
|
2012
|
-
const b =
|
|
2049
|
+
const b = kt(a);
|
|
2013
2050
|
if (b)
|
|
2014
2051
|
try {
|
|
2015
2052
|
b(g, {
|
|
@@ -2018,16 +2055,16 @@ function w(e) {
|
|
|
2018
2055
|
pathPrefix: o
|
|
2019
2056
|
});
|
|
2020
2057
|
} catch (f) {
|
|
2021
|
-
const
|
|
2022
|
-
throw new Error(
|
|
2058
|
+
const p = f instanceof Error ? f.message : "Unknown validation error";
|
|
2059
|
+
throw new Error(p);
|
|
2023
2060
|
}
|
|
2024
|
-
return
|
|
2061
|
+
return Rt(a, g);
|
|
2025
2062
|
}
|
|
2026
|
-
function
|
|
2063
|
+
function _e(e) {
|
|
2027
2064
|
const { attribute: r, config: t } = e;
|
|
2028
|
-
if (
|
|
2065
|
+
if (G(e) && zr(r)) {
|
|
2029
2066
|
const { granularity: i } = r;
|
|
2030
|
-
return
|
|
2067
|
+
return Or(
|
|
2031
2068
|
r,
|
|
2032
2069
|
e.members.map((s) => i === "Years" && !isNaN(Number(s)) ? `${s}-01-01T00:00:00` : s),
|
|
2033
2070
|
t
|
|
@@ -2035,13 +2072,13 @@ function ke(e) {
|
|
|
2035
2072
|
}
|
|
2036
2073
|
return e;
|
|
2037
2074
|
}
|
|
2038
|
-
function
|
|
2075
|
+
function jt(e) {
|
|
2039
2076
|
let r = [];
|
|
2040
2077
|
for (const t of e)
|
|
2041
|
-
|
|
2078
|
+
_(t) ? r = ce(t, r) : r = ce([_e(t)], r);
|
|
2042
2079
|
return r != null ? r : [];
|
|
2043
2080
|
}
|
|
2044
|
-
const
|
|
2081
|
+
const Wt = (e) => {
|
|
2045
2082
|
const { data: r } = e, { dataSource: t, tables: i } = e.context, s = [], a = [];
|
|
2046
2083
|
return r.forEach((n, o) => {
|
|
2047
2084
|
const u = {
|
|
@@ -2054,15 +2091,15 @@ const Ut = (e) => {
|
|
|
2054
2091
|
data: n,
|
|
2055
2092
|
context: { dataSource: t, tables: i, pathPrefix: "" }
|
|
2056
2093
|
});
|
|
2057
|
-
!
|
|
2094
|
+
!_(c) && !U(c) ? a.push(q(h({}, u), { message: "Invalid filter JSON" })) : s.push(c);
|
|
2058
2095
|
} catch (c) {
|
|
2059
2096
|
const d = c instanceof Error ? c.message : "Unknown error";
|
|
2060
2097
|
a.push(q(h({}, u), { message: d }));
|
|
2061
2098
|
}
|
|
2062
|
-
}), a.length > 0 ? { success: !1, errors: a } : { success: !0, data:
|
|
2063
|
-
},
|
|
2099
|
+
}), a.length > 0 ? { success: !1, errors: a } : { success: !0, data: jt(s) };
|
|
2100
|
+
}, Kt = (e) => {
|
|
2064
2101
|
const { data: r } = e, { dataSource: t, tables: i } = e.context;
|
|
2065
|
-
return r ?
|
|
2102
|
+
return r ? ie(r) ? Wt({
|
|
2066
2103
|
data: r,
|
|
2067
2104
|
context: { dataSource: t, tables: i }
|
|
2068
2105
|
}) : {
|
|
@@ -2076,7 +2113,7 @@ const Ut = (e) => {
|
|
|
2076
2113
|
}
|
|
2077
2114
|
]
|
|
2078
2115
|
} : { success: !0, data: [] };
|
|
2079
|
-
},
|
|
2116
|
+
}, Qt = (e) => {
|
|
2080
2117
|
const { data: r } = e, { dataSource: t, tables: i } = e.context, s = [], a = [];
|
|
2081
2118
|
return r.forEach((n, o) => {
|
|
2082
2119
|
const u = {
|
|
@@ -2089,15 +2126,15 @@ const Ut = (e) => {
|
|
|
2089
2126
|
data: n,
|
|
2090
2127
|
context: { dataSource: t, tables: i, pathPrefix: "" }
|
|
2091
2128
|
});
|
|
2092
|
-
|
|
2129
|
+
U(c) ? s.push(_e(c)) : a.push(q(h({}, u), { message: "Invalid filter JSON" }));
|
|
2093
2130
|
} catch (c) {
|
|
2094
2131
|
const d = c instanceof Error ? c.message : "Unknown error";
|
|
2095
2132
|
a.push(q(h({}, u), { message: d }));
|
|
2096
2133
|
}
|
|
2097
2134
|
}), a.length > 0 ? { success: !1, errors: a } : { success: !0, data: s };
|
|
2098
|
-
},
|
|
2135
|
+
}, Yt = (e) => {
|
|
2099
2136
|
const { data: r } = e, { dataSource: t, tables: i } = e.context;
|
|
2100
|
-
return r ?
|
|
2137
|
+
return r ? ie(r) ? Qt({
|
|
2101
2138
|
data: r,
|
|
2102
2139
|
context: { dataSource: t, tables: i }
|
|
2103
2140
|
}) : {
|
|
@@ -2111,7 +2148,7 @@ const Ut = (e) => {
|
|
|
2111
2148
|
}
|
|
2112
2149
|
]
|
|
2113
2150
|
} : { success: !0, data: [] };
|
|
2114
|
-
},
|
|
2151
|
+
}, Ht = (e) => {
|
|
2115
2152
|
const { data: r } = e, { dataSource: t, tables: i } = e.context, s = [], a = [];
|
|
2116
2153
|
return r.forEach((n, o) => {
|
|
2117
2154
|
const u = {
|
|
@@ -2130,9 +2167,9 @@ const Ut = (e) => {
|
|
|
2130
2167
|
a.push(q(h({}, u), { message: d }));
|
|
2131
2168
|
}
|
|
2132
2169
|
}), a.length > 0 ? { success: !1, errors: a } : { success: !0, data: s };
|
|
2133
|
-
},
|
|
2170
|
+
}, Xt = (e) => {
|
|
2134
2171
|
const { data: r } = e, { dataSource: t, tables: i } = e.context;
|
|
2135
|
-
return r ?
|
|
2172
|
+
return r ? ie(r) ? Ht({
|
|
2136
2173
|
data: r,
|
|
2137
2174
|
context: { dataSource: t, tables: i }
|
|
2138
2175
|
}) : {
|
|
@@ -2146,29 +2183,29 @@ const Ut = (e) => {
|
|
|
2146
2183
|
}
|
|
2147
2184
|
]
|
|
2148
2185
|
} : { success: !0, data: [] };
|
|
2149
|
-
},
|
|
2186
|
+
}, ii = (e) => {
|
|
2150
2187
|
const { data: r } = e, { dataSource: t, tables: i } = e.context, s = [], a = (g) => {
|
|
2151
|
-
const
|
|
2152
|
-
return
|
|
2188
|
+
const y = g();
|
|
2189
|
+
return y.success ? y.data : (s.push(...y.errors), null);
|
|
2153
2190
|
}, n = a(
|
|
2154
|
-
() =>
|
|
2191
|
+
() => Ct({
|
|
2155
2192
|
data: r.dimensions || [],
|
|
2156
2193
|
context: { dataSource: t, tables: i }
|
|
2157
2194
|
})
|
|
2158
2195
|
), o = a(
|
|
2159
|
-
() =>
|
|
2196
|
+
() => Xt({
|
|
2160
2197
|
data: r.measures || [],
|
|
2161
2198
|
context: { dataSource: t, tables: i }
|
|
2162
2199
|
})
|
|
2163
2200
|
), u = a(
|
|
2164
|
-
() =>
|
|
2201
|
+
() => Kt({
|
|
2165
2202
|
data: r.filters || [],
|
|
2166
2203
|
context: { dataSource: t, tables: i }
|
|
2167
2204
|
})
|
|
2168
2205
|
);
|
|
2169
2206
|
let c = null;
|
|
2170
2207
|
return r.highlights && (c = a(
|
|
2171
|
-
() =>
|
|
2208
|
+
() => Yt({
|
|
2172
2209
|
data: r.highlights || [],
|
|
2173
2210
|
context: { dataSource: t, tables: i }
|
|
2174
2211
|
})
|
|
@@ -2178,15 +2215,15 @@ const Ut = (e) => {
|
|
|
2178
2215
|
} : {
|
|
2179
2216
|
success: !0,
|
|
2180
2217
|
data: h({
|
|
2181
|
-
dataSource:
|
|
2218
|
+
dataSource: Tr(t),
|
|
2182
2219
|
dimensions: n || [],
|
|
2183
2220
|
measures: o || [],
|
|
2184
2221
|
filters: u || []
|
|
2185
2222
|
}, c && { highlights: c })
|
|
2186
2223
|
};
|
|
2187
2224
|
};
|
|
2188
|
-
function
|
|
2189
|
-
const { filters: r, relations: t } =
|
|
2225
|
+
function Zt(e) {
|
|
2226
|
+
const { filters: r, relations: t } = kr(
|
|
2190
2227
|
e.filters || []
|
|
2191
2228
|
);
|
|
2192
2229
|
return {
|
|
@@ -2199,18 +2236,18 @@ function Yt(e) {
|
|
|
2199
2236
|
// No count/offset/ungroup - these are execution concerns, not translation concerns
|
|
2200
2237
|
};
|
|
2201
2238
|
}
|
|
2202
|
-
function
|
|
2203
|
-
const i =
|
|
2204
|
-
return
|
|
2239
|
+
function si(e, r, t = !1) {
|
|
2240
|
+
const i = Zt(e), s = Br(i, r);
|
|
2241
|
+
return Pr(s, t);
|
|
2205
2242
|
}
|
|
2206
2243
|
export {
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2244
|
+
ti as CustomSuperJSON,
|
|
2245
|
+
oi as EMPTY_EXPANDED_QUERY_MODEL,
|
|
2246
|
+
ui as EMPTY_SIMPLE_QUERY_MODEL,
|
|
2247
|
+
li as isByIdDashboardCodeParams,
|
|
2248
|
+
ci as isByIdWidgetCodeParams,
|
|
2249
|
+
fi as isClientSideDashboardCodeParams,
|
|
2250
|
+
di as isClientSideWidgetCodeParams,
|
|
2251
|
+
ii as translateQueryJSON,
|
|
2252
|
+
si as translateQueryToJaql
|
|
2216
2253
|
};
|