@thoughtspot/visual-embed-sdk 1.35.12 → 1.35.14
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 +1 -2
- package/cjs/src/auth.d.ts +2 -1
- package/cjs/src/auth.d.ts.map +1 -1
- package/cjs/src/auth.js +3 -1
- package/cjs/src/auth.js.map +1 -1
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +2 -0
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +44 -0
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +10 -1
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +36 -0
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.d.ts +3 -3
- package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.js +6 -1
- package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +8 -2
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/search-bar.d.ts.map +1 -1
- package/cjs/src/embed/search-bar.js +4 -2
- package/cjs/src/embed/search-bar.js.map +1 -1
- package/cjs/src/embed/search.d.ts.map +1 -1
- package/cjs/src/embed/search.js +4 -2
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/search.spec.js +56 -3
- package/cjs/src/embed/search.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +6 -0
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +38 -13
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +132 -130
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/types.d.ts +43 -17
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +35 -7
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/processData.d.ts.map +1 -1
- package/cjs/src/utils/processData.js +9 -2
- package/cjs/src/utils/processData.js.map +1 -1
- package/cjs/src/utils/processData.spec.js +51 -0
- package/cjs/src/utils/processData.spec.js.map +1 -1
- package/dist/index-B3hd6DTM.js +7370 -0
- package/dist/index-vxW97_xb.js +7370 -0
- package/dist/src/auth.d.ts +2 -1
- package/dist/src/auth.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +44 -0
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/contracts.d.ts +3 -3
- package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/search-bar.d.ts.map +1 -1
- package/dist/src/embed/search.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +6 -0
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/types.d.ts +43 -17
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/processData.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +122 -34
- package/dist/tsembed-react.js +121 -33
- package/dist/tsembed.es.js +122 -34
- package/dist/tsembed.js +121 -33
- package/dist/visual-embed-sdk-react-full.d.ts +92 -21
- package/dist/visual-embed-sdk-react.d.ts +92 -21
- package/dist/visual-embed-sdk.d.ts +92 -21
- package/lib/package.json +1 -2
- package/lib/src/auth.d.ts +2 -1
- package/lib/src/auth.d.ts.map +1 -1
- package/lib/src/auth.js +3 -1
- package/lib/src/auth.js.map +1 -1
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +2 -0
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +44 -0
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +10 -1
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +36 -0
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts +3 -3
- package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.js +6 -1
- package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +8 -2
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/search-bar.d.ts.map +1 -1
- package/lib/src/embed/search-bar.js +4 -2
- package/lib/src/embed/search-bar.js.map +1 -1
- package/lib/src/embed/search.d.ts.map +1 -1
- package/lib/src/embed/search.js +4 -2
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/search.spec.js +56 -3
- package/lib/src/embed/search.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +6 -0
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +38 -13
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +133 -131
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/types.d.ts +43 -17
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +35 -7
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/processData.d.ts.map +1 -1
- package/lib/src/utils/processData.js +9 -2
- package/lib/src/utils/processData.js.map +1 -1
- package/lib/src/utils/processData.spec.js +51 -0
- package/lib/src/utils/processData.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +92 -21
- package/package.json +1 -2
- package/src/auth.ts +3 -1
- package/src/embed/app.ts +2 -0
- package/src/embed/conversation.spec.ts +52 -3
- package/src/embed/conversation.ts +60 -1
- package/src/embed/hostEventClient/contracts.ts +3 -3
- package/src/embed/hostEventClient/host-event-client.ts +7 -1
- package/src/embed/liveboard.ts +9 -4
- package/src/embed/search-bar.tsx +6 -4
- package/src/embed/search.spec.ts +71 -3
- package/src/embed/search.ts +6 -5
- package/src/embed/ts-embed.spec.ts +153 -180
- package/src/embed/ts-embed.ts +46 -30
- package/src/types.ts +44 -15
- package/src/utils/processData.spec.ts +63 -0
- package/src/utils/processData.ts +12 -2
package/dist/tsembed.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.35.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.35.14 */
|
|
2
2
|
function _mergeNamespaces(n, m) {
|
|
3
3
|
m.forEach(function (e) {
|
|
4
4
|
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
@@ -923,6 +923,11 @@ var EmbedEvent;
|
|
|
923
923
|
* @hidden
|
|
924
924
|
*/
|
|
925
925
|
EmbedEvent["AuthFailure"] = "ThoughtspotAuthFailure";
|
|
926
|
+
/**
|
|
927
|
+
* ThoughtSpot failed to re validate the auth session.
|
|
928
|
+
* @hidden
|
|
929
|
+
*/
|
|
930
|
+
EmbedEvent["IdleSessionTimeout"] = "IdleSessionTimeout";
|
|
926
931
|
/**
|
|
927
932
|
* ThoughtSpot failed to validate the auth session.
|
|
928
933
|
* @hidden
|
|
@@ -1646,6 +1651,19 @@ var EmbedEvent;
|
|
|
1646
1651
|
* @version SDK: 1.35.12 | ThoughtSpot: 10.7.0.cl
|
|
1647
1652
|
*/
|
|
1648
1653
|
EmbedEvent["TableVizRendered"] = "TableVizRendered";
|
|
1654
|
+
/**
|
|
1655
|
+
* Emitted when the liveboard is created from pin modal or liveboard list page.
|
|
1656
|
+
* You can use this event as a hook to trigger
|
|
1657
|
+
* other events on liveboard creation.
|
|
1658
|
+
*
|
|
1659
|
+
* ```js
|
|
1660
|
+
* liveboardEmbed.on(EmbedEvent.CreateLiveboard, (payload) => {
|
|
1661
|
+
* console.log('payload', payload);
|
|
1662
|
+
* })
|
|
1663
|
+
*```
|
|
1664
|
+
* @version SDK : 1.36.0 | ThoughtSpot : 10.8.0.cl
|
|
1665
|
+
*/
|
|
1666
|
+
EmbedEvent["CreateLiveboard"] = "createLiveboard";
|
|
1649
1667
|
})(EmbedEvent || (EmbedEvent = {}));
|
|
1650
1668
|
/**
|
|
1651
1669
|
* Event types that can be triggered by the host application
|
|
@@ -2652,6 +2670,7 @@ var Param;
|
|
|
2652
2670
|
Param["HideResult"] = "hideResult";
|
|
2653
2671
|
Param["UseLastSelectedDataSource"] = "useLastSelectedSources";
|
|
2654
2672
|
Param["Tag"] = "tag";
|
|
2673
|
+
Param["AutoLogin"] = "autoLogin";
|
|
2655
2674
|
Param["searchTokenString"] = "searchTokenString";
|
|
2656
2675
|
Param["executeSearch"] = "executeSearch";
|
|
2657
2676
|
Param["fullHeight"] = "isFullHeightPinboard";
|
|
@@ -2734,10 +2753,10 @@ var Param;
|
|
|
2734
2753
|
Param["SpotterEnabled"] = "isSpotterExperienceEnabled";
|
|
2735
2754
|
Param["IsUnifiedSearchExperienceEnabled"] = "isUnifiedSearchExperienceEnabled";
|
|
2736
2755
|
Param["OverrideOrgId"] = "orgId";
|
|
2737
|
-
Param["EnableFlipTooltipToContextMenu"] = "flipTooltipToContextMenuEnabled";
|
|
2738
2756
|
Param["OauthPollingInterval"] = "oAuthPollingInterval";
|
|
2739
2757
|
Param["IsForceRedirect"] = "isForceRedirect";
|
|
2740
2758
|
Param["DataSourceId"] = "dataSourceId";
|
|
2759
|
+
Param["ShowSpotterLimitations"] = "showSpotterLimitations";
|
|
2741
2760
|
})(Param || (Param = {}));
|
|
2742
2761
|
/**
|
|
2743
2762
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -3944,10 +3963,17 @@ var ContextMenuTriggerOptions;
|
|
|
3944
3963
|
ContextMenuTriggerOptions["RIGHT_CLICK"] = "right-click";
|
|
3945
3964
|
ContextMenuTriggerOptions["BOTH_CLICKS"] = "both-clicks";
|
|
3946
3965
|
})(ContextMenuTriggerOptions || (ContextMenuTriggerOptions = {}));
|
|
3966
|
+
/**
|
|
3967
|
+
* Enum options to show or suppress Visual Embed SDK and
|
|
3968
|
+
* ThoughtSpot application logs in the console output.
|
|
3969
|
+
* This attribute doesn't support suppressing
|
|
3970
|
+
* browser warnings or errors.
|
|
3971
|
+
*/
|
|
3947
3972
|
var LogLevel;
|
|
3948
3973
|
(function (LogLevel) {
|
|
3949
3974
|
/**
|
|
3950
|
-
* No logs will be logged
|
|
3975
|
+
* No application or SDK-related logs will be logged
|
|
3976
|
+
* in the console output.
|
|
3951
3977
|
* @example
|
|
3952
3978
|
* ```js
|
|
3953
3979
|
* init({
|
|
@@ -3959,7 +3985,7 @@ var LogLevel;
|
|
|
3959
3985
|
*/
|
|
3960
3986
|
LogLevel["SILENT"] = "SILENT";
|
|
3961
3987
|
/**
|
|
3962
|
-
*
|
|
3988
|
+
* Log only errors in the console output.
|
|
3963
3989
|
* @example
|
|
3964
3990
|
* ```js
|
|
3965
3991
|
* init({
|
|
@@ -3971,7 +3997,7 @@ var LogLevel;
|
|
|
3971
3997
|
*/
|
|
3972
3998
|
LogLevel["ERROR"] = "ERROR";
|
|
3973
3999
|
/**
|
|
3974
|
-
*
|
|
4000
|
+
* Log only warnings and errors in the console output.
|
|
3975
4001
|
* @example
|
|
3976
4002
|
* ```js
|
|
3977
4003
|
* init({
|
|
@@ -3983,7 +4009,8 @@ var LogLevel;
|
|
|
3983
4009
|
*/
|
|
3984
4010
|
LogLevel["WARN"] = "WARN";
|
|
3985
4011
|
/**
|
|
3986
|
-
*
|
|
4012
|
+
* Log only the information alerts, warnings, and errors
|
|
4013
|
+
* in the console output.
|
|
3987
4014
|
* @example
|
|
3988
4015
|
* ```js
|
|
3989
4016
|
* init({
|
|
@@ -3995,7 +4022,8 @@ var LogLevel;
|
|
|
3995
4022
|
*/
|
|
3996
4023
|
LogLevel["INFO"] = "INFO";
|
|
3997
4024
|
/**
|
|
3998
|
-
*
|
|
4025
|
+
* Log debug messages, warnings, information alerts,
|
|
4026
|
+
* and errors in the console output.
|
|
3999
4027
|
* @example
|
|
4000
4028
|
* ```js
|
|
4001
4029
|
* init({
|
|
@@ -4007,7 +4035,7 @@ var LogLevel;
|
|
|
4007
4035
|
*/
|
|
4008
4036
|
LogLevel["DEBUG"] = "DEBUG";
|
|
4009
4037
|
/**
|
|
4010
|
-
* All logs will be logged in the console.
|
|
4038
|
+
* All logs will be logged in the browser console.
|
|
4011
4039
|
* @example
|
|
4012
4040
|
* ```js
|
|
4013
4041
|
* init({
|
|
@@ -7199,7 +7227,7 @@ class AnswerService {
|
|
|
7199
7227
|
async getTML() {
|
|
7200
7228
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
7201
7229
|
const edoc = object[0].edoc;
|
|
7202
|
-
const YAML = await import('./index-
|
|
7230
|
+
const YAML = await import('./index-vxW97_xb.js');
|
|
7203
7231
|
const parsedDoc = YAML.parse(edoc);
|
|
7204
7232
|
return {
|
|
7205
7233
|
answer: {
|
|
@@ -14102,6 +14130,7 @@ var AuthFailureType;
|
|
|
14102
14130
|
AuthFailureType["NO_COOKIE_ACCESS"] = "NO_COOKIE_ACCESS";
|
|
14103
14131
|
AuthFailureType["EXPIRY"] = "EXPIRY";
|
|
14104
14132
|
AuthFailureType["OTHER"] = "OTHER";
|
|
14133
|
+
AuthFailureType["IDLE_SESSION_TIMEOUT"] = "IDLE_SESSION_TIMEOUT";
|
|
14105
14134
|
})(AuthFailureType || (AuthFailureType = {}));
|
|
14106
14135
|
/**
|
|
14107
14136
|
* Enum for auth status emitted by the emitter returned from {@link init}.
|
|
@@ -14427,7 +14456,8 @@ const doOIDCAuth = async (embedConfig) => {
|
|
|
14427
14456
|
? `${thoughtSpotHost}/v2/#/embed/saml-complete`
|
|
14428
14457
|
: getRedirectUrl(window.location.href, SSO_REDIRECTION_MARKER_GUID, embedConfig.redirectPath);
|
|
14429
14458
|
// bring back the page to the same URL
|
|
14430
|
-
const
|
|
14459
|
+
const baseEndpoint = `${EndPoints.OIDC_LOGIN_TEMPLATE(encodeURIComponent(ssoRedirectUrl))}`;
|
|
14460
|
+
const ssoEndPoint = `${baseEndpoint}${baseEndpoint.includes('?') ? '&' : '?'}forceSAMLAutoRedirect=true`;
|
|
14431
14461
|
await doSSOAuth(embedConfig, ssoEndPoint);
|
|
14432
14462
|
return loggedInStatus;
|
|
14433
14463
|
};
|
|
@@ -14839,8 +14869,15 @@ function processNoCookieAccess(e, containerEl) {
|
|
|
14839
14869
|
* @param containerEl
|
|
14840
14870
|
*/
|
|
14841
14871
|
function processAuthFailure(e, containerEl) {
|
|
14842
|
-
const { loginFailedMessage, authType, disableLoginFailurePage } = getEmbedConfig();
|
|
14843
|
-
if (
|
|
14872
|
+
const { loginFailedMessage, authType, disableLoginFailurePage, autoLogin, } = getEmbedConfig();
|
|
14873
|
+
if (autoLogin
|
|
14874
|
+
&& (authType === AuthType.TrustedAuthToken
|
|
14875
|
+
|| authType === AuthType.TrustedAuthTokenCookieless)) {
|
|
14876
|
+
// eslint-disable-next-line no-param-reassign
|
|
14877
|
+
containerEl.innerHTML = loginFailedMessage;
|
|
14878
|
+
notifyAuthFailure(AuthFailureType.IDLE_SESSION_TIMEOUT);
|
|
14879
|
+
}
|
|
14880
|
+
else if (authType !== AuthType.None && !disableLoginFailurePage) {
|
|
14844
14881
|
// eslint-disable-next-line no-param-reassign
|
|
14845
14882
|
containerEl.innerHTML = loginFailedMessage;
|
|
14846
14883
|
notifyAuthFailure(AuthFailureType.OTHER);
|
|
@@ -14885,7 +14922,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
|
|
|
14885
14922
|
return e;
|
|
14886
14923
|
}
|
|
14887
14924
|
|
|
14888
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.35.
|
|
14925
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.35.14";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={algoliasearch:"^4.10.5",classnames:"^2.3.1",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",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":"^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",crypto:"^1.0.1","current-git-branch":"^1.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","eslint-plugin-comment-length":"1.7.3","eslint-plugin-jsdoc":"^46.9.0","fs-extra":"^10.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-fetch-mock":"^3.0.3",jsdom:"^17.0.0","node-sass":"^8.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","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^5.3.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","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};
|
|
14889
14926
|
|
|
14890
14927
|
/**
|
|
14891
14928
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -15010,7 +15047,12 @@ class HostEventClient {
|
|
|
15010
15047
|
if (!payload || !('newVizName' in payload)) {
|
|
15011
15048
|
return this.hostEventFallback(HostEvent.Pin, payload);
|
|
15012
15049
|
}
|
|
15013
|
-
|
|
15050
|
+
const formattedPayload = {
|
|
15051
|
+
...payload,
|
|
15052
|
+
pinboardId: payload.liveboardId,
|
|
15053
|
+
newPinboardName: payload.newLiveboardName,
|
|
15054
|
+
};
|
|
15055
|
+
return this.handleHostEventWithParam(UIPassthroughEvent.PinAnswerToLiveboard, formattedPayload);
|
|
15014
15056
|
}
|
|
15015
15057
|
async handleSaveAnswerEvent(payload) {
|
|
15016
15058
|
var _a, _b, _c, _d;
|
|
@@ -15129,12 +15171,37 @@ class TsEmbed {
|
|
|
15129
15171
|
}
|
|
15130
15172
|
notifyAuthFailure(AuthFailureType.EXPIRY);
|
|
15131
15173
|
};
|
|
15174
|
+
/**
|
|
15175
|
+
* Auto Login and send updated authToken to the iFrame to avoid user session logout
|
|
15176
|
+
* @param _
|
|
15177
|
+
* @param responder
|
|
15178
|
+
*/
|
|
15179
|
+
this.idleSessionTimeout = (_, responder) => {
|
|
15180
|
+
handleAuth().then(async () => {
|
|
15181
|
+
let authToken = '';
|
|
15182
|
+
try {
|
|
15183
|
+
authToken = await getAuthenticationToken(this.embedConfig);
|
|
15184
|
+
responder({
|
|
15185
|
+
type: EmbedEvent.IdleSessionTimeout,
|
|
15186
|
+
data: { authToken },
|
|
15187
|
+
});
|
|
15188
|
+
}
|
|
15189
|
+
catch (e) {
|
|
15190
|
+
logger$3.error(`${ERROR_MESSAGE.INVALID_TOKEN_ERROR} Error : ${e === null || e === void 0 ? void 0 : e.message}`);
|
|
15191
|
+
processAuthFailure(e, this.isPreRendered ? this.preRenderWrapper : this.el);
|
|
15192
|
+
}
|
|
15193
|
+
}).catch((e) => {
|
|
15194
|
+
logger$3.error(`Auto Login failed, Error : ${e === null || e === void 0 ? void 0 : e.message}`);
|
|
15195
|
+
});
|
|
15196
|
+
notifyAuthFailure(AuthFailureType.IDLE_SESSION_TIMEOUT);
|
|
15197
|
+
};
|
|
15132
15198
|
/**
|
|
15133
15199
|
* Register APP_INIT event and sendback init payload
|
|
15134
15200
|
*/
|
|
15135
15201
|
this.registerAppInit = () => {
|
|
15136
15202
|
this.on(EmbedEvent.APP_INIT, this.appInitCb, { start: false }, true);
|
|
15137
15203
|
this.on(EmbedEvent.AuthExpire, this.updateAuthToken, { start: false }, true);
|
|
15204
|
+
this.on(EmbedEvent.IdleSessionTimeout, this.idleSessionTimeout, { start: false }, true);
|
|
15138
15205
|
};
|
|
15139
15206
|
this.showPreRenderByDefault = false;
|
|
15140
15207
|
this.validatePreRenderViewConfig = (viewConfig) => {
|
|
@@ -15317,7 +15384,7 @@ class TsEmbed {
|
|
|
15317
15384
|
* @param query
|
|
15318
15385
|
*/
|
|
15319
15386
|
getEmbedBasePath(query) {
|
|
15320
|
-
let queryString =
|
|
15387
|
+
let queryString = query.startsWith('?') ? query : `?${query}`;
|
|
15321
15388
|
if (this.shouldEncodeUrlQueryParams) {
|
|
15322
15389
|
queryString = `?base64UrlEncodedFlags=${getEncodedQueryParamsString(queryString.substr(1))}`;
|
|
15323
15390
|
}
|
|
@@ -15332,20 +15399,22 @@ class TsEmbed {
|
|
|
15332
15399
|
* @returns queryParams
|
|
15333
15400
|
*/
|
|
15334
15401
|
getBaseQueryParams(queryParams = {}) {
|
|
15335
|
-
var _a, _b
|
|
15402
|
+
var _a, _b;
|
|
15336
15403
|
let hostAppUrl = ((_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.host) || '';
|
|
15337
15404
|
// The below check is needed because TS Cloud firewall, blocks
|
|
15338
15405
|
// localhost/127.0.0.1 in any url param.
|
|
15339
15406
|
if (hostAppUrl.includes('localhost') || hostAppUrl.includes('127.0.0.1')) {
|
|
15340
15407
|
hostAppUrl = 'local-host';
|
|
15341
15408
|
}
|
|
15409
|
+
const blockNonEmbedFullAppAccess = (_b = this.embedConfig.blockNonEmbedFullAppAccess) !== null && _b !== void 0 ? _b : true;
|
|
15342
15410
|
queryParams[Param.EmbedApp] = true;
|
|
15343
15411
|
queryParams[Param.HostAppUrl] = encodeURIComponent(hostAppUrl);
|
|
15344
15412
|
queryParams[Param.ViewPortHeight] = window.innerHeight;
|
|
15345
15413
|
queryParams[Param.ViewPortWidth] = window.innerWidth;
|
|
15346
15414
|
queryParams[Param.Version] = version;
|
|
15347
15415
|
queryParams[Param.AuthType] = this.embedConfig.authType;
|
|
15348
|
-
queryParams[Param.blockNonEmbedFullAppAccess] =
|
|
15416
|
+
queryParams[Param.blockNonEmbedFullAppAccess] = blockNonEmbedFullAppAccess;
|
|
15417
|
+
queryParams[Param.AutoLogin] = this.embedConfig.autoLogin;
|
|
15349
15418
|
if (this.embedConfig.disableLoginRedirect === true || this.embedConfig.autoLogin === true) {
|
|
15350
15419
|
queryParams[Param.DisableLoginRedirect] = true;
|
|
15351
15420
|
}
|
|
@@ -15367,15 +15436,12 @@ class TsEmbed {
|
|
|
15367
15436
|
if (this.embedConfig.currencyFormat) {
|
|
15368
15437
|
queryParams[Param.CurrencyFormat] = this.embedConfig.currencyFormat;
|
|
15369
15438
|
}
|
|
15370
|
-
const { disabledActions, disabledActionReason, hiddenActions, visibleActions, hiddenTabs, visibleTabs, showAlerts, additionalFlags: additionalFlagsFromView, locale, customizations, contextMenuTrigger, linkOverride, insertInToSlide, disableRedirectionLinksInNewTab, overrideOrgId,
|
|
15439
|
+
const { disabledActions, disabledActionReason, hiddenActions, visibleActions, hiddenTabs, visibleTabs, showAlerts, additionalFlags: additionalFlagsFromView, locale, customizations, contextMenuTrigger, linkOverride, insertInToSlide, disableRedirectionLinksInNewTab, overrideOrgId, } = this.viewConfig;
|
|
15371
15440
|
const { additionalFlags: additionalFlagsFromInit } = this.embedConfig;
|
|
15372
15441
|
const additionalFlags = {
|
|
15373
15442
|
...additionalFlagsFromInit,
|
|
15374
15443
|
...additionalFlagsFromView,
|
|
15375
15444
|
};
|
|
15376
|
-
if (enableFlipTooltipToContextMenu) {
|
|
15377
|
-
queryParams[Param.EnableFlipTooltipToContextMenu] = enableFlipTooltipToContextMenu;
|
|
15378
|
-
}
|
|
15379
15445
|
if (Array.isArray(visibleActions) && Array.isArray(hiddenActions)) {
|
|
15380
15446
|
this.handleError('You cannot have both hidden actions and visible actions');
|
|
15381
15447
|
return queryParams;
|
|
@@ -15414,8 +15480,8 @@ class TsEmbed {
|
|
|
15414
15480
|
else if (contextMenuTrigger === ContextMenuTriggerOptions.BOTH_CLICKS) {
|
|
15415
15481
|
queryParams[Param.ContextMenuTrigger] = 'both';
|
|
15416
15482
|
}
|
|
15417
|
-
const
|
|
15418
|
-
|
|
15483
|
+
const embedCustomizations = this.embedConfig.customizations;
|
|
15484
|
+
const spriteUrl = (customizations === null || customizations === void 0 ? void 0 : customizations.iconSpriteUrl) || (embedCustomizations === null || embedCustomizations === void 0 ? void 0 : embedCustomizations.iconSpriteUrl);
|
|
15419
15485
|
if (spriteUrl) {
|
|
15420
15486
|
queryParams[Param.IconSpriteUrl] = spriteUrl.replace('https://', '');
|
|
15421
15487
|
}
|
|
@@ -15487,7 +15553,8 @@ class TsEmbed {
|
|
|
15487
15553
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
15488
15554
|
// @ts-ignore
|
|
15489
15555
|
iFrame.allow = 'clipboard-read; clipboard-write; fullscreen;';
|
|
15490
|
-
const
|
|
15556
|
+
const frameParams = this.viewConfig.frameParams;
|
|
15557
|
+
const { height: frameHeight, width: frameWidth, ...restParams } = frameParams || {};
|
|
15491
15558
|
const width = getCssDimension(frameWidth || DEFAULT_EMBED_WIDTH);
|
|
15492
15559
|
const height = getCssDimension(frameHeight || DEFAULT_EMBED_HEIGHT);
|
|
15493
15560
|
setAttributes(iFrame, restParams);
|
|
@@ -15592,8 +15659,8 @@ class TsEmbed {
|
|
|
15592
15659
|
}
|
|
15593
15660
|
connectPreRendered() {
|
|
15594
15661
|
const preRenderIds = this.getPreRenderIds();
|
|
15595
|
-
|
|
15596
|
-
|
|
15662
|
+
const preRenderWrapperElement = document.getElementById(preRenderIds.wrapper);
|
|
15663
|
+
this.preRenderWrapper = this.preRenderWrapper || preRenderWrapperElement;
|
|
15597
15664
|
this.preRenderChild = this.preRenderChild || document.getElementById(preRenderIds.child);
|
|
15598
15665
|
if (this.preRenderWrapper && this.preRenderChild) {
|
|
15599
15666
|
this.isPreRendered = true;
|
|
@@ -16095,7 +16162,7 @@ class V1Embed extends TsEmbed {
|
|
|
16095
16162
|
const filterQuery = getFilterQuery(runtimeFilters || []);
|
|
16096
16163
|
queryString = [filterQuery, queryString].filter(Boolean).join('&');
|
|
16097
16164
|
}
|
|
16098
|
-
return
|
|
16165
|
+
return this.viewConfig.enableV2Shell_experimental
|
|
16099
16166
|
? this.getEmbedBasePath(queryString)
|
|
16100
16167
|
: this.getV1EmbedBasePath(queryString);
|
|
16101
16168
|
}
|
|
@@ -16228,6 +16295,8 @@ class AppEmbed extends V1Embed {
|
|
|
16228
16295
|
'/embed/insights/viz/',
|
|
16229
16296
|
'/liveboard/',
|
|
16230
16297
|
'/insights/liveboard/',
|
|
16298
|
+
'/tsl-editor/PINBOARD_ANSWER_BOOK/',
|
|
16299
|
+
'/import-tsl/PINBOARD_ANSWER_BOOK/',
|
|
16231
16300
|
];
|
|
16232
16301
|
if (liveboardRelatedRoutes.some((path) => data.data.currentPath.startsWith(path))) {
|
|
16233
16302
|
// Ignore the height reset of the frame, if the navigation is
|
|
@@ -16489,6 +16558,12 @@ const addPreviewStylesIfNotPresent = () => {
|
|
|
16489
16558
|
* @summary Liveboard & visualization embed
|
|
16490
16559
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
16491
16560
|
*/
|
|
16561
|
+
const liveboardHeightWhitelistedRoutes = [
|
|
16562
|
+
'/embed/viz/',
|
|
16563
|
+
'/embed/insights/viz/',
|
|
16564
|
+
'/tsl-editor/PINBOARD_ANSWER_BOOK/',
|
|
16565
|
+
'/import-tsl/PINBOARD_ANSWER_BOOK/',
|
|
16566
|
+
];
|
|
16492
16567
|
/**
|
|
16493
16568
|
* Embed a ThoughtSpot Liveboard or visualization. When rendered it already
|
|
16494
16569
|
* waits for the authentication to complete, so you need not wait for
|
|
@@ -16523,8 +16598,8 @@ class LiveboardEmbed extends V1Embed {
|
|
|
16523
16598
|
responder({ type: EmbedEvent.EmbedIframeCenter, data: obj });
|
|
16524
16599
|
};
|
|
16525
16600
|
this.setIframeHeightForNonEmbedLiveboard = (data) => {
|
|
16526
|
-
|
|
16527
|
-
|
|
16601
|
+
const routePath = data.data.currentPath;
|
|
16602
|
+
if (liveboardHeightWhitelistedRoutes.some((path) => routePath.startsWith(path))) {
|
|
16528
16603
|
return;
|
|
16529
16604
|
}
|
|
16530
16605
|
this.setIFrameHeight(this.defaultHeight);
|
|
@@ -16835,8 +16910,10 @@ class SearchEmbed extends TsEmbed {
|
|
|
16835
16910
|
if (dataSource) {
|
|
16836
16911
|
queryParams[Param.DataSources] = `["${dataSource}"]`;
|
|
16837
16912
|
}
|
|
16838
|
-
if (
|
|
16839
|
-
|
|
16913
|
+
if (searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.searchTokenString) {
|
|
16914
|
+
if (!excludeSearchTokenStringFromURL) {
|
|
16915
|
+
queryParams[Param.searchTokenString] = encodeURIComponent(searchOptions.searchTokenString);
|
|
16916
|
+
}
|
|
16840
16917
|
if (searchOptions.executeSearch) {
|
|
16841
16918
|
queryParams[Param.executeSearch] = true;
|
|
16842
16919
|
}
|
|
@@ -16953,8 +17030,10 @@ class SearchBarEmbed extends TsEmbed {
|
|
|
16953
17030
|
if (dataSource) {
|
|
16954
17031
|
queryParams[Param.DataSources] = `["${dataSource}"]`;
|
|
16955
17032
|
}
|
|
16956
|
-
if (
|
|
16957
|
-
|
|
17033
|
+
if (searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.searchTokenString) {
|
|
17034
|
+
if (!excludeSearchTokenStringFromURL) {
|
|
17035
|
+
queryParams[Param.searchTokenString] = encodeURIComponent(searchOptions.searchTokenString);
|
|
17036
|
+
}
|
|
16958
17037
|
if (searchOptions.executeSearch) {
|
|
16959
17038
|
queryParams[Param.executeSearch] = true;
|
|
16960
17039
|
}
|
|
@@ -17494,7 +17573,7 @@ class ConversationEmbed extends TsEmbed {
|
|
|
17494
17573
|
this.viewConfig = viewConfig;
|
|
17495
17574
|
}
|
|
17496
17575
|
getIframeSrc() {
|
|
17497
|
-
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, } = this.viewConfig;
|
|
17576
|
+
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, } = this.viewConfig;
|
|
17498
17577
|
const path = 'insights/conv-assist';
|
|
17499
17578
|
if (!worksheetId) {
|
|
17500
17579
|
this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
|
|
@@ -17507,6 +17586,15 @@ class ConversationEmbed extends TsEmbed {
|
|
|
17507
17586
|
if (!isUndefined_1(hideSourceSelection)) {
|
|
17508
17587
|
queryParams[Param.HideSourceSelection] = !!hideSourceSelection;
|
|
17509
17588
|
}
|
|
17589
|
+
if (!isUndefined_1(dataPanelV2)) {
|
|
17590
|
+
queryParams[Param.DataPanelV2Enabled] = !!dataPanelV2;
|
|
17591
|
+
}
|
|
17592
|
+
if (!isUndefined_1(showSpotterLimitations)) {
|
|
17593
|
+
queryParams[Param.ShowSpotterLimitations] = !!showSpotterLimitations;
|
|
17594
|
+
}
|
|
17595
|
+
if (!isUndefined_1(hideSampleQuestions)) {
|
|
17596
|
+
queryParams[Param.HideSampleQuestions] = !!hideSampleQuestions;
|
|
17597
|
+
}
|
|
17510
17598
|
let query = '';
|
|
17511
17599
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
17512
17600
|
if (queryParamsString) {
|