@sisense/sdk-ui 0.13.0 → 0.15.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/api/chat-api-context.d.ts +12 -0
- package/dist/ai/api/chat-rest-api.d.ts +28 -0
- package/dist/ai/api/hooks.d.ts +74 -0
- package/dist/ai/api/types.d.ts +139 -0
- package/dist/ai/chat-box.d.ts +6 -0
- package/dist/ai/chat-frame.d.ts +8 -0
- package/dist/ai/chat-home.d.ts +2 -0
- package/dist/ai/chat-input.d.ts +7 -0
- package/dist/ai/chatbot-context.d.ts +11 -0
- package/dist/ai/chatbot.d.ts +27 -0
- package/dist/ai/data-topics/data-topic-item.d.ts +8 -0
- package/dist/ai/data-topics/data-topic-list.d.ts +10 -0
- package/dist/ai/data-topics/index.d.ts +2 -0
- package/dist/ai/icons/arrow-left-icon.d.ts +2 -0
- package/dist/ai/icons/clear-chat-icon.d.ts +2 -0
- package/dist/ai/icons/close-dialog-icon.d.ts +2 -0
- package/dist/ai/icons/expand-icon.d.ts +2 -0
- package/dist/ai/icons/info-icon.d.ts +2 -0
- package/dist/ai/icons/light-bulb-icon.d.ts +2 -0
- package/dist/ai/icons/loading-dots-icon.d.ts +2 -0
- package/dist/ai/icons/magic-wand-icon.d.ts +2 -0
- package/dist/ai/icons/message-icon.d.ts +2 -0
- package/dist/ai/icons/refresh-icon.d.ts +2 -0
- package/dist/ai/icons/sisense-logo.d.ts +2 -0
- package/dist/ai/icons/three-dots-icon.d.ts +2 -0
- package/dist/ai/index.d.ts +4 -0
- package/dist/ai/magic-wand-dropdown.d.ts +7 -0
- package/dist/ai/messages/chart-message-toolbar.d.ts +8 -0
- package/dist/ai/messages/chart-message.d.ts +8 -0
- package/dist/ai/messages/clear-history-message.d.ts +6 -0
- package/dist/ai/messages/get-widget-options.d.ts +13 -0
- package/dist/ai/messages/insights-message.d.ts +10 -0
- package/dist/ai/messages/jaql-element.d.ts +25 -0
- package/dist/ai/messages/message-list-resolver.d.ts +7 -0
- package/dist/ai/messages/message-resolver.d.ts +11 -0
- package/dist/ai/messages/text-message.d.ts +8 -0
- package/dist/ai/nav-back-button.d.ts +6 -0
- package/dist/ai/nlg-query-result.d.ts +20 -0
- package/dist/ai/suggestions/index.d.ts +4 -0
- package/dist/ai/suggestions/suggestion-dropdown-item.d.ts +7 -0
- package/dist/ai/suggestions/suggestion-dropdown-list.d.ts +7 -0
- package/dist/ai/suggestions/suggestion-item.d.ts +7 -0
- package/dist/ai/suggestions/suggestion-list-skeleton.d.ts +2 -0
- package/dist/ai/suggestions/suggestion-list.d.ts +7 -0
- package/dist/ai/suggestions/suggestions-with-intro.d.ts +8 -0
- package/dist/ai/toolbar.d.ts +8 -0
- package/dist/ai/use-chat-session.d.ts +22 -0
- package/dist/ai.d.ts +1 -0
- package/dist/ai.js +3390 -0
- package/dist/api/types/dashboard-dto.d.ts +13 -5
- package/dist/chart-data-options/types.d.ts +11 -5
- package/dist/chart-options-processor/translations/axis-section.d.ts +1 -0
- package/dist/chart-options-processor/translations/scatter-series.d.ts +1 -0
- package/dist/chart-options-processor/translations/sunburst/sunburst-series.d.ts +2 -1
- package/dist/chart-options-processor/translations/translations-to-highcharts.d.ts +3 -2
- package/dist/charts/indicator/chart/indicator.d.ts +1 -1
- package/dist/charts/indicator/chart/ticker.d.ts +2 -2
- package/dist/charts/indicator/indicator-legacy-chart-options/default-options.d.ts +2 -1
- package/dist/charts/indicator/types.d.ts +47 -6
- package/dist/common/components/loading-indicator.d.ts +33 -0
- package/dist/common/icons/loading-icon.d.ts +6 -0
- package/dist/dashboard-widget/translate-dashboard-filters.d.ts +13 -0
- package/dist/dashboard-widget/translate-panel-color-format.d.ts +3 -2
- package/dist/dashboard-widget/translate-widget-data-options.d.ts +2 -2
- package/dist/dashboard-widget/translate-widget-filters.d.ts +21 -2
- package/dist/dashboard-widget/types.d.ts +14 -52
- package/dist/dashboard-widget/use-fetch-widget-dto-model.d.ts +48 -0
- package/dist/dashboard-widget/utils.d.ts +3 -3
- package/dist/decorators/{with-tracking → component-decorators/with-tracking}/error-tracker.d.ts +1 -1
- package/dist/decorators/hook-decorators/index.d.ts +1 -0
- package/dist/decorators/hook-decorators/with-tracking.d.ts +2 -0
- package/dist/filters/components/common/basic-input.d.ts +8 -0
- package/dist/filters/components/common/index.d.ts +3 -0
- package/dist/filters/components/common/triangle-indicator.d.ts +2 -0
- package/dist/filters/components/criteria-filter-tile/criteria-filter-display.d.ts +25 -0
- package/dist/filters/components/criteria-filter-tile/criteria-filter-menu.d.ts +20 -0
- package/dist/filters/components/criteria-filter-tile/criteria-filter-operations.d.ts +62 -0
- package/dist/filters/components/criteria-filter-tile/criteria-filter-tile.d.ts +27 -0
- package/dist/filters/components/criteria-filter-tile/index.d.ts +2 -0
- package/dist/filters/components/date-filter/date-filter/date-filter.d.ts +4 -0
- package/dist/filters/components/date-filter/date-range-filter-tile/date-range-filter-tile.d.ts +12 -4
- package/dist/filters/components/date-filter/date-range-filter-tile/use-date-limits.d.ts +2 -2
- package/dist/filters/components/filter-tile.d.ts +5 -2
- package/dist/filters/components/member-filter-tile/basic-member-filter-tile.d.ts +2 -0
- package/dist/filters/components/member-filter-tile/member-filter-tile.d.ts +4 -2
- package/dist/filters/index.d.ts +1 -0
- package/dist/formulas/fetch-formula.d.ts +16 -0
- package/dist/formulas/index.d.ts +1 -0
- package/dist/formulas/use-get-shared-formula.d.ts +95 -0
- package/dist/funnel-chart.d.ts +1 -1
- package/dist/highcharts-memorized.d.ts +6 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +8248 -71295
- package/dist/indicator-chart.d.ts +1 -1
- package/dist/models/dashboard/get-dashboard-models.d.ts +1 -1
- package/dist/models/dashboard/use-get-dashboard-model.d.ts +6 -1
- package/dist/models/dashboard/use-get-dashboard-models.d.ts +6 -1
- package/dist/pie-chart.d.ts +1 -1
- package/dist/props.d.ts +66 -19
- package/dist/query-execution/use-execute-query-by-widget-id.d.ts +18 -5
- package/dist/query-execution/use-execute-query.d.ts +10 -6
- package/dist/scatter-chart.d.ts +1 -1
- package/dist/table-widget-7b20ecf7.js +64167 -0
- package/dist/themes/colors.d.ts +86 -0
- package/dist/translation/resources/en.d.ts +25 -0
- package/dist/translation/resources/index.d.ts +50 -0
- package/dist/treemap-chart.d.ts +1 -2
- package/dist/types.d.ts +13 -3
- package/dist/widgets/chart-widget.d.ts +2 -2
- package/dist/widgets/common/drilldown.d.ts +1 -1
- package/dist/widgets/common/widget-header-info-button.d.ts +8 -0
- package/dist/widgets/common/widget-header.d.ts +1 -1
- package/dist/widgets/table-widget.d.ts +1 -2
- package/package.json +18 -7
- /package/dist/decorators/{as-sisense-component.d.ts → component-decorators/as-sisense-component.d.ts} +0 -0
- /package/dist/decorators/{with-default-translations.d.ts → component-decorators/with-default-translations.d.ts} +0 -0
- /package/dist/decorators/{with-error-boundary.d.ts → component-decorators/with-error-boundary.d.ts} +0 -0
- /package/dist/decorators/{with-sisense-context-validation.d.ts → component-decorators/with-sisense-context-validation.d.ts} +0 -0
- /package/dist/decorators/{with-tracking → component-decorators/with-tracking}/index.d.ts +0 -0
- /package/dist/decorators/{with-tracking → component-decorators/with-tracking}/use-track-component-init.d.ts +0 -0
- /package/dist/decorators/{with-tracking → component-decorators/with-tracking}/with-tracking.d.ts +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ChatRestApi } from './chat-rest-api';
|
|
3
|
+
export declare const useChatApi: () => ChatRestApi | undefined;
|
|
4
|
+
/**
|
|
5
|
+
* React component that allows wrapped components to access the AI Chat API on a
|
|
6
|
+
* Sisense instance. Depends on {@link SisenseContextProvider}.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare const ChatApiContextProvider: ({ children }: {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}) => JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { HttpClient } from '@sisense/sdk-rest-client';
|
|
2
|
+
import type { Chat, ChatRequest, ChatResponse, ChatWithoutHistory, DataModel, GetNlgQueryResultRequest, GetNlgQueryResultResponse, LlmConfig, Perspective, QueryRecommendationResponse } from './types';
|
|
3
|
+
export declare class ChatRestApi {
|
|
4
|
+
private httpClient;
|
|
5
|
+
constructor(httpClient: HttpClient);
|
|
6
|
+
getDataModels: () => Promise<DataModel[]>;
|
|
7
|
+
getPerspectives: () => Promise<Perspective[]>;
|
|
8
|
+
private getNlgQueryResult;
|
|
9
|
+
private getQueryRecommendations;
|
|
10
|
+
private setLlmConfig;
|
|
11
|
+
private getAllChats;
|
|
12
|
+
private getChatById;
|
|
13
|
+
private createChat;
|
|
14
|
+
private postChat;
|
|
15
|
+
private deleteChatHistory;
|
|
16
|
+
ai: {
|
|
17
|
+
getNlgQueryResult: (request: GetNlgQueryResultRequest) => Promise<GetNlgQueryResultResponse>;
|
|
18
|
+
getQueryRecommendations: (contextId: string) => Promise<QueryRecommendationResponse>;
|
|
19
|
+
setLlmConfig: (config: LlmConfig) => Promise<unknown>;
|
|
20
|
+
chat: {
|
|
21
|
+
getAll: () => Promise<ChatWithoutHistory[]>;
|
|
22
|
+
getById: (chatId: string) => Promise<Chat>;
|
|
23
|
+
create: (contextId: string) => Promise<Chat>;
|
|
24
|
+
post: (chatId: string, request: ChatRequest) => Promise<ChatResponse>;
|
|
25
|
+
clearHistory: (chatId: string) => Promise<void>;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { ChatContext } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export declare const useDataTopics: () => {
|
|
6
|
+
data: ChatContext[] | undefined;
|
|
7
|
+
isLoading: boolean;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export declare const useChats: () => {
|
|
13
|
+
data: import("./types").ChatWithoutHistory[];
|
|
14
|
+
isLoading: boolean;
|
|
15
|
+
refetch: <TPageData>(options?: (import("@tanstack/react-query").RefetchOptions & import("@tanstack/react-query").RefetchQueryFilters<TPageData>) | undefined) => Promise<import("@tanstack/react-query").QueryObserverResult<import("./types").ChatWithoutHistory[] | undefined, unknown>>;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export declare const useChat: (id: string | undefined) => {
|
|
21
|
+
data: import("./types").Chat | undefined;
|
|
22
|
+
isLoading: boolean;
|
|
23
|
+
refetch: () => void;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Parameters for {@link useQueryRecommendations} hook.
|
|
27
|
+
*
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
30
|
+
export interface UseGetQueryRecommendationsParams {
|
|
31
|
+
/** Data model or perspective ID */
|
|
32
|
+
contextId: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Fetch recommended questions for a data model or perspective.
|
|
36
|
+
*
|
|
37
|
+
* @param params - {@link UseQueryRecommendationsParams}
|
|
38
|
+
* @returns An array of questions
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
export declare function useGetQueryRecommendations(params: UseGetQueryRecommendationsParams): {
|
|
42
|
+
data: string[];
|
|
43
|
+
isLoading: boolean;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Parameters for {@link useNlgQueryResult} hook.
|
|
47
|
+
*
|
|
48
|
+
* @internal
|
|
49
|
+
*/
|
|
50
|
+
export interface UseGetNlgQueryResultParams {
|
|
51
|
+
/** The data source that the JAQL metadata targets - e.g. `Sample ECommerce` */
|
|
52
|
+
dataSource: string;
|
|
53
|
+
/** The metadata that composes the JAQL to be analyzed */
|
|
54
|
+
metadata: unknown[];
|
|
55
|
+
/**
|
|
56
|
+
* Boolean flag to enable/disable API call by default
|
|
57
|
+
*
|
|
58
|
+
* If not specified, the default value is `true`
|
|
59
|
+
*/
|
|
60
|
+
enabled?: boolean;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Fetch an analysis of the provided JAQL.
|
|
64
|
+
*
|
|
65
|
+
* @param params - {@link UseNlgQueryResultParams}
|
|
66
|
+
* @returns A response object containing a text summary
|
|
67
|
+
* @internal
|
|
68
|
+
*/
|
|
69
|
+
export declare const useGetNlgQueryResult: (params: UseGetNlgQueryResultParams) => {
|
|
70
|
+
data: string | undefined;
|
|
71
|
+
isError: boolean;
|
|
72
|
+
isLoading: boolean;
|
|
73
|
+
refetch: () => void;
|
|
74
|
+
};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { MetadataItem } from '@sisense/sdk-query-client';
|
|
2
|
+
export interface ChatContext {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
type: ChatContextType;
|
|
6
|
+
description: string;
|
|
7
|
+
}
|
|
8
|
+
export type ChatContextType = 'dashboard' | 'datamodel' | 'global' | 'perspective';
|
|
9
|
+
interface TextMessage {
|
|
10
|
+
role: 'assistant';
|
|
11
|
+
content: string;
|
|
12
|
+
type: 'Text';
|
|
13
|
+
}
|
|
14
|
+
export interface NlqMessage {
|
|
15
|
+
role: 'assistant';
|
|
16
|
+
content: string;
|
|
17
|
+
type: 'nlq';
|
|
18
|
+
}
|
|
19
|
+
interface RegularMessage {
|
|
20
|
+
role: 'user' | 'assistant';
|
|
21
|
+
content: string;
|
|
22
|
+
}
|
|
23
|
+
type SystemMessage = NlqMessage | TextMessage;
|
|
24
|
+
export type ChatMessage = RegularMessage | SystemMessage;
|
|
25
|
+
export interface Chat {
|
|
26
|
+
chatId: string;
|
|
27
|
+
contextId: string;
|
|
28
|
+
contextType: ChatContextType;
|
|
29
|
+
contextTitle: string;
|
|
30
|
+
lastUpdate: string;
|
|
31
|
+
tenantId: string;
|
|
32
|
+
userId: string;
|
|
33
|
+
chatHistory: ChatMessage[];
|
|
34
|
+
}
|
|
35
|
+
export type ChatWithoutHistory = Omit<Chat, 'chatHistory'>;
|
|
36
|
+
export interface LlmConfig {
|
|
37
|
+
provider: string;
|
|
38
|
+
apiKey: string;
|
|
39
|
+
baseUrl: string;
|
|
40
|
+
model: string;
|
|
41
|
+
version?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface ChatRequest {
|
|
44
|
+
text?: string;
|
|
45
|
+
timezone?: string;
|
|
46
|
+
options?: {
|
|
47
|
+
enableFollowup?: boolean;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
interface TextResponse {
|
|
51
|
+
chatHistory: ChatMessage[];
|
|
52
|
+
data: {
|
|
53
|
+
answer: string;
|
|
54
|
+
};
|
|
55
|
+
chatId: string;
|
|
56
|
+
responseType: 'Text';
|
|
57
|
+
}
|
|
58
|
+
export interface AxesMapping {
|
|
59
|
+
category?: {
|
|
60
|
+
name: string;
|
|
61
|
+
type: string;
|
|
62
|
+
}[];
|
|
63
|
+
value?: {
|
|
64
|
+
name: string;
|
|
65
|
+
type: string;
|
|
66
|
+
}[];
|
|
67
|
+
breakBy?: {
|
|
68
|
+
name: string;
|
|
69
|
+
type: string;
|
|
70
|
+
}[];
|
|
71
|
+
}
|
|
72
|
+
export interface ChartRecommendations {
|
|
73
|
+
chartFamily: string;
|
|
74
|
+
chartType: string;
|
|
75
|
+
axesMapping: AxesMapping;
|
|
76
|
+
}
|
|
77
|
+
export interface NlqResponseData {
|
|
78
|
+
detailedDescription: string;
|
|
79
|
+
followupQuestions: string[];
|
|
80
|
+
nlqPrompt: string;
|
|
81
|
+
chartRecommendations: ChartRecommendations;
|
|
82
|
+
jaql: {
|
|
83
|
+
datasource?: {
|
|
84
|
+
title: string;
|
|
85
|
+
};
|
|
86
|
+
metadata: MetadataItem[];
|
|
87
|
+
};
|
|
88
|
+
queryTitle: string;
|
|
89
|
+
}
|
|
90
|
+
export interface NlqResponse {
|
|
91
|
+
data: NlqResponseData;
|
|
92
|
+
timestamp: string;
|
|
93
|
+
responseType: 'nlq';
|
|
94
|
+
}
|
|
95
|
+
export type ChatResponse = NlqResponse | TextResponse;
|
|
96
|
+
export interface QueryRecommendation {
|
|
97
|
+
query: string;
|
|
98
|
+
jaql: object;
|
|
99
|
+
}
|
|
100
|
+
export interface QueryRecommendationResponse {
|
|
101
|
+
data: {
|
|
102
|
+
answer: QueryRecommendation[];
|
|
103
|
+
};
|
|
104
|
+
responseType: 'Array';
|
|
105
|
+
}
|
|
106
|
+
export interface DataModel {
|
|
107
|
+
oid: string;
|
|
108
|
+
title: string;
|
|
109
|
+
}
|
|
110
|
+
export interface Perspective {
|
|
111
|
+
_id: string;
|
|
112
|
+
oid: string;
|
|
113
|
+
datamodelOid: string;
|
|
114
|
+
description: string;
|
|
115
|
+
tables: any[];
|
|
116
|
+
lastUpdated: string;
|
|
117
|
+
createdTime: string;
|
|
118
|
+
parentOid: string | null;
|
|
119
|
+
name: string;
|
|
120
|
+
creator: string;
|
|
121
|
+
isDefault: boolean;
|
|
122
|
+
tenantId: string;
|
|
123
|
+
}
|
|
124
|
+
export interface GetNlgQueryResultRequest {
|
|
125
|
+
style: 'Small' | 'Medium' | 'Large';
|
|
126
|
+
jaql: {
|
|
127
|
+
datasource: {
|
|
128
|
+
title: string;
|
|
129
|
+
};
|
|
130
|
+
metadata: unknown[];
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
export interface GetNlgQueryResultResponse {
|
|
134
|
+
data?: {
|
|
135
|
+
answer: string;
|
|
136
|
+
};
|
|
137
|
+
responseType: 'Text';
|
|
138
|
+
}
|
|
139
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
type ChatFrameProps = {
|
|
3
|
+
width?: CSSProperties['width'];
|
|
4
|
+
height?: CSSProperties['height'];
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export default function ChatFrame({ width, height, children, }: ChatFrameProps): JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type ChatInputProps = {
|
|
3
|
+
onSendMessage: (message: string) => void;
|
|
4
|
+
onClearHistoryClick?: () => void;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export default function ChatInput({ onSendMessage, onClearHistoryClick, disabled, }: ChatInputProps): JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ChatContext } from './api/types';
|
|
3
|
+
type ChatbotContextProviderProps = {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
};
|
|
6
|
+
export declare const useChatbotContext: () => {
|
|
7
|
+
selectedContext?: ChatContext | undefined;
|
|
8
|
+
setSelectedContext: (context: ChatContext | undefined) => void;
|
|
9
|
+
};
|
|
10
|
+
export declare function ChatbotContextProvider({ children }: ChatbotContextProviderProps): JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Props for {@link Chatbot} component.
|
|
4
|
+
*
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export type ChatbotProps = {
|
|
8
|
+
/**
|
|
9
|
+
* Total width of the chatbot
|
|
10
|
+
*
|
|
11
|
+
* If not specified, a default width of 500px will be used
|
|
12
|
+
*/
|
|
13
|
+
width?: CSSProperties['width'];
|
|
14
|
+
/**
|
|
15
|
+
* Total height of the chatbot
|
|
16
|
+
*
|
|
17
|
+
* If not specified, a default height of 500px will be used
|
|
18
|
+
*/
|
|
19
|
+
height?: CSSProperties['height'];
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* React component that renders a chatbot with data topic selection.
|
|
23
|
+
*
|
|
24
|
+
* @param props - {@link ChatbotProps}
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
|
+
export declare const Chatbot: import("react").FunctionComponent<ChatbotProps>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { ChatApiContextProvider } from './api/chat-api-context';
|
|
2
|
+
export { useGetNlgQueryResult, useGetQueryRecommendations, type UseGetNlgQueryResultParams, type UseGetQueryRecommendationsParams, } from './api/hooks';
|
|
3
|
+
export { Chatbot, type ChatbotProps } from './chatbot';
|
|
4
|
+
export { default as NlgQueryResult, type NlgQueryResultProps } from './nlg-query-result';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
type ChartMessageToolbarProps = {
|
|
3
|
+
infoTooltipText?: string;
|
|
4
|
+
onRefresh: () => void;
|
|
5
|
+
onExpand: () => void;
|
|
6
|
+
};
|
|
7
|
+
export default function ChartMessageToolbar({ infoTooltipText, onRefresh, onExpand, }: ChartMessageToolbarProps): JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { NlqResponseData } from '../api/types';
|
|
3
|
+
type ChartMessageProps = {
|
|
4
|
+
content: NlqResponseData;
|
|
5
|
+
dataSource: string;
|
|
6
|
+
};
|
|
7
|
+
export default function ChartMessage({ content, dataSource }: ChartMessageProps): JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { MetadataItem } from '@sisense/sdk-query-client';
|
|
2
|
+
import { CartesianChartDataOptions, CategoricalChartDataOptions, StyleOptions } from '../../types';
|
|
3
|
+
import { ChartRecommendations } from '../api/types';
|
|
4
|
+
export declare const getTableOptions: (jaql: MetadataItem[]) => {
|
|
5
|
+
dataOptions: {
|
|
6
|
+
columns: import("./jaql-element").JaqlElement[];
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export declare const getChartOptions: (jaql: MetadataItem[], chartRecs: ChartRecommendations) => {
|
|
10
|
+
dataOptions: CartesianChartDataOptions | CategoricalChartDataOptions;
|
|
11
|
+
styleOptions: StyleOptions;
|
|
12
|
+
expandedStyleOptions: StyleOptions;
|
|
13
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare function InsightsSummary({ summary }: {
|
|
3
|
+
summary: string;
|
|
4
|
+
}): JSX.Element;
|
|
5
|
+
type InsightsMessageProps = {
|
|
6
|
+
dataSource: string;
|
|
7
|
+
metadata: unknown[];
|
|
8
|
+
};
|
|
9
|
+
export default function InsightsMessage({ dataSource, metadata }: InsightsMessageProps): JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { DimensionalElement } from '@sisense/sdk-data';
|
|
2
|
+
import { MetadataItem } from '@sisense/sdk-query-client';
|
|
3
|
+
/**
|
|
4
|
+
* This implementation wraps metadata for a JAQL query. The metadata could be
|
|
5
|
+
* for a dimension, measure, or filter. We do little to no interpretation of
|
|
6
|
+
* the JAQL as it is designed to be "passed through" to the query execution
|
|
7
|
+
* step.
|
|
8
|
+
*
|
|
9
|
+
* This will typically be used for JAQL metadata that is coming from a Sisense
|
|
10
|
+
* instance and is assumed to be correct (e.g. dashboard widget, NLQ
|
|
11
|
+
* suggestion).
|
|
12
|
+
*
|
|
13
|
+
* @param item - the metadata item in a JAQL query
|
|
14
|
+
* @param type - the data type of the dimension
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export declare class JaqlElement extends DimensionalElement {
|
|
18
|
+
private metadataItem;
|
|
19
|
+
expression: string;
|
|
20
|
+
skipValidation: boolean;
|
|
21
|
+
constructor(item: MetadataItem, type: string);
|
|
22
|
+
get id(): string;
|
|
23
|
+
jaql(): MetadataItem;
|
|
24
|
+
}
|
|
25
|
+
export declare function createJaqlElement(item: MetadataItem): JaqlElement;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ChatMessage } from '../api/types';
|
|
3
|
+
export type MessageListResolverProps = {
|
|
4
|
+
messages: ChatMessage[];
|
|
5
|
+
sendMessage?: (message: string) => void;
|
|
6
|
+
};
|
|
7
|
+
export default function MessageListResolver({ messages, sendMessage, }: MessageListResolverProps): JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ChatMessage } from '../api/types';
|
|
3
|
+
type MessageResolverProps = {
|
|
4
|
+
message: ChatMessage;
|
|
5
|
+
dataSource: string;
|
|
6
|
+
sendMessage?: (message: string) => void;
|
|
7
|
+
allowFollowupQuestions?: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare function MessageResolver({ message, dataSource, allowFollowupQuestions, sendMessage, }: MessageResolverProps): JSX.Element;
|
|
10
|
+
declare const _default: import("react").MemoExoticComponent<typeof MessageResolver>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/**
|
|
3
|
+
* Props for {@link NlgQueryResult} component.
|
|
4
|
+
*
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export type NlgQueryResultProps = {
|
|
8
|
+
/** The data source that the JAQL metadata targets - e.g. `Sample ECommerce` */
|
|
9
|
+
dataSource: string;
|
|
10
|
+
/** The metadata that composes the JAQL to be analyzed */
|
|
11
|
+
metadata: unknown[];
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Fetch and display a collapsible analysis of the provided JAQL.
|
|
15
|
+
*
|
|
16
|
+
* @param props - {@link NlgQueryResultProps}
|
|
17
|
+
* @returns A response object containing a text summary
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export default function NlgQueryResult(props: NlgQueryResultProps): JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as SuggestionItem } from './suggestion-item';
|
|
2
|
+
export { default as SuggestionList } from './suggestion-list';
|
|
3
|
+
export { default as SuggestionListWithIntro } from './suggestions-with-intro';
|
|
4
|
+
export { default as SuggestionListSkeleton } from './suggestion-list-skeleton';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface SuggestionDropdownListProps {
|
|
3
|
+
onSelect: (selection: string) => void;
|
|
4
|
+
suggestions: string[];
|
|
5
|
+
isLoading: boolean;
|
|
6
|
+
}
|
|
7
|
+
export default function SuggestionDropdownList(props: SuggestionDropdownListProps): JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface Props {
|
|
3
|
+
title: string;
|
|
4
|
+
leftNav: JSX.Element;
|
|
5
|
+
rightNav?: JSX.Element;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ChatMessage } from './api/types';
|
|
2
|
+
interface UseChatSessionResult {
|
|
3
|
+
history: ChatMessage[];
|
|
4
|
+
clearHistory: () => void;
|
|
5
|
+
sendMessage: (message: string) => void;
|
|
6
|
+
isAwaitingResponse: boolean;
|
|
7
|
+
isLoading: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* React hook that returns a chat session object for the given data model or
|
|
11
|
+
* perspective.
|
|
12
|
+
*
|
|
13
|
+
* Maintains chat history and updates when a message is sent/received or when
|
|
14
|
+
* history is cleared.
|
|
15
|
+
*
|
|
16
|
+
* If a chat session does not already exist, then one is created.
|
|
17
|
+
*
|
|
18
|
+
* @param contextTitle - the title of the data model or perspective
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export declare const useChatSession: (contextTitle: string) => UseChatSessionResult;
|
|
22
|
+
export {};
|
package/dist/ai.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ai/index'
|