@thoughtspot/visual-embed-sdk 1.11.0-auth.1 → 1.11.0-auth.2
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
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,14 @@ 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
|
+
}).catch((e) => {
|
|
8710
|
+
console.error(e);
|
|
8711
|
+
});
|
|
8708
8712
|
}
|
|
8709
8713
|
async function fetchBasicAuthService(thoughtSpotHost, username, password) {
|
|
8710
|
-
return
|
|
8714
|
+
return failureLoggedFetch(`${thoughtSpotHost}${EndPoints.BASIC_LOGIN}`, {
|
|
8711
8715
|
method: 'POST',
|
|
8712
8716
|
headers: {
|
|
8713
8717
|
'content-type': 'application/x-www-form-urlencoded',
|
|
@@ -9102,7 +9106,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
|
9102
9106
|
}
|
|
9103
9107
|
}
|
|
9104
9108
|
|
|
9105
|
-
var name="@thoughtspot/visual-embed-sdk";var version="1.11.0-auth.
|
|
9109
|
+
var name="@thoughtspot/visual-embed-sdk";var version="1.11.0-auth.2";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
9110
|
|
|
9107
9111
|
/**
|
|
9108
9112
|
* 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,14 @@
|
|
|
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
|
+
}).catch((e) => {
|
|
8679
|
+
console.error(e);
|
|
8680
|
+
});
|
|
8677
8681
|
}
|
|
8678
8682
|
async function fetchBasicAuthService(thoughtSpotHost, username, password) {
|
|
8679
|
-
return
|
|
8683
|
+
return failureLoggedFetch(`${thoughtSpotHost}${EndPoints.BASIC_LOGIN}`, {
|
|
8680
8684
|
method: 'POST',
|
|
8681
8685
|
headers: {
|
|
8682
8686
|
'content-type': 'application/x-www-form-urlencoded',
|
|
@@ -9071,7 +9075,7 @@
|
|
|
9071
9075
|
}
|
|
9072
9076
|
}
|
|
9073
9077
|
|
|
9074
|
-
var name="@thoughtspot/visual-embed-sdk";var version="1.11.0-auth.
|
|
9078
|
+
var name="@thoughtspot/visual-embed-sdk";var version="1.11.0-auth.2";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
9079
|
|
|
9076
9080
|
/**
|
|
9077
9081
|
* Copyright (c) 2022
|
package/lib/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// eslint-disable-next-line import/no-cycle
|
|
2
2
|
import { EndPoints } 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,14 @@ 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
|
+
}).catch((e) => {
|
|
23
|
+
console.error(e);
|
|
24
|
+
});
|
|
21
25
|
}
|
|
22
26
|
export async function fetchBasicAuthService(thoughtSpotHost, username, password) {
|
|
23
|
-
return
|
|
27
|
+
return failureLoggedFetch(`${thoughtSpotHost}${EndPoints.BASIC_LOGIN}`, {
|
|
24
28
|
method: 'POST',
|
|
25
29
|
headers: {
|
|
26
30
|
'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,SAAS,kBAAkB,CACvB,GAAW,EACX,UAAuB,EAAE;IAEzB,OAAO,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,KAA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|
@@ -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,9 +32,14 @@ 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
|
-
|
|
37
|
+
{
|
|
38
|
+
credentials: 'include',
|
|
39
|
+
},
|
|
40
|
+
).catch((e) => {
|
|
41
|
+
console.error(e);
|
|
42
|
+
});
|
|
38
43
|
}
|
|
39
44
|
|
|
40
45
|
export async function fetchBasicAuthService(
|
|
@@ -42,7 +47,7 @@ export async function fetchBasicAuthService(
|
|
|
42
47
|
username: string,
|
|
43
48
|
password: string,
|
|
44
49
|
): Promise<any> {
|
|
45
|
-
return
|
|
50
|
+
return failureLoggedFetch(`${thoughtSpotHost}${EndPoints.BASIC_LOGIN}`, {
|
|
46
51
|
method: 'POST',
|
|
47
52
|
headers: {
|
|
48
53
|
'content-type': 'application/x-www-form-urlencoded',
|