@thoughtspot/visual-embed-sdk 1.20.0 → 1.20.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 (70) hide show
  1. package/dist/src/auth.d.ts +38 -4
  2. package/dist/src/auth.d.ts.map +1 -1
  3. package/dist/src/embed/app.d.ts +2 -2
  4. package/dist/src/embed/base.d.ts +22 -13
  5. package/dist/src/embed/base.d.ts.map +1 -1
  6. package/dist/src/embed/liveboard.d.ts +2 -2
  7. package/dist/src/embed/search-bar.d.ts +4 -1
  8. package/dist/src/embed/search-bar.d.ts.map +1 -1
  9. package/dist/src/embed/search.d.ts +2 -2
  10. package/dist/src/embed/ts-embed.d.ts +35 -1
  11. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  12. package/dist/src/index.d.ts +3 -3
  13. package/dist/src/index.d.ts.map +1 -1
  14. package/dist/src/react/index.d.ts.map +1 -1
  15. package/dist/src/types.d.ts +161 -26
  16. package/dist/src/types.d.ts.map +1 -1
  17. package/dist/tsembed.es.js +193 -35
  18. package/dist/tsembed.js +174 -35
  19. package/lib/package.json +2 -3
  20. package/lib/src/auth.d.ts +38 -4
  21. package/lib/src/auth.d.ts.map +1 -1
  22. package/lib/src/auth.js +17 -2
  23. package/lib/src/auth.js.map +1 -1
  24. package/lib/src/embed/app.d.ts +2 -2
  25. package/lib/src/embed/app.js +1 -1
  26. package/lib/src/embed/base.d.ts +22 -13
  27. package/lib/src/embed/base.d.ts.map +1 -1
  28. package/lib/src/embed/base.js +21 -3
  29. package/lib/src/embed/base.js.map +1 -1
  30. package/lib/src/embed/base.spec.js +2 -2
  31. package/lib/src/embed/base.spec.js.map +1 -1
  32. package/lib/src/embed/liveboard.d.ts +2 -2
  33. package/lib/src/embed/liveboard.js +1 -1
  34. package/lib/src/embed/search-bar.d.ts +4 -1
  35. package/lib/src/embed/search-bar.d.ts.map +1 -1
  36. package/lib/src/embed/search-bar.js +1 -1
  37. package/lib/src/embed/search-bar.js.map +1 -1
  38. package/lib/src/embed/search.d.ts +2 -2
  39. package/lib/src/embed/search.js +1 -1
  40. package/lib/src/embed/ts-embed.d.ts +35 -1
  41. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  42. package/lib/src/embed/ts-embed.js +35 -2
  43. package/lib/src/embed/ts-embed.js.map +1 -1
  44. package/lib/src/index.d.ts +3 -3
  45. package/lib/src/index.d.ts.map +1 -1
  46. package/lib/src/index.js +1 -1
  47. package/lib/src/index.js.map +1 -1
  48. package/lib/src/react/index.d.ts.map +1 -1
  49. package/lib/src/react/index.js +4 -2
  50. package/lib/src/react/index.js.map +1 -1
  51. package/lib/src/react/index.spec.js +14 -2
  52. package/lib/src/react/index.spec.js.map +1 -1
  53. package/lib/src/types.d.ts +161 -26
  54. package/lib/src/types.d.ts.map +1 -1
  55. package/lib/src/types.js +115 -23
  56. package/lib/src/types.js.map +1 -1
  57. package/lib/src/visual-embed-sdk.d.ts +269 -54
  58. package/package.json +2 -3
  59. package/src/auth.ts +51 -5
  60. package/src/embed/app.ts +2 -2
  61. package/src/embed/base.spec.ts +3 -3
  62. package/src/embed/base.ts +26 -7
  63. package/src/embed/liveboard.ts +2 -2
  64. package/src/embed/search-bar.tsx +4 -1
  65. package/src/embed/search.ts +2 -2
  66. package/src/embed/ts-embed.ts +35 -2
  67. package/src/index.ts +24 -2
  68. package/src/react/index.spec.tsx +35 -2
  69. package/src/react/index.tsx +10 -2
  70. package/src/types.ts +162 -25
@@ -180,6 +180,7 @@ function getDOMNode(domSelector) {
180
180
  /**
181
181
  * The authentication mechanism for allowing access to the
182
182
  * the embedded app
183
+ * @group Authentication / Init
183
184
  */
184
185
  // eslint-disable-next-line no-shadow
185
186
  var AuthType;
@@ -209,6 +210,15 @@ var AuthType;
209
210
  /**
210
211
  * SSO using SAML
211
212
  * Will make the host application redirect to the SAML Idp.
213
+ * @example
214
+ * ```js
215
+ * init({
216
+ * // ...
217
+ * authType: AuthType.SAMLRedirect,
218
+ * authTriggerText: 'Login with SAML',
219
+ * authTriggerContainer: '#embed-container',
220
+ * });
221
+ * ```
212
222
  */
213
223
  AuthType["SAMLRedirect"] = "SSO_SAML";
214
224
  /**
@@ -232,6 +242,18 @@ var AuthType;
232
242
  * Trusted authentication server, Use your own authentication server
233
243
  * which returns a bearer token, generated using the secret_key obtained from
234
244
  * ThoughtSpot.
245
+ *
246
+ * @example
247
+ * ```js
248
+ * init({
249
+ * // ...
250
+ * authType: AuthType.TrustedAuthToken,
251
+ * getAuthToken: () => {
252
+ * return fetch('https://my-backend.app/ts-token')
253
+ * .then((response) => response.json())
254
+ * .then((data) => data.token);
255
+ * }
256
+ * ```
235
257
  */
236
258
  AuthType["TrustedAuthToken"] = "AuthServer";
237
259
  /**
@@ -314,6 +336,10 @@ var RuntimeFilterOp;
314
336
  })(RuntimeFilterOp || (RuntimeFilterOp = {}));
315
337
  /**
316
338
  * Event types emitted by the embedded ThoughtSpot application.
339
+ *
340
+ * To add an event listener use the corresponding
341
+ * {@link LiveboardEmbed.on} or {@link AppEmbed.on} or {@link SearchEmbed.on} method.
342
+ * @group Events
317
343
  */
318
344
  // eslint-disable-next-line no-shadow
319
345
  var EmbedEvent;
@@ -642,6 +668,7 @@ var EmbedEvent;
642
668
  *
643
669
  * To trigger an event use the corresponding
644
670
  * {@link LiveboardEmbed.trigger} or {@link AppEmbed.trigger} or {@link SearchEmbed.trigger} method.
671
+ * @group Events
645
672
  */
646
673
  // eslint-disable-next-line no-shadow
647
674
  var HostEvent;
@@ -654,11 +681,13 @@ var HostEvent;
654
681
  * @param - searchQuery - The search query
655
682
  * @param - execute - execute the existing / updated query
656
683
  * @example
684
+ * ```js
657
685
  * searchEmbed.trigger(HostEvent.Search, {
658
- * searchQuery: "[sales] by [item type],
659
- * "dataSourceIds: ["cd252e5c-b552-49a8-821d-3eadaa049cca"]
660
- * "execute": true
686
+ * searchQuery: "[sales] by [item type],
687
+ * dataSourceIds: ["cd252e5c-b552-49a8-821d-3eadaa049cca"]
688
+ * execute: true
661
689
  * })
690
+ * ```
662
691
  */
663
692
  HostEvent["Search"] = "search";
664
693
  /**
@@ -667,10 +696,14 @@ var HostEvent;
667
696
  * eg. { selectedPoints: []}
668
697
  * @param - columnGuid - a string guid of the column to drill by. This is optional,
669
698
  * if not provided it will auto drill by the configured column.
670
- * @example searchEmbed.trigger(HostEvent.DrillDown, {
671
- * points: clickedPointData,
672
- * autoDrillDown: true,
699
+ * @example
700
+ * ```js
701
+ * searchEmbed.trigger(HostEvent.DrillDown, {
702
+ * points: clickedPointData,
703
+ * autoDrillDown: true,
673
704
  * })
705
+ * ```
706
+ *
674
707
  * @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
675
708
  */
676
709
  HostEvent["DrillDown"] = "triggerDrillDown";
@@ -709,7 +742,10 @@ var HostEvent;
709
742
  * Navigate to a specific page in App embed without any reload.
710
743
  * This is the same as calling `appEmbed.navigateToPage(path, true)`
711
744
  * @param - path - the path to navigate to (can be a number[1/-1] to go forward/back)
712
- * @example appEmbed.navigateToPage(-1)
745
+ * @example
746
+ * ```js
747
+ * appEmbed.navigateToPage(-1)
748
+ * ```
713
749
  * @version SDK: 1.12.0 | ThoughtSpot 8.4.0.cl, 8.4.1-sw
714
750
  */
715
751
  HostEvent["Navigate"] = "Navigate";
@@ -717,27 +753,39 @@ var HostEvent;
717
753
  * Opens the filter panel for a particular column.
718
754
  * Works with Search embed.
719
755
  * @param - { columnId: string, name: string, type: INT64/CHAR/DATE, dataType: ATTRIBUTE/MEASURE }
720
- * @example searchEmbed.trigger(HostEvent.OpenFilter, { columnId: '123', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE' })
756
+ * @example
757
+ * ```js
758
+ * searchEmbed.trigger(HostEvent.OpenFilter, { columnId: '123', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE' })
759
+ * ```
721
760
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
722
761
  */
723
762
  HostEvent["OpenFilter"] = "openFilter";
724
763
  /**
725
764
  * Adds the columns to the current Search.
726
765
  * @param - { columnIds: string[] }
727
- * @example searchEmbed.trigger(HostEvent.AddColumns, { columnIds: ['123', '456'] })
766
+ * @example
767
+ * ```js
768
+ * searchEmbed.trigger(HostEvent.AddColumns, { columnIds: ['123', '456'] })
769
+ * ```
728
770
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
729
771
  */
730
772
  HostEvent["AddColumns"] = "addColumns";
731
773
  /**
732
774
  * Removes a column from the current Search.
733
775
  * @param - { columnId: string }
734
- * @example - searchEmbed.trigger(HostEvent.RemoveColumn, { columnId: '123' })
776
+ * @example
777
+ * ```js
778
+ * searchEmbed.trigger(HostEvent.RemoveColumn, { columnId: '123' })
779
+ * ```
735
780
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
736
781
  */
737
782
  HostEvent["RemoveColumn"] = "removeColumn";
738
783
  /**
739
784
  * Gets the current pinboard content.
740
- * @example liveboardEmbed.trigger(HostEvent.getExportRequestForCurrentPinboard)
785
+ * @example
786
+ * ```js
787
+ * liveboardEmbed.trigger(HostEvent.getExportRequestForCurrentPinboard)
788
+ * ```
741
789
  * @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl, 8.8.1-sw
742
790
  */
743
791
  HostEvent["getExportRequestForCurrentPinboard"] = "getExportRequestForCurrentPinboard";
@@ -746,87 +794,124 @@ var HostEvent;
746
794
  * @param - incase of Liveboard embed, takes in an object with vizId as a key
747
795
  * can be left empty for search and visualization embeds
748
796
  * @example
797
+ * ```js
749
798
  * liveboardEmbed.trigger(HostEvent.Pin, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
750
799
  * vizEmbed.trigger(HostEvent.Pin)
751
800
  * searchEmbed.trigger(HostEvent.Pin)
801
+ * ```
752
802
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
753
803
  */
754
804
  HostEvent["Pin"] = "pin";
755
805
  /**
756
806
  * Triggers the Show Liveboard details action on a Liveboard
757
- * @example liveboardEmbed.trigger(HostEvent.LiveboardInfo)
807
+ * @example
808
+ * ```js
809
+ * liveboardEmbed.trigger(HostEvent.LiveboardInfo)
810
+ * ```
758
811
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
759
812
  */
760
813
  HostEvent["LiveboardInfo"] = "pinboardInfo";
761
814
  /**
762
815
  * Triggers the Schedule action on a Liveboard
763
- * @example liveboardEmbed.trigger(HostEvent.Schedule)
816
+ * @example
817
+ * ```js
818
+ * liveboardEmbed.trigger(HostEvent.Schedule)
819
+ * ```
764
820
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
765
821
  */
766
822
  HostEvent["Schedule"] = "subscription";
767
823
  /**
768
824
  * Triggers the Manage schedule action on a Liveboard
769
- * @example liveboardEmbed.trigger(HostEvent.ScheduleList)
825
+ * @example
826
+ * ```js
827
+ * liveboardEmbed.trigger(HostEvent.ScheduleList)
828
+ * ```
770
829
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
771
830
  */
772
831
  HostEvent["SchedulesList"] = "schedule-list";
773
832
  /**
774
833
  * Triggers the Export TML action on a Liveboard
775
- * @example liveboardEmbed.trigger(HostEvent.ExportTML)
834
+ * @example
835
+ * ```js
836
+ * liveboardEmbed.trigger(HostEvent.ExportTML)
837
+ * ```
776
838
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
777
839
  */
778
840
  HostEvent["ExportTML"] = "exportTSL";
779
841
  /**
780
842
  * Triggers the Edit TML action on a Liveboard
781
- * @example liveboardEmbed.trigger(HostEvent.EditTML)
843
+ * @example
844
+ * ```js
845
+ * liveboardEmbed.trigger(HostEvent.EditTML)
846
+ * ```
782
847
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
783
848
  */
784
849
  HostEvent["EditTML"] = "editTSL";
785
850
  /**
786
851
  * Triggers the Update TML action on a Liveboard
787
- * @example liveboardEmbed.trigger(HostEvent.UpdateTML)
852
+ * @example
853
+ * ```js
854
+ * liveboardEmbed.trigger(HostEvent.UpdateTML)
855
+ * ```
788
856
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
789
857
  */
790
858
  HostEvent["UpdateTML"] = "updateTSL";
791
859
  /**
792
860
  * Triggers the Download PDF action on a Liveboard
793
- * @example liveboardEmbed.trigger(HostEvent.DownloadAsPDF)
861
+ * @example
862
+ * ```js
863
+ * liveboardEmbed.trigger(HostEvent.DownloadAsPDF)
864
+ * ```
794
865
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
795
866
  */
796
867
  HostEvent["DownloadAsPdf"] = "downloadAsPdf";
797
868
  /**
798
869
  * Triggers the Make a copy action on a Liveboard, search or visualization
799
870
  * @example
871
+ * ```js
800
872
  * liveboardEmbed.trigger(HostEvent.MakeACopy, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
801
873
  * vizEmbed.trigger(HostEvent.MakeACopy)
802
874
  * searchEmbed.trigger(HostEvent.MakeACopy)
875
+ * ```
803
876
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
804
877
  */
805
878
  HostEvent["MakeACopy"] = "makeACopy";
806
879
  /**
807
880
  * Triggers the Delete action on a Liveboard
808
- * @example appEmbed.trigger(HostEvent.Remove)
881
+ * @example
882
+ * ```js
883
+ * appEmbed.trigger(HostEvent.Remove)
884
+ * ```
809
885
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
810
886
  */
811
887
  HostEvent["Remove"] = "delete";
812
888
  /**
813
889
  * Triggers the Explore action on a visualization
814
890
  * @param - an object with vizId as a key
815
- * @example liveboardEmbed.trigger(HostEvent.Explore, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
891
+ * @example
892
+ * ```js
893
+ * liveboardEmbed.trigger(HostEvent.Explore, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
894
+ * ```
816
895
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
817
896
  */
818
897
  HostEvent["Explore"] = "explore";
819
898
  /**
820
899
  * Triggers the Create alert action on a visualization
821
900
  * @param - an object with vizId as a key
822
- * @example liveboardEmbed.trigger(HostEvent.CreateMonitor {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
901
+ * @example
902
+ * ```js
903
+ * liveboardEmbed.trigger(HostEvent.CreateMonitor {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
904
+ * ```
823
905
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
824
906
  */
825
907
  HostEvent["CreateMonitor"] = "createMonitor";
826
908
  /**
827
909
  * Triggers the Manage alert action on a visualization
828
910
  * @param - an object with vizId as a key
829
- * @example liveboardEmbed.trigger(HostEvent.ManageMonitor, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
911
+ * @example
912
+ * ```js
913
+ * liveboardEmbed.trigger(HostEvent.ManageMonitor, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
914
+ * ```
830
915
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
831
916
  */
832
917
  HostEvent["ManageMonitor"] = "manageMonitor";
@@ -844,9 +929,11 @@ var HostEvent;
844
929
  * Triggers the Copy link action on a Liveboard or visualization
845
930
  * @param - object - to trigger the action for a specfic visualization in Liveboard embed, pass in vizId as a key
846
931
  * @example
932
+ * ```js
847
933
  * liveboardEmbed.trigger(HostEvent.CopyLink)
848
934
  * liveboardEmbed.trigger(HostEvent.CopyLink, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
849
935
  * vizEmbed.trigger((HostEvent.CopyLink)
936
+ * ```
850
937
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
851
938
  */
852
939
  HostEvent["CopyLink"] = "embedDocument";
@@ -854,15 +941,20 @@ var HostEvent;
854
941
  * Triggers the Present action on a Liveboard or visualization
855
942
  * @param - object - to trigger the action for a specfic visualization in Liveboard embed, pass in vizId as a key
856
943
  * @example
944
+ * ```js
857
945
  * liveboardEmbed.trigger(HostEvent.Present)
858
946
  * liveboardEmbed.trigger(HostEvent.Present, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
859
947
  * vizEmbed.trigger((HostEvent.Present)
948
+ * ```
860
949
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
861
950
  */
862
951
  HostEvent["Present"] = "present";
863
952
  /**
864
953
  * Get TML for the current search.
865
- * @example searchEmbed.trigger(HostEvent.GetTML)
954
+ * @example
955
+ * ```js
956
+ * searchEmbed.trigger(HostEvent.GetTML)
957
+ * ```
866
958
  * @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1-sw
867
959
  */
868
960
  HostEvent["GetTML"] = "getTML";
@@ -8913,6 +9005,11 @@ const EndPoints = {
8913
9005
  BASIC_LOGIN: '/callosum/v1/session/login',
8914
9006
  LOGOUT: '/callosum/v1/session/logout',
8915
9007
  };
9008
+ /**
9009
+ * Enum for auth failure types. This is the parameter passed to the listner
9010
+ * of {@link AuthStatus.FAILURE}.
9011
+ * @group Authentication / Init
9012
+ */
8916
9013
  var AuthFailureType;
8917
9014
  (function (AuthFailureType) {
8918
9015
  AuthFailureType["SDK"] = "SDK";
@@ -8920,6 +9017,10 @@ var AuthFailureType;
8920
9017
  AuthFailureType["EXPIRY"] = "EXPIRY";
8921
9018
  AuthFailureType["OTHER"] = "OTHER";
8922
9019
  })(AuthFailureType || (AuthFailureType = {}));
9020
+ /**
9021
+ * Enum for auth status emitted by the emitter returned from {@link init}.
9022
+ * @group Authentication / Init
9023
+ */
8923
9024
  var AuthStatus;
8924
9025
  (function (AuthStatus) {
8925
9026
  /**
@@ -8946,10 +9047,15 @@ var AuthStatus;
8946
9047
  */
8947
9048
  AuthStatus["WAITING_FOR_POPUP"] = "WAITING_FOR_POPUP";
8948
9049
  })(AuthStatus || (AuthStatus = {}));
9050
+ /**
9051
+ * Events which can be triggered on the emitter returned from {@link init}.
9052
+ * @group Authentication / Init
9053
+ */
8949
9054
  var AuthEvent;
8950
9055
  (function (AuthEvent) {
8951
9056
  /**
8952
- * Manually trigger the SSO popup.
9057
+ * Manually trigger the SSO popup. This is useful with
9058
+ * authStatus: SAMLRedirect/OIDCRedicre and inPopup: true
8953
9059
  */
8954
9060
  AuthEvent["TRIGGER_SSO_POPUP"] = "TRIGGER_SSO_POPUP";
8955
9061
  })(AuthEvent || (AuthEvent = {}));
@@ -9009,8 +9115,9 @@ function getReleaseVersion() {
9009
9115
  return releaseVersion;
9010
9116
  }
9011
9117
  /**
9012
- * Return a promise that resolves with the session info when authentication is
9118
+ * Return a promise that resolves with the session information when authentication is
9013
9119
  * successful. And info is available.
9120
+ * @group Global methods
9014
9121
  */
9015
9122
  function getSessionInfo() {
9016
9123
  return sessionInfoPromise;
@@ -9247,6 +9354,13 @@ const CONFIG_DEFAULTS = {
9247
9354
  authType: AuthType.None,
9248
9355
  };
9249
9356
  let authPromise;
9357
+ /**
9358
+ * Gets the configuration embed was initialized with.
9359
+ *
9360
+ * @returns {@link EmbedConfig} The configuration embed was initialized with.
9361
+ * @version SDK: 1.19.0 | ThoughtSpot: *
9362
+ * @group Global methods
9363
+ */
9250
9364
  const getEmbedConfig = () => config;
9251
9365
  const getAuthPromise = () => authPromise;
9252
9366
  /**
@@ -9277,6 +9391,7 @@ const hostUrlToFeatureUrl = {
9277
9391
  * @param url The URL provided for prefetch
9278
9392
  * @param prefetchFeatures Specify features which needs to be prefetched.
9279
9393
  * @version SDK: 1.4.0 | ThoughtSpot: ts7.sep.cl, 7.2.1
9394
+ * @group Global methods
9280
9395
  */
9281
9396
  const prefetch = (url, prefetchFeatures) => {
9282
9397
  if (url === '') {
@@ -9326,10 +9441,19 @@ function backwardCompat(embedConfig) {
9326
9441
  * authentication if applicable.
9327
9442
  * @param embedConfig The configuration object containing ThoughtSpot host,
9328
9443
  * authentication mechanism and so on.
9329
- * example: authStatus = init(config);
9330
- * authStatus.on(AuthStatus.FAILURE, (reason) => { // do something here });
9331
- * @returns event emitter which emits events on authentication success, failure and logout. See {@link AuthStatus}
9444
+ *
9445
+ * @example
9446
+ * ```js
9447
+ * const authStatus = init({
9448
+ * thoughtSpotHost: 'https://my.thoughtspot.cloud',
9449
+ * authType: AuthType.None,
9450
+ * });
9451
+ * authStatus.on(AuthStatus.FAILURE, (reason) => { // do something here });
9452
+ * ```
9453
+ *
9454
+ * @returns {@link AuthEventEmitter} event emitter which emits events on authentication success, failure and logout. See {@link AuthStatus}
9332
9455
  * @version SDK: 1.0.0 | ThoughtSpot ts7.april.cl, 7.2.1
9456
+ * @group Authentication / Init
9333
9457
  */
9334
9458
  const init = (embedConfig) => {
9335
9459
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
@@ -9371,6 +9495,7 @@ function disableAutoLogin() {
9371
9495
  * @param doNotDisableAutoLogin This flag when passed will not disable autoLogin
9372
9496
  * @returns Promise which resolves when logout completes.
9373
9497
  * @version SDK: 1.10.1 | ThoughtSpot: 8.2.0.cl, 8.4.1-sw
9498
+ * @group Global methods
9374
9499
  */
9375
9500
  const logout$1 = (doNotDisableAutoLogin = false) => {
9376
9501
  if (!doNotDisableAutoLogin) {
@@ -9560,7 +9685,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
9560
9685
  });
9561
9686
  }
9562
9687
 
9563
- var name="@thoughtspot/visual-embed-sdk";var version="1.20.0";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**"];var exports={".":"./lib/src/index.js","./react":{"import":"./lib/src/react/index.js",require:"./cjs/src/react.index.js",types:"./lib/src/react/index.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/index.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":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts",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",prepublishOnly:"npm run test; npm run tsc; npm run bundle-dts; npm run build","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",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","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","@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","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-puppeteer":"^4.4.0",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",puppeteer:"^7.0.1",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-neo-theme":"^1.1.0","typedoc-plugin-toc-group":"0.0.5",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,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};
9688
+ var name="@thoughtspot/visual-embed-sdk";var version="1.20.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/**"];var exports={".":"./lib/src/index.js","./react":{"import":"./lib/src/react/index.js",require:"./cjs/src/react.index.js",types:"./lib/src/react/index.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/index.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":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts",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",prepublishOnly:"npm run test; npm run tsc; npm run bundle-dts; npm run build","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",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","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","@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","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-puppeteer":"^4.4.0",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",puppeteer:"^7.0.1",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,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};
9564
9689
 
9565
9690
  /**
9566
9691
  * Copyright (c) 2022
@@ -10039,6 +10164,20 @@ class TsEmbed {
10039
10164
  * @param messageType The message type
10040
10165
  * @param callback A callback as a function
10041
10166
  * @param options The message options
10167
+ * @example
10168
+ * ```js
10169
+ * tsEmbed.on(EmbedEvent.Error, (data) => {
10170
+ * console.error(data);
10171
+ * });
10172
+ * ```
10173
+ * @example
10174
+ * ```js
10175
+ * tsEmbed.on(EmbedEvent.Save, (data) => {
10176
+ * console.log("Answer save clicked", data);
10177
+ * }, {
10178
+ * start: true // This will trigger the callback on start of save
10179
+ * });
10180
+ * ```
10042
10181
  */
10043
10182
  on(messageType, callback, options = { start: false }) {
10044
10183
  if (this.isRendered) {
@@ -10133,6 +10272,8 @@ class TsEmbed {
10133
10272
  * Base class for embedding v1 experience
10134
10273
  * Note: The v1 version of ThoughtSpot Blink works on the AngularJS stack
10135
10274
  * which is currently under migration to v2
10275
+ *
10276
+ * @inheritdoc
10136
10277
  */
10137
10278
  class V1Embed extends TsEmbed {
10138
10279
  constructor(domSelector, viewConfig) {
@@ -10140,13 +10281,30 @@ class V1Embed extends TsEmbed {
10140
10281
  this.viewConfig = viewConfig;
10141
10282
  }
10142
10283
  /**
10143
- * Render the app in an iframe and set up event handlers
10284
+ * Render the ap p in an iframe and set up event handlers
10144
10285
  * @param iframeSrc
10145
10286
  */
10146
10287
  renderV1Embed(iframeSrc) {
10147
10288
  return this.renderIFrame(iframeSrc, this.viewConfig.frameParams);
10148
10289
  }
10149
- // @override
10290
+ /**
10291
+ * @inheritdoc TsEmbed.on
10292
+ *
10293
+ * @example
10294
+ * ```js
10295
+ * tsEmbed.on(EmbedEvent.Error, (data) => {
10296
+ * console.error(data);
10297
+ * });
10298
+ * ```
10299
+ * @example
10300
+ * ```js
10301
+ * tsEmbed.on(EmbedEvent.Save, (data) => {
10302
+ * console.log("Answer save clicked", data);
10303
+ * }, {
10304
+ * start: true // This will trigger the callback on start of save
10305
+ * });
10306
+ * ```
10307
+ */
10150
10308
  on(messageType, callback, options = { start: false }) {
10151
10309
  const eventType = this.getCompatibleEventType(messageType);
10152
10310
  uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_ON}-${messageType}`);
@@ -10201,7 +10359,7 @@ var Page;
10201
10359
  })(Page || (Page = {}));
10202
10360
  /**
10203
10361
  * Embeds full ThoughtSpot experience in a host application.
10204
- * @Category App Embed
10362
+ * @group Embed components
10205
10363
  */
10206
10364
  class AppEmbed extends V1Embed {
10207
10365
  // eslint-disable-next-line no-useless-constructor
@@ -10335,7 +10493,7 @@ class AppEmbed extends V1Embed {
10335
10493
  */
10336
10494
  /**
10337
10495
  * Embed a ThoughtSpot Liveboard or visualization
10338
- * @Category Liveboards and Charts
10496
+ * @group Embed components
10339
10497
  */
10340
10498
  class LiveboardEmbed extends V1Embed {
10341
10499
  // eslint-disable-next-line no-useless-constructor
@@ -10478,7 +10636,7 @@ const HiddenActionItemByDefaultForSearchEmbed = [
10478
10636
  /**
10479
10637
  * Embed ThoughtSpot search
10480
10638
  *
10481
- * @Category Search Embed
10639
+ * @group Embed components
10482
10640
  */
10483
10641
  class SearchEmbed extends TsEmbed {
10484
10642
  constructor(domSelector, viewConfig) {
@@ -10570,8 +10728,8 @@ class SearchEmbed extends TsEmbed {
10570
10728
  /**
10571
10729
  * Embed ThoughtSpot search bar
10572
10730
  *
10573
- * @Category Search Embed
10574
10731
  * @version: SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1-sw
10732
+ * @group Embed components
10575
10733
  */
10576
10734
  class SearchBarEmbed extends TsEmbed {
10577
10735
  constructor(domSelector, viewConfig) {