@sisense/sdk-ui 1.9.0 → 1.10.1

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.
Files changed (116) hide show
  1. package/dist/ai/ai-context-provider.d.ts +1 -4
  2. package/dist/ai/ai-disclaimer.d.ts +1 -2
  3. package/dist/ai/api/chat-api-provider.d.ts +1 -1
  4. package/dist/ai/buttons/insights-button.d.ts +3 -0
  5. package/dist/ai/buttons/thumbs-down-button.d.ts +1 -2
  6. package/dist/ai/buttons/thumbs-up-button.d.ts +1 -2
  7. package/dist/ai/chat-box.d.ts +1 -2
  8. package/dist/ai/chat-config.d.ts +1 -1
  9. package/dist/ai/chat-dropup.d.ts +1 -2
  10. package/dist/ai/chat-frame.d.ts +1 -1
  11. package/dist/ai/chat-home.d.ts +1 -2
  12. package/dist/ai/chat-input.d.ts +1 -2
  13. package/dist/ai/chat-router.d.ts +1 -2
  14. package/dist/ai/common/collapsible.d.ts +1 -2
  15. package/dist/ai/common/dropup-section.d.ts +1 -2
  16. package/dist/ai/common/error-container.d.ts +1 -2
  17. package/dist/ai/common/icon-button.d.ts +1 -1
  18. package/dist/ai/common/tooltip.d.ts +1 -2
  19. package/dist/ai/data-topics/data-topic-item.d.ts +1 -2
  20. package/dist/ai/data-topics/data-topic-list.d.ts +1 -2
  21. package/dist/ai/icons/arrow-left-icon.d.ts +1 -2
  22. package/dist/ai/icons/clear-chat-icon.d.ts +1 -2
  23. package/dist/ai/icons/close-dialog-icon.d.ts +1 -2
  24. package/dist/ai/icons/expand-icon.d.ts +1 -2
  25. package/dist/ai/icons/info-icon.d.ts +1 -2
  26. package/dist/ai/icons/light-bulb-icon.d.ts +1 -2
  27. package/dist/ai/icons/loading-dots-icon.d.ts +1 -2
  28. package/dist/ai/icons/message-icon.d.ts +1 -2
  29. package/dist/ai/icons/refresh-icon.d.ts +1 -2
  30. package/dist/ai/icons/sisense-logo.d.ts +1 -2
  31. package/dist/ai/icons/three-dots-icon.d.ts +1 -2
  32. package/dist/ai/icons/thumbs-down-hovered-icon.d.ts +1 -2
  33. package/dist/ai/icons/thumbs-down-icon.d.ts +1 -2
  34. package/dist/ai/icons/thumbs-up-hovered-icon.d.ts +1 -2
  35. package/dist/ai/icons/thumbs-up-icon.d.ts +1 -2
  36. package/dist/ai/index.d.ts +3 -1
  37. package/dist/ai/messages/chart-message-toolbar.d.ts +1 -2
  38. package/dist/ai/messages/chart-message.d.ts +1 -2
  39. package/dist/ai/messages/chat-welcome-message.d.ts +1 -2
  40. package/dist/ai/messages/clear-history-message.d.ts +1 -2
  41. package/dist/ai/messages/clear-history-success-message.d.ts +1 -2
  42. package/dist/ai/messages/clickable-message.d.ts +1 -1
  43. package/dist/ai/messages/feedback-wrapper.d.ts +1 -1
  44. package/dist/ai/messages/get-widget-options.d.ts +14 -0
  45. package/dist/ai/messages/insights-message.d.ts +1 -7
  46. package/dist/ai/messages/message-list-resolver.d.ts +1 -2
  47. package/dist/ai/messages/message-resolver.d.ts +1 -1
  48. package/dist/ai/messages/nlq-message-group.d.ts +1 -2
  49. package/dist/ai/nav-back-button.d.ts +1 -2
  50. package/dist/ai/suggestions/suggestion-item.d.ts +1 -2
  51. package/dist/ai/suggestions/suggestion-list-skeleton.d.ts +1 -2
  52. package/dist/ai/suggestions/suggestion-list.d.ts +1 -2
  53. package/dist/ai/suggestions/suggestions-with-intro.d.ts +1 -2
  54. package/dist/ai/{translators/use-get-data-source.d.ts → use-get-data-source-fields.d.ts} +2 -2
  55. package/dist/ai.js +1276 -6688
  56. package/dist/alert-box/alert-box.d.ts +1 -2
  57. package/dist/chart/helpers/use-translated-data-options.d.ts +2 -2
  58. package/dist/chart-data-options/get-translated-data-options.d.ts +2 -2
  59. package/dist/chart-options-processor/style-to-design-options-translator/prepare-design-options.d.ts +4 -2
  60. package/dist/chart-options-processor/style-to-design-options-translator/translate-to-highcharts-options.d.ts +7 -4
  61. package/dist/chart-options-processor/translations/design-options.d.ts +9 -7
  62. package/dist/chart-options-processor/translations/types.d.ts +7 -6
  63. package/dist/charts/map-charts/areamap/areamap.d.ts +3 -6
  64. package/dist/charts/map-charts/scattermap/scattermap.d.ts +5 -9
  65. package/dist/charts/table/data-table-wrapper.d.ts +1 -2
  66. package/dist/charts/table/header/field-type-icon.d.ts +1 -2
  67. package/dist/charts/table/pure-table.d.ts +1 -2
  68. package/dist/common/components/loading-dots.d.ts +1 -2
  69. package/dist/common/components/loading-indicator.d.ts +1 -2
  70. package/dist/common/components/loading-overlay.d.ts +1 -1
  71. package/dist/common/components/loading-spinner.d.ts +1 -2
  72. package/dist/common/icons/exclamation-mark-icon.d.ts +1 -2
  73. package/dist/common/icons/loading-icon.d.ts +1 -2
  74. package/dist/dashboard-widget/utils.d.ts +7 -0
  75. package/dist/{debounce-Cc9bQD5m.js → debounce-CVvJ1016.js} +38258 -38196
  76. package/dist/decorators/component-decorators/with-tracking/use-track-component-init.d.ts +1 -1
  77. package/dist/dynamic-size-container/dynamic-size-container.d.ts +1 -1
  78. package/dist/error-boundary/error-boundary-box.d.ts +1 -2
  79. package/dist/error-boundary/error-boundary.d.ts +1 -1
  80. package/dist/filters/components/common/switch.d.ts +2 -1
  81. package/dist/filters/components/common/triangle-indicator.d.ts +1 -2
  82. package/dist/filters/components/date-filter/date-filter/calendar-date-selector.d.ts +1 -2
  83. package/dist/filters/components/date-filter/date-filter/calendar-header.d.ts +1 -2
  84. package/dist/filters/components/date-filter/date-filter/date-filter.d.ts +1 -2
  85. package/dist/filters/components/date-filter/date-filter/quick-date-selection-buttons.d.ts +1 -2
  86. package/dist/filters/components/icons/arrow-down-icon.d.ts +1 -1
  87. package/dist/filters/components/icons/arrow-right-icon.d.ts +1 -1
  88. package/dist/filters/components/icons/date-icon.d.ts +1 -1
  89. package/dist/filters/components/icons/double-arrow-right-icon.d.ts +1 -1
  90. package/dist/filters/components/icons/menu-icon.d.ts +1 -1
  91. package/dist/filters/components/icons/pencil-icon.d.ts +1 -1
  92. package/dist/filters/components/icons/plus-icon.d.ts +1 -1
  93. package/dist/filters/components/icons/search-icon.d.ts +1 -1
  94. package/dist/filters/components/icons/trash-icon.d.ts +1 -1
  95. package/dist/highcharts-memorized.d.ts +1 -1
  96. package/dist/index.d.ts +1 -0
  97. package/dist/index.js +18534 -18847
  98. package/dist/indicator-canvas.d.ts +4 -9
  99. package/dist/no-results-overlay/no-results-overlay.d.ts +1 -2
  100. package/dist/props.d.ts +1 -1
  101. package/dist/sisense-chart/sisense-chart.d.ts +4 -6
  102. package/dist/translation/i18n-provider.d.ts +1 -1
  103. package/dist/widgets/common/context-menu.d.ts +1 -2
  104. package/dist/widgets/common/drilldown-breadcrumbs/styled-buttons.d.ts +2 -2
  105. package/dist/widgets/common/widget-header-info-button.d.ts +1 -2
  106. package/dist/widgets/drilldown-widget.d.ts +1 -2
  107. package/package.json +16 -18
  108. package/dist/ai/translators/code-templates.d.ts +0 -11
  109. package/dist/ai/translators/generate-code.d.ts +0 -9
  110. package/dist/ai/translators/index.d.ts +0 -4
  111. package/dist/ai/translators/model-translator.d.ts +0 -51
  112. package/dist/ai/translators/query-translator.d.ts +0 -137
  113. package/dist/ai/translators/translate-filters-to-code.d.ts +0 -2
  114. package/dist/ai/translators/translate-props-to-code.d.ts +0 -8
  115. package/dist/ai/translators/types.d.ts +0 -105
  116. package/dist/ai/translators/utils.d.ts +0 -12
@@ -1,11 +1,9 @@
1
- import { ChartDataOptionsInternal, IndicatorChartDataOptionsInternal } from './chart-data-options/types';
1
+ import { IndicatorChartDataOptionsInternal } from './chart-data-options/types';
2
2
  import { type FunctionComponent } from 'react';
3
3
  import { IndicatorChartData } from './chart-data/types';
4
4
  import { IndicatorChartDesignOptions } from './chart-options-processor/translations/design-options';
5
- import { ChartData } from './chart-data/types';
6
- import { DesignOptions } from './chart-options-processor/translations/types';
7
5
  import { ThemeSettings } from './types';
8
- interface Props {
6
+ export interface IndicatorCanvasProps {
9
7
  chartData: IndicatorChartData;
10
8
  dataOptions: IndicatorChartDataOptionsInternal;
11
9
  designOptions: IndicatorChartDesignOptions;
@@ -14,8 +12,5 @@ interface Props {
14
12
  /**
15
13
  * @internal
16
14
  */
17
- export declare const IndicatorCanvas: FunctionComponent<Props>;
18
- export declare const isIndicatorChartData: (chartData: ChartData) => chartData is IndicatorChartData;
19
- export declare const isIndicatorChartDataOptionsInternal: (dataOptions: ChartDataOptionsInternal) => dataOptions is IndicatorChartDataOptionsInternal;
20
- export declare const isIndicatorDesignOptions: (designOptions: DesignOptions) => designOptions is IndicatorChartDesignOptions;
21
- export {};
15
+ export declare const IndicatorCanvas: FunctionComponent<IndicatorCanvasProps>;
16
+ export declare const isIndicatorCanvasProps: (chartData: IndicatorCanvasProps) => boolean;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ChartType, TableType } from '../types';
3
2
  /**
4
3
  * This component displays `No Results` overlay for visualization (e.g., Chart, Table) with no data
@@ -10,4 +9,4 @@ import { ChartType, TableType } from '../types';
10
9
  */
11
10
  export declare const NoResultsOverlay: ({ iconType }: {
12
11
  iconType: ChartType | TableType;
13
- }) => JSX.Element;
12
+ }) => import("react/jsx-runtime").JSX.Element;
package/dist/props.d.ts CHANGED
@@ -343,7 +343,7 @@ export interface BaseChartProps {
343
343
  *
344
344
  * (1) Sisense data source name as a string. For example, `'Sample ECommerce'`. Typically, you
345
345
  * retrieve the data source name from a data model you create using the `get-data-model`
346
- * {@link @sisense/sdk-cli!Command | command} of the Compose SDK CLI. Under the hood, the chart
346
+ * {@link https://sisense.dev/guides/sdk/guides/cli.html | command} of the Compose SDK CLI. Under the hood, the chart
347
347
  * connects to the data source, executes a query, and loads the data as specified in
348
348
  * {@link dataOptions}, {@link filters}, and {@link highlights}.
349
349
  *
@@ -1,15 +1,14 @@
1
- /// <reference types="react" />
2
1
  import { ChartDataOptionsInternal } from '../chart-data-options/types';
3
2
  import { ChartData } from '../chart-data/types';
4
3
  import { BeforeRenderHandler } from '../props';
5
4
  import { ChartDesignOptions } from '../chart-options-processor/translations/types';
6
5
  import { ChartType, CompleteThemeSettings } from '../types';
7
6
  import { SisenseChartDataPointEventHandler, SisenseChartDataPointsEventHandler } from './types';
8
- interface Props {
7
+ export interface SisenseChartProps {
9
8
  chartType: ChartType;
10
9
  chartData: ChartData;
11
- chartDataOptions: ChartDataOptionsInternal;
12
- chartDesignOptions: ChartDesignOptions;
10
+ dataOptions: ChartDataOptionsInternal;
11
+ designOptions: ChartDesignOptions;
13
12
  themeSettings?: CompleteThemeSettings;
14
13
  onDataPointClick?: SisenseChartDataPointEventHandler;
15
14
  onDataPointContextMenu?: SisenseChartDataPointEventHandler;
@@ -19,5 +18,4 @@ interface Props {
19
18
  /**
20
19
  * @internal
21
20
  */
22
- export declare const SisenseChart: ({ chartType, chartData, chartDataOptions, chartDesignOptions, themeSettings, onDataPointClick, onDataPointContextMenu, onDataPointsSelected, onBeforeRender, }: Props) => JSX.Element | null;
23
- export {};
21
+ export declare const SisenseChart: ({ chartType, chartData, dataOptions, designOptions, themeSettings, onDataPointClick, onDataPointContextMenu, onDataPointsSelected, onBeforeRender, }: SisenseChartProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -3,5 +3,5 @@ type I18nProviderProps = {
3
3
  children: React.ReactNode;
4
4
  userLanguage?: string;
5
5
  };
6
- export declare const I18nProvider: ({ children, userLanguage }: I18nProviderProps) => JSX.Element | null;
6
+ export declare const I18nProvider: ({ children, userLanguage }: I18nProviderProps) => import("react/jsx-runtime").JSX.Element | null;
7
7
  export {};
@@ -1,8 +1,7 @@
1
- /// <reference types="react" />
2
1
  import { ContextMenuProps } from '../../props';
3
2
  /**
4
3
  * Context menu of a Drilldown Widget
5
4
  *
6
5
  * @group Drilldown
7
6
  */
8
- export declare const ContextMenu: ({ position, closeContextMenu, itemSections, children, }: ContextMenuProps) => JSX.Element;
7
+ export declare const ContextMenu: ({ position, closeContextMenu, itemSections, children, }: ContextMenuProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  export declare const StyledPrevButton: import("@emotion/styled").StyledComponent<import("@mui/material/IconButton").IconButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
3
3
  ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
4
- }, "style" | "children" | "disabled" | "size" | "className" | "tabIndex" | "color" | "action" | "classes" | "sx" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge"> & {
4
+ }, "children" | "style" | "disabled" | "size" | "className" | "tabIndex" | "color" | "action" | "classes" | "sx" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge"> & {
5
5
  theme?: import("@emotion/react").Theme | undefined;
6
6
  }, {}, {}>;
7
7
  export declare const StyledNextButton: import("@emotion/styled").StyledComponent<import("@mui/material/IconButton").IconButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
8
8
  ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
9
- }, "style" | "children" | "disabled" | "size" | "className" | "tabIndex" | "color" | "action" | "classes" | "sx" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge"> & {
9
+ }, "children" | "style" | "disabled" | "size" | "className" | "tabIndex" | "color" | "action" | "classes" | "sx" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge"> & {
10
10
  theme?: import("@emotion/react").Theme | undefined;
11
11
  }, {}, {}>;
@@ -1,8 +1,7 @@
1
- /// <reference types="react" />
2
1
  import { WidgetStyleOptions } from '../../types';
3
2
  export default function WidgetHeaderInfoButton({ title, description, styleOptions, onRefresh, }: {
4
3
  title?: string;
5
4
  description?: string;
6
5
  styleOptions?: WidgetStyleOptions['header'];
7
6
  onRefresh: () => void;
8
- }): JSX.Element;
7
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { DrilldownWidgetProps } from '../props';
3
2
  /**
4
3
  * React component designed to add drilldown functionality to any type of chart.
@@ -35,4 +34,4 @@ import { DrilldownWidgetProps } from '../props';
35
34
  * @returns DrilldownWidget wrapper component
36
35
  * @group Drilldown
37
36
  */
38
- export declare const DrilldownWidget: ({ drilldownDimensions, initialDimension, config, children, }: DrilldownWidgetProps) => JSX.Element;
37
+ export declare const DrilldownWidget: ({ drilldownDimensions, initialDimension, config, children, }: DrilldownWidgetProps) => import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "Sisense",
12
12
  "Compose SDK"
13
13
  ],
14
- "version": "1.9.0",
14
+ "version": "1.10.1",
15
15
  "type": "module",
16
16
  "exports": {
17
17
  ".": {
@@ -38,15 +38,15 @@
38
38
  "dependencies": {
39
39
  "@emotion/react": "^11.10.5",
40
40
  "@emotion/styled": "^11.10.5",
41
- "@mui/material": "^5.11.6",
41
+ "@mui/material": "^5.15.16",
42
42
  "@mui/system": "^5.15.15",
43
- "@sisense/sdk-common": "^1.9.0",
44
- "@sisense/sdk-data": "^1.9.0",
45
- "@sisense/sdk-pivot-client": "^1.9.0",
46
- "@sisense/sdk-query-client": "^1.9.0",
47
- "@sisense/sdk-rest-client": "^1.9.0",
48
- "@sisense/sdk-tracking": "^1.9.0",
49
- "@sisense/sisense-charts": "5.1.0-alpha-e8a83de6.0",
43
+ "@sisense/sdk-common": "^1.10.1",
44
+ "@sisense/sdk-data": "^1.10.1",
45
+ "@sisense/sdk-pivot-client": "^1.10.1",
46
+ "@sisense/sdk-query-client": "^1.10.1",
47
+ "@sisense/sdk-rest-client": "^1.10.1",
48
+ "@sisense/sdk-tracking": "^1.10.1",
49
+ "@sisense/sisense-charts": "5.1.1",
50
50
  "@tanstack/react-query": "4.36.1",
51
51
  "classnames": "^2.3.2",
52
52
  "colorjs.io": "^0.4.3",
@@ -68,8 +68,7 @@
68
68
  "react-number-format": "^5.1.0",
69
69
  "ts-deepmerge": "6.0.2",
70
70
  "ts-essentials": "^9.3.0",
71
- "whatwg-fetch": "^3.6.2",
72
- "yaml": "^2.4.0"
71
+ "whatwg-fetch": "^3.6.2"
73
72
  },
74
73
  "scripts": {
75
74
  "dev": "vite",
@@ -94,7 +93,6 @@
94
93
  ],
95
94
  "devDependencies": {
96
95
  "@babel/preset-env": "^7.20.2",
97
- "@monaco-editor/react": "^4.6.0",
98
96
  "@mui/icons-material": "^5.14.9",
99
97
  "@mui/x-data-grid": "^6.16.0",
100
98
  "@mui/x-data-grid-pro": "^6.16.0",
@@ -110,13 +108,13 @@
110
108
  "@swc-node/register": "^1.6.5",
111
109
  "@testing-library/jest-dom": "^6.4.2",
112
110
  "@testing-library/react": "^14.0.0",
113
- "@types/fixed-data-table-2": "^0.8.8",
111
+ "@types/fixed-data-table-2": "^1.0.0",
114
112
  "@types/leaflet": "^1.9.8",
115
113
  "@types/lodash": "^4.14.194",
116
114
  "@types/proj4leaflet": "^1.0.10",
117
- "@types/react": "18.2.0",
115
+ "@types/react": "18.3.1",
118
116
  "@types/react-datepicker": "^4.11.2",
119
- "@types/react-dom": "18.2.0",
117
+ "@types/react-dom": "18.3.0",
120
118
  "@types/react-grid-layout": "^1.3.5",
121
119
  "@types/react-plotly.js": "^2.6.0",
122
120
  "@vitejs/plugin-react-swc": "^3.3.0",
@@ -125,16 +123,16 @@
125
123
  "canvas": "^2.11.2",
126
124
  "eslint": "^8.40.0",
127
125
  "jsdom": "^22.1.0",
128
- "monaco-editor": "^0.45.0",
129
126
  "msw": "2.2.1",
130
127
  "plotly.js": "^2.25.2",
131
128
  "postcss": "^8.4.31",
132
129
  "prettier": "2.8.4",
133
- "react": "18.2.0",
134
- "react-dom": "^18.2.0",
130
+ "react": "18.3.1",
131
+ "react-dom": "18.3.1",
135
132
  "react-grid-layout": "^1.4.4",
136
133
  "react-json-view": "^1.21.3",
137
134
  "react-plotly.js": "^2.6.0",
135
+ "rollup-plugin-re": "^1.0.7",
138
136
  "sass": "1.58.3",
139
137
  "storybook": "7.0.24",
140
138
  "tailwindcss": "^3.3.1",
@@ -1,11 +0,0 @@
1
- import { CodeTemplates } from '../../ai/translators/types';
2
- /**
3
- * Code templates for different UI frameworks.
4
- *
5
- * A code template is made up of other code templates and placeholders.
6
- * This allows a code template to be reused in other code templates.
7
- * For example, a chart widget template can be reused in a dashboard template.
8
- *
9
- * @internal
10
- */
11
- export declare const CODE_TEMPLATES: CodeTemplates;
@@ -1,9 +0,0 @@
1
- import { CodeTemplateKey, UiFramework } from '../../ai/translators/types';
2
- /**
3
- * Generates code from a template with the given data and UI framework.
4
- *
5
- * @param templateKey - the key of the template to use
6
- * @param data - the data to populate the template with
7
- * @param uiFramework - the UI framework for the generated code
8
- */
9
- export declare const generateCode: (templateKey: CodeTemplateKey, data: Record<string, string>, uiFramework?: UiFramework) => string;
@@ -1,4 +0,0 @@
1
- export * from './types';
2
- export { useGetDataSource } from './use-get-data-source';
3
- export { ModelTranslator } from './model-translator';
4
- export { QueryTranslator } from './query-translator';
@@ -1,51 +0,0 @@
1
- import { ExpandedQueryModel, ChartWidgetModel, UiFramework } from '../../ai/translators/types';
2
- /**
3
- * A class that translates expanded query model to CSDK chart model and code.
4
- *
5
- * @internal
6
- */
7
- export declare class ModelTranslator {
8
- queryModel: ExpandedQueryModel;
9
- constructor(queryModel: ExpandedQueryModel);
10
- /**
11
- * Gets chart recommendations or default to table.
12
- *
13
- * @param chart - chart recommendations
14
- * @returns chart recommendations or default to table
15
- */
16
- private getChartRecommendationsOrDefault;
17
- /**
18
- * Gets filters from metadata.
19
- *
20
- * @param metadata - metadata items
21
- * @return array of Filter objects
22
- */
23
- private getFilters;
24
- /**
25
- * Splits metadata into columns and filters.
26
- *
27
- * @param metadata - metadata items
28
- */
29
- private splitMetadata;
30
- /**
31
- * Converts query model to chart.
32
- *
33
- * TODO Refactor Chatbot to use this method to render the chart
34
- */
35
- toChart(): ChartWidgetModel | undefined;
36
- private stringifyDataSource;
37
- private stringifyChartType;
38
- private stringifyFilters;
39
- private stringifyDataOptions;
40
- private stringifyExtraImports;
41
- private getChartWidgetCode;
42
- private getTableWidgetCode;
43
- /**
44
- * Converts chart widget model to CSDK code.
45
- *
46
- * @param chartWidgetModel - chart widget model
47
- * @param uiFramework - UI framework
48
- * @returns CSDK code string of the UI framework
49
- */
50
- toCode(chartWidgetModel: ChartWidgetModel, uiFramework?: UiFramework): string;
51
- }
@@ -1,137 +0,0 @@
1
- import { ExpandedQueryModel, SimpleQueryModel, SimpleChartRecommendations } from '../../ai/translators/types';
2
- import { DataSourceField, MetadataItem, MetadataItemJaql } from '@sisense/sdk-query-client';
3
- import { ChartRecommendations } from '../../ai';
4
- /**
5
- * A class that translates ExpandedQueryModel (Raw JAQL+Chart Recommendations)
6
- * to SimpleQueryModel (Simple JAQL+Simple Chart Options) and vice versa.
7
- *
8
- * It also provides methods to stringify query models to YAML strings
9
- * and parse YAML strings to query models.
10
- *
11
- * @internal
12
- */
13
- export declare class QueryTranslator {
14
- private readonly contextTitle;
15
- private readonly indexedFields;
16
- /**
17
- * Constructor for QueryTranslator.
18
- *
19
- * @param contextTitle - The context title
20
- * @param fields - The data source fields
21
- */
22
- constructor(contextTitle: string, fields: DataSourceField[]);
23
- private indexFields;
24
- /**
25
- * Concatenates Aggregation Types.
26
- */
27
- private concatAggTypes;
28
- /**
29
- * Simplifies Aggregation Formula defined in MetadataItemJaql returned from chat response.
30
- *
31
- * @param aggFormula - The Aggregation Formula to simplify
32
- * @returns The equivalent measure
33
- * @privateRemarks
34
- * See unit tests for examples of aggregation formulas and their equivalent measures.
35
- */
36
- simplifyAggFormula(aggFormula: MetadataItemJaql): MetadataItemJaql;
37
- /**
38
- * Simplifies MetadataItemJaql.
39
- *
40
- * @param item - The MetadataItemJaql to simplify
41
- * @returns The simplified MetadataItemJaql
42
- */
43
- simplifyMetadataItemJaql(item: MetadataItemJaql): MetadataItemJaql;
44
- /**
45
- * Simplify filter
46
- *
47
- * @param item - the MetadataItem
48
- * @return the MetadataItem with simplified filter
49
- */
50
- simplifyMetadataItemFilter(item: MetadataItem): MetadataItem;
51
- /**
52
- * Simplify date and number format
53
- *
54
- * @param item - the MetadataItem
55
- * @return the MetadataItem with simplified format
56
- */
57
- simplifyMetadataItemFormat(item: MetadataItem): MetadataItem;
58
- /**
59
- * Simplifies MetadataItem.
60
- *
61
- * @param item - The MetadataItem to simplify
62
- * @returns The simplified MetadataItem
63
- */
64
- simplifyMetadataItem(item: MetadataItem): MetadataItem;
65
- /**
66
- * Simplifies Chart Recommendations.
67
- *
68
- * @param chartRecommendations - The Chart Recommendations to simplify
69
- * @returns The simplified chart data options
70
- */
71
- simplifyChartRecommendations(chartRecommendations: ChartRecommendations | {}): SimpleChartRecommendations | {};
72
- /**
73
- * Returns the query title with the chart type.
74
- *
75
- * @param queryTitle - The query title
76
- * @param chartRecommendations - The chart recommendations
77
- * @returns The query title with the chart type
78
- */
79
- getQueryTitleWithChartType(queryTitle: string, chartRecommendations: {} | ChartRecommendations): string;
80
- /**
81
- * Takes a ExpandedQueryModel (e.g., from chat response) and translates it to SimpleQueryModel.
82
- *
83
- * @param expandedQueryModel - The Expanded Query model to simplify
84
- * @returns The simplified query model
85
- */
86
- translateToSimple(expandedQueryModel: ExpandedQueryModel): SimpleQueryModel;
87
- /**
88
- * Stringifies a simple query model to YAML string.
89
- *
90
- * @param simpleQueryModel - The Simple Query model to convert
91
- * @returns The YAML string representing the simple query model
92
- */
93
- stringifySimple(simpleQueryModel: SimpleQueryModel): string;
94
- /**
95
- * Parses a YAML string to Simple Query Model.
96
- *
97
- * @param simpleQueryYaml - The YAML string to parse
98
- * @returns The Simple Query Model
99
- */
100
- parseSimple(simpleQueryYaml: string): SimpleQueryModel;
101
- /**
102
- * Derives chart family from chart type.
103
- *
104
- * @param chartType - chart type
105
- * @returns chart family
106
- */
107
- private deriveChartFamily;
108
- /**
109
- * Expands Chart Recommendations.
110
- *
111
- * @param chartRecommendations - The Chart Recommendations to expand
112
- * @returns The expanded chart recommendations
113
- */
114
- expandChartRecommendations(chartRecommendations: SimpleChartRecommendations | {}): ChartRecommendations | {};
115
- /**
116
- * Expands MetadataItemJaql by adding table, column, datatype, and title
117
- * if they are missing from the item.
118
- *
119
- * @param item - The MetadataItemJaql to expand
120
- * @returns The expanded MetadataItemJaql
121
- */
122
- expandMetadataItemJaql(item: MetadataItemJaql): MetadataItemJaql;
123
- /**
124
- * Expands MetadataItem
125
- *
126
- * @param item - The MetadataItem to expand
127
- * @returns The expanded MetadataItem
128
- */
129
- expandMetadataItem(item: MetadataItem): MetadataItem;
130
- /**
131
- * Translates a Simple Query Model to Expanded Query Model.
132
- *
133
- * @param simpleQueryModel - The Simple Query model to convert
134
- * @returns The Expanded Query Model
135
- */
136
- translateToExpanded(simpleQueryModel: SimpleQueryModel): ExpandedQueryModel;
137
- }
@@ -1,2 +0,0 @@
1
- import { Filter } from '@sisense/sdk-data';
2
- export declare const stringifyFilterList: (filters: Filter[], indent?: number) => string;
@@ -1,8 +0,0 @@
1
- export type MembersFilterJaql = {
2
- members: string[];
3
- };
4
- export type FromNotEqualFilterJaql = {
5
- fromNotEqual: number;
6
- };
7
- export type FilterJaql = MembersFilterJaql | FromNotEqualFilterJaql;
8
- export declare const stringifyProps: (props: object | string, indent?: number, wrapInQuotes?: boolean) => string;
@@ -1,105 +0,0 @@
1
- import { MetadataItem } from '@sisense/sdk-query-client';
2
- import { AxesMapping, NlqResponseData } from '../../ai';
3
- import { ChartType, TableType } from '../../types';
4
- import { WidgetModel } from '../../models';
5
- /**
6
- * Expanded Query Model that is based on NlqResponseData.
7
- * It contains expanded JAQL and chart recommendations returned from the chat response.
8
- *
9
- * @internal
10
- */
11
- export type ExpandedQueryModel = Pick<NlqResponseData, 'jaql' | 'chartRecommendations' | 'queryTitle'>;
12
- /**
13
- * Expanded Query Model
14
- *
15
- * Used as a default value for ExpandedQueryModel
16
- *
17
- * @internal
18
- */
19
- export declare const EMPTY_EXPANDED_QUERY_MODEL: ExpandedQueryModel;
20
- /**
21
- * Simple Chart Recommendations
22
- *
23
- * @internal
24
- */
25
- export interface SimpleChartRecommendations {
26
- chartType: string;
27
- dataOptions: AxesMapping;
28
- }
29
- /**
30
- * Simple Query Model that is a simplified version of ExpandedQueryModel.
31
- *
32
- * It removes any JAQL syntax or information that already exists in the schema.
33
- * Also, any parameters that have a default do not need to be specified.
34
- *
35
- * Users manipulates this model via the query in YAML format.
36
- *
37
- * ModelTranslator is responsible for translating this query model to SimpleWidgetModel.
38
- *
39
- * @internal
40
- */
41
- export interface SimpleQueryModel {
42
- /**
43
- * The data model or perspective title.
44
- */
45
- model: string;
46
- metadata: MetadataItem[];
47
- chart: SimpleChartRecommendations | {};
48
- /**
49
- * Title of the query
50
- */
51
- queryTitle: string;
52
- }
53
- /**
54
- * Empty Simple Query Model
55
- *
56
- * Used as a default value for SimpleQueryModel
57
- *
58
- * @internal
59
- */
60
- export declare const EMPTY_SIMPLE_QUERY_MODEL: SimpleQueryModel;
61
- /**
62
- * All Chart Types including Table
63
- * Note: Table will be re-united with ChartType in a future MR
64
- *
65
- * @internal
66
- */
67
- export type AllChartType = ChartType | TableType;
68
- /**
69
- * Chart Widget Model
70
- *
71
- * This model serves two purposes:
72
- *
73
- * (1) For rendering a chart or table widget in the Query Composer.
74
- * (2) For reverse engineered (translated) to CSDK code
75
- *
76
- * Naming TBD
77
- *
78
- * @internal
79
- */
80
- export type ChartWidgetModel = Pick<WidgetModel, 'getChartWidgetProps' | 'getTableWidgetProps'> & {
81
- chartType: AllChartType;
82
- queryTitle: string;
83
- };
84
- /**
85
- * UI Framework
86
- *
87
- * @internal
88
- */
89
- export type UiFramework = 'react' | 'vue' | 'angular';
90
- /**
91
- * Code Template Key
92
- *
93
- * @internal
94
- */
95
- export type CodeTemplateKey = 'baseChartTmpl' | 'chartTmpl' | 'chartWidgetTmpl' | 'tableWidgetTmpl';
96
- /**
97
- * Code Templates
98
- *
99
- * @internal
100
- */
101
- export type CodeTemplates = {
102
- [key in UiFramework]: {
103
- [key in CodeTemplateKey]: string;
104
- };
105
- };
@@ -1,12 +0,0 @@
1
- import { ExpandedQueryModel, SimpleQueryModel } from './types';
2
- export declare function toKebabCase(str: string): string;
3
- export declare function capitalizeFirstLetter(str: string): string;
4
- /**
5
- * Sanitize ID of a dimension
6
- *
7
- * @param str - input string
8
- * @return sanitized ID
9
- */
10
- export declare function sanitizeDimensionId(str: string): string;
11
- export declare function validateQueryModel(model: any): SimpleQueryModel;
12
- export declare function isEmptyQueryModel(queryModel: ExpandedQueryModel | undefined | null): boolean;