@thoughtspot/visual-embed-sdk 1.11.0-alpha.0 → 1.11.0-auth.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/auth.d.ts +5 -5
- package/dist/src/embed/base.d.ts +4 -4
- package/dist/src/embed/pinboard.d.ts +91 -0
- package/dist/src/utils/plugin.d.ts +0 -0
- package/dist/src/v1/api.d.ts +19 -0
- package/dist/tsembed.es.js +30 -10
- package/dist/tsembed.js +30 -10
- package/lib/package.json +1 -1
- package/lib/src/auth.d.ts +5 -5
- package/lib/src/auth.js +13 -5
- package/lib/src/auth.js.map +1 -1
- package/lib/src/auth.spec.js +7 -3
- package/lib/src/auth.spec.js.map +1 -1
- package/lib/src/embed/base.d.ts +4 -4
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/pinboard.d.ts +91 -0
- package/lib/src/embed/pinboard.js +110 -0
- package/lib/src/embed/pinboard.js.map +1 -0
- package/lib/src/embed/ts-embed.js +5 -1
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/utils/authService.js +11 -3
- package/lib/src/utils/authService.js.map +1 -1
- package/lib/src/utils/authService.spec.js +4 -2
- package/lib/src/utils/authService.spec.js.map +1 -1
- package/lib/src/utils/plugin.d.ts +0 -0
- package/lib/src/utils/plugin.js +1 -0
- package/lib/src/utils/plugin.js.map +1 -0
- package/lib/src/visual-embed-sdk.d.ts +4 -4
- package/package.json +1 -1
- package/src/auth.spec.ts +11 -3
- package/src/auth.ts +24 -10
- package/src/embed/base.ts +4 -4
- package/src/embed/ts-embed.ts +6 -1
- package/src/utils/authService.spec.ts +8 -2
- package/src/utils/authService.ts +15 -3
package/dist/src/auth.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export declare function initSession(sessionDetails: any): void;
|
|
|
20
20
|
* Perform token based authentication
|
|
21
21
|
* @param embedConfig The embed configuration
|
|
22
22
|
*/
|
|
23
|
-
export declare const doTokenAuth: (embedConfig: EmbedConfig) => Promise<
|
|
23
|
+
export declare const doTokenAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
24
24
|
/**
|
|
25
25
|
* Perform basic authentication to the ThoughtSpot cluster using the cluster
|
|
26
26
|
* credentials.
|
|
@@ -29,14 +29,14 @@ export declare const doTokenAuth: (embedConfig: EmbedConfig) => Promise<void>;
|
|
|
29
29
|
* strongly advised not to use this authentication method in production.
|
|
30
30
|
* @param embedConfig The embed configuration
|
|
31
31
|
*/
|
|
32
|
-
export declare const doBasicAuth: (embedConfig: EmbedConfig) => Promise<
|
|
33
|
-
export declare const doSamlAuth: (embedConfig: EmbedConfig) => Promise<
|
|
34
|
-
export declare const doOIDCAuth: (embedConfig: EmbedConfig) => Promise<
|
|
32
|
+
export declare const doBasicAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
33
|
+
export declare const doSamlAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
34
|
+
export declare const doOIDCAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
35
35
|
/**
|
|
36
36
|
* Perform authentication on the ThoughtSpot cluster
|
|
37
37
|
* @param embedConfig The embed configuration
|
|
38
38
|
*/
|
|
39
|
-
export declare const authenticate: (embedConfig: EmbedConfig) => Promise<
|
|
39
|
+
export declare const authenticate: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
40
40
|
/**
|
|
41
41
|
* Check if we are authenticated to the ThoughtSpot cluster
|
|
42
42
|
*/
|
package/dist/src/embed/base.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { EmbedConfig } from '../types';
|
|
2
|
-
export declare let authPromise: Promise<
|
|
2
|
+
export declare let authPromise: Promise<boolean>;
|
|
3
3
|
/**
|
|
4
4
|
* Perform authentication on the ThoughtSpot app as applicable.
|
|
5
5
|
*/
|
|
6
|
-
export declare const handleAuth: () => Promise<
|
|
6
|
+
export declare const handleAuth: () => Promise<boolean>;
|
|
7
7
|
export declare const getEmbedConfig: () => EmbedConfig;
|
|
8
|
-
export declare const getAuthPromise: () => Promise<
|
|
8
|
+
export declare const getAuthPromise: () => Promise<boolean>;
|
|
9
9
|
/**
|
|
10
10
|
* Prefetches static resources from the specified URL. Web browsers can then cache the prefetched resources and serve them from the user's local disk to provide faster access to your app.
|
|
11
11
|
* @param url The URL provided for prefetch
|
|
@@ -19,7 +19,7 @@ export declare const prefetch: (url?: string) => void;
|
|
|
19
19
|
*
|
|
20
20
|
* @returns authPromise Promise which resolves when authentication is complete.
|
|
21
21
|
*/
|
|
22
|
-
export declare const init: (embedConfig: EmbedConfig) => Promise<
|
|
22
|
+
export declare const init: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
23
23
|
/**
|
|
24
24
|
* Renders functions in a queue, resolves to next function only after the callback next is called
|
|
25
25
|
* @param fn The function being registered
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2021
|
|
3
|
+
*
|
|
4
|
+
* Embed a ThoughtSpot pinboard or visualization
|
|
5
|
+
* https://developers.thoughtspot.com/docs/?pageid=embed-pinboard
|
|
6
|
+
* https://developers.thoughtspot.com/docs/?pageid=embed-a-viz
|
|
7
|
+
*
|
|
8
|
+
* @summary Pinboard & visualization embed
|
|
9
|
+
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
10
|
+
*/
|
|
11
|
+
import { DOMSelector } from '../types';
|
|
12
|
+
import { V1Embed, ViewConfig } from './ts-embed';
|
|
13
|
+
/**
|
|
14
|
+
* The configuration for the embedded pinboard or visualization page view.
|
|
15
|
+
* @Category Pinboards and Charts
|
|
16
|
+
*/
|
|
17
|
+
export interface PinboardViewConfig extends ViewConfig {
|
|
18
|
+
/**
|
|
19
|
+
* If set to true, the embedded object container dynamically resizes
|
|
20
|
+
* according to the height of the pinboard.
|
|
21
|
+
*/
|
|
22
|
+
fullHeight?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* This is the minimum height(in pixels) for a full height pinboard.
|
|
25
|
+
* Setting this height helps resolves issues with empty pinboards and
|
|
26
|
+
* other screens navigable from a pinboard.
|
|
27
|
+
* @default 500
|
|
28
|
+
* * _since 1.5.0_
|
|
29
|
+
*/
|
|
30
|
+
defaultHeight?: number;
|
|
31
|
+
/**
|
|
32
|
+
* If set to true, the context menu in visualizations will be enabled.
|
|
33
|
+
*/
|
|
34
|
+
enableVizTransformations?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* The pinboard to display in the embedded view.
|
|
37
|
+
*/
|
|
38
|
+
pinboardId: string;
|
|
39
|
+
/**
|
|
40
|
+
* The visualization within the pinboard to display.
|
|
41
|
+
*/
|
|
42
|
+
vizId?: string;
|
|
43
|
+
/**
|
|
44
|
+
* If set to true, all filter chips from a
|
|
45
|
+
* pinboard page will be read-only (no X buttons)
|
|
46
|
+
*/
|
|
47
|
+
preventPinboardFilterRemoval?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* An array of vizids which should be visible when this pinboard loads.
|
|
50
|
+
* The ids not in this array are hidden from the pinboard.
|
|
51
|
+
* _since: 1.6.0_
|
|
52
|
+
*/
|
|
53
|
+
pinboardVisibleVizs?: string[];
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Embed a ThoughtSpot pinboard or visualization
|
|
57
|
+
* @Category Pinboards and Charts
|
|
58
|
+
*/
|
|
59
|
+
export declare class PinboardEmbed extends V1Embed {
|
|
60
|
+
protected viewConfig: PinboardViewConfig;
|
|
61
|
+
private defaultHeight;
|
|
62
|
+
constructor(domSelector: DOMSelector, viewConfig: PinboardViewConfig);
|
|
63
|
+
/**
|
|
64
|
+
* Construct a map of params to be passed on to the
|
|
65
|
+
* embedded pinboard or visualization.
|
|
66
|
+
*/
|
|
67
|
+
private getEmbedParams;
|
|
68
|
+
/**
|
|
69
|
+
* Construct the URL of the embedded ThoughtSpot pinboard or visualization
|
|
70
|
+
* to be loaded within the iframe.
|
|
71
|
+
* @param pinboardId The GUID of the pinboard.
|
|
72
|
+
* @param vizId The optional GUID of a visualization within the pinboard.
|
|
73
|
+
* @param runtimeFilters A list of runtime filters to be applied to
|
|
74
|
+
* the pinboard or visualization on load.
|
|
75
|
+
*/
|
|
76
|
+
private getIFrameSrc;
|
|
77
|
+
/**
|
|
78
|
+
* Set the iframe height as per the computed height received
|
|
79
|
+
* from the ThoughtSpot app.
|
|
80
|
+
* @param data The event payload
|
|
81
|
+
*/
|
|
82
|
+
private updateIFrameHeight;
|
|
83
|
+
private embedIframeCenter;
|
|
84
|
+
private handleRouteChangeFullHeightPinboard;
|
|
85
|
+
/**
|
|
86
|
+
* Render an embedded ThoughtSpot pinboard or visualization
|
|
87
|
+
* @param renderOptions An object specifying the pinboard ID,
|
|
88
|
+
* visualization ID and the runtime filters.
|
|
89
|
+
*/
|
|
90
|
+
render(): PinboardEmbed;
|
|
91
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright: ThoughtSpot Inc. 2012-2016
|
|
3
|
+
* Author: Shashank Singh (sunny@thoughtspot.com)
|
|
4
|
+
*
|
|
5
|
+
* @fileoverview ThoughtSpot Javascript API for use of ThoughtSpot in external webpages.
|
|
6
|
+
*/
|
|
7
|
+
import { AuthType } from '../types';
|
|
8
|
+
export declare enum Events {
|
|
9
|
+
THOUGHTSPOT_AUTH_EXPIRED = "ThoughtspotAuthExpired",
|
|
10
|
+
EXPORT_VIZ_DATA_TO_PARENT = "exportVizDataToParent",
|
|
11
|
+
ALERT = "alert",
|
|
12
|
+
EXPORT_VIZ_DATA_TO_CHILD = "exportVizDataToChild",
|
|
13
|
+
GET_DATA = "getData"
|
|
14
|
+
}
|
|
15
|
+
declare type Callback = (...args: any[]) => void;
|
|
16
|
+
declare function checkIfLoggedIn(tsHost: string, callback: Callback): void;
|
|
17
|
+
declare function initialize(onInitialized: Callback, onAuthExpiration: Callback, _thoughtspotHost: string, authType: AuthType): void;
|
|
18
|
+
declare function notifyOnAuthExpiration(): void;
|
|
19
|
+
export { initialize, checkIfLoggedIn, notifyOnAuthExpiration };
|
package/dist/tsembed.es.js
CHANGED
|
@@ -8687,8 +8687,16 @@ function initMixpanel(sessionInfo) {
|
|
|
8687
8687
|
}
|
|
8688
8688
|
|
|
8689
8689
|
// eslint-disable-next-line import/no-cycle
|
|
8690
|
+
function errorLoggedFetch(url, options) {
|
|
8691
|
+
return fetch(url, options).then(async (r) => {
|
|
8692
|
+
if (!r.ok) {
|
|
8693
|
+
console.error('Failure', await r.json());
|
|
8694
|
+
}
|
|
8695
|
+
return r;
|
|
8696
|
+
});
|
|
8697
|
+
}
|
|
8690
8698
|
function fetchSessionInfoService(authVerificationUrl) {
|
|
8691
|
-
return
|
|
8699
|
+
return errorLoggedFetch(authVerificationUrl, {
|
|
8692
8700
|
credentials: 'include',
|
|
8693
8701
|
});
|
|
8694
8702
|
}
|
|
@@ -8696,12 +8704,12 @@ async function fetchAuthTokenService(authEndpoint) {
|
|
|
8696
8704
|
return fetch(authEndpoint);
|
|
8697
8705
|
}
|
|
8698
8706
|
async function fetchAuthService(thoughtSpotHost, username, authToken) {
|
|
8699
|
-
return
|
|
8707
|
+
return errorLoggedFetch(`${thoughtSpotHost}${EndPoints.TOKEN_LOGIN}?username=${username}&auth_token=${authToken}`, {
|
|
8700
8708
|
credentials: 'include',
|
|
8701
8709
|
});
|
|
8702
8710
|
}
|
|
8703
8711
|
async function fetchBasicAuthService(thoughtSpotHost, username, password) {
|
|
8704
|
-
return
|
|
8712
|
+
return errorLoggedFetch(`${thoughtSpotHost}${EndPoints.BASIC_LOGIN}`, {
|
|
8705
8713
|
method: 'POST',
|
|
8706
8714
|
headers: {
|
|
8707
8715
|
'content-type': 'application/x-www-form-urlencoded',
|
|
@@ -8782,10 +8790,13 @@ const doTokenAuth = async (embedConfig) => {
|
|
|
8782
8790
|
const response = await fetchAuthTokenService(authEndpoint);
|
|
8783
8791
|
authToken = await response.text();
|
|
8784
8792
|
}
|
|
8785
|
-
await fetchAuthService(thoughtSpotHost, username, authToken);
|
|
8786
|
-
loggedInStatus =
|
|
8793
|
+
const resp = await fetchAuthService(thoughtSpotHost, username, authToken);
|
|
8794
|
+
loggedInStatus = resp.status === 200;
|
|
8787
8795
|
}
|
|
8788
|
-
|
|
8796
|
+
else {
|
|
8797
|
+
loggedInStatus = true;
|
|
8798
|
+
}
|
|
8799
|
+
return loggedInStatus;
|
|
8789
8800
|
};
|
|
8790
8801
|
/**
|
|
8791
8802
|
* Perform basic authentication to the ThoughtSpot cluster using the cluster
|
|
@@ -8802,7 +8813,10 @@ const doBasicAuth = async (embedConfig) => {
|
|
|
8802
8813
|
const response = await fetchBasicAuthService(thoughtSpotHost, username, password);
|
|
8803
8814
|
loggedInStatus = response.status === 200;
|
|
8804
8815
|
}
|
|
8805
|
-
|
|
8816
|
+
else {
|
|
8817
|
+
loggedInStatus = true;
|
|
8818
|
+
}
|
|
8819
|
+
return loggedInStatus;
|
|
8806
8820
|
};
|
|
8807
8821
|
async function samlPopupFlow(ssoURL) {
|
|
8808
8822
|
document.body.insertAdjacentHTML('beforeend', '<div id="ts-saml-auth"></div>');
|
|
@@ -8866,6 +8880,7 @@ const doSamlAuth = async (embedConfig) => {
|
|
|
8866
8880
|
// bring back the page to the same URL
|
|
8867
8881
|
const ssoEndPoint = `${EndPoints.SAML_LOGIN_TEMPLATE(encodeURIComponent(ssoRedirectUrl))}`;
|
|
8868
8882
|
await doSSOAuth(embedConfig, ssoEndPoint);
|
|
8883
|
+
return loggedInStatus;
|
|
8869
8884
|
};
|
|
8870
8885
|
const doOIDCAuth = async (embedConfig) => {
|
|
8871
8886
|
const { thoughtSpotHost } = embedConfig;
|
|
@@ -8877,6 +8892,7 @@ const doOIDCAuth = async (embedConfig) => {
|
|
|
8877
8892
|
// bring back the page to the same URL
|
|
8878
8893
|
const ssoEndPoint = `${EndPoints.OIDC_LOGIN_TEMPLATE(encodeURIComponent(ssoRedirectUrl))}`;
|
|
8879
8894
|
await doSSOAuth(embedConfig, ssoEndPoint);
|
|
8895
|
+
return loggedInStatus;
|
|
8880
8896
|
};
|
|
8881
8897
|
/**
|
|
8882
8898
|
* Perform authentication on the ThoughtSpot cluster
|
|
@@ -8894,7 +8910,7 @@ const authenticate = async (embedConfig) => {
|
|
|
8894
8910
|
case AuthType.Basic:
|
|
8895
8911
|
return doBasicAuth(embedConfig);
|
|
8896
8912
|
default:
|
|
8897
|
-
return Promise.resolve();
|
|
8913
|
+
return Promise.resolve(true);
|
|
8898
8914
|
}
|
|
8899
8915
|
};
|
|
8900
8916
|
|
|
@@ -9088,7 +9104,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
|
9088
9104
|
}
|
|
9089
9105
|
}
|
|
9090
9106
|
|
|
9091
|
-
var name="@thoughtspot/visual-embed-sdk";var version="1.11.0-
|
|
9107
|
+
var name="@thoughtspot/visual-embed-sdk";var version="1.11.0-auth.0";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**"];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};
|
|
9092
9108
|
|
|
9093
9109
|
/**
|
|
9094
9110
|
* Copyright (c) 2022
|
|
@@ -9336,7 +9352,11 @@ class TsEmbed {
|
|
|
9336
9352
|
type: EmbedEvent.Init,
|
|
9337
9353
|
});
|
|
9338
9354
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_START);
|
|
9339
|
-
(_a = getAuthPromise()) === null || _a === void 0 ? void 0 : _a.then(() => {
|
|
9355
|
+
(_a = getAuthPromise()) === null || _a === void 0 ? void 0 : _a.then((isLoggedIn) => {
|
|
9356
|
+
if (!isLoggedIn) {
|
|
9357
|
+
this.el.innerHTML = 'Login failed';
|
|
9358
|
+
return;
|
|
9359
|
+
}
|
|
9340
9360
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_COMPLETE);
|
|
9341
9361
|
this.iFrame =
|
|
9342
9362
|
this.iFrame || document.createElement('iframe');
|
package/dist/tsembed.js
CHANGED
|
@@ -8656,8 +8656,16 @@
|
|
|
8656
8656
|
}
|
|
8657
8657
|
|
|
8658
8658
|
// eslint-disable-next-line import/no-cycle
|
|
8659
|
+
function errorLoggedFetch(url, options) {
|
|
8660
|
+
return fetch(url, options).then(async (r) => {
|
|
8661
|
+
if (!r.ok) {
|
|
8662
|
+
console.error('Failure', await r.json());
|
|
8663
|
+
}
|
|
8664
|
+
return r;
|
|
8665
|
+
});
|
|
8666
|
+
}
|
|
8659
8667
|
function fetchSessionInfoService(authVerificationUrl) {
|
|
8660
|
-
return
|
|
8668
|
+
return errorLoggedFetch(authVerificationUrl, {
|
|
8661
8669
|
credentials: 'include',
|
|
8662
8670
|
});
|
|
8663
8671
|
}
|
|
@@ -8665,12 +8673,12 @@
|
|
|
8665
8673
|
return fetch(authEndpoint);
|
|
8666
8674
|
}
|
|
8667
8675
|
async function fetchAuthService(thoughtSpotHost, username, authToken) {
|
|
8668
|
-
return
|
|
8676
|
+
return errorLoggedFetch(`${thoughtSpotHost}${EndPoints.TOKEN_LOGIN}?username=${username}&auth_token=${authToken}`, {
|
|
8669
8677
|
credentials: 'include',
|
|
8670
8678
|
});
|
|
8671
8679
|
}
|
|
8672
8680
|
async function fetchBasicAuthService(thoughtSpotHost, username, password) {
|
|
8673
|
-
return
|
|
8681
|
+
return errorLoggedFetch(`${thoughtSpotHost}${EndPoints.BASIC_LOGIN}`, {
|
|
8674
8682
|
method: 'POST',
|
|
8675
8683
|
headers: {
|
|
8676
8684
|
'content-type': 'application/x-www-form-urlencoded',
|
|
@@ -8751,10 +8759,13 @@
|
|
|
8751
8759
|
const response = await fetchAuthTokenService(authEndpoint);
|
|
8752
8760
|
authToken = await response.text();
|
|
8753
8761
|
}
|
|
8754
|
-
await fetchAuthService(thoughtSpotHost, username, authToken);
|
|
8755
|
-
loggedInStatus =
|
|
8762
|
+
const resp = await fetchAuthService(thoughtSpotHost, username, authToken);
|
|
8763
|
+
loggedInStatus = resp.status === 200;
|
|
8756
8764
|
}
|
|
8757
|
-
|
|
8765
|
+
else {
|
|
8766
|
+
loggedInStatus = true;
|
|
8767
|
+
}
|
|
8768
|
+
return loggedInStatus;
|
|
8758
8769
|
};
|
|
8759
8770
|
/**
|
|
8760
8771
|
* Perform basic authentication to the ThoughtSpot cluster using the cluster
|
|
@@ -8771,7 +8782,10 @@
|
|
|
8771
8782
|
const response = await fetchBasicAuthService(thoughtSpotHost, username, password);
|
|
8772
8783
|
loggedInStatus = response.status === 200;
|
|
8773
8784
|
}
|
|
8774
|
-
|
|
8785
|
+
else {
|
|
8786
|
+
loggedInStatus = true;
|
|
8787
|
+
}
|
|
8788
|
+
return loggedInStatus;
|
|
8775
8789
|
};
|
|
8776
8790
|
async function samlPopupFlow(ssoURL) {
|
|
8777
8791
|
document.body.insertAdjacentHTML('beforeend', '<div id="ts-saml-auth"></div>');
|
|
@@ -8835,6 +8849,7 @@
|
|
|
8835
8849
|
// bring back the page to the same URL
|
|
8836
8850
|
const ssoEndPoint = `${EndPoints.SAML_LOGIN_TEMPLATE(encodeURIComponent(ssoRedirectUrl))}`;
|
|
8837
8851
|
await doSSOAuth(embedConfig, ssoEndPoint);
|
|
8852
|
+
return loggedInStatus;
|
|
8838
8853
|
};
|
|
8839
8854
|
const doOIDCAuth = async (embedConfig) => {
|
|
8840
8855
|
const { thoughtSpotHost } = embedConfig;
|
|
@@ -8846,6 +8861,7 @@
|
|
|
8846
8861
|
// bring back the page to the same URL
|
|
8847
8862
|
const ssoEndPoint = `${EndPoints.OIDC_LOGIN_TEMPLATE(encodeURIComponent(ssoRedirectUrl))}`;
|
|
8848
8863
|
await doSSOAuth(embedConfig, ssoEndPoint);
|
|
8864
|
+
return loggedInStatus;
|
|
8849
8865
|
};
|
|
8850
8866
|
/**
|
|
8851
8867
|
* Perform authentication on the ThoughtSpot cluster
|
|
@@ -8863,7 +8879,7 @@
|
|
|
8863
8879
|
case exports.AuthType.Basic:
|
|
8864
8880
|
return doBasicAuth(embedConfig);
|
|
8865
8881
|
default:
|
|
8866
|
-
return Promise.resolve();
|
|
8882
|
+
return Promise.resolve(true);
|
|
8867
8883
|
}
|
|
8868
8884
|
};
|
|
8869
8885
|
|
|
@@ -9057,7 +9073,7 @@
|
|
|
9057
9073
|
}
|
|
9058
9074
|
}
|
|
9059
9075
|
|
|
9060
|
-
var name="@thoughtspot/visual-embed-sdk";var version="1.11.0-
|
|
9076
|
+
var name="@thoughtspot/visual-embed-sdk";var version="1.11.0-auth.0";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**"];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};
|
|
9061
9077
|
|
|
9062
9078
|
/**
|
|
9063
9079
|
* Copyright (c) 2022
|
|
@@ -9305,7 +9321,11 @@
|
|
|
9305
9321
|
type: exports.EmbedEvent.Init,
|
|
9306
9322
|
});
|
|
9307
9323
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_START);
|
|
9308
|
-
(_a = getAuthPromise()) === null || _a === void 0 ? void 0 : _a.then(() => {
|
|
9324
|
+
(_a = getAuthPromise()) === null || _a === void 0 ? void 0 : _a.then((isLoggedIn) => {
|
|
9325
|
+
if (!isLoggedIn) {
|
|
9326
|
+
this.el.innerHTML = 'Login failed';
|
|
9327
|
+
return;
|
|
9328
|
+
}
|
|
9309
9329
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_COMPLETE);
|
|
9310
9330
|
this.iFrame =
|
|
9311
9331
|
this.iFrame || document.createElement('iframe');
|
package/lib/package.json
CHANGED
package/lib/src/auth.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export declare function initSession(sessionDetails: any): void;
|
|
|
20
20
|
* Perform token based authentication
|
|
21
21
|
* @param embedConfig The embed configuration
|
|
22
22
|
*/
|
|
23
|
-
export declare const doTokenAuth: (embedConfig: EmbedConfig) => Promise<
|
|
23
|
+
export declare const doTokenAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
24
24
|
/**
|
|
25
25
|
* Perform basic authentication to the ThoughtSpot cluster using the cluster
|
|
26
26
|
* credentials.
|
|
@@ -29,14 +29,14 @@ export declare const doTokenAuth: (embedConfig: EmbedConfig) => Promise<void>;
|
|
|
29
29
|
* strongly advised not to use this authentication method in production.
|
|
30
30
|
* @param embedConfig The embed configuration
|
|
31
31
|
*/
|
|
32
|
-
export declare const doBasicAuth: (embedConfig: EmbedConfig) => Promise<
|
|
33
|
-
export declare const doSamlAuth: (embedConfig: EmbedConfig) => Promise<
|
|
34
|
-
export declare const doOIDCAuth: (embedConfig: EmbedConfig) => Promise<
|
|
32
|
+
export declare const doBasicAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
33
|
+
export declare const doSamlAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
34
|
+
export declare const doOIDCAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
35
35
|
/**
|
|
36
36
|
* Perform authentication on the ThoughtSpot cluster
|
|
37
37
|
* @param embedConfig The embed configuration
|
|
38
38
|
*/
|
|
39
|
-
export declare const authenticate: (embedConfig: EmbedConfig) => Promise<
|
|
39
|
+
export declare const authenticate: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
40
40
|
/**
|
|
41
41
|
* Check if we are authenticated to the ThoughtSpot cluster
|
|
42
42
|
*/
|
package/lib/src/auth.js
CHANGED
|
@@ -79,10 +79,13 @@ export const doTokenAuth = async (embedConfig) => {
|
|
|
79
79
|
const response = await fetchAuthTokenService(authEndpoint);
|
|
80
80
|
authToken = await response.text();
|
|
81
81
|
}
|
|
82
|
-
await fetchAuthService(thoughtSpotHost, username, authToken);
|
|
83
|
-
loggedInStatus =
|
|
82
|
+
const resp = await fetchAuthService(thoughtSpotHost, username, authToken);
|
|
83
|
+
loggedInStatus = resp.status === 200;
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
loggedInStatus = true;
|
|
84
87
|
}
|
|
85
|
-
loggedInStatus
|
|
88
|
+
return loggedInStatus;
|
|
86
89
|
};
|
|
87
90
|
/**
|
|
88
91
|
* Perform basic authentication to the ThoughtSpot cluster using the cluster
|
|
@@ -99,7 +102,10 @@ export const doBasicAuth = async (embedConfig) => {
|
|
|
99
102
|
const response = await fetchBasicAuthService(thoughtSpotHost, username, password);
|
|
100
103
|
loggedInStatus = response.status === 200;
|
|
101
104
|
}
|
|
102
|
-
|
|
105
|
+
else {
|
|
106
|
+
loggedInStatus = true;
|
|
107
|
+
}
|
|
108
|
+
return loggedInStatus;
|
|
103
109
|
};
|
|
104
110
|
async function samlPopupFlow(ssoURL) {
|
|
105
111
|
document.body.insertAdjacentHTML('beforeend', '<div id="ts-saml-auth"></div>');
|
|
@@ -163,6 +169,7 @@ export const doSamlAuth = async (embedConfig) => {
|
|
|
163
169
|
// bring back the page to the same URL
|
|
164
170
|
const ssoEndPoint = `${EndPoints.SAML_LOGIN_TEMPLATE(encodeURIComponent(ssoRedirectUrl))}`;
|
|
165
171
|
await doSSOAuth(embedConfig, ssoEndPoint);
|
|
172
|
+
return loggedInStatus;
|
|
166
173
|
};
|
|
167
174
|
export const doOIDCAuth = async (embedConfig) => {
|
|
168
175
|
const { thoughtSpotHost } = embedConfig;
|
|
@@ -174,6 +181,7 @@ export const doOIDCAuth = async (embedConfig) => {
|
|
|
174
181
|
// bring back the page to the same URL
|
|
175
182
|
const ssoEndPoint = `${EndPoints.OIDC_LOGIN_TEMPLATE(encodeURIComponent(ssoRedirectUrl))}`;
|
|
176
183
|
await doSSOAuth(embedConfig, ssoEndPoint);
|
|
184
|
+
return loggedInStatus;
|
|
177
185
|
};
|
|
178
186
|
/**
|
|
179
187
|
* Perform authentication on the ThoughtSpot cluster
|
|
@@ -191,7 +199,7 @@ export const authenticate = async (embedConfig) => {
|
|
|
191
199
|
case AuthType.Basic:
|
|
192
200
|
return doBasicAuth(embedConfig);
|
|
193
201
|
default:
|
|
194
|
-
return Promise.resolve();
|
|
202
|
+
return Promise.resolve(true);
|
|
195
203
|
}
|
|
196
204
|
};
|
|
197
205
|
/**
|
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,CAAC,IAAI,cAAc,GAAW,IAAI,CAAC;AACzC,qDAAqD;AACrD,MAAM,CAAC,IAAI,qBAAqB,GAAkB,IAAI,CAAC;AACvD,qDAAqD;AACrD,MAAM,CAAC,IAAI,WAAW,GAAQ,IAAI,CAAC;AAEnC,MAAM,CAAC,MAAM,2BAA2B,GACpC,sCAAsC,CAAC;AAE3C,MAAM,CAAC,MAAM,SAA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,WAAW,CAAC,WAAW,CAAC,CAAC;QACpC,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
|
@@ -97,7 +97,9 @@ describe('Unit test for auth', () => {
|
|
|
97
97
|
test('doTokenAuth: when user is not loggedIn & getAuthToken have response, isLoggedIn should called', async () => {
|
|
98
98
|
jest.spyOn(authService, 'fetchSessionInfoService').mockImplementation(() => false);
|
|
99
99
|
jest.spyOn(authService, 'fetchAuthTokenService').mockImplementation(() => ({ text: () => Promise.resolve('abc') }));
|
|
100
|
-
jest.spyOn(authService, 'fetchAuthService')
|
|
100
|
+
jest.spyOn(authService, 'fetchAuthService').mockImplementation(() => Promise.resolve({
|
|
101
|
+
status: 200,
|
|
102
|
+
}));
|
|
101
103
|
await authInstance.doTokenAuth(embedConfig.doTokenAuthSuccess);
|
|
102
104
|
expect(authService.fetchSessionInfoService).toBeCalled();
|
|
103
105
|
expect(authService.fetchAuthService).toBeCalledWith(thoughtSpotHost, username, 'authToken');
|
|
@@ -105,7 +107,9 @@ describe('Unit test for auth', () => {
|
|
|
105
107
|
test('doTokenAuth: when user is not loggedIn & getAuthToken not present, isLoggedIn should called', async () => {
|
|
106
108
|
jest.spyOn(authService, 'fetchSessionInfoService').mockImplementation(() => false);
|
|
107
109
|
jest.spyOn(authService, 'fetchAuthTokenService').mockImplementation(() => Promise.resolve({ text: () => Promise.resolve('abc') }));
|
|
108
|
-
jest.spyOn(authService, 'fetchAuthService')
|
|
110
|
+
jest.spyOn(authService, 'fetchAuthService').mockImplementation(() => Promise.resolve({
|
|
111
|
+
status: 200,
|
|
112
|
+
}));
|
|
109
113
|
await authInstance.doTokenAuth(embedConfig.doTokenAuthFailureWithoutGetAuthToken);
|
|
110
114
|
await executeAfterWait(() => {
|
|
111
115
|
expect(authInstance.loggedInStatus).toBe(true);
|
|
@@ -190,7 +194,7 @@ describe('Unit test for auth', () => {
|
|
|
190
194
|
expect(await authInstance.doSamlAuth({
|
|
191
195
|
...embedConfig.doSamlAuth,
|
|
192
196
|
noRedirect: true,
|
|
193
|
-
})).toBe(
|
|
197
|
+
})).toBe(false);
|
|
194
198
|
expect(authService.fetchSessionInfoService).toBeCalled();
|
|
195
199
|
});
|
|
196
200
|
});
|
package/lib/src/auth.spec.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.spec.js","sourceRoot":"","sources":["../../src/auth.spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,YAAY,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,WAAW,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,MAAM,eAAe,GAAG,uBAAuB,CAAC;AAChD,MAAM,QAAQ,GAAG,QAAQ,CAAC;AAC1B,MAAM,QAAQ,GAAG,UAAU,CAAC;AAC5B,MAAM,aAAa,GAAG,GAAG,eAAe,+EAA+E,CAAC;AAExH,MAAM,WAAW,GAAQ;IACrB,kBAAkB,EAAE;QAChB,eAAe;QACf,QAAQ;QACR,YAAY,EAAE,MAAM;QACpB,YAAY,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;KAC5D;IACD,qCAAqC,EAAE;QACnC,eAAe;QACf,QAAQ;QACR,YAAY,EAAE,EAAE;QAChB,YAAY,EAAE,IAAI;KACrB;IACD,qCAAqC,EAAE;QACnC,eAAe;QACf,QAAQ;QACR,YAAY,EAAE,MAAM;QACpB,YAAY,EAAE,IAAI;KACrB;IAC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