@thoughtspot/visual-embed-sdk 1.33.2 → 1.33.3
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/README.md +1 -1
- package/cjs/package.json +1 -1
- package/cjs/src/auth.d.ts.map +1 -1
- package/cjs/src/auth.js +5 -2
- package/cjs/src/auth.js.map +1 -1
- package/cjs/src/auth.spec.js +15 -3
- package/cjs/src/auth.spec.js.map +1 -1
- package/cjs/src/css-variables.d.ts +2 -2
- package/cjs/src/embed/liveboard.d.ts +0 -3
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +0 -1
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/tokenizedFetch.d.ts +0 -1
- package/cjs/src/tokenizedFetch.d.ts.map +1 -1
- package/cjs/src/tokenizedFetch.js +0 -1
- package/cjs/src/tokenizedFetch.js.map +1 -1
- package/cjs/src/types.d.ts +7 -4
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +7 -4
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/processData.d.ts.map +1 -1
- package/cjs/src/utils/processData.js +0 -1
- package/cjs/src/utils/processData.js.map +1 -1
- package/cjs/src/utils/sessionInfoService.d.ts +0 -4
- package/cjs/src/utils/sessionInfoService.d.ts.map +1 -1
- package/cjs/src/utils/sessionInfoService.js +0 -4
- package/cjs/src/utils/sessionInfoService.js.map +1 -1
- package/cjs/src/utils.d.ts +1 -0
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +13 -3
- package/cjs/src/utils.js.map +1 -1
- package/cjs/src/utils.spec.js +6 -6
- package/cjs/src/utils.spec.js.map +1 -1
- package/dist/{index-CqrIh3Vj.js → index-Ck3m4Sis.js} +1 -1
- package/dist/src/auth.d.ts.map +1 -1
- package/dist/src/css-variables.d.ts +2 -2
- package/dist/src/embed/liveboard.d.ts +0 -3
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/tokenizedFetch.d.ts +0 -1
- package/dist/src/tokenizedFetch.d.ts.map +1 -1
- package/dist/src/types.d.ts +7 -4
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/processData.d.ts.map +1 -1
- package/dist/src/utils/sessionInfoService.d.ts +0 -4
- package/dist/src/utils/sessionInfoService.d.ts.map +1 -1
- package/dist/src/utils.d.ts +1 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +26 -16
- package/dist/tsembed-react.js +25 -15
- package/dist/tsembed.es.js +26 -16
- package/dist/tsembed.js +25 -15
- package/dist/visual-embed-sdk-react-full.d.ts +9 -14
- package/dist/visual-embed-sdk-react.d.ts +9 -14
- package/dist/visual-embed-sdk.d.ts +9 -14
- package/lib/package.json +1 -1
- package/lib/src/auth.d.ts.map +1 -1
- package/lib/src/auth.js +6 -3
- package/lib/src/auth.js.map +1 -1
- package/lib/src/auth.spec.js +15 -3
- package/lib/src/auth.spec.js.map +1 -1
- package/lib/src/css-variables.d.ts +2 -2
- package/lib/src/embed/liveboard.d.ts +0 -3
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +0 -1
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/tokenizedFetch.d.ts +0 -1
- package/lib/src/tokenizedFetch.d.ts.map +1 -1
- package/lib/src/tokenizedFetch.js +0 -1
- package/lib/src/tokenizedFetch.js.map +1 -1
- package/lib/src/types.d.ts +7 -4
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +7 -4
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/processData.d.ts.map +1 -1
- package/lib/src/utils/processData.js +0 -1
- package/lib/src/utils/processData.js.map +1 -1
- package/lib/src/utils/sessionInfoService.d.ts +0 -4
- package/lib/src/utils/sessionInfoService.d.ts.map +1 -1
- package/lib/src/utils/sessionInfoService.js +0 -4
- package/lib/src/utils/sessionInfoService.js.map +1 -1
- package/lib/src/utils.d.ts +1 -0
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +11 -2
- package/lib/src/utils.js.map +1 -1
- package/lib/src/utils.spec.js +6 -6
- package/lib/src/utils.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +9 -14
- package/package.json +1 -1
- package/src/auth.spec.ts +15 -3
- package/src/auth.ts +7 -3
- package/src/css-variables.ts +2 -2
- package/src/embed/liveboard.ts +0 -3
- package/src/tokenizedFetch.ts +0 -1
- package/src/types.ts +7 -4
- package/src/utils/processData.ts +0 -1
- package/src/utils/sessionInfoService.ts +0 -4
- package/src/utils.spec.ts +6 -6
- package/src/utils.ts +14 -2
package/dist/tsembed.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.33.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.33.3 */
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
@@ -173,6 +173,10 @@
|
|
|
173
173
|
}
|
|
174
174
|
return value;
|
|
175
175
|
};
|
|
176
|
+
const getSSOMarker = (markerId) => {
|
|
177
|
+
const encStringToAppend = encodeURIComponent(markerId);
|
|
178
|
+
return `tsSSOMarker=${encStringToAppend}`;
|
|
179
|
+
};
|
|
176
180
|
/**
|
|
177
181
|
* Append a string to a URL's hash fragment
|
|
178
182
|
* @param url A URL
|
|
@@ -181,12 +185,17 @@
|
|
|
181
185
|
const appendToUrlHash = (url, stringToAppend) => {
|
|
182
186
|
let outputUrl = url;
|
|
183
187
|
const encStringToAppend = encodeURIComponent(stringToAppend);
|
|
188
|
+
const marker = `tsSSOMarker=${encStringToAppend}`;
|
|
189
|
+
let splitAdder = '';
|
|
184
190
|
if (url.indexOf('#') >= 0) {
|
|
185
|
-
|
|
191
|
+
// If second half of hash contains a '?' already add a '&' instead of
|
|
192
|
+
// '?' which appends to query params.
|
|
193
|
+
splitAdder = url.split('#')[1].indexOf('?') >= 0 ? '&' : '?';
|
|
186
194
|
}
|
|
187
195
|
else {
|
|
188
|
-
|
|
196
|
+
splitAdder = '#?';
|
|
189
197
|
}
|
|
198
|
+
outputUrl = `${outputUrl}${splitAdder}${marker}`;
|
|
190
199
|
return outputUrl;
|
|
191
200
|
};
|
|
192
201
|
/**
|
|
@@ -2347,8 +2356,11 @@
|
|
|
2347
2356
|
* see link:https://developers.thoughtspot.com/docs/runtime-filters#rtOperator[Developer Documentation].
|
|
2348
2357
|
*
|
|
2349
2358
|
* `values` - An array of one or several values. The value definition on the
|
|
2350
|
-
* data type you choose to filter on. For a complete list of supported data types,
|
|
2351
|
-
*
|
|
2359
|
+
* data type you choose to filter on. For a complete list of supported data types, see
|
|
2360
|
+
* link:https://developers.thoughtspot.com/docs/runtime-filters#_supported_data_types[Supported data types]
|
|
2361
|
+
* `type` - To update filters for date time, specify the date format type.
|
|
2362
|
+
* For more information and examples, see link:https://developers.thoughtspot.com/docs/embed-liveboard#_date_filters[Date filters].
|
|
2363
|
+
*
|
|
2352
2364
|
* @example
|
|
2353
2365
|
* ```js
|
|
2354
2366
|
*
|
|
@@ -2478,7 +2490,7 @@
|
|
|
2478
2490
|
*/
|
|
2479
2491
|
HostEvent["AskSage"] = "AskSage";
|
|
2480
2492
|
/**
|
|
2481
|
-
* Trigger
|
|
2493
|
+
* Trigger cross filter update action on a Liveboard
|
|
2482
2494
|
* @example
|
|
2483
2495
|
* ```js
|
|
2484
2496
|
* liveboardEmbed.trigger(HostEvent.UpdateCrossFilter, {
|
|
@@ -2493,7 +2505,7 @@
|
|
|
2493
2505
|
*/
|
|
2494
2506
|
HostEvent["UpdateCrossFilter"] = "UpdateCrossFilter";
|
|
2495
2507
|
/**
|
|
2496
|
-
* Trigger
|
|
2508
|
+
* Trigger reset action for a personalized Liveboard view.
|
|
2497
2509
|
* @example
|
|
2498
2510
|
* ```js
|
|
2499
2511
|
* liveboardEmbed.trigger(HostEvent.ResetLiveboardPersonalisedView);
|
|
@@ -6272,7 +6284,6 @@
|
|
|
6272
6284
|
* Fetch wrapper that adds the authentication token to the request.
|
|
6273
6285
|
* Use this to call the ThoughtSpot APIs when using the visual embed sdk.
|
|
6274
6286
|
* The interface for this method is the same as Web `Fetch`.
|
|
6275
|
-
*
|
|
6276
6287
|
* @param input
|
|
6277
6288
|
* @param init
|
|
6278
6289
|
* @example
|
|
@@ -13714,7 +13725,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
13714
13725
|
* Returns the session info object and caches it for future use.
|
|
13715
13726
|
* Once fetched the session info object is cached and returned from the cache on
|
|
13716
13727
|
* subsequent calls.
|
|
13717
|
-
*
|
|
13718
13728
|
* @example ```js
|
|
13719
13729
|
* const sessionInfo = await getSessionInfo();
|
|
13720
13730
|
* console.log(sessionInfo);
|
|
@@ -13733,7 +13743,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
13733
13743
|
}
|
|
13734
13744
|
/**
|
|
13735
13745
|
* Processes the session info response and returns the session info object.
|
|
13736
|
-
*
|
|
13737
13746
|
* @param sessionInfoResp {any} Response from the session info API.
|
|
13738
13747
|
* @returns {SessionInfo} The session info object.
|
|
13739
13748
|
* @example ```js
|
|
@@ -13924,7 +13933,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
13924
13933
|
* Check if we are stuck at the SSO redirect URL
|
|
13925
13934
|
*/
|
|
13926
13935
|
function isAtSSORedirectUrl() {
|
|
13927
|
-
return window.location.href.indexOf(SSO_REDIRECTION_MARKER_GUID) >= 0;
|
|
13936
|
+
return window.location.href.indexOf(getSSOMarker(SSO_REDIRECTION_MARKER_GUID)) >= 0;
|
|
13928
13937
|
}
|
|
13929
13938
|
/**
|
|
13930
13939
|
* Remove the SSO redirect URL marker
|
|
@@ -13935,7 +13944,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
13935
13944
|
// reload the page which we don't want. We'll live with adding an
|
|
13936
13945
|
// unnecessary hash to the parent page URL until we find any use case where
|
|
13937
13946
|
// that creates an issue.
|
|
13938
|
-
|
|
13947
|
+
// Replace any occurences of ?ssoMarker=guid or &ssoMarker=guid.
|
|
13948
|
+
let updatedHash = window.location.hash.replace(`?${getSSOMarker(SSO_REDIRECTION_MARKER_GUID)}`, '');
|
|
13949
|
+
updatedHash = updatedHash.replace(`&${getSSOMarker(SSO_REDIRECTION_MARKER_GUID)}`, '');
|
|
13950
|
+
window.location.hash = updatedHash;
|
|
13939
13951
|
}
|
|
13940
13952
|
/**
|
|
13941
13953
|
* Perform token based authentication
|
|
@@ -14468,7 +14480,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
14468
14480
|
}
|
|
14469
14481
|
/**
|
|
14470
14482
|
* Responds to AuthInit sent from host signifying successful authentication in host.
|
|
14471
|
-
*
|
|
14472
14483
|
* @param e
|
|
14473
14484
|
* @returns {any}
|
|
14474
14485
|
*/
|
|
@@ -14609,7 +14620,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
14609
14620
|
});
|
|
14610
14621
|
}
|
|
14611
14622
|
|
|
14612
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.33.
|
|
14623
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.33.3";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",dompurify:"^2.3.4","eslint-plugin-comment-length":"^0.9.2","eslint-plugin-jsdoc":"^46.9.0",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","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$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"30 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};
|
|
14613
14624
|
|
|
14614
14625
|
/**
|
|
14615
14626
|
* Copyright (c) 2022
|
|
@@ -16224,7 +16235,6 @@ query GetEurekaVizSnapshots(
|
|
|
16224
16235
|
/**
|
|
16225
16236
|
* Returns the full url of the liveboard/viz which can be used to open
|
|
16226
16237
|
* this liveboard inside the full Thoughtspot application in a new tab.
|
|
16227
|
-
*
|
|
16228
16238
|
* @returns url string
|
|
16229
16239
|
*/
|
|
16230
16240
|
getLiveboardUrl() {
|
|
@@ -1478,7 +1478,6 @@ export interface LiveboardViewConfig extends Omit<ViewConfig, 'hiddenHomepageMod
|
|
|
1478
1478
|
*
|
|
1479
1479
|
* Since, this will show preview images, be careful that it may show
|
|
1480
1480
|
* undesired data to the user when using row level security.
|
|
1481
|
-
*
|
|
1482
1481
|
* @example
|
|
1483
1482
|
* ```js
|
|
1484
1483
|
* const embed = new LiveboardEmbed('#embed-container', {
|
|
@@ -1488,7 +1487,6 @@ export interface LiveboardViewConfig extends Omit<ViewConfig, 'hiddenHomepageMod
|
|
|
1488
1487
|
* });
|
|
1489
1488
|
* embed.render();
|
|
1490
1489
|
* ```
|
|
1491
|
-
*
|
|
1492
1490
|
* @version SDK: 1.32.0 | ThoughtSpot: 10.0.0.cl
|
|
1493
1491
|
*/
|
|
1494
1492
|
showPreviewLoader?: boolean;
|
|
@@ -1576,7 +1574,6 @@ export declare class LiveboardEmbed extends V1Embed {
|
|
|
1576
1574
|
/**
|
|
1577
1575
|
* Returns the full url of the liveboard/viz which can be used to open
|
|
1578
1576
|
* this liveboard inside the full Thoughtspot application in a new tab.
|
|
1579
|
-
*
|
|
1580
1577
|
* @returns url string
|
|
1581
1578
|
*/
|
|
1582
1579
|
getLiveboardUrl(): string;
|
|
@@ -1987,7 +1984,6 @@ export type SessionInfo = {
|
|
|
1987
1984
|
* Returns the session info object and caches it for future use.
|
|
1988
1985
|
* Once fetched the session info object is cached and returned from the cache on
|
|
1989
1986
|
* subsequent calls.
|
|
1990
|
-
*
|
|
1991
1987
|
* @example ```js
|
|
1992
1988
|
* const sessionInfo = await getSessionInfo();
|
|
1993
1989
|
* console.log(sessionInfo);
|
|
@@ -1999,7 +1995,6 @@ export declare function getSessionInfo(): Promise<SessionInfo>;
|
|
|
1999
1995
|
/**
|
|
2000
1996
|
* Returns the cached session info object. If the client is not authenticated the
|
|
2001
1997
|
* function will return null.
|
|
2002
|
-
*
|
|
2003
1998
|
* @example ```js
|
|
2004
1999
|
* const sessionInfo = getCachedSessionInfo();
|
|
2005
2000
|
* if (sessionInfo) {
|
|
@@ -2014,7 +2009,6 @@ export declare function getSessionInfo(): Promise<SessionInfo>;
|
|
|
2014
2009
|
export declare function getCachedSessionInfo(): SessionInfo | null;
|
|
2015
2010
|
/**
|
|
2016
2011
|
* Processes the session info response and returns the session info object.
|
|
2017
|
-
*
|
|
2018
2012
|
* @param sessionInfoResp {any} Response from the session info API.
|
|
2019
2013
|
* @returns {SessionInfo} The session info object.
|
|
2020
2014
|
* @example ```js
|
|
@@ -2027,7 +2021,6 @@ export declare function getCachedSessionInfo(): SessionInfo | null;
|
|
|
2027
2021
|
export declare const getSessionDetails: (sessionInfoResp: any) => SessionInfo;
|
|
2028
2022
|
/**
|
|
2029
2023
|
* Resets the cached session info object and forces a new fetch on the next call.
|
|
2030
|
-
*
|
|
2031
2024
|
* @example ```js
|
|
2032
2025
|
* resetCachedSessionInfo();
|
|
2033
2026
|
* const sessionInfo = await getSessionInfo();
|
|
@@ -4948,8 +4941,11 @@ export declare enum HostEvent {
|
|
|
4948
4941
|
* see link:https://developers.thoughtspot.com/docs/runtime-filters#rtOperator[Developer Documentation].
|
|
4949
4942
|
*
|
|
4950
4943
|
* `values` - An array of one or several values. The value definition on the
|
|
4951
|
-
* data type you choose to filter on. For a complete list of supported data types,
|
|
4952
|
-
*
|
|
4944
|
+
* data type you choose to filter on. For a complete list of supported data types, see
|
|
4945
|
+
* link:https://developers.thoughtspot.com/docs/runtime-filters#_supported_data_types[Supported data types]
|
|
4946
|
+
* `type` - To update filters for date time, specify the date format type.
|
|
4947
|
+
* For more information and examples, see link:https://developers.thoughtspot.com/docs/embed-liveboard#_date_filters[Date filters].
|
|
4948
|
+
*
|
|
4953
4949
|
* @example
|
|
4954
4950
|
* ```js
|
|
4955
4951
|
*
|
|
@@ -5079,7 +5075,7 @@ export declare enum HostEvent {
|
|
|
5079
5075
|
*/
|
|
5080
5076
|
AskSage = "AskSage",
|
|
5081
5077
|
/**
|
|
5082
|
-
* Trigger
|
|
5078
|
+
* Trigger cross filter update action on a Liveboard
|
|
5083
5079
|
* @example
|
|
5084
5080
|
* ```js
|
|
5085
5081
|
* liveboardEmbed.trigger(HostEvent.UpdateCrossFilter, {
|
|
@@ -5094,7 +5090,7 @@ export declare enum HostEvent {
|
|
|
5094
5090
|
*/
|
|
5095
5091
|
UpdateCrossFilter = "UpdateCrossFilter",
|
|
5096
5092
|
/**
|
|
5097
|
-
* Trigger
|
|
5093
|
+
* Trigger reset action for a personalized Liveboard view.
|
|
5098
5094
|
* @example
|
|
5099
5095
|
* ```js
|
|
5100
5096
|
* liveboardEmbed.trigger(HostEvent.ResetLiveboardPersonalisedView);
|
|
@@ -6423,8 +6419,8 @@ export interface CustomCssVariables {
|
|
|
6423
6419
|
/**
|
|
6424
6420
|
* Font color of the text on toggle buttons such as
|
|
6425
6421
|
* **All**, **Answers**, and **Liveboards** on the Home page (Classic experience),
|
|
6426
|
-
* the text color of the chart and table tiles on Home page (New modular Homepage
|
|
6427
|
-
* and title text on the AI-generated charts and tables.
|
|
6422
|
+
* the text color of the chart and table tiles on Home page (New modular Homepage
|
|
6423
|
+
* experience), and title text on the AI-generated charts and tables.
|
|
6428
6424
|
* The default color code is #2770EF.
|
|
6429
6425
|
*
|
|
6430
6426
|
*/
|
|
@@ -7011,7 +7007,6 @@ export declare function testResetMixpanel(): void;
|
|
|
7011
7007
|
* Fetch wrapper that adds the authentication token to the request.
|
|
7012
7008
|
* Use this to call the ThoughtSpot APIs when using the visual embed sdk.
|
|
7013
7009
|
* The interface for this method is the same as Web `Fetch`.
|
|
7014
|
-
*
|
|
7015
7010
|
* @param input
|
|
7016
7011
|
* @param init
|
|
7017
7012
|
* @example
|
|
@@ -1468,7 +1468,6 @@ export interface LiveboardViewConfig extends Omit<ViewConfig, 'hiddenHomepageMod
|
|
|
1468
1468
|
*
|
|
1469
1469
|
* Since, this will show preview images, be careful that it may show
|
|
1470
1470
|
* undesired data to the user when using row level security.
|
|
1471
|
-
*
|
|
1472
1471
|
* @example
|
|
1473
1472
|
* ```js
|
|
1474
1473
|
* const embed = new LiveboardEmbed('#embed-container', {
|
|
@@ -1478,7 +1477,6 @@ export interface LiveboardViewConfig extends Omit<ViewConfig, 'hiddenHomepageMod
|
|
|
1478
1477
|
* });
|
|
1479
1478
|
* embed.render();
|
|
1480
1479
|
* ```
|
|
1481
|
-
*
|
|
1482
1480
|
* @version SDK: 1.32.0 | ThoughtSpot: 10.0.0.cl
|
|
1483
1481
|
*/
|
|
1484
1482
|
showPreviewLoader?: boolean;
|
|
@@ -1566,7 +1564,6 @@ export declare class LiveboardEmbed extends V1Embed {
|
|
|
1566
1564
|
/**
|
|
1567
1565
|
* Returns the full url of the liveboard/viz which can be used to open
|
|
1568
1566
|
* this liveboard inside the full Thoughtspot application in a new tab.
|
|
1569
|
-
*
|
|
1570
1567
|
* @returns url string
|
|
1571
1568
|
*/
|
|
1572
1569
|
getLiveboardUrl(): string;
|
|
@@ -4556,8 +4553,11 @@ export declare enum HostEvent {
|
|
|
4556
4553
|
* see link:https://developers.thoughtspot.com/docs/runtime-filters#rtOperator[Developer Documentation].
|
|
4557
4554
|
*
|
|
4558
4555
|
* `values` - An array of one or several values. The value definition on the
|
|
4559
|
-
* data type you choose to filter on. For a complete list of supported data types,
|
|
4560
|
-
*
|
|
4556
|
+
* data type you choose to filter on. For a complete list of supported data types, see
|
|
4557
|
+
* link:https://developers.thoughtspot.com/docs/runtime-filters#_supported_data_types[Supported data types]
|
|
4558
|
+
* `type` - To update filters for date time, specify the date format type.
|
|
4559
|
+
* For more information and examples, see link:https://developers.thoughtspot.com/docs/embed-liveboard#_date_filters[Date filters].
|
|
4560
|
+
*
|
|
4561
4561
|
* @example
|
|
4562
4562
|
* ```js
|
|
4563
4563
|
*
|
|
@@ -4687,7 +4687,7 @@ export declare enum HostEvent {
|
|
|
4687
4687
|
*/
|
|
4688
4688
|
AskSage = "AskSage",
|
|
4689
4689
|
/**
|
|
4690
|
-
* Trigger
|
|
4690
|
+
* Trigger cross filter update action on a Liveboard
|
|
4691
4691
|
* @example
|
|
4692
4692
|
* ```js
|
|
4693
4693
|
* liveboardEmbed.trigger(HostEvent.UpdateCrossFilter, {
|
|
@@ -4702,7 +4702,7 @@ export declare enum HostEvent {
|
|
|
4702
4702
|
*/
|
|
4703
4703
|
UpdateCrossFilter = "UpdateCrossFilter",
|
|
4704
4704
|
/**
|
|
4705
|
-
* Trigger
|
|
4705
|
+
* Trigger reset action for a personalized Liveboard view.
|
|
4706
4706
|
* @example
|
|
4707
4707
|
* ```js
|
|
4708
4708
|
* liveboardEmbed.trigger(HostEvent.ResetLiveboardPersonalisedView);
|
|
@@ -6638,7 +6638,6 @@ export type SessionInfo = {
|
|
|
6638
6638
|
* Returns the session info object and caches it for future use.
|
|
6639
6639
|
* Once fetched the session info object is cached and returned from the cache on
|
|
6640
6640
|
* subsequent calls.
|
|
6641
|
-
*
|
|
6642
6641
|
* @example ```js
|
|
6643
6642
|
* const sessionInfo = await getSessionInfo();
|
|
6644
6643
|
* console.log(sessionInfo);
|
|
@@ -6650,7 +6649,6 @@ export declare function getSessionInfo(): Promise<SessionInfo>;
|
|
|
6650
6649
|
/**
|
|
6651
6650
|
* Returns the cached session info object. If the client is not authenticated the
|
|
6652
6651
|
* function will return null.
|
|
6653
|
-
*
|
|
6654
6652
|
* @example ```js
|
|
6655
6653
|
* const sessionInfo = getCachedSessionInfo();
|
|
6656
6654
|
* if (sessionInfo) {
|
|
@@ -6665,7 +6663,6 @@ export declare function getSessionInfo(): Promise<SessionInfo>;
|
|
|
6665
6663
|
export declare function getCachedSessionInfo(): SessionInfo | null;
|
|
6666
6664
|
/**
|
|
6667
6665
|
* Processes the session info response and returns the session info object.
|
|
6668
|
-
*
|
|
6669
6666
|
* @param sessionInfoResp {any} Response from the session info API.
|
|
6670
6667
|
* @returns {SessionInfo} The session info object.
|
|
6671
6668
|
* @example ```js
|
|
@@ -6678,7 +6675,6 @@ export declare function getCachedSessionInfo(): SessionInfo | null;
|
|
|
6678
6675
|
export declare const getSessionDetails: (sessionInfoResp: any) => SessionInfo;
|
|
6679
6676
|
/**
|
|
6680
6677
|
* Resets the cached session info object and forces a new fetch on the next call.
|
|
6681
|
-
*
|
|
6682
6678
|
* @example ```js
|
|
6683
6679
|
* resetCachedSessionInfo();
|
|
6684
6680
|
* const sessionInfo = await getSessionInfo();
|
|
@@ -6713,8 +6709,8 @@ export interface CustomCssVariables {
|
|
|
6713
6709
|
/**
|
|
6714
6710
|
* Font color of the text on toggle buttons such as
|
|
6715
6711
|
* **All**, **Answers**, and **Liveboards** on the Home page (Classic experience),
|
|
6716
|
-
* the text color of the chart and table tiles on Home page (New modular Homepage
|
|
6717
|
-
* and title text on the AI-generated charts and tables.
|
|
6712
|
+
* the text color of the chart and table tiles on Home page (New modular Homepage
|
|
6713
|
+
* experience), and title text on the AI-generated charts and tables.
|
|
6718
6714
|
* The default color code is #2770EF.
|
|
6719
6715
|
*
|
|
6720
6716
|
*/
|
|
@@ -7301,7 +7297,6 @@ export declare function testResetMixpanel(): void;
|
|
|
7301
7297
|
* Fetch wrapper that adds the authentication token to the request.
|
|
7302
7298
|
* Use this to call the ThoughtSpot APIs when using the visual embed sdk.
|
|
7303
7299
|
* The interface for this method is the same as Web `Fetch`.
|
|
7304
|
-
*
|
|
7305
7300
|
* @param input
|
|
7306
7301
|
* @param init
|
|
7307
7302
|
* @example
|
|
@@ -860,7 +860,6 @@ export interface LiveboardViewConfig extends Omit<ViewConfig, 'hiddenHomepageMod
|
|
|
860
860
|
*
|
|
861
861
|
* Since, this will show preview images, be careful that it may show
|
|
862
862
|
* undesired data to the user when using row level security.
|
|
863
|
-
*
|
|
864
863
|
* @example
|
|
865
864
|
* ```js
|
|
866
865
|
* const embed = new LiveboardEmbed('#embed-container', {
|
|
@@ -870,7 +869,6 @@ export interface LiveboardViewConfig extends Omit<ViewConfig, 'hiddenHomepageMod
|
|
|
870
869
|
* });
|
|
871
870
|
* embed.render();
|
|
872
871
|
* ```
|
|
873
|
-
*
|
|
874
872
|
* @version SDK: 1.32.0 | ThoughtSpot: 10.0.0.cl
|
|
875
873
|
*/
|
|
876
874
|
showPreviewLoader?: boolean;
|
|
@@ -958,7 +956,6 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
958
956
|
/**
|
|
959
957
|
* Returns the full url of the liveboard/viz which can be used to open
|
|
960
958
|
* this liveboard inside the full Thoughtspot application in a new tab.
|
|
961
|
-
*
|
|
962
959
|
* @returns url string
|
|
963
960
|
*/
|
|
964
961
|
getLiveboardUrl(): string;
|
|
@@ -1576,7 +1573,6 @@ export type SessionInfo = {
|
|
|
1576
1573
|
* Returns the session info object and caches it for future use.
|
|
1577
1574
|
* Once fetched the session info object is cached and returned from the cache on
|
|
1578
1575
|
* subsequent calls.
|
|
1579
|
-
*
|
|
1580
1576
|
* @example ```js
|
|
1581
1577
|
* const sessionInfo = await getSessionInfo();
|
|
1582
1578
|
* console.log(sessionInfo);
|
|
@@ -1588,7 +1584,6 @@ export function getSessionInfo(): Promise<SessionInfo>;
|
|
|
1588
1584
|
/**
|
|
1589
1585
|
* Returns the cached session info object. If the client is not authenticated the
|
|
1590
1586
|
* function will return null.
|
|
1591
|
-
*
|
|
1592
1587
|
* @example ```js
|
|
1593
1588
|
* const sessionInfo = getCachedSessionInfo();
|
|
1594
1589
|
* if (sessionInfo) {
|
|
@@ -1603,7 +1598,6 @@ export function getSessionInfo(): Promise<SessionInfo>;
|
|
|
1603
1598
|
export function getCachedSessionInfo(): SessionInfo | null;
|
|
1604
1599
|
/**
|
|
1605
1600
|
* Processes the session info response and returns the session info object.
|
|
1606
|
-
*
|
|
1607
1601
|
* @param sessionInfoResp {any} Response from the session info API.
|
|
1608
1602
|
* @returns {SessionInfo} The session info object.
|
|
1609
1603
|
* @example ```js
|
|
@@ -1616,7 +1610,6 @@ export function getCachedSessionInfo(): SessionInfo | null;
|
|
|
1616
1610
|
export const getSessionDetails: (sessionInfoResp: any) => SessionInfo;
|
|
1617
1611
|
/**
|
|
1618
1612
|
* Resets the cached session info object and forces a new fetch on the next call.
|
|
1619
|
-
*
|
|
1620
1613
|
* @example ```js
|
|
1621
1614
|
* resetCachedSessionInfo();
|
|
1622
1615
|
* const sessionInfo = await getSessionInfo();
|
|
@@ -4537,8 +4530,11 @@ export enum HostEvent {
|
|
|
4537
4530
|
* see link:https://developers.thoughtspot.com/docs/runtime-filters#rtOperator[Developer Documentation].
|
|
4538
4531
|
*
|
|
4539
4532
|
* `values` - An array of one or several values. The value definition on the
|
|
4540
|
-
* data type you choose to filter on. For a complete list of supported data types,
|
|
4541
|
-
*
|
|
4533
|
+
* data type you choose to filter on. For a complete list of supported data types, see
|
|
4534
|
+
* link:https://developers.thoughtspot.com/docs/runtime-filters#_supported_data_types[Supported data types]
|
|
4535
|
+
* `type` - To update filters for date time, specify the date format type.
|
|
4536
|
+
* For more information and examples, see link:https://developers.thoughtspot.com/docs/embed-liveboard#_date_filters[Date filters].
|
|
4537
|
+
*
|
|
4542
4538
|
* @example
|
|
4543
4539
|
* ```js
|
|
4544
4540
|
*
|
|
@@ -4668,7 +4664,7 @@ export enum HostEvent {
|
|
|
4668
4664
|
*/
|
|
4669
4665
|
AskSage = "AskSage",
|
|
4670
4666
|
/**
|
|
4671
|
-
* Trigger
|
|
4667
|
+
* Trigger cross filter update action on a Liveboard
|
|
4672
4668
|
* @example
|
|
4673
4669
|
* ```js
|
|
4674
4670
|
* liveboardEmbed.trigger(HostEvent.UpdateCrossFilter, {
|
|
@@ -4683,7 +4679,7 @@ export enum HostEvent {
|
|
|
4683
4679
|
*/
|
|
4684
4680
|
UpdateCrossFilter = "UpdateCrossFilter",
|
|
4685
4681
|
/**
|
|
4686
|
-
* Trigger
|
|
4682
|
+
* Trigger reset action for a personalized Liveboard view.
|
|
4687
4683
|
* @example
|
|
4688
4684
|
* ```js
|
|
4689
4685
|
* liveboardEmbed.trigger(HostEvent.ResetLiveboardPersonalisedView);
|
|
@@ -6012,8 +6008,8 @@ export interface CustomCssVariables {
|
|
|
6012
6008
|
/**
|
|
6013
6009
|
* Font color of the text on toggle buttons such as
|
|
6014
6010
|
* **All**, **Answers**, and **Liveboards** on the Home page (Classic experience),
|
|
6015
|
-
* the text color of the chart and table tiles on Home page (New modular Homepage
|
|
6016
|
-
* and title text on the AI-generated charts and tables.
|
|
6011
|
+
* the text color of the chart and table tiles on Home page (New modular Homepage
|
|
6012
|
+
* experience), and title text on the AI-generated charts and tables.
|
|
6017
6013
|
* The default color code is #2770EF.
|
|
6018
6014
|
*
|
|
6019
6015
|
*/
|
|
@@ -6746,7 +6742,6 @@ export function testResetMixpanel(): void;
|
|
|
6746
6742
|
* Fetch wrapper that adds the authentication token to the request.
|
|
6747
6743
|
* Use this to call the ThoughtSpot APIs when using the visual embed sdk.
|
|
6748
6744
|
* The interface for this method is the same as Web `Fetch`.
|
|
6749
|
-
*
|
|
6750
6745
|
* @param input
|
|
6751
6746
|
* @param init
|
|
6752
6747
|
* @example
|
package/lib/package.json
CHANGED
package/lib/src/auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,eAAe,CAAC;AAIzC,OAAO,EACoB,WAAW,EACrC,MAAM,SAAS,CAAC;AAejB,eAAO,IAAI,cAAc,SAAQ,CAAC;AAElC,eAAO,IAAI,cAAc,EAAE,MAAa,CAAC;AAEzC,eAAO,IAAI,qBAAqB,EAAE,OAAO,CAAC,IAAI,CAAQ,CAAC;AAIvD,eAAO,MAAM,2BAA2B,yCAAyC,CAAC;AAElF;;;;GAIG;AACH,oBAAY,eAAe;IACvB,GAAG,QAAQ;IACX,gBAAgB,qBAAqB;IACrC,MAAM,WAAW;IACjB,KAAK,UAAU;CAClB;AAED;;;GAGG;AACH,oBAAY,UAAU;IAClB;;OAEG;IACH,OAAO,YAAY;IACnB;;OAEG;IACH,WAAW,gBAAgB;IAC3B;;OAEG;IACH,OAAO,YAAY;IACnB;;OAEG;IACH,MAAM,WAAW;IACjB;;;;;OAKG;IACH,iBAAiB,sBAAsB;CAC1C;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC7B;;;;OAIG;IACH,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC,WAAW,EAAE,eAAe,KAAK,IAAI,GAAG,IAAI,CAAC;IACtF;;;;OAIG;IACH,EAAE,CACE,KAAK,EAAE,UAAU,CAAC,WAAW,GAAG,UAAU,CAAC,MAAM,GAAG,UAAU,CAAC,iBAAiB,EAChF,QAAQ,EAAE,MAAM,IAAI,GACrB,IAAI,CAAC;IACR,EAAE,CAAC,KAAK,EAAE,UAAU,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AsB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAWvD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,eAAe,GAAG,IAAI,CAMpE;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,IAAI,CAMnC;AAeD;;;;;;;;;;GAUG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAWtD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,WAEhC;AAyBD;;;GAGG;AACH,eAAO,MAAM,WAAW,gBAAuB,WAAW,KAAG,QAAQ,OAAO,CAgC3E,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,gBAAuB,WAAW,KAAG,QAAQ,OAAO,CAgBrF,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,gBAAuB,WAAW,KAAG,QAAQ,OAAO,CAa3E,CAAC;AA2EF,eAAO,MAAM,UAAU,gBAAuB,WAAW,qBAiBxD,CAAC;AAEF,eAAO,MAAM,UAAU,gBAAuB,WAAW,qBAiBxD,CAAC;AAEF,eAAO,MAAM,MAAM,gBAAuB,WAAW,KAAG,QAAQ,OAAO,CAYtE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,gBAAuB,WAAW,KAAG,QAAQ,OAAO,CAoB5E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,QAAO,OAAyB,CAAC"}
|
package/lib/src/auth.js
CHANGED
|
@@ -2,7 +2,7 @@ import { getAuthenticationToken, resetCachedAuthToken } from './authToken';
|
|
|
2
2
|
import { getEmbedConfig } from './embed/embedConfig';
|
|
3
3
|
import { initMixpanel } from './mixpanel-service';
|
|
4
4
|
import { AuthType, EmbedEvent, } from './types';
|
|
5
|
-
import { getDOMNode, getRedirectUrl } from './utils';
|
|
5
|
+
import { getDOMNode, getRedirectUrl, getSSOMarker } from './utils';
|
|
6
6
|
import { EndPoints, fetchAuthPostService, fetchAuthService, fetchBasicAuthService, fetchLogoutService, } from './utils/authService';
|
|
7
7
|
import { isActiveService } from './utils/authService/tokenizedAuthService';
|
|
8
8
|
import { logger } from './utils/logger';
|
|
@@ -178,7 +178,7 @@ export function getReleaseVersion() {
|
|
|
178
178
|
* Check if we are stuck at the SSO redirect URL
|
|
179
179
|
*/
|
|
180
180
|
function isAtSSORedirectUrl() {
|
|
181
|
-
return window.location.href.indexOf(SSO_REDIRECTION_MARKER_GUID) >= 0;
|
|
181
|
+
return window.location.href.indexOf(getSSOMarker(SSO_REDIRECTION_MARKER_GUID)) >= 0;
|
|
182
182
|
}
|
|
183
183
|
/**
|
|
184
184
|
* Remove the SSO redirect URL marker
|
|
@@ -189,7 +189,10 @@ function removeSSORedirectUrlMarker() {
|
|
|
189
189
|
// reload the page which we don't want. We'll live with adding an
|
|
190
190
|
// unnecessary hash to the parent page URL until we find any use case where
|
|
191
191
|
// that creates an issue.
|
|
192
|
-
|
|
192
|
+
// Replace any occurences of ?ssoMarker=guid or &ssoMarker=guid.
|
|
193
|
+
let updatedHash = window.location.hash.replace(`?${getSSOMarker(SSO_REDIRECTION_MARKER_GUID)}`, '');
|
|
194
|
+
updatedHash = updatedHash.replace(`&${getSSOMarker(SSO_REDIRECTION_MARKER_GUID)}`, '');
|
|
195
|
+
window.location.hash = updatedHash;
|
|
193
196
|
}
|
|
194
197
|
/**
|
|
195
198
|
* Perform token based authentication
|
package/lib/src/auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/auth.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EACH,QAAQ,EAA4B,UAAU,GACjD,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,UAAU,E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AO,CAAC,CAAC,EAAE,EAAE,EAAE;YAC9B,EAAE,CAAC,aAAa,CAAC,SAAS,GAAG,WAAW,CAAC,kBAAkB,CAAC;QAChE,CAAC,CAAC,CAAC;KACN;IACD,cAAc,GAAG,KAAK,CAAC;IACvB,OAAO,cAAc,CAAC;AAC1B,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAAE,WAAwB,EAAoB,EAAE;IAC7E,MAAM,EAAE,QAAQ,EAAE,GAAG,WAAW,CAAC;IACjC,QAAQ,QAAQ,EAAE;QACd,KAAK,QAAQ,CAAC,GAAG,CAAC;QAClB,KAAK,QAAQ,CAAC,YAAY,CAAC;QAC3B,KAAK,QAAQ,CAAC,IAAI;YACd,OAAO,UAAU,CAAC,WAAW,CAAC,CAAC;QACnC,KAAK,QAAQ,CAAC,IAAI,CAAC;QACnB,KAAK,QAAQ,CAAC,YAAY;YACtB,OAAO,UAAU,CAAC,WAAW,CAAC,CAAC;QACnC,KAAK,QAAQ,CAAC,UAAU,CAAC;QACzB,KAAK,QAAQ,CAAC,gBAAgB;YAC1B,OAAO,WAAW,CAAC,WAAW,CAAC,CAAC;QACpC,KAAK,QAAQ,CAAC,0BAA0B;YACpC,OAAO,qBAAqB,CAAC,WAAW,CAAC,CAAC;QAC9C,KAAK,QAAQ,CAAC,KAAK;YACf,OAAO,WAAW,CAAC,WAAW,CAAC,CAAC;QACpC;YACI,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KACpC;AACL,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,GAAY,EAAE,CAAC,cAAc,CAAC"}
|
package/lib/src/auth.spec.js
CHANGED
|
@@ -13,7 +13,7 @@ import * as SessionService from './utils/sessionInfoService';
|
|
|
13
13
|
const thoughtSpotHost = 'http://localhost:3000';
|
|
14
14
|
const username = 'tsuser';
|
|
15
15
|
const password = '12345678';
|
|
16
|
-
const samalLoginUrl = `${thoughtSpotHost}/callosum/v1/saml/login?targetURLPath=%
|
|
16
|
+
const samalLoginUrl = `${thoughtSpotHost}/callosum/v1/saml/login?targetURLPath=%23%3FtsSSOMarker%3D5e16222e-ef02-43e9-9fbd-24226bf3ce5b`;
|
|
17
17
|
export const embedConfig = {
|
|
18
18
|
doTokenAuthSuccess: (token) => ({
|
|
19
19
|
thoughtSpotHost,
|
|
@@ -292,8 +292,8 @@ describe('Unit test for auth', () => {
|
|
|
292
292
|
spyOn(checkReleaseVersionInBetaInstance, 'checkReleaseVersionInBeta');
|
|
293
293
|
Object.defineProperty(window, 'location', {
|
|
294
294
|
value: {
|
|
295
|
-
href: authInstance.SSO_REDIRECTION_MARKER_GUID
|
|
296
|
-
hash:
|
|
295
|
+
href: `asd.com#?tsSSOMarker=${authInstance.SSO_REDIRECTION_MARKER_GUID}`,
|
|
296
|
+
hash: `?tsSSOMarker=${authInstance.SSO_REDIRECTION_MARKER_GUID}`,
|
|
297
297
|
},
|
|
298
298
|
});
|
|
299
299
|
jest.spyOn(tokenAuthService, 'fetchSessionInfoService').mockImplementation(async () => ({
|
|
@@ -306,6 +306,12 @@ describe('Unit test for auth', () => {
|
|
|
306
306
|
expect(authInstance.loggedInStatus).toBe(true);
|
|
307
307
|
});
|
|
308
308
|
it('when user is not loggedIn & isAtSSORedirectUrl is true', async () => {
|
|
309
|
+
Object.defineProperty(window, 'location', {
|
|
310
|
+
value: {
|
|
311
|
+
href: `asd.com#?tsSSOMarker=${authInstance.SSO_REDIRECTION_MARKER_GUID}`,
|
|
312
|
+
hash: `?tsSSOMarker=${authInstance.SSO_REDIRECTION_MARKER_GUID}`,
|
|
313
|
+
},
|
|
314
|
+
});
|
|
309
315
|
jest.spyOn(tokenAuthService, 'fetchSessionInfoService').mockImplementation(() => Promise.reject());
|
|
310
316
|
await authInstance.doSamlAuth(embedConfig.doSamlAuth);
|
|
311
317
|
expect(window.location.hash).toBe('');
|
|
@@ -353,6 +359,12 @@ describe('Unit test for auth', () => {
|
|
|
353
359
|
global.fetch = window.fetch;
|
|
354
360
|
});
|
|
355
361
|
it('when user is not loggedIn & isAtSSORedirectUrl is true', async () => {
|
|
362
|
+
Object.defineProperty(window, 'location', {
|
|
363
|
+
value: {
|
|
364
|
+
href: `asd.com#?tsSSOMarker=${authInstance.SSO_REDIRECTION_MARKER_GUID}`,
|
|
365
|
+
hash: `?tsSSOMarker=${authInstance.SSO_REDIRECTION_MARKER_GUID}`,
|
|
366
|
+
},
|
|
367
|
+
});
|
|
356
368
|
jest.spyOn(tokenAuthService, 'fetchSessionInfoService').mockImplementation(() => Promise.reject());
|
|
357
369
|
await authInstance.doOIDCAuth(embedConfig.doOidcAuth);
|
|
358
370
|
expect(window.location.hash).toBe('');
|