@thoughtspot/visual-embed-sdk 1.46.4 → 1.46.5-beta.1

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 (172) hide show
  1. package/cjs/package.json +2 -2
  2. package/cjs/src/auth.d.ts +2 -1
  3. package/cjs/src/auth.d.ts.map +1 -1
  4. package/cjs/src/auth.js +2 -1
  5. package/cjs/src/auth.js.map +1 -1
  6. package/cjs/src/authToken.d.ts.map +1 -1
  7. package/cjs/src/authToken.js.map +1 -1
  8. package/cjs/src/css-variables.d.ts +51 -17
  9. package/cjs/src/css-variables.d.ts.map +1 -1
  10. package/cjs/src/embed/app.d.ts +1 -0
  11. package/cjs/src/embed/app.d.ts.map +1 -1
  12. package/cjs/src/embed/app.js +10 -1
  13. package/cjs/src/embed/app.js.map +1 -1
  14. package/cjs/src/embed/app.spec.js +46 -1
  15. package/cjs/src/embed/app.spec.js.map +1 -1
  16. package/cjs/src/embed/base.d.ts.map +1 -1
  17. package/cjs/src/embed/base.js.map +1 -1
  18. package/cjs/src/embed/base.spec.js.map +1 -1
  19. package/cjs/src/embed/events.spec.js +72 -0
  20. package/cjs/src/embed/events.spec.js.map +1 -1
  21. package/cjs/src/embed/hostEventClient/contracts.d.ts +74 -3
  22. package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  23. package/cjs/src/embed/hostEventClient/contracts.js +7 -0
  24. package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
  25. package/cjs/src/embed/hostEventClient/host-event-client.d.ts +10 -0
  26. package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  27. package/cjs/src/embed/hostEventClient/host-event-client.js +46 -9
  28. package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
  29. package/cjs/src/embed/hostEventClient/host-event-client.spec.js +155 -0
  30. package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  31. package/cjs/src/embed/liveboard.d.ts +1 -0
  32. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  33. package/cjs/src/embed/liveboard.js +11 -2
  34. package/cjs/src/embed/liveboard.js.map +1 -1
  35. package/cjs/src/embed/liveboard.spec.js +96 -2
  36. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  37. package/cjs/src/embed/sage.d.ts.map +1 -1
  38. package/cjs/src/embed/sage.js.map +1 -1
  39. package/cjs/src/embed/search.spec.js.map +1 -1
  40. package/cjs/src/embed/ts-embed.d.ts +41 -2
  41. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  42. package/cjs/src/embed/ts-embed.js +41 -2
  43. package/cjs/src/embed/ts-embed.js.map +1 -1
  44. package/cjs/src/react/index.d.ts.map +1 -1
  45. package/cjs/src/react/index.js +58 -53
  46. package/cjs/src/react/index.js.map +1 -1
  47. package/cjs/src/types.d.ts +730 -32
  48. package/cjs/src/types.d.ts.map +1 -1
  49. package/cjs/src/types.js +734 -3
  50. package/cjs/src/types.js.map +1 -1
  51. package/cjs/src/utils/graphql/answerService/answerService.d.ts +4 -2
  52. package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  53. package/cjs/src/utils/graphql/answerService/answerService.js +4 -2
  54. package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
  55. package/cjs/src/utils/graphql/preview-service.d.ts.map +1 -1
  56. package/cjs/src/utils/graphql/preview-service.js.map +1 -1
  57. package/cjs/src/utils/processData.d.ts.map +1 -1
  58. package/cjs/src/utils/processData.js.map +1 -1
  59. package/dist/{index-DGV_zh53.js → index-DW2wEHqy.js} +1 -1
  60. package/dist/src/auth.d.ts +2 -1
  61. package/dist/src/auth.d.ts.map +1 -1
  62. package/dist/src/authToken.d.ts.map +1 -1
  63. package/dist/src/css-variables.d.ts +51 -17
  64. package/dist/src/css-variables.d.ts.map +1 -1
  65. package/dist/src/embed/app.d.ts +1 -0
  66. package/dist/src/embed/app.d.ts.map +1 -1
  67. package/dist/src/embed/base.d.ts.map +1 -1
  68. package/dist/src/embed/hostEventClient/contracts.d.ts +74 -3
  69. package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  70. package/dist/src/embed/hostEventClient/host-event-client.d.ts +10 -0
  71. package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  72. package/dist/src/embed/liveboard.d.ts +1 -0
  73. package/dist/src/embed/liveboard.d.ts.map +1 -1
  74. package/dist/src/embed/sage.d.ts.map +1 -1
  75. package/dist/src/embed/ts-embed.d.ts +41 -2
  76. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  77. package/dist/src/react/index.d.ts.map +1 -1
  78. package/dist/src/types.d.ts +730 -32
  79. package/dist/src/types.d.ts.map +1 -1
  80. package/dist/src/utils/graphql/answerService/answerService.d.ts +4 -2
  81. package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  82. package/dist/src/utils/graphql/preview-service.d.ts.map +1 -1
  83. package/dist/src/utils/processData.d.ts.map +1 -1
  84. package/dist/tsembed-react.es.js +917 -77
  85. package/dist/tsembed-react.js +915 -75
  86. package/dist/tsembed.es.js +859 -24
  87. package/dist/tsembed.js +857 -22
  88. package/dist/visual-embed-sdk-react-full.d.ts +892 -54
  89. package/dist/visual-embed-sdk-react.d.ts +892 -54
  90. package/dist/visual-embed-sdk.d.ts +912 -56
  91. package/lib/package.json +2 -2
  92. package/lib/src/auth.d.ts +2 -1
  93. package/lib/src/auth.d.ts.map +1 -1
  94. package/lib/src/auth.js +2 -1
  95. package/lib/src/auth.js.map +1 -1
  96. package/lib/src/authToken.d.ts.map +1 -1
  97. package/lib/src/authToken.js.map +1 -1
  98. package/lib/src/css-variables.d.ts +51 -17
  99. package/lib/src/css-variables.d.ts.map +1 -1
  100. package/lib/src/embed/app.d.ts +1 -0
  101. package/lib/src/embed/app.d.ts.map +1 -1
  102. package/lib/src/embed/app.js +10 -1
  103. package/lib/src/embed/app.js.map +1 -1
  104. package/lib/src/embed/app.spec.js +46 -1
  105. package/lib/src/embed/app.spec.js.map +1 -1
  106. package/lib/src/embed/base.d.ts.map +1 -1
  107. package/lib/src/embed/base.js.map +1 -1
  108. package/lib/src/embed/base.spec.js.map +1 -1
  109. package/lib/src/embed/events.spec.js +73 -1
  110. package/lib/src/embed/events.spec.js.map +1 -1
  111. package/lib/src/embed/hostEventClient/contracts.d.ts +74 -3
  112. package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  113. package/lib/src/embed/hostEventClient/contracts.js +7 -0
  114. package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
  115. package/lib/src/embed/hostEventClient/host-event-client.d.ts +10 -0
  116. package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  117. package/lib/src/embed/hostEventClient/host-event-client.js +46 -9
  118. package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
  119. package/lib/src/embed/hostEventClient/host-event-client.spec.js +155 -0
  120. package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  121. package/lib/src/embed/liveboard.d.ts +1 -0
  122. package/lib/src/embed/liveboard.d.ts.map +1 -1
  123. package/lib/src/embed/liveboard.js +11 -2
  124. package/lib/src/embed/liveboard.js.map +1 -1
  125. package/lib/src/embed/liveboard.spec.js +96 -2
  126. package/lib/src/embed/liveboard.spec.js.map +1 -1
  127. package/lib/src/embed/sage.d.ts.map +1 -1
  128. package/lib/src/embed/sage.js.map +1 -1
  129. package/lib/src/embed/search.spec.js.map +1 -1
  130. package/lib/src/embed/ts-embed.d.ts +41 -2
  131. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  132. package/lib/src/embed/ts-embed.js +42 -3
  133. package/lib/src/embed/ts-embed.js.map +1 -1
  134. package/lib/src/react/index.d.ts.map +1 -1
  135. package/lib/src/react/index.js +58 -53
  136. package/lib/src/react/index.js.map +1 -1
  137. package/lib/src/types.d.ts +730 -32
  138. package/lib/src/types.d.ts.map +1 -1
  139. package/lib/src/types.js +734 -3
  140. package/lib/src/types.js.map +1 -1
  141. package/lib/src/utils/graphql/answerService/answerService.d.ts +4 -2
  142. package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  143. package/lib/src/utils/graphql/answerService/answerService.js +4 -2
  144. package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
  145. package/lib/src/utils/graphql/preview-service.d.ts.map +1 -1
  146. package/lib/src/utils/graphql/preview-service.js.map +1 -1
  147. package/lib/src/utils/processData.d.ts.map +1 -1
  148. package/lib/src/utils/processData.js.map +1 -1
  149. package/lib/src/visual-embed-sdk.d.ts +912 -56
  150. package/package.json +2 -2
  151. package/src/auth.spec.ts +1 -1
  152. package/src/auth.ts +2 -1
  153. package/src/authToken.ts +0 -1
  154. package/src/css-variables.ts +51 -17
  155. package/src/embed/app.spec.ts +62 -3
  156. package/src/embed/app.ts +10 -1
  157. package/src/embed/base.spec.ts +1 -2
  158. package/src/embed/base.ts +1 -4
  159. package/src/embed/events.spec.ts +88 -0
  160. package/src/embed/hostEventClient/contracts.ts +74 -2
  161. package/src/embed/hostEventClient/host-event-client.spec.ts +257 -0
  162. package/src/embed/hostEventClient/host-event-client.ts +70 -15
  163. package/src/embed/liveboard.spec.ts +126 -2
  164. package/src/embed/liveboard.ts +11 -2
  165. package/src/embed/sage.ts +0 -1
  166. package/src/embed/search.spec.ts +0 -2
  167. package/src/embed/ts-embed.ts +43 -3
  168. package/src/react/index.tsx +76 -72
  169. package/src/types.ts +739 -31
  170. package/src/utils/graphql/answerService/answerService.ts +4 -5
  171. package/src/utils/graphql/preview-service.ts +0 -1
  172. package/src/utils/processData.ts +0 -5
package/dist/tsembed.js CHANGED
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.46.4 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.46.5-beta.1 */
2
2
  'use client';
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
@@ -76,6 +76,7 @@
76
76
  * @deprecated This option is deprecated.
77
77
  * @hidden
78
78
  */
79
+ // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
79
80
  AuthType["SAML"] = "SSO_SAML";
80
81
  /**
81
82
  * SSO using SAML
@@ -121,6 +122,7 @@
121
122
  * });
122
123
  * ```
123
124
  */
125
+ // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
124
126
  AuthType["SAMLRedirect"] = "SSO_SAML";
125
127
  /**
126
128
  * SSO using OIDC
@@ -134,6 +136,7 @@
134
136
  * Will make the host application redirect to the OIDC IdP.
135
137
  * See code samples in {@link SAMLRedirect}.
136
138
  */
139
+ // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
137
140
  AuthType["OIDCRedirect"] = "SSO_OIDC";
138
141
  /**
139
142
  * Trusted authentication server
@@ -159,6 +162,7 @@
159
162
  * });
160
163
  * ```
161
164
  */
165
+ // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
162
166
  AuthType["TrustedAuthToken"] = "AuthServer";
163
167
  /**
164
168
  * Trusted authentication server Cookieless, Use your own authentication
@@ -1298,22 +1302,45 @@
1298
1302
  /**
1299
1303
  * Emitted when name, status (private or public) or filter values of a
1300
1304
  * Personalised view is updated.
1305
+ * This event is deprecated. Use {@link EmbedEvent.UpdatePersonalizedView} instead.
1301
1306
  * @returns viewName: string
1302
1307
  * @returns viewId: string
1303
1308
  * @returns liveboardId: string
1304
1309
  * @returns isPublic: boolean
1305
1310
  * @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw
1311
+ * @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
1306
1312
  */
1307
1313
  EmbedEvent["UpdatePersonalisedView"] = "updatePersonalisedView";
1314
+ /**
1315
+ * Emitted when name, status (private or public) or filter values of a
1316
+ * Personalized view is updated.
1317
+ * @returns viewName: string
1318
+ * @returns viewId: string
1319
+ * @returns liveboardId: string
1320
+ * @returns isPublic: boolean
1321
+ * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
1322
+ */
1323
+ EmbedEvent["UpdatePersonalizedView"] = "updatePersonalisedView";
1308
1324
  /**
1309
1325
  * Emitted when a Personalised view is saved.
1326
+ * This event is deprecated. Use {@link EmbedEvent.SavePersonalizedView} instead.
1310
1327
  * @returns viewName: string
1311
1328
  * @returns viewId: string
1312
1329
  * @returns liveboardId: string
1313
1330
  * @returns isPublic: boolean
1314
1331
  * @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw
1332
+ * @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
1315
1333
  */
1316
1334
  EmbedEvent["SavePersonalisedView"] = "savePersonalisedView";
1335
+ /**
1336
+ * Emitted when a Personalized view is saved.
1337
+ * @returns viewName: string
1338
+ * @returns viewId: string
1339
+ * @returns liveboardId: string
1340
+ * @returns isPublic: boolean
1341
+ * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
1342
+ */
1343
+ EmbedEvent["SavePersonalizedView"] = "savePersonalisedView";
1317
1344
  /**
1318
1345
  * Emitted when a Liveboard is reset.
1319
1346
  * @returns viewName: string
@@ -1325,11 +1352,41 @@
1325
1352
  EmbedEvent["ResetLiveboard"] = "resetLiveboard";
1326
1353
  /**
1327
1354
  * Emitted when a PersonalisedView is deleted.
1355
+ * This event is deprecated. Use {@link EmbedEvent.DeletePersonalizedView} instead.
1328
1356
  * @returns views: string[]
1329
1357
  * @returns liveboardId: string
1330
1358
  * @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw
1359
+ * @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
1331
1360
  */
1332
1361
  EmbedEvent["DeletePersonalisedView"] = "deletePersonalisedView";
1362
+ /**
1363
+ * Emitted when a PersonalizedView is deleted.
1364
+ * @returns views: string[]
1365
+ * @returns liveboardId: string
1366
+ * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
1367
+ */
1368
+ EmbedEvent["DeletePersonalizedView"] = "deletePersonalisedView";
1369
+ /**
1370
+ * Emitted when a user selects a different Personalized View or
1371
+ * resets to the original/default view on a Liveboard.
1372
+ * @example
1373
+ * ```js
1374
+ * liveboardEmbed.on(EmbedEvent.ChangePersonalizedView, (data) => {
1375
+ * console.log(data.viewName); // 'Q4 Revenue' or 'Original View'
1376
+ * console.log(data.viewId); // '2a021a12-...' or null (default)
1377
+ * console.log(data.liveboardId); // 'abc123...'
1378
+ * console.log(data.isPublic); // true | false
1379
+ * })
1380
+ * ```
1381
+ * @returns viewName: string - Name of the selected view,
1382
+ * or 'Original View' when reset to default.
1383
+ * @returns viewId: string | null - GUID of the selected view,
1384
+ * or null when reset to default.
1385
+ * @returns liveboardId: string
1386
+ * @returns isPublic: boolean
1387
+ * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
1388
+ */
1389
+ EmbedEvent["ChangePersonalizedView"] = "changePersonalisedView";
1333
1390
  /**
1334
1391
  * Emitted when a user creates a Worksheet.
1335
1392
  * @version SDK: 1.27.0 | ThoughtSpot: 9.8.0.cl, 9.8.0.sw
@@ -1363,7 +1420,8 @@
1363
1420
  * @param - Includes the following parameters:
1364
1421
  * - `payload`: The payload received from the embed related to the Data API call.
1365
1422
  * - `responder`: Contains elements that let developers define whether ThoughtSpot
1366
- * will run or block the search operation, and if blocked, which error message to provide.
1423
+ * will run or block the search operation, and if blocked, which error message to
1424
+ * provide.
1367
1425
  * - `execute` - When `execute` returns `true`, the search is run.
1368
1426
  * When `execute` returns `false`, the search is not executed.
1369
1427
  * - `error` - Developers can customize the user-facing error message when `execute`
@@ -1797,6 +1855,25 @@
1797
1855
  * );
1798
1856
  * }
1799
1857
  * ```
1858
+ *
1859
+ * **Context Parameter (SDK: 1.45.2+)**
1860
+ *
1861
+ * Starting from SDK version 1.45.2 | ThoughtSpot: 26.3.0.cl, you can optionally pass a
1862
+ * `ContextType` as the third parameter to the `trigger` method to specify the context
1863
+ * from which the event is triggered. This helps ThoughtSpot understand the current page
1864
+ * context (Search, Answer, Liveboard, or Spotter) for better event handling.
1865
+ *
1866
+ * @example
1867
+ * ```js
1868
+ * import { HostEvent, ContextType } from '@thoughtspot/visual-embed-sdk';
1869
+ *
1870
+ * // Trigger Pin event with Search context
1871
+ * appEmbed.trigger(HostEvent.Pin, {
1872
+ * vizId: "123",
1873
+ * liveboardId: "456"
1874
+ * }, ContextType.Search);
1875
+ * ```
1876
+ *
1800
1877
  * @group Events
1801
1878
  */
1802
1879
  exports.HostEvent = void 0;
@@ -1819,6 +1896,16 @@
1819
1896
  execute: true
1820
1897
  });
1821
1898
  * ```
1899
+ * @example
1900
+ * ```js
1901
+ * // Trigger search from search context
1902
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
1903
+ * appEmbed.trigger(HostEvent.Search, {
1904
+ * searchQuery: "[revenue] by [region]",
1905
+ * dataSources: ["cd252e5c-b552-49a8-821d-3eadaa049cca"],
1906
+ * execute: true
1907
+ * }, ContextType.Search);
1908
+ * ```
1822
1909
  */
1823
1910
  HostEvent["Search"] = "search";
1824
1911
  /**
@@ -1869,6 +1956,24 @@
1869
1956
  * });
1870
1957
  * })
1871
1958
  * ```
1959
+ * @example
1960
+ * ```js
1961
+ * // Drill down from answer context
1962
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
1963
+ * appEmbed.trigger(HostEvent.DrillDown, {
1964
+ * points: { clickedPoint, selectedPoints },
1965
+ * autoDrillDown: true
1966
+ * }, ContextType.Answer);
1967
+ * ```
1968
+ * @example
1969
+ * ```js
1970
+ * // Drill down from search context
1971
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
1972
+ * searchEmbed.trigger(HostEvent.DrillDown, {
1973
+ * points: { clickedPoint, selectedPoints },
1974
+ * columnGuid: "column-guid"
1975
+ * }, ContextType.Search);
1976
+ * ```
1872
1977
  * @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
1873
1978
  */
1874
1979
  HostEvent["DrillDown"] = "triggerDrillDown";
@@ -1889,6 +1994,13 @@
1889
1994
  * const url = embed.trigger(HostEvent.GetIframeUrl);
1890
1995
  * console.log("iFrameURL",url);
1891
1996
  * ```
1997
+ * @example
1998
+ * ```js
1999
+ * // Get iframe URL from specific context
2000
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2001
+ * const url = await appEmbed.trigger(HostEvent.GetIframeUrl, {}, ContextType.Answer);
2002
+ * console.log("iFrameURL", url);
2003
+ * ```
1892
2004
  * @version SDK: 1.35.0 | ThoughtSpot: 10.4.0.cl
1893
2005
  */
1894
2006
  HostEvent["GetIframeUrl"] = "GetIframeUrl";
@@ -1902,6 +2014,15 @@
1902
2014
  * '730496d6-6903-4601-937e-2c691821af3c',
1903
2015
  * 'd547ec54-2a37-4516-a222-2b06719af726'])
1904
2016
  * ```
2017
+ * @example
2018
+ * ```js
2019
+ * // Set visible vizs from liveboard context
2020
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2021
+ * liveboardEmbed.trigger(HostEvent.SetVisibleVizs, [
2022
+ * '730496d6-6903-4601-937e-2c691821af3c',
2023
+ * 'd547ec54-2a37-4516-a222-2b06719af726'
2024
+ * ], ContextType.Liveboard);
2025
+ * ```
1905
2026
  * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
1906
2027
  */
1907
2028
  HostEvent["SetVisibleVizs"] = "SetPinboardVisibleVizs";
@@ -1914,6 +2035,14 @@
1914
2035
  * tabId:'730496d6-6903-4601-937e-2c691821af3c'
1915
2036
  * })
1916
2037
  * ```
2038
+ * @example
2039
+ * ```js
2040
+ * // Set active tab from liveboard context
2041
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2042
+ * liveboardEmbed.trigger(HostEvent.SetActiveTab, {
2043
+ * tabId: '730496d6-6903-4601-937e-2c691821af3c'
2044
+ * }, ContextType.Liveboard);
2045
+ * ```
1917
2046
  * @version SDK: 1.24.0 | ThoughtSpot: 9.5.0.cl, 9.5.1-sw
1918
2047
  */
1919
2048
  HostEvent["SetActiveTab"] = "SetActiveTab";
@@ -1947,6 +2076,15 @@
1947
2076
  * {columnName: "item type",operator: RuntimeFilterOp.EQ,values: ["Jackets"]}
1948
2077
  * ])
1949
2078
  * ```
2079
+ * @example
2080
+ * ```js
2081
+ * // Update runtime filters from liveboard context
2082
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2083
+ * liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
2084
+ * {columnName: "region", operator: RuntimeFilterOp.EQ, values: ["west"]},
2085
+ * {columnName: "product", operator: RuntimeFilterOp.IN, values: ["shoes", "boots"]}
2086
+ * ], ContextType.Liveboard);
2087
+ * ```
1950
2088
  * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw
1951
2089
  * @important
1952
2090
  */
@@ -1980,6 +2118,14 @@
1980
2118
  * LiveboardEmbed.trigger(HostEvent.OpenFilter,
1981
2119
  * { column: {columnId: '<column-GUID>'}})
1982
2120
  * ```
2121
+ * @example
2122
+ * ```js
2123
+ * // Open filter from search context
2124
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2125
+ * searchEmbed.trigger(HostEvent.OpenFilter, {
2126
+ * column: { columnId: '<column-GUID>', name: 'region', type: 'ATTRIBUTE', dataType: 'CHAR'}
2127
+ * }, ContextType.Search);
2128
+ * ```
1983
2129
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
1984
2130
  */
1985
2131
  HostEvent["OpenFilter"] = "openFilter";
@@ -1990,6 +2136,14 @@
1990
2136
  * ```js
1991
2137
  * searchEmbed.trigger(HostEvent.AddColumns, { columnIds: ['<column-GUID>','<column-GUID>'] })
1992
2138
  * ```
2139
+ * @example
2140
+ * ```js
2141
+ * // Add columns from search context
2142
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2143
+ * searchEmbed.trigger(HostEvent.AddColumns, {
2144
+ * columnIds: ['col-guid-1', 'col-guid-2']
2145
+ * }, ContextType.Search);
2146
+ * ```
1993
2147
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
1994
2148
  */
1995
2149
  HostEvent["AddColumns"] = "addColumns";
@@ -2000,6 +2154,14 @@
2000
2154
  * ```js
2001
2155
  * searchEmbed.trigger(HostEvent.RemoveColumn, { columnId: '<column-Guid>' })
2002
2156
  * ```
2157
+ * @example
2158
+ * ```js
2159
+ * // Remove column from search context
2160
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2161
+ * searchEmbed.trigger(HostEvent.RemoveColumn, {
2162
+ * columnId: 'column-guid'
2163
+ * }, ContextType.Search);
2164
+ * ```
2003
2165
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
2004
2166
  */
2005
2167
  HostEvent["RemoveColumn"] = "removeColumn";
@@ -2086,6 +2248,37 @@
2086
2248
  *
2087
2249
  * spotterEmbed.trigger(HostEvent.Pin, { vizId: latestSpotterVizId });
2088
2250
  * ```
2251
+ * @example
2252
+ * ```js
2253
+ * // Using context parameter to specify the context type (SDK: 1.45.2+)
2254
+ * // Pin from a search answer context
2255
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2256
+ * appEmbed.trigger(HostEvent.Pin, {
2257
+ * vizId: "123",
2258
+ * newVizName: "Sales by region",
2259
+ * liveboardId: "456"
2260
+ * }, ContextType.Search);
2261
+ * ```
2262
+ * @example
2263
+ * ```js
2264
+ * // Pin from an answer context (explore modal/page) (SDK: 1.45.2+)
2265
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2266
+ * appEmbed.trigger(HostEvent.Pin, {
2267
+ * vizId: "789",
2268
+ * newVizName: "Revenue trends",
2269
+ * liveboardId: "456"
2270
+ * }, ContextType.Answer);
2271
+ * ```
2272
+ * @example
2273
+ * ```js
2274
+ * // Pin from a spotter context (SDK: 1.45.2+)
2275
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2276
+ * appEmbed.trigger(HostEvent.Pin, {
2277
+ * vizId: latestSpotterVizId,
2278
+ * newVizName: "AI-generated insights",
2279
+ * liveboardId: "456"
2280
+ * }, ContextType.Spotter);
2281
+ * ```
2089
2282
  *
2090
2283
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2091
2284
  */
@@ -2096,6 +2289,12 @@
2096
2289
  * @example
2097
2290
  * ```js
2098
2291
  * liveboardEmbed.trigger(HostEvent.LiveboardInfo)
2292
+ *```
2293
+ * @example
2294
+ * ```js
2295
+ * // Show liveboard info from liveboard context
2296
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2297
+ * liveboardEmbed.trigger(HostEvent.LiveboardInfo, {}, ContextType.Liveboard);
2099
2298
  * ```
2100
2299
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2101
2300
  */
@@ -2106,6 +2305,12 @@
2106
2305
  * ```js
2107
2306
  * liveboardEmbed.trigger(HostEvent.Schedule)
2108
2307
  * ```
2308
+ * @example
2309
+ * ```js
2310
+ * // Schedule from liveboard context
2311
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2312
+ * liveboardEmbed.trigger(HostEvent.Schedule, {}, ContextType.Liveboard);
2313
+ * ```
2109
2314
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2110
2315
  */
2111
2316
  HostEvent["Schedule"] = "subscription";
@@ -2115,6 +2320,12 @@
2115
2320
  * ```js
2116
2321
  * liveboardEmbed.trigger(HostEvent.ScheduleList)
2117
2322
  * ```
2323
+ * @example
2324
+ * ```js
2325
+ * // Manage schedules from liveboard context
2326
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2327
+ * liveboardEmbed.trigger(HostEvent.ScheduleList, {}, ContextType.Liveboard);
2328
+ * ```
2118
2329
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2119
2330
  */
2120
2331
  HostEvent["SchedulesList"] = "schedule-list";
@@ -2125,6 +2336,18 @@
2125
2336
  * ```js
2126
2337
  * liveboardEmbed.trigger(HostEvent.ExportTML)
2127
2338
  * ```
2339
+ * @example
2340
+ * ```js
2341
+ * // Export TML from liveboard context
2342
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2343
+ * liveboardEmbed.trigger(HostEvent.ExportTML, {}, ContextType.Liveboard);
2344
+ * ```
2345
+ * @example
2346
+ * ```js
2347
+ * // Export TML from search-answer context
2348
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2349
+ * appEmbed.trigger(HostEvent.ExportTML, {}, ContextType.Search);
2350
+ * ```
2128
2351
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2129
2352
  */
2130
2353
  HostEvent["ExportTML"] = "exportTSL";
@@ -2135,6 +2358,18 @@
2135
2358
  * ```js
2136
2359
  * liveboardEmbed.trigger(HostEvent.EditTML)
2137
2360
  * ```
2361
+ * @example
2362
+ * ```js
2363
+ * // Edit TML from liveboard context
2364
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2365
+ * liveboardEmbed.trigger(HostEvent.EditTML, {}, ContextType.Liveboard);
2366
+ * ```
2367
+ * @example
2368
+ * ```js
2369
+ * // Edit TML from search-answer context
2370
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2371
+ * appEmbed.trigger(HostEvent.EditTML, {}, ContextType.Search);
2372
+ * ```
2138
2373
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2139
2374
  */
2140
2375
  HostEvent["EditTML"] = "editTSL";
@@ -2144,6 +2379,12 @@
2144
2379
  * ```js
2145
2380
  * liveboardEmbed.trigger(HostEvent.UpdateTML)
2146
2381
  * ```
2382
+ * @example
2383
+ * ```js
2384
+ * // Update TML from liveboard context
2385
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2386
+ * liveboardEmbed.trigger(HostEvent.UpdateTML, {}, ContextType.Liveboard);
2387
+ * ```
2147
2388
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2148
2389
  */
2149
2390
  HostEvent["UpdateTML"] = "updateTSL";
@@ -2170,6 +2411,18 @@
2170
2411
  *
2171
2412
  * spotterEmbed.trigger(HostEvent.DownloadAsPdf, { vizId: latestSpotterVizId });
2172
2413
  * ```
2414
+ * @example
2415
+ * ```js
2416
+ * // Download as PDF from search-answer context
2417
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2418
+ * appEmbed.trigger(HostEvent.DownloadAsPdf, {}, ContextType.Search);
2419
+ * ```
2420
+ * @example
2421
+ * ```js
2422
+ * // Download as PDF from liveboard context
2423
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2424
+ * liveboardEmbed.trigger(HostEvent.DownloadAsPdf, {}, ContextType.Liveboard);
2425
+ * ```
2173
2426
  *
2174
2427
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2175
2428
  */
@@ -2214,6 +2467,18 @@
2214
2467
  *
2215
2468
  * spotterEmbed.trigger(HostEvent.MakeACopy, { vizId: latestSpotterVizId });
2216
2469
  * ```
2470
+ * @example
2471
+ * ```js
2472
+ * // Make a copy from answer context
2473
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2474
+ * appEmbed.trigger(HostEvent.MakeACopy, {}, ContextType.Answer);
2475
+ * ```
2476
+ * @example
2477
+ * ```js
2478
+ * // Make a copy from search context
2479
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2480
+ * appEmbed.trigger(HostEvent.MakeACopy, {}, ContextType.Search);
2481
+ * ```
2217
2482
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2218
2483
  */
2219
2484
  HostEvent["MakeACopy"] = "makeACopy";
@@ -2238,6 +2503,14 @@
2238
2503
  * ```js
2239
2504
  * liveboardEmbed.trigger(HostEvent.Explore, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
2240
2505
  * ```
2506
+ * @example
2507
+ * ```js
2508
+ * // Explore from liveboard context
2509
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2510
+ * liveboardEmbed.trigger(HostEvent.Explore, {
2511
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
2512
+ * }, ContextType.Liveboard);
2513
+ * ```
2241
2514
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2242
2515
  */
2243
2516
  HostEvent["Explore"] = "explore";
@@ -2255,6 +2528,20 @@
2255
2528
  * ```js
2256
2529
  * searchEmbed.trigger(HostEvent.CreateMonitor)
2257
2530
  * ```
2531
+ * @example
2532
+ * ```js
2533
+ * // Create monitor from answer context
2534
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2535
+ * appEmbed.trigger(HostEvent.CreateMonitor, {}, ContextType.Answer);
2536
+ * ```
2537
+ * @example
2538
+ * ```js
2539
+ * // Create monitor from liveboard context
2540
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2541
+ * liveboardEmbed.trigger(HostEvent.CreateMonitor, {
2542
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
2543
+ * }, ContextType.Liveboard);
2544
+ * ```
2258
2545
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2259
2546
  */
2260
2547
  HostEvent["CreateMonitor"] = "createMonitor";
@@ -2276,6 +2563,20 @@
2276
2563
  * ```js
2277
2564
  * vizEmbed.trigger(HostEvent.ManageMonitor)
2278
2565
  * ```
2566
+ * @example
2567
+ * ```js
2568
+ * // Manage monitor from answer context
2569
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2570
+ * appEmbed.trigger(HostEvent.ManageMonitor, {}, ContextType.Answer);
2571
+ * ```
2572
+ * @example
2573
+ * ```js
2574
+ * // Manage monitor from liveboard context
2575
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2576
+ * liveboardEmbed.trigger(HostEvent.ManageMonitor, {
2577
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
2578
+ * }, ContextType.Liveboard);
2579
+ * ```
2279
2580
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2280
2581
  */
2281
2582
  HostEvent["ManageMonitor"] = "manageMonitor";
@@ -2301,6 +2602,26 @@
2301
2602
  * ```js
2302
2603
  * spotterEmbed.trigger(HostEvent.Edit);
2303
2604
  * ```
2605
+ * @example
2606
+ * ```js
2607
+ * // Using context parameter to edit liveboard context
2608
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2609
+ * liveboardEmbed.trigger(HostEvent.Edit, {}, ContextType.Liveboard);
2610
+ * ```
2611
+ * @example
2612
+ * ```js
2613
+ * // Edit from search context
2614
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2615
+ * appEmbed.trigger(HostEvent.Edit, {}, ContextType.Search);
2616
+ * ```
2617
+ * * @example
2618
+ * ```js
2619
+ * // Edit from spotter context
2620
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2621
+ * appEmbed.trigger(HostEvent.Edit, {
2622
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
2623
+ * }, ContextType.Spotter);
2624
+ * ```
2304
2625
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2305
2626
  */
2306
2627
  HostEvent["Edit"] = "edit";
@@ -2318,6 +2639,20 @@
2318
2639
  * ```js
2319
2640
  * vizEmbed.trigger(HostEvent.CopyLink)
2320
2641
  * ```
2642
+ * @example
2643
+ * ```js
2644
+ * // Copy link from liveboard context
2645
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2646
+ * liveboardEmbed.trigger(HostEvent.CopyLink, {}, ContextType.Liveboard);
2647
+ * ```
2648
+ * @example
2649
+ * ```js
2650
+ * // Copy link from liveboard visualization context
2651
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2652
+ * liveboardEmbed.trigger(HostEvent.CopyLink, {
2653
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
2654
+ * }, ContextType.Liveboard);
2655
+ * ```
2321
2656
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2322
2657
  */
2323
2658
  HostEvent["CopyLink"] = "embedDocument";
@@ -2335,6 +2670,20 @@
2335
2670
  * ```js
2336
2671
  * vizEmbed.trigger(HostEvent.Present)
2337
2672
  * ```
2673
+ * @example
2674
+ * ```js
2675
+ * // Present from liveboard visualization context
2676
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2677
+ * liveboardEmbed.trigger(HostEvent.Present, {
2678
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
2679
+ * }, ContextType.Liveboard);
2680
+ * ```
2681
+ * @example
2682
+ * ```js
2683
+ * // Present from liveboard context
2684
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2685
+ * liveboardEmbed.trigger(HostEvent.Present, {}, ContextType.Liveboard);
2686
+ * ```
2338
2687
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2339
2688
  */
2340
2689
  HostEvent["Present"] = "present";
@@ -2363,6 +2712,22 @@
2363
2712
  * tml.answer.search_query // TML representation of the search query
2364
2713
  * );
2365
2714
  * })
2715
+ * ```
2716
+ * @example
2717
+ * ```js
2718
+ * // Get TML from search context
2719
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2720
+ * appEmbed.trigger(HostEvent.GetTML, {}, ContextType.Search).then((tml) => {
2721
+ * console.log(tml.answer.search_query);
2722
+ * });
2723
+ * ```
2724
+ * @example
2725
+ * ```js
2726
+ * // Get TML from search-answer context
2727
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2728
+ * appEmbed.trigger(HostEvent.GetTML, {}, ContextType.Search).then((tml) => {
2729
+ * console.log(tml.answer);
2730
+ * });
2366
2731
  * ```
2367
2732
  * @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1.sw
2368
2733
  * @important
@@ -2384,6 +2749,20 @@
2384
2749
  * ```js
2385
2750
  * searchEmbed.trigger(HostEvent.ShowUnderlyingData)
2386
2751
  * ```
2752
+ * @example
2753
+ * ```js
2754
+ * // Show underlying data from liveboard visualization context
2755
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2756
+ * appEmbed.trigger(HostEvent.ShowUnderlyingData, {
2757
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
2758
+ * }, ContextType.Liveboard);
2759
+ * ```
2760
+ * @example
2761
+ * ```js
2762
+ * // Show underlying data from search context
2763
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2764
+ * appEmbed.trigger(HostEvent.ShowUnderlyingData, {}, ContextType.Search);
2765
+ * ```
2387
2766
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2388
2767
  */
2389
2768
  HostEvent["ShowUnderlyingData"] = "showUnderlyingData";
@@ -2401,6 +2780,18 @@
2401
2780
  * ```js
2402
2781
  * searchEmbed.trigger(HostEvent.Delete)
2403
2782
  * ```
2783
+ * @example
2784
+ * ```js
2785
+ * // Delete from liveboard context
2786
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2787
+ * liveboardEmbed.trigger(HostEvent.Delete, {}, ContextType.Liveboard);
2788
+ * ```
2789
+ * @example
2790
+ * ```js
2791
+ * // Delete from search context
2792
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2793
+ * appEmbed.trigger(HostEvent.Delete, {}, ContextType.Search);
2794
+ * ```
2404
2795
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2405
2796
  */
2406
2797
  HostEvent["Delete"] = "onDeleteAnswer";
@@ -2421,6 +2812,20 @@
2421
2812
  * ```js
2422
2813
  * searchEmbed.trigger(HostEvent.SpotIQAnalyze)
2423
2814
  * ```
2815
+ * @example
2816
+ * ```js
2817
+ * // SpotIQ analyze from search-answer context
2818
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2819
+ * appEmbed.trigger(HostEvent.SpotIQAnalyze, { vizId: '730496d6-6903-4601-937e-2c691821af3c' }, ContextType.Search);
2820
+ * ```
2821
+ * @example
2822
+ * ```js
2823
+ * // SpotIQ analyze from search context
2824
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2825
+ * liveboardEmbed.trigger(HostEvent.SpotIQAnalyze, {
2826
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
2827
+ * }, ContextType.Liveboard);
2828
+ * ```
2424
2829
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2425
2830
  */
2426
2831
  HostEvent["SpotIQAnalyze"] = "spotIQAnalyze";
@@ -2472,9 +2877,16 @@
2472
2877
  *
2473
2878
  * spotterEmbed.trigger(HostEvent.DownloadAsPng, { vizId: latestSpotterVizId });
2474
2879
  * ```
2880
+ * @example
2881
+ * ```js
2882
+ * // Download as PNG from search-answer context
2883
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2884
+ * appEmbed.trigger(HostEvent.DownloadAsPng, {}, ContextType.Search);
2885
+ * ```
2475
2886
  *
2476
2887
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
2477
2888
  */
2889
+ // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
2478
2890
  HostEvent["DownloadAsPng"] = "downloadAsPng";
2479
2891
  /**
2480
2892
  * Trigger the **Download** > **CSV** action on tables in
@@ -2500,6 +2912,18 @@
2500
2912
  *
2501
2913
  * spotterEmbed.trigger(HostEvent.DownloadAsCsv, { vizId: latestSpotterVizId });
2502
2914
  * ```
2915
+ * @example
2916
+ * ```js
2917
+ * // Download as CSV from search-answer context
2918
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2919
+ * appEmbed.trigger(HostEvent.DownloadAsCsv, {}, ContextType.Search);
2920
+ * ```
2921
+ * @example
2922
+ * ```js
2923
+ * // Download as CSV from search context
2924
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2925
+ * searchEmbed.trigger(HostEvent.DownloadAsCsv, {}, ContextType.Search);
2926
+ * ```
2503
2927
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2504
2928
  */
2505
2929
  HostEvent["DownloadAsCsv"] = "downloadAsCSV";
@@ -2527,6 +2951,18 @@
2527
2951
  *
2528
2952
  * spotterEmbed.trigger(HostEvent.DownloadAsXlsx, { vizId: latestSpotterVizId });
2529
2953
  * ```
2954
+ * @example
2955
+ * ```js
2956
+ * // Download as XLSX from answer context
2957
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2958
+ * appEmbed.trigger(HostEvent.DownloadAsXlsx, {}, ContextType.Answer);
2959
+ * ```
2960
+ * @example
2961
+ * ```js
2962
+ * // Download as XLSX from search context
2963
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2964
+ * searchEmbed.trigger(HostEvent.DownloadAsXlsx, {}, ContextType.Search);
2965
+ * ```
2530
2966
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2531
2967
  */
2532
2968
  HostEvent["DownloadAsXlsx"] = "downloadAsXLSX";
@@ -2540,6 +2976,18 @@
2540
2976
  * ```js
2541
2977
  * searchEmbed.trigger(HostEvent.Share)
2542
2978
  * ```
2979
+ * @example
2980
+ * ```js
2981
+ * // Share from Liveboard context
2982
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2983
+ * liveboardEmbed.trigger(HostEvent.Share, {}, ContextType.Liveboard);
2984
+ * ```
2985
+ * @example
2986
+ * ```js
2987
+ * // Share from search-answer context
2988
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2989
+ * appEmbed.trigger(HostEvent.Share, {}, ContextType.Search);
2990
+ * ```
2543
2991
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2544
2992
  */
2545
2993
  HostEvent["Share"] = "share";
@@ -2579,6 +3027,18 @@
2579
3027
  *
2580
3028
  * spotterEmbed.trigger(HostEvent.Save, { vizId: latestSpotterVizId });
2581
3029
  * ```
3030
+ * @example
3031
+ * ```js
3032
+ * // Save from answer context
3033
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3034
+ * appEmbed.trigger(HostEvent.Save, {}, ContextType.Answer);
3035
+ * ```
3036
+ * @example
3037
+ * ```js
3038
+ * // Save from search context
3039
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3040
+ * searchEmbed.trigger(HostEvent.Save, {}, ContextType.Search);
3041
+ * ```
2582
3042
  *
2583
3043
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2584
3044
  */
@@ -2595,6 +3055,20 @@
2595
3055
  * ```js
2596
3056
  * vizEmbed.trigger(HostEvent.SyncToSheets)
2597
3057
  * ```
3058
+ * @example
3059
+ * ```js
3060
+ * // Sync to sheets from answer context
3061
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3062
+ * appEmbed.trigger(HostEvent.SyncToSheets, {}, ContextType.Answer);
3063
+ * ```
3064
+ * @example
3065
+ * ```js
3066
+ * // Sync to sheets from liveboard context
3067
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3068
+ * liveboardEmbed.trigger(HostEvent.SyncToSheets, {
3069
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
3070
+ * }, ContextType.Liveboard);
3071
+ * ```
2598
3072
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2599
3073
  */
2600
3074
  HostEvent["SyncToSheets"] = "sync-to-sheets";
@@ -2611,6 +3085,20 @@
2611
3085
  * ```js
2612
3086
  * vizEmbed.trigger(HostEvent.SyncToOtherApps)
2613
3087
  * ```
3088
+ * @example
3089
+ * ```js
3090
+ * // Sync to other apps from answer context
3091
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3092
+ * appEmbed.trigger(HostEvent.SyncToOtherApps, {}, ContextType.Answer);
3093
+ * ```
3094
+ * @example
3095
+ * ```js
3096
+ * // Sync to other apps from liveboard context
3097
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3098
+ * liveboardEmbed.trigger(HostEvent.SyncToOtherApps, {
3099
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
3100
+ * }, ContextType.Liveboard);
3101
+ * ```
2614
3102
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2615
3103
  */
2616
3104
  HostEvent["SyncToOtherApps"] = "sync-to-other-apps";
@@ -2627,6 +3115,20 @@
2627
3115
  * ```js
2628
3116
  * vizEmbed.trigger(HostEvent.ManagePipelines)
2629
3117
  * ```
3118
+ * @example
3119
+ * ```js
3120
+ * // Manage pipelines from answer context
3121
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3122
+ * appEmbed.trigger(HostEvent.ManagePipelines, {}, ContextType.Answer);
3123
+ * ```
3124
+ * @example
3125
+ * ```js
3126
+ * // Manage pipelines from liveboard context
3127
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3128
+ * liveboardEmbed.trigger(HostEvent.ManagePipelines, {
3129
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
3130
+ * }, ContextType.Liveboard);
3131
+ * ```
2630
3132
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2631
3133
  */
2632
3134
  HostEvent["ManagePipelines"] = "manage-pipeline";
@@ -2639,6 +3141,12 @@
2639
3141
  * ```js
2640
3142
  * appEmbed.trigger(HostEvent.ResetSearch)
2641
3143
  * ```
3144
+ * @example
3145
+ * ```js
3146
+ * // Reset search from search context
3147
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3148
+ * searchEmbed.trigger(HostEvent.ResetSearch, {}, ContextType.Search);
3149
+ * ```
2642
3150
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.0.1.sw
2643
3151
  */
2644
3152
  HostEvent["ResetSearch"] = "resetSearch";
@@ -2650,6 +3158,13 @@
2650
3158
  * const data = await liveboardEmbed.trigger(HostEvent.GetFilters);
2651
3159
  * console.log('data', data);
2652
3160
  * ```
3161
+ * @example
3162
+ * ```js
3163
+ * // Get filters from liveboard context
3164
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3165
+ * const data = await liveboardEmbed.trigger(HostEvent.GetFilters, {}, ContextType.Liveboard);
3166
+ * console.log('filters', data);
3167
+ * ```
2653
3168
  * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
2654
3169
  */
2655
3170
  HostEvent["GetFilters"] = "getFilters";
@@ -2657,7 +3172,8 @@
2657
3172
  * Update one or several filters applied on a Liveboard.
2658
3173
  * @param - Includes the following keys:
2659
3174
  * - `filter`: A single filter object containing column name, filter operator, and
2660
- * values. - `filters`: Multiple filter objects with column name, filter operator,
3175
+ * values.
3176
+ * - `filters`: Multiple filter objects with column name, filter operator,
2661
3177
  * and values for each.
2662
3178
  *
2663
3179
  * Each filter object must include the following attributes:
@@ -2740,6 +3256,18 @@
2740
3256
  * }]
2741
3257
  * });
2742
3258
  * ```
3259
+ * @example
3260
+ * ```js
3261
+ * // Update filters from liveboard context
3262
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3263
+ * liveboardEmbed.trigger(HostEvent.UpdateFilters, {
3264
+ * filter: {
3265
+ * column: "item type",
3266
+ * oper: "IN",
3267
+ * values: ["shoes", "boots"]
3268
+ * }
3269
+ * }, ContextType.Liveboard);
3270
+ * ```
2743
3271
  * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
2744
3272
  */
2745
3273
  HostEvent["UpdateFilters"] = "updateFilters";
@@ -2753,6 +3281,14 @@
2753
3281
  * );
2754
3282
  * })
2755
3283
  * ```
3284
+ * @example
3285
+ * ```js
3286
+ * // Get tabs from liveboard context
3287
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3288
+ * liveboardEmbed.trigger(HostEvent.GetTabs, {}, ContextType.Liveboard).then((tabDetails) => {
3289
+ * console.log('tabs', tabDetails);
3290
+ * });
3291
+ * ```
2756
3292
  * @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl
2757
3293
  */
2758
3294
  HostEvent["GetTabs"] = "getTabs";
@@ -2766,6 +3302,15 @@
2766
3302
  * '430496d6-6903-4601-937e-2c691821af3c',
2767
3303
  * 'f547ec54-2a37-4516-a222-2b06719af726'])
2768
3304
  * ```
3305
+ * @example
3306
+ * ```js
3307
+ * // Set visible tabs from liveboard context
3308
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3309
+ * liveboardEmbed.trigger(HostEvent.SetVisibleTabs, [
3310
+ * '430496d6-6903-4601-937e-2c691821af3c',
3311
+ * 'f547ec54-2a37-4516-a222-2b06719af726'
3312
+ * ], ContextType.Liveboard);
3313
+ * ```
2769
3314
  * @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw
2770
3315
  */
2771
3316
  HostEvent["SetVisibleTabs"] = "SetPinboardVisibleTabs";
@@ -2779,6 +3324,15 @@
2779
3324
  * '630496d6-6903-4601-937e-2c691821af3c',
2780
3325
  * 'i547ec54-2a37-4516-a222-2b06719af726'])
2781
3326
  * ```
3327
+ * @example
3328
+ * ```js
3329
+ * // Set hidden tabs from liveboard context
3330
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3331
+ * liveboardEmbed.trigger(HostEvent.SetHiddenTabs, [
3332
+ * '630496d6-6903-4601-937e-2c691821af3c',
3333
+ * 'i547ec54-2a37-4516-a222-2b06719af726'
3334
+ * ], ContextType.Liveboard);
3335
+ * ```
2782
3336
  * @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw
2783
3337
  */
2784
3338
  HostEvent["SetHiddenTabs"] = "SetPinboardHiddenTabs";
@@ -2855,13 +3409,24 @@
2855
3409
  HostEvent["UpdateCrossFilter"] = "UpdateCrossFilter";
2856
3410
  /**
2857
3411
  * Trigger reset action for a personalized Liveboard view.
3412
+ * This event is deprecated. Use {@link HostEvent.ResetLiveboardPersonalizedView} instead.
2858
3413
  * @example
2859
3414
  * ```js
2860
3415
  * liveboardEmbed.trigger(HostEvent.ResetLiveboardPersonalisedView);
2861
3416
  * ```
2862
3417
  * @version SDK: 1.29.0 | ThoughtSpot Cloud: 10.1.0.cl, 10.1.0.sw
3418
+ * @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
2863
3419
  */
2864
3420
  HostEvent["ResetLiveboardPersonalisedView"] = "ResetLiveboardPersonalisedView";
3421
+ /**
3422
+ * Trigger reset action for a personalized Liveboard view.
3423
+ * @example
3424
+ * ```js
3425
+ * liveboardEmbed.trigger(HostEvent.ResetLiveboardPersonalizedView);
3426
+ * ```
3427
+ * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
3428
+ */
3429
+ HostEvent["ResetLiveboardPersonalizedView"] = "ResetLiveboardPersonalisedView";
2865
3430
  /**
2866
3431
  * Triggers an action to update Parameter values on embedded
2867
3432
  * Answers, Liveboard, and Spotter answer in Edit mode.
@@ -2878,6 +3443,16 @@
2878
3443
  * isVisibleToUser: false
2879
3444
  * }])
2880
3445
  * ```
3446
+ * @example
3447
+ * ```js
3448
+ * // Update parameters from liveboard context
3449
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3450
+ * liveboardEmbed.trigger(HostEvent.UpdateParameters, [{
3451
+ * name: "Region Param",
3452
+ * value: "West",
3453
+ * isVisibleToUser: true
3454
+ * }], ContextType.Liveboard);
3455
+ * ```
2881
3456
  * @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
2882
3457
  */
2883
3458
  HostEvent["UpdateParameters"] = "UpdateParameters";
@@ -2897,18 +3472,77 @@
2897
3472
  * });
2898
3473
  *
2899
3474
  * spotterEmbed.trigger(HostEvent.GetParameters, { vizId: latestSpotterVizId });
3475
+ *```
3476
+ * @example
3477
+ * ```js
3478
+ * // Get parameters from liveboard context
3479
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3480
+ * liveboardEmbed.trigger(HostEvent.GetParameters, {}, ContextType.Liveboard).then((parameters) => {
3481
+ * console.log('parameters', parameters);
3482
+ * });
2900
3483
  * ```
2901
3484
  * @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
2902
3485
  */
2903
3486
  HostEvent["GetParameters"] = "GetParameters";
2904
3487
  /**
2905
3488
  * Triggers an event to update a personalized view of a Liveboard.
3489
+ * This event is deprecated. Use {@link HostEvent.UpdatePersonalizedView} instead.
2906
3490
  * ```js
2907
3491
  * liveboardEmbed.trigger(HostEvent.UpdatePersonalisedView, {viewId: '1234'})
2908
3492
  * ```
3493
+ * @example
3494
+ * ```js
3495
+ * // Update personalized view from liveboard context
3496
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3497
+ * liveboardEmbed.trigger(HostEvent.UpdatePersonalisedView, {
3498
+ * viewId: '1234'
3499
+ * }, ContextType.Liveboard);
3500
+ * ```
2909
3501
  * @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
3502
+ * @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
2910
3503
  */
2911
3504
  HostEvent["UpdatePersonalisedView"] = "UpdatePersonalisedView";
3505
+ /**
3506
+ * Triggers an event to update a personalized view of a Liveboard.
3507
+ * ```js
3508
+ * liveboardEmbed.trigger(HostEvent.UpdatePersonalisedView, {viewId: '1234'})
3509
+ * ```
3510
+ * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
3511
+ */
3512
+ HostEvent["UpdatePersonalizedView"] = "UpdatePersonalisedView";
3513
+ /**
3514
+ * Triggers selection of a specific Personalized View on a
3515
+ * Liveboard without reloading the embed. Pass either a
3516
+ * `viewId` (GUID) or `viewName`. If both are provided, `viewId` takes precedence.
3517
+ * If neither is provided, the Liveboard resets to the original/default view.
3518
+ * When a `viewName` is provided and multiple views share
3519
+ * the same name, the first match is selected.
3520
+ * @example
3521
+ * ```js
3522
+ * liveboardEmbed.trigger(
3523
+ * HostEvent.SelectPersonalizedView,
3524
+ * { viewId: '2a021a12-1aed-425d-984b-141ee916ce72' },
3525
+ * )
3526
+ * ```
3527
+ * @example
3528
+ * ```js
3529
+ * // Select by name
3530
+ * liveboardEmbed.trigger(
3531
+ * HostEvent.SelectPersonalizedView,
3532
+ * { viewName: 'Dr Smith Cardiology' },
3533
+ * )
3534
+ * ```
3535
+ * @example
3536
+ * ```js
3537
+ * // Reset to default view
3538
+ * liveboardEmbed.trigger(
3539
+ * HostEvent.SelectPersonalizedView,
3540
+ * {},
3541
+ * )
3542
+ * ```
3543
+ * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
3544
+ */
3545
+ HostEvent["SelectPersonalizedView"] = "SelectPersonalisedView";
2912
3546
  /**
2913
3547
  * @hidden
2914
3548
  * Notify when info call is completed successfully
@@ -2928,7 +3562,8 @@
2928
3562
  * add a name and description for the Answer.
2929
3563
  * @param - Includes the following keys:
2930
3564
  * - `vizId`: Refers to the Answer ID in Spotter embed and is **required** in Spotter
2931
- * embed. - `name`: Optional. Name string for the Answer.
3565
+ * embed.
3566
+ * - `name`: Optional. Name string for the Answer.
2932
3567
  * - `description`: Optional. Description text for the Answer.
2933
3568
  * @example
2934
3569
  * ```js
@@ -2947,6 +3582,34 @@
2947
3582
  *
2948
3583
  * spotterEmbed.trigger(HostEvent.SaveAnswer, { vizId: latestSpotterVizId });
2949
3584
  * ```
3585
+ * @example
3586
+ * ```js
3587
+ * // Using context parameter to save answer from search context
3588
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3589
+ * const saveAnswerResponse = await appEmbed.trigger(HostEvent.SaveAnswer, {
3590
+ * name: "Regional sales analysis",
3591
+ * description: "Sales breakdown by region"
3592
+ * }, ContextType.Search);
3593
+ * ```
3594
+ * @example
3595
+ * ```js
3596
+ * // Save answer from answer context (explore modal)
3597
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3598
+ * const saveAnswerResponse = await appEmbed.trigger(HostEvent.SaveAnswer, {
3599
+ * name: "Modified analysis",
3600
+ * description: "Updated from explore view"
3601
+ * }, ContextType.Answer);
3602
+ * ```
3603
+ * @example
3604
+ * ```js
3605
+ * // Save answer from spotter context
3606
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3607
+ * const saveAnswerResponse = await appEmbed.trigger(HostEvent.SaveAnswer, {
3608
+ * vizId: latestSpotterVizId,
3609
+ * name: "AI insights",
3610
+ * description: "Generated from Spotter"
3611
+ * }, ContextType.Spotter);
3612
+ * ```
2950
3613
  * @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
2951
3614
  */
2952
3615
  HostEvent["SaveAnswer"] = "saveAnswer";
@@ -2988,6 +3651,15 @@
2988
3651
  * executeSearch: true,
2989
3652
  * })
2990
3653
  * ```
3654
+ * @example
3655
+ * ```js
3656
+ * // Spotter search from spotter context
3657
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3658
+ * spotterEmbed.trigger(HostEvent.SpotterSearch, {
3659
+ * query: 'sales by region',
3660
+ * executeSearch: true
3661
+ * }, ContextType.Spotter);
3662
+ * ```
2991
3663
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
2992
3664
  */
2993
3665
  HostEvent["SpotterSearch"] = "SpotterSearch";
@@ -2998,6 +3670,12 @@
2998
3670
  * ```js
2999
3671
  * spotterEmbed.trigger(HostEvent.EditLastPrompt, "revenue per year");
3000
3672
  * ```
3673
+ * @example
3674
+ * ```js
3675
+ * // Edit last prompt from spotter context
3676
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3677
+ * spotterEmbed.trigger(HostEvent.EditLastPrompt, "sales by region", ContextType.Spotter);
3678
+ * ```
3001
3679
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
3002
3680
  */
3003
3681
  HostEvent["EditLastPrompt"] = "EditLastPrompt";
@@ -3007,6 +3685,12 @@
3007
3685
  * ```js
3008
3686
  * spotterEmbed.trigger(HostEvent.PreviewSpotterData);
3009
3687
  * ```
3688
+ * @example
3689
+ * ```js
3690
+ * // Preview spotter data from spotter context
3691
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3692
+ * spotterEmbed.trigger(HostEvent.PreviewSpotterData, {}, ContextType.Spotter);
3693
+ * ```
3010
3694
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
3011
3695
  */
3012
3696
  HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
@@ -3765,6 +4449,7 @@
3765
4449
  * disabledActions: [Action.LiveboardInfo]
3766
4450
  * ```
3767
4451
  */
4452
+ // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
3768
4453
  Action["LiveboardInfo"] = "pinboardInfo";
3769
4454
  /**
3770
4455
  * @hidden
@@ -3795,6 +4480,7 @@
3795
4480
  * disabledActions: [Action.Subscription]
3796
4481
  * ```
3797
4482
  */
4483
+ // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
3798
4484
  Action["Subscription"] = "subscription";
3799
4485
  /**
3800
4486
  * The **Explore** action on Liveboard visualizations
@@ -4274,13 +4960,25 @@
4274
4960
  /**
4275
4961
  * The Liveboard Personalised Views dropdown.
4276
4962
  * Allows navigating to a personalized Liveboard View.
4963
+ * This action is deprecated. Use {@link Action.PersonalizedViewsDropdown} instead.
4277
4964
  * @example
4278
4965
  * ```js
4279
4966
  * disabledActions: [Action.PersonalisedViewsDropdown]
4280
4967
  * ```
4281
4968
  * @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 10.1.0.sw
4969
+ * @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
4282
4970
  */
4283
4971
  Action["PersonalisedViewsDropdown"] = "personalisedViewsDropdown";
4972
+ /**
4973
+ * The Liveboard Personalized Views dropdown.
4974
+ * Allows navigating to a personalized Liveboard View.
4975
+ * @example
4976
+ * ```js
4977
+ * disabledActions: [Action.PersonalizedViewsDropdown]
4978
+ * ```
4979
+ * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
4980
+ */
4981
+ Action["PersonalizedViewsDropdown"] = "personalisedViewsDropdown";
4284
4982
  /**
4285
4983
  * Action ID for show or hide the user details on a
4286
4984
  * Liveboard (Recently visited / social proof)
@@ -4368,14 +5066,27 @@
4368
5066
  /**
4369
5067
  * The **Organize Favourites** action on Homepage
4370
5068
  * *Favorites* module.
5069
+ * This action is deprecated. Use {@link Action.OrganizeFavorites} instead.
4371
5070
  *
4372
5071
  * @example
4373
5072
  * ```js
4374
5073
  * disabledActions: [Action.OrganiseFavourites]
4375
5074
  * ```
4376
5075
  * @version SDK: 1.32.0 | ThoughtSpot: 10.0.0.cl
5076
+ * @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
4377
5077
  */
4378
5078
  Action["OrganiseFavourites"] = "organiseFavourites";
5079
+ /**
5080
+ * The **Organize Favorites** action on Homepage
5081
+ * *Favorites* module.
5082
+ *
5083
+ * @example
5084
+ * ```js
5085
+ * disabledActions: [Action.OrganizeFavorites]
5086
+ * ```
5087
+ * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
5088
+ */
5089
+ Action["OrganizeFavorites"] = "organiseFavourites";
4379
5090
  /**
4380
5091
  * The **AI Highlights** action on a Liveboard.
4381
5092
  *
@@ -5125,6 +5836,22 @@
5125
5836
  /** Invalid URL provided in configuration */
5126
5837
  EmbedErrorCodes["INVALID_URL"] = "INVALID_URL";
5127
5838
  })(exports.EmbedErrorCodes || (exports.EmbedErrorCodes = {}));
5839
+ /**
5840
+ * Context types for specifying the page context when triggering host events.
5841
+ * Used as the third parameter in the `trigger` method to help ThoughtSpot
5842
+ * understand the current page context for better event handling.
5843
+ *
5844
+ * @example
5845
+ * ```js
5846
+ * import { HostEvent, ContextType } from '@thoughtspot/visual-embed-sdk';
5847
+ *
5848
+ * // Trigger an event with specific context
5849
+ * embed.trigger(HostEvent.Pin, { vizId: "123", liveboardId: "456" }, ContextType.Search);
5850
+ * ```
5851
+ *
5852
+ * @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl
5853
+ * @group Events
5854
+ */
5128
5855
  exports.ContextType = void 0;
5129
5856
  (function (ContextType) {
5130
5857
  /**
@@ -5143,6 +5870,10 @@
5143
5870
  * Spotter context for spotter modal/page.
5144
5871
  */
5145
5872
  ContextType["Spotter"] = "spotter";
5873
+ /**
5874
+ * Other context for any other generic page.
5875
+ */
5876
+ ContextType["Other"] = "other";
5146
5877
  })(exports.ContextType || (exports.ContextType = {}));
5147
5878
  /**
5148
5879
  * Enum for the type of API intercepted
@@ -8125,6 +8856,13 @@
8125
8856
  UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
8126
8857
  UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
8127
8858
  UIPassthroughEvent["GetUnsavedAnswerTML"] = "getUnsavedAnswerTML";
8859
+ UIPassthroughEvent["GetAnswerSession"] = "getAnswerSession";
8860
+ UIPassthroughEvent["GetFilters"] = "getFilters";
8861
+ UIPassthroughEvent["GetIframeUrl"] = "getIframeUrl";
8862
+ UIPassthroughEvent["GetParameters"] = "getParameters";
8863
+ UIPassthroughEvent["GetTML"] = "getTML";
8864
+ UIPassthroughEvent["GetTabs"] = "getTabs";
8865
+ UIPassthroughEvent["GetExportRequestForCurrentPinboard"] = "getExportRequestForCurrentPinboard";
8128
8866
  })(exports.UIPassthroughEvent || (exports.UIPassthroughEvent = {}));
8129
8867
 
8130
8868
  const EndPoints = {
@@ -8758,9 +9496,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
8758
9496
  * You can use this service to:
8759
9497
  *
8760
9498
  * - Add or remove columns from Answers (`addColumns`, `removeColumns`,
8761
- * `addColumnsByName`) - Apply filters to Answers (`addFilter`)
9499
+ * `addColumnsByName`)
9500
+ * - Apply filters to Answers (`addFilter`)
8762
9501
  * - Get data from Answers in different formats (JSON, CSV, PNG) (`fetchData`,
8763
- * `fetchCSVBlob`, `fetchPNGBlob`) - Get data for specific points in visualizations
9502
+ * `fetchCSVBlob`, `fetchPNGBlob`)
9503
+ * - Get data for specific points in visualizations
8764
9504
  * (`getUnderlyingDataForPoint`)
8765
9505
  * - Run custom queries (`executeQuery`)
8766
9506
  * - Add visualizations to Liveboards (`addDisplayedVizToLiveboard`)
@@ -17522,7 +18262,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17522
18262
  /**
17523
18263
  * The current authentication token or session has expired.
17524
18264
  *
17525
- * Emitted when the embed receives an auth-expiry signal and starts auth refresh handling.
18265
+ * Emitted when the embed receives an auth-expiry signal and starts auth refresh
18266
+ * handling.
17526
18267
  */
17527
18268
  AuthFailureType["EXPIRY"] = "EXPIRY";
17528
18269
  /**
@@ -18535,11 +19276,25 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
18535
19276
  return eventData;
18536
19277
  }
18537
19278
 
18538
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.46.4";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 && node dts-config/wrap-ambient-module.mjs","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 || echo 'Warning: Coveralls upload failed but not breaking the build.'","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};
19279
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.46.5-beta.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 && node dts-config/wrap-ambient-module.mjs","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 || echo 'Warning: Coveralls upload failed but not breaking the build.'","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"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};
18539
19280
 
19281
+ /** Host events that use getDataWithPassthroughFallback (getter-style APIs) */
19282
+ const HOST_EVENT_PASSTHROUGH_MAP = {
19283
+ [exports.HostEvent.GetAnswerSession]: exports.UIPassthroughEvent.GetAnswerSession,
19284
+ [exports.HostEvent.GetFilters]: exports.UIPassthroughEvent.GetFilters,
19285
+ [exports.HostEvent.GetIframeUrl]: exports.UIPassthroughEvent.GetIframeUrl,
19286
+ [exports.HostEvent.GetParameters]: exports.UIPassthroughEvent.GetParameters,
19287
+ [exports.HostEvent.GetTML]: exports.UIPassthroughEvent.GetTML,
19288
+ [exports.HostEvent.GetTabs]: exports.UIPassthroughEvent.GetTabs,
19289
+ [exports.HostEvent.getExportRequestForCurrentPinboard]: exports.UIPassthroughEvent.GetExportRequestForCurrentPinboard,
19290
+ };
18540
19291
  class HostEventClient {
18541
19292
  constructor(iFrame) {
18542
19293
  this.iFrame = iFrame;
19294
+ this.customHandlers = {
19295
+ [exports.HostEvent.Pin]: (p, c) => this.handlePinEvent(p, c),
19296
+ [exports.HostEvent.SaveAnswer]: (p, c) => this.handleSaveAnswerEvent(p, c),
19297
+ };
18543
19298
  }
18544
19299
  /**
18545
19300
  * A wrapper over process trigger to
@@ -18556,7 +19311,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
18556
19311
  }
18557
19312
  async handleHostEventWithParam(apiName, parameters, context) {
18558
19313
  var _a, _b, _c, _d;
18559
- 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];
19314
+ const response = (_b = (_a = (await this.triggerUIPassthroughApi(apiName, parameters, context))) === null || _a === void 0 ? void 0 : _a.find) === null || _b === void 0 ? void 0 : _b.call(_a, (r) => r.error || r.value);
18560
19315
  if (!response) {
18561
19316
  const error = `No answer found${parameters.vizId ? ` for vizId: ${parameters.vizId}` : ''}.`;
18562
19317
  throw { error };
@@ -18565,13 +19320,35 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
18565
19320
  || ((_c = response.value) === null || _c === void 0 ? void 0 : _c.errors)
18566
19321
  || ((_d = response.value) === null || _d === void 0 ? void 0 : _d.error);
18567
19322
  if (errors) {
18568
- throw { error: response.error };
19323
+ const message = typeof errors === 'string' ? errors : JSON.stringify(errors);
19324
+ throw { error: message };
18569
19325
  }
18570
19326
  return { ...response.value };
18571
19327
  }
18572
19328
  async hostEventFallback(hostEvent, data, context) {
18573
19329
  return this.processTrigger(hostEvent, data, context);
18574
19330
  }
19331
+ /**
19332
+ * For getter events that return data. Tries UI passthrough first;
19333
+ * if the app doesn't support it (no response data), falls back to
19334
+ * the legacy host event channel. Real errors are thrown as-is.
19335
+ */
19336
+ async getDataWithPassthroughFallback(passthroughEvent, hostEvent, payload, context) {
19337
+ var _a, _b, _c;
19338
+ const response = await this.triggerUIPassthroughApi(passthroughEvent, payload || {}, context);
19339
+ const matched = (_a = response === null || response === void 0 ? void 0 : response.find) === null || _a === void 0 ? void 0 : _a.call(response, (r) => r.error || r.value);
19340
+ if (!matched) {
19341
+ return this.hostEventFallback(hostEvent, payload, context);
19342
+ }
19343
+ const errors = matched.error
19344
+ || ((_b = matched.value) === null || _b === void 0 ? void 0 : _b.errors)
19345
+ || ((_c = matched.value) === null || _c === void 0 ? void 0 : _c.error);
19346
+ if (errors) {
19347
+ const message = typeof errors === 'string' ? errors : JSON.stringify(errors);
19348
+ throw new Error(message);
19349
+ }
19350
+ return { ...matched.value };
19351
+ }
18575
19352
  /**
18576
19353
  * Setter for the iframe element used for host events
18577
19354
  * @param {HTMLIFrameElement} iFrame - the iframe element to set
@@ -18615,14 +19392,15 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
18615
19392
  };
18616
19393
  }
18617
19394
  async triggerHostEvent(hostEvent, payload, context) {
18618
- switch (hostEvent) {
18619
- case exports.HostEvent.Pin:
18620
- return this.handlePinEvent(payload, context);
18621
- case exports.HostEvent.SaveAnswer:
18622
- return this.handleSaveAnswerEvent(payload, context);
18623
- default:
18624
- return this.hostEventFallback(hostEvent, payload, context);
19395
+ const customHandler = this.customHandlers[hostEvent];
19396
+ if (customHandler) {
19397
+ return customHandler(payload, context);
18625
19398
  }
19399
+ const passthroughEvent = HOST_EVENT_PASSTHROUGH_MAP[hostEvent];
19400
+ if (passthroughEvent) {
19401
+ return this.getDataWithPassthroughFallback(passthroughEvent, hostEvent, payload, context);
19402
+ }
19403
+ return this.hostEventFallback(hostEvent, payload, context);
18626
19404
  }
18627
19405
  }
18628
19406
 
@@ -19913,7 +20691,21 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
19913
20691
  * Triggers an event to the embedded app
19914
20692
  * @param {HostEvent} messageType The event type
19915
20693
  * @param {any} data The payload to send with the message
20694
+ * @param {ContextType} context Optional context type to specify the context from which the event is triggered.
20695
+ * Use ContextType.Search for search answer context, ContextType.Answer for answer/explore context,
20696
+ * ContextType.Liveboard for liveboard context, or ContextType.Spotter for spotter context.
20697
+ * Available from SDK version 1.45.2 | ThoughtSpot: 26.3.0.cl
19916
20698
  * @returns A promise that resolves with the response from the embedded app
20699
+ * @example
20700
+ * ```js
20701
+ * // Trigger Pin event with context (SDK: 1.45.2+)
20702
+ * import { HostEvent, ContextType } from '@thoughtspot/visual-embed-sdk';
20703
+ * embed.trigger(HostEvent.Pin, {
20704
+ * vizId: "123",
20705
+ * liveboardId: "456"
20706
+ * }, ContextType.Search);
20707
+ * ```
20708
+ * @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl (for context parameter)
19917
20709
  */
19918
20710
  async trigger(messageType, data = {}, context) {
19919
20711
  uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
@@ -19976,8 +20768,33 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
19976
20768
  return this.render();
19977
20769
  }
19978
20770
  /**
19979
- * Get the current context of the embedded TS component.
19980
- * @returns The current context object containing the page type and object ids.
20771
+ * Context object for the embedded component.
20772
+ * @returns {ContextObject} The current context object containing the page type and object ids.
20773
+ * @example
20774
+ * ```js
20775
+ * const context = await embed.getCurrentContext();
20776
+ * console.log(context);
20777
+ *
20778
+ * // Example output
20779
+ * {
20780
+ * stack: [
20781
+ * {
20782
+ * name: 'Liveboard',
20783
+ * type: ContextType.Liveboard,
20784
+ * objectIds: {
20785
+ * liveboardId: '123',
20786
+ * },
20787
+ * },
20788
+ * ],
20789
+ * currentContext: {
20790
+ * name: 'Liveboard',
20791
+ * type: ContextType.Liveboard,
20792
+ * objectIds: {
20793
+ * liveboardId: '123',
20794
+ * },
20795
+ * },
20796
+ * }
20797
+ * ```
19981
20798
  * @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl
19982
20799
  */
19983
20800
  async getCurrentContext() {
@@ -20461,13 +21278,22 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
20461
21278
  const visibleCoordinatesData = calculateVisibleElementData(this.iFrame);
20462
21279
  responder({ type: exports.EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
20463
21280
  };
21281
+ this.HEIGHT_CHANAGE_THRESHOLD = 30;
20464
21282
  /**
20465
21283
  * Set the iframe height as per the computed height received
20466
21284
  * from the ThoughtSpot app.
20467
21285
  * @param data The event payload
20468
21286
  */
20469
21287
  this.updateIFrameHeight = (data) => {
20470
- this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
21288
+ logger$3.error('Updating iframe height', data);
21289
+ const currentHeight = this.iFrame.getBoundingClientRect().height;
21290
+ const heightToSet = Math.max(data.data, this.defaultHeight);
21291
+ const heightChange = Math.abs(heightToSet - currentHeight);
21292
+ if (heightChange < this.HEIGHT_CHANAGE_THRESHOLD) {
21293
+ logger$3.info('Height change is less than the threshold, skipping height update', { heightChange, heightToSet, currentHeight });
21294
+ return;
21295
+ }
21296
+ this.setIFrameHeight(heightToSet);
20471
21297
  this.sendFullHeightLazyLoadData();
20472
21298
  };
20473
21299
  this.embedIframeCenter = (data, responder) => {
@@ -20926,13 +21752,21 @@ query GetEurekaVizSnapshots(
20926
21752
  const visibleCoordinatesData = calculateVisibleElementData(this.iFrame);
20927
21753
  responder({ type: exports.EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
20928
21754
  };
21755
+ this.HEIGHT_CHANAGE_THRESHOLD = 30;
20929
21756
  /**
20930
21757
  * Set the iframe height as per the computed height received
20931
21758
  * from the ThoughtSpot app.
20932
21759
  * @param data The event payload
20933
21760
  */
20934
21761
  this.updateIFrameHeight = (data) => {
20935
- this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
21762
+ const currentHeight = this.iFrame.getBoundingClientRect().height;
21763
+ const heightToSet = Math.max(data.data, this.defaultHeight);
21764
+ const heightChange = Math.abs(heightToSet - currentHeight);
21765
+ if (heightChange < this.HEIGHT_CHANAGE_THRESHOLD) {
21766
+ logger$3.info('Height change is less than the threshold, skipping height update', { heightChange, heightToSet, currentHeight });
21767
+ return;
21768
+ }
21769
+ this.setIFrameHeight(heightToSet);
20936
21770
  this.sendFullHeightLazyLoadData();
20937
21771
  };
20938
21772
  this.embedIframeCenter = (data, responder) => {
@@ -21098,7 +21932,8 @@ query GetEurekaVizSnapshots(
21098
21932
  }
21099
21933
  getIframeSuffixSrc(liveboardId, vizId, activeTabId, personalizedViewId) {
21100
21934
  // Extract view from liveboardId if passed along with it (legacy
21101
- // approach) View must be appended as query param at the end, not
21935
+ // approach)
21936
+ // View must be appended as query param at the end, not
21102
21937
  // embedded in path
21103
21938
  let liveboardGuid = liveboardId;
21104
21939
  let legacyViewId;