@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.
- package/dist/src/auth.d.ts +38 -4
- package/dist/src/auth.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +2 -2
- package/dist/src/embed/base.d.ts +22 -13
- package/dist/src/embed/base.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +2 -2
- package/dist/src/embed/search-bar.d.ts +4 -1
- package/dist/src/embed/search-bar.d.ts.map +1 -1
- package/dist/src/embed/search.d.ts +2 -2
- package/dist/src/embed/ts-embed.d.ts +35 -1
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/index.d.ts +3 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +161 -26
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsembed.es.js +193 -35
- package/dist/tsembed.js +174 -35
- package/lib/package.json +2 -3
- package/lib/src/auth.d.ts +38 -4
- package/lib/src/auth.d.ts.map +1 -1
- package/lib/src/auth.js +17 -2
- package/lib/src/auth.js.map +1 -1
- package/lib/src/embed/app.d.ts +2 -2
- package/lib/src/embed/app.js +1 -1
- package/lib/src/embed/base.d.ts +22 -13
- package/lib/src/embed/base.d.ts.map +1 -1
- package/lib/src/embed/base.js +21 -3
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/base.spec.js +2 -2
- package/lib/src/embed/base.spec.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +2 -2
- package/lib/src/embed/liveboard.js +1 -1
- package/lib/src/embed/search-bar.d.ts +4 -1
- package/lib/src/embed/search-bar.d.ts.map +1 -1
- package/lib/src/embed/search-bar.js +1 -1
- package/lib/src/embed/search-bar.js.map +1 -1
- package/lib/src/embed/search.d.ts +2 -2
- package/lib/src/embed/search.js +1 -1
- package/lib/src/embed/ts-embed.d.ts +35 -1
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +35 -2
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/index.d.ts +3 -3
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +1 -1
- package/lib/src/index.js.map +1 -1
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +4 -2
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/react/index.spec.js +14 -2
- package/lib/src/react/index.spec.js.map +1 -1
- package/lib/src/types.d.ts +161 -26
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +115 -23
- package/lib/src/types.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +269 -54
- package/package.json +2 -3
- package/src/auth.ts +51 -5
- package/src/embed/app.ts +2 -2
- package/src/embed/base.spec.ts +3 -3
- package/src/embed/base.ts +26 -7
- package/src/embed/liveboard.ts +2 -2
- package/src/embed/search-bar.tsx +4 -1
- package/src/embed/search.ts +2 -2
- package/src/embed/ts-embed.ts +35 -2
- package/src/index.ts +24 -2
- package/src/react/index.spec.tsx +35 -2
- package/src/react/index.tsx +10 -2
- package/src/types.ts +162 -25
package/dist/tsembed.js
CHANGED
|
@@ -209,6 +209,15 @@
|
|
|
209
209
|
/**
|
|
210
210
|
* SSO using SAML
|
|
211
211
|
* Will make the host application redirect to the SAML Idp.
|
|
212
|
+
* @example
|
|
213
|
+
* ```js
|
|
214
|
+
* init({
|
|
215
|
+
* // ...
|
|
216
|
+
* authType: AuthType.SAMLRedirect,
|
|
217
|
+
* authTriggerText: 'Login with SAML',
|
|
218
|
+
* authTriggerContainer: '#embed-container',
|
|
219
|
+
* });
|
|
220
|
+
* ```
|
|
212
221
|
*/
|
|
213
222
|
AuthType["SAMLRedirect"] = "SSO_SAML";
|
|
214
223
|
/**
|
|
@@ -232,6 +241,18 @@
|
|
|
232
241
|
* Trusted authentication server, Use your own authentication server
|
|
233
242
|
* which returns a bearer token, generated using the secret_key obtained from
|
|
234
243
|
* ThoughtSpot.
|
|
244
|
+
*
|
|
245
|
+
* @example
|
|
246
|
+
* ```js
|
|
247
|
+
* init({
|
|
248
|
+
* // ...
|
|
249
|
+
* authType: AuthType.TrustedAuthToken,
|
|
250
|
+
* getAuthToken: () => {
|
|
251
|
+
* return fetch('https://my-backend.app/ts-token')
|
|
252
|
+
* .then((response) => response.json())
|
|
253
|
+
* .then((data) => data.token);
|
|
254
|
+
* }
|
|
255
|
+
* ```
|
|
235
256
|
*/
|
|
236
257
|
AuthType["TrustedAuthToken"] = "AuthServer";
|
|
237
258
|
/**
|
|
@@ -635,11 +656,13 @@
|
|
|
635
656
|
* @param - searchQuery - The search query
|
|
636
657
|
* @param - execute - execute the existing / updated query
|
|
637
658
|
* @example
|
|
659
|
+
* ```js
|
|
638
660
|
* searchEmbed.trigger(HostEvent.Search, {
|
|
639
|
-
*
|
|
640
|
-
*
|
|
641
|
-
*
|
|
661
|
+
* searchQuery: "[sales] by [item type],
|
|
662
|
+
* dataSourceIds: ["cd252e5c-b552-49a8-821d-3eadaa049cca"]
|
|
663
|
+
* execute: true
|
|
642
664
|
* })
|
|
665
|
+
* ```
|
|
643
666
|
*/
|
|
644
667
|
HostEvent["Search"] = "search";
|
|
645
668
|
/**
|
|
@@ -648,10 +671,14 @@
|
|
|
648
671
|
* eg. { selectedPoints: []}
|
|
649
672
|
* @param - columnGuid - a string guid of the column to drill by. This is optional,
|
|
650
673
|
* if not provided it will auto drill by the configured column.
|
|
651
|
-
* @example
|
|
652
|
-
*
|
|
653
|
-
*
|
|
674
|
+
* @example
|
|
675
|
+
* ```js
|
|
676
|
+
* searchEmbed.trigger(HostEvent.DrillDown, {
|
|
677
|
+
* points: clickedPointData,
|
|
678
|
+
* autoDrillDown: true,
|
|
654
679
|
* })
|
|
680
|
+
* ```
|
|
681
|
+
*
|
|
655
682
|
* @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
|
|
656
683
|
*/
|
|
657
684
|
HostEvent["DrillDown"] = "triggerDrillDown";
|
|
@@ -690,7 +717,10 @@
|
|
|
690
717
|
* Navigate to a specific page in App embed without any reload.
|
|
691
718
|
* This is the same as calling `appEmbed.navigateToPage(path, true)`
|
|
692
719
|
* @param - path - the path to navigate to (can be a number[1/-1] to go forward/back)
|
|
693
|
-
* @example
|
|
720
|
+
* @example
|
|
721
|
+
* ```js
|
|
722
|
+
* appEmbed.navigateToPage(-1)
|
|
723
|
+
* ```
|
|
694
724
|
* @version SDK: 1.12.0 | ThoughtSpot 8.4.0.cl, 8.4.1-sw
|
|
695
725
|
*/
|
|
696
726
|
HostEvent["Navigate"] = "Navigate";
|
|
@@ -698,27 +728,39 @@
|
|
|
698
728
|
* Opens the filter panel for a particular column.
|
|
699
729
|
* Works with Search embed.
|
|
700
730
|
* @param - { columnId: string, name: string, type: INT64/CHAR/DATE, dataType: ATTRIBUTE/MEASURE }
|
|
701
|
-
* @example
|
|
731
|
+
* @example
|
|
732
|
+
* ```js
|
|
733
|
+
* searchEmbed.trigger(HostEvent.OpenFilter, { columnId: '123', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE' })
|
|
734
|
+
* ```
|
|
702
735
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
703
736
|
*/
|
|
704
737
|
HostEvent["OpenFilter"] = "openFilter";
|
|
705
738
|
/**
|
|
706
739
|
* Adds the columns to the current Search.
|
|
707
740
|
* @param - { columnIds: string[] }
|
|
708
|
-
* @example
|
|
741
|
+
* @example
|
|
742
|
+
* ```js
|
|
743
|
+
* searchEmbed.trigger(HostEvent.AddColumns, { columnIds: ['123', '456'] })
|
|
744
|
+
* ```
|
|
709
745
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
710
746
|
*/
|
|
711
747
|
HostEvent["AddColumns"] = "addColumns";
|
|
712
748
|
/**
|
|
713
749
|
* Removes a column from the current Search.
|
|
714
750
|
* @param - { columnId: string }
|
|
715
|
-
* @example
|
|
751
|
+
* @example
|
|
752
|
+
* ```js
|
|
753
|
+
* searchEmbed.trigger(HostEvent.RemoveColumn, { columnId: '123' })
|
|
754
|
+
* ```
|
|
716
755
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
717
756
|
*/
|
|
718
757
|
HostEvent["RemoveColumn"] = "removeColumn";
|
|
719
758
|
/**
|
|
720
759
|
* Gets the current pinboard content.
|
|
721
|
-
* @example
|
|
760
|
+
* @example
|
|
761
|
+
* ```js
|
|
762
|
+
* liveboardEmbed.trigger(HostEvent.getExportRequestForCurrentPinboard)
|
|
763
|
+
* ```
|
|
722
764
|
* @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl, 8.8.1-sw
|
|
723
765
|
*/
|
|
724
766
|
HostEvent["getExportRequestForCurrentPinboard"] = "getExportRequestForCurrentPinboard";
|
|
@@ -727,87 +769,124 @@
|
|
|
727
769
|
* @param - incase of Liveboard embed, takes in an object with vizId as a key
|
|
728
770
|
* can be left empty for search and visualization embeds
|
|
729
771
|
* @example
|
|
772
|
+
* ```js
|
|
730
773
|
* liveboardEmbed.trigger(HostEvent.Pin, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
731
774
|
* vizEmbed.trigger(HostEvent.Pin)
|
|
732
775
|
* searchEmbed.trigger(HostEvent.Pin)
|
|
776
|
+
* ```
|
|
733
777
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
734
778
|
*/
|
|
735
779
|
HostEvent["Pin"] = "pin";
|
|
736
780
|
/**
|
|
737
781
|
* Triggers the Show Liveboard details action on a Liveboard
|
|
738
|
-
* @example
|
|
782
|
+
* @example
|
|
783
|
+
* ```js
|
|
784
|
+
* liveboardEmbed.trigger(HostEvent.LiveboardInfo)
|
|
785
|
+
* ```
|
|
739
786
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
740
787
|
*/
|
|
741
788
|
HostEvent["LiveboardInfo"] = "pinboardInfo";
|
|
742
789
|
/**
|
|
743
790
|
* Triggers the Schedule action on a Liveboard
|
|
744
|
-
* @example
|
|
791
|
+
* @example
|
|
792
|
+
* ```js
|
|
793
|
+
* liveboardEmbed.trigger(HostEvent.Schedule)
|
|
794
|
+
* ```
|
|
745
795
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
746
796
|
*/
|
|
747
797
|
HostEvent["Schedule"] = "subscription";
|
|
748
798
|
/**
|
|
749
799
|
* Triggers the Manage schedule action on a Liveboard
|
|
750
|
-
* @example
|
|
800
|
+
* @example
|
|
801
|
+
* ```js
|
|
802
|
+
* liveboardEmbed.trigger(HostEvent.ScheduleList)
|
|
803
|
+
* ```
|
|
751
804
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
752
805
|
*/
|
|
753
806
|
HostEvent["SchedulesList"] = "schedule-list";
|
|
754
807
|
/**
|
|
755
808
|
* Triggers the Export TML action on a Liveboard
|
|
756
|
-
* @example
|
|
809
|
+
* @example
|
|
810
|
+
* ```js
|
|
811
|
+
* liveboardEmbed.trigger(HostEvent.ExportTML)
|
|
812
|
+
* ```
|
|
757
813
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
758
814
|
*/
|
|
759
815
|
HostEvent["ExportTML"] = "exportTSL";
|
|
760
816
|
/**
|
|
761
817
|
* Triggers the Edit TML action on a Liveboard
|
|
762
|
-
* @example
|
|
818
|
+
* @example
|
|
819
|
+
* ```js
|
|
820
|
+
* liveboardEmbed.trigger(HostEvent.EditTML)
|
|
821
|
+
* ```
|
|
763
822
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
764
823
|
*/
|
|
765
824
|
HostEvent["EditTML"] = "editTSL";
|
|
766
825
|
/**
|
|
767
826
|
* Triggers the Update TML action on a Liveboard
|
|
768
|
-
* @example
|
|
827
|
+
* @example
|
|
828
|
+
* ```js
|
|
829
|
+
* liveboardEmbed.trigger(HostEvent.UpdateTML)
|
|
830
|
+
* ```
|
|
769
831
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
770
832
|
*/
|
|
771
833
|
HostEvent["UpdateTML"] = "updateTSL";
|
|
772
834
|
/**
|
|
773
835
|
* Triggers the Download PDF action on a Liveboard
|
|
774
|
-
* @example
|
|
836
|
+
* @example
|
|
837
|
+
* ```js
|
|
838
|
+
* liveboardEmbed.trigger(HostEvent.DownloadAsPDF)
|
|
839
|
+
* ```
|
|
775
840
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
776
841
|
*/
|
|
777
842
|
HostEvent["DownloadAsPdf"] = "downloadAsPdf";
|
|
778
843
|
/**
|
|
779
844
|
* Triggers the Make a copy action on a Liveboard, search or visualization
|
|
780
845
|
* @example
|
|
846
|
+
* ```js
|
|
781
847
|
* liveboardEmbed.trigger(HostEvent.MakeACopy, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
782
848
|
* vizEmbed.trigger(HostEvent.MakeACopy)
|
|
783
849
|
* searchEmbed.trigger(HostEvent.MakeACopy)
|
|
850
|
+
* ```
|
|
784
851
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
785
852
|
*/
|
|
786
853
|
HostEvent["MakeACopy"] = "makeACopy";
|
|
787
854
|
/**
|
|
788
855
|
* Triggers the Delete action on a Liveboard
|
|
789
|
-
* @example
|
|
856
|
+
* @example
|
|
857
|
+
* ```js
|
|
858
|
+
* appEmbed.trigger(HostEvent.Remove)
|
|
859
|
+
* ```
|
|
790
860
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
791
861
|
*/
|
|
792
862
|
HostEvent["Remove"] = "delete";
|
|
793
863
|
/**
|
|
794
864
|
* Triggers the Explore action on a visualization
|
|
795
865
|
* @param - an object with vizId as a key
|
|
796
|
-
* @example
|
|
866
|
+
* @example
|
|
867
|
+
* ```js
|
|
868
|
+
* liveboardEmbed.trigger(HostEvent.Explore, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
869
|
+
* ```
|
|
797
870
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
798
871
|
*/
|
|
799
872
|
HostEvent["Explore"] = "explore";
|
|
800
873
|
/**
|
|
801
874
|
* Triggers the Create alert action on a visualization
|
|
802
875
|
* @param - an object with vizId as a key
|
|
803
|
-
* @example
|
|
876
|
+
* @example
|
|
877
|
+
* ```js
|
|
878
|
+
* liveboardEmbed.trigger(HostEvent.CreateMonitor {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
879
|
+
* ```
|
|
804
880
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
805
881
|
*/
|
|
806
882
|
HostEvent["CreateMonitor"] = "createMonitor";
|
|
807
883
|
/**
|
|
808
884
|
* Triggers the Manage alert action on a visualization
|
|
809
885
|
* @param - an object with vizId as a key
|
|
810
|
-
* @example
|
|
886
|
+
* @example
|
|
887
|
+
* ```js
|
|
888
|
+
* liveboardEmbed.trigger(HostEvent.ManageMonitor, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
889
|
+
* ```
|
|
811
890
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
812
891
|
*/
|
|
813
892
|
HostEvent["ManageMonitor"] = "manageMonitor";
|
|
@@ -825,9 +904,11 @@
|
|
|
825
904
|
* Triggers the Copy link action on a Liveboard or visualization
|
|
826
905
|
* @param - object - to trigger the action for a specfic visualization in Liveboard embed, pass in vizId as a key
|
|
827
906
|
* @example
|
|
907
|
+
* ```js
|
|
828
908
|
* liveboardEmbed.trigger(HostEvent.CopyLink)
|
|
829
909
|
* liveboardEmbed.trigger(HostEvent.CopyLink, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
830
910
|
* vizEmbed.trigger((HostEvent.CopyLink)
|
|
911
|
+
* ```
|
|
831
912
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
832
913
|
*/
|
|
833
914
|
HostEvent["CopyLink"] = "embedDocument";
|
|
@@ -835,15 +916,20 @@
|
|
|
835
916
|
* Triggers the Present action on a Liveboard or visualization
|
|
836
917
|
* @param - object - to trigger the action for a specfic visualization in Liveboard embed, pass in vizId as a key
|
|
837
918
|
* @example
|
|
919
|
+
* ```js
|
|
838
920
|
* liveboardEmbed.trigger(HostEvent.Present)
|
|
839
921
|
* liveboardEmbed.trigger(HostEvent.Present, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
840
922
|
* vizEmbed.trigger((HostEvent.Present)
|
|
923
|
+
* ```
|
|
841
924
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
842
925
|
*/
|
|
843
926
|
HostEvent["Present"] = "present";
|
|
844
927
|
/**
|
|
845
928
|
* Get TML for the current search.
|
|
846
|
-
* @example
|
|
929
|
+
* @example
|
|
930
|
+
* ```js
|
|
931
|
+
* searchEmbed.trigger(HostEvent.GetTML)
|
|
932
|
+
* ```
|
|
847
933
|
* @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1-sw
|
|
848
934
|
*/
|
|
849
935
|
HostEvent["GetTML"] = "getTML";
|
|
@@ -8914,7 +9000,8 @@
|
|
|
8914
9000
|
})(exports.AuthStatus || (exports.AuthStatus = {}));
|
|
8915
9001
|
(function (AuthEvent) {
|
|
8916
9002
|
/**
|
|
8917
|
-
* Manually trigger the SSO popup.
|
|
9003
|
+
* Manually trigger the SSO popup. This is useful with
|
|
9004
|
+
* authStatus: SAMLRedirect/OIDCRedicre and inPopup: true
|
|
8918
9005
|
*/
|
|
8919
9006
|
AuthEvent["TRIGGER_SSO_POPUP"] = "TRIGGER_SSO_POPUP";
|
|
8920
9007
|
})(exports.AuthEvent || (exports.AuthEvent = {}));
|
|
@@ -8974,8 +9061,9 @@
|
|
|
8974
9061
|
return releaseVersion;
|
|
8975
9062
|
}
|
|
8976
9063
|
/**
|
|
8977
|
-
* Return a promise that resolves with the session
|
|
9064
|
+
* Return a promise that resolves with the session information when authentication is
|
|
8978
9065
|
* successful. And info is available.
|
|
9066
|
+
* @group Global methods
|
|
8979
9067
|
*/
|
|
8980
9068
|
function getSessionInfo() {
|
|
8981
9069
|
return sessionInfoPromise;
|
|
@@ -9212,6 +9300,13 @@
|
|
|
9212
9300
|
authType: exports.AuthType.None,
|
|
9213
9301
|
};
|
|
9214
9302
|
let authPromise;
|
|
9303
|
+
/**
|
|
9304
|
+
* Gets the configuration embed was initialized with.
|
|
9305
|
+
*
|
|
9306
|
+
* @returns {@link EmbedConfig} The configuration embed was initialized with.
|
|
9307
|
+
* @version SDK: 1.19.0 | ThoughtSpot: *
|
|
9308
|
+
* @group Global methods
|
|
9309
|
+
*/
|
|
9215
9310
|
const getEmbedConfig = () => config;
|
|
9216
9311
|
const getAuthPromise = () => authPromise;
|
|
9217
9312
|
/**
|
|
@@ -9242,6 +9337,7 @@
|
|
|
9242
9337
|
* @param url The URL provided for prefetch
|
|
9243
9338
|
* @param prefetchFeatures Specify features which needs to be prefetched.
|
|
9244
9339
|
* @version SDK: 1.4.0 | ThoughtSpot: ts7.sep.cl, 7.2.1
|
|
9340
|
+
* @group Global methods
|
|
9245
9341
|
*/
|
|
9246
9342
|
const prefetch = (url, prefetchFeatures) => {
|
|
9247
9343
|
if (url === '') {
|
|
@@ -9291,10 +9387,19 @@
|
|
|
9291
9387
|
* authentication if applicable.
|
|
9292
9388
|
* @param embedConfig The configuration object containing ThoughtSpot host,
|
|
9293
9389
|
* authentication mechanism and so on.
|
|
9294
|
-
*
|
|
9295
|
-
*
|
|
9296
|
-
*
|
|
9390
|
+
*
|
|
9391
|
+
* @example
|
|
9392
|
+
* ```js
|
|
9393
|
+
* const authStatus = init({
|
|
9394
|
+
* thoughtSpotHost: 'https://my.thoughtspot.cloud',
|
|
9395
|
+
* authType: AuthType.None,
|
|
9396
|
+
* });
|
|
9397
|
+
* authStatus.on(AuthStatus.FAILURE, (reason) => { // do something here });
|
|
9398
|
+
* ```
|
|
9399
|
+
*
|
|
9400
|
+
* @returns {@link AuthEventEmitter} event emitter which emits events on authentication success, failure and logout. See {@link AuthStatus}
|
|
9297
9401
|
* @version SDK: 1.0.0 | ThoughtSpot ts7.april.cl, 7.2.1
|
|
9402
|
+
* @group Authentication / Init
|
|
9298
9403
|
*/
|
|
9299
9404
|
const init = (embedConfig) => {
|
|
9300
9405
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
@@ -9336,6 +9441,7 @@
|
|
|
9336
9441
|
* @param doNotDisableAutoLogin This flag when passed will not disable autoLogin
|
|
9337
9442
|
* @returns Promise which resolves when logout completes.
|
|
9338
9443
|
* @version SDK: 1.10.1 | ThoughtSpot: 8.2.0.cl, 8.4.1-sw
|
|
9444
|
+
* @group Global methods
|
|
9339
9445
|
*/
|
|
9340
9446
|
const logout$1 = (doNotDisableAutoLogin = false) => {
|
|
9341
9447
|
if (!doNotDisableAutoLogin) {
|
|
@@ -9525,7 +9631,7 @@
|
|
|
9525
9631
|
});
|
|
9526
9632
|
}
|
|
9527
9633
|
|
|
9528
|
-
var name="@thoughtspot/visual-embed-sdk";var version="1.20.
|
|
9634
|
+
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$1={".":"./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$1,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};
|
|
9529
9635
|
|
|
9530
9636
|
/**
|
|
9531
9637
|
* Copyright (c) 2022
|
|
@@ -10004,6 +10110,20 @@
|
|
|
10004
10110
|
* @param messageType The message type
|
|
10005
10111
|
* @param callback A callback as a function
|
|
10006
10112
|
* @param options The message options
|
|
10113
|
+
* @example
|
|
10114
|
+
* ```js
|
|
10115
|
+
* tsEmbed.on(EmbedEvent.Error, (data) => {
|
|
10116
|
+
* console.error(data);
|
|
10117
|
+
* });
|
|
10118
|
+
* ```
|
|
10119
|
+
* @example
|
|
10120
|
+
* ```js
|
|
10121
|
+
* tsEmbed.on(EmbedEvent.Save, (data) => {
|
|
10122
|
+
* console.log("Answer save clicked", data);
|
|
10123
|
+
* }, {
|
|
10124
|
+
* start: true // This will trigger the callback on start of save
|
|
10125
|
+
* });
|
|
10126
|
+
* ```
|
|
10007
10127
|
*/
|
|
10008
10128
|
on(messageType, callback, options = { start: false }) {
|
|
10009
10129
|
if (this.isRendered) {
|
|
@@ -10098,6 +10218,8 @@
|
|
|
10098
10218
|
* Base class for embedding v1 experience
|
|
10099
10219
|
* Note: The v1 version of ThoughtSpot Blink works on the AngularJS stack
|
|
10100
10220
|
* which is currently under migration to v2
|
|
10221
|
+
*
|
|
10222
|
+
* @inheritdoc
|
|
10101
10223
|
*/
|
|
10102
10224
|
class V1Embed extends TsEmbed {
|
|
10103
10225
|
constructor(domSelector, viewConfig) {
|
|
@@ -10105,13 +10227,30 @@
|
|
|
10105
10227
|
this.viewConfig = viewConfig;
|
|
10106
10228
|
}
|
|
10107
10229
|
/**
|
|
10108
|
-
* Render the
|
|
10230
|
+
* Render the ap p in an iframe and set up event handlers
|
|
10109
10231
|
* @param iframeSrc
|
|
10110
10232
|
*/
|
|
10111
10233
|
renderV1Embed(iframeSrc) {
|
|
10112
10234
|
return this.renderIFrame(iframeSrc, this.viewConfig.frameParams);
|
|
10113
10235
|
}
|
|
10114
|
-
|
|
10236
|
+
/**
|
|
10237
|
+
* @inheritdoc TsEmbed.on
|
|
10238
|
+
*
|
|
10239
|
+
* @example
|
|
10240
|
+
* ```js
|
|
10241
|
+
* tsEmbed.on(EmbedEvent.Error, (data) => {
|
|
10242
|
+
* console.error(data);
|
|
10243
|
+
* });
|
|
10244
|
+
* ```
|
|
10245
|
+
* @example
|
|
10246
|
+
* ```js
|
|
10247
|
+
* tsEmbed.on(EmbedEvent.Save, (data) => {
|
|
10248
|
+
* console.log("Answer save clicked", data);
|
|
10249
|
+
* }, {
|
|
10250
|
+
* start: true // This will trigger the callback on start of save
|
|
10251
|
+
* });
|
|
10252
|
+
* ```
|
|
10253
|
+
*/
|
|
10115
10254
|
on(messageType, callback, options = { start: false }) {
|
|
10116
10255
|
const eventType = this.getCompatibleEventType(messageType);
|
|
10117
10256
|
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_ON}-${messageType}`);
|
|
@@ -10161,7 +10300,7 @@
|
|
|
10161
10300
|
})(exports.Page || (exports.Page = {}));
|
|
10162
10301
|
/**
|
|
10163
10302
|
* Embeds full ThoughtSpot experience in a host application.
|
|
10164
|
-
* @
|
|
10303
|
+
* @group Embed components
|
|
10165
10304
|
*/
|
|
10166
10305
|
class AppEmbed extends V1Embed {
|
|
10167
10306
|
// eslint-disable-next-line no-useless-constructor
|
|
@@ -10295,7 +10434,7 @@
|
|
|
10295
10434
|
*/
|
|
10296
10435
|
/**
|
|
10297
10436
|
* Embed a ThoughtSpot Liveboard or visualization
|
|
10298
|
-
* @
|
|
10437
|
+
* @group Embed components
|
|
10299
10438
|
*/
|
|
10300
10439
|
class LiveboardEmbed extends V1Embed {
|
|
10301
10440
|
// eslint-disable-next-line no-useless-constructor
|
|
@@ -10438,7 +10577,7 @@
|
|
|
10438
10577
|
/**
|
|
10439
10578
|
* Embed ThoughtSpot search
|
|
10440
10579
|
*
|
|
10441
|
-
* @
|
|
10580
|
+
* @group Embed components
|
|
10442
10581
|
*/
|
|
10443
10582
|
class SearchEmbed extends TsEmbed {
|
|
10444
10583
|
constructor(domSelector, viewConfig) {
|
|
@@ -10530,8 +10669,8 @@
|
|
|
10530
10669
|
/**
|
|
10531
10670
|
* Embed ThoughtSpot search bar
|
|
10532
10671
|
*
|
|
10533
|
-
* @Category Search Embed
|
|
10534
10672
|
* @version: SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1-sw
|
|
10673
|
+
* @group Embed components
|
|
10535
10674
|
*/
|
|
10536
10675
|
class SearchBarEmbed extends TsEmbed {
|
|
10537
10676
|
constructor(domSelector, viewConfig) {
|
package/lib/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thoughtspot/visual-embed-sdk",
|
|
3
|
-
"version": "1.20.
|
|
3
|
+
"version": "1.20.1",
|
|
4
4
|
"description": "ThoughtSpot Embed SDK",
|
|
5
5
|
"module": "lib/src/index.js",
|
|
6
6
|
"main": "dist/tsembed.js",
|
|
@@ -135,8 +135,7 @@
|
|
|
135
135
|
"ts-jest": "^26.5.5",
|
|
136
136
|
"ts-loader": "8.0.4",
|
|
137
137
|
"typedoc": "0.21.6",
|
|
138
|
-
"typedoc-
|
|
139
|
-
"typedoc-plugin-toc-group": "0.0.5",
|
|
138
|
+
"typedoc-plugin-toc-group": "thoughtspot/typedoc-plugin-toc-group",
|
|
140
139
|
"typescript": "^4.9.4",
|
|
141
140
|
"url-search-params-polyfill": "^8.1.0",
|
|
142
141
|
"util": "^0.12.4"
|
package/lib/src/auth.d.ts
CHANGED
|
@@ -12,12 +12,21 @@ export declare const EndPoints: {
|
|
|
12
12
|
BASIC_LOGIN: string;
|
|
13
13
|
LOGOUT: string;
|
|
14
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* Enum for auth failure types. This is the parameter passed to the listner
|
|
17
|
+
* of {@link AuthStatus.FAILURE}.
|
|
18
|
+
* @group Authentication / Init
|
|
19
|
+
*/
|
|
15
20
|
export declare enum AuthFailureType {
|
|
16
21
|
SDK = "SDK",
|
|
17
22
|
NO_COOKIE_ACCESS = "NO_COOKIE_ACCESS",
|
|
18
23
|
EXPIRY = "EXPIRY",
|
|
19
24
|
OTHER = "OTHER"
|
|
20
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Enum for auth status emitted by the emitter returned from {@link init}.
|
|
28
|
+
* @group Authentication / Init
|
|
29
|
+
*/
|
|
21
30
|
export declare enum AuthStatus {
|
|
22
31
|
/**
|
|
23
32
|
* Emits when the SDK fails to authenticate
|
|
@@ -43,14 +52,38 @@ export declare enum AuthStatus {
|
|
|
43
52
|
*/
|
|
44
53
|
WAITING_FOR_POPUP = "WAITING_FOR_POPUP"
|
|
45
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* Event emitter returned from {@link init}.
|
|
57
|
+
* @group Authentication / Init
|
|
58
|
+
*/
|
|
59
|
+
export interface AuthEventEmitter {
|
|
60
|
+
/**
|
|
61
|
+
* Registed a listener on Auth failure.
|
|
62
|
+
* @param event
|
|
63
|
+
* @param listener
|
|
64
|
+
*/
|
|
65
|
+
on(event: AuthStatus.FAILURE, listener: (failureType: AuthFailureType) => void): this;
|
|
66
|
+
on(event: AuthStatus.SDK_SUCCESS | AuthStatus.LOGOUT | AuthStatus.WAITING_FOR_POPUP, listener: () => void): this;
|
|
67
|
+
on(event: AuthStatus.SUCCESS, listener: (sessionInfo: any) => void): this;
|
|
68
|
+
/**
|
|
69
|
+
* Trigger an event on the emitter returned from init.
|
|
70
|
+
* @param {@link AuthEvent}
|
|
71
|
+
*/
|
|
72
|
+
emit(event: AuthEvent): void;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Events which can be triggered on the emitter returned from {@link init}.
|
|
76
|
+
* @group Authentication / Init
|
|
77
|
+
*/
|
|
46
78
|
export declare enum AuthEvent {
|
|
47
79
|
/**
|
|
48
|
-
* Manually trigger the SSO popup.
|
|
80
|
+
* Manually trigger the SSO popup. This is useful with
|
|
81
|
+
* authStatus: SAMLRedirect/OIDCRedicre and inPopup: true
|
|
49
82
|
*/
|
|
50
83
|
TRIGGER_SSO_POPUP = "TRIGGER_SSO_POPUP"
|
|
51
84
|
}
|
|
52
|
-
export declare function getAuthEE(): EventEmitter
|
|
53
|
-
export declare function setAuthEE(eventEmitter: EventEmitter): void;
|
|
85
|
+
export declare function getAuthEE(): EventEmitter<AuthStatus | AuthEvent>;
|
|
86
|
+
export declare function setAuthEE(eventEmitter: EventEmitter<AuthStatus | AuthEvent>): void;
|
|
54
87
|
export declare function notifyAuthSDKSuccess(): void;
|
|
55
88
|
export declare function notifyAuthSuccess(): void;
|
|
56
89
|
export declare function notifyAuthFailure(failureType: AuthFailureType): void;
|
|
@@ -60,8 +93,9 @@ export declare function notifyLogout(): void;
|
|
|
60
93
|
*/
|
|
61
94
|
export declare function getReleaseVersion(): string;
|
|
62
95
|
/**
|
|
63
|
-
* Return a promise that resolves with the session
|
|
96
|
+
* Return a promise that resolves with the session information when authentication is
|
|
64
97
|
* successful. And info is available.
|
|
98
|
+
* @group Global methods
|
|
65
99
|
*/
|
|
66
100
|
export declare function getSessionInfo(): Promise<any>;
|
|
67
101
|
export declare function initSession(sessionDetails: any): void;
|
package/lib/src/auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAyB,WAAW,EAAqB,MAAM,SAAS,CAAC;AAahF,eAAO,IAAI,cAAc,SAAQ,CAAC;AAElC,eAAO,IAAI,cAAc,EAAE,MAAa,CAAC;AAEzC,eAAO,IAAI,qBAAqB,EAAE,OAAO,CAAC,IAAI,CAAQ,CAAC;AAQvD,eAAO,MAAM,2BAA2B,yCACE,CAAC;AAE3C,eAAO,MAAM,SAAS;;qCAEe,MAAM;qCAEN,MAAM;;;;CAK1C,CAAC;AAEF,oBAAY,eAAe;IACvB,GAAG,QAAQ;IACX,gBAAgB,qBAAqB;IACrC,MAAM,WAAW;IACjB,KAAK,UAAU;CAClB;AAED,oBAAY,UAAU;IAClB;;OAEG;IACH,OAAO,YAAY;IACnB;;OAEG;IACH,WAAW,gBAAgB;IAC3B;;OAEG;IACH,OAAO,YAAY;IACnB;;OAEG;IACH,MAAM,WAAW;IACjB;;;;;OAKG;IACH,iBAAiB,sBAAsB;CAC1C;AAED,oBAAY,SAAS;IACjB
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/auth.ts"],"names":[],"mappings":"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"}
|
package/lib/src/auth.js
CHANGED
|
@@ -24,6 +24,11 @@ export const EndPoints = {
|
|
|
24
24
|
BASIC_LOGIN: '/callosum/v1/session/login',
|
|
25
25
|
LOGOUT: '/callosum/v1/session/logout',
|
|
26
26
|
};
|
|
27
|
+
/**
|
|
28
|
+
* Enum for auth failure types. This is the parameter passed to the listner
|
|
29
|
+
* of {@link AuthStatus.FAILURE}.
|
|
30
|
+
* @group Authentication / Init
|
|
31
|
+
*/
|
|
27
32
|
export var AuthFailureType;
|
|
28
33
|
(function (AuthFailureType) {
|
|
29
34
|
AuthFailureType["SDK"] = "SDK";
|
|
@@ -31,6 +36,10 @@ export var AuthFailureType;
|
|
|
31
36
|
AuthFailureType["EXPIRY"] = "EXPIRY";
|
|
32
37
|
AuthFailureType["OTHER"] = "OTHER";
|
|
33
38
|
})(AuthFailureType || (AuthFailureType = {}));
|
|
39
|
+
/**
|
|
40
|
+
* Enum for auth status emitted by the emitter returned from {@link init}.
|
|
41
|
+
* @group Authentication / Init
|
|
42
|
+
*/
|
|
34
43
|
export var AuthStatus;
|
|
35
44
|
(function (AuthStatus) {
|
|
36
45
|
/**
|
|
@@ -57,10 +66,15 @@ export var AuthStatus;
|
|
|
57
66
|
*/
|
|
58
67
|
AuthStatus["WAITING_FOR_POPUP"] = "WAITING_FOR_POPUP";
|
|
59
68
|
})(AuthStatus || (AuthStatus = {}));
|
|
69
|
+
/**
|
|
70
|
+
* Events which can be triggered on the emitter returned from {@link init}.
|
|
71
|
+
* @group Authentication / Init
|
|
72
|
+
*/
|
|
60
73
|
export var AuthEvent;
|
|
61
74
|
(function (AuthEvent) {
|
|
62
75
|
/**
|
|
63
|
-
* Manually trigger the SSO popup.
|
|
76
|
+
* Manually trigger the SSO popup. This is useful with
|
|
77
|
+
* authStatus: SAMLRedirect/OIDCRedicre and inPopup: true
|
|
64
78
|
*/
|
|
65
79
|
AuthEvent["TRIGGER_SSO_POPUP"] = "TRIGGER_SSO_POPUP";
|
|
66
80
|
})(AuthEvent || (AuthEvent = {}));
|
|
@@ -123,8 +137,9 @@ export function getReleaseVersion() {
|
|
|
123
137
|
return releaseVersion;
|
|
124
138
|
}
|
|
125
139
|
/**
|
|
126
|
-
* Return a promise that resolves with the session
|
|
140
|
+
* Return a promise that resolves with the session information when authentication is
|
|
127
141
|
* successful. And info is available.
|
|
142
|
+
* @group Global methods
|
|
128
143
|
*/
|
|
129
144
|
export function getSessionInfo() {
|
|
130
145
|
return sessionInfoPromise;
|