@thoughtspot/visual-embed-sdk 1.26.3 → 1.27.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. package/README.md +3 -3
  2. package/cjs/.DS_Store +0 -0
  3. package/cjs/package.json +1 -1
  4. package/cjs/src/.DS_Store +0 -0
  5. package/cjs/src/auth.d.ts +4 -4
  6. package/cjs/src/auth.d.ts.map +1 -1
  7. package/cjs/src/auth.js +10 -4
  8. package/cjs/src/auth.js.map +1 -1
  9. package/cjs/src/embed/app.d.ts +15 -15
  10. package/cjs/src/embed/app.d.ts.map +1 -1
  11. package/cjs/src/embed/app.js +1 -1
  12. package/cjs/src/embed/app.js.map +1 -1
  13. package/cjs/src/embed/liveboard.d.ts +28 -23
  14. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  15. package/cjs/src/embed/liveboard.js +4 -3
  16. package/cjs/src/embed/liveboard.js.map +1 -1
  17. package/cjs/src/embed/sage.d.ts +48 -30
  18. package/cjs/src/embed/sage.d.ts.map +1 -1
  19. package/cjs/src/embed/sage.js +7 -6
  20. package/cjs/src/embed/sage.js.map +1 -1
  21. package/cjs/src/embed/sage.spec.js +3 -3
  22. package/cjs/src/embed/sage.spec.js.map +1 -1
  23. package/cjs/src/embed/search-bar.d.ts +22 -6
  24. package/cjs/src/embed/search-bar.d.ts.map +1 -1
  25. package/cjs/src/embed/search-bar.js.map +1 -1
  26. package/cjs/src/embed/search.d.ts +34 -19
  27. package/cjs/src/embed/search.d.ts.map +1 -1
  28. package/cjs/src/embed/search.js +7 -3
  29. package/cjs/src/embed/search.js.map +1 -1
  30. package/cjs/src/embed/search.spec.js +10 -0
  31. package/cjs/src/embed/search.spec.js.map +1 -1
  32. package/cjs/src/embed/ts-embed.d.ts +1 -0
  33. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  34. package/cjs/src/embed/ts-embed.js +27 -7
  35. package/cjs/src/embed/ts-embed.js.map +1 -1
  36. package/cjs/src/embed/ts-embed.spec.js +114 -0
  37. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  38. package/cjs/src/react/index.spec.js +0 -12
  39. package/cjs/src/react/index.spec.js.map +1 -1
  40. package/cjs/src/types.d.ts +680 -231
  41. package/cjs/src/types.d.ts.map +1 -1
  42. package/cjs/src/types.js +605 -164
  43. package/cjs/src/types.js.map +1 -1
  44. package/cjs/src/utils/answerService.d.ts +10 -0
  45. package/cjs/src/utils/answerService.d.ts.map +1 -0
  46. package/cjs/src/utils/answerService.js +61 -0
  47. package/cjs/src/utils/answerService.js.map +1 -0
  48. package/cjs/src/utils/answerService.spec.d.ts +2 -0
  49. package/cjs/src/utils/answerService.spec.d.ts.map +1 -0
  50. package/cjs/src/utils/answerService.spec.js +31 -0
  51. package/cjs/src/utils/answerService.spec.js.map +1 -0
  52. package/cjs/src/utils/authService.d.ts +37 -0
  53. package/cjs/src/utils/authService.d.ts.map +1 -0
  54. package/cjs/src/utils/authService.js +106 -0
  55. package/cjs/src/utils/authService.js.map +1 -0
  56. package/cjs/src/utils/authService.spec.d.ts +2 -0
  57. package/cjs/src/utils/authService.spec.d.ts.map +1 -0
  58. package/cjs/src/utils/authService.spec.js +72 -0
  59. package/cjs/src/utils/authService.spec.js.map +1 -0
  60. package/cjs/src/utils/graphql/answerService/answerService.d.ts +2 -4
  61. package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  62. package/cjs/src/utils/graphql/answerService/answerService.js +2 -4
  63. package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
  64. package/cjs/src/utils/processData.d.ts +6 -0
  65. package/cjs/src/utils/processData.d.ts.map +1 -1
  66. package/cjs/src/utils/processData.js +5 -1
  67. package/cjs/src/utils/processData.js.map +1 -1
  68. package/cjs/src/utils/processTrigger.js +1 -1
  69. package/dist/src/auth.d.ts +4 -4
  70. package/dist/src/auth.d.ts.map +1 -1
  71. package/dist/src/embed/app.d.ts +15 -15
  72. package/dist/src/embed/app.d.ts.map +1 -1
  73. package/dist/src/embed/liveboard.d.ts +28 -23
  74. package/dist/src/embed/liveboard.d.ts.map +1 -1
  75. package/dist/src/embed/sage.d.ts +48 -30
  76. package/dist/src/embed/sage.d.ts.map +1 -1
  77. package/dist/src/embed/search-bar.d.ts +22 -6
  78. package/dist/src/embed/search-bar.d.ts.map +1 -1
  79. package/dist/src/embed/search.d.ts +34 -19
  80. package/dist/src/embed/search.d.ts.map +1 -1
  81. package/dist/src/embed/ts-embed.d.ts +1 -0
  82. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  83. package/dist/src/types.d.ts +680 -231
  84. package/dist/src/types.d.ts.map +1 -1
  85. package/dist/src/utils/answerService.d.ts +10 -0
  86. package/dist/src/utils/answerService.d.ts.map +1 -0
  87. package/dist/src/utils/answerService.spec.d.ts +2 -0
  88. package/dist/src/utils/answerService.spec.d.ts.map +1 -0
  89. package/dist/src/utils/authService.d.ts +37 -0
  90. package/dist/src/utils/authService.d.ts.map +1 -0
  91. package/dist/src/utils/authService.spec.d.ts +2 -0
  92. package/dist/src/utils/authService.spec.d.ts.map +1 -0
  93. package/dist/src/utils/graphql/answerService/answerService.d.ts +2 -4
  94. package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  95. package/dist/src/utils/processData.d.ts +6 -0
  96. package/dist/src/utils/processData.d.ts.map +1 -1
  97. package/dist/tsembed-react.es.js +664 -194
  98. package/dist/tsembed-react.js +663 -193
  99. package/dist/tsembed.es.js +667 -194
  100. package/dist/tsembed.js +665 -192
  101. package/dist/visual-embed-sdk-react-full.d.ts +851 -328
  102. package/dist/visual-embed-sdk-react.d.ts +851 -328
  103. package/dist/visual-embed-sdk.d.ts +851 -328
  104. package/lib/.DS_Store +0 -0
  105. package/lib/package.json +1 -1
  106. package/lib/src/.DS_Store +0 -0
  107. package/lib/src/auth.d.ts +4 -4
  108. package/lib/src/auth.d.ts.map +1 -1
  109. package/lib/src/auth.js +10 -4
  110. package/lib/src/auth.js.map +1 -1
  111. package/lib/src/embed/app.d.ts +15 -15
  112. package/lib/src/embed/app.d.ts.map +1 -1
  113. package/lib/src/embed/app.js +1 -1
  114. package/lib/src/embed/app.js.map +1 -1
  115. package/lib/src/embed/liveboard.d.ts +28 -23
  116. package/lib/src/embed/liveboard.d.ts.map +1 -1
  117. package/lib/src/embed/liveboard.js +4 -3
  118. package/lib/src/embed/liveboard.js.map +1 -1
  119. package/lib/src/embed/sage.d.ts +48 -30
  120. package/lib/src/embed/sage.d.ts.map +1 -1
  121. package/lib/src/embed/sage.js +7 -6
  122. package/lib/src/embed/sage.js.map +1 -1
  123. package/lib/src/embed/sage.spec.js +3 -3
  124. package/lib/src/embed/sage.spec.js.map +1 -1
  125. package/lib/src/embed/search-bar.d.ts +22 -6
  126. package/lib/src/embed/search-bar.d.ts.map +1 -1
  127. package/lib/src/embed/search-bar.js.map +1 -1
  128. package/lib/src/embed/search.d.ts +34 -19
  129. package/lib/src/embed/search.d.ts.map +1 -1
  130. package/lib/src/embed/search.js +7 -3
  131. package/lib/src/embed/search.js.map +1 -1
  132. package/lib/src/embed/search.spec.js +10 -0
  133. package/lib/src/embed/search.spec.js.map +1 -1
  134. package/lib/src/embed/ts-embed.d.ts +1 -0
  135. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  136. package/lib/src/embed/ts-embed.js +28 -8
  137. package/lib/src/embed/ts-embed.js.map +1 -1
  138. package/lib/src/embed/ts-embed.spec.js +114 -0
  139. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  140. package/lib/src/react/index.spec.js +0 -12
  141. package/lib/src/react/index.spec.js.map +1 -1
  142. package/lib/src/types.d.ts +680 -231
  143. package/lib/src/types.d.ts.map +1 -1
  144. package/lib/src/types.js +605 -164
  145. package/lib/src/types.js.map +1 -1
  146. package/lib/src/utils/answerService.d.ts +10 -0
  147. package/lib/src/utils/answerService.d.ts.map +1 -0
  148. package/lib/src/utils/answerService.js +57 -0
  149. package/lib/src/utils/answerService.js.map +1 -0
  150. package/lib/src/utils/answerService.spec.d.ts +2 -0
  151. package/lib/src/utils/answerService.spec.d.ts.map +1 -0
  152. package/lib/src/utils/answerService.spec.js +29 -0
  153. package/lib/src/utils/answerService.spec.js.map +1 -0
  154. package/lib/src/utils/authService.d.ts +37 -0
  155. package/lib/src/utils/authService.d.ts.map +1 -0
  156. package/lib/src/utils/authService.js +97 -0
  157. package/lib/src/utils/authService.js.map +1 -0
  158. package/lib/src/utils/authService.spec.d.ts +2 -0
  159. package/lib/src/utils/authService.spec.d.ts.map +1 -0
  160. package/lib/src/utils/authService.spec.js +70 -0
  161. package/lib/src/utils/authService.spec.js.map +1 -0
  162. package/lib/src/utils/graphql/answerService/answerService.d.ts +2 -4
  163. package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  164. package/lib/src/utils/graphql/answerService/answerService.js +2 -4
  165. package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
  166. package/lib/src/utils/processData.d.ts +6 -0
  167. package/lib/src/utils/processData.d.ts.map +1 -1
  168. package/lib/src/utils/processData.js +4 -1
  169. package/lib/src/utils/processData.js.map +1 -1
  170. package/lib/src/utils/processTrigger.js +1 -1
  171. package/lib/src/visual-embed-sdk.d.ts +851 -328
  172. package/package.json +1 -1
  173. package/src/.DS_Store +0 -0
  174. package/src/auth.ts +10 -4
  175. package/src/embed/app.ts +20 -20
  176. package/src/embed/liveboard.ts +32 -27
  177. package/src/embed/sage.spec.ts +3 -3
  178. package/src/embed/sage.ts +54 -36
  179. package/src/embed/search-bar.tsx +22 -6
  180. package/src/embed/search.spec.ts +13 -0
  181. package/src/embed/search.ts +42 -22
  182. package/src/embed/ts-embed.spec.ts +132 -0
  183. package/src/embed/ts-embed.ts +27 -9
  184. package/src/react/index.spec.tsx +0 -29
  185. package/src/types.ts +680 -232
  186. package/src/utils/graphql/answerService/answerService.ts +2 -4
  187. package/src/utils/processData.ts +4 -1
  188. package/src/utils/processTrigger.ts +1 -1
@@ -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
  /**
@@ -614,12 +613,26 @@ var EmbedEvent;
614
613
  /**
615
614
  * Rendering has initialized.
616
615
  *
616
+ * @example
617
+ *```js
618
+ * liveboardEmbed.on(EmbedEvent.Init, showLoader)
619
+ * //show a loader
620
+ * function showLoader() {
621
+ * document.getElementById("loader");
622
+ * }
623
+ *```
617
624
  * @returns timestamp - The timestamp when the event was generated.
618
625
  */
619
626
  EmbedEvent["Init"] = "init";
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
+ *```
623
636
  * @returns isLoggedIn - A Boolean specifying whether authentication was successful.
624
637
  */
625
638
  EmbedEvent["AuthInit"] = "authInit";
@@ -627,37 +640,91 @@ var EmbedEvent;
627
640
  * The embed object container has loaded.
628
641
  *
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
655
  *
635
656
  * @return data - The answer or Liveboard data
657
+ * @example
658
+ *```js
659
+ * liveboardEmbed.on(EmbedEvent.Data, payload => {
660
+ * console.log('data', payload);
661
+ * })
662
+ *```
636
663
  * @important
637
664
  */
638
665
  EmbedEvent["Data"] = "data";
639
666
  /**
640
- * Search/answer/Liveboard filters have been applied/updated by the user.
667
+ * Search/Answer/Liveboard filters have been applied/updated by the user.
641
668
  *
642
669
  * @hidden
643
670
  */
644
671
  EmbedEvent["FiltersChanged"] = "filtersChanged";
645
672
  /**
646
673
  * Search query has been updated by the user.
674
+ *
675
+ * @example
676
+ *```js
677
+ * searchEmbed.on(EmbedEvent.QueryChanged, payload => console.log('data', payload))
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
+ * @example
688
+ *```js
689
+ * searchEmbed.trigger(HostEvent.DrillDown, {
690
+ * points: {
691
+ * clickedPoint,
692
+ * selectedPoints: selectedPoint
693
+ * },
694
+ * autoDrillDown: true,
695
+ * })
696
+ *```
697
+ * In this example, `VizPointDoubleClick` event is used for
698
+ * triggering the `DrillDown` event when an area or specific
699
+ * data point on a table or chart is double-clicked.
700
+ * @example
701
+ *```js
702
+ * searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
703
+ * console.log(payload);
704
+ * const clickedPoint = payload.data.clickedPoint;
705
+ * const selectedPoint = payload.data.selectedPoints;
706
+ * console.log('>>> called', clickedPoint);
707
+ * embed.trigger(HostEvent.DrillDown, {
708
+ * points: {
709
+ * clickedPoint,
710
+ * selectedPoints: selectedPoint
711
+ * },
712
+ * autoDrillDown: true,
713
+ * })
714
+ * })
715
+ *```
655
716
  */
656
717
  EmbedEvent["Drilldown"] = "drillDown";
657
718
  /**
658
719
  * One or more data sources have been selected.
659
720
  *
660
721
  * @returns dataSourceIds - the list of data sources
722
+ * @example
723
+ * ```js
724
+ * searchEmbed.on(EmbedEvent.DataSourceSelected, payload => {
725
+ * console.log('DataSourceSelected', payload);
726
+ * })
727
+ * ```
661
728
  */
662
729
  EmbedEvent["DataSourceSelected"] = "dataSourceSelected";
663
730
  /**
@@ -665,25 +732,49 @@ var EmbedEvent;
665
732
  *
666
733
  * @returns columnIds - the list of columns
667
734
  * @version SDK: 1.10.0 | ThoughtSpot: 8.2.0.cl, 8.4.1.sw
735
+ * @example
736
+ * ```js
737
+ * appEmbed.on(EmbedEvent.AddRemoveColumns, payload => {
738
+ * console.log('AddRemoveColumns', payload);
739
+ * })
740
+ * ```
668
741
  */
669
742
  EmbedEvent["AddRemoveColumns"] = "addRemoveColumns";
670
743
  /**
671
- * A custom action has been triggered
744
+ * A custom action has been triggered.
672
745
  *
673
- * @returns actionId - The id of the custom action
674
- * @returns data - The answer or Liveboard data
746
+ * @returns actionId - ID of the custom action
747
+ * @returns data - Response payload with the Answer or Liveboard data
748
+ * @example
749
+ * ```js
750
+ * appEmbed.on(EmbedEvent.customAction, payload => {
751
+ * const data = payload.data;
752
+ * if (data.id === 'insert Custom Action ID here') {
753
+ * console.log('Custom Action event:', data.embedAnswerData);
754
+ * }
755
+ * })
756
+ * ```
675
757
  */
676
758
  EmbedEvent["CustomAction"] = "customAction";
677
759
  /**
678
- * Listen to double clicks on a visualization
760
+ * Listen to double click actions on a visualization.
679
761
  *
680
- * @return ContextMenuInputPoints - data point that is double clicked
762
+ * @return ContextMenuInputPoints - Data point that is double-clicked
681
763
  * @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
764
+ * @example
765
+ * ```js
766
+ * livebaordEmbed.on(EmbedEvent.VizPointDoubleClick, payload => {
767
+ * console.log('VizPointDoubleClick', payload)
768
+ * })
769
+ * ```
682
770
  */
683
771
  EmbedEvent["VizPointDoubleClick"] = "vizPointDoubleClick";
684
772
  /**
685
- * Listen to clicks on a visualization in a liveboard or Search result.
773
+ * Listen to clicks on a visualization in a Liveboard or Search result.
686
774
  *
775
+ * @return viz, clickedPoint - metadata about the point that is clicked
776
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
777
+ * @important
687
778
  * @example
688
779
  * ```js
689
780
  * embed.on(ThoughtSpotEmbed.Event.VizPointClick, ({data}) => {
@@ -696,25 +787,42 @@ var EmbedEvent;
696
787
  * )
697
788
  * });
698
789
  * ```
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
790
  */
703
791
  EmbedEvent["VizPointClick"] = "vizPointClick";
704
792
  /**
705
793
  * An error has occurred.
706
794
  *
707
795
  * @returns error - An error object or message
796
+ * @example
797
+ * ```js
798
+ * SearchEmbed.on(EmbedEvent.Error, showErrorMsg)
799
+ * //show error messaage
800
+ * function showErrorMsg() {
801
+ * document.getElementById("error");
802
+ * ```
708
803
  */
709
804
  EmbedEvent["Error"] = "Error";
710
805
  /**
711
- * The embedded object has sent an alert
806
+ * The embedded object has sent an alert.
712
807
  *
713
808
  * @returns alert - An alert object
809
+ * @example
810
+ * ```js
811
+ * searchEmbed.on(EmbedEvent.Alert)
812
+ * ```
714
813
  */
715
814
  EmbedEvent["Alert"] = "alert";
716
815
  /**
717
816
  * The ThoughtSpot auth session has expired.
817
+ *
818
+ * @example
819
+ *```js
820
+ * appEmbed.on(EmbedEvent.AuthExpire, showAuthExpired)
821
+ * //show auth expired banner
822
+ * function showAuthExpired() {
823
+ * document.getElementById("authExpiredBanner");
824
+ * }
825
+ *```
718
826
  */
719
827
  EmbedEvent["AuthExpire"] = "ThoughtspotAuthExpired";
720
828
  /**
@@ -744,14 +852,27 @@ var EmbedEvent;
744
852
  */
745
853
  EmbedEvent["EmbedIframeCenter"] = "EmbedIframeCenter";
746
854
  /**
747
- * Emitted when the "Get Data" button in Search Bar embed
748
- * is clicked.
855
+ * Emitted when the **Get Data** action is initiated.
856
+ * Applicable to `SearchBarEmbed` only.
749
857
  *
750
- * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.0.sw
858
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
859
+ * @example
860
+ *```js
861
+ * searchbarEmbed.on(EmbedEvent.GetDataClick)
862
+ * .then(data => {
863
+ * console.log('Answer Data:', data);
864
+ * })
865
+ *```
751
866
  */
752
867
  EmbedEvent["GetDataClick"] = "getDataClick";
753
868
  /**
754
869
  * Detects the route change.
870
+ *
871
+ * @example
872
+ *```js
873
+ * searchEmbed.on(EmbedEvent.RouteChange, payload =>
874
+ * console.log('data', payload))
875
+ *```
755
876
  */
756
877
  EmbedEvent["RouteChange"] = "ROUTE_CHANGE";
757
878
  /**
@@ -761,10 +882,15 @@ var EmbedEvent;
761
882
  */
762
883
  EmbedEvent["V1Data"] = "exportVizDataToParent";
763
884
  /**
764
- * Emitted when the embed does not have cookie access. This
765
- * happens on Safari where third-party cookies are blocked by default.
885
+ * Emitted when the embed does not have cookie access. This happens
886
+ * when Safari and other Web browsers block third-party cookies
887
+ * are blocked by default. `NoCookieAccess` can trigger
766
888
  *
767
- * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 7.2.1
889
+ * @example
890
+ *```js
891
+ * appEmbed.on(EmbedEvent.NoCookieAccess)
892
+ *```
893
+ * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 7.2.1.sw
768
894
  */
769
895
  EmbedEvent["NoCookieAccess"] = "noCookieAccess";
770
896
  /**
@@ -778,12 +904,24 @@ var EmbedEvent;
778
904
  * Emitted when any modal is opened in the app
779
905
  *
780
906
  * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
907
+ * @example
908
+ *```js
909
+ * appEmbed.on(EmbedEvent.DialogOpen, payload => {
910
+ * console.log('dialog open', payload);
911
+ * })
912
+ *```
781
913
  */
782
914
  EmbedEvent["DialogOpen"] = "dialog-open";
783
915
  /**
784
916
  * Emitted when any modal is closed in the app
785
917
  *
786
918
  * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
919
+ * @example
920
+ *```js
921
+ * appEmbed.on(EmbedEvent.DialogClose, payload => {
922
+ * console.log('dialog close', payload);
923
+ * })
924
+ *```
787
925
  */
788
926
  EmbedEvent["DialogClose"] = "dialog-close";
789
927
  /**
@@ -792,6 +930,21 @@ var EmbedEvent;
792
930
  * other events on the rendered Liveboard.
793
931
  *
794
932
  * @version SDK: 1.9.1 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw
933
+ * @example
934
+ *```js
935
+ * liveboardEmbed.on(EmbedEvent.LiveboardRendered, payload => {
936
+ console.log('Liveboard is rendered', payload);
937
+ })
938
+ *```
939
+ * The following example shows how to trigger
940
+ * `SetVisibleVizs` event using LiveboardRendered embed event:
941
+ * @example
942
+ *```js
943
+ * const embedRef = useEmbedRef();
944
+ * const onLiveboardRendered = () => {
945
+ * embed.trigger(HostEvent.SetVisibleVizs, ['viz1', 'viz2']);
946
+ * };
947
+ *```
795
948
  */
796
949
  EmbedEvent["LiveboardRendered"] = "PinboardRendered";
797
950
  /**
@@ -799,216 +952,470 @@ var EmbedEvent;
799
952
  * is triggered on all events.
800
953
  *
801
954
  * @Version SDK: 1.10.0 | ThoughtSpot: 8.2.0.cl, 8.4.1.sw
955
+ * @example
956
+ *```js
957
+ * appEmbed.on(EmbedEvent.ALL, payload => {
958
+ * console.log('Embed Events', payload)
959
+ * })
960
+ *```
802
961
  */
803
962
  EmbedEvent["ALL"] = "*";
804
963
  /**
805
964
  * Emitted when an Answer is saved in the app
806
965
  *
807
966
  * @Version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
967
+ * @example
968
+ *```js
969
+ * //trigger when action starts
970
+ * searchEmbed.on(EmbedEvent.Save, payload => {
971
+ * console.log('Save', payload)
972
+ * }, {
973
+ * start: true
974
+ * })
975
+ * //trigger when action ends
976
+ * searchEmbed.on(EmbedEvent.Save, payload => {
977
+ * console.log('Save', payload)
978
+ * })
979
+ *```
808
980
  */
809
981
  EmbedEvent["Save"] = "save";
810
982
  /**
811
983
  * Emitted when the download action is triggered on an answer
812
984
  *
985
+ * **Note**: This event is deprecated in v1.21.0.
986
+ * To fire an event when a download action is initiated on a chart or table,
987
+ * use `EmbedEvent.DownloadAsPng`, `EmbedEvent.DownloadAsPDF`, `EmbedEvent.DownloadAsCSV`,
988
+ * or `EmbedEvent.DownloadAsXLSX`
989
+ *
813
990
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
991
+ * @example
992
+ *```js
993
+ * liveboardEmbed.trigger(HostEvent.Download, {
994
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
995
+ * })
996
+ *```
814
997
  */
815
998
  EmbedEvent["Download"] = "download";
816
999
  /**
817
1000
  * Emitted when the download action is triggered on an answer
818
1001
  *
819
1002
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.0.sw
1003
+ * @example
1004
+ *```js
1005
+ * //trigger when action starts
1006
+ * searchEmbed.on(EmbedEvent.DownloadAsPng, payload => {
1007
+ * console.log('download PNG', payload)}, {start: true })
1008
+ * //trigger when action ends
1009
+ * searchEmbed.on(EmbedEvent.DownloadAsPng, payload => {
1010
+ * console.log('download PNG', payload)})
1011
+ *```
820
1012
  */
821
1013
  EmbedEvent["DownloadAsPng"] = "downloadAsPng";
822
1014
  /**
823
1015
  * Emitted when the Download as PDF action is triggered on an answer
824
1016
  *
825
1017
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1018
+ * @example
1019
+ *```js
1020
+ * //trigger when action starts
1021
+ * searchEmbed.on(EmbedEvent.DownloadAsPdf, payload => {
1022
+ * console.log('download PDF', payload)}, {start: true })
1023
+ * //trigger when action ends
1024
+ * searchEmbed.on(EmbedEvent.DownloadAsPdf, payload => {
1025
+ * console.log('download PDF', payload)})
1026
+ *```
826
1027
  */
827
1028
  EmbedEvent["DownloadAsPdf"] = "downloadAsPdf";
828
1029
  /**
829
1030
  * Emitted when the Download as CSV action is triggered on an answer
830
1031
  *
831
1032
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1033
+ * @example
1034
+ *```js
1035
+ * //trigger when action starts
1036
+ * searchEmbed.on(EmbedEvent.DownloadAsCSV, payload => {
1037
+ * console.log('download CSV', payload)}, {start: true })
1038
+ * //trigger when action ends
1039
+ * searchEmbed.on(EmbedEvent.DownloadAsCSV, payload => {
1040
+ * console.log('download CSV', payload)})
1041
+ *```
832
1042
  */
833
1043
  EmbedEvent["DownloadAsCsv"] = "downloadAsCsv";
834
1044
  /**
835
1045
  * Emitted when the Download as XLSX action is triggered on an answer
836
1046
  *
837
1047
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1048
+ * @example
1049
+ *```js
1050
+ * //trigger when action starts
1051
+ * searchEmbed.on(EmbedEvent.DownloadAsXlsx, payload => {
1052
+ * console.log('download Xlsx', payload)}, { start: true })
1053
+ * //trigger when action ends
1054
+ * searchEmbed.on(EmbedEvent.DownloadAsXlsx, payload => {
1055
+ * console.log('download Xlsx', payload)})
1056
+ *```
838
1057
  */
839
1058
  EmbedEvent["DownloadAsXlsx"] = "downloadAsXlsx";
840
1059
  /**
841
- * Emitted when an answer is deleted in the app
1060
+ * Emitted when an Answer is deleted in the app
842
1061
  *
843
1062
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1063
+ * @example
1064
+ *```js
1065
+ * //trigger when action starts
1066
+ * appEmbed.on(EmbedEvent.AnswerDelete, payload => {
1067
+ * console.log('delete answer', payload)}, {start: true })
1068
+ * //trigger when action is completed
1069
+ * appEmbed.on(EmbedEvent.AnswerDelete, payload => {
1070
+ * console.log('delete answer', payload)})
1071
+ *```
844
1072
  */
845
1073
  EmbedEvent["AnswerDelete"] = "answerDelete";
846
1074
  /**
847
1075
  * Emitted when an answer is pinned to a Liveboard
848
1076
  *
849
1077
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1078
+ * @example
1079
+ *```js
1080
+ * //trigger when action starts
1081
+ * searchEmbed.on(EmbedEvent.Pin, payload => {
1082
+ * console.log('pin', payload)
1083
+ * }, {
1084
+ * start: true
1085
+ * })
1086
+ * //trigger when action ends
1087
+ * searchEmbed.on(EmbedEvent.Pin, payload => {
1088
+ * console.log('pin', payload)
1089
+ * })
1090
+ *```
850
1091
  */
851
1092
  EmbedEvent["Pin"] = "pin";
852
1093
  /**
853
1094
  * Emitted when SpotIQ analysis is triggered
854
1095
  *
855
1096
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1097
+ * @example
1098
+ *```js
1099
+ * //trigger when action starts
1100
+ * searchEmbed.on(EmbedEvent.SpotIQAnalyze, payload => {
1101
+ * console.log('SpotIQAnalyze', payload)
1102
+ * }, {
1103
+ * start: true
1104
+ * })
1105
+ * //trigger when action ends
1106
+ * searchEmbed.on(EmbedEvent.SpotIQAnalyze, payload => {
1107
+ * console.log('SpotIQ analyze', payload)
1108
+ * })
1109
+ *```
856
1110
  */
857
1111
  EmbedEvent["SpotIQAnalyze"] = "spotIQAnalyze";
858
1112
  /**
859
1113
  * Emitted when a user shares an object with another user or group
860
1114
  *
861
1115
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1116
+ * @example
1117
+ *```js
1118
+ * //trigger when action starts
1119
+ * searchEmbed.on(EmbedEvent.Share, payload => {
1120
+ * console.log('Share', payload)
1121
+ * }, {
1122
+ * start: true
1123
+ * })
1124
+ * //trigger when action ends
1125
+ * searchEmbed.on(EmbedEvent.Share, payload => {
1126
+ * console.log('Share', payload)
1127
+ * })
1128
+ *```
862
1129
  */
863
1130
  EmbedEvent["Share"] = "share";
864
1131
  /**
865
- * Emitted when a user clicks the Include action to include a specific value or data
866
- * on a chart or table
1132
+ * Emitted when a user clicks the **Include** action to include a specific value or
1133
+ * data on a chart or table.
867
1134
  *
868
1135
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1136
+ * @example
1137
+ *```js
1138
+ * appEmbed.on(EmbedEvent.DrillInclude, payload => {
1139
+ * console.log('Drill include', payload);
1140
+ * })
1141
+ *```
869
1142
  */
870
1143
  EmbedEvent["DrillInclude"] = "context-menu-item-include";
871
1144
  /**
872
- * Emitted when a user clicks the Exclude action to exclude a specific value or data
873
- * on a chart or table
1145
+ * Emitted when a user clicks the **Exclude** action to exclude a specific value or
1146
+ * data on a chart or table
874
1147
  *
875
1148
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1149
+ * @example
1150
+ *```js
1151
+ * appEmbed.on(EmbedEvent.DrillExclude, payload => {
1152
+ * console.log('Drill exclude', payload);
1153
+ * })
1154
+ *```
876
1155
  */
877
1156
  EmbedEvent["DrillExclude"] = "context-menu-item-exclude";
878
1157
  /**
879
- * Emitted when copied column value on the app
1158
+ * Emitted when a column value is copied in the embedded app.
880
1159
  *
881
1160
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1161
+ * @example
1162
+ *```js
1163
+ * seachEmbed.on(EmbedEvent.CopyToClipboard, payload => {
1164
+ * console.log('copy to clipboard', payload);
1165
+ * })
1166
+ *```
882
1167
  */
883
1168
  EmbedEvent["CopyToClipboard"] = "context-menu-item-copy-to-clipboard";
884
1169
  /**
885
- * Emitted when a user clicks the Update TML action
1170
+ * Emitted when a user clicks the **Update TML** action
886
1171
  *
887
1172
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1173
+ * @example
1174
+ *```js
1175
+ * liveboardEmbed.on(EmbedEvent.UpdateTML)
1176
+ * })
1177
+ *```
888
1178
  */
889
1179
  EmbedEvent["UpdateTML"] = "updateTSL";
890
1180
  /**
891
- * Emitted when a user clicks the Edit TML action
1181
+ * Emitted when a user clicks the **Edit TML** action
892
1182
  *
893
1183
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1184
+ * @example
1185
+ *```js
1186
+ * appEmbed.on(EmbedEvent.EditTML, payload => {
1187
+ * console.log('Edit TML', payload);
1188
+ * })
1189
+ *```
894
1190
  */
895
1191
  EmbedEvent["EditTML"] = "editTSL";
896
1192
  /**
897
- * Emitted when ExportTML trigger in answer on the app
1193
+ * Emitted when the **Export TML** action is triggered on an
1194
+ * an embedded object in the app
898
1195
  *
899
1196
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1197
+ * @example
1198
+ *```js
1199
+ * //trigger when action starts
1200
+ * searchEmbed.on(EmbedEvent.ExportTML, payload => {
1201
+ * console.log('Export TML', payload)}, { start: true })
1202
+ * //trigger when action ends
1203
+ * searchEmbed.on(EmbedEvent.ExportTML, payload => {
1204
+ * console.log('Export TML', payload)})
1205
+ *```
900
1206
  */
901
1207
  EmbedEvent["ExportTML"] = "exportTSL";
902
1208
  /**
903
- * Emitted when an answer is saved as a view
1209
+ * Emitted when an Answer is saved as a View.
904
1210
  *
905
1211
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1212
+ * @example
1213
+ *```js
1214
+ * appEmbed.on(EmbedEvent.SaveAsView, payload => {
1215
+ * console.log('View', payload);
1216
+ * })
1217
+ *```
906
1218
  */
907
1219
  EmbedEvent["SaveAsView"] = "saveAsView";
908
1220
  /**
909
- * Emitted when copy of existing answer on the app
1221
+ * Emitted when the user creates a copy of an Answer
910
1222
  *
911
1223
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1224
+ * @example
1225
+ *```js
1226
+ * //trigger when action starts
1227
+ * appEmbed.on(EmbedEvent.CopyAEdit, payload => {
1228
+ * console.log('Copy and edit', payload)}, {start: true })
1229
+ * //trigger when action ends
1230
+ * appEmbed.on(EmbedEvent.CopyAEdit, payload => {
1231
+ * console.log('Copy and edit', payload)})
1232
+ *```
912
1233
  */
913
1234
  EmbedEvent["CopyAEdit"] = "copyAEdit";
914
1235
  /**
915
- * Emitted when a user clicks Show underlying data on an answe
1236
+ * Emitted when a user clicks Show underlying data on an Answer
916
1237
  *
917
1238
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1239
+ * @example
1240
+ *```js
1241
+ * liveboardEmbed.on(EmbedEvent.ShowUnderlyingData, payload => {
1242
+ * console.log('show data', payload);
1243
+ * })
1244
+ *```
918
1245
  */
919
1246
  EmbedEvent["ShowUnderlyingData"] = "showUnderlyingData";
920
1247
  /**
921
- * Emitted when an answer is switched to a chart or table view
1248
+ * Emitted when an answer is switched to a chart or table view.
922
1249
  *
923
1250
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1251
+ * @example
1252
+ *```js
1253
+ * searchEmbed.on(EmbedEvent.AnswerChartSwitcher, payload => {
1254
+ * console.log('switch view', payload);
1255
+ * })
1256
+ *```
924
1257
  */
925
1258
  EmbedEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
926
1259
  /**
927
- * Internal event to communicate the initial settings back to the TS APP
1260
+ * Internal event to communicate the initial settings back to the ThoughtSpot app
928
1261
  *
929
1262
  * @hidden
930
1263
  */
931
1264
  EmbedEvent["APP_INIT"] = "appInit";
932
1265
  /**
933
- * Emitted when a user clicks Show Liveboard details on a Liveboard
1266
+ * Emitted when a user clicks **Show Liveboard details** on a Liveboard
934
1267
  *
935
1268
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1269
+ * @example
1270
+ *```js
1271
+ * liveboardEmbed.on(EmbedEvent.AnswerChartSwitcher, payload => {
1272
+ * console.log('Liveboard details', payload);
1273
+ * })
1274
+ *```
936
1275
  */
937
1276
  EmbedEvent["LiveboardInfo"] = "pinboardInfo";
938
1277
  /**
939
1278
  * Emitted when a user clicks on the Favorite icon on a Liveboard
940
1279
  *
941
1280
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1281
+ * @example
1282
+ *```js
1283
+ * liveboardEmbed.on(EmbedEvent.AddToFavorites, payload => {
1284
+ * console.log('favorites', payload);
1285
+ * })
1286
+ *```
942
1287
  */
943
1288
  EmbedEvent["AddToFavorites"] = "addToFavorites";
944
1289
  /**
945
- * Emitted when a user clicks Schedule on a Liveboard
1290
+ * Emitted when a user clicks **Schedule** on a Liveboard
946
1291
  *
947
1292
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1293
+ * @example
1294
+ *```js
1295
+ * liveboardEmbed.on(EmbedEvent.Schedule, payload => {
1296
+ * console.log(`Liveboard schedule', payload);
1297
+ * })
1298
+ *```
948
1299
  */
949
1300
  EmbedEvent["Schedule"] = "subscription";
950
1301
  /**
951
- * Emitted when a user clicks Edit on a Liveboard or visualization
1302
+ * Emitted when a user clicks **Edit** on a Liveboard or visualization
952
1303
  *
953
1304
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1305
+ * @example
1306
+ *```js
1307
+ * liveboardEmbed.on(EmbedEvent.Edit, payload => {
1308
+ * console.log(`Liveboard edit', payload);
1309
+ * })
1310
+ *```
954
1311
  */
955
1312
  EmbedEvent["Edit"] = "edit";
956
1313
  /**
957
- * Emitted when a user clicks Make a copy on a Liveboard
1314
+ * Emitted when a user clicks *Make a copy* on a Liveboard
958
1315
  *
959
1316
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1317
+ * @example
1318
+ *```js
1319
+ * liveboardEmbed.on(EmbedEvent.MakeACopy, payload => {
1320
+ * console.log(`Copy', payload);
1321
+ * })
1322
+ *```
960
1323
  */
961
1324
  EmbedEvent["MakeACopy"] = "makeACopy";
962
1325
  /**
963
- * Emitted when a user clicks Present on a Liveboard or visualization
1326
+ * Emitted when a user clicks **Present** on a Liveboard or visualization
964
1327
  *
965
1328
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1329
+ * @example
1330
+ *```js
1331
+ * liveboardEmbed.trigger(HostEvent.Present)
1332
+ *```
1333
+ * @example
1334
+ *```js
1335
+ * liveboardEmbed.on(EmbedEvent.Present, {
1336
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1337
+ * })
1338
+ *```
966
1339
  */
967
1340
  EmbedEvent["Present"] = "present";
968
1341
  /**
969
- * Emitted when a user clicks Delete on a Liveboard
1342
+ * Emitted when a user clicks **Delete** on a visualization
970
1343
  *
971
1344
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1345
+ * @example
1346
+ *```js
1347
+ * liveboardEmbed.trigger(HostEvent.Delete,
1348
+ * {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1349
+ *```
972
1350
  */
973
1351
  EmbedEvent["Delete"] = "delete";
974
1352
  /**
975
1353
  * Emitted when a user clicks Manage schedules on a Liveboard
976
1354
  *
977
1355
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1356
+ * @example
1357
+ *```js
1358
+ * liveboardEmbed.trigger(HostEvent.SchedulesList)
1359
+ *```
978
1360
  */
979
1361
  EmbedEvent["SchedulesList"] = "schedule-list";
980
1362
  /**
981
- * Emitted when a user clicks Cancel in edit mode on a Liveboard
1363
+ * Emitted when a user clicks **Cancel** in edit mode on a Liveboard
982
1364
  *
983
1365
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1366
+ * @example
1367
+ *```js
1368
+ * liveboardEmbed.trigger(HostEvent.Cancel)
1369
+ *```
984
1370
  */
985
1371
  EmbedEvent["Cancel"] = "cancel";
986
1372
  /**
987
- * Emitted when a user clicks Explore on a visualization
1373
+ * Emitted when a user clicks **Explore** on a visualization
988
1374
  *
989
1375
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1376
+ * @example
1377
+ *```js
1378
+ * liveboardEmbed.trigger(HostEvent.Explore, {
1379
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1380
+ *```
990
1381
  */
991
1382
  EmbedEvent["Explore"] = "explore";
992
1383
  /**
993
- * Emitted when a user clicks Copy link action on a visualization
1384
+ * Emitted when a user clicks **Copy link** action on a visualization
994
1385
  *
995
1386
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1387
+ * @example
1388
+ *```js
1389
+ * liveboardEmbed.trigger(HostEvent.CopyLink, {
1390
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1391
+ *```
996
1392
  */
997
1393
  EmbedEvent["CopyLink"] = "embedDocument";
998
1394
  /**
999
- * Emitted when a user interacts with cross filters on a visualization or liveboard
1395
+ * Emitted when a user interacts with cross filters on a visualization or Liveboard
1000
1396
  *
1001
- * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
1397
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.0.sw
1398
+ * @example
1399
+ *```js
1400
+ * liveboardEmbed.trigger(HostEvent.CrossFilterChanged, {
1401
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1402
+ *```
1002
1403
  */
1003
1404
  EmbedEvent["CrossFilterChanged"] = "cross-filter-changed";
1004
1405
  /**
1005
1406
  * Emitted when a user right clicks on a visualization (chart or table)
1006
1407
  *
1007
- * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
1408
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.0.sw
1409
+ * @example
1410
+ *```js
1411
+ * LiveboardEmbed.on(EmbedEvent.VizPointRightClick, payload => {
1412
+ * console.log('VizPointClick', payload)
1413
+ * })
1414
+ *```
1008
1415
  */
1009
1416
  EmbedEvent["VizPointRightClick"] = "vizPointRightClick";
1010
1417
  /**
1011
- * Emitted when a user clicks on Insert to slide on a visualization
1418
+ * Emitted when a user clicks **Insert to slide** on a visualization
1012
1419
  *
1013
1420
  * @hidden
1014
1421
  */
@@ -1016,52 +1423,52 @@ var EmbedEvent;
1016
1423
  /**
1017
1424
  * @hidden
1018
1425
  * Emitted when a user changes any filter on a Liveboard.
1019
- * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
1426
+ * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl, 9.5.0.sw
1020
1427
  */
1021
1428
  EmbedEvent["FilterChanged"] = "filterChanged";
1022
1429
  /**
1023
- * Emitted when a user click on Go button in Sage Embed
1430
+ * Emitted when a user clicks the **Go** button on the Search page
1024
1431
  *
1025
- * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
1432
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
1026
1433
  */
1027
1434
  EmbedEvent["SageEmbedQuery"] = "sageEmbedQuery";
1028
1435
  /**
1029
- * Emitten when a user select data source in Sage Embed
1436
+ * Emitted when a user selects a data source.
1030
1437
  *
1031
- * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
1438
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
1032
1439
  */
1033
1440
  EmbedEvent["SageWorksheetUpdated"] = "sageWorksheetUpdated";
1034
1441
  /**
1035
- * Emitted when a user updates a connection in Data tab
1442
+ * Emitted when a user updates a connection on the **Data** page
1036
1443
  *
1037
- * @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl
1444
+ * @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl, 9.8.0.sw
1038
1445
  */
1039
1446
  EmbedEvent["UpdateConnection"] = "updateConnection";
1040
1447
  /**
1041
- * Emitted when a user updates a connection in Data tab
1448
+ * Emitted when a user updates a connection on the **Data** page
1042
1449
  *
1043
- * @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl
1450
+ * @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl, 9.8.0.sw
1044
1451
  */
1045
1452
  EmbedEvent["CreateConnection"] = "createConnection";
1046
1453
  /**
1047
1454
  * Emitted when name, status (private or public) or filter values of a
1048
- * PersonalisedView is updated.
1455
+ * Personalised view is updated.
1049
1456
  *
1050
1457
  * @returns viewName: string
1051
1458
  * @returns viewId: string
1052
1459
  * @returns liveboardId: string
1053
1460
  * @returns isPublic: boolean
1054
- * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
1461
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
1055
1462
  */
1056
1463
  EmbedEvent["UpdatePersonalisedView"] = "updatePersonalisedView";
1057
1464
  /**
1058
- * Emitted when a PersonalisedView is saved.
1465
+ * Emitted when a Personalised view is saved.
1059
1466
  *
1060
1467
  * @returns viewName: string
1061
1468
  * @returns viewId: string
1062
1469
  * @returns liveboardId: string
1063
1470
  * @returns isPublic: boolean
1064
- * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
1471
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
1065
1472
  */
1066
1473
  EmbedEvent["SavePersonalisedView"] = "savePersonalisedView";
1067
1474
  /**
@@ -1071,7 +1478,7 @@ var EmbedEvent;
1071
1478
  * @returns viewId: string
1072
1479
  * @returns liveboardId: string
1073
1480
  * @returns isPublic: boolean
1074
- * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
1481
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
1075
1482
  */
1076
1483
  EmbedEvent["ResetLiveboard"] = "resetLiveboard";
1077
1484
  /**
@@ -1079,11 +1486,11 @@ var EmbedEvent;
1079
1486
  *
1080
1487
  * @returns views: string[]
1081
1488
  * @returns liveboardId: string
1082
- * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
1489
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
1083
1490
  */
1084
1491
  EmbedEvent["DeletePersonalisedView"] = "deletePersonalisedView";
1085
1492
  /**
1086
- * Emitten when a user creates a new worksheet
1493
+ * Emitted when a user creates a new worksheet
1087
1494
  *
1088
1495
  * @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl
1089
1496
  */
@@ -1115,15 +1522,16 @@ var EmbedEvent;
1115
1522
  var HostEvent;
1116
1523
  (function (HostEvent) {
1117
1524
  /**
1118
- * Triggers a search query in AppEmbed and SearchEmbed
1119
- * deployments.
1525
+ * Triggers a search operation with the search tokens specified in
1526
+ * the search query string.
1527
+ * Supported in `AppEmbed` and `SearchEmbed` deployments.
1120
1528
  * Includes the following properties:
1121
1529
  *
1122
- * @param - dataSourceIds - The data source GUID to Search on
1530
+ * @param - `searchQuery` - query string with search tokens
1531
+ * @param - `dataSources` - Data source GUID to Search on
1123
1532
  * - Although an array, only a single source
1124
1533
  * is supported.
1125
- * @param - searchQuery - Query string with search tokens
1126
- * @param - execute - executes the existing / updated query
1534
+ * @param - `execute` - executes search and updates the existing query
1127
1535
  * @example
1128
1536
  * ```js
1129
1537
  * searchembed.trigger(HostEvent.Search, {
@@ -1143,6 +1551,10 @@ var HostEvent;
1143
1551
  * @param - columnGuid - Optional. GUID of the column to drill
1144
1552
  * by. If not provided it will auto drill by the configured
1145
1553
  * column.
1554
+ * @param - autoDrillDown - Optional. If true, the drill down will be
1555
+ * done automatically on the most popular column.
1556
+ * @param - vizId [TS >= 9.8.0] - Optional. The GUID of the visualization to drill
1557
+ * in case of a liveboard.
1146
1558
  * @example
1147
1559
  * ```js
1148
1560
  * searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
@@ -1159,6 +1571,25 @@ var HostEvent;
1159
1571
  * });
1160
1572
  * })
1161
1573
  * ```
1574
+ * @example
1575
+ * ```js
1576
+ * // Works with TS 9.8.0 and above
1577
+ *
1578
+ * liveboardEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
1579
+ * console.log(payload);
1580
+ * const clickedPoint = payload.data.clickedPoint;
1581
+ * const selectedPoint = payload.data.selectedPoints;
1582
+ * console.log('>>> called', clickedPoint);
1583
+ * liveboardEmbed.trigger(HostEvent.DrillDown, {
1584
+ * points: {
1585
+ * clickedPoint,
1586
+ * selectedPoints: selectedPoint
1587
+ * },
1588
+ * autoDrillDown: true,
1589
+ * vizId: payload.data.vizId
1590
+ * });
1591
+ * })
1592
+ * ```
1162
1593
  * @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
1163
1594
  */
1164
1595
  HostEvent["DrillDown"] = "triggerDrillDown";
@@ -1175,7 +1606,7 @@ var HostEvent;
1175
1606
  */
1176
1607
  HostEvent["Reload"] = "reload";
1177
1608
  /**
1178
- * Sets the visible visualizations on a Liveboard.
1609
+ * Display specific visualizations on a Liveboard.
1179
1610
  *
1180
1611
  * @param - An array of GUIDs of the visualization to show. The visualization IDs not passed
1181
1612
  * in this parameter will be hidden.
@@ -1189,7 +1620,7 @@ var HostEvent;
1189
1620
  */
1190
1621
  HostEvent["SetVisibleVizs"] = "SetPinboardVisibleVizs";
1191
1622
  /**
1192
- * Set the Active Tab of a Liveboard.
1623
+ * Set a Liveboard tab as an active tab.
1193
1624
  *
1194
1625
  * @param - tabId - string of id of Tab to show
1195
1626
  * @example
@@ -1202,7 +1633,7 @@ var HostEvent;
1202
1633
  */
1203
1634
  HostEvent["SetActiveTab"] = "SetActiveTab";
1204
1635
  /**
1205
- * Updates runtime filters applied on a Saved Answer or Liveboard. The
1636
+ * Update runtime filters applied on a Saved Answer or Liveboard. The
1206
1637
  * runtime filters passed here are appended to the existing runtime
1207
1638
  * filters.
1208
1639
  * Pass an array of runtime filters with the following attributes:
@@ -1228,10 +1659,11 @@ var HostEvent;
1228
1659
  */
1229
1660
  HostEvent["UpdateRuntimeFilters"] = "UpdateRuntimeFilters";
1230
1661
  /**
1231
- * Navigate to a specific page in the embedded application without reloading the page.
1662
+ * Navigate to a specific page in the embedded ThoughtSpot application.
1232
1663
  * This is the same as calling `appEmbed.navigateToPage(path, true)`
1233
1664
  *
1234
- * @param - path - the path to navigate to (can be a number[1/-1] to go forward/back)
1665
+ * @param - `path` - the path to navigate to to go forward or back. The path value can
1666
+ * be a number; for example, `1`, `-1`.
1235
1667
  * @example
1236
1668
  * ```js
1237
1669
  * appEmbed.navigateToPage(-1)
@@ -1240,7 +1672,7 @@ var HostEvent;
1240
1672
  */
1241
1673
  HostEvent["Navigate"] = "Navigate";
1242
1674
  /**
1243
- * Opens the filter panel for a particular column.
1675
+ * Open the filter panel for a particular column.
1244
1676
  * Works with Search and Liveboard embed.
1245
1677
  *
1246
1678
  * @param - { columnId: string,
@@ -1258,7 +1690,7 @@ var HostEvent;
1258
1690
  */
1259
1691
  HostEvent["OpenFilter"] = "openFilter";
1260
1692
  /**
1261
- * Adds columns to the current search query.
1693
+ * Add columns to the current search query.
1262
1694
  *
1263
1695
  * @param - { columnIds: string[] }
1264
1696
  * @example
@@ -1269,7 +1701,7 @@ var HostEvent;
1269
1701
  */
1270
1702
  HostEvent["AddColumns"] = "addColumns";
1271
1703
  /**
1272
- * Removes a column from the current search query.
1704
+ * Remove a column from the current search query.
1273
1705
  *
1274
1706
  * @param - { columnId: string }
1275
1707
  * @example
@@ -1280,27 +1712,29 @@ var HostEvent;
1280
1712
  */
1281
1713
  HostEvent["RemoveColumn"] = "removeColumn";
1282
1714
  /**
1283
- * Gets the current Liveboard content.
1715
+ * Get the transient state of a Liveboard as encoded content.
1716
+ * This includes unsaved and ad hoc changes such as
1717
+ * Liveboard filters, runtime filters applied on visualizations on a
1718
+ * Liveboard, and Liveboard layout, changes to visualizations such as
1719
+ * sorting, toggling of legends, and data drill down.
1284
1720
  *
1285
1721
  * @example
1286
1722
  * ```js
1287
- * liveboardEmbed.trigger(HostEvent.getExportRequestForCurrentPinboard)
1723
+ * liveboardEmbed.trigger(HostEvent.getexportrequestforcurrentpinboard).then(
1724
+ * data=>console.log(data))
1288
1725
  * ```
1289
1726
  * @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl, 8.8.1.sw
1290
1727
  */
1291
1728
  HostEvent["getExportRequestForCurrentPinboard"] = "getExportRequestForCurrentPinboard";
1292
1729
  /**
1293
- * Triggers the **Pin** action on an embedded object
1730
+ * Trigger the **Pin** action on an embedded object
1294
1731
  *
1295
1732
  * @param - Liveboard embed takes the `vizId` as a
1296
- * key. Can be left undefined when embedding Search, full app or
1733
+ * key. Can be left undefined when embedding Search, full app, or
1297
1734
  * a visualization.
1298
1735
  * @example
1299
1736
  * ```js
1300
- * liveboardEmbed.trigger(HostEvent.Pin, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1301
- * ```
1302
- * ```js
1303
- * vizEmbed.trigger(HostEvent.Pin)
1737
+ * appEmbed.trigger(HostEvent.Pin)
1304
1738
  * ```
1305
1739
  * ```js
1306
1740
  * searchEmbed.trigger(HostEvent.Pin)
@@ -1309,17 +1743,18 @@ var HostEvent;
1309
1743
  */
1310
1744
  HostEvent["Pin"] = "pin";
1311
1745
  /**
1312
- * Triggers the **Show Liveboard details** action on a Liveboard
1746
+ * Trigger the **Show Liveboard details** action
1747
+ * on an embedded Liveboard.
1313
1748
  *
1314
1749
  * @example
1315
- * ```js
1316
- * liveboardEmbed.trigger(HostEvent.LiveboardInfo)
1317
- * ```
1750
+ *```js
1751
+ * liveboardEmbed.trigger(HostEvent.LiveboardInfo)
1752
+ *```
1318
1753
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1319
1754
  */
1320
1755
  HostEvent["LiveboardInfo"] = "pinboardInfo";
1321
1756
  /**
1322
- * Triggers the **Schedule** action on a Liveboard
1757
+ * Trigger the **Schedule** action on an embedded Liveboard.
1323
1758
  *
1324
1759
  * @example
1325
1760
  * ```js
@@ -1329,7 +1764,7 @@ var HostEvent;
1329
1764
  */
1330
1765
  HostEvent["Schedule"] = "subscription";
1331
1766
  /**
1332
- * Triggers the **Manage schedule** action on a Liveboard
1767
+ * Trigger the **Manage schedule** action on an embedded Liveboard
1333
1768
  *
1334
1769
  * @example
1335
1770
  * ```js
@@ -1339,7 +1774,7 @@ var HostEvent;
1339
1774
  */
1340
1775
  HostEvent["SchedulesList"] = "schedule-list";
1341
1776
  /**
1342
- * Triggers the **Export TML** action on a Liveboard
1777
+ * Trigger the **Export TML** action on an embedded Liveboard.
1343
1778
  *
1344
1779
  * @example
1345
1780
  * ```js
@@ -1349,7 +1784,7 @@ var HostEvent;
1349
1784
  */
1350
1785
  HostEvent["ExportTML"] = "exportTSL";
1351
1786
  /**
1352
- * Triggers the **Edit TML** action on a Liveboard
1787
+ * Trigger the **Edit TML** action on an embedded Liveboard.
1353
1788
  *
1354
1789
  * @example
1355
1790
  * ```js
@@ -1359,7 +1794,7 @@ var HostEvent;
1359
1794
  */
1360
1795
  HostEvent["EditTML"] = "editTSL";
1361
1796
  /**
1362
- * Triggers the **Update TML** action on a Liveboard
1797
+ * Trigger the **Update TML** action on an embedded Liveboard.
1363
1798
  *
1364
1799
  * @example
1365
1800
  * ```js
@@ -1369,7 +1804,7 @@ var HostEvent;
1369
1804
  */
1370
1805
  HostEvent["UpdateTML"] = "updateTSL";
1371
1806
  /**
1372
- * Triggers the **Download PDF** action on a Liveboard
1807
+ * Trigger the **Download PDF** action on an embedded Liveboard.
1373
1808
  *
1374
1809
  * @example
1375
1810
  * ```js
@@ -1379,8 +1814,8 @@ var HostEvent;
1379
1814
  */
1380
1815
  HostEvent["DownloadAsPdf"] = "downloadAsPdf";
1381
1816
  /**
1382
- * Triggers the **Make a copy** action on a Liveboard, Search, or
1383
- * visualization page
1817
+ * Trigger the **Make a copy** action on a Liveboard, Search, or
1818
+ * visualization page.
1384
1819
  *
1385
1820
  * @example
1386
1821
  * ```js
@@ -1396,7 +1831,7 @@ var HostEvent;
1396
1831
  */
1397
1832
  HostEvent["MakeACopy"] = "makeACopy";
1398
1833
  /**
1399
- * Triggers the **Delete** action on a Liveboard
1834
+ * Trigger the **Delete** action for a Liveboard.
1400
1835
  *
1401
1836
  * @example
1402
1837
  * ```js
@@ -1406,7 +1841,7 @@ var HostEvent;
1406
1841
  */
1407
1842
  HostEvent["Remove"] = "delete";
1408
1843
  /**
1409
- * Triggers the **Explore* action on a visualization
1844
+ * Trigger the **Explore** action on a visualization.
1410
1845
  *
1411
1846
  * @param - an object with `vizId` as a key
1412
1847
  * @example
@@ -1417,7 +1852,7 @@ var HostEvent;
1417
1852
  */
1418
1853
  HostEvent["Explore"] = "explore";
1419
1854
  /**
1420
- * Triggers the **Create alert** action on a visualization
1855
+ * Trigger the **Create alert** action on a visualization
1421
1856
  *
1422
1857
  * @param - an object with `vizId` as a key
1423
1858
  * @example
@@ -1430,7 +1865,7 @@ var HostEvent;
1430
1865
  */
1431
1866
  HostEvent["CreateMonitor"] = "createMonitor";
1432
1867
  /**
1433
- * Triggers the **Manage alerts** action on a visualization
1868
+ * Trigger the **Manage alerts** action on a visualization
1434
1869
  *
1435
1870
  * @param - an object with `vizId` as a key
1436
1871
  * @example
@@ -1443,7 +1878,7 @@ var HostEvent;
1443
1878
  */
1444
1879
  HostEvent["ManageMonitor"] = "manageMonitor";
1445
1880
  /**
1446
- * Triggers the **Edit** action on a Liveboard or visualization
1881
+ * Trigger the **Edit** action on a Liveboard or visualization
1447
1882
  *
1448
1883
  * @param - object - To trigger the action for a specific visualization
1449
1884
  * in Liveboard embed, pass in `vizId` as a key.
@@ -1464,7 +1899,7 @@ var HostEvent;
1464
1899
  */
1465
1900
  HostEvent["Edit"] = "edit";
1466
1901
  /**
1467
- * Triggers the **Copy link** action on a Liveboard or visualization
1902
+ * Trigger the **Copy link** action on a Liveboard or visualization
1468
1903
  *
1469
1904
  * @param - object - to trigger the action for a
1470
1905
  * specific visualization in Liveboard embed, pass in `vizId` as a key
@@ -1482,7 +1917,7 @@ var HostEvent;
1482
1917
  */
1483
1918
  HostEvent["CopyLink"] = "embedDocument";
1484
1919
  /**
1485
- * Triggers the **Present** action on a Liveboard or visualization
1920
+ * Trigger the **Present** action on a Liveboard or visualization
1486
1921
  *
1487
1922
  * @param - object - to trigger the action for a specific visualization
1488
1923
  * in Liveboard embed, pass in `vizId` as a key
@@ -1500,7 +1935,7 @@ var HostEvent;
1500
1935
  */
1501
1936
  HostEvent["Present"] = "present";
1502
1937
  /**
1503
- * Gets TML for the current search.
1938
+ * Get TML for the current search.
1504
1939
  *
1505
1940
  * @example
1506
1941
  * ```js
@@ -1515,7 +1950,7 @@ var HostEvent;
1515
1950
  */
1516
1951
  HostEvent["GetTML"] = "getTML";
1517
1952
  /**
1518
- * Triggers the **Show underlying data** action on visualization or search
1953
+ * Trigger the **Show underlying data** action on visualization or search
1519
1954
  *
1520
1955
  * @param - an object with vizId as a key
1521
1956
  * @example
@@ -1533,7 +1968,9 @@ var HostEvent;
1533
1968
  */
1534
1969
  HostEvent["ShowUnderlyingData"] = "showUnderlyingData";
1535
1970
  /**
1536
- * Triggers the **Delete** action on visualization or search
1971
+ * Trigger the **Delete** action for a visualization
1972
+ * in an embedded Liveboard, or a chart or table
1973
+ * generated from Search.
1537
1974
  *
1538
1975
  * @param - Liveboard embed takes an object with `vizId` as a key.
1539
1976
  * Can be left empty if embedding Search or visualization.
@@ -1543,16 +1980,13 @@ var HostEvent;
1543
1980
  * '730496d6-6903-4601-937e-2c691821af3c'})
1544
1981
  * ```
1545
1982
  * ```js
1546
- * vizEmbed.trigger(HostEvent.Delete)
1547
- * ```
1548
- * ```js
1549
1983
  * searchEmbed.trigger(HostEvent.Delete)
1550
1984
  * ```
1551
1985
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
1552
1986
  */
1553
1987
  HostEvent["Delete"] = "onDeleteAnswer";
1554
1988
  /**
1555
- * Triggers the **SpotIQ analyze** action on visualization
1989
+ * Trigger the **SpotIQ analyze** action on visualization
1556
1990
  * or search.
1557
1991
  *
1558
1992
  * @param - Liveboard embed takes `vizId` as a
@@ -1573,7 +2007,7 @@ var HostEvent;
1573
2007
  */
1574
2008
  HostEvent["SpotIQAnalyze"] = "spotIQAnalyze";
1575
2009
  /**
1576
- * Triggers the **Download** action on charts in
2010
+ * Trigger the **Download** action on charts in
1577
2011
  * the embedded view.
1578
2012
  *
1579
2013
  * @example
@@ -1582,17 +2016,15 @@ var HostEvent;
1582
2016
  * '730496d6-6903-4601-937e-2c691821af3c'})
1583
2017
  * ```
1584
2018
  * ```js
1585
- * vizEmbed.trigger(HostEvent.Download)
1586
- * ```
1587
- * ```js
1588
- * searchEmbed.trigger(HostEvent.Download)
2019
+ * embed.trigger(HostEvent.Download)
1589
2020
  * ```
1590
- * @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw ,Use {@link DownloadAsPng}
2021
+ * @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw
2022
+ * Use {@link DownloadAsPng}
1591
2023
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
1592
2024
  */
1593
2025
  HostEvent["Download"] = "downloadAsPng";
1594
2026
  /**
1595
- * Triggers the **Download** > **PNG** action on
2027
+ * Trigger the **Download** > **PNG** action on
1596
2028
  * charts in the embedded view.
1597
2029
  *
1598
2030
  * @example
@@ -1608,7 +2040,7 @@ var HostEvent;
1608
2040
  */
1609
2041
  HostEvent["DownloadAsPng"] = "downloadAsPng";
1610
2042
  /**
1611
- * Triggers the **Download** > **CSV** action on tables in
2043
+ * Trigger the **Download** > **CSV** action on tables in
1612
2044
  * the embedded view.
1613
2045
  *
1614
2046
  * @example
@@ -1626,7 +2058,7 @@ var HostEvent;
1626
2058
  */
1627
2059
  HostEvent["DownloadAsCsv"] = "downloadAsCSV";
1628
2060
  /**
1629
- * Triggers the **Download** > **XLSX** action on tables
2061
+ * Trigger the **Download** > **XLSX** action on tables
1630
2062
  * in the embedded view.
1631
2063
  *
1632
2064
  * @example
@@ -1644,7 +2076,7 @@ var HostEvent;
1644
2076
  */
1645
2077
  HostEvent["DownloadAsXlsx"] = "downloadAsXLSX";
1646
2078
  /**
1647
- * Triggers the **Share** action on an embedded
2079
+ * Trigger the **Share** action on an embedded
1648
2080
  * Liveboard or Answer.
1649
2081
  *
1650
2082
  * @example
@@ -1658,7 +2090,7 @@ var HostEvent;
1658
2090
  */
1659
2091
  HostEvent["Share"] = "share";
1660
2092
  /**
1661
- * Triggers the **Save** action on a Liveboard or Answer.
2093
+ * Trigger the **Save** action on a Liveboard or Answer.
1662
2094
  * Saves the changes.
1663
2095
  *
1664
2096
  * @example
@@ -1672,7 +2104,7 @@ var HostEvent;
1672
2104
  */
1673
2105
  HostEvent["Save"] = "save";
1674
2106
  /**
1675
- * Triggers the **Sync to Sheets** action on an embedded visualization or Answer
2107
+ * Trigger the **Sync to Sheets** action on an embedded visualization or Answer
1676
2108
  * Sends data from an Answer or Liveboard visualization to a Google sheet.
1677
2109
  *
1678
2110
  * @param - an object with `vizId` as a key
@@ -1688,7 +2120,7 @@ var HostEvent;
1688
2120
  */
1689
2121
  HostEvent["SyncToSheets"] = "sync-to-sheets";
1690
2122
  /**
1691
- * Triggers the **Sync to Other Apps** action on an embedded visualization or Answer
2123
+ * Trigger the **Sync to Other Apps** action on an embedded visualization or Answer
1692
2124
  * Sends data from an Answer or Liveboard visualization to third-party apps such
1693
2125
  * as Slack, Salesforce, Microsoft Teams, ServiceNow and so on.
1694
2126
  *
@@ -1705,7 +2137,7 @@ var HostEvent;
1705
2137
  */
1706
2138
  HostEvent["SyncToOtherApps"] = "sync-to-other-apps";
1707
2139
  /**
1708
- * Triggers the **Manage pipelines** action on an embedded
2140
+ * Trigger the **Manage pipelines** action on an embedded
1709
2141
  * visualization or Answer.
1710
2142
  * Allows users to manage ThoughtSpot Sync pipelines.
1711
2143
  *
@@ -1722,18 +2154,21 @@ var HostEvent;
1722
2154
  */
1723
2155
  HostEvent["ManagePipelines"] = "manage-pipeline";
1724
2156
  /**
1725
- * Triggers the Reset search on the Search page
2157
+ * Reset search operation on the Search or Answer page.
1726
2158
  *
1727
2159
  * @example
1728
2160
  * ```js
1729
2161
  * searchEmbed.trigger(HostEvent.ResetSearch)
1730
2162
  * ```
2163
+ * ```js
2164
+ * appEmbed.trigger(HostEvent.ResetSearch)
2165
+ * ```
1731
2166
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.0.1.sw
1732
2167
  */
1733
2168
  HostEvent["ResetSearch"] = "resetSearch";
1734
2169
  /**
1735
2170
  * @hidden
1736
- * Gets the currents visible and runtime filters applied on a Liveboard
2171
+ * Get the currents visible and runtime filters applied on a Liveboard
1737
2172
  * @example
1738
2173
  * liveboardEmbed.trigger(HostEvent.GetFilters)
1739
2174
  * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
@@ -1741,7 +2176,7 @@ var HostEvent;
1741
2176
  HostEvent["GetFilters"] = "getFilters";
1742
2177
  /**
1743
2178
  * @hidden
1744
- * Updates the visible filters on the Liveboard.
2179
+ * Update the visible filters on the Liveboard.
1745
2180
  * @param - filter: filter object containing column name and filter operation and values
1746
2181
  * @example
1747
2182
  *
@@ -1754,7 +2189,7 @@ var HostEvent;
1754
2189
  */
1755
2190
  HostEvent["UpdateFilters"] = "updateFilters";
1756
2191
  /**
1757
- * Get Tab for the current Liveboard.
2192
+ * Get tab details for the current Liveboard.
1758
2193
  *
1759
2194
  * @example
1760
2195
  * ```js
@@ -1768,9 +2203,9 @@ var HostEvent;
1768
2203
  */
1769
2204
  HostEvent["GetTabs"] = "getTabs";
1770
2205
  /**
1771
- * Set the visible Tabs on a Liveboard.
2206
+ * Set the visible tabs on a Liveboard.
1772
2207
  *
1773
- * @param - an array of ids of Tabs to show, the ids not passed
2208
+ * @param - an array of ids of tabs to show, the IDs not passed
1774
2209
  * will be hidden.
1775
2210
  * @example
1776
2211
  * ```js
@@ -1784,8 +2219,8 @@ var HostEvent;
1784
2219
  /**
1785
2220
  * Set the hidden tabs on a Liveboard.
1786
2221
  *
1787
- * @param - an array of ids of Tabs to hide, the ids not passed
1788
- * will be shown.
2222
+ * @param - an array of the IDs of the tabs to hide.
2223
+ * The IDs not passed will be shown.
1789
2224
  * @example
1790
2225
  * ```js
1791
2226
  * liveboardEmbed.trigger(HostEvent.SetHiddenTabs, [
@@ -1796,9 +2231,10 @@ var HostEvent;
1796
2231
  */
1797
2232
  HostEvent["SetHiddenTabs"] = "SetPinboardHiddenTabs";
1798
2233
  /**
1799
- * Updates the search query for sage embed.
2234
+ * Updates the search query string for Natural Language Search operations.
1800
2235
  *
1801
- * @param - searchOptions: an object queryString and option to execute the query.
2236
+ * @param - `queryString`: Text string in Natural Language format
2237
+ * @param - `executeSearch`: Boolean to execute search and update search query
1802
2238
  * @example
1803
2239
  * ```js
1804
2240
  * sageEmbed.trigger(HostEvent.UpdateSageQuery, {
@@ -1806,7 +2242,7 @@ var HostEvent;
1806
2242
  * executeSearch: true,
1807
2243
  * })
1808
2244
  * ```
1809
- * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
2245
+ * @version SDK: 1.26.0 | Thoughtspot: 9.8.0.cl, 9.8.0.sw
1810
2246
  */
1811
2247
  HostEvent["UpdateSageQuery"] = "updateSageQuery";
1812
2248
  /**
@@ -1819,26 +2255,27 @@ var HostEvent;
1819
2255
  * vizId: '123', // For Liveboard Visualization.
1820
2256
  * })
1821
2257
  * ```
2258
+ * @version SDK: 1.26.0 | Thoughtspot: 9.10.0.cl
1822
2259
  */
1823
2260
  HostEvent["GetAnswerSession"] = "getAnswerSession";
1824
2261
  })(HostEvent || (HostEvent = {}));
1825
2262
  /**
1826
2263
  * The different visual modes that the data sources panel within
1827
- * search could appear in, i.e., hidden, collapsed, or expanded.
2264
+ * search could appear in, such as hidden, collapsed, or expanded.
1828
2265
  */
1829
2266
  // eslint-disable-next-line no-shadow
1830
2267
  var DataSourceVisualMode;
1831
2268
  (function (DataSourceVisualMode) {
1832
2269
  /**
1833
- * Data source panel is hidden.
2270
+ * The data source panel is hidden.
1834
2271
  */
1835
2272
  DataSourceVisualMode["Hidden"] = "hide";
1836
2273
  /**
1837
- * Data source panel is collapsed, but the user can manually expand it.
2274
+ * The data source panel is collapsed, but the user can manually expand it.
1838
2275
  */
1839
2276
  DataSourceVisualMode["Collapsed"] = "collapse";
1840
2277
  /**
1841
- * Data source panel is expanded, but the user can manually collapse it.
2278
+ * The data source panel is expanded, but the user can manually collapse it.
1842
2279
  */
1843
2280
  DataSourceVisualMode["Expanded"] = "expand";
1844
2281
  })(DataSourceVisualMode || (DataSourceVisualMode = {}));
@@ -1918,6 +2355,7 @@ var Param;
1918
2355
  Param["IsProductTour"] = "isProductTour";
1919
2356
  Param["HideSearchBarTitle"] = "hideSearchBarTitle";
1920
2357
  Param["HideSageAnswerHeader"] = "hideSageAnswerHeader";
2358
+ Param["HideSearchBar"] = "hideSearchBar";
1921
2359
  })(Param || (Param = {}));
1922
2360
  /**
1923
2361
  * ThoughtSpot application pages include actions and menu commands
@@ -1979,9 +2417,11 @@ var Action;
1979
2417
  Action["SaveAsView"] = "saveAsView";
1980
2418
  /**
1981
2419
  * The **Make a copy** action on a Liveboard or Answer
1982
- * page.
1983
- * Creates a copy of the Liveboard, visualization,
1984
- * or Answer.
2420
+ * page. Creates a copy of the Liveboard.
2421
+ * In LiveboardEmbed, the **Make a copy** action is not available for
2422
+ * visualizations in the embedded Liveboard view.
2423
+ * In AppEmbed, the **Make a copy** action is available on both
2424
+ * Liveboards and visualizations.
1985
2425
  *
1986
2426
  * @example
1987
2427
  * ```js
@@ -2165,7 +2605,7 @@ var Action;
2165
2605
  */
2166
2606
  Action["DownloadAsPdf"] = "downloadAsPdf";
2167
2607
  /**
2168
- * The **Download** > **CSV** menu action for tables on a Liveboard
2608
+ * The **Download** > **CSV** menu action for tables on a Liveboard
2169
2609
  * or Answer page.
2170
2610
  * Downloads a visualization or Answer in the XLSX format.
2171
2611
  *
@@ -2696,6 +3136,7 @@ var Action;
2696
3136
  */
2697
3137
  Action["RenameModalTitleDescription"] = "renameModalTitleDescription";
2698
3138
  /**
3139
+ *
2699
3140
  * @version SDK: 1.25.0 | Thoughtspot: 9.6.0.cl
2700
3141
  */
2701
3142
  Action["RequestVerification"] = "requestVerification";
@@ -5392,8 +5833,7 @@ var OperationType;
5392
5833
  * const data = await underlying.fetchData(0, 100);
5393
5834
  * })
5394
5835
  * ```
5395
- * @version
5396
- * ThoughtSpot: 9.9.0.cl / SDK: 1.25.0
5836
+ * @version SDK: 1.25.0| ThoughtSpot: 9.10.0.cl
5397
5837
  * @group Events
5398
5838
  */
5399
5839
  class AnswerService {
@@ -5462,8 +5902,7 @@ class AnswerService {
5462
5902
  * const data = await underlying.fetchData(0, 100);
5463
5903
  * })
5464
5904
  * ```
5465
- * @version
5466
- * ThoughtSpot: 9.9.0.cl / SDK: 1.25.0
5905
+ * @version SDK: 1.25.0| ThoughtSpot: 9.10.0.cl
5467
5906
  */
5468
5907
  async getUnderlyingDataForPoint(outputColumnNames, selectedPoints) {
5469
5908
  if (!selectedPoints && !this.selectedPoints) {
@@ -12372,8 +12811,8 @@ var AuthStatus;
12372
12811
  */
12373
12812
  AuthStatus["LOGOUT"] = "LOGOUT";
12374
12813
  /**
12375
- * Emitted when inPopup: true in the SAMLRedirect flow.
12376
- * And, we are waiting for popup to be triggered either programatically
12814
+ * Emitted when inPopup is true in the SAMLRedirect flow and the
12815
+ * popup is waiting to be triggered either programmatically
12377
12816
  * or by the trigger button.
12378
12817
  *
12379
12818
  * @version SDK: 1.19.0
@@ -12388,8 +12827,8 @@ var AuthStatus;
12388
12827
  var AuthEvent;
12389
12828
  (function (AuthEvent) {
12390
12829
  /**
12391
- * Manually trigger the SSO popup. This is useful with
12392
- * authStatus: SAMLRedirect/OIDCRedicre and inPopup: true
12830
+ * Manually trigger the SSO popup. This is useful when
12831
+ * authStatus is SAMLRedirect/OIDCRedirect and inPopup is set to true
12393
12832
  */
12394
12833
  AuthEvent["TRIGGER_SSO_POPUP"] = "TRIGGER_SSO_POPUP";
12395
12834
  })(AuthEvent || (AuthEvent = {}));
@@ -12688,6 +13127,12 @@ const logout = async (embedConfig) => {
12688
13127
  const { thoughtSpotHost } = embedConfig;
12689
13128
  await fetchLogoutService(thoughtSpotHost);
12690
13129
  resetCachedAuthToken();
13130
+ const thoughtspotIframes = document.querySelectorAll('[data-ts-iframe=\'true\']');
13131
+ if (thoughtspotIframes === null || thoughtspotIframes === void 0 ? void 0 : thoughtspotIframes.length) {
13132
+ thoughtspotIframes.forEach((el) => {
13133
+ el.parentElement.innerHTML = embedConfig.loginFailedMessage;
13134
+ });
13135
+ }
12691
13136
  loggedInStatus = false;
12692
13137
  return loggedInStatus;
12693
13138
  };
@@ -13078,6 +13523,7 @@ function processAuthFailure(e, containerEl) {
13078
13523
  containerEl.innerHTML = loginFailedMessage;
13079
13524
  notifyAuthFailure(AuthFailureType.OTHER);
13080
13525
  }
13526
+ resetCachedAuthToken();
13081
13527
  return e;
13082
13528
  }
13083
13529
  /**
@@ -13089,6 +13535,7 @@ function processAuthLogout(e, containerEl) {
13089
13535
  const { loginFailedMessage } = getEmbedConfig();
13090
13536
  // eslint-disable-next-line no-param-reassign
13091
13537
  containerEl.innerHTML = loginFailedMessage;
13538
+ resetCachedAuthToken();
13092
13539
  disableAutoLogin();
13093
13540
  notifyLogout();
13094
13541
  return e;
@@ -13129,7 +13576,7 @@ const reload = (iFrame) => {
13129
13576
  }, 100);
13130
13577
  };
13131
13578
  /**
13132
- * Post Iframe message.
13579
+ * Post iframe message.
13133
13580
  *
13134
13581
  * @param iFrame
13135
13582
  * @param message
@@ -13174,7 +13621,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
13174
13621
  });
13175
13622
  }
13176
13623
 
13177
- var name="@thoughtspot/visual-embed-sdk";var version="1.26.3";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"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};
13624
+ var name="@thoughtspot/visual-embed-sdk";var version="1.27.0-alpha.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:"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};
13178
13625
 
13179
13626
  /**
13180
13627
  * Copyright (c) 2022
@@ -13230,7 +13677,13 @@ class TsEmbed {
13230
13677
  var _a, _b;
13231
13678
  let authToken = '';
13232
13679
  if (this.embedConfig.authType === AuthType.TrustedAuthTokenCookieless) {
13233
- authToken = await getAuthenticationToken(this.embedConfig);
13680
+ try {
13681
+ authToken = await getAuthenticationToken(this.embedConfig);
13682
+ }
13683
+ catch (e) {
13684
+ processAuthFailure(e, this.isPreRendered ? this.preRenderWrapper : this.el);
13685
+ return;
13686
+ }
13234
13687
  }
13235
13688
  this.isAppInitialized = true;
13236
13689
  responder({
@@ -13259,11 +13712,17 @@ class TsEmbed {
13259
13712
  this.updateAuthToken = async (_, responder) => {
13260
13713
  const { autoLogin = false, authType } = this.embedConfig; // Set autoLogin default to false
13261
13714
  if (authType === AuthType.TrustedAuthTokenCookieless) {
13262
- const authToken = await getAuthenticationToken(this.embedConfig);
13263
- responder({
13264
- type: EmbedEvent.AuthExpire,
13265
- data: { authToken },
13266
- });
13715
+ let authToken = '';
13716
+ try {
13717
+ authToken = await getAuthenticationToken(this.embedConfig);
13718
+ responder({
13719
+ type: EmbedEvent.AuthExpire,
13720
+ data: { authToken },
13721
+ });
13722
+ }
13723
+ catch (e) {
13724
+ processAuthFailure(e, this.isPreRendered ? this.preRenderWrapper : this.el);
13725
+ }
13267
13726
  }
13268
13727
  else if (autoLogin) {
13269
13728
  handleAuth();
@@ -13537,7 +13996,11 @@ class TsEmbed {
13537
13996
  const queryParams = this.shouldEncodeUrlQueryParams
13538
13997
  ? `?base64UrlEncodedFlags=${getEncodedQueryParamsString(queryString)}`
13539
13998
  : `?${queryString}`;
13540
- const path = `${this.thoughtSpotHost}/${queryParams}#`;
13999
+ let host = this.thoughtSpotHost;
14000
+ if (!isUndefined(this.embedConfig.enableReactShell)) {
14001
+ host = this.embedConfig.enableReactShell ? '/v2' : '/v1';
14002
+ }
14003
+ const path = `${host}/${queryParams}#`;
13541
14004
  return path;
13542
14005
  }
13543
14006
  getEmbedParams() {
@@ -13552,6 +14015,7 @@ class TsEmbed {
13552
14015
  const iFrame = document.createElement('iframe');
13553
14016
  iFrame.src = frameSrc;
13554
14017
  iFrame.id = TS_EMBED_ID;
14018
+ iFrame.setAttribute('data-ts-iframe', 'true');
13555
14019
  // according to screenfull.js documentation
13556
14020
  // allowFullscreen, webkitallowfullscreen and mozallowfullscreen must be
13557
14021
  // true
@@ -13937,6 +14401,9 @@ class TsEmbed {
13937
14401
  this.isRendered = true;
13938
14402
  return this;
13939
14403
  }
14404
+ getIframeSrc() {
14405
+ return '';
14406
+ }
13940
14407
  handleRenderForPrerender() {
13941
14408
  this.render();
13942
14409
  }
@@ -14311,7 +14778,7 @@ class AppEmbed extends V1Embed {
14311
14778
  * @param pageId The ID of the page to be embedded.
14312
14779
  */
14313
14780
  getIFrameSrc() {
14314
- const { pageId, path, modularHomeExperience } = this.viewConfig;
14781
+ const { pageId, path, modularHomeExperience, } = this.viewConfig;
14315
14782
  const pageRoute = this.formatPath(path) || this.getPageRoute(pageId, modularHomeExperience);
14316
14783
  let url = `${this.getRootIframeSrc()}/${pageRoute}`;
14317
14784
  const tsPostHashParams = this.getThoughtSpotPostUrlParams();
@@ -14415,8 +14882,9 @@ class AppEmbed extends V1Embed {
14415
14882
  * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
14416
14883
  */
14417
14884
  /**
14418
- * Embed a ThoughtSpot Liveboard or a Thoughtspot visualization. When rendered it already
14419
- * waits for the authentication to complete, so no need to wait for AuthStatus.SUCCESS.
14885
+ * Embed a ThoughtSpot Liveboard or visualization. When rendered it already
14886
+ * waits for the authentication to complete, so you need not wait for
14887
+ * `AuthStatus.SUCCESS`.
14420
14888
  *
14421
14889
  * @example
14422
14890
  * ```js
@@ -14522,7 +14990,7 @@ class LiveboardEmbed extends V1Embed {
14522
14990
  }
14523
14991
  /**
14524
14992
  * Construct the URL of the embedded ThoughtSpot Liveboard or visualization
14525
- * to be loaded within the iframe.
14993
+ * to be loaded within the iFrame.
14526
14994
  */
14527
14995
  getIFrameSrc() {
14528
14996
  var _a;
@@ -14651,7 +15119,7 @@ class SearchEmbed extends TsEmbed {
14651
15119
  }
14652
15120
  getEmbedParams() {
14653
15121
  var _a;
14654
- const { hideResults, expandAllDataSource, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, dataPanelV2 = false, useLastSelectedSources = false, runtimeParameters, } = this.viewConfig;
15122
+ const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = false, useLastSelectedSources = false, runtimeParameters, } = this.viewConfig;
14655
15123
  const queryParams = this.getBaseQueryParams();
14656
15124
  queryParams[Param.HideActions] = [
14657
15125
  ...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
@@ -14678,6 +15146,9 @@ class SearchEmbed extends TsEmbed {
14678
15146
  if (forceTable) {
14679
15147
  queryParams[Param.ForceTable] = true;
14680
15148
  }
15149
+ if (hideSearchBar) {
15150
+ queryParams[Param.HideSearchBar] = true;
15151
+ }
14681
15152
  queryParams[Param.DataPanelV2Enabled] = dataPanelV2;
14682
15153
  queryParams[Param.DataSourceMode] = this.getDataSourceMode();
14683
15154
  queryParams[Param.UseLastSelectedDataSource] = useLastSelectedSources;
@@ -14706,7 +15177,8 @@ class SearchEmbed extends TsEmbed {
14706
15177
  * @param answerId The GUID of a saved answer
14707
15178
  * @param dataSources A list of data source GUIDs
14708
15179
  */
14709
- getIFrameSrc(answerId) {
15180
+ getIFrameSrc() {
15181
+ const { answerId } = this.viewConfig;
14710
15182
  const answerPath = answerId ? `saved-answer/${answerId}` : 'answer';
14711
15183
  const tsPostHashParams = this.getThoughtSpotPostUrlParams();
14712
15184
  return `${this.getRootIframeSrc()}/embed/${answerPath}${tsPostHashParams}`;
@@ -14717,7 +15189,7 @@ class SearchEmbed extends TsEmbed {
14717
15189
  render() {
14718
15190
  super.render();
14719
15191
  const { answerId } = this.viewConfig;
14720
- const src = this.getIFrameSrc(answerId);
15192
+ const src = this.getIFrameSrc();
14721
15193
  this.renderIFrame(src);
14722
15194
  getAuthPromise().then(() => {
14723
15195
  if (checkReleaseVersionInBeta(getReleaseVersion(), getEmbedConfig().suppressSearchEmbedBetaWarning
@@ -14808,7 +15280,7 @@ const HiddenActionItemByDefaultForSageEmbed = [
14808
15280
  Action.Share,
14809
15281
  ];
14810
15282
  /**
14811
- * Embed ThoughtSpot LLM and GPT based natural language search component.
15283
+ * Embed ThoughtSpot LLM and GPT-based Natural Language Search component.
14812
15284
  *
14813
15285
  * @version: SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl, 9.5.1-sw
14814
15286
  * @group Embed components
@@ -14861,15 +15333,16 @@ class SageEmbed extends V1Embed {
14861
15333
  const { dataSource, searchOptions, } = this.viewConfig;
14862
15334
  if (dataSource)
14863
15335
  postHashObj[Param.WorksheetId] = dataSource;
14864
- if (searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.searchQuery) {
14865
- postHashObj[Param.Query] = searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.searchQuery;
14866
- if (searchOptions.executeSearch) {
14867
- postHashObj[Param.executeSearch] = true;
14868
- }
15336
+ if ((searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.searchQuery) && searchOptions.executeSearch) {
15337
+ postHashObj[Param.executeSearch] = true;
14869
15338
  }
14870
15339
  let sagePostHashParams = new URLSearchParams(postHashObj).toString();
14871
15340
  if (sagePostHashParams)
14872
15341
  sagePostHashParams = `${tsPostHashParams ? '&' : '?'}${sagePostHashParams}`;
15342
+ if (searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.searchQuery)
15343
+ sagePostHashParams += `${sagePostHashParams ? '&' : '?'}${[Param.Query]}=${encodeURIComponent(searchOptions.searchQuery)}`;
15344
+ // use encodeURIComponent for query instead of URLSearchParams
15345
+ // as it adds + instead of %20 for spaces
14873
15346
  return `${this.getRootIframeSrc()}/embed/${path}${tsPostHashParams}${sagePostHashParams}`;
14874
15347
  }
14875
15348
  /**