@thoughtspot/visual-embed-sdk 1.35.14 → 1.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/package.json +2 -3
- package/cjs/src/auth.d.ts +5 -0
- package/cjs/src/auth.d.ts.map +1 -1
- package/cjs/src/auth.js +7 -0
- package/cjs/src/auth.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 +27 -0
- 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 +73 -1
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/react/index.spec.js +2 -2
- package/cjs/src/react/index.spec.js.map +1 -1
- package/cjs/src/types.d.ts +13 -2
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +12 -2
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/authService/authService.d.ts +1 -0
- package/cjs/src/utils/authService/authService.d.ts.map +1 -1
- package/cjs/src/utils/authService/authService.js +1 -0
- package/cjs/src/utils/authService/authService.js.map +1 -1
- package/cjs/src/utils/authService/index.d.ts +1 -1
- package/cjs/src/utils/authService/index.d.ts.map +1 -1
- package/cjs/src/utils/authService/index.js +2 -1
- package/cjs/src/utils/authService/index.js.map +1 -1
- package/cjs/src/utils/authService/tokenizedAuthService.d.ts +10 -0
- package/cjs/src/utils/authService/tokenizedAuthService.d.ts.map +1 -1
- package/cjs/src/utils/authService/tokenizedAuthService.js +27 -1
- package/cjs/src/utils/authService/tokenizedAuthService.js.map +1 -1
- package/cjs/src/utils/authService/tokenizedAuthService.spec.js +58 -1
- package/cjs/src/utils/authService/tokenizedAuthService.spec.js.map +1 -1
- package/cjs/src/utils/sessionInfoService.d.ts +30 -0
- package/cjs/src/utils/sessionInfoService.d.ts.map +1 -1
- package/cjs/src/utils/sessionInfoService.js +59 -1
- package/cjs/src/utils/sessionInfoService.js.map +1 -1
- package/dist/{index-B3hd6DTM.js → index-V2oBuwy6.js} +1 -1
- package/dist/src/auth.d.ts +5 -0
- package/dist/src/auth.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/embed/ts-embed.spec.d.ts.map +1 -1
- package/dist/src/types.d.ts +13 -2
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/authService/authService.d.ts +1 -0
- package/dist/src/utils/authService/authService.d.ts.map +1 -1
- package/dist/src/utils/authService/index.d.ts +1 -1
- package/dist/src/utils/authService/index.d.ts.map +1 -1
- package/dist/src/utils/authService/tokenizedAuthService.d.ts +10 -0
- package/dist/src/utils/authService/tokenizedAuthService.d.ts.map +1 -1
- package/dist/src/utils/sessionInfoService.d.ts +30 -0
- package/dist/src/utils/sessionInfoService.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +129 -5
- package/dist/tsembed-react.js +128 -4
- package/dist/tsembed.es.js +130 -5
- package/dist/tsembed.js +129 -4
- package/dist/visual-embed-sdk-react-full.d.ts +48 -2
- package/dist/visual-embed-sdk-react.d.ts +48 -2
- package/dist/visual-embed-sdk.d.ts +48 -2
- package/lib/package.json +2 -3
- package/lib/src/auth.d.ts +5 -0
- package/lib/src/auth.d.ts.map +1 -1
- package/lib/src/auth.js +8 -1
- package/lib/src/auth.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 +27 -0
- 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 +73 -1
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/react/index.spec.js +2 -2
- package/lib/src/react/index.spec.js.map +1 -1
- package/lib/src/types.d.ts +13 -2
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +12 -2
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/authService/authService.d.ts +1 -0
- package/lib/src/utils/authService/authService.d.ts.map +1 -1
- package/lib/src/utils/authService/authService.js +1 -0
- package/lib/src/utils/authService/authService.js.map +1 -1
- package/lib/src/utils/authService/index.d.ts +1 -1
- package/lib/src/utils/authService/index.d.ts.map +1 -1
- package/lib/src/utils/authService/index.js +1 -1
- package/lib/src/utils/authService/index.js.map +1 -1
- package/lib/src/utils/authService/tokenizedAuthService.d.ts +10 -0
- package/lib/src/utils/authService/tokenizedAuthService.d.ts.map +1 -1
- package/lib/src/utils/authService/tokenizedAuthService.js +25 -0
- package/lib/src/utils/authService/tokenizedAuthService.js.map +1 -1
- package/lib/src/utils/authService/tokenizedAuthService.spec.js +59 -2
- package/lib/src/utils/authService/tokenizedAuthService.spec.js.map +1 -1
- package/lib/src/utils/sessionInfoService.d.ts +30 -0
- package/lib/src/utils/sessionInfoService.d.ts.map +1 -1
- package/lib/src/utils/sessionInfoService.js +57 -1
- package/lib/src/utils/sessionInfoService.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +48 -2
- package/package.json +2 -3
- package/src/auth.ts +8 -1
- package/src/embed/ts-embed.spec.ts +95 -1
- package/src/embed/ts-embed.ts +31 -0
- package/src/react/index.spec.tsx +2 -2
- package/src/types.ts +14 -2
- package/src/utils/authService/authService.ts +1 -0
- package/src/utils/authService/index.ts +5 -1
- package/src/utils/authService/tokenizedAuthService.spec.ts +66 -2
- package/src/utils/authService/tokenizedAuthService.ts +26 -0
- package/src/utils/sessionInfoService.ts +64 -1
- package/cjs/src/embed/searchEmbed-basic-auth.spec.d.ts +0 -2
- package/cjs/src/embed/searchEmbed-basic-auth.spec.d.ts.map +0 -1
- package/cjs/src/embed/searchEmbed-basic-auth.spec.js +0 -104
- package/cjs/src/embed/searchEmbed-basic-auth.spec.js.map +0 -1
- package/cjs/src/hostEventsTypeMapping.d.ts +0 -2
- package/cjs/src/hostEventsTypeMapping.d.ts.map +0 -1
- package/cjs/src/hostEventsTypeMapping.js +0 -4
- package/cjs/src/hostEventsTypeMapping.js.map +0 -1
- package/cjs/src/utils/embedApi/contracts.d.ts +0 -101
- package/cjs/src/utils/embedApi/contracts.d.ts.map +0 -1
- package/cjs/src/utils/embedApi/contracts.js +0 -17
- package/cjs/src/utils/embedApi/contracts.js.map +0 -1
- package/cjs/src/utils/embedApi/embedApiClient.d.ts +0 -12
- package/cjs/src/utils/embedApi/embedApiClient.d.ts.map +0 -1
- package/cjs/src/utils/embedApi/embedApiClient.js +0 -46
- package/cjs/src/utils/embedApi/embedApiClient.js.map +0 -1
- package/cjs/src/utils/embedApi/processEmbedApi.d.ts +0 -9
- package/cjs/src/utils/embedApi/processEmbedApi.d.ts.map +0 -1
- package/cjs/src/utils/embedApi/processEmbedApi.js +0 -18
- package/cjs/src/utils/embedApi/processEmbedApi.js.map +0 -1
- package/dist/index-BBBimG1x.js +0 -7370
- package/dist/index-BGnxP5NY.js +0 -7370
- package/dist/index-CENLvayL.js +0 -7370
- package/dist/index-CbltIawo.js +0 -7370
- package/dist/index-CoQfqaHj.js +0 -7370
- package/dist/index-CzwzS0P4.js +0 -7370
- package/dist/index-D-9WUCUl.js +0 -7370
- package/dist/index-DFwi_pV_.js +0 -7370
- package/dist/index-DOIjN0N_.js +0 -7370
- package/dist/index-DYBx8SuE.js +0 -7370
- package/dist/index-DaLHJaLd.js +0 -7370
- package/dist/index-DnJX-gN2.js +0 -7370
- package/dist/index-IDmSUe93.js +0 -7370
- package/dist/index-nWevLycs.js +0 -7370
- package/dist/index-vxW97_xb.js +0 -7370
- package/dist/src/embed/searchEmbed-basic-auth.spec.d.ts +0 -2
- package/dist/src/embed/searchEmbed-basic-auth.spec.d.ts.map +0 -1
- package/dist/src/hostEventsTypeMapping.d.ts +0 -2
- package/dist/src/hostEventsTypeMapping.d.ts.map +0 -1
- package/dist/src/utils/embedApi/contracts.d.ts +0 -101
- package/dist/src/utils/embedApi/contracts.d.ts.map +0 -1
- package/dist/src/utils/embedApi/embedApiClient.d.ts +0 -12
- package/dist/src/utils/embedApi/embedApiClient.d.ts.map +0 -1
- package/dist/src/utils/embedApi/processEmbedApi.d.ts +0 -9
- package/dist/src/utils/embedApi/processEmbedApi.d.ts.map +0 -1
- package/lib/src/embed/searchEmbed-basic-auth.spec.d.ts +0 -2
- package/lib/src/embed/searchEmbed-basic-auth.spec.d.ts.map +0 -1
- package/lib/src/embed/searchEmbed-basic-auth.spec.js +0 -101
- package/lib/src/embed/searchEmbed-basic-auth.spec.js.map +0 -1
- package/lib/src/hostEventsTypeMapping.d.ts +0 -2
- package/lib/src/hostEventsTypeMapping.d.ts.map +0 -1
- package/lib/src/hostEventsTypeMapping.js +0 -2
- package/lib/src/hostEventsTypeMapping.js.map +0 -1
- package/lib/src/utils/embedApi/contracts.d.ts +0 -101
- package/lib/src/utils/embedApi/contracts.d.ts.map +0 -1
- package/lib/src/utils/embedApi/contracts.js +0 -14
- package/lib/src/utils/embedApi/contracts.js.map +0 -1
- package/lib/src/utils/embedApi/embedApiClient.d.ts +0 -12
- package/lib/src/utils/embedApi/embedApiClient.d.ts.map +0 -1
- package/lib/src/utils/embedApi/embedApiClient.js +0 -42
- package/lib/src/utils/embedApi/embedApiClient.js.map +0 -1
- package/lib/src/utils/embedApi/processEmbedApi.d.ts +0 -9
- package/lib/src/utils/embedApi/processEmbedApi.d.ts.map +0 -1
- package/lib/src/utils/embedApi/processEmbedApi.js +0 -14
- package/lib/src/utils/embedApi/processEmbedApi.js.map +0 -1
package/dist/tsembed-react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.36.0 */
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) :
|
|
@@ -2735,8 +2735,17 @@
|
|
|
2735
2735
|
*/
|
|
2736
2736
|
HostEvent["UpdatePersonalisedView"] = "UpdatePersonalisedView";
|
|
2737
2737
|
/**
|
|
2738
|
-
*
|
|
2739
|
-
*
|
|
2738
|
+
* @hidden
|
|
2739
|
+
* Notify when info call is completed successfully
|
|
2740
|
+
* ```js
|
|
2741
|
+
* liveboardEmbed.trigger(HostEvent.InfoSuccess, data);
|
|
2742
|
+
*```
|
|
2743
|
+
* @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
|
|
2744
|
+
*/
|
|
2745
|
+
HostEvent["InfoSuccess"] = "InfoSuccess";
|
|
2746
|
+
/**
|
|
2747
|
+
* Triggers the action to get the current view of the liveboard
|
|
2748
|
+
* @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
|
|
2740
2749
|
*/
|
|
2741
2750
|
HostEvent["SaveAnswer"] = "saveAnswer";
|
|
2742
2751
|
/**
|
|
@@ -2893,6 +2902,7 @@
|
|
|
2893
2902
|
Param["OauthPollingInterval"] = "oAuthPollingInterval";
|
|
2894
2903
|
Param["IsForceRedirect"] = "isForceRedirect";
|
|
2895
2904
|
Param["DataSourceId"] = "dataSourceId";
|
|
2905
|
+
Param["preAuthCache"] = "preAuthCache";
|
|
2896
2906
|
Param["ShowSpotterLimitations"] = "showSpotterLimitations";
|
|
2897
2907
|
})(Param || (Param = {}));
|
|
2898
2908
|
/**
|
|
@@ -6549,6 +6559,7 @@
|
|
|
6549
6559
|
const EndPoints = {
|
|
6550
6560
|
AUTH_VERIFICATION: '/callosum/v1/session/info',
|
|
6551
6561
|
SESSION_INFO: '/callosum/v1/session/info',
|
|
6562
|
+
PREAUTH_INFO: '/prism/preauth/info',
|
|
6552
6563
|
SAML_LOGIN_TEMPLATE: (targetUrl) => `/callosum/v1/saml/login?targetURLPath=${targetUrl}`,
|
|
6553
6564
|
OIDC_LOGIN_TEMPLATE: (targetUrl) => `/callosum/v1/oidc/login?targetURLPath=${targetUrl}`,
|
|
6554
6565
|
TOKEN_LOGIN: '/callosum/v1/session/login/token',
|
|
@@ -14090,6 +14101,31 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
14090
14101
|
return r;
|
|
14091
14102
|
});
|
|
14092
14103
|
}
|
|
14104
|
+
/**
|
|
14105
|
+
* Fetches the session info from the ThoughtSpot server.
|
|
14106
|
+
* @param thoughtspotHost
|
|
14107
|
+
* @returns {Promise<any>}
|
|
14108
|
+
* @example
|
|
14109
|
+
* ```js
|
|
14110
|
+
* const response = await sessionInfoService();
|
|
14111
|
+
* ```
|
|
14112
|
+
*/
|
|
14113
|
+
async function fetchPreauthInfoService(thoughtspotHost) {
|
|
14114
|
+
const sessionInfoPath = `${thoughtspotHost}${EndPoints.PREAUTH_INFO}`;
|
|
14115
|
+
const handleError = (e) => {
|
|
14116
|
+
const error = new Error(`Failed to fetch auth info: ${e.message || e.statusText}`);
|
|
14117
|
+
error.status = e.status; // Attach the status code to the error object
|
|
14118
|
+
throw error;
|
|
14119
|
+
};
|
|
14120
|
+
try {
|
|
14121
|
+
const response = await tokenizedFailureLoggedFetch(sessionInfoPath);
|
|
14122
|
+
return response;
|
|
14123
|
+
}
|
|
14124
|
+
catch (e) {
|
|
14125
|
+
handleError(e);
|
|
14126
|
+
return null;
|
|
14127
|
+
}
|
|
14128
|
+
}
|
|
14093
14129
|
/**
|
|
14094
14130
|
* Fetches the session info from the ThoughtSpot server.
|
|
14095
14131
|
* @param thoughtspotHost
|
|
@@ -14128,6 +14164,62 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
14128
14164
|
}
|
|
14129
14165
|
|
|
14130
14166
|
let sessionInfo = null;
|
|
14167
|
+
let preauthInfo = null;
|
|
14168
|
+
/**
|
|
14169
|
+
* Processes the session info response and returns the session info object.
|
|
14170
|
+
* @param preauthInfoResp {any} Response from the session info API.
|
|
14171
|
+
* @returns {PreauthInfo} The session info object.
|
|
14172
|
+
* @example ```js
|
|
14173
|
+
* const preauthInfoResp = await fetch(sessionInfoPath);
|
|
14174
|
+
* const sessionInfo = await formatPreauthInfo(preauthInfoResp);
|
|
14175
|
+
* console.log(sessionInfo);
|
|
14176
|
+
* ```
|
|
14177
|
+
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
14178
|
+
*/
|
|
14179
|
+
const formatPreauthInfo = async (preauthInfoResp) => {
|
|
14180
|
+
var _a;
|
|
14181
|
+
try {
|
|
14182
|
+
// Convert Headers to a plain object
|
|
14183
|
+
const headers = {};
|
|
14184
|
+
(_a = preauthInfoResp === null || preauthInfoResp === void 0 ? void 0 : preauthInfoResp.headers) === null || _a === void 0 ? void 0 : _a.forEach((value, key) => {
|
|
14185
|
+
headers[key] = value;
|
|
14186
|
+
});
|
|
14187
|
+
const data = await preauthInfoResp.json();
|
|
14188
|
+
return {
|
|
14189
|
+
...data,
|
|
14190
|
+
status: 200,
|
|
14191
|
+
headers,
|
|
14192
|
+
};
|
|
14193
|
+
}
|
|
14194
|
+
catch (error) {
|
|
14195
|
+
return null;
|
|
14196
|
+
}
|
|
14197
|
+
};
|
|
14198
|
+
/**
|
|
14199
|
+
* Returns the session info object and caches it for future use.
|
|
14200
|
+
* Once fetched the session info object is cached and returned from the cache on
|
|
14201
|
+
* subsequent calls.
|
|
14202
|
+
* @example ```js
|
|
14203
|
+
* const preauthInfo = await getPreauthInfo();
|
|
14204
|
+
* console.log(preauthInfo);
|
|
14205
|
+
* ```
|
|
14206
|
+
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
14207
|
+
* @returns {Promise<SessionInfo>} The session info object.
|
|
14208
|
+
*/
|
|
14209
|
+
async function getPreauthInfo(allowCache = true) {
|
|
14210
|
+
if (!allowCache || !preauthInfo) {
|
|
14211
|
+
try {
|
|
14212
|
+
const host = getEmbedConfig().thoughtSpotHost;
|
|
14213
|
+
const sessionResponse = await fetchPreauthInfoService(host);
|
|
14214
|
+
const processedPreauthInfo = await formatPreauthInfo(sessionResponse);
|
|
14215
|
+
preauthInfo = processedPreauthInfo;
|
|
14216
|
+
}
|
|
14217
|
+
catch (error) {
|
|
14218
|
+
return null;
|
|
14219
|
+
}
|
|
14220
|
+
}
|
|
14221
|
+
return preauthInfo;
|
|
14222
|
+
}
|
|
14131
14223
|
/**
|
|
14132
14224
|
* Returns the session info object and caches it for future use.
|
|
14133
14225
|
* Once fetched the session info object is cached and returned from the cache on
|
|
@@ -14211,6 +14303,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
14211
14303
|
* Emits when the SDK authenticates successfully
|
|
14212
14304
|
*/
|
|
14213
14305
|
AuthStatus["SDK_SUCCESS"] = "SDK_SUCCESS";
|
|
14306
|
+
/**
|
|
14307
|
+
* @hidden
|
|
14308
|
+
* Emits when iframe is loaded and session info is available
|
|
14309
|
+
*/
|
|
14310
|
+
AuthStatus["SESSION_INFO_SUCCESS"] = "SESSION_INFO_SUCCESS";
|
|
14214
14311
|
/**
|
|
14215
14312
|
* Emits when the app sends an authentication success message
|
|
14216
14313
|
*/
|
|
@@ -14302,6 +14399,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
14302
14399
|
*/
|
|
14303
14400
|
async function postLoginService() {
|
|
14304
14401
|
try {
|
|
14402
|
+
getPreauthInfo();
|
|
14305
14403
|
const sessionInfo = await getSessionInfo();
|
|
14306
14404
|
releaseVersion = sessionInfo.releaseVersion;
|
|
14307
14405
|
const embedConfig = getEmbedConfig();
|
|
@@ -14702,7 +14800,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
14702
14800
|
return e;
|
|
14703
14801
|
}
|
|
14704
14802
|
|
|
14705
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.
|
|
14803
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.36.0";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"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",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":"6.3.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$1,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};
|
|
14706
14804
|
|
|
14707
14805
|
/**
|
|
14708
14806
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -15065,6 +15163,21 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15065
15163
|
}
|
|
15066
15164
|
return null;
|
|
15067
15165
|
}
|
|
15166
|
+
/**
|
|
15167
|
+
* Checks if preauth cache is enabled
|
|
15168
|
+
* from the view config and embed config
|
|
15169
|
+
* @returns boolean
|
|
15170
|
+
*/
|
|
15171
|
+
isPreAuthCacheEnabled() {
|
|
15172
|
+
// Disable preauth cache when:
|
|
15173
|
+
// 1. overrideOrgId is present since:
|
|
15174
|
+
// - cached auth info would be for wrong org
|
|
15175
|
+
// - info call response changes for each different overrideOrgId
|
|
15176
|
+
// 2. disablePreauthCache is explicitly set to true
|
|
15177
|
+
const isDisabled = (this.viewConfig.overrideOrgId !== undefined
|
|
15178
|
+
|| this.embedConfig.disablePreauthCache === true);
|
|
15179
|
+
return !isDisabled;
|
|
15180
|
+
}
|
|
15068
15181
|
/**
|
|
15069
15182
|
* fix for ts7.sep.cl
|
|
15070
15183
|
* will be removed for ts7.oct.cl
|
|
@@ -15283,6 +15396,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15283
15396
|
if (overrideOrgId !== undefined) {
|
|
15284
15397
|
queryParams[Param.OverrideOrgId] = overrideOrgId;
|
|
15285
15398
|
}
|
|
15399
|
+
if (this.isPreAuthCacheEnabled()) {
|
|
15400
|
+
queryParams[Param.preAuthCache] = true;
|
|
15401
|
+
}
|
|
15286
15402
|
queryParams[Param.OverrideNativeConsole] = true;
|
|
15287
15403
|
queryParams[Param.ClientLogLevel] = this.embedConfig.logLevel;
|
|
15288
15404
|
if (isObject_1(additionalFlags) && !isEmpty_1(additionalFlags)) {
|
|
@@ -15401,6 +15517,14 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15401
15517
|
elHeight: this.iFrame.clientHeight,
|
|
15402
15518
|
timeTookToLoad: loadTimestamp - initTimestamp,
|
|
15403
15519
|
});
|
|
15520
|
+
// Send info event if preauth cache is enabled
|
|
15521
|
+
if (this.isPreAuthCacheEnabled()) {
|
|
15522
|
+
getPreauthInfo().then((data) => {
|
|
15523
|
+
if (data === null || data === void 0 ? void 0 : data.info) {
|
|
15524
|
+
this.trigger(exports.HostEvent.InfoSuccess, data);
|
|
15525
|
+
}
|
|
15526
|
+
});
|
|
15527
|
+
}
|
|
15404
15528
|
});
|
|
15405
15529
|
this.iFrame.addEventListener('error', () => {
|
|
15406
15530
|
nextInQueue();
|
package/dist/tsembed.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.36.0 */
|
|
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) {
|
|
@@ -2598,8 +2598,17 @@ var HostEvent;
|
|
|
2598
2598
|
*/
|
|
2599
2599
|
HostEvent["UpdatePersonalisedView"] = "UpdatePersonalisedView";
|
|
2600
2600
|
/**
|
|
2601
|
-
*
|
|
2602
|
-
*
|
|
2601
|
+
* @hidden
|
|
2602
|
+
* Notify when info call is completed successfully
|
|
2603
|
+
* ```js
|
|
2604
|
+
* liveboardEmbed.trigger(HostEvent.InfoSuccess, data);
|
|
2605
|
+
*```
|
|
2606
|
+
* @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
|
|
2607
|
+
*/
|
|
2608
|
+
HostEvent["InfoSuccess"] = "InfoSuccess";
|
|
2609
|
+
/**
|
|
2610
|
+
* Triggers the action to get the current view of the liveboard
|
|
2611
|
+
* @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
|
|
2603
2612
|
*/
|
|
2604
2613
|
HostEvent["SaveAnswer"] = "saveAnswer";
|
|
2605
2614
|
/**
|
|
@@ -2756,6 +2765,7 @@ var Param;
|
|
|
2756
2765
|
Param["OauthPollingInterval"] = "oAuthPollingInterval";
|
|
2757
2766
|
Param["IsForceRedirect"] = "isForceRedirect";
|
|
2758
2767
|
Param["DataSourceId"] = "dataSourceId";
|
|
2768
|
+
Param["preAuthCache"] = "preAuthCache";
|
|
2759
2769
|
Param["ShowSpotterLimitations"] = "showSpotterLimitations";
|
|
2760
2770
|
})(Param || (Param = {}));
|
|
2761
2771
|
/**
|
|
@@ -6415,6 +6425,7 @@ const ERROR_MESSAGE = {
|
|
|
6415
6425
|
const EndPoints = {
|
|
6416
6426
|
AUTH_VERIFICATION: '/callosum/v1/session/info',
|
|
6417
6427
|
SESSION_INFO: '/callosum/v1/session/info',
|
|
6428
|
+
PREAUTH_INFO: '/prism/preauth/info',
|
|
6418
6429
|
SAML_LOGIN_TEMPLATE: (targetUrl) => `/callosum/v1/saml/login?targetURLPath=${targetUrl}`,
|
|
6419
6430
|
OIDC_LOGIN_TEMPLATE: (targetUrl) => `/callosum/v1/oidc/login?targetURLPath=${targetUrl}`,
|
|
6420
6431
|
TOKEN_LOGIN: '/callosum/v1/session/login/token',
|
|
@@ -7227,7 +7238,7 @@ class AnswerService {
|
|
|
7227
7238
|
async getTML() {
|
|
7228
7239
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
7229
7240
|
const edoc = object[0].edoc;
|
|
7230
|
-
const YAML = await import('./index-
|
|
7241
|
+
const YAML = await import('./index-V2oBuwy6.js');
|
|
7231
7242
|
const parsedDoc = YAML.parse(edoc);
|
|
7232
7243
|
return {
|
|
7233
7244
|
answer: {
|
|
@@ -14012,6 +14023,31 @@ function tokenizedFailureLoggedFetch(url, options = {}) {
|
|
|
14012
14023
|
return r;
|
|
14013
14024
|
});
|
|
14014
14025
|
}
|
|
14026
|
+
/**
|
|
14027
|
+
* Fetches the session info from the ThoughtSpot server.
|
|
14028
|
+
* @param thoughtspotHost
|
|
14029
|
+
* @returns {Promise<any>}
|
|
14030
|
+
* @example
|
|
14031
|
+
* ```js
|
|
14032
|
+
* const response = await sessionInfoService();
|
|
14033
|
+
* ```
|
|
14034
|
+
*/
|
|
14035
|
+
async function fetchPreauthInfoService(thoughtspotHost) {
|
|
14036
|
+
const sessionInfoPath = `${thoughtspotHost}${EndPoints.PREAUTH_INFO}`;
|
|
14037
|
+
const handleError = (e) => {
|
|
14038
|
+
const error = new Error(`Failed to fetch auth info: ${e.message || e.statusText}`);
|
|
14039
|
+
error.status = e.status; // Attach the status code to the error object
|
|
14040
|
+
throw error;
|
|
14041
|
+
};
|
|
14042
|
+
try {
|
|
14043
|
+
const response = await tokenizedFailureLoggedFetch(sessionInfoPath);
|
|
14044
|
+
return response;
|
|
14045
|
+
}
|
|
14046
|
+
catch (e) {
|
|
14047
|
+
handleError(e);
|
|
14048
|
+
return null;
|
|
14049
|
+
}
|
|
14050
|
+
}
|
|
14015
14051
|
/**
|
|
14016
14052
|
* Fetches the session info from the ThoughtSpot server.
|
|
14017
14053
|
* @param thoughtspotHost
|
|
@@ -14063,6 +14099,62 @@ async function isActiveService(thoughtSpotHost) {
|
|
|
14063
14099
|
}
|
|
14064
14100
|
|
|
14065
14101
|
let sessionInfo = null;
|
|
14102
|
+
let preauthInfo = null;
|
|
14103
|
+
/**
|
|
14104
|
+
* Processes the session info response and returns the session info object.
|
|
14105
|
+
* @param preauthInfoResp {any} Response from the session info API.
|
|
14106
|
+
* @returns {PreauthInfo} The session info object.
|
|
14107
|
+
* @example ```js
|
|
14108
|
+
* const preauthInfoResp = await fetch(sessionInfoPath);
|
|
14109
|
+
* const sessionInfo = await formatPreauthInfo(preauthInfoResp);
|
|
14110
|
+
* console.log(sessionInfo);
|
|
14111
|
+
* ```
|
|
14112
|
+
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
14113
|
+
*/
|
|
14114
|
+
const formatPreauthInfo = async (preauthInfoResp) => {
|
|
14115
|
+
var _a;
|
|
14116
|
+
try {
|
|
14117
|
+
// Convert Headers to a plain object
|
|
14118
|
+
const headers = {};
|
|
14119
|
+
(_a = preauthInfoResp === null || preauthInfoResp === void 0 ? void 0 : preauthInfoResp.headers) === null || _a === void 0 ? void 0 : _a.forEach((value, key) => {
|
|
14120
|
+
headers[key] = value;
|
|
14121
|
+
});
|
|
14122
|
+
const data = await preauthInfoResp.json();
|
|
14123
|
+
return {
|
|
14124
|
+
...data,
|
|
14125
|
+
status: 200,
|
|
14126
|
+
headers,
|
|
14127
|
+
};
|
|
14128
|
+
}
|
|
14129
|
+
catch (error) {
|
|
14130
|
+
return null;
|
|
14131
|
+
}
|
|
14132
|
+
};
|
|
14133
|
+
/**
|
|
14134
|
+
* Returns the session info object and caches it for future use.
|
|
14135
|
+
* Once fetched the session info object is cached and returned from the cache on
|
|
14136
|
+
* subsequent calls.
|
|
14137
|
+
* @example ```js
|
|
14138
|
+
* const preauthInfo = await getPreauthInfo();
|
|
14139
|
+
* console.log(preauthInfo);
|
|
14140
|
+
* ```
|
|
14141
|
+
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
14142
|
+
* @returns {Promise<SessionInfo>} The session info object.
|
|
14143
|
+
*/
|
|
14144
|
+
async function getPreauthInfo(allowCache = true) {
|
|
14145
|
+
if (!allowCache || !preauthInfo) {
|
|
14146
|
+
try {
|
|
14147
|
+
const host = getEmbedConfig().thoughtSpotHost;
|
|
14148
|
+
const sessionResponse = await fetchPreauthInfoService(host);
|
|
14149
|
+
const processedPreauthInfo = await formatPreauthInfo(sessionResponse);
|
|
14150
|
+
preauthInfo = processedPreauthInfo;
|
|
14151
|
+
}
|
|
14152
|
+
catch (error) {
|
|
14153
|
+
return null;
|
|
14154
|
+
}
|
|
14155
|
+
}
|
|
14156
|
+
return preauthInfo;
|
|
14157
|
+
}
|
|
14066
14158
|
/**
|
|
14067
14159
|
* Returns the session info object and caches it for future use.
|
|
14068
14160
|
* Once fetched the session info object is cached and returned from the cache on
|
|
@@ -14146,6 +14238,11 @@ var AuthStatus;
|
|
|
14146
14238
|
* Emits when the SDK authenticates successfully
|
|
14147
14239
|
*/
|
|
14148
14240
|
AuthStatus["SDK_SUCCESS"] = "SDK_SUCCESS";
|
|
14241
|
+
/**
|
|
14242
|
+
* @hidden
|
|
14243
|
+
* Emits when iframe is loaded and session info is available
|
|
14244
|
+
*/
|
|
14245
|
+
AuthStatus["SESSION_INFO_SUCCESS"] = "SESSION_INFO_SUCCESS";
|
|
14149
14246
|
/**
|
|
14150
14247
|
* Emits when the app sends an authentication success message
|
|
14151
14248
|
*/
|
|
@@ -14201,6 +14298,7 @@ async function notifyAuthSuccess() {
|
|
|
14201
14298
|
return;
|
|
14202
14299
|
}
|
|
14203
14300
|
try {
|
|
14301
|
+
getPreauthInfo();
|
|
14204
14302
|
const sessionInfo = await getSessionInfo();
|
|
14205
14303
|
authEE.emit(AuthStatus.SUCCESS, sessionInfo);
|
|
14206
14304
|
}
|
|
@@ -14255,6 +14353,7 @@ async function isLoggedIn(thoughtSpotHost) {
|
|
|
14255
14353
|
*/
|
|
14256
14354
|
async function postLoginService() {
|
|
14257
14355
|
try {
|
|
14356
|
+
getPreauthInfo();
|
|
14258
14357
|
const sessionInfo = await getSessionInfo();
|
|
14259
14358
|
releaseVersion = sessionInfo.releaseVersion;
|
|
14260
14359
|
const embedConfig = getEmbedConfig();
|
|
@@ -14922,7 +15021,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
|
|
|
14922
15021
|
return e;
|
|
14923
15022
|
}
|
|
14924
15023
|
|
|
14925
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.
|
|
15024
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.36.0";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./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",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":"6.3.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};
|
|
14926
15025
|
|
|
14927
15026
|
/**
|
|
14928
15027
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -15285,6 +15384,21 @@ class TsEmbed {
|
|
|
15285
15384
|
}
|
|
15286
15385
|
return null;
|
|
15287
15386
|
}
|
|
15387
|
+
/**
|
|
15388
|
+
* Checks if preauth cache is enabled
|
|
15389
|
+
* from the view config and embed config
|
|
15390
|
+
* @returns boolean
|
|
15391
|
+
*/
|
|
15392
|
+
isPreAuthCacheEnabled() {
|
|
15393
|
+
// Disable preauth cache when:
|
|
15394
|
+
// 1. overrideOrgId is present since:
|
|
15395
|
+
// - cached auth info would be for wrong org
|
|
15396
|
+
// - info call response changes for each different overrideOrgId
|
|
15397
|
+
// 2. disablePreauthCache is explicitly set to true
|
|
15398
|
+
const isDisabled = (this.viewConfig.overrideOrgId !== undefined
|
|
15399
|
+
|| this.embedConfig.disablePreauthCache === true);
|
|
15400
|
+
return !isDisabled;
|
|
15401
|
+
}
|
|
15288
15402
|
/**
|
|
15289
15403
|
* fix for ts7.sep.cl
|
|
15290
15404
|
* will be removed for ts7.oct.cl
|
|
@@ -15503,6 +15617,9 @@ class TsEmbed {
|
|
|
15503
15617
|
if (overrideOrgId !== undefined) {
|
|
15504
15618
|
queryParams[Param.OverrideOrgId] = overrideOrgId;
|
|
15505
15619
|
}
|
|
15620
|
+
if (this.isPreAuthCacheEnabled()) {
|
|
15621
|
+
queryParams[Param.preAuthCache] = true;
|
|
15622
|
+
}
|
|
15506
15623
|
queryParams[Param.OverrideNativeConsole] = true;
|
|
15507
15624
|
queryParams[Param.ClientLogLevel] = this.embedConfig.logLevel;
|
|
15508
15625
|
if (isObject_1(additionalFlags) && !isEmpty_1(additionalFlags)) {
|
|
@@ -15621,6 +15738,14 @@ class TsEmbed {
|
|
|
15621
15738
|
elHeight: this.iFrame.clientHeight,
|
|
15622
15739
|
timeTookToLoad: loadTimestamp - initTimestamp,
|
|
15623
15740
|
});
|
|
15741
|
+
// Send info event if preauth cache is enabled
|
|
15742
|
+
if (this.isPreAuthCacheEnabled()) {
|
|
15743
|
+
getPreauthInfo().then((data) => {
|
|
15744
|
+
if (data === null || data === void 0 ? void 0 : data.info) {
|
|
15745
|
+
this.trigger(HostEvent.InfoSuccess, data);
|
|
15746
|
+
}
|
|
15747
|
+
});
|
|
15748
|
+
}
|
|
15624
15749
|
});
|
|
15625
15750
|
this.iFrame.addEventListener('error', () => {
|
|
15626
15751
|
nextInQueue();
|