@sisense/sdk-ui 1.33.0 → 2.0.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 +9 -9
- package/dist/ai.js +566 -578
- package/dist/analytics-composer.cjs +120 -119
- package/dist/analytics-composer.js +3235 -2506
- package/dist/{derive-chart-family-nTKwlMms.js → derive-chart-family-BLaI9-3r.js} +27266 -27205
- package/dist/derive-chart-family-CxqjTyNt.cjs +758 -0
- package/dist/dimensions-C-VKss5V.cjs +1 -0
- package/dist/dimensions-Cfq9FexH.js +200 -0
- package/dist/index.cjs +31 -18
- package/dist/index.js +6117 -6185
- package/dist/packages/sdk-ui/src/ai/ai-context-provider.d.ts +13 -6
- package/dist/packages/sdk-ui/src/ai/chat-config.d.ts +4 -2
- package/dist/packages/sdk-ui/src/ai/chatbot.d.ts +17 -7
- package/dist/packages/sdk-ui/src/ai/custom-ai-context-provider.d.ts +4 -6
- package/dist/packages/sdk-ui/src/ai/get-nlg-insights.d.ts +0 -20
- package/dist/packages/sdk-ui/src/ai/index.d.ts +6 -4
- package/dist/packages/sdk-ui/src/ai/use-final-nlq-response.d.ts +20 -0
- package/dist/packages/sdk-ui/src/ai/use-get-nlg-insights.d.ts +0 -12
- package/dist/packages/sdk-ui/src/ai/use-get-nlq-result.d.ts +1 -4
- package/dist/packages/sdk-ui/src/ai/use-get-query-recommendations.d.ts +1 -4
- package/dist/packages/sdk-ui/src/analytics-composer/{common → code}/stringify-props.d.ts +10 -2
- package/dist/packages/sdk-ui/src/analytics-composer/common/custom-superjson.d.ts +16 -0
- package/dist/packages/sdk-ui/src/analytics-composer/dashboard/dashboard-composer.d.ts +8 -0
- package/dist/packages/sdk-ui/src/analytics-composer/dashboard/stringify-widgets.d.ts +3 -0
- package/dist/packages/sdk-ui/src/analytics-composer/dashboard/to-dashboard-code.d.ts +3 -0
- package/dist/packages/sdk-ui/src/analytics-composer/index.d.ts +4 -0
- package/dist/packages/sdk-ui/src/analytics-composer/query/index.d.ts +1 -0
- package/dist/packages/sdk-ui/src/analytics-composer/query/query-translator.d.ts +1 -0
- package/dist/packages/sdk-ui/src/analytics-composer/query/simplify-metadata-item.d.ts +9 -0
- package/dist/packages/sdk-ui/src/analytics-composer/types.d.ts +95 -5
- package/dist/packages/sdk-ui/src/analytics-composer/widget/chart-options/get-widget-options.d.ts +1 -1
- package/dist/packages/sdk-ui/src/analytics-composer/widget/to-widget-code.d.ts +3 -1
- package/dist/packages/sdk-ui/src/api/rest-api.d.ts +3 -0
- package/dist/packages/sdk-ui/src/app/client-application.d.ts +3 -55
- package/dist/packages/sdk-ui/src/area-range-chart.d.ts +0 -1
- package/dist/packages/sdk-ui/src/chart-data/table-data.d.ts +10 -0
- package/dist/packages/sdk-ui/src/common/components/grouped-items-browser/types.d.ts +2 -0
- package/dist/packages/sdk-ui/src/common/components/menu/types.d.ts +1 -0
- package/dist/packages/sdk-ui/src/common/hooks/decorators/with-lazy-loading/helpers/hooks/index.d.ts +1 -0
- package/dist/packages/sdk-ui/src/common/hooks/decorators/with-lazy-loading/helpers/hooks/use-data-accumulation.d.ts +1 -0
- package/dist/packages/sdk-ui/src/common/hooks/decorators/with-lazy-loading/helpers/{utils/get-hook-state-result.d.ts → hooks/use-get-hook-state-result.d.ts} +3 -2
- package/dist/packages/sdk-ui/src/common/hooks/decorators/with-lazy-loading/helpers/utils/index.d.ts +0 -1
- package/dist/packages/sdk-ui/src/common/hooks/use-defaults.d.ts +1 -0
- package/dist/packages/sdk-ui/src/dashboard/components/content-panel.d.ts +1 -0
- package/dist/packages/sdk-ui/src/dashboard/dashboard-helpers.d.ts +0 -12
- package/dist/packages/sdk-ui/src/dashboard/index.d.ts +1 -1
- package/dist/packages/sdk-ui/src/dashboard/types.d.ts +9 -3
- package/dist/packages/sdk-ui/src/dashboard/use-composed-dashboard.d.ts +1 -4
- package/dist/packages/sdk-ui/src/data-browser/add-filter-popover/add-filter-data-browser.d.ts +8 -1
- package/dist/packages/sdk-ui/src/data-browser/add-filter-popover/add-filter-popover.d.ts +6 -1
- package/dist/packages/sdk-ui/src/data-browser/dimensions-browser/types.d.ts +8 -0
- package/dist/packages/sdk-ui/src/filters/components/cascading-filter-tile/cascading-filter-tile.d.ts +2 -0
- package/dist/packages/sdk-ui/src/filters/components/cascading-filter-tile/cascading-level-filter.d.ts +3 -1
- package/dist/packages/sdk-ui/src/filters/components/criteria-filter-tile/index.d.ts +0 -1
- package/dist/packages/sdk-ui/src/filters/components/date-filter/relative-date-filter-tile/relative-date-filter.d.ts +5 -1
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/filter-editor-context.d.ts +3 -1
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/filter-editor-popover.d.ts +2 -1
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/filter-editor.d.ts +2 -1
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/hooks/use-get-attribute-stats.d.ts +2 -1
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/common/granularities.d.ts +36 -6
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/types.d.ts +2 -0
- package/dist/packages/sdk-ui/src/filters/components/filter-tile-container.d.ts +1 -0
- package/dist/packages/sdk-ui/src/filters/components/filter-tile.d.ts +5 -4
- package/dist/packages/sdk-ui/src/filters/components/filters-panel/hooks/use-existing-filter-editing.d.ts +1 -1
- package/dist/packages/sdk-ui/src/filters/components/filters-panel/hooks/use-new-filter-adding.d.ts +3 -1
- package/dist/packages/sdk-ui/src/filters/hooks/use-get-filter-members.d.ts +3 -3
- package/dist/packages/sdk-ui/src/index-typedoc.d.ts +4 -1
- package/dist/packages/sdk-ui/src/index.d.ts +4 -3
- package/dist/packages/sdk-ui/src/models/dashboard/translate-dashboard-dto-utils.d.ts +0 -1
- package/dist/packages/sdk-ui/src/models/dashboard/translate-dashboard-utils.d.ts +1 -0
- package/dist/packages/sdk-ui/src/models/dashboard/types.d.ts +1 -0
- package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dashboard-model-reducer.d.ts +15 -1
- package/dist/packages/sdk-ui/src/models/hierarchy/types.d.ts +0 -1
- package/dist/packages/sdk-ui/src/models/widget/types.d.ts +1 -1
- package/dist/packages/sdk-ui/src/models/widget/widget-model-translator.d.ts +2 -12
- package/dist/packages/sdk-ui/src/models/widget/widget-model.d.ts +1 -125
- package/dist/packages/sdk-ui/src/plugins-provider/custom-plugins-provider.d.ts +4 -9
- package/dist/packages/sdk-ui/src/props.d.ts +27 -45
- package/dist/packages/sdk-ui/src/query-execution/index.d.ts +1 -1
- package/dist/packages/sdk-ui/src/query-execution/types.d.ts +2 -4
- package/dist/packages/sdk-ui/src/sisense-context/custom-sisense-context-provider.d.ts +2 -4
- package/dist/packages/sdk-ui/src/theme-provider/custom-theme-provider.d.ts +5 -8
- package/dist/packages/sdk-ui/src/translation/resources/en.d.ts +5 -1
- package/dist/packages/sdk-ui/src/translation/resources/index.d.ts +10 -2
- package/dist/packages/sdk-ui/src/types.d.ts +60 -40
- package/dist/packages/sdk-ui/src/utils/{utility-types.d.ts → utility-types/basic-utility-types.d.ts} +0 -34
- package/dist/packages/sdk-ui/src/utils/utility-types/distributive-omit.d.ts +24 -0
- package/dist/packages/sdk-ui/src/utils/utility-types/index.d.ts +4 -0
- package/dist/packages/sdk-ui/src/utils/utility-types/rest-api-hook-state.d.ts +35 -0
- package/dist/packages/sdk-ui/src/utils/utility-types/soft-union.d.ts +35 -0
- package/dist/packages/sdk-ui/src/widget-by-id/translate-widget-data-options.d.ts +2 -2
- package/dist/packages/sdk-ui/src/widget-by-id/translate-widget-drilldown-options.d.ts +2 -2
- package/dist/packages/sdk-ui/src/widget-by-id/translate-widget-style-options.d.ts +2 -2
- package/dist/packages/sdk-ui/src/widget-by-id/types.d.ts +2 -2
- package/dist/packages/sdk-ui/src/widget-by-id/use-get-dashboard-model-and-widget-model.d.ts +1 -0
- package/dist/packages/sdk-ui/src/widget-by-id/utils.d.ts +23 -16
- package/dist/packages/sdk-ui/src/widgets/tabber-widget.d.ts +5 -0
- package/dist/packages/sdk-ui/src/widgets/widget.d.ts +0 -1
- package/dist/{use-common-filters-BNKt9a0z.cjs → use-common-filters-BGGGgJJ5.cjs} +48 -48
- package/dist/{use-common-filters--WPkVexd.js → use-common-filters-Cmyb86sc.js} +5339 -5351
- package/dist/widget-composer-BJURHrVD.cjs +428 -0
- package/dist/widget-composer-C4rwNt4P.js +959 -0
- package/package.json +14 -10
- package/dist/derive-chart-family-B4sA-ao-.cjs +0 -758
- package/dist/packages/sdk-ui/src/ai/common/beta-label.d.ts +0 -1
- package/dist/packages/sdk-ui/src/analytics-composer/widget/stringify-props.d.ts +0 -8
- package/dist/packages/sdk-ui/src/filters/components/criteria-filter-tile/types.d.ts +0 -7
- package/dist/packages/sdk-ui/src/utils/check-and-notify-about-deprecated-prop.d.ts +0 -1
- package/dist/packages/sdk-ui/src/widget-by-id/dashboard-widget.d.ts +0 -27
- package/dist/widget-composer-CobNNZ1e.js +0 -742
- package/dist/widget-composer-DPqi_qzU.cjs +0 -316
- /package/dist/packages/sdk-ui/src/analytics-composer/{widget → code}/stringify-filters.d.ts +0 -0
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
export interface AiContextProviderProps {
|
|
3
3
|
children: ReactNode;
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Boolean flag to indicate whether the chat session should be volatile.
|
|
6
|
+
*
|
|
7
|
+
* When `false` the chat session history will be stored per user per datamodel. The retention period is configurable in Sisense Fusion.
|
|
8
|
+
*
|
|
9
|
+
* When the `Chatbot` component renders, if a previous chat history exists for the current user and datamodel, it will be restored. The user may continue the conversation or clear the history.
|
|
10
|
+
*
|
|
11
|
+
* When `true` a new chat session (with no history) will be created each time the `Chatbot` comoponent initializes.
|
|
12
|
+
*
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
5
15
|
volatile?: boolean;
|
|
6
16
|
}
|
|
7
17
|
/**
|
|
8
18
|
* React component that wraps all generative AI components and hooks.
|
|
9
19
|
*
|
|
10
|
-
* ::: warning Note
|
|
11
|
-
* This component is currently under beta release for our managed cloud customers on version L2024.2 or above. It is subject to changes as we make fixes and improvements.
|
|
12
|
-
* :::
|
|
13
|
-
*
|
|
14
20
|
* @example
|
|
15
21
|
* ```tsx
|
|
16
22
|
* import { SisenseContextProvider } from '@sisense/sdk-ui';
|
|
@@ -26,7 +32,8 @@ export interface AiContextProviderProps {
|
|
|
26
32
|
* );
|
|
27
33
|
* }
|
|
28
34
|
* ```
|
|
35
|
+
* @param props - AI Context Provider Props
|
|
36
|
+
* @returns An AI Context Provider Component
|
|
29
37
|
* @group Generative AI
|
|
30
|
-
* @beta
|
|
31
38
|
*/
|
|
32
39
|
export default function AiContextProvider({ children, volatile }: AiContextProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -67,11 +67,13 @@ export interface ChatConfig {
|
|
|
67
67
|
*/
|
|
68
68
|
enableInsights?: boolean;
|
|
69
69
|
/**
|
|
70
|
-
* Boolean flag to
|
|
70
|
+
* Boolean flag to hide chat history on every load.
|
|
71
71
|
*
|
|
72
|
-
* Note: When the flag is `true`, chat history will be preserved and stored for the session but will not be
|
|
72
|
+
* Note: When the flag is `true`, chat history will be preserved and stored for the session but will not be displayed. Changing this setting back to `false` will make the entire history visible again, even if it was previously hidden. Use the "Clear History" button to completely erase the history.
|
|
73
73
|
*
|
|
74
74
|
* @default false
|
|
75
|
+
* @deprecated
|
|
76
|
+
* This flag is deprecated and will be removed in a future version. Use {@link @sisense/sdk-ui!AiContextProviderProps.volatile} instead.
|
|
75
77
|
*/
|
|
76
78
|
hideHistory?: boolean;
|
|
77
79
|
/**
|
|
@@ -22,11 +22,8 @@ export interface ChatbotProps {
|
|
|
22
22
|
config?: Partial<ChatConfig>;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
|
-
* React component that
|
|
26
|
-
*
|
|
27
|
-
* ::: warning Note
|
|
28
|
-
* This component is currently under beta release for our managed cloud customers on version L2024.2 or above. It is subject to changes as we make fixes and improvements.
|
|
29
|
-
* :::
|
|
25
|
+
* React component that displays a chatbot with data topic selection.
|
|
26
|
+
* You can optionally configure size, config e.g. data topics, recommendations, UI text.
|
|
30
27
|
*
|
|
31
28
|
* @example
|
|
32
29
|
* ```tsx
|
|
@@ -37,7 +34,21 @@ export interface ChatbotProps {
|
|
|
37
34
|
* return (
|
|
38
35
|
* <SisenseContextProvider {...sisenseContextProps}>
|
|
39
36
|
* <AiContextProvider>
|
|
40
|
-
* <Chatbot
|
|
37
|
+
* <Chatbot
|
|
38
|
+
* width={1000}
|
|
39
|
+
* height={800}
|
|
40
|
+
* config={{
|
|
41
|
+
* enableFollowupQuestions: true,
|
|
42
|
+
* numOfRecommendations: 2,
|
|
43
|
+
* dataTopicsList: [
|
|
44
|
+
* 'Sample ECommerce',
|
|
45
|
+
* 'Sample Healthcare'
|
|
46
|
+
* ],
|
|
47
|
+
* inputPromptText: 'What do you want to explore?',
|
|
48
|
+
* welcomeText: 'Welcome to Acme AI, powered by Sisense',
|
|
49
|
+
* suggestionsWelcomeText: 'Would you like to know:',
|
|
50
|
+
* }}
|
|
51
|
+
* />
|
|
41
52
|
* </AiContextProvider>
|
|
42
53
|
* </SisenseContextProvider>
|
|
43
54
|
* );
|
|
@@ -45,6 +56,5 @@ export interface ChatbotProps {
|
|
|
45
56
|
* ```
|
|
46
57
|
* @param props - {@link ChatbotProps}
|
|
47
58
|
* @group Generative AI
|
|
48
|
-
* @beta
|
|
49
59
|
*/
|
|
50
60
|
export declare const Chatbot: import("react").FunctionComponent<ChatbotProps>;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
2
|
import { type ChatRestApi } from './api/chat-rest-api';
|
|
3
|
+
import { CustomContextProviderProps } from '../types';
|
|
3
4
|
/** @internal */
|
|
4
5
|
export type CustomAiContext = {
|
|
5
6
|
api?: ChatRestApi;
|
|
6
7
|
};
|
|
7
8
|
/** @internal */
|
|
8
|
-
export type CustomAiContextProviderProps =
|
|
9
|
-
context?: CustomAiContext;
|
|
10
|
-
children: ReactNode;
|
|
11
|
-
};
|
|
9
|
+
export type CustomAiContextProviderProps = CustomContextProviderProps<CustomAiContext>;
|
|
12
10
|
/** @internal */
|
|
13
|
-
export declare function CustomAiContextProvider({ children, context }: CustomAiContextProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function CustomAiContextProvider({ children, context, }: PropsWithChildren<CustomAiContextProviderProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -9,10 +9,6 @@ export interface GetNlgInsightsProps extends Omit<UseGetNlgInsightsParams, 'enab
|
|
|
9
9
|
* React component that fetches and displays a collapsible analysis of the provided query using natural language generation (NLG).
|
|
10
10
|
* Specifying a query is similar to providing parameters to a {@link useExecuteQuery} hook, using dimensions, measures, and filters.
|
|
11
11
|
*
|
|
12
|
-
* ::: warning Note
|
|
13
|
-
* This component is currently under beta release for our managed cloud customers on version L2024.2 or above. It is subject to changes as we make fixes and improvements.
|
|
14
|
-
* :::
|
|
15
|
-
*
|
|
16
12
|
* @example
|
|
17
13
|
* ```tsx
|
|
18
14
|
* <GetNlgInsights
|
|
@@ -24,22 +20,6 @@ export interface GetNlgInsightsProps extends Omit<UseGetNlgInsightsParams, 'enab
|
|
|
24
20
|
* @param props - {@link GetNlgInsightsProps}
|
|
25
21
|
* @returns Collapsible container wrapping a text summary
|
|
26
22
|
* @group Generative AI
|
|
27
|
-
* @beta
|
|
28
23
|
*/
|
|
29
24
|
declare const _default: import("react").FunctionComponent<GetNlgInsightsProps>;
|
|
30
25
|
export default _default;
|
|
31
|
-
/**
|
|
32
|
-
* Props for {@link GetNlgQueryResult} component.
|
|
33
|
-
* @deprecated Use {@link GetNlgInsightsProps} instead
|
|
34
|
-
* @internal
|
|
35
|
-
*/
|
|
36
|
-
export interface GetNlgQueryResultProps extends GetNlgInsightsProps {
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* @param props - {@link GetNlgQueryResultProps}
|
|
40
|
-
* @returns Collapsible container wrapping a text summary
|
|
41
|
-
* @group Generative AI
|
|
42
|
-
* @deprecated Use {@link GetNlgInsights} instead
|
|
43
|
-
* @internal
|
|
44
|
-
*/
|
|
45
|
-
export declare const GetNlgQueryResult: import("react").FunctionComponent<GetNlgQueryResultProps>;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
export { default as AiContextProvider, type AiContextProviderProps } from './ai-context-provider';
|
|
2
2
|
export { type ChatConfig } from './chat-config';
|
|
3
|
-
export { useGetNlgInsights, type UseGetNlgInsightsParams, type UseGetNlgInsightsState,
|
|
3
|
+
export { useGetNlgInsights, type UseGetNlgInsightsParams, type UseGetNlgInsightsState, } from './use-get-nlg-insights';
|
|
4
4
|
export { useGetNlqResult, prepareGetNlqResultPayload, type UseGetNlqResultParams, type UseGetNlqResultState, type GetNlqResultParams, } from './use-get-nlq-result';
|
|
5
5
|
export { useGetQueryRecommendations, type UseGetQueryRecommendationsParams, type GetQueryRecommendationsParams, type UseGetQueryRecommendationsState, DEFAULT_RECOMMENDATIONS_COUNT, } from './use-get-query-recommendations';
|
|
6
6
|
export { useChatSession, type UseChatSessionResult } from './use-chat-session';
|
|
7
7
|
export { useLastNlqResponse } from './use-last-nlq-response';
|
|
8
|
-
export
|
|
8
|
+
export { useFinalNlqResponse } from './use-final-nlq-response';
|
|
9
|
+
export type { GetNlgInsightsRequest, GetNlgInsightsResponse, QueryRecommendationResponse, QueryRecommendation, NlqResponseData, NlqResult, NlqResultChartType, } from './api/types';
|
|
10
|
+
export { NLQ_RESULT_CHART_TYPES } from './api/types';
|
|
9
11
|
export { Chatbot, type ChatbotProps } from './chatbot';
|
|
10
|
-
export { default as GetNlgInsights, type GetNlgInsightsProps
|
|
12
|
+
export { default as GetNlgInsights, type GetNlgInsightsProps } from './get-nlg-insights';
|
|
11
13
|
export { NlqChartWidget, type NlqChartWidgetProps } from './chart/nlq-chart-widget';
|
|
12
14
|
export { ChatRestApi } from './api/chat-rest-api';
|
|
13
|
-
export { CustomAiContextProvider, type CustomAiContext } from './custom-ai-context-provider';
|
|
15
|
+
export { CustomAiContextProvider, type CustomAiContext, type CustomAiContextProviderProps, } from './custom-ai-context-provider';
|
|
14
16
|
export { prepareGetNlgInsightsPayload } from './use-get-nlg-insights';
|
|
15
17
|
export { widgetComposer } from '../analytics-composer';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { NlqResponseData, ChatContextDetails } from './api/types';
|
|
2
|
+
/**
|
|
3
|
+
* Parameters for the useFinalNlqResponse hook.
|
|
4
|
+
*
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export interface UseFinalNlqResponseParams {
|
|
8
|
+
/** The title of the data model or perspective */
|
|
9
|
+
contextTitle: string;
|
|
10
|
+
/** optional chat context details */
|
|
11
|
+
contextDetails?: ChatContextDetails;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* React hook that returns the final NLQ response for the chat that corresponds
|
|
15
|
+
* to the given data model or perspective.
|
|
16
|
+
*
|
|
17
|
+
* @param params - Parameters for the hook
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export declare const useFinalNlqResponse: ({ contextTitle, contextDetails, }: UseFinalNlqResponseParams) => NlqResponseData | null;
|
|
@@ -52,10 +52,6 @@ export declare const useGetNlgInsightsInternal: (params: GetNlgInsightsProps | G
|
|
|
52
52
|
* React hook that fetches an analysis of the provided query using natural language generation (NLG).
|
|
53
53
|
* Specifying a query is similar to providing parameters to a {@link useExecuteQuery} hook, using dimensions, measures, and filters.
|
|
54
54
|
*
|
|
55
|
-
* ::: warning Note
|
|
56
|
-
* This hook is currently under beta release for our managed cloud customers on version L2024.2 or above. It is subject to changes as we make fixes and improvements.
|
|
57
|
-
* :::
|
|
58
|
-
*
|
|
59
55
|
* @example
|
|
60
56
|
* ```tsx
|
|
61
57
|
* const { data, isLoading } = useGetNlgInsights({
|
|
@@ -72,13 +68,5 @@ export declare const useGetNlgInsightsInternal: (params: GetNlgInsightsProps | G
|
|
|
72
68
|
* ```
|
|
73
69
|
* @returns Response object containing a text summary
|
|
74
70
|
* @group Generative AI
|
|
75
|
-
* @beta
|
|
76
71
|
*/
|
|
77
72
|
export declare const useGetNlgInsights: (params: UseGetNlgInsightsParams) => UseGetNlgInsightsState;
|
|
78
|
-
/**
|
|
79
|
-
* @returns Response object containing a text summary
|
|
80
|
-
* @group Generative AI
|
|
81
|
-
* @deprecated Use {@link useGetNlgInsights} instead
|
|
82
|
-
* @internal
|
|
83
|
-
*/
|
|
84
|
-
export declare const useGetNlgQueryResult: (params: UseGetNlgInsightsParams) => UseGetNlgInsightsState;
|
|
@@ -13,6 +13,7 @@ export interface GetNlqResultParams {
|
|
|
13
13
|
* Enable suggested axis titles in generated widget
|
|
14
14
|
*
|
|
15
15
|
* If not specified, the default value is `false`
|
|
16
|
+
*
|
|
16
17
|
* @internal
|
|
17
18
|
*/
|
|
18
19
|
enableAxisTitlesInWidgetProps?: boolean;
|
|
@@ -52,10 +53,6 @@ export declare const useGetNlqResultInternal: (params: UseGetNlqResultParams) =>
|
|
|
52
53
|
/**
|
|
53
54
|
* React hook that enables natural language query (NLQ) against a data model or perspective.
|
|
54
55
|
*
|
|
55
|
-
* ::: warning Note
|
|
56
|
-
* This hook is currently under beta release for our managed cloud customers on version L2024.2 or above. It is subject to changes as we make fixes and improvements.
|
|
57
|
-
* :::
|
|
58
|
-
*
|
|
59
56
|
* @example
|
|
60
57
|
* ```tsx
|
|
61
58
|
* const { data, isLoading } = useGetNlqResult({
|
|
@@ -15,6 +15,7 @@ export interface GetQueryRecommendationsParams {
|
|
|
15
15
|
* Enable suggested axis titles in generated widget
|
|
16
16
|
*
|
|
17
17
|
* If not specified, the default value is `false`
|
|
18
|
+
*
|
|
18
19
|
* @internal
|
|
19
20
|
*/
|
|
20
21
|
enableAxisTitlesInWidgetProps?: boolean;
|
|
@@ -51,10 +52,6 @@ export declare const useGetQueryRecommendationsInternal: (params: UseGetQueryRec
|
|
|
51
52
|
*
|
|
52
53
|
* This hook includes the same code that fetches the initial suggested questions in the chatbot.
|
|
53
54
|
*
|
|
54
|
-
* ::: warning Note
|
|
55
|
-
* This hook is currently under beta release for our managed cloud customers on version L2024.2 or above. It is subject to changes as we make fixes and improvements.
|
|
56
|
-
* :::
|
|
57
|
-
*
|
|
58
55
|
* @example
|
|
59
56
|
* ```tsx
|
|
60
57
|
* const { data, isLoading } = useGetQueryRecommendations({
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
import { DataSource, Filter, FilterRelations } from '@sisense/sdk-data';
|
|
2
1
|
import { ChartDataOptions } from '../../types';
|
|
2
|
+
import { DataSource, Filter, FilterRelations } from '@sisense/sdk-data';
|
|
3
|
+
export type MembersFilterJaql = {
|
|
4
|
+
members: string[];
|
|
5
|
+
};
|
|
6
|
+
export type FromNotEqualFilterJaql = {
|
|
7
|
+
fromNotEqual: number;
|
|
8
|
+
};
|
|
9
|
+
export type FilterJaql = MembersFilterJaql | FromNotEqualFilterJaql;
|
|
10
|
+
export declare const stringifyProps: (props: object | string, indent?: number, wrapInQuotes?: boolean) => string;
|
|
3
11
|
export declare function stringifyDataOptions(dataOptions: ChartDataOptions): string;
|
|
4
|
-
export declare function stringifyDataSource(dataSource: DataSource | undefined): string;
|
|
12
|
+
export declare function stringifyDataSource(dataSource: DataSource | undefined, defaultDataSourceString?: string): string;
|
|
5
13
|
export declare function stringifyExtraImports(filters: Filter[] | FilterRelations, importMeasureFactory?: boolean): string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import SuperJSON, { SuperJSONResult } from 'superjson';
|
|
2
|
+
/**
|
|
3
|
+
* Utility to stringify and parse CSDK JS objects to JSON and vice versa.
|
|
4
|
+
* JS objects can contain class instances of dimensional elements (e.g., attributes/dimensions, measures, filters).
|
|
5
|
+
*
|
|
6
|
+
* The utility uses `superjson` under the hood.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare const CustomSuperJSON: typeof SuperJSON;
|
|
11
|
+
/**
|
|
12
|
+
* Type alias for the result of the `CustomSuperJSON` utility.
|
|
13
|
+
*
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export type CustomSuperJSONResult = SuperJSONResult;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DashboardCodeParams } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Converts dashboard props to CSDK code.
|
|
4
|
+
*
|
|
5
|
+
* @param dashboardProps - Dashboard props
|
|
6
|
+
* @returns CSDK code string
|
|
7
|
+
*/
|
|
8
|
+
export declare const toDashboardCode: (dashboardCodeParams: DashboardCodeParams) => string;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ByIdDashboardCodeParams, ClientSideDashboardCodeParams } from '../types.js';
|
|
2
|
+
export declare const toDashboardCodeById: ({ dashboardOid, uiFramework, }: ByIdDashboardCodeParams) => string;
|
|
3
|
+
export declare const toDashboardCodeClientSide: ({ dashboardProps, uiFramework, }: ClientSideDashboardCodeParams) => string;
|
|
@@ -2,16 +2,20 @@ export * from './types';
|
|
|
2
2
|
export * from './query';
|
|
3
3
|
/**
|
|
4
4
|
* Utility functions to compose props and code for widgets.
|
|
5
|
+
*
|
|
5
6
|
* @internal
|
|
6
7
|
*/
|
|
7
8
|
export * as widgetComposer from './widget/widget-composer';
|
|
8
9
|
/**
|
|
9
10
|
* Utility functions to compose props and code for dashboards.
|
|
11
|
+
*
|
|
10
12
|
* @internal
|
|
11
13
|
*/
|
|
12
14
|
export * as dashboardComposer from './dashboard/dashboard-composer';
|
|
13
15
|
/**
|
|
14
16
|
* Utility functions to compose props and code for executing queries.
|
|
17
|
+
*
|
|
15
18
|
* @internal
|
|
16
19
|
*/
|
|
17
20
|
export * as executeQueryComposer from './execute-query/execute-query-composer';
|
|
21
|
+
export * from './common/custom-superjson';
|
|
@@ -7,6 +7,7 @@ import { MetadataItem, MetadataItemJaql, DataSourceField } from '@sisense/sdk-da
|
|
|
7
7
|
* It also provides methods to stringify query models to YAML strings
|
|
8
8
|
* and parse YAML strings to query models.
|
|
9
9
|
*
|
|
10
|
+
* @deprecated QueryTranslator was designed for Forge, which is now discontinued. To simplify the JQL query from NLQ, use simplifyMetadataItem() instead.
|
|
10
11
|
* @internal
|
|
11
12
|
*/
|
|
12
13
|
export declare class QueryTranslator {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MetadataItem } from '@sisense/sdk-data';
|
|
2
|
+
/**
|
|
3
|
+
* Simplifies MetadataItem.
|
|
4
|
+
*
|
|
5
|
+
* @param item - The MetadataItem to simplify
|
|
6
|
+
* @returns The simplified MetadataItem
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export declare const simplifyMetadataItem: (item: MetadataItem) => MetadataItem;
|
|
@@ -4,12 +4,15 @@ import { ExecuteQueryParams, ExecutePivotQueryParams } from '../query-execution'
|
|
|
4
4
|
import { MetadataItem } from '@sisense/sdk-data';
|
|
5
5
|
import { DynamicChartType } from '../chart-options-processor/translations/types.js';
|
|
6
6
|
import { AnyColumn } from '../chart-data-options/types.js';
|
|
7
|
+
import { DashboardProps } from '../dashboard/types.js';
|
|
7
8
|
type Stringify<T> = {
|
|
8
9
|
[K in keyof T as `${K & string}String`]: string;
|
|
9
10
|
};
|
|
10
|
-
type
|
|
11
|
+
type ExtraWidgetCodeProps = {
|
|
11
12
|
componentString: string;
|
|
12
13
|
extraImportsString: string;
|
|
14
|
+
idString?: string;
|
|
15
|
+
widgetTypeString?: 'chart' | 'pivot' | 'text' | 'plugin';
|
|
13
16
|
};
|
|
14
17
|
/** @internal */
|
|
15
18
|
export type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
@@ -29,6 +32,7 @@ export interface ChartRecommendations {
|
|
|
29
32
|
/**
|
|
30
33
|
* Expanded Query Model that is based on NlqResponseData.
|
|
31
34
|
* It contains expanded JAQL and chart recommendations returned from the chat response.
|
|
35
|
+
*
|
|
32
36
|
* @internal
|
|
33
37
|
*/
|
|
34
38
|
export interface ExpandedQueryModel {
|
|
@@ -50,11 +54,13 @@ export interface ExpandedQueryModel {
|
|
|
50
54
|
* Empty Expanded Query Model
|
|
51
55
|
*
|
|
52
56
|
* Used as a default value for ExpandedQueryModel
|
|
57
|
+
*
|
|
53
58
|
* @internal
|
|
54
59
|
*/
|
|
55
60
|
export declare const EMPTY_EXPANDED_QUERY_MODEL: ExpandedQueryModel;
|
|
56
61
|
/**
|
|
57
62
|
* Simple Chart Recommendations
|
|
63
|
+
*
|
|
58
64
|
* @internal
|
|
59
65
|
*/
|
|
60
66
|
export interface SimpleChartRecommendations {
|
|
@@ -71,6 +77,7 @@ export interface SimpleChartRecommendations {
|
|
|
71
77
|
* Users manipulates this model via the query in YAML format.
|
|
72
78
|
*
|
|
73
79
|
* QueryTranslator is responsible for translating this query model to ExpandedWidgetModel.
|
|
80
|
+
*
|
|
74
81
|
* @internal
|
|
75
82
|
*/
|
|
76
83
|
export interface SimpleQueryModel {
|
|
@@ -89,21 +96,25 @@ export interface SimpleQueryModel {
|
|
|
89
96
|
* Empty Simple Query Model
|
|
90
97
|
*
|
|
91
98
|
* Used as a default value for SimpleQueryModel
|
|
99
|
+
*
|
|
92
100
|
* @internal
|
|
93
101
|
*/
|
|
94
102
|
export declare const EMPTY_SIMPLE_QUERY_MODEL: SimpleQueryModel;
|
|
95
103
|
/**
|
|
96
104
|
* UI Framework
|
|
105
|
+
*
|
|
97
106
|
* @internal
|
|
98
107
|
*/
|
|
99
108
|
export type UiFramework = 'react' | 'vue' | 'angular';
|
|
100
109
|
/**
|
|
101
110
|
* Code Template Key
|
|
111
|
+
*
|
|
102
112
|
* @internal
|
|
103
113
|
*/
|
|
104
|
-
export type CodeTemplateKey = 'baseChartTmpl' | 'chartTmpl' | 'chartWidgetTmpl' | 'widgetByIdTmpl' | 'executeQueryByWidgetIdTmpl' | 'executeQueryTmpl' | 'executePivotQueryTmpl' | 'pivotTableWidgetTmpl';
|
|
114
|
+
export type CodeTemplateKey = 'baseChartTmpl' | 'chartTmpl' | 'chartWidgetTmpl' | 'chartWidgetPropsTmpl' | 'widgetByIdTmpl' | 'executeQueryByWidgetIdTmpl' | 'executeQueryTmpl' | 'executePivotQueryTmpl' | 'pivotTableWidgetTmpl' | 'pivotTableWidgetPropsTmpl' | 'dashboardByIdTmpl' | 'dashboardTmpl';
|
|
105
115
|
/**
|
|
106
116
|
* Code Templates
|
|
117
|
+
*
|
|
107
118
|
* @internal
|
|
108
119
|
*/
|
|
109
120
|
export type CodeTemplates = {
|
|
@@ -113,18 +124,22 @@ export type CodeTemplates = {
|
|
|
113
124
|
};
|
|
114
125
|
/**
|
|
115
126
|
* Code Placeholder Map
|
|
127
|
+
*
|
|
116
128
|
* @internal
|
|
117
129
|
*/
|
|
118
130
|
export type CodePlaceholderMap = Record<string, string>;
|
|
119
131
|
/**
|
|
120
132
|
* Base Code Config
|
|
133
|
+
*
|
|
121
134
|
* @internal
|
|
122
135
|
*/
|
|
123
136
|
export type BaseCodeConfig = {
|
|
124
137
|
uiFramework?: UiFramework;
|
|
125
138
|
};
|
|
139
|
+
/** TYPES FOR WIDGET CODE */
|
|
126
140
|
/**
|
|
127
141
|
* Widget Code Config
|
|
142
|
+
*
|
|
128
143
|
* @internal
|
|
129
144
|
*/
|
|
130
145
|
export type WidgetCodeConfig = BaseCodeConfig & {
|
|
@@ -132,6 +147,7 @@ export type WidgetCodeConfig = BaseCodeConfig & {
|
|
|
132
147
|
};
|
|
133
148
|
/**
|
|
134
149
|
* Client-side Widget Code Params
|
|
150
|
+
*
|
|
135
151
|
* @internal
|
|
136
152
|
*/
|
|
137
153
|
export type ClientSideWidgetCodeParams = BaseCodeConfig & {
|
|
@@ -139,6 +155,7 @@ export type ClientSideWidgetCodeParams = BaseCodeConfig & {
|
|
|
139
155
|
};
|
|
140
156
|
/**
|
|
141
157
|
* By ID Widget Code Params
|
|
158
|
+
*
|
|
142
159
|
* @internal
|
|
143
160
|
*/
|
|
144
161
|
export type ByIdWidgetCodeParams = WidgetCodeConfig & {
|
|
@@ -148,38 +165,49 @@ export type ByIdWidgetCodeParams = WidgetCodeConfig & {
|
|
|
148
165
|
};
|
|
149
166
|
/**
|
|
150
167
|
* Widget Code Params
|
|
168
|
+
*
|
|
151
169
|
* @internal
|
|
152
170
|
*/
|
|
153
171
|
export type WidgetCodeParams = ClientSideWidgetCodeParams | ByIdWidgetCodeParams;
|
|
154
172
|
/**
|
|
155
173
|
* Check if widget code params is for client-side code
|
|
174
|
+
*
|
|
156
175
|
* @internal
|
|
157
176
|
*/
|
|
158
177
|
export declare const isClientSideWidgetCodeParams: (params: WidgetCodeParams) => params is ClientSideWidgetCodeParams;
|
|
159
178
|
/**
|
|
160
179
|
* Check if widget code params is for by ID code
|
|
180
|
+
*
|
|
161
181
|
* @internal
|
|
162
182
|
*/
|
|
163
183
|
export declare const isByIdWidgetCodeParams: (params: WidgetCodeParams) => params is ByIdWidgetCodeParams;
|
|
164
184
|
/**
|
|
185
|
+
* Widget Props Config
|
|
186
|
+
*
|
|
165
187
|
* @internal
|
|
166
|
-
|
|
188
|
+
*/
|
|
167
189
|
export type WidgetPropsConfig = {
|
|
168
190
|
useCustomizedStyleOptions?: boolean;
|
|
169
191
|
};
|
|
170
192
|
/**
|
|
193
|
+
* Execute Query Code Params
|
|
194
|
+
*
|
|
171
195
|
* @internal
|
|
172
196
|
*/
|
|
173
197
|
export type ExecuteQueryCodeParams = BaseCodeConfig & {
|
|
174
198
|
queryParams: ExecuteQueryParams;
|
|
175
199
|
};
|
|
176
200
|
/**
|
|
201
|
+
* Execute Pivot Query Code Params
|
|
202
|
+
*
|
|
177
203
|
* @internal
|
|
178
204
|
*/
|
|
179
205
|
export type ExecutePivotQueryCodeParams = BaseCodeConfig & {
|
|
180
206
|
pivotQueryParams: ExecutePivotQueryParams;
|
|
181
207
|
};
|
|
182
208
|
/**
|
|
209
|
+
* Execute Query Code Props
|
|
210
|
+
*
|
|
183
211
|
* @internal
|
|
184
212
|
*/
|
|
185
213
|
export type ExecuteQueryCodeProps = Stringify<ExecuteQueryParams> & {
|
|
@@ -192,11 +220,73 @@ export type ExecutePivotQueryCodeProps = Stringify<ExecutePivotQueryParams> & {
|
|
|
192
220
|
extraImportsString: string;
|
|
193
221
|
};
|
|
194
222
|
/**
|
|
223
|
+
* Chart Widget Code Props
|
|
224
|
+
*
|
|
195
225
|
* @internal
|
|
196
226
|
*/
|
|
197
|
-
export type ChartWidgetCodeProps = Stringify<ChartWidgetProps> &
|
|
227
|
+
export type ChartWidgetCodeProps = Stringify<ChartWidgetProps> & ExtraWidgetCodeProps;
|
|
198
228
|
/**
|
|
229
|
+
* Pivot Table Widget Code Props
|
|
230
|
+
*
|
|
231
|
+
* @internal
|
|
232
|
+
*/
|
|
233
|
+
export type PivotTableWidgetCodeProps = Stringify<PivotTableWidgetProps> & ExtraWidgetCodeProps;
|
|
234
|
+
/**
|
|
235
|
+
* Template Key by Widget Type
|
|
236
|
+
*
|
|
237
|
+
* @internal
|
|
238
|
+
*/
|
|
239
|
+
export type TemplateKeyMapByWidgetType = {
|
|
240
|
+
chart: CodeTemplateKey;
|
|
241
|
+
pivot: CodeTemplateKey;
|
|
242
|
+
text?: CodeTemplateKey;
|
|
243
|
+
plugin?: CodeTemplateKey;
|
|
244
|
+
};
|
|
245
|
+
/** TYPE FOR DASHBOARD CODE */
|
|
246
|
+
/**
|
|
247
|
+
* Dashboard Code Config
|
|
248
|
+
*
|
|
249
|
+
* @internal
|
|
250
|
+
*/
|
|
251
|
+
export type DashboardCodeConfig = BaseCodeConfig;
|
|
252
|
+
/**
|
|
253
|
+
* Client-side Dashboard Code Params
|
|
254
|
+
*
|
|
255
|
+
* @internal
|
|
256
|
+
*/
|
|
257
|
+
export type ClientSideDashboardCodeParams = BaseCodeConfig & {
|
|
258
|
+
dashboardProps: DashboardProps;
|
|
259
|
+
};
|
|
260
|
+
/**
|
|
261
|
+
* By ID Dashboard Code Params
|
|
262
|
+
*
|
|
263
|
+
* @internal
|
|
264
|
+
*/
|
|
265
|
+
export type ByIdDashboardCodeParams = DashboardCodeConfig & {
|
|
266
|
+
dashboardOid: string;
|
|
267
|
+
};
|
|
268
|
+
/**
|
|
269
|
+
* Dashboard Code Params
|
|
270
|
+
*
|
|
271
|
+
* @internal
|
|
272
|
+
*/
|
|
273
|
+
export type DashboardCodeParams = ClientSideDashboardCodeParams | ByIdDashboardCodeParams;
|
|
274
|
+
/**
|
|
275
|
+
* Check if dashboard code params is for client-side code
|
|
276
|
+
*
|
|
277
|
+
* @internal
|
|
278
|
+
*/
|
|
279
|
+
export declare const isClientSideDashboardCodeParams: (params: DashboardCodeParams) => params is ClientSideDashboardCodeParams;
|
|
280
|
+
/**
|
|
281
|
+
* Check if dashboard code params is for by ID code
|
|
282
|
+
*
|
|
283
|
+
* @internal
|
|
284
|
+
*/
|
|
285
|
+
export declare const isByIdDashboardCodeParams: (params: DashboardCodeParams) => params is ByIdDashboardCodeParams;
|
|
286
|
+
/**
|
|
287
|
+
* Dashboard Code Props
|
|
288
|
+
*
|
|
199
289
|
* @internal
|
|
200
290
|
*/
|
|
201
|
-
export type
|
|
291
|
+
export type DashboardCodeProps = Stringify<DashboardProps> & ExtraWidgetCodeProps;
|
|
202
292
|
export {};
|
package/dist/packages/sdk-ui/src/analytics-composer/widget/chart-options/get-widget-options.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare const getChartRecommendationsOrDefault: (response: ExpandedQueryM
|
|
|
7
7
|
*/
|
|
8
8
|
export declare const getTableOptions: (jaql: MetadataItem[]) => {
|
|
9
9
|
dataOptions: {
|
|
10
|
-
columns: import("@sisense/sdk-data").JaqlElement[];
|
|
10
|
+
columns: (import("@sisense/sdk-data").Attribute | import("@sisense/sdk-data").JaqlElement | import("@sisense/sdk-data").CalculatedMeasure | import("@sisense/sdk-data").BaseMeasure)[];
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { WidgetProps } from '../../props';
|
|
2
|
+
import { ByIdWidgetCodeParams, ClientSideWidgetCodeParams, UiFramework, TemplateKeyMapByWidgetType } from '../types.js';
|
|
2
3
|
export declare const toWidgetCodeById: ({ dashboardOid, widgetOid, uiFramework, chartType, includeChart, }: ByIdWidgetCodeParams) => string;
|
|
4
|
+
export declare const getWidgetCode: (widgetProps: WidgetProps, uiFramework: UiFramework, templateKeyMap: TemplateKeyMapByWidgetType) => string;
|
|
3
5
|
export declare const toWidgetCodeClientSide: ({ widgetProps, uiFramework, }: ClientSideWidgetCodeParams) => string;
|
|
@@ -72,18 +72,21 @@ export declare class RestApi {
|
|
|
72
72
|
addWidgetToDashboard: (dashboardOid: string, widgetDto: WidgetDto) => Promise<WidgetDto | undefined>;
|
|
73
73
|
/**
|
|
74
74
|
* Get shared formulas by ids
|
|
75
|
+
*
|
|
75
76
|
* @param sharedFormulasIds - An array of shared formulas ids
|
|
76
77
|
* @returns A dictionary of shared formulas
|
|
77
78
|
*/
|
|
78
79
|
getSharedFormulas: (sharedFormulasIds: string[]) => Promise<Record<string, SharedFormulaDto>>;
|
|
79
80
|
/**
|
|
80
81
|
* Get a shared formula by id
|
|
82
|
+
*
|
|
81
83
|
* @param sharedFormulaId - A shared formula id
|
|
82
84
|
* @returns A shared formula
|
|
83
85
|
*/
|
|
84
86
|
getSharedFormula: (sharedFormulaId: string) => Promise<SharedFormulaDto | undefined>;
|
|
85
87
|
/**
|
|
86
88
|
* Get datasource fields
|
|
89
|
+
*
|
|
87
90
|
* @param dataSource - A datasource name
|
|
88
91
|
* @param options - An object with offset and count
|
|
89
92
|
* @returns A list of datasource fields
|