@thoughtspot/visual-embed-sdk 1.20.0 → 1.20.2
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 +25 -14
- package/dist/src/embed/base.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +13 -3
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- 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 +201 -27
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsembed.es.js +247 -38
- package/dist/tsembed.js +228 -38
- 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 +25 -14
- package/lib/src/embed/base.d.ts.map +1 -1
- package/lib/src/embed/base.js +24 -4
- 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 +13 -3
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +12 -2
- package/lib/src/embed/liveboard.js.map +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 +201 -27
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +155 -24
- package/lib/src/types.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +323 -57
- 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 +30 -9
- package/src/embed/liveboard.ts +13 -3
- 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 +202 -26
package/dist/tsembed.es.js
CHANGED
|
@@ -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;
|
|
@@ -208,7 +209,47 @@ var AuthType;
|
|
|
208
209
|
AuthType["SAML"] = "SSO_SAML";
|
|
209
210
|
/**
|
|
210
211
|
* SSO using SAML
|
|
211
|
-
* Will make the host application redirect to the SAML Idp.
|
|
212
|
+
* Will make the host application redirect to the SAML Idp. Use this
|
|
213
|
+
* when the idp does not allow itself to be embedded.
|
|
214
|
+
*
|
|
215
|
+
* This redirects the host application to the SAML Idp. The host application
|
|
216
|
+
* will be redirected back to the ThoughtSpot app after authentication.
|
|
217
|
+
* @example
|
|
218
|
+
* ```js
|
|
219
|
+
* init({
|
|
220
|
+
* // ...
|
|
221
|
+
* authType: AuthType.SAMLRedirect,
|
|
222
|
+
* });
|
|
223
|
+
* ```
|
|
224
|
+
*
|
|
225
|
+
* This opens the SAML Idp in a popup window. The popup is triggered
|
|
226
|
+
* when the user clicks the trigger button. The popup window will be
|
|
227
|
+
* closed automatically after authentication.
|
|
228
|
+
* @example
|
|
229
|
+
* ```js
|
|
230
|
+
* init({
|
|
231
|
+
* // ...
|
|
232
|
+
* authType: AuthType.SAMLRedirect,
|
|
233
|
+
* authTriggerText: 'Login with SAML',
|
|
234
|
+
* authTriggerContainer: '#embed-container',
|
|
235
|
+
* inPopup: true,
|
|
236
|
+
* });
|
|
237
|
+
* ```
|
|
238
|
+
*
|
|
239
|
+
* Can also use event to trigger the popup flow. Works the same
|
|
240
|
+
* as above example.
|
|
241
|
+
* @example
|
|
242
|
+
* ```js
|
|
243
|
+
* const authEE = init({
|
|
244
|
+
* // ...
|
|
245
|
+
* authType: AuthType.SAMLRedirect,
|
|
246
|
+
* inPopup: true,
|
|
247
|
+
* });
|
|
248
|
+
*
|
|
249
|
+
* someButtonOnYourPage.addEventListener('click', () => {
|
|
250
|
+
* authEE.emit(AuthEvent.TRIGGER_SSO_POPUP);
|
|
251
|
+
* });
|
|
252
|
+
* ```
|
|
212
253
|
*/
|
|
213
254
|
AuthType["SAMLRedirect"] = "SSO_SAML";
|
|
214
255
|
/**
|
|
@@ -220,6 +261,7 @@ var AuthType;
|
|
|
220
261
|
/**
|
|
221
262
|
* SSO using OIDC
|
|
222
263
|
* Will make the host application redirect to the OIDC Idp.
|
|
264
|
+
* See code samples in {@link SAMLRedirect}.
|
|
223
265
|
*/
|
|
224
266
|
AuthType["OIDCRedirect"] = "SSO_OIDC";
|
|
225
267
|
/**
|
|
@@ -232,6 +274,18 @@ var AuthType;
|
|
|
232
274
|
* Trusted authentication server, Use your own authentication server
|
|
233
275
|
* which returns a bearer token, generated using the secret_key obtained from
|
|
234
276
|
* ThoughtSpot.
|
|
277
|
+
*
|
|
278
|
+
* @example
|
|
279
|
+
* ```js
|
|
280
|
+
* init({
|
|
281
|
+
* // ...
|
|
282
|
+
* authType: AuthType.TrustedAuthToken,
|
|
283
|
+
* getAuthToken: () => {
|
|
284
|
+
* return fetch('https://my-backend.app/ts-token')
|
|
285
|
+
* .then((response) => response.json())
|
|
286
|
+
* .then((data) => data.token);
|
|
287
|
+
* }
|
|
288
|
+
* ```
|
|
235
289
|
*/
|
|
236
290
|
AuthType["TrustedAuthToken"] = "AuthServer";
|
|
237
291
|
/**
|
|
@@ -314,6 +368,10 @@ var RuntimeFilterOp;
|
|
|
314
368
|
})(RuntimeFilterOp || (RuntimeFilterOp = {}));
|
|
315
369
|
/**
|
|
316
370
|
* Event types emitted by the embedded ThoughtSpot application.
|
|
371
|
+
*
|
|
372
|
+
* To add an event listener use the corresponding
|
|
373
|
+
* {@link LiveboardEmbed.on} or {@link AppEmbed.on} or {@link SearchEmbed.on} method.
|
|
374
|
+
* @group Events
|
|
317
375
|
*/
|
|
318
376
|
// eslint-disable-next-line no-shadow
|
|
319
377
|
var EmbedEvent;
|
|
@@ -480,6 +538,12 @@ var EmbedEvent;
|
|
|
480
538
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
481
539
|
*/
|
|
482
540
|
EmbedEvent["Download"] = "download";
|
|
541
|
+
/**
|
|
542
|
+
* Emitted when the download action is triggered on an answer
|
|
543
|
+
*
|
|
544
|
+
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.0-sw
|
|
545
|
+
*/
|
|
546
|
+
EmbedEvent["DownloadAsPng"] = "downloadAsPng";
|
|
483
547
|
/**
|
|
484
548
|
* Emitted when the Download as PDF action is triggered on an answer
|
|
485
549
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
@@ -642,6 +706,7 @@ var EmbedEvent;
|
|
|
642
706
|
*
|
|
643
707
|
* To trigger an event use the corresponding
|
|
644
708
|
* {@link LiveboardEmbed.trigger} or {@link AppEmbed.trigger} or {@link SearchEmbed.trigger} method.
|
|
709
|
+
* @group Events
|
|
645
710
|
*/
|
|
646
711
|
// eslint-disable-next-line no-shadow
|
|
647
712
|
var HostEvent;
|
|
@@ -654,11 +719,13 @@ var HostEvent;
|
|
|
654
719
|
* @param - searchQuery - The search query
|
|
655
720
|
* @param - execute - execute the existing / updated query
|
|
656
721
|
* @example
|
|
722
|
+
* ```js
|
|
657
723
|
* searchEmbed.trigger(HostEvent.Search, {
|
|
658
|
-
*
|
|
659
|
-
*
|
|
660
|
-
*
|
|
724
|
+
* searchQuery: "[sales] by [item type],
|
|
725
|
+
* dataSourceIds: ["cd252e5c-b552-49a8-821d-3eadaa049cca"]
|
|
726
|
+
* execute: true
|
|
661
727
|
* })
|
|
728
|
+
* ```
|
|
662
729
|
*/
|
|
663
730
|
HostEvent["Search"] = "search";
|
|
664
731
|
/**
|
|
@@ -667,10 +734,14 @@ var HostEvent;
|
|
|
667
734
|
* eg. { selectedPoints: []}
|
|
668
735
|
* @param - columnGuid - a string guid of the column to drill by. This is optional,
|
|
669
736
|
* if not provided it will auto drill by the configured column.
|
|
670
|
-
* @example
|
|
671
|
-
*
|
|
672
|
-
*
|
|
737
|
+
* @example
|
|
738
|
+
* ```js
|
|
739
|
+
* searchEmbed.trigger(HostEvent.DrillDown, {
|
|
740
|
+
* points: clickedPointData,
|
|
741
|
+
* autoDrillDown: true,
|
|
673
742
|
* })
|
|
743
|
+
* ```
|
|
744
|
+
*
|
|
674
745
|
* @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
|
|
675
746
|
*/
|
|
676
747
|
HostEvent["DrillDown"] = "triggerDrillDown";
|
|
@@ -709,7 +780,10 @@ var HostEvent;
|
|
|
709
780
|
* Navigate to a specific page in App embed without any reload.
|
|
710
781
|
* This is the same as calling `appEmbed.navigateToPage(path, true)`
|
|
711
782
|
* @param - path - the path to navigate to (can be a number[1/-1] to go forward/back)
|
|
712
|
-
* @example
|
|
783
|
+
* @example
|
|
784
|
+
* ```js
|
|
785
|
+
* appEmbed.navigateToPage(-1)
|
|
786
|
+
* ```
|
|
713
787
|
* @version SDK: 1.12.0 | ThoughtSpot 8.4.0.cl, 8.4.1-sw
|
|
714
788
|
*/
|
|
715
789
|
HostEvent["Navigate"] = "Navigate";
|
|
@@ -717,27 +791,39 @@ var HostEvent;
|
|
|
717
791
|
* Opens the filter panel for a particular column.
|
|
718
792
|
* Works with Search embed.
|
|
719
793
|
* @param - { columnId: string, name: string, type: INT64/CHAR/DATE, dataType: ATTRIBUTE/MEASURE }
|
|
720
|
-
* @example
|
|
794
|
+
* @example
|
|
795
|
+
* ```js
|
|
796
|
+
* searchEmbed.trigger(HostEvent.OpenFilter, { columnId: '123', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE' })
|
|
797
|
+
* ```
|
|
721
798
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
722
799
|
*/
|
|
723
800
|
HostEvent["OpenFilter"] = "openFilter";
|
|
724
801
|
/**
|
|
725
802
|
* Adds the columns to the current Search.
|
|
726
803
|
* @param - { columnIds: string[] }
|
|
727
|
-
* @example
|
|
804
|
+
* @example
|
|
805
|
+
* ```js
|
|
806
|
+
* searchEmbed.trigger(HostEvent.AddColumns, { columnIds: ['123', '456'] })
|
|
807
|
+
* ```
|
|
728
808
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
729
809
|
*/
|
|
730
810
|
HostEvent["AddColumns"] = "addColumns";
|
|
731
811
|
/**
|
|
732
812
|
* Removes a column from the current Search.
|
|
733
813
|
* @param - { columnId: string }
|
|
734
|
-
* @example
|
|
814
|
+
* @example
|
|
815
|
+
* ```js
|
|
816
|
+
* searchEmbed.trigger(HostEvent.RemoveColumn, { columnId: '123' })
|
|
817
|
+
* ```
|
|
735
818
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
736
819
|
*/
|
|
737
820
|
HostEvent["RemoveColumn"] = "removeColumn";
|
|
738
821
|
/**
|
|
739
822
|
* Gets the current pinboard content.
|
|
740
|
-
* @example
|
|
823
|
+
* @example
|
|
824
|
+
* ```js
|
|
825
|
+
* liveboardEmbed.trigger(HostEvent.getExportRequestForCurrentPinboard)
|
|
826
|
+
* ```
|
|
741
827
|
* @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl, 8.8.1-sw
|
|
742
828
|
*/
|
|
743
829
|
HostEvent["getExportRequestForCurrentPinboard"] = "getExportRequestForCurrentPinboard";
|
|
@@ -746,87 +832,124 @@ var HostEvent;
|
|
|
746
832
|
* @param - incase of Liveboard embed, takes in an object with vizId as a key
|
|
747
833
|
* can be left empty for search and visualization embeds
|
|
748
834
|
* @example
|
|
835
|
+
* ```js
|
|
749
836
|
* liveboardEmbed.trigger(HostEvent.Pin, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
750
837
|
* vizEmbed.trigger(HostEvent.Pin)
|
|
751
838
|
* searchEmbed.trigger(HostEvent.Pin)
|
|
839
|
+
* ```
|
|
752
840
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
753
841
|
*/
|
|
754
842
|
HostEvent["Pin"] = "pin";
|
|
755
843
|
/**
|
|
756
844
|
* Triggers the Show Liveboard details action on a Liveboard
|
|
757
|
-
* @example
|
|
845
|
+
* @example
|
|
846
|
+
* ```js
|
|
847
|
+
* liveboardEmbed.trigger(HostEvent.LiveboardInfo)
|
|
848
|
+
* ```
|
|
758
849
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
759
850
|
*/
|
|
760
851
|
HostEvent["LiveboardInfo"] = "pinboardInfo";
|
|
761
852
|
/**
|
|
762
853
|
* Triggers the Schedule action on a Liveboard
|
|
763
|
-
* @example
|
|
854
|
+
* @example
|
|
855
|
+
* ```js
|
|
856
|
+
* liveboardEmbed.trigger(HostEvent.Schedule)
|
|
857
|
+
* ```
|
|
764
858
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
765
859
|
*/
|
|
766
860
|
HostEvent["Schedule"] = "subscription";
|
|
767
861
|
/**
|
|
768
862
|
* Triggers the Manage schedule action on a Liveboard
|
|
769
|
-
* @example
|
|
863
|
+
* @example
|
|
864
|
+
* ```js
|
|
865
|
+
* liveboardEmbed.trigger(HostEvent.ScheduleList)
|
|
866
|
+
* ```
|
|
770
867
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
771
868
|
*/
|
|
772
869
|
HostEvent["SchedulesList"] = "schedule-list";
|
|
773
870
|
/**
|
|
774
871
|
* Triggers the Export TML action on a Liveboard
|
|
775
|
-
* @example
|
|
872
|
+
* @example
|
|
873
|
+
* ```js
|
|
874
|
+
* liveboardEmbed.trigger(HostEvent.ExportTML)
|
|
875
|
+
* ```
|
|
776
876
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
777
877
|
*/
|
|
778
878
|
HostEvent["ExportTML"] = "exportTSL";
|
|
779
879
|
/**
|
|
780
880
|
* Triggers the Edit TML action on a Liveboard
|
|
781
|
-
* @example
|
|
881
|
+
* @example
|
|
882
|
+
* ```js
|
|
883
|
+
* liveboardEmbed.trigger(HostEvent.EditTML)
|
|
884
|
+
* ```
|
|
782
885
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
783
886
|
*/
|
|
784
887
|
HostEvent["EditTML"] = "editTSL";
|
|
785
888
|
/**
|
|
786
889
|
* Triggers the Update TML action on a Liveboard
|
|
787
|
-
* @example
|
|
890
|
+
* @example
|
|
891
|
+
* ```js
|
|
892
|
+
* liveboardEmbed.trigger(HostEvent.UpdateTML)
|
|
893
|
+
* ```
|
|
788
894
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
789
895
|
*/
|
|
790
896
|
HostEvent["UpdateTML"] = "updateTSL";
|
|
791
897
|
/**
|
|
792
898
|
* Triggers the Download PDF action on a Liveboard
|
|
793
|
-
* @example
|
|
899
|
+
* @example
|
|
900
|
+
* ```js
|
|
901
|
+
* liveboardEmbed.trigger(HostEvent.DownloadAsPDF)
|
|
902
|
+
* ```
|
|
794
903
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
795
904
|
*/
|
|
796
905
|
HostEvent["DownloadAsPdf"] = "downloadAsPdf";
|
|
797
906
|
/**
|
|
798
907
|
* Triggers the Make a copy action on a Liveboard, search or visualization
|
|
799
908
|
* @example
|
|
909
|
+
* ```js
|
|
800
910
|
* liveboardEmbed.trigger(HostEvent.MakeACopy, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
801
911
|
* vizEmbed.trigger(HostEvent.MakeACopy)
|
|
802
912
|
* searchEmbed.trigger(HostEvent.MakeACopy)
|
|
913
|
+
* ```
|
|
803
914
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
804
915
|
*/
|
|
805
916
|
HostEvent["MakeACopy"] = "makeACopy";
|
|
806
917
|
/**
|
|
807
918
|
* Triggers the Delete action on a Liveboard
|
|
808
|
-
* @example
|
|
919
|
+
* @example
|
|
920
|
+
* ```js
|
|
921
|
+
* appEmbed.trigger(HostEvent.Remove)
|
|
922
|
+
* ```
|
|
809
923
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
810
924
|
*/
|
|
811
925
|
HostEvent["Remove"] = "delete";
|
|
812
926
|
/**
|
|
813
927
|
* Triggers the Explore action on a visualization
|
|
814
928
|
* @param - an object with vizId as a key
|
|
815
|
-
* @example
|
|
929
|
+
* @example
|
|
930
|
+
* ```js
|
|
931
|
+
* liveboardEmbed.trigger(HostEvent.Explore, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
932
|
+
* ```
|
|
816
933
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
817
934
|
*/
|
|
818
935
|
HostEvent["Explore"] = "explore";
|
|
819
936
|
/**
|
|
820
937
|
* Triggers the Create alert action on a visualization
|
|
821
938
|
* @param - an object with vizId as a key
|
|
822
|
-
* @example
|
|
939
|
+
* @example
|
|
940
|
+
* ```js
|
|
941
|
+
* liveboardEmbed.trigger(HostEvent.CreateMonitor {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
942
|
+
* ```
|
|
823
943
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
824
944
|
*/
|
|
825
945
|
HostEvent["CreateMonitor"] = "createMonitor";
|
|
826
946
|
/**
|
|
827
947
|
* Triggers the Manage alert action on a visualization
|
|
828
948
|
* @param - an object with vizId as a key
|
|
829
|
-
* @example
|
|
949
|
+
* @example
|
|
950
|
+
* ```js
|
|
951
|
+
* liveboardEmbed.trigger(HostEvent.ManageMonitor, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
952
|
+
* ```
|
|
830
953
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
831
954
|
*/
|
|
832
955
|
HostEvent["ManageMonitor"] = "manageMonitor";
|
|
@@ -844,9 +967,11 @@ var HostEvent;
|
|
|
844
967
|
* Triggers the Copy link action on a Liveboard or visualization
|
|
845
968
|
* @param - object - to trigger the action for a specfic visualization in Liveboard embed, pass in vizId as a key
|
|
846
969
|
* @example
|
|
970
|
+
* ```js
|
|
847
971
|
* liveboardEmbed.trigger(HostEvent.CopyLink)
|
|
848
972
|
* liveboardEmbed.trigger(HostEvent.CopyLink, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
849
973
|
* vizEmbed.trigger((HostEvent.CopyLink)
|
|
974
|
+
* ```
|
|
850
975
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
851
976
|
*/
|
|
852
977
|
HostEvent["CopyLink"] = "embedDocument";
|
|
@@ -854,15 +979,20 @@ var HostEvent;
|
|
|
854
979
|
* Triggers the Present action on a Liveboard or visualization
|
|
855
980
|
* @param - object - to trigger the action for a specfic visualization in Liveboard embed, pass in vizId as a key
|
|
856
981
|
* @example
|
|
982
|
+
* ```js
|
|
857
983
|
* liveboardEmbed.trigger(HostEvent.Present)
|
|
858
984
|
* liveboardEmbed.trigger(HostEvent.Present, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
859
985
|
* vizEmbed.trigger((HostEvent.Present)
|
|
986
|
+
* ```
|
|
860
987
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
861
988
|
*/
|
|
862
989
|
HostEvent["Present"] = "present";
|
|
863
990
|
/**
|
|
864
991
|
* Get TML for the current search.
|
|
865
|
-
* @example
|
|
992
|
+
* @example
|
|
993
|
+
* ```js
|
|
994
|
+
* searchEmbed.trigger(HostEvent.GetTML)
|
|
995
|
+
* ```
|
|
866
996
|
* @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1-sw
|
|
867
997
|
*/
|
|
868
998
|
HostEvent["GetTML"] = "getTML";
|
|
@@ -1097,6 +1227,7 @@ var Action;
|
|
|
1097
1227
|
Action["ReplaySearch"] = "replaySearch";
|
|
1098
1228
|
Action["ShowUnderlyingData"] = "showUnderlyingData";
|
|
1099
1229
|
Action["Download"] = "download";
|
|
1230
|
+
Action["DownloadAsPng"] = "downloadAsPng";
|
|
1100
1231
|
Action["DownloadAsPdf"] = "downloadAsPdf";
|
|
1101
1232
|
Action["DownloadAsCsv"] = "downloadAsCSV";
|
|
1102
1233
|
Action["DownloadAsXlsx"] = "downloadAsXLSX";
|
|
@@ -8913,6 +9044,11 @@ const EndPoints = {
|
|
|
8913
9044
|
BASIC_LOGIN: '/callosum/v1/session/login',
|
|
8914
9045
|
LOGOUT: '/callosum/v1/session/logout',
|
|
8915
9046
|
};
|
|
9047
|
+
/**
|
|
9048
|
+
* Enum for auth failure types. This is the parameter passed to the listner
|
|
9049
|
+
* of {@link AuthStatus.FAILURE}.
|
|
9050
|
+
* @group Authentication / Init
|
|
9051
|
+
*/
|
|
8916
9052
|
var AuthFailureType;
|
|
8917
9053
|
(function (AuthFailureType) {
|
|
8918
9054
|
AuthFailureType["SDK"] = "SDK";
|
|
@@ -8920,6 +9056,10 @@ var AuthFailureType;
|
|
|
8920
9056
|
AuthFailureType["EXPIRY"] = "EXPIRY";
|
|
8921
9057
|
AuthFailureType["OTHER"] = "OTHER";
|
|
8922
9058
|
})(AuthFailureType || (AuthFailureType = {}));
|
|
9059
|
+
/**
|
|
9060
|
+
* Enum for auth status emitted by the emitter returned from {@link init}.
|
|
9061
|
+
* @group Authentication / Init
|
|
9062
|
+
*/
|
|
8923
9063
|
var AuthStatus;
|
|
8924
9064
|
(function (AuthStatus) {
|
|
8925
9065
|
/**
|
|
@@ -8946,10 +9086,15 @@ var AuthStatus;
|
|
|
8946
9086
|
*/
|
|
8947
9087
|
AuthStatus["WAITING_FOR_POPUP"] = "WAITING_FOR_POPUP";
|
|
8948
9088
|
})(AuthStatus || (AuthStatus = {}));
|
|
9089
|
+
/**
|
|
9090
|
+
* Events which can be triggered on the emitter returned from {@link init}.
|
|
9091
|
+
* @group Authentication / Init
|
|
9092
|
+
*/
|
|
8949
9093
|
var AuthEvent;
|
|
8950
9094
|
(function (AuthEvent) {
|
|
8951
9095
|
/**
|
|
8952
|
-
* Manually trigger the SSO popup.
|
|
9096
|
+
* Manually trigger the SSO popup. This is useful with
|
|
9097
|
+
* authStatus: SAMLRedirect/OIDCRedicre and inPopup: true
|
|
8953
9098
|
*/
|
|
8954
9099
|
AuthEvent["TRIGGER_SSO_POPUP"] = "TRIGGER_SSO_POPUP";
|
|
8955
9100
|
})(AuthEvent || (AuthEvent = {}));
|
|
@@ -9009,8 +9154,9 @@ function getReleaseVersion() {
|
|
|
9009
9154
|
return releaseVersion;
|
|
9010
9155
|
}
|
|
9011
9156
|
/**
|
|
9012
|
-
* Return a promise that resolves with the session
|
|
9157
|
+
* Return a promise that resolves with the session information when authentication is
|
|
9013
9158
|
* successful. And info is available.
|
|
9159
|
+
* @group Global methods
|
|
9014
9160
|
*/
|
|
9015
9161
|
function getSessionInfo() {
|
|
9016
9162
|
return sessionInfoPromise;
|
|
@@ -9247,6 +9393,13 @@ const CONFIG_DEFAULTS = {
|
|
|
9247
9393
|
authType: AuthType.None,
|
|
9248
9394
|
};
|
|
9249
9395
|
let authPromise;
|
|
9396
|
+
/**
|
|
9397
|
+
* Gets the configuration embed was initialized with.
|
|
9398
|
+
*
|
|
9399
|
+
* @returns {@link EmbedConfig} The configuration embed was initialized with.
|
|
9400
|
+
* @version SDK: 1.19.0 | ThoughtSpot: *
|
|
9401
|
+
* @group Global methods
|
|
9402
|
+
*/
|
|
9250
9403
|
const getEmbedConfig = () => config;
|
|
9251
9404
|
const getAuthPromise = () => authPromise;
|
|
9252
9405
|
/**
|
|
@@ -9277,6 +9430,7 @@ const hostUrlToFeatureUrl = {
|
|
|
9277
9430
|
* @param url The URL provided for prefetch
|
|
9278
9431
|
* @param prefetchFeatures Specify features which needs to be prefetched.
|
|
9279
9432
|
* @version SDK: 1.4.0 | ThoughtSpot: ts7.sep.cl, 7.2.1
|
|
9433
|
+
* @group Global methods
|
|
9280
9434
|
*/
|
|
9281
9435
|
const prefetch = (url, prefetchFeatures) => {
|
|
9282
9436
|
if (url === '') {
|
|
@@ -9323,13 +9477,24 @@ function backwardCompat(embedConfig) {
|
|
|
9323
9477
|
}
|
|
9324
9478
|
/**
|
|
9325
9479
|
* Initializes the Visual Embed SDK globally and perform
|
|
9326
|
-
* authentication if applicable.
|
|
9480
|
+
* authentication if applicable. This function needs to be called before any ThoughtSpot
|
|
9481
|
+
* component like liveboard etc can be embedded. But need not wait for AuthEvent.SUCCESS
|
|
9482
|
+
* to actually embed. That is handled internally.
|
|
9327
9483
|
* @param embedConfig The configuration object containing ThoughtSpot host,
|
|
9328
9484
|
* authentication mechanism and so on.
|
|
9329
|
-
*
|
|
9330
|
-
*
|
|
9331
|
-
*
|
|
9485
|
+
*
|
|
9486
|
+
* @example
|
|
9487
|
+
* ```js
|
|
9488
|
+
* const authStatus = init({
|
|
9489
|
+
* thoughtSpotHost: 'https://my.thoughtspot.cloud',
|
|
9490
|
+
* authType: AuthType.None,
|
|
9491
|
+
* });
|
|
9492
|
+
* authStatus.on(AuthStatus.FAILURE, (reason) => { // do something here });
|
|
9493
|
+
* ```
|
|
9494
|
+
*
|
|
9495
|
+
* @returns {@link AuthEventEmitter} event emitter which emits events on authentication success, failure and logout. See {@link AuthStatus}
|
|
9332
9496
|
* @version SDK: 1.0.0 | ThoughtSpot ts7.april.cl, 7.2.1
|
|
9497
|
+
* @group Authentication / Init
|
|
9333
9498
|
*/
|
|
9334
9499
|
const init = (embedConfig) => {
|
|
9335
9500
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
@@ -9371,6 +9536,7 @@ function disableAutoLogin() {
|
|
|
9371
9536
|
* @param doNotDisableAutoLogin This flag when passed will not disable autoLogin
|
|
9372
9537
|
* @returns Promise which resolves when logout completes.
|
|
9373
9538
|
* @version SDK: 1.10.1 | ThoughtSpot: 8.2.0.cl, 8.4.1-sw
|
|
9539
|
+
* @group Global methods
|
|
9374
9540
|
*/
|
|
9375
9541
|
const logout$1 = (doNotDisableAutoLogin = false) => {
|
|
9376
9542
|
if (!doNotDisableAutoLogin) {
|
|
@@ -9560,7 +9726,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
|
9560
9726
|
});
|
|
9561
9727
|
}
|
|
9562
9728
|
|
|
9563
|
-
var name="@thoughtspot/visual-embed-sdk";var version="1.20.
|
|
9729
|
+
var name="@thoughtspot/visual-embed-sdk";var version="1.20.2";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
9730
|
|
|
9565
9731
|
/**
|
|
9566
9732
|
* Copyright (c) 2022
|
|
@@ -10039,6 +10205,20 @@ class TsEmbed {
|
|
|
10039
10205
|
* @param messageType The message type
|
|
10040
10206
|
* @param callback A callback as a function
|
|
10041
10207
|
* @param options The message options
|
|
10208
|
+
* @example
|
|
10209
|
+
* ```js
|
|
10210
|
+
* tsEmbed.on(EmbedEvent.Error, (data) => {
|
|
10211
|
+
* console.error(data);
|
|
10212
|
+
* });
|
|
10213
|
+
* ```
|
|
10214
|
+
* @example
|
|
10215
|
+
* ```js
|
|
10216
|
+
* tsEmbed.on(EmbedEvent.Save, (data) => {
|
|
10217
|
+
* console.log("Answer save clicked", data);
|
|
10218
|
+
* }, {
|
|
10219
|
+
* start: true // This will trigger the callback on start of save
|
|
10220
|
+
* });
|
|
10221
|
+
* ```
|
|
10042
10222
|
*/
|
|
10043
10223
|
on(messageType, callback, options = { start: false }) {
|
|
10044
10224
|
if (this.isRendered) {
|
|
@@ -10133,6 +10313,8 @@ class TsEmbed {
|
|
|
10133
10313
|
* Base class for embedding v1 experience
|
|
10134
10314
|
* Note: The v1 version of ThoughtSpot Blink works on the AngularJS stack
|
|
10135
10315
|
* which is currently under migration to v2
|
|
10316
|
+
*
|
|
10317
|
+
* @inheritdoc
|
|
10136
10318
|
*/
|
|
10137
10319
|
class V1Embed extends TsEmbed {
|
|
10138
10320
|
constructor(domSelector, viewConfig) {
|
|
@@ -10140,13 +10322,30 @@ class V1Embed extends TsEmbed {
|
|
|
10140
10322
|
this.viewConfig = viewConfig;
|
|
10141
10323
|
}
|
|
10142
10324
|
/**
|
|
10143
|
-
* Render the
|
|
10325
|
+
* Render the ap p in an iframe and set up event handlers
|
|
10144
10326
|
* @param iframeSrc
|
|
10145
10327
|
*/
|
|
10146
10328
|
renderV1Embed(iframeSrc) {
|
|
10147
10329
|
return this.renderIFrame(iframeSrc, this.viewConfig.frameParams);
|
|
10148
10330
|
}
|
|
10149
|
-
|
|
10331
|
+
/**
|
|
10332
|
+
* @inheritdoc TsEmbed.on
|
|
10333
|
+
*
|
|
10334
|
+
* @example
|
|
10335
|
+
* ```js
|
|
10336
|
+
* tsEmbed.on(EmbedEvent.Error, (data) => {
|
|
10337
|
+
* console.error(data);
|
|
10338
|
+
* });
|
|
10339
|
+
* ```
|
|
10340
|
+
* @example
|
|
10341
|
+
* ```js
|
|
10342
|
+
* tsEmbed.on(EmbedEvent.Save, (data) => {
|
|
10343
|
+
* console.log("Answer save clicked", data);
|
|
10344
|
+
* }, {
|
|
10345
|
+
* start: true // This will trigger the callback on start of save
|
|
10346
|
+
* });
|
|
10347
|
+
* ```
|
|
10348
|
+
*/
|
|
10150
10349
|
on(messageType, callback, options = { start: false }) {
|
|
10151
10350
|
const eventType = this.getCompatibleEventType(messageType);
|
|
10152
10351
|
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_ON}-${messageType}`);
|
|
@@ -10201,7 +10400,7 @@ var Page;
|
|
|
10201
10400
|
})(Page || (Page = {}));
|
|
10202
10401
|
/**
|
|
10203
10402
|
* Embeds full ThoughtSpot experience in a host application.
|
|
10204
|
-
* @
|
|
10403
|
+
* @group Embed components
|
|
10205
10404
|
*/
|
|
10206
10405
|
class AppEmbed extends V1Embed {
|
|
10207
10406
|
// eslint-disable-next-line no-useless-constructor
|
|
@@ -10334,8 +10533,18 @@ class AppEmbed extends V1Embed {
|
|
|
10334
10533
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
10335
10534
|
*/
|
|
10336
10535
|
/**
|
|
10337
|
-
* Embed a ThoughtSpot Liveboard or visualization
|
|
10338
|
-
*
|
|
10536
|
+
* Embed a ThoughtSpot Liveboard or a Thoughtspot visualization. When rendered it already
|
|
10537
|
+
* waits for the authentication to complete, so no need to wait for AuthStatus.SUCCESS.
|
|
10538
|
+
* @example
|
|
10539
|
+
* ```js
|
|
10540
|
+
* import { .. } from '@thoughtspot/visual-embed-sdk';
|
|
10541
|
+
* init({ ... });
|
|
10542
|
+
* const embed = new LiveboardEmbed("#container", {
|
|
10543
|
+
* liveboardId: <your-id-here>,
|
|
10544
|
+
* // .. other params here.
|
|
10545
|
+
* })
|
|
10546
|
+
* ```
|
|
10547
|
+
* @group Embed components
|
|
10339
10548
|
*/
|
|
10340
10549
|
class LiveboardEmbed extends V1Embed {
|
|
10341
10550
|
// eslint-disable-next-line no-useless-constructor
|
|
@@ -10478,7 +10687,7 @@ const HiddenActionItemByDefaultForSearchEmbed = [
|
|
|
10478
10687
|
/**
|
|
10479
10688
|
* Embed ThoughtSpot search
|
|
10480
10689
|
*
|
|
10481
|
-
* @
|
|
10690
|
+
* @group Embed components
|
|
10482
10691
|
*/
|
|
10483
10692
|
class SearchEmbed extends TsEmbed {
|
|
10484
10693
|
constructor(domSelector, viewConfig) {
|
|
@@ -10570,8 +10779,8 @@ class SearchEmbed extends TsEmbed {
|
|
|
10570
10779
|
/**
|
|
10571
10780
|
* Embed ThoughtSpot search bar
|
|
10572
10781
|
*
|
|
10573
|
-
* @Category Search Embed
|
|
10574
10782
|
* @version: SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1-sw
|
|
10783
|
+
* @group Embed components
|
|
10575
10784
|
*/
|
|
10576
10785
|
class SearchBarEmbed extends TsEmbed {
|
|
10577
10786
|
constructor(domSelector, viewConfig) {
|