@sisense/sdk-ui 2.28.0 → 2.30.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 +57 -57
- package/dist/ai.js +767 -797
- package/dist/analytics-composer/node.cjs +1 -1
- package/dist/analytics-composer/node.js +1310 -1230
- package/dist/analytics-composer.cjs +7 -7
- package/dist/analytics-composer.js +19 -18
- package/dist/apply-styled-options-to-query-BK1NnV4P.js +6453 -0
- package/dist/apply-styled-options-to-query-Dl8vVNxo.cjs +1 -0
- package/dist/{index-C77YCBVd.js → index-DCYw3JUB.js} +29 -7
- package/dist/index-DTvxJdqZ.cjs +1 -0
- package/dist/index.cjs +611 -518
- package/dist/index.js +26556 -24829
- package/dist/index.umd.js +952 -829
- package/dist/packages/sdk-ui/src/domains/dashboarding/common-filters/utils.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/components/dashboard-container.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/components/dashboard-header-config.d.ts +127 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/components/dashboard-header-targets.d.ts +30 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/components/dashboard-header-title.d.ts +20 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/components/dashboard-header.d.ts +10 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/constants.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-helpers.d.ts +21 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/get-dashboard-model.d.ts +7 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/translate-dashboard-utils.d.ts +45 -3
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/persist-dashboard-model-middleware.d.ts +10 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/types.d.ts +36 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/utils.d.ts +2 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-module/dashboard-module.d.ts +34 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-module/types.d.ts +58 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/duplicate-widget/use-duplicate-widget-menu-item.d.ts +7 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/use-dashboard-header-menu-item.d.ts +9 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/use-widget-updates-persistence.d.ts +27 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/persistence/deep-merge.d.ts +17 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/persistence/types.d.ts +26 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/persistence/update-types.d.ts +51 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/types.d.ts +18 -7
- package/dist/packages/sdk-ui/src/domains/dashboarding/utils.d.ts +9 -0
- package/dist/packages/sdk-ui/src/domains/data-browser/add-measure-popover/add-measure-data-browser.d.ts +11 -0
- package/dist/packages/sdk-ui/src/domains/data-browser/add-measure-popover/add-measure-popover.d.ts +14 -0
- package/dist/packages/sdk-ui/src/domains/data-browser/add-measure-popover/measure-ranking-title.d.ts +21 -0
- package/dist/packages/sdk-ui/src/domains/data-browser/add-measure-popover/measures.d.ts +13 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/criteria-filter-tile/criteria-filter-menu.d.ts +2 -1
- package/dist/packages/sdk-ui/src/domains/filters/components/criteria-filter-tile/criteria-filter-operations.d.ts +1 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/filter-editor-popover/filter-editor-context.d.ts +1 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/filter-editor-popover/filter-editor-popover.d.ts +2 -1
- package/dist/packages/sdk-ui/src/domains/filters/components/filter-editor-popover/filter-editor.d.ts +2 -1
- package/dist/packages/sdk-ui/src/domains/filters/components/filter-editor-popover/sections/numeric-condition-section/types.d.ts +5 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/filter-editor-popover/sections/ranking-condition/index.d.ts +3 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/filter-editor-popover/sections/ranking-condition/ranking-condition-controls.d.ts +33 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/filter-editor-popover/sections/ranking-condition/ranking-condition-utils.d.ts +13 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/filters-panel/hooks/use-existing-filter-editing.d.ts +2 -1
- package/dist/packages/sdk-ui/src/domains/narrative/components/narrative-collapsible.d.ts +22 -4
- package/dist/packages/sdk-ui/src/domains/narrative/components/narrative-top-slot-shell.d.ts +2 -0
- package/dist/packages/sdk-ui/src/domains/narrative/components/narrative-trigger-button.d.ts +17 -0
- package/dist/packages/sdk-ui/src/domains/narrative/components/widget-narrative-interactive.d.ts +20 -2
- package/dist/packages/sdk-ui/src/domains/narrative/components/widget-narrative.d.ts +11 -9
- package/dist/packages/sdk-ui/src/domains/narrative/core/build-narrative-request.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/narrative/core/get-narrative-dimensions-and-measures.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/narrative/core/get-widget-narrative-from-widget-props.d.ts +18 -0
- package/dist/packages/sdk-ui/src/domains/narrative/core/to-nlg-api-verbosity.d.ts +7 -0
- package/dist/packages/sdk-ui/src/domains/narrative/core/widget-narrative-options.d.ts +101 -23
- package/dist/packages/sdk-ui/src/domains/narrative/core/widget-props-to-narrative-params.d.ts +35 -32
- package/dist/packages/sdk-ui/src/domains/narrative/hooks/use-get-widget-narrative.d.ts +11 -22
- package/dist/packages/sdk-ui/src/domains/narrative/hooks/use-line-height.d.ts +10 -0
- package/dist/packages/sdk-ui/src/domains/narrative/hooks/use-widget-narrative-state.d.ts +8 -9
- package/dist/packages/sdk-ui/src/domains/query-execution/core/execute-query.d.ts +34 -1
- package/dist/packages/sdk-ui/src/domains/query-execution/hooks/use-execute-excel-query/excel-export/build-jaql-excel-export.d.ts +13 -5
- package/dist/packages/sdk-ui/src/domains/query-execution/hooks/use-execute-excel-query/excel-export/build-xlsx-export-payload.d.ts +5 -0
- package/dist/packages/sdk-ui/src/domains/query-execution/hooks/use-execute-query-by-widget-id/use-execute-query-by-widget-id.d.ts +2 -1
- package/dist/packages/sdk-ui/src/domains/query-execution/types.d.ts +55 -3
- package/dist/packages/sdk-ui/src/domains/shared/header/header-item-size.d.ts +30 -0
- package/dist/packages/sdk-ui/src/domains/shared/header/header-items-renderer.d.ts +19 -0
- package/dist/packages/sdk-ui/src/domains/shared/header/header-spacer-item.d.ts +9 -0
- package/dist/packages/sdk-ui/src/domains/shared/header/index.d.ts +6 -0
- package/dist/packages/sdk-ui/src/domains/shared/header/resolve-header-items.d.ts +17 -0
- package/dist/packages/sdk-ui/src/domains/shared/header/types.d.ts +98 -0
- package/dist/packages/sdk-ui/src/domains/shared/header/use-resolved-header-items.d.ts +10 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/areamap-chart/data/areamap-data.d.ts +3 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/data.d.ts +0 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/cartesians/helpers/data.d.ts +3 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/cartesians/stackable/streamgraph-chart/helpers/chart-data.d.ts +3 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/categoricals/helpers/data.d.ts +3 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/categoricals/sunburst-chart/data/index.d.ts +3 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/categoricals/treemap-chart/data/index.d.ts +3 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/highcharts-based-chart-renderer/build-highchart-options.d.ts +1 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/sankey-chart/alerts/index.d.ts +5 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/sankey-chart/data/index.d.ts +22 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/sankey-chart/data-options/index.d.ts +33 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/sankey-chart/design-options/index.d.ts +21 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/sankey-chart/highchart-options/highcharts-options-builder.d.ts +3 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/sankey-chart/sankey-chart-builder.d.ts +3 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/sankey-chart/sankey-node-colors.d.ts +10 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/sankey-chart/types.d.ts +38 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/types.d.ts +2 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/types.d.ts +12 -9
- package/dist/packages/sdk-ui/src/domains/visualizations/components/pivot-table/formatters/data-cell-formatters/data-cell-value-formatter.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/pivot-table/formatters/header-cell-formatters/header-cell-value-formatter.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/pivot-table/hooks/use-pivot-data-loading.d.ts +1 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/pivot-table/resolve-pivot-container-size.d.ts +28 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/sankey-chart.d.ts +30 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/table/pure-table/helpers/format-numbers.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data/cartesian-data.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data/categorical-data.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data/chart-data-service.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data/filter-and-aggregate-chart-data.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data/scatter-data.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data/types.d.ts +2 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data-options/apply-styled-options-to-query.d.ts +4 -4
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data-options/types.d.ts +74 -30
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data-options/utils.d.ts +4 -4
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/chart-options-service.d.ts +3 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/tooltip.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/design-options.d.ts +10 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/funnel-plot-options.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/number-format-config.d.ts +12 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/pie-plot-options.d.ts +2 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/sunburst/sunburst-levels.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/sunburst/sunburst-options.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/treemap/treemap-tooltip.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/types.d.ts +12 -3
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/filter-to-readable-label.d.ts +14 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/index.d.ts +1 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-definition.d.ts +5 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-pill.d.ts +5 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/truncate-pill-label.d.ts +10 -0
- package/dist/packages/sdk-ui/src/domains/widgets/change-events.d.ts +6 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/chart-widget/types.d.ts +8 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/chart-widget/use-chart-widget-excel-download.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/chart-widget/use-chart-widget-narrative.d.ts +28 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/custom-widget/types.d.ts +11 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/custom-widget/use-custom-widget-excel-download.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/pivot-table-widget/pivot-table-widget.d.ts +15 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/pivot-table-widget/types.d.ts +7 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/pivot-table-widget/use-pivot-widget-excel-download.d.ts +1 -1
- 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/tabber.d.ts +17 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/to-widget-dto-style.d.ts +41 -2
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/widget-narrative-style.d.ts +31 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/types.d.ts +36 -1
- package/dist/packages/sdk-ui/src/domains/widgets/helpers/excel-export-map-dimensions-measures.d.ts +17 -2
- package/dist/packages/sdk-ui/src/domains/widgets/helpers/number-format-config-to-numeric-mask.d.ts +5 -0
- package/dist/packages/sdk-ui/src/domains/widgets/hooks/use-track-widget-init.d.ts +44 -0
- package/dist/packages/sdk-ui/src/domains/widgets/hooks/widget-entity-id.d.ts +30 -0
- package/dist/packages/sdk-ui/src/domains/widgets/hooks/widget-tracking-adapters.d.ts +41 -0
- package/dist/packages/sdk-ui/src/domains/widgets/shared/widget-container/widget-container.d.ts +7 -1
- package/dist/packages/sdk-ui/src/domains/widgets/shared/widget-style-utils.d.ts +29 -0
- package/dist/packages/sdk-ui/src/domains/widgets/widget-model/widget-model-translator/to-widget-dto-panels.d.ts +29 -1
- package/dist/packages/sdk-ui/src/domains/widgets/widget-model/widget-model.d.ts +6 -1
- package/dist/packages/sdk-ui/src/infra/api/narrative/narrative-endpoints.d.ts +2 -2
- package/dist/packages/sdk-ui/src/infra/api/rest-api.d.ts +2 -1
- package/dist/packages/sdk-ui/src/infra/app/settings/settings.d.ts +1 -7
- package/dist/packages/sdk-ui/src/infra/app/settings/types/features.d.ts +1 -9
- package/dist/packages/sdk-ui/src/infra/app/types.d.ts +32 -0
- package/dist/packages/sdk-ui/src/infra/contexts/sisense-context/sisense-context-provider.d.ts +1 -1
- package/dist/packages/sdk-ui/src/infra/formatting/format-data-set.d.ts +21 -0
- package/dist/packages/sdk-ui/src/infra/formatting/format-date.d.ts +67 -0
- package/dist/packages/sdk-ui/src/infra/formatting/format-number.d.ts +24 -0
- package/dist/packages/sdk-ui/src/infra/formatting/index.d.ts +5 -0
- package/dist/packages/sdk-ui/src/infra/modules/build-module-graph.d.ts +31 -0
- package/dist/packages/sdk-ui/src/infra/modules/build-module-registry.d.ts +31 -0
- package/dist/packages/sdk-ui/src/infra/modules/core-module-providers-tree.d.ts +11 -0
- package/dist/packages/sdk-ui/src/infra/modules/core-module.d.ts +26 -0
- package/dist/packages/sdk-ui/src/infra/modules/index.d.ts +3 -0
- package/dist/packages/sdk-ui/src/infra/modules/module-provider.d.ts +17 -0
- package/dist/packages/sdk-ui/src/infra/modules/modules-context.d.ts +20 -0
- package/dist/packages/sdk-ui/src/infra/modules/types.d.ts +79 -0
- package/dist/packages/sdk-ui/src/infra/plugins/types.d.ts +34 -6
- package/dist/packages/sdk-ui/src/infra/plugins/widget-plugins/types.d.ts +219 -49
- package/dist/packages/sdk-ui/src/infra/plugins/widget-plugins/widget-plugin-registry.d.ts +3 -3
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/de-de.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/en-us.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/es-ar.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/es-es.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/fr-fr.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/it-it.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ja-jp.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ko-kr.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/nl-nl.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/pt-br.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ru-ru.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/tr-tr.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/zh-cn.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/en.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/index.d.ts +44 -0
- package/dist/packages/sdk-ui/src/modules/ai/common/collapsible.d.ts +38 -2
- package/dist/packages/sdk-ui/src/modules/ai/get-nlg-insights-from-widget.d.ts +4 -13
- package/dist/packages/sdk-ui/src/modules/ai/index.d.ts +1 -1
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/constructs/dimensions/get-dimension-name.d.ts +9 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/constructs/dimensions/translate-dimensions-to-json.d.ts +4 -3
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/constructs/filters/get-filter-name.d.ts +10 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/constructs/filters/translate-filters-to-json.d.ts +3 -3
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/constructs/get-query-element-summary.d.ts +23 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/constructs/measures/get-measure-name.d.ts +10 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/constructs/measures/translate-measures-to-json.d.ts +4 -3
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/index.d.ts +3 -1
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/query/translate-query-from-json.d.ts +1 -1
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/query/translate-query-to-json.d.ts +4 -3
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/data-options/adapters.d.ts +3 -2
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/data-options/index.d.ts +1 -1
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/expression/process-measured-value.d.ts +14 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/types.d.ts +70 -9
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/widget/helpers/to-widget-props.d.ts +3 -3
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/widget/helpers/translate-envelope-widget-from-json.d.ts +2 -3
- package/dist/packages/sdk-ui/src/modules/analytics-composer/types.d.ts +1 -18
- package/dist/packages/sdk-ui/src/props.d.ts +55 -2
- package/dist/packages/sdk-ui/src/public-api/alpha.d.ts +6 -1
- package/dist/packages/sdk-ui/src/public-api/beta.d.ts +6 -0
- package/dist/packages/sdk-ui/src/public-api/internal.d.ts +1 -1
- package/dist/packages/sdk-ui/src/public-api/public.d.ts +3 -1
- package/dist/packages/sdk-ui/src/public-api/sisense-internal.d.ts +5 -3
- package/dist/packages/sdk-ui/src/shared/components/loading-overlay.d.ts +1 -0
- package/dist/packages/sdk-ui/src/shared/hooks/use-element-height.d.ts +19 -0
- package/dist/packages/sdk-ui/src/shared/hooks/use-synced-state.d.ts +23 -2
- package/dist/packages/sdk-ui/src/shared/utils/filter-relations.d.ts +8 -0
- package/dist/packages/sdk-ui/src/shared/utils/gradient.d.ts +5 -0
- package/dist/packages/sdk-ui/src/types.d.ts +78 -6
- package/dist/{use-hover-B6VmMb06.js → quota-notification-DqabeDbO.js} +24790 -22993
- package/dist/quota-notification-gYE6PTWA.cjs +750 -0
- package/dist/translations/de-de.cjs +1 -1
- package/dist/translations/de-de.js +27 -5
- 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 +27 -5
- package/dist/translations/es-es.cjs +1 -1
- package/dist/translations/es-es.js +27 -5
- package/dist/translations/fr-fr.cjs +1 -1
- package/dist/translations/fr-fr.js +27 -5
- package/dist/translations/it-it.cjs +1 -1
- package/dist/translations/it-it.js +29 -7
- package/dist/translations/ja-jp.cjs +1 -1
- package/dist/translations/ja-jp.js +27 -5
- package/dist/translations/ko-kr.cjs +1 -1
- package/dist/translations/ko-kr.js +27 -5
- package/dist/translations/nl-nl.cjs +1 -1
- package/dist/translations/nl-nl.js +29 -7
- package/dist/translations/pt-br.cjs +1 -1
- package/dist/translations/pt-br.js +27 -5
- package/dist/translations/ru-ru.cjs +1 -1
- package/dist/translations/ru-ru.js +27 -5
- package/dist/translations/tr-tr.cjs +1 -1
- package/dist/translations/tr-tr.js +27 -5
- package/dist/translations/zh-cn.cjs +1 -1
- package/dist/translations/zh-cn.js +27 -5
- package/dist/{types-CzgBH2kL.cjs → types-DSNnndG6.cjs} +1 -1
- package/dist/types-DecTaxy7.js +74 -0
- package/dist/{utils-BwGnDoB0.cjs → utils-Cpeyj9TN.cjs} +52 -52
- package/dist/{utils-CsV-iYtb.js → utils-L-HO2pCd.js} +2521 -2469
- package/dist/{widget-composer-C72Io-3c.cjs → widget-composer-CyWQaInf.cjs} +1 -1
- package/dist/{widget-composer-Bv_OVu1o.js → widget-composer-u6NMLm1C.js} +3 -3
- package/package.json +9 -8
- package/dist/apply-styled-options-to-query-23D9br-S.cjs +0 -1
- package/dist/apply-styled-options-to-query-BagjzMqm.js +0 -5992
- package/dist/dimensions-Bn1EaWiP.js +0 -204
- package/dist/dimensions-D8r34WRI.cjs +0 -1
- package/dist/index-C9G8giSk.cjs +0 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/use-dashboard-header-toolbar.d.ts +0 -25
- package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/use-widget-scroll-persistence.d.ts +0 -16
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/with-navigator-scroll-save.d.ts +0 -10
- package/dist/types-D3fPN43o.js +0 -74
- package/dist/use-hover-CaSOzp0i.cjs +0 -720
|
@@ -1,54 +1,53 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
1
|
+
var cr = Object.defineProperty, lr = Object.defineProperties;
|
|
2
|
+
var fr = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var oe = Object.getOwnPropertySymbols;
|
|
4
|
+
var Ke = Object.prototype.hasOwnProperty, Ge = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var Je = (e, t, r) => t in e ? cr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, l = (e, t) => {
|
|
6
6
|
for (var r in t || (t = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var r of
|
|
10
|
-
|
|
7
|
+
Ke.call(t, r) && Je(e, r, t[r]);
|
|
8
|
+
if (oe)
|
|
9
|
+
for (var r of oe(t))
|
|
10
|
+
Ge.call(t, r) && Je(e, r, t[r]);
|
|
11
11
|
return e;
|
|
12
|
-
},
|
|
13
|
-
var
|
|
12
|
+
}, E = (e, t) => lr(e, fr(t));
|
|
13
|
+
var Ee = (e, t) => {
|
|
14
14
|
var r = {};
|
|
15
15
|
for (var s in e)
|
|
16
|
-
|
|
17
|
-
if (e != null &&
|
|
18
|
-
for (var s of
|
|
19
|
-
t.indexOf(s) < 0 &&
|
|
16
|
+
Ke.call(e, s) && t.indexOf(s) < 0 && (r[s] = e[s]);
|
|
17
|
+
if (e != null && oe)
|
|
18
|
+
for (var s of oe(e))
|
|
19
|
+
t.indexOf(s) < 0 && Ge.call(e, s) && (r[s] = e[s]);
|
|
20
20
|
return r;
|
|
21
21
|
};
|
|
22
|
-
import { f as
|
|
23
|
-
import { b as
|
|
24
|
-
import {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const r = e.length, s = t.length, n = Array.from({ length: r + 1 }, (i, o) => Array.from({ length: s + 1 }, (a, u) => o === 0 ? u : u === 0 ? o : 0));
|
|
22
|
+
import { f as dr, J as mr } from "../types-DecTaxy7.js";
|
|
23
|
+
import { b as Hi, E as Qi, a as Xi, i as Zi, e as ea, d as ta } from "../types-DecTaxy7.js";
|
|
24
|
+
import { bt as pr, br as gr, cr as yr, bs as hr, aW as br, cs as Fr, ct as Er, aw as Me, cu as Ar, av as Tr, cv as wr, bh as Sr, ax as Cr, cw as Or, bk as $r, bi as qr, aS as Dr, bg as xr, bj as Nr, cx as vr, at as Mr, bB as Rr, cy as Ir, e as kr, cz as Lr, cA as Br, cB as _r, cC as zr, cD as Ur, cE as Pr, cF as Wr, cG as Vr, cH as jr, cI as Jr, cJ as Kr, as as Gr, cK as Yr, cL as Hr, ak as z, l as se, b as Qr, x as $, a4 as Xr, ag as U, aj as gt, cM as Zr, cN as es, cO as ts, M as J, aX as rs, cP as ss, aO as ns, am as Ye, au as me, cj as is, ck as as, bZ as yt, cQ as ht, ab as os, cR as bt, cS as Ft, A as us, c6 as Et, cT as cs, bQ as ls, aE as fs } from "../apply-styled-options-to-query-BK1NnV4P.js";
|
|
25
|
+
function ds(e, t) {
|
|
26
|
+
const r = e.length, s = t.length, n = Array.from({ length: r + 1 }, (i, a) => Array.from({ length: s + 1 }, (o, u) => a === 0 ? u : u === 0 ? a : 0));
|
|
28
27
|
for (let i = 1; i <= r; i++)
|
|
29
|
-
for (let
|
|
30
|
-
n[i][
|
|
28
|
+
for (let a = 1; a <= s; a++)
|
|
29
|
+
n[i][a] = Math.min(n[i - 1][a] + 1, n[i][a - 1] + 1, n[i - 1][a - 1] + (e[i - 1] === t[a - 1] ? 0 : 1));
|
|
31
30
|
return n[r][s];
|
|
32
31
|
}
|
|
33
|
-
function
|
|
32
|
+
function Re(e, t) {
|
|
34
33
|
const r = [];
|
|
35
|
-
let s = "", n = 0, i = !1,
|
|
36
|
-
for (let
|
|
37
|
-
const u = e[
|
|
34
|
+
let s = "", n = 0, i = !1, a = null;
|
|
35
|
+
for (let o = 0; o < e.length; o++) {
|
|
36
|
+
const u = e[o], c = e[o + 1];
|
|
38
37
|
if (i) {
|
|
39
|
-
if (u !==
|
|
38
|
+
if (u !== a) {
|
|
40
39
|
s += u;
|
|
41
40
|
continue;
|
|
42
41
|
}
|
|
43
|
-
if (c ===
|
|
44
|
-
s += u + c,
|
|
42
|
+
if (c === a) {
|
|
43
|
+
s += u + c, o++;
|
|
45
44
|
continue;
|
|
46
45
|
}
|
|
47
|
-
i = !1,
|
|
46
|
+
i = !1, a = null, s += u;
|
|
48
47
|
continue;
|
|
49
48
|
} else {
|
|
50
49
|
if (u === "'" || u === '"') {
|
|
51
|
-
i = !0,
|
|
50
|
+
i = !0, a = u, s += u;
|
|
52
51
|
continue;
|
|
53
52
|
}
|
|
54
53
|
if ("([{".includes(u) && n++, ")]}".includes(u) && n--, u === t && n === 0) {
|
|
@@ -60,61 +59,61 @@ function xe(e, t) {
|
|
|
60
59
|
}
|
|
61
60
|
return s.trim() && r.push(s.trim()), r;
|
|
62
61
|
}
|
|
63
|
-
function
|
|
62
|
+
function ms(e, t) {
|
|
64
63
|
let r = 0, s = !1, n = null;
|
|
65
64
|
for (let i = 0; i < e.length; i++) {
|
|
66
|
-
const
|
|
65
|
+
const a = e[i], o = e[i + 1];
|
|
67
66
|
if (s) {
|
|
68
|
-
if (
|
|
67
|
+
if (a !== n)
|
|
69
68
|
continue;
|
|
70
|
-
if (
|
|
69
|
+
if (o === n) {
|
|
71
70
|
i++;
|
|
72
71
|
continue;
|
|
73
72
|
}
|
|
74
73
|
s = !1, n = null;
|
|
75
74
|
} else {
|
|
76
|
-
if (
|
|
77
|
-
s = !0, n =
|
|
75
|
+
if (a === "'" || a === '"') {
|
|
76
|
+
s = !0, n = a;
|
|
78
77
|
continue;
|
|
79
78
|
}
|
|
80
|
-
if ("([{".includes(
|
|
79
|
+
if ("([{".includes(a) && r++, ")]}".includes(a) && r--, a === t && r === 0)
|
|
81
80
|
return i;
|
|
82
81
|
}
|
|
83
82
|
}
|
|
84
83
|
return -1;
|
|
85
84
|
}
|
|
86
|
-
function
|
|
85
|
+
function ps(e, t) {
|
|
87
86
|
if (e[t] !== "(")
|
|
88
87
|
return -1;
|
|
89
88
|
let r = 1, s = t + 1, n = !1, i = null;
|
|
90
89
|
for (; s < e.length; ) {
|
|
91
|
-
const
|
|
90
|
+
const a = e[s], o = e[s + 1];
|
|
92
91
|
if (n) {
|
|
93
|
-
if (
|
|
92
|
+
if (a !== i) {
|
|
94
93
|
s++;
|
|
95
94
|
continue;
|
|
96
95
|
}
|
|
97
|
-
if (
|
|
96
|
+
if (o === i) {
|
|
98
97
|
s += 2;
|
|
99
98
|
continue;
|
|
100
99
|
}
|
|
101
100
|
n = !1, i = null, s++;
|
|
102
101
|
} else {
|
|
103
|
-
if (
|
|
104
|
-
n = !0, i =
|
|
102
|
+
if (a === "'" || a === '"') {
|
|
103
|
+
n = !0, i = a, s++;
|
|
105
104
|
continue;
|
|
106
105
|
}
|
|
107
|
-
if ("([{".includes(
|
|
106
|
+
if ("([{".includes(a) && r++, ")]}".includes(a) && --r === 0)
|
|
108
107
|
return s;
|
|
109
108
|
s++;
|
|
110
109
|
}
|
|
111
110
|
}
|
|
112
111
|
return -1;
|
|
113
112
|
}
|
|
114
|
-
function
|
|
113
|
+
function gs(e) {
|
|
115
114
|
return e.startsWith("'") && e.endsWith("'") || e.startsWith('"') && e.endsWith('"') ? e.slice(1, -1) : e;
|
|
116
115
|
}
|
|
117
|
-
function
|
|
116
|
+
function K(e) {
|
|
118
117
|
if (!e || typeof e != "string")
|
|
119
118
|
throw new Error(`Invalid composeCode: expected non-empty string, got ${typeof e}`);
|
|
120
119
|
const t = e.trim();
|
|
@@ -123,16 +122,16 @@ function J(e) {
|
|
|
123
122
|
const r = t.match(/^([a-zA-Z_$][a-zA-Z0-9_.$]*)\s*\((.*)\)$/);
|
|
124
123
|
if (!r)
|
|
125
124
|
throw new Error(`Invalid composeCode format: expected function call, got '${t}'`);
|
|
126
|
-
const s = r[1], n = r[2], i =
|
|
125
|
+
const s = r[1], n = r[2], i = At(n);
|
|
127
126
|
return {
|
|
128
127
|
function: s,
|
|
129
128
|
args: i
|
|
130
129
|
};
|
|
131
130
|
}
|
|
132
|
-
function
|
|
133
|
-
return e.trim() ?
|
|
131
|
+
function At(e) {
|
|
132
|
+
return e.trim() ? Re(e, ",").map(Tt) : [];
|
|
134
133
|
}
|
|
135
|
-
function
|
|
134
|
+
function Tt(e) {
|
|
136
135
|
if (!e)
|
|
137
136
|
throw new Error("Cannot parse empty argument value");
|
|
138
137
|
if (e === "null")
|
|
@@ -153,29 +152,29 @@ function yt(e) {
|
|
|
153
152
|
const r = e.slice(1, -1).trim();
|
|
154
153
|
if (!r)
|
|
155
154
|
return [];
|
|
156
|
-
const s =
|
|
155
|
+
const s = At(r);
|
|
157
156
|
return s.every((n) => typeof n == "string"), s;
|
|
158
157
|
}
|
|
159
158
|
if (e.startsWith("{") && e.endsWith("}")) {
|
|
160
159
|
const r = e.slice(1, -1).trim();
|
|
161
|
-
return r ?
|
|
160
|
+
return r ? hs(r) : {};
|
|
162
161
|
}
|
|
163
|
-
return e.includes("(") && e.includes(")") ?
|
|
162
|
+
return e.includes("(") && e.includes(")") ? K(e) : (e.startsWith("DM."), e);
|
|
164
163
|
}
|
|
165
|
-
function
|
|
166
|
-
const t =
|
|
164
|
+
function ys(e) {
|
|
165
|
+
const t = ms(e, ":");
|
|
167
166
|
if (t === -1)
|
|
168
167
|
throw new Error(`Invalid object property: expected 'key: value', got '${e}'`);
|
|
169
|
-
const r =
|
|
168
|
+
const r = gs(e.slice(0, t).trim()), s = Tt(e.slice(t + 1).trim());
|
|
170
169
|
return [r, s];
|
|
171
170
|
}
|
|
172
|
-
function
|
|
171
|
+
function hs(e) {
|
|
173
172
|
if (!e.trim())
|
|
174
173
|
return {};
|
|
175
|
-
const t =
|
|
174
|
+
const t = Re(e, ",").map(ys).filter(([, r]) => r !== null);
|
|
176
175
|
return Object.fromEntries(t);
|
|
177
176
|
}
|
|
178
|
-
class
|
|
177
|
+
class bs {
|
|
179
178
|
constructor() {
|
|
180
179
|
this.keyToValue = /* @__PURE__ */ new Map(), this.valueToKey = /* @__PURE__ */ new Map();
|
|
181
180
|
}
|
|
@@ -192,9 +191,9 @@ class fs {
|
|
|
192
191
|
this.keyToValue.clear(), this.valueToKey.clear();
|
|
193
192
|
}
|
|
194
193
|
}
|
|
195
|
-
class
|
|
194
|
+
class wt {
|
|
196
195
|
constructor(t) {
|
|
197
|
-
this.generateIdentifier = t, this.kv = new
|
|
196
|
+
this.generateIdentifier = t, this.kv = new bs();
|
|
198
197
|
}
|
|
199
198
|
register(t, r) {
|
|
200
199
|
this.kv.getByValue(t) || (r || (r = this.generateIdentifier(t)), this.kv.set(r, t));
|
|
@@ -209,7 +208,7 @@ class ht {
|
|
|
209
208
|
return this.kv.getByKey(t);
|
|
210
209
|
}
|
|
211
210
|
}
|
|
212
|
-
class
|
|
211
|
+
class Fs extends wt {
|
|
213
212
|
constructor() {
|
|
214
213
|
super((t) => t.name), this.classToAllowedProps = /* @__PURE__ */ new Map();
|
|
215
214
|
}
|
|
@@ -220,7 +219,7 @@ class ps extends ht {
|
|
|
220
219
|
return this.classToAllowedProps.get(t);
|
|
221
220
|
}
|
|
222
221
|
}
|
|
223
|
-
function
|
|
222
|
+
function Es(e) {
|
|
224
223
|
if ("values" in Object)
|
|
225
224
|
return Object.values(e);
|
|
226
225
|
const t = [];
|
|
@@ -228,8 +227,8 @@ function ms(e) {
|
|
|
228
227
|
e.hasOwnProperty(r) && t.push(e[r]);
|
|
229
228
|
return t;
|
|
230
229
|
}
|
|
231
|
-
function
|
|
232
|
-
const r =
|
|
230
|
+
function As(e, t) {
|
|
231
|
+
const r = Es(e);
|
|
233
232
|
if ("find" in r)
|
|
234
233
|
return r.find(t);
|
|
235
234
|
const s = r;
|
|
@@ -239,20 +238,20 @@ function gs(e, t) {
|
|
|
239
238
|
return i;
|
|
240
239
|
}
|
|
241
240
|
}
|
|
242
|
-
function
|
|
241
|
+
function G(e, t) {
|
|
243
242
|
Object.entries(e).forEach(([r, s]) => t(s, r));
|
|
244
243
|
}
|
|
245
|
-
function
|
|
244
|
+
function ue(e, t) {
|
|
246
245
|
return e.indexOf(t) !== -1;
|
|
247
246
|
}
|
|
248
|
-
function
|
|
247
|
+
function He(e, t) {
|
|
249
248
|
for (let r = 0; r < e.length; r++) {
|
|
250
249
|
const s = e[r];
|
|
251
250
|
if (t(s))
|
|
252
251
|
return s;
|
|
253
252
|
}
|
|
254
253
|
}
|
|
255
|
-
class
|
|
254
|
+
class Ts {
|
|
256
255
|
constructor() {
|
|
257
256
|
this.transfomers = {};
|
|
258
257
|
}
|
|
@@ -260,13 +259,13 @@ class ys {
|
|
|
260
259
|
this.transfomers[t.name] = t;
|
|
261
260
|
}
|
|
262
261
|
findApplicable(t) {
|
|
263
|
-
return
|
|
262
|
+
return As(this.transfomers, (r) => r.isApplicable(t));
|
|
264
263
|
}
|
|
265
264
|
findByName(t) {
|
|
266
265
|
return this.transfomers[t];
|
|
267
266
|
}
|
|
268
267
|
}
|
|
269
|
-
const
|
|
268
|
+
const ws = (e) => Object.prototype.toString.call(e).slice(8, -1), St = (e) => typeof e == "undefined", Ss = (e) => e === null, Z = (e) => typeof e != "object" || e === null || e === Object.prototype ? !1 : Object.getPrototypeOf(e) === null ? !0 : Object.getPrototypeOf(e) === Object.prototype, Oe = (e) => Z(e) && Object.keys(e).length === 0, k = (e) => Array.isArray(e), Cs = (e) => typeof e == "string", Os = (e) => typeof e == "number" && !isNaN(e), $s = (e) => typeof e == "boolean", qs = (e) => e instanceof RegExp, ee = (e) => e instanceof Map, te = (e) => e instanceof Set, Ct = (e) => ws(e) === "Symbol", Ds = (e) => e instanceof Date && !isNaN(e.valueOf()), xs = (e) => e instanceof Error, Qe = (e) => typeof e == "number" && isNaN(e), Ns = (e) => $s(e) || Ss(e) || St(e) || Os(e) || Cs(e) || Ct(e), vs = (e) => typeof e == "bigint", Ms = (e) => e === 1 / 0 || e === -1 / 0, Rs = (e) => ArrayBuffer.isView(e) && !(e instanceof DataView), Is = (e) => e instanceof URL, Ot = (e) => e.replace(/\./g, "\\."), Ae = (e) => e.map(String).map(Ot).join("."), Q = (e) => {
|
|
270
269
|
const t = [];
|
|
271
270
|
let r = "";
|
|
272
271
|
for (let n = 0; n < e.length; n++) {
|
|
@@ -292,12 +291,12 @@ function I(e, t, r, s) {
|
|
|
292
291
|
untransform: s
|
|
293
292
|
};
|
|
294
293
|
}
|
|
295
|
-
const
|
|
296
|
-
I(
|
|
294
|
+
const $t = [
|
|
295
|
+
I(St, "undefined", () => null, () => {
|
|
297
296
|
}),
|
|
298
|
-
I(
|
|
299
|
-
I(
|
|
300
|
-
I(
|
|
297
|
+
I(vs, "bigint", (e) => e.toString(), (e) => typeof BigInt != "undefined" ? BigInt(e) : (console.error("Please add a BigInt polyfill."), e)),
|
|
298
|
+
I(Ds, "Date", (e) => e.toISOString(), (e) => new Date(e)),
|
|
299
|
+
I(xs, "Error", (e, t) => {
|
|
301
300
|
const r = {
|
|
302
301
|
name: e.name,
|
|
303
302
|
message: e.message
|
|
@@ -311,24 +310,24 @@ const At = [
|
|
|
311
310
|
r[s] = e[s];
|
|
312
311
|
}), r;
|
|
313
312
|
}),
|
|
314
|
-
I(
|
|
313
|
+
I(qs, "regexp", (e) => "" + e, (e) => {
|
|
315
314
|
const t = e.slice(1, e.lastIndexOf("/")), r = e.slice(e.lastIndexOf("/") + 1);
|
|
316
315
|
return new RegExp(t, r);
|
|
317
316
|
}),
|
|
318
317
|
I(
|
|
319
|
-
|
|
318
|
+
te,
|
|
320
319
|
"set",
|
|
321
320
|
// (sets only exist in es6+)
|
|
322
321
|
// eslint-disable-next-line es5/no-es6-methods
|
|
323
322
|
(e) => [...e.values()],
|
|
324
323
|
(e) => new Set(e)
|
|
325
324
|
),
|
|
326
|
-
I(
|
|
327
|
-
I((e) =>
|
|
325
|
+
I(ee, "map", (e) => [...e.entries()], (e) => new Map(e)),
|
|
326
|
+
I((e) => Qe(e) || Ms(e), "number", (e) => Qe(e) ? "NaN" : e > 0 ? "Infinity" : "-Infinity", Number),
|
|
328
327
|
I((e) => e === 0 && 1 / e === -1 / 0, "number", () => "-0", Number),
|
|
329
|
-
I(
|
|
328
|
+
I(Is, "URL", (e) => e.toString(), (e) => new URL(e))
|
|
330
329
|
];
|
|
331
|
-
function
|
|
330
|
+
function pe(e, t, r, s) {
|
|
332
331
|
return {
|
|
333
332
|
isApplicable: e,
|
|
334
333
|
annotation: t,
|
|
@@ -336,12 +335,12 @@ function de(e, t, r, s) {
|
|
|
336
335
|
untransform: s
|
|
337
336
|
};
|
|
338
337
|
}
|
|
339
|
-
const
|
|
338
|
+
const qt = pe((e, t) => Ct(e) ? !!t.symbolRegistry.getIdentifier(e) : !1, (e, t) => ["symbol", t.symbolRegistry.getIdentifier(e)], (e) => e.description, (e, t, r) => {
|
|
340
339
|
const s = r.symbolRegistry.getValue(t[1]);
|
|
341
340
|
if (!s)
|
|
342
341
|
throw new Error("Trying to deserialize unknown symbol");
|
|
343
342
|
return s;
|
|
344
|
-
}),
|
|
343
|
+
}), ks = [
|
|
345
344
|
Int8Array,
|
|
346
345
|
Uint8Array,
|
|
347
346
|
Int16Array,
|
|
@@ -351,16 +350,16 @@ const wt = de((e, t) => Et(e) ? !!t.symbolRegistry.getIdentifier(e) : !1, (e, t)
|
|
|
351
350
|
Float32Array,
|
|
352
351
|
Float64Array,
|
|
353
352
|
Uint8ClampedArray
|
|
354
|
-
].reduce((e, t) => (e[t.name] = t, e), {}),
|
|
355
|
-
const r =
|
|
353
|
+
].reduce((e, t) => (e[t.name] = t, e), {}), Dt = pe(Rs, (e) => ["typed-array", e.constructor.name], (e) => [...e], (e, t) => {
|
|
354
|
+
const r = ks[t[1]];
|
|
356
355
|
if (!r)
|
|
357
356
|
throw new Error("Trying to deserialize unknown typed array");
|
|
358
357
|
return new r(e);
|
|
359
358
|
});
|
|
360
|
-
function
|
|
359
|
+
function xt(e, t) {
|
|
361
360
|
return e != null && e.constructor ? !!t.classRegistry.getIdentifier(e.constructor) : !1;
|
|
362
361
|
}
|
|
363
|
-
const
|
|
362
|
+
const Nt = pe(xt, (e, t) => ["class", t.classRegistry.getIdentifier(e.constructor)], (e, t) => {
|
|
364
363
|
const r = t.classRegistry.getAllowedProps(e.constructor);
|
|
365
364
|
if (!r)
|
|
366
365
|
return l({}, e);
|
|
@@ -373,49 +372,49 @@ const Ct = de(St, (e, t) => ["class", t.classRegistry.getIdentifier(e.constructo
|
|
|
373
372
|
if (!s)
|
|
374
373
|
throw new Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);
|
|
375
374
|
return Object.assign(Object.create(s.prototype), e);
|
|
376
|
-
}),
|
|
375
|
+
}), vt = pe((e, t) => !!t.customTransformerRegistry.findApplicable(e), (e, t) => ["custom", t.customTransformerRegistry.findApplicable(e).name], (e, t) => t.customTransformerRegistry.findApplicable(e).serialize(e), (e, t, r) => {
|
|
377
376
|
const s = r.customTransformerRegistry.findByName(t[1]);
|
|
378
377
|
if (!s)
|
|
379
378
|
throw new Error("Trying to deserialize unknown custom value");
|
|
380
379
|
return s.deserialize(e);
|
|
381
|
-
}),
|
|
382
|
-
const r =
|
|
380
|
+
}), Ls = [Nt, qt, vt, Dt], Xe = (e, t) => {
|
|
381
|
+
const r = He(Ls, (n) => n.isApplicable(e, t));
|
|
383
382
|
if (r)
|
|
384
383
|
return {
|
|
385
384
|
value: r.transform(e, t),
|
|
386
385
|
type: r.annotation(e, t)
|
|
387
386
|
};
|
|
388
|
-
const s =
|
|
387
|
+
const s = He($t, (n) => n.isApplicable(e, t));
|
|
389
388
|
if (s)
|
|
390
389
|
return {
|
|
391
390
|
value: s.transform(e, t),
|
|
392
391
|
type: s.annotation
|
|
393
392
|
};
|
|
394
|
-
},
|
|
395
|
-
|
|
396
|
-
|
|
393
|
+
}, Mt = {};
|
|
394
|
+
$t.forEach((e) => {
|
|
395
|
+
Mt[e.annotation] = e;
|
|
397
396
|
});
|
|
398
|
-
const
|
|
397
|
+
const Bs = (e, t, r) => {
|
|
399
398
|
if (k(t))
|
|
400
399
|
switch (t[0]) {
|
|
401
400
|
case "symbol":
|
|
402
|
-
return
|
|
401
|
+
return qt.untransform(e, t, r);
|
|
403
402
|
case "class":
|
|
404
|
-
return
|
|
403
|
+
return Nt.untransform(e, t, r);
|
|
405
404
|
case "custom":
|
|
406
|
-
return
|
|
405
|
+
return vt.untransform(e, t, r);
|
|
407
406
|
case "typed-array":
|
|
408
|
-
return
|
|
407
|
+
return Dt.untransform(e, t, r);
|
|
409
408
|
default:
|
|
410
409
|
throw new Error("Unknown transformation: " + t);
|
|
411
410
|
}
|
|
412
411
|
else {
|
|
413
|
-
const s =
|
|
412
|
+
const s = Mt[t];
|
|
414
413
|
if (!s)
|
|
415
414
|
throw new Error("Unknown transformation: " + t);
|
|
416
415
|
return s.untransform(e, r);
|
|
417
416
|
}
|
|
418
|
-
},
|
|
417
|
+
}, j = (e, t) => {
|
|
419
418
|
if (t > e.size)
|
|
420
419
|
throw new Error("index out of bounds");
|
|
421
420
|
const r = e.keys();
|
|
@@ -423,52 +422,52 @@ const Ns = (e, t, r) => {
|
|
|
423
422
|
r.next(), t--;
|
|
424
423
|
return r.next().value;
|
|
425
424
|
};
|
|
426
|
-
function
|
|
427
|
-
if (
|
|
425
|
+
function Rt(e) {
|
|
426
|
+
if (ue(e, "__proto__"))
|
|
428
427
|
throw new Error("__proto__ is not allowed as a property");
|
|
429
|
-
if (
|
|
428
|
+
if (ue(e, "prototype"))
|
|
430
429
|
throw new Error("prototype is not allowed as a property");
|
|
431
|
-
if (
|
|
430
|
+
if (ue(e, "constructor"))
|
|
432
431
|
throw new Error("constructor is not allowed as a property");
|
|
433
432
|
}
|
|
434
|
-
const
|
|
435
|
-
|
|
433
|
+
const _s = (e, t) => {
|
|
434
|
+
Rt(t);
|
|
436
435
|
for (let r = 0; r < t.length; r++) {
|
|
437
436
|
const s = t[r];
|
|
438
|
-
if (
|
|
439
|
-
e =
|
|
440
|
-
else if (
|
|
441
|
-
const n = +s, i = +t[++r] == 0 ? "key" : "value",
|
|
437
|
+
if (te(e))
|
|
438
|
+
e = j(e, +s);
|
|
439
|
+
else if (ee(e)) {
|
|
440
|
+
const n = +s, i = +t[++r] == 0 ? "key" : "value", a = j(e, n);
|
|
442
441
|
switch (i) {
|
|
443
442
|
case "key":
|
|
444
|
-
e =
|
|
443
|
+
e = a;
|
|
445
444
|
break;
|
|
446
445
|
case "value":
|
|
447
|
-
e = e.get(
|
|
446
|
+
e = e.get(a);
|
|
448
447
|
break;
|
|
449
448
|
}
|
|
450
449
|
} else
|
|
451
450
|
e = e[s];
|
|
452
451
|
}
|
|
453
452
|
return e;
|
|
454
|
-
},
|
|
455
|
-
if (
|
|
453
|
+
}, $e = (e, t, r) => {
|
|
454
|
+
if (Rt(t), t.length === 0)
|
|
456
455
|
return r(e);
|
|
457
456
|
let s = e;
|
|
458
457
|
for (let i = 0; i < t.length - 1; i++) {
|
|
459
|
-
const
|
|
458
|
+
const a = t[i];
|
|
460
459
|
if (k(s)) {
|
|
461
|
-
const
|
|
462
|
-
s = s[a];
|
|
463
|
-
} else if (H(s))
|
|
460
|
+
const o = +a;
|
|
464
461
|
s = s[o];
|
|
465
|
-
else if (
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
462
|
+
} else if (Z(s))
|
|
463
|
+
s = s[a];
|
|
464
|
+
else if (te(s)) {
|
|
465
|
+
const o = +a;
|
|
466
|
+
s = j(s, o);
|
|
467
|
+
} else if (ee(s)) {
|
|
469
468
|
if (i === t.length - 2)
|
|
470
469
|
break;
|
|
471
|
-
const u = +
|
|
470
|
+
const u = +a, c = +t[++i] == 0 ? "key" : "value", g = j(s, u);
|
|
472
471
|
switch (c) {
|
|
473
472
|
case "key":
|
|
474
473
|
s = g;
|
|
@@ -480,130 +479,130 @@ const Ms = (e, t) => {
|
|
|
480
479
|
}
|
|
481
480
|
}
|
|
482
481
|
const n = t[t.length - 1];
|
|
483
|
-
if (k(s) ? s[+n] = r(s[+n]) :
|
|
484
|
-
const i =
|
|
485
|
-
i !==
|
|
482
|
+
if (k(s) ? s[+n] = r(s[+n]) : Z(s) && (s[n] = r(s[n])), te(s)) {
|
|
483
|
+
const i = j(s, +n), a = r(i);
|
|
484
|
+
i !== a && (s.delete(i), s.add(a));
|
|
486
485
|
}
|
|
487
|
-
if (
|
|
488
|
-
const i = +t[t.length - 2],
|
|
486
|
+
if (ee(s)) {
|
|
487
|
+
const i = +t[t.length - 2], a = j(s, i);
|
|
489
488
|
switch (+n == 0 ? "key" : "value") {
|
|
490
489
|
case "key": {
|
|
491
|
-
const u = r(
|
|
492
|
-
s.set(u, s.get(
|
|
490
|
+
const u = r(a);
|
|
491
|
+
s.set(u, s.get(a)), u !== a && s.delete(a);
|
|
493
492
|
break;
|
|
494
493
|
}
|
|
495
494
|
case "value": {
|
|
496
|
-
s.set(
|
|
495
|
+
s.set(a, r(s.get(a)));
|
|
497
496
|
break;
|
|
498
497
|
}
|
|
499
498
|
}
|
|
500
499
|
}
|
|
501
500
|
return e;
|
|
502
501
|
};
|
|
503
|
-
function
|
|
502
|
+
function qe(e, t, r = []) {
|
|
504
503
|
if (!e)
|
|
505
504
|
return;
|
|
506
505
|
if (!k(e)) {
|
|
507
|
-
|
|
506
|
+
G(e, (i, a) => qe(i, t, [...r, ...Q(a)]));
|
|
508
507
|
return;
|
|
509
508
|
}
|
|
510
509
|
const [s, n] = e;
|
|
511
|
-
n &&
|
|
512
|
-
|
|
510
|
+
n && G(n, (i, a) => {
|
|
511
|
+
qe(i, t, [...r, ...Q(a)]);
|
|
513
512
|
}), t(s, r);
|
|
514
513
|
}
|
|
515
|
-
function
|
|
516
|
-
return
|
|
517
|
-
e =
|
|
514
|
+
function zs(e, t, r) {
|
|
515
|
+
return qe(t, (s, n) => {
|
|
516
|
+
e = $e(e, n, (i) => Bs(i, s, r));
|
|
518
517
|
}), e;
|
|
519
518
|
}
|
|
520
|
-
function
|
|
519
|
+
function Us(e, t) {
|
|
521
520
|
function r(s, n) {
|
|
522
|
-
const i =
|
|
523
|
-
s.map(
|
|
524
|
-
e =
|
|
521
|
+
const i = _s(e, Q(n));
|
|
522
|
+
s.map(Q).forEach((a) => {
|
|
523
|
+
e = $e(e, a, () => i);
|
|
525
524
|
});
|
|
526
525
|
}
|
|
527
526
|
if (k(t)) {
|
|
528
527
|
const [s, n] = t;
|
|
529
528
|
s.forEach((i) => {
|
|
530
|
-
e =
|
|
531
|
-
}), n &&
|
|
529
|
+
e = $e(e, Q(i), () => e);
|
|
530
|
+
}), n && G(n, r);
|
|
532
531
|
} else
|
|
533
|
-
|
|
532
|
+
G(t, r);
|
|
534
533
|
return e;
|
|
535
534
|
}
|
|
536
|
-
const
|
|
537
|
-
function
|
|
535
|
+
const Ps = (e, t) => Z(e) || k(e) || ee(e) || te(e) || xt(e, t);
|
|
536
|
+
function Ws(e, t, r) {
|
|
538
537
|
const s = r.get(e);
|
|
539
538
|
s ? s.push(t) : r.set(e, [t]);
|
|
540
539
|
}
|
|
541
|
-
function
|
|
540
|
+
function Vs(e, t) {
|
|
542
541
|
const r = {};
|
|
543
542
|
let s;
|
|
544
543
|
return e.forEach((n) => {
|
|
545
544
|
if (n.length <= 1)
|
|
546
545
|
return;
|
|
547
|
-
t || (n = n.map((
|
|
548
|
-
const [i, ...
|
|
549
|
-
i.length === 0 ? s =
|
|
550
|
-
}), s ?
|
|
546
|
+
t || (n = n.map((o) => o.map(String)).sort((o, u) => o.length - u.length));
|
|
547
|
+
const [i, ...a] = n;
|
|
548
|
+
i.length === 0 ? s = a.map(Ae) : r[Ae(i)] = a.map(Ae);
|
|
549
|
+
}), s ? Oe(r) ? [s] : [s, r] : Oe(r) ? void 0 : r;
|
|
551
550
|
}
|
|
552
|
-
const
|
|
551
|
+
const It = (e, t, r, s, n = [], i = [], a = /* @__PURE__ */ new Map()) => {
|
|
553
552
|
var h;
|
|
554
|
-
const
|
|
555
|
-
if (!
|
|
556
|
-
|
|
557
|
-
const b =
|
|
553
|
+
const o = Ns(e);
|
|
554
|
+
if (!o) {
|
|
555
|
+
Ws(e, n, t);
|
|
556
|
+
const b = a.get(e);
|
|
558
557
|
if (b)
|
|
559
558
|
return s ? {
|
|
560
559
|
transformedValue: null
|
|
561
560
|
} : b;
|
|
562
561
|
}
|
|
563
|
-
if (!
|
|
564
|
-
const b =
|
|
562
|
+
if (!Ps(e, r)) {
|
|
563
|
+
const b = Xe(e, r), m = b ? {
|
|
565
564
|
transformedValue: b.value,
|
|
566
565
|
annotations: [b.type]
|
|
567
566
|
} : {
|
|
568
567
|
transformedValue: e
|
|
569
568
|
};
|
|
570
|
-
return
|
|
569
|
+
return o || a.set(e, m), m;
|
|
571
570
|
}
|
|
572
|
-
if (
|
|
571
|
+
if (ue(i, e))
|
|
573
572
|
return {
|
|
574
573
|
transformedValue: null
|
|
575
574
|
};
|
|
576
|
-
const u =
|
|
577
|
-
|
|
578
|
-
if (
|
|
579
|
-
throw new Error(`Detected property ${
|
|
580
|
-
const
|
|
581
|
-
g[
|
|
582
|
-
|
|
575
|
+
const u = Xe(e, r), c = (h = u == null ? void 0 : u.value) != null ? h : e, g = k(c) ? [] : {}, f = {};
|
|
576
|
+
G(c, (b, m) => {
|
|
577
|
+
if (m === "__proto__" || m === "constructor" || m === "prototype")
|
|
578
|
+
throw new Error(`Detected property ${m}. This is a prototype pollution risk, please remove it from your object.`);
|
|
579
|
+
const F = It(b, t, r, s, [...n, m], [...i, e], a);
|
|
580
|
+
g[m] = F.transformedValue, k(F.annotations) ? f[m] = F.annotations : Z(F.annotations) && G(F.annotations, (O, N) => {
|
|
581
|
+
f[Ot(m) + "." + N] = O;
|
|
583
582
|
});
|
|
584
583
|
});
|
|
585
|
-
const
|
|
584
|
+
const p = Oe(f) ? {
|
|
586
585
|
transformedValue: g,
|
|
587
586
|
annotations: u ? [u.type] : void 0
|
|
588
587
|
} : {
|
|
589
588
|
transformedValue: g,
|
|
590
|
-
annotations: u ? [u.type,
|
|
589
|
+
annotations: u ? [u.type, f] : f
|
|
591
590
|
};
|
|
592
|
-
return
|
|
591
|
+
return o || a.set(e, p), p;
|
|
593
592
|
};
|
|
594
|
-
function
|
|
593
|
+
function kt(e) {
|
|
595
594
|
return Object.prototype.toString.call(e).slice(8, -1);
|
|
596
595
|
}
|
|
597
|
-
function
|
|
598
|
-
return
|
|
596
|
+
function Ze(e) {
|
|
597
|
+
return kt(e) === "Array";
|
|
599
598
|
}
|
|
600
|
-
function
|
|
601
|
-
if (
|
|
599
|
+
function js(e) {
|
|
600
|
+
if (kt(e) !== "Object")
|
|
602
601
|
return !1;
|
|
603
602
|
const t = Object.getPrototypeOf(e);
|
|
604
603
|
return !!t && t.constructor === Object && t === Object.prototype;
|
|
605
604
|
}
|
|
606
|
-
function
|
|
605
|
+
function Js(e, t, r, s, n) {
|
|
607
606
|
const i = {}.propertyIsEnumerable.call(s, t) ? "enumerable" : "nonenumerable";
|
|
608
607
|
i === "enumerable" && (e[t] = r), n && i === "nonenumerable" && Object.defineProperty(e, t, {
|
|
609
608
|
value: r,
|
|
@@ -612,17 +611,17 @@ function Us(e, t, r, s, n) {
|
|
|
612
611
|
configurable: !0
|
|
613
612
|
});
|
|
614
613
|
}
|
|
615
|
-
function
|
|
616
|
-
if (
|
|
617
|
-
return e.map((n) =>
|
|
618
|
-
if (!
|
|
614
|
+
function De(e, t = {}) {
|
|
615
|
+
if (Ze(e))
|
|
616
|
+
return e.map((n) => De(n, t));
|
|
617
|
+
if (!js(e))
|
|
619
618
|
return e;
|
|
620
619
|
const r = Object.getOwnPropertyNames(e), s = Object.getOwnPropertySymbols(e);
|
|
621
620
|
return [...r, ...s].reduce((n, i) => {
|
|
622
|
-
if (
|
|
621
|
+
if (Ze(t.props) && !t.props.includes(i))
|
|
623
622
|
return n;
|
|
624
|
-
const
|
|
625
|
-
return
|
|
623
|
+
const a = e[i], o = De(a, t);
|
|
624
|
+
return Js(n, i, o, e, t.nonenumerable), n;
|
|
626
625
|
}, {});
|
|
627
626
|
}
|
|
628
627
|
class y {
|
|
@@ -630,27 +629,27 @@ class y {
|
|
|
630
629
|
* @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.
|
|
631
630
|
*/
|
|
632
631
|
constructor({ dedupe: t = !1 } = {}) {
|
|
633
|
-
this.classRegistry = new
|
|
632
|
+
this.classRegistry = new Fs(), this.symbolRegistry = new wt((r) => {
|
|
634
633
|
var s;
|
|
635
634
|
return (s = r.description) != null ? s : "";
|
|
636
|
-
}), this.customTransformerRegistry = new
|
|
635
|
+
}), this.customTransformerRegistry = new Ts(), this.allowedErrorProps = [], this.dedupe = t;
|
|
637
636
|
}
|
|
638
637
|
serialize(t) {
|
|
639
|
-
const r = /* @__PURE__ */ new Map(), s =
|
|
638
|
+
const r = /* @__PURE__ */ new Map(), s = It(t, r, this, this.dedupe), n = {
|
|
640
639
|
json: s.transformedValue
|
|
641
640
|
};
|
|
642
|
-
s.annotations && (n.meta =
|
|
641
|
+
s.annotations && (n.meta = E(l({}, n.meta), {
|
|
643
642
|
values: s.annotations
|
|
644
643
|
}));
|
|
645
|
-
const i =
|
|
646
|
-
return i && (n.meta =
|
|
644
|
+
const i = Vs(r, this.dedupe);
|
|
645
|
+
return i && (n.meta = E(l({}, n.meta), {
|
|
647
646
|
referentialEqualities: i
|
|
648
647
|
})), n;
|
|
649
648
|
}
|
|
650
649
|
deserialize(t) {
|
|
651
650
|
const { json: r, meta: s } = t;
|
|
652
|
-
let n =
|
|
653
|
-
return s != null && s.values && (n =
|
|
651
|
+
let n = De(r);
|
|
652
|
+
return s != null && s.values && (n = zs(n, s.values, this)), s != null && s.referentialEqualities && (n = Us(n, s.referentialEqualities)), n;
|
|
654
653
|
}
|
|
655
654
|
stringify(t) {
|
|
656
655
|
return JSON.stringify(this.serialize(t));
|
|
@@ -682,15 +681,22 @@ y.registerClass = y.defaultInstance.registerClass.bind(y.defaultInstance);
|
|
|
682
681
|
y.registerSymbol = y.defaultInstance.registerSymbol.bind(y.defaultInstance);
|
|
683
682
|
y.registerCustom = y.defaultInstance.registerCustom.bind(y.defaultInstance);
|
|
684
683
|
y.allowErrorProps = y.defaultInstance.allowErrorProps.bind(y.defaultInstance);
|
|
685
|
-
const P = (e) => e === void 0 ?
|
|
684
|
+
const P = (e) => e === void 0 ? z.None : e, W = (e) => {
|
|
685
|
+
var t, r;
|
|
686
|
+
return (r = (t = e.title) != null ? t : e.name) != null ? r : "";
|
|
687
|
+
}, Ks = (e) => new mr(e.metadataItem, e.type), Ie = (e) => new vr(
|
|
686
688
|
e.name,
|
|
687
689
|
e.expression,
|
|
688
690
|
e.type,
|
|
689
691
|
e.description,
|
|
690
692
|
P(e.sort),
|
|
691
693
|
e.dataSource,
|
|
692
|
-
e.composeCode
|
|
693
|
-
|
|
694
|
+
e.composeCode,
|
|
695
|
+
e.panel,
|
|
696
|
+
e.indexed,
|
|
697
|
+
e.merged,
|
|
698
|
+
W(e)
|
|
699
|
+
), ke = (e) => new Mr(
|
|
694
700
|
e.name,
|
|
695
701
|
e.expression,
|
|
696
702
|
e.granularity,
|
|
@@ -698,28 +704,33 @@ const P = (e) => e === void 0 ? U.None : e, _s = (e) => new ar(e.metadataItem, e
|
|
|
698
704
|
e.description,
|
|
699
705
|
P(e.sort),
|
|
700
706
|
e.dataSource,
|
|
701
|
-
e.composeCode
|
|
702
|
-
|
|
707
|
+
e.composeCode,
|
|
708
|
+
e.panel,
|
|
709
|
+
e.indexed,
|
|
710
|
+
e.merged,
|
|
711
|
+
W(e)
|
|
712
|
+
), v = (e) => {
|
|
703
713
|
switch (e.__serializable) {
|
|
704
714
|
case "DimensionalAttribute":
|
|
705
|
-
return
|
|
715
|
+
return Ie(e);
|
|
706
716
|
case "DimensionalLevelAttribute":
|
|
707
|
-
return
|
|
717
|
+
return ke(e);
|
|
708
718
|
default:
|
|
709
719
|
return e;
|
|
710
720
|
}
|
|
711
|
-
},
|
|
721
|
+
}, Lt = (e) => new Rr(
|
|
712
722
|
e.name,
|
|
713
723
|
e.expression,
|
|
714
|
-
e.attributes.map(
|
|
715
|
-
e.dimensions.map(
|
|
724
|
+
e.attributes.map(v),
|
|
725
|
+
e.dimensions.map(Gs),
|
|
716
726
|
e.type,
|
|
717
727
|
e.description,
|
|
718
728
|
P(e.sort),
|
|
719
729
|
e.dataSource,
|
|
720
730
|
e.composeCode,
|
|
721
|
-
e.defaultAttribute ?
|
|
722
|
-
|
|
731
|
+
e.defaultAttribute ? v(e.defaultAttribute) : void 0,
|
|
732
|
+
W(e)
|
|
733
|
+
), Bt = (e) => new Ir(
|
|
723
734
|
e.name,
|
|
724
735
|
e.expression,
|
|
725
736
|
e.description,
|
|
@@ -727,45 +738,62 @@ const P = (e) => e === void 0 ? U.None : e, _s = (e) => new ar(e.metadataItem, e
|
|
|
727
738
|
e.dataSource,
|
|
728
739
|
e.composeCode,
|
|
729
740
|
e.indexed,
|
|
730
|
-
e.merged
|
|
731
|
-
|
|
741
|
+
e.merged,
|
|
742
|
+
W(e)
|
|
743
|
+
), Gs = (e) => {
|
|
732
744
|
switch (e.__serializable) {
|
|
733
745
|
case "DimensionalDimension":
|
|
734
|
-
return
|
|
746
|
+
return Lt(e);
|
|
735
747
|
case "DimensionalDateDimension":
|
|
736
|
-
return
|
|
748
|
+
return Bt(e);
|
|
737
749
|
default:
|
|
738
750
|
return e;
|
|
739
751
|
}
|
|
740
|
-
},
|
|
752
|
+
}, Le = (e) => new kr(
|
|
741
753
|
e.name,
|
|
742
|
-
|
|
754
|
+
v(e.attribute),
|
|
743
755
|
e.aggregation,
|
|
744
756
|
e.format,
|
|
745
757
|
e.description,
|
|
746
758
|
P(e.sort),
|
|
747
759
|
e.dataSource,
|
|
748
|
-
e.composeCode
|
|
749
|
-
|
|
760
|
+
e.composeCode,
|
|
761
|
+
W(e)
|
|
762
|
+
), Be = (e) => {
|
|
750
763
|
const t = Object.fromEntries(
|
|
751
764
|
Object.entries(e.context).map(([r, s]) => {
|
|
752
765
|
if (s && typeof s == "object" && "__serializable" in s)
|
|
753
766
|
switch (s.__serializable) {
|
|
754
767
|
case "DimensionalAttribute":
|
|
755
|
-
return [r,
|
|
768
|
+
return [r, Ie(s)];
|
|
756
769
|
case "DimensionalLevelAttribute":
|
|
757
|
-
return [r,
|
|
770
|
+
return [r, ke(s)];
|
|
758
771
|
case "DimensionalBaseMeasure":
|
|
759
|
-
return [r,
|
|
772
|
+
return [r, Le(s)];
|
|
760
773
|
case "DimensionalCalculatedMeasure":
|
|
761
|
-
return [r,
|
|
774
|
+
return [r, Be(s)];
|
|
775
|
+
case "DimensionalMeasureTemplate":
|
|
776
|
+
return [r, _e(s)];
|
|
777
|
+
case "MembersFilter":
|
|
778
|
+
case "LogicalAttributeFilter":
|
|
779
|
+
case "CascadingFilter":
|
|
780
|
+
case "ExcludeFilter":
|
|
781
|
+
case "MeasureFilter":
|
|
782
|
+
case "RankingFilter":
|
|
783
|
+
case "MeasureRankingFilter":
|
|
784
|
+
case "NumericFilter":
|
|
785
|
+
case "TextFilter":
|
|
786
|
+
case "DateRangeFilter":
|
|
787
|
+
case "RelativeDateFilter":
|
|
788
|
+
case "CustomFilter":
|
|
789
|
+
return [r, S(s)];
|
|
762
790
|
default:
|
|
763
791
|
return [r, s];
|
|
764
792
|
}
|
|
765
793
|
return [r, s];
|
|
766
794
|
})
|
|
767
795
|
);
|
|
768
|
-
return new
|
|
796
|
+
return new Lr(
|
|
769
797
|
e.name,
|
|
770
798
|
e.expression,
|
|
771
799
|
t,
|
|
@@ -773,60 +801,62 @@ const P = (e) => e === void 0 ? U.None : e, _s = (e) => new ar(e.metadataItem, e
|
|
|
773
801
|
e.description,
|
|
774
802
|
P(e.sort),
|
|
775
803
|
e.dataSource,
|
|
776
|
-
e.composeCode
|
|
804
|
+
e.composeCode,
|
|
805
|
+
W(e)
|
|
777
806
|
);
|
|
778
|
-
},
|
|
807
|
+
}, _e = (e) => new Br(
|
|
779
808
|
e.name,
|
|
780
|
-
|
|
809
|
+
v(e.attribute),
|
|
781
810
|
e.format,
|
|
782
811
|
e.description,
|
|
783
812
|
P(e.sort),
|
|
784
813
|
e.dataSource,
|
|
785
|
-
e.composeCode
|
|
786
|
-
|
|
814
|
+
e.composeCode,
|
|
815
|
+
W(e)
|
|
816
|
+
), Te = (e) => {
|
|
787
817
|
switch (e.__serializable) {
|
|
788
818
|
case "DimensionalBaseMeasure":
|
|
789
|
-
return
|
|
819
|
+
return Le(e);
|
|
790
820
|
case "DimensionalCalculatedMeasure":
|
|
791
|
-
return
|
|
821
|
+
return Be(e);
|
|
792
822
|
case "DimensionalMeasureTemplate":
|
|
793
|
-
return
|
|
823
|
+
return _e(e);
|
|
794
824
|
default:
|
|
795
825
|
return e;
|
|
796
826
|
}
|
|
797
827
|
}, S = (e) => {
|
|
798
828
|
switch (e.__serializable) {
|
|
799
829
|
case "MembersFilter":
|
|
800
|
-
return new
|
|
801
|
-
|
|
830
|
+
return new Hr(
|
|
831
|
+
v(e.attribute),
|
|
802
832
|
e.members,
|
|
803
|
-
e.config.backgroundFilter ?
|
|
833
|
+
e.config.backgroundFilter ? E(l({}, e.config), { backgroundFilter: S(e.config.backgroundFilter) }) : e.config,
|
|
804
834
|
e.composeCode
|
|
805
835
|
);
|
|
806
836
|
case "LogicalAttributeFilter":
|
|
807
|
-
return new
|
|
837
|
+
return new Yr(
|
|
808
838
|
e.filters.map((r) => S(r)),
|
|
809
839
|
e.operator,
|
|
810
840
|
e.config,
|
|
811
841
|
e.composeCode
|
|
812
842
|
);
|
|
813
843
|
case "CascadingFilter":
|
|
814
|
-
return new
|
|
844
|
+
return new Gr(
|
|
815
845
|
e._filters.map((r) => S(r)),
|
|
816
846
|
e.config,
|
|
817
847
|
e.composeCode
|
|
818
848
|
);
|
|
819
849
|
case "ExcludeFilter":
|
|
820
|
-
return new
|
|
850
|
+
return new Kr(
|
|
821
851
|
S(e.filter),
|
|
822
852
|
e.input ? S(e.input) : void 0,
|
|
823
853
|
e.config,
|
|
824
854
|
e.composeCode
|
|
825
855
|
);
|
|
826
856
|
case "MeasureFilter":
|
|
827
|
-
return new
|
|
828
|
-
|
|
829
|
-
|
|
857
|
+
return new Jr(
|
|
858
|
+
v(e.attribute),
|
|
859
|
+
Te(e.measure),
|
|
830
860
|
e.operatorA,
|
|
831
861
|
e.valueA,
|
|
832
862
|
e.operatorB,
|
|
@@ -835,25 +865,25 @@ const P = (e) => e === void 0 ? U.None : e, _s = (e) => new ar(e.metadataItem, e
|
|
|
835
865
|
e.composeCode
|
|
836
866
|
);
|
|
837
867
|
case "RankingFilter":
|
|
838
|
-
return new
|
|
839
|
-
|
|
840
|
-
|
|
868
|
+
return new jr(
|
|
869
|
+
v(e.attribute),
|
|
870
|
+
Te(e.measure),
|
|
841
871
|
e.operator,
|
|
842
872
|
e.count,
|
|
843
873
|
e.config,
|
|
844
874
|
e.composeCode
|
|
845
875
|
);
|
|
846
876
|
case "MeasureRankingFilter":
|
|
847
|
-
return new
|
|
848
|
-
|
|
877
|
+
return new Vr(
|
|
878
|
+
Te(e.measure),
|
|
849
879
|
e.operator,
|
|
850
880
|
e.count,
|
|
851
881
|
e.config,
|
|
852
882
|
e.composeCode
|
|
853
883
|
);
|
|
854
884
|
case "NumericFilter":
|
|
855
|
-
return new
|
|
856
|
-
|
|
885
|
+
return new Wr(
|
|
886
|
+
v(e.attribute),
|
|
857
887
|
e.operatorA,
|
|
858
888
|
e.valueA,
|
|
859
889
|
e.operatorB,
|
|
@@ -862,8 +892,8 @@ const P = (e) => e === void 0 ? U.None : e, _s = (e) => new ar(e.metadataItem, e
|
|
|
862
892
|
e.composeCode
|
|
863
893
|
);
|
|
864
894
|
case "TextFilter":
|
|
865
|
-
return new
|
|
866
|
-
|
|
895
|
+
return new Pr(
|
|
896
|
+
v(e.attribute),
|
|
867
897
|
e.operatorA,
|
|
868
898
|
e.valueA,
|
|
869
899
|
e.config,
|
|
@@ -871,8 +901,8 @@ const P = (e) => e === void 0 ? U.None : e, _s = (e) => new ar(e.metadataItem, e
|
|
|
871
901
|
);
|
|
872
902
|
case "DateRangeFilter": {
|
|
873
903
|
const { valueA: r, valueB: s } = e;
|
|
874
|
-
return new
|
|
875
|
-
|
|
904
|
+
return new Ur(
|
|
905
|
+
v(e.attribute),
|
|
876
906
|
r,
|
|
877
907
|
s,
|
|
878
908
|
e.config,
|
|
@@ -880,8 +910,8 @@ const P = (e) => e === void 0 ? U.None : e, _s = (e) => new ar(e.metadataItem, e
|
|
|
880
910
|
);
|
|
881
911
|
}
|
|
882
912
|
case "RelativeDateFilter":
|
|
883
|
-
return new
|
|
884
|
-
|
|
913
|
+
return new zr(
|
|
914
|
+
v(e.attribute),
|
|
885
915
|
e.offset,
|
|
886
916
|
e.count,
|
|
887
917
|
e.operator,
|
|
@@ -890,8 +920,8 @@ const P = (e) => e === void 0 ? U.None : e, _s = (e) => new ar(e.metadataItem, e
|
|
|
890
920
|
e.composeCode
|
|
891
921
|
);
|
|
892
922
|
case "CustomFilter":
|
|
893
|
-
return new
|
|
894
|
-
|
|
923
|
+
return new _r(
|
|
924
|
+
v(e.attribute),
|
|
895
925
|
e.jaqlExpression,
|
|
896
926
|
e.config,
|
|
897
927
|
e.composeCode
|
|
@@ -902,71 +932,71 @@ const P = (e) => e === void 0 ? U.None : e, _s = (e) => new ar(e.metadataItem, e
|
|
|
902
932
|
};
|
|
903
933
|
y.registerCustom(
|
|
904
934
|
{
|
|
905
|
-
isApplicable:
|
|
935
|
+
isApplicable: dr,
|
|
906
936
|
serialize: (e) => e.serialize(),
|
|
907
|
-
deserialize: (e) =>
|
|
937
|
+
deserialize: (e) => Ks(e)
|
|
908
938
|
},
|
|
909
939
|
"JaqlElement"
|
|
910
940
|
);
|
|
911
941
|
y.registerCustom(
|
|
912
942
|
{
|
|
913
|
-
isApplicable:
|
|
943
|
+
isApplicable: pr,
|
|
914
944
|
serialize: (e) => e.serialize(),
|
|
915
|
-
deserialize: (e) =>
|
|
945
|
+
deserialize: (e) => Ie(e)
|
|
916
946
|
},
|
|
917
947
|
"DimensionalAttribute"
|
|
918
948
|
);
|
|
919
949
|
y.registerCustom(
|
|
920
950
|
{
|
|
921
|
-
isApplicable:
|
|
951
|
+
isApplicable: gr,
|
|
922
952
|
serialize: (e) => e.serialize(),
|
|
923
|
-
deserialize: (e) =>
|
|
953
|
+
deserialize: (e) => ke(e)
|
|
924
954
|
},
|
|
925
955
|
"DimensionalLevelAttribute"
|
|
926
956
|
);
|
|
927
957
|
y.registerCustom(
|
|
928
958
|
{
|
|
929
|
-
isApplicable:
|
|
959
|
+
isApplicable: yr,
|
|
930
960
|
serialize: (e) => e.serialize(),
|
|
931
|
-
deserialize: (e) =>
|
|
961
|
+
deserialize: (e) => Lt(e)
|
|
932
962
|
},
|
|
933
963
|
"DimensionalDimension"
|
|
934
964
|
);
|
|
935
965
|
y.registerCustom(
|
|
936
966
|
{
|
|
937
|
-
isApplicable:
|
|
967
|
+
isApplicable: hr,
|
|
938
968
|
serialize: (e) => e.serialize(),
|
|
939
|
-
deserialize: (e) =>
|
|
969
|
+
deserialize: (e) => Bt(e)
|
|
940
970
|
},
|
|
941
971
|
"DimensionalDateDimension"
|
|
942
972
|
);
|
|
943
973
|
y.registerCustom(
|
|
944
974
|
{
|
|
945
|
-
isApplicable:
|
|
975
|
+
isApplicable: br,
|
|
946
976
|
serialize: (e) => e.serialize(),
|
|
947
|
-
deserialize: (e) =>
|
|
977
|
+
deserialize: (e) => Le(e)
|
|
948
978
|
},
|
|
949
979
|
"DimensionalBaseMeasure"
|
|
950
980
|
);
|
|
951
981
|
y.registerCustom(
|
|
952
982
|
{
|
|
953
|
-
isApplicable:
|
|
983
|
+
isApplicable: Fr,
|
|
954
984
|
serialize: (e) => e.serialize(),
|
|
955
|
-
deserialize: (e) =>
|
|
985
|
+
deserialize: (e) => Be(e)
|
|
956
986
|
},
|
|
957
987
|
"DimensionalCalculatedMeasure"
|
|
958
988
|
);
|
|
959
989
|
y.registerCustom(
|
|
960
990
|
{
|
|
961
|
-
isApplicable:
|
|
991
|
+
isApplicable: Er,
|
|
962
992
|
serialize: (e) => e.serialize(),
|
|
963
|
-
deserialize: (e) =>
|
|
993
|
+
deserialize: (e) => _e(e)
|
|
964
994
|
},
|
|
965
995
|
"DimensionalMeasureTemplate"
|
|
966
996
|
);
|
|
967
997
|
y.registerCustom(
|
|
968
998
|
{
|
|
969
|
-
isApplicable:
|
|
999
|
+
isApplicable: Me,
|
|
970
1000
|
serialize: (e) => e.serialize(),
|
|
971
1001
|
deserialize: (e) => S(e)
|
|
972
1002
|
},
|
|
@@ -974,7 +1004,7 @@ y.registerCustom(
|
|
|
974
1004
|
);
|
|
975
1005
|
y.registerCustom(
|
|
976
1006
|
{
|
|
977
|
-
isApplicable:
|
|
1007
|
+
isApplicable: Ar,
|
|
978
1008
|
serialize: (e) => e.serialize(),
|
|
979
1009
|
deserialize: (e) => S(e)
|
|
980
1010
|
},
|
|
@@ -982,7 +1012,7 @@ y.registerCustom(
|
|
|
982
1012
|
);
|
|
983
1013
|
y.registerCustom(
|
|
984
1014
|
{
|
|
985
|
-
isApplicable:
|
|
1015
|
+
isApplicable: Tr,
|
|
986
1016
|
serialize: (e) => e.serialize(),
|
|
987
1017
|
deserialize: (e) => S(e)
|
|
988
1018
|
},
|
|
@@ -990,7 +1020,7 @@ y.registerCustom(
|
|
|
990
1020
|
);
|
|
991
1021
|
y.registerCustom(
|
|
992
1022
|
{
|
|
993
|
-
isApplicable:
|
|
1023
|
+
isApplicable: wr,
|
|
994
1024
|
serialize: (e) => e.serialize(),
|
|
995
1025
|
deserialize: (e) => S(e)
|
|
996
1026
|
},
|
|
@@ -998,7 +1028,7 @@ y.registerCustom(
|
|
|
998
1028
|
);
|
|
999
1029
|
y.registerCustom(
|
|
1000
1030
|
{
|
|
1001
|
-
isApplicable:
|
|
1031
|
+
isApplicable: Sr,
|
|
1002
1032
|
serialize: (e) => e.serialize(),
|
|
1003
1033
|
deserialize: (e) => S(e)
|
|
1004
1034
|
},
|
|
@@ -1006,7 +1036,7 @@ y.registerCustom(
|
|
|
1006
1036
|
);
|
|
1007
1037
|
y.registerCustom(
|
|
1008
1038
|
{
|
|
1009
|
-
isApplicable:
|
|
1039
|
+
isApplicable: Cr,
|
|
1010
1040
|
serialize: (e) => e.serialize(),
|
|
1011
1041
|
deserialize: (e) => S(e)
|
|
1012
1042
|
},
|
|
@@ -1014,7 +1044,7 @@ y.registerCustom(
|
|
|
1014
1044
|
);
|
|
1015
1045
|
y.registerCustom(
|
|
1016
1046
|
{
|
|
1017
|
-
isApplicable:
|
|
1047
|
+
isApplicable: Or,
|
|
1018
1048
|
serialize: (e) => e.serialize(),
|
|
1019
1049
|
deserialize: (e) => S(e)
|
|
1020
1050
|
},
|
|
@@ -1022,7 +1052,7 @@ y.registerCustom(
|
|
|
1022
1052
|
);
|
|
1023
1053
|
y.registerCustom(
|
|
1024
1054
|
{
|
|
1025
|
-
isApplicable:
|
|
1055
|
+
isApplicable: $r,
|
|
1026
1056
|
serialize: (e) => e.serialize(),
|
|
1027
1057
|
deserialize: (e) => S(e)
|
|
1028
1058
|
},
|
|
@@ -1030,7 +1060,7 @@ y.registerCustom(
|
|
|
1030
1060
|
);
|
|
1031
1061
|
y.registerCustom(
|
|
1032
1062
|
{
|
|
1033
|
-
isApplicable:
|
|
1063
|
+
isApplicable: qr,
|
|
1034
1064
|
serialize: (e) => e.serialize(),
|
|
1035
1065
|
deserialize: (e) => S(e)
|
|
1036
1066
|
},
|
|
@@ -1038,7 +1068,7 @@ y.registerCustom(
|
|
|
1038
1068
|
);
|
|
1039
1069
|
y.registerCustom(
|
|
1040
1070
|
{
|
|
1041
|
-
isApplicable:
|
|
1071
|
+
isApplicable: Dr,
|
|
1042
1072
|
serialize: (e) => e.serialize(),
|
|
1043
1073
|
deserialize: (e) => S(e)
|
|
1044
1074
|
},
|
|
@@ -1046,7 +1076,7 @@ y.registerCustom(
|
|
|
1046
1076
|
);
|
|
1047
1077
|
y.registerCustom(
|
|
1048
1078
|
{
|
|
1049
|
-
isApplicable:
|
|
1079
|
+
isApplicable: xr,
|
|
1050
1080
|
serialize: (e) => e.serialize(),
|
|
1051
1081
|
deserialize: (e) => S(e)
|
|
1052
1082
|
},
|
|
@@ -1054,64 +1084,64 @@ y.registerCustom(
|
|
|
1054
1084
|
);
|
|
1055
1085
|
y.registerCustom(
|
|
1056
1086
|
{
|
|
1057
|
-
isApplicable:
|
|
1087
|
+
isApplicable: Nr,
|
|
1058
1088
|
serialize: (e) => e.serialize(),
|
|
1059
1089
|
deserialize: (e) => S(e)
|
|
1060
1090
|
},
|
|
1061
1091
|
"CustomFilter"
|
|
1062
1092
|
);
|
|
1063
|
-
const
|
|
1064
|
-
function
|
|
1093
|
+
const Ui = y, T = "DM.";
|
|
1094
|
+
function q(e) {
|
|
1065
1095
|
return typeof e == "object" && e !== null;
|
|
1066
1096
|
}
|
|
1067
|
-
function
|
|
1097
|
+
function w(e) {
|
|
1068
1098
|
return typeof e == "object" && e !== null && "function" in e && "args" in e;
|
|
1069
1099
|
}
|
|
1070
|
-
function
|
|
1071
|
-
return e.every(
|
|
1100
|
+
function _t(e) {
|
|
1101
|
+
return Array.isArray(e) && e.every(w);
|
|
1072
1102
|
}
|
|
1073
|
-
function
|
|
1103
|
+
function ge(e) {
|
|
1074
1104
|
return "attribute" in e && "config" in e;
|
|
1075
1105
|
}
|
|
1076
|
-
function
|
|
1106
|
+
function H(e) {
|
|
1077
1107
|
return "left" in e && "right" in e && "operator" in e;
|
|
1078
1108
|
}
|
|
1079
|
-
function
|
|
1080
|
-
return !
|
|
1109
|
+
function ze(e) {
|
|
1110
|
+
return !ge(e) && !H(e);
|
|
1081
1111
|
}
|
|
1082
|
-
function
|
|
1083
|
-
return
|
|
1112
|
+
function zt(e) {
|
|
1113
|
+
return q(e) && "column" in e && typeof e.column == "string" && !("function" in e && "args" in e);
|
|
1084
1114
|
}
|
|
1085
|
-
function
|
|
1086
|
-
return !
|
|
1115
|
+
function Ut(e) {
|
|
1116
|
+
return !q(e) || !("column" in e) ? !1 : w(e.column);
|
|
1087
1117
|
}
|
|
1088
|
-
const
|
|
1118
|
+
const C = 3;
|
|
1089
1119
|
function x(e, t, r) {
|
|
1090
1120
|
if (t.length === 0) return;
|
|
1091
1121
|
let s = Number.MAX_SAFE_INTEGER, n;
|
|
1092
1122
|
for (const i of t) {
|
|
1093
|
-
const
|
|
1094
|
-
|
|
1123
|
+
const a = r(i), o = ds(e, a);
|
|
1124
|
+
o < s && (s = o, n = i);
|
|
1095
1125
|
}
|
|
1096
1126
|
return n !== void 0 ? { best: n, distance: s } : void 0;
|
|
1097
1127
|
}
|
|
1098
|
-
const
|
|
1099
|
-
function
|
|
1100
|
-
return e.localeCompare(t,
|
|
1128
|
+
const Pt = "en";
|
|
1129
|
+
function we(e, t) {
|
|
1130
|
+
return e.localeCompare(t, Pt, { sensitivity: "accent" }) === 0;
|
|
1101
1131
|
}
|
|
1102
|
-
function
|
|
1103
|
-
return t.length <= e.length && e.slice(0, t.length).localeCompare(t,
|
|
1132
|
+
function et(e, t) {
|
|
1133
|
+
return t.length <= e.length && e.slice(0, t.length).localeCompare(t, Pt, { sensitivity: "accent" }) === 0;
|
|
1104
1134
|
}
|
|
1105
|
-
function
|
|
1106
|
-
const t = [...e].sort((i,
|
|
1135
|
+
function ne(e) {
|
|
1136
|
+
const t = [...e].sort((i, a) => a.name.length - i.name.length), r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
1107
1137
|
for (const i of e) {
|
|
1108
1138
|
r.set(i.name, i);
|
|
1109
|
-
const
|
|
1110
|
-
n.set(i.name,
|
|
1111
|
-
const
|
|
1139
|
+
const a = [...i.columns].sort((u, c) => c.name.length - u.name.length);
|
|
1140
|
+
n.set(i.name, a);
|
|
1141
|
+
const o = /* @__PURE__ */ new Map();
|
|
1112
1142
|
for (const u of i.columns)
|
|
1113
|
-
|
|
1114
|
-
s.set(i.name,
|
|
1143
|
+
o.set(u.name, u);
|
|
1144
|
+
s.set(i.name, o);
|
|
1115
1145
|
}
|
|
1116
1146
|
return {
|
|
1117
1147
|
sortedTables: t,
|
|
@@ -1120,79 +1150,79 @@ function re(e) {
|
|
|
1120
1150
|
columnMap: s
|
|
1121
1151
|
};
|
|
1122
1152
|
}
|
|
1123
|
-
function
|
|
1124
|
-
if (!e.startsWith(
|
|
1153
|
+
function Ue(e, t) {
|
|
1154
|
+
if (!e.startsWith(T))
|
|
1125
1155
|
throw new Error(
|
|
1126
|
-
`Invalid dimensional element name format: '${e}'. Expected format: '${
|
|
1156
|
+
`Invalid dimensional element name format: '${e}'. Expected format: '${T}TableName.ColumnName[.Level]'`
|
|
1127
1157
|
);
|
|
1128
|
-
const r = e.slice(
|
|
1158
|
+
const r = e.slice(T.length);
|
|
1129
1159
|
if (!r)
|
|
1130
1160
|
throw new Error(
|
|
1131
|
-
`Invalid dimensional element name format: '${e}'. Expected format: '${
|
|
1161
|
+
`Invalid dimensional element name format: '${e}'. Expected format: '${T}TableName.ColumnName[.Level]'`
|
|
1132
1162
|
);
|
|
1133
1163
|
let s, n;
|
|
1134
|
-
for (const
|
|
1135
|
-
if (
|
|
1136
|
-
const
|
|
1137
|
-
if (!
|
|
1164
|
+
for (const m of t.sortedTables)
|
|
1165
|
+
if (et(r, m.name + ".")) {
|
|
1166
|
+
const F = r.slice(m.name.length + 1);
|
|
1167
|
+
if (!F)
|
|
1138
1168
|
throw new Error(
|
|
1139
|
-
`Invalid dimensional element name format: '${e}'. Expected format: '${
|
|
1169
|
+
`Invalid dimensional element name format: '${e}'. Expected format: '${T}TableName.ColumnName[.Level]'`
|
|
1140
1170
|
);
|
|
1141
|
-
s =
|
|
1171
|
+
s = m, n = F;
|
|
1142
1172
|
break;
|
|
1143
1173
|
}
|
|
1144
1174
|
if (!s) {
|
|
1145
|
-
const
|
|
1146
|
-
if (
|
|
1175
|
+
const m = r.indexOf(".");
|
|
1176
|
+
if (m === -1)
|
|
1147
1177
|
throw new Error(
|
|
1148
|
-
`Invalid dimensional element name format: '${e}'. Expected format: '${
|
|
1178
|
+
`Invalid dimensional element name format: '${e}'. Expected format: '${T}TableName.ColumnName[.Level]'`
|
|
1149
1179
|
);
|
|
1150
|
-
const
|
|
1151
|
-
throw new Error(`Table '${
|
|
1180
|
+
const F = r.slice(0, m), O = x(F, t.sortedTables, (V) => V.name), N = O && O.distance <= C ? ` Did you mean '${O.best.name}'?` : "";
|
|
1181
|
+
throw new Error(`Table '${F}' not found in the data model.${N}`);
|
|
1152
1182
|
}
|
|
1153
1183
|
const i = t.tableColumnMap.get(s.name);
|
|
1154
1184
|
if (!i)
|
|
1155
1185
|
throw new Error(`Table '${s.name}' found but has no columns`);
|
|
1156
|
-
let
|
|
1186
|
+
let a, o;
|
|
1157
1187
|
const u = $.all;
|
|
1158
|
-
for (const
|
|
1159
|
-
if (
|
|
1160
|
-
return { table: s, column:
|
|
1161
|
-
if (!
|
|
1188
|
+
for (const m of i) {
|
|
1189
|
+
if (we(n, m.name))
|
|
1190
|
+
return { table: s, column: m };
|
|
1191
|
+
if (!et(n, m.name + "."))
|
|
1162
1192
|
continue;
|
|
1163
|
-
const
|
|
1164
|
-
if (!
|
|
1193
|
+
const F = n.slice(m.name.length + 1);
|
|
1194
|
+
if (!F)
|
|
1165
1195
|
continue;
|
|
1166
|
-
const
|
|
1167
|
-
if (
|
|
1168
|
-
if (
|
|
1169
|
-
return { table: s, column:
|
|
1170
|
-
|
|
1196
|
+
const O = u.includes(F), N = se(m.dataType);
|
|
1197
|
+
if (O) {
|
|
1198
|
+
if (N)
|
|
1199
|
+
return { table: s, column: m, level: F };
|
|
1200
|
+
a || (a = m, o = F);
|
|
1171
1201
|
continue;
|
|
1172
1202
|
}
|
|
1173
|
-
|
|
1203
|
+
N && !a && (a = m, o = F);
|
|
1174
1204
|
}
|
|
1175
|
-
if (
|
|
1176
|
-
if (u.includes(
|
|
1205
|
+
if (a && o) {
|
|
1206
|
+
if (u.includes(o))
|
|
1177
1207
|
throw new Error(
|
|
1178
|
-
`Invalid date level '${
|
|
1208
|
+
`Invalid date level '${o}' in dimensional element '${e}'. Column '${s.name}.${a.name}' is not a datetime column`
|
|
1179
1209
|
);
|
|
1180
|
-
const
|
|
1210
|
+
const m = x(o, u, (O) => O), F = m && m.distance <= C ? ` Did you mean '${m.best}'?` : "";
|
|
1181
1211
|
throw new Error(
|
|
1182
|
-
`Invalid date level '${
|
|
1212
|
+
`Invalid date level '${o}' in dimensional element '${e}'. Valid levels are: ${u.join(
|
|
1183
1213
|
", "
|
|
1184
|
-
)}.${
|
|
1214
|
+
)}.${F}`
|
|
1185
1215
|
);
|
|
1186
1216
|
}
|
|
1187
|
-
const c = n.indexOf("."), g = c === -1 ? n : n.slice(0, c),
|
|
1217
|
+
const c = n.indexOf("."), g = c === -1 ? n : n.slice(0, c), f = x(n, i, (m) => m.name), p = f && f.distance <= C && !we(f.best.name, g), h = p ? ` Did you mean '${f.best.name}'?` : "", b = !p && n.endsWith(".") && f !== void 0 && we(f.best.name, g) ? ` Use '${g}' without a trailing dot.` : "";
|
|
1188
1218
|
throw new Error(
|
|
1189
1219
|
`Column '${g}' not found in table '${s.name}'.${h}${b}`
|
|
1190
1220
|
);
|
|
1191
1221
|
}
|
|
1192
|
-
function
|
|
1193
|
-
const { table: r, column: s, level: n } =
|
|
1222
|
+
function Ys(e, t) {
|
|
1223
|
+
const { table: r, column: s, level: n } = Ue(e, t);
|
|
1194
1224
|
if (n) {
|
|
1195
|
-
if (!
|
|
1225
|
+
if (!se(s.dataType))
|
|
1196
1226
|
throw new Error(
|
|
1197
1227
|
`Invalid date level '${n}' in dimensional element '${e}'. Column '${r.name}.${s.name}' is not a datetime column`
|
|
1198
1228
|
);
|
|
@@ -1203,87 +1233,87 @@ function js(e, t) {
|
|
|
1203
1233
|
", "
|
|
1204
1234
|
)}`
|
|
1205
1235
|
);
|
|
1206
|
-
const
|
|
1207
|
-
if (s.dataType === "date" && !
|
|
1236
|
+
const a = $.dateOnly;
|
|
1237
|
+
if (s.dataType === "date" && !a.includes(n))
|
|
1208
1238
|
throw new Error(
|
|
1209
1239
|
`Invalid level '${n}' in dimensional element '${e}'. Column '${r.name}.${s.name}' is only a date column, not a datetime column`
|
|
1210
1240
|
);
|
|
1211
|
-
const
|
|
1212
|
-
if (s.dataType === "time" && !
|
|
1241
|
+
const o = $.timeOnly;
|
|
1242
|
+
if (s.dataType === "time" && !o.includes(n))
|
|
1213
1243
|
throw new Error(
|
|
1214
1244
|
`Invalid level '${n}' in dimensional element '${e}'. Column '${r.name}.${s.name}' is only a time column, not a date column`
|
|
1215
1245
|
);
|
|
1216
1246
|
}
|
|
1217
1247
|
return { table: r, column: s, level: n };
|
|
1218
1248
|
}
|
|
1219
|
-
function
|
|
1220
|
-
const { table: n, column: i, level:
|
|
1221
|
-
let
|
|
1222
|
-
if (
|
|
1249
|
+
function re(e, t, r, s) {
|
|
1250
|
+
const { table: n, column: i, level: a } = Ys(e, r);
|
|
1251
|
+
let o = a;
|
|
1252
|
+
if (se(i.dataType) && o === void 0 && (s != null && s.inferredDateLevel)) {
|
|
1223
1253
|
const u = s.inferredDateLevel, c = $.all;
|
|
1224
1254
|
if (!c.includes(u))
|
|
1225
1255
|
throw new Error(
|
|
1226
1256
|
`Invalid inferred date level '${u}'. Valid levels are: ${c.join(", ")}`
|
|
1227
1257
|
);
|
|
1228
|
-
const g = `${e}.${u}`,
|
|
1229
|
-
if (i.dataType === "date" && !
|
|
1258
|
+
const g = `${e}.${u}`, f = $.dateOnly;
|
|
1259
|
+
if (i.dataType === "date" && !f.includes(u))
|
|
1230
1260
|
throw new Error(
|
|
1231
1261
|
`Invalid level '${u}' in dimensional element '${g}'. Column '${n.name}.${i.name}' is only a date column, not a datetime column`
|
|
1232
1262
|
);
|
|
1233
|
-
const
|
|
1234
|
-
if (i.dataType === "time" && !
|
|
1263
|
+
const p = $.timeOnly;
|
|
1264
|
+
if (i.dataType === "time" && !p.includes(u))
|
|
1235
1265
|
throw new Error(
|
|
1236
1266
|
`Invalid level '${u}' in dimensional element '${g}'. Column '${n.name}.${i.name}' is only a time column, not a date column`
|
|
1237
1267
|
);
|
|
1238
|
-
|
|
1268
|
+
o = u;
|
|
1239
1269
|
}
|
|
1240
|
-
return
|
|
1270
|
+
return Qr({
|
|
1241
1271
|
expression: i.expression,
|
|
1242
1272
|
dataType: i.dataType,
|
|
1243
|
-
granularity:
|
|
1273
|
+
granularity: o,
|
|
1244
1274
|
format: void 0,
|
|
1245
1275
|
sort: void 0,
|
|
1246
1276
|
dataSource: t
|
|
1247
1277
|
});
|
|
1248
1278
|
}
|
|
1249
|
-
function
|
|
1250
|
-
const { column: s, level: n } =
|
|
1279
|
+
function Hs(e, t, r) {
|
|
1280
|
+
const { column: s, level: n } = Ue(e, r);
|
|
1251
1281
|
if (n)
|
|
1252
1282
|
throw new Error(
|
|
1253
|
-
`Invalid DateDimension name format: '${e}'. Expected format: '${
|
|
1283
|
+
`Invalid DateDimension name format: '${e}'. Expected format: '${T}TableName.ColumnName'`
|
|
1254
1284
|
);
|
|
1255
|
-
if (!
|
|
1285
|
+
if (!se(s.dataType))
|
|
1256
1286
|
throw new Error(
|
|
1257
1287
|
`Invalid DateDimension name '${e}'. Column '${s.name}' is not a datetime column (got ${s.dataType}).`
|
|
1258
1288
|
);
|
|
1259
|
-
return
|
|
1289
|
+
return Xr({
|
|
1260
1290
|
name: s.name,
|
|
1261
1291
|
expression: s.expression,
|
|
1262
1292
|
dataSource: t
|
|
1263
1293
|
});
|
|
1264
1294
|
}
|
|
1265
|
-
const
|
|
1295
|
+
const Qs = (e, t) => {
|
|
1266
1296
|
if (!e) return;
|
|
1267
1297
|
const r = typeof e == "object" ? e.direction : e;
|
|
1268
|
-
if (!
|
|
1269
|
-
return
|
|
1298
|
+
if (!gt(r))
|
|
1299
|
+
return E(l({}, t), {
|
|
1270
1300
|
message: `Invalid sort type. Expected 'sortAsc', 'sortDesc', or 'sortNone'. Got: '${r}'.`
|
|
1271
1301
|
});
|
|
1272
|
-
},
|
|
1273
|
-
const n =
|
|
1302
|
+
}, Xs = (e, t, r, s) => {
|
|
1303
|
+
const n = Qs(e.sortType, s);
|
|
1274
1304
|
if (n)
|
|
1275
1305
|
return {
|
|
1276
|
-
attribute:
|
|
1306
|
+
attribute: re(e.column, t, r),
|
|
1277
1307
|
style: {},
|
|
1278
1308
|
error: n
|
|
1279
1309
|
};
|
|
1280
|
-
const i =
|
|
1281
|
-
return { attribute: i, style:
|
|
1282
|
-
},
|
|
1283
|
-
error:
|
|
1310
|
+
const i = re(e.column, t, r), a = U(e, "column");
|
|
1311
|
+
return { attribute: i, style: a };
|
|
1312
|
+
}, Zs = (e, t, r, s) => typeof e == "string" ? { attribute: re(e, t, r) } : zt(e) ? Xs(e, t, r, s) : {
|
|
1313
|
+
error: E(l({}, s), {
|
|
1284
1314
|
message: "Invalid dimension item. Expected a string (composeCode) or object with 'column' and optional 'sortType'."
|
|
1285
1315
|
})
|
|
1286
|
-
},
|
|
1316
|
+
}, Wt = (e) => {
|
|
1287
1317
|
const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context;
|
|
1288
1318
|
if (!t)
|
|
1289
1319
|
return { success: !0, data: [] };
|
|
@@ -1299,13 +1329,13 @@ const Ks = (e, t) => {
|
|
|
1299
1329
|
]
|
|
1300
1330
|
};
|
|
1301
1331
|
const n = [], i = [];
|
|
1302
|
-
return t.forEach((
|
|
1332
|
+
return t.forEach((a, o) => {
|
|
1303
1333
|
const u = {
|
|
1304
|
-
path: `dimensions[${
|
|
1305
|
-
input:
|
|
1334
|
+
path: `dimensions[${o}]`,
|
|
1335
|
+
input: a
|
|
1306
1336
|
};
|
|
1307
1337
|
try {
|
|
1308
|
-
const c =
|
|
1338
|
+
const c = Zs(a, r, s, u);
|
|
1309
1339
|
if (c.error) {
|
|
1310
1340
|
i.push(c.error);
|
|
1311
1341
|
return;
|
|
@@ -1315,47 +1345,47 @@ const Ks = (e, t) => {
|
|
|
1315
1345
|
);
|
|
1316
1346
|
} catch (c) {
|
|
1317
1347
|
const g = c instanceof Error ? c.message : "Unknown error";
|
|
1318
|
-
i.push(
|
|
1348
|
+
i.push(E(l({}, u), { message: g }));
|
|
1319
1349
|
}
|
|
1320
1350
|
}), i.length > 0 ? { success: !1, errors: i } : { success: !0, data: n };
|
|
1321
1351
|
};
|
|
1322
|
-
function
|
|
1352
|
+
function Pe(e, t) {
|
|
1323
1353
|
const r = Reflect.get(e, t);
|
|
1324
1354
|
if (typeof r != "function")
|
|
1325
1355
|
throw new Error(`Function '${t}' not found or is not a function`);
|
|
1326
1356
|
return r;
|
|
1327
1357
|
}
|
|
1328
|
-
function
|
|
1329
|
-
const r = e.replace("measureFactory.", ""), n =
|
|
1330
|
-
if (!
|
|
1358
|
+
function en(e, t) {
|
|
1359
|
+
const r = e.replace("measureFactory.", ""), n = Pe(Zr, r)(...t);
|
|
1360
|
+
if (!ze(n))
|
|
1331
1361
|
throw new Error(`Function '${e}' did not return a valid Measure`);
|
|
1332
1362
|
return n;
|
|
1333
1363
|
}
|
|
1334
|
-
function
|
|
1335
|
-
const r = e.replace("filterFactory.logic.", ""), n =
|
|
1336
|
-
if (!
|
|
1364
|
+
function tn(e, t) {
|
|
1365
|
+
const r = e.replace("filterFactory.logic.", ""), n = Pe(es, r)(...t);
|
|
1366
|
+
if (!H(n))
|
|
1337
1367
|
throw new Error(`Function '${e}' did not return a valid FilterRelations`);
|
|
1338
1368
|
return n;
|
|
1339
1369
|
}
|
|
1340
|
-
function
|
|
1370
|
+
function rn(e, t) {
|
|
1341
1371
|
if (e.startsWith("filterFactory.logic."))
|
|
1342
|
-
return
|
|
1343
|
-
const r = e.replace("filterFactory.", ""), n =
|
|
1344
|
-
if (!
|
|
1372
|
+
return tn(e, t);
|
|
1373
|
+
const r = e.replace("filterFactory.", ""), n = Pe(ts, r)(...t);
|
|
1374
|
+
if (!ge(n) && !H(n))
|
|
1345
1375
|
throw new Error(`Function '${e}' did not return a valid Filter or FilterRelations`);
|
|
1346
1376
|
return n;
|
|
1347
1377
|
}
|
|
1348
|
-
function
|
|
1378
|
+
function sn(e, t) {
|
|
1349
1379
|
const s = e.split(".")[0];
|
|
1350
1380
|
if (s === "measureFactory")
|
|
1351
|
-
return
|
|
1381
|
+
return en(e, t);
|
|
1352
1382
|
if (s === "filterFactory")
|
|
1353
|
-
return
|
|
1383
|
+
return rn(e, t);
|
|
1354
1384
|
throw new Error(
|
|
1355
1385
|
`Unsupported factory: '${s}'. Supported factories: measureFactory, filterFactory`
|
|
1356
1386
|
);
|
|
1357
1387
|
}
|
|
1358
|
-
const
|
|
1388
|
+
const d = (e, t, r, s) => l({ category: e, minArgs: t, maxArgs: r }, s), nn = /* @__PURE__ */ new Set([
|
|
1359
1389
|
"CORREL",
|
|
1360
1390
|
"COVARP",
|
|
1361
1391
|
"COVAR",
|
|
@@ -1374,131 +1404,131 @@ const f = (e, t, r, s) => l({ category: e, minArgs: t, maxArgs: r }, s), en = /*
|
|
|
1374
1404
|
"ORDERING",
|
|
1375
1405
|
"RDOUBLE",
|
|
1376
1406
|
"RINT"
|
|
1377
|
-
]),
|
|
1407
|
+
]), le = {
|
|
1378
1408
|
// ── X-diff (datetime difference operators) ──
|
|
1379
|
-
SDIFF:
|
|
1409
|
+
SDIFF: d("xdiff", 2, 2, {
|
|
1380
1410
|
requiredDateLevel: $.Seconds,
|
|
1381
1411
|
argType: "datetime"
|
|
1382
1412
|
}),
|
|
1383
|
-
MNDIFF:
|
|
1413
|
+
MNDIFF: d("xdiff", 2, 2, {
|
|
1384
1414
|
requiredDateLevel: $.Minutes,
|
|
1385
1415
|
argType: "datetime"
|
|
1386
1416
|
}),
|
|
1387
|
-
HDIFF:
|
|
1417
|
+
HDIFF: d("xdiff", 2, 2, {
|
|
1388
1418
|
requiredDateLevel: $.Hours,
|
|
1389
1419
|
argType: "datetime"
|
|
1390
1420
|
}),
|
|
1391
|
-
DDIFF:
|
|
1421
|
+
DDIFF: d("xdiff", 2, 2, {
|
|
1392
1422
|
requiredDateLevel: $.Days,
|
|
1393
1423
|
argType: "datetime"
|
|
1394
1424
|
}),
|
|
1395
|
-
MDIFF:
|
|
1425
|
+
MDIFF: d("xdiff", 2, 2, {
|
|
1396
1426
|
requiredDateLevel: $.Months,
|
|
1397
1427
|
argType: "datetime"
|
|
1398
1428
|
}),
|
|
1399
|
-
QDIFF:
|
|
1429
|
+
QDIFF: d("xdiff", 2, 2, {
|
|
1400
1430
|
requiredDateLevel: $.Quarters,
|
|
1401
1431
|
argType: "datetime"
|
|
1402
1432
|
}),
|
|
1403
|
-
YDIFF:
|
|
1433
|
+
YDIFF: d("xdiff", 2, 2, {
|
|
1404
1434
|
requiredDateLevel: $.Years,
|
|
1405
1435
|
argType: "datetime"
|
|
1406
1436
|
}),
|
|
1407
1437
|
// ── Aggregation ──
|
|
1408
|
-
ANYVALUE:
|
|
1409
|
-
SUM:
|
|
1410
|
-
AVG:
|
|
1411
|
-
MIN:
|
|
1412
|
-
MAX:
|
|
1413
|
-
COUNT:
|
|
1414
|
-
DUPCOUNT:
|
|
1415
|
-
COUNTDUPLICATES:
|
|
1416
|
-
STDEV:
|
|
1417
|
-
STDEVP:
|
|
1418
|
-
VAR:
|
|
1419
|
-
VARP:
|
|
1420
|
-
MEDIAN:
|
|
1421
|
-
QUARTILE:
|
|
1422
|
-
PERCENTILE:
|
|
1423
|
-
LOWERWHISKERMAX_IQR:
|
|
1424
|
-
LOWERWHISKERMAX_STDEVP:
|
|
1425
|
-
UPPERWHISKERMIN_IQR:
|
|
1426
|
-
UPPERWHISKERMIN_STDEVP:
|
|
1427
|
-
OUTLIERSCOUNT_IQR:
|
|
1428
|
-
OUTLIERSCOUNT_STDEVP:
|
|
1429
|
-
MODE:
|
|
1430
|
-
NOAGGFUNCTION:
|
|
1438
|
+
ANYVALUE: d("aggregative", 1, 1),
|
|
1439
|
+
SUM: d("aggregative", 1, 2),
|
|
1440
|
+
AVG: d("aggregative", 1, 2),
|
|
1441
|
+
MIN: d("aggregative", 1, 2),
|
|
1442
|
+
MAX: d("aggregative", 1, 2),
|
|
1443
|
+
COUNT: d("aggregative", 1, 2),
|
|
1444
|
+
DUPCOUNT: d("aggregative", 1, 1),
|
|
1445
|
+
COUNTDUPLICATES: d("aggregative", 1, 1),
|
|
1446
|
+
STDEV: d("aggregative", 1, 2),
|
|
1447
|
+
STDEVP: d("aggregative", 1, 2),
|
|
1448
|
+
VAR: d("aggregative", 1, 2),
|
|
1449
|
+
VARP: d("aggregative", 1, 2),
|
|
1450
|
+
MEDIAN: d("aggregative", 1, 2),
|
|
1451
|
+
QUARTILE: d("aggregative", 2, 3),
|
|
1452
|
+
PERCENTILE: d("aggregative", 2, 3),
|
|
1453
|
+
LOWERWHISKERMAX_IQR: d("aggregative", 1, 1),
|
|
1454
|
+
LOWERWHISKERMAX_STDEVP: d("aggregative", 1, 1),
|
|
1455
|
+
UPPERWHISKERMIN_IQR: d("aggregative", 1, 1),
|
|
1456
|
+
UPPERWHISKERMIN_STDEVP: d("aggregative", 1, 1),
|
|
1457
|
+
OUTLIERSCOUNT_IQR: d("aggregative", 1, 1),
|
|
1458
|
+
OUTLIERSCOUNT_STDEVP: d("aggregative", 1, 1),
|
|
1459
|
+
MODE: d("aggregative", 1, 1),
|
|
1460
|
+
NOAGGFUNCTION: d("aggregative", 1, 1),
|
|
1431
1461
|
// ── Window ──
|
|
1432
|
-
RANK:
|
|
1433
|
-
RSUM:
|
|
1434
|
-
RAVG:
|
|
1435
|
-
YTDSUM:
|
|
1436
|
-
QTDSUM:
|
|
1437
|
-
MTDSUM:
|
|
1438
|
-
WTDSUM:
|
|
1439
|
-
YTDAVG:
|
|
1440
|
-
QTDAVG:
|
|
1441
|
-
MTDAVG:
|
|
1442
|
-
WTDAVG:
|
|
1462
|
+
RANK: d("window", 0, Number.POSITIVE_INFINITY),
|
|
1463
|
+
RSUM: d("window", 1, 2),
|
|
1464
|
+
RAVG: d("window", 1, 2),
|
|
1465
|
+
YTDSUM: d("window", 1, 1),
|
|
1466
|
+
QTDSUM: d("window", 1, 1),
|
|
1467
|
+
MTDSUM: d("window", 1, 1),
|
|
1468
|
+
WTDSUM: d("window", 1, 1),
|
|
1469
|
+
YTDAVG: d("window", 1, 1),
|
|
1470
|
+
QTDAVG: d("window", 1, 1),
|
|
1471
|
+
MTDAVG: d("window", 1, 1),
|
|
1472
|
+
WTDAVG: d("window", 1, 1),
|
|
1443
1473
|
// ── String ──
|
|
1444
|
-
CONCAT:
|
|
1445
|
-
LEFT:
|
|
1446
|
-
RIGHT:
|
|
1474
|
+
CONCAT: d("string", 2, Number.POSITIVE_INFINITY),
|
|
1475
|
+
LEFT: d("string", 2, 2),
|
|
1476
|
+
RIGHT: d("string", 2, 2),
|
|
1447
1477
|
// ── Scalar / math ──
|
|
1448
|
-
ABS:
|
|
1449
|
-
ACOS:
|
|
1450
|
-
ASIN:
|
|
1451
|
-
ATAN:
|
|
1452
|
-
CEILING:
|
|
1453
|
-
CONTRIBUTION:
|
|
1454
|
-
COS:
|
|
1455
|
-
COT:
|
|
1456
|
-
DIFFPASTDAY:
|
|
1457
|
-
DIFFPASTMONTH:
|
|
1458
|
-
DIFFPASTPERIOD:
|
|
1459
|
-
DIFFPASTQUARTER:
|
|
1460
|
-
DIFFPASTWEEK:
|
|
1461
|
-
DIFFPASTYEAR:
|
|
1462
|
-
EXP:
|
|
1463
|
-
FLOOR:
|
|
1464
|
-
GROWTH:
|
|
1465
|
-
GROWTHPASTMONTH:
|
|
1466
|
-
GROWTHPASTQUARTER:
|
|
1467
|
-
GROWTHPASTWEEK:
|
|
1468
|
-
GROWTHPASTYEAR:
|
|
1469
|
-
GROWTHRATE:
|
|
1470
|
-
LN:
|
|
1471
|
-
LOG10:
|
|
1472
|
-
MINUS:
|
|
1473
|
-
MOD:
|
|
1474
|
-
QUOTIENT:
|
|
1475
|
-
PASTDAY:
|
|
1476
|
-
PASTMONTH:
|
|
1477
|
-
PASTPERIOD:
|
|
1478
|
-
PASTQUARTER:
|
|
1479
|
-
PASTWEEK:
|
|
1480
|
-
PASTYEAR:
|
|
1481
|
-
PERCENTILEDISCFORINTERNALUSEONLY:
|
|
1482
|
-
PERCENTILECONTFORINTERNALUSEONLY:
|
|
1483
|
-
POWER:
|
|
1484
|
-
ROUND:
|
|
1485
|
-
SIN:
|
|
1486
|
-
SQRT:
|
|
1487
|
-
TAN:
|
|
1488
|
-
},
|
|
1489
|
-
(e) =>
|
|
1478
|
+
ABS: d("scalar", 1, 1),
|
|
1479
|
+
ACOS: d("scalar", 1, 1),
|
|
1480
|
+
ASIN: d("scalar", 1, 1),
|
|
1481
|
+
ATAN: d("scalar", 1, 1),
|
|
1482
|
+
CEILING: d("scalar", 1, 1),
|
|
1483
|
+
CONTRIBUTION: d("scalar", 1, 1),
|
|
1484
|
+
COS: d("scalar", 1, 1),
|
|
1485
|
+
COT: d("scalar", 1, 1),
|
|
1486
|
+
DIFFPASTDAY: d("scalar", 1, 1),
|
|
1487
|
+
DIFFPASTMONTH: d("scalar", 1, 1),
|
|
1488
|
+
DIFFPASTPERIOD: d("scalar", 1, 1),
|
|
1489
|
+
DIFFPASTQUARTER: d("scalar", 1, 1),
|
|
1490
|
+
DIFFPASTWEEK: d("scalar", 1, 1),
|
|
1491
|
+
DIFFPASTYEAR: d("scalar", 1, 1),
|
|
1492
|
+
EXP: d("scalar", 1, 1),
|
|
1493
|
+
FLOOR: d("scalar", 1, 1),
|
|
1494
|
+
GROWTH: d("growth", 1, 1),
|
|
1495
|
+
GROWTHPASTMONTH: d("growth", 1, 1),
|
|
1496
|
+
GROWTHPASTQUARTER: d("growth", 1, 1),
|
|
1497
|
+
GROWTHPASTWEEK: d("growth", 1, 1),
|
|
1498
|
+
GROWTHPASTYEAR: d("growth", 1, 1),
|
|
1499
|
+
GROWTHRATE: d("growth", 1, 1),
|
|
1500
|
+
LN: d("scalar", 1, 1),
|
|
1501
|
+
LOG10: d("scalar", 1, 1),
|
|
1502
|
+
MINUS: d("scalar", 1, 1),
|
|
1503
|
+
MOD: d("scalar", 2, 2),
|
|
1504
|
+
QUOTIENT: d("scalar", 2, 2),
|
|
1505
|
+
PASTDAY: d("date", 1, 2),
|
|
1506
|
+
PASTMONTH: d("date", 1, 2),
|
|
1507
|
+
PASTPERIOD: d("date", 1, 2),
|
|
1508
|
+
PASTQUARTER: d("date", 1, 2),
|
|
1509
|
+
PASTWEEK: d("date", 1, 2),
|
|
1510
|
+
PASTYEAR: d("date", 1, 2),
|
|
1511
|
+
PERCENTILEDISCFORINTERNALUSEONLY: d("scalar", 1, 1),
|
|
1512
|
+
PERCENTILECONTFORINTERNALUSEONLY: d("scalar", 1, 1),
|
|
1513
|
+
POWER: d("scalar", 2, 2),
|
|
1514
|
+
ROUND: d("scalar", 2, 2),
|
|
1515
|
+
SIN: d("scalar", 1, 1),
|
|
1516
|
+
SQRT: d("scalar", 1, 1),
|
|
1517
|
+
TAN: d("scalar", 1, 1)
|
|
1518
|
+
}, an = Object.keys(le).filter(
|
|
1519
|
+
(e) => le[e].category === "xdiff"
|
|
1490
1520
|
);
|
|
1491
|
-
function
|
|
1492
|
-
return
|
|
1521
|
+
function Vt() {
|
|
1522
|
+
return an;
|
|
1493
1523
|
}
|
|
1494
|
-
function
|
|
1495
|
-
const t =
|
|
1524
|
+
function jt(e) {
|
|
1525
|
+
const t = le[e.toUpperCase()];
|
|
1496
1526
|
return t == null ? void 0 : t.requiredDateLevel;
|
|
1497
1527
|
}
|
|
1498
|
-
function
|
|
1528
|
+
function on(e, t) {
|
|
1499
1529
|
return e === t ? e === 1 ? "1 parameter" : `${e} parameters` : t === Number.POSITIVE_INFINITY ? e <= 1 ? "any number of parameters" : `at least ${e} parameters` : `${e} or ${t} parameters`;
|
|
1500
1530
|
}
|
|
1501
|
-
const
|
|
1531
|
+
const un = /\[(\w[\w.-]*)\]/g, Jt = /* @__PURE__ */ new Set([
|
|
1502
1532
|
// Universal – Aggregative (per Sisense doc: (A) only; Statistical CONTRIBUTION, PERCENTILE, etc. are non-aggregative)
|
|
1503
1533
|
"AVG",
|
|
1504
1534
|
"COUNT",
|
|
@@ -1519,30 +1549,30 @@ const sn = /\[(\w[\w.-]*)\]/g, zt = /* @__PURE__ */ new Set([
|
|
|
1519
1549
|
"YTDSUM"
|
|
1520
1550
|
// RAVG, RSUM are non-aggregative per Sisense doc (Other Functions, not (A))
|
|
1521
1551
|
// CORREL, COVAR*, SKEW*, SLOPE, LARGEST are unsupported in custom formulas (see UNSUPPORTED_FORMULA_FUNCTIONS).
|
|
1522
|
-
]),
|
|
1523
|
-
`\\b(${Array.from(
|
|
1552
|
+
]), cn = new RegExp(
|
|
1553
|
+
`\\b(${Array.from(Jt).join("|")})\\s*\\(`,
|
|
1524
1554
|
"i"
|
|
1525
1555
|
);
|
|
1526
|
-
function
|
|
1527
|
-
return
|
|
1556
|
+
function Kt(e) {
|
|
1557
|
+
return w(e) ? !0 : typeof e == "string" && e.startsWith(T) ? !1 : q(e) && "kind" in e ? e.kind === "measure" : !0;
|
|
1528
1558
|
}
|
|
1529
|
-
function
|
|
1559
|
+
function ln(e) {
|
|
1530
1560
|
const t = /\b(\w+)\s*\(/g, r = /* @__PURE__ */ new Set();
|
|
1531
1561
|
let s;
|
|
1532
1562
|
for (; (s = t.exec(e)) !== null; ) {
|
|
1533
1563
|
const n = s[1];
|
|
1534
|
-
|
|
1564
|
+
Jt.has(n.toUpperCase()) || r.add(n);
|
|
1535
1565
|
}
|
|
1536
1566
|
return Array.from(r);
|
|
1537
1567
|
}
|
|
1538
|
-
function
|
|
1568
|
+
function fn(e) {
|
|
1539
1569
|
return e.length === 1 ? `[${e[0]}]` : e.map((t) => `[${t}]`).join(", ");
|
|
1540
1570
|
}
|
|
1541
|
-
function
|
|
1571
|
+
function dn(e) {
|
|
1542
1572
|
return e.length === 0 ? "" : e.length === 1 ? `${e[0]} is not an aggregative function. ` : `${e.join(", ")} are not aggregative functions. `;
|
|
1543
1573
|
}
|
|
1544
|
-
const
|
|
1545
|
-
function
|
|
1574
|
+
const Y = (e) => e.startsWith("[") ? e : `[${e}]`, Gt = (e) => e.startsWith("[") && e.endsWith("]") ? e.slice(1, -1) : e;
|
|
1575
|
+
function Yt(e, t) {
|
|
1546
1576
|
if (t.length === 0) return [];
|
|
1547
1577
|
const r = t.map((n) => n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|"), s = new RegExp(
|
|
1548
1578
|
`\\b(${r})\\s*\\(\\s*\\[([^\\]]+)\\]\\s*,\\s*\\[([^\\]]+)\\]\\s*\\)`,
|
|
@@ -1554,16 +1584,16 @@ function Pt(e, t) {
|
|
|
1554
1584
|
ref2: n[3].trim()
|
|
1555
1585
|
}));
|
|
1556
1586
|
}
|
|
1557
|
-
function
|
|
1558
|
-
var
|
|
1559
|
-
const s = Object.keys(t), n = ((
|
|
1587
|
+
function mn(e, t, r) {
|
|
1588
|
+
var a, o, u;
|
|
1589
|
+
const s = Object.keys(t), n = ((a = r.errorPrefix) != null ? a : "customFormula validation").trim(), i = n === "" ? "" : n.endsWith(" ") ? n : `${n} `;
|
|
1560
1590
|
return {
|
|
1561
1591
|
formula: e,
|
|
1562
1592
|
context: t,
|
|
1563
1593
|
contextKeys: s,
|
|
1564
|
-
canonicalContextKeys: new Set(s.map(
|
|
1594
|
+
canonicalContextKeys: new Set(s.map(Y)),
|
|
1565
1595
|
errorPrefix: i,
|
|
1566
|
-
warnUnusedContext: (
|
|
1596
|
+
warnUnusedContext: (o = r.warnUnusedContext) != null ? o : !0,
|
|
1567
1597
|
errorOnUnusedContext: (u = r.errorOnUnusedContext) != null ? u : !0,
|
|
1568
1598
|
schemaIndex: r.schemaIndex,
|
|
1569
1599
|
result: { isValid: !0, errors: [], warnings: [], references: [], unusedContextKeys: [] }
|
|
@@ -1572,17 +1602,17 @@ function cn(e, t, r) {
|
|
|
1572
1602
|
function R(e, t) {
|
|
1573
1603
|
e.result.errors.push(t), e.result.isValid = !1;
|
|
1574
1604
|
}
|
|
1575
|
-
const
|
|
1576
|
-
function
|
|
1605
|
+
const pn = /* @__PURE__ */ new Set(["CASE", "WHEN", "THEN", "ELSE", "END", "AND", "OR"]);
|
|
1606
|
+
function gn(e) {
|
|
1577
1607
|
const t = /\b(\w+)\s*\[/gi, r = [...e.formula.matchAll(t)].find(
|
|
1578
|
-
(s) => !
|
|
1608
|
+
(s) => !pn.has(s[1].toUpperCase())
|
|
1579
1609
|
);
|
|
1580
1610
|
r && R(
|
|
1581
1611
|
e,
|
|
1582
1612
|
`${e.errorPrefix}args[1]: Invalid syntax: '${r[1]}' - operator cannot be used before bracket reference without parentheses`
|
|
1583
1613
|
);
|
|
1584
1614
|
}
|
|
1585
|
-
function
|
|
1615
|
+
function yn(e, t) {
|
|
1586
1616
|
const r = e[t];
|
|
1587
1617
|
let s = t + 1;
|
|
1588
1618
|
for (; s < e.length; ) {
|
|
@@ -1599,27 +1629,27 @@ function fn(e, t) {
|
|
|
1599
1629
|
}
|
|
1600
1630
|
return e.length;
|
|
1601
1631
|
}
|
|
1602
|
-
function
|
|
1603
|
-
return
|
|
1632
|
+
function hn(e) {
|
|
1633
|
+
return Re(e, ",").filter((t) => t.trim().length > 0).length;
|
|
1604
1634
|
}
|
|
1605
|
-
function
|
|
1635
|
+
function bn(e, t, r, s) {
|
|
1606
1636
|
for (; t < e.length && /\s/.test(e[t]); )
|
|
1607
1637
|
t++;
|
|
1608
1638
|
if (e[t] !== "(")
|
|
1609
1639
|
return t;
|
|
1610
|
-
const n = t, i =
|
|
1640
|
+
const n = t, i = ps(e, n);
|
|
1611
1641
|
if (i === -1)
|
|
1612
1642
|
return n + 1;
|
|
1613
|
-
const
|
|
1614
|
-
return s.push({ name: r.toUpperCase(), argCount:
|
|
1643
|
+
const a = e.slice(n + 1, i);
|
|
1644
|
+
return s.push({ name: r.toUpperCase(), argCount: hn(a) }), s.push(...Ht(a)), i + 1;
|
|
1615
1645
|
}
|
|
1616
|
-
function
|
|
1646
|
+
function Ht(e) {
|
|
1617
1647
|
const t = [];
|
|
1618
1648
|
let r = 0;
|
|
1619
1649
|
for (; r < e.length; ) {
|
|
1620
1650
|
const s = e[r];
|
|
1621
1651
|
if (s === "'" || s === '"') {
|
|
1622
|
-
r =
|
|
1652
|
+
r = yn(e, r);
|
|
1623
1653
|
continue;
|
|
1624
1654
|
}
|
|
1625
1655
|
if (/[A-Za-z_]/.test(s)) {
|
|
@@ -1627,122 +1657,122 @@ function Wt(e) {
|
|
|
1627
1657
|
for (r++; r < e.length && /[A-Za-z0-9_]/.test(e[r]); )
|
|
1628
1658
|
r++;
|
|
1629
1659
|
const i = e.slice(n, r);
|
|
1630
|
-
r =
|
|
1660
|
+
r = bn(e, r, i, t);
|
|
1631
1661
|
continue;
|
|
1632
1662
|
}
|
|
1633
1663
|
r++;
|
|
1634
1664
|
}
|
|
1635
1665
|
return t;
|
|
1636
1666
|
}
|
|
1637
|
-
function
|
|
1638
|
-
const t =
|
|
1667
|
+
function Fn(e) {
|
|
1668
|
+
const t = Ht(e.formula), r = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set();
|
|
1639
1669
|
for (const { name: n, argCount: i } of t) {
|
|
1640
|
-
if (
|
|
1670
|
+
if (nn.has(n)) {
|
|
1641
1671
|
r.has(n) || (r.add(n), R(
|
|
1642
1672
|
e,
|
|
1643
1673
|
`${e.errorPrefix}args[1]: Function ${n} is not supported in custom formulas`
|
|
1644
1674
|
));
|
|
1645
1675
|
continue;
|
|
1646
1676
|
}
|
|
1647
|
-
const
|
|
1648
|
-
if (
|
|
1677
|
+
const a = le[n];
|
|
1678
|
+
if (a && (i < a.minArgs || i > a.maxArgs) && !s.has(n)) {
|
|
1649
1679
|
s.add(n);
|
|
1650
|
-
const
|
|
1651
|
-
R(e, `${e.errorPrefix}args[1]: Function ${n} accepts ${
|
|
1680
|
+
const o = on(a.minArgs, a.maxArgs);
|
|
1681
|
+
R(e, `${e.errorPrefix}args[1]: Function ${n} accepts ${o}`);
|
|
1652
1682
|
}
|
|
1653
1683
|
}
|
|
1654
1684
|
}
|
|
1655
|
-
function
|
|
1685
|
+
function En(e) {
|
|
1656
1686
|
return [
|
|
1657
1687
|
...new Set(
|
|
1658
|
-
[...e.matchAll(new RegExp(
|
|
1688
|
+
[...e.matchAll(new RegExp(un.source, "g"))].map((t) => t[1])
|
|
1659
1689
|
)
|
|
1660
1690
|
];
|
|
1661
1691
|
}
|
|
1662
|
-
function
|
|
1692
|
+
function An(e) {
|
|
1663
1693
|
const t = e.result.references.filter(
|
|
1664
|
-
(n) => !e.canonicalContextKeys.has(
|
|
1694
|
+
(n) => !e.canonicalContextKeys.has(Y(n))
|
|
1665
1695
|
);
|
|
1666
1696
|
if (t.length === 0) return;
|
|
1667
|
-
const r = e.contextKeys.map((n) => `[${
|
|
1697
|
+
const r = e.contextKeys.map((n) => `[${Gt(n)}]`).join(", "), s = t.length === 1 ? `Reference [${t[0]}]` : `References [${t.join("], [")}]`;
|
|
1668
1698
|
R(
|
|
1669
1699
|
e,
|
|
1670
1700
|
`${e.errorPrefix}args[1]: ${s} not found in context. Available keys: ${r}`
|
|
1671
1701
|
);
|
|
1672
1702
|
}
|
|
1673
|
-
function
|
|
1674
|
-
if (
|
|
1703
|
+
function Tn(e) {
|
|
1704
|
+
if (cn.test(e.formula)) return;
|
|
1675
1705
|
const t = e.result.references.filter((r) => {
|
|
1676
1706
|
var n;
|
|
1677
|
-
const s = (n = e.context[
|
|
1678
|
-
return s !== void 0 && !
|
|
1707
|
+
const s = (n = e.context[Y(r)]) != null ? n : e.context[r];
|
|
1708
|
+
return s !== void 0 && !Kt(s);
|
|
1679
1709
|
});
|
|
1680
1710
|
t.length !== 0 && R(
|
|
1681
1711
|
e,
|
|
1682
|
-
`${e.errorPrefix}args[1]: ${
|
|
1683
|
-
|
|
1684
|
-
)}Bracket reference(s) ${
|
|
1712
|
+
`${e.errorPrefix}args[1]: ${dn(
|
|
1713
|
+
ln(e.formula)
|
|
1714
|
+
)}Bracket reference(s) ${fn(
|
|
1685
1715
|
t
|
|
1686
1716
|
)} point to raw attributes and must be wrapped in an aggregative function (e.g. SUM, AVG)`
|
|
1687
1717
|
);
|
|
1688
1718
|
}
|
|
1689
|
-
function
|
|
1719
|
+
function wn(e) {
|
|
1690
1720
|
if (!e.warnUnusedContext && !e.errorOnUnusedContext || e.contextKeys.length === 0) return;
|
|
1691
|
-
const t = new Set(e.result.references.map(
|
|
1721
|
+
const t = new Set(e.result.references.map(Y)), r = e.contextKeys.filter((i) => !t.has(Y(i)));
|
|
1692
1722
|
if (e.result.unusedContextKeys = r, r.length === 0) return;
|
|
1693
|
-
const s = r.map((i) => `[${
|
|
1723
|
+
const s = r.map((i) => `[${Gt(i)}]`).join(", "), n = `${e.errorPrefix}args[2]: Context keys ${s} are defined but not used in formula`;
|
|
1694
1724
|
e.errorOnUnusedContext ? R(e, n) : e.warnUnusedContext && e.result.warnings.push(n);
|
|
1695
1725
|
}
|
|
1696
|
-
function
|
|
1697
|
-
var
|
|
1698
|
-
const n = (
|
|
1726
|
+
function tt(e, t, r, s) {
|
|
1727
|
+
var a;
|
|
1728
|
+
const n = (a = s.context[Y(e)]) != null ? a : s.context[e];
|
|
1699
1729
|
if (n === void 0) return;
|
|
1700
|
-
if (!(typeof n == "string" && n.startsWith(
|
|
1701
|
-
|
|
1730
|
+
if (!(typeof n == "string" && n.startsWith(T))) {
|
|
1731
|
+
Kt(n) && R(
|
|
1702
1732
|
s,
|
|
1703
|
-
`${s.errorPrefix}args[1]: ${t.functionName} requires datetime dimension attributes. Reference [${e}] points to a measure; use an attribute (e.g. ${
|
|
1733
|
+
`${s.errorPrefix}args[1]: ${t.functionName} requires datetime dimension attributes. Reference [${e}] points to a measure; use an attribute (e.g. ${T}Table.Column.Level).`
|
|
1704
1734
|
);
|
|
1705
1735
|
return;
|
|
1706
1736
|
}
|
|
1707
1737
|
if (s.schemaIndex)
|
|
1708
1738
|
try {
|
|
1709
|
-
const
|
|
1710
|
-
|
|
1739
|
+
const o = Ue(n, s.schemaIndex);
|
|
1740
|
+
se(o.column.dataType) ? r && o.level && o.level !== r && R(
|
|
1711
1741
|
s,
|
|
1712
|
-
`${s.errorPrefix}args[1]: ${t.functionName} expects date level '${r}'. Reference [${e}] has level '${
|
|
1742
|
+
`${s.errorPrefix}args[1]: ${t.functionName} expects date level '${r}'. Reference [${e}] has level '${o.level}'.`
|
|
1713
1743
|
) : R(
|
|
1714
1744
|
s,
|
|
1715
|
-
`${s.errorPrefix}args[1]: ${t.functionName} requires datetime dimensions. Reference [${e}] resolves to non-datetime column '${
|
|
1745
|
+
`${s.errorPrefix}args[1]: ${t.functionName} requires datetime dimensions. Reference [${e}] resolves to non-datetime column '${o.column.name}'.`
|
|
1716
1746
|
);
|
|
1717
|
-
} catch (
|
|
1718
|
-
const u =
|
|
1747
|
+
} catch (o) {
|
|
1748
|
+
const u = o instanceof Error ? o.message : "Unknown error";
|
|
1719
1749
|
R(s, `${s.errorPrefix}args[1]: ${t.functionName} reference [${e}]: ${u}`);
|
|
1720
1750
|
}
|
|
1721
1751
|
}
|
|
1722
|
-
function
|
|
1723
|
-
const t =
|
|
1752
|
+
function Sn(e) {
|
|
1753
|
+
const t = Vt(), r = Yt(e.formula, t);
|
|
1724
1754
|
for (const s of r) {
|
|
1725
|
-
const n =
|
|
1726
|
-
|
|
1755
|
+
const n = jt(s.functionName);
|
|
1756
|
+
tt(s.ref1, s, n, e), tt(s.ref2, s, n, e);
|
|
1727
1757
|
}
|
|
1728
1758
|
}
|
|
1729
|
-
function
|
|
1759
|
+
function Cn(e, t, r = {}) {
|
|
1730
1760
|
var n;
|
|
1731
|
-
const s =
|
|
1732
|
-
return !e || e.trim().length === 0 ? ((n = r.allowEmptyFormula) != null && n || R(s, `${s.errorPrefix}args[1]: Formula cannot be empty`), s.result) : (
|
|
1761
|
+
const s = mn(e, t, r);
|
|
1762
|
+
return !e || e.trim().length === 0 ? ((n = r.allowEmptyFormula) != null && n || R(s, `${s.errorPrefix}args[1]: Formula cannot be empty`), s.result) : (gn(s), Fn(s), s.result.references = En(e), s.result.references.length === 0 ? (s.result.warnings.push(
|
|
1733
1763
|
`${s.errorPrefix}args[1]: No bracket references found in formula - ensure this is intentional`
|
|
1734
1764
|
), s.result) : s.contextKeys.length === 0 ? (R(
|
|
1735
1765
|
s,
|
|
1736
1766
|
`${s.errorPrefix}args[2]: Context cannot be empty - custom formulas require context definitions`
|
|
1737
|
-
), s.result) : (
|
|
1767
|
+
), s.result) : (An(s), Tn(s), wn(s), Sn(s), s.result));
|
|
1738
1768
|
}
|
|
1739
|
-
function
|
|
1740
|
-
const s =
|
|
1769
|
+
function On(e, t, r = {}) {
|
|
1770
|
+
const s = Cn(e, t, r);
|
|
1741
1771
|
if (!s.isValid)
|
|
1742
1772
|
throw new Error(s.errors.join("; "));
|
|
1743
1773
|
s.warnings.length > 0 && console.warn("Formula validation warnings:", s.warnings.join("; "));
|
|
1744
1774
|
}
|
|
1745
|
-
function
|
|
1775
|
+
function $n(e, t) {
|
|
1746
1776
|
if (e.length < 3 || e.length > 5)
|
|
1747
1777
|
throw new Error(
|
|
1748
1778
|
`${t.pathPrefix}Expected 3, 4, or 5 arguments for customFormula (title, formula, context, format?, description?)`
|
|
@@ -1753,12 +1783,12 @@ function Tn(e, t) {
|
|
|
1753
1783
|
`${t.pathPrefix}args[1]: Expected formula string, got ${typeof r}`
|
|
1754
1784
|
);
|
|
1755
1785
|
const s = r, n = e[2];
|
|
1756
|
-
if (!
|
|
1786
|
+
if (!q(n))
|
|
1757
1787
|
throw new Error(
|
|
1758
1788
|
`${t.pathPrefix}args[2]: Expected context object, got ${n === null ? "null" : typeof n}`
|
|
1759
1789
|
);
|
|
1760
1790
|
const i = n;
|
|
1761
|
-
|
|
1791
|
+
On(s, i, {
|
|
1762
1792
|
errorPrefix: `${t.pathPrefix}`,
|
|
1763
1793
|
errorOnUnusedContext: !0,
|
|
1764
1794
|
// Strict validation: all context keys must be used
|
|
@@ -1766,11 +1796,11 @@ function Tn(e, t) {
|
|
|
1766
1796
|
// Custom formulas must have content
|
|
1767
1797
|
schemaIndex: t.schemaIndex
|
|
1768
1798
|
});
|
|
1769
|
-
const
|
|
1799
|
+
const a = qn(s), o = {};
|
|
1770
1800
|
for (const [u, c] of Object.entries(i)) {
|
|
1771
1801
|
const g = `args[2].${u}`;
|
|
1772
|
-
if (
|
|
1773
|
-
|
|
1802
|
+
if (w(c))
|
|
1803
|
+
o[`${u}`] = M({
|
|
1774
1804
|
data: c,
|
|
1775
1805
|
context: {
|
|
1776
1806
|
dataSource: t.dataSource,
|
|
@@ -1778,191 +1808,202 @@ function Tn(e, t) {
|
|
|
1778
1808
|
pathPrefix: g
|
|
1779
1809
|
}
|
|
1780
1810
|
});
|
|
1781
|
-
else if (typeof c == "string" && c.startsWith(
|
|
1782
|
-
const
|
|
1811
|
+
else if (typeof c == "string" && c.startsWith(T)) {
|
|
1812
|
+
const f = u.startsWith("[") && u.endsWith("]") ? u.slice(1, -1) : u, p = a[f];
|
|
1783
1813
|
try {
|
|
1784
|
-
|
|
1814
|
+
o[`${u}`] = re(
|
|
1785
1815
|
c,
|
|
1786
1816
|
t.dataSource,
|
|
1787
1817
|
t.schemaIndex,
|
|
1788
|
-
|
|
1818
|
+
p !== void 0 ? { inferredDateLevel: p } : void 0
|
|
1789
1819
|
);
|
|
1790
1820
|
} catch (h) {
|
|
1791
1821
|
const b = h instanceof Error ? h.message : "Unknown error";
|
|
1792
1822
|
throw new Error(`${g}: ${b}`);
|
|
1793
1823
|
}
|
|
1794
1824
|
} else if (c && typeof c == "object" && "kind" in c)
|
|
1795
|
-
|
|
1825
|
+
o[`${u}`] = c;
|
|
1796
1826
|
else
|
|
1797
1827
|
throw new Error(
|
|
1798
|
-
`${g}: Invalid context value for key '${u}'. Expected a function call or attribute reference (${
|
|
1828
|
+
`${g}: Invalid context value for key '${u}'. Expected a function call or attribute reference (${T}...), but got: ${typeof c}`
|
|
1799
1829
|
);
|
|
1800
1830
|
}
|
|
1801
|
-
return [e[0], e[1],
|
|
1831
|
+
return [e[0], e[1], o, ...e.slice(3)];
|
|
1802
1832
|
}
|
|
1803
|
-
function
|
|
1804
|
-
const t =
|
|
1833
|
+
function qn(e) {
|
|
1834
|
+
const t = Vt(), r = Yt(e, t), s = {};
|
|
1805
1835
|
for (const n of r) {
|
|
1806
|
-
const i =
|
|
1836
|
+
const i = jt(n.functionName);
|
|
1807
1837
|
if (i !== void 0)
|
|
1808
|
-
for (const
|
|
1809
|
-
const
|
|
1810
|
-
if (
|
|
1838
|
+
for (const a of [n.ref1, n.ref2]) {
|
|
1839
|
+
const o = s[a];
|
|
1840
|
+
if (o !== void 0 && o !== i)
|
|
1811
1841
|
throw new Error(
|
|
1812
|
-
`Reference [${
|
|
1842
|
+
`Reference [${a}] is used in xdiff functions with conflicting date levels ('${o}' and '${i}'). Specify the date level in the context (e.g. DM.Table.Column.${i}).`
|
|
1813
1843
|
);
|
|
1814
|
-
s[
|
|
1844
|
+
s[a] = i;
|
|
1815
1845
|
}
|
|
1816
1846
|
}
|
|
1817
1847
|
return s;
|
|
1818
1848
|
}
|
|
1819
|
-
function
|
|
1820
|
-
return e.type ===
|
|
1849
|
+
function Qt(e) {
|
|
1850
|
+
return e.type === J.TextAttribute;
|
|
1821
1851
|
}
|
|
1822
|
-
function
|
|
1823
|
-
return e.type ===
|
|
1852
|
+
function Xt(e) {
|
|
1853
|
+
return e.type === J.NumericAttribute;
|
|
1824
1854
|
}
|
|
1825
|
-
function
|
|
1826
|
-
return e.type ===
|
|
1855
|
+
function Dn(e) {
|
|
1856
|
+
return e.type === J.DateLevel;
|
|
1827
1857
|
}
|
|
1828
|
-
function
|
|
1829
|
-
return
|
|
1858
|
+
function xn(e) {
|
|
1859
|
+
return Qt(e) || Xt(e);
|
|
1830
1860
|
}
|
|
1831
|
-
function
|
|
1832
|
-
return e.type ===
|
|
1861
|
+
function ye(e) {
|
|
1862
|
+
return e.type === J.TextAttribute ? "text" : e.type === J.NumericAttribute ? "numeric" : e.type === J.DateLevel ? "date/datetime" : "unknown";
|
|
1833
1863
|
}
|
|
1834
|
-
function
|
|
1864
|
+
function We(e, t) {
|
|
1835
1865
|
const r = e[0];
|
|
1836
1866
|
if (!r || typeof r != "object" || !("type" in r))
|
|
1837
1867
|
throw new Error(`${t.pathPrefix}args[0]: Expected attribute as first argument`);
|
|
1838
1868
|
return r;
|
|
1839
1869
|
}
|
|
1840
|
-
function
|
|
1841
|
-
const r =
|
|
1842
|
-
if (!
|
|
1870
|
+
function rt(e, t) {
|
|
1871
|
+
const r = We(e, t);
|
|
1872
|
+
if (!xn(r))
|
|
1843
1873
|
throw new Error(
|
|
1844
|
-
`${t.pathPrefix}args[0]: Attribute must be string or numeric type, got ${
|
|
1874
|
+
`${t.pathPrefix}args[0]: Attribute must be string or numeric type, got ${ye(
|
|
1845
1875
|
r
|
|
1846
1876
|
)} attribute`
|
|
1847
1877
|
);
|
|
1848
1878
|
return e;
|
|
1849
1879
|
}
|
|
1850
|
-
function
|
|
1851
|
-
const r =
|
|
1852
|
-
if (!
|
|
1880
|
+
function B(e, t) {
|
|
1881
|
+
const r = We(e, t);
|
|
1882
|
+
if (!Xt(r))
|
|
1853
1883
|
throw new Error(
|
|
1854
|
-
`${t.pathPrefix}args[0]: Attribute must be numeric type, got ${
|
|
1884
|
+
`${t.pathPrefix}args[0]: Attribute must be numeric type, got ${ye(
|
|
1855
1885
|
r
|
|
1856
1886
|
)} attribute`
|
|
1857
1887
|
);
|
|
1858
1888
|
return e;
|
|
1859
1889
|
}
|
|
1860
|
-
function
|
|
1861
|
-
const r =
|
|
1862
|
-
if (!
|
|
1890
|
+
function _(e, t) {
|
|
1891
|
+
const r = We(e, t);
|
|
1892
|
+
if (!Qt(r))
|
|
1863
1893
|
throw new Error(
|
|
1864
|
-
`${t.pathPrefix}args[0]: Attribute must be string type, got ${
|
|
1894
|
+
`${t.pathPrefix}args[0]: Attribute must be string type, got ${ye(
|
|
1865
1895
|
r
|
|
1866
1896
|
)} attribute`
|
|
1867
1897
|
);
|
|
1868
1898
|
return e;
|
|
1869
1899
|
}
|
|
1870
|
-
function
|
|
1900
|
+
function Nn(e, t) {
|
|
1871
1901
|
const r = e[0];
|
|
1872
1902
|
if (!r || typeof r != "object" || !("attribute" in r))
|
|
1873
1903
|
throw new Error(`${t.pathPrefix}args[0]: Expected filter as first argument`);
|
|
1874
1904
|
return r;
|
|
1875
1905
|
}
|
|
1876
|
-
function
|
|
1877
|
-
const r =
|
|
1878
|
-
if (!
|
|
1906
|
+
function vn(e, t) {
|
|
1907
|
+
const r = Nn(e, t);
|
|
1908
|
+
if (!Me(r))
|
|
1879
1909
|
throw new Error(
|
|
1880
1910
|
`${t.pathPrefix}args[0]: exclude filter only accepts members filter, got ${r.__serializable || "unknown"} filter`
|
|
1881
1911
|
);
|
|
1882
1912
|
return e;
|
|
1883
1913
|
}
|
|
1884
|
-
const
|
|
1885
|
-
|
|
1914
|
+
const Mn = "FilterRelations (filterFactory.logic.or / filterFactory.logic.and) is not supported inside measureFactory.measuredValue filters. Use plain filters only, or apply logical relations at the query filter level.";
|
|
1915
|
+
function Rn(e, t) {
|
|
1916
|
+
const r = e[1];
|
|
1917
|
+
return Array.isArray(r) && r.forEach((s, n) => {
|
|
1918
|
+
if (!(typeof s != "object" || s === null) && H(s))
|
|
1919
|
+
throw new Error(
|
|
1920
|
+
`${t.pathPrefix}args[1][${n}]: ${Mn}`
|
|
1921
|
+
);
|
|
1922
|
+
}), e;
|
|
1923
|
+
}
|
|
1924
|
+
const In = {
|
|
1925
|
+
"measureFactory.customFormula": $n,
|
|
1926
|
+
"measureFactory.measuredValue": Rn,
|
|
1886
1927
|
// String | Number filters
|
|
1887
|
-
"filterFactory.equals":
|
|
1888
|
-
"filterFactory.doesntEqual":
|
|
1928
|
+
"filterFactory.equals": rt,
|
|
1929
|
+
"filterFactory.doesntEqual": rt,
|
|
1889
1930
|
// Numeric filters
|
|
1890
|
-
"filterFactory.greaterThan":
|
|
1891
|
-
"filterFactory.greaterThanOrEqual":
|
|
1892
|
-
"filterFactory.lessThan":
|
|
1893
|
-
"filterFactory.lessThanOrEqual":
|
|
1894
|
-
"filterFactory.between":
|
|
1895
|
-
"filterFactory.betweenNotEqual":
|
|
1896
|
-
"filterFactory.numeric":
|
|
1931
|
+
"filterFactory.greaterThan": B,
|
|
1932
|
+
"filterFactory.greaterThanOrEqual": B,
|
|
1933
|
+
"filterFactory.lessThan": B,
|
|
1934
|
+
"filterFactory.lessThanOrEqual": B,
|
|
1935
|
+
"filterFactory.between": B,
|
|
1936
|
+
"filterFactory.betweenNotEqual": B,
|
|
1937
|
+
"filterFactory.numeric": B,
|
|
1897
1938
|
// String filters
|
|
1898
|
-
"filterFactory.contains":
|
|
1899
|
-
"filterFactory.doesntContain":
|
|
1900
|
-
"filterFactory.startsWith":
|
|
1901
|
-
"filterFactory.doesntStartWith":
|
|
1902
|
-
"filterFactory.endsWith":
|
|
1903
|
-
"filterFactory.doesntEndWith":
|
|
1904
|
-
"filterFactory.like":
|
|
1939
|
+
"filterFactory.contains": _,
|
|
1940
|
+
"filterFactory.doesntContain": _,
|
|
1941
|
+
"filterFactory.startsWith": _,
|
|
1942
|
+
"filterFactory.doesntStartWith": _,
|
|
1943
|
+
"filterFactory.endsWith": _,
|
|
1944
|
+
"filterFactory.doesntEndWith": _,
|
|
1945
|
+
"filterFactory.like": _,
|
|
1905
1946
|
// Exclude filter
|
|
1906
|
-
"filterFactory.exclude":
|
|
1947
|
+
"filterFactory.exclude": vn
|
|
1907
1948
|
};
|
|
1908
|
-
function
|
|
1909
|
-
return
|
|
1949
|
+
function kn(e) {
|
|
1950
|
+
return In[`${e}`];
|
|
1910
1951
|
}
|
|
1911
|
-
const
|
|
1952
|
+
const Zt = {
|
|
1912
1953
|
// ==================== MEASURE FACTORY FUNCTIONS ====================
|
|
1913
1954
|
// Basic aggregations
|
|
1914
1955
|
"measureFactory.sum": [
|
|
1915
1956
|
{ type: "Attribute", required: !0 },
|
|
1916
|
-
{ type: "string", required: !1 },
|
|
1957
|
+
{ type: "string", required: !1, isName: !0 },
|
|
1917
1958
|
// name
|
|
1918
1959
|
{ type: "string", required: !1 }
|
|
1919
1960
|
// format
|
|
1920
1961
|
],
|
|
1921
1962
|
"measureFactory.average": [
|
|
1922
1963
|
{ type: "Attribute", required: !0 },
|
|
1923
|
-
{ type: "string", required: !1 },
|
|
1964
|
+
{ type: "string", required: !1, isName: !0 },
|
|
1924
1965
|
// name
|
|
1925
1966
|
{ type: "string", required: !1 }
|
|
1926
1967
|
// format
|
|
1927
1968
|
],
|
|
1928
1969
|
"measureFactory.avg": [
|
|
1929
1970
|
{ type: "Attribute", required: !0 },
|
|
1930
|
-
{ type: "string", required: !1 },
|
|
1971
|
+
{ type: "string", required: !1, isName: !0 },
|
|
1931
1972
|
// name
|
|
1932
1973
|
{ type: "string", required: !1 }
|
|
1933
1974
|
// format
|
|
1934
1975
|
],
|
|
1935
1976
|
"measureFactory.min": [
|
|
1936
1977
|
{ type: "Attribute", required: !0 },
|
|
1937
|
-
{ type: "string", required: !1 },
|
|
1978
|
+
{ type: "string", required: !1, isName: !0 },
|
|
1938
1979
|
// name
|
|
1939
1980
|
{ type: "string", required: !1 }
|
|
1940
1981
|
// format
|
|
1941
1982
|
],
|
|
1942
1983
|
"measureFactory.max": [
|
|
1943
1984
|
{ type: "Attribute", required: !0 },
|
|
1944
|
-
{ type: "string", required: !1 },
|
|
1985
|
+
{ type: "string", required: !1, isName: !0 },
|
|
1945
1986
|
// name
|
|
1946
1987
|
{ type: "string", required: !1 }
|
|
1947
1988
|
// format
|
|
1948
1989
|
],
|
|
1949
1990
|
"measureFactory.median": [
|
|
1950
1991
|
{ type: "Attribute", required: !0 },
|
|
1951
|
-
{ type: "string", required: !1 },
|
|
1992
|
+
{ type: "string", required: !1, isName: !0 },
|
|
1952
1993
|
// name
|
|
1953
1994
|
{ type: "string", required: !1 }
|
|
1954
1995
|
// format
|
|
1955
1996
|
],
|
|
1956
1997
|
"measureFactory.count": [
|
|
1957
1998
|
{ type: "Attribute", required: !0 },
|
|
1958
|
-
{ type: "string", required: !1 },
|
|
1999
|
+
{ type: "string", required: !1, isName: !0 },
|
|
1959
2000
|
// name
|
|
1960
2001
|
{ type: "string", required: !1 }
|
|
1961
2002
|
// format
|
|
1962
2003
|
],
|
|
1963
2004
|
"measureFactory.countDistinct": [
|
|
1964
2005
|
{ type: "Attribute", required: !0 },
|
|
1965
|
-
{ type: "string", required: !1 },
|
|
2006
|
+
{ type: "string", required: !1, isName: !0 },
|
|
1966
2007
|
// name
|
|
1967
2008
|
{ type: "string", required: !1 }
|
|
1968
2009
|
// format
|
|
@@ -1971,7 +2012,7 @@ const Jt = {
|
|
|
1971
2012
|
{ type: "Attribute", required: !0 },
|
|
1972
2013
|
{ type: "string", required: !0 },
|
|
1973
2014
|
// aggregationType
|
|
1974
|
-
{ type: "string", required: !1 },
|
|
2015
|
+
{ type: "string", required: !1, isName: !0 },
|
|
1975
2016
|
// name
|
|
1976
2017
|
{ type: "string", required: !1 }
|
|
1977
2018
|
// format
|
|
@@ -1979,7 +2020,7 @@ const Jt = {
|
|
|
1979
2020
|
// Constants and formulas
|
|
1980
2021
|
"measureFactory.constant": [{ type: "number", required: !0 }],
|
|
1981
2022
|
"measureFactory.customFormula": [
|
|
1982
|
-
{ type: "string", required: !0 },
|
|
2023
|
+
{ type: "string", required: !0, isName: !0 },
|
|
1983
2024
|
// title
|
|
1984
2025
|
{ type: "string", required: !0 },
|
|
1985
2026
|
// formula
|
|
@@ -1994,7 +2035,7 @@ const Jt = {
|
|
|
1994
2035
|
"measureFactory.add": [
|
|
1995
2036
|
{ type: "Measure | number", required: !0 },
|
|
1996
2037
|
{ type: "Measure | number", required: !0 },
|
|
1997
|
-
{ type: "string", required: !1 },
|
|
2038
|
+
{ type: "string", required: !1, isName: !0 },
|
|
1998
2039
|
// name
|
|
1999
2040
|
{ type: "boolean", required: !1 }
|
|
2000
2041
|
// withParentheses
|
|
@@ -2002,7 +2043,7 @@ const Jt = {
|
|
|
2002
2043
|
"measureFactory.subtract": [
|
|
2003
2044
|
{ type: "Measure | number", required: !0 },
|
|
2004
2045
|
{ type: "Measure | number", required: !0 },
|
|
2005
|
-
{ type: "string", required: !1 },
|
|
2046
|
+
{ type: "string", required: !1, isName: !0 },
|
|
2006
2047
|
// name
|
|
2007
2048
|
{ type: "boolean", required: !1 }
|
|
2008
2049
|
// withParentheses
|
|
@@ -2010,7 +2051,7 @@ const Jt = {
|
|
|
2010
2051
|
"measureFactory.multiply": [
|
|
2011
2052
|
{ type: "Measure | number", required: !0 },
|
|
2012
2053
|
{ type: "Measure | number", required: !0 },
|
|
2013
|
-
{ type: "string", required: !1 },
|
|
2054
|
+
{ type: "string", required: !1, isName: !0 },
|
|
2014
2055
|
// name
|
|
2015
2056
|
{ type: "boolean", required: !1 }
|
|
2016
2057
|
// withParentheses
|
|
@@ -2018,7 +2059,7 @@ const Jt = {
|
|
|
2018
2059
|
"measureFactory.divide": [
|
|
2019
2060
|
{ type: "Measure | number", required: !0 },
|
|
2020
2061
|
{ type: "Measure | number", required: !0 },
|
|
2021
|
-
{ type: "string", required: !1 },
|
|
2062
|
+
{ type: "string", required: !1, isName: !0 },
|
|
2022
2063
|
// name
|
|
2023
2064
|
{ type: "boolean", required: !1 }
|
|
2024
2065
|
// withParentheses
|
|
@@ -2027,14 +2068,14 @@ const Jt = {
|
|
|
2027
2068
|
"measureFactory.measuredValue": [
|
|
2028
2069
|
{ type: "Measure", required: !0 },
|
|
2029
2070
|
{ type: "Filter[]", required: !0 },
|
|
2030
|
-
{ type: "string", required: !1 },
|
|
2071
|
+
{ type: "string", required: !1, isName: !0 },
|
|
2031
2072
|
// name
|
|
2032
2073
|
{ type: "string", required: !1 }
|
|
2033
2074
|
// format
|
|
2034
2075
|
],
|
|
2035
2076
|
"measureFactory.rank": [
|
|
2036
2077
|
{ type: "Measure", required: !0 },
|
|
2037
|
-
{ type: "string", required: !1 },
|
|
2078
|
+
{ type: "string", required: !1, isName: !0 },
|
|
2038
2079
|
// name
|
|
2039
2080
|
{ type: "string", required: !1 },
|
|
2040
2081
|
// sort
|
|
@@ -2045,14 +2086,14 @@ const Jt = {
|
|
|
2045
2086
|
],
|
|
2046
2087
|
"measureFactory.trend": [
|
|
2047
2088
|
{ type: "Measure", required: !0 },
|
|
2048
|
-
{ type: "string", required: !1 },
|
|
2089
|
+
{ type: "string", required: !1, isName: !0 },
|
|
2049
2090
|
// name
|
|
2050
2091
|
{ type: "any", required: !1 }
|
|
2051
2092
|
// options
|
|
2052
2093
|
],
|
|
2053
2094
|
"measureFactory.forecast": [
|
|
2054
2095
|
{ type: "Measure", required: !0 },
|
|
2055
|
-
{ type: "string", required: !1 },
|
|
2096
|
+
{ type: "string", required: !1, isName: !0 },
|
|
2056
2097
|
// name
|
|
2057
2098
|
{ type: "any", required: !1 }
|
|
2058
2099
|
// options
|
|
@@ -2060,117 +2101,117 @@ const Jt = {
|
|
|
2060
2101
|
// Time-based aggregations
|
|
2061
2102
|
"measureFactory.yearToDateSum": [
|
|
2062
2103
|
{ type: "Measure", required: !0 },
|
|
2063
|
-
{ type: "string", required: !1 }
|
|
2104
|
+
{ type: "string", required: !1, isName: !0 }
|
|
2064
2105
|
// name
|
|
2065
2106
|
],
|
|
2066
2107
|
"measureFactory.quarterToDateSum": [
|
|
2067
2108
|
{ type: "Measure", required: !0 },
|
|
2068
|
-
{ type: "string", required: !1 }
|
|
2109
|
+
{ type: "string", required: !1, isName: !0 }
|
|
2069
2110
|
// name
|
|
2070
2111
|
],
|
|
2071
2112
|
"measureFactory.monthToDateSum": [
|
|
2072
2113
|
{ type: "Measure", required: !0 },
|
|
2073
|
-
{ type: "string", required: !1 }
|
|
2114
|
+
{ type: "string", required: !1, isName: !0 }
|
|
2074
2115
|
// name
|
|
2075
2116
|
],
|
|
2076
2117
|
"measureFactory.weekToDateSum": [
|
|
2077
2118
|
{ type: "Measure", required: !0 },
|
|
2078
|
-
{ type: "string", required: !1 }
|
|
2119
|
+
{ type: "string", required: !1, isName: !0 }
|
|
2079
2120
|
// name
|
|
2080
2121
|
],
|
|
2081
2122
|
"measureFactory.runningSum": [
|
|
2082
2123
|
{ type: "Measure", required: !0 },
|
|
2083
2124
|
{ type: "boolean", required: !1 },
|
|
2084
2125
|
// continuous
|
|
2085
|
-
{ type: "string", required: !1 }
|
|
2126
|
+
{ type: "string", required: !1, isName: !0 }
|
|
2086
2127
|
// name
|
|
2087
2128
|
],
|
|
2088
2129
|
// Growth and difference calculations
|
|
2089
2130
|
"measureFactory.growth": [
|
|
2090
2131
|
{ type: "Measure", required: !0 },
|
|
2091
|
-
{ type: "string", required: !1 }
|
|
2132
|
+
{ type: "string", required: !1, isName: !0 }
|
|
2092
2133
|
// name
|
|
2093
2134
|
],
|
|
2094
2135
|
"measureFactory.growthRate": [
|
|
2095
2136
|
{ type: "Measure", required: !0 },
|
|
2096
|
-
{ type: "string", required: !1 }
|
|
2137
|
+
{ type: "string", required: !1, isName: !0 }
|
|
2097
2138
|
// name
|
|
2098
2139
|
],
|
|
2099
2140
|
"measureFactory.growthPastWeek": [
|
|
2100
2141
|
{ type: "Measure", required: !0 },
|
|
2101
|
-
{ type: "string", required: !1 }
|
|
2142
|
+
{ type: "string", required: !1, isName: !0 }
|
|
2102
2143
|
// name
|
|
2103
2144
|
],
|
|
2104
2145
|
"measureFactory.growthPastMonth": [
|
|
2105
2146
|
{ type: "Measure", required: !0 },
|
|
2106
|
-
{ type: "string", required: !1 }
|
|
2147
|
+
{ type: "string", required: !1, isName: !0 }
|
|
2107
2148
|
// name
|
|
2108
2149
|
],
|
|
2109
2150
|
"measureFactory.growthPastQuarter": [
|
|
2110
2151
|
{ type: "Measure", required: !0 },
|
|
2111
|
-
{ type: "string", required: !1 }
|
|
2152
|
+
{ type: "string", required: !1, isName: !0 }
|
|
2112
2153
|
// name
|
|
2113
2154
|
],
|
|
2114
2155
|
"measureFactory.growthPastYear": [
|
|
2115
2156
|
{ type: "Measure", required: !0 },
|
|
2116
|
-
{ type: "string", required: !1 }
|
|
2157
|
+
{ type: "string", required: !1, isName: !0 }
|
|
2117
2158
|
// name
|
|
2118
2159
|
],
|
|
2119
2160
|
"measureFactory.difference": [
|
|
2120
2161
|
{ type: "Measure", required: !0 },
|
|
2121
|
-
{ type: "string", required: !1 }
|
|
2162
|
+
{ type: "string", required: !1, isName: !0 }
|
|
2122
2163
|
// name
|
|
2123
2164
|
],
|
|
2124
2165
|
"measureFactory.diffPastWeek": [
|
|
2125
2166
|
{ type: "Measure", required: !0 },
|
|
2126
|
-
{ type: "string", required: !1 }
|
|
2167
|
+
{ type: "string", required: !1, isName: !0 }
|
|
2127
2168
|
// name
|
|
2128
2169
|
],
|
|
2129
2170
|
"measureFactory.diffPastMonth": [
|
|
2130
2171
|
{ type: "Measure", required: !0 },
|
|
2131
|
-
{ type: "string", required: !1 }
|
|
2172
|
+
{ type: "string", required: !1, isName: !0 }
|
|
2132
2173
|
// name
|
|
2133
2174
|
],
|
|
2134
2175
|
"measureFactory.diffPastQuarter": [
|
|
2135
2176
|
{ type: "Measure", required: !0 },
|
|
2136
|
-
{ type: "string", required: !1 }
|
|
2177
|
+
{ type: "string", required: !1, isName: !0 }
|
|
2137
2178
|
// name
|
|
2138
2179
|
],
|
|
2139
2180
|
"measureFactory.diffPastYear": [
|
|
2140
2181
|
{ type: "Measure", required: !0 },
|
|
2141
|
-
{ type: "string", required: !1 }
|
|
2182
|
+
{ type: "string", required: !1, isName: !0 }
|
|
2142
2183
|
// name
|
|
2143
2184
|
],
|
|
2144
2185
|
// Past period measures
|
|
2145
2186
|
"measureFactory.pastDay": [
|
|
2146
2187
|
{ type: "Measure", required: !0 },
|
|
2147
|
-
{ type: "string", required: !1 }
|
|
2188
|
+
{ type: "string", required: !1, isName: !0 }
|
|
2148
2189
|
// name
|
|
2149
2190
|
],
|
|
2150
2191
|
"measureFactory.pastWeek": [
|
|
2151
2192
|
{ type: "Measure", required: !0 },
|
|
2152
|
-
{ type: "string", required: !1 }
|
|
2193
|
+
{ type: "string", required: !1, isName: !0 }
|
|
2153
2194
|
// name
|
|
2154
2195
|
],
|
|
2155
2196
|
"measureFactory.pastMonth": [
|
|
2156
2197
|
{ type: "Measure", required: !0 },
|
|
2157
|
-
{ type: "string", required: !1 }
|
|
2198
|
+
{ type: "string", required: !1, isName: !0 }
|
|
2158
2199
|
// name
|
|
2159
2200
|
],
|
|
2160
2201
|
"measureFactory.pastQuarter": [
|
|
2161
2202
|
{ type: "Measure", required: !0 },
|
|
2162
|
-
{ type: "string", required: !1 }
|
|
2203
|
+
{ type: "string", required: !1, isName: !0 }
|
|
2163
2204
|
// name
|
|
2164
2205
|
],
|
|
2165
2206
|
"measureFactory.pastYear": [
|
|
2166
2207
|
{ type: "Measure", required: !0 },
|
|
2167
|
-
{ type: "string", required: !1 }
|
|
2208
|
+
{ type: "string", required: !1, isName: !0 }
|
|
2168
2209
|
// name
|
|
2169
2210
|
],
|
|
2170
2211
|
// Statistics
|
|
2171
2212
|
"measureFactory.contribution": [
|
|
2172
2213
|
{ type: "Measure", required: !0 },
|
|
2173
|
-
{ type: "string", required: !1 }
|
|
2214
|
+
{ type: "string", required: !1, isName: !0 }
|
|
2174
2215
|
// name
|
|
2175
2216
|
],
|
|
2176
2217
|
// ==================== FILTER FACTORY FUNCTIONS ====================
|
|
@@ -2435,18 +2476,18 @@ const Jt = {
|
|
|
2435
2476
|
{ type: "FilterRelationsNode", required: !0 }
|
|
2436
2477
|
]
|
|
2437
2478
|
};
|
|
2438
|
-
function
|
|
2439
|
-
return
|
|
2479
|
+
function he(e) {
|
|
2480
|
+
return Zt[`${e}`];
|
|
2440
2481
|
}
|
|
2441
|
-
function
|
|
2442
|
-
const t =
|
|
2482
|
+
function Ln(e) {
|
|
2483
|
+
const t = he(e);
|
|
2443
2484
|
return t ? t.filter((r) => r.required).length : 0;
|
|
2444
2485
|
}
|
|
2445
|
-
function
|
|
2446
|
-
const t =
|
|
2486
|
+
function Bn(e) {
|
|
2487
|
+
const t = he(e);
|
|
2447
2488
|
return t ? t.length : 0;
|
|
2448
2489
|
}
|
|
2449
|
-
function
|
|
2490
|
+
function _n(e) {
|
|
2450
2491
|
if (typeof e != "string" || !/^\d{4}-\d{2}-\d{2}/.test(e))
|
|
2451
2492
|
return !1;
|
|
2452
2493
|
const r = Date.parse(e);
|
|
@@ -2455,319 +2496,319 @@ function Mn(e) {
|
|
|
2455
2496
|
const s = new Date(e);
|
|
2456
2497
|
return !isNaN(s.getTime());
|
|
2457
2498
|
}
|
|
2458
|
-
function
|
|
2459
|
-
if (e.startsWith(
|
|
2499
|
+
function Se(e, t, r, s) {
|
|
2500
|
+
if (e.startsWith(T))
|
|
2460
2501
|
try {
|
|
2461
|
-
return
|
|
2502
|
+
return re(e, t, r);
|
|
2462
2503
|
} catch (n) {
|
|
2463
2504
|
const i = n instanceof Error ? n.message : "Unknown error";
|
|
2464
2505
|
throw new Error(`${s}: ${i}`);
|
|
2465
2506
|
}
|
|
2466
2507
|
throw new Error(
|
|
2467
|
-
`${s}: Invalid attribute '${e}'. Expected format: '${
|
|
2508
|
+
`${s}: Invalid attribute '${e}'. Expected format: '${T}TableName.ColumnName[.Level]'`
|
|
2468
2509
|
);
|
|
2469
2510
|
}
|
|
2470
|
-
function
|
|
2471
|
-
if (e.startsWith(
|
|
2511
|
+
function zn(e, t, r, s) {
|
|
2512
|
+
if (e.startsWith(T))
|
|
2472
2513
|
try {
|
|
2473
|
-
return
|
|
2514
|
+
return Hs(e, t, r);
|
|
2474
2515
|
} catch (n) {
|
|
2475
2516
|
const i = n instanceof Error ? n.message : "Unknown error";
|
|
2476
2517
|
throw new Error(`${s}: ${i}`);
|
|
2477
2518
|
}
|
|
2478
2519
|
throw new Error(
|
|
2479
|
-
`${s}: Invalid date dimension string '${e}'. Expected format: '${
|
|
2520
|
+
`${s}: Invalid date dimension string '${e}'. Expected format: '${T}TableName.ColumnName'`
|
|
2480
2521
|
);
|
|
2481
2522
|
}
|
|
2482
|
-
function
|
|
2483
|
-
const t = e.data, { argSchema: r, dataSource: s, schemaIndex: n, pathPrefix: i } = e.context,
|
|
2523
|
+
function Un(e) {
|
|
2524
|
+
const t = e.data, { argSchema: r, dataSource: s, schemaIndex: n, pathPrefix: i } = e.context, a = i;
|
|
2484
2525
|
if (t === void 0) {
|
|
2485
2526
|
if (r.required)
|
|
2486
|
-
throw new Error(`${
|
|
2527
|
+
throw new Error(`${a}: Required argument is missing (expected ${r.type})`);
|
|
2487
2528
|
return;
|
|
2488
2529
|
}
|
|
2489
2530
|
if (!(t === null && !r.required))
|
|
2490
2531
|
switch (r.type) {
|
|
2491
2532
|
case "string":
|
|
2492
2533
|
if (typeof t != "string")
|
|
2493
|
-
throw new Error(`${
|
|
2534
|
+
throw new Error(`${a}: Expected string, got ${typeof t}`);
|
|
2494
2535
|
return t;
|
|
2495
2536
|
case "number":
|
|
2496
2537
|
if (typeof t != "number")
|
|
2497
|
-
throw new Error(`${
|
|
2538
|
+
throw new Error(`${a}: Expected number, got ${typeof t}`);
|
|
2498
2539
|
return t;
|
|
2499
2540
|
case "boolean":
|
|
2500
2541
|
if (typeof t != "boolean")
|
|
2501
|
-
throw new Error(`${
|
|
2542
|
+
throw new Error(`${a}: Expected boolean, got ${typeof t}`);
|
|
2502
2543
|
return t;
|
|
2503
2544
|
case "string[]":
|
|
2504
2545
|
if (!Array.isArray(t))
|
|
2505
2546
|
throw new Error(
|
|
2506
|
-
`${
|
|
2547
|
+
`${a}: Expected array of strings, got ${typeof t}. Example: ['value1', 'value2']`
|
|
2507
2548
|
);
|
|
2508
|
-
if (!t.every((
|
|
2549
|
+
if (!t.every((o) => typeof o == "string"))
|
|
2509
2550
|
throw new Error(
|
|
2510
|
-
`${
|
|
2551
|
+
`${a}: Expected array of strings, but contains non-string values`
|
|
2511
2552
|
);
|
|
2512
2553
|
return t;
|
|
2513
2554
|
case "number[]":
|
|
2514
2555
|
if (!Array.isArray(t))
|
|
2515
2556
|
throw new Error(
|
|
2516
|
-
`${
|
|
2557
|
+
`${a}: Expected array of numbers, got ${typeof t}. Example: [10, 20]`
|
|
2517
2558
|
);
|
|
2518
|
-
if (!t.every((
|
|
2559
|
+
if (!t.every((o) => typeof o == "number"))
|
|
2519
2560
|
throw new Error(
|
|
2520
|
-
`${
|
|
2561
|
+
`${a}: Expected array of numbers, but contains non-number values`
|
|
2521
2562
|
);
|
|
2522
2563
|
return t;
|
|
2523
2564
|
case "Attribute":
|
|
2524
2565
|
if (typeof t != "string")
|
|
2525
2566
|
throw new Error(
|
|
2526
|
-
`${
|
|
2567
|
+
`${a}: Expected attribute string, got ${typeof t}. Example: 'DM.Commerce.Revenue'`
|
|
2527
2568
|
);
|
|
2528
|
-
return
|
|
2569
|
+
return Se(t, s, n, a);
|
|
2529
2570
|
case "Attribute[]":
|
|
2530
2571
|
if (!Array.isArray(t))
|
|
2531
2572
|
throw new Error(
|
|
2532
|
-
`${
|
|
2573
|
+
`${a}: Expected array of attributes, got ${typeof t}. Example: ['DM.Commerce.AgeRange']`
|
|
2533
2574
|
);
|
|
2534
|
-
return t.map((
|
|
2535
|
-
if (typeof
|
|
2536
|
-
throw new Error(`${
|
|
2537
|
-
return
|
|
2575
|
+
return t.map((o, u) => {
|
|
2576
|
+
if (typeof o != "string")
|
|
2577
|
+
throw new Error(`${a}[${u}]: Expected attribute string, got ${typeof o}`);
|
|
2578
|
+
return Se(o, s, n, `${a}[${u}]`);
|
|
2538
2579
|
});
|
|
2539
2580
|
case "Measure":
|
|
2540
2581
|
case "BaseMeasure":
|
|
2541
|
-
if (!
|
|
2582
|
+
if (!w(t))
|
|
2542
2583
|
throw new Error(
|
|
2543
|
-
`${
|
|
2584
|
+
`${a}: Expected measure function call, got ${typeof t}. Example: {'function': 'measureFactory.sum', 'args': ['DM.Commerce.Revenue']}`
|
|
2544
2585
|
);
|
|
2545
2586
|
return M({
|
|
2546
2587
|
data: t,
|
|
2547
|
-
context: { dataSource: s, schemaIndex: n, pathPrefix:
|
|
2588
|
+
context: { dataSource: s, schemaIndex: n, pathPrefix: a }
|
|
2548
2589
|
});
|
|
2549
2590
|
case "Measure[]":
|
|
2550
2591
|
if (!Array.isArray(t))
|
|
2551
2592
|
throw new Error(
|
|
2552
|
-
`${
|
|
2593
|
+
`${a}: Expected array of measure function calls, got ${typeof t}`
|
|
2553
2594
|
);
|
|
2554
|
-
return t.map((
|
|
2555
|
-
if (!
|
|
2595
|
+
return t.map((o, u) => {
|
|
2596
|
+
if (!w(o))
|
|
2556
2597
|
throw new Error(
|
|
2557
|
-
`${
|
|
2598
|
+
`${a}[${u}]: Expected measure function call, got ${typeof o}`
|
|
2558
2599
|
);
|
|
2559
2600
|
return M({
|
|
2560
|
-
data:
|
|
2561
|
-
context: { dataSource: s, schemaIndex: n, pathPrefix: `${
|
|
2601
|
+
data: o,
|
|
2602
|
+
context: { dataSource: s, schemaIndex: n, pathPrefix: `${a}[${u}]` }
|
|
2562
2603
|
});
|
|
2563
2604
|
});
|
|
2564
2605
|
case "Filter":
|
|
2565
|
-
if (!
|
|
2606
|
+
if (!w(t))
|
|
2566
2607
|
throw new Error(
|
|
2567
|
-
`${
|
|
2608
|
+
`${a}: Expected filter function call, got ${typeof t}. Example: {'function': 'filterFactory.contains', 'args': ['DM.Brand.Brand', 'Apple']}`
|
|
2568
2609
|
);
|
|
2569
2610
|
return M({
|
|
2570
2611
|
data: t,
|
|
2571
|
-
context: { dataSource: s, schemaIndex: n, pathPrefix:
|
|
2612
|
+
context: { dataSource: s, schemaIndex: n, pathPrefix: a }
|
|
2572
2613
|
});
|
|
2573
2614
|
case "Filter[]":
|
|
2574
2615
|
if (!Array.isArray(t))
|
|
2575
2616
|
throw new Error(
|
|
2576
|
-
`${
|
|
2617
|
+
`${a}: Expected array of filter function calls, got ${typeof t}`
|
|
2577
2618
|
);
|
|
2578
|
-
return t.map((
|
|
2579
|
-
if (!
|
|
2619
|
+
return t.map((o, u) => {
|
|
2620
|
+
if (!w(o))
|
|
2580
2621
|
throw new Error(
|
|
2581
|
-
`${
|
|
2622
|
+
`${a}[${u}]: Expected filter function call, got ${typeof o}`
|
|
2582
2623
|
);
|
|
2583
2624
|
return M({
|
|
2584
|
-
data:
|
|
2585
|
-
context: { dataSource: s, schemaIndex: n, pathPrefix: `${
|
|
2625
|
+
data: o,
|
|
2626
|
+
context: { dataSource: s, schemaIndex: n, pathPrefix: `${a}[${u}]` }
|
|
2586
2627
|
});
|
|
2587
2628
|
});
|
|
2588
2629
|
case "FilterRelationsNode":
|
|
2589
2630
|
if (Array.isArray(t))
|
|
2590
|
-
return t.map((
|
|
2591
|
-
if (!
|
|
2631
|
+
return t.map((o, u) => {
|
|
2632
|
+
if (!w(o))
|
|
2592
2633
|
throw new Error(
|
|
2593
|
-
`${
|
|
2634
|
+
`${a}[${u}]: Expected filter function call, got ${typeof o}`
|
|
2594
2635
|
);
|
|
2595
2636
|
return M({
|
|
2596
|
-
data:
|
|
2597
|
-
context: { dataSource: s, schemaIndex: n, pathPrefix: `${
|
|
2637
|
+
data: o,
|
|
2638
|
+
context: { dataSource: s, schemaIndex: n, pathPrefix: `${a}[${u}]` }
|
|
2598
2639
|
});
|
|
2599
2640
|
});
|
|
2600
|
-
if (
|
|
2641
|
+
if (w(t))
|
|
2601
2642
|
return M({
|
|
2602
2643
|
data: t,
|
|
2603
|
-
context: { dataSource: s, schemaIndex: n, pathPrefix:
|
|
2644
|
+
context: { dataSource: s, schemaIndex: n, pathPrefix: a }
|
|
2604
2645
|
});
|
|
2605
2646
|
throw new Error(
|
|
2606
|
-
`${
|
|
2647
|
+
`${a}: Expected filter function call or array of filters, got ${typeof t}`
|
|
2607
2648
|
);
|
|
2608
2649
|
case "DateDimension":
|
|
2609
2650
|
if (typeof t != "string")
|
|
2610
2651
|
throw new Error(
|
|
2611
|
-
`${
|
|
2652
|
+
`${a}: Expected date dimension string, got ${typeof t}. Example: 'DM.Commerce.Date'`
|
|
2612
2653
|
);
|
|
2613
|
-
return
|
|
2654
|
+
return zn(t, s, n, a);
|
|
2614
2655
|
case "LevelAttribute": {
|
|
2615
2656
|
if (typeof t != "string")
|
|
2616
2657
|
throw new Error(
|
|
2617
|
-
`${
|
|
2658
|
+
`${a}: Expected date attribute string, got ${typeof t}. Example: 'DM.Commerce.Date.Years'`
|
|
2618
2659
|
);
|
|
2619
|
-
const
|
|
2660
|
+
const o = Se(
|
|
2620
2661
|
t,
|
|
2621
2662
|
s,
|
|
2622
2663
|
n,
|
|
2623
|
-
|
|
2664
|
+
a
|
|
2624
2665
|
);
|
|
2625
|
-
if (!
|
|
2666
|
+
if (!Dn(o))
|
|
2626
2667
|
throw new Error(
|
|
2627
|
-
`${
|
|
2628
|
-
|
|
2668
|
+
`${a}: Attribute must be date/datetime type, got ${ye(
|
|
2669
|
+
o
|
|
2629
2670
|
)} attribute`
|
|
2630
2671
|
);
|
|
2631
|
-
return
|
|
2672
|
+
return o;
|
|
2632
2673
|
}
|
|
2633
2674
|
case "Measure | number":
|
|
2634
2675
|
if (typeof t == "number")
|
|
2635
2676
|
return t;
|
|
2636
|
-
if (
|
|
2677
|
+
if (w(t))
|
|
2637
2678
|
return M({
|
|
2638
2679
|
data: t,
|
|
2639
|
-
context: { dataSource: s, schemaIndex: n, pathPrefix:
|
|
2680
|
+
context: { dataSource: s, schemaIndex: n, pathPrefix: a }
|
|
2640
2681
|
});
|
|
2641
2682
|
throw new Error(
|
|
2642
|
-
`${
|
|
2683
|
+
`${a}: Expected measure function call or number, got ${typeof t}`
|
|
2643
2684
|
);
|
|
2644
2685
|
case "Date | string":
|
|
2645
2686
|
if (typeof t == "string") {
|
|
2646
|
-
if (
|
|
2687
|
+
if (_n(t))
|
|
2647
2688
|
return t;
|
|
2648
2689
|
throw new Error(
|
|
2649
|
-
`${
|
|
2690
|
+
`${a}: Expected valid ISO date string or Date object, got invalid date string '${t}'`
|
|
2650
2691
|
);
|
|
2651
2692
|
} else {
|
|
2652
2693
|
if (t instanceof Date)
|
|
2653
2694
|
return t;
|
|
2654
2695
|
throw new Error(
|
|
2655
|
-
`${
|
|
2696
|
+
`${a}: Expected date string or Date object, got ${typeof t}`
|
|
2656
2697
|
);
|
|
2657
2698
|
}
|
|
2658
2699
|
case "string | number":
|
|
2659
2700
|
if (typeof t == "string" || typeof t == "number")
|
|
2660
2701
|
return t;
|
|
2661
|
-
throw new Error(`${
|
|
2702
|
+
throw new Error(`${a}: Expected string or number, got ${typeof t}`);
|
|
2662
2703
|
case "BaseFilterConfig":
|
|
2663
2704
|
case "MembersFilterConfig":
|
|
2664
2705
|
case "CustomFormulaContext":
|
|
2665
2706
|
case "any":
|
|
2666
2707
|
if (t == null && r.required)
|
|
2667
|
-
throw new Error(`${
|
|
2708
|
+
throw new Error(`${a}: Required argument is null/undefined`);
|
|
2668
2709
|
return t;
|
|
2669
2710
|
default:
|
|
2670
2711
|
return t;
|
|
2671
2712
|
}
|
|
2672
2713
|
}
|
|
2673
2714
|
function M(e) {
|
|
2674
|
-
const { data: t } = e, { dataSource: r, schemaIndex: s, pathPrefix: n } = e.context, { function: i, args:
|
|
2715
|
+
const { data: t } = e, { dataSource: r, schemaIndex: s, pathPrefix: n } = e.context, { function: i, args: a } = t, o = n ? `${n}.` : "", u = he(i);
|
|
2675
2716
|
if (!u) {
|
|
2676
|
-
const
|
|
2717
|
+
const m = Object.keys(Zt), F = x(i, m, (N) => N), O = F && F.distance <= C ? ` Did you mean '${F.best}'?` : "";
|
|
2677
2718
|
throw new Error(
|
|
2678
|
-
`${
|
|
2719
|
+
`${o}function: Unknown function '${i}'.${O}`
|
|
2679
2720
|
);
|
|
2680
2721
|
}
|
|
2681
|
-
const c =
|
|
2682
|
-
if (
|
|
2722
|
+
const c = Ln(i), g = Bn(i);
|
|
2723
|
+
if (a.length < c)
|
|
2683
2724
|
throw new Error(
|
|
2684
|
-
`${
|
|
2725
|
+
`${o}function: Expected at least ${c} arguments, got ${a.length}`
|
|
2685
2726
|
);
|
|
2686
|
-
if (
|
|
2727
|
+
if (a.length > g)
|
|
2687
2728
|
throw new Error(
|
|
2688
|
-
`${
|
|
2729
|
+
`${o}function: Expected at most ${g} arguments, got ${a.length}`
|
|
2689
2730
|
);
|
|
2690
|
-
const
|
|
2691
|
-
for (let
|
|
2692
|
-
const
|
|
2693
|
-
if (
|
|
2694
|
-
|
|
2731
|
+
const f = [], p = [];
|
|
2732
|
+
for (let m = 0; m < Math.max(a.length, u.length); m++) {
|
|
2733
|
+
const F = u[`${m}`], O = a[`${m}`], N = o ? `${o}args[${m}]` : `args[${m}]`;
|
|
2734
|
+
if (O === void 0) {
|
|
2735
|
+
F != null && F.required && p.push(`${N}: Missing required argument (expected ${F.type})`);
|
|
2695
2736
|
continue;
|
|
2696
2737
|
}
|
|
2697
|
-
if (!
|
|
2698
|
-
|
|
2738
|
+
if (!F) {
|
|
2739
|
+
p.push(`${N}: Unexpected argument`);
|
|
2699
2740
|
continue;
|
|
2700
2741
|
}
|
|
2701
2742
|
try {
|
|
2702
|
-
const
|
|
2703
|
-
data:
|
|
2743
|
+
const V = Un({
|
|
2744
|
+
data: O,
|
|
2704
2745
|
context: {
|
|
2705
2746
|
dataSource: r,
|
|
2706
2747
|
schemaIndex: s,
|
|
2707
|
-
pathPrefix:
|
|
2708
|
-
argSchema:
|
|
2748
|
+
pathPrefix: N,
|
|
2749
|
+
argSchema: F
|
|
2709
2750
|
}
|
|
2710
2751
|
});
|
|
2711
|
-
|
|
2712
|
-
} catch (
|
|
2713
|
-
const
|
|
2714
|
-
|
|
2752
|
+
f.push(V);
|
|
2753
|
+
} catch (V) {
|
|
2754
|
+
const ur = V instanceof Error ? V.message : "Unknown error";
|
|
2755
|
+
p.push(ur);
|
|
2715
2756
|
}
|
|
2716
2757
|
}
|
|
2717
|
-
if (
|
|
2718
|
-
const
|
|
2719
|
-
throw new Error(
|
|
2758
|
+
if (p.length > 0) {
|
|
2759
|
+
const m = p.join("; ");
|
|
2760
|
+
throw new Error(m);
|
|
2720
2761
|
}
|
|
2721
|
-
let h =
|
|
2722
|
-
const b =
|
|
2762
|
+
let h = f;
|
|
2763
|
+
const b = kn(i);
|
|
2723
2764
|
if (b)
|
|
2724
2765
|
try {
|
|
2725
|
-
h = b(
|
|
2766
|
+
h = b(f, {
|
|
2726
2767
|
dataSource: r,
|
|
2727
2768
|
schemaIndex: s,
|
|
2728
|
-
pathPrefix:
|
|
2769
|
+
pathPrefix: o
|
|
2729
2770
|
});
|
|
2730
|
-
} catch (
|
|
2731
|
-
const
|
|
2732
|
-
throw new Error(
|
|
2771
|
+
} catch (m) {
|
|
2772
|
+
const F = m instanceof Error ? m.message : "Unknown validation error";
|
|
2773
|
+
throw new Error(F);
|
|
2733
2774
|
}
|
|
2734
|
-
return
|
|
2775
|
+
return sn(i, h);
|
|
2735
2776
|
}
|
|
2736
|
-
function
|
|
2777
|
+
function er(e) {
|
|
2737
2778
|
const { attribute: t, config: r } = e;
|
|
2738
|
-
if (
|
|
2739
|
-
const { granularity: s } = t, n = e.members.map((
|
|
2740
|
-
return
|
|
2779
|
+
if (Me(e) && rs(t)) {
|
|
2780
|
+
const { granularity: s } = t, n = e.members.map((o) => s === "Years" && !isNaN(Number(o)) ? `${o}-01-01T00:00:00` : o), i = ss(r), a = Object.keys(i).length === 0 ? void 0 : i;
|
|
2781
|
+
return ns(t, n, a);
|
|
2741
2782
|
}
|
|
2742
2783
|
return e;
|
|
2743
2784
|
}
|
|
2744
|
-
function
|
|
2785
|
+
function Pn(e) {
|
|
2745
2786
|
let t = [];
|
|
2746
2787
|
for (const r of e)
|
|
2747
|
-
|
|
2788
|
+
H(r) ? t = Ye(r, t) : t = Ye([er(r)], t);
|
|
2748
2789
|
return t != null ? t : [];
|
|
2749
2790
|
}
|
|
2750
|
-
const
|
|
2791
|
+
const Wn = (e) => {
|
|
2751
2792
|
const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context, n = [], i = [];
|
|
2752
|
-
return t.forEach((
|
|
2793
|
+
return t.forEach((a, o) => {
|
|
2753
2794
|
const u = {
|
|
2754
|
-
path: `filters[${
|
|
2755
|
-
input:
|
|
2795
|
+
path: `filters[${o}]`,
|
|
2796
|
+
input: a
|
|
2756
2797
|
};
|
|
2757
2798
|
try {
|
|
2758
2799
|
const c = M({
|
|
2759
|
-
data:
|
|
2800
|
+
data: a,
|
|
2760
2801
|
context: { dataSource: r, schemaIndex: s, pathPrefix: "" }
|
|
2761
2802
|
});
|
|
2762
|
-
!
|
|
2803
|
+
!H(c) && !ge(c) ? i.push(E(l({}, u), { message: "Invalid filter JSON" })) : n.push(c);
|
|
2763
2804
|
} catch (c) {
|
|
2764
2805
|
const g = c instanceof Error ? c.message : "Unknown error";
|
|
2765
|
-
i.push(
|
|
2806
|
+
i.push(E(l({}, u), { message: g }));
|
|
2766
2807
|
}
|
|
2767
|
-
}), i.length > 0 ? { success: !1, errors: i } : { success: !0, data:
|
|
2768
|
-
},
|
|
2808
|
+
}), i.length > 0 ? { success: !1, errors: i } : { success: !0, data: Pn(n) };
|
|
2809
|
+
}, ie = (e) => {
|
|
2769
2810
|
const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context;
|
|
2770
|
-
return t ?
|
|
2811
|
+
return t ? _t(t) ? Wn({
|
|
2771
2812
|
data: t,
|
|
2772
2813
|
context: { dataSource: r, schemaIndex: s }
|
|
2773
2814
|
}) : {
|
|
@@ -2780,27 +2821,27 @@ const Bn = (e) => {
|
|
|
2780
2821
|
}
|
|
2781
2822
|
]
|
|
2782
2823
|
} : { success: !0, data: [] };
|
|
2783
|
-
},
|
|
2824
|
+
}, Vn = (e) => {
|
|
2784
2825
|
const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context, n = [], i = [];
|
|
2785
|
-
return t.forEach((
|
|
2826
|
+
return t.forEach((a, o) => {
|
|
2786
2827
|
const u = {
|
|
2787
|
-
path: `highlights[${
|
|
2788
|
-
input:
|
|
2828
|
+
path: `highlights[${o}]`,
|
|
2829
|
+
input: a
|
|
2789
2830
|
};
|
|
2790
2831
|
try {
|
|
2791
2832
|
const c = M({
|
|
2792
|
-
data:
|
|
2833
|
+
data: a,
|
|
2793
2834
|
context: { dataSource: r, schemaIndex: s, pathPrefix: "" }
|
|
2794
2835
|
});
|
|
2795
|
-
|
|
2836
|
+
ge(c) ? n.push(er(c)) : i.push(E(l({}, u), { message: "Invalid filter JSON" }));
|
|
2796
2837
|
} catch (c) {
|
|
2797
2838
|
const g = c instanceof Error ? c.message : "Unknown error";
|
|
2798
|
-
i.push(
|
|
2839
|
+
i.push(E(l({}, u), { message: g }));
|
|
2799
2840
|
}
|
|
2800
2841
|
}), i.length > 0 ? { success: !1, errors: i } : { success: !0, data: n };
|
|
2801
|
-
},
|
|
2842
|
+
}, be = (e) => {
|
|
2802
2843
|
const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context;
|
|
2803
|
-
return t ?
|
|
2844
|
+
return t ? _t(t) ? Vn({
|
|
2804
2845
|
data: t,
|
|
2805
2846
|
context: { dataSource: r, schemaIndex: s }
|
|
2806
2847
|
}) : {
|
|
@@ -2813,51 +2854,51 @@ const Bn = (e) => {
|
|
|
2813
2854
|
}
|
|
2814
2855
|
]
|
|
2815
2856
|
} : { success: !0, data: [] };
|
|
2816
|
-
},
|
|
2817
|
-
if (e && !
|
|
2818
|
-
return
|
|
2857
|
+
}, jn = (e, t) => {
|
|
2858
|
+
if (e && !gt(e))
|
|
2859
|
+
return E(l({}, t), {
|
|
2819
2860
|
message: `Invalid sort type. Expected 'sortAsc', 'sortDesc', or 'sortNone'. Got: '${e}'.`
|
|
2820
2861
|
});
|
|
2821
|
-
},
|
|
2862
|
+
}, Jn = (e, t, r) => {
|
|
2822
2863
|
const { dataSource: s, schemaIndex: n } = t;
|
|
2823
2864
|
try {
|
|
2824
2865
|
const i = M({
|
|
2825
2866
|
data: e,
|
|
2826
2867
|
context: { dataSource: s, schemaIndex: n, pathPrefix: "" }
|
|
2827
2868
|
});
|
|
2828
|
-
return
|
|
2869
|
+
return ze(i) ? { success: !0, data: i } : {
|
|
2829
2870
|
success: !1,
|
|
2830
|
-
errors: [
|
|
2871
|
+
errors: [E(l({}, r), { message: "Invalid measure JSON" })]
|
|
2831
2872
|
};
|
|
2832
2873
|
} catch (i) {
|
|
2833
|
-
const
|
|
2874
|
+
const a = i instanceof Error ? i.message : "Unknown error";
|
|
2834
2875
|
return {
|
|
2835
2876
|
success: !1,
|
|
2836
|
-
errors: [
|
|
2877
|
+
errors: [E(l({}, r), { message: a })]
|
|
2837
2878
|
};
|
|
2838
2879
|
}
|
|
2839
|
-
},
|
|
2880
|
+
}, Kn = (e, t, r, s) => {
|
|
2840
2881
|
const n = M({
|
|
2841
2882
|
data: e.column,
|
|
2842
2883
|
context: { dataSource: t, schemaIndex: r, pathPrefix: "" }
|
|
2843
2884
|
});
|
|
2844
|
-
if (!
|
|
2885
|
+
if (!ze(n))
|
|
2845
2886
|
return {
|
|
2846
2887
|
style: {},
|
|
2847
|
-
error:
|
|
2888
|
+
error: E(l({}, s), { message: "Invalid measure JSON" })
|
|
2848
2889
|
};
|
|
2849
|
-
const i =
|
|
2890
|
+
const i = jn(e.sortType, s);
|
|
2850
2891
|
if (i) {
|
|
2851
|
-
const
|
|
2852
|
-
return { measure: n, style:
|
|
2892
|
+
const o = U(e, "column");
|
|
2893
|
+
return { measure: n, style: o, error: i };
|
|
2853
2894
|
}
|
|
2854
|
-
const
|
|
2855
|
-
return { measure: n, style:
|
|
2856
|
-
},
|
|
2857
|
-
if (
|
|
2858
|
-
return
|
|
2859
|
-
if (
|
|
2860
|
-
const n =
|
|
2895
|
+
const a = U(e, "column");
|
|
2896
|
+
return { measure: n, style: a };
|
|
2897
|
+
}, Gn = (e, t, r, s) => {
|
|
2898
|
+
if (Ut(e))
|
|
2899
|
+
return Kn(e, t, r, s);
|
|
2900
|
+
if (w(e)) {
|
|
2901
|
+
const n = Jn(
|
|
2861
2902
|
e,
|
|
2862
2903
|
{ dataSource: t, schemaIndex: r },
|
|
2863
2904
|
s
|
|
@@ -2865,11 +2906,11 @@ const Bn = (e) => {
|
|
|
2865
2906
|
return n.success ? { measure: n.data } : { error: n.errors[0] };
|
|
2866
2907
|
}
|
|
2867
2908
|
return {
|
|
2868
|
-
error:
|
|
2909
|
+
error: E(l({}, s), {
|
|
2869
2910
|
message: "Invalid measure item. Expected a function call (function/args) or object with 'column' and optional 'sortType'."
|
|
2870
2911
|
})
|
|
2871
2912
|
};
|
|
2872
|
-
},
|
|
2913
|
+
}, tr = (e) => {
|
|
2873
2914
|
const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context;
|
|
2874
2915
|
if (!t)
|
|
2875
2916
|
return { success: !0, data: [] };
|
|
@@ -2885,13 +2926,13 @@ const Bn = (e) => {
|
|
|
2885
2926
|
]
|
|
2886
2927
|
};
|
|
2887
2928
|
const n = [], i = [];
|
|
2888
|
-
return t.forEach((
|
|
2929
|
+
return t.forEach((a, o) => {
|
|
2889
2930
|
const u = {
|
|
2890
|
-
path: `measures[${
|
|
2891
|
-
input:
|
|
2931
|
+
path: `measures[${o}]`,
|
|
2932
|
+
input: a
|
|
2892
2933
|
};
|
|
2893
2934
|
try {
|
|
2894
|
-
const c =
|
|
2935
|
+
const c = Gn(a, r, s, u);
|
|
2895
2936
|
if (c.error) {
|
|
2896
2937
|
i.push(c.error);
|
|
2897
2938
|
return;
|
|
@@ -2901,14 +2942,14 @@ const Bn = (e) => {
|
|
|
2901
2942
|
);
|
|
2902
2943
|
} catch (c) {
|
|
2903
2944
|
const g = c instanceof Error ? c.message : "Unknown error";
|
|
2904
|
-
i.push(
|
|
2945
|
+
i.push(E(l({}, u), { message: g }));
|
|
2905
2946
|
}
|
|
2906
2947
|
}), i.length > 0 ? { success: !1, errors: i } : { success: !0, data: n };
|
|
2907
2948
|
};
|
|
2908
|
-
function
|
|
2949
|
+
function ce(e) {
|
|
2909
2950
|
return typeof e == "string" ? e : e.title;
|
|
2910
2951
|
}
|
|
2911
|
-
function
|
|
2952
|
+
function Yn(e) {
|
|
2912
2953
|
const t = {};
|
|
2913
2954
|
for (const [r, s] of Object.entries(e)) {
|
|
2914
2955
|
const n = {};
|
|
@@ -2916,12 +2957,12 @@ function Wn(e) {
|
|
|
2916
2957
|
}
|
|
2917
2958
|
return Object.keys(t).length > 0 ? t : void 0;
|
|
2918
2959
|
}
|
|
2919
|
-
function
|
|
2960
|
+
function rr(e) {
|
|
2920
2961
|
return typeof e == "object" && e !== null && "toJSON" in e && typeof e.toJSON == "function" ? e.toJSON() : e;
|
|
2921
2962
|
}
|
|
2922
|
-
function
|
|
2923
|
-
return typeof e == "string" ? e.replace(/\[\[([^\]]+)\]\]/g, "$1") : Array.isArray(e) ? e.map(
|
|
2924
|
-
Object.entries(e).map(([t, r]) => [t,
|
|
2963
|
+
function L(e) {
|
|
2964
|
+
return typeof e == "string" ? e.replace(/\[\[([^\]]+)\]\]/g, "$1") : Array.isArray(e) ? e.map(L) : e !== null && typeof e == "object" ? Object.fromEntries(
|
|
2965
|
+
Object.entries(e).map(([t, r]) => [t, L(r)])
|
|
2925
2966
|
) : e;
|
|
2926
2967
|
}
|
|
2927
2968
|
function A(e, t, r) {
|
|
@@ -2932,21 +2973,21 @@ function A(e, t, r) {
|
|
|
2932
2973
|
}
|
|
2933
2974
|
return s.data;
|
|
2934
2975
|
}
|
|
2935
|
-
const
|
|
2936
|
-
const { data: t } = e, { dataSource: r, tables: s } = e.context, n =
|
|
2937
|
-
() =>
|
|
2976
|
+
const Pi = (e) => {
|
|
2977
|
+
const { data: t } = e, { dataSource: r, tables: s } = e.context, n = ne(s), i = [], a = A(
|
|
2978
|
+
() => Wt({
|
|
2938
2979
|
data: t.dimensions || [],
|
|
2939
2980
|
context: { dataSource: r, schemaIndex: n }
|
|
2940
2981
|
}),
|
|
2941
2982
|
i
|
|
2942
|
-
),
|
|
2943
|
-
() =>
|
|
2983
|
+
), o = A(
|
|
2984
|
+
() => tr({
|
|
2944
2985
|
data: t.measures || [],
|
|
2945
2986
|
context: { dataSource: r, schemaIndex: n }
|
|
2946
2987
|
}),
|
|
2947
2988
|
i
|
|
2948
2989
|
), u = A(
|
|
2949
|
-
() =>
|
|
2990
|
+
() => ie({
|
|
2950
2991
|
data: t.filters || [],
|
|
2951
2992
|
context: { dataSource: r, schemaIndex: n }
|
|
2952
2993
|
}),
|
|
@@ -2954,7 +2995,7 @@ const xi = (e) => {
|
|
|
2954
2995
|
);
|
|
2955
2996
|
let c = null;
|
|
2956
2997
|
return t.highlights && (c = A(
|
|
2957
|
-
() =>
|
|
2998
|
+
() => be({
|
|
2958
2999
|
data: t.highlights || [],
|
|
2959
3000
|
context: { dataSource: r, schemaIndex: n }
|
|
2960
3001
|
}),
|
|
@@ -2965,53 +3006,53 @@ const xi = (e) => {
|
|
|
2965
3006
|
} : {
|
|
2966
3007
|
success: !0,
|
|
2967
3008
|
data: l({
|
|
2968
|
-
dataSource:
|
|
2969
|
-
dimensions:
|
|
2970
|
-
measures:
|
|
3009
|
+
dataSource: me(r),
|
|
3010
|
+
dimensions: a ? is(a) : [],
|
|
3011
|
+
measures: o ? as(o) : [],
|
|
2971
3012
|
filters: u || []
|
|
2972
3013
|
}, c && { highlights: c })
|
|
2973
3014
|
};
|
|
2974
3015
|
};
|
|
2975
|
-
function
|
|
3016
|
+
function st(e) {
|
|
2976
3017
|
return typeof e == "object" && e !== null && "column" in e && e.column !== void 0;
|
|
2977
3018
|
}
|
|
2978
|
-
function
|
|
3019
|
+
function Ve(e) {
|
|
2979
3020
|
const t = [], r = [];
|
|
2980
3021
|
return e.forEach((s, n) => {
|
|
2981
|
-
var
|
|
2982
|
-
const i =
|
|
3022
|
+
var f, p, h;
|
|
3023
|
+
const i = st(s) ? s.column : s, a = st(s) ? s : void 0, o = () => rr(i);
|
|
2983
3024
|
if (!i.composeCode) {
|
|
2984
3025
|
r.push({
|
|
2985
3026
|
path: `dimensions[${n}]`,
|
|
2986
|
-
input:
|
|
3027
|
+
input: o(),
|
|
2987
3028
|
message: `Dimension at index ${n} (${i.name || "unnamed"}) is missing composeCode`
|
|
2988
3029
|
});
|
|
2989
3030
|
return;
|
|
2990
3031
|
}
|
|
2991
|
-
if (!i.composeCode.startsWith(
|
|
3032
|
+
if (!i.composeCode.startsWith(T)) {
|
|
2992
3033
|
r.push({
|
|
2993
3034
|
path: `dimensions[${n}]`,
|
|
2994
|
-
input:
|
|
2995
|
-
message: `Expected composeCode to start with '${
|
|
3035
|
+
input: o(),
|
|
3036
|
+
message: `Expected composeCode to start with '${T}' for dimension at index ${n} (${i.name || "unnamed"}). Got: '${i.composeCode}'`
|
|
2996
3037
|
});
|
|
2997
3038
|
return;
|
|
2998
3039
|
}
|
|
2999
|
-
const u = (h =
|
|
3000
|
-
if (u !== void 0 && u !==
|
|
3040
|
+
const u = (h = a != null && a.sortType ? yt(a.sortType) : void 0) != null ? h : ((f = i.getSort) == null ? void 0 : f.call(i)) !== void 0 && ((p = i.getSort) == null ? void 0 : p.call(i)) !== z.None ? i.getSort() : void 0, c = a ? U(a, "column") : {};
|
|
3041
|
+
if (u !== void 0 && u !== z.None || a && Object.keys(c).length > 0) {
|
|
3001
3042
|
const b = l(l({
|
|
3002
3043
|
column: i.composeCode
|
|
3003
|
-
}, u !== void 0 && u !==
|
|
3044
|
+
}, u !== void 0 && u !== z.None && { sortType: ht(u) }), c);
|
|
3004
3045
|
t.push(b);
|
|
3005
3046
|
} else
|
|
3006
3047
|
t.push(i.composeCode);
|
|
3007
3048
|
}), r.length > 0 ? { success: !1, errors: r } : { success: !0, data: t };
|
|
3008
3049
|
}
|
|
3009
|
-
const
|
|
3010
|
-
function
|
|
3050
|
+
const xe = "Unknown error";
|
|
3051
|
+
function ae(e) {
|
|
3011
3052
|
if (!e)
|
|
3012
3053
|
return { success: !0, data: [] };
|
|
3013
3054
|
const t = [];
|
|
3014
|
-
if (
|
|
3055
|
+
if (os(e)) {
|
|
3015
3056
|
if (!e.composeCode)
|
|
3016
3057
|
return {
|
|
3017
3058
|
success: !1,
|
|
@@ -3024,9 +3065,9 @@ function ne(e) {
|
|
|
3024
3065
|
]
|
|
3025
3066
|
};
|
|
3026
3067
|
try {
|
|
3027
|
-
return { success: !0, data: [
|
|
3068
|
+
return { success: !0, data: [K(e.composeCode)] };
|
|
3028
3069
|
} catch (s) {
|
|
3029
|
-
const n = s instanceof Error ? s.message :
|
|
3070
|
+
const n = s instanceof Error ? s.message : xe;
|
|
3030
3071
|
return {
|
|
3031
3072
|
success: !1,
|
|
3032
3073
|
errors: [
|
|
@@ -3051,19 +3092,19 @@ function ne(e) {
|
|
|
3051
3092
|
return;
|
|
3052
3093
|
}
|
|
3053
3094
|
try {
|
|
3054
|
-
const
|
|
3055
|
-
r.push(
|
|
3056
|
-
} catch (
|
|
3057
|
-
const
|
|
3095
|
+
const a = K(s.composeCode);
|
|
3096
|
+
r.push(a);
|
|
3097
|
+
} catch (a) {
|
|
3098
|
+
const o = a instanceof Error ? a.message : xe;
|
|
3058
3099
|
t.push({
|
|
3059
3100
|
path: `filters[${n}]`,
|
|
3060
3101
|
input: s,
|
|
3061
|
-
message: `Failed to parse composeCode for filter at index ${n}: ${
|
|
3102
|
+
message: `Failed to parse composeCode for filter at index ${n}: ${o}. ComposeCode: '${s.composeCode}'`
|
|
3062
3103
|
});
|
|
3063
3104
|
}
|
|
3064
3105
|
}), t.length > 0 ? { success: !1, errors: t } : { success: !0, data: r };
|
|
3065
3106
|
}
|
|
3066
|
-
function
|
|
3107
|
+
function Fe(e) {
|
|
3067
3108
|
if (!e)
|
|
3068
3109
|
return { success: !0, data: [] };
|
|
3069
3110
|
const t = [], r = [];
|
|
@@ -3078,130 +3119,130 @@ function ge(e) {
|
|
|
3078
3119
|
return;
|
|
3079
3120
|
}
|
|
3080
3121
|
try {
|
|
3081
|
-
const
|
|
3082
|
-
t.push(
|
|
3083
|
-
} catch (
|
|
3084
|
-
const
|
|
3122
|
+
const a = K(s.composeCode);
|
|
3123
|
+
t.push(a);
|
|
3124
|
+
} catch (a) {
|
|
3125
|
+
const o = a instanceof Error ? a.message : xe;
|
|
3085
3126
|
r.push({
|
|
3086
3127
|
path: `highlights[${n}]`,
|
|
3087
3128
|
input: s,
|
|
3088
|
-
message: `Failed to parse composeCode for highlight filter at index ${n}: ${
|
|
3129
|
+
message: `Failed to parse composeCode for highlight filter at index ${n}: ${o}. ComposeCode: '${s.composeCode}'`
|
|
3089
3130
|
});
|
|
3090
3131
|
}
|
|
3091
3132
|
}), r.length > 0 ? { success: !1, errors: r } : { success: !0, data: t };
|
|
3092
3133
|
}
|
|
3093
|
-
function
|
|
3134
|
+
function nt(e) {
|
|
3094
3135
|
return typeof e == "object" && e !== null && "column" in e && e.column !== void 0;
|
|
3095
3136
|
}
|
|
3096
|
-
function
|
|
3137
|
+
function je(e) {
|
|
3097
3138
|
const t = [], r = [];
|
|
3098
3139
|
return e.forEach((s, n) => {
|
|
3099
3140
|
var u, c, g;
|
|
3100
|
-
const i =
|
|
3141
|
+
const i = nt(s) ? s.column : s, a = nt(s) ? s : void 0, o = () => rr(i);
|
|
3101
3142
|
if (!i.composeCode) {
|
|
3102
3143
|
r.push({
|
|
3103
3144
|
path: `measures[${n}]`,
|
|
3104
|
-
input:
|
|
3145
|
+
input: o(),
|
|
3105
3146
|
message: `Measure at index ${n} (${i.name || "unnamed"}) is missing composeCode`
|
|
3106
3147
|
});
|
|
3107
3148
|
return;
|
|
3108
3149
|
}
|
|
3109
3150
|
try {
|
|
3110
|
-
const
|
|
3111
|
-
if (
|
|
3112
|
-
const b =
|
|
3113
|
-
column:
|
|
3114
|
-
},
|
|
3115
|
-
t.push(
|
|
3151
|
+
const f = K(i.composeCode), p = (g = a != null && a.sortType ? yt(a.sortType) : void 0) != null ? g : ((u = i.getSort) == null ? void 0 : u.call(i)) !== void 0 && ((c = i.getSort) == null ? void 0 : c.call(i)) !== z.None ? i.getSort() : void 0;
|
|
3152
|
+
if (p !== void 0 && p !== z.None || a && Object.keys(U(a, "column")).length > 0) {
|
|
3153
|
+
const b = a ? U(a, "column") : {}, m = l(l({
|
|
3154
|
+
column: f
|
|
3155
|
+
}, p !== void 0 && p !== z.None && { sortType: ht(p) }), b);
|
|
3156
|
+
t.push(m);
|
|
3116
3157
|
} else
|
|
3117
|
-
t.push(
|
|
3118
|
-
} catch (
|
|
3119
|
-
const
|
|
3158
|
+
t.push(f);
|
|
3159
|
+
} catch (f) {
|
|
3160
|
+
const p = f instanceof Error ? f.message : "Unknown error";
|
|
3120
3161
|
r.push({
|
|
3121
3162
|
path: `measures[${n}]`,
|
|
3122
|
-
input:
|
|
3123
|
-
message: `Failed to parse composeCode for measure at index ${n} (${i.name || "unnamed"}): ${
|
|
3163
|
+
input: o(),
|
|
3164
|
+
message: `Failed to parse composeCode for measure at index ${n} (${i.name || "unnamed"}): ${p}. ComposeCode: '${i.composeCode}'`
|
|
3124
3165
|
});
|
|
3125
3166
|
}
|
|
3126
3167
|
}), r.length > 0 ? { success: !1, errors: r } : { success: !0, data: t };
|
|
3127
3168
|
}
|
|
3128
|
-
function
|
|
3169
|
+
function it(e) {
|
|
3129
3170
|
var t, r, s, n;
|
|
3130
|
-
return ((r = (t = e.composeCode) == null ? void 0 : t.includes("measureFactory.trend")) != null ? r : !1) || ((n = (s = e.name) == null ? void 0 : s.startsWith(
|
|
3171
|
+
return ((r = (t = e.composeCode) == null ? void 0 : t.includes("measureFactory.trend")) != null ? r : !1) || ((n = (s = e.name) == null ? void 0 : s.startsWith(bt)) != null ? n : !1);
|
|
3131
3172
|
}
|
|
3132
|
-
function
|
|
3173
|
+
function at(e) {
|
|
3133
3174
|
var t, r, s, n;
|
|
3134
|
-
return ((r = (t = e.composeCode) == null ? void 0 : t.includes("measureFactory.forecast")) != null ? r : !1) || ((n = (s = e.name) == null ? void 0 : s.startsWith(
|
|
3175
|
+
return ((r = (t = e.composeCode) == null ? void 0 : t.includes("measureFactory.forecast")) != null ? r : !1) || ((n = (s = e.name) == null ? void 0 : s.startsWith(Ft)) != null ? n : !1);
|
|
3135
3176
|
}
|
|
3136
|
-
function
|
|
3177
|
+
function ot(e) {
|
|
3137
3178
|
try {
|
|
3138
|
-
const t =
|
|
3179
|
+
const t = K(e.trim());
|
|
3139
3180
|
return t.args[2] != null && typeof t.args[2] == "object" ? t.args[2] : void 0;
|
|
3140
3181
|
} catch (t) {
|
|
3141
3182
|
return;
|
|
3142
3183
|
}
|
|
3143
3184
|
}
|
|
3144
|
-
function
|
|
3185
|
+
function Hn(e) {
|
|
3145
3186
|
var s, n, i;
|
|
3146
3187
|
if (!(e != null && e.length)) return [];
|
|
3147
3188
|
const t = /* @__PURE__ */ new Set(), r = [];
|
|
3148
|
-
for (let
|
|
3149
|
-
if (t.has(
|
|
3150
|
-
const
|
|
3151
|
-
if (
|
|
3152
|
-
r.push(
|
|
3189
|
+
for (let a = 0; a < e.length; a++) {
|
|
3190
|
+
if (t.has(a)) continue;
|
|
3191
|
+
const o = e[a];
|
|
3192
|
+
if (it(o) || at(o)) {
|
|
3193
|
+
r.push(o);
|
|
3153
3194
|
continue;
|
|
3154
3195
|
}
|
|
3155
|
-
const u = (s =
|
|
3156
|
-
let
|
|
3157
|
-
if (h < e.length && !t.has(h) &&
|
|
3196
|
+
const u = (s = o.name) != null ? s : "Measure", c = `${bt}_${u}`, g = `${Ft}_${u}`;
|
|
3197
|
+
let f, p, h = a + 1;
|
|
3198
|
+
if (h < e.length && !t.has(h) && it(e[h]) && e[h].name === c) {
|
|
3158
3199
|
const b = (n = e[h].composeCode) == null ? void 0 : n.trim();
|
|
3159
|
-
b && (
|
|
3200
|
+
b && (f = ot(b), t.add(h), h++);
|
|
3160
3201
|
}
|
|
3161
|
-
if (h < e.length && !t.has(h) &&
|
|
3202
|
+
if (h < e.length && !t.has(h) && at(e[h]) && e[h].name === g) {
|
|
3162
3203
|
const b = (i = e[h].composeCode) == null ? void 0 : i.trim();
|
|
3163
|
-
b && (
|
|
3204
|
+
b && (p = ot(b), t.add(h));
|
|
3164
3205
|
}
|
|
3165
|
-
|
|
3166
|
-
column:
|
|
3167
|
-
},
|
|
3206
|
+
f !== void 0 || p !== void 0 ? r.push(l(l({
|
|
3207
|
+
column: o
|
|
3208
|
+
}, f && Object.keys(f).length > 0 && { trend: f }), p && Object.keys(p).length > 0 && { forecast: p })) : r.push(o);
|
|
3168
3209
|
}
|
|
3169
3210
|
return r;
|
|
3170
3211
|
}
|
|
3171
|
-
function
|
|
3212
|
+
function Wi(e) {
|
|
3172
3213
|
const t = [], r = A(
|
|
3173
|
-
() =>
|
|
3214
|
+
() => Ve(e.dimensions || []),
|
|
3174
3215
|
t
|
|
3175
|
-
), s =
|
|
3176
|
-
() =>
|
|
3216
|
+
), s = Hn(e.measures || []), n = A(
|
|
3217
|
+
() => je(s),
|
|
3177
3218
|
t
|
|
3178
3219
|
), i = A(
|
|
3179
|
-
() =>
|
|
3220
|
+
() => ae(e.filters),
|
|
3180
3221
|
t
|
|
3181
3222
|
);
|
|
3182
|
-
let
|
|
3183
|
-
if (e.highlights && e.highlights.length > 0 && (
|
|
3184
|
-
() =>
|
|
3223
|
+
let a = null;
|
|
3224
|
+
if (e.highlights && e.highlights.length > 0 && (a = A(
|
|
3225
|
+
() => Fe(e.highlights),
|
|
3185
3226
|
t
|
|
3186
3227
|
)), t.length > 0)
|
|
3187
3228
|
return {
|
|
3188
3229
|
success: !1,
|
|
3189
3230
|
errors: t
|
|
3190
3231
|
};
|
|
3191
|
-
const
|
|
3232
|
+
const o = l({
|
|
3192
3233
|
dimensions: r || [],
|
|
3193
3234
|
measures: n || [],
|
|
3194
3235
|
filters: i || []
|
|
3195
|
-
},
|
|
3236
|
+
}, a && { highlights: a });
|
|
3196
3237
|
return {
|
|
3197
3238
|
success: !0,
|
|
3198
3239
|
// Strip [[delimiters]] from all strings to preserve original names with spaces
|
|
3199
|
-
data:
|
|
3240
|
+
data: L(o)
|
|
3200
3241
|
};
|
|
3201
3242
|
}
|
|
3202
|
-
const
|
|
3203
|
-
|
|
3204
|
-
),
|
|
3243
|
+
const sr = new Set(
|
|
3244
|
+
us.filter((e) => e !== "image")
|
|
3245
|
+
), ut = Object.freeze([...sr]), Ce = /* @__PURE__ */ new Set([
|
|
3205
3246
|
"category",
|
|
3206
3247
|
"value",
|
|
3207
3248
|
"breakBy",
|
|
@@ -3224,7 +3265,7 @@ const Ht = new Set(
|
|
|
3224
3265
|
"min",
|
|
3225
3266
|
"max",
|
|
3226
3267
|
"seriesToColorMap"
|
|
3227
|
-
]),
|
|
3268
|
+
]), Qn = {
|
|
3228
3269
|
line: {
|
|
3229
3270
|
validAxes: /* @__PURE__ */ new Set(["category", "value", "breakBy", "seriesToColorMap"]),
|
|
3230
3271
|
requiredAxes: ["category", "value"]
|
|
@@ -3297,7 +3338,7 @@ const Ht = new Set(
|
|
|
3297
3338
|
validAxes: /* @__PURE__ */ new Set(["category", "value", "breakBy", "seriesToColorMap"]),
|
|
3298
3339
|
requiredAxes: ["category", "value"]
|
|
3299
3340
|
}
|
|
3300
|
-
},
|
|
3341
|
+
}, Xn = /* @__PURE__ */ new Set([
|
|
3301
3342
|
"category",
|
|
3302
3343
|
"breakBy",
|
|
3303
3344
|
"breakByPoint",
|
|
@@ -3305,7 +3346,7 @@ const Ht = new Set(
|
|
|
3305
3346
|
"geo",
|
|
3306
3347
|
"details",
|
|
3307
3348
|
"date"
|
|
3308
|
-
]),
|
|
3349
|
+
]), Zn = /* @__PURE__ */ new Set([
|
|
3309
3350
|
"value",
|
|
3310
3351
|
"size",
|
|
3311
3352
|
"colorBy",
|
|
@@ -3317,34 +3358,34 @@ const Ht = new Set(
|
|
|
3317
3358
|
"max",
|
|
3318
3359
|
"color"
|
|
3319
3360
|
]);
|
|
3320
|
-
function
|
|
3321
|
-
const t =
|
|
3361
|
+
function ei(e) {
|
|
3362
|
+
const t = Qn[e];
|
|
3322
3363
|
if (t)
|
|
3323
3364
|
return {
|
|
3324
3365
|
validAxes: new Set(t.validAxes),
|
|
3325
3366
|
requiredAxes: Object.freeze([...t.requiredAxes])
|
|
3326
3367
|
};
|
|
3327
3368
|
}
|
|
3328
|
-
function
|
|
3329
|
-
return typeof e == "string" &&
|
|
3369
|
+
function nr(e) {
|
|
3370
|
+
return typeof e == "string" && sr.has(e);
|
|
3330
3371
|
}
|
|
3331
|
-
function
|
|
3332
|
-
if (r === "boxplot" && e === "value" || r === "calendar-heatmap" && e === "date" ||
|
|
3372
|
+
function ti(e, t, r) {
|
|
3373
|
+
if (r === "boxplot" && e === "value" || r === "calendar-heatmap" && e === "date" || Xn.has(e))
|
|
3333
3374
|
return !0;
|
|
3334
|
-
if (
|
|
3375
|
+
if (Zn.has(e))
|
|
3335
3376
|
return !1;
|
|
3336
3377
|
const s = Array.isArray(t) ? t[0] : t;
|
|
3337
3378
|
if (!s)
|
|
3338
3379
|
return !0;
|
|
3339
3380
|
let n;
|
|
3340
|
-
return
|
|
3381
|
+
return q(s) && "column" in s && (n = s.column), !(w(s) || n !== void 0 && w(n));
|
|
3341
3382
|
}
|
|
3342
|
-
function
|
|
3383
|
+
function ri(e) {
|
|
3343
3384
|
const t = [], r = {
|
|
3344
3385
|
chartType: "",
|
|
3345
3386
|
dataOptions: {}
|
|
3346
3387
|
};
|
|
3347
|
-
if (!
|
|
3388
|
+
if (!q(e))
|
|
3348
3389
|
return t.push({
|
|
3349
3390
|
path: "chartType",
|
|
3350
3391
|
input: e,
|
|
@@ -3352,29 +3393,29 @@ function Hn(e) {
|
|
|
3352
3393
|
}), { normalized: r, errors: t };
|
|
3353
3394
|
const s = e.chartType;
|
|
3354
3395
|
if (s === void 0) {
|
|
3355
|
-
const i = Object.keys(e),
|
|
3396
|
+
const i = Object.keys(e), a = x("chartType", i, (c) => c), o = a && a.distance <= C ? ` Did you mean 'chartType'? (You may have typed '${a.best}')` : "", u = a && a.distance <= C ? { [a.best]: e[a.best] } : e;
|
|
3356
3397
|
t.push({
|
|
3357
3398
|
path: "chartType",
|
|
3358
3399
|
input: u,
|
|
3359
|
-
message: `chartType is required.${
|
|
3400
|
+
message: `chartType is required.${o}`
|
|
3360
3401
|
});
|
|
3361
|
-
} else if (
|
|
3402
|
+
} else if (nr(s))
|
|
3362
3403
|
r.chartType = s;
|
|
3363
3404
|
else {
|
|
3364
|
-
const i = x(String(s),
|
|
3405
|
+
const i = x(String(s), ut, (u) => u), a = i && i.distance <= C ? ` Did you mean '${i.best}'?` : "", o = ut.slice(0, 8).join(", ");
|
|
3365
3406
|
t.push({
|
|
3366
3407
|
path: "chartType",
|
|
3367
3408
|
input: s,
|
|
3368
|
-
message: `Invalid chartType '${s}'. Valid types: ${
|
|
3409
|
+
message: `Invalid chartType '${s}'. Valid types: ${o}, ...${a}`
|
|
3369
3410
|
});
|
|
3370
3411
|
}
|
|
3371
3412
|
const n = e.dataOptions;
|
|
3372
3413
|
if (n === void 0) {
|
|
3373
|
-
const i = Object.keys(e),
|
|
3414
|
+
const i = Object.keys(e), a = x("dataOptions", i, (c) => c), o = a && a.distance <= C ? ` Did you mean 'dataOptions'? (You may have typed '${a.best}')` : "", u = a && a.distance <= C ? { [a.best]: e[a.best] } : e;
|
|
3374
3415
|
t.push({
|
|
3375
3416
|
path: "dataOptions",
|
|
3376
3417
|
input: u,
|
|
3377
|
-
message: `dataOptions is required.${
|
|
3418
|
+
message: `dataOptions is required.${o}`
|
|
3378
3419
|
});
|
|
3379
3420
|
} else n !== null && typeof n == "object" && (r.dataOptions = n);
|
|
3380
3421
|
return e.styleOptions !== void 0 && (r.styleOptions = e.styleOptions), e.filters !== void 0 && Array.isArray(e.filters) && (r.filters = e.filters), e.highlights !== void 0 && Array.isArray(e.highlights) && (r.highlights = e.highlights), { normalized: r, errors: t };
|
|
@@ -3382,149 +3423,156 @@ function Hn(e) {
|
|
|
3382
3423
|
function D(e, t) {
|
|
3383
3424
|
return e === -1 ? "dataOptions" : typeof e == "number" ? `dataOptions[${e}]` : t !== void 0 ? `dataOptions.${e}[${t}]` : `dataOptions.${e}`;
|
|
3384
3425
|
}
|
|
3385
|
-
function
|
|
3426
|
+
function ir(e, t) {
|
|
3386
3427
|
return e ? t ? `${e}.${t}` : e : t != null ? t : "";
|
|
3387
3428
|
}
|
|
3388
|
-
function
|
|
3389
|
-
return (t) =>
|
|
3390
|
-
path:
|
|
3429
|
+
function si(e) {
|
|
3430
|
+
return (t) => E(l({}, t), {
|
|
3431
|
+
path: ir(e, t.path)
|
|
3391
3432
|
});
|
|
3392
3433
|
}
|
|
3393
|
-
function
|
|
3394
|
-
return
|
|
3434
|
+
function ar(e) {
|
|
3435
|
+
return si(`widgets[${e}]`);
|
|
3395
3436
|
}
|
|
3396
|
-
function
|
|
3437
|
+
function or(e, t) {
|
|
3397
3438
|
return e.map(t);
|
|
3398
3439
|
}
|
|
3399
|
-
function
|
|
3440
|
+
function ni(e) {
|
|
3400
3441
|
return e.map(
|
|
3401
3442
|
({ attribute: t, style: r }) => r ? l({ column: t }, r) : t
|
|
3402
3443
|
);
|
|
3403
3444
|
}
|
|
3404
|
-
function
|
|
3445
|
+
function ii(e) {
|
|
3405
3446
|
return e.map(
|
|
3406
3447
|
({ measure: t, style: r }) => r ? l({ column: t }, r) : t
|
|
3407
3448
|
);
|
|
3408
3449
|
}
|
|
3409
|
-
function
|
|
3450
|
+
function ai(e) {
|
|
3451
|
+
return Array.isArray(e) ? e : [e];
|
|
3452
|
+
}
|
|
3453
|
+
function oi(e) {
|
|
3454
|
+
return Array.isArray(e) ? e : [e];
|
|
3455
|
+
}
|
|
3456
|
+
function ui(e) {
|
|
3410
3457
|
return Array.isArray(e) ? e : [e];
|
|
3411
3458
|
}
|
|
3412
|
-
const
|
|
3413
|
-
function
|
|
3459
|
+
const ci = /^(dimensions|measures|filters|highlights)(\[\d+\])?$/;
|
|
3460
|
+
function Ne(e) {
|
|
3414
3461
|
return (t) => {
|
|
3415
3462
|
const r = t.path.match(/\[(\d+)\]$/), s = r ? Number(r[1]) : void 0, n = D(e, s);
|
|
3416
|
-
if (
|
|
3417
|
-
return
|
|
3463
|
+
if (ci.test(t.path) || t.path.startsWith("dataOptions"))
|
|
3464
|
+
return E(l({}, t), { path: n });
|
|
3418
3465
|
const i = t.path.replace(/\[\d+\]$/, "");
|
|
3419
|
-
return
|
|
3420
|
-
path:
|
|
3466
|
+
return E(l({}, t), {
|
|
3467
|
+
path: ir(i, n)
|
|
3421
3468
|
});
|
|
3422
3469
|
};
|
|
3423
3470
|
}
|
|
3424
|
-
function
|
|
3425
|
-
const i = t ? tr(
|
|
3426
|
-
t
|
|
3427
|
-
) : [];
|
|
3428
|
-
if (i.length === 0)
|
|
3429
|
-
return [];
|
|
3471
|
+
function fe(e, t, r, s, n) {
|
|
3430
3472
|
if (r === "dimension") {
|
|
3431
|
-
const
|
|
3432
|
-
|
|
3433
|
-
|
|
3473
|
+
const o = t ? ai(t) : [];
|
|
3474
|
+
if (o.length === 0)
|
|
3475
|
+
return [];
|
|
3476
|
+
const u = A(
|
|
3477
|
+
() => Wt({
|
|
3478
|
+
data: o,
|
|
3434
3479
|
context: s
|
|
3435
3480
|
}),
|
|
3436
3481
|
n,
|
|
3437
|
-
|
|
3482
|
+
Ne(e)
|
|
3438
3483
|
);
|
|
3439
|
-
return
|
|
3484
|
+
return u !== null ? ni(u) : null;
|
|
3440
3485
|
}
|
|
3441
|
-
const
|
|
3442
|
-
|
|
3486
|
+
const i = t ? oi(t) : [];
|
|
3487
|
+
if (i.length === 0)
|
|
3488
|
+
return [];
|
|
3489
|
+
const a = A(
|
|
3490
|
+
() => tr({
|
|
3443
3491
|
data: i,
|
|
3444
3492
|
context: s
|
|
3445
3493
|
}),
|
|
3446
3494
|
n,
|
|
3447
|
-
|
|
3495
|
+
Ne(e)
|
|
3448
3496
|
);
|
|
3449
|
-
return
|
|
3497
|
+
return a !== null ? ii(a) : null;
|
|
3450
3498
|
}
|
|
3451
|
-
const
|
|
3499
|
+
const ct = (e, t) => {
|
|
3452
3500
|
const r = t.path.match(/\[(\d+)\]$/), s = r ? Number(r[1]) : void 0;
|
|
3453
|
-
return
|
|
3501
|
+
return E(l({}, t), { path: D(e, s) });
|
|
3454
3502
|
};
|
|
3455
|
-
function
|
|
3503
|
+
function lt(e, t, r) {
|
|
3456
3504
|
const s = Array.isArray(t) ? t : t != null ? [t] : [];
|
|
3457
3505
|
if (r === "dimension") {
|
|
3458
|
-
const i =
|
|
3506
|
+
const i = Ve(
|
|
3459
3507
|
s
|
|
3460
3508
|
);
|
|
3461
3509
|
return i.success ? { success: !0, data: i.data } : {
|
|
3462
3510
|
success: !1,
|
|
3463
|
-
errors: i.errors.map((
|
|
3511
|
+
errors: i.errors.map((a) => ct(e, a))
|
|
3464
3512
|
};
|
|
3465
3513
|
}
|
|
3466
|
-
const n =
|
|
3514
|
+
const n = je(s);
|
|
3467
3515
|
return n.success ? { success: !0, data: n.data } : {
|
|
3468
3516
|
success: !1,
|
|
3469
|
-
errors: n.errors.map((i) =>
|
|
3517
|
+
errors: n.errors.map((i) => ct(e, i))
|
|
3470
3518
|
};
|
|
3471
3519
|
}
|
|
3472
|
-
function
|
|
3520
|
+
function li(e, t) {
|
|
3473
3521
|
let r;
|
|
3474
|
-
|
|
3475
|
-
const n = !(
|
|
3476
|
-
return
|
|
3522
|
+
q(e) && "column" in e && (r = e.column);
|
|
3523
|
+
const n = !(w(e) || r !== void 0 && w(r)) ? "dimension" : "measure", i = [], a = fe("columns", [e], n, t, i);
|
|
3524
|
+
return a !== null ? { success: !0, data: a } : { success: !1, errors: i };
|
|
3477
3525
|
}
|
|
3478
|
-
function
|
|
3526
|
+
function fi(e, t, r, s) {
|
|
3479
3527
|
const n = [];
|
|
3480
3528
|
for (const i of e) {
|
|
3481
|
-
const
|
|
3482
|
-
() =>
|
|
3529
|
+
const a = A(
|
|
3530
|
+
() => li(i, t),
|
|
3483
3531
|
r,
|
|
3484
3532
|
s
|
|
3485
3533
|
);
|
|
3486
|
-
|
|
3534
|
+
a && n.push(...a);
|
|
3487
3535
|
}
|
|
3488
3536
|
return n;
|
|
3489
3537
|
}
|
|
3490
|
-
function
|
|
3491
|
-
if (!e || !
|
|
3538
|
+
function di(e, t, r) {
|
|
3539
|
+
if (!e || !q(e))
|
|
3492
3540
|
return r.push({
|
|
3493
3541
|
path: D(-1),
|
|
3494
3542
|
input: e,
|
|
3495
3543
|
message: "dataOptions is required"
|
|
3496
3544
|
}), null;
|
|
3497
|
-
const s = {}, { chartType: n } = t, i = r.length,
|
|
3498
|
-
for (const
|
|
3499
|
-
if (!
|
|
3500
|
-
const
|
|
3501
|
-
|
|
3502
|
-
path: D(
|
|
3503
|
-
input:
|
|
3504
|
-
message: `Unknown dataOptions key '${
|
|
3545
|
+
const s = {}, { chartType: n } = t, i = r.length, a = e, o = Object.keys(e), u = /* @__PURE__ */ new Map();
|
|
3546
|
+
for (const f of o)
|
|
3547
|
+
if (!Ce.has(f)) {
|
|
3548
|
+
const p = x(f, [...Ce], (b) => b), h = p && p.distance <= C ? ` Did you mean '${p.best}'?` : "";
|
|
3549
|
+
p && p.distance <= C && u.set(f, p.best), r.push({
|
|
3550
|
+
path: D(f),
|
|
3551
|
+
input: a[f],
|
|
3552
|
+
message: `Unknown dataOptions key '${f}'.${h}`
|
|
3505
3553
|
});
|
|
3506
3554
|
}
|
|
3507
|
-
const c = n ?
|
|
3555
|
+
const c = n ? ei(n) : void 0;
|
|
3508
3556
|
if (c) {
|
|
3509
|
-
for (const
|
|
3510
|
-
if (
|
|
3511
|
-
const
|
|
3557
|
+
for (const f of o)
|
|
3558
|
+
if (f !== "seriesToColorMap" && !c.validAxes.has(f) && Ce.has(f)) {
|
|
3559
|
+
const p = x(f, [...c.validAxes], (m) => m), h = p && p.distance <= C ? ` Did you mean '${p.best}'?` : "", b = [...c.validAxes].join(", ");
|
|
3512
3560
|
r.push({
|
|
3513
|
-
path: D(
|
|
3514
|
-
input:
|
|
3515
|
-
message: `Axis '${
|
|
3561
|
+
path: D(f),
|
|
3562
|
+
input: a[f],
|
|
3563
|
+
message: `Axis '${f}' is not valid for chart type '${n}'. Valid axes: ${b}.${h}`
|
|
3516
3564
|
});
|
|
3517
3565
|
}
|
|
3518
|
-
for (const
|
|
3519
|
-
[...u.values()].includes(
|
|
3520
|
-
path: D(
|
|
3566
|
+
for (const f of c.requiredAxes)
|
|
3567
|
+
[...u.values()].includes(f) || (!(f in a) || a[f] == null) && r.push({
|
|
3568
|
+
path: D(f),
|
|
3521
3569
|
input: null,
|
|
3522
3570
|
message: `Chart type '${n}' requires '${c.requiredAxes.join(
|
|
3523
3571
|
"' and '"
|
|
3524
|
-
)}'. Missing: ${
|
|
3572
|
+
)}'. Missing: ${f}.`
|
|
3525
3573
|
});
|
|
3526
3574
|
n === "indicator" && (["value", "secondary", "min", "max"].some(
|
|
3527
|
-
(h) => h in
|
|
3575
|
+
(h) => h in a && a[h] != null
|
|
3528
3576
|
) || r.push({
|
|
3529
3577
|
path: D(-1),
|
|
3530
3578
|
input: e,
|
|
@@ -3538,66 +3586,66 @@ function si(e, t, r) {
|
|
|
3538
3586
|
if (r.length > i)
|
|
3539
3587
|
return null;
|
|
3540
3588
|
const g = Object.entries(e);
|
|
3541
|
-
for (const [
|
|
3542
|
-
if (!
|
|
3543
|
-
if (
|
|
3544
|
-
s[
|
|
3589
|
+
for (const [f, p] of g) {
|
|
3590
|
+
if (!p) continue;
|
|
3591
|
+
if (f === "seriesToColorMap") {
|
|
3592
|
+
s[f] = p;
|
|
3545
3593
|
continue;
|
|
3546
3594
|
}
|
|
3547
|
-
if (
|
|
3548
|
-
s[
|
|
3549
|
-
|
|
3595
|
+
if (f === "columns") {
|
|
3596
|
+
s[f] = fi(
|
|
3597
|
+
ui(p),
|
|
3550
3598
|
t,
|
|
3551
3599
|
r,
|
|
3552
|
-
|
|
3600
|
+
Ne("columns")
|
|
3553
3601
|
);
|
|
3554
3602
|
continue;
|
|
3555
3603
|
}
|
|
3556
|
-
const h =
|
|
3557
|
-
|
|
3558
|
-
|
|
3604
|
+
const h = ti(f, p, n) ? "dimension" : "measure", b = fe(
|
|
3605
|
+
f,
|
|
3606
|
+
p,
|
|
3559
3607
|
h,
|
|
3560
3608
|
t,
|
|
3561
3609
|
r
|
|
3562
3610
|
);
|
|
3563
3611
|
if (b !== null) {
|
|
3564
|
-
const
|
|
3565
|
-
s[
|
|
3612
|
+
const m = n === "calendar-heatmap" && f === "value";
|
|
3613
|
+
s[f] = m || !Array.isArray(p) ? b[0] : b;
|
|
3566
3614
|
}
|
|
3567
3615
|
}
|
|
3568
3616
|
return r.length > i ? null : s;
|
|
3569
3617
|
}
|
|
3570
|
-
function
|
|
3618
|
+
function mi(e) {
|
|
3571
3619
|
if (typeof e != "string") return "iqr";
|
|
3572
3620
|
const t = e.split("/")[1];
|
|
3573
3621
|
return t === "iqr" || t === "extremums" || t === "standardDeviation" ? t : "iqr";
|
|
3574
3622
|
}
|
|
3575
|
-
const
|
|
3576
|
-
var
|
|
3577
|
-
const { data: t, context: r } = e, { dataSource: s, tables: n } = r, { normalized: i, errors:
|
|
3578
|
-
if (
|
|
3579
|
-
return { success: !1, errors:
|
|
3580
|
-
const
|
|
3581
|
-
let g =
|
|
3623
|
+
const pi = (e) => {
|
|
3624
|
+
var m;
|
|
3625
|
+
const { data: t, context: r } = e, { dataSource: s, tables: n } = r, { normalized: i, errors: a } = ri(t);
|
|
3626
|
+
if (a.length > 0)
|
|
3627
|
+
return { success: !1, errors: a };
|
|
3628
|
+
const o = i.chartType, u = ne(n), c = [];
|
|
3629
|
+
let g = di(
|
|
3582
3630
|
i.dataOptions,
|
|
3583
|
-
{ dataSource: s, schemaIndex: u, chartType:
|
|
3631
|
+
{ dataSource: s, schemaIndex: u, chartType: o },
|
|
3584
3632
|
c
|
|
3585
3633
|
);
|
|
3586
|
-
if (
|
|
3587
|
-
const
|
|
3588
|
-
g =
|
|
3634
|
+
if (o === "boxplot" && g) {
|
|
3635
|
+
const F = mi((m = i.styleOptions) == null ? void 0 : m.subtype), O = F === "iqr" || F === "standardDeviation";
|
|
3636
|
+
g = E(l({}, g), { boxType: F, outliersEnabled: O });
|
|
3589
3637
|
}
|
|
3590
|
-
let
|
|
3591
|
-
i.filters && i.filters.length > 0 && (
|
|
3592
|
-
() =>
|
|
3638
|
+
let f = null;
|
|
3639
|
+
i.filters && i.filters.length > 0 && (f = A(
|
|
3640
|
+
() => ie({
|
|
3593
3641
|
data: i.filters || [],
|
|
3594
3642
|
context: { dataSource: s, schemaIndex: u }
|
|
3595
3643
|
}),
|
|
3596
3644
|
c
|
|
3597
3645
|
));
|
|
3598
|
-
let
|
|
3599
|
-
if (i.highlights && i.highlights.length > 0 && (
|
|
3600
|
-
() =>
|
|
3646
|
+
let p = null;
|
|
3647
|
+
if (i.highlights && i.highlights.length > 0 && (p = A(
|
|
3648
|
+
() => be({
|
|
3601
3649
|
data: i.highlights || [],
|
|
3602
3650
|
context: { dataSource: s, schemaIndex: u }
|
|
3603
3651
|
}),
|
|
@@ -3607,7 +3655,7 @@ const ii = (e) => {
|
|
|
3607
3655
|
success: !1,
|
|
3608
3656
|
errors: c
|
|
3609
3657
|
};
|
|
3610
|
-
if (!
|
|
3658
|
+
if (!nr(i.chartType))
|
|
3611
3659
|
return {
|
|
3612
3660
|
success: !1,
|
|
3613
3661
|
errors: [
|
|
@@ -3622,15 +3670,15 @@ const ii = (e) => {
|
|
|
3622
3670
|
return {
|
|
3623
3671
|
success: !0,
|
|
3624
3672
|
data: l(l(l({
|
|
3625
|
-
dataSet:
|
|
3673
|
+
dataSet: me(s),
|
|
3626
3674
|
chartType: h,
|
|
3627
3675
|
dataOptions: g
|
|
3628
3676
|
}, i.styleOptions && {
|
|
3629
3677
|
// Pass-through NLQ JSON; shape matches ChartStyleOptions.
|
|
3630
3678
|
styleOptions: i.styleOptions
|
|
3631
|
-
}),
|
|
3679
|
+
}), f && { filters: f }), p && { highlights: p })
|
|
3632
3680
|
};
|
|
3633
|
-
},
|
|
3681
|
+
}, gi = (e) => {
|
|
3634
3682
|
const t = [];
|
|
3635
3683
|
if (!e.chartType)
|
|
3636
3684
|
return {
|
|
@@ -3655,27 +3703,27 @@ const ii = (e) => {
|
|
|
3655
3703
|
]
|
|
3656
3704
|
};
|
|
3657
3705
|
let r = null;
|
|
3658
|
-
const s =
|
|
3706
|
+
const s = yi(e.dataOptions);
|
|
3659
3707
|
s.success ? r = s.data : t.push(...s.errors);
|
|
3660
3708
|
let n;
|
|
3661
3709
|
if (e.filters) {
|
|
3662
|
-
const
|
|
3663
|
-
() =>
|
|
3710
|
+
const o = A(
|
|
3711
|
+
() => ae(e.filters),
|
|
3664
3712
|
t
|
|
3665
3713
|
);
|
|
3666
|
-
n =
|
|
3714
|
+
n = o != null ? o : void 0;
|
|
3667
3715
|
}
|
|
3668
3716
|
let i;
|
|
3669
3717
|
if (e.highlights && e.highlights.length > 0) {
|
|
3670
|
-
const
|
|
3671
|
-
() =>
|
|
3718
|
+
const o = A(
|
|
3719
|
+
() => Fe(e.highlights),
|
|
3672
3720
|
t
|
|
3673
3721
|
);
|
|
3674
|
-
i =
|
|
3722
|
+
i = o != null ? o : void 0;
|
|
3675
3723
|
}
|
|
3676
3724
|
if (t.length > 0 || r === null)
|
|
3677
3725
|
return { success: !1, errors: t };
|
|
3678
|
-
const
|
|
3726
|
+
const a = l(l(l({
|
|
3679
3727
|
chartType: e.chartType,
|
|
3680
3728
|
dataOptions: r
|
|
3681
3729
|
}, e.styleOptions && {
|
|
@@ -3683,10 +3731,10 @@ const ii = (e) => {
|
|
|
3683
3731
|
}), n && n.length > 0 && { filters: n }), i && i.length > 0 && { highlights: i });
|
|
3684
3732
|
return {
|
|
3685
3733
|
success: !0,
|
|
3686
|
-
data:
|
|
3734
|
+
data: L(a)
|
|
3687
3735
|
};
|
|
3688
3736
|
};
|
|
3689
|
-
function
|
|
3737
|
+
function yi(e) {
|
|
3690
3738
|
const t = {}, r = [], s = /* @__PURE__ */ new Set(["seriesToColorMap", "boxType", "outliersEnabled", "valueTitle"]);
|
|
3691
3739
|
for (const [n, i] of Object.entries(e)) {
|
|
3692
3740
|
if (n === "seriesToColorMap" && i) {
|
|
@@ -3697,16 +3745,16 @@ function ai(e) {
|
|
|
3697
3745
|
i != null && (t[n] = i);
|
|
3698
3746
|
continue;
|
|
3699
3747
|
}
|
|
3700
|
-
const
|
|
3701
|
-
for (let g = 0; g <
|
|
3702
|
-
const
|
|
3703
|
-
|
|
3704
|
-
]) :
|
|
3748
|
+
const a = Array.isArray(i) ? i : [i], o = Array.isArray(i), u = [], c = [];
|
|
3749
|
+
for (let g = 0; g < a.length; g++) {
|
|
3750
|
+
const f = a[g], h = hi(f) ? Ve([
|
|
3751
|
+
f
|
|
3752
|
+
]) : je([f]);
|
|
3705
3753
|
h.success ? u.push(...h.data) : h.errors.forEach((b) => {
|
|
3706
|
-
var
|
|
3707
|
-
c.push(
|
|
3754
|
+
var m;
|
|
3755
|
+
c.push(E(l({}, b), {
|
|
3708
3756
|
path: D(n, g),
|
|
3709
|
-
input: (
|
|
3757
|
+
input: (m = b.input) != null ? m : f
|
|
3710
3758
|
}));
|
|
3711
3759
|
});
|
|
3712
3760
|
}
|
|
@@ -3714,15 +3762,15 @@ function ai(e) {
|
|
|
3714
3762
|
r.push(...c);
|
|
3715
3763
|
continue;
|
|
3716
3764
|
}
|
|
3717
|
-
t[n] =
|
|
3765
|
+
t[n] = o ? u : u[0];
|
|
3718
3766
|
}
|
|
3719
3767
|
return r.length > 0 ? { success: !1, errors: r } : { success: !0, data: t };
|
|
3720
3768
|
}
|
|
3721
|
-
function
|
|
3769
|
+
function hi(e) {
|
|
3722
3770
|
const t = Array.isArray(e) ? e[0] : e;
|
|
3723
|
-
if (!t || !
|
|
3771
|
+
if (!t || !q(t))
|
|
3724
3772
|
return !0;
|
|
3725
|
-
const r = "column" in t && t.column != null &&
|
|
3773
|
+
const r = "column" in t && t.column != null && q(t.column) ? t.column : t;
|
|
3726
3774
|
if ("composeCode" in r) {
|
|
3727
3775
|
const s = r.composeCode;
|
|
3728
3776
|
if (typeof s == "string" && s.startsWith("DM."))
|
|
@@ -3737,17 +3785,17 @@ function ui(e) {
|
|
|
3737
3785
|
}
|
|
3738
3786
|
return !("aggregation" in r || "attribute" in r && "aggregation" in r);
|
|
3739
3787
|
}
|
|
3740
|
-
const
|
|
3741
|
-
function
|
|
3742
|
-
if (!
|
|
3788
|
+
const ft = ["rows", "columns", "values", "grandTotals"];
|
|
3789
|
+
function bi(e) {
|
|
3790
|
+
if (!q(e)) return !1;
|
|
3743
3791
|
const t = Object.keys(e);
|
|
3744
3792
|
return t.every((r) => r === "rows" || r === "columns") && t.every((r) => typeof e[r] == "boolean");
|
|
3745
3793
|
}
|
|
3746
|
-
function
|
|
3794
|
+
function Fi(e) {
|
|
3747
3795
|
const t = [], r = {
|
|
3748
3796
|
dataOptions: {}
|
|
3749
3797
|
};
|
|
3750
|
-
if (!
|
|
3798
|
+
if (!q(e))
|
|
3751
3799
|
return t.push({
|
|
3752
3800
|
path: "dataOptions",
|
|
3753
3801
|
input: e,
|
|
@@ -3755,34 +3803,34 @@ function li(e) {
|
|
|
3755
3803
|
}), { normalized: r, errors: t };
|
|
3756
3804
|
const s = e.dataOptions;
|
|
3757
3805
|
if (s === void 0) {
|
|
3758
|
-
const n = Object.keys(e), i = x("dataOptions", n, (u) => u),
|
|
3806
|
+
const n = Object.keys(e), i = x("dataOptions", n, (u) => u), a = i && i.distance <= C ? ` Did you mean 'dataOptions'? (You may have typed '${i.best}')` : "", o = i && i.distance <= C ? { [i.best]: e[i.best] } : e;
|
|
3759
3807
|
t.push({
|
|
3760
3808
|
path: "dataOptions",
|
|
3761
|
-
input:
|
|
3762
|
-
message: `dataOptions is required.${
|
|
3809
|
+
input: o,
|
|
3810
|
+
message: `dataOptions is required.${a}`
|
|
3763
3811
|
});
|
|
3764
|
-
} else if (
|
|
3812
|
+
} else if (q(s)) {
|
|
3765
3813
|
const n = s;
|
|
3766
3814
|
r.dataOptions = n;
|
|
3767
|
-
for (const
|
|
3768
|
-
if (!
|
|
3769
|
-
const
|
|
3815
|
+
for (const a of Object.keys(n))
|
|
3816
|
+
if (!ft.includes(a)) {
|
|
3817
|
+
const o = x(a, [...ft], (c) => c), u = o && o.distance <= C ? ` Did you mean '${o.best}'?` : "";
|
|
3770
3818
|
t.push({
|
|
3771
|
-
path: D(
|
|
3772
|
-
input: n[
|
|
3773
|
-
message: `Unknown dataOptions key '${
|
|
3819
|
+
path: D(a),
|
|
3820
|
+
input: n[a],
|
|
3821
|
+
message: `Unknown dataOptions key '${a}'. Valid keys: rows, columns, values, grandTotals.${u}`
|
|
3774
3822
|
});
|
|
3775
3823
|
}
|
|
3776
|
-
for (const
|
|
3777
|
-
const
|
|
3778
|
-
|
|
3779
|
-
path: D(
|
|
3780
|
-
input:
|
|
3781
|
-
message: `dataOptions.${
|
|
3824
|
+
for (const a of ["rows", "columns", "values"]) {
|
|
3825
|
+
const o = n[a];
|
|
3826
|
+
o != null && !Array.isArray(o) && t.push({
|
|
3827
|
+
path: D(a),
|
|
3828
|
+
input: o,
|
|
3829
|
+
message: `dataOptions.${a} must be an array`
|
|
3782
3830
|
});
|
|
3783
3831
|
}
|
|
3784
3832
|
const i = n.grandTotals;
|
|
3785
|
-
i != null && !
|
|
3833
|
+
i != null && !bi(i) && t.push({
|
|
3786
3834
|
path: D("grandTotals"),
|
|
3787
3835
|
input: i,
|
|
3788
3836
|
message: "grandTotals must be an object with optional rows?: boolean, columns?: boolean"
|
|
@@ -3790,7 +3838,7 @@ function li(e) {
|
|
|
3790
3838
|
}
|
|
3791
3839
|
return e.styleOptions !== void 0 && (r.styleOptions = e.styleOptions), e.filters !== void 0 && Array.isArray(e.filters) && (r.filters = e.filters), e.highlights !== void 0 && Array.isArray(e.highlights) && (r.highlights = e.highlights), { normalized: r, errors: t };
|
|
3792
3840
|
}
|
|
3793
|
-
function
|
|
3841
|
+
function Ei(e, t, r) {
|
|
3794
3842
|
if (!e || typeof e != "object")
|
|
3795
3843
|
return r.push({
|
|
3796
3844
|
path: D(-1),
|
|
@@ -3798,17 +3846,17 @@ function di(e, t, r) {
|
|
|
3798
3846
|
message: "dataOptions is required"
|
|
3799
3847
|
}), null;
|
|
3800
3848
|
const s = {}, n = r.length;
|
|
3801
|
-
for (const
|
|
3802
|
-
const
|
|
3803
|
-
|
|
3804
|
-
e[
|
|
3849
|
+
for (const a of ["rows", "columns"]) {
|
|
3850
|
+
const o = fe(
|
|
3851
|
+
a,
|
|
3852
|
+
e[a],
|
|
3805
3853
|
"dimension",
|
|
3806
3854
|
t,
|
|
3807
3855
|
r
|
|
3808
3856
|
);
|
|
3809
|
-
|
|
3857
|
+
o && (s[a] = o);
|
|
3810
3858
|
}
|
|
3811
|
-
const i =
|
|
3859
|
+
const i = fe(
|
|
3812
3860
|
"values",
|
|
3813
3861
|
e.values,
|
|
3814
3862
|
"measure",
|
|
@@ -3817,28 +3865,28 @@ function di(e, t, r) {
|
|
|
3817
3865
|
);
|
|
3818
3866
|
return i && (s.values = i), e.grandTotals !== void 0 && (s.grandTotals = e.grandTotals), r.length > n ? null : s;
|
|
3819
3867
|
}
|
|
3820
|
-
const
|
|
3821
|
-
const { data: t, context: r } = e, { dataSource: s, tables: n } = r, { normalized: i, errors:
|
|
3822
|
-
if (
|
|
3823
|
-
return { success: !1, errors:
|
|
3824
|
-
const
|
|
3868
|
+
const Ai = (e) => {
|
|
3869
|
+
const { data: t, context: r } = e, { dataSource: s, tables: n } = r, { normalized: i, errors: a } = Fi(t);
|
|
3870
|
+
if (a.length > 0)
|
|
3871
|
+
return { success: !1, errors: a };
|
|
3872
|
+
const o = ne(n), u = [], c = Ei(
|
|
3825
3873
|
i.dataOptions,
|
|
3826
|
-
{ dataSource: s, schemaIndex:
|
|
3874
|
+
{ dataSource: s, schemaIndex: o },
|
|
3827
3875
|
u
|
|
3828
3876
|
);
|
|
3829
3877
|
let g = null;
|
|
3830
3878
|
i.filters && i.filters.length > 0 && (g = A(
|
|
3831
|
-
() =>
|
|
3879
|
+
() => ie({
|
|
3832
3880
|
data: i.filters || [],
|
|
3833
|
-
context: { dataSource: s, schemaIndex:
|
|
3881
|
+
context: { dataSource: s, schemaIndex: o }
|
|
3834
3882
|
}),
|
|
3835
3883
|
u
|
|
3836
3884
|
));
|
|
3837
|
-
let
|
|
3838
|
-
return i.highlights && i.highlights.length > 0 && (
|
|
3839
|
-
() =>
|
|
3885
|
+
let f = null;
|
|
3886
|
+
return i.highlights && i.highlights.length > 0 && (f = A(
|
|
3887
|
+
() => be({
|
|
3840
3888
|
data: i.highlights || [],
|
|
3841
|
-
context: { dataSource: s, schemaIndex:
|
|
3889
|
+
context: { dataSource: s, schemaIndex: o }
|
|
3842
3890
|
}),
|
|
3843
3891
|
u
|
|
3844
3892
|
)), u.length > 0 || c === null ? {
|
|
@@ -3847,11 +3895,11 @@ const fi = (e) => {
|
|
|
3847
3895
|
} : {
|
|
3848
3896
|
success: !0,
|
|
3849
3897
|
data: l(l(l({
|
|
3850
|
-
dataSet:
|
|
3898
|
+
dataSet: me(s),
|
|
3851
3899
|
dataOptions: c
|
|
3852
|
-
}, i.styleOptions && { styleOptions: i.styleOptions }), g && { filters: g }),
|
|
3900
|
+
}, i.styleOptions && { styleOptions: i.styleOptions }), g && { filters: g }), f && { highlights: f })
|
|
3853
3901
|
};
|
|
3854
|
-
},
|
|
3902
|
+
}, Ti = (e) => {
|
|
3855
3903
|
const t = [];
|
|
3856
3904
|
if (!e.dataOptions)
|
|
3857
3905
|
return {
|
|
@@ -3868,54 +3916,54 @@ const fi = (e) => {
|
|
|
3868
3916
|
for (const u of ["rows", "columns"]) {
|
|
3869
3917
|
const c = r[u];
|
|
3870
3918
|
if (c && c.length > 0) {
|
|
3871
|
-
const g =
|
|
3919
|
+
const g = lt(u, c, "dimension");
|
|
3872
3920
|
g.success ? s[u] = g.data : t.push(...g.errors);
|
|
3873
3921
|
}
|
|
3874
3922
|
}
|
|
3875
3923
|
const n = r.values;
|
|
3876
3924
|
if (n && n.length > 0) {
|
|
3877
|
-
const u =
|
|
3925
|
+
const u = lt("values", n, "measure");
|
|
3878
3926
|
u.success ? s.values = u.data : t.push(...u.errors);
|
|
3879
3927
|
}
|
|
3880
3928
|
r.grandTotals !== void 0 && (s.grandTotals = r.grandTotals);
|
|
3881
3929
|
let i;
|
|
3882
3930
|
if (e.filters) {
|
|
3883
3931
|
const u = A(
|
|
3884
|
-
() =>
|
|
3932
|
+
() => ae(e.filters),
|
|
3885
3933
|
t
|
|
3886
3934
|
);
|
|
3887
3935
|
i = u != null ? u : void 0;
|
|
3888
3936
|
}
|
|
3889
|
-
let
|
|
3937
|
+
let a;
|
|
3890
3938
|
if (e.highlights && e.highlights.length > 0) {
|
|
3891
3939
|
const u = A(
|
|
3892
|
-
() =>
|
|
3940
|
+
() => Fe(e.highlights),
|
|
3893
3941
|
t
|
|
3894
3942
|
);
|
|
3895
|
-
|
|
3943
|
+
a = u != null ? u : void 0;
|
|
3896
3944
|
}
|
|
3897
3945
|
if (t.length > 0)
|
|
3898
3946
|
return { success: !1, errors: t };
|
|
3899
|
-
const
|
|
3947
|
+
const o = l(l(l({
|
|
3900
3948
|
dataOptions: s
|
|
3901
|
-
}, e.styleOptions && { styleOptions: e.styleOptions }), i && i.length > 0 && { filters: i }),
|
|
3949
|
+
}, e.styleOptions && { styleOptions: e.styleOptions }), i && i.length > 0 && { filters: i }), a && a.length > 0 && { highlights: a });
|
|
3902
3950
|
return {
|
|
3903
3951
|
success: !0,
|
|
3904
|
-
data:
|
|
3952
|
+
data: L(o)
|
|
3905
3953
|
};
|
|
3906
|
-
},
|
|
3907
|
-
const s =
|
|
3908
|
-
() =>
|
|
3954
|
+
}, wi = (e, t, r) => {
|
|
3955
|
+
const s = ne(r.tables), n = { dataSource: r.dataSource, schemaIndex: s }, i = [], a = e && e.length > 0 ? A(
|
|
3956
|
+
() => ie({ data: e, context: n }),
|
|
3909
3957
|
i
|
|
3910
|
-
) : void 0,
|
|
3911
|
-
() =>
|
|
3958
|
+
) : void 0, o = t && t.length > 0 ? A(
|
|
3959
|
+
() => be({ data: t, context: n }),
|
|
3912
3960
|
i
|
|
3913
3961
|
) : void 0;
|
|
3914
3962
|
return i.length > 0 ? { success: !1, errors: i } : {
|
|
3915
3963
|
success: !0,
|
|
3916
|
-
data: l(l({},
|
|
3964
|
+
data: l(l({}, a != null && { filters: a }), o != null && { highlights: o })
|
|
3917
3965
|
};
|
|
3918
|
-
},
|
|
3966
|
+
}, Si = [
|
|
3919
3967
|
"widgetType",
|
|
3920
3968
|
"id",
|
|
3921
3969
|
"title",
|
|
@@ -3923,36 +3971,36 @@ const fi = (e) => {
|
|
|
3923
3971
|
"dataSource",
|
|
3924
3972
|
"config",
|
|
3925
3973
|
"highlightSelectionDisabled"
|
|
3926
|
-
],
|
|
3927
|
-
const { id: n, title: i, description:
|
|
3928
|
-
return
|
|
3974
|
+
], dt = (e, t, r, s) => {
|
|
3975
|
+
const { id: n, title: i, description: a, dataSource: o, config: u, highlightSelectionDisabled: c } = e, g = U(e, Si), f = r({ data: g, context: t });
|
|
3976
|
+
return f.success ? {
|
|
3929
3977
|
success: !0,
|
|
3930
|
-
data: s(
|
|
3978
|
+
data: s(f.data, {
|
|
3931
3979
|
id: n,
|
|
3932
3980
|
title: i,
|
|
3933
|
-
description:
|
|
3934
|
-
dataSource:
|
|
3981
|
+
description: a,
|
|
3982
|
+
dataSource: o,
|
|
3935
3983
|
config: u,
|
|
3936
3984
|
highlightSelectionDisabled: c
|
|
3937
3985
|
})
|
|
3938
|
-
} :
|
|
3939
|
-
},
|
|
3940
|
-
const n = e, { dataSet: r } = n, s =
|
|
3941
|
-
return l(l(l(l(l(
|
|
3986
|
+
} : f;
|
|
3987
|
+
}, Ci = (e, t) => {
|
|
3988
|
+
const n = e, { dataSet: r } = n, s = Ee(n, ["dataSet"]);
|
|
3989
|
+
return l(l(l(l(l(E(l({}, s), {
|
|
3942
3990
|
widgetType: "chart",
|
|
3943
3991
|
id: t.id
|
|
3944
|
-
}), t.dataSource !== void 0 ? { dataSource: t.dataSource } : r !== void 0 &&
|
|
3992
|
+
}), t.dataSource !== void 0 ? { dataSource: t.dataSource } : r !== void 0 && Et(r) && { dataSource: r }), t.config !== void 0 && { config: t.config }), t.highlightSelectionDisabled !== void 0 && {
|
|
3945
3993
|
highlightSelectionDisabled: t.highlightSelectionDisabled
|
|
3946
3994
|
}), t.title !== void 0 && { title: t.title }), t.description !== void 0 && { description: t.description });
|
|
3947
|
-
},
|
|
3948
|
-
const n = e, { dataSet: r } = n, s =
|
|
3949
|
-
return l(l(l(l(
|
|
3995
|
+
}, Oi = (e, t) => {
|
|
3996
|
+
const n = e, { dataSet: r } = n, s = Ee(n, ["dataSet"]);
|
|
3997
|
+
return l(l(l(l(E(l({}, s), {
|
|
3950
3998
|
widgetType: "pivot",
|
|
3951
3999
|
id: t.id
|
|
3952
|
-
}), t.dataSource !== void 0 ? { dataSource: t.dataSource } : r !== void 0 &&
|
|
3953
|
-
},
|
|
3954
|
-
function
|
|
3955
|
-
if (!
|
|
4000
|
+
}), t.dataSource !== void 0 ? { dataSource: t.dataSource } : r !== void 0 && Et(r) && { dataSource: r }), t.config !== void 0 && { config: t.config }), t.title !== void 0 && { title: t.title }), t.description !== void 0 && { description: t.description });
|
|
4001
|
+
}, ve = ["chart", "pivot", "text", "custom"], $i = (e) => typeof e == "string" && ve.includes(e);
|
|
4002
|
+
function qi(e) {
|
|
4003
|
+
if (!q(e))
|
|
3956
4004
|
return {
|
|
3957
4005
|
path: "widgetType",
|
|
3958
4006
|
input: e,
|
|
@@ -3960,15 +4008,15 @@ function Ei(e) {
|
|
|
3960
4008
|
};
|
|
3961
4009
|
const t = e.widgetType;
|
|
3962
4010
|
if (t === void 0) {
|
|
3963
|
-
const r = Object.keys(e), s = x("widgetType", r, (
|
|
4011
|
+
const r = Object.keys(e), s = x("widgetType", r, (a) => a), n = s && s.distance <= C ? ` Did you mean 'widgetType'? (You may have typed '${s.best}')` : "";
|
|
3964
4012
|
return {
|
|
3965
4013
|
path: "widgetType",
|
|
3966
|
-
input: s && s.distance <=
|
|
4014
|
+
input: s && s.distance <= C ? { [s.best]: e[s.best] } : e,
|
|
3967
4015
|
message: `widgetType is required.${n}`
|
|
3968
4016
|
};
|
|
3969
4017
|
}
|
|
3970
|
-
if (
|
|
3971
|
-
const r = x(String(t),
|
|
4018
|
+
if (!$i(t)) {
|
|
4019
|
+
const r = x(String(t), ve, (i) => i), s = r && r.distance <= C ? ` Did you mean '${r.best}'?` : "", n = ve.join(", ");
|
|
3972
4020
|
return {
|
|
3973
4021
|
path: "widgetType",
|
|
3974
4022
|
input: t,
|
|
@@ -3979,30 +4027,30 @@ function Ei(e) {
|
|
|
3979
4027
|
}
|
|
3980
4028
|
return null;
|
|
3981
4029
|
}
|
|
3982
|
-
const
|
|
4030
|
+
const Di = (e) => ({
|
|
3983
4031
|
path: "id",
|
|
3984
4032
|
input: e,
|
|
3985
4033
|
message: "Widget id is required"
|
|
3986
|
-
}),
|
|
3987
|
-
const { data: t, context: r } = e, s =
|
|
4034
|
+
}), xi = (e) => !!e.id, Ni = (e) => {
|
|
4035
|
+
const { data: t, context: r } = e, s = qi(t);
|
|
3988
4036
|
if (s)
|
|
3989
4037
|
return { success: !1, errors: [s] };
|
|
3990
|
-
if (!
|
|
3991
|
-
return { success: !1, errors: [
|
|
4038
|
+
if (!xi(t))
|
|
4039
|
+
return { success: !1, errors: [Di(t)] };
|
|
3992
4040
|
switch (t.widgetType) {
|
|
3993
4041
|
case "chart":
|
|
3994
|
-
return
|
|
4042
|
+
return dt(
|
|
3995
4043
|
t,
|
|
3996
4044
|
r,
|
|
3997
|
-
|
|
3998
|
-
|
|
4045
|
+
pi,
|
|
4046
|
+
Ci
|
|
3999
4047
|
);
|
|
4000
4048
|
case "pivot":
|
|
4001
|
-
return
|
|
4049
|
+
return dt(
|
|
4002
4050
|
t,
|
|
4003
4051
|
r,
|
|
4004
|
-
|
|
4005
|
-
|
|
4052
|
+
Ai,
|
|
4053
|
+
Oi
|
|
4006
4054
|
);
|
|
4007
4055
|
case "text":
|
|
4008
4056
|
return { success: !0, data: l({
|
|
@@ -4014,23 +4062,23 @@ const Fi = (e) => ({
|
|
|
4014
4062
|
const {
|
|
4015
4063
|
id: n,
|
|
4016
4064
|
customWidgetType: i,
|
|
4017
|
-
title:
|
|
4018
|
-
description:
|
|
4065
|
+
title: a,
|
|
4066
|
+
description: o,
|
|
4019
4067
|
dataSource: u,
|
|
4020
4068
|
config: c,
|
|
4021
4069
|
filters: g,
|
|
4022
|
-
highlights:
|
|
4023
|
-
dataOptions:
|
|
4070
|
+
highlights: f,
|
|
4071
|
+
dataOptions: p,
|
|
4024
4072
|
styleOptions: h,
|
|
4025
4073
|
customOptions: b
|
|
4026
|
-
} = t,
|
|
4027
|
-
return
|
|
4074
|
+
} = t, m = wi(g, f, r);
|
|
4075
|
+
return m.success ? { success: !0, data: l(l(l(l(l(l({
|
|
4028
4076
|
widgetType: "custom",
|
|
4029
4077
|
id: n,
|
|
4030
4078
|
customWidgetType: i,
|
|
4031
|
-
dataSource: u !== void 0 ? u :
|
|
4032
|
-
dataOptions:
|
|
4033
|
-
},
|
|
4079
|
+
dataSource: u !== void 0 ? u : me(r.dataSource),
|
|
4080
|
+
dataOptions: p != null ? p : {}
|
|
4081
|
+
}, a !== void 0 && { title: a }), o !== void 0 && { description: o }), c !== void 0 && { config: c }), h !== void 0 && { styleOptions: h }), b !== void 0 && { customOptions: b }), m.data) } : m;
|
|
4034
4082
|
}
|
|
4035
4083
|
default:
|
|
4036
4084
|
return {
|
|
@@ -4046,37 +4094,37 @@ const Fi = (e) => ({
|
|
|
4046
4094
|
]
|
|
4047
4095
|
};
|
|
4048
4096
|
}
|
|
4049
|
-
},
|
|
4097
|
+
}, vi = (e) => {
|
|
4050
4098
|
const { widgetType: t } = e;
|
|
4051
4099
|
switch (t) {
|
|
4052
4100
|
case "chart": {
|
|
4053
|
-
const r =
|
|
4101
|
+
const r = gi(e);
|
|
4054
4102
|
if (!r.success) return r;
|
|
4055
|
-
const s = l(l(l(l(l(
|
|
4103
|
+
const s = l(l(l(l(l(E(l({}, r.data), {
|
|
4056
4104
|
widgetType: "chart",
|
|
4057
4105
|
id: e.id
|
|
4058
4106
|
}), e.title !== void 0 && { title: e.title }), e.description !== void 0 && { description: e.description }), e.dataSource !== void 0 && {
|
|
4059
|
-
dataSource:
|
|
4107
|
+
dataSource: ce(e.dataSource)
|
|
4060
4108
|
}), e.config !== void 0 && { config: e.config }), e.highlightSelectionDisabled !== void 0 && {
|
|
4061
4109
|
highlightSelectionDisabled: e.highlightSelectionDisabled
|
|
4062
4110
|
});
|
|
4063
4111
|
return {
|
|
4064
4112
|
success: !0,
|
|
4065
|
-
data:
|
|
4113
|
+
data: L(s)
|
|
4066
4114
|
};
|
|
4067
4115
|
}
|
|
4068
4116
|
case "pivot": {
|
|
4069
|
-
const r =
|
|
4117
|
+
const r = Ti(e);
|
|
4070
4118
|
if (!r.success) return r;
|
|
4071
|
-
const s = l(l(l(l(
|
|
4119
|
+
const s = l(l(l(l(E(l({}, r.data), {
|
|
4072
4120
|
widgetType: "pivot",
|
|
4073
4121
|
id: e.id
|
|
4074
4122
|
}), e.title !== void 0 && { title: e.title }), e.description !== void 0 && { description: e.description }), e.dataSource !== void 0 && {
|
|
4075
|
-
dataSource:
|
|
4123
|
+
dataSource: ce(e.dataSource)
|
|
4076
4124
|
}), e.config !== void 0 && { config: e.config });
|
|
4077
4125
|
return {
|
|
4078
4126
|
success: !0,
|
|
4079
|
-
data:
|
|
4127
|
+
data: L(s)
|
|
4080
4128
|
};
|
|
4081
4129
|
}
|
|
4082
4130
|
case "text":
|
|
@@ -4087,10 +4135,10 @@ const Fi = (e) => ({
|
|
|
4087
4135
|
}, e.config !== void 0 && { config: e.config }) };
|
|
4088
4136
|
case "custom": {
|
|
4089
4137
|
const r = [], s = e.filters !== void 0 ? A(
|
|
4090
|
-
() =>
|
|
4138
|
+
() => ae(e.filters),
|
|
4091
4139
|
r
|
|
4092
4140
|
) : void 0, n = e.highlights !== void 0 ? A(
|
|
4093
|
-
() =>
|
|
4141
|
+
() => Fe(e.highlights),
|
|
4094
4142
|
r
|
|
4095
4143
|
) : void 0;
|
|
4096
4144
|
return r.length > 0 ? { success: !1, errors: r } : { success: !0, data: l(l(l(l(l(l(l(l(l({
|
|
@@ -4098,7 +4146,7 @@ const Fi = (e) => ({
|
|
|
4098
4146
|
customWidgetType: e.customWidgetType,
|
|
4099
4147
|
id: e.id
|
|
4100
4148
|
}, e.title !== void 0 && { title: e.title }), e.description !== void 0 && { description: e.description }), e.dataSource !== void 0 && {
|
|
4101
|
-
dataSource:
|
|
4149
|
+
dataSource: ce(e.dataSource)
|
|
4102
4150
|
}), e.config !== void 0 && { config: e.config }), e.dataOptions !== void 0 && {
|
|
4103
4151
|
dataOptions: e.dataOptions
|
|
4104
4152
|
}), e.styleOptions !== void 0 && { styleOptions: e.styleOptions }), e.customOptions !== void 0 && {
|
|
@@ -4121,13 +4169,13 @@ const Fi = (e) => ({
|
|
|
4121
4169
|
]
|
|
4122
4170
|
};
|
|
4123
4171
|
}
|
|
4124
|
-
},
|
|
4172
|
+
}, Vi = (e) => {
|
|
4125
4173
|
const { data: t, context: r } = e, s = [], n = [];
|
|
4126
|
-
Array.isArray(t.widgets) ? t.widgets.forEach((
|
|
4127
|
-
const c =
|
|
4174
|
+
Array.isArray(t.widgets) ? t.widgets.forEach((o, u) => {
|
|
4175
|
+
const c = Ni({ data: o, context: r });
|
|
4128
4176
|
if (!c.success) {
|
|
4129
4177
|
s.push(
|
|
4130
|
-
...
|
|
4178
|
+
...or(c.errors, ar(u))
|
|
4131
4179
|
);
|
|
4132
4180
|
return;
|
|
4133
4181
|
}
|
|
@@ -4139,11 +4187,11 @@ const Fi = (e) => ({
|
|
|
4139
4187
|
});
|
|
4140
4188
|
let i = null;
|
|
4141
4189
|
if (t.filters && t.filters.length > 0) {
|
|
4142
|
-
const
|
|
4190
|
+
const o = ne(r.tables);
|
|
4143
4191
|
i = A(
|
|
4144
|
-
() =>
|
|
4192
|
+
() => ie({
|
|
4145
4193
|
data: t.filters,
|
|
4146
|
-
context: { dataSource: r.dataSource, schemaIndex:
|
|
4194
|
+
context: { dataSource: r.dataSource, schemaIndex: o }
|
|
4147
4195
|
}),
|
|
4148
4196
|
s
|
|
4149
4197
|
);
|
|
@@ -4157,13 +4205,13 @@ const Fi = (e) => ({
|
|
|
4157
4205
|
}), t.styleOptions !== void 0 && { styleOptions: t.styleOptions }), t.widgetsOptions !== void 0 && {
|
|
4158
4206
|
widgetsOptions: t.widgetsOptions
|
|
4159
4207
|
}) };
|
|
4160
|
-
},
|
|
4208
|
+
}, ji = (e) => {
|
|
4161
4209
|
const t = [], r = [];
|
|
4162
|
-
e.widgets.forEach((
|
|
4163
|
-
const u =
|
|
4210
|
+
e.widgets.forEach((a, o) => {
|
|
4211
|
+
const u = vi(a);
|
|
4164
4212
|
if (!u.success) {
|
|
4165
4213
|
t.push(
|
|
4166
|
-
...
|
|
4214
|
+
...or(u.errors, ar(o))
|
|
4167
4215
|
);
|
|
4168
4216
|
return;
|
|
4169
4217
|
}
|
|
@@ -4171,28 +4219,28 @@ const Fi = (e) => ({
|
|
|
4171
4219
|
});
|
|
4172
4220
|
let s;
|
|
4173
4221
|
if (e.filters) {
|
|
4174
|
-
const
|
|
4175
|
-
() =>
|
|
4222
|
+
const a = A(
|
|
4223
|
+
() => ae(e.filters),
|
|
4176
4224
|
t
|
|
4177
4225
|
);
|
|
4178
|
-
s =
|
|
4226
|
+
s = a != null ? a : void 0;
|
|
4179
4227
|
}
|
|
4180
4228
|
if (t.length > 0)
|
|
4181
4229
|
return { success: !1, errors: t };
|
|
4182
|
-
const n = e.widgetsOptions !== void 0 ?
|
|
4230
|
+
const n = e.widgetsOptions !== void 0 ? Yn(e.widgetsOptions) : void 0, i = l(l(l(l(l(l(l(l({
|
|
4183
4231
|
widgets: r
|
|
4184
4232
|
}, e.id !== void 0 && { id: e.id }), e.title !== void 0 && { title: e.title }), s && s.length > 0 && { filters: s }), e.layoutOptions !== void 0 && {
|
|
4185
4233
|
layoutOptions: e.layoutOptions
|
|
4186
4234
|
}), e.config !== void 0 && { config: e.config }), e.defaultDataSource !== void 0 && {
|
|
4187
|
-
defaultDataSource:
|
|
4235
|
+
defaultDataSource: ce(e.defaultDataSource)
|
|
4188
4236
|
}), e.styleOptions !== void 0 && { styleOptions: e.styleOptions }), n !== void 0 && { widgetsOptions: n });
|
|
4189
4237
|
return {
|
|
4190
4238
|
success: !0,
|
|
4191
|
-
data:
|
|
4239
|
+
data: L(i)
|
|
4192
4240
|
};
|
|
4193
4241
|
};
|
|
4194
|
-
function
|
|
4195
|
-
const { filters: t, relations: r } =
|
|
4242
|
+
function Mi(e) {
|
|
4243
|
+
const { filters: t, relations: r } = fs(
|
|
4196
4244
|
e.filters || []
|
|
4197
4245
|
);
|
|
4198
4246
|
return {
|
|
@@ -4205,27 +4253,59 @@ function Si(e) {
|
|
|
4205
4253
|
// No count/offset/ungroup - these are execution concerns, not translation concerns
|
|
4206
4254
|
};
|
|
4207
4255
|
}
|
|
4208
|
-
function
|
|
4209
|
-
const s =
|
|
4210
|
-
return
|
|
4256
|
+
function Ji(e, t, r = !1) {
|
|
4257
|
+
const s = Mi(e), n = cs(s, t);
|
|
4258
|
+
return ls(n, r);
|
|
4259
|
+
}
|
|
4260
|
+
function de(e) {
|
|
4261
|
+
const t = e.trim();
|
|
4262
|
+
return t.startsWith(T) ? t.slice(T.length) : t;
|
|
4263
|
+
}
|
|
4264
|
+
function X(e) {
|
|
4265
|
+
var s;
|
|
4266
|
+
const t = he(e.function);
|
|
4267
|
+
if (t) {
|
|
4268
|
+
const n = t.findIndex((i) => i.isName);
|
|
4269
|
+
if (n >= 0) {
|
|
4270
|
+
const i = e.args[n];
|
|
4271
|
+
if (typeof i == "string" && i.length > 0) return i;
|
|
4272
|
+
}
|
|
4273
|
+
}
|
|
4274
|
+
const r = e.args[0];
|
|
4275
|
+
return typeof r == "string" ? de(r) : w(r) ? X(r) : (s = e.function.split(".").pop()) != null ? s : e.function;
|
|
4276
|
+
}
|
|
4277
|
+
const mt = "filterFactory.logic.";
|
|
4278
|
+
function pt(e) {
|
|
4279
|
+
var r;
|
|
4280
|
+
if (e.function.startsWith(mt))
|
|
4281
|
+
return e.function.slice(mt.length);
|
|
4282
|
+
const t = e.args[0];
|
|
4283
|
+
return typeof t == "string" ? de(t) : w(t) ? X(t) : (r = e.function.split(".").pop()) != null ? r : e.function;
|
|
4284
|
+
}
|
|
4285
|
+
const Ri = "measureFactory.", Ii = "filterFactory.", ki = (e) => e.function.startsWith(Ri), Li = (e) => e.function.startsWith(Ii);
|
|
4286
|
+
function Ki(e, t) {
|
|
4287
|
+
var s;
|
|
4288
|
+
const r = (s = t == null ? void 0 : t.role) != null ? s : "filter";
|
|
4289
|
+
return typeof e == "string" ? { name: de(e), type: "dimension" } : zt(e) ? { name: de(e.column), type: "dimension" } : Ut(e) ? { name: X(e.column), type: "measure" } : w(e) ? ki(e) ? { name: X(e), type: "measure" } : Li(e) ? { name: pt(e), type: r } : (t == null ? void 0 : t.role) !== void 0 ? { name: pt(e), type: r } : { name: X(e), type: "measure" } : null;
|
|
4211
4290
|
}
|
|
4212
4291
|
export {
|
|
4213
|
-
|
|
4214
|
-
|
|
4215
|
-
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4292
|
+
Ui as CustomSuperJSON,
|
|
4293
|
+
Hi as EMPTY_EXPANDED_QUERY_MODEL,
|
|
4294
|
+
Qi as EMPTY_SIMPLE_QUERY_MODEL,
|
|
4295
|
+
Ki as getQueryElementSummary,
|
|
4296
|
+
Xi as isByIdDashboardCodeParams,
|
|
4297
|
+
Zi as isByIdWidgetCodeParams,
|
|
4298
|
+
ea as isClientSideDashboardCodeParams,
|
|
4299
|
+
ta as isClientSideWidgetCodeParams,
|
|
4300
|
+
pi as translateChartFromJSON,
|
|
4301
|
+
gi as translateChartToJSON,
|
|
4302
|
+
Vi as translateDashboardFromJSON,
|
|
4303
|
+
ji as translateDashboardToJSON,
|
|
4304
|
+
Ai as translatePivotTableFromJSON,
|
|
4305
|
+
Ti as translatePivotTableToJSON,
|
|
4306
|
+
Pi as translateQueryFromJSON,
|
|
4307
|
+
Wi as translateQueryToJSON,
|
|
4308
|
+
Ji as translateQueryToJaql,
|
|
4309
|
+
Ni as translateWidgetFromJSON,
|
|
4310
|
+
vi as translateWidgetToJSON
|
|
4231
4311
|
};
|