@thoughtspot/visual-embed-sdk 1.36.3 → 1.36.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/cjs/package.json +1 -1
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +1 -1
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/base.d.ts +4 -0
- package/cjs/src/embed/base.d.ts.map +1 -1
- package/cjs/src/embed/base.js +27 -1
- package/cjs/src/embed/base.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/cjs/src/embed/bodyless-conversation.js +1 -1
- package/cjs/src/embed/bodyless-conversation.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +1 -1
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/embedConfig.d.ts.map +1 -1
- package/cjs/src/embed/embedConfig.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +2 -2
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +4 -5
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +11 -11
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/sage.d.ts.map +1 -1
- package/cjs/src/embed/sage.js +1 -1
- package/cjs/src/embed/sage.js.map +1 -1
- package/cjs/src/embed/search-bar.d.ts.map +1 -1
- package/cjs/src/embed/search-bar.js +1 -1
- package/cjs/src/embed/search-bar.js.map +1 -1
- package/cjs/src/embed/search.d.ts.map +1 -1
- package/cjs/src/embed/search.js +1 -1
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +4 -3
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +25 -16
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +71 -5
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/errors.d.ts +1 -0
- package/cjs/src/errors.d.ts.map +1 -1
- package/cjs/src/errors.js +1 -0
- package/cjs/src/errors.js.map +1 -1
- package/cjs/src/react/all-types-export.d.ts +1 -1
- package/cjs/src/react/all-types-export.d.ts.map +1 -1
- package/cjs/src/react/all-types-export.js +2 -1
- package/cjs/src/react/all-types-export.js.map +1 -1
- package/cjs/src/react/index.d.ts +16 -0
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +25 -2
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/utils/with-resolvers-polyfill.d.ts +1 -0
- package/cjs/src/utils/with-resolvers-polyfill.d.ts.map +1 -0
- package/cjs/src/utils/with-resolvers-polyfill.js +12 -0
- package/cjs/src/utils/with-resolvers-polyfill.js.map +1 -0
- package/cjs/src/utils.d.ts +17 -2
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +27 -3
- package/cjs/src/utils.js.map +1 -1
- package/dist/{index-BJx3m5_V.js → index-NZYq1Tu3.js} +1 -1
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/base.d.ts +4 -0
- package/dist/src/embed/base.d.ts.map +1 -1
- package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/embedConfig.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +2 -2
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/sage.d.ts.map +1 -1
- package/dist/src/embed/search-bar.d.ts.map +1 -1
- package/dist/src/embed/search.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +4 -3
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/dist/src/errors.d.ts +1 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/react/all-types-export.d.ts +1 -1
- package/dist/src/react/all-types-export.d.ts.map +1 -1
- package/dist/src/react/index.d.ts +16 -0
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/utils/with-resolvers-polyfill.d.ts +1 -0
- package/dist/src/utils/with-resolvers-polyfill.d.ts.map +1 -0
- package/dist/src/utils.d.ts +17 -2
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +349 -45
- package/dist/tsembed-react.js +347 -42
- package/dist/tsembed.es.js +85 -32
- package/dist/tsembed.js +84 -31
- package/dist/visual-embed-sdk-react-full.d.ts +1233 -1214
- package/dist/visual-embed-sdk-react.d.ts +668 -649
- package/dist/visual-embed-sdk.d.ts +9 -4
- package/lib/package.json +1 -1
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +1 -1
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/base.d.ts +4 -0
- package/lib/src/embed/base.d.ts.map +1 -1
- package/lib/src/embed/base.js +24 -1
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/lib/src/embed/bodyless-conversation.js +1 -1
- package/lib/src/embed/bodyless-conversation.js.map +1 -1
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +1 -1
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/embedConfig.d.ts.map +1 -1
- package/lib/src/embed/embedConfig.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +2 -2
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +4 -5
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +11 -11
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/sage.d.ts.map +1 -1
- package/lib/src/embed/sage.js +1 -1
- package/lib/src/embed/sage.js.map +1 -1
- package/lib/src/embed/search-bar.d.ts.map +1 -1
- package/lib/src/embed/search-bar.js +1 -1
- package/lib/src/embed/search-bar.js.map +1 -1
- package/lib/src/embed/search.d.ts.map +1 -1
- package/lib/src/embed/search.js +1 -1
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +4 -3
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +26 -17
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +71 -5
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/errors.d.ts +1 -0
- package/lib/src/errors.d.ts.map +1 -1
- package/lib/src/errors.js +1 -0
- package/lib/src/errors.js.map +1 -1
- package/lib/src/react/all-types-export.d.ts +1 -1
- package/lib/src/react/all-types-export.d.ts.map +1 -1
- package/lib/src/react/all-types-export.js +1 -1
- package/lib/src/react/all-types-export.js.map +1 -1
- package/lib/src/react/index.d.ts +16 -0
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +23 -1
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/utils/with-resolvers-polyfill.d.ts +1 -0
- package/lib/src/utils/with-resolvers-polyfill.d.ts.map +1 -0
- package/lib/src/utils/with-resolvers-polyfill.js +12 -0
- package/lib/src/utils/with-resolvers-polyfill.js.map +1 -0
- package/lib/src/utils.d.ts +17 -2
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +25 -2
- package/lib/src/utils.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +10 -5
- package/package.json +1 -1
- package/src/embed/app.ts +2 -1
- package/src/embed/base.ts +41 -1
- package/src/embed/bodyless-conversation.ts +2 -1
- package/src/embed/conversation.ts +2 -1
- package/src/embed/embedConfig.ts +1 -1
- package/src/embed/liveboard.spec.ts +11 -11
- package/src/embed/liveboard.ts +5 -6
- package/src/embed/sage.ts +1 -2
- package/src/embed/search-bar.tsx +1 -2
- package/src/embed/search.ts +1 -2
- package/src/embed/ts-embed.spec.ts +83 -5
- package/src/embed/ts-embed.ts +33 -17
- package/src/errors.ts +1 -0
- package/src/react/all-types-export.ts +1 -0
- package/src/react/index.tsx +27 -2
- package/src/utils/with-resolvers-polyfill.ts +11 -0
- package/src/utils.ts +35 -4
|
@@ -250,6 +250,195 @@ type EmbedComponent = typeof SearchEmbed | typeof AppEmbed | typeof LiveboardEmb
|
|
|
250
250
|
* @returns {React.MutableRefObject<T extends TsEmbed>} ref
|
|
251
251
|
*/
|
|
252
252
|
export function useEmbedRef<T extends EmbedComponent>(): React.MutableRefObject<React.ComponentRef<T>>;
|
|
253
|
+
/**
|
|
254
|
+
*
|
|
255
|
+
* @param config - EmbedConfig
|
|
256
|
+
* @returns AuthEventEmitter
|
|
257
|
+
* @example
|
|
258
|
+
* ```
|
|
259
|
+
* function Component() {
|
|
260
|
+
* const authEE = useInit({ ...initConfig });
|
|
261
|
+
* return <LiveboardEmbed ref={ref} liveboardId={<id>} />
|
|
262
|
+
* }
|
|
263
|
+
* ```
|
|
264
|
+
* @version SDK: 1.36.2 | ThoughtSpot: *
|
|
265
|
+
*/
|
|
266
|
+
export function useInit(config: EmbedConfig): React.MutableRefObject<AuthEventEmitter>;
|
|
267
|
+
|
|
268
|
+
export declare let loggedInStatus: boolean;
|
|
269
|
+
export declare let samlAuthWindow: Window;
|
|
270
|
+
export declare let samlCompletionPromise: Promise<void>;
|
|
271
|
+
export declare const SSO_REDIRECTION_MARKER_GUID = "5e16222e-ef02-43e9-9fbd-24226bf3ce5b";
|
|
272
|
+
/**
|
|
273
|
+
* Enum for auth failure types. This is the parameter passed to the listner
|
|
274
|
+
* of {@link AuthStatus.FAILURE}.
|
|
275
|
+
* @group Authentication / Init
|
|
276
|
+
*/
|
|
277
|
+
export declare enum AuthFailureType {
|
|
278
|
+
SDK = "SDK",
|
|
279
|
+
NO_COOKIE_ACCESS = "NO_COOKIE_ACCESS",
|
|
280
|
+
EXPIRY = "EXPIRY",
|
|
281
|
+
OTHER = "OTHER",
|
|
282
|
+
IDLE_SESSION_TIMEOUT = "IDLE_SESSION_TIMEOUT"
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Enum for auth status emitted by the emitter returned from {@link init}.
|
|
286
|
+
* @group Authentication / Init
|
|
287
|
+
*/
|
|
288
|
+
export declare enum AuthStatus {
|
|
289
|
+
/**
|
|
290
|
+
* Emits when the SDK fails to authenticate
|
|
291
|
+
*/
|
|
292
|
+
FAILURE = "FAILURE",
|
|
293
|
+
/**
|
|
294
|
+
* Emits when the SDK authenticates successfully
|
|
295
|
+
*/
|
|
296
|
+
SDK_SUCCESS = "SDK_SUCCESS",
|
|
297
|
+
/**
|
|
298
|
+
* @hidden
|
|
299
|
+
* Emits when iframe is loaded and session info is available
|
|
300
|
+
*/
|
|
301
|
+
SESSION_INFO_SUCCESS = "SESSION_INFO_SUCCESS",
|
|
302
|
+
/**
|
|
303
|
+
* Emits when the app sends an authentication success message
|
|
304
|
+
*/
|
|
305
|
+
SUCCESS = "SUCCESS",
|
|
306
|
+
/**
|
|
307
|
+
* Emits when a user logs out
|
|
308
|
+
*/
|
|
309
|
+
LOGOUT = "LOGOUT",
|
|
310
|
+
/**
|
|
311
|
+
* Emitted when inPopup is true in the SAMLRedirect flow and the
|
|
312
|
+
* popup is waiting to be triggered either programmatically
|
|
313
|
+
* or by the trigger button.
|
|
314
|
+
* @version SDK: 1.19.0
|
|
315
|
+
*/
|
|
316
|
+
WAITING_FOR_POPUP = "WAITING_FOR_POPUP"
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Event emitter returned from {@link init}.
|
|
320
|
+
* @group Authentication / Init
|
|
321
|
+
*/
|
|
322
|
+
export interface AuthEventEmitter {
|
|
323
|
+
/**
|
|
324
|
+
* Register a listener on Auth failure.
|
|
325
|
+
* @param event
|
|
326
|
+
* @param listener
|
|
327
|
+
*/
|
|
328
|
+
on(event: AuthStatus.FAILURE, listener: (failureType: AuthFailureType) => void): this;
|
|
329
|
+
/**
|
|
330
|
+
* Register a listener on Auth SDK success.
|
|
331
|
+
* @param event
|
|
332
|
+
* @param listener
|
|
333
|
+
*/
|
|
334
|
+
on(event: AuthStatus.SDK_SUCCESS | AuthStatus.LOGOUT | AuthStatus.WAITING_FOR_POPUP, listener: () => void): this;
|
|
335
|
+
on(event: AuthStatus.SUCCESS, listener: (sessionInfo: any) => void): this;
|
|
336
|
+
once(event: AuthStatus.FAILURE, listener: (failureType: AuthFailureType) => void): this;
|
|
337
|
+
once(event: AuthStatus.SDK_SUCCESS | AuthStatus.LOGOUT | AuthStatus.WAITING_FOR_POPUP, listener: () => void): this;
|
|
338
|
+
once(event: AuthStatus.SUCCESS, listener: (sessionInfo: any) => void): this;
|
|
339
|
+
/**
|
|
340
|
+
* Trigger an event on the emitter returned from init.
|
|
341
|
+
* @param {@link AuthEvent}
|
|
342
|
+
*/
|
|
343
|
+
emit(event: AuthEvent, ...args: any[]): boolean;
|
|
344
|
+
/**
|
|
345
|
+
* Remove listener from the emitter returned from init.
|
|
346
|
+
* @param event
|
|
347
|
+
* @param listener
|
|
348
|
+
* @param context
|
|
349
|
+
* @param once
|
|
350
|
+
*/
|
|
351
|
+
off(event: AuthStatus, listener: (...args: any[]) => void, context: any, once: boolean): this;
|
|
352
|
+
/**
|
|
353
|
+
* Remove all the event listeners
|
|
354
|
+
* @param event
|
|
355
|
+
*/
|
|
356
|
+
removeAllListeners(event: AuthStatus): this;
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Events which can be triggered on the emitter returned from {@link init}.
|
|
360
|
+
* @group Authentication / Init
|
|
361
|
+
*/
|
|
362
|
+
export declare enum AuthEvent {
|
|
363
|
+
/**
|
|
364
|
+
* Manually trigger the SSO popup. This is useful when
|
|
365
|
+
* authStatus is SAMLRedirect/OIDCRedirect and inPopup is set to true
|
|
366
|
+
*/
|
|
367
|
+
TRIGGER_SSO_POPUP = "TRIGGER_SSO_POPUP"
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
*
|
|
371
|
+
*/
|
|
372
|
+
export declare function getAuthEE(): EventEmitter<AuthStatus | AuthEvent>;
|
|
373
|
+
/**
|
|
374
|
+
*
|
|
375
|
+
* @param eventEmitter
|
|
376
|
+
*/
|
|
377
|
+
export declare function setAuthEE(eventEmitter: EventEmitter<AuthStatus | AuthEvent>): void;
|
|
378
|
+
/**
|
|
379
|
+
*
|
|
380
|
+
*/
|
|
381
|
+
export declare function notifyAuthSDKSuccess(): void;
|
|
382
|
+
/**
|
|
383
|
+
*
|
|
384
|
+
*/
|
|
385
|
+
export declare function notifyAuthSuccess(): Promise<void>;
|
|
386
|
+
/**
|
|
387
|
+
*
|
|
388
|
+
* @param failureType
|
|
389
|
+
*/
|
|
390
|
+
export declare function notifyAuthFailure(failureType: AuthFailureType): void;
|
|
391
|
+
/**
|
|
392
|
+
*
|
|
393
|
+
*/
|
|
394
|
+
export declare function notifyLogout(): void;
|
|
395
|
+
/**
|
|
396
|
+
* Services to be called after the login is successful,
|
|
397
|
+
* This should be called after the cookie is set for cookie auth or
|
|
398
|
+
* after the token is set for cookieless.
|
|
399
|
+
* @return {Promise<void>}
|
|
400
|
+
* @example
|
|
401
|
+
* ```js
|
|
402
|
+
* await postLoginService();
|
|
403
|
+
* ```
|
|
404
|
+
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
405
|
+
*/
|
|
406
|
+
export declare function postLoginService(): Promise<void>;
|
|
407
|
+
/**
|
|
408
|
+
* Return releaseVersion if available
|
|
409
|
+
*/
|
|
410
|
+
export declare function getReleaseVersion(): string;
|
|
411
|
+
/**
|
|
412
|
+
* Perform token based authentication
|
|
413
|
+
* @param embedConfig The embed configuration
|
|
414
|
+
*/
|
|
415
|
+
export declare const doTokenAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
416
|
+
/**
|
|
417
|
+
* Validate embedConfig parameters required for cookielessTokenAuth
|
|
418
|
+
* @param embedConfig The embed configuration
|
|
419
|
+
*/
|
|
420
|
+
export declare const doCookielessTokenAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
421
|
+
/**
|
|
422
|
+
* Perform basic authentication to the ThoughtSpot cluster using the cluster
|
|
423
|
+
* credentials.
|
|
424
|
+
*
|
|
425
|
+
* Warning: This feature is primarily intended for developer testing. It is
|
|
426
|
+
* strongly advised not to use this authentication method in production.
|
|
427
|
+
* @param embedConfig The embed configuration
|
|
428
|
+
*/
|
|
429
|
+
export declare const doBasicAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
430
|
+
export declare const doSamlAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
431
|
+
export declare const doOIDCAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
432
|
+
export declare const logout: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
433
|
+
/**
|
|
434
|
+
* Perform authentication on the ThoughtSpot cluster
|
|
435
|
+
* @param embedConfig The embed configuration
|
|
436
|
+
*/
|
|
437
|
+
export declare const authenticate: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
438
|
+
/**
|
|
439
|
+
* Check if we are authenticated to the ThoughtSpot cluster
|
|
440
|
+
*/
|
|
441
|
+
export declare const isAuthenticated: () => boolean;
|
|
253
442
|
|
|
254
443
|
/**
|
|
255
444
|
* @group Embed components
|
|
@@ -1702,7 +1891,7 @@ export declare class LiveboardEmbed extends V1Embed {
|
|
|
1702
1891
|
*/
|
|
1703
1892
|
protected getEmbedParams(): string;
|
|
1704
1893
|
protected beforePrerenderVisible(): void;
|
|
1705
|
-
protected handleRenderForPrerender():
|
|
1894
|
+
protected handleRenderForPrerender(): Promise<TsEmbed>;
|
|
1706
1895
|
/**
|
|
1707
1896
|
* Triggers an event to the embedded app
|
|
1708
1897
|
* @param {HostEvent} messageType The event type
|
|
@@ -1730,177 +1919,39 @@ export declare class LiveboardEmbed extends V1Embed {
|
|
|
1730
1919
|
export declare class PinboardEmbed extends LiveboardEmbed {
|
|
1731
1920
|
}
|
|
1732
1921
|
|
|
1733
|
-
export type EmbedEventHandlers = {
|
|
1734
|
-
[key in keyof typeof EmbedEvent as `on${Capitalize<key>}`]?: MessageCallback;
|
|
1735
|
-
};
|
|
1736
|
-
export interface EmbedProps extends ViewConfig, EmbedEventHandlers {
|
|
1737
|
-
className?: string;
|
|
1738
|
-
}
|
|
1739
|
-
export interface ViewConfigAndListeners<T extends ViewConfig> {
|
|
1740
|
-
viewConfig: T;
|
|
1741
|
-
listeners: {
|
|
1742
|
-
[key in EmbedEvent]?: MessageCallback;
|
|
1743
|
-
};
|
|
1744
|
-
}
|
|
1745
|
-
/**
|
|
1746
|
-
*
|
|
1747
|
-
* @param props
|
|
1748
|
-
*/
|
|
1749
|
-
export function getViewPropsAndListeners<T extends EmbedProps, U extends ViewConfig>(props: T): ViewConfigAndListeners<U>;
|
|
1750
|
-
|
|
1751
1922
|
/**
|
|
1752
|
-
*
|
|
1923
|
+
* Copyright (c) 2023
|
|
1924
|
+
*
|
|
1925
|
+
* TypeScript type definitions for ThoughtSpot Visual Embed SDK
|
|
1926
|
+
* @summary Type definitions for Embed SDK
|
|
1927
|
+
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
1753
1928
|
*/
|
|
1754
|
-
export interface SearchOptions {
|
|
1755
|
-
/**
|
|
1756
|
-
* The query string to pass to start the Conversation.
|
|
1757
|
-
*/
|
|
1758
|
-
searchQuery: string;
|
|
1759
|
-
}
|
|
1760
1929
|
/**
|
|
1761
|
-
* The
|
|
1762
|
-
*
|
|
1930
|
+
* The authentication mechanism for allowing access to the
|
|
1931
|
+
* the embedded app
|
|
1932
|
+
* @group Authentication / Init
|
|
1763
1933
|
*/
|
|
1764
|
-
export
|
|
1765
|
-
/**
|
|
1766
|
-
* The ID of the worksheet to use for the conversation.
|
|
1767
|
-
*/
|
|
1768
|
-
worksheetId: string;
|
|
1769
|
-
/**
|
|
1770
|
-
* Ability to pass a starting search query to the conversation.
|
|
1771
|
-
*/
|
|
1772
|
-
searchOptions?: SearchOptions;
|
|
1934
|
+
export declare enum AuthType {
|
|
1773
1935
|
/**
|
|
1774
|
-
*
|
|
1775
|
-
*
|
|
1936
|
+
* No authentication on the SDK. Pass-through to the embedded App. Alias for
|
|
1937
|
+
* `Passthrough`.
|
|
1776
1938
|
* @example
|
|
1777
1939
|
* ```js
|
|
1778
|
-
*
|
|
1779
|
-
*
|
|
1780
|
-
*
|
|
1781
|
-
*
|
|
1940
|
+
* init({
|
|
1941
|
+
* // ...
|
|
1942
|
+
* authType: AuthType.None,
|
|
1943
|
+
* });
|
|
1782
1944
|
* ```
|
|
1783
|
-
* @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
|
|
1784
1945
|
*/
|
|
1785
|
-
|
|
1946
|
+
None = "None",
|
|
1786
1947
|
/**
|
|
1787
|
-
*
|
|
1788
|
-
*
|
|
1789
|
-
*
|
|
1790
|
-
*
|
|
1791
|
-
*
|
|
1792
|
-
*
|
|
1793
|
-
*
|
|
1794
|
-
* ```
|
|
1795
|
-
* @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
|
|
1796
|
-
*/
|
|
1797
|
-
hideSourceSelection?: boolean;
|
|
1798
|
-
/**
|
|
1799
|
-
* Flag to control Data panel experience
|
|
1800
|
-
* @default false
|
|
1801
|
-
* @version SDK: 1.36.0 | ThoughtSpot Cloud: 10.4.0.cl
|
|
1802
|
-
* @example
|
|
1803
|
-
* ```js
|
|
1804
|
-
* const embed = new AppEmbed('#tsEmbed', {
|
|
1805
|
-
* ... // other options
|
|
1806
|
-
* dataPanelV2: true,
|
|
1807
|
-
* })
|
|
1808
|
-
* ```
|
|
1809
|
-
*/
|
|
1810
|
-
dataPanelV2?: boolean;
|
|
1811
|
-
/**
|
|
1812
|
-
* showSpotterLimitations : show limitation text
|
|
1813
|
-
* of the spotter underneath the chat input.
|
|
1814
|
-
* default is false.
|
|
1815
|
-
* @example
|
|
1816
|
-
* ```js
|
|
1817
|
-
* const embed = new ConversationEmbed('#tsEmbed', {
|
|
1818
|
-
* ... // other options
|
|
1819
|
-
* showSpotterLimitations : true,
|
|
1820
|
-
* })
|
|
1821
|
-
* ```
|
|
1822
|
-
* @version SDK: 1.36.0 | Thoughtspot: 10.5.0.cl
|
|
1823
|
-
*/
|
|
1824
|
-
showSpotterLimitations?: boolean;
|
|
1825
|
-
/**
|
|
1826
|
-
* hideSampleQuestions : Hide sample questions on
|
|
1827
|
-
* the initial screen of the conversation.
|
|
1828
|
-
* @example
|
|
1829
|
-
* ```js
|
|
1830
|
-
* const embed = new ConversationEmbed('#tsEmbed', {
|
|
1831
|
-
* ... // other options
|
|
1832
|
-
* hideSampleQuestions : true,
|
|
1833
|
-
* })
|
|
1834
|
-
* ```
|
|
1835
|
-
* @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
|
|
1836
|
-
*/
|
|
1837
|
-
hideSampleQuestions?: boolean;
|
|
1838
|
-
}
|
|
1839
|
-
/**
|
|
1840
|
-
* Embed ThoughtSpot AI Conversation.
|
|
1841
|
-
* @group Embed components
|
|
1842
|
-
* @example
|
|
1843
|
-
* ```js
|
|
1844
|
-
* const conversation = new ConversationEmbed('#tsEmbed', {
|
|
1845
|
-
* worksheetId: 'worksheetId',
|
|
1846
|
-
* searchOptions: {
|
|
1847
|
-
* searchQuery: 'searchQuery',
|
|
1848
|
-
* },
|
|
1849
|
-
* });
|
|
1850
|
-
* conversation.render();
|
|
1851
|
-
* ```
|
|
1852
|
-
* @version SDK: 1.33.1 | ThoughtSpot: 10.5.0.cl
|
|
1853
|
-
*/
|
|
1854
|
-
export declare class ConversationEmbed extends TsEmbed {
|
|
1855
|
-
protected viewConfig: ConversationViewConfig;
|
|
1856
|
-
constructor(container: HTMLElement, viewConfig: ConversationViewConfig);
|
|
1857
|
-
getIframeSrc(): string;
|
|
1858
|
-
render(): Promise<ConversationEmbed>;
|
|
1859
|
-
}
|
|
1860
|
-
|
|
1861
|
-
/**
|
|
1862
|
-
* Copyright (c) 2023
|
|
1863
|
-
*
|
|
1864
|
-
* ThoughtSpot Visual Embed SDK for embedding ThoughtSpot analytics
|
|
1865
|
-
* in other web applications.
|
|
1866
|
-
* @summary ThoughtSpot Visual Embed SDK
|
|
1867
|
-
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
1868
|
-
*/
|
|
1869
|
-
export { init, logout, prefetch, executeTML, exportTML, executeTMLInput, exportTMLInput, getEmbedConfig as getInitConfig, getSessionInfo, tokenizedFetch, getAnswerFromQuery, createLiveboardWithAnswers, SearchEmbed, SearchBarEmbed, PinboardEmbed, LiveboardEmbed, SageEmbed, AppEmbed, BodylessConversation, BodylessConversationViewConfig, ConversationEmbed, ConversationViewConfig, AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter, AnswerService, SessionInterface, UnderlyingDataPoint, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, ContextMenuTriggerOptions, EmbedConfig, SearchViewConfig, SearchBarViewConfig, LiveboardViewConfig, SageViewConfig, AppViewConfig, PrefetchFeatures, FrameParams, HomeLeftNavItem, HomepageModule, DOMSelector, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, CustomCssVariables, RuntimeParameter, LogLevel, uploadMixpanelEvent, MIXPANEL_EVENT, HomePageSearchBarMode, VizPoint, CustomActionPayload, UIPassthroughEvent, };
|
|
1870
|
-
|
|
1871
|
-
/**
|
|
1872
|
-
* Copyright (c) 2023
|
|
1873
|
-
*
|
|
1874
|
-
* TypeScript type definitions for ThoughtSpot Visual Embed SDK
|
|
1875
|
-
* @summary Type definitions for Embed SDK
|
|
1876
|
-
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
1877
|
-
*/
|
|
1878
|
-
/**
|
|
1879
|
-
* The authentication mechanism for allowing access to the
|
|
1880
|
-
* the embedded app
|
|
1881
|
-
* @group Authentication / Init
|
|
1882
|
-
*/
|
|
1883
|
-
export declare enum AuthType {
|
|
1884
|
-
/**
|
|
1885
|
-
* No authentication on the SDK. Pass-through to the embedded App. Alias for
|
|
1886
|
-
* `Passthrough`.
|
|
1887
|
-
* @example
|
|
1888
|
-
* ```js
|
|
1889
|
-
* init({
|
|
1890
|
-
* // ...
|
|
1891
|
-
* authType: AuthType.None,
|
|
1892
|
-
* });
|
|
1893
|
-
* ```
|
|
1894
|
-
*/
|
|
1895
|
-
None = "None",
|
|
1896
|
-
/**
|
|
1897
|
-
* Passthrough SSO to the embedded application within the iframe. Requires least
|
|
1898
|
-
* configuration, but may not be supported by all IDPs. This will behave like `None`
|
|
1899
|
-
* if SSO is not configured on ThoughtSpot.
|
|
1900
|
-
*
|
|
1901
|
-
* To use this:
|
|
1902
|
-
* Your SAML or OpenID provider must allow iframe redirects.
|
|
1903
|
-
* For example, if you are using Okta as IdP, you can enable iframe embedding.
|
|
1948
|
+
* Passthrough SSO to the embedded application within the iframe. Requires least
|
|
1949
|
+
* configuration, but may not be supported by all IDPs. This will behave like `None`
|
|
1950
|
+
* if SSO is not configured on ThoughtSpot.
|
|
1951
|
+
*
|
|
1952
|
+
* To use this:
|
|
1953
|
+
* Your SAML or OpenID provider must allow iframe redirects.
|
|
1954
|
+
* For example, if you are using Okta as IdP, you can enable iframe embedding.
|
|
1904
1955
|
* @example
|
|
1905
1956
|
* ```js
|
|
1906
1957
|
* init({
|
|
@@ -6670,6 +6721,144 @@ export interface DefaultAppInitData {
|
|
|
6670
6721
|
customVariablesForThirdPartyTools: Record<string, any>;
|
|
6671
6722
|
}
|
|
6672
6723
|
|
|
6724
|
+
export type EmbedEventHandlers = {
|
|
6725
|
+
[key in keyof typeof EmbedEvent as `on${Capitalize<key>}`]?: MessageCallback;
|
|
6726
|
+
};
|
|
6727
|
+
export interface EmbedProps extends ViewConfig, EmbedEventHandlers {
|
|
6728
|
+
className?: string;
|
|
6729
|
+
}
|
|
6730
|
+
export interface ViewConfigAndListeners<T extends ViewConfig> {
|
|
6731
|
+
viewConfig: T;
|
|
6732
|
+
listeners: {
|
|
6733
|
+
[key in EmbedEvent]?: MessageCallback;
|
|
6734
|
+
};
|
|
6735
|
+
}
|
|
6736
|
+
/**
|
|
6737
|
+
*
|
|
6738
|
+
* @param props
|
|
6739
|
+
*/
|
|
6740
|
+
export function getViewPropsAndListeners<T extends EmbedProps, U extends ViewConfig>(props: T): ViewConfigAndListeners<U>;
|
|
6741
|
+
|
|
6742
|
+
/**
|
|
6743
|
+
* Configuration for search options
|
|
6744
|
+
*/
|
|
6745
|
+
export interface SearchOptions {
|
|
6746
|
+
/**
|
|
6747
|
+
* The query string to pass to start the Conversation.
|
|
6748
|
+
*/
|
|
6749
|
+
searchQuery: string;
|
|
6750
|
+
}
|
|
6751
|
+
/**
|
|
6752
|
+
* The configuration for the embedded conversationEmbed options.
|
|
6753
|
+
* @group Embed components
|
|
6754
|
+
*/
|
|
6755
|
+
export interface ConversationViewConfig extends ViewConfig {
|
|
6756
|
+
/**
|
|
6757
|
+
* The ID of the worksheet to use for the conversation.
|
|
6758
|
+
*/
|
|
6759
|
+
worksheetId: string;
|
|
6760
|
+
/**
|
|
6761
|
+
* Ability to pass a starting search query to the conversation.
|
|
6762
|
+
*/
|
|
6763
|
+
searchOptions?: SearchOptions;
|
|
6764
|
+
/**
|
|
6765
|
+
* disableSourceSelection : Disables data source selection
|
|
6766
|
+
* but still display the selected data source.
|
|
6767
|
+
* @example
|
|
6768
|
+
* ```js
|
|
6769
|
+
* const embed = new ConversationEmbed('#tsEmbed', {
|
|
6770
|
+
* ... // other options
|
|
6771
|
+
* disableSourceSelection : true,
|
|
6772
|
+
* })
|
|
6773
|
+
* ```
|
|
6774
|
+
* @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
|
|
6775
|
+
*/
|
|
6776
|
+
disableSourceSelection?: boolean;
|
|
6777
|
+
/**
|
|
6778
|
+
* hideSourceSelection : Hide data source selection
|
|
6779
|
+
* @example
|
|
6780
|
+
* ```js
|
|
6781
|
+
* const embed = new ConversationEmbed('#tsEmbed', {
|
|
6782
|
+
* ... // other options
|
|
6783
|
+
* hideSourceSelection : true,
|
|
6784
|
+
* })
|
|
6785
|
+
* ```
|
|
6786
|
+
* @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
|
|
6787
|
+
*/
|
|
6788
|
+
hideSourceSelection?: boolean;
|
|
6789
|
+
/**
|
|
6790
|
+
* Flag to control Data panel experience
|
|
6791
|
+
* @default false
|
|
6792
|
+
* @version SDK: 1.36.0 | ThoughtSpot Cloud: 10.4.0.cl
|
|
6793
|
+
* @example
|
|
6794
|
+
* ```js
|
|
6795
|
+
* const embed = new AppEmbed('#tsEmbed', {
|
|
6796
|
+
* ... // other options
|
|
6797
|
+
* dataPanelV2: true,
|
|
6798
|
+
* })
|
|
6799
|
+
* ```
|
|
6800
|
+
*/
|
|
6801
|
+
dataPanelV2?: boolean;
|
|
6802
|
+
/**
|
|
6803
|
+
* showSpotterLimitations : show limitation text
|
|
6804
|
+
* of the spotter underneath the chat input.
|
|
6805
|
+
* default is false.
|
|
6806
|
+
* @example
|
|
6807
|
+
* ```js
|
|
6808
|
+
* const embed = new ConversationEmbed('#tsEmbed', {
|
|
6809
|
+
* ... // other options
|
|
6810
|
+
* showSpotterLimitations : true,
|
|
6811
|
+
* })
|
|
6812
|
+
* ```
|
|
6813
|
+
* @version SDK: 1.36.0 | Thoughtspot: 10.5.0.cl
|
|
6814
|
+
*/
|
|
6815
|
+
showSpotterLimitations?: boolean;
|
|
6816
|
+
/**
|
|
6817
|
+
* hideSampleQuestions : Hide sample questions on
|
|
6818
|
+
* the initial screen of the conversation.
|
|
6819
|
+
* @example
|
|
6820
|
+
* ```js
|
|
6821
|
+
* const embed = new ConversationEmbed('#tsEmbed', {
|
|
6822
|
+
* ... // other options
|
|
6823
|
+
* hideSampleQuestions : true,
|
|
6824
|
+
* })
|
|
6825
|
+
* ```
|
|
6826
|
+
* @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
|
|
6827
|
+
*/
|
|
6828
|
+
hideSampleQuestions?: boolean;
|
|
6829
|
+
}
|
|
6830
|
+
/**
|
|
6831
|
+
* Embed ThoughtSpot AI Conversation.
|
|
6832
|
+
* @group Embed components
|
|
6833
|
+
* @example
|
|
6834
|
+
* ```js
|
|
6835
|
+
* const conversation = new ConversationEmbed('#tsEmbed', {
|
|
6836
|
+
* worksheetId: 'worksheetId',
|
|
6837
|
+
* searchOptions: {
|
|
6838
|
+
* searchQuery: 'searchQuery',
|
|
6839
|
+
* },
|
|
6840
|
+
* });
|
|
6841
|
+
* conversation.render();
|
|
6842
|
+
* ```
|
|
6843
|
+
* @version SDK: 1.33.1 | ThoughtSpot: 10.5.0.cl
|
|
6844
|
+
*/
|
|
6845
|
+
export declare class ConversationEmbed extends TsEmbed {
|
|
6846
|
+
protected viewConfig: ConversationViewConfig;
|
|
6847
|
+
constructor(container: HTMLElement, viewConfig: ConversationViewConfig);
|
|
6848
|
+
getIframeSrc(): string;
|
|
6849
|
+
render(): Promise<ConversationEmbed>;
|
|
6850
|
+
}
|
|
6851
|
+
|
|
6852
|
+
/**
|
|
6853
|
+
* Copyright (c) 2023
|
|
6854
|
+
*
|
|
6855
|
+
* ThoughtSpot Visual Embed SDK for embedding ThoughtSpot analytics
|
|
6856
|
+
* in other web applications.
|
|
6857
|
+
* @summary ThoughtSpot Visual Embed SDK
|
|
6858
|
+
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
6859
|
+
*/
|
|
6860
|
+
export { init, logout, prefetch, executeTML, exportTML, executeTMLInput, exportTMLInput, getEmbedConfig as getInitConfig, getSessionInfo, tokenizedFetch, getAnswerFromQuery, createLiveboardWithAnswers, SearchEmbed, SearchBarEmbed, PinboardEmbed, LiveboardEmbed, SageEmbed, AppEmbed, BodylessConversation, BodylessConversationViewConfig, ConversationEmbed, ConversationViewConfig, AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter, AnswerService, SessionInterface, UnderlyingDataPoint, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, ContextMenuTriggerOptions, EmbedConfig, SearchViewConfig, SearchBarViewConfig, LiveboardViewConfig, SageViewConfig, AppViewConfig, PrefetchFeatures, FrameParams, HomeLeftNavItem, HomepageModule, DOMSelector, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, CustomCssVariables, RuntimeParameter, LogLevel, uploadMixpanelEvent, MIXPANEL_EVENT, HomePageSearchBarMode, VizPoint, CustomActionPayload, UIPassthroughEvent, };
|
|
6861
|
+
|
|
6673
6862
|
/**
|
|
6674
6863
|
* Copyright (c) 2022
|
|
6675
6864
|
*
|
|
@@ -6725,6 +6914,7 @@ export declare class TsEmbed {
|
|
|
6725
6914
|
*/
|
|
6726
6915
|
protected isRendered: boolean;
|
|
6727
6916
|
protected hostEventClient: HostEventClient;
|
|
6917
|
+
protected isReadyForRenderPromise: Promise<void>;
|
|
6728
6918
|
constructor(domSelector: DOMSelector, viewConfig?: ViewConfig);
|
|
6729
6919
|
/**
|
|
6730
6920
|
* Handles errors within the SDK
|
|
@@ -6868,12 +7058,12 @@ export declare class TsEmbed {
|
|
|
6868
7058
|
*/
|
|
6869
7059
|
render(): Promise<TsEmbed>;
|
|
6870
7060
|
getIframeSrc(): string;
|
|
6871
|
-
protected handleRenderForPrerender():
|
|
7061
|
+
protected handleRenderForPrerender(): Promise<TsEmbed>;
|
|
6872
7062
|
/**
|
|
6873
7063
|
* Creates the preRender shell
|
|
6874
7064
|
* @param showPreRenderByDefault - Show the preRender after render, hidden by default
|
|
6875
7065
|
*/
|
|
6876
|
-
preRender(showPreRenderByDefault?: boolean): TsEmbed
|
|
7066
|
+
preRender(showPreRenderByDefault?: boolean): Promise<TsEmbed>;
|
|
6877
7067
|
/**
|
|
6878
7068
|
* Get the Post Url Params for THOUGHTSPOT from the current
|
|
6879
7069
|
* host app URL.
|
|
@@ -6904,7 +7094,7 @@ export declare class TsEmbed {
|
|
|
6904
7094
|
* Also, synchronizes the style of the PreRender component with the embedding
|
|
6905
7095
|
* element.
|
|
6906
7096
|
*/
|
|
6907
|
-
showPreRender():
|
|
7097
|
+
showPreRender(): Promise<TsEmbed>;
|
|
6908
7098
|
/**
|
|
6909
7099
|
* Synchronizes the style properties of the PreRender component with the embedding
|
|
6910
7100
|
* element. This function adjusts the position, width, and height of the PreRender
|
|
@@ -7056,512 +7246,56 @@ export type HostEventResponse<HostEventT extends HostEvent> = HostEventT extends
|
|
|
7056
7246
|
export type TriggerPayload<PayloadT, HostEventT extends HostEvent> = PayloadT | HostEventRequest<HostEventT>;
|
|
7057
7247
|
export type TriggerResponse<PayloadT, HostEventT extends HostEvent> = PayloadT extends HostEventRequest<HostEventT> ? HostEventResponse<HostEventT> : any;
|
|
7058
7248
|
|
|
7059
|
-
export interface executeTMLInput {
|
|
7060
|
-
metadata_tmls: string[];
|
|
7061
|
-
import_policy?: 'PARTIAL' | 'ALL_OR_NONE' | 'VALIDATE_ONLY';
|
|
7062
|
-
create_new?: boolean;
|
|
7063
|
-
}
|
|
7064
|
-
export interface exportTMLInput {
|
|
7065
|
-
metadata: {
|
|
7066
|
-
identifier: string;
|
|
7067
|
-
type?: 'LIVEBOARD' | 'ANSWER' | 'LOGICAL_TABLE' | 'CONNECTION';
|
|
7068
|
-
}[];
|
|
7069
|
-
export_associated?: boolean;
|
|
7070
|
-
export_fqn?: boolean;
|
|
7071
|
-
edoc_format?: 'YAML' | 'JSON';
|
|
7072
|
-
}
|
|
7073
|
-
export declare let authPromise: Promise<boolean>;
|
|
7074
|
-
export declare const getAuthPromise: () => Promise<boolean>;
|
|
7075
|
-
export { notifyAuthFailure, notifyAuthSDKSuccess, notifyAuthSuccess, notifyLogout, };
|
|
7076
|
-
/**
|
|
7077
|
-
* Perform authentication on the ThoughtSpot app as applicable.
|
|
7078
|
-
*/
|
|
7079
|
-
export declare const handleAuth: () => Promise<boolean>;
|
|
7080
|
-
/**
|
|
7081
|
-
* Prefetches static resources from the specified URL. Web browsers can then cache the
|
|
7082
|
-
* prefetched resources and serve them from the user's local disk to provide faster access
|
|
7083
|
-
* to your app.
|
|
7084
|
-
* @param url The URL provided for prefetch
|
|
7085
|
-
* @param prefetchFeatures Specify features which needs to be prefetched.
|
|
7086
|
-
* @param additionalFlags This can be used to add any URL flag.
|
|
7087
|
-
* @version SDK: 1.4.0 | ThoughtSpot: ts7.sep.cl, 7.2.1
|
|
7088
|
-
* @group Global methods
|
|
7089
|
-
*/
|
|
7090
|
-
export declare const prefetch: (url?: string, prefetchFeatures?: PrefetchFeatures[], additionalFlags?: {
|
|
7091
|
-
[key: string]: string | number | boolean;
|
|
7092
|
-
}) => void;
|
|
7093
|
-
/**
|
|
7094
|
-
* Initializes the Visual Embed SDK globally and perform
|
|
7095
|
-
* authentication if applicable. This function needs to be called before any ThoughtSpot
|
|
7096
|
-
* component like Liveboard etc can be embedded. But need not wait for AuthEvent.SUCCESS
|
|
7097
|
-
* to actually embed. That is handled internally.
|
|
7098
|
-
* @param embedConfig The configuration object containing ThoughtSpot host,
|
|
7099
|
-
* authentication mechanism and so on.
|
|
7100
|
-
* @example
|
|
7101
|
-
* ```js
|
|
7102
|
-
* const authStatus = init({
|
|
7103
|
-
* thoughtSpotHost: 'https://my.thoughtspot.cloud',
|
|
7104
|
-
* authType: AuthType.None,
|
|
7105
|
-
* });
|
|
7106
|
-
* authStatus.on(AuthStatus.FAILURE, (reason) => { // do something here });
|
|
7107
|
-
* ```
|
|
7108
|
-
* @returns {@link AuthEventEmitter} event emitter which emits events on authentication success,
|
|
7109
|
-
* failure and logout. See {@link AuthStatus}
|
|
7110
|
-
* @version SDK: 1.0.0 | ThoughtSpot ts7.april.cl, 7.2.1
|
|
7111
|
-
* @group Authentication / Init
|
|
7112
|
-
*/
|
|
7113
|
-
export declare const init: (embedConfig: EmbedConfig) => AuthEventEmitter;
|
|
7114
|
-
/**
|
|
7115
|
-
*
|
|
7116
|
-
*/
|
|
7117
|
-
export declare function disableAutoLogin(): void;
|
|
7118
|
-
/**
|
|
7119
|
-
* Logs out from ThoughtSpot. This also sets the autoLogin flag to false, to
|
|
7120
|
-
* prevent the SDK from automatically logging in again.
|
|
7121
|
-
*
|
|
7122
|
-
* You can call the `init` method again to re login, if autoLogin is set to
|
|
7123
|
-
* true in this second call it will be honored.
|
|
7124
|
-
* @param doNotDisableAutoLogin This flag when passed will not disable autoLogin
|
|
7125
|
-
* @returns Promise which resolves when logout completes.
|
|
7126
|
-
* @version SDK: 1.10.1 | ThoughtSpot: 8.2.0.cl, 8.4.1-sw
|
|
7127
|
-
* @group Global methods
|
|
7128
|
-
*/
|
|
7129
|
-
export declare const logout: (doNotDisableAutoLogin?: boolean) => Promise<boolean>;
|
|
7130
|
-
/**
|
|
7131
|
-
* Renders functions in a queue, resolves to next function only after the callback next
|
|
7132
|
-
* is called
|
|
7133
|
-
* @param fn The function being registered
|
|
7134
|
-
*/
|
|
7135
|
-
export declare const renderInQueue: (fn: (next?: (val?: any) => void) => Promise<any>) => Promise<any>;
|
|
7136
|
-
/**
|
|
7137
|
-
* Imports TML representation of the metadata objects into ThoughtSpot.
|
|
7138
|
-
* @param data
|
|
7139
|
-
* @returns imports TML data into ThoughtSpot
|
|
7140
|
-
* @example
|
|
7141
|
-
* ```js
|
|
7142
|
-
* executeTML({
|
|
7143
|
-
* //Array of metadata Tmls in string format
|
|
7144
|
-
* metadata_tmls: [
|
|
7145
|
-
* "'\''{\"guid\":\"9bd202f5-d431-44bf-9a07-b4f7be372125\",
|
|
7146
|
-
* \"liveboard\":{\"name\":\"Parameters Liveboard\"}}'\''"
|
|
7147
|
-
* ],
|
|
7148
|
-
* import_policy: 'PARTIAL', // Specifies the import policy for the TML import.
|
|
7149
|
-
* create_new: false, // If selected, creates TML objects with new GUIDs.
|
|
7150
|
-
* }).then(result => {
|
|
7151
|
-
* console.log(result);
|
|
7152
|
-
* }).catch(error => {
|
|
7153
|
-
* console.error(error);
|
|
7154
|
-
* });
|
|
7155
|
-
*```
|
|
7156
|
-
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
7157
|
-
* @group Global methods
|
|
7158
|
-
*/
|
|
7159
|
-
export declare const executeTML: (data: executeTMLInput) => Promise<any>;
|
|
7160
|
-
/**
|
|
7161
|
-
* Exports TML representation of the metadata objects from ThoughtSpot in JSON or YAML
|
|
7162
|
-
* format.
|
|
7163
|
-
* @param data
|
|
7164
|
-
* @returns exports TML data
|
|
7165
|
-
* @example
|
|
7166
|
-
* ```js
|
|
7167
|
-
* exportTML({
|
|
7168
|
-
* metadata: [
|
|
7169
|
-
* {
|
|
7170
|
-
* type: "LIVEBOARD", //Metadata Type
|
|
7171
|
-
* identifier: "9bd202f5-d431-44bf-9a07-b4f7be372125" //Metadata Id
|
|
7172
|
-
* }
|
|
7173
|
-
* ],
|
|
7174
|
-
* export_associated: false,//indicates whether to export associated metadata objects
|
|
7175
|
-
* export_fqn: false, //Adds FQNs of the referenced objects.For example, if you are
|
|
7176
|
-
* //exporting a Liveboard and its associated objects, the API
|
|
7177
|
-
* //returns the Liveboard TML data with the FQNs of the referenced
|
|
7178
|
-
* //worksheet. If the exported TML data includes FQNs, you don't need
|
|
7179
|
-
* //to manually add FQNs of the referenced objects during TML import.
|
|
7180
|
-
* edoc_format: "JSON" //It takes JSON or YAML value
|
|
7181
|
-
* }).then(result => {
|
|
7182
|
-
* console.log(result);
|
|
7183
|
-
* }).catch(error => {
|
|
7184
|
-
* console.error(error);
|
|
7185
|
-
* });
|
|
7186
|
-
* ```
|
|
7187
|
-
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
7188
|
-
* @group Global methods
|
|
7189
|
-
*/
|
|
7190
|
-
export declare const exportTML: (data: exportTMLInput) => Promise<any>;
|
|
7191
|
-
/**
|
|
7192
|
-
*
|
|
7193
|
-
*/
|
|
7194
|
-
export declare function reset(): void;
|
|
7195
|
-
|
|
7196
7249
|
/**
|
|
7197
|
-
*
|
|
7198
|
-
*
|
|
7250
|
+
* The list of customization css variables. These
|
|
7251
|
+
* are the only allowed variables possible.
|
|
7199
7252
|
*/
|
|
7200
|
-
export interface
|
|
7253
|
+
export interface CustomCssVariables {
|
|
7201
7254
|
/**
|
|
7202
|
-
*
|
|
7255
|
+
* Background color of the Liveboard, visualization, Search, and Answer pages.
|
|
7203
7256
|
*/
|
|
7204
|
-
|
|
7205
|
-
}
|
|
7206
|
-
/**
|
|
7207
|
-
* Create a conversation embed, which can be integrated inside
|
|
7208
|
-
* chatbots or other conversational interfaces.
|
|
7209
|
-
* @example
|
|
7210
|
-
* ```js
|
|
7211
|
-
* import { BodylessConversation } from '@thoughtspot/visual-embed-sdk';
|
|
7212
|
-
*
|
|
7213
|
-
* const conversation = new BodylessConversation({
|
|
7214
|
-
* worksheetId: 'worksheetId',
|
|
7215
|
-
* });
|
|
7216
|
-
*
|
|
7217
|
-
* const { container, error } = await conversation.sendMessage('show me sales by region');
|
|
7218
|
-
*
|
|
7219
|
-
* // append the container to the DOM
|
|
7220
|
-
* document.body.appendChild(container); // or to any other element
|
|
7221
|
-
* ```
|
|
7222
|
-
* @group Embed components
|
|
7223
|
-
* @version SDK: 1.33.1 | ThoughtSpot: 10.5.0.cl
|
|
7224
|
-
*/
|
|
7225
|
-
export declare class BodylessConversation {
|
|
7226
|
-
constructor(viewConfig: BodylessConversationViewConfig);
|
|
7227
|
-
sendMessage(userMessage: string): Promise<{
|
|
7228
|
-
error: any;
|
|
7229
|
-
container?: undefined;
|
|
7230
|
-
} | {
|
|
7231
|
-
container: HTMLDivElement;
|
|
7232
|
-
error?: undefined;
|
|
7233
|
-
}>;
|
|
7234
|
-
}
|
|
7235
|
-
|
|
7236
|
-
export declare let loggedInStatus: boolean;
|
|
7237
|
-
export declare let samlAuthWindow: Window;
|
|
7238
|
-
export declare let samlCompletionPromise: Promise<void>;
|
|
7239
|
-
export declare const SSO_REDIRECTION_MARKER_GUID = "5e16222e-ef02-43e9-9fbd-24226bf3ce5b";
|
|
7240
|
-
/**
|
|
7241
|
-
* Enum for auth failure types. This is the parameter passed to the listner
|
|
7242
|
-
* of {@link AuthStatus.FAILURE}.
|
|
7243
|
-
* @group Authentication / Init
|
|
7244
|
-
*/
|
|
7245
|
-
export declare enum AuthFailureType {
|
|
7246
|
-
SDK = "SDK",
|
|
7247
|
-
NO_COOKIE_ACCESS = "NO_COOKIE_ACCESS",
|
|
7248
|
-
EXPIRY = "EXPIRY",
|
|
7249
|
-
OTHER = "OTHER",
|
|
7250
|
-
IDLE_SESSION_TIMEOUT = "IDLE_SESSION_TIMEOUT"
|
|
7251
|
-
}
|
|
7252
|
-
/**
|
|
7253
|
-
* Enum for auth status emitted by the emitter returned from {@link init}.
|
|
7254
|
-
* @group Authentication / Init
|
|
7255
|
-
*/
|
|
7256
|
-
export declare enum AuthStatus {
|
|
7257
|
+
'--ts-var-root-background'?: string;
|
|
7257
7258
|
/**
|
|
7258
|
-
*
|
|
7259
|
+
* Color of the text on application pages.
|
|
7259
7260
|
*/
|
|
7260
|
-
|
|
7261
|
+
'--ts-var-root-color'?: string;
|
|
7261
7262
|
/**
|
|
7262
|
-
*
|
|
7263
|
+
* Font type for the text on application pages.
|
|
7263
7264
|
*/
|
|
7264
|
-
|
|
7265
|
+
'--ts-var-root-font-family'?: string;
|
|
7265
7266
|
/**
|
|
7266
|
-
*
|
|
7267
|
-
* Emits when iframe is loaded and session info is available
|
|
7267
|
+
* Text transformation specification for UI elements in the app.
|
|
7268
7268
|
*/
|
|
7269
|
-
|
|
7269
|
+
'--ts-var-root-text-transform'?: string;
|
|
7270
7270
|
/**
|
|
7271
|
-
*
|
|
7271
|
+
* Font color of the text on toggle buttons such as
|
|
7272
|
+
* **All**, **Answers**, and **Liveboards** on the Home page (Classic experience),
|
|
7273
|
+
* the text color of the chart and table tiles on Home page (New modular Homepage
|
|
7274
|
+
* experience), and title text on the AI-generated charts and tables.
|
|
7275
|
+
* The default color code is #2770EF.
|
|
7276
|
+
*
|
|
7272
7277
|
*/
|
|
7273
|
-
|
|
7278
|
+
'--ts-var-application-color'?: string;
|
|
7274
7279
|
/**
|
|
7275
|
-
*
|
|
7280
|
+
* Background color of the top navigation panel.
|
|
7276
7281
|
*/
|
|
7277
|
-
|
|
7282
|
+
'--ts-var-nav-background'?: string;
|
|
7278
7283
|
/**
|
|
7279
|
-
*
|
|
7280
|
-
* popup is waiting to be triggered either programmatically
|
|
7281
|
-
* or by the trigger button.
|
|
7282
|
-
* @version SDK: 1.19.0
|
|
7284
|
+
* Font color of the top navigation panel.
|
|
7283
7285
|
*/
|
|
7284
|
-
|
|
7285
|
-
}
|
|
7286
|
-
/**
|
|
7287
|
-
* Event emitter returned from {@link init}.
|
|
7288
|
-
* @group Authentication / Init
|
|
7289
|
-
*/
|
|
7290
|
-
export interface AuthEventEmitter {
|
|
7286
|
+
'--ts-var-nav-color'?: string;
|
|
7291
7287
|
/**
|
|
7292
|
-
*
|
|
7293
|
-
* @param event
|
|
7294
|
-
* @param listener
|
|
7288
|
+
* Background color of the *Search data* button.
|
|
7295
7289
|
*/
|
|
7296
|
-
|
|
7290
|
+
'--ts-var-search-data-button-background'?: string;
|
|
7297
7291
|
/**
|
|
7298
|
-
*
|
|
7299
|
-
* @param event
|
|
7300
|
-
* @param listener
|
|
7292
|
+
* Color of the text on the *Search data* button.
|
|
7301
7293
|
*/
|
|
7302
|
-
|
|
7303
|
-
on(event: AuthStatus.SUCCESS, listener: (sessionInfo: any) => void): this;
|
|
7304
|
-
once(event: AuthStatus.FAILURE, listener: (failureType: AuthFailureType) => void): this;
|
|
7305
|
-
once(event: AuthStatus.SDK_SUCCESS | AuthStatus.LOGOUT | AuthStatus.WAITING_FOR_POPUP, listener: () => void): this;
|
|
7306
|
-
once(event: AuthStatus.SUCCESS, listener: (sessionInfo: any) => void): this;
|
|
7294
|
+
'--ts-var-search-data-button-font-color'?: string;
|
|
7307
7295
|
/**
|
|
7308
|
-
*
|
|
7309
|
-
* @param {@link AuthEvent}
|
|
7296
|
+
* Font of the text on the *Search data* button.
|
|
7310
7297
|
*/
|
|
7311
|
-
|
|
7312
|
-
/**
|
|
7313
|
-
* Remove listener from the emitter returned from init.
|
|
7314
|
-
* @param event
|
|
7315
|
-
* @param listener
|
|
7316
|
-
* @param context
|
|
7317
|
-
* @param once
|
|
7318
|
-
*/
|
|
7319
|
-
off(event: AuthStatus, listener: (...args: any[]) => void, context: any, once: boolean): this;
|
|
7320
|
-
/**
|
|
7321
|
-
* Remove all the event listeners
|
|
7322
|
-
* @param event
|
|
7323
|
-
*/
|
|
7324
|
-
removeAllListeners(event: AuthStatus): this;
|
|
7325
|
-
}
|
|
7326
|
-
/**
|
|
7327
|
-
* Events which can be triggered on the emitter returned from {@link init}.
|
|
7328
|
-
* @group Authentication / Init
|
|
7329
|
-
*/
|
|
7330
|
-
export declare enum AuthEvent {
|
|
7331
|
-
/**
|
|
7332
|
-
* Manually trigger the SSO popup. This is useful when
|
|
7333
|
-
* authStatus is SAMLRedirect/OIDCRedirect and inPopup is set to true
|
|
7334
|
-
*/
|
|
7335
|
-
TRIGGER_SSO_POPUP = "TRIGGER_SSO_POPUP"
|
|
7336
|
-
}
|
|
7337
|
-
/**
|
|
7338
|
-
*
|
|
7339
|
-
*/
|
|
7340
|
-
export declare function getAuthEE(): EventEmitter<AuthStatus | AuthEvent>;
|
|
7341
|
-
/**
|
|
7342
|
-
*
|
|
7343
|
-
* @param eventEmitter
|
|
7344
|
-
*/
|
|
7345
|
-
export declare function setAuthEE(eventEmitter: EventEmitter<AuthStatus | AuthEvent>): void;
|
|
7346
|
-
/**
|
|
7347
|
-
*
|
|
7348
|
-
*/
|
|
7349
|
-
export declare function notifyAuthSDKSuccess(): void;
|
|
7350
|
-
/**
|
|
7351
|
-
*
|
|
7352
|
-
*/
|
|
7353
|
-
export declare function notifyAuthSuccess(): Promise<void>;
|
|
7354
|
-
/**
|
|
7355
|
-
*
|
|
7356
|
-
* @param failureType
|
|
7357
|
-
*/
|
|
7358
|
-
export declare function notifyAuthFailure(failureType: AuthFailureType): void;
|
|
7359
|
-
/**
|
|
7360
|
-
*
|
|
7361
|
-
*/
|
|
7362
|
-
export declare function notifyLogout(): void;
|
|
7363
|
-
/**
|
|
7364
|
-
* Services to be called after the login is successful,
|
|
7365
|
-
* This should be called after the cookie is set for cookie auth or
|
|
7366
|
-
* after the token is set for cookieless.
|
|
7367
|
-
* @return {Promise<void>}
|
|
7368
|
-
* @example
|
|
7369
|
-
* ```js
|
|
7370
|
-
* await postLoginService();
|
|
7371
|
-
* ```
|
|
7372
|
-
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
7373
|
-
*/
|
|
7374
|
-
export declare function postLoginService(): Promise<void>;
|
|
7375
|
-
/**
|
|
7376
|
-
* Return releaseVersion if available
|
|
7377
|
-
*/
|
|
7378
|
-
export declare function getReleaseVersion(): string;
|
|
7379
|
-
/**
|
|
7380
|
-
* Perform token based authentication
|
|
7381
|
-
* @param embedConfig The embed configuration
|
|
7382
|
-
*/
|
|
7383
|
-
export declare const doTokenAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
7384
|
-
/**
|
|
7385
|
-
* Validate embedConfig parameters required for cookielessTokenAuth
|
|
7386
|
-
* @param embedConfig The embed configuration
|
|
7387
|
-
*/
|
|
7388
|
-
export declare const doCookielessTokenAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
7389
|
-
/**
|
|
7390
|
-
* Perform basic authentication to the ThoughtSpot cluster using the cluster
|
|
7391
|
-
* credentials.
|
|
7392
|
-
*
|
|
7393
|
-
* Warning: This feature is primarily intended for developer testing. It is
|
|
7394
|
-
* strongly advised not to use this authentication method in production.
|
|
7395
|
-
* @param embedConfig The embed configuration
|
|
7396
|
-
*/
|
|
7397
|
-
export declare const doBasicAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
7398
|
-
export declare const doSamlAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
7399
|
-
export declare const doOIDCAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
7400
|
-
export declare const logout: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
7401
|
-
/**
|
|
7402
|
-
* Perform authentication on the ThoughtSpot cluster
|
|
7403
|
-
* @param embedConfig The embed configuration
|
|
7404
|
-
*/
|
|
7405
|
-
export declare const authenticate: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
7406
|
-
/**
|
|
7407
|
-
* Check if we are authenticated to the ThoughtSpot cluster
|
|
7408
|
-
*/
|
|
7409
|
-
export declare const isAuthenticated: () => boolean;
|
|
7410
|
-
|
|
7411
|
-
export type SessionInfo = {
|
|
7412
|
-
releaseVersion: string;
|
|
7413
|
-
userGUID: string;
|
|
7414
|
-
currentOrgId: number;
|
|
7415
|
-
privileges: string[];
|
|
7416
|
-
mixpanelToken: string;
|
|
7417
|
-
isPublicUser: boolean;
|
|
7418
|
-
clusterId: string;
|
|
7419
|
-
clusterName: string;
|
|
7420
|
-
[key: string]: any;
|
|
7421
|
-
};
|
|
7422
|
-
export type PreauthInfo = {
|
|
7423
|
-
info?: SessionInfo;
|
|
7424
|
-
headers: Record<string, string>;
|
|
7425
|
-
status: number;
|
|
7426
|
-
[key: string]: any;
|
|
7427
|
-
};
|
|
7428
|
-
/**
|
|
7429
|
-
* Processes the session info response and returns the session info object.
|
|
7430
|
-
* @param preauthInfoResp {any} Response from the session info API.
|
|
7431
|
-
* @returns {PreauthInfo} The session info object.
|
|
7432
|
-
* @example ```js
|
|
7433
|
-
* const preauthInfoResp = await fetch(sessionInfoPath);
|
|
7434
|
-
* const sessionInfo = await formatPreauthInfo(preauthInfoResp);
|
|
7435
|
-
* console.log(sessionInfo);
|
|
7436
|
-
* ```
|
|
7437
|
-
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
7438
|
-
*/
|
|
7439
|
-
export declare const formatPreauthInfo: (preauthInfoResp: any) => Promise<PreauthInfo>;
|
|
7440
|
-
/**
|
|
7441
|
-
* Returns the session info object and caches it for future use.
|
|
7442
|
-
* Once fetched the session info object is cached and returned from the cache on
|
|
7443
|
-
* subsequent calls.
|
|
7444
|
-
* @example ```js
|
|
7445
|
-
* const preauthInfo = await getPreauthInfo();
|
|
7446
|
-
* console.log(preauthInfo);
|
|
7447
|
-
* ```
|
|
7448
|
-
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
7449
|
-
* @returns {Promise<SessionInfo>} The session info object.
|
|
7450
|
-
*/
|
|
7451
|
-
export declare function getPreauthInfo(allowCache?: boolean): Promise<PreauthInfo>;
|
|
7452
|
-
/**
|
|
7453
|
-
* Returns the cached session info object and caches it for future use.
|
|
7454
|
-
* Once fetched the session info object is cached and returned from the cache on
|
|
7455
|
-
* subsequent calls.
|
|
7456
|
-
* This cache is cleared when inti is called OR resetCachedSessionInfo is called.
|
|
7457
|
-
* @example ```js
|
|
7458
|
-
* const sessionInfo = await getSessionInfo();
|
|
7459
|
-
* console.log(sessionInfo);
|
|
7460
|
-
* ```
|
|
7461
|
-
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
7462
|
-
* @returns {Promise<SessionInfo>} The session info object.
|
|
7463
|
-
*/
|
|
7464
|
-
export declare function getSessionInfo(): Promise<SessionInfo>;
|
|
7465
|
-
/**
|
|
7466
|
-
* Returns the cached session info object. If the client is not authenticated the
|
|
7467
|
-
* function will return null.
|
|
7468
|
-
* @example ```js
|
|
7469
|
-
* const sessionInfo = getCachedSessionInfo();
|
|
7470
|
-
* if (sessionInfo) {
|
|
7471
|
-
* console.log(sessionInfo);
|
|
7472
|
-
* } else {
|
|
7473
|
-
* console.log('Not authenticated');
|
|
7474
|
-
* }
|
|
7475
|
-
* ```
|
|
7476
|
-
* @returns {SessionInfo | null} The session info object.
|
|
7477
|
-
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
7478
|
-
*/
|
|
7479
|
-
export declare function getCachedSessionInfo(): SessionInfo | null;
|
|
7480
|
-
/**
|
|
7481
|
-
* Processes the session info response and returns the session info object.
|
|
7482
|
-
* @param sessionInfoResp {any} Response from the session info API.
|
|
7483
|
-
* @returns {SessionInfo} The session info object.
|
|
7484
|
-
* @example ```js
|
|
7485
|
-
* const sessionInfoResp = await fetch(sessionInfoPath);
|
|
7486
|
-
* const sessionInfo = getSessionDetails(sessionInfoResp);
|
|
7487
|
-
* console.log(sessionInfo);
|
|
7488
|
-
* ```
|
|
7489
|
-
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
7490
|
-
*/
|
|
7491
|
-
export declare const getSessionDetails: (sessionInfoResp: any) => SessionInfo;
|
|
7492
|
-
/**
|
|
7493
|
-
* Resets the cached session info object and forces a new fetch on the next call.
|
|
7494
|
-
* @example ```js
|
|
7495
|
-
* resetCachedSessionInfo();
|
|
7496
|
-
* const sessionInfo = await getSessionInfo();
|
|
7497
|
-
* console.log(sessionInfo);
|
|
7498
|
-
* ```
|
|
7499
|
-
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
7500
|
-
* @returns {void}
|
|
7501
|
-
*/
|
|
7502
|
-
export declare function resetCachedSessionInfo(): void;
|
|
7503
|
-
/**
|
|
7504
|
-
* Resets the cached preauth info object and forces a new fetch on the next call.
|
|
7505
|
-
* @example ```js
|
|
7506
|
-
* resetCachedPreauthInfo();
|
|
7507
|
-
* const preauthInfo = await getPreauthInfo();
|
|
7508
|
-
* console.log(preauthInfo);
|
|
7509
|
-
* ```
|
|
7510
|
-
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
7511
|
-
* @returns {void}
|
|
7512
|
-
*/
|
|
7513
|
-
export declare function resetCachedPreauthInfo(): void;
|
|
7514
|
-
|
|
7515
|
-
/**
|
|
7516
|
-
* The list of customization css variables. These
|
|
7517
|
-
* are the only allowed variables possible.
|
|
7518
|
-
*/
|
|
7519
|
-
export interface CustomCssVariables {
|
|
7520
|
-
/**
|
|
7521
|
-
* Background color of the Liveboard, visualization, Search, and Answer pages.
|
|
7522
|
-
*/
|
|
7523
|
-
'--ts-var-root-background'?: string;
|
|
7524
|
-
/**
|
|
7525
|
-
* Color of the text on application pages.
|
|
7526
|
-
*/
|
|
7527
|
-
'--ts-var-root-color'?: string;
|
|
7528
|
-
/**
|
|
7529
|
-
* Font type for the text on application pages.
|
|
7530
|
-
*/
|
|
7531
|
-
'--ts-var-root-font-family'?: string;
|
|
7532
|
-
/**
|
|
7533
|
-
* Text transformation specification for UI elements in the app.
|
|
7534
|
-
*/
|
|
7535
|
-
'--ts-var-root-text-transform'?: string;
|
|
7536
|
-
/**
|
|
7537
|
-
* Font color of the text on toggle buttons such as
|
|
7538
|
-
* **All**, **Answers**, and **Liveboards** on the Home page (Classic experience),
|
|
7539
|
-
* the text color of the chart and table tiles on Home page (New modular Homepage
|
|
7540
|
-
* experience), and title text on the AI-generated charts and tables.
|
|
7541
|
-
* The default color code is #2770EF.
|
|
7542
|
-
*
|
|
7543
|
-
*/
|
|
7544
|
-
'--ts-var-application-color'?: string;
|
|
7545
|
-
/**
|
|
7546
|
-
* Background color of the top navigation panel.
|
|
7547
|
-
*/
|
|
7548
|
-
'--ts-var-nav-background'?: string;
|
|
7549
|
-
/**
|
|
7550
|
-
* Font color of the top navigation panel.
|
|
7551
|
-
*/
|
|
7552
|
-
'--ts-var-nav-color'?: string;
|
|
7553
|
-
/**
|
|
7554
|
-
* Background color of the *Search data* button.
|
|
7555
|
-
*/
|
|
7556
|
-
'--ts-var-search-data-button-background'?: string;
|
|
7557
|
-
/**
|
|
7558
|
-
* Color of the text on the *Search data* button.
|
|
7559
|
-
*/
|
|
7560
|
-
'--ts-var-search-data-button-font-color'?: string;
|
|
7561
|
-
/**
|
|
7562
|
-
* Font of the text on the *Search data* button.
|
|
7563
|
-
*/
|
|
7564
|
-
'--ts-var-search-data-button-font-family'?: string;
|
|
7298
|
+
'--ts-var-search-data-button-font-family'?: string;
|
|
7565
7299
|
/**
|
|
7566
7300
|
* Font color of the text in the Search bar.
|
|
7567
7301
|
*/
|
|
@@ -8078,6 +7812,291 @@ export declare class AnswerService {
|
|
|
8078
7812
|
setTMLOverride(override: any): void;
|
|
8079
7813
|
}
|
|
8080
7814
|
|
|
7815
|
+
import '../utils/with-resolvers-polyfill';
|
|
7816
|
+
export interface executeTMLInput {
|
|
7817
|
+
metadata_tmls: string[];
|
|
7818
|
+
import_policy?: 'PARTIAL' | 'ALL_OR_NONE' | 'VALIDATE_ONLY';
|
|
7819
|
+
create_new?: boolean;
|
|
7820
|
+
}
|
|
7821
|
+
export interface exportTMLInput {
|
|
7822
|
+
metadata: {
|
|
7823
|
+
identifier: string;
|
|
7824
|
+
type?: 'LIVEBOARD' | 'ANSWER' | 'LOGICAL_TABLE' | 'CONNECTION';
|
|
7825
|
+
}[];
|
|
7826
|
+
export_associated?: boolean;
|
|
7827
|
+
export_fqn?: boolean;
|
|
7828
|
+
edoc_format?: 'YAML' | 'JSON';
|
|
7829
|
+
}
|
|
7830
|
+
export declare let authPromise: Promise<boolean>;
|
|
7831
|
+
export declare const getAuthPromise: () => Promise<boolean>;
|
|
7832
|
+
export { notifyAuthFailure, notifyAuthSDKSuccess, notifyAuthSuccess, notifyLogout, };
|
|
7833
|
+
/**
|
|
7834
|
+
* Perform authentication on the ThoughtSpot app as applicable.
|
|
7835
|
+
*/
|
|
7836
|
+
export declare const handleAuth: () => Promise<boolean>;
|
|
7837
|
+
/**
|
|
7838
|
+
* Prefetches static resources from the specified URL. Web browsers can then cache the
|
|
7839
|
+
* prefetched resources and serve them from the user's local disk to provide faster access
|
|
7840
|
+
* to your app.
|
|
7841
|
+
* @param url The URL provided for prefetch
|
|
7842
|
+
* @param prefetchFeatures Specify features which needs to be prefetched.
|
|
7843
|
+
* @param additionalFlags This can be used to add any URL flag.
|
|
7844
|
+
* @version SDK: 1.4.0 | ThoughtSpot: ts7.sep.cl, 7.2.1
|
|
7845
|
+
* @group Global methods
|
|
7846
|
+
*/
|
|
7847
|
+
export declare const prefetch: (url?: string, prefetchFeatures?: PrefetchFeatures[], additionalFlags?: {
|
|
7848
|
+
[key: string]: string | number | boolean;
|
|
7849
|
+
}) => void;
|
|
7850
|
+
export declare const createAndSetInitPromise: () => void;
|
|
7851
|
+
export declare const getInitPromise: () => Promise<ReturnType<typeof init>>;
|
|
7852
|
+
export declare const getIsInitCalled: () => boolean;
|
|
7853
|
+
/**
|
|
7854
|
+
* Initializes the Visual Embed SDK globally and perform
|
|
7855
|
+
* authentication if applicable. This function needs to be called before any ThoughtSpot
|
|
7856
|
+
* component like Liveboard etc can be embedded. But need not wait for AuthEvent.SUCCESS
|
|
7857
|
+
* to actually embed. That is handled internally.
|
|
7858
|
+
* @param embedConfig The configuration object containing ThoughtSpot host,
|
|
7859
|
+
* authentication mechanism and so on.
|
|
7860
|
+
* @example
|
|
7861
|
+
* ```js
|
|
7862
|
+
* const authStatus = init({
|
|
7863
|
+
* thoughtSpotHost: 'https://my.thoughtspot.cloud',
|
|
7864
|
+
* authType: AuthType.None,
|
|
7865
|
+
* });
|
|
7866
|
+
* authStatus.on(AuthStatus.FAILURE, (reason) => { // do something here });
|
|
7867
|
+
* ```
|
|
7868
|
+
* @returns {@link AuthEventEmitter} event emitter which emits events on authentication success,
|
|
7869
|
+
* failure and logout. See {@link AuthStatus}
|
|
7870
|
+
* @version SDK: 1.0.0 | ThoughtSpot ts7.april.cl, 7.2.1
|
|
7871
|
+
* @group Authentication / Init
|
|
7872
|
+
*/
|
|
7873
|
+
export declare const init: (embedConfig: EmbedConfig) => AuthEventEmitter;
|
|
7874
|
+
/**
|
|
7875
|
+
*
|
|
7876
|
+
*/
|
|
7877
|
+
export declare function disableAutoLogin(): void;
|
|
7878
|
+
/**
|
|
7879
|
+
* Logs out from ThoughtSpot. This also sets the autoLogin flag to false, to
|
|
7880
|
+
* prevent the SDK from automatically logging in again.
|
|
7881
|
+
*
|
|
7882
|
+
* You can call the `init` method again to re login, if autoLogin is set to
|
|
7883
|
+
* true in this second call it will be honored.
|
|
7884
|
+
* @param doNotDisableAutoLogin This flag when passed will not disable autoLogin
|
|
7885
|
+
* @returns Promise which resolves when logout completes.
|
|
7886
|
+
* @version SDK: 1.10.1 | ThoughtSpot: 8.2.0.cl, 8.4.1-sw
|
|
7887
|
+
* @group Global methods
|
|
7888
|
+
*/
|
|
7889
|
+
export declare const logout: (doNotDisableAutoLogin?: boolean) => Promise<boolean>;
|
|
7890
|
+
/**
|
|
7891
|
+
* Renders functions in a queue, resolves to next function only after the callback next
|
|
7892
|
+
* is called
|
|
7893
|
+
* @param fn The function being registered
|
|
7894
|
+
*/
|
|
7895
|
+
export declare const renderInQueue: (fn: (next?: (val?: any) => void) => Promise<any>) => Promise<any>;
|
|
7896
|
+
/**
|
|
7897
|
+
* Imports TML representation of the metadata objects into ThoughtSpot.
|
|
7898
|
+
* @param data
|
|
7899
|
+
* @returns imports TML data into ThoughtSpot
|
|
7900
|
+
* @example
|
|
7901
|
+
* ```js
|
|
7902
|
+
* executeTML({
|
|
7903
|
+
* //Array of metadata Tmls in string format
|
|
7904
|
+
* metadata_tmls: [
|
|
7905
|
+
* "'\''{\"guid\":\"9bd202f5-d431-44bf-9a07-b4f7be372125\",
|
|
7906
|
+
* \"liveboard\":{\"name\":\"Parameters Liveboard\"}}'\''"
|
|
7907
|
+
* ],
|
|
7908
|
+
* import_policy: 'PARTIAL', // Specifies the import policy for the TML import.
|
|
7909
|
+
* create_new: false, // If selected, creates TML objects with new GUIDs.
|
|
7910
|
+
* }).then(result => {
|
|
7911
|
+
* console.log(result);
|
|
7912
|
+
* }).catch(error => {
|
|
7913
|
+
* console.error(error);
|
|
7914
|
+
* });
|
|
7915
|
+
*```
|
|
7916
|
+
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
7917
|
+
* @group Global methods
|
|
7918
|
+
*/
|
|
7919
|
+
export declare const executeTML: (data: executeTMLInput) => Promise<any>;
|
|
7920
|
+
/**
|
|
7921
|
+
* Exports TML representation of the metadata objects from ThoughtSpot in JSON or YAML
|
|
7922
|
+
* format.
|
|
7923
|
+
* @param data
|
|
7924
|
+
* @returns exports TML data
|
|
7925
|
+
* @example
|
|
7926
|
+
* ```js
|
|
7927
|
+
* exportTML({
|
|
7928
|
+
* metadata: [
|
|
7929
|
+
* {
|
|
7930
|
+
* type: "LIVEBOARD", //Metadata Type
|
|
7931
|
+
* identifier: "9bd202f5-d431-44bf-9a07-b4f7be372125" //Metadata Id
|
|
7932
|
+
* }
|
|
7933
|
+
* ],
|
|
7934
|
+
* export_associated: false,//indicates whether to export associated metadata objects
|
|
7935
|
+
* export_fqn: false, //Adds FQNs of the referenced objects.For example, if you are
|
|
7936
|
+
* //exporting a Liveboard and its associated objects, the API
|
|
7937
|
+
* //returns the Liveboard TML data with the FQNs of the referenced
|
|
7938
|
+
* //worksheet. If the exported TML data includes FQNs, you don't need
|
|
7939
|
+
* //to manually add FQNs of the referenced objects during TML import.
|
|
7940
|
+
* edoc_format: "JSON" //It takes JSON or YAML value
|
|
7941
|
+
* }).then(result => {
|
|
7942
|
+
* console.log(result);
|
|
7943
|
+
* }).catch(error => {
|
|
7944
|
+
* console.error(error);
|
|
7945
|
+
* });
|
|
7946
|
+
* ```
|
|
7947
|
+
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
7948
|
+
* @group Global methods
|
|
7949
|
+
*/
|
|
7950
|
+
export declare const exportTML: (data: exportTMLInput) => Promise<any>;
|
|
7951
|
+
/**
|
|
7952
|
+
*
|
|
7953
|
+
*/
|
|
7954
|
+
export declare function reset(): void;
|
|
7955
|
+
|
|
7956
|
+
/**
|
|
7957
|
+
* Configuration for bodyless conversation options.
|
|
7958
|
+
* @group Embed components
|
|
7959
|
+
*/
|
|
7960
|
+
export interface BodylessConversationViewConfig extends ViewConfig {
|
|
7961
|
+
/**
|
|
7962
|
+
* The ID of the worksheet to use for the conversation.
|
|
7963
|
+
*/
|
|
7964
|
+
worksheetId: string;
|
|
7965
|
+
}
|
|
7966
|
+
/**
|
|
7967
|
+
* Create a conversation embed, which can be integrated inside
|
|
7968
|
+
* chatbots or other conversational interfaces.
|
|
7969
|
+
* @example
|
|
7970
|
+
* ```js
|
|
7971
|
+
* import { BodylessConversation } from '@thoughtspot/visual-embed-sdk';
|
|
7972
|
+
*
|
|
7973
|
+
* const conversation = new BodylessConversation({
|
|
7974
|
+
* worksheetId: 'worksheetId',
|
|
7975
|
+
* });
|
|
7976
|
+
*
|
|
7977
|
+
* const { container, error } = await conversation.sendMessage('show me sales by region');
|
|
7978
|
+
*
|
|
7979
|
+
* // append the container to the DOM
|
|
7980
|
+
* document.body.appendChild(container); // or to any other element
|
|
7981
|
+
* ```
|
|
7982
|
+
* @group Embed components
|
|
7983
|
+
* @version SDK: 1.33.1 | ThoughtSpot: 10.5.0.cl
|
|
7984
|
+
*/
|
|
7985
|
+
export declare class BodylessConversation {
|
|
7986
|
+
constructor(viewConfig: BodylessConversationViewConfig);
|
|
7987
|
+
sendMessage(userMessage: string): Promise<{
|
|
7988
|
+
error: any;
|
|
7989
|
+
container?: undefined;
|
|
7990
|
+
} | {
|
|
7991
|
+
container: HTMLDivElement;
|
|
7992
|
+
error?: undefined;
|
|
7993
|
+
}>;
|
|
7994
|
+
}
|
|
7995
|
+
|
|
7996
|
+
export type SessionInfo = {
|
|
7997
|
+
releaseVersion: string;
|
|
7998
|
+
userGUID: string;
|
|
7999
|
+
currentOrgId: number;
|
|
8000
|
+
privileges: string[];
|
|
8001
|
+
mixpanelToken: string;
|
|
8002
|
+
isPublicUser: boolean;
|
|
8003
|
+
clusterId: string;
|
|
8004
|
+
clusterName: string;
|
|
8005
|
+
[key: string]: any;
|
|
8006
|
+
};
|
|
8007
|
+
export type PreauthInfo = {
|
|
8008
|
+
info?: SessionInfo;
|
|
8009
|
+
headers: Record<string, string>;
|
|
8010
|
+
status: number;
|
|
8011
|
+
[key: string]: any;
|
|
8012
|
+
};
|
|
8013
|
+
/**
|
|
8014
|
+
* Processes the session info response and returns the session info object.
|
|
8015
|
+
* @param preauthInfoResp {any} Response from the session info API.
|
|
8016
|
+
* @returns {PreauthInfo} The session info object.
|
|
8017
|
+
* @example ```js
|
|
8018
|
+
* const preauthInfoResp = await fetch(sessionInfoPath);
|
|
8019
|
+
* const sessionInfo = await formatPreauthInfo(preauthInfoResp);
|
|
8020
|
+
* console.log(sessionInfo);
|
|
8021
|
+
* ```
|
|
8022
|
+
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
8023
|
+
*/
|
|
8024
|
+
export declare const formatPreauthInfo: (preauthInfoResp: any) => Promise<PreauthInfo>;
|
|
8025
|
+
/**
|
|
8026
|
+
* Returns the session info object and caches it for future use.
|
|
8027
|
+
* Once fetched the session info object is cached and returned from the cache on
|
|
8028
|
+
* subsequent calls.
|
|
8029
|
+
* @example ```js
|
|
8030
|
+
* const preauthInfo = await getPreauthInfo();
|
|
8031
|
+
* console.log(preauthInfo);
|
|
8032
|
+
* ```
|
|
8033
|
+
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
8034
|
+
* @returns {Promise<SessionInfo>} The session info object.
|
|
8035
|
+
*/
|
|
8036
|
+
export declare function getPreauthInfo(allowCache?: boolean): Promise<PreauthInfo>;
|
|
8037
|
+
/**
|
|
8038
|
+
* Returns the cached session info object and caches it for future use.
|
|
8039
|
+
* Once fetched the session info object is cached and returned from the cache on
|
|
8040
|
+
* subsequent calls.
|
|
8041
|
+
* This cache is cleared when inti is called OR resetCachedSessionInfo is called.
|
|
8042
|
+
* @example ```js
|
|
8043
|
+
* const sessionInfo = await getSessionInfo();
|
|
8044
|
+
* console.log(sessionInfo);
|
|
8045
|
+
* ```
|
|
8046
|
+
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
8047
|
+
* @returns {Promise<SessionInfo>} The session info object.
|
|
8048
|
+
*/
|
|
8049
|
+
export declare function getSessionInfo(): Promise<SessionInfo>;
|
|
8050
|
+
/**
|
|
8051
|
+
* Returns the cached session info object. If the client is not authenticated the
|
|
8052
|
+
* function will return null.
|
|
8053
|
+
* @example ```js
|
|
8054
|
+
* const sessionInfo = getCachedSessionInfo();
|
|
8055
|
+
* if (sessionInfo) {
|
|
8056
|
+
* console.log(sessionInfo);
|
|
8057
|
+
* } else {
|
|
8058
|
+
* console.log('Not authenticated');
|
|
8059
|
+
* }
|
|
8060
|
+
* ```
|
|
8061
|
+
* @returns {SessionInfo | null} The session info object.
|
|
8062
|
+
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
8063
|
+
*/
|
|
8064
|
+
export declare function getCachedSessionInfo(): SessionInfo | null;
|
|
8065
|
+
/**
|
|
8066
|
+
* Processes the session info response and returns the session info object.
|
|
8067
|
+
* @param sessionInfoResp {any} Response from the session info API.
|
|
8068
|
+
* @returns {SessionInfo} The session info object.
|
|
8069
|
+
* @example ```js
|
|
8070
|
+
* const sessionInfoResp = await fetch(sessionInfoPath);
|
|
8071
|
+
* const sessionInfo = getSessionDetails(sessionInfoResp);
|
|
8072
|
+
* console.log(sessionInfo);
|
|
8073
|
+
* ```
|
|
8074
|
+
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
8075
|
+
*/
|
|
8076
|
+
export declare const getSessionDetails: (sessionInfoResp: any) => SessionInfo;
|
|
8077
|
+
/**
|
|
8078
|
+
* Resets the cached session info object and forces a new fetch on the next call.
|
|
8079
|
+
* @example ```js
|
|
8080
|
+
* resetCachedSessionInfo();
|
|
8081
|
+
* const sessionInfo = await getSessionInfo();
|
|
8082
|
+
* console.log(sessionInfo);
|
|
8083
|
+
* ```
|
|
8084
|
+
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
8085
|
+
* @returns {void}
|
|
8086
|
+
*/
|
|
8087
|
+
export declare function resetCachedSessionInfo(): void;
|
|
8088
|
+
/**
|
|
8089
|
+
* Resets the cached preauth info object and forces a new fetch on the next call.
|
|
8090
|
+
* @example ```js
|
|
8091
|
+
* resetCachedPreauthInfo();
|
|
8092
|
+
* const preauthInfo = await getPreauthInfo();
|
|
8093
|
+
* console.log(preauthInfo);
|
|
8094
|
+
* ```
|
|
8095
|
+
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
8096
|
+
* @returns {void}
|
|
8097
|
+
*/
|
|
8098
|
+
export declare function resetCachedPreauthInfo(): void;
|
|
8099
|
+
|
|
8081
8100
|
/**
|
|
8082
8101
|
* Gets the configuration embed was initialized with.
|
|
8083
8102
|
* @returns {@link EmbedConfig} The configuration embed was initialized with.
|