@thoughtspot/visual-embed-sdk 1.26.1 → 1.27.0-alpha.0

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 (274) hide show
  1. package/README.md +1 -1
  2. package/cjs/package.json +2 -2
  3. package/cjs/src/auth.d.ts +4 -16
  4. package/cjs/src/auth.d.ts.map +1 -1
  5. package/cjs/src/auth.js +26 -58
  6. package/cjs/src/auth.js.map +1 -1
  7. package/cjs/src/auth.spec.d.ts.map +1 -1
  8. package/cjs/src/auth.spec.js +42 -32
  9. package/cjs/src/auth.spec.js.map +1 -1
  10. package/cjs/src/authToken.d.ts +4 -0
  11. package/cjs/src/authToken.d.ts.map +1 -0
  12. package/cjs/src/authToken.js +61 -0
  13. package/cjs/src/authToken.js.map +1 -0
  14. package/cjs/src/embed/app.d.ts +15 -15
  15. package/cjs/src/embed/app.d.ts.map +1 -1
  16. package/cjs/src/embed/app.js +1 -1
  17. package/cjs/src/embed/app.js.map +1 -1
  18. package/cjs/src/embed/base.d.ts +0 -9
  19. package/cjs/src/embed/base.d.ts.map +1 -1
  20. package/cjs/src/embed/base.js +21 -44
  21. package/cjs/src/embed/base.js.map +1 -1
  22. package/cjs/src/embed/base.spec.js +15 -14
  23. package/cjs/src/embed/base.spec.js.map +1 -1
  24. package/cjs/src/embed/embedConfig.d.ts +18 -0
  25. package/cjs/src/embed/embedConfig.d.ts.map +1 -0
  26. package/cjs/src/embed/embedConfig.js +25 -0
  27. package/cjs/src/embed/embedConfig.js.map +1 -0
  28. package/cjs/src/embed/liveboard.d.ts +28 -23
  29. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  30. package/cjs/src/embed/liveboard.js +4 -3
  31. package/cjs/src/embed/liveboard.js.map +1 -1
  32. package/cjs/src/embed/sage.d.ts +48 -30
  33. package/cjs/src/embed/sage.d.ts.map +1 -1
  34. package/cjs/src/embed/sage.js +1 -1
  35. package/cjs/src/embed/sage.js.map +1 -1
  36. package/cjs/src/embed/search-bar.d.ts +22 -6
  37. package/cjs/src/embed/search-bar.d.ts.map +1 -1
  38. package/cjs/src/embed/search-bar.js.map +1 -1
  39. package/cjs/src/embed/search.d.ts +34 -19
  40. package/cjs/src/embed/search.d.ts.map +1 -1
  41. package/cjs/src/embed/search.js +10 -4
  42. package/cjs/src/embed/search.js.map +1 -1
  43. package/cjs/src/embed/search.spec.js +10 -0
  44. package/cjs/src/embed/search.spec.js.map +1 -1
  45. package/cjs/src/embed/searchEmbed-basic-auth.spec.js +3 -2
  46. package/cjs/src/embed/searchEmbed-basic-auth.spec.js.map +1 -1
  47. package/cjs/src/embed/ts-embed.d.ts +1 -0
  48. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  49. package/cjs/src/embed/ts-embed.js +30 -8
  50. package/cjs/src/embed/ts-embed.js.map +1 -1
  51. package/cjs/src/embed/ts-embed.spec.js +145 -22
  52. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  53. package/cjs/src/index.d.ts +2 -1
  54. package/cjs/src/index.d.ts.map +1 -1
  55. package/cjs/src/index.js +2 -1
  56. package/cjs/src/index.js.map +1 -1
  57. package/cjs/src/react/index.spec.js +0 -12
  58. package/cjs/src/react/index.spec.js.map +1 -1
  59. package/cjs/src/tokenizedFetch.d.ts +2 -0
  60. package/cjs/src/tokenizedFetch.d.ts.map +1 -0
  61. package/cjs/src/tokenizedFetch.js +20 -0
  62. package/cjs/src/tokenizedFetch.js.map +1 -0
  63. package/cjs/src/types.d.ts +733 -242
  64. package/cjs/src/types.d.ts.map +1 -1
  65. package/cjs/src/types.js +653 -175
  66. package/cjs/src/types.js.map +1 -1
  67. package/cjs/src/utils/{authService.d.ts → authService/authService.d.ts} +12 -11
  68. package/cjs/src/utils/authService/authService.d.ts.map +1 -0
  69. package/cjs/src/utils/{authService.js → authService/authService.js} +31 -39
  70. package/cjs/src/utils/authService/authService.js.map +1 -0
  71. package/cjs/src/utils/authService/authService.spec.d.ts.map +1 -0
  72. package/cjs/src/utils/{authService.spec.js → authService/authService.spec.js} +11 -12
  73. package/cjs/src/utils/authService/authService.spec.js.map +1 -0
  74. package/cjs/src/utils/authService/index.d.ts +3 -0
  75. package/cjs/src/utils/authService/index.d.ts.map +1 -0
  76. package/cjs/src/utils/authService/index.js +14 -0
  77. package/cjs/src/utils/authService/index.js.map +1 -0
  78. package/cjs/src/utils/authService/tokenizedAuthService.d.ts +11 -0
  79. package/cjs/src/utils/authService/tokenizedAuthService.d.ts.map +1 -0
  80. package/cjs/src/utils/authService/tokenizedAuthService.js +44 -0
  81. package/cjs/src/utils/authService/tokenizedAuthService.js.map +1 -0
  82. package/cjs/src/utils/graphql/answerService/answerService.d.ts +2 -4
  83. package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  84. package/cjs/src/utils/graphql/answerService/answerService.js +4 -5
  85. package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
  86. package/cjs/src/utils/graphql/answerService/answerService.spec.js +15 -3
  87. package/cjs/src/utils/graphql/answerService/answerService.spec.js.map +1 -1
  88. package/cjs/src/utils/processData.d.ts +6 -0
  89. package/cjs/src/utils/processData.d.ts.map +1 -1
  90. package/cjs/src/utils/processData.js +10 -5
  91. package/cjs/src/utils/processData.js.map +1 -1
  92. package/cjs/src/utils/processData.spec.js +8 -7
  93. package/cjs/src/utils/processData.spec.js.map +1 -1
  94. package/cjs/src/utils/processTrigger.js +1 -1
  95. package/dist/src/auth.d.ts +4 -16
  96. package/dist/src/auth.d.ts.map +1 -1
  97. package/dist/src/auth.spec.d.ts.map +1 -1
  98. package/dist/src/authToken.d.ts +4 -0
  99. package/dist/src/authToken.d.ts.map +1 -0
  100. package/dist/src/embed/app.d.ts +15 -15
  101. package/dist/src/embed/app.d.ts.map +1 -1
  102. package/dist/src/embed/base.d.ts +0 -9
  103. package/dist/src/embed/base.d.ts.map +1 -1
  104. package/dist/src/embed/embedConfig.d.ts +18 -0
  105. package/dist/src/embed/embedConfig.d.ts.map +1 -0
  106. package/dist/src/embed/liveboard.d.ts +28 -23
  107. package/dist/src/embed/liveboard.d.ts.map +1 -1
  108. package/dist/src/embed/sage.d.ts +48 -30
  109. package/dist/src/embed/sage.d.ts.map +1 -1
  110. package/dist/src/embed/search-bar.d.ts +22 -6
  111. package/dist/src/embed/search-bar.d.ts.map +1 -1
  112. package/dist/src/embed/search.d.ts +34 -19
  113. package/dist/src/embed/search.d.ts.map +1 -1
  114. package/dist/src/embed/ts-embed.d.ts +1 -0
  115. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  116. package/dist/src/index.d.ts +2 -1
  117. package/dist/src/index.d.ts.map +1 -1
  118. package/dist/src/tokenizedFetch.d.ts +2 -0
  119. package/dist/src/tokenizedFetch.d.ts.map +1 -0
  120. package/dist/src/types.d.ts +733 -242
  121. package/dist/src/types.d.ts.map +1 -1
  122. package/{lib/src/utils → dist/src/utils/authService}/authService.d.ts +44 -43
  123. package/dist/src/utils/authService/authService.d.ts.map +1 -0
  124. package/dist/src/utils/authService/index.d.ts +3 -0
  125. package/dist/src/utils/authService/index.d.ts.map +1 -0
  126. package/dist/src/utils/authService/tokenizedAuthService.d.ts +11 -0
  127. package/dist/src/utils/authService/tokenizedAuthService.d.ts.map +1 -0
  128. package/dist/src/utils/graphql/answerService/answerService.d.ts +2 -4
  129. package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  130. package/dist/src/utils/processData.d.ts +6 -0
  131. package/dist/src/utils/processData.d.ts.map +1 -1
  132. package/dist/tsembed-react.es.js +906 -339
  133. package/dist/tsembed-react.js +905 -338
  134. package/dist/tsembed.es.js +938 -370
  135. package/dist/tsembed.js +936 -368
  136. package/dist/visual-embed-sdk-react-full.d.ts +921 -360
  137. package/dist/visual-embed-sdk-react.d.ts +921 -360
  138. package/dist/visual-embed-sdk.d.ts +921 -360
  139. package/lib/package.json +2 -2
  140. package/lib/src/auth.d.ts +4 -16
  141. package/lib/src/auth.d.ts.map +1 -1
  142. package/lib/src/auth.js +21 -52
  143. package/lib/src/auth.js.map +1 -1
  144. package/lib/src/auth.spec.d.ts.map +1 -1
  145. package/lib/src/auth.spec.js +42 -32
  146. package/lib/src/auth.spec.js.map +1 -1
  147. package/lib/src/authToken.d.ts +4 -0
  148. package/lib/src/authToken.d.ts.map +1 -0
  149. package/lib/src/authToken.js +56 -0
  150. package/lib/src/authToken.js.map +1 -0
  151. package/lib/src/embed/app.d.ts +15 -15
  152. package/lib/src/embed/app.d.ts.map +1 -1
  153. package/lib/src/embed/app.js +1 -1
  154. package/lib/src/embed/app.js.map +1 -1
  155. package/lib/src/embed/base.d.ts +0 -9
  156. package/lib/src/embed/base.d.ts.map +1 -1
  157. package/lib/src/embed/base.js +21 -43
  158. package/lib/src/embed/base.js.map +1 -1
  159. package/lib/src/embed/base.spec.js +15 -14
  160. package/lib/src/embed/base.spec.js.map +1 -1
  161. package/lib/src/embed/embedConfig.d.ts +18 -0
  162. package/lib/src/embed/embedConfig.d.ts.map +1 -0
  163. package/lib/src/embed/embedConfig.js +20 -0
  164. package/lib/src/embed/embedConfig.js.map +1 -0
  165. package/lib/src/embed/liveboard.d.ts +28 -23
  166. package/lib/src/embed/liveboard.d.ts.map +1 -1
  167. package/lib/src/embed/liveboard.js +4 -3
  168. package/lib/src/embed/liveboard.js.map +1 -1
  169. package/lib/src/embed/sage.d.ts +48 -30
  170. package/lib/src/embed/sage.d.ts.map +1 -1
  171. package/lib/src/embed/sage.js +1 -1
  172. package/lib/src/embed/sage.js.map +1 -1
  173. package/lib/src/embed/search-bar.d.ts +22 -6
  174. package/lib/src/embed/search-bar.d.ts.map +1 -1
  175. package/lib/src/embed/search-bar.js.map +1 -1
  176. package/lib/src/embed/search.d.ts +34 -19
  177. package/lib/src/embed/search.d.ts.map +1 -1
  178. package/lib/src/embed/search.js +11 -5
  179. package/lib/src/embed/search.js.map +1 -1
  180. package/lib/src/embed/search.spec.js +10 -0
  181. package/lib/src/embed/search.spec.js.map +1 -1
  182. package/lib/src/embed/searchEmbed-basic-auth.spec.js +3 -2
  183. package/lib/src/embed/searchEmbed-basic-auth.spec.js.map +1 -1
  184. package/lib/src/embed/ts-embed.d.ts +1 -0
  185. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  186. package/lib/src/embed/ts-embed.js +32 -10
  187. package/lib/src/embed/ts-embed.js.map +1 -1
  188. package/lib/src/embed/ts-embed.spec.js +145 -22
  189. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  190. package/lib/src/index.d.ts +2 -1
  191. package/lib/src/index.d.ts.map +1 -1
  192. package/lib/src/index.js +2 -1
  193. package/lib/src/index.js.map +1 -1
  194. package/lib/src/react/index.spec.js +0 -12
  195. package/lib/src/react/index.spec.js.map +1 -1
  196. package/lib/src/tokenizedFetch.d.ts +2 -0
  197. package/lib/src/tokenizedFetch.d.ts.map +1 -0
  198. package/lib/src/tokenizedFetch.js +16 -0
  199. package/lib/src/tokenizedFetch.js.map +1 -0
  200. package/lib/src/types.d.ts +733 -242
  201. package/lib/src/types.d.ts.map +1 -1
  202. package/lib/src/types.js +653 -175
  203. package/lib/src/types.js.map +1 -1
  204. package/{dist/src/utils → lib/src/utils/authService}/authService.d.ts +44 -43
  205. package/lib/src/utils/authService/authService.d.ts.map +1 -0
  206. package/lib/src/utils/{authService.js → authService/authService.js} +26 -32
  207. package/lib/src/utils/authService/authService.js.map +1 -0
  208. package/lib/src/utils/authService/authService.spec.d.ts.map +1 -0
  209. package/lib/src/utils/{authService.spec.js → authService/authService.spec.js} +1 -2
  210. package/lib/src/utils/authService/authService.spec.js.map +1 -0
  211. package/lib/src/utils/authService/index.d.ts +3 -0
  212. package/lib/src/utils/authService/index.d.ts.map +1 -0
  213. package/lib/src/utils/authService/index.js +3 -0
  214. package/lib/src/utils/authService/index.js.map +1 -0
  215. package/lib/src/utils/authService/tokenizedAuthService.d.ts +11 -0
  216. package/lib/src/utils/authService/tokenizedAuthService.d.ts.map +1 -0
  217. package/lib/src/utils/authService/tokenizedAuthService.js +39 -0
  218. package/lib/src/utils/authService/tokenizedAuthService.js.map +1 -0
  219. package/lib/src/utils/graphql/answerService/answerService.d.ts +2 -4
  220. package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  221. package/lib/src/utils/graphql/answerService/answerService.js +4 -5
  222. package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
  223. package/lib/src/utils/graphql/answerService/answerService.spec.js +14 -3
  224. package/lib/src/utils/graphql/answerService/answerService.spec.js.map +1 -1
  225. package/lib/src/utils/processData.d.ts +6 -0
  226. package/lib/src/utils/processData.d.ts.map +1 -1
  227. package/lib/src/utils/processData.js +8 -4
  228. package/lib/src/utils/processData.js.map +1 -1
  229. package/lib/src/utils/processData.spec.js +8 -7
  230. package/lib/src/utils/processData.spec.js.map +1 -1
  231. package/lib/src/utils/processTrigger.js +1 -1
  232. package/lib/src/visual-embed-sdk.d.ts +926 -361
  233. package/package.json +2 -2
  234. package/src/auth.spec.ts +77 -63
  235. package/src/auth.ts +22 -59
  236. package/src/authToken.ts +66 -0
  237. package/src/embed/app.ts +20 -20
  238. package/src/embed/base.spec.ts +18 -17
  239. package/src/embed/base.ts +26 -51
  240. package/src/embed/embedConfig.ts +23 -0
  241. package/src/embed/liveboard.ts +32 -27
  242. package/src/embed/sage.ts +48 -30
  243. package/src/embed/search-bar.tsx +22 -6
  244. package/src/embed/search.spec.ts +13 -0
  245. package/src/embed/search.ts +51 -31
  246. package/src/embed/searchEmbed-basic-auth.spec.ts +3 -2
  247. package/src/embed/ts-embed.spec.ts +189 -45
  248. package/src/embed/ts-embed.ts +33 -24
  249. package/src/index.ts +8 -2
  250. package/src/react/index.spec.tsx +0 -29
  251. package/src/tokenizedFetch.ts +18 -0
  252. package/src/types.ts +761 -266
  253. package/src/utils/{authService.spec.ts → authService/authService.spec.ts} +2 -3
  254. package/src/utils/{authService.ts → authService/authService.ts} +29 -34
  255. package/src/utils/authService/index.ts +9 -0
  256. package/src/utils/authService/tokenizedAuthService.ts +40 -0
  257. package/src/utils/graphql/answerService/answerService.spec.ts +16 -4
  258. package/src/utils/graphql/answerService/answerService.ts +4 -5
  259. package/src/utils/processData.spec.ts +19 -16
  260. package/src/utils/processData.ts +7 -3
  261. package/src/utils/processTrigger.ts +1 -1
  262. package/cjs/src/utils/authService.d.ts.map +0 -1
  263. package/cjs/src/utils/authService.js.map +0 -1
  264. package/cjs/src/utils/authService.spec.d.ts.map +0 -1
  265. package/cjs/src/utils/authService.spec.js.map +0 -1
  266. package/dist/src/utils/authService.d.ts.map +0 -1
  267. package/lib/src/utils/authService.d.ts.map +0 -1
  268. package/lib/src/utils/authService.js.map +0 -1
  269. package/lib/src/utils/authService.spec.d.ts.map +0 -1
  270. package/lib/src/utils/authService.spec.js.map +0 -1
  271. /package/cjs/src/utils/{authService.spec.d.ts → authService/authService.spec.d.ts} +0 -0
  272. /package/dist/src/utils/{authService.spec.d.ts → authService/authService.spec.d.ts} +0 -0
  273. /package/dist/src/utils/{authService.spec.d.ts.map → authService/authService.spec.d.ts.map} +0 -0
  274. /package/lib/src/utils/{authService.spec.d.ts → authService/authService.spec.d.ts} +0 -0
package/src/types.ts CHANGED
@@ -32,10 +32,14 @@ export enum AuthType {
32
32
  */
33
33
  None = 'None',
34
34
  /**
35
- * Passthrough SSO to the embedded App within the iframe. Requires least
35
+ * Passthrough SSO to the embedded application within the iframe. Requires least
36
36
  * configuration, but may not be supported by all IDPs. This will behave like `None`
37
37
  * if SSO is not configured on ThoughtSpot.
38
38
  *
39
+ * To use this:
40
+ * Your SAML or OpenID provider must allow iframe redirects.
41
+ * For example, if you are using Okta as IdP, you can enable iframe embedding.
42
+ *
39
43
  * @example
40
44
  * ```js
41
45
  * init({
@@ -43,12 +47,7 @@ export enum AuthType {
43
47
  * authType: AuthType.EmbeddedSSO,
44
48
  * });
45
49
  * ```
46
- * Set authentication type as Embedded SSO.
47
- *
48
- * To use this:
49
- * Your SAML or OpenID provider must allow iframe redirects.
50
- * eg. If you are using okta as IdP, you can enable iFrame embedding.
51
- * @version: SDK: 1.15.0 | ThouhgtSpot: 8.8.0.cl
50
+ * @version: SDK: 1.15.0 | ThoughtSpot: 8.8.0.cl
52
51
  */
53
52
  EmbeddedSSO = 'EmbeddedSSO',
54
53
  /**
@@ -67,10 +66,10 @@ export enum AuthType {
67
66
  SAML = 'SSO_SAML',
68
67
  /**
69
68
  * SSO using SAML
70
- * Will make the host application redirect to the SAML Idp. Use this
71
- * when the idp does not allow itself to be embedded.
69
+ * Makes the host application redirect to the SAML IdP. Use this
70
+ * if your IdP does not allow itself to be embedded.
72
71
  *
73
- * This redirects the host application to the SAML Idp. The host application
72
+ * This redirects the host application to the SAML IdP. The host application
74
73
  * will be redirected back to the ThoughtSpot app after authentication.
75
74
  *
76
75
  * @example
@@ -81,7 +80,7 @@ export enum AuthType {
81
80
  * });
82
81
  * ```
83
82
  *
84
- * This opens the SAML Idp in a popup window. The popup is triggered
83
+ * This opens the SAML IdP in a popup window. The popup is triggered
85
84
  * when the user clicks the trigger button. The popup window will be
86
85
  * closed automatically after authentication.
87
86
  * @example
@@ -95,8 +94,8 @@ export enum AuthType {
95
94
  * });
96
95
  * ```
97
96
  *
98
- * Can also use event to trigger the popup flow. Works the same
99
- * as above example.
97
+ * Can also use the event to trigger the popup flow. Works the same
98
+ * as the above example.
100
99
  * @example
101
100
  * ```js
102
101
  * const authEE = init({
@@ -120,7 +119,7 @@ export enum AuthType {
120
119
  OIDC = 'SSO_OIDC',
121
120
  /**
122
121
  * SSO using OIDC
123
- * Will make the host application redirect to the OIDC Idp.
122
+ * Will make the host application redirect to the OIDC IdP.
124
123
  * See code samples in {@link SAMLRedirect}.
125
124
  */
126
125
  OIDCRedirect = 'SSO_OIDC',
@@ -132,8 +131,8 @@ export enum AuthType {
132
131
  */
133
132
  AuthServer = 'AuthServer',
134
133
  /**
135
- * Trusted authentication server, Use your own authentication server
136
- * which returns a bearer token, generated using the secret_key obtained
134
+ * Trusted authentication server. Use your own authentication server
135
+ * which returns a bearer token, generated using the `secret_key` obtained
137
136
  * from ThoughtSpot.
138
137
  *
139
138
  * @example
@@ -150,11 +149,11 @@ export enum AuthType {
150
149
  */
151
150
  TrustedAuthToken = 'AuthServer',
152
151
  /**
153
- * Trusted authentication server Cookieless, Use you own authentication
154
- * server which returns a bearer token, generated using the secret_key
152
+ * Trusted authentication server Cookieless, Use your own authentication
153
+ * server which returns a bearer token, generated using the `secret_key`
155
154
  * obtained from ThoughtSpot. This uses a cookieless authentication
156
- * approach, recommended to by pass third-party cookie-blocking restriction
157
- * implemented by some browsers
155
+ * approach, recommended to bypass the third-party cookie-blocking restriction
156
+ * implemented by some browsers.
158
157
  *
159
158
  * @example
160
159
  * ```js
@@ -167,7 +166,7 @@ export enum AuthType {
167
166
  * .then((data) => data.token);
168
167
  * }
169
168
  * ```
170
- * @version SDK: 1.22.0| ThouhgtSpot: 9.3.0.cl, 9.5.1.sw
169
+ * @version SDK: 1.22.0| ThoughtSpot: 9.3.0.cl, 9.5.1.sw
171
170
  */
172
171
  TrustedAuthTokenCookieless = 'AuthServerCookieless',
173
172
  /**
@@ -294,13 +293,19 @@ export interface EmbedConfig {
294
293
  * The ThoughtSpot cluster hostname or IP address.
295
294
  */
296
295
  thoughtSpotHost: string;
296
+ /**
297
+ * If true, all the iframe links will have /v2 added automatically.
298
+ * If false, all the iframe links will have /v1 added automatically.
299
+ * If undefined, nothing will be added
300
+ */
301
+ enableReactShell?: boolean | undefined;
297
302
  /**
298
303
  * The authentication mechanism to use.
299
304
  */
300
305
  authType: AuthType;
301
306
  /**
302
307
  * [AuthServer] The trusted authentication endpoint to use to get the
303
- * authentication token. A GET request is made to the
308
+ * authentication token. A `GET` request is made to the
304
309
  * authentication API endpoint, which returns the token
305
310
  * as a plaintext response. For trusted authentication,
306
311
  * the `authEndpoint` or `getAuthToken` attribute is required.
@@ -313,8 +318,8 @@ export interface EmbedConfig {
313
318
  * attribute is required.
314
319
  *
315
320
  * It is advisable to fetch a new token inside this method and not
316
- * reuse and older issued token, as because when auth expires this is
317
- * called again and if it is called with an older token the authentication
321
+ * reuse the old issued token. When auth expires this method is
322
+ * called again and if it is called with an older token, the authentication
318
323
  * will not succeed.
319
324
  */
320
325
  getAuthToken?: () => Promise<string>;
@@ -325,7 +330,7 @@ export interface EmbedConfig {
325
330
  username?: string;
326
331
 
327
332
  /**
328
- * [Basic] The ThoughtSpot login password corresponding to the user name
333
+ * [Basic] The ThoughtSpot login password corresponding to the username
329
334
  *
330
335
  * Warning: This feature is primarily intended for developer testing. It is
331
336
  * strongly advised not to use this authentication method in production.
@@ -334,7 +339,7 @@ export interface EmbedConfig {
334
339
 
335
340
  /**
336
341
  * [SSO] For SSO Authentication, if `noRedirect` is set to true, it will
337
- * open the SAML auth flow in a popup, instead of redirecting browser in
342
+ * open the SAML auth flow in a popup, instead of redirecting the browser in
338
343
  * place.
339
344
  *
340
345
  * @default false
@@ -344,10 +349,10 @@ export interface EmbedConfig {
344
349
 
345
350
  /**
346
351
  * [SSO] For SSO Authentication, if `inPopup` is set to true, it will open
347
- * the SAML auth flow in a popup, instead of redirecting browser in place.
352
+ * the SAML auth flow in a popup, instead of redirecting the browser in place.
348
353
  *
349
- * Need to use this with authTriggerContainer. Or manually trigger
350
- * the AuthEvent.TRIGGER_SSO_POPUP event on a user interaction.
354
+ * Need to use this with `authTriggerContainer`. Or manually trigger
355
+ * the `AuthEvent.TRIGGER_SSO_POPUP` event on a user interaction.
351
356
  *
352
357
  * @default false
353
358
  * @version SDK: 1.18.0
@@ -355,13 +360,13 @@ export interface EmbedConfig {
355
360
  inPopup?: boolean;
356
361
 
357
362
  /**
358
- * [SSO] For SSO Authentication, one can supply an optional path param,
359
- * this will be the path on the host origin where the SAML flow will be
363
+ * [SSO] For SSO Authentication, one can supply an optional path param;
364
+ * This will be the path on the host origin where the SAML flow will be
360
365
  * terminated.
361
366
  *
362
367
  * Eg: "/dashboard", "#/foo" [Do not include the host]
363
368
  *
364
- * @version SDK: 1.10.2 | 8.2.0.cl, 8.4.1.sw
369
+ * @version SDK: 1.10.2 | ThoughtSpot 8.2.0.cl, 8.4.1.sw
365
370
  */
366
371
  redirectPath?: string;
367
372
 
@@ -369,19 +374,19 @@ export interface EmbedConfig {
369
374
  basepath?: string;
370
375
 
371
376
  /**
372
- * Should we encode URL Query Params using base64 encoding which thoughtspot
373
- * will generate for embedding. This provides additional security to
374
- * thoughtspot clusters against Cross site scripting attacks.
377
+ * Boolean to define if the query parameters in the ThoughtSpot URL
378
+ * should be encoded in base64. This provides additional security to
379
+ * Thoughtspot clusters against cross-site scripting attacks.
375
380
  *
376
381
  * @default false
377
382
  */
378
383
  shouldEncodeUrlQueryParams?: boolean;
379
384
 
380
385
  /**
381
- * Suppress cookie access alert when third party cookies are blocked by the
382
- * user's browser. Third party cookie blocking is the default behaviour on
383
- * Safari and opt-in for Firefox/Chrome. If you set this to `true`, you are
384
- * encouraged to handle `noCookieAccess` event, to show your own treatment
386
+ * Suppress cookie access alert when third-party cookies are blocked by the
387
+ * user's browser. Third-party cookie blocking is the default behaviour on
388
+ * some web browsers like Safari. If you set this attribute to `true`,
389
+ * you are encouraged to handle `noCookieAccess` event, to show your own treatment
385
390
  * in this case.
386
391
  *
387
392
  * @default false
@@ -389,16 +394,17 @@ export interface EmbedConfig {
389
394
  suppressNoCookieAccessAlert?: boolean;
390
395
 
391
396
  /**
392
- * Ignore cookie access alert when third party cookies are blocked by the
397
+ * Ignore the cookie access alert when third-party cookies are blocked by the
393
398
  * user's browser. If you set this to `true`, the embedded iframe behaviour
394
- * persist even in case of non logged in user.
399
+ * persists even in the case of a non-logged-in user.
395
400
  *
396
401
  * @default false
397
402
  */
398
403
  ignoreNoCookieAccess?: boolean;
399
404
 
400
405
  /**
401
- * Re-login when session expires with the previous login options
406
+ * Re-login a user with the previous login options
407
+ * when a user session expires.
402
408
  *
403
409
  * @default false
404
410
  */
@@ -406,8 +412,9 @@ export interface EmbedConfig {
406
412
 
407
413
  /**
408
414
  * Disable redirection to the login page when the embedded session expires
409
- * This flag is typically used alongside the combination of auth modes such as {@link
410
- * AuthType.AuthServer} and auto login behavior {@link EmbedConfig.autoLogin}
415
+ * This flag is typically used alongside the combination of authentication modes such
416
+ * as {@link AuthType.AuthServer} and auto-login behavior {@link
417
+ * EmbedConfig.autoLogin}
411
418
  *
412
419
  * @version SDK: 1.9.3 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw
413
420
  * @default false
@@ -415,23 +422,23 @@ export interface EmbedConfig {
415
422
  disableLoginRedirect?: boolean;
416
423
 
417
424
  /**
418
- * This message is displayed on the embed view when the login fails.
425
+ * This message is displayed in the embedded view when a user login fails.
419
426
  *
420
427
  * @version SDK: 1.10.1 | ThoughtSpot: 8.2.0.cl, 8.4.1.sw
421
428
  */
422
429
  loginFailedMessage?: string;
423
430
 
424
431
  /**
425
- * Calls the prefetch method internally when set to true
432
+ * Calls the prefetch method internally when set to `true`
426
433
  *
427
434
  * @default false
428
435
  */
429
436
  callPrefetch?: boolean;
430
437
 
431
438
  /**
432
- * When there are multiple embeds, queue the render of embed to start
433
- * after the previous embed's render is complete. This helps in the load
434
- * performance by decreasing the load on the browser.
439
+ * When there are multiple objects embedded, queue the rendering of embedded objects
440
+ * to start after the previous embed's render is complete. This helps improve
441
+ * performance by decreasing the load on the browser.
435
442
  *
436
443
  * @Version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
437
444
  * @default false
@@ -439,7 +446,7 @@ export interface EmbedConfig {
439
446
  queueMultiRenders?: boolean;
440
447
 
441
448
  /**
442
- * Dynamic CSS Url to be injected in the loaded application.
449
+ * Dynamic CSS URL to be injected in the loaded application.
443
450
  * You would also need to set `style-src` in the CSP settings.
444
451
  *
445
452
  * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
@@ -447,9 +454,9 @@ export interface EmbedConfig {
447
454
  */
448
455
  customCssUrl?: string;
449
456
  /**
450
- * [AuthServer|Basic] Detect if 3rd party cookies are enabled by doing an
457
+ * [AuthServer|Basic] Detect if third-party party cookies are enabled by doing an
451
458
  * additional call. This is slower and should be avoided. Listen to the
452
- * NO_COOKIE_ACCESS event to handle the situation.
459
+ * `NO_COOKIE_ACCESS` event to handle the situation.
453
460
  *
454
461
  * This is slightly slower than letting the browser handle the cookie check, as it
455
462
  * involves an extra network call.
@@ -458,27 +465,26 @@ export interface EmbedConfig {
458
465
  */
459
466
  detectCookieAccessSlow?: boolean;
460
467
  /**
461
- * Hide beta alert warning message for SearchEmbed.
468
+ * Hide the `beta` alert warning message for SearchEmbed.
462
469
  *
463
470
  * @version SDK: 1.12.0 | ThoughtSpot: 8.4.0.cl, 8.4.1.sw*
464
471
  */
465
472
  suppressSearchEmbedBetaWarning?: boolean;
466
-
467
473
  /**
468
- * Hide beta alert warning message for SageEmbed.
474
+ * Hide `beta` alert warning message for SageEmbed.
469
475
  *
470
476
  */
471
477
  suppressSageEmbedBetaWarning?: boolean;
472
478
  /**
473
479
  * Custom style params for embed Config.
474
480
  *
475
- * @version SDK: 1.17.0 | ThoughtSpot: 8.9.0.cl
481
+ * @version SDK: 1.17.0 | ThoughtSpot: 8.9.0.cl, 9.0.1.sw
476
482
  */
477
483
  customizations?: CustomisationsInterface;
478
484
  /**
479
- * For inPopup SAMLRedirect or OIDCRedirect Auth, we need a button which the user
480
- * click to trigger the flow. This is the containing element
481
- * for that button.
485
+ * For `inPopup` SAMLRedirect or OIDCRedirect authentication, we need a
486
+ * button that the user can click to trigger the flow.
487
+ * This attribute sets a containing element for that button.
482
488
  *
483
489
  * @example
484
490
  * ```js
@@ -488,11 +494,11 @@ export interface EmbedConfig {
488
494
  * authTriggerContainer: '#auth-trigger-container'
489
495
  * })
490
496
  * ```
491
- * @version SDK: 1.17.0 | ThoughtSpot: *
497
+ * @version SDK: 1.17.0 | ThoughtSpot: 8.9.0.cl, 9.0.1.sw
492
498
  */
493
499
  authTriggerContainer?: string | HTMLElement;
494
500
  /**
495
- * Specify that we want to use the AuthEvent.TRIGGER_SSO_POPUP event to trigger
501
+ * Specify that we want to use the `AuthEvent.TRIGGER_SSO_POPUP` event to trigger
496
502
  * SAML popup. This is useful when you want to trigger the popup on a custom user
497
503
  * action.
498
504
  *
@@ -500,13 +506,15 @@ export interface EmbedConfig {
500
506
  useEventForSAMLPopup?: boolean;
501
507
  /**
502
508
  * Text to show in the button which triggers the popup auth flow.
503
- * Default: "Authorize".
509
+ * Default: `Authorize`.
504
510
  *
505
- * @version SDK: 1.17.0 | ThoughtSpot: *
511
+ * @version SDK: 1.17.0 | ThoughtSpot: 8.9.0.cl, 9.0.1.sw
506
512
  */
507
513
  authTriggerText?: string;
508
514
  /**
509
- * Disable Full App access of Embedded app outside of the iFrame.
515
+ * Prevent users from accessing the full application or ThoughtSpot application pages
516
+ * access to the embedded application users
517
+ * outside of the iframe.
510
518
  *
511
519
  * @default true
512
520
  * @version SDK: 1.22.0 | ThoughtSpot: 9.3.0.cl, 9.5.1.sw
@@ -514,7 +522,7 @@ export interface EmbedConfig {
514
522
  blockNonEmbedFullAppAccess?: boolean;
515
523
 
516
524
  /**
517
- * Host config incase embedded app is inside TS app itself
525
+ * Host config in case embedded app is inside TS app itself
518
526
  *
519
527
  * @hidden
520
528
  */
@@ -531,23 +539,30 @@ export interface EmbedConfig {
531
539
  * @version SDK: 1.27.0 | ThoughtSpot: 9.8.0.cl
532
540
  */
533
541
  pendoTrackingKey?: string;
542
+
543
+ /**
544
+ * If passed as true all alerts will be suppressed in the embedded app.
545
+ *
546
+ * @version SDK: 1.26.2 | ThoughtSpot: *
547
+ */
548
+ suppressErrorAlerts?: boolean;
534
549
  }
535
550
 
536
551
  // eslint-disable-next-line @typescript-eslint/no-empty-interface
537
- export interface LayoutConfig { }
552
+ export interface LayoutConfig {}
538
553
 
539
554
  /**
540
- * Embedded iFrame configuration
555
+ * Embedded iframe configuration
541
556
  *
542
557
  * @group Embed components
543
558
  */
544
559
  export interface FrameParams {
545
560
  /**
546
- * The width of the iFrame (unit is pixels if numeric).
561
+ * The width of the iframe (unit is pixels if numeric).
547
562
  */
548
563
  width?: number | string;
549
564
  /**
550
- * The height of the iFrame (unit is pixels if numeric).
565
+ * The height of the iframe (unit is pixels if numeric).
551
566
  */
552
567
  height?: number | string;
553
568
  /**
@@ -650,7 +665,6 @@ export interface ViewConfig {
650
665
  */
651
666
  runtimeParameters?: RuntimeParameter[];
652
667
  /**
653
- /**
654
668
  * The locale/language to use for the embedded view.
655
669
  *
656
670
  * @version SDK: 1.9.4 | ThoughtSpot 8.1.0.cl, 8.4.1.sw
@@ -748,31 +762,29 @@ export interface ViewConfig {
748
762
  */
749
763
  reorderedHomepageModules?: HomepageModule[];
750
764
  /**
751
- * The list of tab IDs to show in the embedded.
752
- * Only this Tabs will be shown in their respective LBs.
753
- * Use this to show an tabID.
765
+ * The list of tab IDs to show in the embedded Liveboard.
766
+ * Only the tabs specified in the array will be shown in the Liveboard.
754
767
  *
755
- * Use either this or hiddenTabs.
768
+ * Use either `visibleTabs` or `hiddenTabs`.
756
769
  *
757
770
  * @example
758
771
  * ```js
759
- * const embed = new LiveboardEmbed('#embed', {
760
- * ... // other liveboard view config
761
- * visibleTabs: [
772
+ * visibleTabs: [
762
773
  * '430496d6-6903-4601-937e-2c691821af3c',
763
- * 'f547ec54-2a37-4516-a222-2b06719af726']
764
- * });
774
+ * 'f547ec54-2a37-4516-a222-2b06719af726']
765
775
  * ```
766
776
  * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
767
777
  */
768
778
  visibleTabs?: string[];
769
779
  /**
770
- * homepageLeftNavItems : show/hide Homeapage Left Nav Bar Items
771
- * There are 8 home nav list items, we will send those item as list
772
- * which we want to hide for TSE.
773
- * eg: hiddenHomeLeftNavItems = [HomeLeftNavItem.Home] to hide home.
780
+ * homepageLeftNavItems : Show or hide the left navigation bar items.
781
+ * There are 8 eight home navigation list items.
782
+ * To hide these items, specify the string in the array.
774
783
  *
775
- * @version SDK: 1.27.0 | Thoughtspot: 9.8.0.cl
784
+ * ```js
785
+ * hiddenHomeLeftNavItems = [HomeLeftNavItem.Home]
786
+ * ```
787
+ * @version SDK: 1.27.0 | Thoughtspot: 9.10.0.cl
776
788
  */
777
789
  hiddenHomeLeftNavItems?: HomeLeftNavItem[];
778
790
  /**
@@ -788,7 +800,7 @@ export interface ViewConfig {
788
800
  * });
789
801
  * embed.showPreRender();
790
802
  * ```
791
- * @version SDK: 1.25.0 | Thoughtspot: 9.6.0.cl
803
+ * @version SDK: 1.25.0 | Thoughtspot: 9.6.0.cl, 9.8.0.sw
792
804
  */
793
805
  preRenderId?: string;
794
806
 
@@ -826,7 +838,7 @@ export type MessagePayload = {
826
838
  status?: string;
827
839
  };
828
840
  /**
829
- * MessageOptions: By Providing options, getting specific event start / end based on
841
+ * MessageOptions: By providing options, getting specific event start / end based on
830
842
  * option
831
843
  *
832
844
  * @group Events
@@ -834,7 +846,7 @@ export type MessagePayload = {
834
846
  export type MessageOptions = {
835
847
  /**
836
848
  * A boolean value indicating that start status events of this type
837
- * will be dispatched
849
+ * will be dispatched.
838
850
  */
839
851
  start?: boolean;
840
852
  };
@@ -844,7 +856,7 @@ export type MessageOptions = {
844
856
  * @group Events
845
857
  */
846
858
  export type MessageCallback = (
847
- /* payload: Message payload contain type, data and status */
859
+ /* payload: Message payload contains type, data, and status */
848
860
  payload: MessagePayload,
849
861
  /**
850
862
  * responder: Message callback function triggered when embed event
@@ -857,7 +869,7 @@ export type MessageCallback = (
857
869
  */
858
870
  export type MessageCallbackObj = {
859
871
  /**
860
- * options: It contains start, A boolean value indicating that start
872
+ * options: It contains start, a boolean value indicating that start
861
873
  * status events of this type will be dispatched
862
874
  */
863
875
  /* callback: Embed event message callback */
@@ -935,7 +947,7 @@ export enum RuntimeFilterOp {
935
947
  }
936
948
 
937
949
  /**
938
- * Home page module that can be hide
950
+ * Home page module that can be hidden
939
951
  */
940
952
  // eslint-disable-next-line no-shadow
941
953
  export enum HomepageModule {
@@ -952,7 +964,7 @@ export enum HomepageModule {
952
964
  */
953
965
  Favorite = 'FAVORITE',
954
966
  /**
955
- * List of answers and liveboards
967
+ * List of answers and Liveboards
956
968
  */
957
969
  MyLibrary = 'MY_LIBRARY',
958
970
  /**
@@ -986,7 +998,7 @@ export interface RuntimeFilter {
986
998
  values: (number | boolean | string)[];
987
999
  }
988
1000
  /**
989
- * A filter that can be applied to ThoughtSpot answers, Liveboards, or
1001
+ * A filter that can be applied to ThoughtSpot Answers, Liveboards, or
990
1002
  * visualizations at runtime.
991
1003
  */
992
1004
  export interface RuntimeParameter {
@@ -1024,6 +1036,14 @@ export interface RuntimeParameter {
1024
1036
  export enum EmbedEvent {
1025
1037
  /**
1026
1038
  * Rendering has initialized.
1039
+ * @example
1040
+ *```js
1041
+ * liveboardEmbed.on(EmbedEvent.Init, showLoader)
1042
+ * //show a loader
1043
+ * function showLoader() {
1044
+ * document.getElementById("loader");
1045
+ * }
1046
+ *```
1027
1047
  *
1028
1048
  * @returns timestamp - The timestamp when the event was generated.
1029
1049
  */
@@ -1031,69 +1051,162 @@ export enum EmbedEvent {
1031
1051
  /**
1032
1052
  * Authentication has either succeeded or failed.
1033
1053
  *
1054
+ * @example
1055
+ *```js
1056
+ * appEmbed.on(EmbedEvent.AuthInit, payload => {
1057
+ * console.log('AuthInit', payload);
1058
+ * })
1059
+ *```
1060
+ *
1034
1061
  * @returns isLoggedIn - A Boolean specifying whether authentication was successful.
1035
1062
  */
1036
1063
  AuthInit = 'authInit',
1037
1064
  /**
1038
1065
  * The embed object container has loaded.
1039
- *
1040
1066
  * @returns timestamp - The timestamp when the event was generated.
1067
+ * @example
1068
+ *```js
1069
+ * liveboardEmbed.on(EmbedEvent.Load, hideLoader)
1070
+ * //hide loader
1071
+ * function hideLoader() {
1072
+ * document.getElementById("loader");
1073
+ * }
1074
+ *```
1041
1075
  */
1042
1076
  Load = 'load',
1043
1077
  /**
1044
1078
  * Data pertaining to answer or Liveboard is received
1045
- *
1046
1079
  * @return data - The answer or Liveboard data
1080
+ * @example
1081
+ *```js
1082
+ * liveboardEmbed.on(EmbedEvent.Data, payload => {
1083
+ * console.log('data', payload);
1084
+ * })
1085
+ *```
1047
1086
  * @important
1048
1087
  */
1049
1088
  Data = 'data',
1050
1089
  /**
1051
- * Search/answer/Liveboard filters have been applied/updated by the user.
1090
+ * Search/Answer/Liveboard filters have been applied/updated by the user.
1052
1091
  *
1053
1092
  * @hidden
1054
1093
  */
1055
1094
  FiltersChanged = 'filtersChanged',
1056
1095
  /**
1057
1096
  * Search query has been updated by the user.
1097
+ *
1098
+ * @example
1099
+ *```js
1100
+ * searchEmbed.on(EmbedEvent.QueryChanged, payload => console.log('data', payload))
1101
+ *```
1102
+ *
1058
1103
  */
1059
1104
  QueryChanged = 'queryChanged',
1060
1105
  /**
1061
- * A drill down operation has been performed.
1106
+ * A drill-down operation has been performed.
1062
1107
  *
1063
1108
  * @returns additionalFilters - Any additional filters applied
1064
1109
  * @returns drillDownColumns - The columns on which drill down was performed
1065
1110
  * @returns nonFilteredColumns - The columns that were not filtered
1111
+ *
1112
+ * @example
1113
+ *```js
1114
+ * searchEmbed.trigger(HostEvent.DrillDown, {
1115
+ * points: {
1116
+ * clickedPoint,
1117
+ * selectedPoints: selectedPoint
1118
+ * },
1119
+ * autoDrillDown: true,
1120
+ * })
1121
+ *```
1122
+ * In this example, `VizPointDoubleClick` event is used for
1123
+ * triggering the `DrillDown` event when an area or specific
1124
+ * data point on a table or chart is double-clicked.
1125
+ *
1126
+ * @example
1127
+ *```js
1128
+ * searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
1129
+ * console.log(payload);
1130
+ * const clickedPoint = payload.data.clickedPoint;
1131
+ * const selectedPoint = payload.data.selectedPoints;
1132
+ * console.log('>>> called', clickedPoint);
1133
+ * embed.trigger(HostEvent.DrillDown, {
1134
+ * points: {
1135
+ * clickedPoint,
1136
+ * selectedPoints: selectedPoint
1137
+ * },
1138
+ * autoDrillDown: true,
1139
+ * })
1140
+ * })
1141
+ *```
1142
+ *
1066
1143
  */
1067
1144
  Drilldown = 'drillDown',
1068
1145
  /**
1069
1146
  * One or more data sources have been selected.
1070
- *
1071
1147
  * @returns dataSourceIds - the list of data sources
1148
+ *
1149
+ * @example
1150
+ * ```js
1151
+ * searchEmbed.on(EmbedEvent.DataSourceSelected, payload => {
1152
+ * console.log('DataSourceSelected', payload);
1153
+ * })
1154
+ * ```
1155
+ *
1072
1156
  */
1073
1157
  DataSourceSelected = 'dataSourceSelected',
1074
1158
  /**
1075
1159
  * One or more data columns have been selected.
1076
- *
1077
1160
  * @returns columnIds - the list of columns
1078
1161
  * @version SDK: 1.10.0 | ThoughtSpot: 8.2.0.cl, 8.4.1.sw
1162
+ *
1163
+ * @example
1164
+ * ```js
1165
+ * appEmbed.on(EmbedEvent.AddRemoveColumns, payload => {
1166
+ * console.log('AddRemoveColumns', payload);
1167
+ * })
1168
+ * ```
1169
+ *
1079
1170
  */
1080
1171
  AddRemoveColumns = 'addRemoveColumns',
1081
1172
  /**
1082
- * A custom action has been triggered
1173
+ * A custom action has been triggered.
1083
1174
  *
1084
- * @returns actionId - The id of the custom action
1085
- * @returns data - The answer or Liveboard data
1175
+ * @returns actionId - ID of the custom action
1176
+ * @returns data - Response payload with the Answer or Liveboard data
1177
+ *
1178
+ * @example
1179
+ * ```js
1180
+ * appEmbed.on(EmbedEvent.customAction, payload => {
1181
+ * const data = payload.data;
1182
+ * if (data.id === 'insert Custom Action ID here') {
1183
+ * console.log('Custom Action event:', data.embedAnswerData);
1184
+ * }
1185
+ * })
1186
+ * ```
1086
1187
  */
1087
1188
  CustomAction = 'customAction',
1088
1189
  /**
1089
- * Listen to double clicks on a visualization
1190
+ * Listen to double click actions on a visualization.
1191
+ *
1192
+ * @return ContextMenuInputPoints - Data point that is double-clicked
1090
1193
  *
1091
- * @return ContextMenuInputPoints - data point that is double clicked
1092
1194
  * @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
1195
+ *
1196
+ * @example
1197
+ * ```js
1198
+ * livebaordEmbed.on(EmbedEvent.VizPointDoubleClick, payload => {
1199
+ * console.log('VizPointDoubleClick', payload)
1200
+ * })
1201
+ * ```
1093
1202
  */
1094
1203
  VizPointDoubleClick = 'vizPointDoubleClick',
1095
1204
  /**
1096
- * Listen to clicks on a visualization in a liveboard or Search result.
1205
+ * Listen to clicks on a visualization in a Liveboard or Search result.
1206
+ *
1207
+ * @return viz, clickedPoint - metadata about the point that is clicked
1208
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1209
+ * @important
1097
1210
  *
1098
1211
  * @example
1099
1212
  * ```js
@@ -1107,25 +1220,46 @@ export enum EmbedEvent {
1107
1220
  * )
1108
1221
  * });
1109
1222
  * ```
1110
- * @return viz, clickedPoint - metadata about point that is clicked
1111
- * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1112
- * @important
1113
1223
  */
1114
1224
  VizPointClick = 'vizPointClick',
1115
1225
  /**
1116
1226
  * An error has occurred.
1117
1227
  *
1118
1228
  * @returns error - An error object or message
1229
+ *
1230
+ * @example
1231
+ * ```js
1232
+ * SearchEmbed.on(EmbedEvent.Error, showErrorMsg)
1233
+ * //show error messaage
1234
+ * function showErrorMsg() {
1235
+ * document.getElementById("error");
1236
+ * ```
1237
+ *
1119
1238
  */
1120
1239
  Error = 'Error',
1121
1240
  /**
1122
- * The embedded object has sent an alert
1241
+ * The embedded object has sent an alert.
1123
1242
  *
1124
1243
  * @returns alert - An alert object
1244
+ *
1245
+ * @example
1246
+ * ```js
1247
+ * searchEmbed.on(EmbedEvent.Alert)
1248
+ * ```
1249
+ *
1125
1250
  */
1126
1251
  Alert = 'alert',
1127
1252
  /**
1128
1253
  * The ThoughtSpot auth session has expired.
1254
+ *
1255
+ * @example
1256
+ *```js
1257
+ * appEmbed.on(EmbedEvent.AuthExpire, showAuthExpired)
1258
+ * //show auth expired banner
1259
+ * function showAuthExpired() {
1260
+ * document.getElementById("authExpiredBanner");
1261
+ * }
1262
+ *```
1129
1263
  */
1130
1264
  AuthExpire = 'ThoughtspotAuthExpired',
1131
1265
  /**
@@ -1155,14 +1289,28 @@ export enum EmbedEvent {
1155
1289
  */
1156
1290
  EmbedIframeCenter = 'EmbedIframeCenter',
1157
1291
  /**
1158
- * Emitted when the "Get Data" button in Search Bar embed
1159
- * is clicked.
1292
+ * Emitted when the **Get Data** action is initiated.
1293
+ * Applicable to `SearchBarEmbed` only.
1160
1294
  *
1161
- * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.0.sw
1295
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
1296
+ *
1297
+ * @example
1298
+ *```js
1299
+ * searchbarEmbed.on(EmbedEvent.GetDataClick)
1300
+ * .then(data => {
1301
+ * console.log('Answer Data:', data);
1302
+ * })
1303
+ *```
1162
1304
  */
1163
1305
  GetDataClick = 'getDataClick',
1164
1306
  /**
1165
1307
  * Detects the route change.
1308
+ *
1309
+ * @example
1310
+ *```js
1311
+ * searchEmbed.on(EmbedEvent.RouteChange, payload =>
1312
+ * console.log('data', payload))
1313
+ *```
1166
1314
  */
1167
1315
  RouteChange = 'ROUTE_CHANGE',
1168
1316
  /**
@@ -1172,10 +1320,15 @@ export enum EmbedEvent {
1172
1320
  */
1173
1321
  V1Data = 'exportVizDataToParent',
1174
1322
  /**
1175
- * Emitted when the embed does not have cookie access. This
1176
- * happens on Safari where third-party cookies are blocked by default.
1323
+ * Emitted when the embed does not have cookie access. This happens
1324
+ * when Safari and other Web browsers block third-party cookies
1325
+ * are blocked by default. `NoCookieAccess` can trigger
1177
1326
  *
1178
- * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 7.2.1
1327
+ * @example
1328
+ *```js
1329
+ * appEmbed.on(EmbedEvent.NoCookieAccess)
1330
+ *```
1331
+ * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 7.2.1.sw
1179
1332
  */
1180
1333
  NoCookieAccess = 'noCookieAccess',
1181
1334
  /**
@@ -1187,239 +1340,539 @@ export enum EmbedEvent {
1187
1340
  SAMLComplete = 'samlComplete',
1188
1341
  /**
1189
1342
  * Emitted when any modal is opened in the app
1190
- *
1191
1343
  * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
1344
+ *
1345
+ * @example
1346
+ *```js
1347
+ * appEmbed.on(EmbedEvent.DialogOpen, payload => {
1348
+ * console.log('dialog open', payload);
1349
+ * })
1350
+ *```
1192
1351
  */
1193
1352
  DialogOpen = 'dialog-open',
1194
1353
  /**
1195
1354
  * Emitted when any modal is closed in the app
1196
- *
1197
1355
  * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
1356
+ *
1357
+ * @example
1358
+ *```js
1359
+ * appEmbed.on(EmbedEvent.DialogClose, payload => {
1360
+ * console.log('dialog close', payload);
1361
+ * })
1362
+ *```
1198
1363
  */
1199
1364
  DialogClose = 'dialog-close',
1200
1365
  /**
1201
1366
  * Emitted when the Liveboard shell loads.
1202
1367
  * You can use this event as a hook to trigger
1203
1368
  * other events on the rendered Liveboard.
1204
- *
1205
1369
  * @version SDK: 1.9.1 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw
1370
+ *
1371
+ * @example
1372
+ *```js
1373
+ * liveboardEmbed.on(EmbedEvent.LiveboardRendered, payload => {
1374
+ console.log('Liveboard is rendered', payload);
1375
+ })
1376
+ *```
1377
+ * The following example shows how to trigger
1378
+ * `SetVisibleVizs` event using LiveboardRendered embed event:
1379
+ *
1380
+ * @example
1381
+ *```js
1382
+ * const embedRef = useEmbedRef();
1383
+ * const onLiveboardRendered = () => {
1384
+ * embed.trigger(HostEvent.SetVisibleVizs, ['viz1', 'viz2']);
1385
+ * };
1386
+ *```
1206
1387
  */
1207
1388
  LiveboardRendered = 'PinboardRendered',
1208
1389
  /**
1209
1390
  * This can be used to register an event listener which
1210
1391
  * is triggered on all events.
1211
- *
1212
1392
  * @Version SDK: 1.10.0 | ThoughtSpot: 8.2.0.cl, 8.4.1.sw
1393
+ *
1394
+ * @example
1395
+ *```js
1396
+ * appEmbed.on(EmbedEvent.ALL, payload => {
1397
+ * console.log('Embed Events', payload)
1398
+ * })
1399
+ *```
1213
1400
  */
1214
1401
  ALL = '*',
1215
1402
  /**
1216
1403
  * Emitted when an Answer is saved in the app
1217
- *
1218
1404
  * @Version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1405
+ * @example
1406
+ *```js
1407
+ * //trigger when action starts
1408
+ * searchEmbed.on(EmbedEvent.Save, payload => {
1409
+ * console.log('Save', payload)
1410
+ * }, {
1411
+ * start: true
1412
+ * })
1413
+ * //trigger when action ends
1414
+ * searchEmbed.on(EmbedEvent.Save, payload => {
1415
+ * console.log('Save', payload)
1416
+ * })
1417
+ *```
1219
1418
  */
1220
1419
  Save = 'save',
1221
1420
  /**
1222
1421
  * Emitted when the download action is triggered on an answer
1223
1422
  *
1423
+ * **Note**: This event is deprecated in v1.21.0.
1424
+ * To fire an event when a download action is initiated on a chart or table,
1425
+ * use `EmbedEvent.DownloadAsPng`, `EmbedEvent.DownloadAsPDF`, `EmbedEvent.DownloadAsCSV`,
1426
+ * or `EmbedEvent.DownloadAsXLSX`
1427
+ *
1224
1428
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1429
+ *
1430
+ * @example
1431
+ *```js
1432
+ * liveboardEmbed.trigger(HostEvent.Download, {
1433
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
1434
+ * })
1435
+ *```
1225
1436
  */
1226
1437
  Download = 'download',
1227
1438
  /**
1228
1439
  * Emitted when the download action is triggered on an answer
1229
- *
1230
1440
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.0.sw
1441
+ *
1442
+ * @example
1443
+ *```js
1444
+ * //trigger when action starts
1445
+ * searchEmbed.on(EmbedEvent.DownloadAsPng, payload => {
1446
+ * console.log('download PNG', payload)}, {start: true })
1447
+ * //trigger when action ends
1448
+ * searchEmbed.on(EmbedEvent.DownloadAsPng, payload => {
1449
+ * console.log('download PNG', payload)})
1450
+ *```
1451
+ *
1231
1452
  */
1232
1453
  DownloadAsPng = 'downloadAsPng',
1233
1454
  /**
1234
1455
  * Emitted when the Download as PDF action is triggered on an answer
1235
1456
  *
1236
1457
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1458
+ *
1459
+ * @example
1460
+ *```js
1461
+ * //trigger when action starts
1462
+ * searchEmbed.on(EmbedEvent.DownloadAsPdf, payload => {
1463
+ * console.log('download PDF', payload)}, {start: true })
1464
+ * //trigger when action ends
1465
+ * searchEmbed.on(EmbedEvent.DownloadAsPdf, payload => {
1466
+ * console.log('download PDF', payload)})
1467
+ *```
1468
+ *
1237
1469
  */
1238
1470
  DownloadAsPdf = 'downloadAsPdf',
1239
1471
  /**
1240
1472
  * Emitted when the Download as CSV action is triggered on an answer
1241
1473
  *
1242
1474
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1475
+ * @example
1476
+ *```js
1477
+ * //trigger when action starts
1478
+ * searchEmbed.on(EmbedEvent.DownloadAsCSV, payload => {
1479
+ * console.log('download CSV', payload)}, {start: true })
1480
+ * //trigger when action ends
1481
+ * searchEmbed.on(EmbedEvent.DownloadAsCSV, payload => {
1482
+ * console.log('download CSV', payload)})
1483
+ *```
1243
1484
  */
1244
1485
  DownloadAsCsv = 'downloadAsCsv',
1245
1486
  /**
1246
1487
  * Emitted when the Download as XLSX action is triggered on an answer
1247
1488
  *
1248
1489
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1490
+ *
1491
+ * @example
1492
+ *```js
1493
+ * //trigger when action starts
1494
+ * searchEmbed.on(EmbedEvent.DownloadAsXlsx, payload => {
1495
+ * console.log('download Xlsx', payload)}, { start: true })
1496
+ * //trigger when action ends
1497
+ * searchEmbed.on(EmbedEvent.DownloadAsXlsx, payload => {
1498
+ * console.log('download Xlsx', payload)})
1499
+ *```
1249
1500
  */
1250
1501
  DownloadAsXlsx = 'downloadAsXlsx',
1251
1502
  /**
1252
- * Emitted when an answer is deleted in the app
1503
+ * Emitted when an Answer is deleted in the app
1253
1504
  *
1254
1505
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1506
+ *
1507
+ * @example
1508
+ *```js
1509
+ * //trigger when action starts
1510
+ * appEmbed.on(EmbedEvent.AnswerDelete, payload => {
1511
+ * console.log('delete answer', payload)}, {start: true })
1512
+ * //trigger when action is completed
1513
+ * appEmbed.on(EmbedEvent.AnswerDelete, payload => {
1514
+ * console.log('delete answer', payload)})
1515
+ *```
1255
1516
  */
1256
1517
  AnswerDelete = 'answerDelete',
1257
1518
  /**
1258
1519
  * Emitted when an answer is pinned to a Liveboard
1259
1520
  *
1260
1521
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1522
+ * @example
1523
+ *```js
1524
+ * //trigger when action starts
1525
+ * searchEmbed.on(EmbedEvent.Pin, payload => {
1526
+ * console.log('pin', payload)
1527
+ * }, {
1528
+ * start: true
1529
+ * })
1530
+ * //trigger when action ends
1531
+ * searchEmbed.on(EmbedEvent.Pin, payload => {
1532
+ * console.log('pin', payload)
1533
+ * })
1534
+ *```
1261
1535
  */
1262
1536
  Pin = 'pin',
1263
1537
  /**
1264
1538
  * Emitted when SpotIQ analysis is triggered
1265
1539
  *
1266
1540
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1541
+ * @example
1542
+ *```js
1543
+ * //trigger when action starts
1544
+ * searchEmbed.on(EmbedEvent.SpotIQAnalyze, payload => {
1545
+ * console.log('SpotIQAnalyze', payload)
1546
+ * }, {
1547
+ * start: true
1548
+ * })
1549
+ * //trigger when action ends
1550
+ * searchEmbed.on(EmbedEvent.SpotIQAnalyze, payload => {
1551
+ * console.log('SpotIQ analyze', payload)
1552
+ * })
1553
+ *```
1267
1554
  */
1268
1555
  SpotIQAnalyze = 'spotIQAnalyze',
1269
1556
  /**
1270
1557
  * Emitted when a user shares an object with another user or group
1271
1558
  *
1272
1559
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1560
+ *
1561
+ * @example
1562
+ *```js
1563
+ * //trigger when action starts
1564
+ * searchEmbed.on(EmbedEvent.Share, payload => {
1565
+ * console.log('Share', payload)
1566
+ * }, {
1567
+ * start: true
1568
+ * })
1569
+ * //trigger when action ends
1570
+ * searchEmbed.on(EmbedEvent.Share, payload => {
1571
+ * console.log('Share', payload)
1572
+ * })
1573
+ *```
1273
1574
  */
1274
1575
  Share = 'share',
1275
1576
  /**
1276
- * Emitted when a user clicks the Include action to include a specific value or data
1277
- * on a chart or table
1577
+ * Emitted when a user clicks the **Include** action to include a specific value or
1578
+ * data on a chart or table.
1278
1579
  *
1279
1580
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1581
+ * @example
1582
+ *```js
1583
+ * appEmbed.on(EmbedEvent.DrillInclude, payload => {
1584
+ * console.log('Drill include', payload);
1585
+ * })
1586
+ *```
1280
1587
  */
1281
1588
  DrillInclude = 'context-menu-item-include',
1282
1589
  /**
1283
- * Emitted when a user clicks the Exclude action to exclude a specific value or data
1284
- * on a chart or table
1590
+ * Emitted when a user clicks the **Exclude** action to exclude a specific value or
1591
+ * data on a chart or table
1285
1592
  *
1286
1593
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1594
+ * @example
1595
+ *```js
1596
+ * appEmbed.on(EmbedEvent.DrillExclude, payload => {
1597
+ * console.log('Drill exclude', payload);
1598
+ * })
1599
+ *```
1287
1600
  */
1288
1601
  DrillExclude = 'context-menu-item-exclude',
1289
1602
  /**
1290
- * Emitted when copied column value on the app
1603
+ * Emitted when a column value is copied in the embedded app.
1291
1604
  *
1292
1605
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1606
+ * @example
1607
+ *```js
1608
+ * seachEmbed.on(EmbedEvent.CopyToClipboard, payload => {
1609
+ * console.log('copy to clipboard', payload);
1610
+ * })
1611
+ *```
1293
1612
  */
1294
1613
  CopyToClipboard = 'context-menu-item-copy-to-clipboard',
1295
1614
  /**
1296
- * Emitted when a user clicks the Update TML action
1615
+ * Emitted when a user clicks the **Update TML** action
1297
1616
  *
1298
1617
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1618
+ * @example
1619
+ *```js
1620
+ * liveboardEmbed.on(EmbedEvent.UpdateTML)
1621
+ * })
1622
+ *```
1299
1623
  */
1300
1624
  UpdateTML = 'updateTSL',
1301
1625
  /**
1302
- * Emitted when a user clicks the Edit TML action
1626
+ * Emitted when a user clicks the **Edit TML** action
1303
1627
  *
1304
1628
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1629
+ * @example
1630
+ *```js
1631
+ * appEmbed.on(EmbedEvent.EditTML, payload => {
1632
+ * console.log('Edit TML', payload);
1633
+ * })
1634
+ *```
1305
1635
  */
1306
1636
  EditTML = 'editTSL',
1307
1637
  /**
1308
- * Emitted when ExportTML trigger in answer on the app
1309
- *
1638
+ * Emitted when the **Export TML** action is triggered on an
1639
+ * an embedded object in the app
1310
1640
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1641
+ * @example
1642
+ *```js
1643
+ * //trigger when action starts
1644
+ * searchEmbed.on(EmbedEvent.ExportTML, payload => {
1645
+ * console.log('Export TML', payload)}, { start: true })
1646
+ * //trigger when action ends
1647
+ * searchEmbed.on(EmbedEvent.ExportTML, payload => {
1648
+ * console.log('Export TML', payload)})
1649
+ *```
1311
1650
  */
1312
1651
  ExportTML = 'exportTSL',
1313
1652
  /**
1314
- * Emitted when an answer is saved as a view
1653
+ * Emitted when an Answer is saved as a View.
1315
1654
  *
1316
1655
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1656
+ * @example
1657
+ *```js
1658
+ * appEmbed.on(EmbedEvent.SaveAsView, payload => {
1659
+ * console.log('View', payload);
1660
+ * })
1661
+ *```
1317
1662
  */
1318
1663
  SaveAsView = 'saveAsView',
1319
1664
  /**
1320
- * Emitted when copy of existing answer on the app
1665
+ * Emitted when the user creates a copy of an Answer
1321
1666
  *
1322
1667
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1668
+ * @example
1669
+ *```js
1670
+ * //trigger when action starts
1671
+ * appEmbed.on(EmbedEvent.CopyAEdit, payload => {
1672
+ * console.log('Copy and edit', payload)}, {start: true })
1673
+ * //trigger when action ends
1674
+ * appEmbed.on(EmbedEvent.CopyAEdit, payload => {
1675
+ * console.log('Copy and edit', payload)})
1676
+ *```
1323
1677
  */
1324
1678
  CopyAEdit = 'copyAEdit',
1325
1679
  /**
1326
- * Emitted when a user clicks Show underlying data on an answe
1680
+ * Emitted when a user clicks Show underlying data on an Answer
1327
1681
  *
1328
1682
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1683
+ * @example
1684
+ *```js
1685
+ * liveboardEmbed.on(EmbedEvent.ShowUnderlyingData, payload => {
1686
+ * console.log('show data', payload);
1687
+ * })
1688
+ *```
1329
1689
  */
1330
1690
  ShowUnderlyingData = 'showUnderlyingData',
1331
1691
  /**
1332
- * Emitted when an answer is switched to a chart or table view
1692
+ * Emitted when an answer is switched to a chart or table view.
1333
1693
  *
1334
1694
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1695
+ * @example
1696
+ *```js
1697
+ * searchEmbed.on(EmbedEvent.AnswerChartSwitcher, payload => {
1698
+ * console.log('switch view', payload);
1699
+ * })
1700
+ *```
1335
1701
  */
1336
1702
  AnswerChartSwitcher = 'answerChartSwitcher',
1337
1703
  /**
1338
- * Internal event to communicate the initial settings back to the TS APP
1704
+ * Internal event to communicate the initial settings back to the ThoughtSpot app
1339
1705
  *
1340
1706
  * @hidden
1341
1707
  */
1342
1708
  APP_INIT = 'appInit',
1343
1709
  /**
1344
- * Emitted when a user clicks Show Liveboard details on a Liveboard
1710
+ * Emitted when a user clicks **Show Liveboard details** on a Liveboard
1345
1711
  *
1346
1712
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1713
+ * @example
1714
+ *```js
1715
+ * liveboardEmbed.on(EmbedEvent.AnswerChartSwitcher, payload => {
1716
+ * console.log('Liveboard details', payload);
1717
+ * })
1718
+ *```
1347
1719
  */
1348
1720
  LiveboardInfo = 'pinboardInfo',
1349
1721
  /**
1350
1722
  * Emitted when a user clicks on the Favorite icon on a Liveboard
1351
1723
  *
1352
1724
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1725
+ * @example
1726
+ *```js
1727
+ * liveboardEmbed.on(EmbedEvent.AddToFavorites, payload => {
1728
+ * console.log('favorites', payload);
1729
+ * })
1730
+ *```
1353
1731
  */
1354
1732
  AddToFavorites = 'addToFavorites',
1355
1733
  /**
1356
- * Emitted when a user clicks Schedule on a Liveboard
1734
+ * Emitted when a user clicks **Schedule** on a Liveboard
1357
1735
  *
1358
1736
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1737
+ * @example
1738
+ *```js
1739
+ * liveboardEmbed.on(EmbedEvent.Schedule, payload => {
1740
+ * console.log(`Liveboard schedule', payload);
1741
+ * })
1742
+ *```
1359
1743
  */
1360
1744
  Schedule = 'subscription',
1361
1745
  /**
1362
- * Emitted when a user clicks Edit on a Liveboard or visualization
1746
+ * Emitted when a user clicks **Edit** on a Liveboard or visualization
1363
1747
  *
1364
1748
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1749
+ * @example
1750
+ *```js
1751
+ * liveboardEmbed.on(EmbedEvent.Edit, payload => {
1752
+ * console.log(`Liveboard edit', payload);
1753
+ * })
1754
+ *```
1365
1755
  */
1366
1756
  Edit = 'edit',
1367
1757
  /**
1368
- * Emitted when a user clicks Make a copy on a Liveboard
1758
+ * Emitted when a user clicks *Make a copy* on a Liveboard
1369
1759
  *
1370
1760
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1761
+ * @example
1762
+ *```js
1763
+ * liveboardEmbed.on(EmbedEvent.MakeACopy, payload => {
1764
+ * console.log(`Copy', payload);
1765
+ * })
1766
+ *```
1371
1767
  */
1372
1768
  MakeACopy = 'makeACopy',
1373
1769
  /**
1374
- * Emitted when a user clicks Present on a Liveboard or visualization
1770
+ * Emitted when a user clicks **Present** on a Liveboard or visualization
1375
1771
  *
1376
1772
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1773
+ * @example
1774
+ *```js
1775
+ * liveboardEmbed.trigger(HostEvent.Present)
1776
+ *```
1777
+ *
1778
+ * @example
1779
+ *```js
1780
+ * liveboardEmbed.on(EmbedEvent.Present, {
1781
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1782
+ * })
1783
+ *```
1377
1784
  */
1378
1785
  Present = 'present',
1379
1786
  /**
1380
- * Emitted when a user clicks Delete on a Liveboard
1787
+ * Emitted when a user clicks **Delete** on a visualization
1381
1788
  *
1382
1789
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1790
+ * @example
1791
+ *```js
1792
+ * liveboardEmbed.trigger(HostEvent.Delete,
1793
+ * {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1794
+ *```
1795
+ *
1383
1796
  */
1384
1797
  Delete = 'delete',
1385
1798
  /**
1386
1799
  * Emitted when a user clicks Manage schedules on a Liveboard
1387
1800
  *
1388
1801
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1802
+ *
1803
+ * @example
1804
+ *```js
1805
+ * liveboardEmbed.trigger(HostEvent.SchedulesList)
1806
+ *```
1807
+ *
1389
1808
  */
1390
1809
  SchedulesList = 'schedule-list',
1391
1810
  /**
1392
- * Emitted when a user clicks Cancel in edit mode on a Liveboard
1811
+ * Emitted when a user clicks **Cancel** in edit mode on a Liveboard
1393
1812
  *
1394
1813
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1814
+ *
1815
+ * @example
1816
+ *```js
1817
+ * liveboardEmbed.trigger(HostEvent.Cancel)
1818
+ *```
1819
+ *
1395
1820
  */
1396
1821
  Cancel = 'cancel',
1397
1822
  /**
1398
- * Emitted when a user clicks Explore on a visualization
1823
+ * Emitted when a user clicks **Explore** on a visualization
1399
1824
  *
1400
1825
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1826
+ *
1827
+ * @example
1828
+ *```js
1829
+ * liveboardEmbed.trigger(HostEvent.Explore, {
1830
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1831
+ *```
1832
+ *
1401
1833
  */
1402
1834
  Explore = 'explore',
1403
1835
  /**
1404
- * Emitted when a user clicks Copy link action on a visualization
1836
+ * Emitted when a user clicks **Copy link** action on a visualization
1405
1837
  *
1406
1838
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1839
+ *
1840
+ * @example
1841
+ *```js
1842
+ * liveboardEmbed.trigger(HostEvent.CopyLink, {
1843
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1844
+ *```
1845
+ *
1407
1846
  */
1408
1847
  CopyLink = 'embedDocument',
1409
1848
  /**
1410
- * Emitted when a user interacts with cross filters on a visualization or liveboard
1849
+ * Emitted when a user interacts with cross filters on a visualization or Liveboard
1850
+ *
1851
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.0.sw
1852
+ *
1853
+ * @example
1854
+ *```js
1855
+ * liveboardEmbed.trigger(HostEvent.CrossFilterChanged, {
1856
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1857
+ *```
1411
1858
  *
1412
- * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
1413
1859
  */
1414
1860
  CrossFilterChanged = 'cross-filter-changed',
1415
1861
  /**
1416
1862
  * Emitted when a user right clicks on a visualization (chart or table)
1417
1863
  *
1418
- * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
1864
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.0.sw
1865
+ *
1866
+ * @example
1867
+ *```js
1868
+ * LiveboardEmbed.on(EmbedEvent.VizPointRightClick, payload => {
1869
+ * console.log('VizPointClick', payload)
1870
+ * })
1871
+ *```
1419
1872
  */
1420
1873
  VizPointRightClick = 'vizPointRightClick',
1421
1874
  /**
1422
- * Emitted when a user clicks on Insert to slide on a visualization
1875
+ * Emitted when a user clicks **Insert to slide** on a visualization
1423
1876
  *
1424
1877
  * @hidden
1425
1878
  */
@@ -1427,52 +1880,53 @@ export enum EmbedEvent {
1427
1880
  /**
1428
1881
  * @hidden
1429
1882
  * Emitted when a user changes any filter on a Liveboard.
1430
- * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
1883
+ * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl, 9.5.0.sw
1431
1884
  */
1432
1885
  FilterChanged = 'filterChanged',
1433
1886
  /**
1434
- * Emitted when a user click on Go button in Sage Embed
1887
+ * Emitted when a user clicks the **Go** button on the Search page
1435
1888
  *
1436
- * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
1889
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
1437
1890
  */
1438
1891
  SageEmbedQuery = 'sageEmbedQuery',
1439
1892
  /**
1440
- * Emitten when a user select data source in Sage Embed
1893
+ * Emitted when a user selects a data source.
1894
+ *
1895
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
1441
1896
  *
1442
- * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
1443
1897
  */
1444
1898
  SageWorksheetUpdated = 'sageWorksheetUpdated',
1445
1899
  /**
1446
- * Emitted when a user updates a connection in Data tab
1900
+ * Emitted when a user updates a connection on the **Data** page
1447
1901
  *
1448
- * @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl
1902
+ * @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl, 9.8.0.sw
1449
1903
  */
1450
1904
  UpdateConnection = 'updateConnection',
1451
1905
  /**
1452
- * Emitted when a user updates a connection in Data tab
1906
+ * Emitted when a user updates a connection on the **Data** page
1453
1907
  *
1454
- * @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl
1908
+ * @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl, 9.8.0.sw
1455
1909
  */
1456
1910
  CreateConnection = 'createConnection',
1457
1911
  /**
1458
1912
  * Emitted when name, status (private or public) or filter values of a
1459
- * PersonalisedView is updated.
1913
+ * Personalised view is updated.
1460
1914
  *
1461
1915
  * @returns viewName: string
1462
1916
  * @returns viewId: string
1463
1917
  * @returns liveboardId: string
1464
1918
  * @returns isPublic: boolean
1465
- * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
1919
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
1466
1920
  */
1467
1921
  UpdatePersonalisedView = 'updatePersonalisedView',
1468
1922
  /**
1469
- * Emitted when a PersonalisedView is saved.
1923
+ * Emitted when a Personalised view is saved.
1470
1924
  *
1471
1925
  * @returns viewName: string
1472
1926
  * @returns viewId: string
1473
1927
  * @returns liveboardId: string
1474
1928
  * @returns isPublic: boolean
1475
- * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
1929
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
1476
1930
  */
1477
1931
  SavePersonalisedView = 'savePersonalisedView',
1478
1932
  /**
@@ -1482,7 +1936,7 @@ export enum EmbedEvent {
1482
1936
  * @returns viewId: string
1483
1937
  * @returns liveboardId: string
1484
1938
  * @returns isPublic: boolean
1485
- * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
1939
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
1486
1940
  */
1487
1941
  ResetLiveboard = 'resetLiveboard',
1488
1942
  /**
@@ -1490,11 +1944,11 @@ export enum EmbedEvent {
1490
1944
  *
1491
1945
  * @returns views: string[]
1492
1946
  * @returns liveboardId: string
1493
- * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
1947
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
1494
1948
  */
1495
1949
  DeletePersonalisedView = 'deletePersonalisedView',
1496
1950
  /**
1497
- * Emitten when a user creates a new worksheet
1951
+ * Emitted when a user creates a new worksheet
1498
1952
  *
1499
1953
  * @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl
1500
1954
  */
@@ -1526,15 +1980,16 @@ export enum EmbedEvent {
1526
1980
  // eslint-disable-next-line no-shadow
1527
1981
  export enum HostEvent {
1528
1982
  /**
1529
- * Triggers a search query in AppEmbed and SearchEmbed
1530
- * deployments.
1983
+ * Triggers a search operation with the search tokens specified in
1984
+ * the search query string.
1985
+ * Supported in `AppEmbed` and `SearchEmbed` deployments.
1531
1986
  * Includes the following properties:
1532
1987
  *
1533
- * @param - dataSourceIds - The data source GUID to Search on
1988
+ * @param - `searchQuery` - query string with search tokens
1989
+ * @param - `dataSources` - Data source GUID to Search on
1534
1990
  * - Although an array, only a single source
1535
1991
  * is supported.
1536
- * @param - searchQuery - Query string with search tokens
1537
- * @param - execute - executes the existing / updated query
1992
+ * @param - `execute` - executes search and updates the existing query
1538
1993
  * @example
1539
1994
  * ```js
1540
1995
  * searchembed.trigger(HostEvent.Search, {
@@ -1554,6 +2009,10 @@ export enum HostEvent {
1554
2009
  * @param - columnGuid - Optional. GUID of the column to drill
1555
2010
  * by. If not provided it will auto drill by the configured
1556
2011
  * column.
2012
+ * @param - autoDrillDown - Optional. If true, the drill down will be
2013
+ * done automatically on the most popular column.
2014
+ * @param - vizId [TS >= 9.8.0] - Optional. The GUID of the visualization to drill
2015
+ * in case of a liveboard.
1557
2016
  * @example
1558
2017
  * ```js
1559
2018
  * searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
@@ -1570,6 +2029,25 @@ export enum HostEvent {
1570
2029
  * });
1571
2030
  * })
1572
2031
  * ```
2032
+ * @example
2033
+ * ```js
2034
+ * // Works with TS 9.8.0 and above
2035
+ *
2036
+ * liveboardEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
2037
+ * console.log(payload);
2038
+ * const clickedPoint = payload.data.clickedPoint;
2039
+ * const selectedPoint = payload.data.selectedPoints;
2040
+ * console.log('>>> called', clickedPoint);
2041
+ * liveboardEmbed.trigger(HostEvent.DrillDown, {
2042
+ * points: {
2043
+ * clickedPoint,
2044
+ * selectedPoints: selectedPoint
2045
+ * },
2046
+ * autoDrillDown: true,
2047
+ * vizId: payload.data.vizId
2048
+ * });
2049
+ * })
2050
+ * ```
1573
2051
  * @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
1574
2052
  */
1575
2053
  DrillDown = 'triggerDrillDown',
@@ -1586,7 +2064,7 @@ export enum HostEvent {
1586
2064
  */
1587
2065
  Reload = 'reload',
1588
2066
  /**
1589
- * Sets the visible visualizations on a Liveboard.
2067
+ * Display specific visualizations on a Liveboard.
1590
2068
  *
1591
2069
  * @param - An array of GUIDs of the visualization to show. The visualization IDs not passed
1592
2070
  * in this parameter will be hidden.
@@ -1600,7 +2078,7 @@ export enum HostEvent {
1600
2078
  */
1601
2079
  SetVisibleVizs = 'SetPinboardVisibleVizs',
1602
2080
  /**
1603
- * Set the Active Tab of a Liveboard.
2081
+ * Set a Liveboard tab as an active tab.
1604
2082
  *
1605
2083
  * @param - tabId - string of id of Tab to show
1606
2084
  * @example
@@ -1613,7 +2091,7 @@ export enum HostEvent {
1613
2091
  */
1614
2092
  SetActiveTab = 'SetActiveTab',
1615
2093
  /**
1616
- * Updates runtime filters applied on a Saved Answer or Liveboard. The
2094
+ * Update runtime filters applied on a Saved Answer or Liveboard. The
1617
2095
  * runtime filters passed here are appended to the existing runtime
1618
2096
  * filters.
1619
2097
  * Pass an array of runtime filters with the following attributes:
@@ -1639,10 +2117,12 @@ export enum HostEvent {
1639
2117
  */
1640
2118
  UpdateRuntimeFilters = 'UpdateRuntimeFilters',
1641
2119
  /**
1642
- * Navigate to a specific page in the embedded application without reloading the page.
2120
+ * Navigate to a specific page in the embedded ThoughtSpot application.
1643
2121
  * This is the same as calling `appEmbed.navigateToPage(path, true)`
1644
2122
  *
1645
- * @param - path - the path to navigate to (can be a number[1/-1] to go forward/back)
2123
+ * @param - `path` - the path to navigate to to go forward or back. The path value can
2124
+ * be a number; for example, `1`, `-1`.
2125
+ *
1646
2126
  * @example
1647
2127
  * ```js
1648
2128
  * appEmbed.navigateToPage(-1)
@@ -1651,7 +2131,7 @@ export enum HostEvent {
1651
2131
  */
1652
2132
  Navigate = 'Navigate',
1653
2133
  /**
1654
- * Opens the filter panel for a particular column.
2134
+ * Open the filter panel for a particular column.
1655
2135
  * Works with Search and Liveboard embed.
1656
2136
  *
1657
2137
  * @param - { columnId: string,
@@ -1669,7 +2149,7 @@ export enum HostEvent {
1669
2149
  */
1670
2150
  OpenFilter = 'openFilter',
1671
2151
  /**
1672
- * Adds columns to the current search query.
2152
+ * Add columns to the current search query.
1673
2153
  *
1674
2154
  * @param - { columnIds: string[] }
1675
2155
  * @example
@@ -1680,7 +2160,7 @@ export enum HostEvent {
1680
2160
  */
1681
2161
  AddColumns = 'addColumns',
1682
2162
  /**
1683
- * Removes a column from the current search query.
2163
+ * Remove a column from the current search query.
1684
2164
  *
1685
2165
  * @param - { columnId: string }
1686
2166
  * @example
@@ -1691,27 +2171,29 @@ export enum HostEvent {
1691
2171
  */
1692
2172
  RemoveColumn = 'removeColumn',
1693
2173
  /**
1694
- * Gets the current Liveboard content.
2174
+ * Get the transient state of a Liveboard as encoded content.
2175
+ * This includes unsaved and ad hoc changes such as
2176
+ * Liveboard filters, runtime filters applied on visualizations on a
2177
+ * Liveboard, and Liveboard layout, changes to visualizations such as
2178
+ * sorting, toggling of legends, and data drill down.
1695
2179
  *
1696
2180
  * @example
1697
2181
  * ```js
1698
- * liveboardEmbed.trigger(HostEvent.getExportRequestForCurrentPinboard)
2182
+ * liveboardEmbed.trigger(HostEvent.getexportrequestforcurrentpinboard).then(
2183
+ * data=>console.log(data))
1699
2184
  * ```
1700
2185
  * @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl, 8.8.1.sw
1701
2186
  */
1702
2187
  getExportRequestForCurrentPinboard = 'getExportRequestForCurrentPinboard',
1703
2188
  /**
1704
- * Triggers the **Pin** action on an embedded object
2189
+ * Trigger the **Pin** action on an embedded object
1705
2190
  *
1706
2191
  * @param - Liveboard embed takes the `vizId` as a
1707
- * key. Can be left undefined when embedding Search, full app or
2192
+ * key. Can be left undefined when embedding Search, full app, or
1708
2193
  * a visualization.
1709
2194
  * @example
1710
2195
  * ```js
1711
- * liveboardEmbed.trigger(HostEvent.Pin, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1712
- * ```
1713
- * ```js
1714
- * vizEmbed.trigger(HostEvent.Pin)
2196
+ * appEmbed.trigger(HostEvent.Pin)
1715
2197
  * ```
1716
2198
  * ```js
1717
2199
  * searchEmbed.trigger(HostEvent.Pin)
@@ -1720,17 +2202,18 @@ export enum HostEvent {
1720
2202
  */
1721
2203
  Pin = 'pin',
1722
2204
  /**
1723
- * Triggers the **Show Liveboard details** action on a Liveboard
2205
+ * Trigger the **Show Liveboard details** action
2206
+ * on an embedded Liveboard.
1724
2207
  *
1725
2208
  * @example
1726
- * ```js
1727
- * liveboardEmbed.trigger(HostEvent.LiveboardInfo)
1728
- * ```
2209
+ *```js
2210
+ * liveboardEmbed.trigger(HostEvent.LiveboardInfo)
2211
+ *```
1729
2212
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1730
2213
  */
1731
2214
  LiveboardInfo = 'pinboardInfo',
1732
2215
  /**
1733
- * Triggers the **Schedule** action on a Liveboard
2216
+ * Trigger the **Schedule** action on an embedded Liveboard.
1734
2217
  *
1735
2218
  * @example
1736
2219
  * ```js
@@ -1740,7 +2223,7 @@ export enum HostEvent {
1740
2223
  */
1741
2224
  Schedule = 'subscription',
1742
2225
  /**
1743
- * Triggers the **Manage schedule** action on a Liveboard
2226
+ * Trigger the **Manage schedule** action on an embedded Liveboard
1744
2227
  *
1745
2228
  * @example
1746
2229
  * ```js
@@ -1750,7 +2233,7 @@ export enum HostEvent {
1750
2233
  */
1751
2234
  SchedulesList = 'schedule-list',
1752
2235
  /**
1753
- * Triggers the **Export TML** action on a Liveboard
2236
+ * Trigger the **Export TML** action on an embedded Liveboard.
1754
2237
  *
1755
2238
  * @example
1756
2239
  * ```js
@@ -1760,7 +2243,7 @@ export enum HostEvent {
1760
2243
  */
1761
2244
  ExportTML = 'exportTSL',
1762
2245
  /**
1763
- * Triggers the **Edit TML** action on a Liveboard
2246
+ * Trigger the **Edit TML** action on an embedded Liveboard.
1764
2247
  *
1765
2248
  * @example
1766
2249
  * ```js
@@ -1770,7 +2253,7 @@ export enum HostEvent {
1770
2253
  */
1771
2254
  EditTML = 'editTSL',
1772
2255
  /**
1773
- * Triggers the **Update TML** action on a Liveboard
2256
+ * Trigger the **Update TML** action on an embedded Liveboard.
1774
2257
  *
1775
2258
  * @example
1776
2259
  * ```js
@@ -1780,7 +2263,7 @@ export enum HostEvent {
1780
2263
  */
1781
2264
  UpdateTML = 'updateTSL',
1782
2265
  /**
1783
- * Triggers the **Download PDF** action on a Liveboard
2266
+ * Trigger the **Download PDF** action on an embedded Liveboard.
1784
2267
  *
1785
2268
  * @example
1786
2269
  * ```js
@@ -1790,8 +2273,8 @@ export enum HostEvent {
1790
2273
  */
1791
2274
  DownloadAsPdf = 'downloadAsPdf',
1792
2275
  /**
1793
- * Triggers the **Make a copy** action on a Liveboard, Search, or
1794
- * visualization page
2276
+ * Trigger the **Make a copy** action on a Liveboard, Search, or
2277
+ * visualization page.
1795
2278
  *
1796
2279
  * @example
1797
2280
  * ```js
@@ -1807,7 +2290,7 @@ export enum HostEvent {
1807
2290
  */
1808
2291
  MakeACopy = 'makeACopy',
1809
2292
  /**
1810
- * Triggers the **Delete** action on a Liveboard
2293
+ * Trigger the **Delete** action for a Liveboard.
1811
2294
  *
1812
2295
  * @example
1813
2296
  * ```js
@@ -1817,7 +2300,7 @@ export enum HostEvent {
1817
2300
  */
1818
2301
  Remove = 'delete',
1819
2302
  /**
1820
- * Triggers the **Explore* action on a visualization
2303
+ * Trigger the **Explore** action on a visualization.
1821
2304
  *
1822
2305
  * @param - an object with `vizId` as a key
1823
2306
  * @example
@@ -1828,7 +2311,7 @@ export enum HostEvent {
1828
2311
  */
1829
2312
  Explore = 'explore',
1830
2313
  /**
1831
- * Triggers the **Create alert** action on a visualization
2314
+ * Trigger the **Create alert** action on a visualization
1832
2315
  *
1833
2316
  * @param - an object with `vizId` as a key
1834
2317
  * @example
@@ -1841,7 +2324,7 @@ export enum HostEvent {
1841
2324
  */
1842
2325
  CreateMonitor = 'createMonitor',
1843
2326
  /**
1844
- * Triggers the **Manage alerts** action on a visualization
2327
+ * Trigger the **Manage alerts** action on a visualization
1845
2328
  *
1846
2329
  * @param - an object with `vizId` as a key
1847
2330
  * @example
@@ -1854,7 +2337,7 @@ export enum HostEvent {
1854
2337
  */
1855
2338
  ManageMonitor = 'manageMonitor',
1856
2339
  /**
1857
- * Triggers the **Edit** action on a Liveboard or visualization
2340
+ * Trigger the **Edit** action on a Liveboard or visualization
1858
2341
  *
1859
2342
  * @param - object - To trigger the action for a specific visualization
1860
2343
  * in Liveboard embed, pass in `vizId` as a key.
@@ -1875,7 +2358,7 @@ export enum HostEvent {
1875
2358
  */
1876
2359
  Edit = 'edit',
1877
2360
  /**
1878
- * Triggers the **Copy link** action on a Liveboard or visualization
2361
+ * Trigger the **Copy link** action on a Liveboard or visualization
1879
2362
  *
1880
2363
  * @param - object - to trigger the action for a
1881
2364
  * specific visualization in Liveboard embed, pass in `vizId` as a key
@@ -1893,7 +2376,7 @@ export enum HostEvent {
1893
2376
  */
1894
2377
  CopyLink = 'embedDocument',
1895
2378
  /**
1896
- * Triggers the **Present** action on a Liveboard or visualization
2379
+ * Trigger the **Present** action on a Liveboard or visualization
1897
2380
  *
1898
2381
  * @param - object - to trigger the action for a specific visualization
1899
2382
  * in Liveboard embed, pass in `vizId` as a key
@@ -1911,7 +2394,7 @@ export enum HostEvent {
1911
2394
  */
1912
2395
  Present = 'present',
1913
2396
  /**
1914
- * Gets TML for the current search.
2397
+ * Get TML for the current search.
1915
2398
  *
1916
2399
  * @example
1917
2400
  * ```js
@@ -1926,7 +2409,7 @@ export enum HostEvent {
1926
2409
  */
1927
2410
  GetTML = 'getTML',
1928
2411
  /**
1929
- * Triggers the **Show underlying data** action on visualization or search
2412
+ * Trigger the **Show underlying data** action on visualization or search
1930
2413
  *
1931
2414
  * @param - an object with vizId as a key
1932
2415
  * @example
@@ -1944,7 +2427,9 @@ export enum HostEvent {
1944
2427
  */
1945
2428
  ShowUnderlyingData = 'showUnderlyingData',
1946
2429
  /**
1947
- * Triggers the **Delete** action on visualization or search
2430
+ * Trigger the **Delete** action for a visualization
2431
+ * in an embedded Liveboard, or a chart or table
2432
+ * generated from Search.
1948
2433
  *
1949
2434
  * @param - Liveboard embed takes an object with `vizId` as a key.
1950
2435
  * Can be left empty if embedding Search or visualization.
@@ -1954,16 +2439,13 @@ export enum HostEvent {
1954
2439
  * '730496d6-6903-4601-937e-2c691821af3c'})
1955
2440
  * ```
1956
2441
  * ```js
1957
- * vizEmbed.trigger(HostEvent.Delete)
1958
- * ```
1959
- * ```js
1960
2442
  * searchEmbed.trigger(HostEvent.Delete)
1961
2443
  * ```
1962
2444
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
1963
2445
  */
1964
2446
  Delete = 'onDeleteAnswer',
1965
2447
  /**
1966
- * Triggers the **SpotIQ analyze** action on visualization
2448
+ * Trigger the **SpotIQ analyze** action on visualization
1967
2449
  * or search.
1968
2450
  *
1969
2451
  * @param - Liveboard embed takes `vizId` as a
@@ -1984,7 +2466,7 @@ export enum HostEvent {
1984
2466
  */
1985
2467
  SpotIQAnalyze = 'spotIQAnalyze',
1986
2468
  /**
1987
- * Triggers the **Download** action on charts in
2469
+ * Trigger the **Download** action on charts in
1988
2470
  * the embedded view.
1989
2471
  *
1990
2472
  * @example
@@ -1993,17 +2475,15 @@ export enum HostEvent {
1993
2475
  * '730496d6-6903-4601-937e-2c691821af3c'})
1994
2476
  * ```
1995
2477
  * ```js
1996
- * vizEmbed.trigger(HostEvent.Download)
1997
- * ```
1998
- * ```js
1999
- * searchEmbed.trigger(HostEvent.Download)
2478
+ * embed.trigger(HostEvent.Download)
2000
2479
  * ```
2001
- * @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw ,Use {@link DownloadAsPng}
2480
+ * @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw
2481
+ * Use {@link DownloadAsPng}
2002
2482
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2003
2483
  */
2004
2484
  Download = 'downloadAsPng',
2005
2485
  /**
2006
- * Triggers the **Download** > **PNG** action on
2486
+ * Trigger the **Download** > **PNG** action on
2007
2487
  * charts in the embedded view.
2008
2488
  *
2009
2489
  * @example
@@ -2019,7 +2499,7 @@ export enum HostEvent {
2019
2499
  */
2020
2500
  DownloadAsPng = 'downloadAsPng',
2021
2501
  /**
2022
- * Triggers the **Download** > **CSV** action on tables in
2502
+ * Trigger the **Download** > **CSV** action on tables in
2023
2503
  * the embedded view.
2024
2504
  *
2025
2505
  * @example
@@ -2037,7 +2517,7 @@ export enum HostEvent {
2037
2517
  */
2038
2518
  DownloadAsCsv = 'downloadAsCSV',
2039
2519
  /**
2040
- * Triggers the **Download** > **XLSX** action on tables
2520
+ * Trigger the **Download** > **XLSX** action on tables
2041
2521
  * in the embedded view.
2042
2522
  *
2043
2523
  * @example
@@ -2055,7 +2535,7 @@ export enum HostEvent {
2055
2535
  */
2056
2536
  DownloadAsXlsx = 'downloadAsXLSX',
2057
2537
  /**
2058
- * Triggers the **Share** action on an embedded
2538
+ * Trigger the **Share** action on an embedded
2059
2539
  * Liveboard or Answer.
2060
2540
  *
2061
2541
  * @example
@@ -2069,7 +2549,7 @@ export enum HostEvent {
2069
2549
  */
2070
2550
  Share = 'share',
2071
2551
  /**
2072
- * Triggers the **Save** action on a Liveboard or Answer.
2552
+ * Trigger the **Save** action on a Liveboard or Answer.
2073
2553
  * Saves the changes.
2074
2554
  *
2075
2555
  * @example
@@ -2083,7 +2563,7 @@ export enum HostEvent {
2083
2563
  */
2084
2564
  Save = 'save',
2085
2565
  /**
2086
- * Triggers the **Sync to Sheets** action on an embedded visualization or Answer
2566
+ * Trigger the **Sync to Sheets** action on an embedded visualization or Answer
2087
2567
  * Sends data from an Answer or Liveboard visualization to a Google sheet.
2088
2568
  *
2089
2569
  * @param - an object with `vizId` as a key
@@ -2099,7 +2579,7 @@ export enum HostEvent {
2099
2579
  */
2100
2580
  SyncToSheets = 'sync-to-sheets',
2101
2581
  /**
2102
- * Triggers the **Sync to Other Apps** action on an embedded visualization or Answer
2582
+ * Trigger the **Sync to Other Apps** action on an embedded visualization or Answer
2103
2583
  * Sends data from an Answer or Liveboard visualization to third-party apps such
2104
2584
  * as Slack, Salesforce, Microsoft Teams, ServiceNow and so on.
2105
2585
  *
@@ -2116,7 +2596,7 @@ export enum HostEvent {
2116
2596
  */
2117
2597
  SyncToOtherApps = 'sync-to-other-apps',
2118
2598
  /**
2119
- * Triggers the **Manage pipelines** action on an embedded
2599
+ * Trigger the **Manage pipelines** action on an embedded
2120
2600
  * visualization or Answer.
2121
2601
  * Allows users to manage ThoughtSpot Sync pipelines.
2122
2602
  *
@@ -2133,18 +2613,21 @@ export enum HostEvent {
2133
2613
  */
2134
2614
  ManagePipelines = 'manage-pipeline',
2135
2615
  /**
2136
- * Triggers the Reset search on the Search page
2616
+ * Reset search operation on the Search or Answer page.
2137
2617
  *
2138
2618
  * @example
2139
2619
  * ```js
2140
2620
  * searchEmbed.trigger(HostEvent.ResetSearch)
2141
2621
  * ```
2622
+ * ```js
2623
+ * appEmbed.trigger(HostEvent.ResetSearch)
2624
+ * ```
2142
2625
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.0.1.sw
2143
2626
  */
2144
2627
  ResetSearch = 'resetSearch',
2145
2628
  /**
2146
2629
  * @hidden
2147
- * Gets the currents visible and runtime filters applied on a Liveboard
2630
+ * Get the currents visible and runtime filters applied on a Liveboard
2148
2631
  * @example
2149
2632
  * liveboardEmbed.trigger(HostEvent.GetFilters)
2150
2633
  * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
@@ -2152,7 +2635,7 @@ export enum HostEvent {
2152
2635
  GetFilters = 'getFilters',
2153
2636
  /**
2154
2637
  * @hidden
2155
- * Updates the visible filters on the Liveboard.
2638
+ * Update the visible filters on the Liveboard.
2156
2639
  * @param - filter: filter object containing column name and filter operation and values
2157
2640
  * @example
2158
2641
  *
@@ -2165,7 +2648,7 @@ export enum HostEvent {
2165
2648
  */
2166
2649
  UpdateFilters = 'updateFilters',
2167
2650
  /**
2168
- * Get Tab for the current Liveboard.
2651
+ * Get tab details for the current Liveboard.
2169
2652
  *
2170
2653
  * @example
2171
2654
  * ```js
@@ -2179,9 +2662,9 @@ export enum HostEvent {
2179
2662
  */
2180
2663
  GetTabs = 'getTabs',
2181
2664
  /**
2182
- * Set the visible Tabs on a Liveboard.
2665
+ * Set the visible tabs on a Liveboard.
2183
2666
  *
2184
- * @param - an array of ids of Tabs to show, the ids not passed
2667
+ * @param - an array of ids of tabs to show, the IDs not passed
2185
2668
  * will be hidden.
2186
2669
  * @example
2187
2670
  * ```js
@@ -2195,8 +2678,8 @@ export enum HostEvent {
2195
2678
  /**
2196
2679
  * Set the hidden tabs on a Liveboard.
2197
2680
  *
2198
- * @param - an array of ids of Tabs to hide, the ids not passed
2199
- * will be shown.
2681
+ * @param - an array of the IDs of the tabs to hide.
2682
+ * The IDs not passed will be shown.
2200
2683
  * @example
2201
2684
  * ```js
2202
2685
  * liveboardEmbed.trigger(HostEvent.SetHiddenTabs, [
@@ -2207,9 +2690,12 @@ export enum HostEvent {
2207
2690
  */
2208
2691
  SetHiddenTabs = 'SetPinboardHiddenTabs',
2209
2692
  /**
2210
- * Updates the search query for sage embed.
2693
+ * Updates the search query string for Natural Language Search operations.
2694
+ *
2695
+ * @param - `queryString`: Text string in Natural Language format
2696
+ *
2697
+ * @param - `executeSearch`: Boolean to execute search and update search query
2211
2698
  *
2212
- * @param - searchOptions: an object queryString and option to execute the query.
2213
2699
  * @example
2214
2700
  * ```js
2215
2701
  * sageEmbed.trigger(HostEvent.UpdateSageQuery, {
@@ -2217,7 +2703,7 @@ export enum HostEvent {
2217
2703
  * executeSearch: true,
2218
2704
  * })
2219
2705
  * ```
2220
- * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
2706
+ * @version SDK: 1.26.0 | Thoughtspot: 9.8.0.cl, 9.8.0.sw
2221
2707
  */
2222
2708
  UpdateSageQuery = 'updateSageQuery',
2223
2709
  /**
@@ -2230,26 +2716,27 @@ export enum HostEvent {
2230
2716
  * vizId: '123', // For Liveboard Visualization.
2231
2717
  * })
2232
2718
  * ```
2719
+ * @version SDK: 1.26.0 | Thoughtspot: 9.10.0.cl
2233
2720
  */
2234
2721
  GetAnswerSession = 'getAnswerSession',
2235
2722
  }
2236
2723
 
2237
2724
  /**
2238
2725
  * The different visual modes that the data sources panel within
2239
- * search could appear in, i.e., hidden, collapsed, or expanded.
2726
+ * search could appear in, such as hidden, collapsed, or expanded.
2240
2727
  */
2241
2728
  // eslint-disable-next-line no-shadow
2242
2729
  export enum DataSourceVisualMode {
2243
2730
  /**
2244
- * Data source panel is hidden.
2731
+ * The data source panel is hidden.
2245
2732
  */
2246
2733
  Hidden = 'hide',
2247
2734
  /**
2248
- * Data source panel is collapsed, but the user can manually expand it.
2735
+ * The data source panel is collapsed, but the user can manually expand it.
2249
2736
  */
2250
2737
  Collapsed = 'collapse',
2251
2738
  /**
2252
- * Data source panel is expanded, but the user can manually collapse it.
2739
+ * The data source panel is expanded, but the user can manually collapse it.
2253
2740
  */
2254
2741
  Expanded = 'expand',
2255
2742
  }
@@ -2329,6 +2816,7 @@ export enum Param {
2329
2816
  IsProductTour = 'isProductTour',
2330
2817
  HideSearchBarTitle = 'hideSearchBarTitle',
2331
2818
  HideSageAnswerHeader = 'hideSageAnswerHeader',
2819
+ HideSearchBar = 'hideSearchBar',
2332
2820
  }
2333
2821
 
2334
2822
  /**
@@ -2390,9 +2878,11 @@ export enum Action {
2390
2878
  SaveAsView = 'saveAsView',
2391
2879
  /**
2392
2880
  * The **Make a copy** action on a Liveboard or Answer
2393
- * page.
2394
- * Creates a copy of the Liveboard, visualization,
2395
- * or Answer.
2881
+ * page. Creates a copy of the Liveboard.
2882
+ * In LiveboardEmbed, the **Make a copy** action is not available for
2883
+ * visualizations in the embedded Liveboard view.
2884
+ * In AppEmbed, the **Make a copy** action is available on both
2885
+ * Liveboards and visualizations.
2396
2886
  *
2397
2887
  * @example
2398
2888
  * ```js
@@ -2576,7 +3066,7 @@ export enum Action {
2576
3066
  */
2577
3067
  DownloadAsPdf = 'downloadAsPdf',
2578
3068
  /**
2579
- * The **Download** > **CSV** menu action for tables on a Liveboard
3069
+ * The **Download** > **CSV** menu action for tables on a Liveboard
2580
3070
  * or Answer page.
2581
3071
  * Downloads a visualization or Answer in the XLSX format.
2582
3072
  *
@@ -3108,6 +3598,7 @@ export enum Action {
3108
3598
  */
3109
3599
  RenameModalTitleDescription = 'renameModalTitleDescription',
3110
3600
  /**
3601
+ *
3111
3602
  * @version SDK: 1.25.0 | Thoughtspot: 9.6.0.cl
3112
3603
  */
3113
3604
  RequestVerification = 'requestVerification',
@@ -3212,40 +3703,44 @@ export enum ContextMenuTriggerOptions {
3212
3703
 
3213
3704
  export interface ColumnValue {
3214
3705
  column: {
3215
- id: string,
3216
- name: string,
3217
- dataType: string,
3218
- [key: string]: any
3219
- },
3220
- value: string | number | boolean | {
3221
- v: {
3222
- s: number;
3223
- e: number;
3224
- }
3706
+ id: string;
3707
+ name: string;
3708
+ dataType: string;
3709
+ [key: string]: any;
3225
3710
  };
3711
+ value:
3712
+ | string
3713
+ | number
3714
+ | boolean
3715
+ | {
3716
+ v: {
3717
+ s: number;
3718
+ e: number;
3719
+ };
3720
+ };
3226
3721
  }
3227
3722
 
3228
3723
  export interface VizPoint {
3229
- selectedAttributes: ColumnValue[],
3230
- selectedMeasures: ColumnValue[]
3724
+ selectedAttributes: ColumnValue[];
3725
+ selectedMeasures: ColumnValue[];
3231
3726
  }
3232
3727
 
3233
3728
  export interface CustomActionPayload {
3234
3729
  contextMenuPoints?: {
3235
- clickedPoint: VizPoint
3236
- selectedPoints: VizPoint[]
3730
+ clickedPoint: VizPoint;
3731
+ selectedPoints: VizPoint[];
3237
3732
  };
3238
3733
  embedAnswerData: {
3239
- name: string,
3240
- id: string,
3734
+ name: string;
3735
+ id: string;
3241
3736
  sources: {
3242
3737
  header: {
3243
- guid: string
3244
- }
3245
- },
3246
- columns: any[],
3247
- data: any[],
3248
- [key: string]: any
3738
+ guid: string;
3739
+ };
3740
+ };
3741
+ columns: any[];
3742
+ data: any[];
3743
+ [key: string]: any;
3249
3744
  };
3250
3745
  session: SessionInterface;
3251
3746
  vizId?: string;