@sisense/sdk-ui 2.21.0 → 2.22.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 +58 -58
- package/dist/ai.js +863 -846
- package/dist/analytics-composer/node.cjs +1 -1
- package/dist/analytics-composer/node.js +718 -709
- package/dist/analytics-composer.cjs +1 -1
- package/dist/analytics-composer.js +6 -6
- package/dist/{dimensions-DuUqQgpi.js → dimensions-BiLyFpCg.js} +1 -1
- package/dist/{dimensions-DVGn8ORR.cjs → dimensions-X4_igtmO.cjs} +1 -1
- package/dist/{execute-query-B21bnb05.js → execute-query-BEeqqDl6.js} +1483 -1490
- package/dist/execute-query-DJDE0zRU.cjs +1 -0
- package/dist/{index-0brX9D6q.cjs → index-NyouhE_A.cjs} +1 -1
- package/dist/{index-Ck90GjPy.js → index-kxX21arA.js} +15 -1
- package/dist/index.cjs +404 -404
- package/dist/index.js +22869 -21774
- package/dist/index.umd.js +644 -644
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/index.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/translate-dashboard-utils.d.ts +8 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/types.d.ts +9 -2
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/index.d.ts +4 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/persist-dashboard-model-middleware.d.ts +13 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/{use-dashboard-model-reducer.d.ts → dashboard-model-reducer/types.d.ts} +19 -36
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/use-dashboard-model-reducer.d.ts +9 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/utils.d.ts +28 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/use-dashboard-persistence.d.ts +4 -4
- package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/duplicate-widget/duplicate-widget-utils.d.ts +34 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/duplicate-widget/index.d.ts +2 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/duplicate-widget/use-duplicate-widget-menu-item.d.ts +57 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/types.d.ts +43 -2
- package/dist/packages/sdk-ui/src/domains/dashboarding/use-composed-dashboard.d.ts +15 -3
- package/dist/packages/sdk-ui/src/domains/filters/components/cascading-filter-tile/cascading-filter-tile.d.ts +7 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/cascading-filter-tile/cascading-level-filter.d.ts +4 -1
- package/dist/packages/sdk-ui/src/domains/filters/components/cascading-filter-tile/use-cascadding-filter-tile-menu-items/use-cascadding-filter-tile-lock-menu-item.d.ts +13 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/cascading-filter-tile/use-cascadding-filter-tile-menu-items/use-cascadding-filter-tile-menu-items.d.ts +14 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/criteria-filter-tile/criteria-filter-tile.d.ts +7 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/custom-filter-tile.d.ts +7 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/date-filter/date-range-filter-tile/date-range-filter-tile.d.ts +7 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/date-filter/relative-date-filter-tile/relative-date-filter-tile.d.ts +7 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/{filter-tile.d.ts → filter-tile/filter-tile.d.ts} +7 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/filter-tile/index.d.ts +1 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/filter-tile/types.d.ts +36 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/filter-tile-container.d.ts +6 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/filters-panel/types.d.ts +13 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/index.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/filters/components/member-filter-tile/member-filter-tile.d.ts +7 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/unsupported-filter-tile.d.ts +10 -1
- package/dist/packages/sdk-ui/src/domains/filters/shared/clone-filter-and-toggle-locked.d.ts +7 -0
- package/dist/packages/sdk-ui/src/domains/filters/shared/filter-tile-menu-button.d.ts +10 -0
- package/dist/packages/sdk-ui/src/domains/filters/shared/use-filter-tile-menu-items/use-filter-tile-lock-menu-item.d.ts +15 -0
- package/dist/packages/sdk-ui/src/domains/filters/shared/use-filter-tile-menu-items/use-filter-tile-menu-items.d.ts +14 -0
- package/dist/packages/sdk-ui/src/domains/formulas/index.d.ts +0 -1
- package/dist/packages/sdk-ui/src/domains/formulas/use-get-shared-formula.d.ts +20 -7
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/index.d.ts +1 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/to-widget-dto-style.d.ts +63 -0
- package/dist/packages/sdk-ui/src/domains/widgets/helpers/header-menu-utils.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/widgets/helpers/index.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/widgets/shared/widget-header/types.d.ts +1 -17
- package/dist/packages/sdk-ui/src/domains/widgets/shared/widget-header/widget-menu-button.d.ts +1 -1
- package/dist/packages/sdk-ui/src/infra/api/types/dashboard-dto.d.ts +2 -1
- package/dist/packages/sdk-ui/src/infra/app/client-application.d.ts +17 -0
- package/dist/packages/sdk-ui/src/infra/app/settings/settings.d.ts +3 -0
- package/dist/packages/sdk-ui/src/infra/app/settings/types/deployment-props.d.ts +1 -1
- package/dist/packages/sdk-ui/src/infra/app/settings/types/features.d.ts +18 -1
- package/dist/packages/sdk-ui/src/infra/contexts/plugin-provider/index.d.ts +5 -0
- package/dist/packages/sdk-ui/src/infra/contexts/plugin-provider/plugin-context.d.ts +15 -0
- package/dist/packages/sdk-ui/src/infra/contexts/plugin-provider/plugin-provider.d.ts +21 -0
- package/dist/packages/sdk-ui/src/infra/contexts/plugin-provider/types.d.ts +50 -0
- package/dist/packages/sdk-ui/src/infra/contexts/plugin-provider/validate-plugins.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/de-de.d.ts +14 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/en-us.d.ts +14 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/es-ar.d.ts +14 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/es-es.d.ts +14 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/fr-fr.d.ts +14 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/it-it.d.ts +14 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ja-jp.d.ts +14 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ko-kr.d.ts +14 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/nl-nl.d.ts +14 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/pt-br.d.ts +14 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ru-ru.d.ts +14 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/tr-tr.d.ts +14 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/zh-cn.d.ts +14 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/en.d.ts +14 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/index.d.ts +28 -0
- package/dist/packages/sdk-ui/src/modules/ai/api/chat-rest-api.d.ts +2 -1
- package/dist/packages/sdk-ui/src/modules/ai/api/narration-endpoints.d.ts +2 -1
- package/dist/packages/sdk-ui/src/modules/ai/get-nlg-insights-from-widget.d.ts +1 -0
- package/dist/packages/sdk-ui/src/props.d.ts +13 -20
- package/dist/packages/sdk-ui/src/public-api/internal.d.ts +1 -0
- package/dist/packages/sdk-ui/src/public-api/public.d.ts +2 -2
- package/dist/packages/sdk-ui/src/public-api/sisense-internal.d.ts +6 -0
- package/dist/packages/sdk-ui/src/shared/components/alert/alert.d.ts +91 -0
- package/dist/packages/sdk-ui/src/shared/components/alert/index.d.ts +2 -0
- package/dist/packages/sdk-ui/src/shared/components/menu/menu-button.d.ts +2 -1
- package/dist/packages/sdk-ui/src/shared/components/quota-notification/quota-notification.d.ts +32 -0
- package/dist/packages/sdk-ui/src/shared/hooks/use-app-settings.d.ts +11 -0
- package/dist/packages/sdk-ui/src/shared/hooks/use-quota-notification.d.ts +54 -0
- package/dist/packages/sdk-ui/src/shared/hooks/use-quota-warning-dismissed.d.ts +8 -0
- package/dist/packages/sdk-ui/src/shared/icons/warning-icon.d.ts +6 -0
- package/dist/packages/sdk-ui/src/shared/icons/x-circle-icon.d.ts +6 -0
- package/dist/packages/sdk-ui/src/shared/types/menu-item.d.ts +17 -0
- package/dist/{use-common-filters-DBqRT0et.js → quota-notification-D6oMJal8.js} +10460 -10234
- package/dist/{use-common-filters-CXJN3RSs.cjs → quota-notification-z3dv2KoH.cjs} +129 -129
- package/dist/translations/de-de.cjs +1 -1
- package/dist/translations/de-de.js +16 -2
- package/dist/translations/en-us.cjs +1 -1
- package/dist/translations/en-us.js +1 -1
- package/dist/translations/es-ar.cjs +1 -1
- package/dist/translations/es-ar.js +16 -2
- package/dist/translations/es-es.cjs +1 -1
- package/dist/translations/es-es.js +16 -2
- package/dist/translations/fr-fr.cjs +1 -1
- package/dist/translations/fr-fr.js +16 -2
- package/dist/translations/it-it.cjs +1 -1
- package/dist/translations/it-it.js +16 -2
- package/dist/translations/ja-jp.cjs +1 -1
- package/dist/translations/ja-jp.js +16 -2
- package/dist/translations/ko-kr.cjs +1 -1
- package/dist/translations/ko-kr.js +16 -2
- package/dist/translations/nl-nl.cjs +1 -1
- package/dist/translations/nl-nl.js +16 -2
- package/dist/translations/pt-br.cjs +1 -1
- package/dist/translations/pt-br.js +16 -2
- package/dist/translations/ru-ru.cjs +1 -1
- package/dist/translations/ru-ru.js +16 -2
- package/dist/translations/tr-tr.cjs +1 -1
- package/dist/translations/tr-tr.js +16 -2
- package/dist/translations/zh-cn.cjs +1 -1
- package/dist/translations/zh-cn.js +16 -2
- package/dist/{types-Ch9J6ycn.cjs → types-CoY6F8Ma.cjs} +1 -1
- package/dist/{types-Ockb-LJ0.js → types-ixSwJkxM.js} +1 -1
- package/dist/{utils-BXDqo_yg.js → utils-BP-BglHE.js} +4181 -4157
- package/dist/{utils-DH69_bUK.cjs → utils-C8YMrOdw.cjs} +36 -36
- package/dist/{widget-composer-DfVCQL2G.js → widget-composer-CUUFoCb9.js} +3 -3
- package/dist/{widget-composer-DgCWcMJ1.cjs → widget-composer-DI4sHaNe.cjs} +3 -3
- package/package.json +10 -9
- package/dist/execute-query-BIkhszY1.cjs +0 -1
- /package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/{use-dasboard-model-utils.d.ts → use-dashboard-model-utils.d.ts} +0 -0
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
1
|
+
var er = Object.defineProperty, rr = Object.defineProperties;
|
|
2
|
+
var tr = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var ye = Object.getOwnPropertySymbols;
|
|
4
|
+
var sr = Object.prototype.hasOwnProperty, nr = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var ge = (e, r, t) => r in e ? er(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t, g = (e, r) => {
|
|
6
6
|
for (var t in r || (r = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var t of
|
|
10
|
-
|
|
7
|
+
sr.call(r, t) && ge(e, t, r[t]);
|
|
8
|
+
if (ye)
|
|
9
|
+
for (var t of ye(r))
|
|
10
|
+
nr.call(r, t) && ge(e, t, r[t]);
|
|
11
11
|
return e;
|
|
12
|
-
},
|
|
13
|
-
import { f as
|
|
14
|
-
import { b as
|
|
15
|
-
import { bW as
|
|
16
|
-
import { i as
|
|
17
|
-
class
|
|
12
|
+
}, h = (e, r) => rr(e, tr(r));
|
|
13
|
+
import { f as ir, J as or } from "../types-ixSwJkxM.js";
|
|
14
|
+
import { b as Ws, E as js, a as Js, i as Ks, e as Gs, d as Qs } from "../types-ixSwJkxM.js";
|
|
15
|
+
import { bW as ar, bA as ur, bX as cr, bY as lr, bZ as fr, aw as ne, b_ as dr, av as mr, b$ as pr, b8 as yr, ax as gr, c0 as hr, bb as br, b9 as Fr, aL as wr, b7 as qr, ba as Er, d as Cr, c as $r, k as Ar, c1 as xr, c2 as Dr, c3 as Mr, c4 as Sr, c5 as Tr, c6 as Nr, c7 as Rr, c8 as Or, c9 as Ir, ca as zr, cb as Br, au as Pr, cc as kr, cd as Lr, S as ie, h as Vr, s as oe, b as W, M as I, aj as $e, bG as Ae, ce as _r, cf as Ur, cg as Wr, ch as jr, ci as Jr, aH as Kr, an as he, am as Gr, cj as xe, a6 as Qr, ck as Yr, x as Hr, v as Zr } from "../execute-query-BEeqqDl6.js";
|
|
16
|
+
import { i as Xr, b as vr, D as et, d as rt, a as tt } from "../dimensions-BiLyFpCg.js";
|
|
17
|
+
class st {
|
|
18
18
|
constructor() {
|
|
19
19
|
this.keyToValue = /* @__PURE__ */ new Map(), this.valueToKey = /* @__PURE__ */ new Map();
|
|
20
20
|
}
|
|
@@ -31,9 +31,9 @@ class rt {
|
|
|
31
31
|
this.keyToValue.clear(), this.valueToKey.clear();
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
class
|
|
34
|
+
class De {
|
|
35
35
|
constructor(r) {
|
|
36
|
-
this.generateIdentifier = r, this.kv = new
|
|
36
|
+
this.generateIdentifier = r, this.kv = new st();
|
|
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 Ae {
|
|
|
48
48
|
return this.kv.getByKey(r);
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
class
|
|
51
|
+
class nt extends De {
|
|
52
52
|
constructor() {
|
|
53
53
|
super((r) => r.name), this.classToAllowedProps = /* @__PURE__ */ new Map();
|
|
54
54
|
}
|
|
@@ -59,7 +59,7 @@ class tt extends Ae {
|
|
|
59
59
|
return this.classToAllowedProps.get(r);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function it(e) {
|
|
63
63
|
if ("values" in Object)
|
|
64
64
|
return Object.values(e);
|
|
65
65
|
const r = [];
|
|
@@ -67,8 +67,8 @@ function st(e) {
|
|
|
67
67
|
e.hasOwnProperty(t) && r.push(e[t]);
|
|
68
68
|
return r;
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
const t =
|
|
70
|
+
function ot(e, r) {
|
|
71
|
+
const t = it(e);
|
|
72
72
|
if ("find" in t)
|
|
73
73
|
return t.find(r);
|
|
74
74
|
const s = t;
|
|
@@ -78,20 +78,20 @@ function nt(e, r) {
|
|
|
78
78
|
return o;
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function z(e, r) {
|
|
82
82
|
Object.entries(e).forEach(([t, s]) => r(s, t));
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function j(e, r) {
|
|
85
85
|
return e.indexOf(r) !== -1;
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function be(e, r) {
|
|
88
88
|
for (let t = 0; t < e.length; t++) {
|
|
89
89
|
const s = e[t];
|
|
90
90
|
if (r(s))
|
|
91
91
|
return s;
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
-
class
|
|
94
|
+
class at {
|
|
95
95
|
constructor() {
|
|
96
96
|
this.transfomers = {};
|
|
97
97
|
}
|
|
@@ -99,13 +99,13 @@ class it {
|
|
|
99
99
|
this.transfomers[r.name] = r;
|
|
100
100
|
}
|
|
101
101
|
findApplicable(r) {
|
|
102
|
-
return
|
|
102
|
+
return ot(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 ut = (e) => Object.prototype.toString.call(e).slice(8, -1), Me = (e) => typeof e == "undefined", ct = (e) => e === null, k = (e) => typeof e != "object" || e === null || e === Object.prototype ? !1 : Object.getPrototypeOf(e) === null ? !0 : Object.getPrototypeOf(e) === Object.prototype, X = (e) => k(e) && Object.keys(e).length === 0, S = (e) => Array.isArray(e), lt = (e) => typeof e == "string", ft = (e) => typeof e == "number" && !isNaN(e), dt = (e) => typeof e == "boolean", mt = (e) => e instanceof RegExp, L = (e) => e instanceof Map, V = (e) => e instanceof Set, Se = (e) => ut(e) === "Symbol", pt = (e) => e instanceof Date && !isNaN(e.valueOf()), yt = (e) => e instanceof Error, Fe = (e) => typeof e == "number" && isNaN(e), gt = (e) => dt(e) || ct(e) || Me(e) || ft(e) || lt(e) || Se(e), ht = (e) => typeof e == "bigint", bt = (e) => e === 1 / 0 || e === -1 / 0, Ft = (e) => ArrayBuffer.isView(e) && !(e instanceof DataView), wt = (e) => e instanceof URL, Te = (e) => e.replace(/\./g, "\\."), Y = (e) => e.map(String).map(Te).join("."), P = (e) => {
|
|
109
109
|
const r = [];
|
|
110
110
|
let t = "";
|
|
111
111
|
for (let n = 0; n < e.length; n++) {
|
|
@@ -123,7 +123,7 @@ const ot = (e) => Object.prototype.toString.call(e).slice(8, -1), xe = (e) => ty
|
|
|
123
123
|
const s = t;
|
|
124
124
|
return r.push(s), r;
|
|
125
125
|
};
|
|
126
|
-
function
|
|
126
|
+
function A(e, r, t, s) {
|
|
127
127
|
return {
|
|
128
128
|
isApplicable: e,
|
|
129
129
|
annotation: r,
|
|
@@ -131,12 +131,12 @@ function $(e, r, t, s) {
|
|
|
131
131
|
untransform: s
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
|
-
const
|
|
135
|
-
|
|
134
|
+
const Ne = [
|
|
135
|
+
A(Me, "undefined", () => null, () => {
|
|
136
136
|
}),
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
137
|
+
A(ht, "bigint", (e) => e.toString(), (e) => typeof BigInt != "undefined" ? BigInt(e) : (console.error("Please add a BigInt polyfill."), e)),
|
|
138
|
+
A(pt, "Date", (e) => e.toISOString(), (e) => new Date(e)),
|
|
139
|
+
A(yt, "Error", (e, r) => {
|
|
140
140
|
const t = {
|
|
141
141
|
name: e.name,
|
|
142
142
|
message: e.message
|
|
@@ -150,24 +150,24 @@ const Se = [
|
|
|
150
150
|
t[s] = e[s];
|
|
151
151
|
}), t;
|
|
152
152
|
}),
|
|
153
|
-
|
|
153
|
+
A(mt, "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
|
+
A(
|
|
158
|
+
V,
|
|
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
|
+
A(L, "map", (e) => [...e.entries()], (e) => new Map(e)),
|
|
166
|
+
A((e) => Fe(e) || bt(e), "number", (e) => Fe(e) ? "NaN" : e > 0 ? "Infinity" : "-Infinity", Number),
|
|
167
|
+
A((e) => e === 0 && 1 / e === -1 / 0, "number", () => "-0", Number),
|
|
168
|
+
A(wt, "URL", (e) => e.toString(), (e) => new URL(e))
|
|
169
169
|
];
|
|
170
|
-
function
|
|
170
|
+
function J(e, r, t, s) {
|
|
171
171
|
return {
|
|
172
172
|
isApplicable: e,
|
|
173
173
|
annotation: r,
|
|
@@ -175,12 +175,12 @@ function j(e, r, t, s) {
|
|
|
175
175
|
untransform: s
|
|
176
176
|
};
|
|
177
177
|
}
|
|
178
|
-
const
|
|
178
|
+
const Re = J((e, r) => Se(e) ? !!r.symbolRegistry.getIdentifier(e) : !1, (e, r) => ["symbol", r.symbolRegistry.getIdentifier(e)], (e) => e.description, (e, r, t) => {
|
|
179
179
|
const s = t.symbolRegistry.getValue(r[1]);
|
|
180
180
|
if (!s)
|
|
181
181
|
throw new Error("Trying to deserialize unknown symbol");
|
|
182
182
|
return s;
|
|
183
|
-
}),
|
|
183
|
+
}), qt = [
|
|
184
184
|
Int8Array,
|
|
185
185
|
Uint8Array,
|
|
186
186
|
Int16Array,
|
|
@@ -190,19 +190,19 @@ const Te = j((e, r) => De(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), {}), Oe = J(Ft, (e) => ["typed-array", e.constructor.name], (e) => [...e], (e, r) => {
|
|
194
|
+
const t = qt[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 Ie(e, r) {
|
|
200
200
|
return e != null && e.constructor ? !!r.classRegistry.getIdentifier(e.constructor) : !1;
|
|
201
201
|
}
|
|
202
|
-
const
|
|
202
|
+
const ze = J(Ie, (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 g({}, e);
|
|
206
206
|
const s = {};
|
|
207
207
|
return t.forEach((n) => {
|
|
208
208
|
s[n] = e[n];
|
|
@@ -212,49 +212,49 @@ const Oe = j(Re, (e, r) => ["class", r.classRegistry.getIdentifier(e.constructor
|
|
|
212
212
|
if (!s)
|
|
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(s.prototype), e);
|
|
215
|
-
}),
|
|
215
|
+
}), Be = J((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 s = t.customTransformerRegistry.findByName(r[1]);
|
|
217
217
|
if (!s)
|
|
218
218
|
throw new Error("Trying to deserialize unknown custom value");
|
|
219
219
|
return s.deserialize(e);
|
|
220
|
-
}),
|
|
221
|
-
const t =
|
|
220
|
+
}), Et = [ze, Re, Be, Oe], we = (e, r) => {
|
|
221
|
+
const t = be(Et, (n) => n.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 s =
|
|
227
|
+
const s = be(Ne, (n) => n.isApplicable(e, r));
|
|
228
228
|
if (s)
|
|
229
229
|
return {
|
|
230
230
|
value: s.transform(e, r),
|
|
231
231
|
type: s.annotation
|
|
232
232
|
};
|
|
233
|
-
},
|
|
234
|
-
|
|
235
|
-
|
|
233
|
+
}, Pe = {};
|
|
234
|
+
Ne.forEach((e) => {
|
|
235
|
+
Pe[e.annotation] = e;
|
|
236
236
|
});
|
|
237
|
-
const
|
|
238
|
-
if (
|
|
237
|
+
const Ct = (e, r, t) => {
|
|
238
|
+
if (S(r))
|
|
239
239
|
switch (r[0]) {
|
|
240
240
|
case "symbol":
|
|
241
|
-
return
|
|
241
|
+
return Re.untransform(e, r, t);
|
|
242
242
|
case "class":
|
|
243
|
-
return
|
|
243
|
+
return ze.untransform(e, r, t);
|
|
244
244
|
case "custom":
|
|
245
|
-
return
|
|
245
|
+
return Be.untransform(e, r, t);
|
|
246
246
|
case "typed-array":
|
|
247
|
-
return
|
|
247
|
+
return Oe.untransform(e, r, t);
|
|
248
248
|
default:
|
|
249
249
|
throw new Error("Unknown transformation: " + r);
|
|
250
250
|
}
|
|
251
251
|
else {
|
|
252
|
-
const s =
|
|
252
|
+
const s = Pe[r];
|
|
253
253
|
if (!s)
|
|
254
254
|
throw new Error("Unknown transformation: " + r);
|
|
255
255
|
return s.untransform(e, t);
|
|
256
256
|
}
|
|
257
|
-
},
|
|
257
|
+
}, O = (e, r) => {
|
|
258
258
|
if (r > e.size)
|
|
259
259
|
throw new Error("index out of bounds");
|
|
260
260
|
const t = e.keys();
|
|
@@ -262,22 +262,22 @@ const qt = (e, r, t) => {
|
|
|
262
262
|
t.next(), r--;
|
|
263
263
|
return t.next().value;
|
|
264
264
|
};
|
|
265
|
-
function
|
|
266
|
-
if (
|
|
265
|
+
function ke(e) {
|
|
266
|
+
if (j(e, "__proto__"))
|
|
267
267
|
throw new Error("__proto__ is not allowed as a property");
|
|
268
|
-
if (
|
|
268
|
+
if (j(e, "prototype"))
|
|
269
269
|
throw new Error("prototype is not allowed as a property");
|
|
270
|
-
if (
|
|
270
|
+
if (j(e, "constructor"))
|
|
271
271
|
throw new Error("constructor is not allowed as a property");
|
|
272
272
|
}
|
|
273
|
-
const
|
|
274
|
-
|
|
273
|
+
const $t = (e, r) => {
|
|
274
|
+
ke(r);
|
|
275
275
|
for (let t = 0; t < r.length; t++) {
|
|
276
276
|
const s = r[t];
|
|
277
|
-
if (
|
|
278
|
-
e =
|
|
279
|
-
else if (
|
|
280
|
-
const n = +s, o = +r[++t] == 0 ? "key" : "value", i =
|
|
277
|
+
if (V(e))
|
|
278
|
+
e = O(e, +s);
|
|
279
|
+
else if (L(e)) {
|
|
280
|
+
const n = +s, o = +r[++t] == 0 ? "key" : "value", i = O(e, n);
|
|
281
281
|
switch (o) {
|
|
282
282
|
case "key":
|
|
283
283
|
e = i;
|
|
@@ -290,41 +290,41 @@ const Et = (e, r) => {
|
|
|
290
290
|
e = e[s];
|
|
291
291
|
}
|
|
292
292
|
return e;
|
|
293
|
-
},
|
|
294
|
-
if (
|
|
293
|
+
}, v = (e, r, t) => {
|
|
294
|
+
if (ke(r), r.length === 0)
|
|
295
295
|
return t(e);
|
|
296
296
|
let s = e;
|
|
297
297
|
for (let o = 0; o < r.length - 1; o++) {
|
|
298
298
|
const i = r[o];
|
|
299
|
-
if (
|
|
299
|
+
if (S(s)) {
|
|
300
300
|
const a = +i;
|
|
301
301
|
s = s[a];
|
|
302
|
-
} else if (
|
|
302
|
+
} else if (k(s))
|
|
303
303
|
s = s[i];
|
|
304
|
-
else if (
|
|
304
|
+
else if (V(s)) {
|
|
305
305
|
const a = +i;
|
|
306
|
-
s =
|
|
307
|
-
} else if (
|
|
306
|
+
s = O(s, a);
|
|
307
|
+
} else if (L(s)) {
|
|
308
308
|
if (o === r.length - 2)
|
|
309
309
|
break;
|
|
310
|
-
const u = +i, c = +r[++o] == 0 ? "key" : "value",
|
|
310
|
+
const u = +i, c = +r[++o] == 0 ? "key" : "value", p = O(s, u);
|
|
311
311
|
switch (c) {
|
|
312
312
|
case "key":
|
|
313
|
-
s =
|
|
313
|
+
s = p;
|
|
314
314
|
break;
|
|
315
315
|
case "value":
|
|
316
|
-
s = s.get(
|
|
316
|
+
s = s.get(p);
|
|
317
317
|
break;
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
321
|
const n = r[r.length - 1];
|
|
322
|
-
if (
|
|
323
|
-
const o =
|
|
322
|
+
if (S(s) ? s[+n] = t(s[+n]) : k(s) && (s[n] = t(s[n])), V(s)) {
|
|
323
|
+
const o = O(s, +n), i = t(o);
|
|
324
324
|
o !== i && (s.delete(o), s.add(i));
|
|
325
325
|
}
|
|
326
|
-
if (
|
|
327
|
-
const o = +r[r.length - 2], i =
|
|
326
|
+
if (L(s)) {
|
|
327
|
+
const o = +r[r.length - 2], i = O(s, o);
|
|
328
328
|
switch (+n == 0 ? "key" : "value") {
|
|
329
329
|
case "key": {
|
|
330
330
|
const u = t(i);
|
|
@@ -339,45 +339,45 @@ const Et = (e, r) => {
|
|
|
339
339
|
}
|
|
340
340
|
return e;
|
|
341
341
|
};
|
|
342
|
-
function
|
|
342
|
+
function ee(e, r, t = []) {
|
|
343
343
|
if (!e)
|
|
344
344
|
return;
|
|
345
|
-
if (!
|
|
346
|
-
|
|
345
|
+
if (!S(e)) {
|
|
346
|
+
z(e, (o, i) => ee(o, r, [...t, ...P(i)]));
|
|
347
347
|
return;
|
|
348
348
|
}
|
|
349
349
|
const [s, n] = e;
|
|
350
|
-
n &&
|
|
351
|
-
|
|
350
|
+
n && z(n, (o, i) => {
|
|
351
|
+
ee(o, r, [...t, ...P(i)]);
|
|
352
352
|
}), r(s, t);
|
|
353
353
|
}
|
|
354
|
-
function
|
|
355
|
-
return
|
|
356
|
-
e =
|
|
354
|
+
function At(e, r, t) {
|
|
355
|
+
return ee(r, (s, n) => {
|
|
356
|
+
e = v(e, n, (o) => Ct(o, s, t));
|
|
357
357
|
}), e;
|
|
358
358
|
}
|
|
359
|
-
function
|
|
359
|
+
function xt(e, r) {
|
|
360
360
|
function t(s, n) {
|
|
361
|
-
const o =
|
|
361
|
+
const o = $t(e, P(n));
|
|
362
362
|
s.map(P).forEach((i) => {
|
|
363
|
-
e =
|
|
363
|
+
e = v(e, i, () => o);
|
|
364
364
|
});
|
|
365
365
|
}
|
|
366
|
-
if (
|
|
366
|
+
if (S(r)) {
|
|
367
367
|
const [s, n] = r;
|
|
368
368
|
s.forEach((o) => {
|
|
369
|
-
e =
|
|
370
|
-
}), n &&
|
|
369
|
+
e = v(e, P(o), () => e);
|
|
370
|
+
}), n && z(n, t);
|
|
371
371
|
} else
|
|
372
|
-
|
|
372
|
+
z(r, t);
|
|
373
373
|
return e;
|
|
374
374
|
}
|
|
375
|
-
const
|
|
376
|
-
function
|
|
375
|
+
const Dt = (e, r) => k(e) || S(e) || L(e) || V(e) || Ie(e, r);
|
|
376
|
+
function Mt(e, r, t) {
|
|
377
377
|
const s = t.get(e);
|
|
378
378
|
s ? s.push(r) : t.set(e, [r]);
|
|
379
379
|
}
|
|
380
|
-
function
|
|
380
|
+
function St(e, r) {
|
|
381
381
|
const t = {};
|
|
382
382
|
let s;
|
|
383
383
|
return e.forEach((n) => {
|
|
@@ -385,64 +385,64 @@ function Dt(e, r) {
|
|
|
385
385
|
return;
|
|
386
386
|
r || (n = n.map((a) => a.map(String)).sort((a, u) => a.length - u.length));
|
|
387
387
|
const [o, ...i] = n;
|
|
388
|
-
o.length === 0 ? s = i.map(
|
|
389
|
-
}), s ?
|
|
388
|
+
o.length === 0 ? s = i.map(Y) : t[Y(o)] = i.map(Y);
|
|
389
|
+
}), s ? X(t) ? [s] : [s, t] : X(t) ? void 0 : t;
|
|
390
390
|
}
|
|
391
|
-
const
|
|
392
|
-
var
|
|
393
|
-
const a =
|
|
391
|
+
const Le = (e, r, t, s, n = [], o = [], i = /* @__PURE__ */ new Map()) => {
|
|
392
|
+
var x;
|
|
393
|
+
const a = gt(e);
|
|
394
394
|
if (!a) {
|
|
395
|
-
|
|
395
|
+
Mt(e, n, r);
|
|
396
396
|
const f = i.get(e);
|
|
397
397
|
if (f)
|
|
398
398
|
return s ? {
|
|
399
399
|
transformedValue: null
|
|
400
400
|
} : f;
|
|
401
401
|
}
|
|
402
|
-
if (!
|
|
403
|
-
const f =
|
|
402
|
+
if (!Dt(e, t)) {
|
|
403
|
+
const f = we(e, t), d = f ? {
|
|
404
404
|
transformedValue: f.value,
|
|
405
405
|
annotations: [f.type]
|
|
406
406
|
} : {
|
|
407
407
|
transformedValue: e
|
|
408
408
|
};
|
|
409
|
-
return a || i.set(e,
|
|
409
|
+
return a || i.set(e, d), d;
|
|
410
410
|
}
|
|
411
|
-
if (
|
|
411
|
+
if (j(o, e))
|
|
412
412
|
return {
|
|
413
413
|
transformedValue: null
|
|
414
414
|
};
|
|
415
|
-
const u =
|
|
416
|
-
|
|
417
|
-
if (
|
|
418
|
-
throw new Error(`Detected property ${
|
|
419
|
-
const
|
|
420
|
-
|
|
421
|
-
|
|
415
|
+
const u = we(e, t), c = (x = u == null ? void 0 : u.value) != null ? x : e, p = S(c) ? [] : {}, m = {};
|
|
416
|
+
z(c, (f, d) => {
|
|
417
|
+
if (d === "__proto__" || d === "constructor" || d === "prototype")
|
|
418
|
+
throw new Error(`Detected property ${d}. This is a prototype pollution risk, please remove it from your object.`);
|
|
419
|
+
const w = Le(f, r, t, s, [...n, d], [...o, e], i);
|
|
420
|
+
p[d] = w.transformedValue, S(w.annotations) ? m[d] = w.annotations : k(w.annotations) && z(w.annotations, ($, D) => {
|
|
421
|
+
m[Te(d) + "." + D] = $;
|
|
422
422
|
});
|
|
423
423
|
});
|
|
424
|
-
const y =
|
|
425
|
-
transformedValue:
|
|
424
|
+
const y = X(m) ? {
|
|
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, m] : m
|
|
430
430
|
};
|
|
431
431
|
return a || i.set(e, y), y;
|
|
432
432
|
};
|
|
433
|
-
function
|
|
433
|
+
function Ve(e) {
|
|
434
434
|
return Object.prototype.toString.call(e).slice(8, -1);
|
|
435
435
|
}
|
|
436
|
-
function
|
|
437
|
-
return
|
|
436
|
+
function qe(e) {
|
|
437
|
+
return Ve(e) === "Array";
|
|
438
438
|
}
|
|
439
|
-
function
|
|
440
|
-
if (
|
|
439
|
+
function Tt(e) {
|
|
440
|
+
if (Ve(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 Nt(e, r, t, s, n) {
|
|
446
446
|
const o = {}.propertyIsEnumerable.call(s, r) ? "enumerable" : "nonenumerable";
|
|
447
447
|
o === "enumerable" && (e[r] = t), n && o === "nonenumerable" && Object.defineProperty(e, r, {
|
|
448
448
|
value: t,
|
|
@@ -451,17 +451,17 @@ function St(e, r, t, s, n) {
|
|
|
451
451
|
configurable: !0
|
|
452
452
|
});
|
|
453
453
|
}
|
|
454
|
-
function
|
|
455
|
-
if (
|
|
456
|
-
return e.map((n) =>
|
|
457
|
-
if (!
|
|
454
|
+
function re(e, r = {}) {
|
|
455
|
+
if (qe(e))
|
|
456
|
+
return e.map((n) => re(n, r));
|
|
457
|
+
if (!Tt(e))
|
|
458
458
|
return e;
|
|
459
459
|
const t = Object.getOwnPropertyNames(e), s = Object.getOwnPropertySymbols(e);
|
|
460
460
|
return [...t, ...s].reduce((n, o) => {
|
|
461
|
-
if (
|
|
461
|
+
if (qe(r.props) && !r.props.includes(o))
|
|
462
462
|
return n;
|
|
463
|
-
const i = e[o], a =
|
|
464
|
-
return
|
|
463
|
+
const i = e[o], a = re(i, r);
|
|
464
|
+
return Nt(n, o, a, e, r.nonenumerable), n;
|
|
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 nt(), this.symbolRegistry = new De((t) => {
|
|
473
473
|
var s;
|
|
474
474
|
return (s = t.description) != null ? s : "";
|
|
475
|
-
}), this.customTransformerRegistry = new
|
|
475
|
+
}), this.customTransformerRegistry = new at(), this.allowedErrorProps = [], this.dedupe = r;
|
|
476
476
|
}
|
|
477
477
|
serialize(r) {
|
|
478
|
-
const t = /* @__PURE__ */ new Map(), s =
|
|
478
|
+
const t = /* @__PURE__ */ new Map(), s = Le(r, t, this, this.dedupe), n = {
|
|
479
479
|
json: s.transformedValue
|
|
480
480
|
};
|
|
481
|
-
s.annotations && (n.meta =
|
|
481
|
+
s.annotations && (n.meta = h(g({}, n.meta), {
|
|
482
482
|
values: s.annotations
|
|
483
483
|
}));
|
|
484
|
-
const o =
|
|
485
|
-
return o && (n.meta =
|
|
484
|
+
const o = St(t, this.dedupe);
|
|
485
|
+
return o && (n.meta = h(g({}, n.meta), {
|
|
486
486
|
referentialEqualities: o
|
|
487
487
|
})), n;
|
|
488
488
|
}
|
|
489
489
|
deserialize(r) {
|
|
490
490
|
const { json: t, meta: s } = r;
|
|
491
|
-
let n =
|
|
492
|
-
return s != null && s.values && (n =
|
|
491
|
+
let n = re(t);
|
|
492
|
+
return s != null && s.values && (n = At(n, s.values, this)), s != null && s.referentialEqualities && (n = xt(n, s.referentialEqualities)), n;
|
|
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(g({
|
|
508
508
|
name: t
|
|
509
509
|
}, r));
|
|
510
510
|
}
|
|
@@ -521,149 +521,149 @@ 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
|
|
524
|
+
const R = (e) => e === void 0 ? ie.None : e, Rt = (e) => new or(e.metadataItem, e.type), ae = (e) => new Cr(
|
|
525
525
|
e.name,
|
|
526
526
|
e.expression,
|
|
527
527
|
e.type,
|
|
528
528
|
e.description,
|
|
529
|
-
|
|
529
|
+
R(e.sort),
|
|
530
530
|
e.dataSource,
|
|
531
531
|
e.composeCode
|
|
532
|
-
),
|
|
532
|
+
), ue = (e) => new $r(
|
|
533
533
|
e.name,
|
|
534
534
|
e.expression,
|
|
535
535
|
e.granularity,
|
|
536
536
|
e.format,
|
|
537
537
|
e.description,
|
|
538
|
-
|
|
538
|
+
R(e.sort),
|
|
539
539
|
e.dataSource,
|
|
540
540
|
e.composeCode
|
|
541
541
|
), q = (e) => {
|
|
542
542
|
switch (e.__serializable) {
|
|
543
543
|
case "DimensionalAttribute":
|
|
544
|
-
return oe(e);
|
|
545
|
-
case "DimensionalLevelAttribute":
|
|
546
544
|
return ae(e);
|
|
545
|
+
case "DimensionalLevelAttribute":
|
|
546
|
+
return ue(e);
|
|
547
547
|
default:
|
|
548
548
|
return e;
|
|
549
549
|
}
|
|
550
|
-
},
|
|
550
|
+
}, _e = (e) => new et(
|
|
551
551
|
e.name,
|
|
552
552
|
e.expression,
|
|
553
553
|
e.attributes.map(q),
|
|
554
|
-
e.dimensions.map(
|
|
554
|
+
e.dimensions.map(Ot),
|
|
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 ? q(e.defaultAttribute) : void 0
|
|
561
|
-
),
|
|
561
|
+
), Ue = (e) => new rt(
|
|
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
|
+
), Ot = (e) => {
|
|
569
569
|
switch (e.__serializable) {
|
|
570
570
|
case "DimensionalDimension":
|
|
571
|
-
return
|
|
571
|
+
return _e(e);
|
|
572
572
|
case "DimensionalDateDimension":
|
|
573
|
-
return
|
|
573
|
+
return Ue(e);
|
|
574
574
|
default:
|
|
575
575
|
return e;
|
|
576
576
|
}
|
|
577
|
-
},
|
|
577
|
+
}, ce = (e) => new Ar(
|
|
578
578
|
e.name,
|
|
579
579
|
q(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
|
+
), le = (e) => {
|
|
587
587
|
const r = Object.fromEntries(
|
|
588
588
|
Object.entries(e.context).map(([t, s]) => {
|
|
589
589
|
if (s && typeof s == "object" && "__serializable" in s)
|
|
590
590
|
switch (s.__serializable) {
|
|
591
591
|
case "DimensionalAttribute":
|
|
592
|
-
return [t, oe(s)];
|
|
593
|
-
case "DimensionalLevelAttribute":
|
|
594
592
|
return [t, ae(s)];
|
|
595
|
-
case "
|
|
593
|
+
case "DimensionalLevelAttribute":
|
|
596
594
|
return [t, ue(s)];
|
|
597
|
-
case "
|
|
595
|
+
case "DimensionalBaseMeasure":
|
|
598
596
|
return [t, ce(s)];
|
|
597
|
+
case "DimensionalCalculatedMeasure":
|
|
598
|
+
return [t, le(s)];
|
|
599
599
|
default:
|
|
600
600
|
return [t, s];
|
|
601
601
|
}
|
|
602
602
|
return [t, s];
|
|
603
603
|
})
|
|
604
604
|
);
|
|
605
|
-
return new
|
|
605
|
+
return new xr(
|
|
606
606
|
e.name,
|
|
607
607
|
e.expression,
|
|
608
608
|
r,
|
|
609
609
|
e.format,
|
|
610
610
|
e.description,
|
|
611
|
-
|
|
611
|
+
R(e.sort),
|
|
612
612
|
e.dataSource,
|
|
613
613
|
e.composeCode
|
|
614
614
|
);
|
|
615
|
-
},
|
|
615
|
+
}, We = (e) => new Dr(
|
|
616
616
|
e.name,
|
|
617
617
|
q(e.attribute),
|
|
618
618
|
e.format,
|
|
619
619
|
e.description,
|
|
620
|
-
|
|
620
|
+
R(e.sort),
|
|
621
621
|
e.dataSource,
|
|
622
622
|
e.composeCode
|
|
623
|
-
),
|
|
623
|
+
), H = (e) => {
|
|
624
624
|
switch (e.__serializable) {
|
|
625
625
|
case "DimensionalBaseMeasure":
|
|
626
|
-
return ue(e);
|
|
627
|
-
case "DimensionalCalculatedMeasure":
|
|
628
626
|
return ce(e);
|
|
627
|
+
case "DimensionalCalculatedMeasure":
|
|
628
|
+
return le(e);
|
|
629
629
|
case "DimensionalMeasureTemplate":
|
|
630
|
-
return
|
|
630
|
+
return We(e);
|
|
631
631
|
default:
|
|
632
632
|
return e;
|
|
633
633
|
}
|
|
634
|
-
},
|
|
634
|
+
}, b = (e) => {
|
|
635
635
|
switch (e.__serializable) {
|
|
636
636
|
case "MembersFilter":
|
|
637
|
-
return new
|
|
637
|
+
return new Lr(
|
|
638
638
|
q(e.attribute),
|
|
639
639
|
e.members,
|
|
640
|
-
e.config.backgroundFilter ?
|
|
640
|
+
e.config.backgroundFilter ? h(g({}, e.config), { backgroundFilter: b(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 kr(
|
|
645
|
+
e.filters.map((t) => b(t)),
|
|
646
646
|
e.operator,
|
|
647
647
|
e.config,
|
|
648
648
|
e.composeCode
|
|
649
649
|
);
|
|
650
650
|
case "CascadingFilter":
|
|
651
|
-
return new
|
|
652
|
-
e._filters.map((t) =>
|
|
651
|
+
return new Pr(
|
|
652
|
+
e._filters.map((t) => b(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 Br(
|
|
658
|
+
b(e.filter),
|
|
659
|
+
e.input ? b(e.input) : void 0,
|
|
660
660
|
e.config,
|
|
661
661
|
e.composeCode
|
|
662
662
|
);
|
|
663
663
|
case "MeasureFilter":
|
|
664
|
-
return new
|
|
664
|
+
return new zr(
|
|
665
665
|
q(e.attribute),
|
|
666
|
-
|
|
666
|
+
H(e.measure),
|
|
667
667
|
e.operatorA,
|
|
668
668
|
e.valueA,
|
|
669
669
|
e.operatorB,
|
|
@@ -672,24 +672,24 @@ const T = (e) => e === void 0 ? ne.None : e, Tt = (e) => new nr(e.metadataItem,
|
|
|
672
672
|
e.composeCode
|
|
673
673
|
);
|
|
674
674
|
case "RankingFilter":
|
|
675
|
-
return new
|
|
675
|
+
return new Ir(
|
|
676
676
|
q(e.attribute),
|
|
677
|
-
|
|
677
|
+
H(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 Or(
|
|
685
|
+
H(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 Rr(
|
|
693
693
|
q(e.attribute),
|
|
694
694
|
e.operatorA,
|
|
695
695
|
e.valueA,
|
|
@@ -699,7 +699,7 @@ const T = (e) => e === void 0 ? ne.None : e, Tt = (e) => new nr(e.metadataItem,
|
|
|
699
699
|
e.composeCode
|
|
700
700
|
);
|
|
701
701
|
case "TextFilter":
|
|
702
|
-
return new
|
|
702
|
+
return new Nr(
|
|
703
703
|
q(e.attribute),
|
|
704
704
|
e.operatorA,
|
|
705
705
|
e.valueA,
|
|
@@ -708,7 +708,7 @@ const T = (e) => e === void 0 ? ne.None : e, Tt = (e) => new nr(e.metadataItem,
|
|
|
708
708
|
);
|
|
709
709
|
case "DateRangeFilter": {
|
|
710
710
|
const { valueA: t, valueB: s } = e;
|
|
711
|
-
return new
|
|
711
|
+
return new Tr(
|
|
712
712
|
q(e.attribute),
|
|
713
713
|
t,
|
|
714
714
|
s,
|
|
@@ -717,7 +717,7 @@ const T = (e) => e === void 0 ? ne.None : e, Tt = (e) => new nr(e.metadataItem,
|
|
|
717
717
|
);
|
|
718
718
|
}
|
|
719
719
|
case "RelativeDateFilter":
|
|
720
|
-
return new
|
|
720
|
+
return new Sr(
|
|
721
721
|
q(e.attribute),
|
|
722
722
|
e.offset,
|
|
723
723
|
e.count,
|
|
@@ -727,7 +727,7 @@ const T = (e) => e === void 0 ? ne.None : e, Tt = (e) => new nr(e.metadataItem,
|
|
|
727
727
|
e.composeCode
|
|
728
728
|
);
|
|
729
729
|
case "CustomFilter":
|
|
730
|
-
return new
|
|
730
|
+
return new Mr(
|
|
731
731
|
q(e.attribute),
|
|
732
732
|
e.jaqlExpression,
|
|
733
733
|
e.config,
|
|
@@ -739,188 +739,188 @@ const T = (e) => e === void 0 ? ne.None : e, Tt = (e) => new nr(e.metadataItem,
|
|
|
739
739
|
};
|
|
740
740
|
l.registerCustom(
|
|
741
741
|
{
|
|
742
|
-
isApplicable:
|
|
742
|
+
isApplicable: ir,
|
|
743
743
|
serialize: (e) => e.serialize(),
|
|
744
|
-
deserialize: (e) =>
|
|
744
|
+
deserialize: (e) => Rt(e)
|
|
745
745
|
},
|
|
746
746
|
"JaqlElement"
|
|
747
747
|
);
|
|
748
748
|
l.registerCustom(
|
|
749
749
|
{
|
|
750
|
-
isApplicable:
|
|
750
|
+
isApplicable: ar,
|
|
751
751
|
serialize: (e) => e.serialize(),
|
|
752
|
-
deserialize: (e) =>
|
|
752
|
+
deserialize: (e) => ae(e)
|
|
753
753
|
},
|
|
754
754
|
"DimensionalAttribute"
|
|
755
755
|
);
|
|
756
756
|
l.registerCustom(
|
|
757
757
|
{
|
|
758
|
-
isApplicable:
|
|
758
|
+
isApplicable: ur,
|
|
759
759
|
serialize: (e) => e.serialize(),
|
|
760
|
-
deserialize: (e) =>
|
|
760
|
+
deserialize: (e) => ue(e)
|
|
761
761
|
},
|
|
762
762
|
"DimensionalLevelAttribute"
|
|
763
763
|
);
|
|
764
764
|
l.registerCustom(
|
|
765
765
|
{
|
|
766
|
-
isApplicable:
|
|
766
|
+
isApplicable: Xr,
|
|
767
767
|
serialize: (e) => e.serialize(),
|
|
768
|
-
deserialize: (e) =>
|
|
768
|
+
deserialize: (e) => _e(e)
|
|
769
769
|
},
|
|
770
770
|
"DimensionalDimension"
|
|
771
771
|
);
|
|
772
772
|
l.registerCustom(
|
|
773
773
|
{
|
|
774
|
-
isApplicable:
|
|
774
|
+
isApplicable: vr,
|
|
775
775
|
serialize: (e) => e.serialize(),
|
|
776
|
-
deserialize: (e) =>
|
|
776
|
+
deserialize: (e) => Ue(e)
|
|
777
777
|
},
|
|
778
778
|
"DimensionalDateDimension"
|
|
779
779
|
);
|
|
780
780
|
l.registerCustom(
|
|
781
781
|
{
|
|
782
|
-
isApplicable:
|
|
782
|
+
isApplicable: cr,
|
|
783
783
|
serialize: (e) => e.serialize(),
|
|
784
|
-
deserialize: (e) =>
|
|
784
|
+
deserialize: (e) => ce(e)
|
|
785
785
|
},
|
|
786
786
|
"DimensionalBaseMeasure"
|
|
787
787
|
);
|
|
788
788
|
l.registerCustom(
|
|
789
789
|
{
|
|
790
|
-
isApplicable:
|
|
790
|
+
isApplicable: lr,
|
|
791
791
|
serialize: (e) => e.serialize(),
|
|
792
|
-
deserialize: (e) =>
|
|
792
|
+
deserialize: (e) => le(e)
|
|
793
793
|
},
|
|
794
794
|
"DimensionalCalculatedMeasure"
|
|
795
795
|
);
|
|
796
796
|
l.registerCustom(
|
|
797
797
|
{
|
|
798
|
-
isApplicable:
|
|
798
|
+
isApplicable: fr,
|
|
799
799
|
serialize: (e) => e.serialize(),
|
|
800
|
-
deserialize: (e) =>
|
|
800
|
+
deserialize: (e) => We(e)
|
|
801
801
|
},
|
|
802
802
|
"DimensionalMeasureTemplate"
|
|
803
803
|
);
|
|
804
804
|
l.registerCustom(
|
|
805
805
|
{
|
|
806
|
-
isApplicable:
|
|
806
|
+
isApplicable: ne,
|
|
807
807
|
serialize: (e) => e.serialize(),
|
|
808
|
-
deserialize: (e) =>
|
|
808
|
+
deserialize: (e) => b(e)
|
|
809
809
|
},
|
|
810
810
|
"MembersFilter"
|
|
811
811
|
);
|
|
812
812
|
l.registerCustom(
|
|
813
813
|
{
|
|
814
|
-
isApplicable:
|
|
814
|
+
isApplicable: dr,
|
|
815
815
|
serialize: (e) => e.serialize(),
|
|
816
|
-
deserialize: (e) =>
|
|
816
|
+
deserialize: (e) => b(e)
|
|
817
817
|
},
|
|
818
818
|
"LogicalAttributeFilter"
|
|
819
819
|
);
|
|
820
820
|
l.registerCustom(
|
|
821
821
|
{
|
|
822
|
-
isApplicable:
|
|
822
|
+
isApplicable: mr,
|
|
823
823
|
serialize: (e) => e.serialize(),
|
|
824
|
-
deserialize: (e) =>
|
|
824
|
+
deserialize: (e) => b(e)
|
|
825
825
|
},
|
|
826
826
|
"CascadingFilter"
|
|
827
827
|
);
|
|
828
828
|
l.registerCustom(
|
|
829
829
|
{
|
|
830
|
-
isApplicable:
|
|
830
|
+
isApplicable: pr,
|
|
831
831
|
serialize: (e) => e.serialize(),
|
|
832
|
-
deserialize: (e) =>
|
|
832
|
+
deserialize: (e) => b(e)
|
|
833
833
|
},
|
|
834
834
|
"ExcludeFilter"
|
|
835
835
|
);
|
|
836
836
|
l.registerCustom(
|
|
837
837
|
{
|
|
838
|
-
isApplicable:
|
|
838
|
+
isApplicable: yr,
|
|
839
839
|
serialize: (e) => e.serialize(),
|
|
840
|
-
deserialize: (e) =>
|
|
840
|
+
deserialize: (e) => b(e)
|
|
841
841
|
},
|
|
842
842
|
"MeasureFilter"
|
|
843
843
|
);
|
|
844
844
|
l.registerCustom(
|
|
845
845
|
{
|
|
846
|
-
isApplicable:
|
|
846
|
+
isApplicable: gr,
|
|
847
847
|
serialize: (e) => e.serialize(),
|
|
848
|
-
deserialize: (e) =>
|
|
848
|
+
deserialize: (e) => b(e)
|
|
849
849
|
},
|
|
850
850
|
"RankingFilter"
|
|
851
851
|
);
|
|
852
852
|
l.registerCustom(
|
|
853
853
|
{
|
|
854
|
-
isApplicable:
|
|
854
|
+
isApplicable: hr,
|
|
855
855
|
serialize: (e) => e.serialize(),
|
|
856
|
-
deserialize: (e) =>
|
|
856
|
+
deserialize: (e) => b(e)
|
|
857
857
|
},
|
|
858
858
|
"MeasureRankingFilter"
|
|
859
859
|
);
|
|
860
860
|
l.registerCustom(
|
|
861
861
|
{
|
|
862
|
-
isApplicable:
|
|
862
|
+
isApplicable: br,
|
|
863
863
|
serialize: (e) => e.serialize(),
|
|
864
|
-
deserialize: (e) =>
|
|
864
|
+
deserialize: (e) => b(e)
|
|
865
865
|
},
|
|
866
866
|
"NumericFilter"
|
|
867
867
|
);
|
|
868
868
|
l.registerCustom(
|
|
869
869
|
{
|
|
870
|
-
isApplicable:
|
|
870
|
+
isApplicable: Fr,
|
|
871
871
|
serialize: (e) => e.serialize(),
|
|
872
|
-
deserialize: (e) =>
|
|
872
|
+
deserialize: (e) => b(e)
|
|
873
873
|
},
|
|
874
874
|
"TextFilter"
|
|
875
875
|
);
|
|
876
876
|
l.registerCustom(
|
|
877
877
|
{
|
|
878
|
-
isApplicable:
|
|
878
|
+
isApplicable: wr,
|
|
879
879
|
serialize: (e) => e.serialize(),
|
|
880
|
-
deserialize: (e) =>
|
|
880
|
+
deserialize: (e) => b(e)
|
|
881
881
|
},
|
|
882
882
|
"DateRangeFilter"
|
|
883
883
|
);
|
|
884
884
|
l.registerCustom(
|
|
885
885
|
{
|
|
886
|
-
isApplicable:
|
|
886
|
+
isApplicable: qr,
|
|
887
887
|
serialize: (e) => e.serialize(),
|
|
888
|
-
deserialize: (e) =>
|
|
888
|
+
deserialize: (e) => b(e)
|
|
889
889
|
},
|
|
890
890
|
"RelativeDateFilter"
|
|
891
891
|
);
|
|
892
892
|
l.registerCustom(
|
|
893
893
|
{
|
|
894
|
-
isApplicable:
|
|
894
|
+
isApplicable: Er,
|
|
895
895
|
serialize: (e) => e.serialize(),
|
|
896
|
-
deserialize: (e) =>
|
|
896
|
+
deserialize: (e) => b(e)
|
|
897
897
|
},
|
|
898
898
|
"CustomFilter"
|
|
899
899
|
);
|
|
900
|
-
const
|
|
900
|
+
const Ps = l, F = "DM.";
|
|
901
901
|
function E(e) {
|
|
902
902
|
return typeof e == "object" && e !== null && "function" in e && "args" in e;
|
|
903
903
|
}
|
|
904
|
-
function
|
|
904
|
+
function je(e) {
|
|
905
905
|
return e.every(E);
|
|
906
906
|
}
|
|
907
|
-
function
|
|
907
|
+
function K(e) {
|
|
908
908
|
return "attribute" in e && "config" in e;
|
|
909
909
|
}
|
|
910
|
-
function
|
|
910
|
+
function U(e) {
|
|
911
911
|
return "left" in e && "right" in e && "operator" in e;
|
|
912
912
|
}
|
|
913
|
-
function
|
|
914
|
-
return !
|
|
913
|
+
function fe(e) {
|
|
914
|
+
return !K(e) && !U(e);
|
|
915
915
|
}
|
|
916
|
-
function
|
|
916
|
+
function It(e) {
|
|
917
917
|
return typeof e == "object" && e !== null && "column" in e && typeof e.column == "string" && !("function" in e && "args" in e);
|
|
918
918
|
}
|
|
919
|
-
function
|
|
919
|
+
function zt(e) {
|
|
920
920
|
const r = e;
|
|
921
921
|
return typeof e != "object" || e === null || r === null || !("column" in r) ? !1 : E(r.column);
|
|
922
922
|
}
|
|
923
|
-
function
|
|
923
|
+
function Bt(e) {
|
|
924
924
|
const r = [...e].sort((o, i) => i.name.length - o.name.length), t = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
925
925
|
for (const o of e) {
|
|
926
926
|
t.set(o.name, o);
|
|
@@ -938,57 +938,57 @@ function It(e) {
|
|
|
938
938
|
columnMap: s
|
|
939
939
|
};
|
|
940
940
|
}
|
|
941
|
-
function
|
|
942
|
-
if (!e.startsWith(
|
|
941
|
+
function Je(e, r) {
|
|
942
|
+
if (!e.startsWith(F))
|
|
943
943
|
throw new Error(
|
|
944
|
-
`Invalid dimensional element name format: "${e}". Expected format: "${
|
|
944
|
+
`Invalid dimensional element name format: "${e}". Expected format: "${F}TableName.ColumnName[.Level]"`
|
|
945
945
|
);
|
|
946
|
-
const t = e.slice(
|
|
946
|
+
const t = e.slice(F.length);
|
|
947
947
|
if (!t)
|
|
948
948
|
throw new Error(
|
|
949
|
-
`Invalid dimensional element name format: "${e}". Expected format: "${
|
|
949
|
+
`Invalid dimensional element name format: "${e}". Expected format: "${F}TableName.ColumnName[.Level]"`
|
|
950
950
|
);
|
|
951
951
|
let s, n;
|
|
952
|
-
for (const
|
|
953
|
-
if (t.startsWith(
|
|
954
|
-
const y = t.slice(
|
|
952
|
+
for (const m of r.sortedTables)
|
|
953
|
+
if (t.startsWith(m.name + ".")) {
|
|
954
|
+
const y = t.slice(m.name.length + 1);
|
|
955
955
|
if (!y)
|
|
956
956
|
throw new Error(
|
|
957
|
-
`Invalid dimensional element name format: "${e}". Expected format: "${
|
|
957
|
+
`Invalid dimensional element name format: "${e}". Expected format: "${F}TableName.ColumnName[.Level]"`
|
|
958
958
|
);
|
|
959
|
-
s =
|
|
959
|
+
s = m, n = y;
|
|
960
960
|
break;
|
|
961
961
|
}
|
|
962
962
|
if (!s) {
|
|
963
|
-
const
|
|
964
|
-
if (
|
|
963
|
+
const m = t.indexOf(".");
|
|
964
|
+
if (m === -1)
|
|
965
965
|
throw new Error(
|
|
966
|
-
`Invalid dimensional element name format: "${e}". Expected format: "${
|
|
966
|
+
`Invalid dimensional element name format: "${e}". Expected format: "${F}TableName.ColumnName[.Level]"`
|
|
967
967
|
);
|
|
968
|
-
const y = t.slice(0,
|
|
968
|
+
const y = t.slice(0, m);
|
|
969
969
|
throw new Error(`Table "${y}" not found in the data model`);
|
|
970
970
|
}
|
|
971
971
|
const o = r.tableColumnMap.get(s.name);
|
|
972
972
|
if (!o)
|
|
973
973
|
throw new Error(`Table "${s.name}" found but has no columns`);
|
|
974
974
|
let i, a;
|
|
975
|
-
const u =
|
|
976
|
-
for (const
|
|
977
|
-
if (n ===
|
|
978
|
-
return { table: s, column:
|
|
979
|
-
if (!n.startsWith(
|
|
975
|
+
const u = W.all;
|
|
976
|
+
for (const m of o) {
|
|
977
|
+
if (n === m.name)
|
|
978
|
+
return { table: s, column: m };
|
|
979
|
+
if (!n.startsWith(m.name + "."))
|
|
980
980
|
continue;
|
|
981
|
-
const y = n.slice(
|
|
981
|
+
const y = n.slice(m.name.length + 1);
|
|
982
982
|
if (!y)
|
|
983
983
|
continue;
|
|
984
|
-
const
|
|
985
|
-
if (
|
|
984
|
+
const x = u.includes(y), f = oe(m.dataType);
|
|
985
|
+
if (x) {
|
|
986
986
|
if (f)
|
|
987
|
-
return { table: s, column:
|
|
988
|
-
i || (i =
|
|
987
|
+
return { table: s, column: m, level: y };
|
|
988
|
+
i || (i = m, a = y);
|
|
989
989
|
continue;
|
|
990
990
|
}
|
|
991
|
-
f && !i && (i =
|
|
991
|
+
f && !i && (i = m, a = y);
|
|
992
992
|
}
|
|
993
993
|
if (i && a)
|
|
994
994
|
throw u.includes(a) ? new Error(
|
|
@@ -998,29 +998,29 @@ function We(e, r) {
|
|
|
998
998
|
", "
|
|
999
999
|
)}`
|
|
1000
1000
|
);
|
|
1001
|
-
const c = n.indexOf("."),
|
|
1002
|
-
throw new Error(`Column "${
|
|
1001
|
+
const c = n.indexOf("."), p = c === -1 ? n : n.slice(0, c);
|
|
1002
|
+
throw new Error(`Column "${p}" not found in table "${s.name}"`);
|
|
1003
1003
|
}
|
|
1004
|
-
function
|
|
1005
|
-
const { table: t, column: s, level: n } =
|
|
1004
|
+
function Pt(e, r) {
|
|
1005
|
+
const { table: t, column: s, level: n } = Je(e, r);
|
|
1006
1006
|
if (n) {
|
|
1007
|
-
if (!
|
|
1007
|
+
if (!oe(s.dataType))
|
|
1008
1008
|
throw new Error(
|
|
1009
1009
|
`Invalid date level "${n}" in dimensional element "${e}". Column "${t.name}.${s.name}" is not a datetime column`
|
|
1010
1010
|
);
|
|
1011
|
-
const o =
|
|
1011
|
+
const o = W.all;
|
|
1012
1012
|
if (!o.includes(n))
|
|
1013
1013
|
throw new Error(
|
|
1014
1014
|
`Invalid date level "${n}" in dimensional element "${e}". Valid levels are: ${o.join(
|
|
1015
1015
|
", "
|
|
1016
1016
|
)}`
|
|
1017
1017
|
);
|
|
1018
|
-
const i =
|
|
1018
|
+
const i = W.dateOnly;
|
|
1019
1019
|
if (s.dataType === "date" && !i.includes(n))
|
|
1020
1020
|
throw new Error(
|
|
1021
1021
|
`Invalid level "${n}" in dimensional element "${e}". Column "${t.name}.${s.name}" is only a date column, not a datetime column`
|
|
1022
1022
|
);
|
|
1023
|
-
const a =
|
|
1023
|
+
const a = W.timeOnly;
|
|
1024
1024
|
if (s.dataType === "time" && !a.includes(n))
|
|
1025
1025
|
throw new Error(
|
|
1026
1026
|
`Invalid level "${n}" in dimensional element "${e}". Column "${t.name}.${s.name}" is only a time column, not a date column`
|
|
@@ -1028,24 +1028,24 @@ function zt(e, r) {
|
|
|
1028
1028
|
}
|
|
1029
1029
|
return { column: s, level: n };
|
|
1030
1030
|
}
|
|
1031
|
-
function
|
|
1032
|
-
return e.type ===
|
|
1031
|
+
function Ke(e) {
|
|
1032
|
+
return e.type === I.TextAttribute;
|
|
1033
1033
|
}
|
|
1034
|
-
function
|
|
1035
|
-
return e.type ===
|
|
1034
|
+
function Ge(e) {
|
|
1035
|
+
return e.type === I.NumericAttribute;
|
|
1036
1036
|
}
|
|
1037
|
-
function
|
|
1038
|
-
return e.type ===
|
|
1037
|
+
function kt(e) {
|
|
1038
|
+
return e.type === I.DateLevel;
|
|
1039
1039
|
}
|
|
1040
|
-
function
|
|
1041
|
-
return
|
|
1040
|
+
function Lt(e) {
|
|
1041
|
+
return Ke(e) || Ge(e);
|
|
1042
1042
|
}
|
|
1043
1043
|
function G(e) {
|
|
1044
|
-
return e.type ===
|
|
1044
|
+
return e.type === I.TextAttribute ? "text" : e.type === I.NumericAttribute ? "numeric" : e.type === I.DateLevel ? "date/datetime" : "unknown";
|
|
1045
1045
|
}
|
|
1046
|
-
function
|
|
1047
|
-
const { column: s, level: n } =
|
|
1048
|
-
return
|
|
1046
|
+
function Q(e, r, t) {
|
|
1047
|
+
const { column: s, level: n } = Pt(e, t);
|
|
1048
|
+
return Vr({
|
|
1049
1049
|
expression: s.expression,
|
|
1050
1050
|
dataType: s.dataType,
|
|
1051
1051
|
granularity: n,
|
|
@@ -1054,44 +1054,44 @@ function K(e, r, t) {
|
|
|
1054
1054
|
dataSource: r
|
|
1055
1055
|
});
|
|
1056
1056
|
}
|
|
1057
|
-
function
|
|
1058
|
-
const { column: s, level: n } =
|
|
1057
|
+
function Vt(e, r, t) {
|
|
1058
|
+
const { column: s, level: n } = Je(e, t);
|
|
1059
1059
|
if (n)
|
|
1060
1060
|
throw new Error(
|
|
1061
|
-
`Invalid DateDimension name format: "${e}". Expected format: "${
|
|
1061
|
+
`Invalid DateDimension name format: "${e}". Expected format: "${F}TableName.ColumnName"`
|
|
1062
1062
|
);
|
|
1063
|
-
if (!
|
|
1063
|
+
if (!oe(s.dataType))
|
|
1064
1064
|
throw new Error(
|
|
1065
1065
|
`Invalid DateDimension name "${e}". Column "${s.name}" is not a datetime column (got ${s.dataType}).`
|
|
1066
1066
|
);
|
|
1067
|
-
return
|
|
1067
|
+
return tt({
|
|
1068
1068
|
name: s.name,
|
|
1069
1069
|
expression: s.expression,
|
|
1070
1070
|
dataSource: r
|
|
1071
1071
|
});
|
|
1072
1072
|
}
|
|
1073
|
-
function
|
|
1073
|
+
function M(e, r) {
|
|
1074
1074
|
const t = e();
|
|
1075
1075
|
return t.success ? t.data : (r.push(...t.errors), null);
|
|
1076
1076
|
}
|
|
1077
|
-
const
|
|
1077
|
+
const _t = (e, r, t) => {
|
|
1078
1078
|
if (!r)
|
|
1079
1079
|
return { attribute: e };
|
|
1080
1080
|
const s = typeof r == "object" ? r.direction : r;
|
|
1081
|
-
return
|
|
1081
|
+
return $e(s) ? { attribute: e.sort(Ae(s)) } : {
|
|
1082
1082
|
attribute: e,
|
|
1083
|
-
error:
|
|
1083
|
+
error: h(g({}, t), {
|
|
1084
1084
|
message: `Invalid sort type. Expected "sortAsc", "sortDesc", or "sortNone". Got: "${s}".`
|
|
1085
1085
|
})
|
|
1086
1086
|
};
|
|
1087
|
-
},
|
|
1088
|
-
const n =
|
|
1089
|
-
return
|
|
1090
|
-
},
|
|
1091
|
-
error:
|
|
1087
|
+
}, Ut = (e, r, t, s) => {
|
|
1088
|
+
const n = Q(e.column, r, t);
|
|
1089
|
+
return _t(n, e.sortType, s);
|
|
1090
|
+
}, Wt = (e, r, t, s) => typeof e == "string" ? { attribute: Q(e, r, t) } : It(e) ? Ut(e, r, t, s) : {
|
|
1091
|
+
error: h(g({}, s), {
|
|
1092
1092
|
message: 'Invalid dimension item. Expected a string (composeCode) or object with "column" and optional "sortType".'
|
|
1093
1093
|
})
|
|
1094
|
-
},
|
|
1094
|
+
}, jt = (e) => {
|
|
1095
1095
|
const { data: r } = e, { dataSource: t, schemaIndex: s } = e.context;
|
|
1096
1096
|
if (!r)
|
|
1097
1097
|
return { success: !0, data: [] };
|
|
@@ -1115,55 +1115,55 @@ const Lt = (e, r, t) => {
|
|
|
1115
1115
|
input: i
|
|
1116
1116
|
};
|
|
1117
1117
|
try {
|
|
1118
|
-
const c =
|
|
1118
|
+
const c = Wt(i, t, s, u);
|
|
1119
1119
|
if (c.error) {
|
|
1120
1120
|
o.push(c.error);
|
|
1121
1121
|
return;
|
|
1122
1122
|
}
|
|
1123
1123
|
c.attribute && n.push(c.attribute);
|
|
1124
1124
|
} catch (c) {
|
|
1125
|
-
const
|
|
1126
|
-
o.push(
|
|
1125
|
+
const p = c instanceof Error ? c.message : "Unknown error";
|
|
1126
|
+
o.push(h(g({}, u), { message: p }));
|
|
1127
1127
|
}
|
|
1128
1128
|
}), o.length > 0 ? { success: !1, errors: o } : { success: !0, data: n };
|
|
1129
1129
|
};
|
|
1130
|
-
function
|
|
1130
|
+
function de(e, r) {
|
|
1131
1131
|
const t = Reflect.get(e, r);
|
|
1132
1132
|
if (typeof t != "function")
|
|
1133
1133
|
throw new Error(`Function "${r}" not found or is not a function`);
|
|
1134
1134
|
return t;
|
|
1135
1135
|
}
|
|
1136
|
-
function
|
|
1137
|
-
const t = e.replace("measureFactory.", ""), n =
|
|
1138
|
-
if (!
|
|
1136
|
+
function Jt(e, r) {
|
|
1137
|
+
const t = e.replace("measureFactory.", ""), n = de(_r, t)(...r);
|
|
1138
|
+
if (!fe(n))
|
|
1139
1139
|
throw new Error(`Function "${e}" did not return a valid Measure`);
|
|
1140
1140
|
return n;
|
|
1141
1141
|
}
|
|
1142
|
-
function
|
|
1143
|
-
const t = e.replace("filterFactory.logic.", ""), n =
|
|
1144
|
-
if (!
|
|
1142
|
+
function Kt(e, r) {
|
|
1143
|
+
const t = e.replace("filterFactory.logic.", ""), n = de(Ur, t)(...r);
|
|
1144
|
+
if (!U(n))
|
|
1145
1145
|
throw new Error(`Function "${e}" did not return a valid FilterRelations`);
|
|
1146
1146
|
return n;
|
|
1147
1147
|
}
|
|
1148
|
-
function
|
|
1148
|
+
function Gt(e, r) {
|
|
1149
1149
|
if (e.startsWith("filterFactory.logic."))
|
|
1150
|
-
return
|
|
1151
|
-
const t = e.replace("filterFactory.", ""), n =
|
|
1152
|
-
if (!
|
|
1150
|
+
return Kt(e, r);
|
|
1151
|
+
const t = e.replace("filterFactory.", ""), n = de(Wr, t)(...r);
|
|
1152
|
+
if (!K(n) && !U(n))
|
|
1153
1153
|
throw new Error(`Function "${e}" did not return a valid Filter or FilterRelations`);
|
|
1154
1154
|
return n;
|
|
1155
1155
|
}
|
|
1156
|
-
function
|
|
1156
|
+
function Qt(e, r) {
|
|
1157
1157
|
const s = e.split(".")[0];
|
|
1158
1158
|
if (s === "measureFactory")
|
|
1159
|
-
return Wt(e, r);
|
|
1160
|
-
if (s === "filterFactory")
|
|
1161
1159
|
return Jt(e, r);
|
|
1160
|
+
if (s === "filterFactory")
|
|
1161
|
+
return Gt(e, r);
|
|
1162
1162
|
throw new Error(
|
|
1163
1163
|
`Unsupported factory: "${s}". Supported factories: measureFactory, filterFactory`
|
|
1164
1164
|
);
|
|
1165
1165
|
}
|
|
1166
|
-
const
|
|
1166
|
+
const Yt = /\[(\w[\w.-]*)\]/g, Qe = /* @__PURE__ */ new Set([
|
|
1167
1167
|
// Universal – Aggregative (per Sisense doc: (A) only; Statistical CONTRIBUTION, PERCENTILE, etc. are non-aggregative)
|
|
1168
1168
|
"AVG",
|
|
1169
1169
|
"COUNT",
|
|
@@ -1191,29 +1191,30 @@ const Kt = /\[([a-zA-Z_][a-zA-Z0-9_.-]*)\]/g, Ge = /* @__PURE__ */ new Set([
|
|
|
1191
1191
|
"SKEWP",
|
|
1192
1192
|
"SKEW",
|
|
1193
1193
|
"SLOPE"
|
|
1194
|
-
]),
|
|
1195
|
-
`\\b(${Array.from(
|
|
1194
|
+
]), Ht = new RegExp(
|
|
1195
|
+
`\\b(${Array.from(Qe).join("|")})\\s*\\(`,
|
|
1196
1196
|
"i"
|
|
1197
1197
|
);
|
|
1198
|
-
function
|
|
1199
|
-
return E(e) ? !0 : typeof e == "string" && e.startsWith(
|
|
1198
|
+
function Zt(e) {
|
|
1199
|
+
return E(e) ? !0 : typeof e == "string" && e.startsWith(F) ? !1 : e && typeof e == "object" && "kind" in e ? e.kind === "measure" : !0;
|
|
1200
1200
|
}
|
|
1201
|
-
function
|
|
1201
|
+
function Xt(e) {
|
|
1202
1202
|
const r = /\b(\w+)\s*\(/g, t = /* @__PURE__ */ new Set();
|
|
1203
1203
|
let s;
|
|
1204
1204
|
for (; (s = r.exec(e)) !== null; ) {
|
|
1205
1205
|
const n = s[1];
|
|
1206
|
-
|
|
1206
|
+
Qe.has(n.toUpperCase()) || t.add(n);
|
|
1207
1207
|
}
|
|
1208
1208
|
return Array.from(t);
|
|
1209
1209
|
}
|
|
1210
|
-
function
|
|
1210
|
+
function vt(e) {
|
|
1211
1211
|
return e.length === 1 ? `[${e[0]}]` : e.map((r) => `[${r}]`).join(", ");
|
|
1212
1212
|
}
|
|
1213
|
-
function
|
|
1213
|
+
function es(e) {
|
|
1214
1214
|
return e.length === 0 ? "" : e.length === 1 ? `${e[0]} is not an aggregative function. ` : `${e.join(", ")} are not aggregative functions. `;
|
|
1215
1215
|
}
|
|
1216
|
-
|
|
1216
|
+
const B = (e) => e.startsWith("[") ? e : `[${e}]`, Ee = (e) => e.startsWith("[") && e.endsWith("]") ? e.slice(1, -1) : e;
|
|
1217
|
+
function rs(e, r, t = {}) {
|
|
1217
1218
|
const {
|
|
1218
1219
|
warnUnusedContext: s = !0,
|
|
1219
1220
|
errorOnUnusedContext: n = !0,
|
|
@@ -1230,68 +1231,75 @@ function vt(e, r, t = {}) {
|
|
|
1230
1231
|
return o || (a.errors.push(`${i}args[1]: Formula cannot be empty`), a.isValid = !1), a;
|
|
1231
1232
|
const u = /\b\w+\s*\[/gi, c = e.match(u);
|
|
1232
1233
|
if (c) {
|
|
1233
|
-
const
|
|
1234
|
+
const f = c[0].replace(/\s*\[.*$/, "");
|
|
1234
1235
|
a.errors.push(
|
|
1235
|
-
`${i}args[1]: Invalid syntax: '${
|
|
1236
|
+
`${i}args[1]: Invalid syntax: '${f}' - operator cannot be used before bracket reference without parentheses`
|
|
1236
1237
|
), a.isValid = !1;
|
|
1237
1238
|
}
|
|
1238
1239
|
a.references = [
|
|
1239
1240
|
...new Set(
|
|
1240
|
-
[...e.matchAll(new RegExp(
|
|
1241
|
+
[...e.matchAll(new RegExp(Yt.source, "g"))].map((f) => f[1])
|
|
1241
1242
|
)
|
|
1242
1243
|
];
|
|
1243
|
-
const
|
|
1244
|
+
const p = Object.keys(r);
|
|
1244
1245
|
if (a.references.length === 0)
|
|
1245
1246
|
return a.warnings.push(
|
|
1246
1247
|
`${i}args[1]: No bracket references found in formula - ensure this is intentional`
|
|
1247
1248
|
), a;
|
|
1248
|
-
if (
|
|
1249
|
+
if (p.length === 0)
|
|
1249
1250
|
return a.errors.push(
|
|
1250
1251
|
`${i}args[2]: Context cannot be empty - custom formulas require context definitions`
|
|
1251
1252
|
), a.isValid = !1, a;
|
|
1252
|
-
const
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
)
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1253
|
+
const m = new Set(p.map(B)), y = a.references.filter(
|
|
1254
|
+
(f) => !m.has(B(f))
|
|
1255
|
+
);
|
|
1256
|
+
if (y.length > 0) {
|
|
1257
|
+
a.isValid = !1;
|
|
1258
|
+
const f = p.map((d) => `[${Ee(d)}]`).join(", ");
|
|
1259
|
+
y.length === 1 ? a.errors.push(
|
|
1260
|
+
`${i}args[1]: Reference [${y[0]}] not found in context. Available keys: ${f}`
|
|
1261
|
+
) : a.errors.push(
|
|
1262
|
+
`${i}args[1]: References [${y.join(
|
|
1263
|
+
"], ["
|
|
1264
|
+
)}] not found in context. Available keys: ${f}`
|
|
1262
1265
|
);
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1266
|
+
}
|
|
1267
|
+
if (!Ht.test(e)) {
|
|
1268
|
+
const f = a.references.filter((d) => {
|
|
1269
|
+
var $;
|
|
1270
|
+
const w = ($ = r[B(d)]) != null ? $ : r[d];
|
|
1271
|
+
return w !== void 0 && !Zt(w);
|
|
1272
|
+
});
|
|
1273
|
+
f.length > 0 && (a.errors.push(
|
|
1274
|
+
`${i}args[1]: ${es(
|
|
1275
|
+
Xt(e)
|
|
1276
|
+
)}Bracket reference(s) ${vt(
|
|
1277
|
+
f
|
|
1268
1278
|
)} point to raw attributes and must be wrapped in an aggregative function (e.g. SUM, AVG)`
|
|
1269
1279
|
), a.isValid = !1);
|
|
1270
1280
|
}
|
|
1271
|
-
if ((s || n) &&
|
|
1272
|
-
const
|
|
1273
|
-
if (a.unusedContextKeys =
|
|
1274
|
-
const
|
|
1275
|
-
|
|
1276
|
-
)}] are defined but not used in formula`;
|
|
1277
|
-
n ? (a.errors.push(f), a.isValid = !1) : s && a.warnings.push(f);
|
|
1281
|
+
if ((s || n) && p.length > 0) {
|
|
1282
|
+
const f = new Set(a.references.map(B)), d = p.filter((w) => !f.has(B(w)));
|
|
1283
|
+
if (a.unusedContextKeys = d, d.length > 0) {
|
|
1284
|
+
const w = d.map((D) => `[${Ee(D)}]`).join(", "), $ = `${i}args[2]: Context keys ${w} are defined but not used in formula`;
|
|
1285
|
+
n ? (a.errors.push($), a.isValid = !1) : s && a.warnings.push($);
|
|
1278
1286
|
}
|
|
1279
1287
|
}
|
|
1280
1288
|
return a;
|
|
1281
1289
|
}
|
|
1282
|
-
function
|
|
1283
|
-
const s =
|
|
1290
|
+
function ts(e, r, t = {}) {
|
|
1291
|
+
const s = rs(e, r, t);
|
|
1284
1292
|
if (!s.isValid)
|
|
1285
1293
|
throw new Error(s.errors.join("; "));
|
|
1286
1294
|
s.warnings.length > 0 && console.warn("Formula validation warnings:", s.warnings.join("; "));
|
|
1287
1295
|
}
|
|
1288
|
-
function
|
|
1296
|
+
function ss(e, r) {
|
|
1289
1297
|
if (e.length < 3 || e.length > 5)
|
|
1290
1298
|
throw new Error(
|
|
1291
1299
|
`${r.pathPrefix}Expected 3, 4, or 5 arguments for customFormula (title, formula, context, format?, description?)`
|
|
1292
1300
|
);
|
|
1293
1301
|
const t = e[1], s = e[2];
|
|
1294
|
-
|
|
1302
|
+
ts(t, s, {
|
|
1295
1303
|
errorPrefix: `${r.pathPrefix}`,
|
|
1296
1304
|
errorOnUnusedContext: !0,
|
|
1297
1305
|
// Strict validation: all context keys must be used
|
|
@@ -1310,9 +1318,9 @@ function rs(e, r) {
|
|
|
1310
1318
|
pathPrefix: a
|
|
1311
1319
|
}
|
|
1312
1320
|
});
|
|
1313
|
-
else if (typeof i == "string" && i.startsWith(
|
|
1321
|
+
else if (typeof i == "string" && i.startsWith(F))
|
|
1314
1322
|
try {
|
|
1315
|
-
n[`${o}`] =
|
|
1323
|
+
n[`${o}`] = Q(
|
|
1316
1324
|
i,
|
|
1317
1325
|
r.dataSource,
|
|
1318
1326
|
r.schemaIndex
|
|
@@ -1325,85 +1333,85 @@ function rs(e, r) {
|
|
|
1325
1333
|
n[`${o}`] = i;
|
|
1326
1334
|
else
|
|
1327
1335
|
throw new Error(
|
|
1328
|
-
`${a}: Invalid context value for key '${o}'. Expected a function call or attribute reference (${
|
|
1336
|
+
`${a}: Invalid context value for key '${o}'. Expected a function call or attribute reference (${F}...), but got: ${typeof i}`
|
|
1329
1337
|
);
|
|
1330
1338
|
}
|
|
1331
1339
|
e[2] = n;
|
|
1332
1340
|
}
|
|
1333
|
-
function
|
|
1341
|
+
function me(e, r) {
|
|
1334
1342
|
const t = e[0];
|
|
1335
1343
|
if (!t || typeof t != "object" || !("type" in t))
|
|
1336
1344
|
throw new Error(`${r.pathPrefix}args[0]: Expected attribute as first argument`);
|
|
1337
1345
|
return t;
|
|
1338
1346
|
}
|
|
1339
|
-
function
|
|
1340
|
-
const t =
|
|
1341
|
-
if (!
|
|
1347
|
+
function Ce(e, r) {
|
|
1348
|
+
const t = me(e, r);
|
|
1349
|
+
if (!Lt(t))
|
|
1342
1350
|
throw new Error(
|
|
1343
1351
|
`${r.pathPrefix}args[0]: Attribute must be string or numeric type, got ${G(
|
|
1344
1352
|
t
|
|
1345
1353
|
)} attribute`
|
|
1346
1354
|
);
|
|
1347
1355
|
}
|
|
1348
|
-
function
|
|
1349
|
-
const t =
|
|
1350
|
-
if (!
|
|
1356
|
+
function T(e, r) {
|
|
1357
|
+
const t = me(e, r);
|
|
1358
|
+
if (!Ge(t))
|
|
1351
1359
|
throw new Error(
|
|
1352
1360
|
`${r.pathPrefix}args[0]: Attribute must be numeric type, got ${G(
|
|
1353
1361
|
t
|
|
1354
1362
|
)} attribute`
|
|
1355
1363
|
);
|
|
1356
1364
|
}
|
|
1357
|
-
function
|
|
1358
|
-
const t =
|
|
1359
|
-
if (!
|
|
1365
|
+
function N(e, r) {
|
|
1366
|
+
const t = me(e, r);
|
|
1367
|
+
if (!Ke(t))
|
|
1360
1368
|
throw new Error(
|
|
1361
1369
|
`${r.pathPrefix}args[0]: Attribute must be string type, got ${G(
|
|
1362
1370
|
t
|
|
1363
1371
|
)} attribute`
|
|
1364
1372
|
);
|
|
1365
1373
|
}
|
|
1366
|
-
function
|
|
1374
|
+
function ns(e, r) {
|
|
1367
1375
|
const t = e[0];
|
|
1368
1376
|
if (!t || typeof t != "object" || !("attribute" in t))
|
|
1369
1377
|
throw new Error(`${r.pathPrefix}args[0]: Expected filter as first argument`);
|
|
1370
1378
|
return t;
|
|
1371
1379
|
}
|
|
1372
|
-
function
|
|
1373
|
-
const t =
|
|
1374
|
-
if (!
|
|
1380
|
+
function is(e, r) {
|
|
1381
|
+
const t = ns(e, r);
|
|
1382
|
+
if (!ne(t))
|
|
1375
1383
|
throw new Error(
|
|
1376
1384
|
`${r.pathPrefix}args[0]: exclude filter only accepts members filter, got ${t.__serializable || "unknown"} filter`
|
|
1377
1385
|
);
|
|
1378
1386
|
}
|
|
1379
|
-
const
|
|
1380
|
-
"measureFactory.customFormula":
|
|
1387
|
+
const os = {
|
|
1388
|
+
"measureFactory.customFormula": ss,
|
|
1381
1389
|
// String | Number filters
|
|
1382
|
-
"filterFactory.equals":
|
|
1383
|
-
"filterFactory.doesntEqual":
|
|
1390
|
+
"filterFactory.equals": Ce,
|
|
1391
|
+
"filterFactory.doesntEqual": Ce,
|
|
1384
1392
|
// Numeric filters
|
|
1385
|
-
"filterFactory.greaterThan":
|
|
1386
|
-
"filterFactory.greaterThanOrEqual":
|
|
1387
|
-
"filterFactory.lessThan":
|
|
1388
|
-
"filterFactory.lessThanOrEqual":
|
|
1389
|
-
"filterFactory.between":
|
|
1390
|
-
"filterFactory.betweenNotEqual":
|
|
1391
|
-
"filterFactory.numeric":
|
|
1393
|
+
"filterFactory.greaterThan": T,
|
|
1394
|
+
"filterFactory.greaterThanOrEqual": T,
|
|
1395
|
+
"filterFactory.lessThan": T,
|
|
1396
|
+
"filterFactory.lessThanOrEqual": T,
|
|
1397
|
+
"filterFactory.between": T,
|
|
1398
|
+
"filterFactory.betweenNotEqual": T,
|
|
1399
|
+
"filterFactory.numeric": T,
|
|
1392
1400
|
// String filters
|
|
1393
|
-
"filterFactory.contains":
|
|
1394
|
-
"filterFactory.doesntContain":
|
|
1395
|
-
"filterFactory.startsWith":
|
|
1396
|
-
"filterFactory.doesntStartWith":
|
|
1397
|
-
"filterFactory.endsWith":
|
|
1398
|
-
"filterFactory.doesntEndWith":
|
|
1399
|
-
"filterFactory.like":
|
|
1401
|
+
"filterFactory.contains": N,
|
|
1402
|
+
"filterFactory.doesntContain": N,
|
|
1403
|
+
"filterFactory.startsWith": N,
|
|
1404
|
+
"filterFactory.doesntStartWith": N,
|
|
1405
|
+
"filterFactory.endsWith": N,
|
|
1406
|
+
"filterFactory.doesntEndWith": N,
|
|
1407
|
+
"filterFactory.like": N,
|
|
1400
1408
|
// Exclude filter
|
|
1401
|
-
"filterFactory.exclude":
|
|
1409
|
+
"filterFactory.exclude": is
|
|
1402
1410
|
};
|
|
1403
|
-
function
|
|
1404
|
-
return
|
|
1411
|
+
function as(e) {
|
|
1412
|
+
return os[`${e}`];
|
|
1405
1413
|
}
|
|
1406
|
-
const
|
|
1414
|
+
const us = {
|
|
1407
1415
|
// ==================== MEASURE FACTORY FUNCTIONS ====================
|
|
1408
1416
|
// Basic aggregations
|
|
1409
1417
|
"measureFactory.sum": [
|
|
@@ -1930,18 +1938,18 @@ const os = {
|
|
|
1930
1938
|
{ type: "FilterRelationsNode", required: !0 }
|
|
1931
1939
|
]
|
|
1932
1940
|
};
|
|
1933
|
-
function
|
|
1934
|
-
return
|
|
1941
|
+
function pe(e) {
|
|
1942
|
+
return us[`${e}`];
|
|
1935
1943
|
}
|
|
1936
|
-
function
|
|
1937
|
-
const r =
|
|
1944
|
+
function cs(e) {
|
|
1945
|
+
const r = pe(e);
|
|
1938
1946
|
return r ? r.filter((t) => t.required).length : 0;
|
|
1939
1947
|
}
|
|
1940
|
-
function
|
|
1941
|
-
const r =
|
|
1948
|
+
function ls(e) {
|
|
1949
|
+
const r = pe(e);
|
|
1942
1950
|
return r ? r.length : 0;
|
|
1943
1951
|
}
|
|
1944
|
-
function
|
|
1952
|
+
function fs(e) {
|
|
1945
1953
|
if (typeof e != "string" || !/^\d{4}-\d{2}-\d{2}/.test(e))
|
|
1946
1954
|
return !1;
|
|
1947
1955
|
const t = Date.parse(e);
|
|
@@ -1950,293 +1958,294 @@ function cs(e) {
|
|
|
1950
1958
|
const s = new Date(e);
|
|
1951
1959
|
return !isNaN(s.getTime());
|
|
1952
1960
|
}
|
|
1953
|
-
function
|
|
1954
|
-
if (e.startsWith(
|
|
1961
|
+
function Z(e, r, t, s) {
|
|
1962
|
+
if (e.startsWith(F))
|
|
1955
1963
|
try {
|
|
1956
|
-
return
|
|
1964
|
+
return Q(e, r, t);
|
|
1957
1965
|
} catch (n) {
|
|
1958
1966
|
const o = n instanceof Error ? n.message : "Unknown error";
|
|
1959
1967
|
throw new Error(`${s}: ${o}`);
|
|
1960
1968
|
}
|
|
1961
1969
|
throw new Error(
|
|
1962
|
-
`${s}: Invalid attribute "${e}". Expected format: "${
|
|
1970
|
+
`${s}: Invalid attribute "${e}". Expected format: "${F}TableName.ColumnName[.Level]"`
|
|
1963
1971
|
);
|
|
1964
1972
|
}
|
|
1965
|
-
function
|
|
1966
|
-
if (e.startsWith(
|
|
1973
|
+
function ds(e, r, t, s) {
|
|
1974
|
+
if (e.startsWith(F))
|
|
1967
1975
|
try {
|
|
1968
|
-
return
|
|
1976
|
+
return Vt(e, r, t);
|
|
1969
1977
|
} catch (n) {
|
|
1970
1978
|
const o = n instanceof Error ? n.message : "Unknown error";
|
|
1971
1979
|
throw new Error(`${s}: ${o}`);
|
|
1972
1980
|
}
|
|
1973
1981
|
throw new Error(
|
|
1974
|
-
`${s}: Invalid date dimension string "${e}". Expected format: "${
|
|
1982
|
+
`${s}: Invalid date dimension string "${e}". Expected format: "${F}TableName.ColumnName"`
|
|
1975
1983
|
);
|
|
1976
1984
|
}
|
|
1977
|
-
function
|
|
1985
|
+
function ms(e) {
|
|
1978
1986
|
const r = e.data, { argSchema: t, dataSource: s, schemaIndex: n, pathPrefix: o } = e.context, i = o;
|
|
1979
1987
|
if (r === void 0) {
|
|
1980
1988
|
if (t.required)
|
|
1981
1989
|
throw new Error(`${i}: Required argument is missing (expected ${t.type})`);
|
|
1982
1990
|
return;
|
|
1983
1991
|
}
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
`${i}: Expected array of strings, got ${typeof r}. Example: ["value1", "value2"]`
|
|
2001
|
-
);
|
|
2002
|
-
if (!r.every((a) => typeof a == "string"))
|
|
2003
|
-
throw new Error(
|
|
2004
|
-
`${i}: Expected array of strings, but contains non-string values`
|
|
2005
|
-
);
|
|
2006
|
-
return r;
|
|
2007
|
-
case "number[]":
|
|
2008
|
-
if (!Array.isArray(r))
|
|
2009
|
-
throw new Error(
|
|
2010
|
-
`${i}: Expected array of numbers, got ${typeof r}. Example: [10, 20]`
|
|
2011
|
-
);
|
|
2012
|
-
if (!r.every((a) => typeof a == "number"))
|
|
2013
|
-
throw new Error(
|
|
2014
|
-
`${i}: Expected array of numbers, but contains non-number values`
|
|
2015
|
-
);
|
|
2016
|
-
return r;
|
|
2017
|
-
case "Attribute":
|
|
2018
|
-
if (typeof r != "string")
|
|
2019
|
-
throw new Error(
|
|
2020
|
-
`${i}: Expected attribute string, got ${typeof r}. Example: "DM.Commerce.Revenue"`
|
|
2021
|
-
);
|
|
2022
|
-
return H(r, s, n, i);
|
|
2023
|
-
case "Attribute[]":
|
|
2024
|
-
if (!Array.isArray(r))
|
|
2025
|
-
throw new Error(
|
|
2026
|
-
`${i}: Expected array of attributes, got ${typeof r}. Example: ["DM.Commerce.AgeRange"]`
|
|
2027
|
-
);
|
|
2028
|
-
return r.map((a, u) => {
|
|
2029
|
-
if (typeof a != "string")
|
|
2030
|
-
throw new Error(`${i}[${u}]: Expected attribute string, got ${typeof a}`);
|
|
2031
|
-
return H(a, s, n, `${i}[${u}]`);
|
|
2032
|
-
});
|
|
2033
|
-
case "Measure":
|
|
2034
|
-
case "BaseMeasure":
|
|
2035
|
-
if (!E(r))
|
|
2036
|
-
throw new Error(
|
|
2037
|
-
`${i}: Expected measure function call, got ${typeof r}. Example: {"function": "measureFactory.sum", "args": ["DM.Commerce.Revenue"]}`
|
|
2038
|
-
);
|
|
2039
|
-
return C({
|
|
2040
|
-
data: r,
|
|
2041
|
-
context: { dataSource: s, schemaIndex: n, pathPrefix: i }
|
|
2042
|
-
});
|
|
2043
|
-
case "Measure[]":
|
|
2044
|
-
if (!Array.isArray(r))
|
|
2045
|
-
throw new Error(
|
|
2046
|
-
`${i}: Expected array of measure function calls, got ${typeof r}`
|
|
2047
|
-
);
|
|
2048
|
-
return r.map((a, u) => {
|
|
2049
|
-
if (!E(a))
|
|
1992
|
+
if (!(r === null && !t.required))
|
|
1993
|
+
switch (t.type) {
|
|
1994
|
+
case "string":
|
|
1995
|
+
if (typeof r != "string")
|
|
1996
|
+
throw new Error(`${i}: Expected string, got ${typeof r}`);
|
|
1997
|
+
return r;
|
|
1998
|
+
case "number":
|
|
1999
|
+
if (typeof r != "number")
|
|
2000
|
+
throw new Error(`${i}: Expected number, got ${typeof r}`);
|
|
2001
|
+
return r;
|
|
2002
|
+
case "boolean":
|
|
2003
|
+
if (typeof r != "boolean")
|
|
2004
|
+
throw new Error(`${i}: Expected boolean, got ${typeof r}`);
|
|
2005
|
+
return r;
|
|
2006
|
+
case "string[]":
|
|
2007
|
+
if (!Array.isArray(r))
|
|
2050
2008
|
throw new Error(
|
|
2051
|
-
`${i}
|
|
2009
|
+
`${i}: Expected array of strings, got ${typeof r}. Example: ["value1", "value2"]`
|
|
2052
2010
|
);
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2011
|
+
if (!r.every((a) => typeof a == "string"))
|
|
2012
|
+
throw new Error(
|
|
2013
|
+
`${i}: Expected array of strings, but contains non-string values`
|
|
2014
|
+
);
|
|
2015
|
+
return r;
|
|
2016
|
+
case "number[]":
|
|
2017
|
+
if (!Array.isArray(r))
|
|
2018
|
+
throw new Error(
|
|
2019
|
+
`${i}: Expected array of numbers, got ${typeof r}. Example: [10, 20]`
|
|
2020
|
+
);
|
|
2021
|
+
if (!r.every((a) => typeof a == "number"))
|
|
2022
|
+
throw new Error(
|
|
2023
|
+
`${i}: Expected array of numbers, but contains non-number values`
|
|
2024
|
+
);
|
|
2025
|
+
return r;
|
|
2026
|
+
case "Attribute":
|
|
2027
|
+
if (typeof r != "string")
|
|
2028
|
+
throw new Error(
|
|
2029
|
+
`${i}: Expected attribute string, got ${typeof r}. Example: "DM.Commerce.Revenue"`
|
|
2030
|
+
);
|
|
2031
|
+
return Z(r, s, n, i);
|
|
2032
|
+
case "Attribute[]":
|
|
2033
|
+
if (!Array.isArray(r))
|
|
2034
|
+
throw new Error(
|
|
2035
|
+
`${i}: Expected array of attributes, got ${typeof r}. Example: ["DM.Commerce.AgeRange"]`
|
|
2036
|
+
);
|
|
2037
|
+
return r.map((a, u) => {
|
|
2038
|
+
if (typeof a != "string")
|
|
2039
|
+
throw new Error(`${i}[${u}]: Expected attribute string, got ${typeof a}`);
|
|
2040
|
+
return Z(a, s, n, `${i}[${u}]`);
|
|
2056
2041
|
});
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
throw new Error(
|
|
2061
|
-
`${i}: Expected filter function call, got ${typeof r}. Example: {"function": "filterFactory.contains", "args": ["DM.Brand.Brand", "Apple"]}`
|
|
2062
|
-
);
|
|
2063
|
-
return C({
|
|
2064
|
-
data: r,
|
|
2065
|
-
context: { dataSource: s, schemaIndex: n, pathPrefix: i }
|
|
2066
|
-
});
|
|
2067
|
-
case "Filter[]":
|
|
2068
|
-
if (!Array.isArray(r))
|
|
2069
|
-
throw new Error(
|
|
2070
|
-
`${i}: Expected array of filter function calls, got ${typeof r}`
|
|
2071
|
-
);
|
|
2072
|
-
return r.map((a, u) => {
|
|
2073
|
-
if (!E(a))
|
|
2042
|
+
case "Measure":
|
|
2043
|
+
case "BaseMeasure":
|
|
2044
|
+
if (!E(r))
|
|
2074
2045
|
throw new Error(
|
|
2075
|
-
`${i}
|
|
2046
|
+
`${i}: Expected measure function call, got ${typeof r}. Example: {"function": "measureFactory.sum", "args": ["DM.Commerce.Revenue"]}`
|
|
2076
2047
|
);
|
|
2077
2048
|
return C({
|
|
2078
|
-
data:
|
|
2079
|
-
context: { dataSource: s, schemaIndex: n, pathPrefix:
|
|
2049
|
+
data: r,
|
|
2050
|
+
context: { dataSource: s, schemaIndex: n, pathPrefix: i }
|
|
2080
2051
|
});
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2052
|
+
case "Measure[]":
|
|
2053
|
+
if (!Array.isArray(r))
|
|
2054
|
+
throw new Error(
|
|
2055
|
+
`${i}: Expected array of measure function calls, got ${typeof r}`
|
|
2056
|
+
);
|
|
2084
2057
|
return r.map((a, u) => {
|
|
2085
2058
|
if (!E(a))
|
|
2086
2059
|
throw new Error(
|
|
2087
|
-
`${i}[${u}]: Expected
|
|
2060
|
+
`${i}[${u}]: Expected measure function call, got ${typeof a}`
|
|
2088
2061
|
);
|
|
2089
2062
|
return C({
|
|
2090
2063
|
data: a,
|
|
2091
2064
|
context: { dataSource: s, schemaIndex: n, pathPrefix: `${i}[${u}]` }
|
|
2092
2065
|
});
|
|
2093
2066
|
});
|
|
2094
|
-
|
|
2067
|
+
case "Filter":
|
|
2068
|
+
if (!E(r))
|
|
2069
|
+
throw new Error(
|
|
2070
|
+
`${i}: Expected filter function call, got ${typeof r}. Example: {"function": "filterFactory.contains", "args": ["DM.Brand.Brand", "Apple"]}`
|
|
2071
|
+
);
|
|
2095
2072
|
return C({
|
|
2096
2073
|
data: r,
|
|
2097
2074
|
context: { dataSource: s, schemaIndex: n, pathPrefix: i }
|
|
2098
2075
|
});
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2076
|
+
case "Filter[]":
|
|
2077
|
+
if (!Array.isArray(r))
|
|
2078
|
+
throw new Error(
|
|
2079
|
+
`${i}: Expected array of filter function calls, got ${typeof r}`
|
|
2080
|
+
);
|
|
2081
|
+
return r.map((a, u) => {
|
|
2082
|
+
if (!E(a))
|
|
2083
|
+
throw new Error(
|
|
2084
|
+
`${i}[${u}]: Expected filter function call, got ${typeof a}`
|
|
2085
|
+
);
|
|
2086
|
+
return C({
|
|
2087
|
+
data: a,
|
|
2088
|
+
context: { dataSource: s, schemaIndex: n, pathPrefix: `${i}[${u}]` }
|
|
2089
|
+
});
|
|
2090
|
+
});
|
|
2091
|
+
case "FilterRelationsNode":
|
|
2092
|
+
if (Array.isArray(r))
|
|
2093
|
+
return r.map((a, u) => {
|
|
2094
|
+
if (!E(a))
|
|
2095
|
+
throw new Error(
|
|
2096
|
+
`${i}[${u}]: Expected filter function call, got ${typeof a}`
|
|
2097
|
+
);
|
|
2098
|
+
return C({
|
|
2099
|
+
data: a,
|
|
2100
|
+
context: { dataSource: s, schemaIndex: n, pathPrefix: `${i}[${u}]` }
|
|
2101
|
+
});
|
|
2102
|
+
});
|
|
2103
|
+
if (E(r))
|
|
2104
|
+
return C({
|
|
2105
|
+
data: r,
|
|
2106
|
+
context: { dataSource: s, schemaIndex: n, pathPrefix: i }
|
|
2107
|
+
});
|
|
2110
2108
|
throw new Error(
|
|
2111
|
-
`${i}: Expected
|
|
2109
|
+
`${i}: Expected filter function call or array of filters, got ${typeof r}`
|
|
2112
2110
|
);
|
|
2113
|
-
|
|
2114
|
-
r
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
)
|
|
2111
|
+
case "DateDimension":
|
|
2112
|
+
if (typeof r != "string")
|
|
2113
|
+
throw new Error(
|
|
2114
|
+
`${i}: Expected date dimension string, got ${typeof r}. Example: "DM.Commerce.Date"`
|
|
2115
|
+
);
|
|
2116
|
+
return ds(r, s, n, i);
|
|
2117
|
+
case "LevelAttribute": {
|
|
2118
|
+
if (typeof r != "string")
|
|
2119
|
+
throw new Error(
|
|
2120
|
+
`${i}: Expected date attribute string, got ${typeof r}. Example: "DM.Commerce.Date.Years"`
|
|
2121
|
+
);
|
|
2122
|
+
const a = Z(
|
|
2123
|
+
r,
|
|
2124
|
+
s,
|
|
2125
|
+
n,
|
|
2126
|
+
i
|
|
2124
2127
|
);
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
return
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
throw new Error(
|
|
2136
|
-
`${i}: Expected measure function call or number, got ${typeof r}`
|
|
2137
|
-
);
|
|
2138
|
-
case "Date | string":
|
|
2139
|
-
if (typeof r == "string") {
|
|
2140
|
-
if (cs(r))
|
|
2128
|
+
if (!kt(a))
|
|
2129
|
+
throw new Error(
|
|
2130
|
+
`${i}: Attribute must be date/datetime type, got ${G(
|
|
2131
|
+
a
|
|
2132
|
+
)} attribute`
|
|
2133
|
+
);
|
|
2134
|
+
return a;
|
|
2135
|
+
}
|
|
2136
|
+
case "Measure | number":
|
|
2137
|
+
if (typeof r == "number")
|
|
2141
2138
|
return r;
|
|
2139
|
+
if (E(r))
|
|
2140
|
+
return C({
|
|
2141
|
+
data: r,
|
|
2142
|
+
context: { dataSource: s, schemaIndex: n, pathPrefix: i }
|
|
2143
|
+
});
|
|
2142
2144
|
throw new Error(
|
|
2143
|
-
`${i}: Expected
|
|
2145
|
+
`${i}: Expected measure function call or number, got ${typeof r}`
|
|
2144
2146
|
);
|
|
2145
|
-
|
|
2146
|
-
if (r
|
|
2147
|
+
case "Date | string":
|
|
2148
|
+
if (typeof r == "string") {
|
|
2149
|
+
if (fs(r))
|
|
2150
|
+
return r;
|
|
2151
|
+
throw new Error(
|
|
2152
|
+
`${i}: Expected valid ISO date string or Date object, got invalid date string "${r}"`
|
|
2153
|
+
);
|
|
2154
|
+
} else {
|
|
2155
|
+
if (r instanceof Date)
|
|
2156
|
+
return r;
|
|
2157
|
+
throw new Error(
|
|
2158
|
+
`${i}: Expected date string or Date object, got ${typeof r}`
|
|
2159
|
+
);
|
|
2160
|
+
}
|
|
2161
|
+
case "string | number":
|
|
2162
|
+
if (typeof r == "string" || typeof r == "number")
|
|
2147
2163
|
return r;
|
|
2148
|
-
throw new Error(
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2164
|
+
throw new Error(`${i}: Expected string or number, got ${typeof r}`);
|
|
2165
|
+
case "BaseFilterConfig":
|
|
2166
|
+
case "MembersFilterConfig":
|
|
2167
|
+
case "CustomFormulaContext":
|
|
2168
|
+
case "any":
|
|
2169
|
+
if (r == null && t.required)
|
|
2170
|
+
throw new Error(`${i}: Required argument is null/undefined`);
|
|
2154
2171
|
return r;
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
case "CustomFormulaContext":
|
|
2159
|
-
case "any":
|
|
2160
|
-
if (r == null && t.required)
|
|
2161
|
-
throw new Error(`${i}: Required argument is null/undefined`);
|
|
2162
|
-
return r;
|
|
2163
|
-
default:
|
|
2164
|
-
return r;
|
|
2165
|
-
}
|
|
2172
|
+
default:
|
|
2173
|
+
return r;
|
|
2174
|
+
}
|
|
2166
2175
|
}
|
|
2167
2176
|
function C(e) {
|
|
2168
|
-
const { data: r } = e, { dataSource: t, schemaIndex: s, pathPrefix: n } = e.context, { function: o, args: i } = r, a = n ? `${n}.` : "", u =
|
|
2177
|
+
const { data: r } = e, { dataSource: t, schemaIndex: s, pathPrefix: n } = e.context, { function: o, args: i } = r, a = n ? `${n}.` : "", u = pe(o);
|
|
2169
2178
|
if (!u)
|
|
2170
2179
|
throw new Error(`${a}function: Unknown function "${o}"`);
|
|
2171
|
-
const c =
|
|
2180
|
+
const c = cs(o), p = ls(o);
|
|
2172
2181
|
if (i.length < c)
|
|
2173
2182
|
throw new Error(
|
|
2174
2183
|
`${a}function: Expected at least ${c} arguments, got ${i.length}`
|
|
2175
2184
|
);
|
|
2176
|
-
if (i.length >
|
|
2185
|
+
if (i.length > p)
|
|
2177
2186
|
throw new Error(
|
|
2178
|
-
`${a}function: Expected at most ${
|
|
2187
|
+
`${a}function: Expected at most ${p} arguments, got ${i.length}`
|
|
2179
2188
|
);
|
|
2180
|
-
const
|
|
2189
|
+
const m = [], y = [];
|
|
2181
2190
|
for (let f = 0; f < Math.max(i.length, u.length); f++) {
|
|
2182
|
-
const
|
|
2183
|
-
if (
|
|
2184
|
-
|
|
2191
|
+
const d = u[`${f}`], w = i[`${f}`], $ = a ? `${a}args[${f}]` : `args[${f}]`;
|
|
2192
|
+
if (w === void 0) {
|
|
2193
|
+
d != null && d.required && y.push(`${$}: Missing required argument (expected ${d.type})`);
|
|
2185
2194
|
continue;
|
|
2186
2195
|
}
|
|
2187
|
-
if (!
|
|
2188
|
-
y.push(`${
|
|
2196
|
+
if (!d) {
|
|
2197
|
+
y.push(`${$}: Unexpected argument`);
|
|
2189
2198
|
continue;
|
|
2190
2199
|
}
|
|
2191
2200
|
try {
|
|
2192
|
-
const
|
|
2193
|
-
data:
|
|
2201
|
+
const D = ms({
|
|
2202
|
+
data: w,
|
|
2194
2203
|
context: {
|
|
2195
2204
|
dataSource: t,
|
|
2196
2205
|
schemaIndex: s,
|
|
2197
|
-
pathPrefix:
|
|
2198
|
-
argSchema:
|
|
2206
|
+
pathPrefix: $,
|
|
2207
|
+
argSchema: d
|
|
2199
2208
|
}
|
|
2200
2209
|
});
|
|
2201
|
-
|
|
2202
|
-
} catch (
|
|
2203
|
-
const
|
|
2204
|
-
y.push(
|
|
2210
|
+
m.push(D);
|
|
2211
|
+
} catch (D) {
|
|
2212
|
+
const ve = D instanceof Error ? D.message : "Unknown error";
|
|
2213
|
+
y.push(ve);
|
|
2205
2214
|
}
|
|
2206
2215
|
}
|
|
2207
2216
|
if (y.length > 0) {
|
|
2208
2217
|
const f = y.join("; ");
|
|
2209
2218
|
throw new Error(f);
|
|
2210
2219
|
}
|
|
2211
|
-
const
|
|
2212
|
-
if (
|
|
2220
|
+
const x = as(o);
|
|
2221
|
+
if (x)
|
|
2213
2222
|
try {
|
|
2214
|
-
|
|
2223
|
+
x(m, {
|
|
2215
2224
|
dataSource: t,
|
|
2216
2225
|
schemaIndex: s,
|
|
2217
2226
|
pathPrefix: a
|
|
2218
2227
|
});
|
|
2219
2228
|
} catch (f) {
|
|
2220
|
-
const
|
|
2221
|
-
throw new Error(
|
|
2229
|
+
const d = f instanceof Error ? f.message : "Unknown validation error";
|
|
2230
|
+
throw new Error(d);
|
|
2222
2231
|
}
|
|
2223
|
-
return
|
|
2232
|
+
return Qt(o, m);
|
|
2224
2233
|
}
|
|
2225
|
-
function
|
|
2234
|
+
function Ye(e) {
|
|
2226
2235
|
const { attribute: r, config: t } = e;
|
|
2227
|
-
if (
|
|
2228
|
-
const { granularity: s } = r, n = e.members.map((a) => s === "Years" && !isNaN(Number(a)) ? `${a}-01-01T00:00:00` : a), o =
|
|
2229
|
-
return
|
|
2236
|
+
if (ne(e) && jr(r)) {
|
|
2237
|
+
const { granularity: s } = r, n = e.members.map((a) => s === "Years" && !isNaN(Number(a)) ? `${a}-01-01T00:00:00` : a), o = Jr(t), i = Object.keys(o).length === 0 ? void 0 : o;
|
|
2238
|
+
return Kr(r, n, i);
|
|
2230
2239
|
}
|
|
2231
2240
|
return e;
|
|
2232
2241
|
}
|
|
2233
|
-
function
|
|
2242
|
+
function ps(e) {
|
|
2234
2243
|
let r = [];
|
|
2235
2244
|
for (const t of e)
|
|
2236
|
-
|
|
2245
|
+
U(t) ? r = he(t, r) : r = he([Ye(t)], r);
|
|
2237
2246
|
return r != null ? r : [];
|
|
2238
2247
|
}
|
|
2239
|
-
const
|
|
2248
|
+
const ys = (e) => {
|
|
2240
2249
|
const { data: r } = e, { dataSource: t, schemaIndex: s } = e.context, n = [], o = [];
|
|
2241
2250
|
return r.forEach((i, a) => {
|
|
2242
2251
|
const u = {
|
|
@@ -2249,15 +2258,15 @@ const ms = (e) => {
|
|
|
2249
2258
|
data: i,
|
|
2250
2259
|
context: { dataSource: t, schemaIndex: s, pathPrefix: "" }
|
|
2251
2260
|
});
|
|
2252
|
-
!
|
|
2261
|
+
!U(c) && !K(c) ? o.push(h(g({}, u), { message: "Invalid filter JSON" })) : n.push(c);
|
|
2253
2262
|
} catch (c) {
|
|
2254
|
-
const
|
|
2255
|
-
o.push(
|
|
2263
|
+
const p = c instanceof Error ? c.message : "Unknown error";
|
|
2264
|
+
o.push(h(g({}, u), { message: p }));
|
|
2256
2265
|
}
|
|
2257
|
-
}), o.length > 0 ? { success: !1, errors: o } : { success: !0, data:
|
|
2258
|
-
},
|
|
2266
|
+
}), o.length > 0 ? { success: !1, errors: o } : { success: !0, data: ps(n) };
|
|
2267
|
+
}, gs = (e) => {
|
|
2259
2268
|
const { data: r } = e, { dataSource: t, schemaIndex: s } = e.context;
|
|
2260
|
-
return r ?
|
|
2269
|
+
return r ? je(r) ? ys({
|
|
2261
2270
|
data: r,
|
|
2262
2271
|
context: { dataSource: t, schemaIndex: s }
|
|
2263
2272
|
}) : {
|
|
@@ -2271,7 +2280,7 @@ const ms = (e) => {
|
|
|
2271
2280
|
}
|
|
2272
2281
|
]
|
|
2273
2282
|
} : { success: !0, data: [] };
|
|
2274
|
-
},
|
|
2283
|
+
}, hs = (e) => {
|
|
2275
2284
|
const { data: r } = e, { dataSource: t, schemaIndex: s } = e.context, n = [], o = [];
|
|
2276
2285
|
return r.forEach((i, a) => {
|
|
2277
2286
|
const u = {
|
|
@@ -2284,15 +2293,15 @@ const ms = (e) => {
|
|
|
2284
2293
|
data: i,
|
|
2285
2294
|
context: { dataSource: t, schemaIndex: s, pathPrefix: "" }
|
|
2286
2295
|
});
|
|
2287
|
-
|
|
2296
|
+
K(c) ? n.push(Ye(c)) : o.push(h(g({}, u), { message: "Invalid filter JSON" }));
|
|
2288
2297
|
} catch (c) {
|
|
2289
|
-
const
|
|
2290
|
-
o.push(
|
|
2298
|
+
const p = c instanceof Error ? c.message : "Unknown error";
|
|
2299
|
+
o.push(h(g({}, u), { message: p }));
|
|
2291
2300
|
}
|
|
2292
2301
|
}), o.length > 0 ? { success: !1, errors: o } : { success: !0, data: n };
|
|
2293
|
-
},
|
|
2302
|
+
}, bs = (e) => {
|
|
2294
2303
|
const { data: r } = e, { dataSource: t, schemaIndex: s } = e.context;
|
|
2295
|
-
return r ?
|
|
2304
|
+
return r ? je(r) ? hs({
|
|
2296
2305
|
data: r,
|
|
2297
2306
|
context: { dataSource: t, schemaIndex: s }
|
|
2298
2307
|
}) : {
|
|
@@ -2306,40 +2315,40 @@ const ms = (e) => {
|
|
|
2306
2315
|
}
|
|
2307
2316
|
]
|
|
2308
2317
|
} : { success: !0, data: [] };
|
|
2309
|
-
},
|
|
2318
|
+
}, Fs = (e, r, t) => {
|
|
2310
2319
|
const { dataSource: s, schemaIndex: n } = r;
|
|
2311
2320
|
try {
|
|
2312
2321
|
const o = C({
|
|
2313
2322
|
data: e,
|
|
2314
2323
|
context: { dataSource: s, schemaIndex: n, pathPrefix: "" }
|
|
2315
2324
|
});
|
|
2316
|
-
return
|
|
2325
|
+
return fe(o) ? { success: !0, data: o } : {
|
|
2317
2326
|
success: !1,
|
|
2318
|
-
errors: [
|
|
2327
|
+
errors: [h(g({}, t), { message: "Invalid measure JSON" })]
|
|
2319
2328
|
};
|
|
2320
2329
|
} catch (o) {
|
|
2321
2330
|
const i = o instanceof Error ? o.message : "Unknown error";
|
|
2322
2331
|
return {
|
|
2323
2332
|
success: !1,
|
|
2324
|
-
errors: [
|
|
2333
|
+
errors: [h(g({}, t), { message: i })]
|
|
2325
2334
|
};
|
|
2326
2335
|
}
|
|
2327
|
-
},
|
|
2336
|
+
}, ws = (e, r, t) => r ? $e(r) ? { measure: e.sort(Ae(r)) } : {
|
|
2328
2337
|
measure: e,
|
|
2329
|
-
error:
|
|
2338
|
+
error: h(g({}, t), {
|
|
2330
2339
|
message: `Invalid sort type. Expected "sortAsc", "sortDesc", or "sortNone". Got: "${r}".`
|
|
2331
2340
|
})
|
|
2332
|
-
} : { measure: e },
|
|
2341
|
+
} : { measure: e }, qs = (e, r, t, s) => {
|
|
2333
2342
|
const n = C({
|
|
2334
2343
|
data: e.column,
|
|
2335
2344
|
context: { dataSource: r, schemaIndex: t, pathPrefix: "" }
|
|
2336
2345
|
});
|
|
2337
|
-
return
|
|
2338
|
-
},
|
|
2339
|
-
if (
|
|
2340
|
-
return
|
|
2346
|
+
return fe(n) ? ws(n, e.sortType, s) : { error: h(g({}, s), { message: "Invalid measure JSON" }) };
|
|
2347
|
+
}, Es = (e, r, t, s) => {
|
|
2348
|
+
if (zt(e))
|
|
2349
|
+
return qs(e, r, t, s);
|
|
2341
2350
|
if (E(e)) {
|
|
2342
|
-
const n =
|
|
2351
|
+
const n = Fs(
|
|
2343
2352
|
e,
|
|
2344
2353
|
{ dataSource: r, schemaIndex: t },
|
|
2345
2354
|
s
|
|
@@ -2347,11 +2356,11 @@ const ms = (e) => {
|
|
|
2347
2356
|
return n.success ? { measure: n.data } : { error: n.errors[0] };
|
|
2348
2357
|
}
|
|
2349
2358
|
return {
|
|
2350
|
-
error:
|
|
2359
|
+
error: h(g({}, s), {
|
|
2351
2360
|
message: 'Invalid measure item. Expected a function call (function/args) or object with "column" and optional "sortType".'
|
|
2352
2361
|
})
|
|
2353
2362
|
};
|
|
2354
|
-
},
|
|
2363
|
+
}, Cs = (e) => {
|
|
2355
2364
|
const { data: r } = e, { dataSource: t, schemaIndex: s } = e.context;
|
|
2356
2365
|
if (!r)
|
|
2357
2366
|
return { success: !0, data: [] };
|
|
@@ -2375,40 +2384,40 @@ const ms = (e) => {
|
|
|
2375
2384
|
input: i
|
|
2376
2385
|
};
|
|
2377
2386
|
try {
|
|
2378
|
-
const c =
|
|
2387
|
+
const c = Es(i, t, s, u);
|
|
2379
2388
|
if (c.error) {
|
|
2380
2389
|
o.push(c.error);
|
|
2381
2390
|
return;
|
|
2382
2391
|
}
|
|
2383
2392
|
c.measure && n.push(c.measure);
|
|
2384
2393
|
} catch (c) {
|
|
2385
|
-
const
|
|
2386
|
-
o.push(
|
|
2394
|
+
const p = c instanceof Error ? c.message : "Unknown error";
|
|
2395
|
+
o.push(h(g({}, u), { message: p }));
|
|
2387
2396
|
}
|
|
2388
2397
|
}), o.length > 0 ? { success: !1, errors: o } : { success: !0, data: n };
|
|
2389
|
-
},
|
|
2390
|
-
const { data: r } = e, { dataSource: t, tables: s } = e.context, n =
|
|
2391
|
-
() =>
|
|
2398
|
+
}, ks = (e) => {
|
|
2399
|
+
const { data: r } = e, { dataSource: t, tables: s } = e.context, n = Bt(s), o = [], i = M(
|
|
2400
|
+
() => jt({
|
|
2392
2401
|
data: r.dimensions || [],
|
|
2393
2402
|
context: { dataSource: t, schemaIndex: n }
|
|
2394
2403
|
}),
|
|
2395
2404
|
o
|
|
2396
|
-
), a =
|
|
2397
|
-
() =>
|
|
2405
|
+
), a = M(
|
|
2406
|
+
() => Cs({
|
|
2398
2407
|
data: r.measures || [],
|
|
2399
2408
|
context: { dataSource: t, schemaIndex: n }
|
|
2400
2409
|
}),
|
|
2401
2410
|
o
|
|
2402
|
-
), u =
|
|
2403
|
-
() =>
|
|
2411
|
+
), u = M(
|
|
2412
|
+
() => gs({
|
|
2404
2413
|
data: r.filters || [],
|
|
2405
2414
|
context: { dataSource: t, schemaIndex: n }
|
|
2406
2415
|
}),
|
|
2407
2416
|
o
|
|
2408
2417
|
);
|
|
2409
2418
|
let c = null;
|
|
2410
|
-
return r.highlights && (c =
|
|
2411
|
-
() =>
|
|
2419
|
+
return r.highlights && (c = M(
|
|
2420
|
+
() => bs({
|
|
2412
2421
|
data: r.highlights || [],
|
|
2413
2422
|
context: { dataSource: t, schemaIndex: n }
|
|
2414
2423
|
}),
|
|
@@ -2418,15 +2427,15 @@ const ms = (e) => {
|
|
|
2418
2427
|
errors: o
|
|
2419
2428
|
} : {
|
|
2420
2429
|
success: !0,
|
|
2421
|
-
data:
|
|
2422
|
-
dataSource:
|
|
2430
|
+
data: g({
|
|
2431
|
+
dataSource: Gr(t),
|
|
2423
2432
|
dimensions: i || [],
|
|
2424
2433
|
measures: a || [],
|
|
2425
2434
|
filters: u || []
|
|
2426
2435
|
}, c && { highlights: c })
|
|
2427
2436
|
};
|
|
2428
2437
|
};
|
|
2429
|
-
function
|
|
2438
|
+
function $s(e) {
|
|
2430
2439
|
const r = [], t = [];
|
|
2431
2440
|
return e.forEach((s, n) => {
|
|
2432
2441
|
const o = () => typeof s.toJSON == "function" ? s.toJSON() : s;
|
|
@@ -2439,27 +2448,27 @@ function Es(e) {
|
|
|
2439
2448
|
});
|
|
2440
2449
|
return;
|
|
2441
2450
|
}
|
|
2442
|
-
if (!s.composeCode.startsWith(
|
|
2451
|
+
if (!s.composeCode.startsWith(F)) {
|
|
2443
2452
|
t.push({
|
|
2444
2453
|
category: "dimensions",
|
|
2445
2454
|
index: n,
|
|
2446
2455
|
input: o(),
|
|
2447
|
-
message: `Expected composeCode to start with "${
|
|
2456
|
+
message: `Expected composeCode to start with "${F}" for dimension at index ${n} (${s.name || "unnamed"}). Got: "${s.composeCode}"`
|
|
2448
2457
|
});
|
|
2449
2458
|
return;
|
|
2450
2459
|
}
|
|
2451
2460
|
const i = s.getSort();
|
|
2452
|
-
if (i !== void 0 && i !==
|
|
2461
|
+
if (i !== void 0 && i !== ie.None) {
|
|
2453
2462
|
const a = {
|
|
2454
2463
|
column: s.composeCode,
|
|
2455
|
-
sortType:
|
|
2464
|
+
sortType: xe(i)
|
|
2456
2465
|
};
|
|
2457
2466
|
r.push(a);
|
|
2458
2467
|
} else
|
|
2459
2468
|
r.push(s.composeCode);
|
|
2460
2469
|
}), t.length > 0 ? { success: !1, errors: t } : { success: !0, data: r };
|
|
2461
2470
|
}
|
|
2462
|
-
function
|
|
2471
|
+
function He(e, r) {
|
|
2463
2472
|
const t = [];
|
|
2464
2473
|
let s = "", n = 0, o = !1, i = null;
|
|
2465
2474
|
for (let a = 0; a < e.length; a++) {
|
|
@@ -2489,7 +2498,7 @@ function Qe(e, r) {
|
|
|
2489
2498
|
}
|
|
2490
2499
|
return s.trim() && t.push(s.trim()), t;
|
|
2491
2500
|
}
|
|
2492
|
-
function
|
|
2501
|
+
function As(e, r) {
|
|
2493
2502
|
let t = 0, s = !1, n = null;
|
|
2494
2503
|
for (let o = 0; o < e.length; o++) {
|
|
2495
2504
|
const i = e[o], a = e[o + 1];
|
|
@@ -2510,10 +2519,10 @@ function Cs(e, r) {
|
|
|
2510
2519
|
}
|
|
2511
2520
|
return -1;
|
|
2512
2521
|
}
|
|
2513
|
-
function
|
|
2522
|
+
function xs(e) {
|
|
2514
2523
|
return e.startsWith("'") && e.endsWith("'") || e.startsWith('"') && e.endsWith('"') ? e.slice(1, -1) : e;
|
|
2515
2524
|
}
|
|
2516
|
-
function
|
|
2525
|
+
function _(e) {
|
|
2517
2526
|
if (!e || typeof e != "string")
|
|
2518
2527
|
throw new Error(`Invalid composeCode: expected non-empty string, got ${typeof e}`);
|
|
2519
2528
|
const r = e.trim();
|
|
@@ -2522,16 +2531,16 @@ function V(e) {
|
|
|
2522
2531
|
const t = r.match(/^([a-zA-Z_$][a-zA-Z0-9_.$]*)\s*\((.*)\)$/);
|
|
2523
2532
|
if (!t)
|
|
2524
2533
|
throw new Error(`Invalid composeCode format: expected function call, got "${r}"`);
|
|
2525
|
-
const s = t[1], n = t[2], o =
|
|
2534
|
+
const s = t[1], n = t[2], o = Ze(n);
|
|
2526
2535
|
return {
|
|
2527
2536
|
function: s,
|
|
2528
2537
|
args: o
|
|
2529
2538
|
};
|
|
2530
2539
|
}
|
|
2531
|
-
function
|
|
2532
|
-
return e.trim() ?
|
|
2540
|
+
function Ze(e) {
|
|
2541
|
+
return e.trim() ? He(e, ",").map(Xe) : [];
|
|
2533
2542
|
}
|
|
2534
|
-
function
|
|
2543
|
+
function Xe(e) {
|
|
2535
2544
|
if (!e)
|
|
2536
2545
|
throw new Error("Cannot parse empty argument value");
|
|
2537
2546
|
if (e === "null")
|
|
@@ -2552,33 +2561,33 @@ function He(e) {
|
|
|
2552
2561
|
const t = e.slice(1, -1).trim();
|
|
2553
2562
|
if (!t)
|
|
2554
2563
|
return [];
|
|
2555
|
-
const s =
|
|
2564
|
+
const s = Ze(t);
|
|
2556
2565
|
return s.every((n) => typeof n == "string"), s;
|
|
2557
2566
|
}
|
|
2558
2567
|
if (e.startsWith("{") && e.endsWith("}")) {
|
|
2559
2568
|
const t = e.slice(1, -1).trim();
|
|
2560
|
-
return t ?
|
|
2569
|
+
return t ? Ms(t) : {};
|
|
2561
2570
|
}
|
|
2562
|
-
return e.includes("(") && e.includes(")") ?
|
|
2571
|
+
return e.includes("(") && e.includes(")") ? _(e) : (e.startsWith("DM."), e);
|
|
2563
2572
|
}
|
|
2564
|
-
function
|
|
2565
|
-
const r =
|
|
2573
|
+
function Ds(e) {
|
|
2574
|
+
const r = As(e, ":");
|
|
2566
2575
|
if (r === -1)
|
|
2567
2576
|
throw new Error(`Invalid object property: expected "key: value", got "${e}"`);
|
|
2568
|
-
const t =
|
|
2577
|
+
const t = xs(e.slice(0, r).trim()), s = Xe(e.slice(r + 1).trim());
|
|
2569
2578
|
return [t, s];
|
|
2570
2579
|
}
|
|
2571
|
-
function
|
|
2580
|
+
function Ms(e) {
|
|
2572
2581
|
if (!e.trim()) return {};
|
|
2573
|
-
const r =
|
|
2582
|
+
const r = He(e, ",").map(Ds).filter(([, t]) => t !== null);
|
|
2574
2583
|
return Object.fromEntries(r);
|
|
2575
2584
|
}
|
|
2576
|
-
const
|
|
2577
|
-
function
|
|
2585
|
+
const te = "Unknown error";
|
|
2586
|
+
function Ss(e) {
|
|
2578
2587
|
if (!e)
|
|
2579
2588
|
return { success: !0, data: [] };
|
|
2580
2589
|
const r = [];
|
|
2581
|
-
if (
|
|
2590
|
+
if (Qr(e)) {
|
|
2582
2591
|
if (!e.composeCode)
|
|
2583
2592
|
return {
|
|
2584
2593
|
success: !1,
|
|
@@ -2592,9 +2601,9 @@ function Ds(e) {
|
|
|
2592
2601
|
]
|
|
2593
2602
|
};
|
|
2594
2603
|
try {
|
|
2595
|
-
return { success: !0, data: [
|
|
2604
|
+
return { success: !0, data: [_(e.composeCode)] };
|
|
2596
2605
|
} catch (s) {
|
|
2597
|
-
const n = s instanceof Error ? s.message :
|
|
2606
|
+
const n = s instanceof Error ? s.message : te;
|
|
2598
2607
|
return {
|
|
2599
2608
|
success: !1,
|
|
2600
2609
|
errors: [
|
|
@@ -2620,10 +2629,10 @@ function Ds(e) {
|
|
|
2620
2629
|
return;
|
|
2621
2630
|
}
|
|
2622
2631
|
try {
|
|
2623
|
-
const o =
|
|
2632
|
+
const o = _(s.composeCode);
|
|
2624
2633
|
t.push(o);
|
|
2625
2634
|
} catch (o) {
|
|
2626
|
-
const i = o instanceof Error ? o.message :
|
|
2635
|
+
const i = o instanceof Error ? o.message : te;
|
|
2627
2636
|
r.push({
|
|
2628
2637
|
category: "filters",
|
|
2629
2638
|
index: n,
|
|
@@ -2633,7 +2642,7 @@ function Ds(e) {
|
|
|
2633
2642
|
}
|
|
2634
2643
|
}), r.length > 0 ? { success: !1, errors: r } : { success: !0, data: t };
|
|
2635
2644
|
}
|
|
2636
|
-
function
|
|
2645
|
+
function Ts(e) {
|
|
2637
2646
|
if (!e)
|
|
2638
2647
|
return { success: !0, data: [] };
|
|
2639
2648
|
const r = [], t = [];
|
|
@@ -2648,10 +2657,10 @@ function Ms(e) {
|
|
|
2648
2657
|
return;
|
|
2649
2658
|
}
|
|
2650
2659
|
try {
|
|
2651
|
-
const o =
|
|
2660
|
+
const o = _(s.composeCode);
|
|
2652
2661
|
r.push(o);
|
|
2653
2662
|
} catch (o) {
|
|
2654
|
-
const i = o instanceof Error ? o.message :
|
|
2663
|
+
const i = o instanceof Error ? o.message : te;
|
|
2655
2664
|
t.push({
|
|
2656
2665
|
category: "highlights",
|
|
2657
2666
|
index: n,
|
|
@@ -2661,7 +2670,7 @@ function Ms(e) {
|
|
|
2661
2670
|
}
|
|
2662
2671
|
}), t.length > 0 ? { success: !1, errors: t } : { success: !0, data: r };
|
|
2663
2672
|
}
|
|
2664
|
-
function
|
|
2673
|
+
function Ns(e) {
|
|
2665
2674
|
const r = [], t = [];
|
|
2666
2675
|
return e.forEach((s, n) => {
|
|
2667
2676
|
const o = () => typeof s.toJSON == "function" ? s.toJSON() : s;
|
|
@@ -2675,11 +2684,11 @@ function Ss(e) {
|
|
|
2675
2684
|
return;
|
|
2676
2685
|
}
|
|
2677
2686
|
try {
|
|
2678
|
-
const i =
|
|
2679
|
-
if (a !== void 0 && a !==
|
|
2687
|
+
const i = _(s.composeCode), a = s.getSort();
|
|
2688
|
+
if (a !== void 0 && a !== ie.None) {
|
|
2680
2689
|
const u = {
|
|
2681
2690
|
column: i,
|
|
2682
|
-
sortType:
|
|
2691
|
+
sortType: xe(a)
|
|
2683
2692
|
};
|
|
2684
2693
|
r.push(u);
|
|
2685
2694
|
} else
|
|
@@ -2695,32 +2704,32 @@ function Ss(e) {
|
|
|
2695
2704
|
}
|
|
2696
2705
|
}), t.length > 0 ? { success: !1, errors: t } : { success: !0, data: r };
|
|
2697
2706
|
}
|
|
2698
|
-
function
|
|
2699
|
-
return typeof e == "string" ? e.replace(/\[\[([^\]]+)\]\]/g, "$1") : Array.isArray(e) ? e.map(
|
|
2700
|
-
Object.entries(e).map(([r, t]) => [r,
|
|
2707
|
+
function se(e) {
|
|
2708
|
+
return typeof e == "string" ? e.replace(/\[\[([^\]]+)\]\]/g, "$1") : Array.isArray(e) ? e.map(se) : e !== null && typeof e == "object" ? Object.fromEntries(
|
|
2709
|
+
Object.entries(e).map(([r, t]) => [r, se(t)])
|
|
2701
2710
|
) : e;
|
|
2702
2711
|
}
|
|
2703
|
-
function
|
|
2704
|
-
const r = [], t =
|
|
2705
|
-
() =>
|
|
2712
|
+
function Ls(e) {
|
|
2713
|
+
const r = [], t = M(
|
|
2714
|
+
() => $s(e.dimensions || []),
|
|
2706
2715
|
r
|
|
2707
|
-
), s =
|
|
2708
|
-
() =>
|
|
2716
|
+
), s = M(
|
|
2717
|
+
() => Ns(e.measures || []),
|
|
2709
2718
|
r
|
|
2710
|
-
), n =
|
|
2711
|
-
() =>
|
|
2719
|
+
), n = M(
|
|
2720
|
+
() => Ss(e.filters),
|
|
2712
2721
|
r
|
|
2713
2722
|
);
|
|
2714
2723
|
let o = null;
|
|
2715
|
-
if (e.highlights && e.highlights.length > 0 && (o =
|
|
2716
|
-
() =>
|
|
2724
|
+
if (e.highlights && e.highlights.length > 0 && (o = M(
|
|
2725
|
+
() => Ts(e.highlights),
|
|
2717
2726
|
r
|
|
2718
2727
|
)), r.length > 0)
|
|
2719
2728
|
return {
|
|
2720
2729
|
success: !1,
|
|
2721
2730
|
errors: r
|
|
2722
2731
|
};
|
|
2723
|
-
const i =
|
|
2732
|
+
const i = g({
|
|
2724
2733
|
dimensions: t || [],
|
|
2725
2734
|
measures: s || [],
|
|
2726
2735
|
filters: n || []
|
|
@@ -2728,11 +2737,11 @@ function Bs(e) {
|
|
|
2728
2737
|
return {
|
|
2729
2738
|
success: !0,
|
|
2730
2739
|
// Strip [[delimiters]] from all strings to preserve original names with spaces
|
|
2731
|
-
data:
|
|
2740
|
+
data: se(i)
|
|
2732
2741
|
};
|
|
2733
2742
|
}
|
|
2734
|
-
function
|
|
2735
|
-
const { filters: r, relations: t } =
|
|
2743
|
+
function Rs(e) {
|
|
2744
|
+
const { filters: r, relations: t } = Zr(
|
|
2736
2745
|
e.filters || []
|
|
2737
2746
|
);
|
|
2738
2747
|
return {
|
|
@@ -2745,19 +2754,19 @@ function Ts(e) {
|
|
|
2745
2754
|
// No count/offset/ungroup - these are execution concerns, not translation concerns
|
|
2746
2755
|
};
|
|
2747
2756
|
}
|
|
2748
|
-
function
|
|
2749
|
-
const s =
|
|
2750
|
-
return
|
|
2757
|
+
function Vs(e, r, t = !1) {
|
|
2758
|
+
const s = Rs(e), n = Yr(s, r);
|
|
2759
|
+
return Hr(n, t);
|
|
2751
2760
|
}
|
|
2752
2761
|
export {
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2762
|
+
Ps as CustomSuperJSON,
|
|
2763
|
+
Ws as EMPTY_EXPANDED_QUERY_MODEL,
|
|
2764
|
+
js as EMPTY_SIMPLE_QUERY_MODEL,
|
|
2765
|
+
Js as isByIdDashboardCodeParams,
|
|
2766
|
+
Ks as isByIdWidgetCodeParams,
|
|
2767
|
+
Gs as isClientSideDashboardCodeParams,
|
|
2768
|
+
Qs as isClientSideWidgetCodeParams,
|
|
2769
|
+
ks as translateQueryFromJSON,
|
|
2770
|
+
Ls as translateQueryToJSON,
|
|
2771
|
+
Vs as translateQueryToJaql
|
|
2763
2772
|
};
|