@thoughtspot/visual-embed-sdk 1.39.1 → 1.39.2-alpha.2

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 (190) 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 +75 -15
  5. package/cjs/src/embed/app.d.ts.map +1 -1
  6. package/cjs/src/embed/app.js +69 -9
  7. package/cjs/src/embed/app.js.map +1 -1
  8. package/cjs/src/embed/app.spec.js +374 -12
  9. package/cjs/src/embed/app.spec.js.map +1 -1
  10. package/cjs/src/embed/bodyless-conversation.d.ts +19 -7
  11. package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
  12. package/cjs/src/embed/bodyless-conversation.js +24 -4
  13. package/cjs/src/embed/bodyless-conversation.js.map +1 -1
  14. package/cjs/src/embed/bodyless-conversation.spec.js +8 -190
  15. package/cjs/src/embed/bodyless-conversation.spec.js.map +1 -1
  16. package/cjs/src/embed/conversation.spec.js +28 -0
  17. package/cjs/src/embed/conversation.spec.js.map +1 -1
  18. package/cjs/src/embed/embedConfig.d.ts +9 -7
  19. package/cjs/src/embed/embedConfig.d.ts.map +1 -1
  20. package/cjs/src/embed/embedConfig.js +9 -7
  21. package/cjs/src/embed/embedConfig.js.map +1 -1
  22. package/cjs/src/embed/liveboard.d.ts +56 -17
  23. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  24. package/cjs/src/embed/liveboard.js +48 -4
  25. package/cjs/src/embed/liveboard.js.map +1 -1
  26. package/cjs/src/embed/liveboard.spec.js +215 -11
  27. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  28. package/cjs/src/embed/ts-embed.d.ts +5 -0
  29. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  30. package/cjs/src/embed/ts-embed.js +16 -1
  31. package/cjs/src/embed/ts-embed.js.map +1 -1
  32. package/cjs/src/embed/ts-embed.spec.js +164 -0
  33. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  34. package/cjs/src/errors.d.ts +1 -0
  35. package/cjs/src/errors.d.ts.map +1 -1
  36. package/cjs/src/errors.js +1 -0
  37. package/cjs/src/errors.js.map +1 -1
  38. package/cjs/src/index.d.ts +2 -2
  39. package/cjs/src/index.d.ts.map +1 -1
  40. package/cjs/src/index.js +2 -1
  41. package/cjs/src/index.js.map +1 -1
  42. package/cjs/src/react/all-types-export.d.ts +1 -1
  43. package/cjs/src/react/all-types-export.d.ts.map +1 -1
  44. package/cjs/src/react/all-types-export.js +3 -2
  45. package/cjs/src/react/all-types-export.js.map +1 -1
  46. package/cjs/src/react/index.d.ts +71 -20
  47. package/cjs/src/react/index.d.ts.map +1 -1
  48. package/cjs/src/react/index.js +79 -42
  49. package/cjs/src/react/index.js.map +1 -1
  50. package/cjs/src/react/index.spec.js +436 -100
  51. package/cjs/src/react/index.spec.js.map +1 -1
  52. package/cjs/src/types.d.ts +80 -6
  53. package/cjs/src/types.d.ts.map +1 -1
  54. package/cjs/src/types.js +45 -1
  55. package/cjs/src/types.js.map +1 -1
  56. package/cjs/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
  57. package/cjs/src/utils/graphql/nlsService/conversation-service.js +2 -0
  58. package/cjs/src/utils/graphql/nlsService/conversation-service.js.map +1 -1
  59. package/cjs/src/utils/processTrigger.js +2 -1
  60. package/cjs/src/utils/processTrigger.js.map +1 -1
  61. package/cjs/src/utils.d.ts +6 -0
  62. package/cjs/src/utils.d.ts.map +1 -1
  63. package/cjs/src/utils.js +23 -3
  64. package/cjs/src/utils.js.map +1 -1
  65. package/cjs/src/utils.spec.js +237 -1
  66. package/cjs/src/utils.spec.js.map +1 -1
  67. package/dist/{index-JaFaxrvQ.js → index-CmEQfuE3.js} +1 -1
  68. package/dist/index-DeFzsyFF.js +7371 -0
  69. package/dist/index-Dpf0rd6w.js +7371 -0
  70. package/dist/index-UuEbsISo.js +7447 -0
  71. package/dist/index-e3Uw3YFO.js +7371 -0
  72. package/dist/src/embed/app.d.ts +75 -15
  73. package/dist/src/embed/app.d.ts.map +1 -1
  74. package/dist/src/embed/bodyless-conversation.d.ts +19 -7
  75. package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
  76. package/dist/src/embed/embedConfig.d.ts +9 -7
  77. package/dist/src/embed/embedConfig.d.ts.map +1 -1
  78. package/dist/src/embed/liveboard.d.ts +56 -17
  79. package/dist/src/embed/liveboard.d.ts.map +1 -1
  80. package/dist/src/embed/ts-embed.d.ts +5 -0
  81. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  82. package/dist/src/errors.d.ts +1 -0
  83. package/dist/src/errors.d.ts.map +1 -1
  84. package/dist/src/index.d.ts +2 -2
  85. package/dist/src/index.d.ts.map +1 -1
  86. package/dist/src/react/all-types-export.d.ts +1 -1
  87. package/dist/src/react/all-types-export.d.ts.map +1 -1
  88. package/dist/src/react/index.d.ts +71 -20
  89. package/dist/src/react/index.d.ts.map +1 -1
  90. package/dist/src/types.d.ts +80 -6
  91. package/dist/src/types.d.ts.map +1 -1
  92. package/dist/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
  93. package/dist/src/utils.d.ts +6 -0
  94. package/dist/src/utils.d.ts.map +1 -1
  95. package/dist/tsembed-react.es.js +320 -78
  96. package/dist/tsembed-react.js +320 -76
  97. package/dist/tsembed.es.js +238 -31
  98. package/dist/tsembed.js +236 -29
  99. package/dist/visual-embed-sdk-react-full.d.ts +288 -72
  100. package/dist/visual-embed-sdk-react.d.ts +288 -72
  101. package/dist/visual-embed-sdk.d.ts +218 -53
  102. package/lib/package.json +1 -1
  103. package/lib/src/config.spec.js +9 -0
  104. package/lib/src/config.spec.js.map +1 -1
  105. package/lib/src/embed/app.d.ts +75 -15
  106. package/lib/src/embed/app.d.ts.map +1 -1
  107. package/lib/src/embed/app.js +69 -9
  108. package/lib/src/embed/app.js.map +1 -1
  109. package/lib/src/embed/app.spec.js +376 -14
  110. package/lib/src/embed/app.spec.js.map +1 -1
  111. package/lib/src/embed/bodyless-conversation.d.ts +19 -7
  112. package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
  113. package/lib/src/embed/bodyless-conversation.js +23 -4
  114. package/lib/src/embed/bodyless-conversation.js.map +1 -1
  115. package/lib/src/embed/bodyless-conversation.spec.js +9 -191
  116. package/lib/src/embed/bodyless-conversation.spec.js.map +1 -1
  117. package/lib/src/embed/conversation.spec.js +30 -2
  118. package/lib/src/embed/conversation.spec.js.map +1 -1
  119. package/lib/src/embed/embedConfig.d.ts +9 -7
  120. package/lib/src/embed/embedConfig.d.ts.map +1 -1
  121. package/lib/src/embed/embedConfig.js +9 -7
  122. package/lib/src/embed/embedConfig.js.map +1 -1
  123. package/lib/src/embed/liveboard.d.ts +56 -17
  124. package/lib/src/embed/liveboard.d.ts.map +1 -1
  125. package/lib/src/embed/liveboard.js +49 -5
  126. package/lib/src/embed/liveboard.js.map +1 -1
  127. package/lib/src/embed/liveboard.spec.js +215 -11
  128. package/lib/src/embed/liveboard.spec.js.map +1 -1
  129. package/lib/src/embed/ts-embed.d.ts +5 -0
  130. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  131. package/lib/src/embed/ts-embed.js +16 -1
  132. package/lib/src/embed/ts-embed.js.map +1 -1
  133. package/lib/src/embed/ts-embed.spec.js +164 -0
  134. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  135. package/lib/src/errors.d.ts +1 -0
  136. package/lib/src/errors.d.ts.map +1 -1
  137. package/lib/src/errors.js +1 -0
  138. package/lib/src/errors.js.map +1 -1
  139. package/lib/src/index.d.ts +2 -2
  140. package/lib/src/index.d.ts.map +1 -1
  141. package/lib/src/index.js +2 -2
  142. package/lib/src/index.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 +80 -6
  154. package/lib/src/types.d.ts.map +1 -1
  155. package/lib/src/types.js +45 -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/processTrigger.js +2 -1
  161. package/lib/src/utils/processTrigger.js.map +1 -1
  162. package/lib/src/utils.d.ts +6 -0
  163. package/lib/src/utils.d.ts.map +1 -1
  164. package/lib/src/utils.js +21 -2
  165. package/lib/src/utils.js.map +1 -1
  166. package/lib/src/utils.spec.js +238 -2
  167. package/lib/src/utils.spec.js.map +1 -1
  168. package/lib/src/visual-embed-sdk.d.ts +219 -54
  169. package/package.json +1 -1
  170. package/src/config.spec.ts +11 -0
  171. package/src/embed/app.spec.ts +479 -26
  172. package/src/embed/app.ts +133 -27
  173. package/src/embed/bodyless-conversation.spec.ts +9 -203
  174. package/src/embed/bodyless-conversation.ts +24 -10
  175. package/src/embed/conversation.spec.ts +40 -2
  176. package/src/embed/embedConfig.ts +10 -8
  177. package/src/embed/liveboard.spec.ts +256 -5
  178. package/src/embed/liveboard.ts +99 -27
  179. package/src/embed/ts-embed.spec.ts +225 -0
  180. package/src/embed/ts-embed.ts +19 -0
  181. package/src/errors.ts +1 -0
  182. package/src/index.ts +2 -0
  183. package/src/react/all-types-export.ts +2 -1
  184. package/src/react/index.spec.tsx +556 -157
  185. package/src/react/index.tsx +117 -51
  186. package/src/types.ts +117 -43
  187. package/src/utils/graphql/nlsService/conversation-service.ts +2 -0
  188. package/src/utils/processTrigger.ts +1 -1
  189. package/src/utils.spec.ts +279 -2
  190. package/src/utils.ts +28 -2
@@ -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
@@ -320,7 +371,7 @@ export function useInit(config: EmbedConfig): React.MutableRefObject<AuthEventEm
320
371
  * @summary ThoughtSpot Visual Embed SDK
321
372
  * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
322
373
  */
323
- export { init, logout, prefetch, executeTML, exportTML, executeTMLInput, exportTMLInput, getEmbedConfig as getInitConfig, getSessionInfo, tokenizedFetch, getAnswerFromQuery, createLiveboardWithAnswers, SearchEmbed, SearchBarEmbed, PinboardEmbed, LiveboardEmbed, SageEmbed, AppEmbed, SpotterAgentEmbed, SpotterAgentEmbedViewConfig, BodylessConversationViewConfig, BodylessConversation, SpotterEmbed, SpotterEmbedViewConfig, ConversationViewConfig, ConversationEmbed, AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter, AnswerService, SessionInterface, UnderlyingDataPoint, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, ContextMenuTriggerOptions, EmbedConfig, SearchViewConfig, SearchBarViewConfig, LiveboardViewConfig, SageViewConfig, AppViewConfig, PrefetchFeatures, FrameParams, HomeLeftNavItem, HomepageModule, DOMSelector, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, CustomCssVariables, RuntimeParameter, LogLevel, uploadMixpanelEvent, MIXPANEL_EVENT, HomePageSearchBarMode, PrimaryNavbarVersion, HomePage, VizPoint, CustomActionPayload, UIPassthroughEvent, ListPageColumns, DataPanelCustomColumnGroupsAccordionState, };
374
+ export { init, logout, prefetch, executeTML, exportTML, executeTMLInput, exportTMLInput, getEmbedConfig as getInitConfig, getSessionInfo, tokenizedFetch, getAnswerFromQuery, createLiveboardWithAnswers, SearchEmbed, SearchBarEmbed, PinboardEmbed, LiveboardEmbed, SageEmbed, AppEmbed, SpotterAgentEmbed, SpotterAgentEmbedViewConfig, BodylessConversationViewConfig, BodylessConversation, SpotterEmbed, SpotterEmbedViewConfig, ConversationViewConfig, ConversationEmbed, AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter, AnswerService, SessionInterface, UnderlyingDataPoint, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, ContextMenuTriggerOptions, EmbedConfig, SearchViewConfig, SearchBarViewConfig, LiveboardViewConfig, SageViewConfig, AppViewConfig, PrefetchFeatures, FrameParams, HomeLeftNavItem, HomepageModule, DOMSelector, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, CustomCssVariables, RuntimeParameter, LogLevel, uploadMixpanelEvent, MIXPANEL_EVENT, HomePageSearchBarMode, PrimaryNavbarVersion, HomePage, ListPage, VizPoint, CustomActionPayload, UIPassthroughEvent, ListPageColumns, DataPanelCustomColumnGroupsAccordionState, };
324
375
 
325
376
  export declare let loggedInStatus: boolean;
326
377
  export declare let samlAuthWindow: Window;
@@ -1204,6 +1255,21 @@ export declare enum HomePage {
1204
1255
  */
1205
1256
  Modular = "v2"
1206
1257
  }
1258
+ /**
1259
+ * Define the version of the list page
1260
+ * @version SDK: 1.40.0 | ThoughtSpot: 10.12.0.cl
1261
+ */
1262
+ export declare enum ListPage {
1263
+ /**
1264
+ * List (v2) is the traditional List Experience.
1265
+ * It serves as the foundational version of the list page.
1266
+ */
1267
+ List = "v2",
1268
+ /**
1269
+ * ListWithUXChanges (v3) introduces the new updated list page with UX changes.
1270
+ */
1271
+ ListWithUXChanges = "v3"
1272
+ }
1207
1273
  /**
1208
1274
  * Define the discovery experience
1209
1275
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
@@ -1217,6 +1283,10 @@ export interface DiscoveryExperience {
1217
1283
  * homePage determines the version of the home page.
1218
1284
  */
1219
1285
  homePage?: HomePage;
1286
+ /**
1287
+ * listPageVersion determines the version of the list page.
1288
+ */
1289
+ listPageVersion?: ListPage;
1220
1290
  }
1221
1291
  /**
1222
1292
  * The view configuration for full app embedding.
@@ -1588,21 +1658,6 @@ export interface AppViewConfig extends AllEmbedViewConfig {
1588
1658
  * ```
1589
1659
  */
1590
1660
  isUnifiedSearchExperienceEnabled?: boolean;
1591
- /**
1592
- * Show alert messages and toast messages in the embedded
1593
- * view in full app embed.
1594
- *
1595
- * Supported embed types: `AppEmbed`
1596
- * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1597
- * @example
1598
- * ```js
1599
- * const embed = new AppEmbed('#tsEmbed', {
1600
- * ... // other embed view config
1601
- * showAlerts:true,
1602
- * })
1603
- * ```
1604
- */
1605
- showAlerts?: boolean;
1606
1661
  /**
1607
1662
  * This flag is used to enable/disable the styling and grouping in a Liveboard
1608
1663
  *
@@ -1619,6 +1674,46 @@ export interface AppViewConfig extends AllEmbedViewConfig {
1619
1674
  * ```
1620
1675
  */
1621
1676
  isLiveboardStylingAndGroupingEnabled?: boolean;
1677
+ /**
1678
+ * This flag is used to enable the full height lazy load data.
1679
+ *
1680
+ * @example
1681
+ * ```js
1682
+ * const embed = new AppEmbed('#embed-container', {
1683
+ * // ...other options
1684
+ * fullHeight: true,
1685
+ * lazyLoadingForFullHeight: true,
1686
+ * })
1687
+ * ```
1688
+ *
1689
+ * @type {boolean}
1690
+ * @default false
1691
+ * @version SDK: 1.39.0 | ThoughtSpot:10.10.0.cl
1692
+ */
1693
+ lazyLoadingForFullHeight?: boolean;
1694
+ /**
1695
+ * The margin to be used for lazy loading.
1696
+ *
1697
+ * For example, if the margin is set to '10px',
1698
+ * the visualization will be loaded 10px before the its top edge is visible in the
1699
+ * viewport.
1700
+ *
1701
+ * The format is similar to CSS margin.
1702
+ *
1703
+ * @example
1704
+ * ```js
1705
+ * const embed = new AppEmbed('#embed-container', {
1706
+ * // ...other options
1707
+ * fullHeight: true,
1708
+ * lazyLoadingForFullHeight: true,
1709
+ * // Using 0px, the visualization will be only loaded when its visible in the viewport.
1710
+ * lazyLoadingMargin: '0px',
1711
+ * })
1712
+ * ```
1713
+ * @type {string}
1714
+ * @version SDK: 1.39.0 | ThoughtSpot:10.10.0.cl
1715
+ */
1716
+ lazyLoadingMargin?: string;
1622
1717
  }
1623
1718
  /**
1624
1719
  * Embeds full ThoughtSpot experience in a host application.
@@ -1655,6 +1750,11 @@ export declare class AppEmbed extends V1Embed {
1655
1750
  * @version SDK: 1.12.0 | ThoughtSpot: 8.4.0.cl, 8.4.1-sw
1656
1751
  */
1657
1752
  navigateToPage(path: string | number, noReload?: boolean): void;
1753
+ /**
1754
+ * Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
1755
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1756
+ */
1757
+ destroy(): void;
1658
1758
  /**
1659
1759
  * Renders the embedded application pages in the ThoughtSpot app.
1660
1760
  * @param renderOptions An object containing the page ID
@@ -1910,23 +2010,6 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
1910
2010
  * })
1911
2011
  */
1912
2012
  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
2013
  /**
1931
2014
  * The list of tab IDs to hide from the embedded.
1932
2015
  * This Tabs will be hidden from their respective LBs.
@@ -1982,6 +2065,46 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
1982
2065
  * ```
1983
2066
  */
1984
2067
  isLiveboardStylingAndGroupingEnabled?: boolean;
2068
+ /**
2069
+ * This flag is used to enable the full height lazy load data.
2070
+ *
2071
+ * @example
2072
+ * ```js
2073
+ * const embed = new LiveboardEmbed('#embed-container', {
2074
+ * // ...other options
2075
+ * fullHeight: true,
2076
+ * lazyLoadingForFullHeight: true,
2077
+ * })
2078
+ * ```
2079
+ *
2080
+ * @type {boolean}
2081
+ * @default false
2082
+ * @version SDK: 1.39.0 | ThoughtSpot:10.10.0.cl
2083
+ */
2084
+ lazyLoadingForFullHeight?: boolean;
2085
+ /**
2086
+ * The margin to be used for lazy loading.
2087
+ *
2088
+ * For example, if the margin is set to '10px',
2089
+ * the visualization will be loaded 10px before the its top edge is visible in the
2090
+ * viewport.
2091
+ *
2092
+ * The format is similar to CSS margin.
2093
+ *
2094
+ * @example
2095
+ * ```js
2096
+ * const embed = new LiveboardEmbed('#embed-container', {
2097
+ * // ...other options
2098
+ * fullHeight: true,
2099
+ * lazyLoadingForFullHeight: true,
2100
+ * // Using 0px, the visualization will be only loaded when its visible in the viewport.
2101
+ * lazyLoadingMargin: '0px',
2102
+ * })
2103
+ * ```
2104
+ * @type {string}
2105
+ * @version SDK: 1.39.0 | ThoughtSpot:10.10.0.cl
2106
+ */
2107
+ lazyLoadingMargin?: string;
1985
2108
  }
1986
2109
  /**
1987
2110
  * Embed a ThoughtSpot Liveboard or visualization. When rendered it already
@@ -2015,6 +2138,11 @@ export declare class LiveboardEmbed extends V1Embed {
2015
2138
  * @returns A promise that resolves with the response from the embedded app
2016
2139
  */
2017
2140
  trigger<HostEventT extends HostEvent, PayloadT>(messageType: HostEventT, data?: TriggerPayload<PayloadT, HostEventT>): Promise<TriggerResponse<PayloadT, HostEventT>>;
2141
+ /**
2142
+ * Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
2143
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
2144
+ */
2145
+ destroy(): void;
2018
2146
  /**
2019
2147
  * Render an embedded ThoughtSpot Liveboard or visualization
2020
2148
  * @param renderOptions An object specifying the Liveboard ID,
@@ -2044,10 +2172,6 @@ export interface SpotterAgentEmbedViewConfig extends Omit<BaseViewConfig, 'prima
2044
2172
  * The ID of the worksheet to use for the conversation.
2045
2173
  */
2046
2174
  worksheetId: string;
2047
- /**
2048
- * Optional CSS class name to add to the container div.
2049
- */
2050
- containerClassName?: string;
2051
2175
  }
2052
2176
  /**
2053
2177
  * Configuration for conversation options.
@@ -2057,13 +2181,13 @@ export interface SpotterAgentEmbedViewConfig extends Omit<BaseViewConfig, 'prima
2057
2181
  */
2058
2182
  export interface BodylessConversationViewConfig extends SpotterAgentEmbedViewConfig {
2059
2183
  }
2060
- interface SpotterAgentMessageViewConfig extends SpotterAgentEmbedViewConfig {
2184
+ export interface SpotterAgentMessageViewConfig extends SpotterAgentEmbedViewConfig {
2061
2185
  sessionId: string;
2062
2186
  genNo: number;
2063
2187
  acSessionId: string;
2064
2188
  acGenNo: number;
2065
2189
  }
2066
- declare class ConversationMessage extends TsEmbed {
2190
+ export declare class ConversationMessage extends TsEmbed {
2067
2191
  protected viewConfig: SpotterAgentMessageViewConfig;
2068
2192
  constructor(container: HTMLElement, viewConfig: SpotterAgentMessageViewConfig);
2069
2193
  getIframeSrc(): string;
@@ -2099,6 +2223,23 @@ export declare class SpotterAgentEmbed {
2099
2223
  viz: ConversationMessage;
2100
2224
  error?: undefined;
2101
2225
  }>;
2226
+ /**
2227
+ * Send a message to the conversation service and return only the data.
2228
+ * @param userMessage - The message to send to the conversation service.
2229
+ * @returns The data from the conversation service.
2230
+ */
2231
+ sendMessageData(userMessage: string): Promise<{
2232
+ error: any;
2233
+ data?: undefined;
2234
+ } | {
2235
+ data: {
2236
+ sessionId: any;
2237
+ genNo: any;
2238
+ acSessionId: any;
2239
+ acGenNo: any;
2240
+ };
2241
+ error?: undefined;
2242
+ }>;
2102
2243
  }
2103
2244
  /**
2104
2245
  * Create a conversation embed, which can be integrated inside
@@ -2123,7 +2264,6 @@ export declare class SpotterAgentEmbed {
2123
2264
  export declare class BodylessConversation extends SpotterAgentEmbed {
2124
2265
  constructor(viewConfig: BodylessConversationViewConfig);
2125
2266
  }
2126
- export {};
2127
2267
 
2128
2268
  /**
2129
2269
  * Copyright (c) 2023
@@ -2337,7 +2477,13 @@ export declare enum HomeLeftNavItem {
2337
2477
  * available when new navigation V3 is enabled.
2338
2478
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
2339
2479
  */
2340
- Spotter = "spotter"
2480
+ Spotter = "spotter",
2481
+ /**
2482
+ * Favorites option in the insights left navigation,
2483
+ * available when new navigation V3 is enabled.
2484
+ * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
2485
+ */
2486
+ Favorites = "favorites"
2341
2487
  }
2342
2488
  export type DOMSelector = string | HTMLElement;
2343
2489
  /**
@@ -3103,6 +3249,20 @@ export interface BaseViewConfig {
3103
3249
  * @private
3104
3250
  */
3105
3251
  insertInToSlide?: boolean;
3252
+ /**
3253
+ * Show alert messages and toast messages in the embed.
3254
+ * Supported embed in all embed types.
3255
+ *
3256
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
3257
+ * @example
3258
+ * ```js
3259
+ * const embed = new AppEmbed('#tsEmbed', {
3260
+ * ... // other embed view config
3261
+ * showAlerts:true,
3262
+ * })
3263
+ * ```
3264
+ */
3265
+ showAlerts?: boolean;
3106
3266
  }
3107
3267
  /**
3108
3268
  * The configuration object for Home page embeds configs.
@@ -3480,6 +3640,22 @@ export interface LiveboardAppEmbedViewConfig {
3480
3640
  * ```
3481
3641
  */
3482
3642
  enableAskSage?: boolean;
3643
+ /**
3644
+ * This flag is used to show or hide checkboxes for including or excluding
3645
+ * the cover and filters pages in the Liveboard PDF.
3646
+ *
3647
+ * Supported embed types: `AppEmbed`, `LiveboardEmbed`
3648
+ * @version SDK: 1.40.0 | ThoughtSpot:10.8.0.cl
3649
+ * @example
3650
+ * ```js
3651
+ * // Replace <EmbedComponent> with embed component name. For example, AppEmbed or LiveboardEmbed
3652
+ * const embed = new <EmbedComponent>('#tsEmbed', {
3653
+ * ... // other embed view config
3654
+ * coverAndFilterOptionInPDF: false,
3655
+ * })
3656
+ * ```
3657
+ */
3658
+ coverAndFilterOptionInPDF?: boolean;
3483
3659
  }
3484
3660
  export interface AllEmbedViewConfig extends BaseViewConfig, SearchLiveboardCommonViewConfig, HomePageConfig, LiveboardAppEmbedViewConfig {
3485
3661
  }
@@ -4739,7 +4915,13 @@ export declare enum EmbedEvent {
4739
4915
  * Emitted when a user exits present mode.
4740
4916
  * @version SDK : 1.40.0 | ThoughtSpot: 10.11.0.cl
4741
4917
  */
4742
- ExitPresentMode = "exitPresentMode"
4918
+ ExitPresentMode = "exitPresentMode",
4919
+ /**
4920
+ * Emitted when a user requests the full height lazy load data.
4921
+ * @version SDK : 1.39.0 | ThoughtSpot : 10.10.0.cl
4922
+ * @hidden
4923
+ */
4924
+ RequestVisibleEmbedCoordinates = "requestVisibleEmbedCoordinates"
4743
4925
  }
4744
4926
  /**
4745
4927
  * Event types that can be triggered by the host application
@@ -5821,7 +6003,20 @@ export declare enum HostEvent {
5821
6003
  *```
5822
6004
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
5823
6005
  */
5824
- ExitPresentMode = "exitPresentMode"
6006
+ ExitPresentMode = "exitPresentMode",
6007
+ /**
6008
+ * Triggers the full height lazy load data.
6009
+ * @example
6010
+ * ```js
6011
+ * liveboardEmbed.on(EmbedEvent.RequestVisibleEmbedCoordinates, (payload) => {
6012
+ * console.log(payload);
6013
+ * });
6014
+ * ```
6015
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
6016
+ *
6017
+ * @hidden
6018
+ */
6019
+ VisibleEmbedCoordinates = "visibleEmbedCoordinates"
5825
6020
  }
5826
6021
  /**
5827
6022
  * The different visual modes that the data sources panel within
@@ -5917,6 +6112,7 @@ export declare enum Param {
5917
6112
  Query = "query",
5918
6113
  HideHomepageLeftNav = "hideHomepageLeftNav",
5919
6114
  ModularHomeExperienceEnabled = "modularHomeExperience",
6115
+ ListPageVersion = "listpageVersion",
5920
6116
  PendoTrackingKey = "additionalPendoKey",
5921
6117
  LiveboardHeaderSticky = "isLiveboardHeaderSticky",
5922
6118
  IsProductTour = "isProductTour",
@@ -5951,10 +6147,12 @@ export declare enum Param {
5951
6147
  DataSourceId = "dataSourceId",
5952
6148
  preAuthCache = "preAuthCache",
5953
6149
  ShowSpotterLimitations = "showSpotterLimitations",
5954
- CoverAndFilterOptionInPDF = "coverAndFilterOptionInPDF",
6150
+ CoverAndFilterOptionInPDF = "arePdfCoverFilterPageCheckboxesEnabled",
5955
6151
  PrimaryAction = "primaryAction",
5956
6152
  isSpotterAgentEmbed = "isSpotterAgentEmbed",
5957
- IsLiveboardStylingAndGroupingEnabled = "isLiveboardStylingAndGroupingEnabled"
6153
+ IsLiveboardStylingAndGroupingEnabled = "isLiveboardStylingAndGroupingEnabled",
6154
+ IsLazyLoadingForEmbedEnabled = "isLazyLoadingForEmbedEnabled",
6155
+ RootMarginForLazyLoad = "rootMarginForLazyLoad"
5958
6156
  }
5959
6157
  /**
5960
6158
  * ThoughtSpot application pages include actions and menu commands
@@ -7174,7 +7372,23 @@ export declare enum Action {
7174
7372
  * ```
7175
7373
  * @version SDK: 1.37.0 | ThoughtSpot Cloud: 10.8.0.cl
7176
7374
  */
7177
- CoverAndFilterOptionInPDF = "coverAndFilterOptionInPDF"
7375
+ CoverAndFilterOptionInPDF = "coverAndFilterOptionInPDF",
7376
+ /**
7377
+ * Action ID for hide or disable the
7378
+ * Spotter in conversation training widget.
7379
+ * The Add to Coaching feature is currently in beta
7380
+ * and is disabled by default on embed deployments.
7381
+ * To enable this feature on your instance,
7382
+ * contact ThoughtSpot Support.
7383
+ * @example
7384
+ * ```js
7385
+ * hiddenAction: [Action.InConversationTraining]
7386
+ * disabledActions: [Action.InConversationTraining]
7387
+ *
7388
+ * ```
7389
+ * @version SDK: 1.39.0 | ThoughtSpot Cloud: 10.10.0.cl
7390
+ */
7391
+ InConversationTraining = "InConversationTraining"
7178
7392
  }
7179
7393
  export interface AnswerServiceType {
7180
7394
  getAnswer?: (offset: number, batchSize: number) => any;
@@ -8342,13 +8556,14 @@ export declare class AnswerService {
8342
8556
  *
8343
8557
  * @example
8344
8558
  * ```js
8559
+ * import { getInitConfig } from '@thoughtspot/visual-embed-sdk';
8560
+ * // Call the getInitConfig method to retrieve the embed configuration
8345
8561
  * const config = getInitConfig();
8562
+ * // Log the configuration settings
8346
8563
  * console.log(config);
8347
8564
  * ```
8348
- * @example
8349
- *
8350
- * Returns the `EmbedConfig` object, which
8351
- * contains the configuration settings used to
8565
+ * Returns the link:https://developers.thoughtspot.com/docs/Interface_EmbedConfig[EmbedConfig]
8566
+ * object, which contains the configuration settings used to
8352
8567
  * initialize the SDK, including the following:
8353
8568
  *
8354
8569
  * - `thoughtSpotHost` - ThoughtSpot host URL
@@ -8357,9 +8572,10 @@ export declare class AnswerService {
8357
8572
  * - `customizations` - Style, text, and icon customization settings
8358
8573
  * that were applied during the SDK initialization.
8359
8574
  *
8360
- * For a comprehensive list of embed configuration settings,
8361
- * see link:https://developers.thoughtspot.com/docs/Interface_EmbedConfig[Developer Documentation].
8575
+ * The following JSON output shows the embed configuration
8576
+ * settings returned from the code in the previous example:
8362
8577
  *
8578
+ * @example
8363
8579
  * ```json
8364
8580
  * {
8365
8581
  * "thoughtSpotHost": "https://{ThoughtSpot-Host}",
@@ -8381,7 +8597,7 @@ export declare class AnswerService {
8381
8597
  * "authTriggerContainer": "#your-own-div"
8382
8598
  * }
8383
8599
  * ```
8384
- * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.cl, and later
8600
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw, and later
8385
8601
  * @group Global methods
8386
8602
  */
8387
8603
  export declare const getEmbedConfig: () => EmbedConfig;