@thoughtspot/visual-embed-sdk 1.26.0-token-cache.0 → 1.26.0-token-cache.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/package.json +1 -1
- package/cjs/src/authToken.d.ts.map +1 -1
- package/cjs/src/authToken.js +3 -3
- package/cjs/src/authToken.js.map +1 -1
- package/dist/src/authToken.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +4 -4
- package/dist/tsembed-react.js +4 -4
- package/dist/tsembed.es.js +4 -4
- package/dist/tsembed.js +4 -4
- package/lib/package.json +1 -1
- package/lib/src/authToken.d.ts.map +1 -1
- package/lib/src/authToken.js +3 -3
- package/lib/src/authToken.js.map +1 -1
- package/package.json +1 -1
- package/src/authToken.ts +11 -3
package/cjs/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authToken.d.ts","sourceRoot":"","sources":["../../src/authToken.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAWtC,eAAO,MAAM,sBAAsB,gBAAuB,WAAW,KAAG,QAAQ,MAAM,
|
|
1
|
+
{"version":3,"file":"authToken.d.ts","sourceRoot":"","sources":["../../src/authToken.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAWtC,eAAO,MAAM,sBAAsB,gBAAuB,WAAW,KAAG,QAAQ,MAAM,CA6BrF,CAAC;AAyBF,eAAO,MAAM,oBAAoB,QAAO,IAEvC,CAAC"}
|
package/cjs/src/authToken.js
CHANGED
|
@@ -10,7 +10,7 @@ let cachedAuthToken = null;
|
|
|
10
10
|
const getAuthenticationToken = async (embedConfig) => {
|
|
11
11
|
if (cachedAuthToken) {
|
|
12
12
|
try {
|
|
13
|
-
const isCachedTokenStillValid = await validateAuthToken(embedConfig, cachedAuthToken);
|
|
13
|
+
const isCachedTokenStillValid = await validateAuthToken(embedConfig, cachedAuthToken, true);
|
|
14
14
|
if (isCachedTokenStillValid)
|
|
15
15
|
return cachedAuthToken;
|
|
16
16
|
}
|
|
@@ -33,7 +33,7 @@ const getAuthenticationToken = async (embedConfig) => {
|
|
|
33
33
|
return authToken;
|
|
34
34
|
};
|
|
35
35
|
exports.getAuthenticationToken = getAuthenticationToken;
|
|
36
|
-
const validateAuthToken = async (embedConfig, authToken) => {
|
|
36
|
+
const validateAuthToken = async (embedConfig, authToken, suppressAlert) => {
|
|
37
37
|
try {
|
|
38
38
|
const isTokenValid = await (0, authService_1.verifyTokenService)(embedConfig.thoughtSpotHost, authToken);
|
|
39
39
|
if (isTokenValid)
|
|
@@ -43,7 +43,7 @@ const validateAuthToken = async (embedConfig, authToken) => {
|
|
|
43
43
|
return false;
|
|
44
44
|
}
|
|
45
45
|
if (cachedAuthToken && cachedAuthToken === authToken) {
|
|
46
|
-
if (!embedConfig.suppressErrorAlerts) {
|
|
46
|
+
if (!embedConfig.suppressErrorAlerts && !suppressAlert) {
|
|
47
47
|
// eslint-disable-next-line no-alert
|
|
48
48
|
alert(DUPLICATE_TOKEN_ERR);
|
|
49
49
|
}
|
package/cjs/src/authToken.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authToken.js","sourceRoot":"","sources":["../../src/authToken.ts"],"names":[],"mappings":";;;AACA,qDAAgF;AAEhF,MAAM,mBAAmB,GAAG,uFAAuF;MAC7G,qGAAqG,CAAC;AAE5G,MAAM,iBAAiB,GAAG,mEAAmE,CAAC;AAE9F,IAAI,eAAe,GAAkB,IAAI,CAAC;AAE1C,qEAAqE;AAC9D,MAAM,sBAAsB,GAAG,KAAK,EAAE,WAAwB,EAAmB,EAAE;IACtF,IAAI,eAAe,EAAE;QACjB,IAAI;YACA,MAAM,uBAAuB,GAAG,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"authToken.js","sourceRoot":"","sources":["../../src/authToken.ts"],"names":[],"mappings":";;;AACA,qDAAgF;AAEhF,MAAM,mBAAmB,GAAG,uFAAuF;MAC7G,qGAAqG,CAAC;AAE5G,MAAM,iBAAiB,GAAG,mEAAmE,CAAC;AAE9F,IAAI,eAAe,GAAkB,IAAI,CAAC;AAE1C,qEAAqE;AAC9D,MAAM,sBAAsB,GAAG,KAAK,EAAE,WAAwB,EAAmB,EAAE;IACtF,IAAI,eAAe,EAAE;QACjB,IAAI;YACA,MAAM,uBAAuB,GAAG,MAAM,iBAAiB,CACnD,WAAW,EACX,eAAe,EACf,IAAI,CACP,CAAC;YACF,IAAI,uBAAuB;gBAAE,OAAO,eAAe,CAAC;SACvD;QAAC,MAAM;YACJ,kDAAkD;SACrD;KACJ;IAED,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,GAAG,WAAW,CAAC;IAEnD,IAAI,SAAS,GAAG,IAAI,CAAC;IACrB,IAAI,YAAY,EAAE;QACd,SAAS,GAAG,MAAM,YAAY,EAAE,CAAC;KACpC;SAAM;QACH,MAAM,QAAQ,GAAG,MAAM,IAAA,mCAAqB,EAAC,YAAY,CAAC,CAAC;QAC3D,SAAS,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;KACrC;IAED,kDAAkD;IAClD,MAAM,iBAAiB,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IAEhD,eAAe,GAAG,SAAS,CAAC;IAC5B,OAAO,SAAS,CAAC;AACrB,CAAC,CAAC;AA7BW,QAAA,sBAAsB,0BA6BjC;AAEF,MAAM,iBAAiB,GAAG,KAAK,EAC3B,WAAwB,EACxB,SAAiB,EACjB,aAAuB,EACP,EAAE;IAClB,IAAI;QACA,MAAM,YAAY,GAAG,MAAM,IAAA,gCAAkB,EAAC,WAAW,CAAC,eAAe,EAAE,SAAS,CAAC,CAAC;QACtF,IAAI,YAAY;YAAE,OAAO,IAAI,CAAC;KACjC;IAAC,MAAM;QACJ,OAAO,KAAK,CAAC;KAChB;IAED,IAAI,eAAe,IAAI,eAAe,KAAK,SAAS,EAAE;QAClD,IAAI,CAAC,WAAW,CAAC,mBAAmB,IAAI,CAAC,aAAa,EAAE;YACpD,oCAAoC;YACpC,KAAK,CAAC,mBAAmB,CAAC,CAAC;SAC9B;QACD,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;KACxC;SAAM;QACH,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;KACtC;AACL,CAAC,CAAC;AAEK,MAAM,oBAAoB,GAAG,GAAS,EAAE;IAC3C,eAAe,GAAG,IAAI,CAAC;AAC3B,CAAC,CAAC;AAFW,QAAA,oBAAoB,wBAE/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authToken.d.ts","sourceRoot":"","sources":["authToken.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAWtC,eAAO,MAAM,sBAAsB,gBAAuB,WAAW,KAAG,QAAQ,MAAM,
|
|
1
|
+
{"version":3,"file":"authToken.d.ts","sourceRoot":"","sources":["authToken.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAWtC,eAAO,MAAM,sBAAsB,gBAAuB,WAAW,KAAG,QAAQ,MAAM,CA6BrF,CAAC;AAyBF,eAAO,MAAM,oBAAoB,QAAO,IAEvC,CAAC"}
|
package/dist/tsembed-react.es.js
CHANGED
|
@@ -5236,7 +5236,7 @@ let cachedAuthToken = null;
|
|
|
5236
5236
|
const getAuthenticationToken = async (embedConfig) => {
|
|
5237
5237
|
if (cachedAuthToken) {
|
|
5238
5238
|
try {
|
|
5239
|
-
const isCachedTokenStillValid = await validateAuthToken(embedConfig, cachedAuthToken);
|
|
5239
|
+
const isCachedTokenStillValid = await validateAuthToken(embedConfig, cachedAuthToken, true);
|
|
5240
5240
|
if (isCachedTokenStillValid)
|
|
5241
5241
|
return cachedAuthToken;
|
|
5242
5242
|
}
|
|
@@ -5258,7 +5258,7 @@ const getAuthenticationToken = async (embedConfig) => {
|
|
|
5258
5258
|
cachedAuthToken = authToken;
|
|
5259
5259
|
return authToken;
|
|
5260
5260
|
};
|
|
5261
|
-
const validateAuthToken = async (embedConfig, authToken) => {
|
|
5261
|
+
const validateAuthToken = async (embedConfig, authToken, suppressAlert) => {
|
|
5262
5262
|
try {
|
|
5263
5263
|
const isTokenValid = await verifyTokenService(embedConfig.thoughtSpotHost, authToken);
|
|
5264
5264
|
if (isTokenValid)
|
|
@@ -5268,7 +5268,7 @@ const validateAuthToken = async (embedConfig, authToken) => {
|
|
|
5268
5268
|
return false;
|
|
5269
5269
|
}
|
|
5270
5270
|
if (cachedAuthToken && cachedAuthToken === authToken) {
|
|
5271
|
-
if (!embedConfig.suppressErrorAlerts) {
|
|
5271
|
+
if (!embedConfig.suppressErrorAlerts && !suppressAlert) {
|
|
5272
5272
|
// eslint-disable-next-line no-alert
|
|
5273
5273
|
alert(DUPLICATE_TOKEN_ERR);
|
|
5274
5274
|
}
|
|
@@ -12758,7 +12758,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
|
12758
12758
|
});
|
|
12759
12759
|
}
|
|
12760
12760
|
|
|
12761
|
-
var name="@thoughtspot/visual-embed-sdk";var version="1.26.0-token-cache.
|
|
12761
|
+
var name="@thoughtspot/visual-embed-sdk";var version="1.26.0-token-cache.1";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs",start:"gatsby develop","build:gatsby":"npm run clean:gatsby && gatsby build --prefix-paths","build:gatsby:noprefix":"npm run clean:gatsby && gatsby build","serve:gatsby":"gatsby serve","clean:gatsby":"gatsby clean","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","docs-cmd":"node scripts/gatsby-commands.js",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme","test-sdk":"jest -c jest.config.sdk.js --runInBand","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs",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"};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":"^40.1.0",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"^2.45.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.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/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","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",gatsby:"3.13.1","gatsby-plugin-algolia":"^0.22.2","gatsby-plugin-catch-links":"^3.1.0","gatsby-plugin-env-variables":"^2.1.0","gatsby-plugin-intl":"^0.3.3","gatsby-plugin-manifest":"^3.2.0","gatsby-plugin-output":"^0.1.3","gatsby-plugin-sass":"6.7.0","gatsby-plugin-sitemap":"^4.10.0","gatsby-source-filesystem":"3.1.0","gatsby-transformer-asciidoc":"2.1.0","gatsby-transformer-rehype":"2.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:"2.30.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"};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","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,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.js",limit:"43 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};
|
|
12762
12762
|
|
|
12763
12763
|
/**
|
|
12764
12764
|
* Copyright (c) 2022
|
package/dist/tsembed-react.js
CHANGED
|
@@ -5158,7 +5158,7 @@
|
|
|
5158
5158
|
const getAuthenticationToken = async (embedConfig) => {
|
|
5159
5159
|
if (cachedAuthToken) {
|
|
5160
5160
|
try {
|
|
5161
|
-
const isCachedTokenStillValid = await validateAuthToken(embedConfig, cachedAuthToken);
|
|
5161
|
+
const isCachedTokenStillValid = await validateAuthToken(embedConfig, cachedAuthToken, true);
|
|
5162
5162
|
if (isCachedTokenStillValid)
|
|
5163
5163
|
return cachedAuthToken;
|
|
5164
5164
|
}
|
|
@@ -5180,7 +5180,7 @@
|
|
|
5180
5180
|
cachedAuthToken = authToken;
|
|
5181
5181
|
return authToken;
|
|
5182
5182
|
};
|
|
5183
|
-
const validateAuthToken = async (embedConfig, authToken) => {
|
|
5183
|
+
const validateAuthToken = async (embedConfig, authToken, suppressAlert) => {
|
|
5184
5184
|
try {
|
|
5185
5185
|
const isTokenValid = await verifyTokenService(embedConfig.thoughtSpotHost, authToken);
|
|
5186
5186
|
if (isTokenValid)
|
|
@@ -5190,7 +5190,7 @@
|
|
|
5190
5190
|
return false;
|
|
5191
5191
|
}
|
|
5192
5192
|
if (cachedAuthToken && cachedAuthToken === authToken) {
|
|
5193
|
-
if (!embedConfig.suppressErrorAlerts) {
|
|
5193
|
+
if (!embedConfig.suppressErrorAlerts && !suppressAlert) {
|
|
5194
5194
|
// eslint-disable-next-line no-alert
|
|
5195
5195
|
alert(DUPLICATE_TOKEN_ERR);
|
|
5196
5196
|
}
|
|
@@ -12680,7 +12680,7 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
|
|
|
12680
12680
|
});
|
|
12681
12681
|
}
|
|
12682
12682
|
|
|
12683
|
-
var name="@thoughtspot/visual-embed-sdk";var version="1.26.0-token-cache.
|
|
12683
|
+
var name="@thoughtspot/visual-embed-sdk";var version="1.26.0-token-cache.1";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$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",start:"gatsby develop","build:gatsby":"npm run clean:gatsby && gatsby build --prefix-paths","build:gatsby:noprefix":"npm run clean:gatsby && gatsby build","serve:gatsby":"gatsby serve","clean:gatsby":"gatsby clean","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","docs-cmd":"node scripts/gatsby-commands.js",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme","test-sdk":"jest -c jest.config.sdk.js --runInBand","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs",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"};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":"^40.1.0",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"^2.45.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.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/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","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",gatsby:"3.13.1","gatsby-plugin-algolia":"^0.22.2","gatsby-plugin-catch-links":"^3.1.0","gatsby-plugin-env-variables":"^2.1.0","gatsby-plugin-intl":"^0.3.3","gatsby-plugin-manifest":"^3.2.0","gatsby-plugin-output":"^0.1.3","gatsby-plugin-sass":"6.7.0","gatsby-plugin-sitemap":"^4.10.0","gatsby-source-filesystem":"3.1.0","gatsby-transformer-asciidoc":"2.1.0","gatsby-transformer-rehype":"2.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:"2.30.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"};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","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,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.js",limit:"43 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};
|
|
12684
12684
|
|
|
12685
12685
|
/**
|
|
12686
12686
|
* Copyright (c) 2022
|
package/dist/tsembed.es.js
CHANGED
|
@@ -5135,7 +5135,7 @@ let cachedAuthToken = null;
|
|
|
5135
5135
|
const getAuthenticationToken = async (embedConfig) => {
|
|
5136
5136
|
if (cachedAuthToken) {
|
|
5137
5137
|
try {
|
|
5138
|
-
const isCachedTokenStillValid = await validateAuthToken(embedConfig, cachedAuthToken);
|
|
5138
|
+
const isCachedTokenStillValid = await validateAuthToken(embedConfig, cachedAuthToken, true);
|
|
5139
5139
|
if (isCachedTokenStillValid)
|
|
5140
5140
|
return cachedAuthToken;
|
|
5141
5141
|
}
|
|
@@ -5157,7 +5157,7 @@ const getAuthenticationToken = async (embedConfig) => {
|
|
|
5157
5157
|
cachedAuthToken = authToken;
|
|
5158
5158
|
return authToken;
|
|
5159
5159
|
};
|
|
5160
|
-
const validateAuthToken = async (embedConfig, authToken) => {
|
|
5160
|
+
const validateAuthToken = async (embedConfig, authToken, suppressAlert) => {
|
|
5161
5161
|
try {
|
|
5162
5162
|
const isTokenValid = await verifyTokenService(embedConfig.thoughtSpotHost, authToken);
|
|
5163
5163
|
if (isTokenValid)
|
|
@@ -5167,7 +5167,7 @@ const validateAuthToken = async (embedConfig, authToken) => {
|
|
|
5167
5167
|
return false;
|
|
5168
5168
|
}
|
|
5169
5169
|
if (cachedAuthToken && cachedAuthToken === authToken) {
|
|
5170
|
-
if (!embedConfig.suppressErrorAlerts) {
|
|
5170
|
+
if (!embedConfig.suppressErrorAlerts && !suppressAlert) {
|
|
5171
5171
|
// eslint-disable-next-line no-alert
|
|
5172
5172
|
alert(DUPLICATE_TOKEN_ERR);
|
|
5173
5173
|
}
|
|
@@ -13161,7 +13161,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
|
13161
13161
|
});
|
|
13162
13162
|
}
|
|
13163
13163
|
|
|
13164
|
-
var name="@thoughtspot/visual-embed-sdk";var version="1.26.0-token-cache.
|
|
13164
|
+
var name="@thoughtspot/visual-embed-sdk";var version="1.26.0-token-cache.1";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs",start:"gatsby develop","build:gatsby":"npm run clean:gatsby && gatsby build --prefix-paths","build:gatsby:noprefix":"npm run clean:gatsby && gatsby build","serve:gatsby":"gatsby serve","clean:gatsby":"gatsby clean","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","docs-cmd":"node scripts/gatsby-commands.js",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme","test-sdk":"jest -c jest.config.sdk.js --runInBand","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs",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"};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":"^40.1.0",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"^2.45.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.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/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","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",gatsby:"3.13.1","gatsby-plugin-algolia":"^0.22.2","gatsby-plugin-catch-links":"^3.1.0","gatsby-plugin-env-variables":"^2.1.0","gatsby-plugin-intl":"^0.3.3","gatsby-plugin-manifest":"^3.2.0","gatsby-plugin-output":"^0.1.3","gatsby-plugin-sass":"6.7.0","gatsby-plugin-sitemap":"^4.10.0","gatsby-source-filesystem":"3.1.0","gatsby-transformer-asciidoc":"2.1.0","gatsby-transformer-rehype":"2.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:"2.30.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"};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","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,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.js",limit:"43 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};
|
|
13165
13165
|
|
|
13166
13166
|
/**
|
|
13167
13167
|
* Copyright (c) 2022
|
package/dist/tsembed.js
CHANGED
|
@@ -5036,7 +5036,7 @@
|
|
|
5036
5036
|
const getAuthenticationToken = async (embedConfig) => {
|
|
5037
5037
|
if (cachedAuthToken) {
|
|
5038
5038
|
try {
|
|
5039
|
-
const isCachedTokenStillValid = await validateAuthToken(embedConfig, cachedAuthToken);
|
|
5039
|
+
const isCachedTokenStillValid = await validateAuthToken(embedConfig, cachedAuthToken, true);
|
|
5040
5040
|
if (isCachedTokenStillValid)
|
|
5041
5041
|
return cachedAuthToken;
|
|
5042
5042
|
}
|
|
@@ -5058,7 +5058,7 @@
|
|
|
5058
5058
|
cachedAuthToken = authToken;
|
|
5059
5059
|
return authToken;
|
|
5060
5060
|
};
|
|
5061
|
-
const validateAuthToken = async (embedConfig, authToken) => {
|
|
5061
|
+
const validateAuthToken = async (embedConfig, authToken, suppressAlert) => {
|
|
5062
5062
|
try {
|
|
5063
5063
|
const isTokenValid = await verifyTokenService(embedConfig.thoughtSpotHost, authToken);
|
|
5064
5064
|
if (isTokenValid)
|
|
@@ -5068,7 +5068,7 @@
|
|
|
5068
5068
|
return false;
|
|
5069
5069
|
}
|
|
5070
5070
|
if (cachedAuthToken && cachedAuthToken === authToken) {
|
|
5071
|
-
if (!embedConfig.suppressErrorAlerts) {
|
|
5071
|
+
if (!embedConfig.suppressErrorAlerts && !suppressAlert) {
|
|
5072
5072
|
// eslint-disable-next-line no-alert
|
|
5073
5073
|
alert(DUPLICATE_TOKEN_ERR);
|
|
5074
5074
|
}
|
|
@@ -13043,7 +13043,7 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
|
|
|
13043
13043
|
});
|
|
13044
13044
|
}
|
|
13045
13045
|
|
|
13046
|
-
var name="@thoughtspot/visual-embed-sdk";var version="1.26.0-token-cache.
|
|
13046
|
+
var name="@thoughtspot/visual-embed-sdk";var version="1.26.0-token-cache.1";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$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",start:"gatsby develop","build:gatsby":"npm run clean:gatsby && gatsby build --prefix-paths","build:gatsby:noprefix":"npm run clean:gatsby && gatsby build","serve:gatsby":"gatsby serve","clean:gatsby":"gatsby clean","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","docs-cmd":"node scripts/gatsby-commands.js",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme","test-sdk":"jest -c jest.config.sdk.js --runInBand","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs",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"};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":"^40.1.0",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"^2.45.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.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/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","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",gatsby:"3.13.1","gatsby-plugin-algolia":"^0.22.2","gatsby-plugin-catch-links":"^3.1.0","gatsby-plugin-env-variables":"^2.1.0","gatsby-plugin-intl":"^0.3.3","gatsby-plugin-manifest":"^3.2.0","gatsby-plugin-output":"^0.1.3","gatsby-plugin-sass":"6.7.0","gatsby-plugin-sitemap":"^4.10.0","gatsby-source-filesystem":"3.1.0","gatsby-transformer-asciidoc":"2.1.0","gatsby-transformer-rehype":"2.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:"2.30.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"};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","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,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.js",limit:"43 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};
|
|
13047
13047
|
|
|
13048
13048
|
/**
|
|
13049
13049
|
* Copyright (c) 2022
|
package/lib/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authToken.d.ts","sourceRoot":"","sources":["../../src/authToken.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAWtC,eAAO,MAAM,sBAAsB,gBAAuB,WAAW,KAAG,QAAQ,MAAM,
|
|
1
|
+
{"version":3,"file":"authToken.d.ts","sourceRoot":"","sources":["../../src/authToken.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAWtC,eAAO,MAAM,sBAAsB,gBAAuB,WAAW,KAAG,QAAQ,MAAM,CA6BrF,CAAC;AAyBF,eAAO,MAAM,oBAAoB,QAAO,IAEvC,CAAC"}
|
package/lib/src/authToken.js
CHANGED
|
@@ -7,7 +7,7 @@ let cachedAuthToken = null;
|
|
|
7
7
|
export const getAuthenticationToken = async (embedConfig) => {
|
|
8
8
|
if (cachedAuthToken) {
|
|
9
9
|
try {
|
|
10
|
-
const isCachedTokenStillValid = await validateAuthToken(embedConfig, cachedAuthToken);
|
|
10
|
+
const isCachedTokenStillValid = await validateAuthToken(embedConfig, cachedAuthToken, true);
|
|
11
11
|
if (isCachedTokenStillValid)
|
|
12
12
|
return cachedAuthToken;
|
|
13
13
|
}
|
|
@@ -29,7 +29,7 @@ export const getAuthenticationToken = async (embedConfig) => {
|
|
|
29
29
|
cachedAuthToken = authToken;
|
|
30
30
|
return authToken;
|
|
31
31
|
};
|
|
32
|
-
const validateAuthToken = async (embedConfig, authToken) => {
|
|
32
|
+
const validateAuthToken = async (embedConfig, authToken, suppressAlert) => {
|
|
33
33
|
try {
|
|
34
34
|
const isTokenValid = await verifyTokenService(embedConfig.thoughtSpotHost, authToken);
|
|
35
35
|
if (isTokenValid)
|
|
@@ -39,7 +39,7 @@ const validateAuthToken = async (embedConfig, authToken) => {
|
|
|
39
39
|
return false;
|
|
40
40
|
}
|
|
41
41
|
if (cachedAuthToken && cachedAuthToken === authToken) {
|
|
42
|
-
if (!embedConfig.suppressErrorAlerts) {
|
|
42
|
+
if (!embedConfig.suppressErrorAlerts && !suppressAlert) {
|
|
43
43
|
// eslint-disable-next-line no-alert
|
|
44
44
|
alert(DUPLICATE_TOKEN_ERR);
|
|
45
45
|
}
|
package/lib/src/authToken.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authToken.js","sourceRoot":"","sources":["../../src/authToken.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEhF,MAAM,mBAAmB,GAAG,uFAAuF;MAC7G,qGAAqG,CAAC;AAE5G,MAAM,iBAAiB,GAAG,mEAAmE,CAAC;AAE9F,IAAI,eAAe,GAAkB,IAAI,CAAC;AAE1C,qEAAqE;AACrE,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,EAAE,WAAwB,EAAmB,EAAE;IACtF,IAAI,eAAe,EAAE;QACjB,IAAI;YACA,MAAM,uBAAuB,GAAG,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"authToken.js","sourceRoot":"","sources":["../../src/authToken.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEhF,MAAM,mBAAmB,GAAG,uFAAuF;MAC7G,qGAAqG,CAAC;AAE5G,MAAM,iBAAiB,GAAG,mEAAmE,CAAC;AAE9F,IAAI,eAAe,GAAkB,IAAI,CAAC;AAE1C,qEAAqE;AACrE,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,EAAE,WAAwB,EAAmB,EAAE;IACtF,IAAI,eAAe,EAAE;QACjB,IAAI;YACA,MAAM,uBAAuB,GAAG,MAAM,iBAAiB,CACnD,WAAW,EACX,eAAe,EACf,IAAI,CACP,CAAC;YACF,IAAI,uBAAuB;gBAAE,OAAO,eAAe,CAAC;SACvD;QAAC,MAAM;YACJ,kDAAkD;SACrD;KACJ;IAED,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,GAAG,WAAW,CAAC;IAEnD,IAAI,SAAS,GAAG,IAAI,CAAC;IACrB,IAAI,YAAY,EAAE;QACd,SAAS,GAAG,MAAM,YAAY,EAAE,CAAC;KACpC;SAAM;QACH,MAAM,QAAQ,GAAG,MAAM,qBAAqB,CAAC,YAAY,CAAC,CAAC;QAC3D,SAAS,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;KACrC;IAED,kDAAkD;IAClD,MAAM,iBAAiB,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IAEhD,eAAe,GAAG,SAAS,CAAC;IAC5B,OAAO,SAAS,CAAC;AACrB,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,KAAK,EAC3B,WAAwB,EACxB,SAAiB,EACjB,aAAuB,EACP,EAAE;IAClB,IAAI;QACA,MAAM,YAAY,GAAG,MAAM,kBAAkB,CAAC,WAAW,CAAC,eAAe,EAAE,SAAS,CAAC,CAAC;QACtF,IAAI,YAAY;YAAE,OAAO,IAAI,CAAC;KACjC;IAAC,MAAM;QACJ,OAAO,KAAK,CAAC;KAChB;IAED,IAAI,eAAe,IAAI,eAAe,KAAK,SAAS,EAAE;QAClD,IAAI,CAAC,WAAW,CAAC,mBAAmB,IAAI,CAAC,aAAa,EAAE;YACpD,oCAAoC;YACpC,KAAK,CAAC,mBAAmB,CAAC,CAAC;SAC9B;QACD,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;KACxC;SAAM;QACH,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;KACtC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAS,EAAE;IAC3C,eAAe,GAAG,IAAI,CAAC;AAC3B,CAAC,CAAC"}
|
package/package.json
CHANGED
package/src/authToken.ts
CHANGED
|
@@ -12,7 +12,11 @@ let cachedAuthToken: string | null = null;
|
|
|
12
12
|
export const getAuthenticationToken = async (embedConfig: EmbedConfig): Promise<string> => {
|
|
13
13
|
if (cachedAuthToken) {
|
|
14
14
|
try {
|
|
15
|
-
const isCachedTokenStillValid = await validateAuthToken(
|
|
15
|
+
const isCachedTokenStillValid = await validateAuthToken(
|
|
16
|
+
embedConfig,
|
|
17
|
+
cachedAuthToken,
|
|
18
|
+
true,
|
|
19
|
+
);
|
|
16
20
|
if (isCachedTokenStillValid) return cachedAuthToken;
|
|
17
21
|
} catch {
|
|
18
22
|
// Continue to get a new token if validation fails
|
|
@@ -36,7 +40,11 @@ export const getAuthenticationToken = async (embedConfig: EmbedConfig): Promise<
|
|
|
36
40
|
return authToken;
|
|
37
41
|
};
|
|
38
42
|
|
|
39
|
-
const validateAuthToken = async (
|
|
43
|
+
const validateAuthToken = async (
|
|
44
|
+
embedConfig: EmbedConfig,
|
|
45
|
+
authToken: string,
|
|
46
|
+
suppressAlert?: boolean,
|
|
47
|
+
): Promise<boolean> => {
|
|
40
48
|
try {
|
|
41
49
|
const isTokenValid = await verifyTokenService(embedConfig.thoughtSpotHost, authToken);
|
|
42
50
|
if (isTokenValid) return true;
|
|
@@ -45,7 +53,7 @@ const validateAuthToken = async (embedConfig: EmbedConfig, authToken: string): P
|
|
|
45
53
|
}
|
|
46
54
|
|
|
47
55
|
if (cachedAuthToken && cachedAuthToken === authToken) {
|
|
48
|
-
if (!embedConfig.suppressErrorAlerts) {
|
|
56
|
+
if (!embedConfig.suppressErrorAlerts && !suppressAlert) {
|
|
49
57
|
// eslint-disable-next-line no-alert
|
|
50
58
|
alert(DUPLICATE_TOKEN_ERR);
|
|
51
59
|
}
|