@thoughtspot/visual-embed-sdk 1.11.0-auth.1 → 1.11.0-auth.4
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/dist/tsembed.es.js +9 -6
- package/dist/tsembed.js +9 -6
- package/lib/package.json +1 -1
- package/lib/src/auth.js +1 -1
- package/lib/src/auth.js.map +1 -1
- package/lib/src/utils/authService.js +7 -4
- package/lib/src/utils/authService.js.map +1 -1
- package/package.json +1 -1
- package/src/auth.ts +1 -1
- package/src/utils/authService.ts +8 -4
package/dist/tsembed.es.js
CHANGED
|
@@ -8687,7 +8687,7 @@ function initMixpanel(sessionInfo) {
|
|
|
8687
8687
|
}
|
|
8688
8688
|
|
|
8689
8689
|
// eslint-disable-next-line import/no-cycle
|
|
8690
|
-
function
|
|
8690
|
+
function failureLoggedFetch(url, options = {}) {
|
|
8691
8691
|
return fetch(url, options).then(async (r) => {
|
|
8692
8692
|
if (!r.ok) {
|
|
8693
8693
|
console.error('Failure', await r.json());
|
|
@@ -8696,7 +8696,7 @@ function errorLoggedFetch(url, options = {}) {
|
|
|
8696
8696
|
});
|
|
8697
8697
|
}
|
|
8698
8698
|
function fetchSessionInfoService(authVerificationUrl) {
|
|
8699
|
-
return
|
|
8699
|
+
return failureLoggedFetch(authVerificationUrl, {
|
|
8700
8700
|
credentials: 'include',
|
|
8701
8701
|
});
|
|
8702
8702
|
}
|
|
@@ -8704,10 +8704,13 @@ async function fetchAuthTokenService(authEndpoint) {
|
|
|
8704
8704
|
return fetch(authEndpoint);
|
|
8705
8705
|
}
|
|
8706
8706
|
async function fetchAuthService(thoughtSpotHost, username, authToken) {
|
|
8707
|
-
return
|
|
8707
|
+
return failureLoggedFetch(`${thoughtSpotHost}${EndPoints.TOKEN_LOGIN}?username=${username}&auth_token=${authToken}`, {
|
|
8708
|
+
credentials: 'include',
|
|
8709
|
+
redirect: 'manual',
|
|
8710
|
+
});
|
|
8708
8711
|
}
|
|
8709
8712
|
async function fetchBasicAuthService(thoughtSpotHost, username, password) {
|
|
8710
|
-
return
|
|
8713
|
+
return failureLoggedFetch(`${thoughtSpotHost}${EndPoints.BASIC_LOGIN}`, {
|
|
8711
8714
|
method: 'POST',
|
|
8712
8715
|
headers: {
|
|
8713
8716
|
'content-type': 'application/x-www-form-urlencoded',
|
|
@@ -8789,7 +8792,7 @@ const doTokenAuth = async (embedConfig) => {
|
|
|
8789
8792
|
authToken = await response.text();
|
|
8790
8793
|
}
|
|
8791
8794
|
const resp = await fetchAuthService(thoughtSpotHost, username, authToken);
|
|
8792
|
-
loggedInStatus = resp.
|
|
8795
|
+
loggedInStatus = resp.ok;
|
|
8793
8796
|
}
|
|
8794
8797
|
else {
|
|
8795
8798
|
loggedInStatus = true;
|
|
@@ -9102,7 +9105,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
|
9102
9105
|
}
|
|
9103
9106
|
}
|
|
9104
9107
|
|
|
9105
|
-
var name="@thoughtspot/visual-embed-sdk";var version="1.11.0-auth.
|
|
9108
|
+
var name="@thoughtspot/visual-embed-sdk";var version="1.11.0-auth.4";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/**"];var exports={".":"./lib/src/index.js","./react":"./lib/src/react/index.js"};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false",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":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts",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","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs && npx istanbul-merge --out ./coverage/coverage.json ./coverage/docs/coverage-final.json ./coverage/sdk/coverage-final.json && npx istanbul report --include ./coverage/coverage.json --dir ./coverage lcov",posttest:"cat ./coverage/sdk/lcov.info | coveralls",prepublishOnly:"npm run test; npm run tsc; npm run bundle-dts; npm run build","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","mixpanel-browser":"^2.41.0"};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","@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","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.1.0","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":"4.1.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-puppeteer":"^4.4.0",jsdom:"^17.0.0","node-sass":"^4.0.0",prettier:"2.1.2",puppeteer:"^7.0.1",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-neo-theme":"^1.1.0","typedoc-plugin-toc-group":"0.0.5",typescript:"^4.1.0","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,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};
|
|
9106
9109
|
|
|
9107
9110
|
/**
|
|
9108
9111
|
* Copyright (c) 2022
|
package/dist/tsembed.js
CHANGED
|
@@ -8656,7 +8656,7 @@
|
|
|
8656
8656
|
}
|
|
8657
8657
|
|
|
8658
8658
|
// eslint-disable-next-line import/no-cycle
|
|
8659
|
-
function
|
|
8659
|
+
function failureLoggedFetch(url, options = {}) {
|
|
8660
8660
|
return fetch(url, options).then(async (r) => {
|
|
8661
8661
|
if (!r.ok) {
|
|
8662
8662
|
console.error('Failure', await r.json());
|
|
@@ -8665,7 +8665,7 @@
|
|
|
8665
8665
|
});
|
|
8666
8666
|
}
|
|
8667
8667
|
function fetchSessionInfoService(authVerificationUrl) {
|
|
8668
|
-
return
|
|
8668
|
+
return failureLoggedFetch(authVerificationUrl, {
|
|
8669
8669
|
credentials: 'include',
|
|
8670
8670
|
});
|
|
8671
8671
|
}
|
|
@@ -8673,10 +8673,13 @@
|
|
|
8673
8673
|
return fetch(authEndpoint);
|
|
8674
8674
|
}
|
|
8675
8675
|
async function fetchAuthService(thoughtSpotHost, username, authToken) {
|
|
8676
|
-
return
|
|
8676
|
+
return failureLoggedFetch(`${thoughtSpotHost}${EndPoints.TOKEN_LOGIN}?username=${username}&auth_token=${authToken}`, {
|
|
8677
|
+
credentials: 'include',
|
|
8678
|
+
redirect: 'manual',
|
|
8679
|
+
});
|
|
8677
8680
|
}
|
|
8678
8681
|
async function fetchBasicAuthService(thoughtSpotHost, username, password) {
|
|
8679
|
-
return
|
|
8682
|
+
return failureLoggedFetch(`${thoughtSpotHost}${EndPoints.BASIC_LOGIN}`, {
|
|
8680
8683
|
method: 'POST',
|
|
8681
8684
|
headers: {
|
|
8682
8685
|
'content-type': 'application/x-www-form-urlencoded',
|
|
@@ -8758,7 +8761,7 @@
|
|
|
8758
8761
|
authToken = await response.text();
|
|
8759
8762
|
}
|
|
8760
8763
|
const resp = await fetchAuthService(thoughtSpotHost, username, authToken);
|
|
8761
|
-
loggedInStatus = resp.
|
|
8764
|
+
loggedInStatus = resp.ok;
|
|
8762
8765
|
}
|
|
8763
8766
|
else {
|
|
8764
8767
|
loggedInStatus = true;
|
|
@@ -9071,7 +9074,7 @@
|
|
|
9071
9074
|
}
|
|
9072
9075
|
}
|
|
9073
9076
|
|
|
9074
|
-
var name="@thoughtspot/visual-embed-sdk";var version="1.11.0-auth.
|
|
9077
|
+
var name="@thoughtspot/visual-embed-sdk";var version="1.11.0-auth.4";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/**"];var exports$1={".":"./lib/src/index.js","./react":"./lib/src/react/index.js"};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false",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":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts",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","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs && npx istanbul-merge --out ./coverage/coverage.json ./coverage/docs/coverage-final.json ./coverage/sdk/coverage-final.json && npx istanbul report --include ./coverage/coverage.json --dir ./coverage lcov",posttest:"cat ./coverage/sdk/lcov.info | coveralls",prepublishOnly:"npm run test; npm run tsc; npm run bundle-dts; npm run build","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","mixpanel-browser":"^2.41.0"};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","@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","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.1.0","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":"4.1.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-puppeteer":"^4.4.0",jsdom:"^17.0.0","node-sass":"^4.0.0",prettier:"2.1.2",puppeteer:"^7.0.1",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-neo-theme":"^1.1.0","typedoc-plugin-toc-group":"0.0.5",typescript:"^4.1.0","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,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};
|
|
9075
9078
|
|
|
9076
9079
|
/**
|
|
9077
9080
|
* Copyright (c) 2022
|
package/lib/package.json
CHANGED
package/lib/src/auth.js
CHANGED
|
@@ -80,7 +80,7 @@ export const doTokenAuth = async (embedConfig) => {
|
|
|
80
80
|
authToken = await response.text();
|
|
81
81
|
}
|
|
82
82
|
const resp = await fetchAuthService(thoughtSpotHost, username, authToken);
|
|
83
|
-
loggedInStatus = resp.
|
|
83
|
+
loggedInStatus = resp.ok;
|
|
84
84
|
}
|
|
85
85
|
else {
|
|
86
86
|
loggedInStatus = true;
|
package/lib/src/auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAe,UAAU,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,2CAA2C;AAC3C,OAAO,EACH,uBAAuB,EACvB,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,GACxB,MAAM,qBAAqB,CAAC;AAE7B,qDAAqD;AACrD,MAAM,CAAC,IAAI,cAAc,GAAG,KAAK,CAAC;AAClC,qDAAqD;AACrD,MAAM,C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Points } from '../auth';
|
|
3
|
-
function
|
|
3
|
+
function failureLoggedFetch(url, options = {}) {
|
|
4
4
|
return fetch(url, options).then(async (r) => {
|
|
5
5
|
if (!r.ok) {
|
|
6
6
|
console.error('Failure', await r.json());
|
|
@@ -9,7 +9,7 @@ function errorLoggedFetch(url, options = {}) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
export function fetchSessionInfoService(authVerificationUrl) {
|
|
12
|
-
return
|
|
12
|
+
return failureLoggedFetch(authVerificationUrl, {
|
|
13
13
|
credentials: 'include',
|
|
14
14
|
});
|
|
15
15
|
}
|
|
@@ -17,10 +17,13 @@ export async function fetchAuthTokenService(authEndpoint) {
|
|
|
17
17
|
return fetch(authEndpoint);
|
|
18
18
|
}
|
|
19
19
|
export async function fetchAuthService(thoughtSpotHost, username, authToken) {
|
|
20
|
-
return
|
|
20
|
+
return failureLoggedFetch(`${thoughtSpotHost}${EndPoints.TOKEN_LOGIN}?username=${username}&auth_token=${authToken}`, {
|
|
21
|
+
credentials: 'include',
|
|
22
|
+
redirect: 'manual',
|
|
23
|
+
});
|
|
21
24
|
}
|
|
22
25
|
export async function fetchBasicAuthService(thoughtSpotHost, username, password) {
|
|
23
|
-
return
|
|
26
|
+
return failureLoggedFetch(`${thoughtSpotHost}${EndPoints.BASIC_LOGIN}`, {
|
|
24
27
|
method: 'POST',
|
|
25
28
|
headers: {
|
|
26
29
|
'content-type': 'application/x-www-form-urlencoded',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authService.js","sourceRoot":"","sources":["../../../src/utils/authService.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,SAAS,
|
|
1
|
+
{"version":3,"file":"authService.js","sourceRoot":"","sources":["../../../src/utils/authService.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,SAA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
CHANGED
package/src/auth.ts
CHANGED
package/src/utils/authService.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// eslint-disable-next-line import/no-cycle
|
|
2
2
|
import { EndPoints } from '../auth';
|
|
3
3
|
|
|
4
|
-
function
|
|
4
|
+
function failureLoggedFetch(
|
|
5
5
|
url: string,
|
|
6
6
|
options: RequestInit = {},
|
|
7
7
|
): Promise<Response> {
|
|
@@ -16,7 +16,7 @@ function errorLoggedFetch(
|
|
|
16
16
|
export function fetchSessionInfoService(
|
|
17
17
|
authVerificationUrl: string,
|
|
18
18
|
): Promise<any> {
|
|
19
|
-
return
|
|
19
|
+
return failureLoggedFetch(authVerificationUrl, {
|
|
20
20
|
credentials: 'include',
|
|
21
21
|
});
|
|
22
22
|
}
|
|
@@ -32,8 +32,12 @@ export async function fetchAuthService(
|
|
|
32
32
|
username: string,
|
|
33
33
|
authToken: string,
|
|
34
34
|
): Promise<any> {
|
|
35
|
-
return
|
|
35
|
+
return failureLoggedFetch(
|
|
36
36
|
`${thoughtSpotHost}${EndPoints.TOKEN_LOGIN}?username=${username}&auth_token=${authToken}`,
|
|
37
|
+
{
|
|
38
|
+
credentials: 'include',
|
|
39
|
+
redirect: 'manual',
|
|
40
|
+
},
|
|
37
41
|
);
|
|
38
42
|
}
|
|
39
43
|
|
|
@@ -42,7 +46,7 @@ export async function fetchBasicAuthService(
|
|
|
42
46
|
username: string,
|
|
43
47
|
password: string,
|
|
44
48
|
): Promise<any> {
|
|
45
|
-
return
|
|
49
|
+
return failureLoggedFetch(`${thoughtSpotHost}${EndPoints.BASIC_LOGIN}`, {
|
|
46
50
|
method: 'POST',
|
|
47
51
|
headers: {
|
|
48
52
|
'content-type': 'application/x-www-form-urlencoded',
|