@thoughtspot/visual-embed-sdk 1.45.1 → 1.45.3

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 (213) hide show
  1. package/cjs/package.json +1 -1
  2. package/cjs/src/authToken.d.ts +1 -1
  3. package/cjs/src/authToken.d.ts.map +1 -1
  4. package/cjs/src/authToken.js +2 -2
  5. package/cjs/src/authToken.js.map +1 -1
  6. package/cjs/src/authToken.spec.js +71 -0
  7. package/cjs/src/authToken.spec.js.map +1 -1
  8. package/cjs/src/css-variables.d.ts +48 -0
  9. package/cjs/src/css-variables.d.ts.map +1 -1
  10. package/cjs/src/embed/app.d.ts +37 -0
  11. package/cjs/src/embed/app.d.ts.map +1 -1
  12. package/cjs/src/embed/app.js +37 -1
  13. package/cjs/src/embed/app.js.map +1 -1
  14. package/cjs/src/embed/app.spec.js +24 -0
  15. package/cjs/src/embed/app.spec.js.map +1 -1
  16. package/cjs/src/embed/conversation.d.ts +127 -9
  17. package/cjs/src/embed/conversation.d.ts.map +1 -1
  18. package/cjs/src/embed/conversation.js +41 -18
  19. package/cjs/src/embed/conversation.js.map +1 -1
  20. package/cjs/src/embed/conversation.spec.js +96 -3
  21. package/cjs/src/embed/conversation.spec.js.map +1 -1
  22. package/cjs/src/embed/hostEventClient/contracts.d.ts +3 -3
  23. package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  24. package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
  25. package/cjs/src/embed/hostEventClient/host-event-client.d.ts +8 -8
  26. package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  27. package/cjs/src/embed/hostEventClient/host-event-client.js +18 -18
  28. package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
  29. package/cjs/src/embed/hostEventClient/host-event-client.spec.js +7 -7
  30. package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  31. package/cjs/src/embed/liveboard.d.ts +40 -3
  32. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  33. package/cjs/src/embed/liveboard.js +40 -12
  34. package/cjs/src/embed/liveboard.js.map +1 -1
  35. package/cjs/src/embed/liveboard.spec.js +180 -8
  36. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  37. package/cjs/src/embed/ts-embed.d.ts +23 -2
  38. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  39. package/cjs/src/embed/ts-embed.js +64 -22
  40. package/cjs/src/embed/ts-embed.js.map +1 -1
  41. package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
  42. package/cjs/src/embed/ts-embed.spec.js +138 -19
  43. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  44. package/cjs/src/errors.d.ts +1 -0
  45. package/cjs/src/errors.d.ts.map +1 -1
  46. package/cjs/src/errors.js +1 -0
  47. package/cjs/src/errors.js.map +1 -1
  48. package/cjs/src/index.d.ts +3 -3
  49. package/cjs/src/index.d.ts.map +1 -1
  50. package/cjs/src/index.js +3 -2
  51. package/cjs/src/index.js.map +1 -1
  52. package/cjs/src/types.d.ts +356 -42
  53. package/cjs/src/types.d.ts.map +1 -1
  54. package/cjs/src/types.js +227 -20
  55. package/cjs/src/types.js.map +1 -1
  56. package/cjs/src/utils/graphql/answerService/answer-queries.d.ts +1 -0
  57. package/cjs/src/utils/graphql/answerService/answer-queries.d.ts.map +1 -1
  58. package/cjs/src/utils/graphql/answerService/answer-queries.js +23 -1
  59. package/cjs/src/utils/graphql/answerService/answer-queries.js.map +1 -1
  60. package/cjs/src/utils/graphql/answerService/answerService.d.ts +2 -1
  61. package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  62. package/cjs/src/utils/graphql/answerService/answerService.js +9 -1
  63. package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
  64. package/cjs/src/utils/graphql/answerService/answerService.spec.js +73 -0
  65. package/cjs/src/utils/graphql/answerService/answerService.spec.js.map +1 -1
  66. package/cjs/src/utils/processTrigger.d.ts +3 -2
  67. package/cjs/src/utils/processTrigger.d.ts.map +1 -1
  68. package/cjs/src/utils/processTrigger.js +4 -2
  69. package/cjs/src/utils/processTrigger.js.map +1 -1
  70. package/cjs/src/utils.d.ts +20 -1
  71. package/cjs/src/utils.d.ts.map +1 -1
  72. package/cjs/src/utils.js +40 -1
  73. package/cjs/src/utils.js.map +1 -1
  74. package/cjs/src/utils.spec.js +49 -0
  75. package/cjs/src/utils.spec.js.map +1 -1
  76. package/dist/{index-Dgzjq7qH.js → index-BuwECGdm.js} +1 -1
  77. package/dist/src/authToken.d.ts +1 -1
  78. package/dist/src/authToken.d.ts.map +1 -1
  79. package/dist/src/css-variables.d.ts +48 -0
  80. package/dist/src/css-variables.d.ts.map +1 -1
  81. package/dist/src/embed/app.d.ts +37 -0
  82. package/dist/src/embed/app.d.ts.map +1 -1
  83. package/dist/src/embed/conversation.d.ts +127 -9
  84. package/dist/src/embed/conversation.d.ts.map +1 -1
  85. package/dist/src/embed/hostEventClient/contracts.d.ts +3 -3
  86. package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  87. package/dist/src/embed/hostEventClient/host-event-client.d.ts +8 -8
  88. package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  89. package/dist/src/embed/liveboard.d.ts +40 -3
  90. package/dist/src/embed/liveboard.d.ts.map +1 -1
  91. package/dist/src/embed/ts-embed.d.ts +23 -2
  92. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  93. package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
  94. package/dist/src/errors.d.ts +1 -0
  95. package/dist/src/errors.d.ts.map +1 -1
  96. package/dist/src/index.d.ts +3 -3
  97. package/dist/src/index.d.ts.map +1 -1
  98. package/dist/src/types.d.ts +356 -42
  99. package/dist/src/types.d.ts.map +1 -1
  100. package/dist/src/utils/graphql/answerService/answer-queries.d.ts +1 -0
  101. package/dist/src/utils/graphql/answerService/answer-queries.d.ts.map +1 -1
  102. package/dist/src/utils/graphql/answerService/answerService.d.ts +2 -1
  103. package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  104. package/dist/src/utils/processTrigger.d.ts +3 -2
  105. package/dist/src/utils/processTrigger.d.ts.map +1 -1
  106. package/dist/src/utils.d.ts +20 -1
  107. package/dist/src/utils.d.ts.map +1 -1
  108. package/dist/tsembed-react.es.js +501 -98
  109. package/dist/tsembed-react.js +500 -97
  110. package/dist/tsembed.es.js +516 -113
  111. package/dist/tsembed.js +29956 -29553
  112. package/dist/visual-embed-sdk-react-full.d.ts +819 -282
  113. package/dist/visual-embed-sdk-react.d.ts +818 -281
  114. package/dist/visual-embed-sdk.d.ts +882 -321
  115. package/lib/package.json +1 -1
  116. package/lib/src/authToken.d.ts +1 -1
  117. package/lib/src/authToken.d.ts.map +1 -1
  118. package/lib/src/authToken.js +2 -2
  119. package/lib/src/authToken.js.map +1 -1
  120. package/lib/src/authToken.spec.js +72 -1
  121. package/lib/src/authToken.spec.js.map +1 -1
  122. package/lib/src/css-variables.d.ts +48 -0
  123. package/lib/src/css-variables.d.ts.map +1 -1
  124. package/lib/src/embed/app.d.ts +37 -0
  125. package/lib/src/embed/app.d.ts.map +1 -1
  126. package/lib/src/embed/app.js +39 -3
  127. package/lib/src/embed/app.js.map +1 -1
  128. package/lib/src/embed/app.spec.js +24 -0
  129. package/lib/src/embed/app.spec.js.map +1 -1
  130. package/lib/src/embed/conversation.d.ts +127 -9
  131. package/lib/src/embed/conversation.d.ts.map +1 -1
  132. package/lib/src/embed/conversation.js +42 -19
  133. package/lib/src/embed/conversation.js.map +1 -1
  134. package/lib/src/embed/conversation.spec.js +96 -3
  135. package/lib/src/embed/conversation.spec.js.map +1 -1
  136. package/lib/src/embed/hostEventClient/contracts.d.ts +3 -3
  137. package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  138. package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
  139. package/lib/src/embed/hostEventClient/host-event-client.d.ts +8 -8
  140. package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  141. package/lib/src/embed/hostEventClient/host-event-client.js +18 -18
  142. package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
  143. package/lib/src/embed/hostEventClient/host-event-client.spec.js +7 -7
  144. package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  145. package/lib/src/embed/liveboard.d.ts +40 -3
  146. package/lib/src/embed/liveboard.d.ts.map +1 -1
  147. package/lib/src/embed/liveboard.js +41 -13
  148. package/lib/src/embed/liveboard.js.map +1 -1
  149. package/lib/src/embed/liveboard.spec.js +180 -8
  150. package/lib/src/embed/liveboard.spec.js.map +1 -1
  151. package/lib/src/embed/ts-embed.d.ts +23 -2
  152. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  153. package/lib/src/embed/ts-embed.js +64 -22
  154. package/lib/src/embed/ts-embed.js.map +1 -1
  155. package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
  156. package/lib/src/embed/ts-embed.spec.js +139 -20
  157. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  158. package/lib/src/errors.d.ts +1 -0
  159. package/lib/src/errors.d.ts.map +1 -1
  160. package/lib/src/errors.js +1 -0
  161. package/lib/src/errors.js.map +1 -1
  162. package/lib/src/index.d.ts +3 -3
  163. package/lib/src/index.d.ts.map +1 -1
  164. package/lib/src/index.js +2 -2
  165. package/lib/src/index.js.map +1 -1
  166. package/lib/src/types.d.ts +356 -42
  167. package/lib/src/types.d.ts.map +1 -1
  168. package/lib/src/types.js +226 -19
  169. package/lib/src/types.js.map +1 -1
  170. package/lib/src/utils/graphql/answerService/answer-queries.d.ts +1 -0
  171. package/lib/src/utils/graphql/answerService/answer-queries.d.ts.map +1 -1
  172. package/lib/src/utils/graphql/answerService/answer-queries.js +22 -0
  173. package/lib/src/utils/graphql/answerService/answer-queries.js.map +1 -1
  174. package/lib/src/utils/graphql/answerService/answerService.d.ts +2 -1
  175. package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  176. package/lib/src/utils/graphql/answerService/answerService.js +9 -1
  177. package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
  178. package/lib/src/utils/graphql/answerService/answerService.spec.js +73 -0
  179. package/lib/src/utils/graphql/answerService/answerService.spec.js.map +1 -1
  180. package/lib/src/utils/processTrigger.d.ts +3 -2
  181. package/lib/src/utils/processTrigger.d.ts.map +1 -1
  182. package/lib/src/utils/processTrigger.js +4 -2
  183. package/lib/src/utils/processTrigger.js.map +1 -1
  184. package/lib/src/utils.d.ts +20 -1
  185. package/lib/src/utils.d.ts.map +1 -1
  186. package/lib/src/utils.js +36 -0
  187. package/lib/src/utils.js.map +1 -1
  188. package/lib/src/utils.spec.js +50 -1
  189. package/lib/src/utils.spec.js.map +1 -1
  190. package/package.json +1 -1
  191. package/src/authToken.spec.ts +91 -2
  192. package/src/authToken.ts +2 -2
  193. package/src/css-variables.ts +60 -0
  194. package/src/embed/app.spec.ts +32 -0
  195. package/src/embed/app.ts +97 -1
  196. package/src/embed/conversation.spec.ts +117 -3
  197. package/src/embed/conversation.ts +188 -29
  198. package/src/embed/hostEventClient/contracts.ts +4 -4
  199. package/src/embed/hostEventClient/host-event-client.spec.ts +7 -1
  200. package/src/embed/hostEventClient/host-event-client.ts +22 -11
  201. package/src/embed/liveboard.spec.ts +264 -10
  202. package/src/embed/liveboard.ts +105 -14
  203. package/src/embed/ts-embed.spec.ts +184 -8
  204. package/src/embed/ts-embed.ts +81 -24
  205. package/src/errors.ts +1 -0
  206. package/src/index.ts +7 -1
  207. package/src/types.ts +364 -40
  208. package/src/utils/graphql/answerService/answer-queries.ts +23 -0
  209. package/src/utils/graphql/answerService/answerService.spec.ts +87 -0
  210. package/src/utils/graphql/answerService/answerService.ts +13 -1
  211. package/src/utils/processTrigger.ts +6 -3
  212. package/src/utils.spec.ts +56 -0
  213. package/src/utils.ts +44 -0
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.45.1 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.45.3 */
2
2
  'use client';
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
@@ -1867,6 +1867,54 @@
1867
1867
  * @version SDK: 1.43.0 | ThoughtSpot: 10.15.0.cl
1868
1868
  */
1869
1869
  EmbedEvent["ApiIntercept"] = "ApiIntercept";
1870
+ /**
1871
+ * Emitted when a Spotter conversation is renamed.
1872
+ * @example
1873
+ * ```js
1874
+ * spotterEmbed.on(EmbedEvent.SpotterConversationRenamed, (payload) => {
1875
+ * console.log('Conversation renamed', payload);
1876
+ * // payload: { convId: string, oldTitle: string, newTitle: string }
1877
+ * })
1878
+ * ```
1879
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
1880
+ */
1881
+ EmbedEvent["SpotterConversationRenamed"] = "spotterConversationRenamed";
1882
+ /**
1883
+ * Emitted when a Spotter conversation is deleted.
1884
+ * @example
1885
+ * ```js
1886
+ * spotterEmbed.on(EmbedEvent.SpotterConversationDeleted, (payload) => {
1887
+ * console.log('Conversation deleted', payload);
1888
+ * // payload: { convId: string, title: string }
1889
+ * })
1890
+ * ```
1891
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
1892
+ */
1893
+ EmbedEvent["SpotterConversationDeleted"] = "spotterConversationDeleted";
1894
+ /**
1895
+ * Emitted when a Spotter conversation is selected/clicked.
1896
+ * @example
1897
+ * ```js
1898
+ * spotterEmbed.on(EmbedEvent.SpotterConversationSelected, (payload) => {
1899
+ * console.log('Conversation selected', payload);
1900
+ * // payload: { convId: string, title: string, worksheetId: string }
1901
+ * })
1902
+ * ```
1903
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
1904
+ */
1905
+ EmbedEvent["SpotterConversationSelected"] = "spotterConversationSelected";
1906
+ /**
1907
+ * @hidden
1908
+ * Emitted when the auth token is about to get expired and needs to be refreshed.
1909
+ * @example
1910
+ * ```js
1911
+ * embed.on(EmbedEvent.RefreshAuthToken, (payload) => {
1912
+ * console.log('payload', payload);
1913
+ * })
1914
+ * ```
1915
+ * @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl
1916
+ */
1917
+ EmbedEvent["RefreshAuthToken"] = "RefreshAuthToken";
1870
1918
  })(exports.EmbedEvent || (exports.EmbedEvent = {}));
1871
1919
  /**
1872
1920
  * Event types that can be triggered by the host application
@@ -3250,6 +3298,17 @@
3250
3298
  * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
3251
3299
  */
3252
3300
  HostEvent["StartNewSpotterConversation"] = "StartNewSpotterConversation";
3301
+ /**
3302
+ * @hidden
3303
+ * Get the current context of the embedded page.
3304
+ *
3305
+ * @example
3306
+ * ```js
3307
+ * const context = await liveboardEmbed.trigger(HostEvent.GetPageContext);
3308
+ * ```
3309
+ * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
3310
+ */
3311
+ HostEvent["GetPageContext"] = "GetPageContext";
3253
3312
  })(exports.HostEvent || (exports.HostEvent = {}));
3254
3313
  /**
3255
3314
  * The different visual modes that the data sources panel within
@@ -3406,7 +3465,19 @@
3406
3465
  Param["isLinkParametersEnabled"] = "isLinkParametersEnabled";
3407
3466
  Param["EnablePastConversationsSidebar"] = "enablePastConversationsSidebar";
3408
3467
  Param["UpdatedSpotterChatPrompt"] = "updatedSpotterChatPrompt";
3468
+ Param["SpotterSidebarTitle"] = "spotterSidebarTitle";
3469
+ Param["SpotterSidebarDefaultExpanded"] = "spotterSidebarDefaultExpanded";
3470
+ Param["SpotterChatRenameLabel"] = "spotterChatRenameLabel";
3471
+ Param["SpotterChatDeleteLabel"] = "spotterChatDeleteLabel";
3472
+ Param["SpotterDeleteConversationModalTitle"] = "spotterDeleteConversationModalTitle";
3473
+ Param["SpotterPastConversationAlertMessage"] = "spotterPastConversationAlertMessage";
3474
+ Param["SpotterDocumentationUrl"] = "spotterDocumentationUrl";
3475
+ Param["SpotterBestPracticesLabel"] = "spotterBestPracticesLabel";
3476
+ Param["SpotterConversationsBatchSize"] = "spotterConversationsBatchSize";
3477
+ Param["SpotterNewChatButtonTitle"] = "spotterNewChatButtonTitle";
3409
3478
  Param["IsThisPeriodInDateFiltersEnabled"] = "isThisPeriodInDateFiltersEnabled";
3479
+ Param["HideToolResponseCardBranding"] = "hideToolResponseCardBranding";
3480
+ Param["ToolResponseCardBrandingLabel"] = "toolResponseCardBrandingLabel";
3410
3481
  })(Param || (Param = {}));
3411
3482
  /**
3412
3483
  * ThoughtSpot application pages include actions and menu commands
@@ -4832,6 +4903,96 @@
4832
4903
  * @version SDK: 1.44.0 | ThoughtSpot Cloud: 26.2.0.cl
4833
4904
  */
4834
4905
  Action["UngroupLiveboardGroup"] = "ungroupLiveboardGroup";
4906
+ /**
4907
+ * Controls visibility of the sidebar header (title and toggle button)
4908
+ * in the Spotter past conversations sidebar.
4909
+ * @example
4910
+ * ```js
4911
+ * hiddenActions: [Action.SpotterSidebarHeader]
4912
+ * ```
4913
+ * @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
4914
+ */
4915
+ Action["SpotterSidebarHeader"] = "spotterSidebarHeader";
4916
+ /**
4917
+ * Controls visibility of the sidebar footer (documentation link)
4918
+ * in the Spotter past conversations sidebar.
4919
+ * @example
4920
+ * ```js
4921
+ * hiddenActions: [Action.SpotterSidebarFooter]
4922
+ * ```
4923
+ * @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
4924
+ */
4925
+ Action["SpotterSidebarFooter"] = "spotterSidebarFooter";
4926
+ /**
4927
+ * Controls visibility and disable state of the sidebar toggle/expand button
4928
+ * in the Spotter past conversations sidebar.
4929
+ * @example
4930
+ * ```js
4931
+ * disabledActions: [Action.SpotterSidebarToggle]
4932
+ * ```
4933
+ * @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
4934
+ */
4935
+ Action["SpotterSidebarToggle"] = "spotterSidebarToggle";
4936
+ /**
4937
+ * Controls visibility and disable state of the "New Chat" button
4938
+ * in the Spotter past conversations sidebar.
4939
+ * @example
4940
+ * ```js
4941
+ * disabledActions: [Action.SpotterNewChat]
4942
+ * ```
4943
+ * @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
4944
+ */
4945
+ Action["SpotterNewChat"] = "spotterNewChat";
4946
+ /**
4947
+ * Controls visibility of the past conversation banner alert
4948
+ * in the Spotter interface.
4949
+ * @example
4950
+ * ```js
4951
+ * hiddenActions: [Action.SpotterPastChatBanner]
4952
+ * ```
4953
+ * @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
4954
+ */
4955
+ Action["SpotterPastChatBanner"] = "spotterPastChatBanner";
4956
+ /**
4957
+ * Controls visibility and disable state of the conversation edit menu
4958
+ * (three-dot menu) in the Spotter past conversations sidebar.
4959
+ * @example
4960
+ * ```js
4961
+ * disabledActions: [Action.SpotterChatMenu]
4962
+ * ```
4963
+ * @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
4964
+ */
4965
+ Action["SpotterChatMenu"] = "spotterChatMenu";
4966
+ /**
4967
+ * Controls visibility and disable state of the rename action
4968
+ * in the Spotter conversation edit menu.
4969
+ * @example
4970
+ * ```js
4971
+ * disabledActions: [Action.SpotterChatRename]
4972
+ * ```
4973
+ * @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
4974
+ */
4975
+ Action["SpotterChatRename"] = "spotterChatRename";
4976
+ /**
4977
+ * Controls visibility and disable state of the delete action
4978
+ * in the Spotter conversation edit menu.
4979
+ * @example
4980
+ * ```js
4981
+ * disabledActions: [Action.SpotterChatDelete]
4982
+ * ```
4983
+ * @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
4984
+ */
4985
+ Action["SpotterChatDelete"] = "spotterChatDelete";
4986
+ /**
4987
+ * Controls visibility and disable state of the documentation/best practices
4988
+ * link in the Spotter sidebar footer.
4989
+ * @example
4990
+ * ```js
4991
+ * disabledActions: [Action.SpotterDocs]
4992
+ * ```
4993
+ * @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
4994
+ */
4995
+ Action["SpotterDocs"] = "spotterDocs";
4835
4996
  /**
4836
4997
  * The **Include current period** checkbox for date filters.
4837
4998
  * Controls the visibility and availability of the option to include
@@ -4970,13 +5131,30 @@
4970
5131
  * Error types emitted by embedded components.
4971
5132
  *
4972
5133
  * These enum values categorize different types of errors that can occur during
4973
- * the lifecycle of an embedded ThoughtSpot component. Use these values to implement
4974
- * specific error handling logic based on the error category.
4975
- *
4976
- * @see {@link EmbedErrorDetailsEvent} - The error event object structure
4977
- * @see {@link EmbedEvent.Error} - The event that emits these errors
5134
+ * the lifecycle of an embedded ThoughtSpot component.
5135
+ * Use {@link EmbedErrorDetailsEvent} and {@link EmbedErrorCodes} to handle specific errors.
4978
5136
  * @version SDK: 1.44.2 | ThoughtSpot: 26.2.0.cl
4979
5137
  * @group Error Handling
5138
+ *
5139
+ * @example
5140
+ * Handle specific error types
5141
+ * ```js
5142
+ * embed.on(EmbedEvent.Error, (error) => {
5143
+ * switch (error.errorType) {
5144
+ * case ErrorDetailsTypes.API:
5145
+ * console.error('API error:', error.message);
5146
+ * break;
5147
+ * case ErrorDetailsTypes.VALIDATION_ERROR:
5148
+ * console.error('Validation error:', error.message);
5149
+ * break;
5150
+ * case ErrorDetailsTypes.NETWORK:
5151
+ * console.error('Network error:', error.message);
5152
+ * break;
5153
+ * default:
5154
+ * console.error('Unknown error:', error);
5155
+ * }
5156
+ * });
5157
+ * ```
4980
5158
  */
4981
5159
  var ErrorDetailsTypes;
4982
5160
  (function (ErrorDetailsTypes) {
@@ -4988,35 +5166,43 @@
4988
5166
  ErrorDetailsTypes["NETWORK"] = "NETWORK";
4989
5167
  })(ErrorDetailsTypes || (ErrorDetailsTypes = {}));
4990
5168
  /**
4991
- * Error codes for identifying specific issues in embedded ThoughtSpot components.
4992
- *
4993
- * Use these codes for precise error handling and debugging. Each code maps to a
4994
- * distinct failure scenario, enabling targeted recovery strategies.
5169
+ * Error codes for identifying specific issues in embedded ThoughtSpot components. Use {@link EmbedErrorDetailsEvent} and {@link ErrorDetailsTypes} codes for precise error handling and debugging.
4995
5170
  *
4996
5171
  * @version SDK: 1.44.2 | ThoughtSpot: 26.2.0.cl
4997
5172
  * @group Error Handling
4998
- *
4999
- * @see {@link EmbedErrorDetailsEvent} - The error event object that includes these codes
5000
- * @see {@link ErrorDetailsTypes} - General error type categories
5001
- *
5173
+
5002
5174
  * @example
5003
5175
  * Handle specific error codes in the error event handler
5004
- *
5176
+ * ```js
5005
5177
  * embed.on(EmbedEvent.Error, (error) => {
5006
- * if (error.code === EmbedErrorCodes.WORKSHEET_ID_NOT_FOUND) {
5007
- * console.error('Worksheet ID not found:', error.message);
5178
+ * switch (error.code) {
5179
+ * case EmbedErrorCodes.WORKSHEET_ID_NOT_FOUND:
5180
+ * console.error('Worksheet ID not found:', error.message);
5181
+ * break;
5182
+ * case EmbedErrorCodes.LIVEBOARD_ID_MISSING:
5183
+ * console.error('Liveboard ID is missing:', error.message);
5184
+ * break;
5185
+ * case EmbedErrorCodes.CONFLICTING_ACTIONS_CONFIG:
5186
+ * console.error('Conflicting actions configuration:', error.message);
5187
+ * break;
5188
+ * case EmbedErrorCodes.CONFLICTING_TABS_CONFIG:
5189
+ * console.error('Conflicting tabs configuration:', error.message);
5190
+ * break;
5191
+ * default:
5192
+ * console.error('Unknown error:', error);
5008
5193
  * }
5009
5194
  * });
5010
- * */
5195
+ * ```
5196
+ * */
5011
5197
  var EmbedErrorCodes;
5012
5198
  (function (EmbedErrorCodes) {
5013
5199
  /** Worksheet ID not found or does not exist */
5014
5200
  EmbedErrorCodes["WORKSHEET_ID_NOT_FOUND"] = "WORKSHEET_ID_NOT_FOUND";
5015
5201
  /** Required Liveboard ID is missing from configuration */
5016
5202
  EmbedErrorCodes["LIVEBOARD_ID_MISSING"] = "LIVEBOARD_ID_MISSING";
5017
- /** Conflicting action configuration detected (e.g., both hiddenActions and visibleActions specified) */
5203
+ /** Conflicting action configuration detected */
5018
5204
  EmbedErrorCodes["CONFLICTING_ACTIONS_CONFIG"] = "CONFLICTING_ACTIONS_CONFIG";
5019
- /** Conflicting tab configuration detected (e.g., both hiddenTabs and visibleTabs specified) */
5205
+ /** Conflicting tab configuration detected */
5020
5206
  EmbedErrorCodes["CONFLICTING_TABS_CONFIG"] = "CONFLICTING_TABS_CONFIG";
5021
5207
  /** Error during component initialization */
5022
5208
  EmbedErrorCodes["INIT_ERROR"] = "INIT_ERROR";
@@ -5034,7 +5220,28 @@
5034
5220
  EmbedErrorCodes["PARSING_API_INTERCEPT_BODY_ERROR"] = "PARSING_API_INTERCEPT_BODY_ERROR";
5035
5221
  /** Failed to update embed parameters during pre-render */
5036
5222
  EmbedErrorCodes["UPDATE_PARAMS_FAILED"] = "UPDATE_PARAMS_FAILED";
5223
+ /** Invalid URL provided in configuration */
5224
+ EmbedErrorCodes["INVALID_URL"] = "INVALID_URL";
5037
5225
  })(EmbedErrorCodes || (EmbedErrorCodes = {}));
5226
+ var ContextType;
5227
+ (function (ContextType) {
5228
+ /**
5229
+ * Search answer context for search page or edit viz dialog on liveboard page.
5230
+ */
5231
+ ContextType["Search"] = "search-answer";
5232
+ /**
5233
+ * Liveboard context for liveboard page.
5234
+ */
5235
+ ContextType["Liveboard"] = "liveboard";
5236
+ /**
5237
+ * Answer context for explore modal/page on liveboard page.
5238
+ */
5239
+ ContextType["Answer"] = "answer";
5240
+ /**
5241
+ * Spotter context for spotter modal/page.
5242
+ */
5243
+ ContextType["Spotter"] = "spotter";
5244
+ })(ContextType || (ContextType = {}));
5038
5245
  /**
5039
5246
  * Enum for the type of API intercepted
5040
5247
  */
@@ -5155,6 +5362,7 @@
5155
5362
  ERROR_PARSING_API_INTERCEPT_BODY: 'Error parsing api intercept body',
5156
5363
  SSR_ENVIRONMENT_ERROR: 'SSR environment detected. This function cannot be called in SSR environment.',
5157
5364
  UPDATE_PARAMS_FAILED: 'Failed to update embed parameters',
5365
+ INVALID_SPOTTER_DOCUMENTATION_URL: 'Invalid spotterDocumentationUrl. Please provide a valid http or https URL.',
5158
5366
  };
5159
5367
  const CUSTOM_ACTIONS_ERROR_MESSAGE = {
5160
5368
  INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
@@ -5621,6 +5829,12 @@
5621
5829
  return values[key] !== undefined ? String(values[key]) : match;
5622
5830
  });
5623
5831
  };
5832
+ const getHostEventsConfig = (viewConfig) => {
5833
+ return {
5834
+ shouldBypassPayloadValidation: viewConfig.shouldBypassPayloadValidation,
5835
+ useHostEventsV2: viewConfig.useHostEventsV2,
5836
+ };
5837
+ };
5624
5838
  /**
5625
5839
  * Check if the window is undefined
5626
5840
  * If the window is undefined, it means the code is running in a SSR environment.
@@ -5633,6 +5847,36 @@
5633
5847
  return true;
5634
5848
  }
5635
5849
  return false;
5850
+ };
5851
+ /**
5852
+ * Validates that a URL uses only http: or https: protocols.
5853
+ * Returns a tuple of [isValid, error] so the caller can handle validation errors.
5854
+ * @param url - The URL string to validate
5855
+ * @returns [true, null] if valid, [false, Error] if invalid
5856
+ */
5857
+ const validateHttpUrl = (url) => {
5858
+ try {
5859
+ const parsedUrl = new URL(url);
5860
+ if (parsedUrl.protocol !== 'http:' && parsedUrl.protocol !== 'https:') {
5861
+ return [false, new Error(`Invalid protocol: ${parsedUrl.protocol}. Only http: and https: are allowed.`)];
5862
+ }
5863
+ return [true, null];
5864
+ }
5865
+ catch (error) {
5866
+ return [false, error instanceof Error ? error : new Error(String(error))];
5867
+ }
5868
+ };
5869
+ /**
5870
+ * Sets a query parameter if the value is defined.
5871
+ * @param queryParams - The query params object to modify
5872
+ * @param param - The parameter key
5873
+ * @param value - The value to set
5874
+ * @param asBoolean - If true, coerces value to boolean
5875
+ */
5876
+ const setParamIfDefined = (queryParams, param, value, asBoolean = false) => {
5877
+ if (value !== undefined) {
5878
+ queryParams[param] = asBoolean ? !!value : value;
5879
+ }
5636
5880
  };
5637
5881
 
5638
5882
  /**
@@ -8044,11 +8288,11 @@
8044
8288
  *
8045
8289
  * @param embedConfig
8046
8290
  */
8047
- async function getAuthenticationToken(embedConfig) {
8291
+ async function getAuthenticationToken(embedConfig, skipvalidation = false) {
8048
8292
  const cachedAuthToken = getCacheAuthToken();
8049
8293
  // Since we don't have token validation enabled , we cannot tell if the
8050
8294
  // cached token is valid or not. So we will always fetch a new token.
8051
- if (cachedAuthToken && !embedConfig.disableTokenVerification) {
8295
+ if (cachedAuthToken && !embedConfig.disableTokenVerification && !skipvalidation) {
8052
8296
  let isCachedTokenStillValid;
8053
8297
  try {
8054
8298
  isCachedTokenStillValid = await validateAuthToken(embedConfig, cachedAuthToken, true);
@@ -8492,6 +8736,28 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
8492
8736
  sql
8493
8737
  }
8494
8738
  }
8739
+ `;
8740
+ const updateDisplayMode = `
8741
+ mutation UpdateDisplayMode(
8742
+ $session: BachSessionIdInput!
8743
+ $displayMode: DisplayMode
8744
+ ) {
8745
+ Answer__updateProperties(session: $session, displayMode: $displayMode) {
8746
+ id {
8747
+ sessionId
8748
+ genNo
8749
+ acSession {
8750
+ sessionId
8751
+ genNo
8752
+ }
8753
+ }
8754
+ answer {
8755
+ id
8756
+ displayMode
8757
+ suggestedDisplayMode
8758
+ }
8759
+ }
8760
+ }
8495
8761
  `;
8496
8762
  const getAnswerTML = `
8497
8763
  mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies: Boolean, $formatType: EDocFormatType, $exportPermissions: Boolean, $exportFqn: Boolean) {
@@ -8660,7 +8926,15 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
8660
8926
  },
8661
8927
  });
8662
8928
  }
8663
- async getSQLQuery() {
8929
+ async updateDisplayMode(displayMode = "TABLE_MODE") {
8930
+ return this.executeQuery(updateDisplayMode, {
8931
+ displayMode,
8932
+ });
8933
+ }
8934
+ async getSQLQuery(fetchSQLWithAllColumns = false) {
8935
+ if (fetchSQLWithAllColumns) {
8936
+ await this.updateDisplayMode("TABLE_MODE");
8937
+ }
8664
8938
  const { sql } = await this.executeQuery(getSQLQuery, {});
8665
8939
  return sql;
8666
8940
  }
@@ -17678,6 +17952,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17678
17952
  * @param message
17679
17953
  * @param message.type
17680
17954
  * @param message.data
17955
+ * @param message.context
17681
17956
  * @param thoughtSpotHost
17682
17957
  * @param channel
17683
17958
  */
@@ -17692,8 +17967,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17692
17967
  * @param messageType
17693
17968
  * @param thoughtSpotHost
17694
17969
  * @param data
17970
+ * @param context
17695
17971
  */
17696
- function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
17972
+ function processTrigger(iFrame, messageType, thoughtSpotHost, data, context) {
17697
17973
  return new Promise((res, rej) => {
17698
17974
  var _a;
17699
17975
  if (messageType === exports.HostEvent.Reload) {
@@ -17727,7 +18003,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17727
18003
  channel.port1.close();
17728
18004
  res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
17729
18005
  }, TRIGGER_TIMEOUT);
17730
- return postIframeMessage(iFrame, { type: messageType, data }, thoughtSpotHost, channel);
18006
+ return postIframeMessage(iFrame, { type: messageType, data, context }, thoughtSpotHost, channel);
17731
18007
  });
17732
18008
  }
17733
18009
 
@@ -18073,7 +18349,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
18073
18349
  return eventData;
18074
18350
  }
18075
18351
 
18076
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.45.1";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | npx coveralls-next","is-publish-allowed":"node scripts/is-publish-allowed.js",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","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.23","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^11.2.0","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^30.0.0","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^30.2.0","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1","coveralls-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle-generator":"^9.5.1",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^2.0.0",jest:"^30.2.0","jest-environment-jsdom":"^29.7.0","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^29.4.6","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"32 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
18352
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.45.3";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | npx coveralls-next","is-publish-allowed":"node scripts/is-publish-allowed.js",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","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.23","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^11.2.0","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^30.0.0","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^30.2.0","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1","coveralls-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle-generator":"^9.5.1",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^2.0.0",jest:"^30.2.0","jest-environment-jsdom":"^29.7.0","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^29.4.6","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"32 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
18077
18353
 
18078
18354
  class HostEventClient {
18079
18355
  constructor(iFrame) {
@@ -18085,16 +18361,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
18085
18361
  * @param {any} data Data to send with the host event
18086
18362
  * @returns {Promise<any>} - the response from the process trigger
18087
18363
  */
18088
- async processTrigger(message, data) {
18364
+ async processTrigger(message, data, context) {
18089
18365
  if (!this.iFrame) {
18090
18366
  throw new Error('Iframe element is not set');
18091
18367
  }
18092
18368
  const thoughtspotHost = getEmbedConfig().thoughtSpotHost;
18093
- return processTrigger(this.iFrame, message, thoughtspotHost, data);
18369
+ return processTrigger(this.iFrame, message, thoughtspotHost, data, context);
18094
18370
  }
18095
- async handleHostEventWithParam(apiName, parameters) {
18371
+ async handleHostEventWithParam(apiName, parameters, context) {
18096
18372
  var _a, _b, _c, _d;
18097
- const response = (_b = (_a = (await this.triggerUIPassthroughApi(apiName, parameters))) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.call(_a, (r) => r.error || r.value)[0];
18373
+ const response = (_b = (_a = (await this.triggerUIPassthroughApi(apiName, parameters, context))) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.call(_a, (r) => r.error || r.value)[0];
18098
18374
  if (!response) {
18099
18375
  const error = `No answer found${parameters.vizId ? ` for vizId: ${parameters.vizId}` : ''}.`;
18100
18376
  // eslint-disable-next-line no-throw-literal
@@ -18109,8 +18385,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
18109
18385
  }
18110
18386
  return { ...response.value };
18111
18387
  }
18112
- async hostEventFallback(hostEvent, data) {
18113
- return this.processTrigger(hostEvent, data);
18388
+ async hostEventFallback(hostEvent, data, context) {
18389
+ return this.processTrigger(hostEvent, data, context);
18114
18390
  }
18115
18391
  /**
18116
18392
  * Setter for the iframe element used for host events
@@ -18119,49 +18395,49 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
18119
18395
  setIframeElement(iFrame) {
18120
18396
  this.iFrame = iFrame;
18121
18397
  }
18122
- async triggerUIPassthroughApi(apiName, parameters) {
18398
+ async triggerUIPassthroughApi(apiName, parameters, context) {
18123
18399
  const res = await this.processTrigger(exports.HostEvent.UIPassthrough, {
18124
18400
  type: apiName,
18125
18401
  parameters,
18126
- });
18402
+ }, context);
18127
18403
  return res;
18128
18404
  }
18129
- async handlePinEvent(payload) {
18405
+ async handlePinEvent(payload, context) {
18130
18406
  var _a, _b;
18131
18407
  if (!payload || !('newVizName' in payload)) {
18132
- return this.hostEventFallback(exports.HostEvent.Pin, payload);
18408
+ return this.hostEventFallback(exports.HostEvent.Pin, payload, context);
18133
18409
  }
18134
18410
  const formattedPayload = {
18135
18411
  ...payload,
18136
18412
  pinboardId: (_a = payload.liveboardId) !== null && _a !== void 0 ? _a : payload.pinboardId,
18137
18413
  newPinboardName: (_b = payload.newLiveboardName) !== null && _b !== void 0 ? _b : payload.newPinboardName,
18138
18414
  };
18139
- const data = await this.handleHostEventWithParam(UIPassthroughEvent.PinAnswerToLiveboard, formattedPayload);
18415
+ const data = await this.handleHostEventWithParam(UIPassthroughEvent.PinAnswerToLiveboard, formattedPayload, context);
18140
18416
  return {
18141
18417
  ...data,
18142
18418
  liveboardId: data.pinboardId,
18143
18419
  };
18144
18420
  }
18145
- async handleSaveAnswerEvent(payload) {
18421
+ async handleSaveAnswerEvent(payload, context) {
18146
18422
  var _a, _b, _c, _d;
18147
18423
  if (!payload || !('name' in payload) || !('description' in payload)) {
18148
18424
  // Save is the fallback for SaveAnswer
18149
- return this.hostEventFallback(exports.HostEvent.Save, payload);
18425
+ return this.hostEventFallback(exports.HostEvent.Save, payload, context);
18150
18426
  }
18151
- const data = await this.handleHostEventWithParam(UIPassthroughEvent.SaveAnswer, payload);
18427
+ const data = await this.handleHostEventWithParam(UIPassthroughEvent.SaveAnswer, payload, context);
18152
18428
  return {
18153
18429
  ...data,
18154
18430
  answerId: (_d = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.saveResponse) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.Answer__save) === null || _c === void 0 ? void 0 : _c.answer) === null || _d === void 0 ? void 0 : _d.id,
18155
18431
  };
18156
18432
  }
18157
- async triggerHostEvent(hostEvent, payload) {
18433
+ async triggerHostEvent(hostEvent, payload, context) {
18158
18434
  switch (hostEvent) {
18159
18435
  case exports.HostEvent.Pin:
18160
- return this.handlePinEvent(payload);
18436
+ return this.handlePinEvent(payload, context);
18161
18437
  case exports.HostEvent.SaveAnswer:
18162
- return this.handleSaveAnswerEvent(payload);
18438
+ return this.handleSaveAnswerEvent(payload, context);
18163
18439
  default:
18164
- return this.hostEventFallback(hostEvent, payload);
18440
+ return this.hostEventFallback(hostEvent, payload, context);
18165
18441
  }
18166
18442
  }
18167
18443
  }
@@ -18422,31 +18698,39 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
18422
18698
  logger$3.error(`AppInit failed, Error : ${e === null || e === void 0 ? void 0 : e.message}`);
18423
18699
  }
18424
18700
  };
18701
+ this.handleAuthFailure = (error) => {
18702
+ logger$3.error(`${ERROR_MESSAGE.INVALID_TOKEN_ERROR} Error : ${error === null || error === void 0 ? void 0 : error.message}`);
18703
+ processAuthFailure(error, this.isPreRendered ? this.preRenderWrapper : this.el);
18704
+ };
18705
+ /**
18706
+ * Refresh the auth token if the autoLogin is true and the authType is TrustedAuthTokenCookieless
18707
+ * @param _
18708
+ * @param responder
18709
+ */
18710
+ this.tokenRefresh = async (_, responder) => {
18711
+ try {
18712
+ await this.refreshAuthTokenForCookieless(responder, exports.EmbedEvent.RefreshAuthToken, true);
18713
+ }
18714
+ catch (e) {
18715
+ this.handleAuthFailure(e);
18716
+ }
18717
+ };
18425
18718
  /**
18426
18719
  * Sends updated auth token to the iFrame to avoid user logout
18427
18720
  * @param _
18428
18721
  * @param responder
18429
18722
  */
18430
18723
  this.updateAuthToken = async (_, responder) => {
18431
- const { authType } = this.embedConfig;
18432
- let { autoLogin } = this.embedConfig;
18433
- // Default autoLogin: true for cookieless if undefined/null, otherwise
18434
- // false
18435
- autoLogin = autoLogin !== null && autoLogin !== void 0 ? autoLogin : (authType === AuthType.TrustedAuthTokenCookieless);
18436
- if (autoLogin && authType === AuthType.TrustedAuthTokenCookieless) {
18437
- try {
18438
- const authToken = await getAuthenticationToken(this.embedConfig);
18439
- responder({
18440
- type: exports.EmbedEvent.AuthExpire,
18441
- data: { authToken },
18442
- });
18443
- }
18444
- catch (e) {
18445
- logger$3.error(`${ERROR_MESSAGE.INVALID_TOKEN_ERROR} Error : ${e === null || e === void 0 ? void 0 : e.message}`);
18446
- processAuthFailure(e, this.isPreRendered ? this.preRenderWrapper : this.el);
18447
- }
18724
+ const { authType, autoLogin: autoLoginConfig } = this.embedConfig;
18725
+ // Default autoLogin: true for cookieless if undefined/null, otherwise false
18726
+ const autoLogin = autoLoginConfig !== null && autoLoginConfig !== void 0 ? autoLoginConfig : (authType === AuthType.TrustedAuthTokenCookieless);
18727
+ try {
18728
+ await this.refreshAuthTokenForCookieless(responder, exports.EmbedEvent.AuthExpire, false);
18448
18729
  }
18449
- else if (autoLogin) {
18730
+ catch (e) {
18731
+ this.handleAuthFailure(e);
18732
+ }
18733
+ if (autoLogin && authType !== AuthType.TrustedAuthTokenCookieless) {
18450
18734
  handleAuth();
18451
18735
  }
18452
18736
  notifyAuthFailure(AuthFailureType.EXPIRY);
@@ -18467,8 +18751,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
18467
18751
  });
18468
18752
  }
18469
18753
  catch (e) {
18470
- logger$3.error(`${ERROR_MESSAGE.INVALID_TOKEN_ERROR} Error : ${e === null || e === void 0 ? void 0 : e.message}`);
18471
- processAuthFailure(e, this.isPreRendered ? this.preRenderWrapper : this.el);
18754
+ this.handleAuthFailure(e);
18472
18755
  }
18473
18756
  }).catch((e) => {
18474
18757
  logger$3.error(`Auto Login failed, Error : ${e === null || e === void 0 ? void 0 : e.message}`);
@@ -18486,6 +18769,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
18486
18769
  this.on(exports.EmbedEvent.EmbedListenerReady, embedListenerReadyHandler, { start: false }, true);
18487
18770
  const authInitHandler = this.createEmbedContainerHandler(exports.EmbedEvent.AuthInit);
18488
18771
  this.on(exports.EmbedEvent.AuthInit, authInitHandler, { start: false }, true);
18772
+ this.on(exports.EmbedEvent.RefreshAuthToken, this.tokenRefresh, { start: false }, true);
18489
18773
  };
18490
18774
  this.showPreRenderByDefault = false;
18491
18775
  /**
@@ -18795,13 +19079,33 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
18795
19079
  customVariablesForThirdPartyTools: this.embedConfig.customVariablesForThirdPartyTools || {},
18796
19080
  hiddenListColumns: this.viewConfig.hiddenListColumns || [],
18797
19081
  customActions: customActionsResult.actions,
19082
+ embedExpiryInAuthToken: this.viewConfig.refreshAuthTokenOnNearExpiry,
18798
19083
  ...getInterceptInitData(this.viewConfig),
19084
+ ...getHostEventsConfig(this.viewConfig),
18799
19085
  };
18800
19086
  return baseInitData;
18801
19087
  }
18802
19088
  async getAppInitData() {
18803
19089
  return this.getDefaultAppInitData();
18804
19090
  }
19091
+ /**
19092
+ * Helper method to refresh/update auth token for TrustedAuthTokenCookieless auth type
19093
+ * @param responder - Function to send response back
19094
+ * @param eventType - The embed event type to send
19095
+ * @param forceRefresh - Whether to force refresh the token
19096
+ * @returns Promise that resolves if token was refreshed, rejects otherwise
19097
+ */
19098
+ async refreshAuthTokenForCookieless(responder, eventType, forceRefresh = false) {
19099
+ const { authType, autoLogin } = this.embedConfig;
19100
+ const isAutoLoginTrue = autoLogin !== null && autoLogin !== void 0 ? autoLogin : (authType === AuthType.TrustedAuthTokenCookieless);
19101
+ if (isAutoLoginTrue && authType === AuthType.TrustedAuthTokenCookieless) {
19102
+ const authToken = await getAuthenticationToken(this.embedConfig, forceRefresh);
19103
+ responder({
19104
+ type: eventType,
19105
+ data: { authToken },
19106
+ });
19107
+ }
19108
+ }
18805
19109
  /**
18806
19110
  * Constructs the base URL string to load the ThoughtSpot app.
18807
19111
  * @param query
@@ -19420,7 +19724,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
19420
19724
  * @param {any} data The payload to send with the message
19421
19725
  * @returns A promise that resolves with the response from the embedded app
19422
19726
  */
19423
- async trigger(messageType, data = {}) {
19727
+ async trigger(messageType, data = {}, context) {
19424
19728
  uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
19425
19729
  if (!this.isRendered) {
19426
19730
  this.handleError({
@@ -19447,7 +19751,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
19447
19751
  return null;
19448
19752
  }
19449
19753
  // send an empty object, this is needed for liveboard default handlers
19450
- return this.hostEventClient.triggerHostEvent(messageType, data);
19754
+ return this.hostEventClient.triggerHostEvent(messageType, data, context);
19451
19755
  }
19452
19756
  /**
19453
19757
  * Triggers an event to the embedded app, skipping the UI flow.
@@ -19480,6 +19784,19 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
19480
19784
  handleRenderForPrerender() {
19481
19785
  return this.render();
19482
19786
  }
19787
+ /**
19788
+ * Get the current context of the embedded TS component.
19789
+ * @returns The current context object containing the page type and object ids.
19790
+ * @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl
19791
+ */
19792
+ async getCurrentContext() {
19793
+ return new Promise((resolve) => {
19794
+ this.executeAfterEmbedContainerLoaded(async () => {
19795
+ const context = await this.trigger(exports.HostEvent.GetPageContext, {});
19796
+ resolve(context);
19797
+ });
19798
+ });
19799
+ }
19483
19800
  /**
19484
19801
  * Creates the preRender shell
19485
19802
  * @param showPreRenderByDefault - Show the preRender after render, hidden by default
@@ -20338,7 +20655,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
20338
20655
  * embedded Liveboard or visualization.
20339
20656
  */
20340
20657
  getEmbedParams() {
20341
- const { tag, hideTagFilterChips, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled = false, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, isEnhancedFilterInteractivityEnabled = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled = false, isGranularXLSXCSVSchedulesEnabled = false, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, minimumHeight, isThisPeriodInDateFiltersEnabled, } = this.viewConfig;
20658
+ const { tag, hideTagFilterChips, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled = false, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, isEnhancedFilterInteractivityEnabled = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled = false, isGranularXLSXCSVSchedulesEnabled = false, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, spotterSidebarConfig, spotterChatConfig, minimumHeight, isThisPeriodInDateFiltersEnabled, } = this.viewConfig;
20342
20659
  let params = {};
20343
20660
  params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
20344
20661
  params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
@@ -20362,6 +20679,41 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
20362
20679
  if (!isUndefined$1(updatedSpotterChatPrompt)) {
20363
20680
  params[Param.UpdatedSpotterChatPrompt] = !!updatedSpotterChatPrompt;
20364
20681
  }
20682
+ // Handle spotterSidebarConfig params
20683
+ if (spotterSidebarConfig) {
20684
+ const { enablePastConversationsSidebar, spotterSidebarTitle, spotterSidebarDefaultExpanded, spotterChatRenameLabel, spotterChatDeleteLabel, spotterDeleteConversationModalTitle, spotterPastConversationAlertMessage, spotterDocumentationUrl, spotterBestPracticesLabel, spotterConversationsBatchSize, spotterNewChatButtonTitle, } = spotterSidebarConfig;
20685
+ setParamIfDefined(params, Param.EnablePastConversationsSidebar, enablePastConversationsSidebar, true);
20686
+ setParamIfDefined(params, Param.SpotterSidebarDefaultExpanded, spotterSidebarDefaultExpanded, true);
20687
+ setParamIfDefined(params, Param.SpotterSidebarTitle, spotterSidebarTitle);
20688
+ setParamIfDefined(params, Param.SpotterChatRenameLabel, spotterChatRenameLabel);
20689
+ setParamIfDefined(params, Param.SpotterChatDeleteLabel, spotterChatDeleteLabel);
20690
+ setParamIfDefined(params, Param.SpotterDeleteConversationModalTitle, spotterDeleteConversationModalTitle);
20691
+ setParamIfDefined(params, Param.SpotterPastConversationAlertMessage, spotterPastConversationAlertMessage);
20692
+ setParamIfDefined(params, Param.SpotterBestPracticesLabel, spotterBestPracticesLabel);
20693
+ setParamIfDefined(params, Param.SpotterConversationsBatchSize, spotterConversationsBatchSize);
20694
+ setParamIfDefined(params, Param.SpotterNewChatButtonTitle, spotterNewChatButtonTitle);
20695
+ // URL param with validation
20696
+ if (spotterDocumentationUrl !== undefined) {
20697
+ const [isValid, validationError] = validateHttpUrl(spotterDocumentationUrl);
20698
+ if (isValid) {
20699
+ params[Param.SpotterDocumentationUrl] = spotterDocumentationUrl;
20700
+ }
20701
+ else {
20702
+ this.handleError({
20703
+ errorType: ErrorDetailsTypes.VALIDATION_ERROR,
20704
+ message: ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
20705
+ code: EmbedErrorCodes.INVALID_URL,
20706
+ error: (validationError === null || validationError === void 0 ? void 0 : validationError.message) || ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
20707
+ });
20708
+ }
20709
+ }
20710
+ }
20711
+ // Handle spotterChatConfig params
20712
+ if (spotterChatConfig) {
20713
+ const { hideToolResponseCardBranding, toolResponseCardBrandingLabel, } = spotterChatConfig;
20714
+ setParamIfDefined(params, Param.HideToolResponseCardBranding, hideToolResponseCardBranding, true);
20715
+ setParamIfDefined(params, Param.ToolResponseCardBrandingLabel, toolResponseCardBrandingLabel);
20716
+ }
20365
20717
  if (hideObjectSearch) {
20366
20718
  params[Param.HideObjectSearch] = !!hideObjectSearch;
20367
20719
  }
@@ -20759,6 +21111,7 @@ query GetEurekaVizSnapshots(
20759
21111
  liveboardId: this.viewConfig.liveboardId,
20760
21112
  vizId: this.viewConfig.vizId,
20761
21113
  activeTabId: this.viewConfig.activeTabId,
21114
+ personalizedViewId: this.viewConfig.personalizedViewId,
20762
21115
  };
20763
21116
  if (this.viewConfig.fullHeight === true) {
20764
21117
  if (this.viewConfig.vizId) {
@@ -20783,7 +21136,7 @@ query GetEurekaVizSnapshots(
20783
21136
  getEmbedParamsObject() {
20784
21137
  let params = {};
20785
21138
  params = this.getBaseQueryParams(params);
20786
- const { enableVizTransformations, fullHeight, defaultHeight, minimumHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled = false, isEnhancedFilterInteractivityEnabled = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled = false, isGranularXLSXCSVSchedulesEnabled = false, showSpotterLimitations, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, isThisPeriodInDateFiltersEnabled, } = this.viewConfig;
21139
+ const { enableVizTransformations, fullHeight, defaultHeight, minimumHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled = false, isEnhancedFilterInteractivityEnabled = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled = false, isGranularXLSXCSVSchedulesEnabled = false, showSpotterLimitations, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, spotterChatConfig, isThisPeriodInDateFiltersEnabled, } = this.viewConfig;
20787
21140
  const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
20788
21141
  || this.viewConfig.preventPinboardFilterRemoval;
20789
21142
  if (fullHeight === true) {
@@ -20857,6 +21210,12 @@ query GetEurekaVizSnapshots(
20857
21210
  if (showSpotterLimitations !== undefined) {
20858
21211
  params[Param.ShowSpotterLimitations] = showSpotterLimitations;
20859
21212
  }
21213
+ // Handle spotterChatConfig params
21214
+ if (spotterChatConfig) {
21215
+ const { hideToolResponseCardBranding, toolResponseCardBrandingLabel, } = spotterChatConfig;
21216
+ setParamIfDefined(params, Param.HideToolResponseCardBranding, hideToolResponseCardBranding, true);
21217
+ setParamIfDefined(params, Param.ToolResponseCardBrandingLabel, toolResponseCardBrandingLabel);
21218
+ }
20860
21219
  if (isLinkParametersEnabled !== undefined) {
20861
21220
  params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
20862
21221
  }
@@ -20880,15 +21239,31 @@ query GetEurekaVizSnapshots(
20880
21239
  getQueryParamString(params, true);
20881
21240
  return params;
20882
21241
  }
20883
- getIframeSuffixSrc(liveboardId, vizId, activeTabId) {
20884
- let suffix = `/embed/viz/${liveboardId}`;
21242
+ getIframeSuffixSrc(liveboardId, vizId, activeTabId, personalizedViewId) {
21243
+ // Extract view from liveboardId if passed along with it (legacy approach)
21244
+ // View must be appended as query param at the end, not embedded in path
21245
+ let liveboardGuid = liveboardId;
21246
+ let legacyViewId;
21247
+ if (liveboardId === null || liveboardId === void 0 ? void 0 : liveboardId.includes('?')) {
21248
+ const [id, query] = liveboardId.split('?');
21249
+ liveboardGuid = id;
21250
+ const params = new URLSearchParams(query);
21251
+ legacyViewId = params.get('view') || undefined;
21252
+ }
21253
+ // personalizedViewId takes precedence over legacyViewId (when passed as part of liveboardId)
21254
+ const effectiveViewId = personalizedViewId || legacyViewId;
21255
+ let suffix = `/embed/viz/${liveboardGuid}`;
20885
21256
  if (activeTabId) {
20886
- suffix = `${suffix}/tab/${activeTabId} `;
21257
+ suffix = `${suffix}/tab/${activeTabId}`;
20887
21258
  }
20888
21259
  if (vizId) {
20889
21260
  suffix = `${suffix}/${vizId}`;
20890
21261
  }
20891
- const tsPostHashParams = this.getThoughtSpotPostUrlParams();
21262
+ const additionalParams = {};
21263
+ if (effectiveViewId) {
21264
+ additionalParams.view = effectiveViewId;
21265
+ }
21266
+ const tsPostHashParams = this.getThoughtSpotPostUrlParams(additionalParams);
20892
21267
  suffix = `${suffix}${tsPostHashParams}`;
20893
21268
  return suffix;
20894
21269
  }
@@ -20898,7 +21273,7 @@ query GetEurekaVizSnapshots(
20898
21273
  */
20899
21274
  getIFrameSrc() {
20900
21275
  var _a;
20901
- const { vizId, activeTabId } = this.viewConfig;
21276
+ const { vizId, activeTabId, personalizedViewId } = this.viewConfig;
20902
21277
  const liveboardId = (_a = this.viewConfig.liveboardId) !== null && _a !== void 0 ? _a : this.viewConfig.pinboardId;
20903
21278
  if (!liveboardId) {
20904
21279
  this.handleError({
@@ -20908,7 +21283,7 @@ query GetEurekaVizSnapshots(
20908
21283
  error: ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION,
20909
21284
  });
20910
21285
  }
20911
- return `${this.getRootIframeSrc()}${this.getIframeSuffixSrc(liveboardId, vizId, activeTabId)}`;
21286
+ return `${this.getRootIframeSrc()}${this.getIframeSuffixSrc(liveboardId, vizId, activeTabId, personalizedViewId)}`;
20912
21287
  }
20913
21288
  setActiveTab(data) {
20914
21289
  if (!this.viewConfig.vizId) {
@@ -20947,12 +21322,13 @@ query GetEurekaVizSnapshots(
20947
21322
  beforePrerenderVisible() {
20948
21323
  const embedObj = this.getPreRenderObj();
20949
21324
  this.executeAfterEmbedContainerLoaded(() => {
20950
- this.navigateToLiveboard(this.viewConfig.liveboardId, this.viewConfig.vizId, this.viewConfig.activeTabId);
21325
+ this.navigateToLiveboard(this.viewConfig.liveboardId, this.viewConfig.vizId, this.viewConfig.activeTabId, this.viewConfig.personalizedViewId);
20951
21326
  if (embedObj) {
20952
21327
  embedObj.currentLiveboardState = {
20953
21328
  liveboardId: this.viewConfig.liveboardId,
20954
21329
  vizId: this.viewConfig.vizId,
20955
21330
  activeTabId: this.viewConfig.activeTabId,
21331
+ personalizedViewId: this.viewConfig.personalizedViewId,
20956
21332
  };
20957
21333
  }
20958
21334
  });
@@ -20969,7 +21345,7 @@ query GetEurekaVizSnapshots(
20969
21345
  * @param {any} data The payload to send with the message
20970
21346
  * @returns A promise that resolves with the response from the embedded app
20971
21347
  */
20972
- trigger(messageType, data = {}) {
21348
+ trigger(messageType, data = {}, context) {
20973
21349
  const dataWithVizId = data;
20974
21350
  if (messageType === exports.HostEvent.SetActiveTab) {
20975
21351
  this.setActiveTab(data);
@@ -20978,7 +21354,7 @@ query GetEurekaVizSnapshots(
20978
21354
  if (typeof dataWithVizId === 'object' && this.viewConfig.vizId) {
20979
21355
  dataWithVizId.vizId = this.viewConfig.vizId;
20980
21356
  }
20981
- return super.trigger(messageType, dataWithVizId);
21357
+ return super.trigger(messageType, dataWithVizId, context);
20982
21358
  }
20983
21359
  /**
20984
21360
  * Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
@@ -21017,11 +21393,12 @@ query GetEurekaVizSnapshots(
21017
21393
  this.postRender();
21018
21394
  return this;
21019
21395
  }
21020
- navigateToLiveboard(liveboardId, vizId, activeTabId) {
21021
- const path = this.getIframeSuffixSrc(liveboardId, vizId, activeTabId);
21396
+ navigateToLiveboard(liveboardId, vizId, activeTabId, personalizedViewId) {
21397
+ const path = this.getIframeSuffixSrc(liveboardId, vizId, activeTabId, personalizedViewId);
21022
21398
  this.viewConfig.liveboardId = liveboardId;
21023
21399
  this.viewConfig.activeTabId = activeTabId;
21024
21400
  this.viewConfig.vizId = vizId;
21401
+ this.viewConfig.personalizedViewId = personalizedViewId;
21025
21402
  if (this.isRendered) {
21026
21403
  this.trigger(exports.HostEvent.Navigate, path.substring(1));
21027
21404
  }
@@ -21045,6 +21422,9 @@ query GetEurekaVizSnapshots(
21045
21422
  if (this.viewConfig.vizId) {
21046
21423
  url = `${url}/${this.viewConfig.vizId}`;
21047
21424
  }
21425
+ if (this.viewConfig.personalizedViewId) {
21426
+ url = `${url}?view=${this.viewConfig.personalizedViewId}`;
21427
+ }
21048
21428
  return url;
21049
21429
  }
21050
21430
  };
@@ -21613,7 +21993,9 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
21613
21993
  this.viewConfig = viewConfig;
21614
21994
  }
21615
21995
  getEmbedParamsObject() {
21616
- const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, enablePastConversationsSidebar, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, updatedSpotterChatPrompt, } = this.viewConfig;
21996
+ const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, updatedSpotterChatPrompt, spotterSidebarConfig, spotterChatConfig, } = this.viewConfig;
21997
+ // Extract sidebar config properties
21998
+ const { enablePastConversationsSidebar, spotterSidebarTitle, spotterSidebarDefaultExpanded, spotterChatRenameLabel, spotterChatDeleteLabel, spotterDeleteConversationModalTitle, spotterPastConversationAlertMessage, spotterDocumentationUrl, spotterBestPracticesLabel, spotterConversationsBatchSize, spotterNewChatButtonTitle, } = spotterSidebarConfig || {};
21617
21999
  if (!worksheetId) {
21618
22000
  this.handleError({
21619
22001
  errorType: ErrorDetailsTypes.VALIDATION_ERROR,
@@ -21624,30 +22006,51 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
21624
22006
  }
21625
22007
  const queryParams = this.getBaseQueryParams();
21626
22008
  queryParams[Param.SpotterEnabled] = true;
21627
- if (!isUndefined_1(disableSourceSelection)) {
21628
- queryParams[Param.DisableSourceSelection] = !!disableSourceSelection;
21629
- }
21630
- if (!isUndefined_1(hideSourceSelection)) {
21631
- queryParams[Param.HideSourceSelection] = !!hideSourceSelection;
21632
- }
21633
- if (!isUndefined_1(dataPanelV2)) {
21634
- queryParams[Param.DataPanelV2Enabled] = !!dataPanelV2;
21635
- }
21636
- if (!isUndefined_1(showSpotterLimitations)) {
21637
- queryParams[Param.ShowSpotterLimitations] = !!showSpotterLimitations;
21638
- }
21639
- if (!isUndefined_1(hideSampleQuestions)) {
21640
- queryParams[Param.HideSampleQuestions] = !!hideSampleQuestions;
22009
+ // Boolean params
22010
+ setParamIfDefined(queryParams, Param.DisableSourceSelection, disableSourceSelection, true);
22011
+ setParamIfDefined(queryParams, Param.HideSourceSelection, hideSourceSelection, true);
22012
+ setParamIfDefined(queryParams, Param.DataPanelV2Enabled, dataPanelV2, true);
22013
+ setParamIfDefined(queryParams, Param.ShowSpotterLimitations, showSpotterLimitations, true);
22014
+ setParamIfDefined(queryParams, Param.HideSampleQuestions, hideSampleQuestions, true);
22015
+ setParamIfDefined(queryParams, Param.UpdatedSpotterChatPrompt, updatedSpotterChatPrompt, true);
22016
+ setParamIfDefined(queryParams, Param.SpotterSidebarDefaultExpanded, spotterSidebarDefaultExpanded, true);
22017
+ // String params
22018
+ setParamIfDefined(queryParams, Param.SpotterSidebarTitle, spotterSidebarTitle);
22019
+ setParamIfDefined(queryParams, Param.SpotterChatRenameLabel, spotterChatRenameLabel);
22020
+ setParamIfDefined(queryParams, Param.SpotterChatDeleteLabel, spotterChatDeleteLabel);
22021
+ setParamIfDefined(queryParams, Param.SpotterDeleteConversationModalTitle, spotterDeleteConversationModalTitle);
22022
+ setParamIfDefined(queryParams, Param.SpotterPastConversationAlertMessage, spotterPastConversationAlertMessage);
22023
+ setParamIfDefined(queryParams, Param.SpotterBestPracticesLabel, spotterBestPracticesLabel);
22024
+ setParamIfDefined(queryParams, Param.SpotterConversationsBatchSize, spotterConversationsBatchSize);
22025
+ setParamIfDefined(queryParams, Param.SpotterNewChatButtonTitle, spotterNewChatButtonTitle);
22026
+ // URL param with validation
22027
+ if (spotterDocumentationUrl !== undefined) {
22028
+ const [isValid, validationError] = validateHttpUrl(spotterDocumentationUrl);
22029
+ if (isValid) {
22030
+ queryParams[Param.SpotterDocumentationUrl] = spotterDocumentationUrl;
22031
+ }
22032
+ else {
22033
+ this.handleError({
22034
+ errorType: ErrorDetailsTypes.VALIDATION_ERROR,
22035
+ message: ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
22036
+ code: EmbedErrorCodes.INVALID_URL,
22037
+ error: (validationError === null || validationError === void 0 ? void 0 : validationError.message) || ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
22038
+ });
22039
+ }
21641
22040
  }
21642
- if (!isUndefined_1(updatedSpotterChatPrompt)) {
21643
- queryParams[Param.UpdatedSpotterChatPrompt] = !!updatedSpotterChatPrompt;
22041
+ // Handle spotterChatConfig params
22042
+ if (spotterChatConfig) {
22043
+ const { hideToolResponseCardBranding, toolResponseCardBrandingLabel, } = spotterChatConfig;
22044
+ setParamIfDefined(queryParams, Param.HideToolResponseCardBranding, hideToolResponseCardBranding, true);
22045
+ setParamIfDefined(queryParams, Param.ToolResponseCardBrandingLabel, toolResponseCardBrandingLabel);
21644
22046
  }
21645
22047
  return queryParams;
21646
22048
  }
21647
22049
  getIframeSrc() {
21648
- const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, enablePastConversationsSidebar, } = this.viewConfig;
22050
+ const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, spotterSidebarConfig, } = this.viewConfig;
21649
22051
  const path = 'insights/conv-assist';
21650
22052
  const queryParams = this.getEmbedParamsObject();
22053
+ const enablePastConversationsSidebar = spotterSidebarConfig === null || spotterSidebarConfig === void 0 ? void 0 : spotterSidebarConfig.enablePastConversationsSidebar;
21651
22054
  if (!isUndefined_1(enablePastConversationsSidebar)) {
21652
22055
  queryParams[Param.EnablePastConversationsSidebar] = !!enablePastConversationsSidebar;
21653
22056
  }