@thoughtspot/visual-embed-sdk 1.37.0 → 1.37.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/cjs/package.json +2 -2
- package/cjs/src/auth.d.ts +9 -4
- package/cjs/src/auth.d.ts.map +1 -1
- package/cjs/src/auth.js +21 -0
- package/cjs/src/auth.js.map +1 -1
- package/cjs/src/auth.spec.js +48 -0
- package/cjs/src/auth.spec.js.map +1 -1
- package/cjs/src/embed/app.d.ts +99 -0
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +48 -3
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +61 -0
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/base.d.ts.map +1 -1
- package/cjs/src/embed/base.js +7 -0
- package/cjs/src/embed/base.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +10 -5
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +105 -0
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/types.d.ts +69 -4
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +54 -2
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.d.ts +35 -15
- package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.js +35 -15
- package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
- package/cjs/src/utils/processData.js +6 -4
- package/cjs/src/utils/processData.js.map +1 -1
- package/dist/{index-DnIvX1FR.js → index-m9UtENc9.js} +1 -1
- package/dist/src/auth.d.ts +9 -4
- package/dist/src/auth.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +99 -0
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/base.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/dist/src/types.d.ts +69 -4
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/graphql/answerService/answerService.d.ts +35 -15
- package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +183 -31
- package/dist/tsembed-react.js +182 -30
- package/dist/tsembed.es.js +183 -31
- package/dist/tsembed.js +182 -30
- package/dist/visual-embed-sdk-react-full.d.ts +212 -23
- package/dist/visual-embed-sdk-react.d.ts +212 -23
- package/dist/visual-embed-sdk.d.ts +212 -23
- package/lib/package.json +2 -2
- package/lib/src/auth.d.ts +9 -4
- package/lib/src/auth.d.ts.map +1 -1
- package/lib/src/auth.js +21 -0
- package/lib/src/auth.js.map +1 -1
- package/lib/src/auth.spec.js +48 -0
- package/lib/src/auth.spec.js.map +1 -1
- package/lib/src/embed/app.d.ts +99 -0
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +47 -2
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +62 -1
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/base.d.ts.map +1 -1
- package/lib/src/embed/base.js +7 -0
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +10 -5
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +105 -0
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/types.d.ts +69 -4
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +54 -2
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.d.ts +35 -15
- package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.js +35 -15
- package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
- package/lib/src/utils/processData.js +6 -4
- package/lib/src/utils/processData.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +212 -23
- package/package.json +2 -2
- package/src/auth.spec.ts +52 -0
- package/src/auth.ts +25 -3
- package/src/embed/app.spec.ts +88 -0
- package/src/embed/app.ts +133 -0
- package/src/embed/base.ts +9 -0
- package/src/embed/ts-embed.spec.ts +130 -0
- package/src/embed/ts-embed.ts +10 -4
- package/src/types.ts +68 -3
- package/src/utils/graphql/answerService/answerService.ts +35 -15
- package/src/utils/processData.ts +6 -6
package/dist/tsembed.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.37.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.37.1 */
|
|
2
2
|
'use client';
|
|
3
3
|
function _mergeNamespaces(n, m) {
|
|
4
4
|
m.forEach(function (e) {
|
|
@@ -575,6 +575,18 @@ var HomeLeftNavItem;
|
|
|
575
575
|
* @version SDK: 1.34.0| ThoughtSpot: 10.3.0.cl
|
|
576
576
|
*/
|
|
577
577
|
HomeLeftNavItem["LiveboardSchedules"] = "liveboard-schedules";
|
|
578
|
+
/**
|
|
579
|
+
* Create new options in the insights left navigation,
|
|
580
|
+
* available when new navigation V3 is enabled.
|
|
581
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
582
|
+
*/
|
|
583
|
+
HomeLeftNavItem["Create"] = "create";
|
|
584
|
+
/**
|
|
585
|
+
* Spotter option in the insights left navigation,
|
|
586
|
+
* available when new navigation V3 is enabled.
|
|
587
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
588
|
+
*/
|
|
589
|
+
HomeLeftNavItem["Spotter"] = "spotter";
|
|
578
590
|
})(HomeLeftNavItem || (HomeLeftNavItem = {}));
|
|
579
591
|
/**
|
|
580
592
|
* A map of the supported runtime filter operations
|
|
@@ -1987,9 +1999,12 @@ var HostEvent;
|
|
|
1987
1999
|
* @example
|
|
1988
2000
|
* ```js
|
|
1989
2001
|
* searchEmbed.trigger(HostEvent.OpenFilter,
|
|
1990
|
-
* { columnId: '<column-GUID>', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE'})
|
|
2002
|
+
* {column: { columnId: '<column-GUID>', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE'}})
|
|
2003
|
+
* ```
|
|
2004
|
+
* @example
|
|
2005
|
+
* ```js
|
|
1991
2006
|
* LiveboardEmbed.trigger(HostEvent.OpenFilter,
|
|
1992
|
-
*
|
|
2007
|
+
* { column: {columnId: '<column-GUID>'}})
|
|
1993
2008
|
* ```
|
|
1994
2009
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
1995
2010
|
*/
|
|
@@ -2598,6 +2613,25 @@ var HostEvent;
|
|
|
2598
2613
|
* }]
|
|
2599
2614
|
* });
|
|
2600
2615
|
* ```
|
|
2616
|
+
* If there are multiple columns with the same name, consider
|
|
2617
|
+
* using `WORKSHEET_NAME::COLUMN_NAME` format.
|
|
2618
|
+
*
|
|
2619
|
+
* @example
|
|
2620
|
+
*
|
|
2621
|
+
* ```js
|
|
2622
|
+
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
2623
|
+
* filters: [{
|
|
2624
|
+
* column: "(Sample) Retail - Apparel::city",
|
|
2625
|
+
* oper: 'IN',
|
|
2626
|
+
* values: ["atlanta"]
|
|
2627
|
+
* },
|
|
2628
|
+
* {
|
|
2629
|
+
* column: "(Sample) Retail - Apparel::Region",
|
|
2630
|
+
* oper: 'IN',
|
|
2631
|
+
* values: ["West","Midwest"]
|
|
2632
|
+
* }]
|
|
2633
|
+
* });
|
|
2634
|
+
* ```
|
|
2601
2635
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
2602
2636
|
*/
|
|
2603
2637
|
HostEvent["UpdateFilters"] = "updateFilters";
|
|
@@ -2657,8 +2691,17 @@ var HostEvent;
|
|
|
2657
2691
|
/**
|
|
2658
2692
|
* Get the Answer session for a Search or
|
|
2659
2693
|
* Liveboard visualization.
|
|
2694
|
+
*
|
|
2695
|
+
* Note: This event is not typically used directly. Instead, use the
|
|
2696
|
+
* `getAnswerService()` method on the embed instance to get an AnswerService
|
|
2697
|
+
* object that provides a more convenient interface for working with answers.
|
|
2698
|
+
*
|
|
2660
2699
|
* @example
|
|
2661
2700
|
* ```js
|
|
2701
|
+
* // Preferred way to get an AnswerService
|
|
2702
|
+
* const service = await embed.getAnswerService();
|
|
2703
|
+
*
|
|
2704
|
+
* // Alternative direct usage (not recommended)
|
|
2662
2705
|
* const {session} = await embed.trigger(
|
|
2663
2706
|
* HostEvent.GetAnswerSession, {
|
|
2664
2707
|
* vizId: '123', // For Liveboard Visualization.
|
|
@@ -2666,6 +2709,10 @@ var HostEvent;
|
|
|
2666
2709
|
* ```
|
|
2667
2710
|
* @example
|
|
2668
2711
|
* ```js
|
|
2712
|
+
* // Preferred way to get an AnswerService
|
|
2713
|
+
* const service = await embed.getAnswerService();
|
|
2714
|
+
*
|
|
2715
|
+
* // Alternative direct usage (not recommended)
|
|
2669
2716
|
* const {session} = await embed.trigger( HostEvent.GetAnswerSession )
|
|
2670
2717
|
* ```
|
|
2671
2718
|
* @version SDK: 1.26.0 | ThoughtSpot: 9.10.0.cl, 10.1.0.sw
|
|
@@ -2874,6 +2921,10 @@ var Param;
|
|
|
2874
2921
|
Param["ShowInsertToSlide"] = "insertInToSlide";
|
|
2875
2922
|
Param["PrimaryNavHidden"] = "primaryNavHidden";
|
|
2876
2923
|
Param["HideProfleAndHelp"] = "profileAndHelpInNavBarHidden";
|
|
2924
|
+
Param["NavigationVersion"] = "navigationVersion";
|
|
2925
|
+
Param["HideHamburger"] = "hideHamburger";
|
|
2926
|
+
Param["HideObjectSearch"] = "hideObjectSearch";
|
|
2927
|
+
Param["HideNotification"] = "hideNotification";
|
|
2877
2928
|
Param["HideApplicationSwitcher"] = "applicationSwitcherHidden";
|
|
2878
2929
|
Param["HideOrgSwitcher"] = "orgSwitcherHidden";
|
|
2879
2930
|
Param["IsSageEmbed"] = "isSageEmbed";
|
|
@@ -2930,6 +2981,7 @@ var Param;
|
|
|
2930
2981
|
Param["preAuthCache"] = "preAuthCache";
|
|
2931
2982
|
Param["ShowSpotterLimitations"] = "showSpotterLimitations";
|
|
2932
2983
|
Param["CoverAndFilterOptionInPDF"] = "coverAndFilterOptionInPDF";
|
|
2984
|
+
Param["PrimaryAction"] = "primaryAction";
|
|
2933
2985
|
})(Param || (Param = {}));
|
|
2934
2986
|
/**
|
|
2935
2987
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -7167,29 +7219,49 @@ var OperationType;
|
|
|
7167
7219
|
OperationType["GetTableWithHeadlineData"] = "GetTableWithHeadlineData";
|
|
7168
7220
|
})(OperationType || (OperationType = {}));
|
|
7169
7221
|
/**
|
|
7170
|
-
*
|
|
7171
|
-
*
|
|
7172
|
-
*
|
|
7173
|
-
*
|
|
7222
|
+
* AnswerService provides a simple way to work with ThoughtSpot Answers.
|
|
7223
|
+
*
|
|
7224
|
+
* This service allows you to interact with ThoughtSpot Answers programmatically,
|
|
7225
|
+
* making it easy to customize visualizations, filter data, and extract insights
|
|
7226
|
+
* directly from your application.
|
|
7227
|
+
*
|
|
7228
|
+
* You can use this service to:
|
|
7229
|
+
* - Add or remove columns from Answers (`addColumns`, `removeColumns`, `addColumnsByName`)
|
|
7230
|
+
* - Apply filters to Answers (`addFilter`)
|
|
7231
|
+
* - Get data from Answers in different formats (JSON, CSV, PNG) (`fetchData`, `fetchCSVBlob`, `fetchPNGBlob`)
|
|
7232
|
+
* - Get data for specific points in visualizations (`getUnderlyingDataForPoint`)
|
|
7233
|
+
* - Run custom queries (`executeQuery`)
|
|
7234
|
+
* - Add visualizations to liveboards (`addDisplayedVizToLiveboard`)
|
|
7235
|
+
*
|
|
7174
7236
|
* @example
|
|
7175
7237
|
* ```js
|
|
7176
|
-
*
|
|
7177
|
-
*
|
|
7178
|
-
*
|
|
7179
|
-
*
|
|
7180
|
-
*
|
|
7181
|
-
*
|
|
7238
|
+
* // Get the answer service
|
|
7239
|
+
* embed.on(EmbedEvent.Data, async (e) => {
|
|
7240
|
+
* const service = await embed.getAnswerService();
|
|
7241
|
+
*
|
|
7242
|
+
* // Add columns to the answer
|
|
7243
|
+
* await service.addColumnsByName(["Sales", "Region"]);
|
|
7244
|
+
*
|
|
7245
|
+
* // Get the data
|
|
7246
|
+
* const data = await service.fetchData();
|
|
7247
|
+
* console.log(data);
|
|
7248
|
+
* });
|
|
7182
7249
|
* ```
|
|
7250
|
+
*
|
|
7183
7251
|
* @example
|
|
7184
7252
|
* ```js
|
|
7185
|
-
*
|
|
7186
|
-
*
|
|
7187
|
-
* await
|
|
7188
|
-
*
|
|
7253
|
+
* // Get data for a point in a visualization
|
|
7254
|
+
* embed.on(EmbedEvent.CustomAction, async (e) => {
|
|
7255
|
+
* const underlying = await e.answerService.getUnderlyingDataForPoint([
|
|
7256
|
+
* 'Product Name',
|
|
7257
|
+
* 'Sales Amount'
|
|
7189
7258
|
* ]);
|
|
7190
|
-
*
|
|
7259
|
+
*
|
|
7260
|
+
* const data = await underlying.fetchData(0, 100);
|
|
7261
|
+
* console.log(data);
|
|
7191
7262
|
* });
|
|
7192
7263
|
* ```
|
|
7264
|
+
*
|
|
7193
7265
|
* @version SDK: 1.25.0| ThoughtSpot: 9.10.0.cl
|
|
7194
7266
|
* @group Events
|
|
7195
7267
|
*/
|
|
@@ -7441,7 +7513,7 @@ class AnswerService {
|
|
|
7441
7513
|
async getTML() {
|
|
7442
7514
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
7443
7515
|
const edoc = object[0].edoc;
|
|
7444
|
-
const YAML = await import('./index-
|
|
7516
|
+
const YAML = await import('./index-m9UtENc9.js');
|
|
7445
7517
|
const parsedDoc = YAML.parse(edoc);
|
|
7446
7518
|
return {
|
|
7447
7519
|
answer: {
|
|
@@ -14465,6 +14537,7 @@ var AuthFailureType;
|
|
|
14465
14537
|
AuthFailureType["EXPIRY"] = "EXPIRY";
|
|
14466
14538
|
AuthFailureType["OTHER"] = "OTHER";
|
|
14467
14539
|
AuthFailureType["IDLE_SESSION_TIMEOUT"] = "IDLE_SESSION_TIMEOUT";
|
|
14540
|
+
AuthFailureType["UNAUTHENTICATED_FAILURE"] = "UNAUTHENTICATED_FAILURE";
|
|
14468
14541
|
})(AuthFailureType || (AuthFailureType = {}));
|
|
14469
14542
|
/**
|
|
14470
14543
|
* Enum for auth status emitted by the emitter returned from {@link init}.
|
|
@@ -14500,6 +14573,10 @@ var AuthStatus;
|
|
|
14500
14573
|
* @version SDK: 1.19.0
|
|
14501
14574
|
*/
|
|
14502
14575
|
AuthStatus["WAITING_FOR_POPUP"] = "WAITING_FOR_POPUP";
|
|
14576
|
+
/**
|
|
14577
|
+
* Emitted when the SAML popup is closed without authentication
|
|
14578
|
+
*/
|
|
14579
|
+
AuthStatus["SAML_POPUP_CLOSED_NO_AUTH"] = "SAML_POPUP_CLOSED_NO_AUTH";
|
|
14503
14580
|
})(AuthStatus || (AuthStatus = {}));
|
|
14504
14581
|
/**
|
|
14505
14582
|
* Events which can be triggered on the emitter returned from {@link init}.
|
|
@@ -14720,14 +14797,26 @@ const doBasicAuth = async (embedConfig) => {
|
|
|
14720
14797
|
* @param triggerText
|
|
14721
14798
|
*/
|
|
14722
14799
|
async function samlPopupFlow(ssoURL, triggerContainer, triggerText) {
|
|
14800
|
+
let popupClosedCheck;
|
|
14723
14801
|
const openPopup = () => {
|
|
14724
14802
|
if (samlAuthWindow === null || samlAuthWindow.closed) {
|
|
14725
14803
|
samlAuthWindow = window.open(ssoURL, '_blank', 'location=no,height=570,width=520,scrollbars=yes,status=yes');
|
|
14804
|
+
if (samlAuthWindow) {
|
|
14805
|
+
popupClosedCheck = setInterval(() => {
|
|
14806
|
+
if (samlAuthWindow.closed) {
|
|
14807
|
+
clearInterval(popupClosedCheck);
|
|
14808
|
+
if (samlCompletionPromise && !samlCompletionResolved) {
|
|
14809
|
+
authEE === null || authEE === void 0 ? void 0 : authEE.emit(AuthStatus.SAML_POPUP_CLOSED_NO_AUTH);
|
|
14810
|
+
}
|
|
14811
|
+
}
|
|
14812
|
+
}, 500);
|
|
14813
|
+
}
|
|
14726
14814
|
}
|
|
14727
14815
|
else {
|
|
14728
14816
|
samlAuthWindow.focus();
|
|
14729
14817
|
}
|
|
14730
14818
|
};
|
|
14819
|
+
let samlCompletionResolved = false;
|
|
14731
14820
|
authEE === null || authEE === void 0 ? void 0 : authEE.emit(AuthStatus.WAITING_FOR_POPUP);
|
|
14732
14821
|
const containerEl = getDOMNode(triggerContainer);
|
|
14733
14822
|
if (containerEl) {
|
|
@@ -14739,6 +14828,10 @@ async function samlPopupFlow(ssoURL, triggerContainer, triggerText) {
|
|
|
14739
14828
|
samlCompletionPromise = samlCompletionPromise || new Promise((resolve, reject) => {
|
|
14740
14829
|
window.addEventListener('message', (e) => {
|
|
14741
14830
|
if (e.data.type === EmbedEvent.SAMLComplete) {
|
|
14831
|
+
samlCompletionResolved = true;
|
|
14832
|
+
if (popupClosedCheck) {
|
|
14833
|
+
clearInterval(popupClosedCheck);
|
|
14834
|
+
}
|
|
14742
14835
|
e.source.close();
|
|
14743
14836
|
resolve();
|
|
14744
14837
|
}
|
|
@@ -14928,6 +15021,13 @@ const prefetch = (url, prefetchFeatures, additionalFlags) => {
|
|
|
14928
15021
|
iFrame.style.width = '0';
|
|
14929
15022
|
iFrame.style.height = '0';
|
|
14930
15023
|
iFrame.style.border = '0';
|
|
15024
|
+
// Make it 'fixed' to keep it in a different stacking context.
|
|
15025
|
+
// This should solve the focus behaviours inside the iframe from
|
|
15026
|
+
// interfering with main body.
|
|
15027
|
+
iFrame.style.position = 'fixed';
|
|
15028
|
+
// Push it out of viewport.
|
|
15029
|
+
iFrame.style.top = '100vh';
|
|
15030
|
+
iFrame.style.left = '100vw';
|
|
14931
15031
|
iFrame.classList.add('prefetchIframe');
|
|
14932
15032
|
iFrame.classList.add(`prefetchIframeNum-${index}`);
|
|
14933
15033
|
document.body.appendChild(iFrame);
|
|
@@ -15244,15 +15344,17 @@ function processNoCookieAccess(e, containerEl) {
|
|
|
15244
15344
|
* @param containerEl
|
|
15245
15345
|
*/
|
|
15246
15346
|
function processAuthFailure(e, containerEl) {
|
|
15347
|
+
var _a;
|
|
15247
15348
|
const { loginFailedMessage, authType, disableLoginFailurePage, autoLogin, } = getEmbedConfig();
|
|
15248
|
-
|
|
15249
|
-
|
|
15250
|
-
|
|
15349
|
+
const isEmbeddedSSO = authType === AuthType.EmbeddedSSO;
|
|
15350
|
+
const isTrustedAuth = authType === AuthType.TrustedAuthToken || authType === AuthType.TrustedAuthTokenCookieless;
|
|
15351
|
+
const isEmbeddedSSOInfoFailure = isEmbeddedSSO && ((_a = e === null || e === void 0 ? void 0 : e.data) === null || _a === void 0 ? void 0 : _a.type) === AuthFailureType.UNAUTHENTICATED_FAILURE;
|
|
15352
|
+
if (autoLogin && isTrustedAuth) {
|
|
15251
15353
|
// eslint-disable-next-line no-param-reassign
|
|
15252
15354
|
containerEl.innerHTML = loginFailedMessage;
|
|
15253
15355
|
notifyAuthFailure(AuthFailureType.IDLE_SESSION_TIMEOUT);
|
|
15254
15356
|
}
|
|
15255
|
-
else if (authType !== AuthType.None && !disableLoginFailurePage) {
|
|
15357
|
+
else if (authType !== AuthType.None && !disableLoginFailurePage && !isEmbeddedSSOInfoFailure) {
|
|
15256
15358
|
// eslint-disable-next-line no-param-reassign
|
|
15257
15359
|
containerEl.innerHTML = loginFailedMessage;
|
|
15258
15360
|
notifyAuthFailure(AuthFailureType.OTHER);
|
|
@@ -15297,7 +15399,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
|
|
|
15297
15399
|
return e;
|
|
15298
15400
|
}
|
|
15299
15401
|
|
|
15300
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.37.
|
|
15402
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.37.1";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.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",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.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","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};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","embedded","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$1,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
|
|
15301
15403
|
|
|
15302
15404
|
/**
|
|
15303
15405
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -15531,11 +15633,13 @@ class TsEmbed {
|
|
|
15531
15633
|
* @param responder
|
|
15532
15634
|
*/
|
|
15533
15635
|
this.updateAuthToken = async (_, responder) => {
|
|
15534
|
-
const {
|
|
15535
|
-
|
|
15536
|
-
|
|
15636
|
+
const { authType } = this.embedConfig;
|
|
15637
|
+
let { autoLogin } = this.embedConfig;
|
|
15638
|
+
// Default autoLogin: true for cookieless if undefined/null, otherwise false
|
|
15639
|
+
autoLogin = autoLogin !== null && autoLogin !== void 0 ? autoLogin : (authType === AuthType.TrustedAuthTokenCookieless);
|
|
15640
|
+
if (autoLogin && authType === AuthType.TrustedAuthTokenCookieless) {
|
|
15537
15641
|
try {
|
|
15538
|
-
authToken = await getAuthenticationToken(this.embedConfig);
|
|
15642
|
+
const authToken = await getAuthenticationToken(this.embedConfig);
|
|
15539
15643
|
responder({
|
|
15540
15644
|
type: EmbedEvent.AuthExpire,
|
|
15541
15645
|
data: { authToken },
|
|
@@ -15834,7 +15938,7 @@ class TsEmbed {
|
|
|
15834
15938
|
if (this.embedConfig.currencyFormat) {
|
|
15835
15939
|
queryParams[Param.CurrencyFormat] = this.embedConfig.currencyFormat;
|
|
15836
15940
|
}
|
|
15837
|
-
const { disabledActions, disabledActionReason, hiddenActions, visibleActions, hiddenTabs, visibleTabs, showAlerts, additionalFlags: additionalFlagsFromView, locale, customizations, contextMenuTrigger, linkOverride, insertInToSlide, disableRedirectionLinksInNewTab, overrideOrgId, exposeTranslationIDs, } = this.viewConfig;
|
|
15941
|
+
const { disabledActions, disabledActionReason, hiddenActions, visibleActions, hiddenTabs, visibleTabs, showAlerts, additionalFlags: additionalFlagsFromView, locale, customizations, contextMenuTrigger, linkOverride, insertInToSlide, disableRedirectionLinksInNewTab, overrideOrgId, exposeTranslationIDs, primaryAction, } = this.viewConfig;
|
|
15838
15942
|
const { additionalFlags: additionalFlagsFromInit } = this.embedConfig;
|
|
15839
15943
|
const additionalFlags = {
|
|
15840
15944
|
...additionalFlagsFromInit,
|
|
@@ -15848,6 +15952,9 @@ class TsEmbed {
|
|
|
15848
15952
|
this.handleError('You cannot have both hidden Tabs and visible Tabs');
|
|
15849
15953
|
return queryParams;
|
|
15850
15954
|
}
|
|
15955
|
+
if (primaryAction) {
|
|
15956
|
+
queryParams[Param.PrimaryAction] = primaryAction;
|
|
15957
|
+
}
|
|
15851
15958
|
if (disabledActions === null || disabledActions === void 0 ? void 0 : disabledActions.length) {
|
|
15852
15959
|
queryParams[Param.DisableActions] = disabledActions;
|
|
15853
15960
|
}
|
|
@@ -16686,6 +16793,31 @@ var HomePageSearchBarMode;
|
|
|
16686
16793
|
HomePageSearchBarMode["AI_ANSWER"] = "aiAnswer";
|
|
16687
16794
|
HomePageSearchBarMode["NONE"] = "none";
|
|
16688
16795
|
})(HomePageSearchBarMode || (HomePageSearchBarMode = {}));
|
|
16796
|
+
/**
|
|
16797
|
+
* Define the version of the primary navbar
|
|
16798
|
+
* @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
|
|
16799
|
+
*/
|
|
16800
|
+
var PrimaryNavbarVersion;
|
|
16801
|
+
(function (PrimaryNavbarVersion) {
|
|
16802
|
+
/**
|
|
16803
|
+
* Sliding (v3) introduces a new left-side navigation hub featuring a tab switcher,
|
|
16804
|
+
* along with updates to the top navigation bar.
|
|
16805
|
+
* It serves as the foundational version of the PrimaryNavBar.
|
|
16806
|
+
*/
|
|
16807
|
+
PrimaryNavbarVersion["Sliding"] = "v3";
|
|
16808
|
+
})(PrimaryNavbarVersion || (PrimaryNavbarVersion = {}));
|
|
16809
|
+
/**
|
|
16810
|
+
* Define the version of the home page
|
|
16811
|
+
* @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
|
|
16812
|
+
*/
|
|
16813
|
+
var HomePage;
|
|
16814
|
+
(function (HomePage) {
|
|
16815
|
+
/**
|
|
16816
|
+
* Modular (v2) introduces the updated Modular Home Experience.
|
|
16817
|
+
* It serves as the foundational version of the home page.
|
|
16818
|
+
*/
|
|
16819
|
+
HomePage["Modular"] = "v2";
|
|
16820
|
+
})(HomePage || (HomePage = {}));
|
|
16689
16821
|
/**
|
|
16690
16822
|
* Embeds full ThoughtSpot experience in a host application.
|
|
16691
16823
|
* @group Embed components
|
|
@@ -16740,9 +16872,9 @@ class AppEmbed extends V1Embed {
|
|
|
16740
16872
|
* embedded Liveboard or visualization.
|
|
16741
16873
|
*/
|
|
16742
16874
|
getEmbedParams() {
|
|
16743
|
-
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
|
|
16875
|
+
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
|
|
16744
16876
|
/* eslint-disable-next-line max-len */
|
|
16745
|
-
dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, } = this.viewConfig;
|
|
16877
|
+
dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, } = this.viewConfig;
|
|
16746
16878
|
let params = {};
|
|
16747
16879
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
16748
16880
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -16759,6 +16891,15 @@ class AppEmbed extends V1Embed {
|
|
|
16759
16891
|
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
16760
16892
|
params[Param.IsUnifiedSearchExperienceEnabled] = isUnifiedSearchExperienceEnabled;
|
|
16761
16893
|
params = this.getBaseQueryParams(params);
|
|
16894
|
+
if (hideObjectSearch) {
|
|
16895
|
+
params[Param.HideObjectSearch] = !!hideObjectSearch;
|
|
16896
|
+
}
|
|
16897
|
+
if (hideHamburger) {
|
|
16898
|
+
params[Param.HideHamburger] = !!hideHamburger;
|
|
16899
|
+
}
|
|
16900
|
+
if (hideNotification) {
|
|
16901
|
+
params[Param.HideNotification] = !!hideNotification;
|
|
16902
|
+
}
|
|
16762
16903
|
if (fullHeight === true) {
|
|
16763
16904
|
params[Param.fullHeight] = true;
|
|
16764
16905
|
}
|
|
@@ -16806,6 +16947,17 @@ class AppEmbed extends V1Embed {
|
|
|
16806
16947
|
/* eslint-disable-next-line max-len */
|
|
16807
16948
|
params[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL;
|
|
16808
16949
|
}
|
|
16950
|
+
if (discoveryExperience) {
|
|
16951
|
+
// primaryNavbarVersion v3 will enabled the new left navigation
|
|
16952
|
+
if (discoveryExperience.primaryNavbarVersion === PrimaryNavbarVersion.Sliding) {
|
|
16953
|
+
params[Param.NavigationVersion] = discoveryExperience.primaryNavbarVersion;
|
|
16954
|
+
}
|
|
16955
|
+
// homePage v2 will enable the modular home page
|
|
16956
|
+
// and it will override the modularHomeExperience value
|
|
16957
|
+
if (discoveryExperience.homePage === HomePage.Modular) {
|
|
16958
|
+
params[Param.ModularHomeExperienceEnabled] = true;
|
|
16959
|
+
}
|
|
16960
|
+
}
|
|
16809
16961
|
const queryParams = getQueryParamString(params, true);
|
|
16810
16962
|
return queryParams;
|
|
16811
16963
|
}
|