@sisense/sdk-ui 2.20.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 +68 -68
- package/dist/ai.js +891 -845
- package/dist/analytics-composer/node.cjs +1 -1
- package/dist/analytics-composer/node.js +1002 -858
- package/dist/analytics-composer.cjs +23 -23
- package/dist/analytics-composer.js +8 -8
- package/dist/{dimensions-Blw0p98x.js → dimensions-BiLyFpCg.js} +1 -1
- package/dist/{dimensions-CgMckRe2.cjs → dimensions-X4_igtmO.cjs} +1 -1
- package/dist/{execute-query-VxgY3tbz.js → execute-query-BEeqqDl6.js} +1499 -1491
- 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 +451 -436
- package/dist/index.js +24710 -23005
- package/dist/index.umd.js +689 -624
- package/dist/packages/sdk-ui/src/domains/dashboarding/common-filters/common-filters-connector.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/common-filters/selection-utils.d.ts +4 -3
- package/dist/packages/sdk-ui/src/domains/dashboarding/common-filters/types.d.ts +10 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/common-filters/use-common-filters.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/common-filters/utils.d.ts +2 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/components/content-panel.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/components/editable-layout/components/editable-layout-row.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/components/editable-layout/editable-layout.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/components/editable-layout/helpers.d.ts +1 -1
- 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/hooks/jtd/jtd-config-transformers.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/jtd/jtd-filters.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/jtd/jtd-handlers.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/jtd/jtd-types.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/jtd/jtd-widget-transforms.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/use-jtd-widget.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/use-jtd.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/use-tabber.d.ts +2 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/types.d.ts +44 -3
- package/dist/packages/sdk-ui/src/domains/dashboarding/use-composed-dashboard.d.ts +15 -3
- package/dist/packages/sdk-ui/src/domains/dashboarding/utils.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/filters/components/cascading-filter-tile/cascading-filter-tile.d.ts +13 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/cascading-filter-tile/cascading-level-filter.d.ts +11 -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/common/reorderable-list.d.ts +32 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/criteria-filter-tile/criteria-filter-tile.d.ts +13 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/custom-filter-tile.d.ts +13 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/date-filter/date-range-filter-tile/date-range-filter-tile.d.ts +13 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/date-filter/relative-date-filter-tile/relative-date-filter-tile.d.ts +13 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/{filter-tile.d.ts → filter-tile/filter-tile.d.ts} +13 -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 +12 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/filters-panel/types.d.ts +27 -1
- 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 +13 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/unsupported-filter-tile.d.ts +17 -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/visualizations/core/chart-data-options/translate-boxplot-data-options.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/widgets/components/chart-widget/chart-widget.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/chart-widget/index.d.ts +1 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/chart-widget/types.d.ts +100 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/chart-widget/use-with-chart-widget-drilldown.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/{common-widget.d.ts → common-widget/common-widget.d.ts} +1 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/common-widget/index.d.ts +2 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/common-widget/types.d.ts +8 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/{custom-widget.d.ts → custom-widget/custom-widget.d.ts} +1 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/custom-widget/index.d.ts +2 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/custom-widget/types.d.ts +71 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/pivot-table-widget/index.d.ts +1 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/pivot-table-widget/pivot-table-widget.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/pivot-table-widget/types.d.ts +141 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/pivot-table-widget/use-with-pivot-table-widget-drilldown.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/tabber-buttons-widget/types.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/table-widget/index.d.ts +2 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/{table-widget.d.ts → table-widget/table-widget.d.ts} +1 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/table-widget/types.d.ts +61 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/text-widget/index.d.ts +2 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/{text-widget.d.ts → text-widget/text-widget.d.ts} +1 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/text-widget/types.d.ts +29 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget/index.d.ts +2 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget/types.d.ts +45 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/{widget.d.ts → widget/widget.d.ts} +1 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-dashboard-filters.d.ts +425 -425
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-filters.d.ts +34 -34
- 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/components/widget-by-id/utils.d.ts +11 -5
- package/dist/packages/sdk-ui/src/domains/widgets/helpers/header-menu-utils.d.ts +9 -0
- package/dist/packages/sdk-ui/src/domains/widgets/helpers/index.d.ts +7 -0
- package/dist/packages/sdk-ui/src/domains/widgets/shared/widget-container/index.d.ts +2 -0
- package/dist/packages/sdk-ui/src/domains/widgets/shared/{widget-container.d.ts → widget-container/widget-container.d.ts} +7 -3
- package/dist/packages/sdk-ui/src/domains/widgets/shared/widget-header/types.d.ts +42 -0
- package/dist/packages/sdk-ui/src/domains/widgets/shared/widget-header/widget-header-info-button.d.ts +13 -0
- package/dist/packages/sdk-ui/src/domains/widgets/shared/widget-header/widget-header-toolbar.d.ts +23 -0
- package/dist/packages/sdk-ui/src/domains/widgets/shared/widget-header/widget-header.d.ts +14 -0
- package/dist/packages/sdk-ui/src/domains/widgets/shared/widget-header/widget-menu-button.d.ts +5 -0
- package/dist/packages/sdk-ui/src/domains/widgets/widget-model/widget-model-translator/widget-model-translator.d.ts +8 -1
- package/dist/packages/sdk-ui/src/domains/widgets/widget-model/widget-model.d.ts +1 -1
- package/dist/packages/sdk-ui/src/infra/api/rest-api.d.ts +2 -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 +4 -0
- package/dist/packages/sdk-ui/src/infra/app/settings/types/deployment-props.d.ts +2 -1
- package/dist/packages/sdk-ui/src/infra/app/settings/types/features.d.ts +18 -1
- package/dist/packages/sdk-ui/src/infra/contexts/custom-widgets-provider/types.d.ts +41 -12
- package/dist/packages/sdk-ui/src/infra/contexts/custom-widgets-provider/use-execute-custom-widget-query.d.ts +12 -3
- 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 +5 -3
- package/dist/packages/sdk-ui/src/modules/ai/api/narration-endpoints.d.ts +25 -0
- package/dist/packages/sdk-ui/src/modules/ai/api/types.d.ts +1 -1
- package/dist/packages/sdk-ui/src/modules/ai/chart/nlq-chart-widget.d.ts +2 -2
- package/dist/packages/sdk-ui/src/modules/ai/get-nlg-insights-from-widget.d.ts +4 -1
- package/dist/packages/sdk-ui/src/modules/ai/use-get-nlq-result.d.ts +1 -1
- package/dist/packages/sdk-ui/src/modules/analytics-composer/common/utils.d.ts +2 -1
- package/dist/packages/sdk-ui/src/modules/analytics-composer/dashboard/stringify-widgets.d.ts +1 -1
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/translate-dimensions-from-json.d.ts +3 -2
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/translate-dimensions-to-json.d.ts +6 -6
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/translate-filters-to-json.d.ts +3 -4
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/translate-measures-from-json.d.ts +13 -28
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/translate-measures-to-json.d.ts +6 -7
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/types.d.ts +45 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/types.d.ts +3 -1
- package/dist/packages/sdk-ui/src/modules/analytics-composer/widget/to-widget-code.d.ts +1 -1
- package/dist/packages/sdk-ui/src/modules/analytics-composer/widget/to-widget-props.d.ts +1 -1
- package/dist/packages/sdk-ui/src/modules/analytics-composer/widget/widget-composer.d.ts +1 -1
- package/dist/packages/sdk-ui/src/props.d.ts +19 -427
- package/dist/packages/sdk-ui/src/public-api/internal.d.ts +4 -0
- package/dist/packages/sdk-ui/src/public-api/public.d.ts +7 -7
- 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/dynamic-size-container/default-size.d.ts +6 -6
- 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/packages/sdk-ui/src/types.d.ts +113 -6
- package/dist/{use-common-filters-B2wOzse2.js → quota-notification-D6oMJal8.js} +11177 -10827
- package/dist/{use-common-filters-BCebg2_K.cjs → quota-notification-z3dv2KoH.cjs} +164 -114
- 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-YU936hyL.cjs → types-CoY6F8Ma.cjs} +1 -1
- package/dist/{types-tDJE6TNR.js → types-ixSwJkxM.js} +1 -1
- package/dist/{utils-BRCTwjTN.js → utils-BP-BglHE.js} +5797 -5781
- package/dist/{utils-pvzOGByh.cjs → utils-C8YMrOdw.cjs} +36 -36
- package/dist/{widget-composer-T6nvM6Xc.js → widget-composer-CUUFoCb9.js} +3 -3
- package/dist/{widget-composer-ChJ9V_fN.cjs → widget-composer-DI4sHaNe.cjs} +3 -3
- package/package.json +13 -10
- package/dist/execute-query-CgkFRn7s.cjs +0 -1
- package/dist/packages/sdk-ui/src/domains/widgets/shared/widget-header-info-button.d.ts +0 -9
- package/dist/packages/sdk-ui/src/domains/widgets/shared/widget-header.d.ts +0 -13
- /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 Gr {
|
|
|
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 Ee {
|
|
|
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 Xr extends Ee {
|
|
|
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,31 +67,31 @@ function vr(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;
|
|
75
75
|
for (let n = 0; n < s.length; n++) {
|
|
76
|
-
const
|
|
77
|
-
if (r(
|
|
78
|
-
return
|
|
76
|
+
const o = s[n];
|
|
77
|
+
if (r(o))
|
|
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,31 +99,31 @@ class rt {
|
|
|
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++) {
|
|
112
|
-
let
|
|
113
|
-
if (
|
|
112
|
+
let o = e.charAt(n);
|
|
113
|
+
if (o === "\\" && e.charAt(n + 1) === ".") {
|
|
114
114
|
t += ".", n++;
|
|
115
115
|
continue;
|
|
116
116
|
}
|
|
117
|
-
if (
|
|
117
|
+
if (o === ".") {
|
|
118
118
|
r.push(t), t = "";
|
|
119
119
|
continue;
|
|
120
120
|
}
|
|
121
|
-
t +=
|
|
121
|
+
t += o;
|
|
122
122
|
}
|
|
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 Ae = [
|
|
|
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 De = j((e, r) => $e(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 Re = j(Ne, (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 De.untransform(e, r, t);
|
|
242
|
-
case "class":
|
|
243
241
|
return Re.untransform(e, r, t);
|
|
242
|
+
case "class":
|
|
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,23 +262,23 @@ const ht = (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,
|
|
281
|
-
switch (
|
|
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
|
+
switch (o) {
|
|
282
282
|
case "key":
|
|
283
283
|
e = i;
|
|
284
284
|
break;
|
|
@@ -290,25 +290,25 @@ const bt = (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
|
-
for (let
|
|
298
|
-
const i = r[
|
|
299
|
-
if (
|
|
300
|
-
const
|
|
301
|
-
s = s[
|
|
297
|
+
for (let o = 0; o < r.length - 1; o++) {
|
|
298
|
+
const i = r[o];
|
|
299
|
+
if (S(s)) {
|
|
300
|
+
const a = +i;
|
|
301
|
+
s = s[a];
|
|
302
302
|
} else if (k(s))
|
|
303
303
|
s = s[i];
|
|
304
|
-
else if (
|
|
305
|
-
const
|
|
306
|
-
s =
|
|
307
|
-
} else if (
|
|
308
|
-
if (
|
|
304
|
+
else if (V(s)) {
|
|
305
|
+
const a = +i;
|
|
306
|
+
s = O(s, a);
|
|
307
|
+
} else if (L(s)) {
|
|
308
|
+
if (o === r.length - 2)
|
|
309
309
|
break;
|
|
310
|
-
const u = +i,
|
|
311
|
-
switch (
|
|
310
|
+
const u = +i, c = +r[++o] == 0 ? "key" : "value", p = O(s, u);
|
|
311
|
+
switch (c) {
|
|
312
312
|
case "key":
|
|
313
313
|
s = p;
|
|
314
314
|
break;
|
|
@@ -319,12 +319,12 @@ const bt = (e, r) => {
|
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
321
|
const n = r[r.length - 1];
|
|
322
|
-
if (
|
|
323
|
-
const
|
|
324
|
-
|
|
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
|
+
o !== i && (s.delete(o), s.add(i));
|
|
325
325
|
}
|
|
326
|
-
if (
|
|
327
|
-
const
|
|
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,157 +339,157 @@ const bt = (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
|
|
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
|
-
s.forEach((
|
|
369
|
-
e =
|
|
370
|
-
}), n &&
|
|
368
|
+
s.forEach((o) => {
|
|
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) => {
|
|
384
384
|
if (n.length <= 1)
|
|
385
385
|
return;
|
|
386
|
-
r || (n = n.map((
|
|
387
|
-
const [
|
|
388
|
-
|
|
389
|
-
}), s ?
|
|
390
|
-
}
|
|
391
|
-
const
|
|
392
|
-
var
|
|
393
|
-
const
|
|
394
|
-
if (!
|
|
395
|
-
|
|
396
|
-
const
|
|
397
|
-
if (
|
|
386
|
+
r || (n = n.map((a) => a.map(String)).sort((a, u) => a.length - u.length));
|
|
387
|
+
const [o, ...i] = n;
|
|
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
|
+
}
|
|
391
|
+
const Le = (e, r, t, s, n = [], o = [], i = /* @__PURE__ */ new Map()) => {
|
|
392
|
+
var x;
|
|
393
|
+
const a = gt(e);
|
|
394
|
+
if (!a) {
|
|
395
|
+
Mt(e, n, r);
|
|
396
|
+
const f = i.get(e);
|
|
397
|
+
if (f)
|
|
398
398
|
return s ? {
|
|
399
399
|
transformedValue: null
|
|
400
|
-
} :
|
|
400
|
+
} : f;
|
|
401
401
|
}
|
|
402
|
-
if (!
|
|
403
|
-
const
|
|
404
|
-
transformedValue:
|
|
405
|
-
annotations: [
|
|
402
|
+
if (!Dt(e, t)) {
|
|
403
|
+
const f = we(e, t), d = f ? {
|
|
404
|
+
transformedValue: f.value,
|
|
405
|
+
annotations: [f.type]
|
|
406
406
|
} : {
|
|
407
407
|
transformedValue: e
|
|
408
408
|
};
|
|
409
|
-
return
|
|
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 w =
|
|
420
|
-
p[
|
|
421
|
-
m[
|
|
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 =
|
|
424
|
+
const y = X(m) ? {
|
|
425
425
|
transformedValue: p,
|
|
426
426
|
annotations: u ? [u.type] : void 0
|
|
427
427
|
} : {
|
|
428
428
|
transformedValue: p,
|
|
429
429
|
annotations: u ? [u.type, m] : m
|
|
430
430
|
};
|
|
431
|
-
return
|
|
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
|
|
446
|
-
const
|
|
447
|
-
|
|
445
|
+
function Nt(e, r, t, s, n) {
|
|
446
|
+
const o = {}.propertyIsEnumerable.call(s, r) ? "enumerable" : "nonenumerable";
|
|
447
|
+
o === "enumerable" && (e[r] = t), n && o === "nonenumerable" && Object.defineProperty(e, r, {
|
|
448
448
|
value: t,
|
|
449
449
|
enumerable: !1,
|
|
450
450
|
writable: !0,
|
|
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
|
-
return [...t, ...s].reduce((n,
|
|
461
|
-
if (
|
|
460
|
+
return [...t, ...s].reduce((n, o) => {
|
|
461
|
+
if (qe(r.props) && !r.props.includes(o))
|
|
462
462
|
return n;
|
|
463
|
-
const i = e[
|
|
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
|
-
class
|
|
467
|
+
class l {
|
|
468
468
|
/**
|
|
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
|
|
485
|
-
return
|
|
486
|
-
referentialEqualities:
|
|
484
|
+
const o = St(t, this.dedupe);
|
|
485
|
+
return o && (n.meta = h(g({}, n.meta), {
|
|
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 c {
|
|
|
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
|
}
|
|
@@ -512,156 +512,156 @@ class c {
|
|
|
512
512
|
this.allowedErrorProps.push(...r);
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
const
|
|
515
|
+
l.defaultInstance = new l();
|
|
516
|
+
l.serialize = l.defaultInstance.serialize.bind(l.defaultInstance);
|
|
517
|
+
l.deserialize = l.defaultInstance.deserialize.bind(l.defaultInstance);
|
|
518
|
+
l.stringify = l.defaultInstance.stringify.bind(l.defaultInstance);
|
|
519
|
+
l.parse = l.defaultInstance.parse.bind(l.defaultInstance);
|
|
520
|
+
l.registerClass = l.defaultInstance.registerClass.bind(l.defaultInstance);
|
|
521
|
+
l.registerSymbol = l.defaultInstance.registerSymbol.bind(l.defaultInstance);
|
|
522
|
+
l.registerCustom = l.defaultInstance.registerCustom.bind(l.defaultInstance);
|
|
523
|
+
l.allowErrorProps = l.defaultInstance.allowErrorProps.bind(l.defaultInstance);
|
|
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 ie(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, ie(s)];
|
|
593
|
-
case "DimensionalLevelAttribute":
|
|
594
592
|
return [t, ae(s)];
|
|
593
|
+
case "DimensionalLevelAttribute":
|
|
594
|
+
return [t, ue(s)];
|
|
595
595
|
case "DimensionalBaseMeasure":
|
|
596
|
-
return [t,
|
|
596
|
+
return [t, ce(s)];
|
|
597
597
|
case "DimensionalCalculatedMeasure":
|
|
598
|
-
return [t,
|
|
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
|
|
626
|
+
return ce(e);
|
|
627
627
|
case "DimensionalCalculatedMeasure":
|
|
628
|
-
return
|
|
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,
|
|
@@ -672,7 +672,7 @@ const O = (e) => e === void 0 ? Tr.None : e, At = (e) => new ve(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,
|
|
@@ -681,7 +681,7 @@ const O = (e) => e === void 0 ? Tr.None : e, At = (e) => new ve(e.metadataItem,
|
|
|
681
681
|
e.composeCode
|
|
682
682
|
);
|
|
683
683
|
case "MeasureRankingFilter":
|
|
684
|
-
return new
|
|
684
|
+
return new Or(
|
|
685
685
|
H(e.measure),
|
|
686
686
|
e.operator,
|
|
687
687
|
e.count,
|
|
@@ -689,7 +689,7 @@ const O = (e) => e === void 0 ? Tr.None : e, At = (e) => new ve(e.metadataItem,
|
|
|
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 O = (e) => e === void 0 ? Tr.None : e, At = (e) => new ve(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 O = (e) => e === void 0 ? Tr.None : e, At = (e) => new ve(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 O = (e) => e === void 0 ? Tr.None : e, At = (e) => new ve(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 O = (e) => e === void 0 ? Tr.None : e, At = (e) => new ve(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,
|
|
@@ -737,195 +737,199 @@ const O = (e) => e === void 0 ? Tr.None : e, At = (e) => new ve(e.metadataItem,
|
|
|
737
737
|
return e;
|
|
738
738
|
}
|
|
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
|
|
901
|
-
function
|
|
900
|
+
const Ps = l, F = "DM.";
|
|
901
|
+
function E(e) {
|
|
902
902
|
return typeof e == "object" && e !== null && "function" in e && "args" in e;
|
|
903
903
|
}
|
|
904
|
-
function
|
|
905
|
-
return e.every(
|
|
904
|
+
function je(e) {
|
|
905
|
+
return e.every(E);
|
|
906
906
|
}
|
|
907
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 !K(e) && !
|
|
915
|
-
}
|
|
916
|
-
function
|
|
917
|
-
return e
|
|
918
|
-
}
|
|
919
|
-
function
|
|
920
|
-
const r =
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
913
|
+
function fe(e) {
|
|
914
|
+
return !K(e) && !U(e);
|
|
915
|
+
}
|
|
916
|
+
function It(e) {
|
|
917
|
+
return typeof e == "object" && e !== null && "column" in e && typeof e.column == "string" && !("function" in e && "args" in e);
|
|
918
|
+
}
|
|
919
|
+
function zt(e) {
|
|
920
|
+
const r = e;
|
|
921
|
+
return typeof e != "object" || e === null || r === null || !("column" in r) ? !1 : E(r.column);
|
|
922
|
+
}
|
|
923
|
+
function Bt(e) {
|
|
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
|
+
for (const o of e) {
|
|
926
|
+
t.set(o.name, o);
|
|
927
|
+
const i = [...o.columns].sort((u, c) => c.name.length - u.name.length);
|
|
928
|
+
n.set(o.name, i);
|
|
929
|
+
const a = /* @__PURE__ */ new Map();
|
|
930
|
+
for (const u of o.columns)
|
|
931
|
+
a.set(u.name, u);
|
|
932
|
+
s.set(o.name, a);
|
|
929
933
|
}
|
|
930
934
|
return {
|
|
931
935
|
sortedTables: r,
|
|
@@ -934,15 +938,15 @@ function Nt(e) {
|
|
|
934
938
|
columnMap: s
|
|
935
939
|
};
|
|
936
940
|
}
|
|
937
|
-
function
|
|
938
|
-
if (!e.startsWith(
|
|
941
|
+
function Je(e, r) {
|
|
942
|
+
if (!e.startsWith(F))
|
|
939
943
|
throw new Error(
|
|
940
|
-
`Invalid dimensional element name format: "${e}". Expected format: "${
|
|
944
|
+
`Invalid dimensional element name format: "${e}". Expected format: "${F}TableName.ColumnName[.Level]"`
|
|
941
945
|
);
|
|
942
|
-
const t = e.slice(
|
|
946
|
+
const t = e.slice(F.length);
|
|
943
947
|
if (!t)
|
|
944
948
|
throw new Error(
|
|
945
|
-
`Invalid dimensional element name format: "${e}". Expected format: "${
|
|
949
|
+
`Invalid dimensional element name format: "${e}". Expected format: "${F}TableName.ColumnName[.Level]"`
|
|
946
950
|
);
|
|
947
951
|
let s, n;
|
|
948
952
|
for (const m of r.sortedTables)
|
|
@@ -950,7 +954,7 @@ function Le(e, r) {
|
|
|
950
954
|
const y = t.slice(m.name.length + 1);
|
|
951
955
|
if (!y)
|
|
952
956
|
throw new Error(
|
|
953
|
-
`Invalid dimensional element name format: "${e}". Expected format: "${
|
|
957
|
+
`Invalid dimensional element name format: "${e}". Expected format: "${F}TableName.ColumnName[.Level]"`
|
|
954
958
|
);
|
|
955
959
|
s = m, n = y;
|
|
956
960
|
break;
|
|
@@ -959,17 +963,17 @@ function Le(e, r) {
|
|
|
959
963
|
const m = t.indexOf(".");
|
|
960
964
|
if (m === -1)
|
|
961
965
|
throw new Error(
|
|
962
|
-
`Invalid dimensional element name format: "${e}". Expected format: "${
|
|
966
|
+
`Invalid dimensional element name format: "${e}". Expected format: "${F}TableName.ColumnName[.Level]"`
|
|
963
967
|
);
|
|
964
968
|
const y = t.slice(0, m);
|
|
965
969
|
throw new Error(`Table "${y}" not found in the data model`);
|
|
966
970
|
}
|
|
967
|
-
const
|
|
968
|
-
if (!
|
|
971
|
+
const o = r.tableColumnMap.get(s.name);
|
|
972
|
+
if (!o)
|
|
969
973
|
throw new Error(`Table "${s.name}" found but has no columns`);
|
|
970
|
-
let i,
|
|
971
|
-
const u =
|
|
972
|
-
for (const m of
|
|
974
|
+
let i, a;
|
|
975
|
+
const u = W.all;
|
|
976
|
+
for (const m of o) {
|
|
973
977
|
if (n === m.name)
|
|
974
978
|
return { table: s, column: m };
|
|
975
979
|
if (!n.startsWith(m.name + "."))
|
|
@@ -977,71 +981,71 @@ function Le(e, r) {
|
|
|
977
981
|
const y = n.slice(m.name.length + 1);
|
|
978
982
|
if (!y)
|
|
979
983
|
continue;
|
|
980
|
-
const
|
|
981
|
-
if (
|
|
982
|
-
if (
|
|
984
|
+
const x = u.includes(y), f = oe(m.dataType);
|
|
985
|
+
if (x) {
|
|
986
|
+
if (f)
|
|
983
987
|
return { table: s, column: m, level: y };
|
|
984
|
-
i || (i = m,
|
|
988
|
+
i || (i = m, a = y);
|
|
985
989
|
continue;
|
|
986
990
|
}
|
|
987
|
-
|
|
991
|
+
f && !i && (i = m, a = y);
|
|
988
992
|
}
|
|
989
|
-
if (i &&
|
|
990
|
-
throw u.includes(
|
|
991
|
-
`Invalid date level "${
|
|
993
|
+
if (i && a)
|
|
994
|
+
throw u.includes(a) ? new Error(
|
|
995
|
+
`Invalid date level "${a}" in dimensional element "${e}". Column "${s.name}.${i.name}" is not a datetime column`
|
|
992
996
|
) : new Error(
|
|
993
|
-
`Invalid date level "${
|
|
997
|
+
`Invalid date level "${a}" in dimensional element "${e}". Valid levels are: ${u.join(
|
|
994
998
|
", "
|
|
995
999
|
)}`
|
|
996
1000
|
);
|
|
997
|
-
const
|
|
1001
|
+
const c = n.indexOf("."), p = c === -1 ? n : n.slice(0, c);
|
|
998
1002
|
throw new Error(`Column "${p}" not found in table "${s.name}"`);
|
|
999
1003
|
}
|
|
1000
|
-
function
|
|
1001
|
-
const { table: t, column: s, level: n } =
|
|
1004
|
+
function Pt(e, r) {
|
|
1005
|
+
const { table: t, column: s, level: n } = Je(e, r);
|
|
1002
1006
|
if (n) {
|
|
1003
|
-
if (!
|
|
1007
|
+
if (!oe(s.dataType))
|
|
1004
1008
|
throw new Error(
|
|
1005
1009
|
`Invalid date level "${n}" in dimensional element "${e}". Column "${t.name}.${s.name}" is not a datetime column`
|
|
1006
1010
|
);
|
|
1007
|
-
const
|
|
1008
|
-
if (!
|
|
1011
|
+
const o = W.all;
|
|
1012
|
+
if (!o.includes(n))
|
|
1009
1013
|
throw new Error(
|
|
1010
|
-
`Invalid date level "${n}" in dimensional element "${e}". Valid levels are: ${
|
|
1014
|
+
`Invalid date level "${n}" in dimensional element "${e}". Valid levels are: ${o.join(
|
|
1011
1015
|
", "
|
|
1012
1016
|
)}`
|
|
1013
1017
|
);
|
|
1014
|
-
const i =
|
|
1018
|
+
const i = W.dateOnly;
|
|
1015
1019
|
if (s.dataType === "date" && !i.includes(n))
|
|
1016
1020
|
throw new Error(
|
|
1017
1021
|
`Invalid level "${n}" in dimensional element "${e}". Column "${t.name}.${s.name}" is only a date column, not a datetime column`
|
|
1018
1022
|
);
|
|
1019
|
-
const
|
|
1020
|
-
if (s.dataType === "time" && !
|
|
1023
|
+
const a = W.timeOnly;
|
|
1024
|
+
if (s.dataType === "time" && !a.includes(n))
|
|
1021
1025
|
throw new Error(
|
|
1022
1026
|
`Invalid level "${n}" in dimensional element "${e}". Column "${t.name}.${s.name}" is only a time column, not a date column`
|
|
1023
1027
|
);
|
|
1024
1028
|
}
|
|
1025
1029
|
return { column: s, level: n };
|
|
1026
1030
|
}
|
|
1027
|
-
function
|
|
1028
|
-
return e.type ===
|
|
1031
|
+
function Ke(e) {
|
|
1032
|
+
return e.type === I.TextAttribute;
|
|
1029
1033
|
}
|
|
1030
|
-
function
|
|
1031
|
-
return e.type ===
|
|
1034
|
+
function Ge(e) {
|
|
1035
|
+
return e.type === I.NumericAttribute;
|
|
1032
1036
|
}
|
|
1033
|
-
function
|
|
1034
|
-
return e.type ===
|
|
1037
|
+
function kt(e) {
|
|
1038
|
+
return e.type === I.DateLevel;
|
|
1035
1039
|
}
|
|
1036
|
-
function
|
|
1037
|
-
return
|
|
1040
|
+
function Lt(e) {
|
|
1041
|
+
return Ke(e) || Ge(e);
|
|
1038
1042
|
}
|
|
1039
|
-
function
|
|
1040
|
-
return e.type ===
|
|
1043
|
+
function G(e) {
|
|
1044
|
+
return e.type === I.TextAttribute ? "text" : e.type === I.NumericAttribute ? "numeric" : e.type === I.DateLevel ? "date/datetime" : "unknown";
|
|
1041
1045
|
}
|
|
1042
|
-
function
|
|
1043
|
-
const { column: s, level: n } =
|
|
1044
|
-
return
|
|
1046
|
+
function Q(e, r, t) {
|
|
1047
|
+
const { column: s, level: n } = Pt(e, t);
|
|
1048
|
+
return Vr({
|
|
1045
1049
|
expression: s.expression,
|
|
1046
1050
|
dataType: s.dataType,
|
|
1047
1051
|
granularity: n,
|
|
@@ -1050,17 +1054,17 @@ function ce(e, r, t) {
|
|
|
1050
1054
|
dataSource: r
|
|
1051
1055
|
});
|
|
1052
1056
|
}
|
|
1053
|
-
function
|
|
1054
|
-
const { column: s, level: n } =
|
|
1057
|
+
function Vt(e, r, t) {
|
|
1058
|
+
const { column: s, level: n } = Je(e, t);
|
|
1055
1059
|
if (n)
|
|
1056
1060
|
throw new Error(
|
|
1057
|
-
`Invalid DateDimension name format: "${e}". Expected format: "${
|
|
1061
|
+
`Invalid DateDimension name format: "${e}". Expected format: "${F}TableName.ColumnName"`
|
|
1058
1062
|
);
|
|
1059
|
-
if (!
|
|
1063
|
+
if (!oe(s.dataType))
|
|
1060
1064
|
throw new Error(
|
|
1061
1065
|
`Invalid DateDimension name "${e}". Column "${s.name}" is not a datetime column (got ${s.dataType}).`
|
|
1062
1066
|
);
|
|
1063
|
-
return
|
|
1067
|
+
return tt({
|
|
1064
1068
|
name: s.name,
|
|
1065
1069
|
expression: s.expression,
|
|
1066
1070
|
dataSource: r
|
|
@@ -1070,11 +1074,28 @@ function M(e, r) {
|
|
|
1070
1074
|
const t = e();
|
|
1071
1075
|
return t.success ? t.data : (r.push(...t.errors), null);
|
|
1072
1076
|
}
|
|
1073
|
-
const
|
|
1077
|
+
const _t = (e, r, t) => {
|
|
1078
|
+
if (!r)
|
|
1079
|
+
return { attribute: e };
|
|
1080
|
+
const s = typeof r == "object" ? r.direction : r;
|
|
1081
|
+
return $e(s) ? { attribute: e.sort(Ae(s)) } : {
|
|
1082
|
+
attribute: e,
|
|
1083
|
+
error: h(g({}, t), {
|
|
1084
|
+
message: `Invalid sort type. Expected "sortAsc", "sortDesc", or "sortNone". Got: "${s}".`
|
|
1085
|
+
})
|
|
1086
|
+
};
|
|
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
|
+
message: 'Invalid dimension item. Expected a string (composeCode) or object with "column" and optional "sortType".'
|
|
1093
|
+
})
|
|
1094
|
+
}, jt = (e) => {
|
|
1074
1095
|
const { data: r } = e, { dataSource: t, schemaIndex: s } = e.context;
|
|
1075
1096
|
if (!r)
|
|
1076
1097
|
return { success: !0, data: [] };
|
|
1077
|
-
if (!
|
|
1098
|
+
if (!Array.isArray(r))
|
|
1078
1099
|
return {
|
|
1079
1100
|
success: !1,
|
|
1080
1101
|
errors: [
|
|
@@ -1082,70 +1103,124 @@ const It = (e) => {
|
|
|
1082
1103
|
category: "dimensions",
|
|
1083
1104
|
index: -1,
|
|
1084
1105
|
input: r,
|
|
1085
|
-
message: "Invalid dimensions JSON. Expected an array
|
|
1106
|
+
message: "Invalid dimensions JSON. Expected an array."
|
|
1086
1107
|
}
|
|
1087
1108
|
]
|
|
1088
1109
|
};
|
|
1089
|
-
const n = [],
|
|
1090
|
-
return r.forEach((i,
|
|
1110
|
+
const n = [], o = [];
|
|
1111
|
+
return r.forEach((i, a) => {
|
|
1091
1112
|
const u = {
|
|
1092
1113
|
category: "dimensions",
|
|
1093
|
-
index:
|
|
1114
|
+
index: a,
|
|
1094
1115
|
input: i
|
|
1095
1116
|
};
|
|
1096
1117
|
try {
|
|
1097
|
-
const
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1118
|
+
const c = Wt(i, t, s, u);
|
|
1119
|
+
if (c.error) {
|
|
1120
|
+
o.push(c.error);
|
|
1121
|
+
return;
|
|
1122
|
+
}
|
|
1123
|
+
c.attribute && n.push(c.attribute);
|
|
1124
|
+
} catch (c) {
|
|
1125
|
+
const p = c instanceof Error ? c.message : "Unknown error";
|
|
1126
|
+
o.push(h(g({}, u), { message: p }));
|
|
1102
1127
|
}
|
|
1103
|
-
}),
|
|
1128
|
+
}), o.length > 0 ? { success: !1, errors: o } : { success: !0, data: n };
|
|
1104
1129
|
};
|
|
1105
|
-
function
|
|
1130
|
+
function de(e, r) {
|
|
1106
1131
|
const t = Reflect.get(e, r);
|
|
1107
1132
|
if (typeof t != "function")
|
|
1108
1133
|
throw new Error(`Function "${r}" not found or is not a function`);
|
|
1109
1134
|
return t;
|
|
1110
1135
|
}
|
|
1111
|
-
function
|
|
1112
|
-
const t = e.replace("measureFactory.", ""), n =
|
|
1113
|
-
if (!
|
|
1136
|
+
function Jt(e, r) {
|
|
1137
|
+
const t = e.replace("measureFactory.", ""), n = de(_r, t)(...r);
|
|
1138
|
+
if (!fe(n))
|
|
1114
1139
|
throw new Error(`Function "${e}" did not return a valid Measure`);
|
|
1115
1140
|
return n;
|
|
1116
1141
|
}
|
|
1117
|
-
function
|
|
1118
|
-
const t = e.replace("filterFactory.logic.", ""), n =
|
|
1119
|
-
if (!
|
|
1142
|
+
function Kt(e, r) {
|
|
1143
|
+
const t = e.replace("filterFactory.logic.", ""), n = de(Ur, t)(...r);
|
|
1144
|
+
if (!U(n))
|
|
1120
1145
|
throw new Error(`Function "${e}" did not return a valid FilterRelations`);
|
|
1121
1146
|
return n;
|
|
1122
1147
|
}
|
|
1123
|
-
function
|
|
1148
|
+
function Gt(e, r) {
|
|
1124
1149
|
if (e.startsWith("filterFactory.logic."))
|
|
1125
|
-
return
|
|
1126
|
-
const t = e.replace("filterFactory.", ""), n =
|
|
1127
|
-
if (!K(n) && !
|
|
1150
|
+
return Kt(e, r);
|
|
1151
|
+
const t = e.replace("filterFactory.", ""), n = de(Wr, t)(...r);
|
|
1152
|
+
if (!K(n) && !U(n))
|
|
1128
1153
|
throw new Error(`Function "${e}" did not return a valid Filter or FilterRelations`);
|
|
1129
1154
|
return n;
|
|
1130
1155
|
}
|
|
1131
|
-
function
|
|
1156
|
+
function Qt(e, r) {
|
|
1132
1157
|
const s = e.split(".")[0];
|
|
1133
1158
|
if (s === "measureFactory")
|
|
1134
|
-
return
|
|
1159
|
+
return Jt(e, r);
|
|
1135
1160
|
if (s === "filterFactory")
|
|
1136
|
-
return
|
|
1161
|
+
return Gt(e, r);
|
|
1137
1162
|
throw new Error(
|
|
1138
1163
|
`Unsupported factory: "${s}". Supported factories: measureFactory, filterFactory`
|
|
1139
1164
|
);
|
|
1140
1165
|
}
|
|
1141
|
-
const
|
|
1142
|
-
|
|
1166
|
+
const Yt = /\[(\w[\w.-]*)\]/g, Qe = /* @__PURE__ */ new Set([
|
|
1167
|
+
// Universal – Aggregative (per Sisense doc: (A) only; Statistical CONTRIBUTION, PERCENTILE, etc. are non-aggregative)
|
|
1168
|
+
"AVG",
|
|
1169
|
+
"COUNT",
|
|
1170
|
+
"DUPCOUNT",
|
|
1171
|
+
"LARGEST",
|
|
1172
|
+
"MAX",
|
|
1173
|
+
"MEDIAN",
|
|
1174
|
+
"MIN",
|
|
1175
|
+
"MODE",
|
|
1176
|
+
"SUM",
|
|
1177
|
+
// Universal – Time-to-date (WTD/MTD/QTD/YTD)
|
|
1178
|
+
"WTDAVG",
|
|
1179
|
+
"WTDSUM",
|
|
1180
|
+
"MTDAVG",
|
|
1181
|
+
"MTDSUM",
|
|
1182
|
+
"QTDAVG",
|
|
1183
|
+
"QTDSUM",
|
|
1184
|
+
"YTDAVG",
|
|
1185
|
+
"YTDSUM",
|
|
1186
|
+
// RAVG, RSUM are non-aggregative per Sisense doc (Other Functions, not (A))
|
|
1187
|
+
// Elasticube – Aggregative
|
|
1188
|
+
"CORREL",
|
|
1189
|
+
"COVARP",
|
|
1190
|
+
"COVAR",
|
|
1191
|
+
"SKEWP",
|
|
1192
|
+
"SKEW",
|
|
1193
|
+
"SLOPE"
|
|
1194
|
+
]), Ht = new RegExp(
|
|
1195
|
+
`\\b(${Array.from(Qe).join("|")})\\s*\\(`,
|
|
1196
|
+
"i"
|
|
1197
|
+
);
|
|
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
|
+
}
|
|
1201
|
+
function Xt(e) {
|
|
1202
|
+
const r = /\b(\w+)\s*\(/g, t = /* @__PURE__ */ new Set();
|
|
1203
|
+
let s;
|
|
1204
|
+
for (; (s = r.exec(e)) !== null; ) {
|
|
1205
|
+
const n = s[1];
|
|
1206
|
+
Qe.has(n.toUpperCase()) || t.add(n);
|
|
1207
|
+
}
|
|
1208
|
+
return Array.from(t);
|
|
1209
|
+
}
|
|
1210
|
+
function vt(e) {
|
|
1211
|
+
return e.length === 1 ? `[${e[0]}]` : e.map((r) => `[${r}]`).join(", ");
|
|
1212
|
+
}
|
|
1213
|
+
function es(e) {
|
|
1214
|
+
return e.length === 0 ? "" : e.length === 1 ? `${e[0]} is not an aggregative function. ` : `${e.join(", ")} are not aggregative functions. `;
|
|
1215
|
+
}
|
|
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 = {}) {
|
|
1143
1218
|
const {
|
|
1144
1219
|
warnUnusedContext: s = !0,
|
|
1145
1220
|
errorOnUnusedContext: n = !0,
|
|
1146
|
-
allowEmptyFormula:
|
|
1221
|
+
allowEmptyFormula: o = !1,
|
|
1147
1222
|
errorPrefix: i = "customFormula validation"
|
|
1148
|
-
} = t,
|
|
1223
|
+
} = t, a = {
|
|
1149
1224
|
isValid: !0,
|
|
1150
1225
|
errors: [],
|
|
1151
1226
|
warnings: [],
|
|
@@ -1153,70 +1228,78 @@ function Lt(e, r, t = {}) {
|
|
|
1153
1228
|
unusedContextKeys: []
|
|
1154
1229
|
};
|
|
1155
1230
|
if (!e || e.trim().length === 0)
|
|
1156
|
-
return
|
|
1157
|
-
const u = /\b\w+\s*\[/gi,
|
|
1158
|
-
if (
|
|
1159
|
-
const f =
|
|
1160
|
-
|
|
1231
|
+
return o || (a.errors.push(`${i}args[1]: Formula cannot be empty`), a.isValid = !1), a;
|
|
1232
|
+
const u = /\b\w+\s*\[/gi, c = e.match(u);
|
|
1233
|
+
if (c) {
|
|
1234
|
+
const f = c[0].replace(/\s*\[.*$/, "");
|
|
1235
|
+
a.errors.push(
|
|
1161
1236
|
`${i}args[1]: Invalid syntax: '${f}' - operator cannot be used before bracket reference without parentheses`
|
|
1162
|
-
),
|
|
1163
|
-
}
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
if (o.references.length > 0 && (/\b\w+\s*\(/gi.test(e) || o.references.every((A) => {
|
|
1173
|
-
if (!(A in r))
|
|
1174
|
-
return !1;
|
|
1175
|
-
const D = r[A];
|
|
1176
|
-
return x(D) ? !1 : typeof D == "string" && D.startsWith(h) ? !0 : D && typeof D == "object" && "kind" in D ? D.kind !== "measure" : !1;
|
|
1177
|
-
}) && (o.errors.push(
|
|
1178
|
-
`${i}args[1]: Formulas with bracket references must contain aggregate function calls`
|
|
1179
|
-
), o.isValid = !1)), o.references.length === 0)
|
|
1180
|
-
return o.warnings.push(
|
|
1237
|
+
), a.isValid = !1;
|
|
1238
|
+
}
|
|
1239
|
+
a.references = [
|
|
1240
|
+
...new Set(
|
|
1241
|
+
[...e.matchAll(new RegExp(Yt.source, "g"))].map((f) => f[1])
|
|
1242
|
+
)
|
|
1243
|
+
];
|
|
1244
|
+
const p = Object.keys(r);
|
|
1245
|
+
if (a.references.length === 0)
|
|
1246
|
+
return a.warnings.push(
|
|
1181
1247
|
`${i}args[1]: No bracket references found in formula - ensure this is intentional`
|
|
1182
|
-
),
|
|
1183
|
-
if (
|
|
1184
|
-
return
|
|
1248
|
+
), a;
|
|
1249
|
+
if (p.length === 0)
|
|
1250
|
+
return a.errors.push(
|
|
1185
1251
|
`${i}args[2]: Context cannot be empty - custom formulas require context definitions`
|
|
1186
|
-
),
|
|
1187
|
-
const
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
if (
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
)
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1252
|
+
), a.isValid = !1, a;
|
|
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}`
|
|
1265
|
+
);
|
|
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
|
|
1278
|
+
)} point to raw attributes and must be wrapped in an aggregative function (e.g. SUM, AVG)`
|
|
1279
|
+
), a.isValid = !1);
|
|
1280
|
+
}
|
|
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($);
|
|
1203
1286
|
}
|
|
1204
1287
|
}
|
|
1205
|
-
return
|
|
1288
|
+
return a;
|
|
1206
1289
|
}
|
|
1207
|
-
function
|
|
1208
|
-
const s =
|
|
1290
|
+
function ts(e, r, t = {}) {
|
|
1291
|
+
const s = rs(e, r, t);
|
|
1209
1292
|
if (!s.isValid)
|
|
1210
1293
|
throw new Error(s.errors.join("; "));
|
|
1211
1294
|
s.warnings.length > 0 && console.warn("Formula validation warnings:", s.warnings.join("; "));
|
|
1212
1295
|
}
|
|
1213
|
-
function
|
|
1296
|
+
function ss(e, r) {
|
|
1214
1297
|
if (e.length < 3 || e.length > 5)
|
|
1215
1298
|
throw new Error(
|
|
1216
1299
|
`${r.pathPrefix}Expected 3, 4, or 5 arguments for customFormula (title, formula, context, format?, description?)`
|
|
1217
1300
|
);
|
|
1218
1301
|
const t = e[1], s = e[2];
|
|
1219
|
-
|
|
1302
|
+
ts(t, s, {
|
|
1220
1303
|
errorPrefix: `${r.pathPrefix}`,
|
|
1221
1304
|
errorOnUnusedContext: !0,
|
|
1222
1305
|
// Strict validation: all context keys must be used
|
|
@@ -1224,111 +1307,111 @@ function Wt(e, r) {
|
|
|
1224
1307
|
// Custom formulas must have content
|
|
1225
1308
|
});
|
|
1226
1309
|
const n = {};
|
|
1227
|
-
for (const [
|
|
1228
|
-
const
|
|
1229
|
-
if (
|
|
1230
|
-
n[`${
|
|
1310
|
+
for (const [o, i] of Object.entries(s)) {
|
|
1311
|
+
const a = `args[2].${o}`;
|
|
1312
|
+
if (E(i))
|
|
1313
|
+
n[`${o}`] = C({
|
|
1231
1314
|
data: i,
|
|
1232
1315
|
context: {
|
|
1233
1316
|
dataSource: r.dataSource,
|
|
1234
1317
|
schemaIndex: r.schemaIndex,
|
|
1235
|
-
pathPrefix:
|
|
1318
|
+
pathPrefix: a
|
|
1236
1319
|
}
|
|
1237
1320
|
});
|
|
1238
|
-
else if (typeof i == "string" && i.startsWith(
|
|
1321
|
+
else if (typeof i == "string" && i.startsWith(F))
|
|
1239
1322
|
try {
|
|
1240
|
-
n[`${
|
|
1323
|
+
n[`${o}`] = Q(
|
|
1241
1324
|
i,
|
|
1242
1325
|
r.dataSource,
|
|
1243
1326
|
r.schemaIndex
|
|
1244
1327
|
);
|
|
1245
1328
|
} catch (u) {
|
|
1246
|
-
const
|
|
1247
|
-
throw new Error(`${
|
|
1329
|
+
const c = u instanceof Error ? u.message : "Unknown error";
|
|
1330
|
+
throw new Error(`${a}: ${c}`);
|
|
1248
1331
|
}
|
|
1249
1332
|
else if (i && typeof i == "object" && "kind" in i)
|
|
1250
|
-
n[`${
|
|
1333
|
+
n[`${o}`] = i;
|
|
1251
1334
|
else
|
|
1252
1335
|
throw new Error(
|
|
1253
|
-
`${
|
|
1336
|
+
`${a}: Invalid context value for key '${o}'. Expected a function call or attribute reference (${F}...), but got: ${typeof i}`
|
|
1254
1337
|
);
|
|
1255
1338
|
}
|
|
1256
1339
|
e[2] = n;
|
|
1257
1340
|
}
|
|
1258
|
-
function
|
|
1341
|
+
function me(e, r) {
|
|
1259
1342
|
const t = e[0];
|
|
1260
1343
|
if (!t || typeof t != "object" || !("type" in t))
|
|
1261
1344
|
throw new Error(`${r.pathPrefix}args[0]: Expected attribute as first argument`);
|
|
1262
1345
|
return t;
|
|
1263
1346
|
}
|
|
1264
|
-
function
|
|
1265
|
-
const t =
|
|
1266
|
-
if (!
|
|
1347
|
+
function Ce(e, r) {
|
|
1348
|
+
const t = me(e, r);
|
|
1349
|
+
if (!Lt(t))
|
|
1267
1350
|
throw new Error(
|
|
1268
|
-
`${r.pathPrefix}args[0]: Attribute must be string or numeric type, got ${
|
|
1351
|
+
`${r.pathPrefix}args[0]: Attribute must be string or numeric type, got ${G(
|
|
1269
1352
|
t
|
|
1270
1353
|
)} attribute`
|
|
1271
1354
|
);
|
|
1272
1355
|
}
|
|
1273
|
-
function
|
|
1274
|
-
const t =
|
|
1275
|
-
if (!
|
|
1356
|
+
function T(e, r) {
|
|
1357
|
+
const t = me(e, r);
|
|
1358
|
+
if (!Ge(t))
|
|
1276
1359
|
throw new Error(
|
|
1277
|
-
`${r.pathPrefix}args[0]: Attribute must be numeric type, got ${
|
|
1360
|
+
`${r.pathPrefix}args[0]: Attribute must be numeric type, got ${G(
|
|
1278
1361
|
t
|
|
1279
1362
|
)} attribute`
|
|
1280
1363
|
);
|
|
1281
1364
|
}
|
|
1282
|
-
function
|
|
1283
|
-
const t =
|
|
1284
|
-
if (!
|
|
1365
|
+
function N(e, r) {
|
|
1366
|
+
const t = me(e, r);
|
|
1367
|
+
if (!Ke(t))
|
|
1285
1368
|
throw new Error(
|
|
1286
|
-
`${r.pathPrefix}args[0]: Attribute must be string type, got ${
|
|
1369
|
+
`${r.pathPrefix}args[0]: Attribute must be string type, got ${G(
|
|
1287
1370
|
t
|
|
1288
1371
|
)} attribute`
|
|
1289
1372
|
);
|
|
1290
1373
|
}
|
|
1291
|
-
function
|
|
1374
|
+
function ns(e, r) {
|
|
1292
1375
|
const t = e[0];
|
|
1293
1376
|
if (!t || typeof t != "object" || !("attribute" in t))
|
|
1294
1377
|
throw new Error(`${r.pathPrefix}args[0]: Expected filter as first argument`);
|
|
1295
1378
|
return t;
|
|
1296
1379
|
}
|
|
1297
|
-
function
|
|
1298
|
-
const t =
|
|
1299
|
-
if (!
|
|
1380
|
+
function is(e, r) {
|
|
1381
|
+
const t = ns(e, r);
|
|
1382
|
+
if (!ne(t))
|
|
1300
1383
|
throw new Error(
|
|
1301
1384
|
`${r.pathPrefix}args[0]: exclude filter only accepts members filter, got ${t.__serializable || "unknown"} filter`
|
|
1302
1385
|
);
|
|
1303
1386
|
}
|
|
1304
|
-
const
|
|
1305
|
-
"measureFactory.customFormula":
|
|
1387
|
+
const os = {
|
|
1388
|
+
"measureFactory.customFormula": ss,
|
|
1306
1389
|
// String | Number filters
|
|
1307
|
-
"filterFactory.equals":
|
|
1308
|
-
"filterFactory.doesntEqual":
|
|
1390
|
+
"filterFactory.equals": Ce,
|
|
1391
|
+
"filterFactory.doesntEqual": Ce,
|
|
1309
1392
|
// Numeric filters
|
|
1310
|
-
"filterFactory.greaterThan":
|
|
1311
|
-
"filterFactory.greaterThanOrEqual":
|
|
1312
|
-
"filterFactory.lessThan":
|
|
1313
|
-
"filterFactory.lessThanOrEqual":
|
|
1314
|
-
"filterFactory.between":
|
|
1315
|
-
"filterFactory.betweenNotEqual":
|
|
1316
|
-
"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,
|
|
1317
1400
|
// String filters
|
|
1318
|
-
"filterFactory.contains":
|
|
1319
|
-
"filterFactory.doesntContain":
|
|
1320
|
-
"filterFactory.startsWith":
|
|
1321
|
-
"filterFactory.doesntStartWith":
|
|
1322
|
-
"filterFactory.endsWith":
|
|
1323
|
-
"filterFactory.doesntEndWith":
|
|
1324
|
-
"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,
|
|
1325
1408
|
// Exclude filter
|
|
1326
|
-
"filterFactory.exclude":
|
|
1409
|
+
"filterFactory.exclude": is
|
|
1327
1410
|
};
|
|
1328
|
-
function
|
|
1329
|
-
return
|
|
1411
|
+
function as(e) {
|
|
1412
|
+
return os[`${e}`];
|
|
1330
1413
|
}
|
|
1331
|
-
const
|
|
1414
|
+
const us = {
|
|
1332
1415
|
// ==================== MEASURE FACTORY FUNCTIONS ====================
|
|
1333
1416
|
// Basic aggregations
|
|
1334
1417
|
"measureFactory.sum": [
|
|
@@ -1855,18 +1938,18 @@ const Qt = {
|
|
|
1855
1938
|
{ type: "FilterRelationsNode", required: !0 }
|
|
1856
1939
|
]
|
|
1857
1940
|
};
|
|
1858
|
-
function
|
|
1859
|
-
return
|
|
1941
|
+
function pe(e) {
|
|
1942
|
+
return us[`${e}`];
|
|
1860
1943
|
}
|
|
1861
|
-
function
|
|
1862
|
-
const r =
|
|
1944
|
+
function cs(e) {
|
|
1945
|
+
const r = pe(e);
|
|
1863
1946
|
return r ? r.filter((t) => t.required).length : 0;
|
|
1864
1947
|
}
|
|
1865
|
-
function
|
|
1866
|
-
const r =
|
|
1948
|
+
function ls(e) {
|
|
1949
|
+
const r = pe(e);
|
|
1867
1950
|
return r ? r.length : 0;
|
|
1868
1951
|
}
|
|
1869
|
-
function
|
|
1952
|
+
function fs(e) {
|
|
1870
1953
|
if (typeof e != "string" || !/^\d{4}-\d{2}-\d{2}/.test(e))
|
|
1871
1954
|
return !1;
|
|
1872
1955
|
const t = Date.parse(e);
|
|
@@ -1876,313 +1959,314 @@ function Zt(e) {
|
|
|
1876
1959
|
return !isNaN(s.getTime());
|
|
1877
1960
|
}
|
|
1878
1961
|
function Z(e, r, t, s) {
|
|
1879
|
-
if (e.startsWith(
|
|
1962
|
+
if (e.startsWith(F))
|
|
1880
1963
|
try {
|
|
1881
|
-
return
|
|
1964
|
+
return Q(e, r, t);
|
|
1882
1965
|
} catch (n) {
|
|
1883
|
-
const
|
|
1884
|
-
throw new Error(`${s}: ${
|
|
1966
|
+
const o = n instanceof Error ? n.message : "Unknown error";
|
|
1967
|
+
throw new Error(`${s}: ${o}`);
|
|
1885
1968
|
}
|
|
1886
1969
|
throw new Error(
|
|
1887
|
-
`${s}: Invalid attribute "${e}". Expected format: "${
|
|
1970
|
+
`${s}: Invalid attribute "${e}". Expected format: "${F}TableName.ColumnName[.Level]"`
|
|
1888
1971
|
);
|
|
1889
1972
|
}
|
|
1890
|
-
function
|
|
1891
|
-
if (e.startsWith(
|
|
1973
|
+
function ds(e, r, t, s) {
|
|
1974
|
+
if (e.startsWith(F))
|
|
1892
1975
|
try {
|
|
1893
|
-
return
|
|
1976
|
+
return Vt(e, r, t);
|
|
1894
1977
|
} catch (n) {
|
|
1895
|
-
const
|
|
1896
|
-
throw new Error(`${s}: ${
|
|
1978
|
+
const o = n instanceof Error ? n.message : "Unknown error";
|
|
1979
|
+
throw new Error(`${s}: ${o}`);
|
|
1897
1980
|
}
|
|
1898
1981
|
throw new Error(
|
|
1899
|
-
`${s}: Invalid date dimension string "${e}". Expected format: "${
|
|
1982
|
+
`${s}: Invalid date dimension string "${e}". Expected format: "${F}TableName.ColumnName"`
|
|
1900
1983
|
);
|
|
1901
1984
|
}
|
|
1902
|
-
function
|
|
1903
|
-
const r = e.data, { argSchema: t, dataSource: s, schemaIndex: n, pathPrefix:
|
|
1985
|
+
function ms(e) {
|
|
1986
|
+
const r = e.data, { argSchema: t, dataSource: s, schemaIndex: n, pathPrefix: o } = e.context, i = o;
|
|
1904
1987
|
if (r === void 0) {
|
|
1905
1988
|
if (t.required)
|
|
1906
1989
|
throw new Error(`${i}: Required argument is missing (expected ${t.type})`);
|
|
1907
1990
|
return;
|
|
1908
1991
|
}
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
`${i}: Expected array of strings, got ${typeof r}. Example: ["value1", "value2"]`
|
|
1926
|
-
);
|
|
1927
|
-
if (!r.every((o) => typeof o == "string"))
|
|
1928
|
-
throw new Error(
|
|
1929
|
-
`${i}: Expected array of strings, but contains non-string values`
|
|
1930
|
-
);
|
|
1931
|
-
return r;
|
|
1932
|
-
case "number[]":
|
|
1933
|
-
if (!Array.isArray(r))
|
|
1934
|
-
throw new Error(
|
|
1935
|
-
`${i}: Expected array of numbers, got ${typeof r}. Example: [10, 20]`
|
|
1936
|
-
);
|
|
1937
|
-
if (!r.every((o) => typeof o == "number"))
|
|
1938
|
-
throw new Error(
|
|
1939
|
-
`${i}: Expected array of numbers, but contains non-number values`
|
|
1940
|
-
);
|
|
1941
|
-
return r;
|
|
1942
|
-
case "Attribute":
|
|
1943
|
-
if (typeof r != "string")
|
|
1944
|
-
throw new Error(
|
|
1945
|
-
`${i}: Expected attribute string, got ${typeof r}. Example: "DM.Commerce.Revenue"`
|
|
1946
|
-
);
|
|
1947
|
-
return Z(r, s, n, i);
|
|
1948
|
-
case "Attribute[]":
|
|
1949
|
-
if (!Array.isArray(r))
|
|
1950
|
-
throw new Error(
|
|
1951
|
-
`${i}: Expected array of attributes, got ${typeof r}. Example: ["DM.Commerce.AgeRange"]`
|
|
1952
|
-
);
|
|
1953
|
-
return r.map((o, u) => {
|
|
1954
|
-
if (typeof o != "string")
|
|
1955
|
-
throw new Error(`${i}[${u}]: Expected attribute string, got ${typeof o}`);
|
|
1956
|
-
return Z(o, s, n, `${i}[${u}]`);
|
|
1957
|
-
});
|
|
1958
|
-
case "Measure":
|
|
1959
|
-
case "BaseMeasure":
|
|
1960
|
-
if (!x(r))
|
|
1961
|
-
throw new Error(
|
|
1962
|
-
`${i}: Expected measure function call, got ${typeof r}. Example: {"function": "measureFactory.sum", "args": ["DM.Commerce.Revenue"]}`
|
|
1963
|
-
);
|
|
1964
|
-
return C({
|
|
1965
|
-
data: r,
|
|
1966
|
-
context: { dataSource: s, schemaIndex: n, pathPrefix: i }
|
|
1967
|
-
});
|
|
1968
|
-
case "Measure[]":
|
|
1969
|
-
if (!Array.isArray(r))
|
|
1970
|
-
throw new Error(
|
|
1971
|
-
`${i}: Expected array of measure function calls, got ${typeof r}`
|
|
1972
|
-
);
|
|
1973
|
-
return r.map((o, u) => {
|
|
1974
|
-
if (!x(o))
|
|
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))
|
|
1975
2008
|
throw new Error(
|
|
1976
|
-
`${i}
|
|
2009
|
+
`${i}: Expected array of strings, got ${typeof r}. Example: ["value1", "value2"]`
|
|
1977
2010
|
);
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
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}]`);
|
|
1981
2041
|
});
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
throw new Error(
|
|
1986
|
-
`${i}: Expected filter function call, got ${typeof r}. Example: {"function": "filterFactory.contains", "args": ["DM.Brand.Brand", "Apple"]}`
|
|
1987
|
-
);
|
|
1988
|
-
return C({
|
|
1989
|
-
data: r,
|
|
1990
|
-
context: { dataSource: s, schemaIndex: n, pathPrefix: i }
|
|
1991
|
-
});
|
|
1992
|
-
case "Filter[]":
|
|
1993
|
-
if (!Array.isArray(r))
|
|
1994
|
-
throw new Error(
|
|
1995
|
-
`${i}: Expected array of filter function calls, got ${typeof r}`
|
|
1996
|
-
);
|
|
1997
|
-
return r.map((o, u) => {
|
|
1998
|
-
if (!x(o))
|
|
2042
|
+
case "Measure":
|
|
2043
|
+
case "BaseMeasure":
|
|
2044
|
+
if (!E(r))
|
|
1999
2045
|
throw new Error(
|
|
2000
|
-
`${i}
|
|
2046
|
+
`${i}: Expected measure function call, got ${typeof r}. Example: {"function": "measureFactory.sum", "args": ["DM.Commerce.Revenue"]}`
|
|
2001
2047
|
);
|
|
2002
2048
|
return C({
|
|
2003
|
-
data:
|
|
2004
|
-
context: { dataSource: s, schemaIndex: n, pathPrefix:
|
|
2049
|
+
data: r,
|
|
2050
|
+
context: { dataSource: s, schemaIndex: n, pathPrefix: i }
|
|
2005
2051
|
});
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2052
|
+
case "Measure[]":
|
|
2053
|
+
if (!Array.isArray(r))
|
|
2054
|
+
throw new Error(
|
|
2055
|
+
`${i}: Expected array of measure function calls, got ${typeof r}`
|
|
2056
|
+
);
|
|
2057
|
+
return r.map((a, u) => {
|
|
2058
|
+
if (!E(a))
|
|
2011
2059
|
throw new Error(
|
|
2012
|
-
`${i}[${u}]: Expected
|
|
2060
|
+
`${i}[${u}]: Expected measure function call, got ${typeof a}`
|
|
2013
2061
|
);
|
|
2014
2062
|
return C({
|
|
2015
|
-
data:
|
|
2063
|
+
data: a,
|
|
2016
2064
|
context: { dataSource: s, schemaIndex: n, pathPrefix: `${i}[${u}]` }
|
|
2017
2065
|
});
|
|
2018
2066
|
});
|
|
2019
|
-
|
|
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
|
+
);
|
|
2020
2072
|
return C({
|
|
2021
2073
|
data: r,
|
|
2022
2074
|
context: { dataSource: s, schemaIndex: n, pathPrefix: i }
|
|
2023
2075
|
});
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
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
|
+
});
|
|
2035
2108
|
throw new Error(
|
|
2036
|
-
`${i}: Expected
|
|
2109
|
+
`${i}: Expected filter function call or array of filters, got ${typeof r}`
|
|
2037
2110
|
);
|
|
2038
|
-
|
|
2039
|
-
r
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
)
|
|
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
|
|
2049
2127
|
);
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
return
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
throw new Error(
|
|
2061
|
-
`${i}: Expected measure function call or number, got ${typeof r}`
|
|
2062
|
-
);
|
|
2063
|
-
case "Date | string":
|
|
2064
|
-
if (typeof r == "string") {
|
|
2065
|
-
if (Zt(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")
|
|
2066
2138
|
return r;
|
|
2139
|
+
if (E(r))
|
|
2140
|
+
return C({
|
|
2141
|
+
data: r,
|
|
2142
|
+
context: { dataSource: s, schemaIndex: n, pathPrefix: i }
|
|
2143
|
+
});
|
|
2067
2144
|
throw new Error(
|
|
2068
|
-
`${i}: Expected
|
|
2145
|
+
`${i}: Expected measure function call or number, got ${typeof r}`
|
|
2069
2146
|
);
|
|
2070
|
-
|
|
2071
|
-
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")
|
|
2072
2163
|
return r;
|
|
2073
|
-
throw new Error(
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
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`);
|
|
2079
2171
|
return r;
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
case "CustomFormulaContext":
|
|
2084
|
-
case "any":
|
|
2085
|
-
if (r == null && t.required)
|
|
2086
|
-
throw new Error(`${i}: Required argument is null/undefined`);
|
|
2087
|
-
return r;
|
|
2088
|
-
default:
|
|
2089
|
-
return r;
|
|
2090
|
-
}
|
|
2172
|
+
default:
|
|
2173
|
+
return r;
|
|
2174
|
+
}
|
|
2091
2175
|
}
|
|
2092
2176
|
function C(e) {
|
|
2093
|
-
const { data: r } = e, { dataSource: t, schemaIndex: s, pathPrefix: n } = e.context, { function:
|
|
2177
|
+
const { data: r } = e, { dataSource: t, schemaIndex: s, pathPrefix: n } = e.context, { function: o, args: i } = r, a = n ? `${n}.` : "", u = pe(o);
|
|
2094
2178
|
if (!u)
|
|
2095
|
-
throw new Error(`${
|
|
2096
|
-
const
|
|
2097
|
-
if (i.length <
|
|
2179
|
+
throw new Error(`${a}function: Unknown function "${o}"`);
|
|
2180
|
+
const c = cs(o), p = ls(o);
|
|
2181
|
+
if (i.length < c)
|
|
2098
2182
|
throw new Error(
|
|
2099
|
-
`${
|
|
2183
|
+
`${a}function: Expected at least ${c} arguments, got ${i.length}`
|
|
2100
2184
|
);
|
|
2101
2185
|
if (i.length > p)
|
|
2102
2186
|
throw new Error(
|
|
2103
|
-
`${
|
|
2187
|
+
`${a}function: Expected at most ${p} arguments, got ${i.length}`
|
|
2104
2188
|
);
|
|
2105
2189
|
const m = [], y = [];
|
|
2106
|
-
for (let
|
|
2107
|
-
const
|
|
2190
|
+
for (let f = 0; f < Math.max(i.length, u.length); f++) {
|
|
2191
|
+
const d = u[`${f}`], w = i[`${f}`], $ = a ? `${a}args[${f}]` : `args[${f}]`;
|
|
2108
2192
|
if (w === void 0) {
|
|
2109
|
-
|
|
2193
|
+
d != null && d.required && y.push(`${$}: Missing required argument (expected ${d.type})`);
|
|
2110
2194
|
continue;
|
|
2111
2195
|
}
|
|
2112
|
-
if (!
|
|
2113
|
-
y.push(`${
|
|
2196
|
+
if (!d) {
|
|
2197
|
+
y.push(`${$}: Unexpected argument`);
|
|
2114
2198
|
continue;
|
|
2115
2199
|
}
|
|
2116
2200
|
try {
|
|
2117
|
-
const
|
|
2201
|
+
const D = ms({
|
|
2118
2202
|
data: w,
|
|
2119
2203
|
context: {
|
|
2120
2204
|
dataSource: t,
|
|
2121
2205
|
schemaIndex: s,
|
|
2122
|
-
pathPrefix:
|
|
2123
|
-
argSchema:
|
|
2206
|
+
pathPrefix: $,
|
|
2207
|
+
argSchema: d
|
|
2124
2208
|
}
|
|
2125
2209
|
});
|
|
2126
|
-
m.push(
|
|
2127
|
-
} catch (
|
|
2128
|
-
const
|
|
2129
|
-
y.push(
|
|
2210
|
+
m.push(D);
|
|
2211
|
+
} catch (D) {
|
|
2212
|
+
const ve = D instanceof Error ? D.message : "Unknown error";
|
|
2213
|
+
y.push(ve);
|
|
2130
2214
|
}
|
|
2131
2215
|
}
|
|
2132
2216
|
if (y.length > 0) {
|
|
2133
|
-
const
|
|
2134
|
-
throw new Error(
|
|
2217
|
+
const f = y.join("; ");
|
|
2218
|
+
throw new Error(f);
|
|
2135
2219
|
}
|
|
2136
|
-
const
|
|
2137
|
-
if (
|
|
2220
|
+
const x = as(o);
|
|
2221
|
+
if (x)
|
|
2138
2222
|
try {
|
|
2139
|
-
|
|
2223
|
+
x(m, {
|
|
2140
2224
|
dataSource: t,
|
|
2141
2225
|
schemaIndex: s,
|
|
2142
|
-
pathPrefix:
|
|
2226
|
+
pathPrefix: a
|
|
2143
2227
|
});
|
|
2144
|
-
} catch (
|
|
2145
|
-
const
|
|
2146
|
-
throw new Error(
|
|
2228
|
+
} catch (f) {
|
|
2229
|
+
const d = f instanceof Error ? f.message : "Unknown validation error";
|
|
2230
|
+
throw new Error(d);
|
|
2147
2231
|
}
|
|
2148
|
-
return
|
|
2232
|
+
return Qt(o, m);
|
|
2149
2233
|
}
|
|
2150
|
-
function
|
|
2234
|
+
function Ye(e) {
|
|
2151
2235
|
const { attribute: r, config: t } = e;
|
|
2152
|
-
if (
|
|
2153
|
-
const { granularity: s } = r, n = e.members.map((
|
|
2154
|
-
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);
|
|
2155
2239
|
}
|
|
2156
2240
|
return e;
|
|
2157
2241
|
}
|
|
2158
|
-
function
|
|
2242
|
+
function ps(e) {
|
|
2159
2243
|
let r = [];
|
|
2160
2244
|
for (const t of e)
|
|
2161
|
-
|
|
2245
|
+
U(t) ? r = he(t, r) : r = he([Ye(t)], r);
|
|
2162
2246
|
return r != null ? r : [];
|
|
2163
2247
|
}
|
|
2164
|
-
const
|
|
2165
|
-
const { data: r } = e, { dataSource: t, schemaIndex: s } = e.context, n = [],
|
|
2166
|
-
return r.forEach((i,
|
|
2248
|
+
const ys = (e) => {
|
|
2249
|
+
const { data: r } = e, { dataSource: t, schemaIndex: s } = e.context, n = [], o = [];
|
|
2250
|
+
return r.forEach((i, a) => {
|
|
2167
2251
|
const u = {
|
|
2168
2252
|
category: "filters",
|
|
2169
|
-
index:
|
|
2253
|
+
index: a,
|
|
2170
2254
|
input: i
|
|
2171
2255
|
};
|
|
2172
2256
|
try {
|
|
2173
|
-
const
|
|
2257
|
+
const c = C({
|
|
2174
2258
|
data: i,
|
|
2175
2259
|
context: { dataSource: t, schemaIndex: s, pathPrefix: "" }
|
|
2176
2260
|
});
|
|
2177
|
-
!
|
|
2178
|
-
} catch (
|
|
2179
|
-
const p =
|
|
2180
|
-
|
|
2261
|
+
!U(c) && !K(c) ? o.push(h(g({}, u), { message: "Invalid filter JSON" })) : n.push(c);
|
|
2262
|
+
} catch (c) {
|
|
2263
|
+
const p = c instanceof Error ? c.message : "Unknown error";
|
|
2264
|
+
o.push(h(g({}, u), { message: p }));
|
|
2181
2265
|
}
|
|
2182
|
-
}),
|
|
2183
|
-
},
|
|
2266
|
+
}), o.length > 0 ? { success: !1, errors: o } : { success: !0, data: ps(n) };
|
|
2267
|
+
}, gs = (e) => {
|
|
2184
2268
|
const { data: r } = e, { dataSource: t, schemaIndex: s } = e.context;
|
|
2185
|
-
return r ?
|
|
2269
|
+
return r ? je(r) ? ys({
|
|
2186
2270
|
data: r,
|
|
2187
2271
|
context: { dataSource: t, schemaIndex: s }
|
|
2188
2272
|
}) : {
|
|
@@ -2196,28 +2280,28 @@ const es = (e) => {
|
|
|
2196
2280
|
}
|
|
2197
2281
|
]
|
|
2198
2282
|
} : { success: !0, data: [] };
|
|
2199
|
-
},
|
|
2200
|
-
const { data: r } = e, { dataSource: t, schemaIndex: s } = e.context, n = [],
|
|
2201
|
-
return r.forEach((i,
|
|
2283
|
+
}, hs = (e) => {
|
|
2284
|
+
const { data: r } = e, { dataSource: t, schemaIndex: s } = e.context, n = [], o = [];
|
|
2285
|
+
return r.forEach((i, a) => {
|
|
2202
2286
|
const u = {
|
|
2203
2287
|
category: "highlights",
|
|
2204
|
-
index:
|
|
2288
|
+
index: a,
|
|
2205
2289
|
input: i
|
|
2206
2290
|
};
|
|
2207
2291
|
try {
|
|
2208
|
-
const
|
|
2292
|
+
const c = C({
|
|
2209
2293
|
data: i,
|
|
2210
2294
|
context: { dataSource: t, schemaIndex: s, pathPrefix: "" }
|
|
2211
2295
|
});
|
|
2212
|
-
K(
|
|
2213
|
-
} catch (
|
|
2214
|
-
const p =
|
|
2215
|
-
|
|
2296
|
+
K(c) ? n.push(Ye(c)) : o.push(h(g({}, u), { message: "Invalid filter JSON" }));
|
|
2297
|
+
} catch (c) {
|
|
2298
|
+
const p = c instanceof Error ? c.message : "Unknown error";
|
|
2299
|
+
o.push(h(g({}, u), { message: p }));
|
|
2216
2300
|
}
|
|
2217
|
-
}),
|
|
2218
|
-
},
|
|
2301
|
+
}), o.length > 0 ? { success: !1, errors: o } : { success: !0, data: n };
|
|
2302
|
+
}, bs = (e) => {
|
|
2219
2303
|
const { data: r } = e, { dataSource: t, schemaIndex: s } = e.context;
|
|
2220
|
-
return r ?
|
|
2304
|
+
return r ? je(r) ? hs({
|
|
2221
2305
|
data: r,
|
|
2222
2306
|
context: { dataSource: t, schemaIndex: s }
|
|
2223
2307
|
}) : {
|
|
@@ -2231,125 +2315,178 @@ const es = (e) => {
|
|
|
2231
2315
|
}
|
|
2232
2316
|
]
|
|
2233
2317
|
} : { success: !0, data: [] };
|
|
2234
|
-
},
|
|
2235
|
-
const {
|
|
2236
|
-
|
|
2318
|
+
}, Fs = (e, r, t) => {
|
|
2319
|
+
const { dataSource: s, schemaIndex: n } = r;
|
|
2320
|
+
try {
|
|
2321
|
+
const o = C({
|
|
2322
|
+
data: e,
|
|
2323
|
+
context: { dataSource: s, schemaIndex: n, pathPrefix: "" }
|
|
2324
|
+
});
|
|
2325
|
+
return fe(o) ? { success: !0, data: o } : {
|
|
2326
|
+
success: !1,
|
|
2327
|
+
errors: [h(g({}, t), { message: "Invalid measure JSON" })]
|
|
2328
|
+
};
|
|
2329
|
+
} catch (o) {
|
|
2330
|
+
const i = o instanceof Error ? o.message : "Unknown error";
|
|
2331
|
+
return {
|
|
2332
|
+
success: !1,
|
|
2333
|
+
errors: [h(g({}, t), { message: i })]
|
|
2334
|
+
};
|
|
2335
|
+
}
|
|
2336
|
+
}, ws = (e, r, t) => r ? $e(r) ? { measure: e.sort(Ae(r)) } : {
|
|
2337
|
+
measure: e,
|
|
2338
|
+
error: h(g({}, t), {
|
|
2339
|
+
message: `Invalid sort type. Expected "sortAsc", "sortDesc", or "sortNone". Got: "${r}".`
|
|
2340
|
+
})
|
|
2341
|
+
} : { measure: e }, qs = (e, r, t, s) => {
|
|
2342
|
+
const n = C({
|
|
2343
|
+
data: e.column,
|
|
2344
|
+
context: { dataSource: r, schemaIndex: t, pathPrefix: "" }
|
|
2345
|
+
});
|
|
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);
|
|
2350
|
+
if (E(e)) {
|
|
2351
|
+
const n = Fs(
|
|
2352
|
+
e,
|
|
2353
|
+
{ dataSource: r, schemaIndex: t },
|
|
2354
|
+
s
|
|
2355
|
+
);
|
|
2356
|
+
return n.success ? { measure: n.data } : { error: n.errors[0] };
|
|
2357
|
+
}
|
|
2358
|
+
return {
|
|
2359
|
+
error: h(g({}, s), {
|
|
2360
|
+
message: 'Invalid measure item. Expected a function call (function/args) or object with "column" and optional "sortType".'
|
|
2361
|
+
})
|
|
2362
|
+
};
|
|
2363
|
+
}, Cs = (e) => {
|
|
2364
|
+
const { data: r } = e, { dataSource: t, schemaIndex: s } = e.context;
|
|
2365
|
+
if (!r)
|
|
2366
|
+
return { success: !0, data: [] };
|
|
2367
|
+
if (!Array.isArray(r))
|
|
2368
|
+
return {
|
|
2369
|
+
success: !1,
|
|
2370
|
+
errors: [
|
|
2371
|
+
{
|
|
2372
|
+
category: "measures",
|
|
2373
|
+
index: -1,
|
|
2374
|
+
input: r,
|
|
2375
|
+
message: "Invalid measures JSON. Expected an array."
|
|
2376
|
+
}
|
|
2377
|
+
]
|
|
2378
|
+
};
|
|
2379
|
+
const n = [], o = [];
|
|
2380
|
+
return r.forEach((i, a) => {
|
|
2237
2381
|
const u = {
|
|
2238
2382
|
category: "measures",
|
|
2239
|
-
index:
|
|
2383
|
+
index: a,
|
|
2240
2384
|
input: i
|
|
2241
2385
|
};
|
|
2242
2386
|
try {
|
|
2243
|
-
const
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
_e(l) ? n.push(l) : a.push(E(b({}, u), { message: "Invalid measure JSON" }));
|
|
2248
|
-
} catch (l) {
|
|
2249
|
-
const p = l instanceof Error ? l.message : "Unknown error";
|
|
2250
|
-
a.push(E(b({}, u), { message: p }));
|
|
2251
|
-
}
|
|
2252
|
-
}), a.length > 0 ? { success: !1, errors: a } : { success: !0, data: n };
|
|
2253
|
-
}, is = (e) => {
|
|
2254
|
-
const { data: r } = e, { dataSource: t, schemaIndex: s } = e.context;
|
|
2255
|
-
return r ? le(r) ? ns({
|
|
2256
|
-
data: r,
|
|
2257
|
-
context: { dataSource: t, schemaIndex: s }
|
|
2258
|
-
}) : {
|
|
2259
|
-
success: !1,
|
|
2260
|
-
errors: [
|
|
2261
|
-
{
|
|
2262
|
-
category: "measures",
|
|
2263
|
-
index: -1,
|
|
2264
|
-
input: r,
|
|
2265
|
-
message: 'Invalid measures JSON. Expected an array of function calls with "function" and "args" properties.'
|
|
2387
|
+
const c = Es(i, t, s, u);
|
|
2388
|
+
if (c.error) {
|
|
2389
|
+
o.push(c.error);
|
|
2390
|
+
return;
|
|
2266
2391
|
}
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2392
|
+
c.measure && n.push(c.measure);
|
|
2393
|
+
} catch (c) {
|
|
2394
|
+
const p = c instanceof Error ? c.message : "Unknown error";
|
|
2395
|
+
o.push(h(g({}, u), { message: p }));
|
|
2396
|
+
}
|
|
2397
|
+
}), o.length > 0 ? { success: !1, errors: o } : { success: !0, data: n };
|
|
2398
|
+
}, ks = (e) => {
|
|
2399
|
+
const { data: r } = e, { dataSource: t, tables: s } = e.context, n = Bt(s), o = [], i = M(
|
|
2400
|
+
() => jt({
|
|
2272
2401
|
data: r.dimensions || [],
|
|
2273
2402
|
context: { dataSource: t, schemaIndex: n }
|
|
2274
2403
|
}),
|
|
2275
|
-
|
|
2276
|
-
),
|
|
2277
|
-
() =>
|
|
2404
|
+
o
|
|
2405
|
+
), a = M(
|
|
2406
|
+
() => Cs({
|
|
2278
2407
|
data: r.measures || [],
|
|
2279
2408
|
context: { dataSource: t, schemaIndex: n }
|
|
2280
2409
|
}),
|
|
2281
|
-
|
|
2410
|
+
o
|
|
2282
2411
|
), u = M(
|
|
2283
|
-
() =>
|
|
2412
|
+
() => gs({
|
|
2284
2413
|
data: r.filters || [],
|
|
2285
2414
|
context: { dataSource: t, schemaIndex: n }
|
|
2286
2415
|
}),
|
|
2287
|
-
|
|
2416
|
+
o
|
|
2288
2417
|
);
|
|
2289
|
-
let
|
|
2290
|
-
return r.highlights && (
|
|
2291
|
-
() =>
|
|
2418
|
+
let c = null;
|
|
2419
|
+
return r.highlights && (c = M(
|
|
2420
|
+
() => bs({
|
|
2292
2421
|
data: r.highlights || [],
|
|
2293
2422
|
context: { dataSource: t, schemaIndex: n }
|
|
2294
2423
|
}),
|
|
2295
|
-
|
|
2296
|
-
)),
|
|
2424
|
+
o
|
|
2425
|
+
)), o.length > 0 ? {
|
|
2297
2426
|
success: !1,
|
|
2298
|
-
errors:
|
|
2427
|
+
errors: o
|
|
2299
2428
|
} : {
|
|
2300
2429
|
success: !0,
|
|
2301
|
-
data:
|
|
2302
|
-
dataSource:
|
|
2430
|
+
data: g({
|
|
2431
|
+
dataSource: Gr(t),
|
|
2303
2432
|
dimensions: i || [],
|
|
2304
|
-
measures:
|
|
2433
|
+
measures: a || [],
|
|
2305
2434
|
filters: u || []
|
|
2306
|
-
},
|
|
2435
|
+
}, c && { highlights: c })
|
|
2307
2436
|
};
|
|
2308
2437
|
};
|
|
2309
|
-
function
|
|
2438
|
+
function $s(e) {
|
|
2310
2439
|
const r = [], t = [];
|
|
2311
2440
|
return e.forEach((s, n) => {
|
|
2312
|
-
const
|
|
2441
|
+
const o = () => typeof s.toJSON == "function" ? s.toJSON() : s;
|
|
2313
2442
|
if (!s.composeCode) {
|
|
2314
2443
|
t.push({
|
|
2315
2444
|
category: "dimensions",
|
|
2316
2445
|
index: n,
|
|
2317
|
-
input:
|
|
2446
|
+
input: o(),
|
|
2318
2447
|
message: `Dimension at index ${n} (${s.name || "unnamed"}) is missing composeCode`
|
|
2319
2448
|
});
|
|
2320
2449
|
return;
|
|
2321
2450
|
}
|
|
2322
|
-
if (!s.composeCode.startsWith(
|
|
2451
|
+
if (!s.composeCode.startsWith(F)) {
|
|
2323
2452
|
t.push({
|
|
2324
2453
|
category: "dimensions",
|
|
2325
2454
|
index: n,
|
|
2326
|
-
input:
|
|
2327
|
-
message: `Expected composeCode to start with "${
|
|
2455
|
+
input: o(),
|
|
2456
|
+
message: `Expected composeCode to start with "${F}" for dimension at index ${n} (${s.name || "unnamed"}). Got: "${s.composeCode}"`
|
|
2328
2457
|
});
|
|
2329
2458
|
return;
|
|
2330
2459
|
}
|
|
2331
|
-
|
|
2460
|
+
const i = s.getSort();
|
|
2461
|
+
if (i !== void 0 && i !== ie.None) {
|
|
2462
|
+
const a = {
|
|
2463
|
+
column: s.composeCode,
|
|
2464
|
+
sortType: xe(i)
|
|
2465
|
+
};
|
|
2466
|
+
r.push(a);
|
|
2467
|
+
} else
|
|
2468
|
+
r.push(s.composeCode);
|
|
2332
2469
|
}), t.length > 0 ? { success: !1, errors: t } : { success: !0, data: r };
|
|
2333
2470
|
}
|
|
2334
|
-
function
|
|
2471
|
+
function He(e, r) {
|
|
2335
2472
|
const t = [];
|
|
2336
|
-
let s = "", n = 0,
|
|
2337
|
-
for (let
|
|
2338
|
-
const u = e[
|
|
2339
|
-
if (
|
|
2473
|
+
let s = "", n = 0, o = !1, i = null;
|
|
2474
|
+
for (let a = 0; a < e.length; a++) {
|
|
2475
|
+
const u = e[a], c = e[a + 1];
|
|
2476
|
+
if (o) {
|
|
2340
2477
|
if (u !== i) {
|
|
2341
2478
|
s += u;
|
|
2342
2479
|
continue;
|
|
2343
2480
|
}
|
|
2344
|
-
if (
|
|
2345
|
-
s += u +
|
|
2481
|
+
if (c === i) {
|
|
2482
|
+
s += u + c, a++;
|
|
2346
2483
|
continue;
|
|
2347
2484
|
}
|
|
2348
|
-
|
|
2485
|
+
o = !1, i = null, s += u;
|
|
2349
2486
|
continue;
|
|
2350
2487
|
} else {
|
|
2351
2488
|
if (u === "'" || u === '"') {
|
|
2352
|
-
|
|
2489
|
+
o = !0, i = u, s += u;
|
|
2353
2490
|
continue;
|
|
2354
2491
|
}
|
|
2355
2492
|
if ("([{".includes(u) && n++, ")]}".includes(u) && n--, u === r && n === 0) {
|
|
@@ -2361,14 +2498,14 @@ function Ue(e, r) {
|
|
|
2361
2498
|
}
|
|
2362
2499
|
return s.trim() && t.push(s.trim()), t;
|
|
2363
2500
|
}
|
|
2364
|
-
function
|
|
2501
|
+
function As(e, r) {
|
|
2365
2502
|
let t = 0, s = !1, n = null;
|
|
2366
|
-
for (let
|
|
2367
|
-
const i = e[
|
|
2503
|
+
for (let o = 0; o < e.length; o++) {
|
|
2504
|
+
const i = e[o], a = e[o + 1];
|
|
2368
2505
|
if (s) {
|
|
2369
2506
|
if (i !== n) continue;
|
|
2370
|
-
if (
|
|
2371
|
-
|
|
2507
|
+
if (a === n) {
|
|
2508
|
+
o++;
|
|
2372
2509
|
continue;
|
|
2373
2510
|
}
|
|
2374
2511
|
s = !1, n = null;
|
|
@@ -2377,15 +2514,15 @@ function os(e, r) {
|
|
|
2377
2514
|
s = !0, n = i;
|
|
2378
2515
|
continue;
|
|
2379
2516
|
}
|
|
2380
|
-
if ("([{".includes(i) && t++, ")]}".includes(i) && t--, i === r && t === 0) return
|
|
2517
|
+
if ("([{".includes(i) && t++, ")]}".includes(i) && t--, i === r && t === 0) return o;
|
|
2381
2518
|
}
|
|
2382
2519
|
}
|
|
2383
2520
|
return -1;
|
|
2384
2521
|
}
|
|
2385
|
-
function
|
|
2522
|
+
function xs(e) {
|
|
2386
2523
|
return e.startsWith("'") && e.endsWith("'") || e.startsWith('"') && e.endsWith('"') ? e.slice(1, -1) : e;
|
|
2387
2524
|
}
|
|
2388
|
-
function
|
|
2525
|
+
function _(e) {
|
|
2389
2526
|
if (!e || typeof e != "string")
|
|
2390
2527
|
throw new Error(`Invalid composeCode: expected non-empty string, got ${typeof e}`);
|
|
2391
2528
|
const r = e.trim();
|
|
@@ -2394,16 +2531,16 @@ function V(e) {
|
|
|
2394
2531
|
const t = r.match(/^([a-zA-Z_$][a-zA-Z0-9_.$]*)\s*\((.*)\)$/);
|
|
2395
2532
|
if (!t)
|
|
2396
2533
|
throw new Error(`Invalid composeCode format: expected function call, got "${r}"`);
|
|
2397
|
-
const s = t[1], n = t[2],
|
|
2534
|
+
const s = t[1], n = t[2], o = Ze(n);
|
|
2398
2535
|
return {
|
|
2399
2536
|
function: s,
|
|
2400
|
-
args:
|
|
2537
|
+
args: o
|
|
2401
2538
|
};
|
|
2402
2539
|
}
|
|
2403
|
-
function
|
|
2404
|
-
return e.trim() ?
|
|
2540
|
+
function Ze(e) {
|
|
2541
|
+
return e.trim() ? He(e, ",").map(Xe) : [];
|
|
2405
2542
|
}
|
|
2406
|
-
function
|
|
2543
|
+
function Xe(e) {
|
|
2407
2544
|
if (!e)
|
|
2408
2545
|
throw new Error("Cannot parse empty argument value");
|
|
2409
2546
|
if (e === "null")
|
|
@@ -2424,33 +2561,33 @@ function Ke(e) {
|
|
|
2424
2561
|
const t = e.slice(1, -1).trim();
|
|
2425
2562
|
if (!t)
|
|
2426
2563
|
return [];
|
|
2427
|
-
const s =
|
|
2564
|
+
const s = Ze(t);
|
|
2428
2565
|
return s.every((n) => typeof n == "string"), s;
|
|
2429
2566
|
}
|
|
2430
2567
|
if (e.startsWith("{") && e.endsWith("}")) {
|
|
2431
2568
|
const t = e.slice(1, -1).trim();
|
|
2432
|
-
return t ?
|
|
2569
|
+
return t ? Ms(t) : {};
|
|
2433
2570
|
}
|
|
2434
|
-
return e.includes("(") && e.includes(")") ?
|
|
2571
|
+
return e.includes("(") && e.includes(")") ? _(e) : (e.startsWith("DM."), e);
|
|
2435
2572
|
}
|
|
2436
|
-
function
|
|
2437
|
-
const r =
|
|
2573
|
+
function Ds(e) {
|
|
2574
|
+
const r = As(e, ":");
|
|
2438
2575
|
if (r === -1)
|
|
2439
2576
|
throw new Error(`Invalid object property: expected "key: value", got "${e}"`);
|
|
2440
|
-
const t =
|
|
2577
|
+
const t = xs(e.slice(0, r).trim()), s = Xe(e.slice(r + 1).trim());
|
|
2441
2578
|
return [t, s];
|
|
2442
2579
|
}
|
|
2443
|
-
function
|
|
2580
|
+
function Ms(e) {
|
|
2444
2581
|
if (!e.trim()) return {};
|
|
2445
|
-
const r =
|
|
2582
|
+
const r = He(e, ",").map(Ds).filter(([, t]) => t !== null);
|
|
2446
2583
|
return Object.fromEntries(r);
|
|
2447
2584
|
}
|
|
2448
|
-
const
|
|
2449
|
-
function
|
|
2585
|
+
const te = "Unknown error";
|
|
2586
|
+
function Ss(e) {
|
|
2450
2587
|
if (!e)
|
|
2451
2588
|
return { success: !0, data: [] };
|
|
2452
2589
|
const r = [];
|
|
2453
|
-
if (
|
|
2590
|
+
if (Qr(e)) {
|
|
2454
2591
|
if (!e.composeCode)
|
|
2455
2592
|
return {
|
|
2456
2593
|
success: !1,
|
|
@@ -2464,9 +2601,9 @@ function fs(e) {
|
|
|
2464
2601
|
]
|
|
2465
2602
|
};
|
|
2466
2603
|
try {
|
|
2467
|
-
return { success: !0, data: [
|
|
2604
|
+
return { success: !0, data: [_(e.composeCode)] };
|
|
2468
2605
|
} catch (s) {
|
|
2469
|
-
const n = s instanceof Error ? s.message :
|
|
2606
|
+
const n = s instanceof Error ? s.message : te;
|
|
2470
2607
|
return {
|
|
2471
2608
|
success: !1,
|
|
2472
2609
|
errors: [
|
|
@@ -2492,10 +2629,10 @@ function fs(e) {
|
|
|
2492
2629
|
return;
|
|
2493
2630
|
}
|
|
2494
2631
|
try {
|
|
2495
|
-
const
|
|
2496
|
-
t.push(
|
|
2497
|
-
} catch (
|
|
2498
|
-
const i =
|
|
2632
|
+
const o = _(s.composeCode);
|
|
2633
|
+
t.push(o);
|
|
2634
|
+
} catch (o) {
|
|
2635
|
+
const i = o instanceof Error ? o.message : te;
|
|
2499
2636
|
r.push({
|
|
2500
2637
|
category: "filters",
|
|
2501
2638
|
index: n,
|
|
@@ -2505,7 +2642,7 @@ function fs(e) {
|
|
|
2505
2642
|
}
|
|
2506
2643
|
}), r.length > 0 ? { success: !1, errors: r } : { success: !0, data: t };
|
|
2507
2644
|
}
|
|
2508
|
-
function
|
|
2645
|
+
function Ts(e) {
|
|
2509
2646
|
if (!e)
|
|
2510
2647
|
return { success: !0, data: [] };
|
|
2511
2648
|
const r = [], t = [];
|
|
@@ -2520,10 +2657,10 @@ function ds(e) {
|
|
|
2520
2657
|
return;
|
|
2521
2658
|
}
|
|
2522
2659
|
try {
|
|
2523
|
-
const
|
|
2524
|
-
r.push(
|
|
2525
|
-
} catch (
|
|
2526
|
-
const i =
|
|
2660
|
+
const o = _(s.composeCode);
|
|
2661
|
+
r.push(o);
|
|
2662
|
+
} catch (o) {
|
|
2663
|
+
const i = o instanceof Error ? o.message : te;
|
|
2527
2664
|
t.push({
|
|
2528
2665
|
category: "highlights",
|
|
2529
2666
|
index: n,
|
|
@@ -2533,71 +2670,78 @@ function ds(e) {
|
|
|
2533
2670
|
}
|
|
2534
2671
|
}), t.length > 0 ? { success: !1, errors: t } : { success: !0, data: r };
|
|
2535
2672
|
}
|
|
2536
|
-
function
|
|
2673
|
+
function Ns(e) {
|
|
2537
2674
|
const r = [], t = [];
|
|
2538
2675
|
return e.forEach((s, n) => {
|
|
2539
|
-
const
|
|
2676
|
+
const o = () => typeof s.toJSON == "function" ? s.toJSON() : s;
|
|
2540
2677
|
if (!s.composeCode) {
|
|
2541
2678
|
t.push({
|
|
2542
2679
|
category: "measures",
|
|
2543
2680
|
index: n,
|
|
2544
|
-
input:
|
|
2681
|
+
input: o(),
|
|
2545
2682
|
message: `Measure at index ${n} (${s.name || "unnamed"}) is missing composeCode`
|
|
2546
2683
|
});
|
|
2547
2684
|
return;
|
|
2548
2685
|
}
|
|
2549
2686
|
try {
|
|
2550
|
-
const i =
|
|
2551
|
-
|
|
2687
|
+
const i = _(s.composeCode), a = s.getSort();
|
|
2688
|
+
if (a !== void 0 && a !== ie.None) {
|
|
2689
|
+
const u = {
|
|
2690
|
+
column: i,
|
|
2691
|
+
sortType: xe(a)
|
|
2692
|
+
};
|
|
2693
|
+
r.push(u);
|
|
2694
|
+
} else
|
|
2695
|
+
r.push(i);
|
|
2552
2696
|
} catch (i) {
|
|
2553
|
-
const
|
|
2697
|
+
const a = i instanceof Error ? i.message : "Unknown error";
|
|
2554
2698
|
t.push({
|
|
2555
2699
|
category: "measures",
|
|
2556
2700
|
index: n,
|
|
2557
|
-
input:
|
|
2558
|
-
message: `Failed to parse composeCode for measure at index ${n} (${s.name || "unnamed"}): ${
|
|
2701
|
+
input: o(),
|
|
2702
|
+
message: `Failed to parse composeCode for measure at index ${n} (${s.name || "unnamed"}): ${a}. ComposeCode: "${s.composeCode}"`
|
|
2559
2703
|
});
|
|
2560
2704
|
}
|
|
2561
2705
|
}), t.length > 0 ? { success: !1, errors: t } : { success: !0, data: r };
|
|
2562
2706
|
}
|
|
2563
|
-
function
|
|
2564
|
-
return typeof e == "string" ? e.replace(/\[\[([^\]]+)\]\]/g, "$1") : Array.isArray(e) ? e.map(
|
|
2565
|
-
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)])
|
|
2566
2710
|
) : e;
|
|
2567
2711
|
}
|
|
2568
|
-
function
|
|
2712
|
+
function Ls(e) {
|
|
2569
2713
|
const r = [], t = M(
|
|
2570
|
-
() =>
|
|
2714
|
+
() => $s(e.dimensions || []),
|
|
2571
2715
|
r
|
|
2572
2716
|
), s = M(
|
|
2573
|
-
() =>
|
|
2717
|
+
() => Ns(e.measures || []),
|
|
2574
2718
|
r
|
|
2575
2719
|
), n = M(
|
|
2576
|
-
() =>
|
|
2720
|
+
() => Ss(e.filters),
|
|
2577
2721
|
r
|
|
2578
2722
|
);
|
|
2579
|
-
let
|
|
2580
|
-
if (e.highlights && e.highlights.length > 0 && (
|
|
2581
|
-
() =>
|
|
2723
|
+
let o = null;
|
|
2724
|
+
if (e.highlights && e.highlights.length > 0 && (o = M(
|
|
2725
|
+
() => Ts(e.highlights),
|
|
2582
2726
|
r
|
|
2583
2727
|
)), r.length > 0)
|
|
2584
2728
|
return {
|
|
2585
2729
|
success: !1,
|
|
2586
2730
|
errors: r
|
|
2587
2731
|
};
|
|
2588
|
-
const i =
|
|
2732
|
+
const i = g({
|
|
2589
2733
|
dimensions: t || [],
|
|
2590
2734
|
measures: s || [],
|
|
2591
2735
|
filters: n || []
|
|
2592
|
-
},
|
|
2736
|
+
}, o && { highlights: o });
|
|
2593
2737
|
return {
|
|
2594
2738
|
success: !0,
|
|
2595
2739
|
// Strip [[delimiters]] from all strings to preserve original names with spaces
|
|
2596
|
-
data:
|
|
2740
|
+
data: se(i)
|
|
2597
2741
|
};
|
|
2598
2742
|
}
|
|
2599
|
-
function
|
|
2600
|
-
const { filters: r, relations: t } =
|
|
2743
|
+
function Rs(e) {
|
|
2744
|
+
const { filters: r, relations: t } = Zr(
|
|
2601
2745
|
e.filters || []
|
|
2602
2746
|
);
|
|
2603
2747
|
return {
|
|
@@ -2610,19 +2754,19 @@ function ps(e) {
|
|
|
2610
2754
|
// No count/offset/ungroup - these are execution concerns, not translation concerns
|
|
2611
2755
|
};
|
|
2612
2756
|
}
|
|
2613
|
-
function
|
|
2614
|
-
const s =
|
|
2615
|
-
return
|
|
2757
|
+
function Vs(e, r, t = !1) {
|
|
2758
|
+
const s = Rs(e), n = Yr(s, r);
|
|
2759
|
+
return Hr(n, t);
|
|
2616
2760
|
}
|
|
2617
2761
|
export {
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
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
|
|
2628
2772
|
};
|