@sisense/sdk-ui 1.5.0 → 1.7.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/ai-context-provider.d.ts +1 -0
- package/dist/ai/api/chat-api-provider.d.ts +1 -1
- package/dist/ai/api/chat-history.d.ts +18 -0
- package/dist/ai/api/chat-rest-api.d.ts +3 -0
- package/dist/ai/api/errors.d.ts +4 -1
- package/dist/ai/api/hooks.d.ts +2 -13
- package/dist/ai/api/types.d.ts +21 -19
- package/dist/ai/chat-config.d.ts +10 -3
- package/dist/ai/chat-intro-blurb.d.ts +4 -0
- package/dist/ai/chat-style-provider.d.ts +15 -0
- package/dist/ai/chatbot.d.ts +8 -0
- package/dist/ai/{error-page.d.ts → common/error-container.d.ts} +1 -1
- package/dist/ai/get-nlg-query-result.d.ts +3 -3
- package/dist/ai/index.d.ts +2 -0
- package/dist/ai/messages/feedback-wrapper.d.ts +2 -1
- package/dist/ai/messages/insights-message.d.ts +6 -1
- package/dist/ai/messages/message-list-resolver.d.ts +1 -2
- package/dist/ai/messages/message-resolver.d.ts +1 -3
- package/dist/ai/messages/nlq-message-group.d.ts +10 -0
- package/dist/ai/suggestions/index.d.ts +1 -1
- package/dist/ai/suggestions/suggestion-item.d.ts +1 -2
- package/dist/ai/suggestions/suggestion-list.d.ts +1 -1
- package/dist/ai/suggestions/suggestions-with-intro.d.ts +2 -2
- package/dist/ai/translators/code-templates.d.ts +11 -0
- package/dist/ai/translators/generate-code.d.ts +9 -0
- package/dist/ai/translators/index.d.ts +4 -0
- package/dist/ai/translators/model-translator.d.ts +50 -0
- package/dist/ai/translators/query-translator.d.ts +122 -0
- package/dist/ai/translators/translate-props-to-code.d.ts +8 -0
- package/dist/ai/translators/types.d.ts +105 -0
- package/dist/ai/translators/use-get-data-source.d.ts +12 -0
- package/dist/ai/translators/utils.d.ts +2 -0
- package/dist/ai/use-chat-session.d.ts +10 -3
- package/dist/ai/use-get-nlg-query-result.d.ts +6 -6
- package/dist/ai/use-get-query-recommendations.d.ts +1 -0
- package/dist/ai.js +7037 -3332
- package/dist/alert-box/alert-box.d.ts +1 -1
- package/dist/app/client-application.d.ts +27 -0
- package/dist/app/settings/settings.d.ts +1 -1
- package/dist/area-chart.d.ts +1 -0
- package/dist/areamap-chart.d.ts +1 -0
- package/dist/bar-chart.d.ts +3 -0
- package/dist/boxplot-chart.d.ts +1 -0
- package/dist/boxplot-utils.d.ts +3 -1
- package/dist/chart/chart.d.ts +1 -0
- package/dist/chart-options-processor/translations/base-design-options.d.ts +1 -0
- package/dist/chart-options-processor/translations/tooltip-utils.d.ts +1 -0
- package/dist/charts/indicator/indicator-legacy-chart-options/legacy-chart-options-to-theme-settings-dictionary.d.ts +2 -0
- package/dist/charts/indicator/indicator-legacy-chart-options/override-with-value-color.d.ts +1 -2
- package/dist/column-chart.d.ts +4 -0
- package/dist/common/components/loading-indicator.d.ts +2 -0
- package/dist/common/hooks/use-fetch.d.ts +42 -0
- package/dist/const.d.ts +1 -0
- package/dist/dashboard-widget/dashboard-widget.d.ts +2 -0
- package/dist/dashboard-widget/translate-widget-data-options.d.ts +5 -0
- package/dist/dashboard-widget/translate-widget-filters.d.ts +1 -0
- package/dist/dashboard-widget/types.d.ts +3 -2
- package/dist/dynamic-size-container/dynamic-size-container.d.ts +4 -3
- package/dist/filters/components/criteria-filter-tile/criteria-filter-tile.d.ts +1 -0
- package/dist/filters/components/date-filter/date-range-filter-tile/date-range-filter-tile.d.ts +1 -0
- package/dist/filters/components/date-filter/relative-date-filter-tile/relative-date-filter-tile.d.ts +1 -0
- package/dist/filters/components/member-filter-tile/member-filter-tile.d.ts +1 -0
- package/dist/formulas/use-get-shared-formula.d.ts +2 -0
- package/dist/funnel-chart.d.ts +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +6680 -37439
- package/dist/indicator-chart.d.ts +1 -0
- package/dist/line-chart.d.ts +1 -0
- package/dist/models/dashboard/get-dashboard-models.d.ts +1 -3
- package/dist/models/dashboard/translate-dashboard.d.ts +1 -1
- package/dist/models/dashboard/types.d.ts +17 -0
- package/dist/models/dashboard/use-get-dashboard-model.d.ts +2 -0
- package/dist/models/dashboard/use-get-dashboard-models.d.ts +2 -0
- package/dist/models/widget/use-get-widget-model.d.ts +2 -0
- package/dist/models/widget/widget-model.d.ts +11 -1
- package/dist/pie-chart.d.ts +1 -0
- package/dist/pivot-table/formatters/data-cell-formatters/data-cell-value-formatter.d.ts +3 -0
- package/dist/pivot-table/formatters/data-cell-formatters/index.d.ts +1 -0
- package/dist/pivot-table/formatters/header-cell-formatters/header-cell-value-formatter.d.ts +3 -0
- package/dist/pivot-table/formatters/header-cell-formatters/index.d.ts +1 -0
- package/dist/pivot-table/formatters/index.d.ts +2 -0
- package/dist/pivot-table/formatters/types.d.ts +4 -0
- package/dist/pivot-table/formatters/utils.d.ts +5 -0
- package/dist/pivot-table/pivot-table.d.ts +1 -0
- package/dist/pivot-table/sorting-utils.d.ts +56 -0
- package/dist/pivot-table/use-apply-pivot-table-formatting.d.ts +11 -0
- package/dist/pivot-table/use-get-pivot-table-query.d.ts +1 -1
- package/dist/polar-chart.d.ts +1 -0
- package/dist/props.d.ts +5 -4
- package/dist/query/execute-query.d.ts +5 -5
- package/dist/query-execution/execute-query-by-widget-id.d.ts +2 -0
- package/dist/query-execution/execute-query.d.ts +1 -0
- package/dist/query-execution/index.d.ts +2 -1
- package/dist/query-execution/query-params-comparator.d.ts +8 -0
- package/dist/query-execution/types.d.ts +7 -0
- package/dist/query-execution/use-execute-csv-query.d.ts +1 -0
- package/dist/query-execution/use-execute-pivot-query.d.ts +1 -0
- package/dist/query-execution/use-execute-query-by-widget-id.d.ts +2 -0
- package/dist/query-execution/use-execute-query.d.ts +4 -10
- package/dist/query-execution/use-query-cache.d.ts +10 -0
- package/dist/scatter-chart.d.ts +1 -0
- package/dist/scattermap-chart.d.ts +1 -0
- package/dist/sisense-context/sisense-context-provider.d.ts +1 -0
- package/dist/sisense-context/sisense-query-client-provider.d.ts +2 -0
- package/dist/sunburst-chart.d.ts +1 -0
- package/dist/table/table.d.ts +1 -0
- package/dist/theme-provider/theme-provider.d.ts +7 -0
- package/dist/treemap-chart.d.ts +1 -0
- package/dist/types.d.ts +2 -2
- package/dist/useQuery-aa258c0d.js +121301 -0
- package/dist/utils/create-cache.d.ts +33 -0
- package/dist/widgets/chart-widget.d.ts +1 -0
- package/dist/widgets/common/context-menu.d.ts +5 -0
- package/dist/widgets/common/drilldown-breadcrumbs/drilldown-breadcrumbs.d.ts +5 -0
- package/dist/widgets/drilldown-widget.d.ts +1 -0
- package/package.json +14 -9
- package/dist/chart-data-processor/utils.d.ts +0 -10
- package/dist/utils/not-available-value.d.ts +0 -3
- package/dist/with-tracking-0799ec25.js +0 -78081
|
@@ -0,0 +1,105 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gets the fields of a data source.
|
|
3
|
+
*
|
|
4
|
+
* Alternative hook implementation of QueryApiDispatcher.getDataSourceFields
|
|
5
|
+
*
|
|
6
|
+
* @param dataSource - The data source to get the fields for
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export declare const useGetDataSource: (dataSource: string | undefined) => {
|
|
10
|
+
data: import("@sisense/sdk-query-client").DataSourceField[] | undefined;
|
|
11
|
+
isLoading: boolean;
|
|
12
|
+
};
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
import type { ChatMessage } from './api/types';
|
|
2
|
-
|
|
1
|
+
import type { ChatMessage, NlqMessage, NlqResponseData } from './api/types';
|
|
2
|
+
/**
|
|
3
|
+
* Result of the useChatSession hook.
|
|
4
|
+
*
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export interface UseChatSessionResult {
|
|
3
8
|
chatId: string | undefined;
|
|
4
9
|
history: ChatMessage[];
|
|
10
|
+
lastNlqResponse: NlqResponseData | null;
|
|
5
11
|
sendMessage: (message: string) => void;
|
|
6
12
|
isAwaitingResponse: boolean;
|
|
7
13
|
isLoading: boolean;
|
|
14
|
+
lastError: Error | null;
|
|
8
15
|
}
|
|
16
|
+
export declare const isNlqMessage: (message: ChatMessage | null | undefined) => message is NlqMessage;
|
|
9
17
|
/**
|
|
10
18
|
* React hook that returns a chat session object for the given data model or
|
|
11
19
|
* perspective.
|
|
@@ -19,4 +27,3 @@ interface UseChatSessionResult {
|
|
|
19
27
|
* @internal
|
|
20
28
|
*/
|
|
21
29
|
export declare const useChatSession: (contextTitle: string) => UseChatSessionResult;
|
|
22
|
-
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Attribute, Filter, Measure } from '@sisense/sdk-data';
|
|
1
|
+
import { Attribute, DataSource, Filter, FilterRelations, Measure } from '@sisense/sdk-data';
|
|
2
2
|
import { GetNlgQueryResultRequest } from './api/types';
|
|
3
3
|
import { GetNlgQueryResultProps } from './get-nlg-query-result';
|
|
4
4
|
/**
|
|
@@ -6,13 +6,13 @@ import { GetNlgQueryResultProps } from './get-nlg-query-result';
|
|
|
6
6
|
*/
|
|
7
7
|
export interface UseGetNlgQueryResultParams {
|
|
8
8
|
/** The data source that the query targets - e.g. `Sample ECommerce` */
|
|
9
|
-
dataSource:
|
|
9
|
+
dataSource: DataSource;
|
|
10
10
|
/** Dimensions of the query */
|
|
11
11
|
dimensions?: Attribute[];
|
|
12
12
|
/** Measures of the query */
|
|
13
13
|
measures?: Measure[];
|
|
14
14
|
/** Filters of the query */
|
|
15
|
-
filters?: Filter[];
|
|
15
|
+
filters?: Filter[] | FilterRelations;
|
|
16
16
|
/**
|
|
17
17
|
* Boolean flag to enable/disable API call by default
|
|
18
18
|
*
|
|
@@ -42,9 +42,8 @@ export interface UseGetNlgQueryResultState {
|
|
|
42
42
|
*/
|
|
43
43
|
export declare const useGetNlgQueryResultInternal: (params: GetNlgQueryResultProps | GetNlgQueryResultRequest, enabled?: boolean) => UseGetNlgQueryResultState;
|
|
44
44
|
/**
|
|
45
|
-
* React hook that fetches an analysis of the provided
|
|
46
|
-
*
|
|
47
|
-
* Note that in the example below, this hook expects `metadata` to be in standard JAQL syntax.
|
|
45
|
+
* React hook that fetches an analysis of the provided query using natural language generation (NLG).
|
|
46
|
+
* Specifying a query is similar to providing parameters to a {@link useExecuteQuery} hook, using dimensions, measures, and filters.
|
|
48
47
|
*
|
|
49
48
|
* ::: warning Note
|
|
50
49
|
* This hook is currently under private beta for selected customers and is subject to change as we make fixes and improvements.
|
|
@@ -66,6 +65,7 @@ export declare const useGetNlgQueryResultInternal: (params: GetNlgQueryResultPro
|
|
|
66
65
|
* ```
|
|
67
66
|
* @param params - {@link UseGetNlgQueryResultParams}
|
|
68
67
|
* @returns Response object containing a text summary
|
|
68
|
+
* @group Generative AI
|
|
69
69
|
* @beta
|
|
70
70
|
*/
|
|
71
71
|
export declare const useGetNlgQueryResult: (params: UseGetNlgQueryResultParams) => UseGetNlgQueryResultState;
|
|
@@ -59,6 +59,7 @@ export declare const useGetQueryRecommendationsInternal: (params: UseGetQueryRec
|
|
|
59
59
|
* ```
|
|
60
60
|
* @param params - {@link UseGetQueryRecommendationsParams}
|
|
61
61
|
* @returns An array of objects, each containing recommended question text and its corresponding JAQL
|
|
62
|
+
* @group Generative AI
|
|
62
63
|
* @beta
|
|
63
64
|
*/
|
|
64
65
|
export declare const useGetQueryRecommendations: (params: UseGetQueryRecommendationsParams) => UseGetQueryRecommendationsState;
|