@thoughtspot/visual-embed-sdk 1.21.0-alpha.8 → 1.21.0-react.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/package.json +11 -8
- package/cjs/src/auth.d.ts +2 -0
- package/cjs/src/auth.d.ts.map +1 -1
- package/cjs/src/auth.js +2 -0
- package/cjs/src/auth.js.map +1 -1
- package/cjs/src/embed/app.d.ts +28 -1
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +32 -1
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +67 -0
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/base.d.ts +16 -0
- package/cjs/src/embed/base.d.ts.map +1 -1
- package/cjs/src/embed/base.js +85 -1
- package/cjs/src/embed/base.js.map +1 -1
- package/cjs/src/embed/base.spec.js +127 -0
- package/cjs/src/embed/base.spec.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +19 -0
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/pinboard.spec.js +19 -0
- package/cjs/src/embed/pinboard.spec.js.map +1 -1
- package/cjs/src/embed/search.d.ts.map +1 -1
- package/cjs/src/embed/search.js +2 -2
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/search.spec.js +24 -0
- package/cjs/src/embed/search.spec.js.map +1 -1
- package/cjs/src/embed/searchEmbed-basic-auth.spec.js +1 -1
- package/cjs/src/embed/searchEmbed-basic-auth.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +3 -3
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +28 -9
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +82 -6
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/index.d.ts +3 -3
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +4 -1
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/react/all-types-export.d.ts +3 -0
- package/cjs/src/react/all-types-export.d.ts.map +1 -0
- package/cjs/src/react/all-types-export.js +29 -0
- package/cjs/src/react/all-types-export.js.map +1 -0
- package/cjs/src/react/all-types-export.spec.d.ts +2 -0
- package/cjs/src/react/all-types-export.spec.d.ts.map +1 -0
- package/cjs/src/react/all-types-export.spec.js +13 -0
- package/cjs/src/react/all-types-export.spec.js.map +1 -0
- package/cjs/src/react/index.d.ts +58 -1
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +65 -2
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/react/index.spec.js +12 -2
- package/cjs/src/react/index.spec.js.map +1 -1
- package/cjs/src/test/test-utils.d.ts.map +1 -1
- package/cjs/src/test/test-utils.js +2 -2
- package/cjs/src/test/test-utils.js.map +1 -1
- package/cjs/src/types.d.ts +165 -20
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +113 -17
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/processTrigger.d.ts +6 -0
- package/cjs/src/utils/processTrigger.d.ts.map +1 -1
- package/cjs/src/utils/processTrigger.js +10 -8
- package/cjs/src/utils/processTrigger.js.map +1 -1
- package/cjs/src/utils/processTrigger.spec.js +5 -2
- package/cjs/src/utils/processTrigger.spec.js.map +1 -1
- package/cjs/src/utils.d.ts +1 -0
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +3 -1
- package/cjs/src/utils.js.map +1 -1
- package/dist/src/auth.d.ts +2 -0
- package/dist/src/auth.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +28 -1
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/base.d.ts +16 -0
- package/dist/src/embed/base.d.ts.map +1 -1
- package/dist/src/embed/search.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +3 -3
- 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/all-types-export.d.ts +3 -0
- package/dist/src/react/all-types-export.d.ts.map +1 -0
- package/dist/src/react/all-types-export.spec.d.ts +2 -0
- package/dist/src/react/all-types-export.spec.d.ts.map +1 -0
- package/dist/src/react/index.d.ts +58 -1
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/test/test-utils.d.ts.map +1 -1
- package/dist/src/types.d.ts +165 -20
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/processTrigger.d.ts +6 -0
- package/dist/src/utils/processTrigger.d.ts.map +1 -1
- package/dist/src/utils.d.ts +1 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +28039 -0
- package/dist/tsembed-react.js +27981 -0
- package/dist/tsembed.es.js +269 -38
- package/dist/tsembed.js +269 -40
- package/dist/visual-embed-sdk-react-full.d.ts +3112 -0
- package/dist/visual-embed-sdk-react.d.ts +2781 -0
- package/dist/visual-embed-sdk.d.ts +3005 -0
- package/lib/package.json +11 -8
- package/lib/src/auth.d.ts +2 -0
- package/lib/src/auth.d.ts.map +1 -1
- package/lib/src/auth.js +2 -0
- package/lib/src/auth.js.map +1 -1
- package/lib/src/embed/app.d.ts +28 -1
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +33 -2
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +68 -1
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/base.d.ts +16 -0
- package/lib/src/embed/base.d.ts.map +1 -1
- package/lib/src/embed/base.js +83 -1
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/base.spec.js +127 -0
- package/lib/src/embed/base.spec.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +19 -0
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/pinboard.spec.js +19 -0
- package/lib/src/embed/pinboard.spec.js.map +1 -1
- package/lib/src/embed/search.d.ts.map +1 -1
- package/lib/src/embed/search.js +2 -2
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/search.spec.js +24 -0
- package/lib/src/embed/search.spec.js.map +1 -1
- package/lib/src/embed/searchEmbed-basic-auth.spec.js +1 -1
- package/lib/src/embed/searchEmbed-basic-auth.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +3 -3
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +30 -11
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +83 -7
- package/lib/src/embed/ts-embed.spec.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 +4 -4
- package/lib/src/index.js.map +1 -1
- package/lib/src/react/all-types-export.d.ts +3 -0
- package/lib/src/react/all-types-export.d.ts.map +1 -0
- package/lib/src/react/all-types-export.js +5 -0
- package/lib/src/react/all-types-export.js.map +1 -0
- package/lib/src/react/all-types-export.spec.d.ts +2 -0
- package/lib/src/react/all-types-export.spec.d.ts.map +1 -0
- package/lib/src/react/all-types-export.spec.js +10 -0
- package/lib/src/react/all-types-export.spec.js.map +1 -0
- package/lib/src/react/index.d.ts +58 -1
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +59 -1
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/react/index.spec.js +12 -2
- package/lib/src/react/index.spec.js.map +1 -1
- package/lib/src/test/test-utils.d.ts.map +1 -1
- package/lib/src/test/test-utils.js +2 -2
- package/lib/src/test/test-utils.js.map +1 -1
- package/lib/src/types.d.ts +165 -20
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +113 -17
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/processTrigger.d.ts +6 -0
- package/lib/src/utils/processTrigger.d.ts.map +1 -1
- package/lib/src/utils/processTrigger.js +7 -6
- package/lib/src/utils/processTrigger.js.map +1 -1
- package/lib/src/utils/processTrigger.spec.js +5 -2
- package/lib/src/utils/processTrigger.spec.js.map +1 -1
- package/lib/src/utils.d.ts +1 -0
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +1 -0
- package/lib/src/utils.js.map +1 -1
- package/package.json +11 -8
- package/src/auth.ts +2 -0
- package/src/embed/app.spec.ts +84 -1
- package/src/embed/app.ts +59 -2
- package/src/embed/base.spec.ts +144 -0
- package/src/embed/base.ts +107 -0
- package/src/embed/liveboard.spec.ts +23 -0
- package/src/embed/pinboard.spec.ts +23 -0
- package/src/embed/search.spec.ts +28 -0
- package/src/embed/search.ts +2 -1
- package/src/embed/searchEmbed-basic-auth.spec.ts +1 -1
- package/src/embed/ts-embed.spec.ts +92 -19
- package/src/embed/ts-embed.ts +29 -11
- package/src/index.ts +5 -1
- package/src/react/all-types-export.spec.ts +11 -0
- package/src/react/all-types-export.ts +43 -0
- package/src/react/index.spec.tsx +18 -2
- package/src/react/index.tsx +71 -5
- package/src/test/test-utils.ts +2 -2
- package/src/types.ts +165 -18
- package/src/utils/processTrigger.spec.ts +5 -2
- package/src/utils/processTrigger.ts +7 -6
- package/src/utils.ts +2 -0
- package/lib/src/visual-embed-sdk.d.ts +0 -2855
package/dist/tsembed.es.js
CHANGED
|
@@ -166,6 +166,7 @@ const getCustomisations = (embedConfig, viewConfig) => {
|
|
|
166
166
|
};
|
|
167
167
|
return customizations;
|
|
168
168
|
};
|
|
169
|
+
const getRuntimeFilters = (runtimefilters) => getFilterQuery(runtimefilters || []);
|
|
169
170
|
/**
|
|
170
171
|
* Gets a reference to the DOM node given
|
|
171
172
|
* a selector.
|
|
@@ -196,6 +197,14 @@ var AuthType;
|
|
|
196
197
|
/**
|
|
197
198
|
* No authentication on the SDK. Passthrough to the embedded App. Alias for
|
|
198
199
|
* `Passthrough`.
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* ```js
|
|
203
|
+
* init({
|
|
204
|
+
* // ...
|
|
205
|
+
* authType: AuthType.None,
|
|
206
|
+
* });
|
|
207
|
+
* ```
|
|
199
208
|
*/
|
|
200
209
|
AuthType["None"] = "None";
|
|
201
210
|
/**
|
|
@@ -203,6 +212,18 @@ var AuthType;
|
|
|
203
212
|
* configuration, but may not be supported by all IDPs. This will behave like `None`
|
|
204
213
|
* if SSO is not configured on ThoughtSpot.
|
|
205
214
|
*
|
|
215
|
+
* @example
|
|
216
|
+
* ```js
|
|
217
|
+
* init({
|
|
218
|
+
* // ...
|
|
219
|
+
* authType: AuthType.EmbeddedSSO,
|
|
220
|
+
* });
|
|
221
|
+
* ```
|
|
222
|
+
* Set authentication type as Embedded SSO.
|
|
223
|
+
*
|
|
224
|
+
* To use this:
|
|
225
|
+
* Your SAML or OpenID provider must allow iframe redirects.
|
|
226
|
+
* eg. If you are using okta as IdP, you can enable iFrame embedding.
|
|
206
227
|
* @version: SDK: 1.15.0 | ThouhgtSpot: 8.8.0.cl
|
|
207
228
|
*/
|
|
208
229
|
AuthType["EmbeddedSSO"] = "EmbeddedSSO";
|
|
@@ -310,6 +331,19 @@ var AuthType;
|
|
|
310
331
|
* obtained from ThoughtSpot. This uses a cookieless authentication
|
|
311
332
|
* approach, recommended to by pass third-party cookie-blocking restriction
|
|
312
333
|
* implemented by some browsers
|
|
334
|
+
*
|
|
335
|
+
* @example
|
|
336
|
+
* ```js
|
|
337
|
+
* init({
|
|
338
|
+
* // ...
|
|
339
|
+
* authType: AuthType.TrustedAuthTokenCookieless,
|
|
340
|
+
* getAuthToken: () => {
|
|
341
|
+
* return fetch('https://my-backend.app/ts-token')
|
|
342
|
+
* .then((response) => response.json())
|
|
343
|
+
* .then((data) => data.token);
|
|
344
|
+
* }
|
|
345
|
+
* ```
|
|
346
|
+
* @version SDK: 1.22.0| ThouhgtSpot: 9.3.0.cl, 9.5.1-sw
|
|
313
347
|
*/
|
|
314
348
|
AuthType["TrustedAuthTokenCookieless"] = "AuthServerCookieless";
|
|
315
349
|
/**
|
|
@@ -491,7 +525,7 @@ var EmbedEvent;
|
|
|
491
525
|
* )
|
|
492
526
|
* });
|
|
493
527
|
* ```
|
|
494
|
-
* @return
|
|
528
|
+
* @return viz, clickedPoint - metadata about point that is clicked
|
|
495
529
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
496
530
|
* @important
|
|
497
531
|
*/
|
|
@@ -846,7 +880,7 @@ var HostEvent;
|
|
|
846
880
|
* ```js
|
|
847
881
|
* searchEmbed.trigger(HostEvent.Search, {
|
|
848
882
|
* searchQuery: "[sales] by [item type],
|
|
849
|
-
*
|
|
883
|
+
* dataSources: ["cd252e5c-b552-49a8-821d-3eadaa049cca"]
|
|
850
884
|
* execute: true
|
|
851
885
|
* })
|
|
852
886
|
* ```
|
|
@@ -862,9 +896,18 @@ var HostEvent;
|
|
|
862
896
|
* column.
|
|
863
897
|
* @example
|
|
864
898
|
* ```js
|
|
865
|
-
* searchEmbed.
|
|
866
|
-
*
|
|
867
|
-
*
|
|
899
|
+
* searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
|
|
900
|
+
* console.log(payload);
|
|
901
|
+
* const clickedPoint = payload.data.clickedPoint;
|
|
902
|
+
* const selectedPoint = payload.data.selectedPoints;
|
|
903
|
+
* console.log('>>> called', clickedPoint);
|
|
904
|
+
* searchEmbed.trigger(HostEvent.DrillDown, {
|
|
905
|
+
* points: {
|
|
906
|
+
* clickedPoint,
|
|
907
|
+
* selectedPoints: selectedPoint
|
|
908
|
+
* },
|
|
909
|
+
* autoDrillDown: true,
|
|
910
|
+
* });
|
|
868
911
|
* })
|
|
869
912
|
* ```
|
|
870
913
|
* @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
|
|
@@ -888,9 +931,11 @@ var HostEvent;
|
|
|
888
931
|
* @param - an array of ids of visualizations to show, the ids not passed
|
|
889
932
|
* will be hidden.
|
|
890
933
|
* @example
|
|
934
|
+
* ```js
|
|
891
935
|
* liveboardEmbed.trigger(HostEvent.SetVisibleVizs, [
|
|
892
936
|
* '730496d6-6903-4601-937e-2c691821af3c',
|
|
893
937
|
* 'd547ec54-2a37-4516-a222-2b06719af726'])
|
|
938
|
+
* ```
|
|
894
939
|
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1-sw
|
|
895
940
|
*/
|
|
896
941
|
HostEvent["SetVisibleVizs"] = "SetPinboardVisibleVizs";
|
|
@@ -900,10 +945,12 @@ var HostEvent;
|
|
|
900
945
|
*
|
|
901
946
|
* @param - {@link RuntimeFilter}[] an array of {@link RuntimeFilter} Types.
|
|
902
947
|
* @example
|
|
948
|
+
* ```js
|
|
903
949
|
* liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
|
|
904
950
|
* {columnName: "state",operator: RuntimeFilterOp.EQ,values: ["michigan"]},
|
|
905
951
|
* {columnName: "item type",operator: RuntimeFilterOp.EQ,values: ["Jackets"]}
|
|
906
952
|
* ])
|
|
953
|
+
* ```
|
|
907
954
|
* @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
|
|
908
955
|
* @important
|
|
909
956
|
*/
|
|
@@ -1047,7 +1094,7 @@ var HostEvent;
|
|
|
1047
1094
|
*
|
|
1048
1095
|
* @example
|
|
1049
1096
|
* ```js
|
|
1050
|
-
* liveboardEmbed.trigger(HostEvent.
|
|
1097
|
+
* liveboardEmbed.trigger(HostEvent.DownloadAsPdf)
|
|
1051
1098
|
* ```
|
|
1052
1099
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
1053
1100
|
*/
|
|
@@ -1117,10 +1164,14 @@ var HostEvent;
|
|
|
1117
1164
|
* @param - object - to trigger the action for a specfic visualization
|
|
1118
1165
|
* in Liveboard embed, pass in vizId as a key
|
|
1119
1166
|
* @example
|
|
1167
|
+
* ```js
|
|
1120
1168
|
* liveboardEmbed.trigger(HostEvent.Edit)
|
|
1169
|
+
*
|
|
1121
1170
|
* liveboardEmbed.trigger(HostEvent.Edit, {vizId:
|
|
1122
1171
|
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1172
|
+
*
|
|
1123
1173
|
* vizEmbed.trigger((HostEvent.Edit)
|
|
1174
|
+
* ```
|
|
1124
1175
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
1125
1176
|
*/
|
|
1126
1177
|
HostEvent["Edit"] = "edit";
|
|
@@ -1172,10 +1223,14 @@ var HostEvent;
|
|
|
1172
1223
|
*
|
|
1173
1224
|
* @param - an object with vizId as a key
|
|
1174
1225
|
* @example
|
|
1226
|
+
* ```js
|
|
1175
1227
|
* liveboardEmbed.trigger(HostEvent.ShowUnderlyingData, {vizId:
|
|
1176
1228
|
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1229
|
+
*
|
|
1177
1230
|
* vizEmbed.trigger(HostEvent.ShowUnderlyingData)
|
|
1231
|
+
*
|
|
1178
1232
|
* searchEmbed.trigger(HostEvent.ShowUnderlyingData)
|
|
1233
|
+
* ```
|
|
1179
1234
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
1180
1235
|
*/
|
|
1181
1236
|
HostEvent["ShowUnderlyingData"] = "showUnderlyingData";
|
|
@@ -1185,23 +1240,31 @@ var HostEvent;
|
|
|
1185
1240
|
* @param - incase of Liveboard embed, takes in an object with vizId as a key
|
|
1186
1241
|
* can be left empty for search and visualization embeds
|
|
1187
1242
|
* @example
|
|
1243
|
+
* ```js
|
|
1188
1244
|
* liveboardEmbed.trigger(HostEvent.Delete, {vizId:
|
|
1189
1245
|
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1246
|
+
*
|
|
1190
1247
|
* vizEmbed.trigger(HostEvent.Delete)
|
|
1248
|
+
*
|
|
1191
1249
|
* searchEmbed.trigger(HostEvent.Delete)
|
|
1250
|
+
* ```
|
|
1192
1251
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
1193
1252
|
*/
|
|
1194
|
-
HostEvent["Delete"] = "
|
|
1253
|
+
HostEvent["Delete"] = "onDeleteAnswer";
|
|
1195
1254
|
/**
|
|
1196
1255
|
* Triggers the SpotIQAnalyze action on visualization or search
|
|
1197
1256
|
*
|
|
1198
1257
|
* @param - incase of Liveboard embed, takes in an object with vizId as a key
|
|
1199
1258
|
* can be left empty for search and visualization embeds
|
|
1200
1259
|
* @example
|
|
1260
|
+
* ```js
|
|
1201
1261
|
* liveboardEmbed.trigger(HostEvent.SpotIQAnalyze, {vizId:
|
|
1202
1262
|
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1263
|
+
*
|
|
1203
1264
|
* vizEmbed.trigger(HostEvent.SpotIQAnalyze)
|
|
1265
|
+
*
|
|
1204
1266
|
* searchEmbed.trigger(HostEvent.SpotIQAnalyze)
|
|
1267
|
+
* ```
|
|
1205
1268
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
1206
1269
|
*/
|
|
1207
1270
|
HostEvent["SpotIQAnalyze"] = "spotIQAnalyze";
|
|
@@ -1209,11 +1272,15 @@ var HostEvent;
|
|
|
1209
1272
|
* Triggers the Download action on visualization or search when Displaymode is Chart
|
|
1210
1273
|
*
|
|
1211
1274
|
* @example
|
|
1275
|
+
* ```js
|
|
1212
1276
|
* liveboardEmbed.trigger(HostEvent.Download, {vizId:
|
|
1213
1277
|
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1278
|
+
*
|
|
1214
1279
|
* vizEmbed.trigger(HostEvent.Download)
|
|
1280
|
+
*
|
|
1215
1281
|
* searchEmbed.trigger(HostEvent.Download)
|
|
1216
|
-
*
|
|
1282
|
+
* ```
|
|
1283
|
+
* @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1-sw ,Use {@link DownloadAsPng}
|
|
1217
1284
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
1218
1285
|
*/
|
|
1219
1286
|
HostEvent["Download"] = "downloadAsPng";
|
|
@@ -1224,11 +1291,9 @@ var HostEvent;
|
|
|
1224
1291
|
* ```js
|
|
1225
1292
|
* liveboardEmbed.trigger(HostEvent.DownloadAsPng,
|
|
1226
1293
|
* {vizId:'730496d6-6903-4601-937e-2c691821af3c'})
|
|
1227
|
-
*
|
|
1228
|
-
* ```js
|
|
1294
|
+
*
|
|
1229
1295
|
* vizEmbed.trigger(HostEvent.DownloadAsPng)
|
|
1230
|
-
*
|
|
1231
|
-
* ```js
|
|
1296
|
+
*
|
|
1232
1297
|
* searchEmbed.trigger(HostEvent.DownloadAsPng)
|
|
1233
1298
|
* ```
|
|
1234
1299
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1-sw
|
|
@@ -1238,10 +1303,14 @@ var HostEvent;
|
|
|
1238
1303
|
* Triggers the downloadAsCSV action on visualization or search
|
|
1239
1304
|
*
|
|
1240
1305
|
* @example
|
|
1306
|
+
* ```js
|
|
1241
1307
|
* liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId:
|
|
1242
1308
|
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1309
|
+
*
|
|
1243
1310
|
* vizEmbed.trigger(HostEvent.DownloadAsCsv)
|
|
1311
|
+
*
|
|
1244
1312
|
* searchEmbed.trigger(HostEvent.DownloadAsCsv)
|
|
1313
|
+
* ```
|
|
1245
1314
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
1246
1315
|
*/
|
|
1247
1316
|
HostEvent["DownloadAsCsv"] = "downloadAsCSV";
|
|
@@ -1249,10 +1318,14 @@ var HostEvent;
|
|
|
1249
1318
|
* Triggers the downloadAsXLSX action on visualization or search
|
|
1250
1319
|
*
|
|
1251
1320
|
* @example
|
|
1321
|
+
* ```js
|
|
1252
1322
|
* liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId:
|
|
1253
1323
|
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1324
|
+
*
|
|
1254
1325
|
* vizEmbed.trigger(HostEvent.DownloadAsXlsx)
|
|
1326
|
+
*
|
|
1255
1327
|
* searchEmbed.trigger(HostEvent.DownloadAsXlsx)
|
|
1328
|
+
* ```
|
|
1256
1329
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
1257
1330
|
*/
|
|
1258
1331
|
HostEvent["DownloadAsXlsx"] = "downloadAsXLSX";
|
|
@@ -1260,8 +1333,11 @@ var HostEvent;
|
|
|
1260
1333
|
* Triggers the Share action on a liveboard or answer
|
|
1261
1334
|
*
|
|
1262
1335
|
* @example
|
|
1336
|
+
* ```js
|
|
1263
1337
|
* liveboardEmbed.trigger(HostEvent.Share)
|
|
1338
|
+
*
|
|
1264
1339
|
* searchEmbed.trigger(HostEvent.Share)
|
|
1340
|
+
* ```
|
|
1265
1341
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
1266
1342
|
*/
|
|
1267
1343
|
HostEvent["Share"] = "share";
|
|
@@ -1269,8 +1345,11 @@ var HostEvent;
|
|
|
1269
1345
|
* Trigger the Save action on a liveboard or answer
|
|
1270
1346
|
*
|
|
1271
1347
|
* @example
|
|
1348
|
+
* ```js
|
|
1272
1349
|
* liveboardEmbed.trigger(HostEvent.Save)
|
|
1350
|
+
*
|
|
1273
1351
|
* searchEmbed.trigger(HostEvent.Save)
|
|
1352
|
+
* ```
|
|
1274
1353
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
1275
1354
|
*/
|
|
1276
1355
|
HostEvent["Save"] = "save";
|
|
@@ -1279,9 +1358,12 @@ var HostEvent;
|
|
|
1279
1358
|
*
|
|
1280
1359
|
* @param - an object with vizId as a key
|
|
1281
1360
|
* @example
|
|
1361
|
+
* ```js
|
|
1282
1362
|
* liveboardEmbed.trigger(HostEvent.SyncToSheets, {vizId:
|
|
1283
1363
|
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1364
|
+
*
|
|
1284
1365
|
* vizEmbed.trigger(HostEvent.SyncToSheets)
|
|
1366
|
+
* ```
|
|
1285
1367
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
1286
1368
|
*/
|
|
1287
1369
|
HostEvent["SyncToSheets"] = "sync-to-sheets";
|
|
@@ -1290,9 +1372,12 @@ var HostEvent;
|
|
|
1290
1372
|
*
|
|
1291
1373
|
* @param - an object with vizId as a key
|
|
1292
1374
|
* @example
|
|
1375
|
+
* ```js
|
|
1293
1376
|
* liveboardEmbed.trigger(HostEvent.SyncToOtherApps, {vizId:
|
|
1294
1377
|
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1378
|
+
*
|
|
1295
1379
|
* vizEmbed.trigger(HostEvent.SyncToOtherApps)
|
|
1380
|
+
* ```
|
|
1296
1381
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
1297
1382
|
*/
|
|
1298
1383
|
HostEvent["SyncToOtherApps"] = "sync-to-other-apps";
|
|
@@ -1301,9 +1386,12 @@ var HostEvent;
|
|
|
1301
1386
|
*
|
|
1302
1387
|
* @param - an object with vizId as a key
|
|
1303
1388
|
* @example
|
|
1389
|
+
* ```js
|
|
1304
1390
|
* liveboardEmbed.trigger(HostEvent.ManagePipelines, {vizId:
|
|
1305
1391
|
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1392
|
+
*
|
|
1306
1393
|
* vizEmbed.trigger(HostEvent.ManagePipelines)
|
|
1394
|
+
* ```
|
|
1307
1395
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
1308
1396
|
*/
|
|
1309
1397
|
HostEvent["ManagePipelines"] = "manage-pipeline";
|
|
@@ -1311,7 +1399,9 @@ var HostEvent;
|
|
|
1311
1399
|
* Triggers the Reset search in answer
|
|
1312
1400
|
*
|
|
1313
1401
|
* @example
|
|
1314
|
-
*
|
|
1402
|
+
* ```js
|
|
1403
|
+
* searchEmbed.trigger(HostEvent.ResetSearch)
|
|
1404
|
+
* ```
|
|
1315
1405
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.0.1-sw
|
|
1316
1406
|
*/
|
|
1317
1407
|
HostEvent["ResetSearch"] = "resetSearch";
|
|
@@ -1383,9 +1473,12 @@ var Param;
|
|
|
1383
1473
|
Param["cookieless"] = "cookieless";
|
|
1384
1474
|
Param["ContextMenuTrigger"] = "isContextMenuEnabledOnLeftClick";
|
|
1385
1475
|
Param["LinkOverride"] = "linkOverride";
|
|
1476
|
+
Param["blockNonEmbedFullAppAccess"] = "blockNonEmbedFullAppAccess";
|
|
1386
1477
|
Param["ShowInsertToSlide"] = "insertInToSlide";
|
|
1387
1478
|
Param["PrimaryNavHidden"] = "primaryNavHidden";
|
|
1388
1479
|
Param["HideProfleAndHelp"] = "profileAndHelpInNavBarHidden";
|
|
1480
|
+
Param["HideApplicationSwitcher"] = "applicationSwitcherHidden";
|
|
1481
|
+
Param["HideOrgSwitcher"] = "orgSwitcherHidden";
|
|
1389
1482
|
})(Param || (Param = {}));
|
|
1390
1483
|
/**
|
|
1391
1484
|
* The list of actions that can be performed on visual ThoughtSpot
|
|
@@ -1400,7 +1493,7 @@ var Param;
|
|
|
1400
1493
|
* ... // other options
|
|
1401
1494
|
* visibleActions: [Action.Save, Action.Explore],
|
|
1402
1495
|
* disableActions: [Action.Save],
|
|
1403
|
-
* hiddenActions: [Action.Download],
|
|
1496
|
+
* hiddenActions: [Action.Download], // Set either this or visibleActions
|
|
1404
1497
|
* })
|
|
1405
1498
|
* ```
|
|
1406
1499
|
*/
|
|
@@ -1522,9 +1615,6 @@ var Action;
|
|
|
1522
1615
|
Action["DrillEdit"] = "context-menu-item-edit";
|
|
1523
1616
|
Action["EditMeasure"] = "context-menu-item-edit-measure";
|
|
1524
1617
|
Action["Separator"] = "context-menu-item-separator";
|
|
1525
|
-
/**
|
|
1526
|
-
* @hidden
|
|
1527
|
-
*/
|
|
1528
1618
|
Action["DrillDown"] = "DRILL";
|
|
1529
1619
|
Action["RequestAccess"] = "requestAccess";
|
|
1530
1620
|
Action["QueryDetailsButtons"] = "queryDetailsButtons";
|
|
@@ -1615,6 +1705,10 @@ var Action;
|
|
|
1615
1705
|
* @hidden
|
|
1616
1706
|
*/
|
|
1617
1707
|
Action["InsertInToSlide"] = "insertInToSlide";
|
|
1708
|
+
/**
|
|
1709
|
+
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
1710
|
+
*/
|
|
1711
|
+
Action["RenameModalTitleDescription"] = "renameModalTitleDescription";
|
|
1618
1712
|
})(Action || (Action = {}));
|
|
1619
1713
|
// eslint-disable-next-line no-shadow
|
|
1620
1714
|
var OperationType;
|
|
@@ -1629,6 +1723,9 @@ var PrefetchFeatures;
|
|
|
1629
1723
|
PrefetchFeatures["LiveboardEmbed"] = "LiveboardEmbed";
|
|
1630
1724
|
PrefetchFeatures["VizEmbed"] = "VizEmbed";
|
|
1631
1725
|
})(PrefetchFeatures || (PrefetchFeatures = {}));
|
|
1726
|
+
/**
|
|
1727
|
+
* Enum for options to change context trigger
|
|
1728
|
+
*/
|
|
1632
1729
|
var ContextMenuTriggerOptions;
|
|
1633
1730
|
(function (ContextMenuTriggerOptions) {
|
|
1634
1731
|
ContextMenuTriggerOptions["LEFT_CLICK"] = "left-click";
|
|
@@ -26522,6 +26619,8 @@ const EndPoints = {
|
|
|
26522
26619
|
TOKEN_LOGIN: '/callosum/v1/session/login/token',
|
|
26523
26620
|
BASIC_LOGIN: '/callosum/v1/session/login',
|
|
26524
26621
|
LOGOUT: '/callosum/v1/session/logout',
|
|
26622
|
+
EXECUTE_TML: '/api/rest/2.0/metadata/tml/import',
|
|
26623
|
+
EXPORT_TML: '/api/rest/2.0/metadata/tml/export',
|
|
26525
26624
|
};
|
|
26526
26625
|
/**
|
|
26527
26626
|
* Enum for auth failure types. This is the parameter passed to the listner
|
|
@@ -26920,7 +27019,7 @@ const authenticate = async (embedConfig) => {
|
|
|
26920
27019
|
}
|
|
26921
27020
|
};
|
|
26922
27021
|
|
|
26923
|
-
/* eslint-disable
|
|
27022
|
+
/* eslint-disable camelcase */
|
|
26924
27023
|
let config = {};
|
|
26925
27024
|
const CONFIG_DEFAULTS = {
|
|
26926
27025
|
loginFailedMessage: 'Not logged in',
|
|
@@ -27108,6 +27207,87 @@ const renderInQueue = (fn) => {
|
|
|
27108
27207
|
}
|
|
27109
27208
|
// Sending an empty function to keep it consistent with the above usage.
|
|
27110
27209
|
return fn(() => { }); // eslint-disable-line @typescript-eslint/no-empty-function
|
|
27210
|
+
};
|
|
27211
|
+
const executeTML = async (data) => {
|
|
27212
|
+
const { thoughtSpotHost, authType } = config;
|
|
27213
|
+
try {
|
|
27214
|
+
sanity(config);
|
|
27215
|
+
}
|
|
27216
|
+
catch (err) {
|
|
27217
|
+
return Promise.reject(err);
|
|
27218
|
+
}
|
|
27219
|
+
let authToken = '';
|
|
27220
|
+
if (authType === AuthType.TrustedAuthTokenCookieless) {
|
|
27221
|
+
authToken = await getAuthenticaionToken(config);
|
|
27222
|
+
}
|
|
27223
|
+
const headers = {
|
|
27224
|
+
'Content-Type': 'application/json',
|
|
27225
|
+
'x-requested-by': 'ThoughtSpot',
|
|
27226
|
+
};
|
|
27227
|
+
if (authToken) {
|
|
27228
|
+
headers.Authorization = `Bearer ${authToken}`;
|
|
27229
|
+
}
|
|
27230
|
+
const payload = {
|
|
27231
|
+
metadata_tmls: data.metadata_tmls,
|
|
27232
|
+
import_policy: data.import_policy || 'PARTIAL',
|
|
27233
|
+
create_new: data.create_new || false,
|
|
27234
|
+
};
|
|
27235
|
+
return fetch(`${thoughtSpotHost}${EndPoints.EXECUTE_TML}`, {
|
|
27236
|
+
method: 'POST',
|
|
27237
|
+
headers,
|
|
27238
|
+
body: JSON.stringify(payload),
|
|
27239
|
+
credentials: 'include',
|
|
27240
|
+
})
|
|
27241
|
+
.then((response) => {
|
|
27242
|
+
if (!response.ok) {
|
|
27243
|
+
throw new Error(`Failed to import TML data: ${response.status} - ${response.statusText}`);
|
|
27244
|
+
}
|
|
27245
|
+
return response.json();
|
|
27246
|
+
})
|
|
27247
|
+
.catch((error) => {
|
|
27248
|
+
throw error;
|
|
27249
|
+
});
|
|
27250
|
+
};
|
|
27251
|
+
const exportTML = async (data) => {
|
|
27252
|
+
const { thoughtSpotHost, authType } = config;
|
|
27253
|
+
try {
|
|
27254
|
+
sanity(config);
|
|
27255
|
+
}
|
|
27256
|
+
catch (err) {
|
|
27257
|
+
return Promise.reject(err);
|
|
27258
|
+
}
|
|
27259
|
+
const payload = {
|
|
27260
|
+
metadata: data.metadata,
|
|
27261
|
+
export_associated: data.export_associated || false,
|
|
27262
|
+
export_fqn: data.export_fqn || false,
|
|
27263
|
+
edoc_format: data.edoc_format || 'YAML',
|
|
27264
|
+
};
|
|
27265
|
+
let authToken = '';
|
|
27266
|
+
if (authType === AuthType.TrustedAuthTokenCookieless) {
|
|
27267
|
+
authToken = await getAuthenticaionToken(config);
|
|
27268
|
+
}
|
|
27269
|
+
const headers = {
|
|
27270
|
+
'Content-Type': 'application/json',
|
|
27271
|
+
'x-requested-by': 'ThoughtSpot',
|
|
27272
|
+
};
|
|
27273
|
+
if (authToken) {
|
|
27274
|
+
headers.Authorization = `Bearer ${authToken}`;
|
|
27275
|
+
}
|
|
27276
|
+
return fetch(`${thoughtSpotHost}${EndPoints.EXPORT_TML}`, {
|
|
27277
|
+
method: 'POST',
|
|
27278
|
+
headers,
|
|
27279
|
+
body: JSON.stringify(payload),
|
|
27280
|
+
credentials: 'include',
|
|
27281
|
+
})
|
|
27282
|
+
.then((response) => {
|
|
27283
|
+
if (!response.ok) {
|
|
27284
|
+
throw new Error(`Failed to export TML: ${response.status} - ${response.statusText}`);
|
|
27285
|
+
}
|
|
27286
|
+
return response.json();
|
|
27287
|
+
})
|
|
27288
|
+
.catch((error) => {
|
|
27289
|
+
throw error;
|
|
27290
|
+
});
|
|
27111
27291
|
};
|
|
27112
27292
|
|
|
27113
27293
|
/**
|
|
@@ -27271,12 +27451,13 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
|
|
|
27271
27451
|
*
|
|
27272
27452
|
* @param iFrame
|
|
27273
27453
|
*/
|
|
27274
|
-
|
|
27275
|
-
const
|
|
27276
|
-
|
|
27277
|
-
|
|
27278
|
-
|
|
27279
|
-
}
|
|
27454
|
+
const reload = (iFrame) => {
|
|
27455
|
+
const src = iFrame.src;
|
|
27456
|
+
iFrame.src = '';
|
|
27457
|
+
setTimeout(() => {
|
|
27458
|
+
iFrame.src = src;
|
|
27459
|
+
}, 100);
|
|
27460
|
+
};
|
|
27280
27461
|
/**
|
|
27281
27462
|
* Post Iframe message.
|
|
27282
27463
|
*
|
|
@@ -27323,7 +27504,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
|
27323
27504
|
});
|
|
27324
27505
|
}
|
|
27325
27506
|
|
|
27326
|
-
var name="@thoughtspot/visual-embed-sdk";var version="1.21.0-
|
|
27507
|
+
var name="@thoughtspot/visual-embed-sdk";var version="1.21.0-react.0";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./dist/tsembed.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs",start:"gatsby develop","build:gatsby":"npm run clean:gatsby && gatsby build --prefix-paths","build:gatsby:noprefix":"npm run clean:gatsby && gatsby build","serve:gatsby":"gatsby serve","clean:gatsby":"gatsby clean","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw","docs-cmd":"node scripts/gatsby-commands.js",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme","test-sdk":"jest -c jest.config.sdk.js --runInBand","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs",posttest:"cat ./coverage/sdk/lcov.info | coveralls",prepublishOnly:"npm run test; npm run tsc; npm run bundle-dts; npm run bundle-dts-react-full; 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","eslint-plugin-comment-length":"^0.9.2","eslint-plugin-jsdoc":"^40.1.0",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"^2.45.0","ts-deepmerge":"^6.0.2","use-deep-compare-effect":"^1.8.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@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};
|
|
27327
27508
|
|
|
27328
27509
|
/**
|
|
27329
27510
|
* Copyright (c) 2022
|
|
@@ -27381,6 +27562,8 @@ class TsEmbed {
|
|
|
27381
27562
|
data: {
|
|
27382
27563
|
customisations: getCustomisations(this.embedConfig, this.viewConfig),
|
|
27383
27564
|
authToken,
|
|
27565
|
+
runtimeFilterParams: getRuntimeFilters(this.viewConfig.runtimeFilters),
|
|
27566
|
+
hostConfig: this.embedConfig.hostConfig,
|
|
27384
27567
|
},
|
|
27385
27568
|
});
|
|
27386
27569
|
};
|
|
@@ -27414,6 +27597,9 @@ class TsEmbed {
|
|
|
27414
27597
|
this.el = getDOMNode(domSelector);
|
|
27415
27598
|
// TODO: handle error
|
|
27416
27599
|
this.embedConfig = getEmbedConfig();
|
|
27600
|
+
if (!this.embedConfig.authTriggerContainer && !this.embedConfig.useEventForSAMLPopup) {
|
|
27601
|
+
this.embedConfig.authTriggerContainer = domSelector;
|
|
27602
|
+
}
|
|
27417
27603
|
this.thoughtSpotHost = getThoughtSpotHost(this.embedConfig);
|
|
27418
27604
|
this.thoughtSpotV2Base = getV2BasePath(this.embedConfig);
|
|
27419
27605
|
this.eventHandlerMap = new Map();
|
|
@@ -27496,6 +27682,16 @@ class TsEmbed {
|
|
|
27496
27682
|
this.executeCallbacks(eventType, processEventData(eventType, eventData, this.thoughtSpotHost, this.el), eventPort);
|
|
27497
27683
|
}
|
|
27498
27684
|
});
|
|
27685
|
+
window.addEventListener('online', (e) => {
|
|
27686
|
+
this.trigger(HostEvent.Reload);
|
|
27687
|
+
});
|
|
27688
|
+
window.addEventListener('offline', (e) => {
|
|
27689
|
+
const offlineWarning = 'Network not Detected. Embed is offline. Please reconnect and refresh';
|
|
27690
|
+
this.executeCallbacks(EmbedEvent.Error, {
|
|
27691
|
+
offlineWarning,
|
|
27692
|
+
});
|
|
27693
|
+
console.warn(offlineWarning);
|
|
27694
|
+
});
|
|
27499
27695
|
}
|
|
27500
27696
|
/**
|
|
27501
27697
|
* Constructs the base URL string to load the ThoughtSpot app.
|
|
@@ -27519,7 +27715,7 @@ class TsEmbed {
|
|
|
27519
27715
|
* @returns queryParams
|
|
27520
27716
|
*/
|
|
27521
27717
|
getBaseQueryParams(queryParams = {}) {
|
|
27522
|
-
var _a, _b, _c;
|
|
27718
|
+
var _a, _b, _c, _d;
|
|
27523
27719
|
let hostAppUrl = ((_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.host) || '';
|
|
27524
27720
|
// The below check is needed because TS Cloud firewall, blocks
|
|
27525
27721
|
// localhost/127.0.0.1 in any url param.
|
|
@@ -27531,6 +27727,7 @@ class TsEmbed {
|
|
|
27531
27727
|
queryParams[Param.ViewPortWidth] = window.innerWidth;
|
|
27532
27728
|
queryParams[Param.Version] = version$1;
|
|
27533
27729
|
queryParams[Param.AuthType] = this.embedConfig.authType;
|
|
27730
|
+
queryParams[Param.blockNonEmbedFullAppAccess] = (_b = this.embedConfig.blockNonEmbedFullAppAccess) !== null && _b !== void 0 ? _b : true;
|
|
27534
27731
|
if (this.embedConfig.disableLoginRedirect === true || this.embedConfig.autoLogin === true) {
|
|
27535
27732
|
queryParams[Param.DisableLoginRedirect] = true;
|
|
27536
27733
|
}
|
|
@@ -27546,7 +27743,7 @@ class TsEmbed {
|
|
|
27546
27743
|
return queryParams;
|
|
27547
27744
|
}
|
|
27548
27745
|
// TODO remove embedConfig.customCssUrl
|
|
27549
|
-
const cssUrlParam = ((
|
|
27746
|
+
const cssUrlParam = ((_c = customizations === null || customizations === void 0 ? void 0 : customizations.style) === null || _c === void 0 ? void 0 : _c.customCSSUrl) || this.embedConfig.customCssUrl;
|
|
27550
27747
|
if (cssUrlParam) {
|
|
27551
27748
|
queryParams[Param.CustomCSSUrl] = cssUrlParam;
|
|
27552
27749
|
}
|
|
@@ -27572,7 +27769,7 @@ class TsEmbed {
|
|
|
27572
27769
|
queryParams[Param.ContextMenuTrigger] = false;
|
|
27573
27770
|
}
|
|
27574
27771
|
const spriteUrl = (customizations === null || customizations === void 0 ? void 0 : customizations.iconSpriteUrl)
|
|
27575
|
-
|| ((
|
|
27772
|
+
|| ((_d = this.embedConfig.customizations) === null || _d === void 0 ? void 0 : _d.iconSpriteUrl);
|
|
27576
27773
|
if (spriteUrl) {
|
|
27577
27774
|
queryParams[Param.IconSpriteUrl] = spriteUrl.replace('https://', '');
|
|
27578
27775
|
}
|
|
@@ -27741,7 +27938,7 @@ class TsEmbed {
|
|
|
27741
27938
|
* @param height The height in pixels
|
|
27742
27939
|
*/
|
|
27743
27940
|
setIFrameHeight(height) {
|
|
27744
|
-
this.iFrame.style.height =
|
|
27941
|
+
this.iFrame.style.height = getCssDimension(height);
|
|
27745
27942
|
}
|
|
27746
27943
|
/**
|
|
27747
27944
|
* Executes all registered event handlers for a particular event type
|
|
@@ -27965,7 +28162,7 @@ class TsEmbed {
|
|
|
27965
28162
|
* This means without the path but with the flags already applied.
|
|
27966
28163
|
* This is useful for prerendering the component in the background.
|
|
27967
28164
|
*
|
|
27968
|
-
* @version SDK: 1.
|
|
28165
|
+
* @version SDK: 1.22.0
|
|
27969
28166
|
* @returns
|
|
27970
28167
|
*/
|
|
27971
28168
|
async prerenderGeneric() {
|
|
@@ -27986,7 +28183,7 @@ class V1Embed extends TsEmbed {
|
|
|
27986
28183
|
this.viewConfig = viewConfig;
|
|
27987
28184
|
}
|
|
27988
28185
|
/**
|
|
27989
|
-
* Render the
|
|
28186
|
+
* Render the app in an iframe and set up event handlers
|
|
27990
28187
|
*
|
|
27991
28188
|
* @param iframeSrc
|
|
27992
28189
|
*/
|
|
@@ -27994,10 +28191,13 @@ class V1Embed extends TsEmbed {
|
|
|
27994
28191
|
return this.renderIFrame(iframeSrc);
|
|
27995
28192
|
}
|
|
27996
28193
|
getRootIframeSrc() {
|
|
27997
|
-
const runtimeFilters = this.viewConfig.runtimeFilters;
|
|
27998
|
-
const filterQuery = getFilterQuery(runtimeFilters || []);
|
|
27999
28194
|
const queryParams = this.getEmbedParams();
|
|
28000
|
-
|
|
28195
|
+
let queryString = queryParams;
|
|
28196
|
+
if (!this.viewConfig.excludeRuntimeFiltersfromURL) {
|
|
28197
|
+
const runtimeFilters = this.viewConfig.runtimeFilters;
|
|
28198
|
+
const filterQuery = getFilterQuery(runtimeFilters || []);
|
|
28199
|
+
queryString = [filterQuery, queryParams].filter(Boolean).join('&');
|
|
28200
|
+
}
|
|
28001
28201
|
return this.getV1EmbedBasePath(queryString);
|
|
28002
28202
|
}
|
|
28003
28203
|
/**
|
|
@@ -28078,18 +28278,49 @@ class AppEmbed extends V1Embed {
|
|
|
28078
28278
|
// eslint-disable-next-line no-useless-constructor
|
|
28079
28279
|
constructor(domSelector, viewConfig) {
|
|
28080
28280
|
super(domSelector, viewConfig);
|
|
28281
|
+
this.defaultHeight = '100%';
|
|
28282
|
+
/**
|
|
28283
|
+
* Set the iframe height as per the computed height received
|
|
28284
|
+
* from the ThoughtSpot app.
|
|
28285
|
+
*
|
|
28286
|
+
* @param data The event payload
|
|
28287
|
+
*/
|
|
28288
|
+
this.updateIFrameHeight = (data) => {
|
|
28289
|
+
var _a;
|
|
28290
|
+
this.setIFrameHeight(Math.max(data.data, (_a = this.iFrame) === null || _a === void 0 ? void 0 : _a.scrollHeight));
|
|
28291
|
+
};
|
|
28292
|
+
this.embedIframeCenter = (data, responder) => {
|
|
28293
|
+
const obj = this.getIframeCenter();
|
|
28294
|
+
responder({ type: EmbedEvent.EmbedIframeCenter, data: obj });
|
|
28295
|
+
};
|
|
28296
|
+
this.setIframeHeightForNonEmbedLiveboard = (data) => {
|
|
28297
|
+
const { height: frameHeight, ...restParams } = this.viewConfig.frameParams || {};
|
|
28298
|
+
if (!data.data.currentPath.startsWith('/pinboard/')) {
|
|
28299
|
+
this.setIFrameHeight(frameHeight || this.defaultHeight);
|
|
28300
|
+
}
|
|
28301
|
+
};
|
|
28302
|
+
if (this.viewConfig.fullHeight === true) {
|
|
28303
|
+
this.on(EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
|
|
28304
|
+
this.on(EmbedEvent.EmbedHeight, this.updateIFrameHeight);
|
|
28305
|
+
this.on(EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
|
|
28306
|
+
}
|
|
28081
28307
|
}
|
|
28082
28308
|
/**
|
|
28083
28309
|
* Constructs a map of parameters to be passed on to the
|
|
28084
28310
|
* embedded Liveboard or visualization.
|
|
28085
28311
|
*/
|
|
28086
28312
|
getEmbedParams() {
|
|
28087
|
-
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, enableSearchAssist, } = this.viewConfig;
|
|
28313
|
+
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, } = this.viewConfig;
|
|
28088
28314
|
let params = {};
|
|
28089
28315
|
params[Param.EmbedApp] = true;
|
|
28090
28316
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
28091
28317
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
28318
|
+
params[Param.HideApplicationSwitcher] = !!hideApplicationSwitcher;
|
|
28319
|
+
params[Param.HideOrgSwitcher] = !!hideOrgSwitcher;
|
|
28092
28320
|
params = this.getBaseQueryParams(params);
|
|
28321
|
+
if (fullHeight === true) {
|
|
28322
|
+
params[Param.fullHeight] = true;
|
|
28323
|
+
}
|
|
28093
28324
|
if (tag) {
|
|
28094
28325
|
params[Param.Tag] = tag;
|
|
28095
28326
|
}
|
|
@@ -28403,7 +28634,7 @@ class SearchEmbed extends TsEmbed {
|
|
|
28403
28634
|
}
|
|
28404
28635
|
getEmbedParams() {
|
|
28405
28636
|
var _a;
|
|
28406
|
-
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, } = this.viewConfig;
|
|
28637
|
+
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, } = this.viewConfig;
|
|
28407
28638
|
const queryParams = this.getBaseQueryParams();
|
|
28408
28639
|
queryParams[Param.HideActions] = [
|
|
28409
28640
|
...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
|
|
@@ -28439,7 +28670,7 @@ class SearchEmbed extends TsEmbed {
|
|
|
28439
28670
|
query = `?${queryParamsString}`;
|
|
28440
28671
|
}
|
|
28441
28672
|
const filterQuery = getFilterQuery(runtimeFilters || []);
|
|
28442
|
-
if (filterQuery) {
|
|
28673
|
+
if (filterQuery && !excludeRuntimeFiltersfromURL) {
|
|
28443
28674
|
query += `&${filterQuery}`;
|
|
28444
28675
|
}
|
|
28445
28676
|
return query;
|
|
@@ -28529,4 +28760,4 @@ class SearchBarEmbed extends TsEmbed {
|
|
|
28529
28760
|
}
|
|
28530
28761
|
}
|
|
28531
28762
|
|
|
28532
|
-
export { Action, AppEmbed, AuthEvent, AuthFailureType, AuthStatus, AuthType, DataSourceVisualMode, EmbedEvent, HostEvent, LiveboardEmbed, Page, PinboardEmbed, PrefetchFeatures, RuntimeFilterOp, SearchBarEmbed, SearchEmbed, getEmbedConfig as getInitConfig, getSessionInfo, init, logout$1 as logout, prefetch };
|
|
28763
|
+
export { Action, AppEmbed, AuthEvent, AuthFailureType, AuthStatus, AuthType, ContextMenuTriggerOptions, DataSourceVisualMode, EmbedEvent, HostEvent, LiveboardEmbed, Page, PinboardEmbed, PrefetchFeatures, RuntimeFilterOp, SearchBarEmbed, SearchEmbed, executeTML, exportTML, getEmbedConfig as getInitConfig, getSessionInfo, init, logout$1 as logout, prefetch };
|