@sisense/sdk-ui 2.26.0 → 2.28.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 +35 -35
- package/dist/ai.js +792 -800
- package/dist/analytics-composer/node.cjs +1 -1
- package/dist/analytics-composer/node.js +1322 -1021
- package/dist/analytics-composer.cjs +73 -73
- package/dist/analytics-composer.js +22 -17
- package/dist/apply-styled-options-to-query-23D9br-S.cjs +1 -0
- package/dist/{apply-styled-options-to-query-Bzt2GrgO.js → apply-styled-options-to-query-BagjzMqm.js} +1064 -1046
- package/dist/{dimensions-Ce2zWFrs.js → dimensions-Bn1EaWiP.js} +1 -1
- package/dist/{dimensions-u3w5qNF0.cjs → dimensions-D8r34WRI.cjs} +1 -1
- package/dist/{index-D7mHzfx0.js → index-C77YCBVd.js} +4 -1
- package/dist/{index-BX9p-XrU.cjs → index-C9G8giSk.cjs} +1 -1
- package/dist/index.cjs +404 -404
- package/dist/index.js +18353 -17959
- package/dist/index.umd.js +687 -688
- package/dist/packages/sdk-ui/src/domains/dashboarding/components/editable-layout/const.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/dashboard-model-translator.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/get-dashboard-model.d.ts +4 -3
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/get-dashboard-models.d.ts +3 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/translate-dashboard-utils.d.ts +16 -4
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/types.d.ts +9 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/persist-dashboard-model-middleware.d.ts +10 -3
- package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/use-widget-excel-download.d.ts +23 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/types.d.ts +13 -0
- package/dist/packages/sdk-ui/src/domains/drilldown/hooks/use-drilldown.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/drilldown/hooks/use-hierarchies-loader.d.ts +17 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/cascading-filter-tile/cascading-filter-tile.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/filters/components/custom-filter-tile.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/narrative/core/widget-narrative-options.d.ts +11 -4
- package/dist/packages/sdk-ui/src/domains/narrative/core/widget-props-to-narrative-params.d.ts +51 -1
- package/dist/packages/sdk-ui/src/domains/narrative/hooks/use-get-widget-narrative.d.ts +3 -3
- package/dist/packages/sdk-ui/src/domains/narrative/hooks/use-widget-narrative-state.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/query-execution/hooks/use-execute-excel-query/excel-export/build-jaql-excel-export.d.ts +48 -0
- package/dist/packages/sdk-ui/src/domains/query-execution/hooks/use-execute-excel-query/excel-export/build-xlsx-export-payload.d.ts +33 -0
- package/dist/packages/sdk-ui/src/domains/query-execution/hooks/use-execute-excel-query/excel-query-state-reducer.d.ts +2 -0
- package/dist/packages/sdk-ui/src/domains/query-execution/hooks/use-execute-excel-query/use-excel-query-params-changed.d.ts +8 -0
- package/dist/packages/sdk-ui/src/domains/query-execution/hooks/use-execute-excel-query/use-execute-excel-query.d.ts +8 -0
- package/dist/packages/sdk-ui/src/domains/query-execution/index.d.ts +2 -1
- package/dist/packages/sdk-ui/src/domains/query-execution/types.d.ts +97 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/components/scattermap/utils/map.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/areamap-chart/data/areamap-data.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/utils/with-calendar-heatmap-data-coloring.d.ts +2 -2
- 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 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/types.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/types.d.ts +3 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/pivot-table/formatters/data-cell-formatters/data-cell-color-formatter.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/pivot-table/helpers/prepare-pivot-styling-props.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/pivot-table/hooks/use-render-pivot.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/pivot-table/sorting-utils.d.ts +4 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/table/hooks/use-table-data.d.ts +3 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/table/pure-table/helpers/get-cell-styles.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/table/pure-table/types.d.ts +3 -3
- package/dist/packages/sdk-ui/src/domains/visualizations/components/table/styles/get-custom-pagination-styles.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data-options/translate-data-options.d.ts +13 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data-options/validate-data-options/validate-data-options.d.ts +9 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/apply-event-handlers.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/boxplot-chart-options.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/cartesian/cartesian-chart-options.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/cartesian/utils/axis/axis-builders.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/cartesian/utils/axis/axis-settings.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/cartesian/utils/axis/axis-transformers.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/cartesian/utils/series-processor.d.ts +3 -39
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/category-chart-options/category-chart-options.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/category-chart-options/funnel-chart-options.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/category-chart-options/pie-chart-options.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/category-chart-options/sunburst-chart-options.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/category-chart-options/treemap-chart-options.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/chart-options-service.d.ts +5 -3
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/common-highcharts-option-service.d.ts +3 -3
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/range-chart-options.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/scatter-chart-options.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/series-labels.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/theme-option-service.d.ts +3 -3
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/funnel-series.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/pie-plot-options.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/pie-series.d.ts +4 -4
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/scatter-series.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/sunburst/sunburst-levels.d.ts +4 -4
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/sunburst/sunburst-options.d.ts +5 -5
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/sunburst/sunburst-series.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/treemap/treemap-labels.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/treemap/treemap-options.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/treemap/treemap-series.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-definition-style-constants.d.ts +17 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-definition.d.ts +3 -3
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-params-to-view-model.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/widgets/components/chart-widget/types.d.ts +9 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/chart-widget/use-chart-widget-excel-download.d.ts +18 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/custom-widget/types.d.ts +9 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/custom-widget/use-custom-widget-excel-download.d.ts +16 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/pivot-table-widget/pivot-table-widget.d.ts +0 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/pivot-table-widget/types.d.ts +9 -2
- package/dist/packages/sdk-ui/src/domains/widgets/components/pivot-table-widget/use-pivot-widget-excel-download.d.ts +18 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/pivot-table-widget/use-with-pivot-table-widget-drilldown.d.ts +0 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/pivot-table-widget/utils.d.ts +0 -5
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget/types.d.ts +13 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/apply-partial-dto-style.d.ts +18 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/extract-unsupported-style-options.d.ts +31 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/index.d.ts +2 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/to-widget-dto-style.d.ts +3 -3
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/types.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/utils.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/widgets/helpers/download-blob-as-file.d.ts +14 -0
- package/dist/packages/sdk-ui/src/domains/widgets/helpers/excel-export-map-dimensions-measures.d.ts +18 -0
- package/dist/packages/sdk-ui/src/domains/widgets/helpers/index.d.ts +2 -0
- package/dist/packages/sdk-ui/src/domains/widgets/hooks/use-excel-query-file-loader.d.ts +13 -0
- package/dist/packages/sdk-ui/src/domains/widgets/hooks/use-with-excel-download-menu-item.d.ts +21 -0
- package/dist/packages/sdk-ui/src/domains/widgets/shared/widget-style-utils.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/widgets/widget-model/get-widget-model.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/widgets/widget-model/widget-model-translator/to-widget-dto-panels.d.ts +13 -0
- package/dist/packages/sdk-ui/src/domains/widgets/widget-model/widget-model-translator/widget-model-translator.d.ts +40 -3
- package/dist/packages/sdk-ui/src/domains/widgets/widget-model/widget-model.d.ts +12 -0
- package/dist/packages/sdk-ui/src/infra/api/narrative/narrative-endpoints.d.ts +13 -7
- package/dist/packages/sdk-ui/src/infra/api/rest-api.d.ts +7 -0
- package/dist/packages/sdk-ui/src/infra/app/settings/settings.d.ts +62 -4
- package/dist/packages/sdk-ui/src/infra/app/settings/types/features.d.ts +2 -0
- package/dist/packages/sdk-ui/src/infra/app/types.d.ts +0 -1
- package/dist/packages/sdk-ui/src/infra/contexts/theme-provider/custom-theme-provider.d.ts +2 -2
- package/dist/packages/sdk-ui/src/infra/contexts/theme-provider/default-theme-settings.d.ts +2 -2
- package/dist/packages/sdk-ui/src/infra/contexts/theme-provider/index.d.ts +1 -0
- package/dist/packages/sdk-ui/src/infra/contexts/theme-provider/theme-context.d.ts +3 -3
- package/dist/packages/sdk-ui/src/infra/contexts/theme-provider/types.d.ts +2 -2
- package/dist/packages/sdk-ui/src/infra/contexts/theme-provider/use-theme-settings.d.ts +2 -2
- package/dist/packages/sdk-ui/src/infra/contexts/theme-provider/use-theme.d.ts +14 -0
- package/dist/packages/sdk-ui/src/infra/plugins/widget-plugins/types.d.ts +16 -11
- package/dist/packages/sdk-ui/src/infra/themes/legacy-design-settings.d.ts +4 -4
- package/dist/packages/sdk-ui/src/infra/themes/theme-loader.d.ts +4 -4
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/de-de.d.ts +3 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/en-us.d.ts +3 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/es-ar.d.ts +3 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/es-es.d.ts +3 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/fr-fr.d.ts +3 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/it-it.d.ts +3 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ja-jp.d.ts +3 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ko-kr.d.ts +3 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/nl-nl.d.ts +3 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/pt-br.d.ts +3 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ru-ru.d.ts +3 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/tr-tr.d.ts +3 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/zh-cn.d.ts +3 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/en.d.ts +4 -1
- package/dist/packages/sdk-ui/src/infra/translation/resources/index.d.ts +7 -1
- package/dist/packages/sdk-ui/src/modules/ai/ai-disclaimer.d.ts +2 -2
- package/dist/packages/sdk-ui/src/modules/ai/api/chat-rest-api.d.ts +1 -1
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/dashboard/translate-dashboard-from-json.d.ts +17 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/dashboard/translate-dashboard-to-json.d.ts +15 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/index.d.ts +5 -1
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/query/translate-query-from-json.d.ts +5 -5
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/query/translate-query-to-jaql.d.ts +4 -4
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/query/translate-query-to-json.d.ts +5 -5
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/data-options/adapters.d.ts +0 -3
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/expression/custom-formula/process-custom-formula.d.ts +2 -1
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/expression/factory-function-processors.d.ts +0 -1
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/expression/filter-processors.d.ts +8 -4
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/utils/error-path.d.ts +37 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/utils/translation-helpers.d.ts +36 -3
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/types.d.ts +132 -3
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/widget/helpers/index.d.ts +6 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/widget/helpers/to-widget-props.d.ts +27 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/widget/helpers/translate-custom-widget-filters-from-json.d.ts +12 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/widget/helpers/translate-envelope-widget-from-json.d.ts +20 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/widget/helpers/validate-widget-json.d.ts +8 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/widget/helpers/widget-id.d.ts +17 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/widget/translate-widget-from-json.d.ts +19 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/widget/translate-widget-to-json.d.ts +18 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/types.d.ts +6 -5
- package/dist/packages/sdk-ui/src/modules/analytics-composer/widget/chart-options/get-widget-options.d.ts +12 -0
- package/dist/packages/sdk-ui/src/props.d.ts +15 -6
- package/dist/packages/sdk-ui/src/public-api/alpha.d.ts +5 -0
- package/dist/packages/sdk-ui/src/public-api/internal.d.ts +12 -1
- package/dist/packages/sdk-ui/src/public-api/public.d.ts +24 -21
- package/dist/packages/sdk-ui/src/public-api/sisense-internal.d.ts +3 -3
- package/dist/packages/sdk-ui/src/shared/components/loading-indicator.d.ts +2 -2
- package/dist/packages/sdk-ui/src/shared/components/menu/context-menu/menu.d.ts +1 -1
- package/dist/packages/sdk-ui/src/types.d.ts +220 -4
- package/dist/translations/de-de.cjs +1 -1
- package/dist/translations/de-de.js +5 -2
- package/dist/translations/en-us.cjs +1 -1
- package/dist/translations/en-us.js +1 -1
- package/dist/translations/es-ar.cjs +1 -1
- package/dist/translations/es-ar.js +5 -2
- package/dist/translations/es-es.cjs +1 -1
- package/dist/translations/es-es.js +5 -2
- package/dist/translations/fr-fr.cjs +1 -1
- package/dist/translations/fr-fr.js +5 -2
- package/dist/translations/it-it.cjs +1 -1
- package/dist/translations/it-it.js +5 -2
- package/dist/translations/ja-jp.cjs +1 -1
- package/dist/translations/ja-jp.js +5 -2
- package/dist/translations/ko-kr.cjs +1 -1
- package/dist/translations/ko-kr.js +5 -2
- package/dist/translations/nl-nl.cjs +1 -1
- package/dist/translations/nl-nl.js +5 -2
- package/dist/translations/pt-br.cjs +1 -1
- package/dist/translations/pt-br.js +5 -2
- package/dist/translations/ru-ru.cjs +1 -1
- package/dist/translations/ru-ru.js +5 -2
- package/dist/translations/tr-tr.cjs +1 -1
- package/dist/translations/tr-tr.js +5 -2
- package/dist/translations/zh-cn.cjs +1 -1
- package/dist/translations/zh-cn.js +5 -2
- package/dist/{types-COBvZZm_.cjs → types-CzgBH2kL.cjs} +1 -1
- package/dist/{types-D6jCGncV.js → types-D3fPN43o.js} +1 -1
- package/dist/{use-hover-B1HPf4hF.js → use-hover-B6VmMb06.js} +11779 -11336
- package/dist/{use-hover-CaQrW_gv.cjs → use-hover-CaSOzp0i.cjs} +129 -130
- package/dist/{utils-CAubp1g1.cjs → utils-BwGnDoB0.cjs} +23 -23
- package/dist/{utils-BQtueE3Z.js → utils-CsV-iYtb.js} +2410 -2439
- package/dist/{widget-composer-BAJFWk3t.js → widget-composer-Bv_OVu1o.js} +275 -223
- package/dist/{widget-composer-C75b-E6W.cjs → widget-composer-C72Io-3c.cjs} +7 -7
- package/package.json +11 -8
- package/dist/apply-styled-options-to-query-COD9fRYD.cjs +0 -1
- package/dist/packages/sdk-ui/src/domains/drilldown/hooks/use-synced-drilldown-paths-manager.d.ts +0 -113
|
@@ -19,7 +19,7 @@ export declare class ChatRestApi {
|
|
|
19
19
|
private deleteChatHistory;
|
|
20
20
|
private sendFeedback;
|
|
21
21
|
ai: {
|
|
22
|
-
getNlgInsights: (request: GetNlgInsightsRequest, options?: GetNarrativeOptions) => Promise<import("../../../infra/api/narrative/narrative-api-types").NarrativeResponse>;
|
|
22
|
+
getNlgInsights: (request: GetNlgInsightsRequest, options?: GetNarrativeOptions) => Promise<import("../../../infra/api/narrative/narrative-api-types").NarrativeResponse | undefined>;
|
|
23
23
|
getNlqResult: (contextTitle: string, request: GetNlqResultRequest) => Promise<NlqResult | undefined>;
|
|
24
24
|
getQueryRecommendations: (contextTitle: string, config: QueryRecommendationConfig) => Promise<QueryRecommendationResponse | undefined>;
|
|
25
25
|
setLlmConfig: (config: LlmConfig) => Promise<unknown>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DashboardProps } from '../../../../domains/dashboarding/types.js';
|
|
2
|
+
import type { NlqTranslationResult } from '../../types.js';
|
|
3
|
+
import type { DashboardInput } from '../types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Translates NLQ DashboardJSON format to CSDK DashboardProps.
|
|
6
|
+
* Direction: JSON → CSDK
|
|
7
|
+
*
|
|
8
|
+
* Translates each widget using `translateWidgetFromJSON` (which requires each widget JSON to
|
|
9
|
+
* have an `id`). Dashboard-level filters are translated using the shared filter translator.
|
|
10
|
+
*
|
|
11
|
+
* Translation fails if any widget or filter translation fails.
|
|
12
|
+
*
|
|
13
|
+
* @param input - DashboardInput containing dashboardJSON and data schema context
|
|
14
|
+
* @returns NlqTranslationResult with DashboardProps or errors
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export declare const translateDashboardFromJSON: (input: DashboardInput) => NlqTranslationResult<DashboardProps>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DashboardProps } from '../../../../domains/dashboarding/types.js';
|
|
2
|
+
import type { NlqTranslationResult } from '../../types.js';
|
|
3
|
+
import type { DashboardJSON } from '../types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Translates CSDK DashboardProps to NLQ DashboardJSON format.
|
|
6
|
+
* Direction: CSDK → JSON
|
|
7
|
+
*
|
|
8
|
+
* Translates each widget using `translateWidgetToJSON` and dashboard-level filters using
|
|
9
|
+
* the shared filter translator. Translation fails if any widget or filter translation fails.
|
|
10
|
+
*
|
|
11
|
+
* @param dashboardProps - Dashboard props to serialize
|
|
12
|
+
* @returns NlqTranslationResult with DashboardJSON or errors
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export declare const translateDashboardToJSON: (dashboardProps: DashboardProps) => NlqTranslationResult<DashboardJSON>;
|
|
@@ -4,5 +4,9 @@ export * from './chart/translate-chart-from-json.js';
|
|
|
4
4
|
export * from './chart/translate-chart-to-json.js';
|
|
5
5
|
export * from './pivot-table/translate-pivot-table-from-json.js';
|
|
6
6
|
export * from './pivot-table/translate-pivot-table-to-json.js';
|
|
7
|
+
export * from './widget/translate-widget-from-json.js';
|
|
8
|
+
export * from './widget/translate-widget-to-json.js';
|
|
9
|
+
export * from './dashboard/translate-dashboard-from-json.js';
|
|
10
|
+
export * from './dashboard/translate-dashboard-to-json.js';
|
|
7
11
|
export * from './query/translate-query-to-jaql.js';
|
|
8
|
-
export type { ChartJSON, DataOptionsJSON, ChartInput, PivotTableJSON, PivotTableDataOptionsJSON, PivotTableInput, } from './types.js';
|
|
12
|
+
export type { ChartJSON, DataOptionsJSON, ChartInput, DataSourceJSON, PivotTableJSON, PivotTableDataOptionsJSON, PivotTableInput, ChartWidgetJSON, PivotTableWidgetJSON, TextWidgetJSON, CustomWidgetJSON, WidgetJSON, WidgetInput, SpecificWidgetOptionsJSON, WidgetsOptionsJSON, DashboardJSON, DashboardInput, } from './types.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ExecuteQueryParams } from '../../../../domains/query-execution/index.js';
|
|
2
2
|
import { NlqTranslationResult } from '../../types.js';
|
|
3
3
|
import { QueryInput } from '../../types.js';
|
|
4
4
|
/**
|
|
5
|
-
* Translates NLQ JSON format to CSDK
|
|
5
|
+
* Translates NLQ JSON format to CSDK ExecuteQueryParams object.
|
|
6
6
|
* Direction: JSON → CSDK
|
|
7
7
|
*
|
|
8
|
-
* Translate Query JSON generated by the new NLQ API to
|
|
8
|
+
* Translate Query JSON generated by the new NLQ API to ExecuteQueryParams object.
|
|
9
9
|
*
|
|
10
10
|
* @example
|
|
11
11
|
* {
|
|
@@ -219,7 +219,7 @@ import { QueryInput } from '../../types.js';
|
|
|
219
219
|
],
|
|
220
220
|
}}
|
|
221
221
|
* @param input - QueryInput object
|
|
222
|
-
* @returns NlqTranslationResult<
|
|
222
|
+
* @returns NlqTranslationResult<ExecuteQueryParams>
|
|
223
223
|
* @internal
|
|
224
224
|
*/
|
|
225
|
-
export declare const translateQueryFromJSON: (input: QueryInput) => NlqTranslationResult<
|
|
225
|
+
export declare const translateQueryFromJSON: (input: QueryInput) => NlqTranslationResult<ExecuteQueryParams>;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { type DataSource } from '@sisense/sdk-data';
|
|
2
2
|
import type { JaqlQueryPayload } from '@sisense/sdk-query-client';
|
|
3
|
-
import {
|
|
3
|
+
import type { ExecuteQueryParams } from '../../../../domains/query-execution/types.js';
|
|
4
4
|
/**
|
|
5
|
-
* Converts
|
|
5
|
+
* Converts ExecuteQueryParams to JAQL payload
|
|
6
6
|
*
|
|
7
7
|
* This is a pure TypeScript function that works in Node.js environments
|
|
8
8
|
* and converts query parameters to JAQL without requiring React hooks or browser APIs.
|
|
9
9
|
*
|
|
10
10
|
* Reuses the existing query preparation logic from executeQuery to avoid duplication.
|
|
11
11
|
*
|
|
12
|
-
* @param queryParams -
|
|
12
|
+
* @param queryParams - Query parameters (execution-only fields are not reflected in JAQL beyond prepareQueryParams)
|
|
13
13
|
* @param defaultDataSource - Default data source if not specified in queryParams
|
|
14
14
|
* @param shouldSkipHighlightsWithoutAttributes - Whether to skip highlights without corresponding attributes
|
|
15
15
|
* @returns The JAQL query payload
|
|
16
16
|
* @internal
|
|
17
17
|
*/
|
|
18
|
-
export declare function translateQueryToJaql(queryParams:
|
|
18
|
+
export declare function translateQueryToJaql(queryParams: ExecuteQueryParams, defaultDataSource?: DataSource, shouldSkipHighlightsWithoutAttributes?: boolean): JaqlQueryPayload;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ExecuteQueryParams } from '../../../../domains/query-execution/index.js';
|
|
2
2
|
import { NlqResponseJSON, NlqTranslationResult } from '../../types.js';
|
|
3
3
|
/**
|
|
4
|
-
* Translates CSDK
|
|
4
|
+
* Translates CSDK ExecuteQueryParams to NLQ JSON format.
|
|
5
5
|
* Direction: CSDK → JSON
|
|
6
6
|
*
|
|
7
7
|
* Converts CSDK objects (Attribute[], Measure[], Filter[], FilterRelations) to NLQ FunctionCall format.
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
10
|
* ```typescript
|
|
11
|
-
* const query:
|
|
11
|
+
* const query: ExecuteQueryParams = {
|
|
12
12
|
* dimensions: [DM.Category.Category, DM.Brand.Brand],
|
|
13
13
|
* measures: [
|
|
14
14
|
* measureFactory.sum(DM.Commerce.Revenue, 'Total Revenue'),
|
|
@@ -49,8 +49,8 @@ import { NlqResponseJSON, NlqTranslationResult } from '../../types.js';
|
|
|
49
49
|
* });
|
|
50
50
|
* ```
|
|
51
51
|
*
|
|
52
|
-
* @param query -
|
|
52
|
+
* @param query - ExecuteQueryParams object with CSDK objects
|
|
53
53
|
* @returns NlqTranslationResult<NlqResponseJSON> with FunctionCall format or structured errors
|
|
54
54
|
* @internal
|
|
55
55
|
*/
|
|
56
|
-
export declare function translateQueryToJSON(query:
|
|
56
|
+
export declare function translateQueryToJSON(query: ExecuteQueryParams): NlqTranslationResult<NlqResponseJSON>;
|
|
@@ -13,7 +13,4 @@ export type AxisType = 'dimension' | 'measure';
|
|
|
13
13
|
export declare function adaptDimensionsToStyledColumn(items: DimensionTranslationItem[]): (Attribute | StyledColumn)[];
|
|
14
14
|
export declare function adaptMeasuresToStyledMeasureColumn(items: MeasureTranslationItem[]): (Measure | StyledMeasureColumn)[];
|
|
15
15
|
export declare function toJSONArray(value: DimensionItemJSON | DimensionItemJSON[] | MeasureItemJSON | MeasureItemJSON[]): JSONArray;
|
|
16
|
-
/**
|
|
17
|
-
* Maps inner translation errors to dataOptions axis context.
|
|
18
|
-
*/
|
|
19
16
|
export declare function withAxisContext(axisKey: string): (e: NlqTranslationError) => NlqTranslationError;
|
|
@@ -12,6 +12,7 @@ import { FunctionContext, ProcessedArg } from '../../../types.js';
|
|
|
12
12
|
*
|
|
13
13
|
* @param processedArgs - [title: string, formula: string, context: Record<string, unknown>, format?: string, description?: string]
|
|
14
14
|
* @param context - Processing context with error prefix and other metadata
|
|
15
|
+
* @returns New args array with `processedContext` at index 2 (does not mutate `processedArgs`)
|
|
15
16
|
* @throws Error with descriptive message if validation fails
|
|
16
17
|
*/
|
|
17
|
-
export declare function processCustomFormula(processedArgs: ProcessedArg[], context: FunctionContext):
|
|
18
|
+
export declare function processCustomFormula(processedArgs: ProcessedArg[], context: FunctionContext): ProcessedArg[];
|
|
@@ -13,7 +13,6 @@ import { CustomFunctionProcessor } from '../../types.js';
|
|
|
13
13
|
* ```typescript
|
|
14
14
|
* // Adding a new custom processor
|
|
15
15
|
* 'measureFactory.rank': processRankingParameters,
|
|
16
|
-
* 'filterFactory.dateRange': processDateRangeLogic,
|
|
17
16
|
* ```
|
|
18
17
|
*/
|
|
19
18
|
export declare const FUNCTION_PROCESSORS: Record<string, CustomFunctionProcessor>;
|
|
@@ -5,33 +5,37 @@ import { FunctionContext, ProcessedArg } from '../../types.js';
|
|
|
5
5
|
*
|
|
6
6
|
* @param processedArgs - [attribute, value, config?]
|
|
7
7
|
* @param context - Processing context with error prefix and other metadata
|
|
8
|
+
* @returns Same `processedArgs` reference when validation succeeds
|
|
8
9
|
* @throws Error with descriptive message if validation fails
|
|
9
10
|
*/
|
|
10
|
-
export declare function processStringOrNumericFilter(processedArgs: ProcessedArg[], context: FunctionContext):
|
|
11
|
+
export declare function processStringOrNumericFilter(processedArgs: ProcessedArg[], context: FunctionContext): ProcessedArg[];
|
|
11
12
|
/**
|
|
12
13
|
* Processes filters that only accept numeric values
|
|
13
14
|
* Used by: greaterThan, lessThan, between, etc.
|
|
14
15
|
*
|
|
15
16
|
* @param processedArgs - [attribute, value, config?]
|
|
16
17
|
* @param context - Processing context with error prefix and other metadata
|
|
18
|
+
* @returns Same `processedArgs` reference when validation succeeds
|
|
17
19
|
* @throws Error with descriptive message if validation fails
|
|
18
20
|
*/
|
|
19
|
-
export declare function processNumericFilter(processedArgs: ProcessedArg[], context: FunctionContext):
|
|
21
|
+
export declare function processNumericFilter(processedArgs: ProcessedArg[], context: FunctionContext): ProcessedArg[];
|
|
20
22
|
/**
|
|
21
23
|
* Processes filters that only accept string values
|
|
22
24
|
* Used by: contains, startsWith, endsWith, like, etc.
|
|
23
25
|
*
|
|
24
26
|
* @param processedArgs - [attribute, value, config?]
|
|
25
27
|
* @param context - Processing context with error prefix and other metadata
|
|
28
|
+
* @returns Same `processedArgs` reference when validation succeeds
|
|
26
29
|
* @throws Error with descriptive message if validation fails
|
|
27
30
|
*/
|
|
28
|
-
export declare function processStringFilter(processedArgs: ProcessedArg[], context: FunctionContext):
|
|
31
|
+
export declare function processStringFilter(processedArgs: ProcessedArg[], context: FunctionContext): ProcessedArg[];
|
|
29
32
|
/**
|
|
30
33
|
* Processes exclude filter to validate that it only accepts members filters
|
|
31
34
|
* Used by: exclude
|
|
32
35
|
*
|
|
33
36
|
* @param processedArgs - [filter, inputFilter?, config?]
|
|
34
37
|
* @param context - Processing context with error prefix and other metadata
|
|
38
|
+
* @returns Same `processedArgs` reference when validation succeeds
|
|
35
39
|
* @throws Error with descriptive message if validation fails
|
|
36
40
|
*/
|
|
37
|
-
export declare function processExcludeFilter(processedArgs: ProcessedArg[], context: FunctionContext):
|
|
41
|
+
export declare function processExcludeFilter(processedArgs: ProcessedArg[], context: FunctionContext): ProcessedArg[];
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { NlqTranslationError } from '../../../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Builds a path string for a dataOptions field.
|
|
4
|
+
*
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare function dataOptionsPath(axisKey: string | number, itemIndex?: number): string;
|
|
8
|
+
/**
|
|
9
|
+
* Joins path segments using pathPrefix notation (e.g. "widgets[0].dataOptions.category[0]").
|
|
10
|
+
*
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare function joinPathStrings(prefix: string, suffix?: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Prefixes an error path with a structural segment.
|
|
16
|
+
*
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export declare function prefixPath(prefix: string): (error: NlqTranslationError) => NlqTranslationError;
|
|
20
|
+
/**
|
|
21
|
+
* Prefixes path with widgets[index] for dashboard-level widget errors.
|
|
22
|
+
*
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
export declare function withWidgetsArrayPath(widgetIndex: number): (error: NlqTranslationError) => NlqTranslationError;
|
|
26
|
+
/**
|
|
27
|
+
* Prefixes filter errors with filters[index] at dashboard level.
|
|
28
|
+
*
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
export declare function withFilterPath(filterIndex: number): (error: NlqTranslationError) => NlqTranslationError;
|
|
32
|
+
/**
|
|
33
|
+
* Maps errors from a translation result through a mapper.
|
|
34
|
+
*
|
|
35
|
+
* @internal
|
|
36
|
+
*/
|
|
37
|
+
export declare function mapTranslationErrors(errors: readonly NlqTranslationError[], mapError: (error: NlqTranslationError) => NlqTranslationError): NlqTranslationError[];
|
|
@@ -3,17 +3,49 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @internal
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import type { DataSource, JSONObject } from '@sisense/sdk-data';
|
|
7
|
+
import type { WidgetsOptions } from '../../../../../domains/dashboarding/dashboard-model/types.js';
|
|
7
8
|
import type { NlqTranslationError, NlqTranslationResult } from '../../../types.js';
|
|
9
|
+
import type { DataSourceJSON, WidgetsOptionsJSON } from '../../types.js';
|
|
10
|
+
type WithOptionalToJSON = {
|
|
11
|
+
toJSON?: () => JSONObject;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Returns a JSON-friendly snapshot for translation error reporting.
|
|
15
|
+
* Uses `toJSON()` when present (CSDK Attribute/Measure); otherwise returns the value as-is.
|
|
16
|
+
*
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Serializes a CSDK data source to NLQ JSON (title string only).
|
|
21
|
+
*
|
|
22
|
+
* @param dataSource - Widget or dashboard data source
|
|
23
|
+
* @returns Data source title for JSON output
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
export declare function translateDataSourceToJSON(dataSource: DataSource): DataSourceJSON;
|
|
27
|
+
/**
|
|
28
|
+
* Extracts JSON-serializable widget options from dashboard `widgetsOptions`.
|
|
29
|
+
* Omits `jtdConfig` and other non-JSON-safe fields.
|
|
30
|
+
*
|
|
31
|
+
* @param widgetsOptions - Dashboard widget options map
|
|
32
|
+
* @returns Widget options safe for NLQ JSON, or `undefined` when empty
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
export declare function translateWidgetsOptionsToJSON(widgetsOptions: WidgetsOptions): WidgetsOptionsJSON | undefined;
|
|
36
|
+
export declare function toNlqErrorInput(value: WithOptionalToJSON | unknown): unknown;
|
|
8
37
|
/**
|
|
9
38
|
* Recursively strips [[delimiters]] from all strings in a JSON structure.
|
|
10
39
|
* Transforms "DM.[[Commerce Sales]].[[Order Date]]" → "DM.Commerce Sales.Order Date"
|
|
11
40
|
*
|
|
12
|
-
*
|
|
41
|
+
* Accepts NLQ output shapes (e.g. ChartJSON) that are JSON-serializable at runtime but are not
|
|
42
|
+
* assignable to sdk-data `JSONValue` because of `Record<string, unknown>` style fields.
|
|
43
|
+
*
|
|
44
|
+
* @param value - The value to process
|
|
13
45
|
* @returns The value with all [[delimiters]] stripped from strings
|
|
14
46
|
* @internal
|
|
15
47
|
*/
|
|
16
|
-
export declare function stripDelimitersFromJson<T
|
|
48
|
+
export declare function stripDelimitersFromJson<T>(value: T): T;
|
|
17
49
|
export declare function getSuccessData<T>(result: NlqTranslationResult<T>): T;
|
|
18
50
|
export declare function getErrors<T>(result: NlqTranslationResult<T>): string[];
|
|
19
51
|
/**
|
|
@@ -29,3 +61,4 @@ export declare function getErrors<T>(result: NlqTranslationResult<T>): string[];
|
|
|
29
61
|
* @internal
|
|
30
62
|
*/
|
|
31
63
|
export declare function collectTranslationErrors<T>(translateFn: () => NlqTranslationResult<T>, errors: NlqTranslationError[], mapError?: (e: NlqTranslationError) => NlqTranslationError): T | null;
|
|
64
|
+
export {};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { type Arg, type ArgValue, Attribute, Filter, FilterRelations, type FunctionCall, JaqlDataSourceForDto, JSONArray, Measure, PivotGrandTotals } from '@sisense/sdk-data';
|
|
2
|
-
import {
|
|
3
|
-
import type {
|
|
2
|
+
import type { CommonFiltersOptions } from '../../../domains/dashboarding/common-filters/types.js';
|
|
3
|
+
import type { DashboardConfig, DashboardLayoutOptions, DashboardStyleOptions } from '../../../domains/dashboarding/types.js';
|
|
4
|
+
import { CategoryStyle, SeriesStyle, ValueStyle } from '../../../domains/visualizations/core/chart-data-options/types.js';
|
|
5
|
+
import type { WidgetConfig, WidgetType } from '../../../domains/widgets/components/widget/types.js';
|
|
6
|
+
import type { CustomWidgetStyleOptions, PivotTableStyleOptions, TextWidgetStyleOptions } from '../../../types.js';
|
|
4
7
|
import { DataSchemaContext, NlqTranslationInput } from '../types.js';
|
|
5
8
|
import type { SchemaIndex } from './shared/utils/schema-index.js';
|
|
6
9
|
/**
|
|
@@ -49,8 +52,12 @@ export type NodeInput = NlqTranslationInput<FunctionCall, FunctionContext>;
|
|
|
49
52
|
export type ArgInput = NlqTranslationInput<Arg, ArgContext>;
|
|
50
53
|
/**
|
|
51
54
|
* Custom processor function signature.
|
|
55
|
+
*
|
|
56
|
+
* Implementations must not mutate `processedArgs`. Returns the argument list to pass to
|
|
57
|
+
* `executeFunction`—typically the same array reference when only validating, or a new array when
|
|
58
|
+
* normalizing or replacing nested values.
|
|
52
59
|
*/
|
|
53
|
-
export type CustomFunctionProcessor = (processedArgs: ProcessedArg[], context: FunctionContext) =>
|
|
60
|
+
export type CustomFunctionProcessor = (processedArgs: ProcessedArg[], context: FunctionContext) => ProcessedArg[];
|
|
54
61
|
/**
|
|
55
62
|
* Type guard: value is a non-null object (Record<string, unknown>).
|
|
56
63
|
* @internal
|
|
@@ -209,3 +216,125 @@ export interface PivotTableJSON {
|
|
|
209
216
|
* @internal
|
|
210
217
|
*/
|
|
211
218
|
export type PivotTableInput = NlqTranslationInput<PivotTableJSON, DataSchemaContext>;
|
|
219
|
+
/**
|
|
220
|
+
* Mirrors `WithCommonWidgetProps` for the JSON layer
|
|
221
|
+
*/
|
|
222
|
+
type WithCommonWidgetJSON<Base, Type extends WidgetType> = Base & {
|
|
223
|
+
widgetType: Type;
|
|
224
|
+
readonly id: string;
|
|
225
|
+
};
|
|
226
|
+
/**
|
|
227
|
+
* Data source in NLQ JSON — title only. Full JAQL details live in {@link DataSchemaContext}.
|
|
228
|
+
*
|
|
229
|
+
* @internal
|
|
230
|
+
*/
|
|
231
|
+
export type DataSourceJSON = string;
|
|
232
|
+
/**
|
|
233
|
+
* JSON representation of a chart widget
|
|
234
|
+
*
|
|
235
|
+
* @internal
|
|
236
|
+
*/
|
|
237
|
+
export type ChartWidgetJSON = ChartJSON & {
|
|
238
|
+
title?: string;
|
|
239
|
+
description?: string;
|
|
240
|
+
dataSource?: DataSourceJSON;
|
|
241
|
+
config?: WidgetConfig;
|
|
242
|
+
highlightSelectionDisabled?: boolean;
|
|
243
|
+
};
|
|
244
|
+
/**
|
|
245
|
+
* JSON representation of a pivot table widget.
|
|
246
|
+
*
|
|
247
|
+
* @internal
|
|
248
|
+
*/
|
|
249
|
+
export type PivotTableWidgetJSON = PivotTableJSON & {
|
|
250
|
+
title?: string;
|
|
251
|
+
description?: string;
|
|
252
|
+
dataSource?: DataSourceJSON;
|
|
253
|
+
config?: WidgetConfig;
|
|
254
|
+
};
|
|
255
|
+
/**
|
|
256
|
+
* JSON representation of a text widget
|
|
257
|
+
*
|
|
258
|
+
* @internal
|
|
259
|
+
*/
|
|
260
|
+
export type TextWidgetJSON = {
|
|
261
|
+
styleOptions: TextWidgetStyleOptions;
|
|
262
|
+
config?: WidgetConfig;
|
|
263
|
+
};
|
|
264
|
+
/**
|
|
265
|
+
* JSON representation of a custom/plugin widget payload.
|
|
266
|
+
* `dataOptions` is passed through as opaque JSON — `GenericDataOptions` cannot be reliably
|
|
267
|
+
* round-tripped without custom-widget-specific schema knowledge.
|
|
268
|
+
* Only `filters` and `highlights` are translated; all other fields are pass-through.
|
|
269
|
+
* `widgetType` and `id` are added on `WidgetJSON` via `WithCommonWidgetJSON`.
|
|
270
|
+
*
|
|
271
|
+
* @internal
|
|
272
|
+
*/
|
|
273
|
+
export type CustomWidgetJSON = {
|
|
274
|
+
customWidgetType: string;
|
|
275
|
+
title?: string;
|
|
276
|
+
description?: string;
|
|
277
|
+
dataSource?: DataSourceJSON;
|
|
278
|
+
config?: WidgetConfig;
|
|
279
|
+
filters?: FunctionCall[];
|
|
280
|
+
highlights?: FunctionCall[];
|
|
281
|
+
/** Opaque pass-through — GenericDataOptions serialized as plain JSON */
|
|
282
|
+
dataOptions?: Record<string, unknown>;
|
|
283
|
+
styleOptions?: CustomWidgetStyleOptions;
|
|
284
|
+
customOptions?: Record<string, unknown>;
|
|
285
|
+
};
|
|
286
|
+
/**
|
|
287
|
+
* Dashboard-level options for a specific widget in NLQ JSON.
|
|
288
|
+
* Excludes non-JSON-safe fields such as `jtdConfig` (Map / Filter objects).
|
|
289
|
+
*
|
|
290
|
+
* @internal
|
|
291
|
+
*/
|
|
292
|
+
export type SpecificWidgetOptionsJSON = {
|
|
293
|
+
filtersOptions?: CommonFiltersOptions;
|
|
294
|
+
partialDtoOptions?: {
|
|
295
|
+
options?: Record<string, unknown>;
|
|
296
|
+
style?: Record<string, unknown>;
|
|
297
|
+
};
|
|
298
|
+
};
|
|
299
|
+
/**
|
|
300
|
+
* Widget options map for NLQ dashboard JSON.
|
|
301
|
+
*
|
|
302
|
+
* @internal
|
|
303
|
+
*/
|
|
304
|
+
export type WidgetsOptionsJSON = Record<string, SpecificWidgetOptionsJSON>;
|
|
305
|
+
/**
|
|
306
|
+
* Discriminated union of all NLQ widget JSON representations.
|
|
307
|
+
* Mirrors the `WidgetProps` discriminated union in serializable JSON form.
|
|
308
|
+
*
|
|
309
|
+
* @internal
|
|
310
|
+
*/
|
|
311
|
+
export type WidgetJSON = WithCommonWidgetJSON<ChartWidgetJSON, 'chart'> | WithCommonWidgetJSON<PivotTableWidgetJSON, 'pivot'> | WithCommonWidgetJSON<TextWidgetJSON, 'text'> | WithCommonWidgetJSON<CustomWidgetJSON, 'custom'>;
|
|
312
|
+
/**
|
|
313
|
+
* JSON representation of a dashboard.
|
|
314
|
+
*
|
|
315
|
+
* @internal
|
|
316
|
+
*/
|
|
317
|
+
export interface DashboardJSON {
|
|
318
|
+
id?: string;
|
|
319
|
+
title?: string;
|
|
320
|
+
filters?: FunctionCall[];
|
|
321
|
+
widgets: WidgetJSON[];
|
|
322
|
+
layoutOptions?: DashboardLayoutOptions;
|
|
323
|
+
config?: DashboardConfig;
|
|
324
|
+
/** Data source title only — schema details live in {@link DataSchemaContext}. */
|
|
325
|
+
defaultDataSource?: DataSourceJSON;
|
|
326
|
+
styleOptions?: DashboardStyleOptions;
|
|
327
|
+
widgetsOptions?: WidgetsOptionsJSON;
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Input type for widget translation (JSON → CSDK).
|
|
331
|
+
*
|
|
332
|
+
* @internal
|
|
333
|
+
*/
|
|
334
|
+
export type WidgetInput = NlqTranslationInput<WidgetJSON, DataSchemaContext>;
|
|
335
|
+
/**
|
|
336
|
+
* Input type for dashboard translation (JSON → CSDK).
|
|
337
|
+
*
|
|
338
|
+
* @internal
|
|
339
|
+
*/
|
|
340
|
+
export type DashboardInput = NlqTranslationInput<DashboardJSON, DataSchemaContext>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { translateCustomWidgetFiltersFromJSON } from './translate-custom-widget-filters-from-json.js';
|
|
2
|
+
export { translateEnvelopeWidgetFromJSON } from './translate-envelope-widget-from-json.js';
|
|
3
|
+
export { toChartWidgetProps, toPivotTableWidgetProps } from './to-widget-props.js';
|
|
4
|
+
export type { WidgetMeta } from './to-widget-props.js';
|
|
5
|
+
export { validateWidgetType } from './validate-widget-json.js';
|
|
6
|
+
export { hasRequiredWidgetId, missingWidgetIdError } from './widget-id.js';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { WidgetConfig, WidgetProps } from '../../../../../domains/widgets/components/widget/types.js';
|
|
2
|
+
import type { ChartProps, PivotTableProps } from '../../../../../props.js';
|
|
3
|
+
import type { DataSourceJSON } from '../../types.js';
|
|
4
|
+
export type WidgetMeta = {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly title?: string;
|
|
7
|
+
readonly description?: string;
|
|
8
|
+
readonly dataSource?: DataSourceJSON;
|
|
9
|
+
readonly config?: WidgetConfig;
|
|
10
|
+
readonly highlightSelectionDisabled?: boolean;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Maps chart component props (with `dataSet`) to chart widget props (with `dataSource`).
|
|
14
|
+
*
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export declare const toChartWidgetProps: (chartProps: ChartProps, meta: WidgetMeta) => Extract<WidgetProps, {
|
|
18
|
+
widgetType: 'chart';
|
|
19
|
+
}>;
|
|
20
|
+
/**
|
|
21
|
+
* Maps pivot table component props (with `dataSet`) to pivot widget props (with `dataSource`).
|
|
22
|
+
*
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
export declare const toPivotTableWidgetProps: (pivotProps: PivotTableProps, meta: WidgetMeta) => Extract<WidgetProps, {
|
|
26
|
+
widgetType: 'pivot';
|
|
27
|
+
}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Filter, FilterRelations, FunctionCall } from '@sisense/sdk-data';
|
|
2
|
+
import type { DataSchemaContext, NlqTranslationResult } from '../../../types.js';
|
|
3
|
+
export type CustomWidgetFiltersTranslation = {
|
|
4
|
+
readonly filters?: Filter[] | FilterRelations;
|
|
5
|
+
readonly highlights?: Filter[];
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Translates custom-widget filters and highlights from NLQ JSON to CSDK filters.
|
|
9
|
+
*
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export declare const translateCustomWidgetFiltersFromJSON: (filters: FunctionCall[] | undefined, highlights: FunctionCall[] | undefined, context: DataSchemaContext) => NlqTranslationResult<CustomWidgetFiltersTranslation>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { WidgetConfig } from '../../../../../domains/widgets/components/widget/types.js';
|
|
2
|
+
import type { DataSchemaContext, NlqTranslationInput, NlqTranslationResult } from '../../../types.js';
|
|
3
|
+
import type { DataSourceJSON } from '../../types.js';
|
|
4
|
+
import type { WidgetMeta } from './to-widget-props.js';
|
|
5
|
+
type WidgetEnvelopeJSON = {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
readonly title?: string;
|
|
8
|
+
readonly description?: string;
|
|
9
|
+
readonly dataSource?: DataSourceJSON;
|
|
10
|
+
readonly config?: WidgetConfig;
|
|
11
|
+
readonly highlightSelectionDisabled?: boolean;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Strips widget envelope fields and delegates to a chart/pivot sub-translator,
|
|
15
|
+
* then maps component props to widget props with metadata.
|
|
16
|
+
*
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export declare const translateEnvelopeWidgetFromJSON: <TWidgetJSON extends WidgetEnvelopeJSON, TPayload, TComponentProps, TWidgetProps>(widgetJSON: TWidgetJSON, context: DataSchemaContext, translate: (input: NlqTranslationInput<TPayload, DataSchemaContext>) => NlqTranslationResult<TComponentProps>, toWidgetProps: (props: TComponentProps, meta: WidgetMeta) => TWidgetProps) => NlqTranslationResult<TWidgetProps>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { NlqTranslationError } from '../../../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Validates that widget JSON includes a supported `widgetType`.
|
|
4
|
+
*
|
|
5
|
+
* @param rawInput - Raw widget JSON object
|
|
6
|
+
* @returns Validation error, or `null` when `widgetType` is present and valid
|
|
7
|
+
*/
|
|
8
|
+
export declare function validateWidgetType(rawInput: unknown): NlqTranslationError | null;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { NlqTranslationError } from '../../../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Builds a translation error when widget JSON is missing a required `id`.
|
|
4
|
+
*
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare const missingWidgetIdError: (input: unknown) => NlqTranslationError;
|
|
8
|
+
/**
|
|
9
|
+
* Narrows widget JSON to require a present `id`.
|
|
10
|
+
*
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare const hasRequiredWidgetId: <T extends {
|
|
14
|
+
id?: string | undefined;
|
|
15
|
+
}>(widget: T) => widget is T & {
|
|
16
|
+
id: string;
|
|
17
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { WidgetProps } from '../../../../domains/widgets/components/widget/types.js';
|
|
2
|
+
import type { NlqTranslationResult } from '../../types.js';
|
|
3
|
+
import type { WidgetInput } from '../types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Translates NLQ WidgetJSON format to CSDK widget props.
|
|
6
|
+
* Direction: JSON → CSDK
|
|
7
|
+
*
|
|
8
|
+
* Dispatches to the appropriate sub-translator based on `widgetType`:
|
|
9
|
+
* - `'chart'` → `translateChartFromJSON`
|
|
10
|
+
* - `'pivot'` → `translatePivotTableFromJSON`
|
|
11
|
+
* - `'text'` → pass-through (no data translation)
|
|
12
|
+
* - `'custom'` → filters/highlights translated; dataOptions passed through as opaque JSON
|
|
13
|
+
*
|
|
14
|
+
*
|
|
15
|
+
* @param input - WidgetInput containing widgetJSON and data schema context
|
|
16
|
+
* @returns NlqTranslationResult with WidgetProps or errors
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export declare const translateWidgetFromJSON: (input: WidgetInput) => NlqTranslationResult<WidgetProps>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { WidgetProps } from '../../../../domains/widgets/components/widget/types.js';
|
|
2
|
+
import type { NlqTranslationResult } from '../../types.js';
|
|
3
|
+
import type { WidgetJSON } from '../types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Translates CSDK widget props to NLQ WidgetJSON format.
|
|
6
|
+
* Direction: CSDK → JSON
|
|
7
|
+
*
|
|
8
|
+
* Dispatches to the appropriate sub-translator based on `widgetType`:
|
|
9
|
+
* - `'chart'` → `translateChartToJSON`
|
|
10
|
+
* - `'pivot'` → `translatePivotTableToJSON`
|
|
11
|
+
* - `'text'` → pass-through of styleOptions
|
|
12
|
+
* - `'custom'` → filters/highlights translated; dataOptions passed through as opaque JSON
|
|
13
|
+
*
|
|
14
|
+
* @param widgetProps - Widget props with widgetType discriminant (id required)
|
|
15
|
+
* @returns NlqTranslationResult with WidgetJSON or errors
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export declare const translateWidgetToJSON: (widgetProps: WidgetProps) => NlqTranslationResult<WidgetJSON>;
|
|
@@ -348,15 +348,16 @@ export interface DataSchemaContext {
|
|
|
348
348
|
*/
|
|
349
349
|
export type QueryInput = NlqTranslationInput<NlqResponseJSON, DataSchemaContext>;
|
|
350
350
|
/**
|
|
351
|
-
* Context
|
|
351
|
+
* Context used when building translation errors (before message is attached).
|
|
352
352
|
*
|
|
353
353
|
* @internal
|
|
354
354
|
*/
|
|
355
355
|
export type NlqTranslationErrorContext = {
|
|
356
|
-
/**
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
356
|
+
/**
|
|
357
|
+
* Structural location in the JSON being translated, using pathPrefix notation.
|
|
358
|
+
* e.g. "widgets[0].dataOptions.category[0]" or "filters[0]"
|
|
359
|
+
*/
|
|
360
|
+
path: string;
|
|
360
361
|
/** The complete original input that caused the error */
|
|
361
362
|
input: unknown;
|
|
362
363
|
};
|
|
@@ -15,6 +15,18 @@ export declare const getChartRecommendationsOrDefault: (response: ExpandedQueryM
|
|
|
15
15
|
* @internal
|
|
16
16
|
*/
|
|
17
17
|
export declare const getChartDataOptions: (metadataItems: MetadataItem[], chartFamily: string, axesMapping: AxesMapping) => ChartDataOptions;
|
|
18
|
+
/**
|
|
19
|
+
* Minimal chart style overrides for consumers that persist widget props without merged SDK defaults.
|
|
20
|
+
* Compose merges these with per-chart defaults at render time (`extendStyleOptionsWithDefaults`).
|
|
21
|
+
*
|
|
22
|
+
* This function is used by buildChartEngine in sdk-ai-core
|
|
23
|
+
*
|
|
24
|
+
* @param chartType - chart type
|
|
25
|
+
* @param axesMapping - axes mapping
|
|
26
|
+
* @returns partial style options
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
export declare const getMinimalChartStyleOptions: (chartType: ChartType, axesMapping: AxesMapping) => Partial<ChartStyleOptions>;
|
|
18
30
|
/**
|
|
19
31
|
* Get chart style options for the chart widget.
|
|
20
32
|
*
|