@thoughtspot/visual-embed-sdk 1.11.0-auth.1 → 1.11.0-auth.12
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 +13 -0
- package/dist/src/embed/base.d.ts +17 -3
- package/dist/src/index.d.ts +3 -2
- package/dist/src/types.d.ts +10 -0
- package/dist/src/utils/authService.d.ts +1 -0
- package/dist/src/utils/processData.d.ts +1 -1
- package/dist/tsembed.es.js +482 -29
- package/dist/tsembed.js +480 -28
- package/lib/package.json +2 -1
- package/lib/src/auth.d.ts +13 -0
- package/lib/src/auth.js +40 -8
- package/lib/src/auth.js.map +1 -1
- package/lib/src/auth.spec.js +63 -9
- package/lib/src/auth.spec.js.map +1 -1
- package/lib/src/embed/base.d.ts +17 -3
- package/lib/src/embed/base.js +50 -5
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/base.spec.js +38 -3
- package/lib/src/embed/base.spec.js.map +1 -1
- package/lib/src/embed/embed.spec.js +1 -1
- package/lib/src/embed/embed.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.js +5 -10
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +16 -6
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/index.d.ts +3 -2
- package/lib/src/index.js +3 -2
- package/lib/src/index.js.map +1 -1
- package/lib/src/test/test-utils.js +1 -1
- package/lib/src/test/test-utils.js.map +1 -1
- package/lib/src/types.d.ts +10 -0
- package/lib/src/types.js +5 -0
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/authService.d.ts +1 -0
- package/lib/src/utils/authService.js +17 -6
- package/lib/src/utils/authService.js.map +1 -1
- package/lib/src/utils/authService.spec.js +7 -3
- package/lib/src/utils/authService.spec.js.map +1 -1
- package/lib/src/utils/processData.d.ts +1 -1
- package/lib/src/utils/processData.js +27 -3
- package/lib/src/utils/processData.js.map +1 -1
- package/lib/src/utils/processData.spec.js +85 -4
- package/lib/src/utils/processData.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +91 -5
- package/package.json +2 -1
- package/src/auth.spec.ts +80 -9
- package/src/auth.ts +43 -6
- package/src/embed/base.spec.ts +44 -4
- package/src/embed/base.ts +65 -9
- package/src/embed/embed.spec.ts +1 -1
- package/src/embed/ts-embed.spec.ts +19 -9
- package/src/embed/ts-embed.ts +10 -12
- package/src/index.ts +5 -1
- package/src/test/test-utils.ts +1 -1
- package/src/types.ts +11 -0
- package/src/utils/authService.spec.ts +10 -3
- package/src/utils/authService.ts +20 -6
- package/src/utils/processData.spec.ts +114 -4
- package/src/utils/processData.ts +41 -4
package/dist/src/auth.d.ts
CHANGED
|
@@ -10,7 +10,19 @@ export declare const EndPoints: {
|
|
|
10
10
|
OIDC_LOGIN_TEMPLATE: (targetUrl: string) => string;
|
|
11
11
|
TOKEN_LOGIN: string;
|
|
12
12
|
BASIC_LOGIN: string;
|
|
13
|
+
LOGOUT: string;
|
|
13
14
|
};
|
|
15
|
+
export declare enum AuthFailureType {
|
|
16
|
+
SDK = "SDK",
|
|
17
|
+
NO_COOKIE_ACCESS = "NO_COOKIE_ACCESS",
|
|
18
|
+
EXPIRY = "EXPIRY",
|
|
19
|
+
OTHER = "OTHER"
|
|
20
|
+
}
|
|
21
|
+
export declare enum AuthStatus {
|
|
22
|
+
FAILURE = "FAILURE",
|
|
23
|
+
SUCCESS = "SUCCESS",
|
|
24
|
+
LOGOUT = "LOGOUT"
|
|
25
|
+
}
|
|
14
26
|
/**
|
|
15
27
|
* Return sessionInfo if available else make a loggedIn check to fetch the sessionInfo
|
|
16
28
|
*/
|
|
@@ -32,6 +44,7 @@ export declare const doTokenAuth: (embedConfig: EmbedConfig) => Promise<boolean>
|
|
|
32
44
|
export declare const doBasicAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
33
45
|
export declare const doSamlAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
34
46
|
export declare const doOIDCAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
47
|
+
export declare const logout: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
35
48
|
/**
|
|
36
49
|
* Perform authentication on the ThoughtSpot cluster
|
|
37
50
|
* @param embedConfig The embed configuration
|
package/dist/src/embed/base.d.ts
CHANGED
|
@@ -1,11 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022
|
|
3
|
+
*
|
|
4
|
+
* Base classes
|
|
5
|
+
*
|
|
6
|
+
* @summary Base classes
|
|
7
|
+
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
8
|
+
*/
|
|
9
|
+
import EventEmitter from 'eventemitter3';
|
|
1
10
|
import { EmbedConfig } from '../types';
|
|
11
|
+
import { AuthFailureType } from '../auth';
|
|
2
12
|
export declare let authPromise: Promise<boolean>;
|
|
13
|
+
export declare const getEmbedConfig: () => EmbedConfig;
|
|
14
|
+
export declare const getAuthPromise: () => Promise<boolean>;
|
|
15
|
+
export declare function notifyAuthSuccess(): void;
|
|
16
|
+
export declare function notifyAuthFailure(failureType: AuthFailureType): void;
|
|
17
|
+
export declare function notifyLogout(): void;
|
|
3
18
|
/**
|
|
4
19
|
* Perform authentication on the ThoughtSpot app as applicable.
|
|
5
20
|
*/
|
|
6
21
|
export declare const handleAuth: () => Promise<boolean>;
|
|
7
|
-
export declare const getEmbedConfig: () => EmbedConfig;
|
|
8
|
-
export declare const getAuthPromise: () => Promise<boolean>;
|
|
9
22
|
/**
|
|
10
23
|
* 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
24
|
* @param url The URL provided for prefetch
|
|
@@ -19,7 +32,8 @@ export declare const prefetch: (url?: string) => void;
|
|
|
19
32
|
*
|
|
20
33
|
* @returns authPromise Promise which resolves when authentication is complete.
|
|
21
34
|
*/
|
|
22
|
-
export declare const init: (embedConfig: EmbedConfig) =>
|
|
35
|
+
export declare const init: (embedConfig: EmbedConfig) => EventEmitter;
|
|
36
|
+
export declare const logout: (doNotDisableAutoLogin?: boolean) => Promise<boolean>;
|
|
23
37
|
/**
|
|
24
38
|
* Renders functions in a queue, resolves to next function only after the callback next is called
|
|
25
39
|
* @param fn The function being registered
|
package/dist/src/index.d.ts
CHANGED
|
@@ -8,8 +8,9 @@
|
|
|
8
8
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
9
9
|
*/
|
|
10
10
|
import { AppEmbed, Page, AppViewConfig } from './embed/app';
|
|
11
|
-
import { init, prefetch } from './embed/base';
|
|
11
|
+
import { init, prefetch, logout } from './embed/base';
|
|
12
12
|
import { PinboardEmbed, LiveboardViewConfig, LiveboardEmbed } from './embed/liveboard';
|
|
13
13
|
import { SearchEmbed, SearchViewConfig } from './embed/search';
|
|
14
|
+
import { AuthFailureType, AuthStatus } from './auth';
|
|
14
15
|
import { AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, EmbedConfig } from './types';
|
|
15
|
-
export { init, prefetch, SearchEmbed, PinboardEmbed, LiveboardEmbed, AppEmbed, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, EmbedConfig, SearchViewConfig, LiveboardViewConfig, AppViewConfig, };
|
|
16
|
+
export { init, logout, prefetch, SearchEmbed, PinboardEmbed, LiveboardEmbed, AppEmbed, AuthFailureType, AuthStatus, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, EmbedConfig, SearchViewConfig, LiveboardViewConfig, AppViewConfig, };
|
package/dist/src/types.d.ts
CHANGED
|
@@ -119,6 +119,11 @@ export interface EmbedConfig {
|
|
|
119
119
|
* @default false
|
|
120
120
|
*/
|
|
121
121
|
disableLoginRedirect?: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* This message is displayed on the embed view when the login fails.
|
|
124
|
+
* @version 1.10.1 | ThoughtSpot: *
|
|
125
|
+
*/
|
|
126
|
+
loginFailedMessage?: string;
|
|
122
127
|
/**
|
|
123
128
|
* Calls the prefetch method internally when set to true
|
|
124
129
|
* @default false
|
|
@@ -332,6 +337,11 @@ export declare enum EmbedEvent {
|
|
|
332
337
|
* The ThoughtSpot auth session has expired.
|
|
333
338
|
*/
|
|
334
339
|
AuthExpire = "ThoughtspotAuthExpired",
|
|
340
|
+
/**
|
|
341
|
+
* ThoughtSpot failed to validate the auth session.
|
|
342
|
+
* @hidden
|
|
343
|
+
*/
|
|
344
|
+
AuthFailure = "ThoughtspotAuthFailure",
|
|
335
345
|
/**
|
|
336
346
|
* The height of the embedded Liveboard or visualization has been computed.
|
|
337
347
|
* @return data - The height of the embedded Liveboard or visualization
|
|
@@ -2,3 +2,4 @@ export declare function fetchSessionInfoService(authVerificationUrl: string): Pr
|
|
|
2
2
|
export declare function fetchAuthTokenService(authEndpoint: string): Promise<any>;
|
|
3
3
|
export declare function fetchAuthService(thoughtSpotHost: string, username: string, authToken: string): Promise<any>;
|
|
4
4
|
export declare function fetchBasicAuthService(thoughtSpotHost: string, username: string, password: string): Promise<any>;
|
|
5
|
+
export declare function fetchLogoutService(thoughtSpotHost: string): Promise<any>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { EmbedEvent } from '../types';
|
|
2
2
|
export declare function processCustomAction(e: any, thoughtSpotHost: string): any;
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function processEventData(type: EmbedEvent, e: any, thoughtSpotHost: string, containerEl: Element): any;
|