@thoughtspot/visual-embed-sdk 1.11.0-auth.10 → 1.11.0-auth.13
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 +11 -0
- package/dist/src/embed/base.d.ts +18 -4
- package/dist/src/embed/ts-embed.d.ts +0 -1
- package/dist/src/index.d.ts +2 -1
- package/dist/src/types.d.ts +5 -0
- package/dist/src/utils/processData.d.ts +1 -1
- package/dist/tsembed.es.js +451 -42
- package/dist/tsembed.js +448 -41
- package/lib/package.json +2 -1
- package/lib/src/auth.d.ts +11 -0
- package/lib/src/auth.js +17 -8
- package/lib/src/auth.js.map +1 -1
- package/lib/src/auth.spec.js +54 -1
- package/lib/src/auth.spec.js.map +1 -1
- package/lib/src/embed/base.d.ts +18 -4
- package/lib/src/embed/base.js +60 -12
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/base.spec.js +47 -2
- 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.d.ts +0 -1
- package/lib/src/embed/ts-embed.js +5 -16
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/index.d.ts +2 -1
- package/lib/src/index.js +2 -1
- package/lib/src/index.js.map +1 -1
- package/lib/src/types.d.ts +5 -0
- package/lib/src/types.js +5 -0
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/authService.js +4 -5
- package/lib/src/utils/authService.js.map +1 -1
- package/lib/src/utils/authService.spec.js +10 -0
- 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 +86 -5
- package/package.json +2 -1
- package/src/auth.spec.ts +67 -1
- package/src/auth.ts +17 -7
- package/src/embed/base.spec.ts +54 -3
- package/src/embed/base.ts +75 -16
- package/src/embed/embed.spec.ts +1 -1
- package/src/embed/ts-embed.ts +10 -19
- package/src/index.ts +3 -0
- package/src/types.ts +5 -0
- package/src/utils/authService.spec.ts +13 -0
- package/src/utils/authService.ts +3 -5
- package/src/utils/processData.spec.ts +114 -4
- package/src/utils/processData.ts +41 -4
package/dist/src/auth.d.ts
CHANGED
|
@@ -12,6 +12,17 @@ export declare const EndPoints: {
|
|
|
12
12
|
BASIC_LOGIN: string;
|
|
13
13
|
LOGOUT: string;
|
|
14
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
|
+
}
|
|
15
26
|
/**
|
|
16
27
|
* Return sessionInfo if available else make a loggedIn check to fetch the sessionInfo
|
|
17
28
|
*/
|
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,10 +32,11 @@ 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) =>
|
|
23
|
-
export declare const logout: () => Promise<boolean>;
|
|
35
|
+
export declare const init: (embedConfig: EmbedConfig) => EventEmitter;
|
|
36
|
+
export declare const logout: (doNotDisableAutoLogin?: boolean) => Promise<boolean>;
|
|
24
37
|
/**
|
|
25
38
|
* Renders functions in a queue, resolves to next function only after the callback next is called
|
|
26
39
|
* @param fn The function being registered
|
|
27
40
|
*/
|
|
28
41
|
export declare const renderInQueue: (fn: (next?: (val?: any) => void) => void) => void;
|
|
42
|
+
export declare function reset(): void;
|
|
@@ -143,7 +143,6 @@ export declare class TsEmbed {
|
|
|
143
143
|
*/
|
|
144
144
|
private shouldEncodeUrlQueryParams;
|
|
145
145
|
constructor(domSelector: DOMSelector, viewConfig?: ViewConfig);
|
|
146
|
-
private getLoginFiledMessage;
|
|
147
146
|
/**
|
|
148
147
|
* Gets a reference to the root DOM node where
|
|
149
148
|
* the embedded content will appear.
|
package/dist/src/index.d.ts
CHANGED
|
@@ -11,5 +11,6 @@ import { AppEmbed, Page, AppViewConfig } from './embed/app';
|
|
|
11
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, logout, 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
|
@@ -337,6 +337,11 @@ export declare enum EmbedEvent {
|
|
|
337
337
|
* The ThoughtSpot auth session has expired.
|
|
338
338
|
*/
|
|
339
339
|
AuthExpire = "ThoughtspotAuthExpired",
|
|
340
|
+
/**
|
|
341
|
+
* ThoughtSpot failed to validate the auth session.
|
|
342
|
+
* @hidden
|
|
343
|
+
*/
|
|
344
|
+
AuthFailure = "ThoughtspotAuthFailure",
|
|
340
345
|
/**
|
|
341
346
|
* The height of the embedded Liveboard or visualization has been computed.
|
|
342
347
|
* @return data - The height of the embedded Liveboard or visualization
|
|
@@ -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;
|