@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-react.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
|
import * as React from 'react';
|
|
4
4
|
import React__default, { useRef } from 'react';
|
|
@@ -690,6 +690,18 @@ var HomeLeftNavItem;
|
|
|
690
690
|
* @version SDK: 1.34.0| ThoughtSpot: 10.3.0.cl
|
|
691
691
|
*/
|
|
692
692
|
HomeLeftNavItem["LiveboardSchedules"] = "liveboard-schedules";
|
|
693
|
+
/**
|
|
694
|
+
* Create new options in the insights left navigation,
|
|
695
|
+
* available when new navigation V3 is enabled.
|
|
696
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
697
|
+
*/
|
|
698
|
+
HomeLeftNavItem["Create"] = "create";
|
|
699
|
+
/**
|
|
700
|
+
* Spotter option in the insights left navigation,
|
|
701
|
+
* available when new navigation V3 is enabled.
|
|
702
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
703
|
+
*/
|
|
704
|
+
HomeLeftNavItem["Spotter"] = "spotter";
|
|
693
705
|
})(HomeLeftNavItem || (HomeLeftNavItem = {}));
|
|
694
706
|
/**
|
|
695
707
|
* A map of the supported runtime filter operations
|
|
@@ -2102,9 +2114,12 @@ var HostEvent;
|
|
|
2102
2114
|
* @example
|
|
2103
2115
|
* ```js
|
|
2104
2116
|
* searchEmbed.trigger(HostEvent.OpenFilter,
|
|
2105
|
-
* { columnId: '<column-GUID>', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE'})
|
|
2117
|
+
* {column: { columnId: '<column-GUID>', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE'}})
|
|
2118
|
+
* ```
|
|
2119
|
+
* @example
|
|
2120
|
+
* ```js
|
|
2106
2121
|
* LiveboardEmbed.trigger(HostEvent.OpenFilter,
|
|
2107
|
-
*
|
|
2122
|
+
* { column: {columnId: '<column-GUID>'}})
|
|
2108
2123
|
* ```
|
|
2109
2124
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
2110
2125
|
*/
|
|
@@ -2713,6 +2728,25 @@ var HostEvent;
|
|
|
2713
2728
|
* }]
|
|
2714
2729
|
* });
|
|
2715
2730
|
* ```
|
|
2731
|
+
* If there are multiple columns with the same name, consider
|
|
2732
|
+
* using `WORKSHEET_NAME::COLUMN_NAME` format.
|
|
2733
|
+
*
|
|
2734
|
+
* @example
|
|
2735
|
+
*
|
|
2736
|
+
* ```js
|
|
2737
|
+
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
2738
|
+
* filters: [{
|
|
2739
|
+
* column: "(Sample) Retail - Apparel::city",
|
|
2740
|
+
* oper: 'IN',
|
|
2741
|
+
* values: ["atlanta"]
|
|
2742
|
+
* },
|
|
2743
|
+
* {
|
|
2744
|
+
* column: "(Sample) Retail - Apparel::Region",
|
|
2745
|
+
* oper: 'IN',
|
|
2746
|
+
* values: ["West","Midwest"]
|
|
2747
|
+
* }]
|
|
2748
|
+
* });
|
|
2749
|
+
* ```
|
|
2716
2750
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
2717
2751
|
*/
|
|
2718
2752
|
HostEvent["UpdateFilters"] = "updateFilters";
|
|
@@ -2772,8 +2806,17 @@ var HostEvent;
|
|
|
2772
2806
|
/**
|
|
2773
2807
|
* Get the Answer session for a Search or
|
|
2774
2808
|
* Liveboard visualization.
|
|
2809
|
+
*
|
|
2810
|
+
* Note: This event is not typically used directly. Instead, use the
|
|
2811
|
+
* `getAnswerService()` method on the embed instance to get an AnswerService
|
|
2812
|
+
* object that provides a more convenient interface for working with answers.
|
|
2813
|
+
*
|
|
2775
2814
|
* @example
|
|
2776
2815
|
* ```js
|
|
2816
|
+
* // Preferred way to get an AnswerService
|
|
2817
|
+
* const service = await embed.getAnswerService();
|
|
2818
|
+
*
|
|
2819
|
+
* // Alternative direct usage (not recommended)
|
|
2777
2820
|
* const {session} = await embed.trigger(
|
|
2778
2821
|
* HostEvent.GetAnswerSession, {
|
|
2779
2822
|
* vizId: '123', // For Liveboard Visualization.
|
|
@@ -2781,6 +2824,10 @@ var HostEvent;
|
|
|
2781
2824
|
* ```
|
|
2782
2825
|
* @example
|
|
2783
2826
|
* ```js
|
|
2827
|
+
* // Preferred way to get an AnswerService
|
|
2828
|
+
* const service = await embed.getAnswerService();
|
|
2829
|
+
*
|
|
2830
|
+
* // Alternative direct usage (not recommended)
|
|
2784
2831
|
* const {session} = await embed.trigger( HostEvent.GetAnswerSession )
|
|
2785
2832
|
* ```
|
|
2786
2833
|
* @version SDK: 1.26.0 | ThoughtSpot: 9.10.0.cl, 10.1.0.sw
|
|
@@ -2989,6 +3036,10 @@ var Param;
|
|
|
2989
3036
|
Param["ShowInsertToSlide"] = "insertInToSlide";
|
|
2990
3037
|
Param["PrimaryNavHidden"] = "primaryNavHidden";
|
|
2991
3038
|
Param["HideProfleAndHelp"] = "profileAndHelpInNavBarHidden";
|
|
3039
|
+
Param["NavigationVersion"] = "navigationVersion";
|
|
3040
|
+
Param["HideHamburger"] = "hideHamburger";
|
|
3041
|
+
Param["HideObjectSearch"] = "hideObjectSearch";
|
|
3042
|
+
Param["HideNotification"] = "hideNotification";
|
|
2992
3043
|
Param["HideApplicationSwitcher"] = "applicationSwitcherHidden";
|
|
2993
3044
|
Param["HideOrgSwitcher"] = "orgSwitcherHidden";
|
|
2994
3045
|
Param["IsSageEmbed"] = "isSageEmbed";
|
|
@@ -3045,6 +3096,7 @@ var Param;
|
|
|
3045
3096
|
Param["preAuthCache"] = "preAuthCache";
|
|
3046
3097
|
Param["ShowSpotterLimitations"] = "showSpotterLimitations";
|
|
3047
3098
|
Param["CoverAndFilterOptionInPDF"] = "coverAndFilterOptionInPDF";
|
|
3099
|
+
Param["PrimaryAction"] = "primaryAction";
|
|
3048
3100
|
})(Param || (Param = {}));
|
|
3049
3101
|
/**
|
|
3050
3102
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -7282,29 +7334,49 @@ var OperationType;
|
|
|
7282
7334
|
OperationType["GetTableWithHeadlineData"] = "GetTableWithHeadlineData";
|
|
7283
7335
|
})(OperationType || (OperationType = {}));
|
|
7284
7336
|
/**
|
|
7285
|
-
*
|
|
7286
|
-
*
|
|
7287
|
-
*
|
|
7288
|
-
*
|
|
7337
|
+
* AnswerService provides a simple way to work with ThoughtSpot Answers.
|
|
7338
|
+
*
|
|
7339
|
+
* This service allows you to interact with ThoughtSpot Answers programmatically,
|
|
7340
|
+
* making it easy to customize visualizations, filter data, and extract insights
|
|
7341
|
+
* directly from your application.
|
|
7342
|
+
*
|
|
7343
|
+
* You can use this service to:
|
|
7344
|
+
* - Add or remove columns from Answers (`addColumns`, `removeColumns`, `addColumnsByName`)
|
|
7345
|
+
* - Apply filters to Answers (`addFilter`)
|
|
7346
|
+
* - Get data from Answers in different formats (JSON, CSV, PNG) (`fetchData`, `fetchCSVBlob`, `fetchPNGBlob`)
|
|
7347
|
+
* - Get data for specific points in visualizations (`getUnderlyingDataForPoint`)
|
|
7348
|
+
* - Run custom queries (`executeQuery`)
|
|
7349
|
+
* - Add visualizations to liveboards (`addDisplayedVizToLiveboard`)
|
|
7350
|
+
*
|
|
7289
7351
|
* @example
|
|
7290
7352
|
* ```js
|
|
7291
|
-
*
|
|
7292
|
-
*
|
|
7293
|
-
*
|
|
7294
|
-
*
|
|
7295
|
-
*
|
|
7296
|
-
*
|
|
7353
|
+
* // Get the answer service
|
|
7354
|
+
* embed.on(EmbedEvent.Data, async (e) => {
|
|
7355
|
+
* const service = await embed.getAnswerService();
|
|
7356
|
+
*
|
|
7357
|
+
* // Add columns to the answer
|
|
7358
|
+
* await service.addColumnsByName(["Sales", "Region"]);
|
|
7359
|
+
*
|
|
7360
|
+
* // Get the data
|
|
7361
|
+
* const data = await service.fetchData();
|
|
7362
|
+
* console.log(data);
|
|
7363
|
+
* });
|
|
7297
7364
|
* ```
|
|
7365
|
+
*
|
|
7298
7366
|
* @example
|
|
7299
7367
|
* ```js
|
|
7300
|
-
*
|
|
7301
|
-
*
|
|
7302
|
-
* await
|
|
7303
|
-
*
|
|
7368
|
+
* // Get data for a point in a visualization
|
|
7369
|
+
* embed.on(EmbedEvent.CustomAction, async (e) => {
|
|
7370
|
+
* const underlying = await e.answerService.getUnderlyingDataForPoint([
|
|
7371
|
+
* 'Product Name',
|
|
7372
|
+
* 'Sales Amount'
|
|
7304
7373
|
* ]);
|
|
7305
|
-
*
|
|
7374
|
+
*
|
|
7375
|
+
* const data = await underlying.fetchData(0, 100);
|
|
7376
|
+
* console.log(data);
|
|
7306
7377
|
* });
|
|
7307
7378
|
* ```
|
|
7379
|
+
*
|
|
7308
7380
|
* @version SDK: 1.25.0| ThoughtSpot: 9.10.0.cl
|
|
7309
7381
|
* @group Events
|
|
7310
7382
|
*/
|
|
@@ -7556,7 +7628,7 @@ class AnswerService {
|
|
|
7556
7628
|
async getTML() {
|
|
7557
7629
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
7558
7630
|
const edoc = object[0].edoc;
|
|
7559
|
-
const YAML = await import('./index-
|
|
7631
|
+
const YAML = await import('./index-m9UtENc9.js');
|
|
7560
7632
|
const parsedDoc = YAML.parse(edoc);
|
|
7561
7633
|
return {
|
|
7562
7634
|
answer: {
|
|
@@ -14567,6 +14639,7 @@ var AuthFailureType;
|
|
|
14567
14639
|
AuthFailureType["EXPIRY"] = "EXPIRY";
|
|
14568
14640
|
AuthFailureType["OTHER"] = "OTHER";
|
|
14569
14641
|
AuthFailureType["IDLE_SESSION_TIMEOUT"] = "IDLE_SESSION_TIMEOUT";
|
|
14642
|
+
AuthFailureType["UNAUTHENTICATED_FAILURE"] = "UNAUTHENTICATED_FAILURE";
|
|
14570
14643
|
})(AuthFailureType || (AuthFailureType = {}));
|
|
14571
14644
|
/**
|
|
14572
14645
|
* Enum for auth status emitted by the emitter returned from {@link init}.
|
|
@@ -14602,6 +14675,10 @@ var AuthStatus;
|
|
|
14602
14675
|
* @version SDK: 1.19.0
|
|
14603
14676
|
*/
|
|
14604
14677
|
AuthStatus["WAITING_FOR_POPUP"] = "WAITING_FOR_POPUP";
|
|
14678
|
+
/**
|
|
14679
|
+
* Emitted when the SAML popup is closed without authentication
|
|
14680
|
+
*/
|
|
14681
|
+
AuthStatus["SAML_POPUP_CLOSED_NO_AUTH"] = "SAML_POPUP_CLOSED_NO_AUTH";
|
|
14605
14682
|
})(AuthStatus || (AuthStatus = {}));
|
|
14606
14683
|
/**
|
|
14607
14684
|
* Events which can be triggered on the emitter returned from {@link init}.
|
|
@@ -14822,14 +14899,26 @@ const doBasicAuth = async (embedConfig) => {
|
|
|
14822
14899
|
* @param triggerText
|
|
14823
14900
|
*/
|
|
14824
14901
|
async function samlPopupFlow(ssoURL, triggerContainer, triggerText) {
|
|
14902
|
+
let popupClosedCheck;
|
|
14825
14903
|
const openPopup = () => {
|
|
14826
14904
|
if (samlAuthWindow === null || samlAuthWindow.closed) {
|
|
14827
14905
|
samlAuthWindow = window.open(ssoURL, '_blank', 'location=no,height=570,width=520,scrollbars=yes,status=yes');
|
|
14906
|
+
if (samlAuthWindow) {
|
|
14907
|
+
popupClosedCheck = setInterval(() => {
|
|
14908
|
+
if (samlAuthWindow.closed) {
|
|
14909
|
+
clearInterval(popupClosedCheck);
|
|
14910
|
+
if (samlCompletionPromise && !samlCompletionResolved) {
|
|
14911
|
+
authEE === null || authEE === void 0 ? void 0 : authEE.emit(AuthStatus.SAML_POPUP_CLOSED_NO_AUTH);
|
|
14912
|
+
}
|
|
14913
|
+
}
|
|
14914
|
+
}, 500);
|
|
14915
|
+
}
|
|
14828
14916
|
}
|
|
14829
14917
|
else {
|
|
14830
14918
|
samlAuthWindow.focus();
|
|
14831
14919
|
}
|
|
14832
14920
|
};
|
|
14921
|
+
let samlCompletionResolved = false;
|
|
14833
14922
|
authEE === null || authEE === void 0 ? void 0 : authEE.emit(AuthStatus.WAITING_FOR_POPUP);
|
|
14834
14923
|
const containerEl = getDOMNode(triggerContainer);
|
|
14835
14924
|
if (containerEl) {
|
|
@@ -14841,6 +14930,10 @@ async function samlPopupFlow(ssoURL, triggerContainer, triggerText) {
|
|
|
14841
14930
|
samlCompletionPromise = samlCompletionPromise || new Promise((resolve, reject) => {
|
|
14842
14931
|
window.addEventListener('message', (e) => {
|
|
14843
14932
|
if (e.data.type === EmbedEvent.SAMLComplete) {
|
|
14933
|
+
samlCompletionResolved = true;
|
|
14934
|
+
if (popupClosedCheck) {
|
|
14935
|
+
clearInterval(popupClosedCheck);
|
|
14936
|
+
}
|
|
14844
14937
|
e.source.close();
|
|
14845
14938
|
resolve();
|
|
14846
14939
|
}
|
|
@@ -15017,6 +15110,13 @@ const prefetch = (url, prefetchFeatures, additionalFlags) => {
|
|
|
15017
15110
|
iFrame.style.width = '0';
|
|
15018
15111
|
iFrame.style.height = '0';
|
|
15019
15112
|
iFrame.style.border = '0';
|
|
15113
|
+
// Make it 'fixed' to keep it in a different stacking context.
|
|
15114
|
+
// This should solve the focus behaviours inside the iframe from
|
|
15115
|
+
// interfering with main body.
|
|
15116
|
+
iFrame.style.position = 'fixed';
|
|
15117
|
+
// Push it out of viewport.
|
|
15118
|
+
iFrame.style.top = '100vh';
|
|
15119
|
+
iFrame.style.left = '100vw';
|
|
15020
15120
|
iFrame.classList.add('prefetchIframe');
|
|
15021
15121
|
iFrame.classList.add(`prefetchIframeNum-${index}`);
|
|
15022
15122
|
document.body.appendChild(iFrame);
|
|
@@ -15193,15 +15293,17 @@ function processNoCookieAccess(e, containerEl) {
|
|
|
15193
15293
|
* @param containerEl
|
|
15194
15294
|
*/
|
|
15195
15295
|
function processAuthFailure(e, containerEl) {
|
|
15296
|
+
var _a;
|
|
15196
15297
|
const { loginFailedMessage, authType, disableLoginFailurePage, autoLogin, } = getEmbedConfig();
|
|
15197
|
-
|
|
15198
|
-
|
|
15199
|
-
|
|
15298
|
+
const isEmbeddedSSO = authType === AuthType.EmbeddedSSO;
|
|
15299
|
+
const isTrustedAuth = authType === AuthType.TrustedAuthToken || authType === AuthType.TrustedAuthTokenCookieless;
|
|
15300
|
+
const isEmbeddedSSOInfoFailure = isEmbeddedSSO && ((_a = e === null || e === void 0 ? void 0 : e.data) === null || _a === void 0 ? void 0 : _a.type) === AuthFailureType.UNAUTHENTICATED_FAILURE;
|
|
15301
|
+
if (autoLogin && isTrustedAuth) {
|
|
15200
15302
|
// eslint-disable-next-line no-param-reassign
|
|
15201
15303
|
containerEl.innerHTML = loginFailedMessage;
|
|
15202
15304
|
notifyAuthFailure(AuthFailureType.IDLE_SESSION_TIMEOUT);
|
|
15203
15305
|
}
|
|
15204
|
-
else if (authType !== AuthType.None && !disableLoginFailurePage) {
|
|
15306
|
+
else if (authType !== AuthType.None && !disableLoginFailurePage && !isEmbeddedSSOInfoFailure) {
|
|
15205
15307
|
// eslint-disable-next-line no-param-reassign
|
|
15206
15308
|
containerEl.innerHTML = loginFailedMessage;
|
|
15207
15309
|
notifyAuthFailure(AuthFailureType.OTHER);
|
|
@@ -15246,7 +15348,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
|
|
|
15246
15348
|
return e;
|
|
15247
15349
|
}
|
|
15248
15350
|
|
|
15249
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.37.
|
|
15351
|
+
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};
|
|
15250
15352
|
|
|
15251
15353
|
/**
|
|
15252
15354
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -15480,11 +15582,13 @@ class TsEmbed {
|
|
|
15480
15582
|
* @param responder
|
|
15481
15583
|
*/
|
|
15482
15584
|
this.updateAuthToken = async (_, responder) => {
|
|
15483
|
-
const {
|
|
15484
|
-
|
|
15485
|
-
|
|
15585
|
+
const { authType } = this.embedConfig;
|
|
15586
|
+
let { autoLogin } = this.embedConfig;
|
|
15587
|
+
// Default autoLogin: true for cookieless if undefined/null, otherwise false
|
|
15588
|
+
autoLogin = autoLogin !== null && autoLogin !== void 0 ? autoLogin : (authType === AuthType.TrustedAuthTokenCookieless);
|
|
15589
|
+
if (autoLogin && authType === AuthType.TrustedAuthTokenCookieless) {
|
|
15486
15590
|
try {
|
|
15487
|
-
authToken = await getAuthenticationToken(this.embedConfig);
|
|
15591
|
+
const authToken = await getAuthenticationToken(this.embedConfig);
|
|
15488
15592
|
responder({
|
|
15489
15593
|
type: EmbedEvent.AuthExpire,
|
|
15490
15594
|
data: { authToken },
|
|
@@ -15783,7 +15887,7 @@ class TsEmbed {
|
|
|
15783
15887
|
if (this.embedConfig.currencyFormat) {
|
|
15784
15888
|
queryParams[Param.CurrencyFormat] = this.embedConfig.currencyFormat;
|
|
15785
15889
|
}
|
|
15786
|
-
const { disabledActions, disabledActionReason, hiddenActions, visibleActions, hiddenTabs, visibleTabs, showAlerts, additionalFlags: additionalFlagsFromView, locale, customizations, contextMenuTrigger, linkOverride, insertInToSlide, disableRedirectionLinksInNewTab, overrideOrgId, exposeTranslationIDs, } = this.viewConfig;
|
|
15890
|
+
const { disabledActions, disabledActionReason, hiddenActions, visibleActions, hiddenTabs, visibleTabs, showAlerts, additionalFlags: additionalFlagsFromView, locale, customizations, contextMenuTrigger, linkOverride, insertInToSlide, disableRedirectionLinksInNewTab, overrideOrgId, exposeTranslationIDs, primaryAction, } = this.viewConfig;
|
|
15787
15891
|
const { additionalFlags: additionalFlagsFromInit } = this.embedConfig;
|
|
15788
15892
|
const additionalFlags = {
|
|
15789
15893
|
...additionalFlagsFromInit,
|
|
@@ -15797,6 +15901,9 @@ class TsEmbed {
|
|
|
15797
15901
|
this.handleError('You cannot have both hidden Tabs and visible Tabs');
|
|
15798
15902
|
return queryParams;
|
|
15799
15903
|
}
|
|
15904
|
+
if (primaryAction) {
|
|
15905
|
+
queryParams[Param.PrimaryAction] = primaryAction;
|
|
15906
|
+
}
|
|
15800
15907
|
if (disabledActions === null || disabledActions === void 0 ? void 0 : disabledActions.length) {
|
|
15801
15908
|
queryParams[Param.DisableActions] = disabledActions;
|
|
15802
15909
|
}
|
|
@@ -16961,6 +17068,31 @@ var HomePageSearchBarMode;
|
|
|
16961
17068
|
HomePageSearchBarMode["AI_ANSWER"] = "aiAnswer";
|
|
16962
17069
|
HomePageSearchBarMode["NONE"] = "none";
|
|
16963
17070
|
})(HomePageSearchBarMode || (HomePageSearchBarMode = {}));
|
|
17071
|
+
/**
|
|
17072
|
+
* Define the version of the primary navbar
|
|
17073
|
+
* @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
|
|
17074
|
+
*/
|
|
17075
|
+
var PrimaryNavbarVersion;
|
|
17076
|
+
(function (PrimaryNavbarVersion) {
|
|
17077
|
+
/**
|
|
17078
|
+
* Sliding (v3) introduces a new left-side navigation hub featuring a tab switcher,
|
|
17079
|
+
* along with updates to the top navigation bar.
|
|
17080
|
+
* It serves as the foundational version of the PrimaryNavBar.
|
|
17081
|
+
*/
|
|
17082
|
+
PrimaryNavbarVersion["Sliding"] = "v3";
|
|
17083
|
+
})(PrimaryNavbarVersion || (PrimaryNavbarVersion = {}));
|
|
17084
|
+
/**
|
|
17085
|
+
* Define the version of the home page
|
|
17086
|
+
* @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
|
|
17087
|
+
*/
|
|
17088
|
+
var HomePage;
|
|
17089
|
+
(function (HomePage) {
|
|
17090
|
+
/**
|
|
17091
|
+
* Modular (v2) introduces the updated Modular Home Experience.
|
|
17092
|
+
* It serves as the foundational version of the home page.
|
|
17093
|
+
*/
|
|
17094
|
+
HomePage["Modular"] = "v2";
|
|
17095
|
+
})(HomePage || (HomePage = {}));
|
|
16964
17096
|
/**
|
|
16965
17097
|
* Embeds full ThoughtSpot experience in a host application.
|
|
16966
17098
|
* @group Embed components
|
|
@@ -17015,9 +17147,9 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
17015
17147
|
* embedded Liveboard or visualization.
|
|
17016
17148
|
*/
|
|
17017
17149
|
getEmbedParams() {
|
|
17018
|
-
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,
|
|
17150
|
+
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,
|
|
17019
17151
|
/* eslint-disable-next-line max-len */
|
|
17020
|
-
dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, } = this.viewConfig;
|
|
17152
|
+
dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, } = this.viewConfig;
|
|
17021
17153
|
let params = {};
|
|
17022
17154
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
17023
17155
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -17034,6 +17166,15 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
17034
17166
|
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
17035
17167
|
params[Param.IsUnifiedSearchExperienceEnabled] = isUnifiedSearchExperienceEnabled;
|
|
17036
17168
|
params = this.getBaseQueryParams(params);
|
|
17169
|
+
if (hideObjectSearch) {
|
|
17170
|
+
params[Param.HideObjectSearch] = !!hideObjectSearch;
|
|
17171
|
+
}
|
|
17172
|
+
if (hideHamburger) {
|
|
17173
|
+
params[Param.HideHamburger] = !!hideHamburger;
|
|
17174
|
+
}
|
|
17175
|
+
if (hideNotification) {
|
|
17176
|
+
params[Param.HideNotification] = !!hideNotification;
|
|
17177
|
+
}
|
|
17037
17178
|
if (fullHeight === true) {
|
|
17038
17179
|
params[Param.fullHeight] = true;
|
|
17039
17180
|
}
|
|
@@ -17081,6 +17222,17 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
17081
17222
|
/* eslint-disable-next-line max-len */
|
|
17082
17223
|
params[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
|
|
17083
17224
|
}
|
|
17225
|
+
if (discoveryExperience) {
|
|
17226
|
+
// primaryNavbarVersion v3 will enabled the new left navigation
|
|
17227
|
+
if (discoveryExperience.primaryNavbarVersion === PrimaryNavbarVersion.Sliding) {
|
|
17228
|
+
params[Param.NavigationVersion] = discoveryExperience.primaryNavbarVersion;
|
|
17229
|
+
}
|
|
17230
|
+
// homePage v2 will enable the modular home page
|
|
17231
|
+
// and it will override the modularHomeExperience value
|
|
17232
|
+
if (discoveryExperience.homePage === HomePage.Modular) {
|
|
17233
|
+
params[Param.ModularHomeExperienceEnabled] = true;
|
|
17234
|
+
}
|
|
17235
|
+
}
|
|
17084
17236
|
const queryParams = getQueryParamString(params, true);
|
|
17085
17237
|
return queryParams;
|
|
17086
17238
|
}
|