@thoughtspot/visual-embed-sdk 1.37.0-temp-nav → 1.37.1-spotter-embed

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 (128) hide show
  1. package/cjs/package.json +3 -3
  2. package/cjs/src/auth.d.ts +7 -3
  3. package/cjs/src/auth.d.ts.map +1 -1
  4. package/cjs/src/auth.js +20 -0
  5. package/cjs/src/auth.js.map +1 -1
  6. package/cjs/src/auth.spec.js +48 -0
  7. package/cjs/src/auth.spec.js.map +1 -1
  8. package/cjs/src/embed/app.d.ts +2 -19
  9. package/cjs/src/embed/app.d.ts.map +1 -1
  10. package/cjs/src/embed/app.js +3 -8
  11. package/cjs/src/embed/app.js.map +1 -1
  12. package/cjs/src/embed/app.spec.js +4 -10
  13. package/cjs/src/embed/app.spec.js.map +1 -1
  14. package/cjs/src/embed/bodyless-conversation.d.ts +39 -9
  15. package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
  16. package/cjs/src/embed/bodyless-conversation.js +32 -5
  17. package/cjs/src/embed/bodyless-conversation.js.map +1 -1
  18. package/cjs/src/embed/bodyless-conversation.spec.js +4 -4
  19. package/cjs/src/embed/bodyless-conversation.spec.js.map +1 -1
  20. package/cjs/src/embed/conversation.d.ts +38 -11
  21. package/cjs/src/embed/conversation.d.ts.map +1 -1
  22. package/cjs/src/embed/conversation.js +28 -4
  23. package/cjs/src/embed/conversation.js.map +1 -1
  24. package/cjs/src/embed/conversation.spec.js +7 -7
  25. package/cjs/src/embed/conversation.spec.js.map +1 -1
  26. package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
  27. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  28. package/cjs/src/index.d.ts +3 -3
  29. package/cjs/src/index.d.ts.map +1 -1
  30. package/cjs/src/index.js +5 -3
  31. package/cjs/src/index.js.map +1 -1
  32. package/cjs/src/react/all-types-export.d.ts +1 -1
  33. package/cjs/src/react/all-types-export.d.ts.map +1 -1
  34. package/cjs/src/react/all-types-export.js +2 -1
  35. package/cjs/src/react/all-types-export.js.map +1 -1
  36. package/cjs/src/react/index.d.ts +24 -5
  37. package/cjs/src/react/index.d.ts.map +1 -1
  38. package/cjs/src/react/index.js +21 -4
  39. package/cjs/src/react/index.js.map +1 -1
  40. package/cjs/src/types.d.ts +51 -2
  41. package/cjs/src/types.d.ts.map +1 -1
  42. package/cjs/src/types.js +49 -0
  43. package/cjs/src/types.js.map +1 -1
  44. package/dist/index-DUaG1OG2.js +7447 -0
  45. package/dist/index-DnIvX1FR.js +7371 -0
  46. package/dist/index-OuiZF3zE.js +7371 -0
  47. package/dist/src/auth.d.ts +7 -3
  48. package/dist/src/auth.d.ts.map +1 -1
  49. package/dist/src/embed/app.d.ts +2 -19
  50. package/dist/src/embed/app.d.ts.map +1 -1
  51. package/dist/src/embed/bodyless-conversation.d.ts +39 -9
  52. package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
  53. package/dist/src/embed/conversation.d.ts +38 -11
  54. package/dist/src/embed/conversation.d.ts.map +1 -1
  55. package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
  56. package/dist/src/index.d.ts +3 -3
  57. package/dist/src/index.d.ts.map +1 -1
  58. package/dist/src/react/all-types-export.d.ts +1 -1
  59. package/dist/src/react/all-types-export.d.ts.map +1 -1
  60. package/dist/src/react/index.d.ts +24 -5
  61. package/dist/src/react/index.d.ts.map +1 -1
  62. package/dist/src/types.d.ts +51 -2
  63. package/dist/src/types.d.ts.map +1 -1
  64. package/dist/tsembed-react.es.js +122 -18
  65. package/dist/tsembed-react.js +342 -161
  66. package/dist/tsembed.es.js +84 -19
  67. package/dist/tsembed.js +306 -163
  68. package/dist/visual-embed-sdk-react-full.d.ts +161 -49
  69. package/dist/visual-embed-sdk-react.d.ts +161 -49
  70. package/dist/visual-embed-sdk.d.ts +138 -45
  71. package/lib/package.json +3 -3
  72. package/lib/src/auth.d.ts +7 -3
  73. package/lib/src/auth.d.ts.map +1 -1
  74. package/lib/src/auth.js +20 -0
  75. package/lib/src/auth.js.map +1 -1
  76. package/lib/src/auth.spec.js +48 -0
  77. package/lib/src/auth.spec.js.map +1 -1
  78. package/lib/src/embed/app.d.ts +2 -19
  79. package/lib/src/embed/app.d.ts.map +1 -1
  80. package/lib/src/embed/app.js +3 -8
  81. package/lib/src/embed/app.js.map +1 -1
  82. package/lib/src/embed/app.spec.js +4 -10
  83. package/lib/src/embed/app.spec.js.map +1 -1
  84. package/lib/src/embed/bodyless-conversation.d.ts +39 -9
  85. package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
  86. package/lib/src/embed/bodyless-conversation.js +30 -4
  87. package/lib/src/embed/bodyless-conversation.js.map +1 -1
  88. package/lib/src/embed/bodyless-conversation.spec.js +5 -5
  89. package/lib/src/embed/bodyless-conversation.spec.js.map +1 -1
  90. package/lib/src/embed/conversation.d.ts +38 -11
  91. package/lib/src/embed/conversation.d.ts.map +1 -1
  92. package/lib/src/embed/conversation.js +26 -3
  93. package/lib/src/embed/conversation.js.map +1 -1
  94. package/lib/src/embed/conversation.spec.js +8 -8
  95. package/lib/src/embed/conversation.spec.js.map +1 -1
  96. package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
  97. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  98. package/lib/src/index.d.ts +3 -3
  99. package/lib/src/index.d.ts.map +1 -1
  100. package/lib/src/index.js +3 -3
  101. package/lib/src/index.js.map +1 -1
  102. package/lib/src/react/all-types-export.d.ts +1 -1
  103. package/lib/src/react/all-types-export.d.ts.map +1 -1
  104. package/lib/src/react/all-types-export.js +1 -1
  105. package/lib/src/react/all-types-export.js.map +1 -1
  106. package/lib/src/react/index.d.ts +24 -5
  107. package/lib/src/react/index.d.ts.map +1 -1
  108. package/lib/src/react/index.js +21 -4
  109. package/lib/src/react/index.js.map +1 -1
  110. package/lib/src/types.d.ts +51 -2
  111. package/lib/src/types.d.ts.map +1 -1
  112. package/lib/src/types.js +49 -0
  113. package/lib/src/types.js.map +1 -1
  114. package/lib/src/visual-embed-sdk.d.ts +140 -47
  115. package/package.json +3 -3
  116. package/src/auth.spec.ts +52 -0
  117. package/src/auth.ts +23 -2
  118. package/src/embed/app.spec.ts +4 -10
  119. package/src/embed/app.ts +6 -30
  120. package/src/embed/bodyless-conversation.spec.ts +6 -6
  121. package/src/embed/bodyless-conversation.ts +43 -8
  122. package/src/embed/conversation.spec.ts +16 -16
  123. package/src/embed/conversation.ts +42 -11
  124. package/src/embed/ts-embed.spec.ts +0 -2
  125. package/src/index.ts +8 -4
  126. package/src/react/all-types-export.ts +1 -0
  127. package/src/react/index.tsx +36 -10
  128. package/src/types.ts +55 -0
@@ -16,8 +16,8 @@ declare module '@thoughtspot/visual-embed-sdk' {
16
16
  import { PinboardEmbed, LiveboardViewConfig, LiveboardEmbed } from '@thoughtspot/visual-embed-sdk/embed/liveboard';
17
17
  import { SearchEmbed, SearchViewConfig } from '@thoughtspot/visual-embed-sdk/embed/search';
18
18
  import { SearchBarEmbed, SearchBarViewConfig } from '@thoughtspot/visual-embed-sdk/embed/search-bar';
19
- import { BodylessConversation, BodylessConversationViewConfig } from '@thoughtspot/visual-embed-sdk/embed/bodyless-conversation';
20
- import { ConversationEmbed, ConversationViewConfig } from '@thoughtspot/visual-embed-sdk/embed/conversation';
19
+ import { SpotterAgentEmbed, SpotterAgentEmbedViewConfig, SpotterAgentEmbed as BodylessConversation, SpotterAgentEmbedViewConfig as BodylessConversationViewConfig } from '@thoughtspot/visual-embed-sdk/embed/bodyless-conversation';
20
+ import { SpotterEmbed, SpotterEmbedViewConfig, SpotterEmbed as ConversationEmbed, SpotterEmbedViewConfig as ConversationViewConfig } from '@thoughtspot/visual-embed-sdk/embed/conversation';
21
21
  import { AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter } from '@thoughtspot/visual-embed-sdk/auth';
22
22
  import { getSessionInfo } from '@thoughtspot/visual-embed-sdk/utils/sessionInfoService';
23
23
  import { AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, EmbedConfig, PrefetchFeatures, FrameParams, DOMSelector, HomeLeftNavItem, HomepageModule, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, ContextMenuTriggerOptions, RuntimeParameter, LogLevel, VizPoint, CustomActionPayload, ListPageColumns } from '@thoughtspot/visual-embed-sdk/types';
@@ -30,7 +30,7 @@ declare module '@thoughtspot/visual-embed-sdk' {
30
30
  import { getAnswerFromQuery } from '@thoughtspot/visual-embed-sdk/utils/graphql/nlsService/nls-answer-service';
31
31
  import { createLiveboardWithAnswers } from '@thoughtspot/visual-embed-sdk/utils/liveboardService/liveboardService';
32
32
  import { UIPassthroughEvent } from '@thoughtspot/visual-embed-sdk/embed/hostEventClient/contracts';
33
- export { init, logout, prefetch, executeTML, exportTML, executeTMLInput, exportTMLInput, getEmbedConfig as getInitConfig, getSessionInfo, tokenizedFetch, getAnswerFromQuery, createLiveboardWithAnswers, SearchEmbed, SearchBarEmbed, PinboardEmbed, LiveboardEmbed, SageEmbed, AppEmbed, BodylessConversation, BodylessConversationViewConfig, ConversationEmbed, ConversationViewConfig, 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, VizPoint, CustomActionPayload, UIPassthroughEvent, ListPageColumns, };
33
+ 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, VizPoint, CustomActionPayload, UIPassthroughEvent, ListPageColumns, };
34
34
  export { resetCachedAuthToken } from '@thoughtspot/visual-embed-sdk/authToken';
35
35
  }
36
36
 
@@ -106,20 +106,6 @@ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
106
106
  AI_ANSWER = "aiAnswer",
107
107
  NONE = "none"
108
108
  }
109
- export interface ModularHomeExperienceV3 {
110
- /**
111
- * Enabled the modular homepage version 3.
112
- */
113
- enabled?: boolean;
114
- /**
115
- * homePage values are v2/v3,
116
- * v2 will show the modular homepage experience
117
- * v3 will show the new modular homepage v3 experience.
118
- *
119
- * @default v2
120
- */
121
- homePage?: string;
122
- }
123
109
  /**
124
110
  * The view configuration for full app embedding.
125
111
  * @group Embed components
@@ -435,14 +421,11 @@ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
435
421
  * ```js
436
422
  * const embed = new AppEmbed('#tsEmbed', {
437
423
  * ... // other options
438
- * modularHomeExperienceV3 : {
439
- * enabled: true,
440
- * homePage: 'v2'
441
- * },
424
+ * modularHomeExperienceV3 : true,
442
425
  * })
443
426
  * ```
444
427
  */
445
- modularHomeExperienceV3?: ModularHomeExperienceV3;
428
+ modularHomeExperienceV3?: boolean;
446
429
  /**
447
430
  * Boolean to control if Liveboard header is sticky or not.
448
431
  * @example
@@ -1628,21 +1611,28 @@ declare module '@thoughtspot/visual-embed-sdk/embed/bodyless-conversation' {
1628
1611
  * Configuration for bodyless conversation options.
1629
1612
  * @group Embed components
1630
1613
  */
1631
- export interface BodylessConversationViewConfig extends ViewConfig {
1614
+ export interface SpotterAgentEmbedViewConfig extends ViewConfig {
1632
1615
  /**
1633
1616
  * The ID of the worksheet to use for the conversation.
1634
1617
  */
1635
1618
  worksheetId: string;
1636
1619
  }
1637
- interface ConversationMessageViewConfig extends BodylessConversationViewConfig {
1620
+ /**
1621
+ * Configuration for conversation options.
1622
+ * @deprecated Renamed to SpotterAgentEmbedViewConfig
1623
+ * @group Embed components
1624
+ */
1625
+ export interface BodylessConversationViewConfig extends SpotterAgentEmbedViewConfig {
1626
+ }
1627
+ interface SpotterAgentMessageViewConfig extends SpotterAgentEmbedViewConfig {
1638
1628
  sessionId: string;
1639
1629
  genNo: number;
1640
1630
  acSessionId: string;
1641
1631
  acGenNo: number;
1642
1632
  }
1643
1633
  class ConversationMessage extends TsEmbed {
1644
- protected viewConfig: ConversationMessageViewConfig;
1645
- constructor(container: HTMLElement, viewConfig: ConversationMessageViewConfig);
1634
+ protected viewConfig: SpotterAgentMessageViewConfig;
1635
+ constructor(container: HTMLElement, viewConfig: SpotterAgentMessageViewConfig);
1646
1636
  getIframeSrc(): string;
1647
1637
  render(): Promise<ConversationMessage>;
1648
1638
  }
@@ -1651,9 +1641,9 @@ declare module '@thoughtspot/visual-embed-sdk/embed/bodyless-conversation' {
1651
1641
  * chatbots or other conversational interfaces.
1652
1642
  * @example
1653
1643
  * ```js
1654
- * import { BodylessConversation } from '@thoughtspot/visual-embed-sdk';
1644
+ * import { SpotterAgentEmbed } from '@thoughtspot/visual-embed-sdk';
1655
1645
  *
1656
- * const conversation = new BodylessConversation({
1646
+ * const conversation = new SpotterAgentEmbed({
1657
1647
  * worksheetId: 'worksheetId',
1658
1648
  * });
1659
1649
  *
@@ -1663,10 +1653,10 @@ declare module '@thoughtspot/visual-embed-sdk/embed/bodyless-conversation' {
1663
1653
  * document.body.appendChild(container); // or to any other element
1664
1654
  * ```
1665
1655
  * @group Embed components
1666
- * @version SDK: 1.33.1 | ThoughtSpot: 10.5.0.cl
1656
+ * @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
1667
1657
  */
1668
- export class BodylessConversation {
1669
- constructor(viewConfig: BodylessConversationViewConfig);
1658
+ export class SpotterAgentEmbed {
1659
+ constructor(viewConfig: SpotterAgentEmbedViewConfig);
1670
1660
  sendMessage(userMessage: string): Promise<{
1671
1661
  error: any;
1672
1662
  container?: undefined;
@@ -1677,6 +1667,29 @@ declare module '@thoughtspot/visual-embed-sdk/embed/bodyless-conversation' {
1677
1667
  error?: undefined;
1678
1668
  }>;
1679
1669
  }
1670
+ /**
1671
+ * Create a conversation embed, which can be integrated inside
1672
+ * chatbots or other conversational interfaces.
1673
+ * @deprecated Renamed to SpotterAgentEmbed
1674
+ * @example
1675
+ * ```js
1676
+ * import { SpotterAgentEmbed } from '@thoughtspot/visual-embed-sdk';
1677
+ *
1678
+ * const conversation = new SpotterAgentEmbed({
1679
+ * worksheetId: 'worksheetId',
1680
+ * });
1681
+ *
1682
+ * const { container, error } = await conversation.sendMessage('show me sales by region');
1683
+ *
1684
+ * // append the container to the DOM
1685
+ * document.body.appendChild(container); // or to any other element
1686
+ * ```
1687
+ * @group Embed components
1688
+ * @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
1689
+ */
1690
+ export class BodylessConversation extends SpotterAgentEmbed {
1691
+ constructor(viewConfig: BodylessConversationViewConfig);
1692
+ }
1680
1693
  export {};
1681
1694
  }
1682
1695
 
@@ -1693,10 +1706,10 @@ declare module '@thoughtspot/visual-embed-sdk/embed/conversation' {
1693
1706
  searchQuery: string;
1694
1707
  }
1695
1708
  /**
1696
- * The configuration for the embedded conversationEmbed options.
1709
+ * The configuration for the embedded spotterEmbed options.
1697
1710
  * @group Embed components
1698
1711
  */
1699
- export interface ConversationViewConfig extends ViewConfig {
1712
+ export interface SpotterEmbedViewConfig extends ViewConfig {
1700
1713
  /**
1701
1714
  * The ID of the worksheet to use for the conversation.
1702
1715
  */
@@ -1710,7 +1723,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/conversation' {
1710
1723
  * but still display the selected data source.
1711
1724
  * @example
1712
1725
  * ```js
1713
- * const embed = new ConversationEmbed('#tsEmbed', {
1726
+ * const embed = new SpotterEmbed('#tsEmbed', {
1714
1727
  * ... // other options
1715
1728
  * disableSourceSelection : true,
1716
1729
  * })
@@ -1722,7 +1735,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/conversation' {
1722
1735
  * hideSourceSelection : Hide data source selection
1723
1736
  * @example
1724
1737
  * ```js
1725
- * const embed = new ConversationEmbed('#tsEmbed', {
1738
+ * const embed = new SpotterEmbed('#tsEmbed', {
1726
1739
  * ... // other options
1727
1740
  * hideSourceSelection : true,
1728
1741
  * })
@@ -1749,7 +1762,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/conversation' {
1749
1762
  * default is false.
1750
1763
  * @example
1751
1764
  * ```js
1752
- * const embed = new ConversationEmbed('#tsEmbed', {
1765
+ * const embed = new SpotterEmbed('#tsEmbed', {
1753
1766
  * ... // other options
1754
1767
  * showSpotterLimitations : true,
1755
1768
  * })
@@ -1762,7 +1775,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/conversation' {
1762
1775
  * the initial screen of the conversation.
1763
1776
  * @example
1764
1777
  * ```js
1765
- * const embed = new ConversationEmbed('#tsEmbed', {
1778
+ * const embed = new SpotterEmbed('#tsEmbed', {
1766
1779
  * ... // other options
1767
1780
  * hideSampleQuestions : true,
1768
1781
  * })
@@ -1771,12 +1784,41 @@ declare module '@thoughtspot/visual-embed-sdk/embed/conversation' {
1771
1784
  */
1772
1785
  hideSampleQuestions?: boolean;
1773
1786
  }
1787
+ /**
1788
+ * The configuration for the embedded spotterEmbed options.
1789
+ * @deprecated Renamed to SpotterEmbedViewConfig
1790
+ * @group Embed components
1791
+ */
1792
+ export interface ConversationViewConfig extends SpotterEmbedViewConfig {
1793
+ }
1794
+ /**
1795
+ * Embed ThoughtSpot AI Conversation.
1796
+ * @group Embed components
1797
+ * @example
1798
+ * ```js
1799
+ * const conversation = new SpotterEmbed('#tsEmbed', {
1800
+ * worksheetId: 'worksheetId',
1801
+ * searchOptions: {
1802
+ * searchQuery: 'searchQuery',
1803
+ * },
1804
+ * });
1805
+ * conversation.render();
1806
+ * ```
1807
+ * @version SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
1808
+ */
1809
+ export class SpotterEmbed extends TsEmbed {
1810
+ protected viewConfig: SpotterEmbedViewConfig;
1811
+ constructor(container: HTMLElement, viewConfig: SpotterEmbedViewConfig);
1812
+ getIframeSrc(): string;
1813
+ render(): Promise<SpotterEmbed>;
1814
+ }
1774
1815
  /**
1775
1816
  * Embed ThoughtSpot AI Conversation.
1817
+ * @deprecated Renamed to SpotterEmbed
1776
1818
  * @group Embed components
1777
1819
  * @example
1778
1820
  * ```js
1779
- * const conversation = new ConversationEmbed('#tsEmbed', {
1821
+ * const conversation = new SpotterEmbed('#tsEmbed', {
1780
1822
  * worksheetId: 'worksheetId',
1781
1823
  * searchOptions: {
1782
1824
  * searchQuery: 'searchQuery',
@@ -1784,13 +1826,11 @@ declare module '@thoughtspot/visual-embed-sdk/embed/conversation' {
1784
1826
  * });
1785
1827
  * conversation.render();
1786
1828
  * ```
1787
- * @version SDK: 1.33.1 | ThoughtSpot: 10.5.0.cl
1829
+ * @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
1788
1830
  */
1789
- export class ConversationEmbed extends TsEmbed {
1831
+ export class ConversationEmbed extends SpotterEmbed {
1790
1832
  protected viewConfig: ConversationViewConfig;
1791
1833
  constructor(container: HTMLElement, viewConfig: ConversationViewConfig);
1792
- getIframeSrc(): string;
1793
- render(): Promise<ConversationEmbed>;
1794
1834
  }
1795
1835
  }
1796
1836
 
@@ -1846,7 +1886,11 @@ declare module '@thoughtspot/visual-embed-sdk/auth' {
1846
1886
  * or by the trigger button.
1847
1887
  * @version SDK: 1.19.0
1848
1888
  */
1849
- WAITING_FOR_POPUP = "WAITING_FOR_POPUP"
1889
+ WAITING_FOR_POPUP = "WAITING_FOR_POPUP",
1890
+ /**
1891
+ * Emitted when the SAML popup is closed without authentication
1892
+ */
1893
+ SAML_POPUP_CLOSED_NO_AUTH = "SAML_POPUP_CLOSED_NO_AUTH"
1850
1894
  }
1851
1895
  /**
1852
1896
  * Event emitter returned from {@link init}.
@@ -1864,10 +1908,10 @@ declare module '@thoughtspot/visual-embed-sdk/auth' {
1864
1908
  * @param event
1865
1909
  * @param listener
1866
1910
  */
1867
- on(event: AuthStatus.SDK_SUCCESS | AuthStatus.LOGOUT | AuthStatus.WAITING_FOR_POPUP, listener: () => void): this;
1911
+ on(event: AuthStatus.SDK_SUCCESS | AuthStatus.LOGOUT | AuthStatus.WAITING_FOR_POPUP | AuthStatus.SAML_POPUP_CLOSED_NO_AUTH, listener: () => void): this;
1868
1912
  on(event: AuthStatus.SUCCESS, listener: (sessionInfo: any) => void): this;
1869
1913
  once(event: AuthStatus.FAILURE, listener: (failureType: AuthFailureType) => void): this;
1870
- once(event: AuthStatus.SDK_SUCCESS | AuthStatus.LOGOUT | AuthStatus.WAITING_FOR_POPUP, listener: () => void): this;
1914
+ once(event: AuthStatus.SDK_SUCCESS | AuthStatus.LOGOUT | AuthStatus.WAITING_FOR_POPUP | AuthStatus.SAML_POPUP_CLOSED_NO_AUTH, listener: () => void): this;
1871
1915
  once(event: AuthStatus.SUCCESS, listener: (sessionInfo: any) => void): this;
1872
1916
  /**
1873
1917
  * Trigger an event on the emitter returned from init.
@@ -5527,7 +5571,55 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
5527
5571
  * ```
5528
5572
  * @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl
5529
5573
  */
5530
- TransformTableVizData = "TransformTableVizData"
5574
+ TransformTableVizData = "TransformTableVizData",
5575
+ /**
5576
+ * Triggers the table visualization re-render with the updated data.
5577
+ * Includes the following properties:
5578
+ * @param - `columnDataLite` - an array of object containing the
5579
+ * data value modifications retrieved from the `EmbedEvent.TableVizRendered`
5580
+ * payload.For example, { columnDataLite: []}`.
5581
+ */
5582
+ SpotterSearch = "SpotterSearch",
5583
+ /**
5584
+ * Triggers the table visualization re-render with the updated data.
5585
+ * Includes the following properties:
5586
+ * @param - `columnDataLite` - an array of object containing the
5587
+ * data value modifications retrieved from the `EmbedEvent.TableVizRendered`
5588
+ * payload.For example, { columnDataLite: []}`.
5589
+ */
5590
+ EditLastPrompt = "EditLastPrompt",
5591
+ /**
5592
+ * Triggers the table visualization re-render with the updated data.
5593
+ * Includes the following properties:
5594
+ * @param - `columnDataLite` - an array of object containing the
5595
+ * data value modifications retrieved from the `EmbedEvent.TableVizRendered`
5596
+ * payload.For example, { columnDataLite: []}`.
5597
+ */
5598
+ PreviewSpotterData = "PreviewSpotterData",
5599
+ /**
5600
+ * Triggers the table visualization re-render with the updated data.
5601
+ * Includes the following properties:
5602
+ * @param - `columnDataLite` - an array of object containing the
5603
+ * data value modifications retrieved from the `EmbedEvent.TableVizRendered`
5604
+ * payload.For example, { columnDataLite: []}`.
5605
+ */
5606
+ ResetSpotterConversation = "ResetSpotterConversation",
5607
+ /**
5608
+ * Triggers the table visualization re-render with the updated data.
5609
+ * Includes the following properties:
5610
+ * @param - `columnDataLite` - an array of object containing the
5611
+ * data value modifications retrieved from the `EmbedEvent.TableVizRendered`
5612
+ * payload.For example, { columnDataLite: []}`.
5613
+ */
5614
+ DeleteLastPrompt = "DeleteLastPrompt",
5615
+ /**
5616
+ * Triggers the table visualization re-render with the updated data.
5617
+ * Includes the following properties:
5618
+ * @param - `columnDataLite` - an array of object containing the
5619
+ * data value modifications retrieved from the `EmbedEvent.TableVizRendered`
5620
+ * payload.For example, { columnDataLite: []}`.
5621
+ */
5622
+ AnswerChartSwitcher = "answerChartSwitcher"
5531
5623
  }
5532
5624
  /**
5533
5625
  * The different visual modes that the data sources panel within
@@ -5658,7 +5750,8 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
5658
5750
  preAuthCache = "preAuthCache",
5659
5751
  ShowSpotterLimitations = "showSpotterLimitations",
5660
5752
  CoverAndFilterOptionInPDF = "coverAndFilterOptionInPDF",
5661
- PrimaryAction = "primaryAction"
5753
+ PrimaryAction = "primaryAction",
5754
+ isSpotterAgentEmbed = "isSpotterAgentEmbed"
5662
5755
  }
5663
5756
  /**
5664
5757
  * ThoughtSpot application pages include actions and menu commands
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thoughtspot/visual-embed-sdk",
3
- "version": "1.37.0-temp-nav",
3
+ "version": "1.37.1-spotter-embed",
4
4
  "description": "ThoughtSpot Embed SDK",
5
5
  "module": "lib/src/index.js",
6
6
  "main": "dist/tsembed.js",
@@ -57,7 +57,7 @@
57
57
  "test": "npm run test-sdk",
58
58
  "posttest": "cat ./coverage/sdk/lcov.info | coveralls",
59
59
  "is-publish-allowed": "node scripts/is-publish-allowed.js",
60
- "prepublishOnly": "npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build",
60
+ "prepublishOnly": "npm run is-publish-allowed && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build",
61
61
  "check-size": "npm run build && size-limit",
62
62
  "publish-dev": "npm publish --tag dev",
63
63
  "publish-prod": "npm publish --tag latest",
@@ -141,7 +141,7 @@
141
141
  "typescript-eslint": "^8.29.1",
142
142
  "url-search-params-polyfill": "^8.1.0",
143
143
  "util": "^0.12.4",
144
- "vite": "^5.3.4"
144
+ "vite": "^6.3.5"
145
145
  },
146
146
  "author": "ThoughtSpot",
147
147
  "email": "support@thoughtspot.com",
package/src/auth.spec.ts CHANGED
@@ -385,6 +385,45 @@ describe('Unit test for auth', () => {
385
385
  expect(global.window.location.href).toBe(samalLoginUrl);
386
386
  });
387
387
 
388
+ it('should emit SAML_POPUP_CLOSED_NO_AUTH when popup window is closed', async () => {
389
+ jest.useFakeTimers();
390
+ const mockPopupWindow = {
391
+ closed: false,
392
+ focus: jest.fn(),
393
+ close: jest.fn()
394
+ };
395
+ global.window.open = jest.fn().mockReturnValue(mockPopupWindow);
396
+ Object.defineProperty(window, 'location', {
397
+ value: {
398
+ href: '',
399
+ hash: '',
400
+ },
401
+ });
402
+ spyOn(authInstance, 'samlCompletionPromise').and.returnValue(Promise.resolve(false));
403
+ const emitSpy = jest.fn();
404
+ const mockEventEmitter = {
405
+ emit: emitSpy,
406
+ once: jest.fn(),
407
+ on: jest.fn()
408
+ };
409
+ authInstance.setAuthEE(mockEventEmitter as any);
410
+ jest.spyOn(tokenAuthService, 'isActiveService')
411
+ .mockReturnValueOnce(false)
412
+ .mockReturnValueOnce(true);
413
+ expect(
414
+ await authInstance.doSamlAuth({
415
+ ...embedConfig.doSamlAuthNoRedirect,
416
+ }),
417
+ ).toBe(true);
418
+ document.getElementById('ts-auth-btn').click();
419
+ mockPopupWindow.closed = true;
420
+ jest.advanceTimersByTime(1000);
421
+ window.postMessage({ type: EmbedEvent.SAMLComplete }, '*');
422
+ await authInstance.samlCompletionPromise;
423
+ expect(emitSpy).toHaveBeenCalledWith(authInstance.AuthStatus.SAML_POPUP_CLOSED_NO_AUTH);
424
+ jest.useRealTimers();
425
+ authInstance.setAuthEE(null);
426
+ });
388
427
  it('when user is not loggedIn, in config noRedirect is true and isAtSSORedirectUrl is false', async () => {
389
428
  Object.defineProperty(window, 'location', {
390
429
  value: {
@@ -408,6 +447,19 @@ describe('Unit test for auth', () => {
408
447
  await authInstance.samlCompletionPromise;
409
448
  expect(authInstance.loggedInStatus).toBe(true);
410
449
  });
450
+
451
+ it('should support emitting SAML_POPUP_CLOSED_NO_AUTH event', () => {
452
+ const emitSpy = jest.fn();
453
+ const mockEventEmitter = {
454
+ emit: emitSpy,
455
+ once: jest.fn()
456
+ };
457
+ authInstance.setAuthEE(mockEventEmitter as any);
458
+ authInstance.getAuthEE().emit(authInstance.AuthStatus.SAML_POPUP_CLOSED_NO_AUTH);
459
+ expect(emitSpy).toHaveBeenCalledWith(authInstance.AuthStatus.SAML_POPUP_CLOSED_NO_AUTH);
460
+ authInstance.setAuthEE(null);
461
+ });
462
+
411
463
  });
412
464
 
413
465
  describe('doOIDCAuth', () => {
package/src/auth.ts CHANGED
@@ -77,6 +77,11 @@ export enum AuthStatus {
77
77
  * @version SDK: 1.19.0
78
78
  */
79
79
  WAITING_FOR_POPUP = 'WAITING_FOR_POPUP',
80
+
81
+ /**
82
+ * Emitted when the SAML popup is closed without authentication
83
+ */
84
+ SAML_POPUP_CLOSED_NO_AUTH = 'SAML_POPUP_CLOSED_NO_AUTH',
80
85
  }
81
86
 
82
87
  /**
@@ -96,13 +101,13 @@ export interface AuthEventEmitter {
96
101
  * @param listener
97
102
  */
98
103
  on(
99
- event: AuthStatus.SDK_SUCCESS | AuthStatus.LOGOUT | AuthStatus.WAITING_FOR_POPUP,
104
+ event: AuthStatus.SDK_SUCCESS | AuthStatus.LOGOUT | AuthStatus.WAITING_FOR_POPUP | AuthStatus.SAML_POPUP_CLOSED_NO_AUTH,
100
105
  listener: () => void,
101
106
  ): this;
102
107
  on(event: AuthStatus.SUCCESS, listener: (sessionInfo: any) => void): this;
103
108
  once(event: AuthStatus.FAILURE, listener: (failureType: AuthFailureType) => void): this;
104
109
  once(
105
- event: AuthStatus.SDK_SUCCESS | AuthStatus.LOGOUT | AuthStatus.WAITING_FOR_POPUP,
110
+ event: AuthStatus.SDK_SUCCESS | AuthStatus.LOGOUT | AuthStatus.WAITING_FOR_POPUP | AuthStatus.SAML_POPUP_CLOSED_NO_AUTH,
106
111
  listener: () => void,
107
112
  ): this;
108
113
  once(event: AuthStatus.SUCCESS, listener: (sessionInfo: any) => void): this;
@@ -364,6 +369,7 @@ export const doBasicAuth = async (embedConfig: EmbedConfig): Promise<boolean> =>
364
369
  * @param triggerText
365
370
  */
366
371
  async function samlPopupFlow(ssoURL: string, triggerContainer: DOMSelector, triggerText: string) {
372
+ let popupClosedCheck: NodeJS.Timeout;
367
373
  const openPopup = () => {
368
374
  if (samlAuthWindow === null || samlAuthWindow.closed) {
369
375
  samlAuthWindow = window.open(
@@ -371,10 +377,21 @@ async function samlPopupFlow(ssoURL: string, triggerContainer: DOMSelector, trig
371
377
  '_blank',
372
378
  'location=no,height=570,width=520,scrollbars=yes,status=yes',
373
379
  );
380
+ if (samlAuthWindow) {
381
+ popupClosedCheck = setInterval(() => {
382
+ if (samlAuthWindow.closed) {
383
+ clearInterval(popupClosedCheck);
384
+ if (samlCompletionPromise && !samlCompletionResolved) {
385
+ authEE?.emit(AuthStatus.SAML_POPUP_CLOSED_NO_AUTH);
386
+ }
387
+ }
388
+ }, 500);
389
+ }
374
390
  } else {
375
391
  samlAuthWindow.focus();
376
392
  }
377
393
  };
394
+ let samlCompletionResolved = false;
378
395
  authEE?.emit(AuthStatus.WAITING_FOR_POPUP);
379
396
  const containerEl = getDOMNode(triggerContainer);
380
397
  if (containerEl) {
@@ -386,6 +403,10 @@ async function samlPopupFlow(ssoURL: string, triggerContainer: DOMSelector, trig
386
403
  samlCompletionPromise = samlCompletionPromise || new Promise<void>((resolve, reject) => {
387
404
  window.addEventListener('message', (e) => {
388
405
  if (e.data.type === EmbedEvent.SAMLComplete) {
406
+ samlCompletionResolved = true;
407
+ if (popupClosedCheck) {
408
+ clearInterval(popupClosedCheck);
409
+ }
389
410
  (e.source as Window).close();
390
411
  resolve();
391
412
  }
@@ -531,17 +531,14 @@ describe('App embed tests', () => {
531
531
  test('Should add navigationVersion=v3 when modularHomeExperienceV3 is true to the iframe src', async () => {
532
532
  const appEmbed = new AppEmbed(getRootEl(), {
533
533
  ...defaultViewConfig,
534
- modularHomeExperienceV3: {
535
- enabled: true,
536
- homePage: 'v2',
537
- },
534
+ modularHomeExperienceV3: true,
538
535
  } as AppViewConfig);
539
536
 
540
537
  appEmbed.render();
541
538
  await executeAfterWait(() => {
542
539
  expectUrlMatchesWithParams(
543
540
  getIFrameSrc(),
544
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true&navigationVersion=v3${defaultParams}${defaultParamsPost}#/home`,
541
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&navigationVersion=v3${defaultParams}${defaultParamsPost}#/home`,
545
542
  );
546
543
  });
547
544
  });
@@ -549,17 +546,14 @@ describe('App embed tests', () => {
549
546
  test('Should not add navigationVersion when modularHomeExperienceV3 is false to the iframe src', async () => {
550
547
  const appEmbed = new AppEmbed(getRootEl(), {
551
548
  ...defaultViewConfig,
552
- modularHomeExperienceV3: {
553
- enabled: false,
554
- homePage: 'v2',
555
- },
549
+ modularHomeExperienceV3: false,
556
550
  } as AppViewConfig);
557
551
 
558
552
  appEmbed.render();
559
553
  await executeAfterWait(() => {
560
554
  expectUrlMatchesWithParams(
561
555
  getIFrameSrc(),
562
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true${defaultParams}${defaultParamsPost}#/home`,
556
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false${defaultParams}${defaultParamsPost}#/home`,
563
557
  );
564
558
  });
565
559
  });
package/src/embed/app.ts CHANGED
@@ -83,22 +83,6 @@ export enum HomePageSearchBarMode {
83
83
  AI_ANSWER = 'aiAnswer',
84
84
  NONE = 'none'
85
85
  }
86
-
87
- export interface ModularHomeExperienceV3 {
88
- /**
89
- * Enabled the modular homepage version 3.
90
- */
91
- enabled?: boolean;
92
- /**
93
- * homePage values are v2/v3,
94
- * v2 will show the modular homepage experience
95
- * v3 will show the new modular homepage v3 experience.
96
- *
97
- * @default v2
98
- */
99
- homePage?: string;
100
- }
101
-
102
86
  /**
103
87
  * The view configuration for full app embedding.
104
88
  * @group Embed components
@@ -414,14 +398,11 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
414
398
  * ```js
415
399
  * const embed = new AppEmbed('#tsEmbed', {
416
400
  * ... // other options
417
- * modularHomeExperienceV3 : {
418
- * enabled: true,
419
- * homePage: 'v2'
420
- * },
401
+ * modularHomeExperienceV3 : true,
421
402
  * })
422
403
  * ```
423
404
  */
424
- modularHomeExperienceV3?: ModularHomeExperienceV3;
405
+ modularHomeExperienceV3?: boolean;
425
406
  /**
426
407
  * Boolean to control if Liveboard header is sticky or not.
427
408
  * @example
@@ -643,6 +624,10 @@ export class AppEmbed extends V1Embed {
643
624
 
644
625
  params = this.getBaseQueryParams(params);
645
626
 
627
+ if (modularHomeExperienceV3) {
628
+ params[Param.NavigationVersion] = 'v3';
629
+ }
630
+
646
631
  if (hideObjectSearch) {
647
632
  params[Param.HideObjectSearch] = !!hideObjectSearch;
648
633
  }
@@ -715,15 +700,6 @@ export class AppEmbed extends V1Embed {
715
700
  params[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
716
701
  }
717
702
 
718
- if (modularHomeExperienceV3) {
719
- if (modularHomeExperienceV3.enabled) {
720
- params[Param.NavigationVersion] = 'v3';
721
- }
722
- if (modularHomeExperienceV3.homePage === 'v2') {
723
- params[Param.ModularHomeExperienceEnabled] = true;
724
- }
725
- }
726
-
727
703
  const queryParams = getQueryParamString(params, true);
728
704
 
729
705
  return queryParams;
@@ -1,5 +1,5 @@
1
1
  import 'jest-fetch-mock';
2
- import { BodylessConversation, BodylessConversationViewConfig } from './bodyless-conversation';
2
+ import { SpotterAgentEmbed, SpotterAgentEmbedViewConfig } from './bodyless-conversation';
3
3
  import * as authInstance from '../auth';
4
4
  import { init } from '../index';
5
5
  import { Action, AuthType, RuntimeFilterOp } from '../types';
@@ -14,7 +14,7 @@ import {
14
14
  expectUrlToHaveParamsWithValues,
15
15
  } from '../test/test-utils';
16
16
 
17
- describe('BodylessConversation', () => {
17
+ describe('SpotterAgentEmbed', () => {
18
18
  const thoughtSpotHost = 'tshost';
19
19
 
20
20
  beforeAll(() => {
@@ -117,12 +117,12 @@ describe('BodylessConversation', () => {
117
117
  },
118
118
  }),
119
119
  );
120
- const viewConfig: BodylessConversationViewConfig = {
120
+ const viewConfig: SpotterAgentEmbedViewConfig = {
121
121
  worksheetId: 'worksheetId',
122
122
  };
123
123
 
124
- const conversationEmbed = new BodylessConversation(viewConfig);
125
- const result = await conversationEmbed.sendMessage('userMessage');
124
+ const spotterEmbed = new SpotterAgentEmbed(viewConfig);
125
+ const result = await spotterEmbed.sendMessage('userMessage');
126
126
  const iframeSrc = getIFrameSrc(result.container);
127
127
  expectUrlToHaveParamsWithValues(iframeSrc, {
128
128
  sessionId: 'sessionId',
@@ -134,7 +134,7 @@ describe('BodylessConversation', () => {
134
134
  fetchMock.mockRejectOnce(
135
135
  new Error('error'),
136
136
  );
137
- const errorResult = await conversationEmbed.sendMessage('userMessage');
137
+ const errorResult = await spotterEmbed.sendMessage('userMessage');
138
138
  expect(errorResult.error instanceof Error).toBeTruthy();
139
139
  });
140
140
  });