@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
@@ -336,10 +336,14 @@ var AuthType;
336
336
  */
337
337
  AuthType["None"] = "None";
338
338
  /**
339
- * Passthrough SSO to the embedded App within the iframe. Requires least
339
+ * Passthrough SSO to the embedded application within the iframe. Requires least
340
340
  * configuration, but may not be supported by all IDPs. This will behave like `None`
341
341
  * if SSO is not configured on ThoughtSpot.
342
342
  *
343
+ * To use this:
344
+ * Your SAML or OpenID provider must allow iframe redirects.
345
+ * For example, if you are using Okta as IdP, you can enable iframe embedding.
346
+ *
343
347
  * @example
344
348
  * ```js
345
349
  * init({
@@ -347,12 +351,7 @@ var AuthType;
347
351
  * authType: AuthType.EmbeddedSSO,
348
352
  * });
349
353
  * ```
350
- * Set authentication type as Embedded SSO.
351
- *
352
- * To use this:
353
- * Your SAML or OpenID provider must allow iframe redirects.
354
- * eg. If you are using okta as IdP, you can enable iFrame embedding.
355
- * @version: SDK: 1.15.0 | ThouhgtSpot: 8.8.0.cl
354
+ * @version: SDK: 1.15.0 | ThoughtSpot: 8.8.0.cl
356
355
  */
357
356
  AuthType["EmbeddedSSO"] = "EmbeddedSSO";
358
357
  /**
@@ -371,10 +370,10 @@ var AuthType;
371
370
  AuthType["SAML"] = "SSO_SAML";
372
371
  /**
373
372
  * SSO using SAML
374
- * Will make the host application redirect to the SAML Idp. Use this
375
- * when the idp does not allow itself to be embedded.
373
+ * Makes the host application redirect to the SAML IdP. Use this
374
+ * if your IdP does not allow itself to be embedded.
376
375
  *
377
- * This redirects the host application to the SAML Idp. The host application
376
+ * This redirects the host application to the SAML IdP. The host application
378
377
  * will be redirected back to the ThoughtSpot app after authentication.
379
378
  *
380
379
  * @example
@@ -385,7 +384,7 @@ var AuthType;
385
384
  * });
386
385
  * ```
387
386
  *
388
- * This opens the SAML Idp in a popup window. The popup is triggered
387
+ * This opens the SAML IdP in a popup window. The popup is triggered
389
388
  * when the user clicks the trigger button. The popup window will be
390
389
  * closed automatically after authentication.
391
390
  * @example
@@ -399,8 +398,8 @@ var AuthType;
399
398
  * });
400
399
  * ```
401
400
  *
402
- * Can also use event to trigger the popup flow. Works the same
403
- * as above example.
401
+ * Can also use the event to trigger the popup flow. Works the same
402
+ * as the above example.
404
403
  * @example
405
404
  * ```js
406
405
  * const authEE = init({
@@ -424,7 +423,7 @@ var AuthType;
424
423
  AuthType["OIDC"] = "SSO_OIDC";
425
424
  /**
426
425
  * SSO using OIDC
427
- * Will make the host application redirect to the OIDC Idp.
426
+ * Will make the host application redirect to the OIDC IdP.
428
427
  * See code samples in {@link SAMLRedirect}.
429
428
  */
430
429
  AuthType["OIDCRedirect"] = "SSO_OIDC";
@@ -436,8 +435,8 @@ var AuthType;
436
435
  */
437
436
  AuthType["AuthServer"] = "AuthServer";
438
437
  /**
439
- * Trusted authentication server, Use your own authentication server
440
- * which returns a bearer token, generated using the secret_key obtained
438
+ * Trusted authentication server. Use your own authentication server
439
+ * which returns a bearer token, generated using the `secret_key` obtained
441
440
  * from ThoughtSpot.
442
441
  *
443
442
  * @example
@@ -454,11 +453,11 @@ var AuthType;
454
453
  */
455
454
  AuthType["TrustedAuthToken"] = "AuthServer";
456
455
  /**
457
- * Trusted authentication server Cookieless, Use you own authentication
458
- * server which returns a bearer token, generated using the secret_key
456
+ * Trusted authentication server Cookieless, Use your own authentication
457
+ * server which returns a bearer token, generated using the `secret_key`
459
458
  * obtained from ThoughtSpot. This uses a cookieless authentication
460
- * approach, recommended to by pass third-party cookie-blocking restriction
461
- * implemented by some browsers
459
+ * approach, recommended to bypass the third-party cookie-blocking restriction
460
+ * implemented by some browsers.
462
461
  *
463
462
  * @example
464
463
  * ```js
@@ -471,7 +470,7 @@ var AuthType;
471
470
  * .then((data) => data.token);
472
471
  * }
473
472
  * ```
474
- * @version SDK: 1.22.0| ThouhgtSpot: 9.3.0.cl, 9.5.1.sw
473
+ * @version SDK: 1.22.0| ThoughtSpot: 9.3.0.cl, 9.5.1.sw
475
474
  */
476
475
  AuthType["TrustedAuthTokenCookieless"] = "AuthServerCookieless";
477
476
  /**
@@ -558,7 +557,7 @@ var RuntimeFilterOp;
558
557
  RuntimeFilterOp["IN"] = "IN";
559
558
  })(RuntimeFilterOp || (RuntimeFilterOp = {}));
560
559
  /**
561
- * Home page module that can be hide
560
+ * Home page module that can be hidden
562
561
  */
563
562
  // eslint-disable-next-line no-shadow
564
563
  var HomepageModule;
@@ -576,7 +575,7 @@ var HomepageModule;
576
575
  */
577
576
  HomepageModule["Favorite"] = "FAVORITE";
578
577
  /**
579
- * List of answers and liveboards
578
+ * List of answers and Liveboards
580
579
  */
581
580
  HomepageModule["MyLibrary"] = "MY_LIBRARY";
582
581
  /**
@@ -613,6 +612,14 @@ var EmbedEvent;
613
612
  (function (EmbedEvent) {
614
613
  /**
615
614
  * Rendering has initialized.
615
+ * @example
616
+ *```js
617
+ * liveboardEmbed.on(EmbedEvent.Init, showLoader)
618
+ * //show a loader
619
+ * function showLoader() {
620
+ * document.getElementById("loader");
621
+ * }
622
+ *```
616
623
  *
617
624
  * @returns timestamp - The timestamp when the event was generated.
618
625
  */
@@ -620,69 +627,162 @@ var EmbedEvent;
620
627
  /**
621
628
  * Authentication has either succeeded or failed.
622
629
  *
630
+ * @example
631
+ *```js
632
+ * appEmbed.on(EmbedEvent.AuthInit, payload => {
633
+ * console.log('AuthInit', payload);
634
+ * })
635
+ *```
636
+ *
623
637
  * @returns isLoggedIn - A Boolean specifying whether authentication was successful.
624
638
  */
625
639
  EmbedEvent["AuthInit"] = "authInit";
626
640
  /**
627
641
  * The embed object container has loaded.
628
- *
629
642
  * @returns timestamp - The timestamp when the event was generated.
643
+ * @example
644
+ *```js
645
+ * liveboardEmbed.on(EmbedEvent.Load, hideLoader)
646
+ * //hide loader
647
+ * function hideLoader() {
648
+ * document.getElementById("loader");
649
+ * }
650
+ *```
630
651
  */
631
652
  EmbedEvent["Load"] = "load";
632
653
  /**
633
654
  * Data pertaining to answer or Liveboard is received
634
- *
635
655
  * @return data - The answer or Liveboard data
656
+ * @example
657
+ *```js
658
+ * liveboardEmbed.on(EmbedEvent.Data, payload => {
659
+ * console.log('data', payload);
660
+ * })
661
+ *```
636
662
  * @important
637
663
  */
638
664
  EmbedEvent["Data"] = "data";
639
665
  /**
640
- * Search/answer/Liveboard filters have been applied/updated by the user.
666
+ * Search/Answer/Liveboard filters have been applied/updated by the user.
641
667
  *
642
668
  * @hidden
643
669
  */
644
670
  EmbedEvent["FiltersChanged"] = "filtersChanged";
645
671
  /**
646
672
  * Search query has been updated by the user.
673
+ *
674
+ * @example
675
+ *```js
676
+ * searchEmbed.on(EmbedEvent.QueryChanged, payload => console.log('data', payload))
677
+ *```
678
+ *
647
679
  */
648
680
  EmbedEvent["QueryChanged"] = "queryChanged";
649
681
  /**
650
- * A drill down operation has been performed.
682
+ * A drill-down operation has been performed.
651
683
  *
652
684
  * @returns additionalFilters - Any additional filters applied
653
685
  * @returns drillDownColumns - The columns on which drill down was performed
654
686
  * @returns nonFilteredColumns - The columns that were not filtered
687
+ *
688
+ * @example
689
+ *```js
690
+ * searchEmbed.trigger(HostEvent.DrillDown, {
691
+ * points: {
692
+ * clickedPoint,
693
+ * selectedPoints: selectedPoint
694
+ * },
695
+ * autoDrillDown: true,
696
+ * })
697
+ *```
698
+ * In this example, `VizPointDoubleClick` event is used for
699
+ * triggering the `DrillDown` event when an area or specific
700
+ * data point on a table or chart is double-clicked.
701
+ *
702
+ * @example
703
+ *```js
704
+ * searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
705
+ * console.log(payload);
706
+ * const clickedPoint = payload.data.clickedPoint;
707
+ * const selectedPoint = payload.data.selectedPoints;
708
+ * console.log('>>> called', clickedPoint);
709
+ * embed.trigger(HostEvent.DrillDown, {
710
+ * points: {
711
+ * clickedPoint,
712
+ * selectedPoints: selectedPoint
713
+ * },
714
+ * autoDrillDown: true,
715
+ * })
716
+ * })
717
+ *```
718
+ *
655
719
  */
656
720
  EmbedEvent["Drilldown"] = "drillDown";
657
721
  /**
658
722
  * One or more data sources have been selected.
659
- *
660
723
  * @returns dataSourceIds - the list of data sources
724
+ *
725
+ * @example
726
+ * ```js
727
+ * searchEmbed.on(EmbedEvent.DataSourceSelected, payload => {
728
+ * console.log('DataSourceSelected', payload);
729
+ * })
730
+ * ```
731
+ *
661
732
  */
662
733
  EmbedEvent["DataSourceSelected"] = "dataSourceSelected";
663
734
  /**
664
735
  * One or more data columns have been selected.
665
- *
666
736
  * @returns columnIds - the list of columns
667
737
  * @version SDK: 1.10.0 | ThoughtSpot: 8.2.0.cl, 8.4.1.sw
738
+ *
739
+ * @example
740
+ * ```js
741
+ * appEmbed.on(EmbedEvent.AddRemoveColumns, payload => {
742
+ * console.log('AddRemoveColumns', payload);
743
+ * })
744
+ * ```
745
+ *
668
746
  */
669
747
  EmbedEvent["AddRemoveColumns"] = "addRemoveColumns";
670
748
  /**
671
- * A custom action has been triggered
749
+ * A custom action has been triggered.
750
+ *
751
+ * @returns actionId - ID of the custom action
752
+ * @returns data - Response payload with the Answer or Liveboard data
672
753
  *
673
- * @returns actionId - The id of the custom action
674
- * @returns data - The answer or Liveboard data
754
+ * @example
755
+ * ```js
756
+ * appEmbed.on(EmbedEvent.customAction, payload => {
757
+ * const data = payload.data;
758
+ * if (data.id === 'insert Custom Action ID here') {
759
+ * console.log('Custom Action event:', data.embedAnswerData);
760
+ * }
761
+ * })
762
+ * ```
675
763
  */
676
764
  EmbedEvent["CustomAction"] = "customAction";
677
765
  /**
678
- * Listen to double clicks on a visualization
766
+ * Listen to double click actions on a visualization.
767
+ *
768
+ * @return ContextMenuInputPoints - Data point that is double-clicked
679
769
  *
680
- * @return ContextMenuInputPoints - data point that is double clicked
681
770
  * @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
771
+ *
772
+ * @example
773
+ * ```js
774
+ * livebaordEmbed.on(EmbedEvent.VizPointDoubleClick, payload => {
775
+ * console.log('VizPointDoubleClick', payload)
776
+ * })
777
+ * ```
682
778
  */
683
779
  EmbedEvent["VizPointDoubleClick"] = "vizPointDoubleClick";
684
780
  /**
685
- * Listen to clicks on a visualization in a liveboard or Search result.
781
+ * Listen to clicks on a visualization in a Liveboard or Search result.
782
+ *
783
+ * @return viz, clickedPoint - metadata about the point that is clicked
784
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
785
+ * @important
686
786
  *
687
787
  * @example
688
788
  * ```js
@@ -696,25 +796,46 @@ var EmbedEvent;
696
796
  * )
697
797
  * });
698
798
  * ```
699
- * @return viz, clickedPoint - metadata about point that is clicked
700
- * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
701
- * @important
702
799
  */
703
800
  EmbedEvent["VizPointClick"] = "vizPointClick";
704
801
  /**
705
802
  * An error has occurred.
706
803
  *
707
804
  * @returns error - An error object or message
805
+ *
806
+ * @example
807
+ * ```js
808
+ * SearchEmbed.on(EmbedEvent.Error, showErrorMsg)
809
+ * //show error messaage
810
+ * function showErrorMsg() {
811
+ * document.getElementById("error");
812
+ * ```
813
+ *
708
814
  */
709
815
  EmbedEvent["Error"] = "Error";
710
816
  /**
711
- * The embedded object has sent an alert
817
+ * The embedded object has sent an alert.
712
818
  *
713
819
  * @returns alert - An alert object
820
+ *
821
+ * @example
822
+ * ```js
823
+ * searchEmbed.on(EmbedEvent.Alert)
824
+ * ```
825
+ *
714
826
  */
715
827
  EmbedEvent["Alert"] = "alert";
716
828
  /**
717
829
  * The ThoughtSpot auth session has expired.
830
+ *
831
+ * @example
832
+ *```js
833
+ * appEmbed.on(EmbedEvent.AuthExpire, showAuthExpired)
834
+ * //show auth expired banner
835
+ * function showAuthExpired() {
836
+ * document.getElementById("authExpiredBanner");
837
+ * }
838
+ *```
718
839
  */
719
840
  EmbedEvent["AuthExpire"] = "ThoughtspotAuthExpired";
720
841
  /**
@@ -744,14 +865,28 @@ var EmbedEvent;
744
865
  */
745
866
  EmbedEvent["EmbedIframeCenter"] = "EmbedIframeCenter";
746
867
  /**
747
- * Emitted when the "Get Data" button in Search Bar embed
748
- * is clicked.
868
+ * Emitted when the **Get Data** action is initiated.
869
+ * Applicable to `SearchBarEmbed` only.
870
+ *
871
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
749
872
  *
750
- * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.0.sw
873
+ * @example
874
+ *```js
875
+ * searchbarEmbed.on(EmbedEvent.GetDataClick)
876
+ * .then(data => {
877
+ * console.log('Answer Data:', data);
878
+ * })
879
+ *```
751
880
  */
752
881
  EmbedEvent["GetDataClick"] = "getDataClick";
753
882
  /**
754
883
  * Detects the route change.
884
+ *
885
+ * @example
886
+ *```js
887
+ * searchEmbed.on(EmbedEvent.RouteChange, payload =>
888
+ * console.log('data', payload))
889
+ *```
755
890
  */
756
891
  EmbedEvent["RouteChange"] = "ROUTE_CHANGE";
757
892
  /**
@@ -761,10 +896,15 @@ var EmbedEvent;
761
896
  */
762
897
  EmbedEvent["V1Data"] = "exportVizDataToParent";
763
898
  /**
764
- * Emitted when the embed does not have cookie access. This
765
- * happens on Safari where third-party cookies are blocked by default.
899
+ * Emitted when the embed does not have cookie access. This happens
900
+ * when Safari and other Web browsers block third-party cookies
901
+ * are blocked by default. `NoCookieAccess` can trigger
766
902
  *
767
- * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 7.2.1
903
+ * @example
904
+ *```js
905
+ * appEmbed.on(EmbedEvent.NoCookieAccess)
906
+ *```
907
+ * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 7.2.1.sw
768
908
  */
769
909
  EmbedEvent["NoCookieAccess"] = "noCookieAccess";
770
910
  /**
@@ -776,239 +916,539 @@ var EmbedEvent;
776
916
  EmbedEvent["SAMLComplete"] = "samlComplete";
777
917
  /**
778
918
  * Emitted when any modal is opened in the app
779
- *
780
919
  * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
920
+ *
921
+ * @example
922
+ *```js
923
+ * appEmbed.on(EmbedEvent.DialogOpen, payload => {
924
+ * console.log('dialog open', payload);
925
+ * })
926
+ *```
781
927
  */
782
928
  EmbedEvent["DialogOpen"] = "dialog-open";
783
929
  /**
784
930
  * Emitted when any modal is closed in the app
785
- *
786
931
  * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
932
+ *
933
+ * @example
934
+ *```js
935
+ * appEmbed.on(EmbedEvent.DialogClose, payload => {
936
+ * console.log('dialog close', payload);
937
+ * })
938
+ *```
787
939
  */
788
940
  EmbedEvent["DialogClose"] = "dialog-close";
789
941
  /**
790
942
  * Emitted when the Liveboard shell loads.
791
943
  * You can use this event as a hook to trigger
792
944
  * other events on the rendered Liveboard.
793
- *
794
945
  * @version SDK: 1.9.1 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw
946
+ *
947
+ * @example
948
+ *```js
949
+ * liveboardEmbed.on(EmbedEvent.LiveboardRendered, payload => {
950
+ console.log('Liveboard is rendered', payload);
951
+ })
952
+ *```
953
+ * The following example shows how to trigger
954
+ * `SetVisibleVizs` event using LiveboardRendered embed event:
955
+ *
956
+ * @example
957
+ *```js
958
+ * const embedRef = useEmbedRef();
959
+ * const onLiveboardRendered = () => {
960
+ * embed.trigger(HostEvent.SetVisibleVizs, ['viz1', 'viz2']);
961
+ * };
962
+ *```
795
963
  */
796
964
  EmbedEvent["LiveboardRendered"] = "PinboardRendered";
797
965
  /**
798
966
  * This can be used to register an event listener which
799
967
  * is triggered on all events.
800
- *
801
968
  * @Version SDK: 1.10.0 | ThoughtSpot: 8.2.0.cl, 8.4.1.sw
969
+ *
970
+ * @example
971
+ *```js
972
+ * appEmbed.on(EmbedEvent.ALL, payload => {
973
+ * console.log('Embed Events', payload)
974
+ * })
975
+ *```
802
976
  */
803
977
  EmbedEvent["ALL"] = "*";
804
978
  /**
805
979
  * Emitted when an Answer is saved in the app
806
- *
807
980
  * @Version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
981
+ * @example
982
+ *```js
983
+ * //trigger when action starts
984
+ * searchEmbed.on(EmbedEvent.Save, payload => {
985
+ * console.log('Save', payload)
986
+ * }, {
987
+ * start: true
988
+ * })
989
+ * //trigger when action ends
990
+ * searchEmbed.on(EmbedEvent.Save, payload => {
991
+ * console.log('Save', payload)
992
+ * })
993
+ *```
808
994
  */
809
995
  EmbedEvent["Save"] = "save";
810
996
  /**
811
997
  * Emitted when the download action is triggered on an answer
812
998
  *
999
+ * **Note**: This event is deprecated in v1.21.0.
1000
+ * To fire an event when a download action is initiated on a chart or table,
1001
+ * use `EmbedEvent.DownloadAsPng`, `EmbedEvent.DownloadAsPDF`, `EmbedEvent.DownloadAsCSV`,
1002
+ * or `EmbedEvent.DownloadAsXLSX`
1003
+ *
813
1004
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1005
+ *
1006
+ * @example
1007
+ *```js
1008
+ * liveboardEmbed.trigger(HostEvent.Download, {
1009
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
1010
+ * })
1011
+ *```
814
1012
  */
815
1013
  EmbedEvent["Download"] = "download";
816
1014
  /**
817
1015
  * Emitted when the download action is triggered on an answer
818
- *
819
1016
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.0.sw
1017
+ *
1018
+ * @example
1019
+ *```js
1020
+ * //trigger when action starts
1021
+ * searchEmbed.on(EmbedEvent.DownloadAsPng, payload => {
1022
+ * console.log('download PNG', payload)}, {start: true })
1023
+ * //trigger when action ends
1024
+ * searchEmbed.on(EmbedEvent.DownloadAsPng, payload => {
1025
+ * console.log('download PNG', payload)})
1026
+ *```
1027
+ *
820
1028
  */
821
1029
  EmbedEvent["DownloadAsPng"] = "downloadAsPng";
822
1030
  /**
823
1031
  * Emitted when the Download as PDF action is triggered on an answer
824
1032
  *
825
1033
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1034
+ *
1035
+ * @example
1036
+ *```js
1037
+ * //trigger when action starts
1038
+ * searchEmbed.on(EmbedEvent.DownloadAsPdf, payload => {
1039
+ * console.log('download PDF', payload)}, {start: true })
1040
+ * //trigger when action ends
1041
+ * searchEmbed.on(EmbedEvent.DownloadAsPdf, payload => {
1042
+ * console.log('download PDF', payload)})
1043
+ *```
1044
+ *
826
1045
  */
827
1046
  EmbedEvent["DownloadAsPdf"] = "downloadAsPdf";
828
1047
  /**
829
1048
  * Emitted when the Download as CSV action is triggered on an answer
830
1049
  *
831
1050
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1051
+ * @example
1052
+ *```js
1053
+ * //trigger when action starts
1054
+ * searchEmbed.on(EmbedEvent.DownloadAsCSV, payload => {
1055
+ * console.log('download CSV', payload)}, {start: true })
1056
+ * //trigger when action ends
1057
+ * searchEmbed.on(EmbedEvent.DownloadAsCSV, payload => {
1058
+ * console.log('download CSV', payload)})
1059
+ *```
832
1060
  */
833
1061
  EmbedEvent["DownloadAsCsv"] = "downloadAsCsv";
834
1062
  /**
835
1063
  * Emitted when the Download as XLSX action is triggered on an answer
836
1064
  *
837
1065
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1066
+ *
1067
+ * @example
1068
+ *```js
1069
+ * //trigger when action starts
1070
+ * searchEmbed.on(EmbedEvent.DownloadAsXlsx, payload => {
1071
+ * console.log('download Xlsx', payload)}, { start: true })
1072
+ * //trigger when action ends
1073
+ * searchEmbed.on(EmbedEvent.DownloadAsXlsx, payload => {
1074
+ * console.log('download Xlsx', payload)})
1075
+ *```
838
1076
  */
839
1077
  EmbedEvent["DownloadAsXlsx"] = "downloadAsXlsx";
840
1078
  /**
841
- * Emitted when an answer is deleted in the app
1079
+ * Emitted when an Answer is deleted in the app
842
1080
  *
843
1081
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1082
+ *
1083
+ * @example
1084
+ *```js
1085
+ * //trigger when action starts
1086
+ * appEmbed.on(EmbedEvent.AnswerDelete, payload => {
1087
+ * console.log('delete answer', payload)}, {start: true })
1088
+ * //trigger when action is completed
1089
+ * appEmbed.on(EmbedEvent.AnswerDelete, payload => {
1090
+ * console.log('delete answer', payload)})
1091
+ *```
844
1092
  */
845
1093
  EmbedEvent["AnswerDelete"] = "answerDelete";
846
1094
  /**
847
1095
  * Emitted when an answer is pinned to a Liveboard
848
1096
  *
849
1097
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1098
+ * @example
1099
+ *```js
1100
+ * //trigger when action starts
1101
+ * searchEmbed.on(EmbedEvent.Pin, payload => {
1102
+ * console.log('pin', payload)
1103
+ * }, {
1104
+ * start: true
1105
+ * })
1106
+ * //trigger when action ends
1107
+ * searchEmbed.on(EmbedEvent.Pin, payload => {
1108
+ * console.log('pin', payload)
1109
+ * })
1110
+ *```
850
1111
  */
851
1112
  EmbedEvent["Pin"] = "pin";
852
1113
  /**
853
1114
  * Emitted when SpotIQ analysis is triggered
854
1115
  *
855
1116
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1117
+ * @example
1118
+ *```js
1119
+ * //trigger when action starts
1120
+ * searchEmbed.on(EmbedEvent.SpotIQAnalyze, payload => {
1121
+ * console.log('SpotIQAnalyze', payload)
1122
+ * }, {
1123
+ * start: true
1124
+ * })
1125
+ * //trigger when action ends
1126
+ * searchEmbed.on(EmbedEvent.SpotIQAnalyze, payload => {
1127
+ * console.log('SpotIQ analyze', payload)
1128
+ * })
1129
+ *```
856
1130
  */
857
1131
  EmbedEvent["SpotIQAnalyze"] = "spotIQAnalyze";
858
1132
  /**
859
1133
  * Emitted when a user shares an object with another user or group
860
1134
  *
861
1135
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1136
+ *
1137
+ * @example
1138
+ *```js
1139
+ * //trigger when action starts
1140
+ * searchEmbed.on(EmbedEvent.Share, payload => {
1141
+ * console.log('Share', payload)
1142
+ * }, {
1143
+ * start: true
1144
+ * })
1145
+ * //trigger when action ends
1146
+ * searchEmbed.on(EmbedEvent.Share, payload => {
1147
+ * console.log('Share', payload)
1148
+ * })
1149
+ *```
862
1150
  */
863
1151
  EmbedEvent["Share"] = "share";
864
1152
  /**
865
- * Emitted when a user clicks the Include action to include a specific value or data
866
- * on a chart or table
1153
+ * Emitted when a user clicks the **Include** action to include a specific value or
1154
+ * data on a chart or table.
867
1155
  *
868
1156
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1157
+ * @example
1158
+ *```js
1159
+ * appEmbed.on(EmbedEvent.DrillInclude, payload => {
1160
+ * console.log('Drill include', payload);
1161
+ * })
1162
+ *```
869
1163
  */
870
1164
  EmbedEvent["DrillInclude"] = "context-menu-item-include";
871
1165
  /**
872
- * Emitted when a user clicks the Exclude action to exclude a specific value or data
873
- * on a chart or table
1166
+ * Emitted when a user clicks the **Exclude** action to exclude a specific value or
1167
+ * data on a chart or table
874
1168
  *
875
1169
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1170
+ * @example
1171
+ *```js
1172
+ * appEmbed.on(EmbedEvent.DrillExclude, payload => {
1173
+ * console.log('Drill exclude', payload);
1174
+ * })
1175
+ *```
876
1176
  */
877
1177
  EmbedEvent["DrillExclude"] = "context-menu-item-exclude";
878
1178
  /**
879
- * Emitted when copied column value on the app
1179
+ * Emitted when a column value is copied in the embedded app.
880
1180
  *
881
1181
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1182
+ * @example
1183
+ *```js
1184
+ * seachEmbed.on(EmbedEvent.CopyToClipboard, payload => {
1185
+ * console.log('copy to clipboard', payload);
1186
+ * })
1187
+ *```
882
1188
  */
883
1189
  EmbedEvent["CopyToClipboard"] = "context-menu-item-copy-to-clipboard";
884
1190
  /**
885
- * Emitted when a user clicks the Update TML action
1191
+ * Emitted when a user clicks the **Update TML** action
886
1192
  *
887
1193
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1194
+ * @example
1195
+ *```js
1196
+ * liveboardEmbed.on(EmbedEvent.UpdateTML)
1197
+ * })
1198
+ *```
888
1199
  */
889
1200
  EmbedEvent["UpdateTML"] = "updateTSL";
890
1201
  /**
891
- * Emitted when a user clicks the Edit TML action
1202
+ * Emitted when a user clicks the **Edit TML** action
892
1203
  *
893
1204
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1205
+ * @example
1206
+ *```js
1207
+ * appEmbed.on(EmbedEvent.EditTML, payload => {
1208
+ * console.log('Edit TML', payload);
1209
+ * })
1210
+ *```
894
1211
  */
895
1212
  EmbedEvent["EditTML"] = "editTSL";
896
1213
  /**
897
- * Emitted when ExportTML trigger in answer on the app
898
- *
1214
+ * Emitted when the **Export TML** action is triggered on an
1215
+ * an embedded object in the app
899
1216
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1217
+ * @example
1218
+ *```js
1219
+ * //trigger when action starts
1220
+ * searchEmbed.on(EmbedEvent.ExportTML, payload => {
1221
+ * console.log('Export TML', payload)}, { start: true })
1222
+ * //trigger when action ends
1223
+ * searchEmbed.on(EmbedEvent.ExportTML, payload => {
1224
+ * console.log('Export TML', payload)})
1225
+ *```
900
1226
  */
901
1227
  EmbedEvent["ExportTML"] = "exportTSL";
902
1228
  /**
903
- * Emitted when an answer is saved as a view
1229
+ * Emitted when an Answer is saved as a View.
904
1230
  *
905
1231
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1232
+ * @example
1233
+ *```js
1234
+ * appEmbed.on(EmbedEvent.SaveAsView, payload => {
1235
+ * console.log('View', payload);
1236
+ * })
1237
+ *```
906
1238
  */
907
1239
  EmbedEvent["SaveAsView"] = "saveAsView";
908
1240
  /**
909
- * Emitted when copy of existing answer on the app
1241
+ * Emitted when the user creates a copy of an Answer
910
1242
  *
911
1243
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1244
+ * @example
1245
+ *```js
1246
+ * //trigger when action starts
1247
+ * appEmbed.on(EmbedEvent.CopyAEdit, payload => {
1248
+ * console.log('Copy and edit', payload)}, {start: true })
1249
+ * //trigger when action ends
1250
+ * appEmbed.on(EmbedEvent.CopyAEdit, payload => {
1251
+ * console.log('Copy and edit', payload)})
1252
+ *```
912
1253
  */
913
1254
  EmbedEvent["CopyAEdit"] = "copyAEdit";
914
1255
  /**
915
- * Emitted when a user clicks Show underlying data on an answe
1256
+ * Emitted when a user clicks Show underlying data on an Answer
916
1257
  *
917
1258
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1259
+ * @example
1260
+ *```js
1261
+ * liveboardEmbed.on(EmbedEvent.ShowUnderlyingData, payload => {
1262
+ * console.log('show data', payload);
1263
+ * })
1264
+ *```
918
1265
  */
919
1266
  EmbedEvent["ShowUnderlyingData"] = "showUnderlyingData";
920
1267
  /**
921
- * Emitted when an answer is switched to a chart or table view
1268
+ * Emitted when an answer is switched to a chart or table view.
922
1269
  *
923
1270
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1271
+ * @example
1272
+ *```js
1273
+ * searchEmbed.on(EmbedEvent.AnswerChartSwitcher, payload => {
1274
+ * console.log('switch view', payload);
1275
+ * })
1276
+ *```
924
1277
  */
925
1278
  EmbedEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
926
1279
  /**
927
- * Internal event to communicate the initial settings back to the TS APP
1280
+ * Internal event to communicate the initial settings back to the ThoughtSpot app
928
1281
  *
929
1282
  * @hidden
930
1283
  */
931
1284
  EmbedEvent["APP_INIT"] = "appInit";
932
1285
  /**
933
- * Emitted when a user clicks Show Liveboard details on a Liveboard
1286
+ * Emitted when a user clicks **Show Liveboard details** on a Liveboard
934
1287
  *
935
1288
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1289
+ * @example
1290
+ *```js
1291
+ * liveboardEmbed.on(EmbedEvent.AnswerChartSwitcher, payload => {
1292
+ * console.log('Liveboard details', payload);
1293
+ * })
1294
+ *```
936
1295
  */
937
1296
  EmbedEvent["LiveboardInfo"] = "pinboardInfo";
938
1297
  /**
939
1298
  * Emitted when a user clicks on the Favorite icon on a Liveboard
940
1299
  *
941
1300
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1301
+ * @example
1302
+ *```js
1303
+ * liveboardEmbed.on(EmbedEvent.AddToFavorites, payload => {
1304
+ * console.log('favorites', payload);
1305
+ * })
1306
+ *```
942
1307
  */
943
1308
  EmbedEvent["AddToFavorites"] = "addToFavorites";
944
1309
  /**
945
- * Emitted when a user clicks Schedule on a Liveboard
1310
+ * Emitted when a user clicks **Schedule** on a Liveboard
946
1311
  *
947
1312
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1313
+ * @example
1314
+ *```js
1315
+ * liveboardEmbed.on(EmbedEvent.Schedule, payload => {
1316
+ * console.log(`Liveboard schedule', payload);
1317
+ * })
1318
+ *```
948
1319
  */
949
1320
  EmbedEvent["Schedule"] = "subscription";
950
1321
  /**
951
- * Emitted when a user clicks Edit on a Liveboard or visualization
1322
+ * Emitted when a user clicks **Edit** on a Liveboard or visualization
952
1323
  *
953
1324
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1325
+ * @example
1326
+ *```js
1327
+ * liveboardEmbed.on(EmbedEvent.Edit, payload => {
1328
+ * console.log(`Liveboard edit', payload);
1329
+ * })
1330
+ *```
954
1331
  */
955
1332
  EmbedEvent["Edit"] = "edit";
956
1333
  /**
957
- * Emitted when a user clicks Make a copy on a Liveboard
1334
+ * Emitted when a user clicks *Make a copy* on a Liveboard
958
1335
  *
959
1336
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1337
+ * @example
1338
+ *```js
1339
+ * liveboardEmbed.on(EmbedEvent.MakeACopy, payload => {
1340
+ * console.log(`Copy', payload);
1341
+ * })
1342
+ *```
960
1343
  */
961
1344
  EmbedEvent["MakeACopy"] = "makeACopy";
962
1345
  /**
963
- * Emitted when a user clicks Present on a Liveboard or visualization
1346
+ * Emitted when a user clicks **Present** on a Liveboard or visualization
964
1347
  *
965
1348
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1349
+ * @example
1350
+ *```js
1351
+ * liveboardEmbed.trigger(HostEvent.Present)
1352
+ *```
1353
+ *
1354
+ * @example
1355
+ *```js
1356
+ * liveboardEmbed.on(EmbedEvent.Present, {
1357
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1358
+ * })
1359
+ *```
966
1360
  */
967
1361
  EmbedEvent["Present"] = "present";
968
1362
  /**
969
- * Emitted when a user clicks Delete on a Liveboard
1363
+ * Emitted when a user clicks **Delete** on a visualization
970
1364
  *
971
1365
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1366
+ * @example
1367
+ *```js
1368
+ * liveboardEmbed.trigger(HostEvent.Delete,
1369
+ * {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1370
+ *```
1371
+ *
972
1372
  */
973
1373
  EmbedEvent["Delete"] = "delete";
974
1374
  /**
975
1375
  * Emitted when a user clicks Manage schedules on a Liveboard
976
1376
  *
977
1377
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1378
+ *
1379
+ * @example
1380
+ *```js
1381
+ * liveboardEmbed.trigger(HostEvent.SchedulesList)
1382
+ *```
1383
+ *
978
1384
  */
979
1385
  EmbedEvent["SchedulesList"] = "schedule-list";
980
1386
  /**
981
- * Emitted when a user clicks Cancel in edit mode on a Liveboard
1387
+ * Emitted when a user clicks **Cancel** in edit mode on a Liveboard
982
1388
  *
983
1389
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1390
+ *
1391
+ * @example
1392
+ *```js
1393
+ * liveboardEmbed.trigger(HostEvent.Cancel)
1394
+ *```
1395
+ *
984
1396
  */
985
1397
  EmbedEvent["Cancel"] = "cancel";
986
1398
  /**
987
- * Emitted when a user clicks Explore on a visualization
1399
+ * Emitted when a user clicks **Explore** on a visualization
988
1400
  *
989
1401
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1402
+ *
1403
+ * @example
1404
+ *```js
1405
+ * liveboardEmbed.trigger(HostEvent.Explore, {
1406
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1407
+ *```
1408
+ *
990
1409
  */
991
1410
  EmbedEvent["Explore"] = "explore";
992
1411
  /**
993
- * Emitted when a user clicks Copy link action on a visualization
1412
+ * Emitted when a user clicks **Copy link** action on a visualization
994
1413
  *
995
1414
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1415
+ *
1416
+ * @example
1417
+ *```js
1418
+ * liveboardEmbed.trigger(HostEvent.CopyLink, {
1419
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1420
+ *```
1421
+ *
996
1422
  */
997
1423
  EmbedEvent["CopyLink"] = "embedDocument";
998
1424
  /**
999
- * Emitted when a user interacts with cross filters on a visualization or liveboard
1425
+ * Emitted when a user interacts with cross filters on a visualization or Liveboard
1426
+ *
1427
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.0.sw
1428
+ *
1429
+ * @example
1430
+ *```js
1431
+ * liveboardEmbed.trigger(HostEvent.CrossFilterChanged, {
1432
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1433
+ *```
1000
1434
  *
1001
- * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
1002
1435
  */
1003
1436
  EmbedEvent["CrossFilterChanged"] = "cross-filter-changed";
1004
1437
  /**
1005
1438
  * Emitted when a user right clicks on a visualization (chart or table)
1006
1439
  *
1007
- * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
1440
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.0.sw
1441
+ *
1442
+ * @example
1443
+ *```js
1444
+ * LiveboardEmbed.on(EmbedEvent.VizPointRightClick, payload => {
1445
+ * console.log('VizPointClick', payload)
1446
+ * })
1447
+ *```
1008
1448
  */
1009
1449
  EmbedEvent["VizPointRightClick"] = "vizPointRightClick";
1010
1450
  /**
1011
- * Emitted when a user clicks on Insert to slide on a visualization
1451
+ * Emitted when a user clicks **Insert to slide** on a visualization
1012
1452
  *
1013
1453
  * @hidden
1014
1454
  */
@@ -1016,52 +1456,53 @@ var EmbedEvent;
1016
1456
  /**
1017
1457
  * @hidden
1018
1458
  * Emitted when a user changes any filter on a Liveboard.
1019
- * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
1459
+ * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl, 9.5.0.sw
1020
1460
  */
1021
1461
  EmbedEvent["FilterChanged"] = "filterChanged";
1022
1462
  /**
1023
- * Emitted when a user click on Go button in Sage Embed
1463
+ * Emitted when a user clicks the **Go** button on the Search page
1024
1464
  *
1025
- * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
1465
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
1026
1466
  */
1027
1467
  EmbedEvent["SageEmbedQuery"] = "sageEmbedQuery";
1028
1468
  /**
1029
- * Emitten when a user select data source in Sage Embed
1469
+ * Emitted when a user selects a data source.
1470
+ *
1471
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
1030
1472
  *
1031
- * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
1032
1473
  */
1033
1474
  EmbedEvent["SageWorksheetUpdated"] = "sageWorksheetUpdated";
1034
1475
  /**
1035
- * Emitted when a user updates a connection in Data tab
1476
+ * Emitted when a user updates a connection on the **Data** page
1036
1477
  *
1037
- * @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl
1478
+ * @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl, 9.8.0.sw
1038
1479
  */
1039
1480
  EmbedEvent["UpdateConnection"] = "updateConnection";
1040
1481
  /**
1041
- * Emitted when a user updates a connection in Data tab
1482
+ * Emitted when a user updates a connection on the **Data** page
1042
1483
  *
1043
- * @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl
1484
+ * @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl, 9.8.0.sw
1044
1485
  */
1045
1486
  EmbedEvent["CreateConnection"] = "createConnection";
1046
1487
  /**
1047
1488
  * Emitted when name, status (private or public) or filter values of a
1048
- * PersonalisedView is updated.
1489
+ * Personalised view is updated.
1049
1490
  *
1050
1491
  * @returns viewName: string
1051
1492
  * @returns viewId: string
1052
1493
  * @returns liveboardId: string
1053
1494
  * @returns isPublic: boolean
1054
- * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
1495
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
1055
1496
  */
1056
1497
  EmbedEvent["UpdatePersonalisedView"] = "updatePersonalisedView";
1057
1498
  /**
1058
- * Emitted when a PersonalisedView is saved.
1499
+ * Emitted when a Personalised view is saved.
1059
1500
  *
1060
1501
  * @returns viewName: string
1061
1502
  * @returns viewId: string
1062
1503
  * @returns liveboardId: string
1063
1504
  * @returns isPublic: boolean
1064
- * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
1505
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
1065
1506
  */
1066
1507
  EmbedEvent["SavePersonalisedView"] = "savePersonalisedView";
1067
1508
  /**
@@ -1071,7 +1512,7 @@ var EmbedEvent;
1071
1512
  * @returns viewId: string
1072
1513
  * @returns liveboardId: string
1073
1514
  * @returns isPublic: boolean
1074
- * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
1515
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
1075
1516
  */
1076
1517
  EmbedEvent["ResetLiveboard"] = "resetLiveboard";
1077
1518
  /**
@@ -1079,11 +1520,11 @@ var EmbedEvent;
1079
1520
  *
1080
1521
  * @returns views: string[]
1081
1522
  * @returns liveboardId: string
1082
- * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
1523
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
1083
1524
  */
1084
1525
  EmbedEvent["DeletePersonalisedView"] = "deletePersonalisedView";
1085
1526
  /**
1086
- * Emitten when a user creates a new worksheet
1527
+ * Emitted when a user creates a new worksheet
1087
1528
  *
1088
1529
  * @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl
1089
1530
  */
@@ -1115,15 +1556,16 @@ var EmbedEvent;
1115
1556
  var HostEvent;
1116
1557
  (function (HostEvent) {
1117
1558
  /**
1118
- * Triggers a search query in AppEmbed and SearchEmbed
1119
- * deployments.
1559
+ * Triggers a search operation with the search tokens specified in
1560
+ * the search query string.
1561
+ * Supported in `AppEmbed` and `SearchEmbed` deployments.
1120
1562
  * Includes the following properties:
1121
1563
  *
1122
- * @param - dataSourceIds - The data source GUID to Search on
1564
+ * @param - `searchQuery` - query string with search tokens
1565
+ * @param - `dataSources` - Data source GUID to Search on
1123
1566
  * - Although an array, only a single source
1124
1567
  * is supported.
1125
- * @param - searchQuery - Query string with search tokens
1126
- * @param - execute - executes the existing / updated query
1568
+ * @param - `execute` - executes search and updates the existing query
1127
1569
  * @example
1128
1570
  * ```js
1129
1571
  * searchembed.trigger(HostEvent.Search, {
@@ -1143,6 +1585,10 @@ var HostEvent;
1143
1585
  * @param - columnGuid - Optional. GUID of the column to drill
1144
1586
  * by. If not provided it will auto drill by the configured
1145
1587
  * column.
1588
+ * @param - autoDrillDown - Optional. If true, the drill down will be
1589
+ * done automatically on the most popular column.
1590
+ * @param - vizId [TS >= 9.8.0] - Optional. The GUID of the visualization to drill
1591
+ * in case of a liveboard.
1146
1592
  * @example
1147
1593
  * ```js
1148
1594
  * searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
@@ -1159,6 +1605,25 @@ var HostEvent;
1159
1605
  * });
1160
1606
  * })
1161
1607
  * ```
1608
+ * @example
1609
+ * ```js
1610
+ * // Works with TS 9.8.0 and above
1611
+ *
1612
+ * liveboardEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
1613
+ * console.log(payload);
1614
+ * const clickedPoint = payload.data.clickedPoint;
1615
+ * const selectedPoint = payload.data.selectedPoints;
1616
+ * console.log('>>> called', clickedPoint);
1617
+ * liveboardEmbed.trigger(HostEvent.DrillDown, {
1618
+ * points: {
1619
+ * clickedPoint,
1620
+ * selectedPoints: selectedPoint
1621
+ * },
1622
+ * autoDrillDown: true,
1623
+ * vizId: payload.data.vizId
1624
+ * });
1625
+ * })
1626
+ * ```
1162
1627
  * @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
1163
1628
  */
1164
1629
  HostEvent["DrillDown"] = "triggerDrillDown";
@@ -1175,7 +1640,7 @@ var HostEvent;
1175
1640
  */
1176
1641
  HostEvent["Reload"] = "reload";
1177
1642
  /**
1178
- * Sets the visible visualizations on a Liveboard.
1643
+ * Display specific visualizations on a Liveboard.
1179
1644
  *
1180
1645
  * @param - An array of GUIDs of the visualization to show. The visualization IDs not passed
1181
1646
  * in this parameter will be hidden.
@@ -1189,7 +1654,7 @@ var HostEvent;
1189
1654
  */
1190
1655
  HostEvent["SetVisibleVizs"] = "SetPinboardVisibleVizs";
1191
1656
  /**
1192
- * Set the Active Tab of a Liveboard.
1657
+ * Set a Liveboard tab as an active tab.
1193
1658
  *
1194
1659
  * @param - tabId - string of id of Tab to show
1195
1660
  * @example
@@ -1202,7 +1667,7 @@ var HostEvent;
1202
1667
  */
1203
1668
  HostEvent["SetActiveTab"] = "SetActiveTab";
1204
1669
  /**
1205
- * Updates runtime filters applied on a Saved Answer or Liveboard. The
1670
+ * Update runtime filters applied on a Saved Answer or Liveboard. The
1206
1671
  * runtime filters passed here are appended to the existing runtime
1207
1672
  * filters.
1208
1673
  * Pass an array of runtime filters with the following attributes:
@@ -1228,10 +1693,12 @@ var HostEvent;
1228
1693
  */
1229
1694
  HostEvent["UpdateRuntimeFilters"] = "UpdateRuntimeFilters";
1230
1695
  /**
1231
- * Navigate to a specific page in the embedded application without reloading the page.
1696
+ * Navigate to a specific page in the embedded ThoughtSpot application.
1232
1697
  * This is the same as calling `appEmbed.navigateToPage(path, true)`
1233
1698
  *
1234
- * @param - path - the path to navigate to (can be a number[1/-1] to go forward/back)
1699
+ * @param - `path` - the path to navigate to to go forward or back. The path value can
1700
+ * be a number; for example, `1`, `-1`.
1701
+ *
1235
1702
  * @example
1236
1703
  * ```js
1237
1704
  * appEmbed.navigateToPage(-1)
@@ -1240,7 +1707,7 @@ var HostEvent;
1240
1707
  */
1241
1708
  HostEvent["Navigate"] = "Navigate";
1242
1709
  /**
1243
- * Opens the filter panel for a particular column.
1710
+ * Open the filter panel for a particular column.
1244
1711
  * Works with Search and Liveboard embed.
1245
1712
  *
1246
1713
  * @param - { columnId: string,
@@ -1258,7 +1725,7 @@ var HostEvent;
1258
1725
  */
1259
1726
  HostEvent["OpenFilter"] = "openFilter";
1260
1727
  /**
1261
- * Adds columns to the current search query.
1728
+ * Add columns to the current search query.
1262
1729
  *
1263
1730
  * @param - { columnIds: string[] }
1264
1731
  * @example
@@ -1269,7 +1736,7 @@ var HostEvent;
1269
1736
  */
1270
1737
  HostEvent["AddColumns"] = "addColumns";
1271
1738
  /**
1272
- * Removes a column from the current search query.
1739
+ * Remove a column from the current search query.
1273
1740
  *
1274
1741
  * @param - { columnId: string }
1275
1742
  * @example
@@ -1280,27 +1747,29 @@ var HostEvent;
1280
1747
  */
1281
1748
  HostEvent["RemoveColumn"] = "removeColumn";
1282
1749
  /**
1283
- * Gets the current Liveboard content.
1750
+ * Get the transient state of a Liveboard as encoded content.
1751
+ * This includes unsaved and ad hoc changes such as
1752
+ * Liveboard filters, runtime filters applied on visualizations on a
1753
+ * Liveboard, and Liveboard layout, changes to visualizations such as
1754
+ * sorting, toggling of legends, and data drill down.
1284
1755
  *
1285
1756
  * @example
1286
1757
  * ```js
1287
- * liveboardEmbed.trigger(HostEvent.getExportRequestForCurrentPinboard)
1758
+ * liveboardEmbed.trigger(HostEvent.getexportrequestforcurrentpinboard).then(
1759
+ * data=>console.log(data))
1288
1760
  * ```
1289
1761
  * @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl, 8.8.1.sw
1290
1762
  */
1291
1763
  HostEvent["getExportRequestForCurrentPinboard"] = "getExportRequestForCurrentPinboard";
1292
1764
  /**
1293
- * Triggers the **Pin** action on an embedded object
1765
+ * Trigger the **Pin** action on an embedded object
1294
1766
  *
1295
1767
  * @param - Liveboard embed takes the `vizId` as a
1296
- * key. Can be left undefined when embedding Search, full app or
1768
+ * key. Can be left undefined when embedding Search, full app, or
1297
1769
  * a visualization.
1298
1770
  * @example
1299
1771
  * ```js
1300
- * liveboardEmbed.trigger(HostEvent.Pin, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1301
- * ```
1302
- * ```js
1303
- * vizEmbed.trigger(HostEvent.Pin)
1772
+ * appEmbed.trigger(HostEvent.Pin)
1304
1773
  * ```
1305
1774
  * ```js
1306
1775
  * searchEmbed.trigger(HostEvent.Pin)
@@ -1309,17 +1778,18 @@ var HostEvent;
1309
1778
  */
1310
1779
  HostEvent["Pin"] = "pin";
1311
1780
  /**
1312
- * Triggers the **Show Liveboard details** action on a Liveboard
1781
+ * Trigger the **Show Liveboard details** action
1782
+ * on an embedded Liveboard.
1313
1783
  *
1314
1784
  * @example
1315
- * ```js
1316
- * liveboardEmbed.trigger(HostEvent.LiveboardInfo)
1317
- * ```
1785
+ *```js
1786
+ * liveboardEmbed.trigger(HostEvent.LiveboardInfo)
1787
+ *```
1318
1788
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1319
1789
  */
1320
1790
  HostEvent["LiveboardInfo"] = "pinboardInfo";
1321
1791
  /**
1322
- * Triggers the **Schedule** action on a Liveboard
1792
+ * Trigger the **Schedule** action on an embedded Liveboard.
1323
1793
  *
1324
1794
  * @example
1325
1795
  * ```js
@@ -1329,7 +1799,7 @@ var HostEvent;
1329
1799
  */
1330
1800
  HostEvent["Schedule"] = "subscription";
1331
1801
  /**
1332
- * Triggers the **Manage schedule** action on a Liveboard
1802
+ * Trigger the **Manage schedule** action on an embedded Liveboard
1333
1803
  *
1334
1804
  * @example
1335
1805
  * ```js
@@ -1339,7 +1809,7 @@ var HostEvent;
1339
1809
  */
1340
1810
  HostEvent["SchedulesList"] = "schedule-list";
1341
1811
  /**
1342
- * Triggers the **Export TML** action on a Liveboard
1812
+ * Trigger the **Export TML** action on an embedded Liveboard.
1343
1813
  *
1344
1814
  * @example
1345
1815
  * ```js
@@ -1349,7 +1819,7 @@ var HostEvent;
1349
1819
  */
1350
1820
  HostEvent["ExportTML"] = "exportTSL";
1351
1821
  /**
1352
- * Triggers the **Edit TML** action on a Liveboard
1822
+ * Trigger the **Edit TML** action on an embedded Liveboard.
1353
1823
  *
1354
1824
  * @example
1355
1825
  * ```js
@@ -1359,7 +1829,7 @@ var HostEvent;
1359
1829
  */
1360
1830
  HostEvent["EditTML"] = "editTSL";
1361
1831
  /**
1362
- * Triggers the **Update TML** action on a Liveboard
1832
+ * Trigger the **Update TML** action on an embedded Liveboard.
1363
1833
  *
1364
1834
  * @example
1365
1835
  * ```js
@@ -1369,7 +1839,7 @@ var HostEvent;
1369
1839
  */
1370
1840
  HostEvent["UpdateTML"] = "updateTSL";
1371
1841
  /**
1372
- * Triggers the **Download PDF** action on a Liveboard
1842
+ * Trigger the **Download PDF** action on an embedded Liveboard.
1373
1843
  *
1374
1844
  * @example
1375
1845
  * ```js
@@ -1379,8 +1849,8 @@ var HostEvent;
1379
1849
  */
1380
1850
  HostEvent["DownloadAsPdf"] = "downloadAsPdf";
1381
1851
  /**
1382
- * Triggers the **Make a copy** action on a Liveboard, Search, or
1383
- * visualization page
1852
+ * Trigger the **Make a copy** action on a Liveboard, Search, or
1853
+ * visualization page.
1384
1854
  *
1385
1855
  * @example
1386
1856
  * ```js
@@ -1396,7 +1866,7 @@ var HostEvent;
1396
1866
  */
1397
1867
  HostEvent["MakeACopy"] = "makeACopy";
1398
1868
  /**
1399
- * Triggers the **Delete** action on a Liveboard
1869
+ * Trigger the **Delete** action for a Liveboard.
1400
1870
  *
1401
1871
  * @example
1402
1872
  * ```js
@@ -1406,7 +1876,7 @@ var HostEvent;
1406
1876
  */
1407
1877
  HostEvent["Remove"] = "delete";
1408
1878
  /**
1409
- * Triggers the **Explore* action on a visualization
1879
+ * Trigger the **Explore** action on a visualization.
1410
1880
  *
1411
1881
  * @param - an object with `vizId` as a key
1412
1882
  * @example
@@ -1417,7 +1887,7 @@ var HostEvent;
1417
1887
  */
1418
1888
  HostEvent["Explore"] = "explore";
1419
1889
  /**
1420
- * Triggers the **Create alert** action on a visualization
1890
+ * Trigger the **Create alert** action on a visualization
1421
1891
  *
1422
1892
  * @param - an object with `vizId` as a key
1423
1893
  * @example
@@ -1430,7 +1900,7 @@ var HostEvent;
1430
1900
  */
1431
1901
  HostEvent["CreateMonitor"] = "createMonitor";
1432
1902
  /**
1433
- * Triggers the **Manage alerts** action on a visualization
1903
+ * Trigger the **Manage alerts** action on a visualization
1434
1904
  *
1435
1905
  * @param - an object with `vizId` as a key
1436
1906
  * @example
@@ -1443,7 +1913,7 @@ var HostEvent;
1443
1913
  */
1444
1914
  HostEvent["ManageMonitor"] = "manageMonitor";
1445
1915
  /**
1446
- * Triggers the **Edit** action on a Liveboard or visualization
1916
+ * Trigger the **Edit** action on a Liveboard or visualization
1447
1917
  *
1448
1918
  * @param - object - To trigger the action for a specific visualization
1449
1919
  * in Liveboard embed, pass in `vizId` as a key.
@@ -1464,7 +1934,7 @@ var HostEvent;
1464
1934
  */
1465
1935
  HostEvent["Edit"] = "edit";
1466
1936
  /**
1467
- * Triggers the **Copy link** action on a Liveboard or visualization
1937
+ * Trigger the **Copy link** action on a Liveboard or visualization
1468
1938
  *
1469
1939
  * @param - object - to trigger the action for a
1470
1940
  * specific visualization in Liveboard embed, pass in `vizId` as a key
@@ -1482,7 +1952,7 @@ var HostEvent;
1482
1952
  */
1483
1953
  HostEvent["CopyLink"] = "embedDocument";
1484
1954
  /**
1485
- * Triggers the **Present** action on a Liveboard or visualization
1955
+ * Trigger the **Present** action on a Liveboard or visualization
1486
1956
  *
1487
1957
  * @param - object - to trigger the action for a specific visualization
1488
1958
  * in Liveboard embed, pass in `vizId` as a key
@@ -1500,7 +1970,7 @@ var HostEvent;
1500
1970
  */
1501
1971
  HostEvent["Present"] = "present";
1502
1972
  /**
1503
- * Gets TML for the current search.
1973
+ * Get TML for the current search.
1504
1974
  *
1505
1975
  * @example
1506
1976
  * ```js
@@ -1515,7 +1985,7 @@ var HostEvent;
1515
1985
  */
1516
1986
  HostEvent["GetTML"] = "getTML";
1517
1987
  /**
1518
- * Triggers the **Show underlying data** action on visualization or search
1988
+ * Trigger the **Show underlying data** action on visualization or search
1519
1989
  *
1520
1990
  * @param - an object with vizId as a key
1521
1991
  * @example
@@ -1533,7 +2003,9 @@ var HostEvent;
1533
2003
  */
1534
2004
  HostEvent["ShowUnderlyingData"] = "showUnderlyingData";
1535
2005
  /**
1536
- * Triggers the **Delete** action on visualization or search
2006
+ * Trigger the **Delete** action for a visualization
2007
+ * in an embedded Liveboard, or a chart or table
2008
+ * generated from Search.
1537
2009
  *
1538
2010
  * @param - Liveboard embed takes an object with `vizId` as a key.
1539
2011
  * Can be left empty if embedding Search or visualization.
@@ -1543,16 +2015,13 @@ var HostEvent;
1543
2015
  * '730496d6-6903-4601-937e-2c691821af3c'})
1544
2016
  * ```
1545
2017
  * ```js
1546
- * vizEmbed.trigger(HostEvent.Delete)
1547
- * ```
1548
- * ```js
1549
2018
  * searchEmbed.trigger(HostEvent.Delete)
1550
2019
  * ```
1551
2020
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
1552
2021
  */
1553
2022
  HostEvent["Delete"] = "onDeleteAnswer";
1554
2023
  /**
1555
- * Triggers the **SpotIQ analyze** action on visualization
2024
+ * Trigger the **SpotIQ analyze** action on visualization
1556
2025
  * or search.
1557
2026
  *
1558
2027
  * @param - Liveboard embed takes `vizId` as a
@@ -1573,7 +2042,7 @@ var HostEvent;
1573
2042
  */
1574
2043
  HostEvent["SpotIQAnalyze"] = "spotIQAnalyze";
1575
2044
  /**
1576
- * Triggers the **Download** action on charts in
2045
+ * Trigger the **Download** action on charts in
1577
2046
  * the embedded view.
1578
2047
  *
1579
2048
  * @example
@@ -1582,17 +2051,15 @@ var HostEvent;
1582
2051
  * '730496d6-6903-4601-937e-2c691821af3c'})
1583
2052
  * ```
1584
2053
  * ```js
1585
- * vizEmbed.trigger(HostEvent.Download)
1586
- * ```
1587
- * ```js
1588
- * searchEmbed.trigger(HostEvent.Download)
2054
+ * embed.trigger(HostEvent.Download)
1589
2055
  * ```
1590
- * @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw ,Use {@link DownloadAsPng}
2056
+ * @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw
2057
+ * Use {@link DownloadAsPng}
1591
2058
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
1592
2059
  */
1593
2060
  HostEvent["Download"] = "downloadAsPng";
1594
2061
  /**
1595
- * Triggers the **Download** > **PNG** action on
2062
+ * Trigger the **Download** > **PNG** action on
1596
2063
  * charts in the embedded view.
1597
2064
  *
1598
2065
  * @example
@@ -1608,7 +2075,7 @@ var HostEvent;
1608
2075
  */
1609
2076
  HostEvent["DownloadAsPng"] = "downloadAsPng";
1610
2077
  /**
1611
- * Triggers the **Download** > **CSV** action on tables in
2078
+ * Trigger the **Download** > **CSV** action on tables in
1612
2079
  * the embedded view.
1613
2080
  *
1614
2081
  * @example
@@ -1626,7 +2093,7 @@ var HostEvent;
1626
2093
  */
1627
2094
  HostEvent["DownloadAsCsv"] = "downloadAsCSV";
1628
2095
  /**
1629
- * Triggers the **Download** > **XLSX** action on tables
2096
+ * Trigger the **Download** > **XLSX** action on tables
1630
2097
  * in the embedded view.
1631
2098
  *
1632
2099
  * @example
@@ -1644,7 +2111,7 @@ var HostEvent;
1644
2111
  */
1645
2112
  HostEvent["DownloadAsXlsx"] = "downloadAsXLSX";
1646
2113
  /**
1647
- * Triggers the **Share** action on an embedded
2114
+ * Trigger the **Share** action on an embedded
1648
2115
  * Liveboard or Answer.
1649
2116
  *
1650
2117
  * @example
@@ -1658,7 +2125,7 @@ var HostEvent;
1658
2125
  */
1659
2126
  HostEvent["Share"] = "share";
1660
2127
  /**
1661
- * Triggers the **Save** action on a Liveboard or Answer.
2128
+ * Trigger the **Save** action on a Liveboard or Answer.
1662
2129
  * Saves the changes.
1663
2130
  *
1664
2131
  * @example
@@ -1672,7 +2139,7 @@ var HostEvent;
1672
2139
  */
1673
2140
  HostEvent["Save"] = "save";
1674
2141
  /**
1675
- * Triggers the **Sync to Sheets** action on an embedded visualization or Answer
2142
+ * Trigger the **Sync to Sheets** action on an embedded visualization or Answer
1676
2143
  * Sends data from an Answer or Liveboard visualization to a Google sheet.
1677
2144
  *
1678
2145
  * @param - an object with `vizId` as a key
@@ -1688,7 +2155,7 @@ var HostEvent;
1688
2155
  */
1689
2156
  HostEvent["SyncToSheets"] = "sync-to-sheets";
1690
2157
  /**
1691
- * Triggers the **Sync to Other Apps** action on an embedded visualization or Answer
2158
+ * Trigger the **Sync to Other Apps** action on an embedded visualization or Answer
1692
2159
  * Sends data from an Answer or Liveboard visualization to third-party apps such
1693
2160
  * as Slack, Salesforce, Microsoft Teams, ServiceNow and so on.
1694
2161
  *
@@ -1705,7 +2172,7 @@ var HostEvent;
1705
2172
  */
1706
2173
  HostEvent["SyncToOtherApps"] = "sync-to-other-apps";
1707
2174
  /**
1708
- * Triggers the **Manage pipelines** action on an embedded
2175
+ * Trigger the **Manage pipelines** action on an embedded
1709
2176
  * visualization or Answer.
1710
2177
  * Allows users to manage ThoughtSpot Sync pipelines.
1711
2178
  *
@@ -1722,18 +2189,21 @@ var HostEvent;
1722
2189
  */
1723
2190
  HostEvent["ManagePipelines"] = "manage-pipeline";
1724
2191
  /**
1725
- * Triggers the Reset search on the Search page
2192
+ * Reset search operation on the Search or Answer page.
1726
2193
  *
1727
2194
  * @example
1728
2195
  * ```js
1729
2196
  * searchEmbed.trigger(HostEvent.ResetSearch)
1730
2197
  * ```
2198
+ * ```js
2199
+ * appEmbed.trigger(HostEvent.ResetSearch)
2200
+ * ```
1731
2201
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.0.1.sw
1732
2202
  */
1733
2203
  HostEvent["ResetSearch"] = "resetSearch";
1734
2204
  /**
1735
2205
  * @hidden
1736
- * Gets the currents visible and runtime filters applied on a Liveboard
2206
+ * Get the currents visible and runtime filters applied on a Liveboard
1737
2207
  * @example
1738
2208
  * liveboardEmbed.trigger(HostEvent.GetFilters)
1739
2209
  * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
@@ -1741,7 +2211,7 @@ var HostEvent;
1741
2211
  HostEvent["GetFilters"] = "getFilters";
1742
2212
  /**
1743
2213
  * @hidden
1744
- * Updates the visible filters on the Liveboard.
2214
+ * Update the visible filters on the Liveboard.
1745
2215
  * @param - filter: filter object containing column name and filter operation and values
1746
2216
  * @example
1747
2217
  *
@@ -1754,7 +2224,7 @@ var HostEvent;
1754
2224
  */
1755
2225
  HostEvent["UpdateFilters"] = "updateFilters";
1756
2226
  /**
1757
- * Get Tab for the current Liveboard.
2227
+ * Get tab details for the current Liveboard.
1758
2228
  *
1759
2229
  * @example
1760
2230
  * ```js
@@ -1768,9 +2238,9 @@ var HostEvent;
1768
2238
  */
1769
2239
  HostEvent["GetTabs"] = "getTabs";
1770
2240
  /**
1771
- * Set the visible Tabs on a Liveboard.
2241
+ * Set the visible tabs on a Liveboard.
1772
2242
  *
1773
- * @param - an array of ids of Tabs to show, the ids not passed
2243
+ * @param - an array of ids of tabs to show, the IDs not passed
1774
2244
  * will be hidden.
1775
2245
  * @example
1776
2246
  * ```js
@@ -1784,8 +2254,8 @@ var HostEvent;
1784
2254
  /**
1785
2255
  * Set the hidden tabs on a Liveboard.
1786
2256
  *
1787
- * @param - an array of ids of Tabs to hide, the ids not passed
1788
- * will be shown.
2257
+ * @param - an array of the IDs of the tabs to hide.
2258
+ * The IDs not passed will be shown.
1789
2259
  * @example
1790
2260
  * ```js
1791
2261
  * liveboardEmbed.trigger(HostEvent.SetHiddenTabs, [
@@ -1796,9 +2266,12 @@ var HostEvent;
1796
2266
  */
1797
2267
  HostEvent["SetHiddenTabs"] = "SetPinboardHiddenTabs";
1798
2268
  /**
1799
- * Updates the search query for sage embed.
2269
+ * Updates the search query string for Natural Language Search operations.
2270
+ *
2271
+ * @param - `queryString`: Text string in Natural Language format
2272
+ *
2273
+ * @param - `executeSearch`: Boolean to execute search and update search query
1800
2274
  *
1801
- * @param - searchOptions: an object queryString and option to execute the query.
1802
2275
  * @example
1803
2276
  * ```js
1804
2277
  * sageEmbed.trigger(HostEvent.UpdateSageQuery, {
@@ -1806,7 +2279,7 @@ var HostEvent;
1806
2279
  * executeSearch: true,
1807
2280
  * })
1808
2281
  * ```
1809
- * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
2282
+ * @version SDK: 1.26.0 | Thoughtspot: 9.8.0.cl, 9.8.0.sw
1810
2283
  */
1811
2284
  HostEvent["UpdateSageQuery"] = "updateSageQuery";
1812
2285
  /**
@@ -1819,26 +2292,27 @@ var HostEvent;
1819
2292
  * vizId: '123', // For Liveboard Visualization.
1820
2293
  * })
1821
2294
  * ```
2295
+ * @version SDK: 1.26.0 | Thoughtspot: 9.10.0.cl
1822
2296
  */
1823
2297
  HostEvent["GetAnswerSession"] = "getAnswerSession";
1824
2298
  })(HostEvent || (HostEvent = {}));
1825
2299
  /**
1826
2300
  * The different visual modes that the data sources panel within
1827
- * search could appear in, i.e., hidden, collapsed, or expanded.
2301
+ * search could appear in, such as hidden, collapsed, or expanded.
1828
2302
  */
1829
2303
  // eslint-disable-next-line no-shadow
1830
2304
  var DataSourceVisualMode;
1831
2305
  (function (DataSourceVisualMode) {
1832
2306
  /**
1833
- * Data source panel is hidden.
2307
+ * The data source panel is hidden.
1834
2308
  */
1835
2309
  DataSourceVisualMode["Hidden"] = "hide";
1836
2310
  /**
1837
- * Data source panel is collapsed, but the user can manually expand it.
2311
+ * The data source panel is collapsed, but the user can manually expand it.
1838
2312
  */
1839
2313
  DataSourceVisualMode["Collapsed"] = "collapse";
1840
2314
  /**
1841
- * Data source panel is expanded, but the user can manually collapse it.
2315
+ * The data source panel is expanded, but the user can manually collapse it.
1842
2316
  */
1843
2317
  DataSourceVisualMode["Expanded"] = "expand";
1844
2318
  })(DataSourceVisualMode || (DataSourceVisualMode = {}));
@@ -1918,6 +2392,7 @@ var Param;
1918
2392
  Param["IsProductTour"] = "isProductTour";
1919
2393
  Param["HideSearchBarTitle"] = "hideSearchBarTitle";
1920
2394
  Param["HideSageAnswerHeader"] = "hideSageAnswerHeader";
2395
+ Param["HideSearchBar"] = "hideSearchBar";
1921
2396
  })(Param || (Param = {}));
1922
2397
  /**
1923
2398
  * ThoughtSpot application pages include actions and menu commands
@@ -1979,9 +2454,11 @@ var Action;
1979
2454
  Action["SaveAsView"] = "saveAsView";
1980
2455
  /**
1981
2456
  * The **Make a copy** action on a Liveboard or Answer
1982
- * page.
1983
- * Creates a copy of the Liveboard, visualization,
1984
- * or Answer.
2457
+ * page. Creates a copy of the Liveboard.
2458
+ * In LiveboardEmbed, the **Make a copy** action is not available for
2459
+ * visualizations in the embedded Liveboard view.
2460
+ * In AppEmbed, the **Make a copy** action is available on both
2461
+ * Liveboards and visualizations.
1985
2462
  *
1986
2463
  * @example
1987
2464
  * ```js
@@ -2165,7 +2642,7 @@ var Action;
2165
2642
  */
2166
2643
  Action["DownloadAsPdf"] = "downloadAsPdf";
2167
2644
  /**
2168
- * The **Download** > **CSV** menu action for tables on a Liveboard
2645
+ * The **Download** > **CSV** menu action for tables on a Liveboard
2169
2646
  * or Answer page.
2170
2647
  * Downloads a visualization or Answer in the XLSX format.
2171
2648
  *
@@ -2696,6 +3173,7 @@ var Action;
2696
3173
  */
2697
3174
  Action["RenameModalTitleDescription"] = "renameModalTitleDescription";
2698
3175
  /**
3176
+ *
2699
3177
  * @version SDK: 1.25.0 | Thoughtspot: 9.6.0.cl
2700
3178
  */
2701
3179
  Action["RequestVerification"] = "requestVerification";
@@ -4998,6 +5476,201 @@ function isEqual(value, other) {
4998
5476
 
4999
5477
  var isEqual_1 = isEqual;
5000
5478
 
5479
+ const EndPoints = {
5480
+ AUTH_VERIFICATION: '/callosum/v1/session/info',
5481
+ SAML_LOGIN_TEMPLATE: (targetUrl) => `/callosum/v1/saml/login?targetURLPath=${targetUrl}`,
5482
+ OIDC_LOGIN_TEMPLATE: (targetUrl) => `/callosum/v1/oidc/login?targetURLPath=${targetUrl}`,
5483
+ TOKEN_LOGIN: '/callosum/v1/session/login/token',
5484
+ BASIC_LOGIN: '/callosum/v1/session/login',
5485
+ LOGOUT: '/callosum/v1/session/logout',
5486
+ EXECUTE_TML: '/api/rest/2.0/metadata/tml/import',
5487
+ EXPORT_TML: '/api/rest/2.0/metadata/tml/export',
5488
+ IS_ACTIVE: '/callosum/v1/session/isactive',
5489
+ };
5490
+ /**
5491
+ *
5492
+ * @param url
5493
+ * @param options
5494
+ */
5495
+ function failureLoggedFetch(url, options = {}) {
5496
+ return fetch(url, options).then(async (r) => {
5497
+ var _a;
5498
+ if (!r.ok && r.type !== 'opaqueredirect' && r.type !== 'opaque') {
5499
+ console.error('Failure', await ((_a = r.text) === null || _a === void 0 ? void 0 : _a.call(r)));
5500
+ }
5501
+ return r;
5502
+ });
5503
+ }
5504
+ /**
5505
+ * Service to validate a auth token against a ThoughtSpot host.
5506
+ *
5507
+ * @param thoughtSpotHost : ThoughtSpot host to verify the token against.
5508
+ * @param authToken : Auth token to verify.
5509
+ */
5510
+ async function verifyTokenService(thoughtSpotHost, authToken) {
5511
+ const authVerificationUrl = `${thoughtSpotHost}${EndPoints.IS_ACTIVE}`;
5512
+ try {
5513
+ const res = await fetch(authVerificationUrl, {
5514
+ headers: {
5515
+ Authorization: `Bearer ${authToken}`,
5516
+ 'x-requested-by': 'ThoughtSpot',
5517
+ },
5518
+ credentials: 'omit',
5519
+ });
5520
+ return res.ok;
5521
+ }
5522
+ catch (e) {
5523
+ console.error(`Token Verification Service failed : ${e.message}`);
5524
+ }
5525
+ return false;
5526
+ }
5527
+ /**
5528
+ *
5529
+ * @param authEndpoint
5530
+ */
5531
+ async function fetchAuthTokenService(authEndpoint) {
5532
+ return fetch(authEndpoint);
5533
+ }
5534
+ /**
5535
+ *
5536
+ * @param thoughtSpotHost
5537
+ * @param username
5538
+ * @param authToken
5539
+ */
5540
+ async function fetchAuthService(thoughtSpotHost, username, authToken) {
5541
+ return failureLoggedFetch(`${thoughtSpotHost}${EndPoints.TOKEN_LOGIN}?username=${username}&auth_token=${authToken}`, {
5542
+ credentials: 'include',
5543
+ // We do not want to follow the redirect, as it starts giving a CORS
5544
+ // error
5545
+ redirect: 'manual',
5546
+ });
5547
+ }
5548
+ /**
5549
+ *
5550
+ * @param thoughtSpotHost
5551
+ * @param username
5552
+ * @param authToken
5553
+ */
5554
+ async function fetchAuthPostService(thoughtSpotHost, username, authToken) {
5555
+ return failureLoggedFetch(`${thoughtSpotHost}${EndPoints.TOKEN_LOGIN}`, {
5556
+ method: 'POST',
5557
+ headers: {
5558
+ 'content-type': 'application/x-www-form-urlencoded',
5559
+ 'x-requested-by': 'ThoughtSpot',
5560
+ },
5561
+ body: `username=${encodeURIComponent(username)}&auth_token=${encodeURIComponent(authToken)}`,
5562
+ credentials: 'include',
5563
+ // We do not want to follow the redirect, as it starts giving a CORS
5564
+ // error
5565
+ redirect: 'manual',
5566
+ });
5567
+ }
5568
+ /**
5569
+ *
5570
+ * @param thoughtSpotHost
5571
+ * @param username
5572
+ * @param password
5573
+ */
5574
+ async function fetchBasicAuthService(thoughtSpotHost, username, password) {
5575
+ return failureLoggedFetch(`${thoughtSpotHost}${EndPoints.BASIC_LOGIN}`, {
5576
+ method: 'POST',
5577
+ headers: {
5578
+ 'content-type': 'application/x-www-form-urlencoded',
5579
+ 'x-requested-by': 'ThoughtSpot',
5580
+ },
5581
+ body: `username=${encodeURIComponent(username)}&password=${encodeURIComponent(password)}`,
5582
+ credentials: 'include',
5583
+ });
5584
+ }
5585
+
5586
+ const DUPLICATE_TOKEN_ERR = 'Duplicate token, please issue a new token every time getAuthToken callback is called.'
5587
+ + 'See https://developers.thoughtspot.com/docs/?pageid=embed-auth#trusted-auth-embed for more details.';
5588
+ const INVALID_TOKEN_ERR = 'Invalid token received form token callback or authToken endpoint.';
5589
+ let cachedAuthToken = null;
5590
+ // This method can be used to get the authToken using the embedConfig
5591
+ const getAuthenticationToken = async (embedConfig) => {
5592
+ if (cachedAuthToken) {
5593
+ let isCachedTokenStillValid;
5594
+ try {
5595
+ isCachedTokenStillValid = await validateAuthToken(embedConfig, cachedAuthToken, true);
5596
+ }
5597
+ catch {
5598
+ isCachedTokenStillValid = false;
5599
+ }
5600
+ if (isCachedTokenStillValid)
5601
+ return cachedAuthToken;
5602
+ }
5603
+ const { authEndpoint, getAuthToken } = embedConfig;
5604
+ let authToken = null;
5605
+ if (getAuthToken) {
5606
+ authToken = await getAuthToken();
5607
+ }
5608
+ else {
5609
+ const response = await fetchAuthTokenService(authEndpoint);
5610
+ authToken = await response.text();
5611
+ }
5612
+ // this will throw error if the token is not valid
5613
+ await validateAuthToken(embedConfig, authToken);
5614
+ cachedAuthToken = authToken;
5615
+ return authToken;
5616
+ };
5617
+ const validateAuthToken = async (embedConfig, authToken, suppressAlert) => {
5618
+ try {
5619
+ const isTokenValid = await verifyTokenService(embedConfig.thoughtSpotHost, authToken);
5620
+ if (isTokenValid)
5621
+ return true;
5622
+ }
5623
+ catch {
5624
+ return false;
5625
+ }
5626
+ if (cachedAuthToken && cachedAuthToken === authToken) {
5627
+ if (!embedConfig.suppressErrorAlerts && !suppressAlert) {
5628
+ // eslint-disable-next-line no-alert
5629
+ alert(DUPLICATE_TOKEN_ERR);
5630
+ }
5631
+ throw new Error(DUPLICATE_TOKEN_ERR);
5632
+ }
5633
+ else {
5634
+ throw new Error(INVALID_TOKEN_ERR);
5635
+ }
5636
+ };
5637
+ const resetCachedAuthToken = () => {
5638
+ cachedAuthToken = null;
5639
+ };
5640
+
5641
+ let config = {};
5642
+ /**
5643
+ * Gets the configuration embed was initialized with.
5644
+ *
5645
+ * @returns {@link EmbedConfig} The configuration embed was initialized with.
5646
+ * @version SDK: 1.19.0 | ThoughtSpot: *
5647
+ * @group Global methods
5648
+ */
5649
+ const getEmbedConfig = () => config;
5650
+ /**
5651
+ * Sets the configuration embed was initialized with.
5652
+ *
5653
+ * @param newConfig The configuration to set.
5654
+ * @version SDK: 1.27.0 | ThoughtSpot: *
5655
+ * @group Global methods
5656
+ */
5657
+ const setEmbedConfig = (newConfig) => {
5658
+ config = newConfig;
5659
+ };
5660
+
5661
+ const tokenizedFetch = async (input, init) => {
5662
+ const embedConfig = getEmbedConfig();
5663
+ if (embedConfig.authType !== AuthType.TrustedAuthTokenCookieless) {
5664
+ return fetch(input, init);
5665
+ }
5666
+ const req = new Request(input, init);
5667
+ const authToken = await getAuthenticationToken(embedConfig);
5668
+ if (authToken) {
5669
+ req.headers.append('Authorization', `Bearer ${authToken}`);
5670
+ }
5671
+ return fetch(req);
5672
+ };
5673
+
5001
5674
  /**
5002
5675
  *
5003
5676
  * @param root0
@@ -5197,8 +5870,7 @@ var OperationType;
5197
5870
  * const data = await underlying.fetchData(0, 100);
5198
5871
  * })
5199
5872
  * ```
5200
- * @version
5201
- * ThoughtSpot: 9.9.0.cl / SDK: 1.25.0
5873
+ * @version SDK: 1.25.0| ThoughtSpot: 9.10.0.cl
5202
5874
  * @group Events
5203
5875
  */
5204
5876
  class AnswerService {
@@ -5246,7 +5918,7 @@ class AnswerService {
5246
5918
  */
5247
5919
  async fetchCSVBlob(userLocale = 'en-us', includeInfo = false) {
5248
5920
  const fetchUrl = this.getFetchCSVBlobUrl(userLocale, includeInfo);
5249
- return fetch(fetchUrl, {
5921
+ return tokenizedFetch(fetchUrl, {
5250
5922
  credentials: 'include',
5251
5923
  });
5252
5924
  }
@@ -5267,8 +5939,7 @@ class AnswerService {
5267
5939
  * const data = await underlying.fetchData(0, 100);
5268
5940
  * })
5269
5941
  * ```
5270
- * @version
5271
- * ThoughtSpot: 9.9.0.cl / SDK: 1.25.0
5942
+ * @version SDK: 1.25.0| ThoughtSpot: 9.10.0.cl
5272
5943
  */
5273
5944
  async getUnderlyingDataForPoint(outputColumnNames, selectedPoints) {
5274
5945
  if (!selectedPoints && !this.selectedPoints) {
@@ -12090,14 +12761,13 @@ function uniq(array) {
12090
12761
 
12091
12762
  var uniq_1 = uniq;
12092
12763
 
12093
- // eslint-disable-next-line import/no-cycle
12094
12764
  /**
12095
12765
  *
12096
12766
  * @param url
12097
12767
  * @param options
12098
12768
  */
12099
- function failureLoggedFetch(url, options = {}) {
12100
- return fetch(url, options).then(async (r) => {
12769
+ function tokenisedFailureLoggedFetch(url, options = {}) {
12770
+ return tokenizedFetch(url, options).then(async (r) => {
12101
12771
  var _a;
12102
12772
  if (!r.ok && r.type !== 'opaqueredirect' && r.type !== 'opaque') {
12103
12773
  console.error('Failure', await ((_a = r.text) === null || _a === void 0 ? void 0 : _a.call(r)));
@@ -12110,81 +12780,7 @@ function failureLoggedFetch(url, options = {}) {
12110
12780
  * @param authVerificationUrl
12111
12781
  */
12112
12782
  function fetchSessionInfoService(authVerificationUrl) {
12113
- return failureLoggedFetch(authVerificationUrl, {
12114
- credentials: 'include',
12115
- });
12116
- }
12117
- /**
12118
- * Service to validate a auth token against a ThoughtSpot host.
12119
- *
12120
- * @param thoughtSpotHost : ThoughtSpot host to verify the token against.
12121
- * @param authToken : Auth token to verify.
12122
- */
12123
- function verifyTokenService(thoughtSpotHost, authToken) {
12124
- const authVerificationUrl = `${thoughtSpotHost}${EndPoints.IS_ACTIVE}`;
12125
- return fetch(authVerificationUrl, {
12126
- headers: {
12127
- Authorization: `Bearer ${authToken}`,
12128
- 'x-requested-by': 'ThoughtSpot',
12129
- },
12130
- credentials: 'omit',
12131
- });
12132
- }
12133
- /**
12134
- *
12135
- * @param authEndpoint
12136
- */
12137
- async function fetchAuthTokenService(authEndpoint) {
12138
- return fetch(authEndpoint);
12139
- }
12140
- /**
12141
- *
12142
- * @param thoughtSpotHost
12143
- * @param username
12144
- * @param authToken
12145
- */
12146
- async function fetchAuthService(thoughtSpotHost, username, authToken) {
12147
- return failureLoggedFetch(`${thoughtSpotHost}${EndPoints.TOKEN_LOGIN}?username=${username}&auth_token=${authToken}`, {
12148
- credentials: 'include',
12149
- // We do not want to follow the redirect, as it starts giving a CORS
12150
- // error
12151
- redirect: 'manual',
12152
- });
12153
- }
12154
- /**
12155
- *
12156
- * @param thoughtSpotHost
12157
- * @param username
12158
- * @param authToken
12159
- */
12160
- async function fetchAuthPostService(thoughtSpotHost, username, authToken) {
12161
- return failureLoggedFetch(`${thoughtSpotHost}${EndPoints.TOKEN_LOGIN}`, {
12162
- method: 'POST',
12163
- headers: {
12164
- 'content-type': 'application/x-www-form-urlencoded',
12165
- 'x-requested-by': 'ThoughtSpot',
12166
- },
12167
- body: `username=${encodeURIComponent(username)}&auth_token=${encodeURIComponent(authToken)}`,
12168
- credentials: 'include',
12169
- // We do not want to follow the redirect, as it starts giving a CORS
12170
- // error
12171
- redirect: 'manual',
12172
- });
12173
- }
12174
- /**
12175
- *
12176
- * @param thoughtSpotHost
12177
- * @param username
12178
- * @param password
12179
- */
12180
- async function fetchBasicAuthService(thoughtSpotHost, username, password) {
12181
- return failureLoggedFetch(`${thoughtSpotHost}${EndPoints.BASIC_LOGIN}`, {
12182
- method: 'POST',
12183
- headers: {
12184
- 'content-type': 'application/x-www-form-urlencoded',
12185
- 'x-requested-by': 'ThoughtSpot',
12186
- },
12187
- body: `username=${encodeURIComponent(username)}&password=${encodeURIComponent(password)}`,
12783
+ return tokenisedFailureLoggedFetch(authVerificationUrl, {
12188
12784
  credentials: 'include',
12189
12785
  });
12190
12786
  }
@@ -12193,7 +12789,7 @@ async function fetchBasicAuthService(thoughtSpotHost, username, password) {
12193
12789
  * @param thoughtSpotHost
12194
12790
  */
12195
12791
  async function fetchLogoutService(thoughtSpotHost) {
12196
- return failureLoggedFetch(`${thoughtSpotHost}${EndPoints.LOGOUT}`, {
12792
+ return tokenisedFailureLoggedFetch(`${thoughtSpotHost}${EndPoints.LOGOUT}`, {
12197
12793
  credentials: 'include',
12198
12794
  method: 'POST',
12199
12795
  headers: {
@@ -12215,17 +12811,6 @@ const sessionInfoPromise = new Promise((resolve) => {
12215
12811
  });
12216
12812
  let releaseVersion = '';
12217
12813
  const SSO_REDIRECTION_MARKER_GUID = '5e16222e-ef02-43e9-9fbd-24226bf3ce5b';
12218
- const EndPoints = {
12219
- AUTH_VERIFICATION: '/callosum/v1/session/info',
12220
- SAML_LOGIN_TEMPLATE: (targetUrl) => `/callosum/v1/saml/login?targetURLPath=${targetUrl}`,
12221
- OIDC_LOGIN_TEMPLATE: (targetUrl) => `/callosum/v1/oidc/login?targetURLPath=${targetUrl}`,
12222
- TOKEN_LOGIN: '/callosum/v1/session/login/token',
12223
- BASIC_LOGIN: '/callosum/v1/session/login',
12224
- LOGOUT: '/callosum/v1/session/logout',
12225
- EXECUTE_TML: '/api/rest/2.0/metadata/tml/import',
12226
- EXPORT_TML: '/api/rest/2.0/metadata/tml/export',
12227
- IS_ACTIVE: '/callosum/v1/session/isactive',
12228
- };
12229
12814
  /**
12230
12815
  * Enum for auth failure types. This is the parameter passed to the listner
12231
12816
  * of {@link AuthStatus.FAILURE}.
@@ -12263,8 +12848,8 @@ var AuthStatus;
12263
12848
  */
12264
12849
  AuthStatus["LOGOUT"] = "LOGOUT";
12265
12850
  /**
12266
- * Emitted when inPopup: true in the SAMLRedirect flow.
12267
- * And, we are waiting for popup to be triggered either programatically
12851
+ * Emitted when inPopup is true in the SAMLRedirect flow and the
12852
+ * popup is waiting to be triggered either programmatically
12268
12853
  * or by the trigger button.
12269
12854
  *
12270
12855
  * @version SDK: 1.19.0
@@ -12279,8 +12864,8 @@ var AuthStatus;
12279
12864
  var AuthEvent;
12280
12865
  (function (AuthEvent) {
12281
12866
  /**
12282
- * Manually trigger the SSO popup. This is useful with
12283
- * authStatus: SAMLRedirect/OIDCRedicre and inPopup: true
12867
+ * Manually trigger the SSO popup. This is useful when
12868
+ * authStatus is SAMLRedirect/OIDCRedirect and inPopup is set to true
12284
12869
  */
12285
12870
  AuthEvent["TRIGGER_SSO_POPUP"] = "TRIGGER_SSO_POPUP";
12286
12871
  })(AuthEvent || (AuthEvent = {}));
@@ -12392,21 +12977,6 @@ function getReleaseVersion() {
12392
12977
  function getSessionInfo() {
12393
12978
  return sessionInfoPromise;
12394
12979
  }
12395
- const DUPLICATE_TOKEN_ERR = 'Duplicate token, please issue a new token every time getAuthToken callback is called.'
12396
- + 'See https://developers.thoughtspot.com/docs/?pageid=embed-auth#trusted-auth-embed for more details.';
12397
- let prevAuthToken = null;
12398
- /**
12399
- *
12400
- * @param authtoken
12401
- */
12402
- function alertForDuplicateToken(authtoken) {
12403
- if (prevAuthToken === authtoken) {
12404
- // eslint-disable-next-line no-alert
12405
- alert(DUPLICATE_TOKEN_ERR);
12406
- throw new Error(DUPLICATE_TOKEN_ERR);
12407
- }
12408
- prevAuthToken = authtoken;
12409
- }
12410
12980
  /**
12411
12981
  * Check if we are stuck at the SSO redirect URL
12412
12982
  */
@@ -12424,19 +12994,6 @@ function removeSSORedirectUrlMarker() {
12424
12994
  // that creates an issue.
12425
12995
  window.location.hash = window.location.hash.replace(SSO_REDIRECTION_MARKER_GUID, '');
12426
12996
  }
12427
- const getAuthenticationToken = async (embedConfig) => {
12428
- const { authEndpoint, getAuthToken } = embedConfig;
12429
- let authToken = null;
12430
- if (getAuthToken) {
12431
- authToken = await getAuthToken();
12432
- alertForDuplicateToken(authToken);
12433
- }
12434
- else {
12435
- const response = await fetchAuthTokenService(authEndpoint);
12436
- authToken = await response.text();
12437
- }
12438
- return authToken;
12439
- };
12440
12997
  /**
12441
12998
  * Perform token based authentication
12442
12999
  *
@@ -12477,16 +13034,17 @@ const doCookielessTokenAuth = async (embedConfig) => {
12477
13034
  if (!authEndpoint && !getAuthToken) {
12478
13035
  throw new Error('Either auth endpoint or getAuthToken function must be provided');
12479
13036
  }
13037
+ let authSuccess = false;
12480
13038
  try {
12481
13039
  const authToken = await getAuthenticationToken(embedConfig);
12482
- const response = await verifyTokenService(embedConfig.thoughtSpotHost, authToken);
12483
- if (!response.ok)
12484
- return false;
13040
+ if (authToken) {
13041
+ authSuccess = true;
13042
+ }
12485
13043
  }
12486
- catch (e) {
12487
- return false;
13044
+ catch {
13045
+ authSuccess = false;
12488
13046
  }
12489
- return true;
13047
+ return authSuccess;
12490
13048
  };
12491
13049
  /**
12492
13050
  * Perform basic authentication to the ThoughtSpot cluster using the cluster
@@ -12604,7 +13162,14 @@ const doOIDCAuth = async (embedConfig) => {
12604
13162
  };
12605
13163
  const logout = async (embedConfig) => {
12606
13164
  const { thoughtSpotHost } = embedConfig;
12607
- const response = await fetchLogoutService(thoughtSpotHost);
13165
+ await fetchLogoutService(thoughtSpotHost);
13166
+ resetCachedAuthToken();
13167
+ const thoughtspotIframes = document.querySelectorAll('[data-ts-iframe=\'true\']');
13168
+ if (thoughtspotIframes === null || thoughtspotIframes === void 0 ? void 0 : thoughtspotIframes.length) {
13169
+ thoughtspotIframes.forEach((el) => {
13170
+ el.parentElement.innerHTML = embedConfig.loginFailedMessage;
13171
+ });
13172
+ }
12608
13173
  loggedInStatus = false;
12609
13174
  return loggedInStatus;
12610
13175
  };
@@ -12636,27 +13201,18 @@ const authenticate = async (embedConfig) => {
12636
13201
  };
12637
13202
 
12638
13203
  /* eslint-disable camelcase */
12639
- let config = {};
12640
13204
  const CONFIG_DEFAULTS = {
12641
13205
  loginFailedMessage: 'Not logged in',
12642
13206
  authTriggerText: 'Authorize',
12643
13207
  authType: AuthType.None,
12644
13208
  };
12645
13209
  let authPromise;
12646
- /**
12647
- * Gets the configuration embed was initialized with.
12648
- *
12649
- * @returns {@link EmbedConfig} The configuration embed was initialized with.
12650
- * @version SDK: 1.19.0 | ThoughtSpot: *
12651
- * @group Global methods
12652
- */
12653
- const getEmbedConfig = () => config;
12654
13210
  const getAuthPromise = () => authPromise;
12655
13211
  /**
12656
13212
  * Perform authentication on the ThoughtSpot app as applicable.
12657
13213
  */
12658
13214
  const handleAuth = () => {
12659
- authPromise = authenticate(config);
13215
+ authPromise = authenticate(getEmbedConfig());
12660
13216
  authPromise.then((isLoggedIn) => {
12661
13217
  if (!isLoggedIn) {
12662
13218
  notifyAuthFailure(AuthFailureType.SDK);
@@ -12692,7 +13248,7 @@ const prefetch = (url, prefetchFeatures) => {
12692
13248
  }
12693
13249
  else {
12694
13250
  const features = prefetchFeatures || [PrefetchFeatures.FullApp];
12695
- let hostUrl = url || config.thoughtSpotHost;
13251
+ let hostUrl = url || getEmbedConfig().thoughtSpotHost;
12696
13252
  hostUrl = hostUrl[hostUrl.length - 1] === '/' ? hostUrl : `${hostUrl}/`;
12697
13253
  uniq_1(features.map((feature) => hostUrlToFeatureUrl[feature](hostUrl))).forEach((prefetchUrl, index) => {
12698
13254
  const iFrame = document.createElement('iframe');
@@ -12758,16 +13314,15 @@ function backwardCompat(embedConfig) {
12758
13314
  const init = (embedConfig) => {
12759
13315
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
12760
13316
  sanity(embedConfig);
12761
- config = {
13317
+ setEmbedConfig(backwardCompat({
12762
13318
  ...CONFIG_DEFAULTS,
12763
13319
  ...embedConfig,
12764
13320
  thoughtSpotHost: getThoughtSpotHost(embedConfig),
12765
- };
12766
- config = backwardCompat(config);
13321
+ }));
12767
13322
  const authEE = new eventemitter3();
12768
13323
  setAuthEE(authEE);
12769
13324
  handleAuth();
12770
- const { password, ...configToTrack } = config;
13325
+ const { password, ...configToTrack } = getEmbedConfig();
12771
13326
  uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_CALLED_INIT, {
12772
13327
  ...configToTrack,
12773
13328
  usedCustomizationSheet: ((_b = (_a = embedConfig.customizations) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.customCSSUrl) != null,
@@ -12776,8 +13331,8 @@ const init = (embedConfig) => {
12776
13331
  usedCustomizationStrings: !!((_k = (_j = embedConfig.customizations) === null || _j === void 0 ? void 0 : _j.content) === null || _k === void 0 ? void 0 : _k.strings),
12777
13332
  usedCustomizationIconSprite: !!((_l = embedConfig.customizations) === null || _l === void 0 ? void 0 : _l.iconSpriteUrl),
12778
13333
  });
12779
- if (config.callPrefetch) {
12780
- prefetch(config.thoughtSpotHost);
13334
+ if (getEmbedConfig().callPrefetch) {
13335
+ prefetch(getEmbedConfig().thoughtSpotHost);
12781
13336
  }
12782
13337
  return authEE;
12783
13338
  };
@@ -12785,7 +13340,7 @@ const init = (embedConfig) => {
12785
13340
  *
12786
13341
  */
12787
13342
  function disableAutoLogin() {
12788
- config.autoLogin = false;
13343
+ getEmbedConfig().autoLogin = false;
12789
13344
  }
12790
13345
  /**
12791
13346
  * Logs out from ThoughtSpot. This also sets the autoLogin flag to false, to
@@ -12803,7 +13358,7 @@ const logout$1 = (doNotDisableAutoLogin = false) => {
12803
13358
  if (!doNotDisableAutoLogin) {
12804
13359
  disableAutoLogin();
12805
13360
  }
12806
- return logout(config).then((isLoggedIn) => {
13361
+ return logout(getEmbedConfig()).then((isLoggedIn) => {
12807
13362
  notifyLogout();
12808
13363
  return isLoggedIn;
12809
13364
  });
@@ -12816,7 +13371,7 @@ let renderQueue = Promise.resolve();
12816
13371
  * @param fn The function being registered
12817
13372
  */
12818
13373
  const renderInQueue = (fn) => {
12819
- const { queueMultiRenders = false } = config;
13374
+ const { queueMultiRenders = false } = getEmbedConfig();
12820
13375
  if (queueMultiRenders) {
12821
13376
  renderQueue = renderQueue.then(() => new Promise((res) => fn(res)));
12822
13377
  return renderQueue;
@@ -12848,30 +13403,23 @@ const renderInQueue = (fn) => {
12848
13403
  * @group Global methods
12849
13404
  */
12850
13405
  const executeTML = async (data) => {
12851
- const { thoughtSpotHost, authType } = config;
12852
13406
  try {
12853
- sanity(config);
13407
+ sanity(getEmbedConfig());
12854
13408
  }
12855
13409
  catch (err) {
12856
13410
  return Promise.reject(err);
12857
13411
  }
12858
- let authToken = '';
12859
- if (authType === AuthType.TrustedAuthTokenCookieless) {
12860
- authToken = await getAuthenticationToken(config);
12861
- }
13412
+ const { thoughtSpotHost, authType } = getEmbedConfig();
12862
13413
  const headers = {
12863
13414
  'Content-Type': 'application/json',
12864
13415
  'x-requested-by': 'ThoughtSpot',
12865
13416
  };
12866
- if (authToken) {
12867
- headers.Authorization = `Bearer ${authToken}`;
12868
- }
12869
13417
  const payload = {
12870
13418
  metadata_tmls: data.metadata_tmls,
12871
13419
  import_policy: data.import_policy || 'PARTIAL',
12872
13420
  create_new: data.create_new || false,
12873
13421
  };
12874
- return fetch(`${thoughtSpotHost}${EndPoints.EXECUTE_TML}`, {
13422
+ return tokenizedFetch(`${thoughtSpotHost}${EndPoints.EXECUTE_TML}`, {
12875
13423
  method: 'POST',
12876
13424
  headers,
12877
13425
  body: JSON.stringify(payload),
@@ -12914,14 +13462,13 @@ const executeTML = async (data) => {
12914
13462
  console.error(error);
12915
13463
  });
12916
13464
  * ```
12917
- *
12918
13465
  * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
12919
13466
  * @group Global methods
12920
13467
  */
12921
13468
  const exportTML = async (data) => {
12922
- const { thoughtSpotHost, authType } = config;
13469
+ const { thoughtSpotHost, authType } = getEmbedConfig();
12923
13470
  try {
12924
- sanity(config);
13471
+ sanity(getEmbedConfig());
12925
13472
  }
12926
13473
  catch (err) {
12927
13474
  return Promise.reject(err);
@@ -12932,18 +13479,11 @@ const exportTML = async (data) => {
12932
13479
  export_fqn: data.export_fqn || false,
12933
13480
  edoc_format: data.edoc_format || 'YAML',
12934
13481
  };
12935
- let authToken = '';
12936
- if (authType === AuthType.TrustedAuthTokenCookieless) {
12937
- authToken = await getAuthenticationToken(config);
12938
- }
12939
13482
  const headers = {
12940
13483
  'Content-Type': 'application/json',
12941
13484
  'x-requested-by': 'ThoughtSpot',
12942
13485
  };
12943
- if (authToken) {
12944
- headers.Authorization = `Bearer ${authToken}`;
12945
- }
12946
- return fetch(`${thoughtSpotHost}${EndPoints.EXPORT_TML}`, {
13486
+ return tokenizedFetch(`${thoughtSpotHost}${EndPoints.EXPORT_TML}`, {
12947
13487
  method: 'POST',
12948
13488
  headers,
12949
13489
  body: JSON.stringify(payload),
@@ -12996,9 +13536,9 @@ function processAuthInit(e) {
12996
13536
  * @param containerEl
12997
13537
  */
12998
13538
  function processNoCookieAccess(e, containerEl) {
12999
- const { loginFailedMessage, suppressNoCookieAccessAlert, ignoreNoCookieAccess, } = getEmbedConfig();
13539
+ const { loginFailedMessage, suppressNoCookieAccessAlert, ignoreNoCookieAccess, suppressErrorAlerts, } = getEmbedConfig();
13000
13540
  if (!ignoreNoCookieAccess) {
13001
- if (!suppressNoCookieAccessAlert) {
13541
+ if (!suppressNoCookieAccessAlert && !suppressErrorAlerts) {
13002
13542
  // eslint-disable-next-line no-alert
13003
13543
  alert('Third party cookie access is blocked on this browser, please allow third party cookies for this to work properly. \nYou can use `suppressNoCookieAccessAlert` to suppress this message.');
13004
13544
  }
@@ -13020,6 +13560,7 @@ function processAuthFailure(e, containerEl) {
13020
13560
  containerEl.innerHTML = loginFailedMessage;
13021
13561
  notifyAuthFailure(AuthFailureType.OTHER);
13022
13562
  }
13563
+ resetCachedAuthToken();
13023
13564
  return e;
13024
13565
  }
13025
13566
  /**
@@ -13031,6 +13572,7 @@ function processAuthLogout(e, containerEl) {
13031
13572
  const { loginFailedMessage } = getEmbedConfig();
13032
13573
  // eslint-disable-next-line no-param-reassign
13033
13574
  containerEl.innerHTML = loginFailedMessage;
13575
+ resetCachedAuthToken();
13034
13576
  disableAutoLogin();
13035
13577
  notifyLogout();
13036
13578
  return e;
@@ -13071,7 +13613,7 @@ const reload = (iFrame) => {
13071
13613
  }, 100);
13072
13614
  };
13073
13615
  /**
13074
- * Post Iframe message.
13616
+ * Post iframe message.
13075
13617
  *
13076
13618
  * @param iFrame
13077
13619
  * @param message
@@ -13116,7 +13658,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
13116
13658
  });
13117
13659
  }
13118
13660
 
13119
- var name="@thoughtspot/visual-embed-sdk";var version="1.26.1";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs",start:"gatsby develop","build:gatsby":"npm run clean:gatsby && gatsby build --prefix-paths","build:gatsby:noprefix":"npm run clean:gatsby && gatsby build","serve:gatsby":"gatsby serve","clean:gatsby":"gatsby clean","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw","docs-cmd":"node scripts/gatsby-commands.js",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme","test-sdk":"jest -c jest.config.sdk.js --runInBand","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",dompurify:"^2.3.4","eslint-plugin-comment-length":"^0.9.2","eslint-plugin-jsdoc":"^46.9.0",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"^2.45.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","fs-extra":"^10.0.0",gatsby:"3.13.1","gatsby-plugin-algolia":"^0.22.2","gatsby-plugin-catch-links":"^3.1.0","gatsby-plugin-env-variables":"^2.1.0","gatsby-plugin-intl":"^0.3.3","gatsby-plugin-manifest":"^3.2.0","gatsby-plugin-output":"^0.1.3","gatsby-plugin-sass":"6.7.0","gatsby-plugin-sitemap":"^4.10.0","gatsby-source-filesystem":"3.1.0","gatsby-transformer-asciidoc":"2.1.0","gatsby-transformer-rehype":"2.0.0","gh-pages":"^3.1.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"2.30.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","url-search-params-polyfill":"^8.1.0",util:"^0.12.4"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.js",limit:"43 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
13661
+ var name="@thoughtspot/visual-embed-sdk";var version="1.27.0-alpha.0";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs",start:"gatsby develop","build:gatsby":"npm run clean:gatsby && gatsby build --prefix-paths","build:gatsby:noprefix":"npm run clean:gatsby && gatsby build","serve:gatsby":"gatsby serve","clean:gatsby":"gatsby clean","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw","docs-cmd":"node scripts/gatsby-commands.js",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme","test-sdk":"jest -c jest.config.sdk.js --runInBand","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",dompurify:"^2.3.4","eslint-plugin-comment-length":"^0.9.2","eslint-plugin-jsdoc":"^46.9.0",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"^2.45.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","fs-extra":"^10.0.0",gatsby:"3.13.1","gatsby-plugin-algolia":"^0.22.2","gatsby-plugin-catch-links":"^3.1.0","gatsby-plugin-env-variables":"^2.1.0","gatsby-plugin-intl":"^0.3.3","gatsby-plugin-manifest":"^3.2.0","gatsby-plugin-output":"^0.1.3","gatsby-plugin-sass":"6.7.0","gatsby-plugin-sitemap":"^4.10.0","gatsby-source-filesystem":"3.1.0","gatsby-transformer-asciidoc":"2.1.0","gatsby-transformer-rehype":"2.0.0","gh-pages":"^3.1.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"2.30.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","url-search-params-polyfill":"^8.1.0",util:"^0.12.4"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.js",limit:"44 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
13120
13662
 
13121
13663
  /**
13122
13664
  * Copyright (c) 2022
@@ -13173,7 +13715,13 @@ class TsEmbed {
13173
13715
  var _a, _b;
13174
13716
  let authToken = '';
13175
13717
  if (this.embedConfig.authType === AuthType.TrustedAuthTokenCookieless) {
13176
- authToken = await getAuthenticationToken(this.embedConfig);
13718
+ try {
13719
+ authToken = await getAuthenticationToken(this.embedConfig);
13720
+ }
13721
+ catch (e) {
13722
+ processAuthFailure(e, this.isPreRendered ? this.preRenderWrapper : this.el);
13723
+ return;
13724
+ }
13177
13725
  }
13178
13726
  this.isAppInitialized = true;
13179
13727
  responder({
@@ -13202,11 +13750,17 @@ class TsEmbed {
13202
13750
  this.updateAuthToken = async (_, responder) => {
13203
13751
  const { autoLogin = false, authType } = this.embedConfig; // Set autoLogin default to false
13204
13752
  if (authType === AuthType.TrustedAuthTokenCookieless) {
13205
- const authToken = await getAuthenticationToken(this.embedConfig);
13206
- responder({
13207
- type: EmbedEvent.AuthExpire,
13208
- data: { authToken },
13209
- });
13753
+ let authToken = '';
13754
+ try {
13755
+ authToken = await getAuthenticationToken(this.embedConfig);
13756
+ responder({
13757
+ type: EmbedEvent.AuthExpire,
13758
+ data: { authToken },
13759
+ });
13760
+ }
13761
+ catch (e) {
13762
+ processAuthFailure(e, this.isPreRendered ? this.preRenderWrapper : this.el);
13763
+ }
13210
13764
  }
13211
13765
  else if (autoLogin) {
13212
13766
  handleAuth();
@@ -13481,7 +14035,11 @@ class TsEmbed {
13481
14035
  const queryParams = this.shouldEncodeUrlQueryParams
13482
14036
  ? `?base64UrlEncodedFlags=${getEncodedQueryParamsString(queryString)}`
13483
14037
  : `?${queryString}`;
13484
- const path = `${this.thoughtSpotHost}/${queryParams}#`;
14038
+ let host = this.thoughtSpotHost;
14039
+ if (!isUndefined(this.embedConfig.enableReactShell)) {
14040
+ host = this.embedConfig.enableReactShell ? '/v2' : '/v1';
14041
+ }
14042
+ const path = `${host}/${queryParams}#`;
13485
14043
  return path;
13486
14044
  }
13487
14045
  getEmbedParams() {
@@ -13496,6 +14054,7 @@ class TsEmbed {
13496
14054
  const iFrame = document.createElement('iframe');
13497
14055
  iFrame.src = frameSrc;
13498
14056
  iFrame.id = TS_EMBED_ID;
14057
+ iFrame.setAttribute('data-ts-iframe', 'true');
13499
14058
  // according to screenfull.js documentation
13500
14059
  // allowFullscreen, webkitallowfullscreen and mozallowfullscreen must be
13501
14060
  // true
@@ -13881,6 +14440,9 @@ class TsEmbed {
13881
14440
  this.isRendered = true;
13882
14441
  return this;
13883
14442
  }
14443
+ getIframeSrc() {
14444
+ return '';
14445
+ }
13884
14446
  handleRenderForPrerender() {
13885
14447
  this.render();
13886
14448
  }
@@ -14255,7 +14817,7 @@ class AppEmbed extends V1Embed {
14255
14817
  * @param pageId The ID of the page to be embedded.
14256
14818
  */
14257
14819
  getIFrameSrc() {
14258
- const { pageId, path, modularHomeExperience } = this.viewConfig;
14820
+ const { pageId, path, modularHomeExperience, } = this.viewConfig;
14259
14821
  const pageRoute = this.formatPath(path) || this.getPageRoute(pageId, modularHomeExperience);
14260
14822
  let url = `${this.getRootIframeSrc()}/${pageRoute}`;
14261
14823
  const tsPostHashParams = this.getThoughtSpotPostUrlParams();
@@ -14359,8 +14921,9 @@ class AppEmbed extends V1Embed {
14359
14921
  * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
14360
14922
  */
14361
14923
  /**
14362
- * Embed a ThoughtSpot Liveboard or a Thoughtspot visualization. When rendered it already
14363
- * waits for the authentication to complete, so no need to wait for AuthStatus.SUCCESS.
14924
+ * Embed a ThoughtSpot Liveboard or visualization. When rendered it already
14925
+ * waits for the authentication to complete, so you need not wait for
14926
+ * `AuthStatus.SUCCESS`.
14364
14927
  *
14365
14928
  * @example
14366
14929
  * ```js
@@ -14466,7 +15029,7 @@ class LiveboardEmbed extends V1Embed {
14466
15029
  }
14467
15030
  /**
14468
15031
  * Construct the URL of the embedded ThoughtSpot Liveboard or visualization
14469
- * to be loaded within the iframe.
15032
+ * to be loaded within the iFrame.
14470
15033
  */
14471
15034
  getIFrameSrc() {
14472
15035
  var _a;
@@ -14596,7 +15159,7 @@ class SearchEmbed extends TsEmbed {
14596
15159
  }
14597
15160
  getEmbedParams() {
14598
15161
  var _a;
14599
- const { hideResults, expandAllDataSource, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, dataPanelV2 = false, useLastSelectedSources = false, runtimeParameters, } = this.viewConfig;
15162
+ const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = false, useLastSelectedSources = false, runtimeParameters, } = this.viewConfig;
14600
15163
  const queryParams = this.getBaseQueryParams();
14601
15164
  queryParams[Param.HideActions] = [
14602
15165
  ...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
@@ -14623,6 +15186,9 @@ class SearchEmbed extends TsEmbed {
14623
15186
  if (forceTable) {
14624
15187
  queryParams[Param.ForceTable] = true;
14625
15188
  }
15189
+ if (hideSearchBar) {
15190
+ queryParams[Param.HideSearchBar] = true;
15191
+ }
14626
15192
  queryParams[Param.DataPanelV2Enabled] = dataPanelV2;
14627
15193
  queryParams[Param.DataSourceMode] = this.getDataSourceMode();
14628
15194
  queryParams[Param.UseLastSelectedDataSource] = useLastSelectedSources;
@@ -14651,7 +15217,8 @@ class SearchEmbed extends TsEmbed {
14651
15217
  * @param answerId The GUID of a saved answer
14652
15218
  * @param dataSources A list of data source GUIDs
14653
15219
  */
14654
- getIFrameSrc(answerId) {
15220
+ getIFrameSrc() {
15221
+ const { answerId } = this.viewConfig;
14655
15222
  const answerPath = answerId ? `saved-answer/${answerId}` : 'answer';
14656
15223
  const tsPostHashParams = this.getThoughtSpotPostUrlParams();
14657
15224
  return `${this.getRootIframeSrc()}/embed/${answerPath}${tsPostHashParams}`;
@@ -14662,10 +15229,11 @@ class SearchEmbed extends TsEmbed {
14662
15229
  render() {
14663
15230
  super.render();
14664
15231
  const { answerId } = this.viewConfig;
14665
- const src = this.getIFrameSrc(answerId);
15232
+ const src = this.getIFrameSrc();
14666
15233
  this.renderIFrame(src);
14667
15234
  getAuthPromise().then(() => {
14668
- if (checkReleaseVersionInBeta(getReleaseVersion(), getEmbedConfig().suppressSearchEmbedBetaWarning)) {
15235
+ if (checkReleaseVersionInBeta(getReleaseVersion(), getEmbedConfig().suppressSearchEmbedBetaWarning
15236
+ || getEmbedConfig().suppressErrorAlerts)) {
14669
15237
  alert(ERROR_MESSAGE.SEARCHEMBED_BETA_WRANING_MESSAGE);
14670
15238
  }
14671
15239
  });
@@ -14752,7 +15320,7 @@ const HiddenActionItemByDefaultForSageEmbed = [
14752
15320
  Action.Share,
14753
15321
  ];
14754
15322
  /**
14755
- * Embed ThoughtSpot LLM and GPT based natural language search component.
15323
+ * Embed ThoughtSpot LLM and GPT-based Natural Language Search component.
14756
15324
  *
14757
15325
  * @version: SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl, 9.5.1-sw
14758
15326
  * @group Embed components