@thoughtspot/visual-embed-sdk 1.39.1 → 1.39.2-spotter-agent
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/cjs/package.json +1 -1
- package/cjs/src/config.spec.js +9 -0
- package/cjs/src/config.spec.js.map +1 -1
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +2 -1
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +18 -8
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.d.ts +19 -7
- package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/cjs/src/embed/bodyless-conversation.js +24 -4
- package/cjs/src/embed/bodyless-conversation.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.spec.js +8 -190
- package/cjs/src/embed/bodyless-conversation.spec.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +28 -0
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/embedConfig.d.ts +9 -7
- package/cjs/src/embed/embedConfig.d.ts.map +1 -1
- package/cjs/src/embed/embedConfig.js +9 -7
- package/cjs/src/embed/embedConfig.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +0 -17
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +2 -4
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +12 -11
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +5 -0
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +16 -1
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +164 -0
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/errors.d.ts +1 -0
- package/cjs/src/errors.d.ts.map +1 -1
- package/cjs/src/errors.js +1 -0
- package/cjs/src/errors.js.map +1 -1
- package/cjs/src/pages/embed-test.page.d.ts +8 -0
- package/cjs/src/pages/embed-test.page.d.ts.map +1 -0
- package/cjs/src/pages/embed-test.page.js +20 -0
- package/cjs/src/pages/embed-test.page.js.map +1 -0
- package/cjs/src/pages/home.page.d.ts +6 -0
- package/cjs/src/pages/home.page.d.ts.map +1 -0
- package/cjs/src/pages/home.page.js +12 -0
- package/cjs/src/pages/home.page.js.map +1 -0
- package/cjs/src/pages/login.page.d.ts +15 -0
- package/cjs/src/pages/login.page.d.ts.map +1 -0
- package/cjs/src/pages/login.page.js +22 -0
- package/cjs/src/pages/login.page.js.map +1 -0
- package/cjs/src/react/all-types-export.d.ts +1 -1
- package/cjs/src/react/all-types-export.d.ts.map +1 -1
- package/cjs/src/react/all-types-export.js +3 -2
- package/cjs/src/react/all-types-export.js.map +1 -1
- package/cjs/src/react/index.d.ts +71 -20
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +79 -42
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/react/index.spec.js +436 -100
- package/cjs/src/react/index.spec.js.map +1 -1
- package/cjs/src/tests/auth.test.d.ts +1 -0
- package/cjs/src/tests/auth.test.d.ts.map +1 -0
- package/cjs/src/tests/auth.test.js +1 -0
- package/cjs/src/tests/auth.test.js.map +1 -0
- package/cjs/src/tests/e2e/auth.spec.d.ts +2 -0
- package/cjs/src/tests/e2e/auth.spec.d.ts.map +1 -0
- package/cjs/src/tests/e2e/auth.spec.js +54 -0
- package/cjs/src/tests/e2e/auth.spec.js.map +1 -0
- package/cjs/src/types.d.ts +34 -2
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +17 -1
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
- package/cjs/src/utils/graphql/nlsService/conversation-service.js +2 -0
- package/cjs/src/utils/graphql/nlsService/conversation-service.js.map +1 -1
- package/cjs/src/utils.spec.js +25 -0
- package/cjs/src/utils.spec.js.map +1 -1
- package/dist/index-2QHwuA-G.js +7371 -0
- package/dist/index-Cj4BVGHL.js +7371 -0
- package/dist/index-DUaG1OG2.js +7447 -0
- package/dist/{index-JaFaxrvQ.js → index-DnIvX1FR.js} +1 -1
- package/dist/index-Fhk1V_Gw.js +7371 -0
- package/dist/index-OuiZF3zE.js +7371 -0
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/bodyless-conversation.d.ts +19 -7
- package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/dist/src/embed/embedConfig.d.ts +9 -7
- package/dist/src/embed/embedConfig.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +0 -17
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +5 -0
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/errors.d.ts +1 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/react/all-types-export.d.ts +1 -1
- package/dist/src/react/all-types-export.d.ts.map +1 -1
- package/dist/src/react/index.d.ts +71 -20
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +34 -2
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +157 -68
- package/dist/tsembed-react.js +157 -66
- package/dist/tsembed.es.js +74 -20
- package/dist/tsembed.js +73 -19
- package/dist/visual-embed-sdk-react-full.d.ts +132 -52
- package/dist/visual-embed-sdk-react.d.ts +132 -52
- package/dist/visual-embed-sdk.d.ts +62 -33
- package/lib/package.json +1 -1
- package/lib/src/config.spec.js +9 -0
- package/lib/src/config.spec.js.map +1 -1
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +2 -1
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +19 -9
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.d.ts +19 -7
- package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/lib/src/embed/bodyless-conversation.js +23 -4
- package/lib/src/embed/bodyless-conversation.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.spec.js +9 -191
- package/lib/src/embed/bodyless-conversation.spec.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +30 -2
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/embedConfig.d.ts +9 -7
- package/lib/src/embed/embedConfig.d.ts.map +1 -1
- package/lib/src/embed/embedConfig.js +9 -7
- package/lib/src/embed/embedConfig.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +0 -17
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +2 -4
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +12 -11
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +5 -0
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +16 -1
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +164 -0
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/errors.d.ts +1 -0
- package/lib/src/errors.d.ts.map +1 -1
- package/lib/src/errors.js +1 -0
- package/lib/src/errors.js.map +1 -1
- package/lib/src/react/all-types-export.d.ts +1 -1
- package/lib/src/react/all-types-export.d.ts.map +1 -1
- package/lib/src/react/all-types-export.js +1 -1
- package/lib/src/react/all-types-export.js.map +1 -1
- package/lib/src/react/index.d.ts +71 -20
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +79 -43
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/react/index.spec.js +439 -103
- package/lib/src/react/index.spec.js.map +1 -1
- package/lib/src/types.d.ts +34 -2
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +17 -1
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
- package/lib/src/utils/graphql/nlsService/conversation-service.js +2 -0
- package/lib/src/utils/graphql/nlsService/conversation-service.js.map +1 -1
- package/lib/src/utils.spec.js +26 -1
- package/lib/src/utils.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +62 -33
- package/package.json +1 -1
- package/src/config.spec.ts +11 -0
- package/src/embed/app.spec.ts +36 -23
- package/src/embed/app.ts +2 -0
- package/src/embed/bodyless-conversation.spec.ts +9 -203
- package/src/embed/bodyless-conversation.ts +24 -10
- package/src/embed/conversation.spec.ts +40 -2
- package/src/embed/embedConfig.ts +10 -8
- package/src/embed/liveboard.spec.ts +5 -4
- package/src/embed/liveboard.ts +2 -22
- package/src/embed/ts-embed.spec.ts +225 -0
- package/src/embed/ts-embed.ts +19 -0
- package/src/errors.ts +1 -0
- package/src/react/all-types-export.ts +2 -1
- package/src/react/index.spec.tsx +556 -157
- package/src/react/index.tsx +117 -51
- package/src/types.ts +75 -43
- package/src/utils/graphql/nlsService/conversation-service.ts +2 -0
- package/src/utils.spec.ts +29 -0
|
@@ -233,33 +233,42 @@ export const SpotterEmbed: React.ForwardRefExoticComponent<SpotterEmbedProps & R
|
|
|
233
233
|
* ```
|
|
234
234
|
*/
|
|
235
235
|
export const ConversationEmbed: React.ForwardRefExoticComponent<ConversationEmbedProps & React.RefAttributes<_ConversationEmbed>>;
|
|
236
|
-
|
|
236
|
+
/**
|
|
237
|
+
* React component for individual conversation messages from SpotterAgent.
|
|
238
|
+
* This component is used internally by the useSpotterAgent hook.
|
|
239
|
+
* @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
|
|
240
|
+
*/
|
|
241
|
+
interface ConversationMessageProps extends EmbedProps, SpotterAgentMessageViewConfig {
|
|
237
242
|
}
|
|
243
|
+
export const ConversationMessage: React.ForwardRefExoticComponent<ConversationMessageProps & React.RefAttributes<_ConversationMessage>>;
|
|
238
244
|
/**
|
|
239
|
-
* React component for
|
|
240
|
-
*
|
|
245
|
+
* React component for displaying individual conversation messages from SpotterAgent.
|
|
246
|
+
*
|
|
247
|
+
* This component renders a single message response from your ThoughtSpot conversation,
|
|
248
|
+
* showing charts, visualizations, or text responses based on the user's query.
|
|
249
|
+
*
|
|
241
250
|
* @example
|
|
242
251
|
* ```tsx
|
|
243
|
-
*
|
|
244
|
-
*
|
|
252
|
+
* const { sendMessage } = useSpotterAgent({ worksheetId: 'worksheetId' });
|
|
253
|
+
* const result = await sendMessage('show me sales by region');
|
|
245
254
|
*
|
|
246
|
-
*
|
|
247
|
-
*
|
|
248
|
-
*
|
|
249
|
-
* document.body.appendChild(container);
|
|
250
|
-
* }
|
|
251
|
-
* };
|
|
255
|
+
* if (!result.error) {
|
|
256
|
+
* // Simple usage - just pass the message data
|
|
257
|
+
* <SpotterMessage message={result.message} />
|
|
252
258
|
*
|
|
253
|
-
*
|
|
254
|
-
*
|
|
255
|
-
*
|
|
256
|
-
*
|
|
257
|
-
*
|
|
258
|
-
* );
|
|
259
|
+
* // With optional query for context
|
|
260
|
+
* <SpotterMessage
|
|
261
|
+
* message={result.message}
|
|
262
|
+
* query={result.query}
|
|
263
|
+
* />
|
|
259
264
|
* }
|
|
260
265
|
* ```
|
|
266
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.11.0.cl
|
|
261
267
|
*/
|
|
262
|
-
export const
|
|
268
|
+
export const SpotterMessage: React.ForwardRefExoticComponent<{
|
|
269
|
+
message: SpotterAgentMessageViewConfig;
|
|
270
|
+
query?: string;
|
|
271
|
+
} & Omit<EmbedProps, keyof SpotterAgentMessageViewConfig> & React.RefAttributes<_ConversationMessage>>;
|
|
263
272
|
/**
|
|
264
273
|
* React component for PreRendered Conversation embed.
|
|
265
274
|
*
|
|
@@ -279,7 +288,7 @@ export const SpotterAgentEmbed: React.ForwardRefExoticComponent<SpotterAgentEmbe
|
|
|
279
288
|
* ```
|
|
280
289
|
*/
|
|
281
290
|
export const PreRenderedConversationEmbed: React.ForwardRefExoticComponent<SpotterEmbedProps & PreRenderProps & React.RefAttributes<_SpotterEmbed>>;
|
|
282
|
-
type EmbedComponent = typeof SearchEmbed | typeof AppEmbed | typeof LiveboardEmbed | typeof SearchBarEmbed | typeof SageEmbed | typeof
|
|
291
|
+
type EmbedComponent = typeof SearchEmbed | typeof AppEmbed | typeof LiveboardEmbed | typeof SearchBarEmbed | typeof SageEmbed | typeof ConversationMessage | typeof SpotterMessage | typeof SpotterEmbed | typeof ConversationEmbed;
|
|
283
292
|
/**
|
|
284
293
|
* Get a reference to the embed component to trigger events on the component.
|
|
285
294
|
* @example
|
|
@@ -311,6 +320,48 @@ export function useEmbedRef<T extends EmbedComponent>(): React.MutableRefObject<
|
|
|
311
320
|
* @version SDK: 1.36.2 | ThoughtSpot: *
|
|
312
321
|
*/
|
|
313
322
|
export function useInit(config: EmbedConfig): React.MutableRefObject<AuthEventEmitter>;
|
|
323
|
+
/**
|
|
324
|
+
* React hook for interacting with SpotterAgent AI conversations.
|
|
325
|
+
*
|
|
326
|
+
* This hook provides a sendMessage function that allows you to send natural language
|
|
327
|
+
* queries to your data and get back AI-generated responses with visualizations.
|
|
328
|
+
*
|
|
329
|
+
* @param config - Configuration object containing worksheetId and other options
|
|
330
|
+
* @returns Object with sendMessage function that returns conversation results
|
|
331
|
+
* @example
|
|
332
|
+
* ```tsx
|
|
333
|
+
* const { sendMessage } = useSpotterAgent({ worksheetId: 'worksheetId' });
|
|
334
|
+
*
|
|
335
|
+
* const handleQuery = async () => {
|
|
336
|
+
* const result = await sendMessage('show me sales by region');
|
|
337
|
+
*
|
|
338
|
+
* if (!result.error) {
|
|
339
|
+
* // Display the message response
|
|
340
|
+
* <SpotterMessage message={result.message} />
|
|
341
|
+
* } else {
|
|
342
|
+
* console.error('Error:', result.error);
|
|
343
|
+
* }
|
|
344
|
+
* };
|
|
345
|
+
* ```
|
|
346
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.11.0.cl
|
|
347
|
+
*/
|
|
348
|
+
export function useSpotterAgent(config: SpotterAgentEmbedViewConfig): {
|
|
349
|
+
sendMessage: (query: string) => Promise<{
|
|
350
|
+
error: any;
|
|
351
|
+
query?: undefined;
|
|
352
|
+
message?: undefined;
|
|
353
|
+
} | {
|
|
354
|
+
query: string;
|
|
355
|
+
message: {
|
|
356
|
+
worksheetId: string;
|
|
357
|
+
sessionId: any;
|
|
358
|
+
genNo: any;
|
|
359
|
+
acSessionId: any;
|
|
360
|
+
acGenNo: any;
|
|
361
|
+
};
|
|
362
|
+
error?: undefined;
|
|
363
|
+
}>;
|
|
364
|
+
};
|
|
314
365
|
|
|
315
366
|
/**
|
|
316
367
|
* Copyright (c) 2023
|
|
@@ -1910,23 +1961,6 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
1910
1961
|
* })
|
|
1911
1962
|
*/
|
|
1912
1963
|
dataSourceId?: string;
|
|
1913
|
-
/**
|
|
1914
|
-
* This flag is for show/hide checkboxes for include or exclude
|
|
1915
|
-
* cover page and filters in the Liveboard PDF.
|
|
1916
|
-
*
|
|
1917
|
-
* Supported embed types: `LiveboardEmbed`
|
|
1918
|
-
* @version SDK: 1.37.0 | ThoughtSpot:10.8.0.cl
|
|
1919
|
-
* @default true
|
|
1920
|
-
* Supported embed types: `LiveboardEmbed`
|
|
1921
|
-
* @example
|
|
1922
|
-
* ```js
|
|
1923
|
-
* const embed = new LiveboardEmbed('#tsEmbed', {
|
|
1924
|
-
* ... //other embed view config
|
|
1925
|
-
* coverAndFilterOptionInPDF: false,
|
|
1926
|
-
* })
|
|
1927
|
-
* ```
|
|
1928
|
-
*/
|
|
1929
|
-
coverAndFilterOptionInPDF?: boolean;
|
|
1930
1964
|
/**
|
|
1931
1965
|
* The list of tab IDs to hide from the embedded.
|
|
1932
1966
|
* This Tabs will be hidden from their respective LBs.
|
|
@@ -2044,10 +2078,6 @@ export interface SpotterAgentEmbedViewConfig extends Omit<BaseViewConfig, 'prima
|
|
|
2044
2078
|
* The ID of the worksheet to use for the conversation.
|
|
2045
2079
|
*/
|
|
2046
2080
|
worksheetId: string;
|
|
2047
|
-
/**
|
|
2048
|
-
* Optional CSS class name to add to the container div.
|
|
2049
|
-
*/
|
|
2050
|
-
containerClassName?: string;
|
|
2051
2081
|
}
|
|
2052
2082
|
/**
|
|
2053
2083
|
* Configuration for conversation options.
|
|
@@ -2057,13 +2087,13 @@ export interface SpotterAgentEmbedViewConfig extends Omit<BaseViewConfig, 'prima
|
|
|
2057
2087
|
*/
|
|
2058
2088
|
export interface BodylessConversationViewConfig extends SpotterAgentEmbedViewConfig {
|
|
2059
2089
|
}
|
|
2060
|
-
interface SpotterAgentMessageViewConfig extends SpotterAgentEmbedViewConfig {
|
|
2090
|
+
export interface SpotterAgentMessageViewConfig extends SpotterAgentEmbedViewConfig {
|
|
2061
2091
|
sessionId: string;
|
|
2062
2092
|
genNo: number;
|
|
2063
2093
|
acSessionId: string;
|
|
2064
2094
|
acGenNo: number;
|
|
2065
2095
|
}
|
|
2066
|
-
declare class ConversationMessage extends TsEmbed {
|
|
2096
|
+
export declare class ConversationMessage extends TsEmbed {
|
|
2067
2097
|
protected viewConfig: SpotterAgentMessageViewConfig;
|
|
2068
2098
|
constructor(container: HTMLElement, viewConfig: SpotterAgentMessageViewConfig);
|
|
2069
2099
|
getIframeSrc(): string;
|
|
@@ -2099,6 +2129,23 @@ export declare class SpotterAgentEmbed {
|
|
|
2099
2129
|
viz: ConversationMessage;
|
|
2100
2130
|
error?: undefined;
|
|
2101
2131
|
}>;
|
|
2132
|
+
/**
|
|
2133
|
+
* Send a message to the conversation service and return only the data.
|
|
2134
|
+
* @param userMessage - The message to send to the conversation service.
|
|
2135
|
+
* @returns The data from the conversation service.
|
|
2136
|
+
*/
|
|
2137
|
+
sendMessageData(userMessage: string): Promise<{
|
|
2138
|
+
error: any;
|
|
2139
|
+
data?: undefined;
|
|
2140
|
+
} | {
|
|
2141
|
+
data: {
|
|
2142
|
+
sessionId: any;
|
|
2143
|
+
genNo: any;
|
|
2144
|
+
acSessionId: any;
|
|
2145
|
+
acGenNo: any;
|
|
2146
|
+
};
|
|
2147
|
+
error?: undefined;
|
|
2148
|
+
}>;
|
|
2102
2149
|
}
|
|
2103
2150
|
/**
|
|
2104
2151
|
* Create a conversation embed, which can be integrated inside
|
|
@@ -2123,7 +2170,6 @@ export declare class SpotterAgentEmbed {
|
|
|
2123
2170
|
export declare class BodylessConversation extends SpotterAgentEmbed {
|
|
2124
2171
|
constructor(viewConfig: BodylessConversationViewConfig);
|
|
2125
2172
|
}
|
|
2126
|
-
export {};
|
|
2127
2173
|
|
|
2128
2174
|
/**
|
|
2129
2175
|
* Copyright (c) 2023
|
|
@@ -3480,6 +3526,22 @@ export interface LiveboardAppEmbedViewConfig {
|
|
|
3480
3526
|
* ```
|
|
3481
3527
|
*/
|
|
3482
3528
|
enableAskSage?: boolean;
|
|
3529
|
+
/**
|
|
3530
|
+
* This flag is used to show or hide checkboxes for including or excluding
|
|
3531
|
+
* the cover and filters pages in the Liveboard PDF.
|
|
3532
|
+
*
|
|
3533
|
+
* Supported embed types: `AppEmbed`, `LiveboardEmbed`
|
|
3534
|
+
* @version SDK: 1.40.0 | ThoughtSpot:10.8.0.cl
|
|
3535
|
+
* @example
|
|
3536
|
+
* ```js
|
|
3537
|
+
* // Replace <EmbedComponent> with embed component name. For example, AppEmbed or LiveboardEmbed
|
|
3538
|
+
* const embed = new <EmbedComponent>('#tsEmbed', {
|
|
3539
|
+
* ... // other embed view config
|
|
3540
|
+
* coverAndFilterOptionInPDF: false,
|
|
3541
|
+
* })
|
|
3542
|
+
* ```
|
|
3543
|
+
*/
|
|
3544
|
+
coverAndFilterOptionInPDF?: boolean;
|
|
3483
3545
|
}
|
|
3484
3546
|
export interface AllEmbedViewConfig extends BaseViewConfig, SearchLiveboardCommonViewConfig, HomePageConfig, LiveboardAppEmbedViewConfig {
|
|
3485
3547
|
}
|
|
@@ -5951,7 +6013,7 @@ export declare enum Param {
|
|
|
5951
6013
|
DataSourceId = "dataSourceId",
|
|
5952
6014
|
preAuthCache = "preAuthCache",
|
|
5953
6015
|
ShowSpotterLimitations = "showSpotterLimitations",
|
|
5954
|
-
CoverAndFilterOptionInPDF = "
|
|
6016
|
+
CoverAndFilterOptionInPDF = "arePdfCoverFilterPageCheckboxesEnabled",
|
|
5955
6017
|
PrimaryAction = "primaryAction",
|
|
5956
6018
|
isSpotterAgentEmbed = "isSpotterAgentEmbed",
|
|
5957
6019
|
IsLiveboardStylingAndGroupingEnabled = "isLiveboardStylingAndGroupingEnabled"
|
|
@@ -7174,7 +7236,23 @@ export declare enum Action {
|
|
|
7174
7236
|
* ```
|
|
7175
7237
|
* @version SDK: 1.37.0 | ThoughtSpot Cloud: 10.8.0.cl
|
|
7176
7238
|
*/
|
|
7177
|
-
CoverAndFilterOptionInPDF = "coverAndFilterOptionInPDF"
|
|
7239
|
+
CoverAndFilterOptionInPDF = "coverAndFilterOptionInPDF",
|
|
7240
|
+
/**
|
|
7241
|
+
* Action ID for hide or disable the
|
|
7242
|
+
* Spotter in conversation training widget.
|
|
7243
|
+
* The Add to Coaching feature is currently in beta
|
|
7244
|
+
* and is disabled by default on embed deployments.
|
|
7245
|
+
* To enable this feature on your instance,
|
|
7246
|
+
* contact ThoughtSpot Support.
|
|
7247
|
+
* @example
|
|
7248
|
+
* ```js
|
|
7249
|
+
* hiddenAction: [Action.InConversationTraining]
|
|
7250
|
+
* disabledActions: [Action.InConversationTraining]
|
|
7251
|
+
*
|
|
7252
|
+
* ```
|
|
7253
|
+
* @version SDK: 1.39.0 | ThoughtSpot Cloud: 10.10.0.cl
|
|
7254
|
+
*/
|
|
7255
|
+
InConversationTraining = "InConversationTraining"
|
|
7178
7256
|
}
|
|
7179
7257
|
export interface AnswerServiceType {
|
|
7180
7258
|
getAnswer?: (offset: number, batchSize: number) => any;
|
|
@@ -8342,13 +8420,14 @@ export declare class AnswerService {
|
|
|
8342
8420
|
*
|
|
8343
8421
|
* @example
|
|
8344
8422
|
* ```js
|
|
8423
|
+
* import { getInitConfig } from '@thoughtspot/visual-embed-sdk';
|
|
8424
|
+
* // Call the getInitConfig method to retrieve the embed configuration
|
|
8345
8425
|
* const config = getInitConfig();
|
|
8426
|
+
* // Log the configuration settings
|
|
8346
8427
|
* console.log(config);
|
|
8347
8428
|
* ```
|
|
8348
|
-
*
|
|
8349
|
-
*
|
|
8350
|
-
* Returns the `EmbedConfig` object, which
|
|
8351
|
-
* contains the configuration settings used to
|
|
8429
|
+
* Returns the link:https://developers.thoughtspot.com/docs/Interface_EmbedConfig[EmbedConfig]
|
|
8430
|
+
* object, which contains the configuration settings used to
|
|
8352
8431
|
* initialize the SDK, including the following:
|
|
8353
8432
|
*
|
|
8354
8433
|
* - `thoughtSpotHost` - ThoughtSpot host URL
|
|
@@ -8357,9 +8436,10 @@ export declare class AnswerService {
|
|
|
8357
8436
|
* - `customizations` - Style, text, and icon customization settings
|
|
8358
8437
|
* that were applied during the SDK initialization.
|
|
8359
8438
|
*
|
|
8360
|
-
*
|
|
8361
|
-
*
|
|
8439
|
+
* The following JSON output shows the embed configuration
|
|
8440
|
+
* settings returned from the code in the previous example:
|
|
8362
8441
|
*
|
|
8442
|
+
* @example
|
|
8363
8443
|
* ```json
|
|
8364
8444
|
* {
|
|
8365
8445
|
* "thoughtSpotHost": "https://{ThoughtSpot-Host}",
|
|
@@ -8381,7 +8461,7 @@ export declare class AnswerService {
|
|
|
8381
8461
|
* "authTriggerContainer": "#your-own-div"
|
|
8382
8462
|
* }
|
|
8383
8463
|
* ```
|
|
8384
|
-
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.
|
|
8464
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw, and later
|
|
8385
8465
|
* @group Global methods
|
|
8386
8466
|
*/
|
|
8387
8467
|
export declare const getEmbedConfig: () => EmbedConfig;
|
|
@@ -233,33 +233,42 @@ export const SpotterEmbed: React.ForwardRefExoticComponent<SpotterEmbedProps & R
|
|
|
233
233
|
* ```
|
|
234
234
|
*/
|
|
235
235
|
export const ConversationEmbed: React.ForwardRefExoticComponent<ConversationEmbedProps & React.RefAttributes<_ConversationEmbed>>;
|
|
236
|
-
|
|
236
|
+
/**
|
|
237
|
+
* React component for individual conversation messages from SpotterAgent.
|
|
238
|
+
* This component is used internally by the useSpotterAgent hook.
|
|
239
|
+
* @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
|
|
240
|
+
*/
|
|
241
|
+
interface ConversationMessageProps extends EmbedProps, SpotterAgentMessageViewConfig {
|
|
237
242
|
}
|
|
243
|
+
export const ConversationMessage: React.ForwardRefExoticComponent<ConversationMessageProps & React.RefAttributes<_ConversationMessage>>;
|
|
238
244
|
/**
|
|
239
|
-
* React component for
|
|
240
|
-
*
|
|
245
|
+
* React component for displaying individual conversation messages from SpotterAgent.
|
|
246
|
+
*
|
|
247
|
+
* This component renders a single message response from your ThoughtSpot conversation,
|
|
248
|
+
* showing charts, visualizations, or text responses based on the user's query.
|
|
249
|
+
*
|
|
241
250
|
* @example
|
|
242
251
|
* ```tsx
|
|
243
|
-
*
|
|
244
|
-
*
|
|
252
|
+
* const { sendMessage } = useSpotterAgent({ worksheetId: 'worksheetId' });
|
|
253
|
+
* const result = await sendMessage('show me sales by region');
|
|
245
254
|
*
|
|
246
|
-
*
|
|
247
|
-
*
|
|
248
|
-
*
|
|
249
|
-
* document.body.appendChild(container);
|
|
250
|
-
* }
|
|
251
|
-
* };
|
|
255
|
+
* if (!result.error) {
|
|
256
|
+
* // Simple usage - just pass the message data
|
|
257
|
+
* <SpotterMessage message={result.message} />
|
|
252
258
|
*
|
|
253
|
-
*
|
|
254
|
-
*
|
|
255
|
-
*
|
|
256
|
-
*
|
|
257
|
-
*
|
|
258
|
-
* );
|
|
259
|
+
* // With optional query for context
|
|
260
|
+
* <SpotterMessage
|
|
261
|
+
* message={result.message}
|
|
262
|
+
* query={result.query}
|
|
263
|
+
* />
|
|
259
264
|
* }
|
|
260
265
|
* ```
|
|
266
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.11.0.cl
|
|
261
267
|
*/
|
|
262
|
-
export const
|
|
268
|
+
export const SpotterMessage: React.ForwardRefExoticComponent<{
|
|
269
|
+
message: SpotterAgentMessageViewConfig;
|
|
270
|
+
query?: string;
|
|
271
|
+
} & Omit<EmbedProps, keyof SpotterAgentMessageViewConfig> & React.RefAttributes<_ConversationMessage>>;
|
|
263
272
|
/**
|
|
264
273
|
* React component for PreRendered Conversation embed.
|
|
265
274
|
*
|
|
@@ -279,7 +288,7 @@ export const SpotterAgentEmbed: React.ForwardRefExoticComponent<SpotterAgentEmbe
|
|
|
279
288
|
* ```
|
|
280
289
|
*/
|
|
281
290
|
export const PreRenderedConversationEmbed: React.ForwardRefExoticComponent<SpotterEmbedProps & PreRenderProps & React.RefAttributes<_SpotterEmbed>>;
|
|
282
|
-
type EmbedComponent = typeof SearchEmbed | typeof AppEmbed | typeof LiveboardEmbed | typeof SearchBarEmbed | typeof SageEmbed | typeof
|
|
291
|
+
type EmbedComponent = typeof SearchEmbed | typeof AppEmbed | typeof LiveboardEmbed | typeof SearchBarEmbed | typeof SageEmbed | typeof ConversationMessage | typeof SpotterMessage | typeof SpotterEmbed | typeof ConversationEmbed;
|
|
283
292
|
/**
|
|
284
293
|
* Get a reference to the embed component to trigger events on the component.
|
|
285
294
|
* @example
|
|
@@ -311,6 +320,48 @@ export function useEmbedRef<T extends EmbedComponent>(): React.MutableRefObject<
|
|
|
311
320
|
* @version SDK: 1.36.2 | ThoughtSpot: *
|
|
312
321
|
*/
|
|
313
322
|
export function useInit(config: EmbedConfig): React.MutableRefObject<AuthEventEmitter>;
|
|
323
|
+
/**
|
|
324
|
+
* React hook for interacting with SpotterAgent AI conversations.
|
|
325
|
+
*
|
|
326
|
+
* This hook provides a sendMessage function that allows you to send natural language
|
|
327
|
+
* queries to your data and get back AI-generated responses with visualizations.
|
|
328
|
+
*
|
|
329
|
+
* @param config - Configuration object containing worksheetId and other options
|
|
330
|
+
* @returns Object with sendMessage function that returns conversation results
|
|
331
|
+
* @example
|
|
332
|
+
* ```tsx
|
|
333
|
+
* const { sendMessage } = useSpotterAgent({ worksheetId: 'worksheetId' });
|
|
334
|
+
*
|
|
335
|
+
* const handleQuery = async () => {
|
|
336
|
+
* const result = await sendMessage('show me sales by region');
|
|
337
|
+
*
|
|
338
|
+
* if (!result.error) {
|
|
339
|
+
* // Display the message response
|
|
340
|
+
* <SpotterMessage message={result.message} />
|
|
341
|
+
* } else {
|
|
342
|
+
* console.error('Error:', result.error);
|
|
343
|
+
* }
|
|
344
|
+
* };
|
|
345
|
+
* ```
|
|
346
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.11.0.cl
|
|
347
|
+
*/
|
|
348
|
+
export function useSpotterAgent(config: SpotterAgentEmbedViewConfig): {
|
|
349
|
+
sendMessage: (query: string) => Promise<{
|
|
350
|
+
error: any;
|
|
351
|
+
query?: undefined;
|
|
352
|
+
message?: undefined;
|
|
353
|
+
} | {
|
|
354
|
+
query: string;
|
|
355
|
+
message: {
|
|
356
|
+
worksheetId: string;
|
|
357
|
+
sessionId: any;
|
|
358
|
+
genNo: any;
|
|
359
|
+
acSessionId: any;
|
|
360
|
+
acGenNo: any;
|
|
361
|
+
};
|
|
362
|
+
error?: undefined;
|
|
363
|
+
}>;
|
|
364
|
+
};
|
|
314
365
|
|
|
315
366
|
export declare let loggedInStatus: boolean;
|
|
316
367
|
export declare let samlAuthWindow: Window;
|
|
@@ -1900,23 +1951,6 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
1900
1951
|
* })
|
|
1901
1952
|
*/
|
|
1902
1953
|
dataSourceId?: string;
|
|
1903
|
-
/**
|
|
1904
|
-
* This flag is for show/hide checkboxes for include or exclude
|
|
1905
|
-
* cover page and filters in the Liveboard PDF.
|
|
1906
|
-
*
|
|
1907
|
-
* Supported embed types: `LiveboardEmbed`
|
|
1908
|
-
* @version SDK: 1.37.0 | ThoughtSpot:10.8.0.cl
|
|
1909
|
-
* @default true
|
|
1910
|
-
* Supported embed types: `LiveboardEmbed`
|
|
1911
|
-
* @example
|
|
1912
|
-
* ```js
|
|
1913
|
-
* const embed = new LiveboardEmbed('#tsEmbed', {
|
|
1914
|
-
* ... //other embed view config
|
|
1915
|
-
* coverAndFilterOptionInPDF: false,
|
|
1916
|
-
* })
|
|
1917
|
-
* ```
|
|
1918
|
-
*/
|
|
1919
|
-
coverAndFilterOptionInPDF?: boolean;
|
|
1920
1954
|
/**
|
|
1921
1955
|
* The list of tab IDs to hide from the embedded.
|
|
1922
1956
|
* This Tabs will be hidden from their respective LBs.
|
|
@@ -2034,10 +2068,6 @@ export interface SpotterAgentEmbedViewConfig extends Omit<BaseViewConfig, 'prima
|
|
|
2034
2068
|
* The ID of the worksheet to use for the conversation.
|
|
2035
2069
|
*/
|
|
2036
2070
|
worksheetId: string;
|
|
2037
|
-
/**
|
|
2038
|
-
* Optional CSS class name to add to the container div.
|
|
2039
|
-
*/
|
|
2040
|
-
containerClassName?: string;
|
|
2041
2071
|
}
|
|
2042
2072
|
/**
|
|
2043
2073
|
* Configuration for conversation options.
|
|
@@ -2047,13 +2077,13 @@ export interface SpotterAgentEmbedViewConfig extends Omit<BaseViewConfig, 'prima
|
|
|
2047
2077
|
*/
|
|
2048
2078
|
export interface BodylessConversationViewConfig extends SpotterAgentEmbedViewConfig {
|
|
2049
2079
|
}
|
|
2050
|
-
interface SpotterAgentMessageViewConfig extends SpotterAgentEmbedViewConfig {
|
|
2080
|
+
export interface SpotterAgentMessageViewConfig extends SpotterAgentEmbedViewConfig {
|
|
2051
2081
|
sessionId: string;
|
|
2052
2082
|
genNo: number;
|
|
2053
2083
|
acSessionId: string;
|
|
2054
2084
|
acGenNo: number;
|
|
2055
2085
|
}
|
|
2056
|
-
declare class ConversationMessage extends TsEmbed {
|
|
2086
|
+
export declare class ConversationMessage extends TsEmbed {
|
|
2057
2087
|
protected viewConfig: SpotterAgentMessageViewConfig;
|
|
2058
2088
|
constructor(container: HTMLElement, viewConfig: SpotterAgentMessageViewConfig);
|
|
2059
2089
|
getIframeSrc(): string;
|
|
@@ -2089,6 +2119,23 @@ export declare class SpotterAgentEmbed {
|
|
|
2089
2119
|
viz: ConversationMessage;
|
|
2090
2120
|
error?: undefined;
|
|
2091
2121
|
}>;
|
|
2122
|
+
/**
|
|
2123
|
+
* Send a message to the conversation service and return only the data.
|
|
2124
|
+
* @param userMessage - The message to send to the conversation service.
|
|
2125
|
+
* @returns The data from the conversation service.
|
|
2126
|
+
*/
|
|
2127
|
+
sendMessageData(userMessage: string): Promise<{
|
|
2128
|
+
error: any;
|
|
2129
|
+
data?: undefined;
|
|
2130
|
+
} | {
|
|
2131
|
+
data: {
|
|
2132
|
+
sessionId: any;
|
|
2133
|
+
genNo: any;
|
|
2134
|
+
acSessionId: any;
|
|
2135
|
+
acGenNo: any;
|
|
2136
|
+
};
|
|
2137
|
+
error?: undefined;
|
|
2138
|
+
}>;
|
|
2092
2139
|
}
|
|
2093
2140
|
/**
|
|
2094
2141
|
* Create a conversation embed, which can be integrated inside
|
|
@@ -2113,7 +2160,6 @@ export declare class SpotterAgentEmbed {
|
|
|
2113
2160
|
export declare class BodylessConversation extends SpotterAgentEmbed {
|
|
2114
2161
|
constructor(viewConfig: BodylessConversationViewConfig);
|
|
2115
2162
|
}
|
|
2116
|
-
export {};
|
|
2117
2163
|
|
|
2118
2164
|
/**
|
|
2119
2165
|
* Copyright (c) 2023
|
|
@@ -3470,6 +3516,22 @@ export interface LiveboardAppEmbedViewConfig {
|
|
|
3470
3516
|
* ```
|
|
3471
3517
|
*/
|
|
3472
3518
|
enableAskSage?: boolean;
|
|
3519
|
+
/**
|
|
3520
|
+
* This flag is used to show or hide checkboxes for including or excluding
|
|
3521
|
+
* the cover and filters pages in the Liveboard PDF.
|
|
3522
|
+
*
|
|
3523
|
+
* Supported embed types: `AppEmbed`, `LiveboardEmbed`
|
|
3524
|
+
* @version SDK: 1.40.0 | ThoughtSpot:10.8.0.cl
|
|
3525
|
+
* @example
|
|
3526
|
+
* ```js
|
|
3527
|
+
* // Replace <EmbedComponent> with embed component name. For example, AppEmbed or LiveboardEmbed
|
|
3528
|
+
* const embed = new <EmbedComponent>('#tsEmbed', {
|
|
3529
|
+
* ... // other embed view config
|
|
3530
|
+
* coverAndFilterOptionInPDF: false,
|
|
3531
|
+
* })
|
|
3532
|
+
* ```
|
|
3533
|
+
*/
|
|
3534
|
+
coverAndFilterOptionInPDF?: boolean;
|
|
3473
3535
|
}
|
|
3474
3536
|
export interface AllEmbedViewConfig extends BaseViewConfig, SearchLiveboardCommonViewConfig, HomePageConfig, LiveboardAppEmbedViewConfig {
|
|
3475
3537
|
}
|
|
@@ -5941,7 +6003,7 @@ export declare enum Param {
|
|
|
5941
6003
|
DataSourceId = "dataSourceId",
|
|
5942
6004
|
preAuthCache = "preAuthCache",
|
|
5943
6005
|
ShowSpotterLimitations = "showSpotterLimitations",
|
|
5944
|
-
CoverAndFilterOptionInPDF = "
|
|
6006
|
+
CoverAndFilterOptionInPDF = "arePdfCoverFilterPageCheckboxesEnabled",
|
|
5945
6007
|
PrimaryAction = "primaryAction",
|
|
5946
6008
|
isSpotterAgentEmbed = "isSpotterAgentEmbed",
|
|
5947
6009
|
IsLiveboardStylingAndGroupingEnabled = "isLiveboardStylingAndGroupingEnabled"
|
|
@@ -7164,7 +7226,23 @@ export declare enum Action {
|
|
|
7164
7226
|
* ```
|
|
7165
7227
|
* @version SDK: 1.37.0 | ThoughtSpot Cloud: 10.8.0.cl
|
|
7166
7228
|
*/
|
|
7167
|
-
CoverAndFilterOptionInPDF = "coverAndFilterOptionInPDF"
|
|
7229
|
+
CoverAndFilterOptionInPDF = "coverAndFilterOptionInPDF",
|
|
7230
|
+
/**
|
|
7231
|
+
* Action ID for hide or disable the
|
|
7232
|
+
* Spotter in conversation training widget.
|
|
7233
|
+
* The Add to Coaching feature is currently in beta
|
|
7234
|
+
* and is disabled by default on embed deployments.
|
|
7235
|
+
* To enable this feature on your instance,
|
|
7236
|
+
* contact ThoughtSpot Support.
|
|
7237
|
+
* @example
|
|
7238
|
+
* ```js
|
|
7239
|
+
* hiddenAction: [Action.InConversationTraining]
|
|
7240
|
+
* disabledActions: [Action.InConversationTraining]
|
|
7241
|
+
*
|
|
7242
|
+
* ```
|
|
7243
|
+
* @version SDK: 1.39.0 | ThoughtSpot Cloud: 10.10.0.cl
|
|
7244
|
+
*/
|
|
7245
|
+
InConversationTraining = "InConversationTraining"
|
|
7168
7246
|
}
|
|
7169
7247
|
export interface AnswerServiceType {
|
|
7170
7248
|
getAnswer?: (offset: number, batchSize: number) => any;
|
|
@@ -8733,13 +8811,14 @@ export declare function resetCachedPreauthInfo(): void;
|
|
|
8733
8811
|
*
|
|
8734
8812
|
* @example
|
|
8735
8813
|
* ```js
|
|
8814
|
+
* import { getInitConfig } from '@thoughtspot/visual-embed-sdk';
|
|
8815
|
+
* // Call the getInitConfig method to retrieve the embed configuration
|
|
8736
8816
|
* const config = getInitConfig();
|
|
8817
|
+
* // Log the configuration settings
|
|
8737
8818
|
* console.log(config);
|
|
8738
8819
|
* ```
|
|
8739
|
-
*
|
|
8740
|
-
*
|
|
8741
|
-
* Returns the `EmbedConfig` object, which
|
|
8742
|
-
* contains the configuration settings used to
|
|
8820
|
+
* Returns the link:https://developers.thoughtspot.com/docs/Interface_EmbedConfig[EmbedConfig]
|
|
8821
|
+
* object, which contains the configuration settings used to
|
|
8743
8822
|
* initialize the SDK, including the following:
|
|
8744
8823
|
*
|
|
8745
8824
|
* - `thoughtSpotHost` - ThoughtSpot host URL
|
|
@@ -8748,9 +8827,10 @@ export declare function resetCachedPreauthInfo(): void;
|
|
|
8748
8827
|
* - `customizations` - Style, text, and icon customization settings
|
|
8749
8828
|
* that were applied during the SDK initialization.
|
|
8750
8829
|
*
|
|
8751
|
-
*
|
|
8752
|
-
*
|
|
8830
|
+
* The following JSON output shows the embed configuration
|
|
8831
|
+
* settings returned from the code in the previous example:
|
|
8753
8832
|
*
|
|
8833
|
+
* @example
|
|
8754
8834
|
* ```json
|
|
8755
8835
|
* {
|
|
8756
8836
|
* "thoughtSpotHost": "https://{ThoughtSpot-Host}",
|
|
@@ -8772,7 +8852,7 @@ export declare function resetCachedPreauthInfo(): void;
|
|
|
8772
8852
|
* "authTriggerContainer": "#your-own-div"
|
|
8773
8853
|
* }
|
|
8774
8854
|
* ```
|
|
8775
|
-
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.
|
|
8855
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw, and later
|
|
8776
8856
|
* @group Global methods
|
|
8777
8857
|
*/
|
|
8778
8858
|
export declare const getEmbedConfig: () => EmbedConfig;
|