@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.
Files changed (181) hide show
  1. package/cjs/package.json +1 -1
  2. package/cjs/src/config.spec.js +9 -0
  3. package/cjs/src/config.spec.js.map +1 -1
  4. package/cjs/src/embed/app.d.ts.map +1 -1
  5. package/cjs/src/embed/app.js +2 -1
  6. package/cjs/src/embed/app.js.map +1 -1
  7. package/cjs/src/embed/app.spec.js +18 -8
  8. package/cjs/src/embed/app.spec.js.map +1 -1
  9. package/cjs/src/embed/bodyless-conversation.d.ts +19 -7
  10. package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
  11. package/cjs/src/embed/bodyless-conversation.js +24 -4
  12. package/cjs/src/embed/bodyless-conversation.js.map +1 -1
  13. package/cjs/src/embed/bodyless-conversation.spec.js +8 -190
  14. package/cjs/src/embed/bodyless-conversation.spec.js.map +1 -1
  15. package/cjs/src/embed/conversation.spec.js +28 -0
  16. package/cjs/src/embed/conversation.spec.js.map +1 -1
  17. package/cjs/src/embed/embedConfig.d.ts +9 -7
  18. package/cjs/src/embed/embedConfig.d.ts.map +1 -1
  19. package/cjs/src/embed/embedConfig.js +9 -7
  20. package/cjs/src/embed/embedConfig.js.map +1 -1
  21. package/cjs/src/embed/liveboard.d.ts +0 -17
  22. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  23. package/cjs/src/embed/liveboard.js +2 -4
  24. package/cjs/src/embed/liveboard.js.map +1 -1
  25. package/cjs/src/embed/liveboard.spec.js +12 -11
  26. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  27. package/cjs/src/embed/ts-embed.d.ts +5 -0
  28. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  29. package/cjs/src/embed/ts-embed.js +16 -1
  30. package/cjs/src/embed/ts-embed.js.map +1 -1
  31. package/cjs/src/embed/ts-embed.spec.js +164 -0
  32. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  33. package/cjs/src/errors.d.ts +1 -0
  34. package/cjs/src/errors.d.ts.map +1 -1
  35. package/cjs/src/errors.js +1 -0
  36. package/cjs/src/errors.js.map +1 -1
  37. package/cjs/src/pages/embed-test.page.d.ts +8 -0
  38. package/cjs/src/pages/embed-test.page.d.ts.map +1 -0
  39. package/cjs/src/pages/embed-test.page.js +20 -0
  40. package/cjs/src/pages/embed-test.page.js.map +1 -0
  41. package/cjs/src/pages/home.page.d.ts +6 -0
  42. package/cjs/src/pages/home.page.d.ts.map +1 -0
  43. package/cjs/src/pages/home.page.js +12 -0
  44. package/cjs/src/pages/home.page.js.map +1 -0
  45. package/cjs/src/pages/login.page.d.ts +15 -0
  46. package/cjs/src/pages/login.page.d.ts.map +1 -0
  47. package/cjs/src/pages/login.page.js +22 -0
  48. package/cjs/src/pages/login.page.js.map +1 -0
  49. package/cjs/src/react/all-types-export.d.ts +1 -1
  50. package/cjs/src/react/all-types-export.d.ts.map +1 -1
  51. package/cjs/src/react/all-types-export.js +3 -2
  52. package/cjs/src/react/all-types-export.js.map +1 -1
  53. package/cjs/src/react/index.d.ts +71 -20
  54. package/cjs/src/react/index.d.ts.map +1 -1
  55. package/cjs/src/react/index.js +79 -42
  56. package/cjs/src/react/index.js.map +1 -1
  57. package/cjs/src/react/index.spec.js +436 -100
  58. package/cjs/src/react/index.spec.js.map +1 -1
  59. package/cjs/src/tests/auth.test.d.ts +1 -0
  60. package/cjs/src/tests/auth.test.d.ts.map +1 -0
  61. package/cjs/src/tests/auth.test.js +1 -0
  62. package/cjs/src/tests/auth.test.js.map +1 -0
  63. package/cjs/src/tests/e2e/auth.spec.d.ts +2 -0
  64. package/cjs/src/tests/e2e/auth.spec.d.ts.map +1 -0
  65. package/cjs/src/tests/e2e/auth.spec.js +54 -0
  66. package/cjs/src/tests/e2e/auth.spec.js.map +1 -0
  67. package/cjs/src/types.d.ts +34 -2
  68. package/cjs/src/types.d.ts.map +1 -1
  69. package/cjs/src/types.js +17 -1
  70. package/cjs/src/types.js.map +1 -1
  71. package/cjs/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
  72. package/cjs/src/utils/graphql/nlsService/conversation-service.js +2 -0
  73. package/cjs/src/utils/graphql/nlsService/conversation-service.js.map +1 -1
  74. package/cjs/src/utils.spec.js +25 -0
  75. package/cjs/src/utils.spec.js.map +1 -1
  76. package/dist/index-2QHwuA-G.js +7371 -0
  77. package/dist/index-Cj4BVGHL.js +7371 -0
  78. package/dist/index-DUaG1OG2.js +7447 -0
  79. package/dist/{index-JaFaxrvQ.js → index-DnIvX1FR.js} +1 -1
  80. package/dist/index-Fhk1V_Gw.js +7371 -0
  81. package/dist/index-OuiZF3zE.js +7371 -0
  82. package/dist/src/embed/app.d.ts.map +1 -1
  83. package/dist/src/embed/bodyless-conversation.d.ts +19 -7
  84. package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
  85. package/dist/src/embed/embedConfig.d.ts +9 -7
  86. package/dist/src/embed/embedConfig.d.ts.map +1 -1
  87. package/dist/src/embed/liveboard.d.ts +0 -17
  88. package/dist/src/embed/liveboard.d.ts.map +1 -1
  89. package/dist/src/embed/ts-embed.d.ts +5 -0
  90. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  91. package/dist/src/errors.d.ts +1 -0
  92. package/dist/src/errors.d.ts.map +1 -1
  93. package/dist/src/react/all-types-export.d.ts +1 -1
  94. package/dist/src/react/all-types-export.d.ts.map +1 -1
  95. package/dist/src/react/index.d.ts +71 -20
  96. package/dist/src/react/index.d.ts.map +1 -1
  97. package/dist/src/types.d.ts +34 -2
  98. package/dist/src/types.d.ts.map +1 -1
  99. package/dist/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
  100. package/dist/tsembed-react.es.js +157 -68
  101. package/dist/tsembed-react.js +157 -66
  102. package/dist/tsembed.es.js +74 -20
  103. package/dist/tsembed.js +73 -19
  104. package/dist/visual-embed-sdk-react-full.d.ts +132 -52
  105. package/dist/visual-embed-sdk-react.d.ts +132 -52
  106. package/dist/visual-embed-sdk.d.ts +62 -33
  107. package/lib/package.json +1 -1
  108. package/lib/src/config.spec.js +9 -0
  109. package/lib/src/config.spec.js.map +1 -1
  110. package/lib/src/embed/app.d.ts.map +1 -1
  111. package/lib/src/embed/app.js +2 -1
  112. package/lib/src/embed/app.js.map +1 -1
  113. package/lib/src/embed/app.spec.js +19 -9
  114. package/lib/src/embed/app.spec.js.map +1 -1
  115. package/lib/src/embed/bodyless-conversation.d.ts +19 -7
  116. package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
  117. package/lib/src/embed/bodyless-conversation.js +23 -4
  118. package/lib/src/embed/bodyless-conversation.js.map +1 -1
  119. package/lib/src/embed/bodyless-conversation.spec.js +9 -191
  120. package/lib/src/embed/bodyless-conversation.spec.js.map +1 -1
  121. package/lib/src/embed/conversation.spec.js +30 -2
  122. package/lib/src/embed/conversation.spec.js.map +1 -1
  123. package/lib/src/embed/embedConfig.d.ts +9 -7
  124. package/lib/src/embed/embedConfig.d.ts.map +1 -1
  125. package/lib/src/embed/embedConfig.js +9 -7
  126. package/lib/src/embed/embedConfig.js.map +1 -1
  127. package/lib/src/embed/liveboard.d.ts +0 -17
  128. package/lib/src/embed/liveboard.d.ts.map +1 -1
  129. package/lib/src/embed/liveboard.js +2 -4
  130. package/lib/src/embed/liveboard.js.map +1 -1
  131. package/lib/src/embed/liveboard.spec.js +12 -11
  132. package/lib/src/embed/liveboard.spec.js.map +1 -1
  133. package/lib/src/embed/ts-embed.d.ts +5 -0
  134. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  135. package/lib/src/embed/ts-embed.js +16 -1
  136. package/lib/src/embed/ts-embed.js.map +1 -1
  137. package/lib/src/embed/ts-embed.spec.js +164 -0
  138. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  139. package/lib/src/errors.d.ts +1 -0
  140. package/lib/src/errors.d.ts.map +1 -1
  141. package/lib/src/errors.js +1 -0
  142. package/lib/src/errors.js.map +1 -1
  143. package/lib/src/react/all-types-export.d.ts +1 -1
  144. package/lib/src/react/all-types-export.d.ts.map +1 -1
  145. package/lib/src/react/all-types-export.js +1 -1
  146. package/lib/src/react/all-types-export.js.map +1 -1
  147. package/lib/src/react/index.d.ts +71 -20
  148. package/lib/src/react/index.d.ts.map +1 -1
  149. package/lib/src/react/index.js +79 -43
  150. package/lib/src/react/index.js.map +1 -1
  151. package/lib/src/react/index.spec.js +439 -103
  152. package/lib/src/react/index.spec.js.map +1 -1
  153. package/lib/src/types.d.ts +34 -2
  154. package/lib/src/types.d.ts.map +1 -1
  155. package/lib/src/types.js +17 -1
  156. package/lib/src/types.js.map +1 -1
  157. package/lib/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
  158. package/lib/src/utils/graphql/nlsService/conversation-service.js +2 -0
  159. package/lib/src/utils/graphql/nlsService/conversation-service.js.map +1 -1
  160. package/lib/src/utils.spec.js +26 -1
  161. package/lib/src/utils.spec.js.map +1 -1
  162. package/lib/src/visual-embed-sdk.d.ts +62 -33
  163. package/package.json +1 -1
  164. package/src/config.spec.ts +11 -0
  165. package/src/embed/app.spec.ts +36 -23
  166. package/src/embed/app.ts +2 -0
  167. package/src/embed/bodyless-conversation.spec.ts +9 -203
  168. package/src/embed/bodyless-conversation.ts +24 -10
  169. package/src/embed/conversation.spec.ts +40 -2
  170. package/src/embed/embedConfig.ts +10 -8
  171. package/src/embed/liveboard.spec.ts +5 -4
  172. package/src/embed/liveboard.ts +2 -22
  173. package/src/embed/ts-embed.spec.ts +225 -0
  174. package/src/embed/ts-embed.ts +19 -0
  175. package/src/errors.ts +1 -0
  176. package/src/react/all-types-export.ts +2 -1
  177. package/src/react/index.spec.tsx +556 -157
  178. package/src/react/index.tsx +117 -51
  179. package/src/types.ts +75 -43
  180. package/src/utils/graphql/nlsService/conversation-service.ts +2 -0
  181. 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
- interface SpotterAgentEmbedProps extends EmbedProps, SpotterAgentEmbedViewConfig {
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 SpotterAgent embed, which can be integrated inside
240
- * chatbots or other conversational interfaces.
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
- * function SpotterAgent() {
244
- * const ref = useRef();
252
+ * const { sendMessage } = useSpotterAgent({ worksheetId: 'worksheetId' });
253
+ * const result = await sendMessage('show me sales by region');
245
254
  *
246
- * const handleSendMessage = async () => {
247
- * const { container, error } = await ref.current.sendMessage('show me sales by region');
248
- * if (container) {
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
- * return (
254
- * <div>
255
- * <SpotterAgentEmbed ref={ref} worksheetId="worksheetId" />
256
- * <button onClick={handleSendMessage}>Send Message</button>
257
- * </div>
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 SpotterAgentEmbed: React.ForwardRefExoticComponent<SpotterAgentEmbedProps & React.RefAttributes<_SpotterAgentEmbed>>;
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 SpotterAgentEmbed | typeof SpotterEmbed | typeof ConversationEmbed;
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 = "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
- * @example
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
- * For a comprehensive list of embed configuration settings,
8361
- * see link:https://developers.thoughtspot.com/docs/Interface_EmbedConfig[Developer Documentation].
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.cl, and later
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
- interface SpotterAgentEmbedProps extends EmbedProps, SpotterAgentEmbedViewConfig {
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 SpotterAgent embed, which can be integrated inside
240
- * chatbots or other conversational interfaces.
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
- * function SpotterAgent() {
244
- * const ref = useRef();
252
+ * const { sendMessage } = useSpotterAgent({ worksheetId: 'worksheetId' });
253
+ * const result = await sendMessage('show me sales by region');
245
254
  *
246
- * const handleSendMessage = async () => {
247
- * const { container, error } = await ref.current.sendMessage('show me sales by region');
248
- * if (container) {
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
- * return (
254
- * <div>
255
- * <SpotterAgentEmbed ref={ref} worksheetId="worksheetId" />
256
- * <button onClick={handleSendMessage}>Send Message</button>
257
- * </div>
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 SpotterAgentEmbed: React.ForwardRefExoticComponent<SpotterAgentEmbedProps & React.RefAttributes<_SpotterAgentEmbed>>;
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 SpotterAgentEmbed | typeof SpotterEmbed | typeof ConversationEmbed;
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 = "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
- * @example
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
- * For a comprehensive list of embed configuration settings,
8752
- * see link:https://developers.thoughtspot.com/docs/Interface_EmbedConfig[Developer Documentation].
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.cl, and later
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;