@thoughtspot/visual-embed-sdk 1.36.2 → 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/authToken.d.ts.map +1 -1
- package/cjs/src/authToken.js +10 -3
- package/cjs/src/authToken.js.map +1 -1
- package/cjs/src/embed/app.d.ts +14 -0
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +5 -2
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +17 -0
- package/cjs/src/embed/app.spec.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 +1 -1
- package/cjs/src/embed/embedConfig.d.ts.map +1 -1
- package/cjs/src/embed/embedConfig.js +5 -4
- package/cjs/src/embed/embedConfig.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +6 -3
- 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/types.d.ts +85 -66
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +78 -59
- package/cjs/src/types.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 +27 -0
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +45 -1
- package/cjs/src/utils.js.map +1 -1
- package/cjs/src/utils.spec.js +15 -0
- package/cjs/src/utils.spec.js.map +1 -1
- package/dist/{index-B3hd6DTM.js → index-NZYq1Tu3.js} +1 -1
- package/dist/src/authToken.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +14 -0
- 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 +1 -1
- package/dist/src/embed/embedConfig.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +6 -3
- 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/types.d.ts +85 -66
- package/dist/src/types.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 +27 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +458 -108
- package/dist/tsembed-react.js +456 -105
- package/dist/tsembed.es.js +197 -98
- package/dist/tsembed.js +196 -97
- package/dist/visual-embed-sdk-react-full.d.ts +1324 -1269
- package/dist/visual-embed-sdk-react.d.ts +814 -759
- package/dist/visual-embed-sdk.d.ts +113 -72
- package/lib/package.json +1 -1
- package/lib/src/authToken.d.ts.map +1 -1
- package/lib/src/authToken.js +10 -3
- package/lib/src/authToken.js.map +1 -1
- package/lib/src/embed/app.d.ts +14 -0
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +5 -2
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +17 -0
- package/lib/src/embed/app.spec.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 +1 -1
- package/lib/src/embed/embedConfig.d.ts.map +1 -1
- package/lib/src/embed/embedConfig.js +5 -4
- package/lib/src/embed/embedConfig.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +6 -3
- 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/types.d.ts +85 -66
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +78 -59
- package/lib/src/types.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 +27 -0
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +41 -0
- package/lib/src/utils.js.map +1 -1
- package/lib/src/utils.spec.js +16 -1
- package/lib/src/utils.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +114 -73
- package/package.json +1 -1
- package/src/authToken.ts +11 -3
- package/src/embed/app.spec.ts +27 -0
- package/src/embed/app.ts +21 -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 +5 -4
- package/src/embed/liveboard.spec.ts +11 -11
- package/src/embed/liveboard.ts +9 -7
- 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/types.ts +89 -70
- package/src/utils/with-resolvers-polyfill.ts +11 -0
- package/src/utils.spec.ts +21 -0
- package/src/utils.ts +52 -0
- package/cjs/src/embed/searchEmbed-basic-auth.spec.d.ts +0 -2
- package/cjs/src/embed/searchEmbed-basic-auth.spec.d.ts.map +0 -1
- package/cjs/src/embed/searchEmbed-basic-auth.spec.js +0 -104
- package/cjs/src/embed/searchEmbed-basic-auth.spec.js.map +0 -1
- package/cjs/src/hostEventsTypeMapping.d.ts +0 -2
- package/cjs/src/hostEventsTypeMapping.d.ts.map +0 -1
- package/cjs/src/hostEventsTypeMapping.js +0 -4
- package/cjs/src/hostEventsTypeMapping.js.map +0 -1
- package/cjs/src/utils/embedApi/contracts.d.ts +0 -101
- package/cjs/src/utils/embedApi/contracts.d.ts.map +0 -1
- package/cjs/src/utils/embedApi/contracts.js +0 -17
- package/cjs/src/utils/embedApi/contracts.js.map +0 -1
- package/cjs/src/utils/embedApi/embedApiClient.d.ts +0 -12
- package/cjs/src/utils/embedApi/embedApiClient.d.ts.map +0 -1
- package/cjs/src/utils/embedApi/embedApiClient.js +0 -46
- package/cjs/src/utils/embedApi/embedApiClient.js.map +0 -1
- package/cjs/src/utils/embedApi/processEmbedApi.d.ts +0 -9
- package/cjs/src/utils/embedApi/processEmbedApi.d.ts.map +0 -1
- package/cjs/src/utils/embedApi/processEmbedApi.js +0 -18
- package/cjs/src/utils/embedApi/processEmbedApi.js.map +0 -1
- package/dist/index-BBBimG1x.js +0 -7370
- package/dist/index-BGnxP5NY.js +0 -7370
- package/dist/index-CENLvayL.js +0 -7370
- package/dist/index-CR5u7BMC.js +0 -7370
- package/dist/index-CbltIawo.js +0 -7370
- package/dist/index-CoQfqaHj.js +0 -7370
- package/dist/index-CzwzS0P4.js +0 -7370
- package/dist/index-D-9WUCUl.js +0 -7370
- package/dist/index-DFwi_pV_.js +0 -7370
- package/dist/index-DOIjN0N_.js +0 -7370
- package/dist/index-DYBx8SuE.js +0 -7370
- package/dist/index-DaLHJaLd.js +0 -7370
- package/dist/index-DnJX-gN2.js +0 -7370
- package/dist/index-DpuhnTj2.js +0 -7370
- package/dist/index-IDmSUe93.js +0 -7370
- package/dist/index-nWevLycs.js +0 -7370
- package/dist/index-vxW97_xb.js +0 -7370
- package/dist/src/embed/searchEmbed-basic-auth.spec.d.ts +0 -2
- package/dist/src/embed/searchEmbed-basic-auth.spec.d.ts.map +0 -1
- package/dist/src/hostEventsTypeMapping.d.ts +0 -2
- package/dist/src/hostEventsTypeMapping.d.ts.map +0 -1
- package/dist/src/utils/embedApi/contracts.d.ts +0 -101
- package/dist/src/utils/embedApi/contracts.d.ts.map +0 -1
- package/dist/src/utils/embedApi/embedApiClient.d.ts +0 -12
- package/dist/src/utils/embedApi/embedApiClient.d.ts.map +0 -1
- package/dist/src/utils/embedApi/processEmbedApi.d.ts +0 -9
- package/dist/src/utils/embedApi/processEmbedApi.d.ts.map +0 -1
- package/lib/src/embed/searchEmbed-basic-auth.spec.d.ts +0 -2
- package/lib/src/embed/searchEmbed-basic-auth.spec.d.ts.map +0 -1
- package/lib/src/embed/searchEmbed-basic-auth.spec.js +0 -101
- package/lib/src/embed/searchEmbed-basic-auth.spec.js.map +0 -1
- package/lib/src/hostEventsTypeMapping.d.ts +0 -2
- package/lib/src/hostEventsTypeMapping.d.ts.map +0 -1
- package/lib/src/hostEventsTypeMapping.js +0 -2
- package/lib/src/hostEventsTypeMapping.js.map +0 -1
- package/lib/src/utils/embedApi/contracts.d.ts +0 -101
- package/lib/src/utils/embedApi/contracts.d.ts.map +0 -1
- package/lib/src/utils/embedApi/contracts.js +0 -14
- package/lib/src/utils/embedApi/contracts.js.map +0 -1
- package/lib/src/utils/embedApi/embedApiClient.d.ts +0 -12
- package/lib/src/utils/embedApi/embedApiClient.d.ts.map +0 -1
- package/lib/src/utils/embedApi/embedApiClient.js +0 -42
- package/lib/src/utils/embedApi/embedApiClient.js.map +0 -1
- package/lib/src/utils/embedApi/processEmbedApi.d.ts +0 -9
- package/lib/src/utils/embedApi/processEmbedApi.d.ts.map +0 -1
- package/lib/src/utils/embedApi/processEmbedApi.js +0 -14
- package/lib/src/utils/embedApi/processEmbedApi.js.map +0 -1
|
@@ -250,6 +250,20 @@ 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>;
|
|
253
267
|
|
|
254
268
|
/**
|
|
255
269
|
* Copyright (c) 2023
|
|
@@ -261,6 +275,181 @@ export function useEmbedRef<T extends EmbedComponent>(): React.MutableRefObject<
|
|
|
261
275
|
*/
|
|
262
276
|
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, };
|
|
263
277
|
|
|
278
|
+
export declare let loggedInStatus: boolean;
|
|
279
|
+
export declare let samlAuthWindow: Window;
|
|
280
|
+
export declare let samlCompletionPromise: Promise<void>;
|
|
281
|
+
export declare const SSO_REDIRECTION_MARKER_GUID = "5e16222e-ef02-43e9-9fbd-24226bf3ce5b";
|
|
282
|
+
/**
|
|
283
|
+
* Enum for auth failure types. This is the parameter passed to the listner
|
|
284
|
+
* of {@link AuthStatus.FAILURE}.
|
|
285
|
+
* @group Authentication / Init
|
|
286
|
+
*/
|
|
287
|
+
export declare enum AuthFailureType {
|
|
288
|
+
SDK = "SDK",
|
|
289
|
+
NO_COOKIE_ACCESS = "NO_COOKIE_ACCESS",
|
|
290
|
+
EXPIRY = "EXPIRY",
|
|
291
|
+
OTHER = "OTHER",
|
|
292
|
+
IDLE_SESSION_TIMEOUT = "IDLE_SESSION_TIMEOUT"
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Enum for auth status emitted by the emitter returned from {@link init}.
|
|
296
|
+
* @group Authentication / Init
|
|
297
|
+
*/
|
|
298
|
+
export declare enum AuthStatus {
|
|
299
|
+
/**
|
|
300
|
+
* Emits when the SDK fails to authenticate
|
|
301
|
+
*/
|
|
302
|
+
FAILURE = "FAILURE",
|
|
303
|
+
/**
|
|
304
|
+
* Emits when the SDK authenticates successfully
|
|
305
|
+
*/
|
|
306
|
+
SDK_SUCCESS = "SDK_SUCCESS",
|
|
307
|
+
/**
|
|
308
|
+
* @hidden
|
|
309
|
+
* Emits when iframe is loaded and session info is available
|
|
310
|
+
*/
|
|
311
|
+
SESSION_INFO_SUCCESS = "SESSION_INFO_SUCCESS",
|
|
312
|
+
/**
|
|
313
|
+
* Emits when the app sends an authentication success message
|
|
314
|
+
*/
|
|
315
|
+
SUCCESS = "SUCCESS",
|
|
316
|
+
/**
|
|
317
|
+
* Emits when a user logs out
|
|
318
|
+
*/
|
|
319
|
+
LOGOUT = "LOGOUT",
|
|
320
|
+
/**
|
|
321
|
+
* Emitted when inPopup is true in the SAMLRedirect flow and the
|
|
322
|
+
* popup is waiting to be triggered either programmatically
|
|
323
|
+
* or by the trigger button.
|
|
324
|
+
* @version SDK: 1.19.0
|
|
325
|
+
*/
|
|
326
|
+
WAITING_FOR_POPUP = "WAITING_FOR_POPUP"
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Event emitter returned from {@link init}.
|
|
330
|
+
* @group Authentication / Init
|
|
331
|
+
*/
|
|
332
|
+
export interface AuthEventEmitter {
|
|
333
|
+
/**
|
|
334
|
+
* Register a listener on Auth failure.
|
|
335
|
+
* @param event
|
|
336
|
+
* @param listener
|
|
337
|
+
*/
|
|
338
|
+
on(event: AuthStatus.FAILURE, listener: (failureType: AuthFailureType) => void): this;
|
|
339
|
+
/**
|
|
340
|
+
* Register a listener on Auth SDK success.
|
|
341
|
+
* @param event
|
|
342
|
+
* @param listener
|
|
343
|
+
*/
|
|
344
|
+
on(event: AuthStatus.SDK_SUCCESS | AuthStatus.LOGOUT | AuthStatus.WAITING_FOR_POPUP, listener: () => void): this;
|
|
345
|
+
on(event: AuthStatus.SUCCESS, listener: (sessionInfo: any) => void): this;
|
|
346
|
+
once(event: AuthStatus.FAILURE, listener: (failureType: AuthFailureType) => void): this;
|
|
347
|
+
once(event: AuthStatus.SDK_SUCCESS | AuthStatus.LOGOUT | AuthStatus.WAITING_FOR_POPUP, listener: () => void): this;
|
|
348
|
+
once(event: AuthStatus.SUCCESS, listener: (sessionInfo: any) => void): this;
|
|
349
|
+
/**
|
|
350
|
+
* Trigger an event on the emitter returned from init.
|
|
351
|
+
* @param {@link AuthEvent}
|
|
352
|
+
*/
|
|
353
|
+
emit(event: AuthEvent, ...args: any[]): boolean;
|
|
354
|
+
/**
|
|
355
|
+
* Remove listener from the emitter returned from init.
|
|
356
|
+
* @param event
|
|
357
|
+
* @param listener
|
|
358
|
+
* @param context
|
|
359
|
+
* @param once
|
|
360
|
+
*/
|
|
361
|
+
off(event: AuthStatus, listener: (...args: any[]) => void, context: any, once: boolean): this;
|
|
362
|
+
/**
|
|
363
|
+
* Remove all the event listeners
|
|
364
|
+
* @param event
|
|
365
|
+
*/
|
|
366
|
+
removeAllListeners(event: AuthStatus): this;
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Events which can be triggered on the emitter returned from {@link init}.
|
|
370
|
+
* @group Authentication / Init
|
|
371
|
+
*/
|
|
372
|
+
export declare enum AuthEvent {
|
|
373
|
+
/**
|
|
374
|
+
* Manually trigger the SSO popup. This is useful when
|
|
375
|
+
* authStatus is SAMLRedirect/OIDCRedirect and inPopup is set to true
|
|
376
|
+
*/
|
|
377
|
+
TRIGGER_SSO_POPUP = "TRIGGER_SSO_POPUP"
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
*
|
|
381
|
+
*/
|
|
382
|
+
export declare function getAuthEE(): EventEmitter<AuthStatus | AuthEvent>;
|
|
383
|
+
/**
|
|
384
|
+
*
|
|
385
|
+
* @param eventEmitter
|
|
386
|
+
*/
|
|
387
|
+
export declare function setAuthEE(eventEmitter: EventEmitter<AuthStatus | AuthEvent>): void;
|
|
388
|
+
/**
|
|
389
|
+
*
|
|
390
|
+
*/
|
|
391
|
+
export declare function notifyAuthSDKSuccess(): void;
|
|
392
|
+
/**
|
|
393
|
+
*
|
|
394
|
+
*/
|
|
395
|
+
export declare function notifyAuthSuccess(): Promise<void>;
|
|
396
|
+
/**
|
|
397
|
+
*
|
|
398
|
+
* @param failureType
|
|
399
|
+
*/
|
|
400
|
+
export declare function notifyAuthFailure(failureType: AuthFailureType): void;
|
|
401
|
+
/**
|
|
402
|
+
*
|
|
403
|
+
*/
|
|
404
|
+
export declare function notifyLogout(): void;
|
|
405
|
+
/**
|
|
406
|
+
* Services to be called after the login is successful,
|
|
407
|
+
* This should be called after the cookie is set for cookie auth or
|
|
408
|
+
* after the token is set for cookieless.
|
|
409
|
+
* @return {Promise<void>}
|
|
410
|
+
* @example
|
|
411
|
+
* ```js
|
|
412
|
+
* await postLoginService();
|
|
413
|
+
* ```
|
|
414
|
+
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
415
|
+
*/
|
|
416
|
+
export declare function postLoginService(): Promise<void>;
|
|
417
|
+
/**
|
|
418
|
+
* Return releaseVersion if available
|
|
419
|
+
*/
|
|
420
|
+
export declare function getReleaseVersion(): string;
|
|
421
|
+
/**
|
|
422
|
+
* Perform token based authentication
|
|
423
|
+
* @param embedConfig The embed configuration
|
|
424
|
+
*/
|
|
425
|
+
export declare const doTokenAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
426
|
+
/**
|
|
427
|
+
* Validate embedConfig parameters required for cookielessTokenAuth
|
|
428
|
+
* @param embedConfig The embed configuration
|
|
429
|
+
*/
|
|
430
|
+
export declare const doCookielessTokenAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
431
|
+
/**
|
|
432
|
+
* Perform basic authentication to the ThoughtSpot cluster using the cluster
|
|
433
|
+
* credentials.
|
|
434
|
+
*
|
|
435
|
+
* Warning: This feature is primarily intended for developer testing. It is
|
|
436
|
+
* strongly advised not to use this authentication method in production.
|
|
437
|
+
* @param embedConfig The embed configuration
|
|
438
|
+
*/
|
|
439
|
+
export declare const doBasicAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
440
|
+
export declare const doSamlAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
441
|
+
export declare const doOIDCAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
442
|
+
export declare const logout: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
443
|
+
/**
|
|
444
|
+
* Perform authentication on the ThoughtSpot cluster
|
|
445
|
+
* @param embedConfig The embed configuration
|
|
446
|
+
*/
|
|
447
|
+
export declare const authenticate: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
448
|
+
/**
|
|
449
|
+
* Check if we are authenticated to the ThoughtSpot cluster
|
|
450
|
+
*/
|
|
451
|
+
export declare const isAuthenticated: () => boolean;
|
|
452
|
+
|
|
264
453
|
/**
|
|
265
454
|
* @group Embed components
|
|
266
455
|
*/
|
|
@@ -937,6 +1126,20 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
|
|
|
937
1126
|
* ```
|
|
938
1127
|
*/
|
|
939
1128
|
disableProfileAndHelp?: boolean;
|
|
1129
|
+
/**
|
|
1130
|
+
* @version SDK: 1.36.3 | ThoughtSpot: 10.1.0.cl
|
|
1131
|
+
* @default true
|
|
1132
|
+
* Whether the help menu in the top nav bar should be served
|
|
1133
|
+
* from Pendo or ThoughtSpot's internal help items.
|
|
1134
|
+
* @example
|
|
1135
|
+
* ```js
|
|
1136
|
+
* const embed = new AppEmbed('#tsEmbed', {
|
|
1137
|
+
* ... // other options
|
|
1138
|
+
* enablePendoHelp: false,
|
|
1139
|
+
* });
|
|
1140
|
+
* ```
|
|
1141
|
+
*/
|
|
1142
|
+
enablePendoHelp?: boolean;
|
|
940
1143
|
/**
|
|
941
1144
|
* Control the visibility of the application switcher button on the nav-bar.
|
|
942
1145
|
* By default, the application switcher is shown.
|
|
@@ -1578,7 +1781,10 @@ export interface LiveboardViewConfig extends Omit<ViewConfig, 'hiddenHomepageMod
|
|
|
1578
1781
|
*/
|
|
1579
1782
|
showPreviewLoader?: boolean;
|
|
1580
1783
|
/**
|
|
1581
|
-
*
|
|
1784
|
+
* Enables or disables the compact header feature on a Liveboard.
|
|
1785
|
+
* Compact Liveboard header is turned off by default on Liveboards in
|
|
1786
|
+
* ThoughtSpot Embedded apps.
|
|
1787
|
+
*
|
|
1582
1788
|
* @type {boolean}
|
|
1583
1789
|
* @default false
|
|
1584
1790
|
* @version SDK: 1.35.0 | ThoughtSpot:10.3.0.cl
|
|
@@ -1695,7 +1901,7 @@ export declare class LiveboardEmbed extends V1Embed {
|
|
|
1695
1901
|
*/
|
|
1696
1902
|
protected getEmbedParams(): string;
|
|
1697
1903
|
protected beforePrerenderVisible(): void;
|
|
1698
|
-
protected handleRenderForPrerender():
|
|
1904
|
+
protected handleRenderForPrerender(): Promise<TsEmbed>;
|
|
1699
1905
|
/**
|
|
1700
1906
|
* Triggers an event to the embedded app
|
|
1701
1907
|
* @param {HostEvent} messageType The event type
|
|
@@ -1723,1159 +1929,798 @@ export declare class LiveboardEmbed extends V1Embed {
|
|
|
1723
1929
|
export declare class PinboardEmbed extends LiveboardEmbed {
|
|
1724
1930
|
}
|
|
1725
1931
|
|
|
1726
|
-
export type EmbedEventHandlers = {
|
|
1727
|
-
[key in keyof typeof EmbedEvent as `on${Capitalize<key>}`]?: MessageCallback;
|
|
1728
|
-
};
|
|
1729
|
-
export interface EmbedProps extends ViewConfig, EmbedEventHandlers {
|
|
1730
|
-
className?: string;
|
|
1731
|
-
}
|
|
1732
|
-
export interface ViewConfigAndListeners<T extends ViewConfig> {
|
|
1733
|
-
viewConfig: T;
|
|
1734
|
-
listeners: {
|
|
1735
|
-
[key in EmbedEvent]?: MessageCallback;
|
|
1736
|
-
};
|
|
1737
|
-
}
|
|
1738
|
-
/**
|
|
1739
|
-
*
|
|
1740
|
-
* @param props
|
|
1741
|
-
*/
|
|
1742
|
-
export function getViewPropsAndListeners<T extends EmbedProps, U extends ViewConfig>(props: T): ViewConfigAndListeners<U>;
|
|
1743
|
-
|
|
1744
1932
|
/**
|
|
1745
|
-
*
|
|
1933
|
+
* Copyright (c) 2023
|
|
1934
|
+
*
|
|
1935
|
+
* TypeScript type definitions for ThoughtSpot Visual Embed SDK
|
|
1936
|
+
* @summary Type definitions for Embed SDK
|
|
1937
|
+
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
1746
1938
|
*/
|
|
1747
|
-
export interface SearchOptions {
|
|
1748
|
-
/**
|
|
1749
|
-
* The query string to pass to start the Conversation.
|
|
1750
|
-
*/
|
|
1751
|
-
searchQuery: string;
|
|
1752
|
-
}
|
|
1753
1939
|
/**
|
|
1754
|
-
* The
|
|
1755
|
-
*
|
|
1940
|
+
* The authentication mechanism for allowing access to the
|
|
1941
|
+
* the embedded app
|
|
1942
|
+
* @group Authentication / Init
|
|
1756
1943
|
*/
|
|
1757
|
-
export
|
|
1758
|
-
/**
|
|
1759
|
-
* The ID of the worksheet to use for the conversation.
|
|
1760
|
-
*/
|
|
1761
|
-
worksheetId: string;
|
|
1762
|
-
/**
|
|
1763
|
-
* Ability to pass a starting search query to the conversation.
|
|
1764
|
-
*/
|
|
1765
|
-
searchOptions?: SearchOptions;
|
|
1944
|
+
export declare enum AuthType {
|
|
1766
1945
|
/**
|
|
1767
|
-
*
|
|
1768
|
-
*
|
|
1946
|
+
* No authentication on the SDK. Pass-through to the embedded App. Alias for
|
|
1947
|
+
* `Passthrough`.
|
|
1769
1948
|
* @example
|
|
1770
1949
|
* ```js
|
|
1771
|
-
*
|
|
1772
|
-
*
|
|
1773
|
-
*
|
|
1774
|
-
*
|
|
1950
|
+
* init({
|
|
1951
|
+
* // ...
|
|
1952
|
+
* authType: AuthType.None,
|
|
1953
|
+
* });
|
|
1775
1954
|
* ```
|
|
1776
|
-
* @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
|
|
1777
1955
|
*/
|
|
1778
|
-
|
|
1956
|
+
None = "None",
|
|
1779
1957
|
/**
|
|
1780
|
-
*
|
|
1781
|
-
*
|
|
1782
|
-
*
|
|
1783
|
-
*
|
|
1784
|
-
*
|
|
1785
|
-
*
|
|
1786
|
-
*
|
|
1958
|
+
* Passthrough SSO to the embedded application within the iframe. Requires least
|
|
1959
|
+
* configuration, but may not be supported by all IDPs. This will behave like `None`
|
|
1960
|
+
* if SSO is not configured on ThoughtSpot.
|
|
1961
|
+
*
|
|
1962
|
+
* To use this:
|
|
1963
|
+
* Your SAML or OpenID provider must allow iframe redirects.
|
|
1964
|
+
* For example, if you are using Okta as IdP, you can enable iframe embedding.
|
|
1965
|
+
* @example
|
|
1966
|
+
* ```js
|
|
1967
|
+
* init({
|
|
1968
|
+
* // ...
|
|
1969
|
+
* authType: AuthType.EmbeddedSSO,
|
|
1970
|
+
* });
|
|
1787
1971
|
* ```
|
|
1788
|
-
* @version SDK: 1.
|
|
1972
|
+
* @version: SDK: 1.15.0 | ThoughtSpot: 8.8.0.cl
|
|
1789
1973
|
*/
|
|
1790
|
-
|
|
1974
|
+
EmbeddedSSO = "EmbeddedSSO",
|
|
1791
1975
|
/**
|
|
1792
|
-
*
|
|
1793
|
-
* @
|
|
1794
|
-
* @
|
|
1976
|
+
* SSO using SAML
|
|
1977
|
+
* @deprecated Use {@link SAMLRedirect} instead
|
|
1978
|
+
* @hidden
|
|
1979
|
+
*/
|
|
1980
|
+
SSO = "SSO_SAML",
|
|
1981
|
+
/**
|
|
1982
|
+
* SSO using SAML
|
|
1983
|
+
* @deprecated Use {@link SAMLRedirect} instead
|
|
1984
|
+
* @hidden
|
|
1985
|
+
*/
|
|
1986
|
+
SAML = "SSO_SAML",
|
|
1987
|
+
/**
|
|
1988
|
+
* SSO using SAML
|
|
1989
|
+
* Makes the host application redirect to the SAML IdP. Use this
|
|
1990
|
+
* if your IdP does not allow itself to be embedded.
|
|
1991
|
+
*
|
|
1992
|
+
* This redirects the host application to the SAML IdP. The host application
|
|
1993
|
+
* will be redirected back to the ThoughtSpot app after authentication.
|
|
1795
1994
|
* @example
|
|
1796
1995
|
* ```js
|
|
1797
|
-
*
|
|
1798
|
-
*
|
|
1799
|
-
*
|
|
1800
|
-
*
|
|
1996
|
+
* init({
|
|
1997
|
+
* // ...
|
|
1998
|
+
* authType: AuthType.SAMLRedirect,
|
|
1999
|
+
* });
|
|
2000
|
+
* ```
|
|
2001
|
+
*
|
|
2002
|
+
* This opens the SAML IdP in a popup window. The popup is triggered
|
|
2003
|
+
* when the user clicks the trigger button. The popup window will be
|
|
2004
|
+
* closed automatically after authentication.
|
|
2005
|
+
* @example
|
|
2006
|
+
* ```js
|
|
2007
|
+
* init({
|
|
2008
|
+
* // ...
|
|
2009
|
+
* authType: AuthType.SAMLRedirect,
|
|
2010
|
+
* authTriggerText: 'Login with SAML',
|
|
2011
|
+
* authTriggerContainer: '#embed-container',
|
|
2012
|
+
* inPopup: true,
|
|
2013
|
+
* });
|
|
2014
|
+
* ```
|
|
2015
|
+
*
|
|
2016
|
+
* Can also use the event to trigger the popup flow. Works the same
|
|
2017
|
+
* as the above example.
|
|
2018
|
+
* @example
|
|
2019
|
+
* ```js
|
|
2020
|
+
* const authEE = init({
|
|
2021
|
+
* // ...
|
|
2022
|
+
* authType: AuthType.SAMLRedirect,
|
|
2023
|
+
* inPopup: true,
|
|
2024
|
+
* });
|
|
2025
|
+
*
|
|
2026
|
+
* someButtonOnYourPage.addEventListener('click', () => {
|
|
2027
|
+
* authEE.emit(AuthEvent.TRIGGER_SSO_POPUP);
|
|
2028
|
+
* });
|
|
1801
2029
|
* ```
|
|
1802
2030
|
*/
|
|
1803
|
-
|
|
2031
|
+
SAMLRedirect = "SSO_SAML",
|
|
1804
2032
|
/**
|
|
1805
|
-
*
|
|
1806
|
-
*
|
|
1807
|
-
*
|
|
2033
|
+
* SSO using OIDC
|
|
2034
|
+
* @hidden
|
|
2035
|
+
* @deprecated Use {@link OIDCRedirect} instead
|
|
2036
|
+
*/
|
|
2037
|
+
OIDC = "SSO_OIDC",
|
|
2038
|
+
/**
|
|
2039
|
+
* SSO using OIDC
|
|
2040
|
+
* Will make the host application redirect to the OIDC IdP.
|
|
2041
|
+
* See code samples in {@link SAMLRedirect}.
|
|
2042
|
+
*/
|
|
2043
|
+
OIDCRedirect = "SSO_OIDC",
|
|
2044
|
+
/**
|
|
2045
|
+
* Trusted authentication server
|
|
2046
|
+
* @hidden
|
|
2047
|
+
* @deprecated Use {@link TrustedAuth} instead
|
|
2048
|
+
*/
|
|
2049
|
+
AuthServer = "AuthServer",
|
|
2050
|
+
/**
|
|
2051
|
+
* Trusted authentication server. Use your own authentication server
|
|
2052
|
+
* which returns a bearer token, generated using the `secret_key` obtained
|
|
2053
|
+
* from ThoughtSpot.
|
|
1808
2054
|
* @example
|
|
1809
2055
|
* ```js
|
|
1810
|
-
*
|
|
1811
|
-
*
|
|
1812
|
-
*
|
|
1813
|
-
*
|
|
2056
|
+
* init({
|
|
2057
|
+
* // ...
|
|
2058
|
+
* authType: AuthType.TrustedAuthToken,
|
|
2059
|
+
* getAuthToken: () => {
|
|
2060
|
+
* return fetch('https://my-backend.app/ts-token')
|
|
2061
|
+
* .then((response) => response.json())
|
|
2062
|
+
* .then((data) => data.token);
|
|
2063
|
+
* }
|
|
2064
|
+
* });
|
|
1814
2065
|
* ```
|
|
1815
|
-
* @version SDK: 1.36.0 | Thoughtspot: 10.5.0.cl
|
|
1816
2066
|
*/
|
|
1817
|
-
|
|
2067
|
+
TrustedAuthToken = "AuthServer",
|
|
1818
2068
|
/**
|
|
1819
|
-
*
|
|
1820
|
-
*
|
|
2069
|
+
* Trusted authentication server Cookieless, Use your own authentication
|
|
2070
|
+
* server which returns a bearer token, generated using the `secret_key`
|
|
2071
|
+
* obtained from ThoughtSpot. This uses a cookieless authentication
|
|
2072
|
+
* approach, recommended to bypass the third-party cookie-blocking restriction
|
|
2073
|
+
* implemented by some browsers.
|
|
1821
2074
|
* @example
|
|
1822
2075
|
* ```js
|
|
1823
|
-
*
|
|
1824
|
-
*
|
|
1825
|
-
*
|
|
1826
|
-
*
|
|
2076
|
+
* init({
|
|
2077
|
+
* // ...
|
|
2078
|
+
* authType: AuthType.TrustedAuthTokenCookieless,
|
|
2079
|
+
* getAuthToken: () => {
|
|
2080
|
+
* return fetch('https://my-backend.app/ts-token')
|
|
2081
|
+
* .then((response) => response.json())
|
|
2082
|
+
* .then((data) => data.token);
|
|
2083
|
+
* }
|
|
1827
2084
|
* ```
|
|
1828
|
-
* @version SDK: 1.
|
|
2085
|
+
* @version SDK: 1.22.0| ThoughtSpot: 9.3.0.cl, 9.5.1.sw
|
|
1829
2086
|
*/
|
|
1830
|
-
|
|
2087
|
+
TrustedAuthTokenCookieless = "AuthServerCookieless",
|
|
2088
|
+
/**
|
|
2089
|
+
* Use the ThoughtSpot login API to authenticate to the cluster directly.
|
|
2090
|
+
*
|
|
2091
|
+
* Warning: This feature is primarily intended for developer testing. It is
|
|
2092
|
+
* strongly advised not to use this authentication method in production.
|
|
2093
|
+
*/
|
|
2094
|
+
Basic = "Basic"
|
|
1831
2095
|
}
|
|
1832
2096
|
/**
|
|
1833
|
-
*
|
|
1834
|
-
*
|
|
1835
|
-
*
|
|
1836
|
-
*
|
|
1837
|
-
*
|
|
1838
|
-
*
|
|
1839
|
-
* searchOptions: {
|
|
1840
|
-
* searchQuery: 'searchQuery',
|
|
1841
|
-
* },
|
|
1842
|
-
* });
|
|
1843
|
-
* conversation.render();
|
|
1844
|
-
* ```
|
|
1845
|
-
* @version SDK: 1.33.1 | ThoughtSpot: 10.5.0.cl
|
|
2097
|
+
*
|
|
2098
|
+
* This option does not apply to the classic homepage experience.
|
|
2099
|
+
* To access the updated modular homepage,
|
|
2100
|
+
* set `modularHomeExperience` to `true`
|
|
2101
|
+
* (available as Early Access feature in 9.12.5.cl).
|
|
2102
|
+
*
|
|
1846
2103
|
*/
|
|
1847
|
-
export declare
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
2104
|
+
export declare enum HomeLeftNavItem {
|
|
2105
|
+
/**
|
|
2106
|
+
* @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
|
|
2107
|
+
*/
|
|
2108
|
+
SearchData = "search-data",
|
|
2109
|
+
/**
|
|
2110
|
+
* @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
|
|
2111
|
+
*/
|
|
2112
|
+
Home = "insights-home",
|
|
2113
|
+
/**
|
|
2114
|
+
* @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
|
|
2115
|
+
*/
|
|
2116
|
+
Liveboards = "liveboards",
|
|
2117
|
+
/**
|
|
2118
|
+
* @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
|
|
2119
|
+
*/
|
|
2120
|
+
Answers = "answers",
|
|
2121
|
+
/**
|
|
2122
|
+
* @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
|
|
2123
|
+
*/
|
|
2124
|
+
MonitorSubscription = "monitor-alerts",
|
|
2125
|
+
/**
|
|
2126
|
+
* @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
|
|
2127
|
+
*/
|
|
2128
|
+
SpotIQAnalysis = "spotiq-analysis",
|
|
2129
|
+
/**
|
|
2130
|
+
* @version SDK: 1.34.0| ThoughtSpot: 10.3.0.cl
|
|
2131
|
+
*/
|
|
2132
|
+
LiveboardSchedules = "liveboard-schedules"
|
|
1867
2133
|
}
|
|
1868
|
-
export
|
|
1869
|
-
export declare const getAuthPromise: () => Promise<boolean>;
|
|
1870
|
-
export { notifyAuthFailure, notifyAuthSDKSuccess, notifyAuthSuccess, notifyLogout, };
|
|
1871
|
-
/**
|
|
1872
|
-
* Perform authentication on the ThoughtSpot app as applicable.
|
|
1873
|
-
*/
|
|
1874
|
-
export declare const handleAuth: () => Promise<boolean>;
|
|
2134
|
+
export type DOMSelector = string | HTMLElement;
|
|
1875
2135
|
/**
|
|
1876
|
-
*
|
|
1877
|
-
*
|
|
1878
|
-
* to your app.
|
|
1879
|
-
* @param url The URL provided for prefetch
|
|
1880
|
-
* @param prefetchFeatures Specify features which needs to be prefetched.
|
|
1881
|
-
* @param additionalFlags This can be used to add any URL flag.
|
|
1882
|
-
* @version SDK: 1.4.0 | ThoughtSpot: ts7.sep.cl, 7.2.1
|
|
1883
|
-
* @group Global methods
|
|
2136
|
+
* inline customCSS within the {@link CustomisationsInterface}.
|
|
2137
|
+
* Use {@link CustomCssVariables} or css rules.
|
|
1884
2138
|
*/
|
|
1885
|
-
export
|
|
1886
|
-
[key: string]: string | number | boolean;
|
|
1887
|
-
}) => void;
|
|
1888
|
-
/**
|
|
1889
|
-
* Initializes the Visual Embed SDK globally and perform
|
|
1890
|
-
* authentication if applicable. This function needs to be called before any ThoughtSpot
|
|
1891
|
-
* component like Liveboard etc can be embedded. But need not wait for AuthEvent.SUCCESS
|
|
1892
|
-
* to actually embed. That is handled internally.
|
|
1893
|
-
* @param embedConfig The configuration object containing ThoughtSpot host,
|
|
1894
|
-
* authentication mechanism and so on.
|
|
1895
|
-
* @example
|
|
1896
|
-
* ```js
|
|
1897
|
-
* const authStatus = init({
|
|
1898
|
-
* thoughtSpotHost: 'https://my.thoughtspot.cloud',
|
|
1899
|
-
* authType: AuthType.None,
|
|
1900
|
-
* });
|
|
1901
|
-
* authStatus.on(AuthStatus.FAILURE, (reason) => { // do something here });
|
|
1902
|
-
* ```
|
|
1903
|
-
* @returns {@link AuthEventEmitter} event emitter which emits events on authentication success,
|
|
1904
|
-
* failure and logout. See {@link AuthStatus}
|
|
1905
|
-
* @version SDK: 1.0.0 | ThoughtSpot ts7.april.cl, 7.2.1
|
|
1906
|
-
* @group Authentication / Init
|
|
1907
|
-
*/
|
|
1908
|
-
export declare const init: (embedConfig: EmbedConfig) => AuthEventEmitter;
|
|
1909
|
-
/**
|
|
1910
|
-
*
|
|
1911
|
-
*/
|
|
1912
|
-
export declare function disableAutoLogin(): void;
|
|
1913
|
-
/**
|
|
1914
|
-
* Logs out from ThoughtSpot. This also sets the autoLogin flag to false, to
|
|
1915
|
-
* prevent the SDK from automatically logging in again.
|
|
1916
|
-
*
|
|
1917
|
-
* You can call the `init` method again to re login, if autoLogin is set to
|
|
1918
|
-
* true in this second call it will be honored.
|
|
1919
|
-
* @param doNotDisableAutoLogin This flag when passed will not disable autoLogin
|
|
1920
|
-
* @returns Promise which resolves when logout completes.
|
|
1921
|
-
* @version SDK: 1.10.1 | ThoughtSpot: 8.2.0.cl, 8.4.1-sw
|
|
1922
|
-
* @group Global methods
|
|
1923
|
-
*/
|
|
1924
|
-
export declare const logout: (doNotDisableAutoLogin?: boolean) => Promise<boolean>;
|
|
1925
|
-
/**
|
|
1926
|
-
* Renders functions in a queue, resolves to next function only after the callback next
|
|
1927
|
-
* is called
|
|
1928
|
-
* @param fn The function being registered
|
|
1929
|
-
*/
|
|
1930
|
-
export declare const renderInQueue: (fn: (next?: (val?: any) => void) => Promise<any>) => Promise<any>;
|
|
1931
|
-
/**
|
|
1932
|
-
* Imports TML representation of the metadata objects into ThoughtSpot.
|
|
1933
|
-
* @param data
|
|
1934
|
-
* @returns imports TML data into ThoughtSpot
|
|
1935
|
-
* @example
|
|
1936
|
-
* ```js
|
|
1937
|
-
* executeTML({
|
|
1938
|
-
* //Array of metadata Tmls in string format
|
|
1939
|
-
* metadata_tmls: [
|
|
1940
|
-
* "'\''{\"guid\":\"9bd202f5-d431-44bf-9a07-b4f7be372125\",
|
|
1941
|
-
* \"liveboard\":{\"name\":\"Parameters Liveboard\"}}'\''"
|
|
1942
|
-
* ],
|
|
1943
|
-
* import_policy: 'PARTIAL', // Specifies the import policy for the TML import.
|
|
1944
|
-
* create_new: false, // If selected, creates TML objects with new GUIDs.
|
|
1945
|
-
* }).then(result => {
|
|
1946
|
-
* console.log(result);
|
|
1947
|
-
* }).catch(error => {
|
|
1948
|
-
* console.error(error);
|
|
1949
|
-
* });
|
|
1950
|
-
*```
|
|
1951
|
-
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
1952
|
-
* @group Global methods
|
|
1953
|
-
*/
|
|
1954
|
-
export declare const executeTML: (data: executeTMLInput) => Promise<any>;
|
|
1955
|
-
/**
|
|
1956
|
-
* Exports TML representation of the metadata objects from ThoughtSpot in JSON or YAML
|
|
1957
|
-
* format.
|
|
1958
|
-
* @param data
|
|
1959
|
-
* @returns exports TML data
|
|
1960
|
-
* @example
|
|
1961
|
-
* ```js
|
|
1962
|
-
* exportTML({
|
|
1963
|
-
* metadata: [
|
|
1964
|
-
* {
|
|
1965
|
-
* type: "LIVEBOARD", //Metadata Type
|
|
1966
|
-
* identifier: "9bd202f5-d431-44bf-9a07-b4f7be372125" //Metadata Id
|
|
1967
|
-
* }
|
|
1968
|
-
* ],
|
|
1969
|
-
* export_associated: false,//indicates whether to export associated metadata objects
|
|
1970
|
-
* export_fqn: false, //Adds FQNs of the referenced objects.For example, if you are
|
|
1971
|
-
* //exporting a Liveboard and its associated objects, the API
|
|
1972
|
-
* //returns the Liveboard TML data with the FQNs of the referenced
|
|
1973
|
-
* //worksheet. If the exported TML data includes FQNs, you don't need
|
|
1974
|
-
* //to manually add FQNs of the referenced objects during TML import.
|
|
1975
|
-
* edoc_format: "JSON" //It takes JSON or YAML value
|
|
1976
|
-
* }).then(result => {
|
|
1977
|
-
* console.log(result);
|
|
1978
|
-
* }).catch(error => {
|
|
1979
|
-
* console.error(error);
|
|
1980
|
-
* });
|
|
1981
|
-
* ```
|
|
1982
|
-
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
1983
|
-
* @group Global methods
|
|
1984
|
-
*/
|
|
1985
|
-
export declare const exportTML: (data: exportTMLInput) => Promise<any>;
|
|
1986
|
-
/**
|
|
1987
|
-
*
|
|
1988
|
-
*/
|
|
1989
|
-
export declare function reset(): void;
|
|
1990
|
-
|
|
1991
|
-
/**
|
|
1992
|
-
* Configuration for bodyless conversation options.
|
|
1993
|
-
* @group Embed components
|
|
1994
|
-
*/
|
|
1995
|
-
export interface BodylessConversationViewConfig extends ViewConfig {
|
|
2139
|
+
export interface customCssInterface {
|
|
1996
2140
|
/**
|
|
1997
|
-
* The
|
|
2141
|
+
* The custom css variables, which can be set.
|
|
2142
|
+
* The variables are available in the {@link CustomCssVariables}
|
|
2143
|
+
* interface. For more information, see
|
|
2144
|
+
* link:https://developers.thoughtspot.com/docs/css-variables-reference[CSS variable reference].
|
|
1998
2145
|
*/
|
|
1999
|
-
|
|
2146
|
+
variables?: CustomCssVariables;
|
|
2147
|
+
/**
|
|
2148
|
+
* Can be used to define a custom font face
|
|
2149
|
+
* like:
|
|
2150
|
+
* @example
|
|
2151
|
+
* ```js
|
|
2152
|
+
* rules_UNSTABLE?: {
|
|
2153
|
+
* "@font-face": {
|
|
2154
|
+
* "font-family": "custom-font",
|
|
2155
|
+
* "src": url("/path/")
|
|
2156
|
+
* };
|
|
2157
|
+
* };
|
|
2158
|
+
* ```
|
|
2159
|
+
*
|
|
2160
|
+
* Also, custom css rules outside of variables.
|
|
2161
|
+
* @example
|
|
2162
|
+
* ```js
|
|
2163
|
+
* rules_UNSTABLE?: {
|
|
2164
|
+
* ".thoughtspot_class_name": {
|
|
2165
|
+
* "border-radius": "10px",
|
|
2166
|
+
* margin: "20px"
|
|
2167
|
+
* };
|
|
2168
|
+
* };
|
|
2169
|
+
* ```
|
|
2170
|
+
*/
|
|
2171
|
+
rules_UNSTABLE?: {
|
|
2172
|
+
[selector: string]: {
|
|
2173
|
+
[declaration: string]: string;
|
|
2174
|
+
};
|
|
2175
|
+
};
|
|
2000
2176
|
}
|
|
2001
2177
|
/**
|
|
2002
|
-
*
|
|
2003
|
-
* chatbots or other conversational interfaces.
|
|
2004
|
-
* @example
|
|
2005
|
-
* ```js
|
|
2006
|
-
* import { BodylessConversation } from '@thoughtspot/visual-embed-sdk';
|
|
2007
|
-
*
|
|
2008
|
-
* const conversation = new BodylessConversation({
|
|
2009
|
-
* worksheetId: 'worksheetId',
|
|
2010
|
-
* });
|
|
2011
|
-
*
|
|
2012
|
-
* const { container, error } = await conversation.sendMessage('show me sales by region');
|
|
2013
|
-
*
|
|
2014
|
-
* // append the container to the DOM
|
|
2015
|
-
* document.body.appendChild(container); // or to any other element
|
|
2016
|
-
* ```
|
|
2017
|
-
* @group Embed components
|
|
2018
|
-
* @version SDK: 1.33.1 | ThoughtSpot: 10.5.0.cl
|
|
2178
|
+
* Styles within the {@link CustomisationsInterface}.
|
|
2019
2179
|
*/
|
|
2020
|
-
export
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
error: any;
|
|
2024
|
-
container?: undefined;
|
|
2025
|
-
} | {
|
|
2026
|
-
container: HTMLDivElement;
|
|
2027
|
-
error?: undefined;
|
|
2028
|
-
}>;
|
|
2180
|
+
export interface CustomStyles {
|
|
2181
|
+
customCSSUrl?: string;
|
|
2182
|
+
customCSS?: customCssInterface;
|
|
2029
2183
|
}
|
|
2030
|
-
|
|
2031
|
-
export declare let loggedInStatus: boolean;
|
|
2032
|
-
export declare let samlAuthWindow: Window;
|
|
2033
|
-
export declare let samlCompletionPromise: Promise<void>;
|
|
2034
|
-
export declare const SSO_REDIRECTION_MARKER_GUID = "5e16222e-ef02-43e9-9fbd-24226bf3ce5b";
|
|
2035
2184
|
/**
|
|
2036
|
-
*
|
|
2037
|
-
*
|
|
2038
|
-
*
|
|
2185
|
+
* Configuration to define the customization on the Embedded
|
|
2186
|
+
* ThoughtSpot components.
|
|
2187
|
+
* You can customize styles, text strings, and icons.
|
|
2188
|
+
* For more information, see https://developers.thoughtspot.com/docs/custom-css.
|
|
2189
|
+
* @example
|
|
2190
|
+
* ```js
|
|
2191
|
+
* init({
|
|
2192
|
+
* // ...
|
|
2193
|
+
* customizations: {
|
|
2194
|
+
* style: {
|
|
2195
|
+
* customCSS: {
|
|
2196
|
+
* variables: {},
|
|
2197
|
+
* rules_UNSTABLE: {}
|
|
2198
|
+
* }
|
|
2199
|
+
* },
|
|
2200
|
+
* content: {
|
|
2201
|
+
* strings: {
|
|
2202
|
+
* 'LIVEBOARDS': 'Dashboards',
|
|
2203
|
+
* 'ANSWERS': 'Visualizations',
|
|
2204
|
+
* 'Edit': 'Modify',
|
|
2205
|
+
* 'Show underlying data': 'Show source data',
|
|
2206
|
+
* 'SpotIQ': 'Insights',
|
|
2207
|
+
* 'Monitor': 'Alerts',
|
|
2208
|
+
* }
|
|
2209
|
+
* },
|
|
2210
|
+
* iconSpriteUrl: 'https://my-custom-icon-sprite.svg'
|
|
2211
|
+
* }
|
|
2212
|
+
* })
|
|
2213
|
+
* ```
|
|
2039
2214
|
*/
|
|
2040
|
-
export
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2215
|
+
export interface CustomisationsInterface {
|
|
2216
|
+
style?: CustomStyles;
|
|
2217
|
+
content?: {
|
|
2218
|
+
/**
|
|
2219
|
+
* @version SDK: 1.26.0 | 9.7.0.cl
|
|
2220
|
+
*/
|
|
2221
|
+
strings?: Record<string, any>;
|
|
2222
|
+
[key: string]: any;
|
|
2223
|
+
};
|
|
2224
|
+
iconSpriteUrl?: string;
|
|
2046
2225
|
}
|
|
2047
2226
|
/**
|
|
2048
|
-
*
|
|
2227
|
+
* The configuration object for embedding ThoughtSpot content.
|
|
2228
|
+
* It includes the ThoughtSpot hostname or IP address,
|
|
2229
|
+
* the type of authentication, and the authentication endpoint
|
|
2230
|
+
* if a trusted authentication server is used.
|
|
2049
2231
|
* @group Authentication / Init
|
|
2050
2232
|
*/
|
|
2051
|
-
export
|
|
2233
|
+
export interface EmbedConfig {
|
|
2052
2234
|
/**
|
|
2053
|
-
*
|
|
2235
|
+
* The ThoughtSpot cluster hostname or IP address.
|
|
2054
2236
|
*/
|
|
2055
|
-
|
|
2237
|
+
thoughtSpotHost: string;
|
|
2056
2238
|
/**
|
|
2057
|
-
*
|
|
2239
|
+
* The authentication mechanism to use.
|
|
2058
2240
|
*/
|
|
2059
|
-
|
|
2241
|
+
authType: AuthType;
|
|
2060
2242
|
/**
|
|
2061
|
-
*
|
|
2062
|
-
*
|
|
2243
|
+
* [AuthServer] The trusted authentication endpoint to use to get the
|
|
2244
|
+
* authentication token. A `GET` request is made to the
|
|
2245
|
+
* authentication API endpoint, which returns the token
|
|
2246
|
+
* as a plaintext response. For trusted authentication,
|
|
2247
|
+
* the `authEndpoint` or `getAuthToken` attribute is required.
|
|
2063
2248
|
*/
|
|
2064
|
-
|
|
2249
|
+
authEndpoint?: string;
|
|
2065
2250
|
/**
|
|
2066
|
-
*
|
|
2251
|
+
* [AuthServer] A function that invokes the trusted authentication endpoint
|
|
2252
|
+
* and returns a Promise that resolves to the `auth token` string.
|
|
2253
|
+
* For trusted authentication, the `authEndpoint` or `getAuthToken`
|
|
2254
|
+
* attribute is required.
|
|
2255
|
+
*
|
|
2256
|
+
* It is advisable to fetch a new token inside this method and not
|
|
2257
|
+
* reuse the old issued token. When auth expires this method is
|
|
2258
|
+
* called again and if it is called with an older token, the authentication
|
|
2259
|
+
* will not succeed.
|
|
2067
2260
|
*/
|
|
2068
|
-
|
|
2261
|
+
getAuthToken?: () => Promise<string>;
|
|
2069
2262
|
/**
|
|
2070
|
-
*
|
|
2263
|
+
* [AuthServer / Basic] The user name of the ThoughtSpot user. This
|
|
2264
|
+
* attribute is required for trusted authentication.
|
|
2071
2265
|
*/
|
|
2072
|
-
|
|
2266
|
+
username?: string;
|
|
2073
2267
|
/**
|
|
2074
|
-
*
|
|
2075
|
-
*
|
|
2076
|
-
*
|
|
2077
|
-
*
|
|
2078
|
-
*/
|
|
2079
|
-
|
|
2080
|
-
}
|
|
2081
|
-
/**
|
|
2082
|
-
* Event emitter returned from {@link init}.
|
|
2083
|
-
* @group Authentication / Init
|
|
2084
|
-
*/
|
|
2085
|
-
export interface AuthEventEmitter {
|
|
2268
|
+
* [Basic] The ThoughtSpot login password corresponding to the username
|
|
2269
|
+
*
|
|
2270
|
+
* Warning: This feature is primarily intended for developer testing. It is
|
|
2271
|
+
* strongly advised not to use this authentication method in production.
|
|
2272
|
+
*/
|
|
2273
|
+
password?: string;
|
|
2086
2274
|
/**
|
|
2087
|
-
*
|
|
2088
|
-
*
|
|
2089
|
-
*
|
|
2275
|
+
* [SSO] For SSO Authentication, if `noRedirect` is set to true, it will
|
|
2276
|
+
* open the SAML auth flow in a popup, instead of redirecting the browser in
|
|
2277
|
+
* place.
|
|
2278
|
+
* @default false
|
|
2279
|
+
* @deprecated
|
|
2090
2280
|
*/
|
|
2091
|
-
|
|
2281
|
+
noRedirect?: boolean;
|
|
2092
2282
|
/**
|
|
2093
|
-
*
|
|
2094
|
-
*
|
|
2095
|
-
*
|
|
2283
|
+
* [SSO] For SSO Authentication, if `inPopup` is set to true, it will open
|
|
2284
|
+
* the SAML auth flow in a popup, instead of redirecting the browser in place.
|
|
2285
|
+
*
|
|
2286
|
+
* Need to use this with `authTriggerContainer`. Or manually trigger
|
|
2287
|
+
* the `AuthEvent.TRIGGER_SSO_POPUP` event on a user interaction.
|
|
2288
|
+
* @default false
|
|
2289
|
+
* @version SDK: 1.18.0
|
|
2096
2290
|
*/
|
|
2097
|
-
|
|
2098
|
-
on(event: AuthStatus.SUCCESS, listener: (sessionInfo: any) => void): this;
|
|
2099
|
-
once(event: AuthStatus.FAILURE, listener: (failureType: AuthFailureType) => void): this;
|
|
2100
|
-
once(event: AuthStatus.SDK_SUCCESS | AuthStatus.LOGOUT | AuthStatus.WAITING_FOR_POPUP, listener: () => void): this;
|
|
2101
|
-
once(event: AuthStatus.SUCCESS, listener: (sessionInfo: any) => void): this;
|
|
2291
|
+
inPopup?: boolean;
|
|
2102
2292
|
/**
|
|
2103
|
-
*
|
|
2104
|
-
*
|
|
2293
|
+
* [SSO] For SSO Authentication, one can supply an optional path param;
|
|
2294
|
+
* This will be the path on the host origin where the SAML flow will be
|
|
2295
|
+
* terminated.
|
|
2296
|
+
*
|
|
2297
|
+
* Eg: "/dashboard", "#/foo" [Do not include the host]
|
|
2298
|
+
* @version SDK: 1.10.2 | ThoughtSpot 8.2.0.cl, 8.4.1.sw
|
|
2105
2299
|
*/
|
|
2106
|
-
|
|
2300
|
+
redirectPath?: string;
|
|
2301
|
+
/** @internal */
|
|
2302
|
+
basepath?: string;
|
|
2107
2303
|
/**
|
|
2108
|
-
*
|
|
2109
|
-
*
|
|
2110
|
-
*
|
|
2111
|
-
* @
|
|
2112
|
-
* @param once
|
|
2304
|
+
* Boolean to define if the query parameters in the ThoughtSpot URL
|
|
2305
|
+
* should be encoded in base64. This provides additional security to
|
|
2306
|
+
* ThoughtSpot clusters against cross-site scripting attacks.
|
|
2307
|
+
* @default false
|
|
2113
2308
|
*/
|
|
2114
|
-
|
|
2309
|
+
shouldEncodeUrlQueryParams?: boolean;
|
|
2115
2310
|
/**
|
|
2116
|
-
*
|
|
2117
|
-
*
|
|
2311
|
+
* Suppress cookie access alert when third-party cookies are blocked by the
|
|
2312
|
+
* user's browser. Third-party cookie blocking is the default behaviour on
|
|
2313
|
+
* some web browsers like Safari. If you set this attribute to `true`,
|
|
2314
|
+
* you are encouraged to handle `noCookieAccess` event, to show your own treatment
|
|
2315
|
+
* in this case.
|
|
2316
|
+
* @default false
|
|
2118
2317
|
*/
|
|
2119
|
-
|
|
2120
|
-
}
|
|
2121
|
-
/**
|
|
2122
|
-
* Events which can be triggered on the emitter returned from {@link init}.
|
|
2123
|
-
* @group Authentication / Init
|
|
2124
|
-
*/
|
|
2125
|
-
export declare enum AuthEvent {
|
|
2318
|
+
suppressNoCookieAccessAlert?: boolean;
|
|
2126
2319
|
/**
|
|
2127
|
-
*
|
|
2128
|
-
*
|
|
2320
|
+
* Ignore the cookie access alert when third-party cookies are blocked by the
|
|
2321
|
+
* user's browser. If you set this to `true`, the embedded iframe behaviour
|
|
2322
|
+
* persists even in the case of a non-logged-in user.
|
|
2323
|
+
* @default false
|
|
2129
2324
|
*/
|
|
2130
|
-
|
|
2131
|
-
}
|
|
2132
|
-
/**
|
|
2133
|
-
*
|
|
2134
|
-
*/
|
|
2135
|
-
export declare function getAuthEE(): EventEmitter<AuthStatus | AuthEvent>;
|
|
2136
|
-
/**
|
|
2137
|
-
*
|
|
2138
|
-
* @param eventEmitter
|
|
2139
|
-
*/
|
|
2140
|
-
export declare function setAuthEE(eventEmitter: EventEmitter<AuthStatus | AuthEvent>): void;
|
|
2141
|
-
/**
|
|
2142
|
-
*
|
|
2143
|
-
*/
|
|
2144
|
-
export declare function notifyAuthSDKSuccess(): void;
|
|
2145
|
-
/**
|
|
2146
|
-
*
|
|
2147
|
-
*/
|
|
2148
|
-
export declare function notifyAuthSuccess(): Promise<void>;
|
|
2149
|
-
/**
|
|
2150
|
-
*
|
|
2151
|
-
* @param failureType
|
|
2152
|
-
*/
|
|
2153
|
-
export declare function notifyAuthFailure(failureType: AuthFailureType): void;
|
|
2154
|
-
/**
|
|
2155
|
-
*
|
|
2156
|
-
*/
|
|
2157
|
-
export declare function notifyLogout(): void;
|
|
2158
|
-
/**
|
|
2159
|
-
* Services to be called after the login is successful,
|
|
2160
|
-
* This should be called after the cookie is set for cookie auth or
|
|
2161
|
-
* after the token is set for cookieless.
|
|
2162
|
-
* @return {Promise<void>}
|
|
2163
|
-
* @example
|
|
2164
|
-
* ```js
|
|
2165
|
-
* await postLoginService();
|
|
2166
|
-
* ```
|
|
2167
|
-
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
2168
|
-
*/
|
|
2169
|
-
export declare function postLoginService(): Promise<void>;
|
|
2170
|
-
/**
|
|
2171
|
-
* Return releaseVersion if available
|
|
2172
|
-
*/
|
|
2173
|
-
export declare function getReleaseVersion(): string;
|
|
2174
|
-
/**
|
|
2175
|
-
* Perform token based authentication
|
|
2176
|
-
* @param embedConfig The embed configuration
|
|
2177
|
-
*/
|
|
2178
|
-
export declare const doTokenAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
2179
|
-
/**
|
|
2180
|
-
* Validate embedConfig parameters required for cookielessTokenAuth
|
|
2181
|
-
* @param embedConfig The embed configuration
|
|
2182
|
-
*/
|
|
2183
|
-
export declare const doCookielessTokenAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
2184
|
-
/**
|
|
2185
|
-
* Perform basic authentication to the ThoughtSpot cluster using the cluster
|
|
2186
|
-
* credentials.
|
|
2187
|
-
*
|
|
2188
|
-
* Warning: This feature is primarily intended for developer testing. It is
|
|
2189
|
-
* strongly advised not to use this authentication method in production.
|
|
2190
|
-
* @param embedConfig The embed configuration
|
|
2191
|
-
*/
|
|
2192
|
-
export declare const doBasicAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
2193
|
-
export declare const doSamlAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
2194
|
-
export declare const doOIDCAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
2195
|
-
export declare const logout: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
2196
|
-
/**
|
|
2197
|
-
* Perform authentication on the ThoughtSpot cluster
|
|
2198
|
-
* @param embedConfig The embed configuration
|
|
2199
|
-
*/
|
|
2200
|
-
export declare const authenticate: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
2201
|
-
/**
|
|
2202
|
-
* Check if we are authenticated to the ThoughtSpot cluster
|
|
2203
|
-
*/
|
|
2204
|
-
export declare const isAuthenticated: () => boolean;
|
|
2205
|
-
|
|
2206
|
-
export type SessionInfo = {
|
|
2207
|
-
releaseVersion: string;
|
|
2208
|
-
userGUID: string;
|
|
2209
|
-
currentOrgId: number;
|
|
2210
|
-
privileges: string[];
|
|
2211
|
-
mixpanelToken: string;
|
|
2212
|
-
isPublicUser: boolean;
|
|
2213
|
-
clusterId: string;
|
|
2214
|
-
clusterName: string;
|
|
2215
|
-
[key: string]: any;
|
|
2216
|
-
};
|
|
2217
|
-
export type PreauthInfo = {
|
|
2218
|
-
info?: SessionInfo;
|
|
2219
|
-
headers: Record<string, string>;
|
|
2220
|
-
status: number;
|
|
2221
|
-
[key: string]: any;
|
|
2222
|
-
};
|
|
2223
|
-
/**
|
|
2224
|
-
* Processes the session info response and returns the session info object.
|
|
2225
|
-
* @param preauthInfoResp {any} Response from the session info API.
|
|
2226
|
-
* @returns {PreauthInfo} The session info object.
|
|
2227
|
-
* @example ```js
|
|
2228
|
-
* const preauthInfoResp = await fetch(sessionInfoPath);
|
|
2229
|
-
* const sessionInfo = await formatPreauthInfo(preauthInfoResp);
|
|
2230
|
-
* console.log(sessionInfo);
|
|
2231
|
-
* ```
|
|
2232
|
-
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
2233
|
-
*/
|
|
2234
|
-
export declare const formatPreauthInfo: (preauthInfoResp: any) => Promise<PreauthInfo>;
|
|
2235
|
-
/**
|
|
2236
|
-
* Returns the session info object and caches it for future use.
|
|
2237
|
-
* Once fetched the session info object is cached and returned from the cache on
|
|
2238
|
-
* subsequent calls.
|
|
2239
|
-
* @example ```js
|
|
2240
|
-
* const preauthInfo = await getPreauthInfo();
|
|
2241
|
-
* console.log(preauthInfo);
|
|
2242
|
-
* ```
|
|
2243
|
-
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
2244
|
-
* @returns {Promise<SessionInfo>} The session info object.
|
|
2245
|
-
*/
|
|
2246
|
-
export declare function getPreauthInfo(allowCache?: boolean): Promise<PreauthInfo>;
|
|
2247
|
-
/**
|
|
2248
|
-
* Returns the cached session info object and caches it for future use.
|
|
2249
|
-
* Once fetched the session info object is cached and returned from the cache on
|
|
2250
|
-
* subsequent calls.
|
|
2251
|
-
* This cache is cleared when inti is called OR resetCachedSessionInfo is called.
|
|
2252
|
-
* @example ```js
|
|
2253
|
-
* const sessionInfo = await getSessionInfo();
|
|
2254
|
-
* console.log(sessionInfo);
|
|
2255
|
-
* ```
|
|
2256
|
-
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
2257
|
-
* @returns {Promise<SessionInfo>} The session info object.
|
|
2258
|
-
*/
|
|
2259
|
-
export declare function getSessionInfo(): Promise<SessionInfo>;
|
|
2260
|
-
/**
|
|
2261
|
-
* Returns the cached session info object. If the client is not authenticated the
|
|
2262
|
-
* function will return null.
|
|
2263
|
-
* @example ```js
|
|
2264
|
-
* const sessionInfo = getCachedSessionInfo();
|
|
2265
|
-
* if (sessionInfo) {
|
|
2266
|
-
* console.log(sessionInfo);
|
|
2267
|
-
* } else {
|
|
2268
|
-
* console.log('Not authenticated');
|
|
2269
|
-
* }
|
|
2270
|
-
* ```
|
|
2271
|
-
* @returns {SessionInfo | null} The session info object.
|
|
2272
|
-
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
2273
|
-
*/
|
|
2274
|
-
export declare function getCachedSessionInfo(): SessionInfo | null;
|
|
2275
|
-
/**
|
|
2276
|
-
* Processes the session info response and returns the session info object.
|
|
2277
|
-
* @param sessionInfoResp {any} Response from the session info API.
|
|
2278
|
-
* @returns {SessionInfo} The session info object.
|
|
2279
|
-
* @example ```js
|
|
2280
|
-
* const sessionInfoResp = await fetch(sessionInfoPath);
|
|
2281
|
-
* const sessionInfo = getSessionDetails(sessionInfoResp);
|
|
2282
|
-
* console.log(sessionInfo);
|
|
2283
|
-
* ```
|
|
2284
|
-
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
2285
|
-
*/
|
|
2286
|
-
export declare const getSessionDetails: (sessionInfoResp: any) => SessionInfo;
|
|
2287
|
-
/**
|
|
2288
|
-
* Resets the cached session info object and forces a new fetch on the next call.
|
|
2289
|
-
* @example ```js
|
|
2290
|
-
* resetCachedSessionInfo();
|
|
2291
|
-
* const sessionInfo = await getSessionInfo();
|
|
2292
|
-
* console.log(sessionInfo);
|
|
2293
|
-
* ```
|
|
2294
|
-
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
2295
|
-
* @returns {void}
|
|
2296
|
-
*/
|
|
2297
|
-
export declare function resetCachedSessionInfo(): void;
|
|
2298
|
-
/**
|
|
2299
|
-
* Resets the cached preauth info object and forces a new fetch on the next call.
|
|
2300
|
-
* @example ```js
|
|
2301
|
-
* resetCachedPreauthInfo();
|
|
2302
|
-
* const preauthInfo = await getPreauthInfo();
|
|
2303
|
-
* console.log(preauthInfo);
|
|
2304
|
-
* ```
|
|
2305
|
-
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
2306
|
-
* @returns {void}
|
|
2307
|
-
*/
|
|
2308
|
-
export declare function resetCachedPreauthInfo(): void;
|
|
2309
|
-
|
|
2310
|
-
/**
|
|
2311
|
-
* Copyright (c) 2023
|
|
2312
|
-
*
|
|
2313
|
-
* TypeScript type definitions for ThoughtSpot Visual Embed SDK
|
|
2314
|
-
* @summary Type definitions for Embed SDK
|
|
2315
|
-
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
2316
|
-
*/
|
|
2317
|
-
/**
|
|
2318
|
-
* The authentication mechanism for allowing access to the
|
|
2319
|
-
* the embedded app
|
|
2320
|
-
* @group Authentication / Init
|
|
2321
|
-
*/
|
|
2322
|
-
export declare enum AuthType {
|
|
2325
|
+
ignoreNoCookieAccess?: boolean;
|
|
2323
2326
|
/**
|
|
2324
|
-
*
|
|
2325
|
-
*
|
|
2326
|
-
* @
|
|
2327
|
-
* ```js
|
|
2328
|
-
* init({
|
|
2329
|
-
* // ...
|
|
2330
|
-
* authType: AuthType.None,
|
|
2331
|
-
* });
|
|
2332
|
-
* ```
|
|
2327
|
+
* Re-login a user with the previous login options
|
|
2328
|
+
* when a user session expires.
|
|
2329
|
+
* @default false
|
|
2333
2330
|
*/
|
|
2334
|
-
|
|
2331
|
+
autoLogin?: boolean;
|
|
2335
2332
|
/**
|
|
2336
|
-
*
|
|
2337
|
-
*
|
|
2338
|
-
*
|
|
2339
|
-
*
|
|
2340
|
-
*
|
|
2341
|
-
*
|
|
2342
|
-
* For example, if you are using Okta as IdP, you can enable iframe embedding.
|
|
2343
|
-
* @example
|
|
2344
|
-
* ```js
|
|
2345
|
-
* init({
|
|
2346
|
-
* // ...
|
|
2347
|
-
* authType: AuthType.EmbeddedSSO,
|
|
2348
|
-
* });
|
|
2349
|
-
* ```
|
|
2350
|
-
* @version: SDK: 1.15.0 | ThoughtSpot: 8.8.0.cl
|
|
2333
|
+
* Disable redirection to the login page when the embedded session expires
|
|
2334
|
+
* This flag is typically used alongside the combination of authentication modes such
|
|
2335
|
+
* as {@link AuthType.AuthServer} and auto-login behavior {@link
|
|
2336
|
+
* EmbedConfig.autoLogin}
|
|
2337
|
+
* @version SDK: 1.9.3 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw
|
|
2338
|
+
* @default false
|
|
2351
2339
|
*/
|
|
2352
|
-
|
|
2340
|
+
disableLoginRedirect?: boolean;
|
|
2353
2341
|
/**
|
|
2354
|
-
*
|
|
2355
|
-
* @
|
|
2356
|
-
* @hidden
|
|
2342
|
+
* This message is displayed in the embedded view when a user login fails.
|
|
2343
|
+
* @version SDK: 1.10.1 | ThoughtSpot: 8.2.0.cl, 8.4.1.sw
|
|
2357
2344
|
*/
|
|
2358
|
-
|
|
2345
|
+
loginFailedMessage?: string;
|
|
2359
2346
|
/**
|
|
2360
|
-
*
|
|
2361
|
-
* @
|
|
2362
|
-
* @hidden
|
|
2347
|
+
* Calls the prefetch method internally when set to `true`
|
|
2348
|
+
* @default false
|
|
2363
2349
|
*/
|
|
2364
|
-
|
|
2350
|
+
callPrefetch?: boolean;
|
|
2365
2351
|
/**
|
|
2366
|
-
*
|
|
2367
|
-
*
|
|
2368
|
-
*
|
|
2352
|
+
* When there are multiple objects embedded, queue the rendering of embedded objects
|
|
2353
|
+
* to start after the previous embed's render is complete. This helps improve
|
|
2354
|
+
* performance by decreasing the load on the browser.
|
|
2355
|
+
* @Version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
|
|
2356
|
+
* @default false
|
|
2357
|
+
*/
|
|
2358
|
+
queueMultiRenders?: boolean;
|
|
2359
|
+
/**
|
|
2360
|
+
* [AuthServer|Basic] Detect if third-party party cookies are enabled by doing an
|
|
2361
|
+
* additional call. This is slower and should be avoided. Listen to the
|
|
2362
|
+
* `NO_COOKIE_ACCESS` event to handle the situation.
|
|
2369
2363
|
*
|
|
2370
|
-
* This
|
|
2371
|
-
*
|
|
2372
|
-
* @
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
*
|
|
2377
|
-
*
|
|
2378
|
-
|
|
2364
|
+
* This is slightly slower than letting the browser handle the cookie check, as it
|
|
2365
|
+
* involves an extra network call.
|
|
2366
|
+
* @version SDK: 1.10.4 | ThoughtSpot: 8.2.0.cl, 8.4.1.sw
|
|
2367
|
+
*/
|
|
2368
|
+
detectCookieAccessSlow?: boolean;
|
|
2369
|
+
/**
|
|
2370
|
+
* Hide the `beta` alert warning message for SearchEmbed.
|
|
2371
|
+
* @version SDK: 1.12.0 | ThoughtSpot: 8.4.0.cl, 8.4.1.sw*
|
|
2372
|
+
*/
|
|
2373
|
+
suppressSearchEmbedBetaWarning?: boolean;
|
|
2374
|
+
/**
|
|
2375
|
+
* Hide `beta` alert warning message for SageEmbed.
|
|
2379
2376
|
*
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2377
|
+
*/
|
|
2378
|
+
suppressSageEmbedBetaWarning?: boolean;
|
|
2379
|
+
/**
|
|
2380
|
+
* Custom style params for embed Config.
|
|
2381
|
+
* @version SDK: 1.17.0 | ThoughtSpot: 8.9.0.cl, 9.0.1.sw
|
|
2382
|
+
*/
|
|
2383
|
+
customizations?: CustomisationsInterface;
|
|
2384
|
+
/**
|
|
2385
|
+
* For `inPopup` SAMLRedirect or OIDCRedirect authentication, we need a
|
|
2386
|
+
* button that the user can click to trigger the flow.
|
|
2387
|
+
* This attribute sets a containing element for that button.
|
|
2383
2388
|
* @example
|
|
2384
2389
|
* ```js
|
|
2385
2390
|
* init({
|
|
2386
|
-
* // ...
|
|
2387
2391
|
* authType: AuthType.SAMLRedirect,
|
|
2388
|
-
* authTriggerText: 'Login with SAML',
|
|
2389
|
-
* authTriggerContainer: '#embed-container',
|
|
2390
2392
|
* inPopup: true,
|
|
2391
|
-
*
|
|
2393
|
+
* authTriggerContainer: '#auth-trigger-container'
|
|
2394
|
+
* })
|
|
2392
2395
|
* ```
|
|
2396
|
+
* @version SDK: 1.17.0 | ThoughtSpot: 8.9.0.cl, 9.0.1.sw
|
|
2397
|
+
*/
|
|
2398
|
+
authTriggerContainer?: string | HTMLElement;
|
|
2399
|
+
/**
|
|
2400
|
+
* Specify that we want to use the `AuthEvent.TRIGGER_SSO_POPUP` event to trigger
|
|
2401
|
+
* SAML popup. This is useful when you want to trigger the popup on a custom user
|
|
2402
|
+
* action.
|
|
2393
2403
|
*
|
|
2394
|
-
* Can also use the event to trigger the popup flow. Works the same
|
|
2395
|
-
* as the above example.
|
|
2396
|
-
* @example
|
|
2397
|
-
* ```js
|
|
2398
|
-
* const authEE = init({
|
|
2399
|
-
* // ...
|
|
2400
|
-
* authType: AuthType.SAMLRedirect,
|
|
2401
|
-
* inPopup: true,
|
|
2402
|
-
* });
|
|
2403
|
-
*
|
|
2404
|
-
* someButtonOnYourPage.addEventListener('click', () => {
|
|
2405
|
-
* authEE.emit(AuthEvent.TRIGGER_SSO_POPUP);
|
|
2406
|
-
* });
|
|
2407
|
-
* ```
|
|
2408
2404
|
*/
|
|
2409
|
-
|
|
2405
|
+
useEventForSAMLPopup?: boolean;
|
|
2410
2406
|
/**
|
|
2411
|
-
*
|
|
2412
|
-
*
|
|
2413
|
-
* @
|
|
2407
|
+
* Text to show in the button which triggers the popup auth flow.
|
|
2408
|
+
* Default: `Authorize`.
|
|
2409
|
+
* @version SDK: 1.17.0 | ThoughtSpot: 8.9.0.cl, 9.0.1.sw
|
|
2414
2410
|
*/
|
|
2415
|
-
|
|
2411
|
+
authTriggerText?: string;
|
|
2416
2412
|
/**
|
|
2417
|
-
*
|
|
2418
|
-
*
|
|
2419
|
-
*
|
|
2413
|
+
* Prevent users from accessing the full application or ThoughtSpot application pages
|
|
2414
|
+
* access to the embedded application users
|
|
2415
|
+
* outside of the iframe.
|
|
2416
|
+
* @default true
|
|
2417
|
+
* @version SDK: 1.22.0 | ThoughtSpot: 9.3.0.cl, 9.5.1.sw
|
|
2420
2418
|
*/
|
|
2421
|
-
|
|
2419
|
+
blockNonEmbedFullAppAccess?: boolean;
|
|
2422
2420
|
/**
|
|
2423
|
-
*
|
|
2421
|
+
* Host config in case embedded app is inside TS app itself
|
|
2424
2422
|
* @hidden
|
|
2425
|
-
* @deprecated Use {@link TrustedAuth} instead
|
|
2426
2423
|
*/
|
|
2427
|
-
|
|
2424
|
+
hostConfig?: {
|
|
2425
|
+
hostUserGuid: string;
|
|
2426
|
+
hostClusterId: string;
|
|
2427
|
+
hostClusterName: string;
|
|
2428
|
+
};
|
|
2428
2429
|
/**
|
|
2429
|
-
*
|
|
2430
|
-
*
|
|
2431
|
-
*
|
|
2432
|
-
* @example
|
|
2433
|
-
* ```js
|
|
2434
|
-
* init({
|
|
2435
|
-
* // ...
|
|
2436
|
-
* authType: AuthType.TrustedAuthToken,
|
|
2437
|
-
* getAuthToken: () => {
|
|
2438
|
-
* return fetch('https://my-backend.app/ts-token')
|
|
2439
|
-
* .then((response) => response.json())
|
|
2440
|
-
* .then((data) => data.token);
|
|
2441
|
-
* }
|
|
2442
|
-
* });
|
|
2443
|
-
* ```
|
|
2430
|
+
* Pendo API key to enable Pendo tracking to your own subscription, the key
|
|
2431
|
+
* is added as an additional key to the embed, as per this link:https://support.pendo.io/hc/en-us/articles/360032201951-Send-data-to-multiple-subscriptions[document].
|
|
2432
|
+
* @version SDK: 1.27.0 | ThoughtSpot: 9.8.0.cl
|
|
2444
2433
|
*/
|
|
2445
|
-
|
|
2434
|
+
pendoTrackingKey?: string;
|
|
2446
2435
|
/**
|
|
2447
|
-
*
|
|
2448
|
-
*
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2436
|
+
* If passed as true all alerts will be suppressed in the embedded app.
|
|
2437
|
+
* @version SDK: 1.26.2 | ThoughtSpot: *
|
|
2438
|
+
*/
|
|
2439
|
+
suppressErrorAlerts?: boolean;
|
|
2440
|
+
/**
|
|
2441
|
+
* Suppress or show specific types of logs in the console output.
|
|
2442
|
+
* For example, `LogLevel.ERROR` shows only Visual Embed SDK and
|
|
2443
|
+
* ThoughtSpot application errors and suppresses
|
|
2444
|
+
* other logs such as warnings, information alerts,
|
|
2445
|
+
* and debug messages in the console output.
|
|
2446
|
+
*
|
|
2447
|
+
* @default LogLevel.ERROR
|
|
2452
2448
|
* @example
|
|
2453
2449
|
* ```js
|
|
2454
2450
|
* init({
|
|
2455
|
-
*
|
|
2456
|
-
*
|
|
2457
|
-
*
|
|
2458
|
-
* return fetch('https://my-backend.app/ts-token')
|
|
2459
|
-
* .then((response) => response.json())
|
|
2460
|
-
* .then((data) => data.token);
|
|
2461
|
-
* }
|
|
2451
|
+
* ...embedConfig,
|
|
2452
|
+
* logLevel: LogLevel.SILENT
|
|
2453
|
+
* })
|
|
2462
2454
|
* ```
|
|
2463
|
-
* @version SDK: 1.
|
|
2455
|
+
* @version SDK: 1.26.7 | ThoughtSpot: 9.10.0.cl
|
|
2464
2456
|
*/
|
|
2465
|
-
|
|
2457
|
+
logLevel?: LogLevel;
|
|
2466
2458
|
/**
|
|
2467
|
-
*
|
|
2468
|
-
*
|
|
2469
|
-
* Warning: This feature is primarily intended for developer testing. It is
|
|
2470
|
-
* strongly advised not to use this authentication method in production.
|
|
2459
|
+
* Disables the Mixpanel tracking from the SDK.
|
|
2460
|
+
* @version SDK: 1.27.9
|
|
2471
2461
|
*/
|
|
2472
|
-
|
|
2473
|
-
}
|
|
2474
|
-
/**
|
|
2475
|
-
*
|
|
2476
|
-
* This option does not apply to the classic homepage experience.
|
|
2477
|
-
* To access the updated modular homepage,
|
|
2478
|
-
* set `modularHomeExperience` to `true`
|
|
2479
|
-
* (available as Early Access feature in 9.12.5.cl).
|
|
2480
|
-
*
|
|
2481
|
-
*/
|
|
2482
|
-
export declare enum HomeLeftNavItem {
|
|
2462
|
+
disableSDKTracking?: boolean;
|
|
2483
2463
|
/**
|
|
2484
|
-
*
|
|
2464
|
+
* Overrides default/user preferred locale for date formatting
|
|
2465
|
+
* @version SDK: 1.28.4 | ThoughtSpot: 10.0.0.cl, 9.5.0.sw
|
|
2485
2466
|
*/
|
|
2486
|
-
|
|
2467
|
+
dateFormatLocale?: string;
|
|
2487
2468
|
/**
|
|
2488
|
-
*
|
|
2469
|
+
* Overrides default/user preferred locale for number formatting
|
|
2470
|
+
* @version SDK: 1.28.4 | ThoughtSpot: 10.0.0.cl, 9.5.0.sw
|
|
2489
2471
|
*/
|
|
2490
|
-
|
|
2491
|
-
/**
|
|
2492
|
-
* @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
|
|
2493
|
-
*/
|
|
2494
|
-
Liveboards = "liveboards",
|
|
2495
|
-
/**
|
|
2496
|
-
* @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
|
|
2497
|
-
*/
|
|
2498
|
-
Answers = "answers",
|
|
2499
|
-
/**
|
|
2500
|
-
* @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
|
|
2501
|
-
*/
|
|
2502
|
-
MonitorSubscription = "monitor-alerts",
|
|
2472
|
+
numberFormatLocale?: string;
|
|
2503
2473
|
/**
|
|
2504
|
-
*
|
|
2474
|
+
* Format to be used for currency when currency format is set to infer from browser
|
|
2475
|
+
* @version SDK: 1.28.4 | ThoughtSpot: 10.0.0.cl, 9.5.0.sw
|
|
2505
2476
|
*/
|
|
2506
|
-
|
|
2477
|
+
currencyFormat?: string;
|
|
2507
2478
|
/**
|
|
2508
|
-
*
|
|
2479
|
+
* This flag is used to disable the token verification in the SDK.
|
|
2480
|
+
* Enabling this flag will also disable the caching of the token.
|
|
2481
|
+
* @hidden
|
|
2482
|
+
* @example
|
|
2483
|
+
* ```js
|
|
2484
|
+
* init({
|
|
2485
|
+
* ...embedConfig,
|
|
2486
|
+
* disableTokenVerification : true
|
|
2487
|
+
* })
|
|
2488
|
+
* ```
|
|
2489
|
+
* @version SDK: 1.28.5 | ThoughtSpot: 9.10.0.cl, 10.1.0.sw
|
|
2509
2490
|
*/
|
|
2510
|
-
|
|
2511
|
-
}
|
|
2512
|
-
export type DOMSelector = string | HTMLElement;
|
|
2513
|
-
/**
|
|
2514
|
-
* inline customCSS within the {@link CustomisationsInterface}.
|
|
2515
|
-
* Use {@link CustomCssVariables} or css rules.
|
|
2516
|
-
*/
|
|
2517
|
-
export interface customCssInterface {
|
|
2491
|
+
disableTokenVerification?: boolean;
|
|
2518
2492
|
/**
|
|
2519
|
-
*
|
|
2520
|
-
*
|
|
2521
|
-
* interface. For more information, see
|
|
2522
|
-
* link:https://developers.thoughtspot.com/docs/css-variables-reference
|
|
2493
|
+
* This flag is used to disable showing the login failure page in the embedded app.
|
|
2494
|
+
* @version SDK 1.32.3 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
|
|
2523
2495
|
*/
|
|
2524
|
-
|
|
2496
|
+
disableLoginFailurePage?: boolean;
|
|
2525
2497
|
/**
|
|
2526
|
-
*
|
|
2527
|
-
*
|
|
2498
|
+
* This is an object (key/val) of override flags which will be applied
|
|
2499
|
+
* to the internal embedded object. This can be used to add any
|
|
2500
|
+
* URL flag.
|
|
2501
|
+
* Warning: This option is for advanced use only and is used internally
|
|
2502
|
+
* to control embed behavior in non-regular ways. We do not publish the
|
|
2503
|
+
* list of supported keys and values associated with each.
|
|
2528
2504
|
* @example
|
|
2529
2505
|
* ```js
|
|
2530
|
-
*
|
|
2531
|
-
*
|
|
2532
|
-
*
|
|
2533
|
-
*
|
|
2534
|
-
*
|
|
2535
|
-
*
|
|
2506
|
+
* const embed = new LiveboardEmbed('#embed', {
|
|
2507
|
+
* ... // other liveboard view config
|
|
2508
|
+
* additionalFlags: {
|
|
2509
|
+
* flag1: 'value1',
|
|
2510
|
+
* flag2: 'value2'
|
|
2511
|
+
* }
|
|
2512
|
+
* });
|
|
2536
2513
|
* ```
|
|
2537
|
-
*
|
|
2538
|
-
|
|
2514
|
+
* @version SDK: 1.33.5 | ThoughtSpot: *
|
|
2515
|
+
*/
|
|
2516
|
+
additionalFlags?: {
|
|
2517
|
+
[key: string]: string | number | boolean;
|
|
2518
|
+
};
|
|
2519
|
+
/**
|
|
2520
|
+
* This is an object (key/val) for customVariables being
|
|
2521
|
+
* used by the third party tool's script.
|
|
2539
2522
|
* @example
|
|
2540
2523
|
* ```js
|
|
2541
|
-
*
|
|
2542
|
-
*
|
|
2543
|
-
*
|
|
2544
|
-
*
|
|
2545
|
-
*
|
|
2546
|
-
*
|
|
2524
|
+
* const embed = new LiveboardEmbed('#embed', {
|
|
2525
|
+
* ... // other liveboard view config
|
|
2526
|
+
* customVariablesForThirdPartyTools: {
|
|
2527
|
+
* key1: 'value1',
|
|
2528
|
+
* key2: 'value2'
|
|
2529
|
+
* }
|
|
2530
|
+
* });
|
|
2547
2531
|
* ```
|
|
2532
|
+
* @version SDK 1.37.0 | ThoughtSpot: 10.7.0.cl
|
|
2548
2533
|
*/
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
[declaration: string]: string;
|
|
2552
|
-
};
|
|
2553
|
-
};
|
|
2554
|
-
}
|
|
2555
|
-
/**
|
|
2556
|
-
* Styles within the {@link CustomisationsInterface}.
|
|
2557
|
-
*/
|
|
2558
|
-
export interface CustomStyles {
|
|
2559
|
-
customCSSUrl?: string;
|
|
2560
|
-
customCSS?: customCssInterface;
|
|
2534
|
+
customVariablesForThirdPartyTools?: Record<string, any>;
|
|
2535
|
+
disablePreauthCache?: boolean;
|
|
2561
2536
|
}
|
|
2562
|
-
|
|
2563
|
-
* Configuration to define the customization on the Embedded
|
|
2564
|
-
* ThoughtSpot components.
|
|
2565
|
-
* You can customize styles, text strings, and icons.
|
|
2566
|
-
* For more information, see https://developers.thoughtspot.com/docs/custom-css.
|
|
2567
|
-
* @example
|
|
2568
|
-
* ```js
|
|
2569
|
-
* init({
|
|
2570
|
-
* // ...
|
|
2571
|
-
* customizations: {
|
|
2572
|
-
* style: {
|
|
2573
|
-
* customCSS: {
|
|
2574
|
-
* variables: {},
|
|
2575
|
-
* rules_UNSTABLE: {}
|
|
2576
|
-
* }
|
|
2577
|
-
* },
|
|
2578
|
-
* content: {
|
|
2579
|
-
* strings: {
|
|
2580
|
-
* 'LIVEBOARDS': 'Dashboards',
|
|
2581
|
-
* 'ANSWERS': 'Visualizations',
|
|
2582
|
-
* 'Edit': 'Modify',
|
|
2583
|
-
* 'Show underlying data': 'Show source data',
|
|
2584
|
-
* 'SpotIQ': 'Insights',
|
|
2585
|
-
* 'Monitor': 'Alerts',
|
|
2586
|
-
* }
|
|
2587
|
-
* },
|
|
2588
|
-
* iconSpriteUrl: 'https://my-custom-icon-sprite.svg'
|
|
2589
|
-
* }
|
|
2590
|
-
* })
|
|
2591
|
-
* ```
|
|
2592
|
-
*/
|
|
2593
|
-
export interface CustomisationsInterface {
|
|
2594
|
-
style?: CustomStyles;
|
|
2595
|
-
content?: {
|
|
2596
|
-
/**
|
|
2597
|
-
* @version SDK: 1.26.0 | 9.7.0.cl
|
|
2598
|
-
*/
|
|
2599
|
-
strings?: Record<string, any>;
|
|
2600
|
-
[key: string]: any;
|
|
2601
|
-
};
|
|
2602
|
-
iconSpriteUrl?: string;
|
|
2537
|
+
export interface LayoutConfig {
|
|
2603
2538
|
}
|
|
2604
2539
|
/**
|
|
2605
|
-
*
|
|
2606
|
-
*
|
|
2607
|
-
* the type of authentication, and the authentication endpoint
|
|
2608
|
-
* if a trusted authentication server is used.
|
|
2609
|
-
* @group Authentication / Init
|
|
2540
|
+
* Embedded iframe configuration
|
|
2541
|
+
* @group Embed components
|
|
2610
2542
|
*/
|
|
2611
|
-
export interface
|
|
2543
|
+
export interface FrameParams {
|
|
2612
2544
|
/**
|
|
2613
|
-
* The
|
|
2545
|
+
* The width of the iframe (unit is pixels if numeric).
|
|
2614
2546
|
*/
|
|
2615
|
-
|
|
2547
|
+
width?: number | string;
|
|
2616
2548
|
/**
|
|
2617
|
-
* The
|
|
2549
|
+
* The height of the iframe (unit is pixels if numeric).
|
|
2618
2550
|
*/
|
|
2619
|
-
|
|
2551
|
+
height?: number | string;
|
|
2620
2552
|
/**
|
|
2621
|
-
*
|
|
2622
|
-
*
|
|
2623
|
-
*
|
|
2624
|
-
* as a plaintext response. For trusted authentication,
|
|
2625
|
-
* the `authEndpoint` or `getAuthToken` attribute is required.
|
|
2553
|
+
* Set to 'lazy' to enable lazy loading of the embedded TS frame.
|
|
2554
|
+
* This will defer loading of the frame until it comes into the
|
|
2555
|
+
* viewport. This is useful for performance optimization.
|
|
2626
2556
|
*/
|
|
2627
|
-
|
|
2557
|
+
loading?: 'lazy' | 'eager' | 'auto';
|
|
2628
2558
|
/**
|
|
2629
|
-
*
|
|
2630
|
-
*
|
|
2631
|
-
* For trusted authentication, the `authEndpoint` or `getAuthToken`
|
|
2632
|
-
* attribute is required.
|
|
2633
|
-
*
|
|
2634
|
-
* It is advisable to fetch a new token inside this method and not
|
|
2635
|
-
* reuse the old issued token. When auth expires this method is
|
|
2636
|
-
* called again and if it is called with an older token, the authentication
|
|
2637
|
-
* will not succeed.
|
|
2559
|
+
* This parameters will be passed on the iframe
|
|
2560
|
+
* as is.
|
|
2638
2561
|
*/
|
|
2639
|
-
|
|
2562
|
+
[key: string]: string | number | boolean | undefined;
|
|
2563
|
+
}
|
|
2564
|
+
/**
|
|
2565
|
+
* The configuration object for an embedded view.
|
|
2566
|
+
*/
|
|
2567
|
+
export interface ViewConfig {
|
|
2640
2568
|
/**
|
|
2641
|
-
*
|
|
2642
|
-
* attribute is required for trusted authentication.
|
|
2569
|
+
* @hidden
|
|
2643
2570
|
*/
|
|
2644
|
-
|
|
2571
|
+
layoutConfig?: LayoutConfig;
|
|
2645
2572
|
/**
|
|
2646
|
-
*
|
|
2647
|
-
*
|
|
2648
|
-
*
|
|
2649
|
-
*
|
|
2573
|
+
* The width and height dimensions to render an embedded
|
|
2574
|
+
* object inside your app. Specify the values in pixels or percentage.
|
|
2575
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 7.2.1
|
|
2576
|
+
* @example
|
|
2577
|
+
* ```js
|
|
2578
|
+
* const embed = new LiveboardEmbed('#embed', {
|
|
2579
|
+
* ... // other liveboard view config
|
|
2580
|
+
* frameParams: {
|
|
2581
|
+
* width: '500px' | '50%',
|
|
2582
|
+
* height: '400px' | '60%',
|
|
2583
|
+
* },
|
|
2584
|
+
* });
|
|
2585
|
+
* ```
|
|
2650
2586
|
*/
|
|
2651
|
-
|
|
2587
|
+
frameParams?: FrameParams;
|
|
2652
2588
|
/**
|
|
2653
|
-
*
|
|
2654
|
-
* open the SAML auth flow in a popup, instead of redirecting the browser in
|
|
2655
|
-
* place.
|
|
2656
|
-
* @default false
|
|
2657
|
-
* @deprecated
|
|
2589
|
+
* @hidden
|
|
2658
2590
|
*/
|
|
2659
|
-
|
|
2591
|
+
theme?: string;
|
|
2660
2592
|
/**
|
|
2661
|
-
*
|
|
2662
|
-
* the SAML auth flow in a popup, instead of redirecting the browser in place.
|
|
2663
|
-
*
|
|
2664
|
-
* Need to use this with `authTriggerContainer`. Or manually trigger
|
|
2665
|
-
* the `AuthEvent.TRIGGER_SSO_POPUP` event on a user interaction.
|
|
2666
|
-
* @default false
|
|
2667
|
-
* @version SDK: 1.18.0
|
|
2593
|
+
* @hidden
|
|
2668
2594
|
*/
|
|
2669
|
-
|
|
2595
|
+
styleSheet__unstable?: string;
|
|
2670
2596
|
/**
|
|
2671
|
-
*
|
|
2672
|
-
*
|
|
2673
|
-
*
|
|
2674
|
-
*
|
|
2675
|
-
*
|
|
2676
|
-
* @
|
|
2597
|
+
* The list of actions to disable from the primary menu, more menu
|
|
2598
|
+
* (...), and the contextual menu. These actions will be disabled
|
|
2599
|
+
* for the user.
|
|
2600
|
+
* Use this to disable actions.
|
|
2601
|
+
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
|
|
2602
|
+
* @example
|
|
2603
|
+
* ```js
|
|
2604
|
+
* const embed = new LiveboardEmbed('#embed', {
|
|
2605
|
+
* ... // other liveboard view config
|
|
2606
|
+
* disabledActions: [Action.Download, Action.Save]
|
|
2607
|
+
* });
|
|
2608
|
+
* ```
|
|
2677
2609
|
*/
|
|
2678
|
-
|
|
2679
|
-
/** @internal */
|
|
2680
|
-
basepath?: string;
|
|
2610
|
+
disabledActions?: Action[];
|
|
2681
2611
|
/**
|
|
2682
|
-
*
|
|
2683
|
-
*
|
|
2684
|
-
*
|
|
2685
|
-
*
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
*
|
|
2690
|
-
*
|
|
2691
|
-
*
|
|
2692
|
-
* you are encouraged to handle `noCookieAccess` event, to show your own treatment
|
|
2693
|
-
* in this case.
|
|
2694
|
-
* @default false
|
|
2695
|
-
*/
|
|
2696
|
-
suppressNoCookieAccessAlert?: boolean;
|
|
2697
|
-
/**
|
|
2698
|
-
* Ignore the cookie access alert when third-party cookies are blocked by the
|
|
2699
|
-
* user's browser. If you set this to `true`, the embedded iframe behaviour
|
|
2700
|
-
* persists even in the case of a non-logged-in user.
|
|
2701
|
-
* @default false
|
|
2702
|
-
*/
|
|
2703
|
-
ignoreNoCookieAccess?: boolean;
|
|
2704
|
-
/**
|
|
2705
|
-
* Re-login a user with the previous login options
|
|
2706
|
-
* when a user session expires.
|
|
2707
|
-
* @default false
|
|
2708
|
-
*/
|
|
2709
|
-
autoLogin?: boolean;
|
|
2710
|
-
/**
|
|
2711
|
-
* Disable redirection to the login page when the embedded session expires
|
|
2712
|
-
* This flag is typically used alongside the combination of authentication modes such
|
|
2713
|
-
* as {@link AuthType.AuthServer} and auto-login behavior {@link
|
|
2714
|
-
* EmbedConfig.autoLogin}
|
|
2715
|
-
* @version SDK: 1.9.3 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw
|
|
2716
|
-
* @default false
|
|
2717
|
-
*/
|
|
2718
|
-
disableLoginRedirect?: boolean;
|
|
2719
|
-
/**
|
|
2720
|
-
* This message is displayed in the embedded view when a user login fails.
|
|
2721
|
-
* @version SDK: 1.10.1 | ThoughtSpot: 8.2.0.cl, 8.4.1.sw
|
|
2722
|
-
*/
|
|
2723
|
-
loginFailedMessage?: string;
|
|
2724
|
-
/**
|
|
2725
|
-
* Calls the prefetch method internally when set to `true`
|
|
2726
|
-
* @default false
|
|
2727
|
-
*/
|
|
2728
|
-
callPrefetch?: boolean;
|
|
2729
|
-
/**
|
|
2730
|
-
* When there are multiple objects embedded, queue the rendering of embedded objects
|
|
2731
|
-
* to start after the previous embed's render is complete. This helps improve
|
|
2732
|
-
* performance by decreasing the load on the browser.
|
|
2733
|
-
* @Version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
|
|
2734
|
-
* @default false
|
|
2735
|
-
*/
|
|
2736
|
-
queueMultiRenders?: boolean;
|
|
2737
|
-
/**
|
|
2738
|
-
* [AuthServer|Basic] Detect if third-party party cookies are enabled by doing an
|
|
2739
|
-
* additional call. This is slower and should be avoided. Listen to the
|
|
2740
|
-
* `NO_COOKIE_ACCESS` event to handle the situation.
|
|
2741
|
-
*
|
|
2742
|
-
* This is slightly slower than letting the browser handle the cookie check, as it
|
|
2743
|
-
* involves an extra network call.
|
|
2744
|
-
* @version SDK: 1.10.4 | ThoughtSpot: 8.2.0.cl, 8.4.1.sw
|
|
2612
|
+
* The tooltip to display for disabled actions.
|
|
2613
|
+
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
|
|
2614
|
+
* @example
|
|
2615
|
+
* ```js
|
|
2616
|
+
* const embed = new LiveboardEmbed('#embed', {
|
|
2617
|
+
* ... // other liveboard view config
|
|
2618
|
+
* disabledActions: [Action.Download, Action.Save]
|
|
2619
|
+
* disabledActionReason: "Reason for disabling",
|
|
2620
|
+
* });
|
|
2621
|
+
* ```
|
|
2745
2622
|
*/
|
|
2746
|
-
|
|
2623
|
+
disabledActionReason?: string;
|
|
2747
2624
|
/**
|
|
2748
|
-
*
|
|
2749
|
-
*
|
|
2625
|
+
* The list of actions to hide from the embedded.
|
|
2626
|
+
* This actions will be hidden from the user.
|
|
2627
|
+
* Use this to hide an action.
|
|
2628
|
+
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
|
|
2629
|
+
* @example
|
|
2630
|
+
* ```js
|
|
2631
|
+
* const embed = new LiveboardEmbed('#embed', {
|
|
2632
|
+
* ... // other liveboard view config
|
|
2633
|
+
* hiddenActions: [Action.Download, Action.Export]
|
|
2634
|
+
* });
|
|
2635
|
+
* ```
|
|
2636
|
+
* @important
|
|
2750
2637
|
*/
|
|
2751
|
-
|
|
2638
|
+
hiddenActions?: Action[];
|
|
2752
2639
|
/**
|
|
2753
|
-
*
|
|
2640
|
+
* The list of actions to display from the primary menu, more menu
|
|
2641
|
+
* (...), and the contextual menu. These will be only actions that
|
|
2642
|
+
* are visible to the user.
|
|
2643
|
+
* Use this to hide all actions except the ones you want to show.
|
|
2754
2644
|
*
|
|
2645
|
+
* Use either this or hiddenActions.
|
|
2646
|
+
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
|
|
2647
|
+
* @important
|
|
2648
|
+
* @example
|
|
2649
|
+
* ```js
|
|
2650
|
+
* const embed = new LiveboardEmbed('#embed', {
|
|
2651
|
+
* ... // other liveboard view config
|
|
2652
|
+
* visibleActions: [Action.Download, Action.Export]
|
|
2653
|
+
* });
|
|
2654
|
+
* ```
|
|
2755
2655
|
*/
|
|
2756
|
-
|
|
2757
|
-
/**
|
|
2758
|
-
* Custom style params for embed Config.
|
|
2759
|
-
* @version SDK: 1.17.0 | ThoughtSpot: 8.9.0.cl, 9.0.1.sw
|
|
2760
|
-
*/
|
|
2761
|
-
customizations?: CustomisationsInterface;
|
|
2656
|
+
visibleActions?: Action[];
|
|
2762
2657
|
/**
|
|
2763
|
-
*
|
|
2764
|
-
*
|
|
2765
|
-
*
|
|
2658
|
+
* Show alert messages and toast messages in the embedded
|
|
2659
|
+
* view in full app embed.
|
|
2660
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
2766
2661
|
* @example
|
|
2767
2662
|
* ```js
|
|
2768
|
-
*
|
|
2769
|
-
*
|
|
2770
|
-
*
|
|
2771
|
-
* authTriggerContainer: '#auth-trigger-container'
|
|
2663
|
+
* const embed = new AppEmbed('#embed-container', {
|
|
2664
|
+
* ... // other options
|
|
2665
|
+
* showAlerts:true,
|
|
2772
2666
|
* })
|
|
2773
2667
|
* ```
|
|
2774
|
-
* @version SDK: 1.17.0 | ThoughtSpot: 8.9.0.cl, 9.0.1.sw
|
|
2775
|
-
*/
|
|
2776
|
-
authTriggerContainer?: string | HTMLElement;
|
|
2777
|
-
/**
|
|
2778
|
-
* Specify that we want to use the `AuthEvent.TRIGGER_SSO_POPUP` event to trigger
|
|
2779
|
-
* SAML popup. This is useful when you want to trigger the popup on a custom user
|
|
2780
|
-
* action.
|
|
2781
|
-
*
|
|
2782
|
-
*/
|
|
2783
|
-
useEventForSAMLPopup?: boolean;
|
|
2784
|
-
/**
|
|
2785
|
-
* Text to show in the button which triggers the popup auth flow.
|
|
2786
|
-
* Default: `Authorize`.
|
|
2787
|
-
* @version SDK: 1.17.0 | ThoughtSpot: 8.9.0.cl, 9.0.1.sw
|
|
2788
|
-
*/
|
|
2789
|
-
authTriggerText?: string;
|
|
2790
|
-
/**
|
|
2791
|
-
* Prevent users from accessing the full application or ThoughtSpot application pages
|
|
2792
|
-
* access to the embedded application users
|
|
2793
|
-
* outside of the iframe.
|
|
2794
|
-
* @default true
|
|
2795
|
-
* @version SDK: 1.22.0 | ThoughtSpot: 9.3.0.cl, 9.5.1.sw
|
|
2796
|
-
*/
|
|
2797
|
-
blockNonEmbedFullAppAccess?: boolean;
|
|
2798
|
-
/**
|
|
2799
|
-
* Host config in case embedded app is inside TS app itself
|
|
2800
|
-
* @hidden
|
|
2801
|
-
*/
|
|
2802
|
-
hostConfig?: {
|
|
2803
|
-
hostUserGuid: string;
|
|
2804
|
-
hostClusterId: string;
|
|
2805
|
-
hostClusterName: string;
|
|
2806
|
-
};
|
|
2807
|
-
/**
|
|
2808
|
-
* Pendo API key to enable Pendo tracking to your own subscription, the key
|
|
2809
|
-
* is added as an additional key to the embed, as per this link:https://support.pendo.io/hc/en-us/articles/360032201951-Send-data-to-multiple-subscriptions[document].
|
|
2810
|
-
* @version SDK: 1.27.0 | ThoughtSpot: 9.8.0.cl
|
|
2811
|
-
*/
|
|
2812
|
-
pendoTrackingKey?: string;
|
|
2813
|
-
/**
|
|
2814
|
-
* If passed as true all alerts will be suppressed in the embedded app.
|
|
2815
|
-
* @version SDK: 1.26.2 | ThoughtSpot: *
|
|
2816
2668
|
*/
|
|
2817
|
-
|
|
2669
|
+
showAlerts?: boolean;
|
|
2818
2670
|
/**
|
|
2819
|
-
*
|
|
2820
|
-
*
|
|
2821
|
-
*
|
|
2822
|
-
* other logs such as warnings, information alerts,
|
|
2823
|
-
* and debug messages in the console output.
|
|
2824
|
-
*
|
|
2825
|
-
* @default LogLevel.ERROR
|
|
2671
|
+
* The list of runtime filters to apply to a search Answer,
|
|
2672
|
+
* visualization, or Liveboard.
|
|
2673
|
+
* @version SDK: 1.9.4 | ThoughtSpot 8.1.0.cl, 8.4.1.sw
|
|
2826
2674
|
* @example
|
|
2827
2675
|
* ```js
|
|
2828
|
-
*
|
|
2829
|
-
*
|
|
2830
|
-
*
|
|
2676
|
+
* const embed = new LiveboardEmbed('#embed-container', {
|
|
2677
|
+
* ... // other options
|
|
2678
|
+
* runtimeFilters: [
|
|
2679
|
+
* {
|
|
2680
|
+
* columnName: 'value',
|
|
2681
|
+
* operator: RuntimeFilterOp.EQ,
|
|
2682
|
+
* values: ['string' | 123 | true],
|
|
2683
|
+
* },
|
|
2684
|
+
* ],
|
|
2831
2685
|
* })
|
|
2832
2686
|
* ```
|
|
2833
|
-
* @version SDK: 1.26.7 | ThoughtSpot: 9.10.0.cl
|
|
2834
|
-
*/
|
|
2835
|
-
logLevel?: LogLevel;
|
|
2836
|
-
/**
|
|
2837
|
-
* Disables the Mixpanel tracking from the SDK.
|
|
2838
|
-
* @version SDK: 1.27.9
|
|
2839
|
-
*/
|
|
2840
|
-
disableSDKTracking?: boolean;
|
|
2841
|
-
/**
|
|
2842
|
-
* Overrides default/user preferred locale for date formatting
|
|
2843
|
-
* @version SDK: 1.28.4 | ThoughtSpot: 10.0.0.cl, 9.5.0.sw
|
|
2844
|
-
*/
|
|
2845
|
-
dateFormatLocale?: string;
|
|
2846
|
-
/**
|
|
2847
|
-
* Overrides default/user preferred locale for number formatting
|
|
2848
|
-
* @version SDK: 1.28.4 | ThoughtSpot: 10.0.0.cl, 9.5.0.sw
|
|
2849
|
-
*/
|
|
2850
|
-
numberFormatLocale?: string;
|
|
2851
|
-
/**
|
|
2852
|
-
* Format to be used for currency when currency format is set to infer from browser
|
|
2853
|
-
* @version SDK: 1.28.4 | ThoughtSpot: 10.0.0.cl, 9.5.0.sw
|
|
2854
2687
|
*/
|
|
2855
|
-
|
|
2688
|
+
runtimeFilters?: RuntimeFilter[];
|
|
2856
2689
|
/**
|
|
2857
|
-
*
|
|
2858
|
-
*
|
|
2859
|
-
* @
|
|
2690
|
+
* The list of parameter override to apply to a search Answer,
|
|
2691
|
+
* visualization, or Liveboard.
|
|
2692
|
+
* @version SDK : 1.25.0 | ThoughtSpot: 9.2.0.cl, 9.5.0.sw
|
|
2860
2693
|
* @example
|
|
2861
2694
|
* ```js
|
|
2862
|
-
*
|
|
2863
|
-
*
|
|
2864
|
-
*
|
|
2695
|
+
* const embed = new LiveboardEmbed('#embed-container', {
|
|
2696
|
+
* ... // other options
|
|
2697
|
+
* runtimeParameters: [
|
|
2698
|
+
* {
|
|
2699
|
+
* name: 'value',
|
|
2700
|
+
* value: 'string' | 123 | true,
|
|
2701
|
+
* },
|
|
2702
|
+
* ],
|
|
2865
2703
|
* })
|
|
2866
2704
|
* ```
|
|
2867
|
-
* @version SDK: 1.28.5 | ThoughtSpot: 9.10.0.cl, 10.1.0.sw
|
|
2868
2705
|
*/
|
|
2869
|
-
|
|
2706
|
+
runtimeParameters?: RuntimeParameter[];
|
|
2870
2707
|
/**
|
|
2871
|
-
*
|
|
2872
|
-
* @version SDK 1.
|
|
2708
|
+
* The locale settings to apply to the embedded view.
|
|
2709
|
+
* @version SDK: 1.9.4 | ThoughtSpot 8.1.0.cl, 8.4.1.sw
|
|
2710
|
+
* @example
|
|
2711
|
+
* ```js
|
|
2712
|
+
* const embed = new LiveboardEmbed('#embed-container', {
|
|
2713
|
+
* ... // other options
|
|
2714
|
+
* locale:'en',
|
|
2715
|
+
* })
|
|
2716
|
+
* ```
|
|
2873
2717
|
*/
|
|
2874
|
-
|
|
2718
|
+
locale?: string;
|
|
2875
2719
|
/**
|
|
2876
2720
|
* This is an object (key/val) of override flags which will be applied
|
|
2877
2721
|
* to the internal embedded object. This can be used to add any
|
|
2878
2722
|
* URL flag.
|
|
2723
|
+
* If the same flags are passed in init, they will be overriden by the values here.
|
|
2879
2724
|
* Warning: This option is for advanced use only and is used internally
|
|
2880
2725
|
* to control embed behavior in non-regular ways. We do not publish the
|
|
2881
2726
|
* list of supported keys and values associated with each.
|
|
@@ -2889,230 +2734,7 @@ export interface EmbedConfig {
|
|
|
2889
2734
|
* }
|
|
2890
2735
|
* });
|
|
2891
2736
|
* ```
|
|
2892
|
-
* @version SDK: 1.
|
|
2893
|
-
*/
|
|
2894
|
-
additionalFlags?: {
|
|
2895
|
-
[key: string]: string | number | boolean;
|
|
2896
|
-
};
|
|
2897
|
-
/**
|
|
2898
|
-
* This is an object (key/val) for customVariables being
|
|
2899
|
-
* used by the third party tool's script.
|
|
2900
|
-
* @example
|
|
2901
|
-
* ```js
|
|
2902
|
-
* const embed = new LiveboardEmbed('#embed', {
|
|
2903
|
-
* ... // other liveboard view config
|
|
2904
|
-
* customVariablesForThirdPartyTools: {
|
|
2905
|
-
* key1: 'value1',
|
|
2906
|
-
* key2: 'value2'
|
|
2907
|
-
* }
|
|
2908
|
-
* });
|
|
2909
|
-
* ```
|
|
2910
|
-
* @version SDK 1.37.0 | ThoughtSpot: 10.7.0.cl
|
|
2911
|
-
*/
|
|
2912
|
-
customVariablesForThirdPartyTools?: Record<string, any>;
|
|
2913
|
-
disablePreauthCache?: boolean;
|
|
2914
|
-
}
|
|
2915
|
-
export interface LayoutConfig {
|
|
2916
|
-
}
|
|
2917
|
-
/**
|
|
2918
|
-
* Embedded iframe configuration
|
|
2919
|
-
* @group Embed components
|
|
2920
|
-
*/
|
|
2921
|
-
export interface FrameParams {
|
|
2922
|
-
/**
|
|
2923
|
-
* The width of the iframe (unit is pixels if numeric).
|
|
2924
|
-
*/
|
|
2925
|
-
width?: number | string;
|
|
2926
|
-
/**
|
|
2927
|
-
* The height of the iframe (unit is pixels if numeric).
|
|
2928
|
-
*/
|
|
2929
|
-
height?: number | string;
|
|
2930
|
-
/**
|
|
2931
|
-
* Set to 'lazy' to enable lazy loading of the embedded TS frame.
|
|
2932
|
-
* This will defer loading of the frame until it comes into the
|
|
2933
|
-
* viewport. This is useful for performance optimization.
|
|
2934
|
-
*/
|
|
2935
|
-
loading?: 'lazy' | 'eager' | 'auto';
|
|
2936
|
-
/**
|
|
2937
|
-
* This parameters will be passed on the iframe
|
|
2938
|
-
* as is.
|
|
2939
|
-
*/
|
|
2940
|
-
[key: string]: string | number | boolean | undefined;
|
|
2941
|
-
}
|
|
2942
|
-
/**
|
|
2943
|
-
* The configuration object for an embedded view.
|
|
2944
|
-
*/
|
|
2945
|
-
export interface ViewConfig {
|
|
2946
|
-
/**
|
|
2947
|
-
* @hidden
|
|
2948
|
-
*/
|
|
2949
|
-
layoutConfig?: LayoutConfig;
|
|
2950
|
-
/**
|
|
2951
|
-
* The width and height dimensions to render an embedded
|
|
2952
|
-
* object inside your app. Specify the values in pixels or percentage.
|
|
2953
|
-
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 7.2.1
|
|
2954
|
-
* @example
|
|
2955
|
-
* ```js
|
|
2956
|
-
* const embed = new LiveboardEmbed('#embed', {
|
|
2957
|
-
* ... // other liveboard view config
|
|
2958
|
-
* frameParams: {
|
|
2959
|
-
* width: '500px' | '50%',
|
|
2960
|
-
* height: '400px' | '60%',
|
|
2961
|
-
* },
|
|
2962
|
-
* });
|
|
2963
|
-
* ```
|
|
2964
|
-
*/
|
|
2965
|
-
frameParams?: FrameParams;
|
|
2966
|
-
/**
|
|
2967
|
-
* @hidden
|
|
2968
|
-
*/
|
|
2969
|
-
theme?: string;
|
|
2970
|
-
/**
|
|
2971
|
-
* @hidden
|
|
2972
|
-
*/
|
|
2973
|
-
styleSheet__unstable?: string;
|
|
2974
|
-
/**
|
|
2975
|
-
* The list of actions to disable from the primary menu, more menu
|
|
2976
|
-
* (...), and the contextual menu. These actions will be disabled
|
|
2977
|
-
* for the user.
|
|
2978
|
-
* Use this to disable actions.
|
|
2979
|
-
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
|
|
2980
|
-
* @example
|
|
2981
|
-
* ```js
|
|
2982
|
-
* const embed = new LiveboardEmbed('#embed', {
|
|
2983
|
-
* ... // other liveboard view config
|
|
2984
|
-
* disabledActions: [Action.Download, Action.Save]
|
|
2985
|
-
* });
|
|
2986
|
-
* ```
|
|
2987
|
-
*/
|
|
2988
|
-
disabledActions?: Action[];
|
|
2989
|
-
/**
|
|
2990
|
-
* The tooltip to display for disabled actions.
|
|
2991
|
-
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
|
|
2992
|
-
* @example
|
|
2993
|
-
* ```js
|
|
2994
|
-
* const embed = new LiveboardEmbed('#embed', {
|
|
2995
|
-
* ... // other liveboard view config
|
|
2996
|
-
* disabledActions: [Action.Download, Action.Save]
|
|
2997
|
-
* disabledActionReason: "Reason for disabling",
|
|
2998
|
-
* });
|
|
2999
|
-
* ```
|
|
3000
|
-
*/
|
|
3001
|
-
disabledActionReason?: string;
|
|
3002
|
-
/**
|
|
3003
|
-
* The list of actions to hide from the embedded.
|
|
3004
|
-
* This actions will be hidden from the user.
|
|
3005
|
-
* Use this to hide an action.
|
|
3006
|
-
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
|
|
3007
|
-
* @example
|
|
3008
|
-
* ```js
|
|
3009
|
-
* const embed = new LiveboardEmbed('#embed', {
|
|
3010
|
-
* ... // other liveboard view config
|
|
3011
|
-
* hiddenActions: [Action.Download, Action.Export]
|
|
3012
|
-
* });
|
|
3013
|
-
* ```
|
|
3014
|
-
* @important
|
|
3015
|
-
*/
|
|
3016
|
-
hiddenActions?: Action[];
|
|
3017
|
-
/**
|
|
3018
|
-
* The list of actions to display from the primary menu, more menu
|
|
3019
|
-
* (...), and the contextual menu. These will be only actions that
|
|
3020
|
-
* are visible to the user.
|
|
3021
|
-
* Use this to hide all actions except the ones you want to show.
|
|
3022
|
-
*
|
|
3023
|
-
* Use either this or hiddenActions.
|
|
3024
|
-
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
|
|
3025
|
-
* @important
|
|
3026
|
-
* @example
|
|
3027
|
-
* ```js
|
|
3028
|
-
* const embed = new LiveboardEmbed('#embed', {
|
|
3029
|
-
* ... // other liveboard view config
|
|
3030
|
-
* visibleActions: [Action.Download, Action.Export]
|
|
3031
|
-
* });
|
|
3032
|
-
* ```
|
|
3033
|
-
*/
|
|
3034
|
-
visibleActions?: Action[];
|
|
3035
|
-
/**
|
|
3036
|
-
* Show alert messages and toast messages in the embedded
|
|
3037
|
-
* view in full app embed.
|
|
3038
|
-
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
3039
|
-
* @example
|
|
3040
|
-
* ```js
|
|
3041
|
-
* const embed = new AppEmbed('#embed-container', {
|
|
3042
|
-
* ... // other options
|
|
3043
|
-
* showAlerts:true,
|
|
3044
|
-
* })
|
|
3045
|
-
* ```
|
|
3046
|
-
*/
|
|
3047
|
-
showAlerts?: boolean;
|
|
3048
|
-
/**
|
|
3049
|
-
* The list of runtime filters to apply to a search answer,
|
|
3050
|
-
* visualization, or Liveboard.
|
|
3051
|
-
* @version SDK: 1.9.4 | ThoughtSpot 8.1.0.cl, 8.4.1.sw
|
|
3052
|
-
* @example
|
|
3053
|
-
* ```js
|
|
3054
|
-
* const embed = new LiveboardEmbed('#embed-container', {
|
|
3055
|
-
* ... // other options
|
|
3056
|
-
* runtimeFilters: [
|
|
3057
|
-
* {
|
|
3058
|
-
* columnName: 'value',
|
|
3059
|
-
* operator: RuntimeFilterOp.EQ,
|
|
3060
|
-
* values: ['string' | 123 | true],
|
|
3061
|
-
* },
|
|
3062
|
-
* ],
|
|
3063
|
-
* })
|
|
3064
|
-
* ```
|
|
3065
|
-
*/
|
|
3066
|
-
runtimeFilters?: RuntimeFilter[];
|
|
3067
|
-
/**
|
|
3068
|
-
* The list of parameter override to apply to a search answer,
|
|
3069
|
-
* visualization, or Liveboard.
|
|
3070
|
-
* @version SDK : 1.25.0 | ThoughtSpot: 9.2.0.cl, 9.5.0.sw
|
|
3071
|
-
* @example
|
|
3072
|
-
* ```js
|
|
3073
|
-
* const embed = new LiveboardEmbed('#embed-container', {
|
|
3074
|
-
* ... // other options
|
|
3075
|
-
* runtimeParameters: [
|
|
3076
|
-
* {
|
|
3077
|
-
* name: 'value',
|
|
3078
|
-
* value: 'string' | 123 | true,
|
|
3079
|
-
* },
|
|
3080
|
-
* ],
|
|
3081
|
-
* })
|
|
3082
|
-
* ```
|
|
3083
|
-
*/
|
|
3084
|
-
runtimeParameters?: RuntimeParameter[];
|
|
3085
|
-
/**
|
|
3086
|
-
* The locale/language to use for the embedded view.
|
|
3087
|
-
* @version SDK: 1.9.4 | ThoughtSpot 8.1.0.cl, 8.4.1.sw
|
|
3088
|
-
* @example
|
|
3089
|
-
* ```js
|
|
3090
|
-
* const embed = new LiveboardEmbed('#embed-container', {
|
|
3091
|
-
* ... // other options
|
|
3092
|
-
* locale:'en',
|
|
3093
|
-
* })
|
|
3094
|
-
* ```
|
|
3095
|
-
*/
|
|
3096
|
-
locale?: string;
|
|
3097
|
-
/**
|
|
3098
|
-
* This is an object (key/val) of override flags which will be applied
|
|
3099
|
-
* to the internal embedded object. This can be used to add any
|
|
3100
|
-
* URL flag.
|
|
3101
|
-
* If the same flags are passed in init, they will be overriden by the values here.
|
|
3102
|
-
* Warning: This option is for advanced use only and is used internally
|
|
3103
|
-
* to control embed behavior in non-regular ways. We do not publish the
|
|
3104
|
-
* list of supported keys and values associated with each.
|
|
3105
|
-
* @example
|
|
3106
|
-
* ```js
|
|
3107
|
-
* const embed = new LiveboardEmbed('#embed', {
|
|
3108
|
-
* ... // other liveboard view config
|
|
3109
|
-
* additionalFlags: {
|
|
3110
|
-
* flag1: 'value1',
|
|
3111
|
-
* flag2: 'value2'
|
|
3112
|
-
* }
|
|
3113
|
-
* });
|
|
3114
|
-
* ```
|
|
3115
|
-
* @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw
|
|
2737
|
+
* @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw
|
|
3116
2738
|
*/
|
|
3117
2739
|
additionalFlags?: {
|
|
3118
2740
|
[key: string]: string | number | boolean;
|
|
@@ -3150,7 +2772,7 @@ export interface ViewConfig {
|
|
|
3150
2772
|
*/
|
|
3151
2773
|
contextMenuTrigger?: ContextMenuTriggerOptions;
|
|
3152
2774
|
/**
|
|
3153
|
-
* Flag to override
|
|
2775
|
+
* Flag to override the *Open Link in New Tab* context menu option.
|
|
3154
2776
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
3155
2777
|
* @example
|
|
3156
2778
|
* ```js
|
|
@@ -3289,7 +2911,7 @@ export interface ViewConfig {
|
|
|
3289
2911
|
*/
|
|
3290
2912
|
preRenderId?: string;
|
|
3291
2913
|
/**
|
|
3292
|
-
* Determines
|
|
2914
|
+
* Determines if the PreRender component should dynamically track the size
|
|
3293
2915
|
* of its embedding element and adjust its own size accordingly.
|
|
3294
2916
|
* Enabling this option allows the PreRender component to automatically adapt
|
|
3295
2917
|
* its dimensions based on changes to the size of the embedding element.
|
|
@@ -3661,8 +3283,8 @@ export declare enum EmbedEvent {
|
|
|
3661
3283
|
*/
|
|
3662
3284
|
Load = "load",
|
|
3663
3285
|
/**
|
|
3664
|
-
* Data pertaining to
|
|
3665
|
-
* @return data - The
|
|
3286
|
+
* Data pertaining to an Answer or Liveboard is received
|
|
3287
|
+
* @return data - The Answer or Liveboard data
|
|
3666
3288
|
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
3667
3289
|
* @example
|
|
3668
3290
|
*```js
|
|
@@ -3836,7 +3458,7 @@ export declare enum EmbedEvent {
|
|
|
3836
3458
|
*/
|
|
3837
3459
|
Alert = "alert",
|
|
3838
3460
|
/**
|
|
3839
|
-
* The ThoughtSpot
|
|
3461
|
+
* The ThoughtSpot authentication session has expired.
|
|
3840
3462
|
* @version SDK: 1.4.0 | ThoughtSpot: ts7.sep.cl, 8.4.1.sw
|
|
3841
3463
|
* @example
|
|
3842
3464
|
*```js
|
|
@@ -3906,7 +3528,7 @@ export declare enum EmbedEvent {
|
|
|
3906
3528
|
/**
|
|
3907
3529
|
* Emitted when the embed does not have cookie access. This happens
|
|
3908
3530
|
* when Safari and other Web browsers block third-party cookies
|
|
3909
|
-
* are blocked by default. `NoCookieAccess` can trigger
|
|
3531
|
+
* are blocked by default. `NoCookieAccess` can trigger.
|
|
3910
3532
|
* @example
|
|
3911
3533
|
*```js
|
|
3912
3534
|
* appEmbed.on(EmbedEvent.NoCookieAccess)
|
|
@@ -3994,7 +3616,7 @@ export declare enum EmbedEvent {
|
|
|
3994
3616
|
*/
|
|
3995
3617
|
Save = "save",
|
|
3996
3618
|
/**
|
|
3997
|
-
* Emitted when the download action is triggered on an
|
|
3619
|
+
* Emitted when the download action is triggered on an Answer.
|
|
3998
3620
|
*
|
|
3999
3621
|
* **Note**: This event is deprecated in v1.21.0.
|
|
4000
3622
|
* To fire an event when a download action is initiated on a chart or table,
|
|
@@ -4010,7 +3632,7 @@ export declare enum EmbedEvent {
|
|
|
4010
3632
|
*/
|
|
4011
3633
|
Download = "download",
|
|
4012
3634
|
/**
|
|
4013
|
-
* Emitted when the download action is triggered on an
|
|
3635
|
+
* Emitted when the download action is triggered on an Answer.
|
|
4014
3636
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.0.sw
|
|
4015
3637
|
* @example
|
|
4016
3638
|
*```js
|
|
@@ -4024,7 +3646,7 @@ export declare enum EmbedEvent {
|
|
|
4024
3646
|
*/
|
|
4025
3647
|
DownloadAsPng = "downloadAsPng",
|
|
4026
3648
|
/**
|
|
4027
|
-
* Emitted when the Download as PDF action is triggered on an
|
|
3649
|
+
* Emitted when the Download as PDF action is triggered on an Answer
|
|
4028
3650
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
4029
3651
|
* @example
|
|
4030
3652
|
*```js
|
|
@@ -4038,7 +3660,7 @@ export declare enum EmbedEvent {
|
|
|
4038
3660
|
*/
|
|
4039
3661
|
DownloadAsPdf = "downloadAsPdf",
|
|
4040
3662
|
/**
|
|
4041
|
-
* Emitted when the Download as CSV action is triggered on an
|
|
3663
|
+
* Emitted when the Download as CSV action is triggered on an Answer.
|
|
4042
3664
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
4043
3665
|
* @example
|
|
4044
3666
|
*```js
|
|
@@ -4052,7 +3674,7 @@ export declare enum EmbedEvent {
|
|
|
4052
3674
|
*/
|
|
4053
3675
|
DownloadAsCsv = "downloadAsCsv",
|
|
4054
3676
|
/**
|
|
4055
|
-
* Emitted when the Download as XLSX action is triggered on an
|
|
3677
|
+
* Emitted when the Download as XLSX action is triggered on an Answer.
|
|
4056
3678
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
4057
3679
|
* @example
|
|
4058
3680
|
*```js
|
|
@@ -4080,7 +3702,8 @@ export declare enum EmbedEvent {
|
|
|
4080
3702
|
*/
|
|
4081
3703
|
AnswerDelete = "answerDelete",
|
|
4082
3704
|
/**
|
|
4083
|
-
* Emitted when
|
|
3705
|
+
* Emitted when a user initiates the Pin action to
|
|
3706
|
+
* add an Answer to a Liveboard.
|
|
4084
3707
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
4085
3708
|
* @example
|
|
4086
3709
|
*```js
|
|
@@ -4218,7 +3841,7 @@ export declare enum EmbedEvent {
|
|
|
4218
3841
|
*/
|
|
4219
3842
|
SaveAsView = "saveAsView",
|
|
4220
3843
|
/**
|
|
4221
|
-
* Emitted when the user creates a copy of an Answer
|
|
3844
|
+
* Emitted when the user creates a copy of an Answer.
|
|
4222
3845
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
4223
3846
|
* @example
|
|
4224
3847
|
*```js
|
|
@@ -4232,7 +3855,7 @@ export declare enum EmbedEvent {
|
|
|
4232
3855
|
*/
|
|
4233
3856
|
CopyAEdit = "copyAEdit",
|
|
4234
3857
|
/**
|
|
4235
|
-
* Emitted when a user clicks Show underlying data on an Answer
|
|
3858
|
+
* Emitted when a user clicks *Show underlying data* on an Answer.
|
|
4236
3859
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
4237
3860
|
* @example
|
|
4238
3861
|
*```js
|
|
@@ -4243,7 +3866,7 @@ export declare enum EmbedEvent {
|
|
|
4243
3866
|
*/
|
|
4244
3867
|
ShowUnderlyingData = "showUnderlyingData",
|
|
4245
3868
|
/**
|
|
4246
|
-
* Emitted when an
|
|
3869
|
+
* Emitted when an Answer is switched to a chart or table view.
|
|
4247
3870
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
4248
3871
|
* @example
|
|
4249
3872
|
*```js
|
|
@@ -4377,11 +4000,12 @@ export declare enum EmbedEvent {
|
|
|
4377
4000
|
*/
|
|
4378
4001
|
CopyLink = "embedDocument",
|
|
4379
4002
|
/**
|
|
4380
|
-
* Emitted when a user interacts with cross filters on a
|
|
4003
|
+
* Emitted when a user interacts with cross filters on a
|
|
4004
|
+
* visualization or Liveboard.
|
|
4381
4005
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.0.sw
|
|
4382
4006
|
* @example
|
|
4383
4007
|
*```js
|
|
4384
|
-
* liveboardEmbed.
|
|
4008
|
+
* liveboardEmbed.on(EmbedEvent.CrossFilterChanged, {
|
|
4385
4009
|
* vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
4386
4010
|
*```
|
|
4387
4011
|
*/
|
|
@@ -4475,8 +4099,8 @@ export declare enum EmbedEvent {
|
|
|
4475
4099
|
*/
|
|
4476
4100
|
DeletePersonalisedView = "deletePersonalisedView",
|
|
4477
4101
|
/**
|
|
4478
|
-
* Emitted when a user creates a
|
|
4479
|
-
* @version SDK : 1.27.0 | ThoughtSpot
|
|
4102
|
+
* Emitted when a user creates a Worksheet.
|
|
4103
|
+
* @version SDK : 1.27.0 | ThoughtSpot: 9.8.0.cl, 9.8.0.sw
|
|
4480
4104
|
*/
|
|
4481
4105
|
CreateWorksheet = "createWorksheet",
|
|
4482
4106
|
/**
|
|
@@ -4489,8 +4113,8 @@ export declare enum EmbedEvent {
|
|
|
4489
4113
|
*/
|
|
4490
4114
|
AskSageInit = "AskSageInit",
|
|
4491
4115
|
/**
|
|
4492
|
-
* Emitted when a
|
|
4493
|
-
* @version SDK : 1.28.0 | ThoughtSpot: 9.10.5.cl
|
|
4116
|
+
* Emitted when a Liveboard or visualization is renamed.
|
|
4117
|
+
* @version SDK : 1.28.0 | ThoughtSpot: 9.10.5.cl, 10.1.0.sw
|
|
4494
4118
|
*/
|
|
4495
4119
|
Rename = "rename",
|
|
4496
4120
|
/**
|
|
@@ -4554,8 +4178,7 @@ export declare enum EmbedEvent {
|
|
|
4554
4178
|
OnBeforeGetVizDataIntercept = "onBeforeGetVizDataIntercept",
|
|
4555
4179
|
/**
|
|
4556
4180
|
* Emitted when parameter changes in an Answer
|
|
4557
|
-
* or Liveboard
|
|
4558
|
-
*
|
|
4181
|
+
* or Liveboard.
|
|
4559
4182
|
* ```js
|
|
4560
4183
|
* liveboardEmbed.on(EmbedEvent.ParameterChanged, (payload) => {
|
|
4561
4184
|
* console.log('payload', payload);
|
|
@@ -4582,7 +4205,7 @@ export declare enum EmbedEvent {
|
|
|
4582
4205
|
*/
|
|
4583
4206
|
TableVizRendered = "TableVizRendered",
|
|
4584
4207
|
/**
|
|
4585
|
-
* Emitted when the liveboard is created from pin modal or
|
|
4208
|
+
* Emitted when the liveboard is created from pin modal or Liveboard list page.
|
|
4586
4209
|
* You can use this event as a hook to trigger
|
|
4587
4210
|
* other events on liveboard creation.
|
|
4588
4211
|
*
|
|
@@ -4725,7 +4348,7 @@ export declare enum HostEvent {
|
|
|
4725
4348
|
*/
|
|
4726
4349
|
Filter = "filter",
|
|
4727
4350
|
/**
|
|
4728
|
-
* Reload the
|
|
4351
|
+
* Reload the Answer or visualization
|
|
4729
4352
|
* @hidden
|
|
4730
4353
|
*/
|
|
4731
4354
|
Reload = "reload",
|
|
@@ -4775,12 +4398,10 @@ export declare enum HostEvent {
|
|
|
4775
4398
|
* and `AppEmbed` only. In full application embedding, this event updates
|
|
4776
4399
|
* the runtime filters applied on the Liveboard and saved Answer objects.
|
|
4777
4400
|
*
|
|
4778
|
-
*
|
|
4779
|
-
* Pass an array of runtime filters with the following attributes:
|
|
4780
|
-
*
|
|
4401
|
+
* @param - Pass an array of {@link RuntimeFilter} with the following attributes:
|
|
4781
4402
|
* `columnName` - _String_. The name of the column to filter on.
|
|
4782
4403
|
*
|
|
4783
|
-
* `operator` -
|
|
4404
|
+
* `operator` - {@link RuntimeFilterOp} to apply. For more information,
|
|
4784
4405
|
* see link:https://developers.thoughtspot.com/docs/?pageid=runtime-filters#rtOperator[Developer Documentation].
|
|
4785
4406
|
*
|
|
4786
4407
|
* `values` - List of operands. Some operators such as EQ and LE allow a
|
|
@@ -4792,7 +4413,7 @@ export declare enum HostEvent {
|
|
|
4792
4413
|
* will be cleared, restoring the original visualization
|
|
4793
4414
|
* with the updated filters.
|
|
4794
4415
|
*
|
|
4795
|
-
|
|
4416
|
+
|
|
4796
4417
|
* @example
|
|
4797
4418
|
* ```js
|
|
4798
4419
|
* liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
|
|
@@ -5031,6 +4652,11 @@ export declare enum HostEvent {
|
|
|
5031
4652
|
* appEmbed.trigger(HostEvent.Remove)
|
|
5032
4653
|
* ```
|
|
5033
4654
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
4655
|
+
* * @example
|
|
4656
|
+
* ```js
|
|
4657
|
+
* liveboardEmbed.trigger(HostEvent.Remove)
|
|
4658
|
+
* ```
|
|
4659
|
+
* @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl, 10.10.0.sw
|
|
5034
4660
|
*/
|
|
5035
4661
|
Remove = "delete",
|
|
5036
4662
|
/**
|
|
@@ -5441,7 +5067,7 @@ export declare enum HostEvent {
|
|
|
5441
5067
|
* ```js
|
|
5442
5068
|
* liveboardEmbed.trigger(HostEvent.GetTabs).then((tabDetails) => {
|
|
5443
5069
|
* console.log(
|
|
5444
|
-
* tabDetails // TabDetails of current
|
|
5070
|
+
* tabDetails // TabDetails of current Liveboard
|
|
5445
5071
|
* );
|
|
5446
5072
|
* })
|
|
5447
5073
|
* ```
|
|
@@ -5489,7 +5115,7 @@ export declare enum HostEvent {
|
|
|
5489
5115
|
*/
|
|
5490
5116
|
UpdateSageQuery = "updateSageQuery",
|
|
5491
5117
|
/**
|
|
5492
|
-
* Get the
|
|
5118
|
+
* Get the Answer session for a Search or
|
|
5493
5119
|
* Liveboard visualization.
|
|
5494
5120
|
* @example
|
|
5495
5121
|
* ```js
|
|
@@ -5664,6 +5290,7 @@ export declare enum Param {
|
|
|
5664
5290
|
HostAppUrl = "hostAppUrl",
|
|
5665
5291
|
EnableVizTransformations = "enableVizTransform",
|
|
5666
5292
|
EnableSearchAssist = "enableSearchAssist",
|
|
5293
|
+
EnablePendoHelp = "enablePendoHelp",
|
|
5667
5294
|
HideResult = "hideResult",
|
|
5668
5295
|
UseLastSelectedDataSource = "useLastSelectedSources",
|
|
5669
5296
|
Tag = "tag",
|
|
@@ -5888,9 +5515,10 @@ export declare enum Action {
|
|
|
5888
5515
|
*/
|
|
5889
5516
|
AddDataPanelObjects = "addDataPanelObjects",
|
|
5890
5517
|
/**
|
|
5891
|
-
*
|
|
5892
|
-
*
|
|
5893
|
-
* Liveboard.
|
|
5518
|
+
* The filter configuration options for a Liveboard.
|
|
5519
|
+
* The configuration options are available when adding
|
|
5520
|
+
* filters on a Liveboard.
|
|
5521
|
+
*
|
|
5894
5522
|
* @example
|
|
5895
5523
|
* ```js
|
|
5896
5524
|
* disabledActions: [Action.ConfigureFilter]
|
|
@@ -5988,14 +5616,17 @@ export declare enum Action {
|
|
|
5988
5616
|
* @hidden
|
|
5989
5617
|
*/
|
|
5990
5618
|
SpotIQFollow = "spotIQFollow",
|
|
5619
|
+
/**
|
|
5620
|
+
* The Share action for a Liveboard visualization.
|
|
5621
|
+
*/
|
|
5991
5622
|
ShareViz = "shareViz",
|
|
5992
5623
|
/**
|
|
5993
5624
|
* @hidden
|
|
5994
5625
|
*/
|
|
5995
5626
|
ReplaySearch = "replaySearch",
|
|
5996
5627
|
/**
|
|
5997
|
-
* The **Show underlying data** menu action on a
|
|
5998
|
-
* Answer page.
|
|
5628
|
+
* The **Show underlying data** menu action on a
|
|
5629
|
+
* visualization or Answer page.
|
|
5999
5630
|
* Displays detailed information and raw data
|
|
6000
5631
|
* for a given visualization.
|
|
6001
5632
|
* @example
|
|
@@ -6005,8 +5636,8 @@ export declare enum Action {
|
|
|
6005
5636
|
*/
|
|
6006
5637
|
ShowUnderlyingData = "showUnderlyingData",
|
|
6007
5638
|
/**
|
|
6008
|
-
* The **Download** menu action on Liveboard
|
|
6009
|
-
* and Answers.
|
|
5639
|
+
* The **Download** menu action on Liveboard
|
|
5640
|
+
* visualizations and Answers.
|
|
6010
5641
|
* Allows downloading a visualization or Answer.
|
|
6011
5642
|
* @example
|
|
6012
5643
|
* ```js
|
|
@@ -6027,11 +5658,10 @@ export declare enum Action {
|
|
|
6027
5658
|
/**
|
|
6028
5659
|
*
|
|
6029
5660
|
*The **Download PDF** action that downloads a Liveboard,
|
|
6030
|
-
*visualization, or Answer as a PDF file.
|
|
6031
|
-
*
|
|
5661
|
+
* visualization, or Answer as a PDF file.
|
|
6032
5662
|
*
|
|
6033
|
-
|
|
6034
|
-
*visualizations and Answers
|
|
5663
|
+
* **NOTE**: The **Download** > **PDF** option is available for
|
|
5664
|
+
* tables in visualizations and Answers.
|
|
6035
5665
|
* @example
|
|
6036
5666
|
* ```js
|
|
6037
5667
|
* disabledActions: [Action.DownloadAsPdf]
|
|
@@ -6063,9 +5693,11 @@ export declare enum Action {
|
|
|
6063
5693
|
*/
|
|
6064
5694
|
DownloadTrace = "downloadTrace",
|
|
6065
5695
|
/**
|
|
6066
|
-
* The **Export TML** menu action on Liveboard,
|
|
6067
|
-
*
|
|
6068
|
-
*
|
|
5696
|
+
* The **Export TML** menu action on a Liveboard, Answer, and
|
|
5697
|
+
* the Data Workspace pages for data objects and connections.
|
|
5698
|
+
*
|
|
5699
|
+
* Allows exporting an object as a TML file.
|
|
5700
|
+
*
|
|
6069
5701
|
* @example
|
|
6070
5702
|
* ```js
|
|
6071
5703
|
* disabledActions: [Action.ExportTML]
|
|
@@ -6073,7 +5705,8 @@ export declare enum Action {
|
|
|
6073
5705
|
*/
|
|
6074
5706
|
ExportTML = "exportTSL",
|
|
6075
5707
|
/**
|
|
6076
|
-
* The **Import TML** menu action
|
|
5708
|
+
* The **Import TML** menu action on the
|
|
5709
|
+
* *Data Workspace* > *Utilities* page.
|
|
6077
5710
|
* Imports TML representation of ThoughtSpot objects.
|
|
6078
5711
|
* @example
|
|
6079
5712
|
* ```js
|
|
@@ -6083,7 +5716,7 @@ export declare enum Action {
|
|
|
6083
5716
|
ImportTML = "importTSL",
|
|
6084
5717
|
/**
|
|
6085
5718
|
* The **Update TML** menu action for Liveboards and Answers.
|
|
6086
|
-
*
|
|
5719
|
+
* Updates TML representation of ThoughtSpot objects.
|
|
6087
5720
|
* @example
|
|
6088
5721
|
* ```js
|
|
6089
5722
|
* disabledActions: [Action.UpdateTML]
|
|
@@ -6110,8 +5743,11 @@ export declare enum Action {
|
|
|
6110
5743
|
*/
|
|
6111
5744
|
Present = "present",
|
|
6112
5745
|
/**
|
|
6113
|
-
* The tile resize
|
|
6114
|
-
*
|
|
5746
|
+
* The visualization tile resize option.
|
|
5747
|
+
* Also available via More `...` options menu on a visualization.
|
|
5748
|
+
* Allows resizing visualization tiles and switching
|
|
5749
|
+
* between different preset layout option.
|
|
5750
|
+
*
|
|
6115
5751
|
* @example
|
|
6116
5752
|
* ```js
|
|
6117
5753
|
* disabledActions: [Action.ToggleSize]
|
|
@@ -6137,8 +5773,9 @@ export declare enum Action {
|
|
|
6137
5773
|
*/
|
|
6138
5774
|
EditTitle = "editTitle",
|
|
6139
5775
|
/**
|
|
6140
|
-
* The **Delete**
|
|
6141
|
-
*
|
|
5776
|
+
* The **Delete** action on a Liveboard, *Liveboards* and
|
|
5777
|
+
* *Answers* list pages in full application embedding.
|
|
5778
|
+
*
|
|
6142
5779
|
* @example
|
|
6143
5780
|
* ```js
|
|
6144
5781
|
* disabledActions: [Action.Remove]
|
|
@@ -6215,8 +5852,9 @@ export declare enum Action {
|
|
|
6215
5852
|
*/
|
|
6216
5853
|
Explore = "explore",
|
|
6217
5854
|
/**
|
|
6218
|
-
* The action to include
|
|
6219
|
-
* or
|
|
5855
|
+
* The contextual menu action to include a specific data point
|
|
5856
|
+
* when drilling down a table or chart on an Answer.
|
|
5857
|
+
*
|
|
6220
5858
|
* @example
|
|
6221
5859
|
* ```js
|
|
6222
5860
|
* disabledActions: [Action.DrillInclude]
|
|
@@ -6224,8 +5862,8 @@ export declare enum Action {
|
|
|
6224
5862
|
*/
|
|
6225
5863
|
DrillInclude = "context-menu-item-include",
|
|
6226
5864
|
/**
|
|
6227
|
-
* The action to exclude
|
|
6228
|
-
* or
|
|
5865
|
+
* The contextual menu action to exclude a specific data point
|
|
5866
|
+
* when drilling down a table or chart on an Answer.
|
|
6229
5867
|
* @example
|
|
6230
5868
|
* ```js
|
|
6231
5869
|
* disabledActions: [Action.DrillInclude]
|
|
@@ -6372,7 +6010,7 @@ export declare enum Action {
|
|
|
6372
6010
|
* Allows users to manage data sync pipelines to third-party apps.
|
|
6373
6011
|
* @example
|
|
6374
6012
|
* ```js
|
|
6375
|
-
* disabledActions: [Action.
|
|
6013
|
+
* disabledActions: [Action.ManagePipelines]
|
|
6376
6014
|
* ```
|
|
6377
6015
|
* @version SDK: 1.18.0| ThoughtSpot: 8.10.0.cl, 9.0.1.sw
|
|
6378
6016
|
*/
|
|
@@ -6691,7 +6329,7 @@ export declare enum Action {
|
|
|
6691
6329
|
/**
|
|
6692
6330
|
* Action ID for the Parent TML action
|
|
6693
6331
|
* The parent action **TML** must be included to access TML-related options
|
|
6694
|
-
* within the cascading menu (specific to the
|
|
6332
|
+
* within the cascading menu (specific to the Answer page)
|
|
6695
6333
|
* @example
|
|
6696
6334
|
* ```js
|
|
6697
6335
|
* // to include specific TML actions
|
|
@@ -6730,8 +6368,10 @@ export declare enum Action {
|
|
|
6730
6368
|
*/
|
|
6731
6369
|
VerifiedLiveboard = "verifiedLiveboard",
|
|
6732
6370
|
/**
|
|
6733
|
-
*
|
|
6734
|
-
*
|
|
6371
|
+
* Action ID for the *Ask Sage* In Natural Language Search embed,
|
|
6372
|
+
* *Spotter* in Liveboard, full app, and Spotter embed.
|
|
6373
|
+
*
|
|
6374
|
+
* Allows initiating a conversation with ThoughtSpot AI analyst.
|
|
6735
6375
|
*
|
|
6736
6376
|
* @example
|
|
6737
6377
|
* ```js
|
|
@@ -6927,7 +6567,8 @@ export declare enum Action {
|
|
|
6927
6567
|
*/
|
|
6928
6568
|
DeletePreviousPrompt = "deletePreviousPrompt",
|
|
6929
6569
|
/**
|
|
6930
|
-
* Action ID for hide
|
|
6570
|
+
* Action ID for hide or disable editing tokens generated from
|
|
6571
|
+
* Spotter results.
|
|
6931
6572
|
* @example
|
|
6932
6573
|
* ```js
|
|
6933
6574
|
* hiddenAction: [Action.EditTokens]
|
|
@@ -7090,6 +6731,419 @@ export interface DefaultAppInitData {
|
|
|
7090
6731
|
customVariablesForThirdPartyTools: Record<string, any>;
|
|
7091
6732
|
}
|
|
7092
6733
|
|
|
6734
|
+
export type EmbedEventHandlers = {
|
|
6735
|
+
[key in keyof typeof EmbedEvent as `on${Capitalize<key>}`]?: MessageCallback;
|
|
6736
|
+
};
|
|
6737
|
+
export interface EmbedProps extends ViewConfig, EmbedEventHandlers {
|
|
6738
|
+
className?: string;
|
|
6739
|
+
}
|
|
6740
|
+
export interface ViewConfigAndListeners<T extends ViewConfig> {
|
|
6741
|
+
viewConfig: T;
|
|
6742
|
+
listeners: {
|
|
6743
|
+
[key in EmbedEvent]?: MessageCallback;
|
|
6744
|
+
};
|
|
6745
|
+
}
|
|
6746
|
+
/**
|
|
6747
|
+
*
|
|
6748
|
+
* @param props
|
|
6749
|
+
*/
|
|
6750
|
+
export function getViewPropsAndListeners<T extends EmbedProps, U extends ViewConfig>(props: T): ViewConfigAndListeners<U>;
|
|
6751
|
+
|
|
6752
|
+
/**
|
|
6753
|
+
* Configuration for search options
|
|
6754
|
+
*/
|
|
6755
|
+
export interface SearchOptions {
|
|
6756
|
+
/**
|
|
6757
|
+
* The query string to pass to start the Conversation.
|
|
6758
|
+
*/
|
|
6759
|
+
searchQuery: string;
|
|
6760
|
+
}
|
|
6761
|
+
/**
|
|
6762
|
+
* The configuration for the embedded conversationEmbed options.
|
|
6763
|
+
* @group Embed components
|
|
6764
|
+
*/
|
|
6765
|
+
export interface ConversationViewConfig extends ViewConfig {
|
|
6766
|
+
/**
|
|
6767
|
+
* The ID of the worksheet to use for the conversation.
|
|
6768
|
+
*/
|
|
6769
|
+
worksheetId: string;
|
|
6770
|
+
/**
|
|
6771
|
+
* Ability to pass a starting search query to the conversation.
|
|
6772
|
+
*/
|
|
6773
|
+
searchOptions?: SearchOptions;
|
|
6774
|
+
/**
|
|
6775
|
+
* disableSourceSelection : Disables data source selection
|
|
6776
|
+
* but still display the selected data source.
|
|
6777
|
+
* @example
|
|
6778
|
+
* ```js
|
|
6779
|
+
* const embed = new ConversationEmbed('#tsEmbed', {
|
|
6780
|
+
* ... // other options
|
|
6781
|
+
* disableSourceSelection : true,
|
|
6782
|
+
* })
|
|
6783
|
+
* ```
|
|
6784
|
+
* @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
|
|
6785
|
+
*/
|
|
6786
|
+
disableSourceSelection?: boolean;
|
|
6787
|
+
/**
|
|
6788
|
+
* hideSourceSelection : Hide data source selection
|
|
6789
|
+
* @example
|
|
6790
|
+
* ```js
|
|
6791
|
+
* const embed = new ConversationEmbed('#tsEmbed', {
|
|
6792
|
+
* ... // other options
|
|
6793
|
+
* hideSourceSelection : true,
|
|
6794
|
+
* })
|
|
6795
|
+
* ```
|
|
6796
|
+
* @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
|
|
6797
|
+
*/
|
|
6798
|
+
hideSourceSelection?: boolean;
|
|
6799
|
+
/**
|
|
6800
|
+
* Flag to control Data panel experience
|
|
6801
|
+
* @default false
|
|
6802
|
+
* @version SDK: 1.36.0 | ThoughtSpot Cloud: 10.4.0.cl
|
|
6803
|
+
* @example
|
|
6804
|
+
* ```js
|
|
6805
|
+
* const embed = new AppEmbed('#tsEmbed', {
|
|
6806
|
+
* ... // other options
|
|
6807
|
+
* dataPanelV2: true,
|
|
6808
|
+
* })
|
|
6809
|
+
* ```
|
|
6810
|
+
*/
|
|
6811
|
+
dataPanelV2?: boolean;
|
|
6812
|
+
/**
|
|
6813
|
+
* showSpotterLimitations : show limitation text
|
|
6814
|
+
* of the spotter underneath the chat input.
|
|
6815
|
+
* default is false.
|
|
6816
|
+
* @example
|
|
6817
|
+
* ```js
|
|
6818
|
+
* const embed = new ConversationEmbed('#tsEmbed', {
|
|
6819
|
+
* ... // other options
|
|
6820
|
+
* showSpotterLimitations : true,
|
|
6821
|
+
* })
|
|
6822
|
+
* ```
|
|
6823
|
+
* @version SDK: 1.36.0 | Thoughtspot: 10.5.0.cl
|
|
6824
|
+
*/
|
|
6825
|
+
showSpotterLimitations?: boolean;
|
|
6826
|
+
/**
|
|
6827
|
+
* hideSampleQuestions : Hide sample questions on
|
|
6828
|
+
* the initial screen of the conversation.
|
|
6829
|
+
* @example
|
|
6830
|
+
* ```js
|
|
6831
|
+
* const embed = new ConversationEmbed('#tsEmbed', {
|
|
6832
|
+
* ... // other options
|
|
6833
|
+
* hideSampleQuestions : true,
|
|
6834
|
+
* })
|
|
6835
|
+
* ```
|
|
6836
|
+
* @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
|
|
6837
|
+
*/
|
|
6838
|
+
hideSampleQuestions?: boolean;
|
|
6839
|
+
}
|
|
6840
|
+
/**
|
|
6841
|
+
* Embed ThoughtSpot AI Conversation.
|
|
6842
|
+
* @group Embed components
|
|
6843
|
+
* @example
|
|
6844
|
+
* ```js
|
|
6845
|
+
* const conversation = new ConversationEmbed('#tsEmbed', {
|
|
6846
|
+
* worksheetId: 'worksheetId',
|
|
6847
|
+
* searchOptions: {
|
|
6848
|
+
* searchQuery: 'searchQuery',
|
|
6849
|
+
* },
|
|
6850
|
+
* });
|
|
6851
|
+
* conversation.render();
|
|
6852
|
+
* ```
|
|
6853
|
+
* @version SDK: 1.33.1 | ThoughtSpot: 10.5.0.cl
|
|
6854
|
+
*/
|
|
6855
|
+
export declare class ConversationEmbed extends TsEmbed {
|
|
6856
|
+
protected viewConfig: ConversationViewConfig;
|
|
6857
|
+
constructor(container: HTMLElement, viewConfig: ConversationViewConfig);
|
|
6858
|
+
getIframeSrc(): string;
|
|
6859
|
+
render(): Promise<ConversationEmbed>;
|
|
6860
|
+
}
|
|
6861
|
+
|
|
6862
|
+
import '../utils/with-resolvers-polyfill';
|
|
6863
|
+
export interface executeTMLInput {
|
|
6864
|
+
metadata_tmls: string[];
|
|
6865
|
+
import_policy?: 'PARTIAL' | 'ALL_OR_NONE' | 'VALIDATE_ONLY';
|
|
6866
|
+
create_new?: boolean;
|
|
6867
|
+
}
|
|
6868
|
+
export interface exportTMLInput {
|
|
6869
|
+
metadata: {
|
|
6870
|
+
identifier: string;
|
|
6871
|
+
type?: 'LIVEBOARD' | 'ANSWER' | 'LOGICAL_TABLE' | 'CONNECTION';
|
|
6872
|
+
}[];
|
|
6873
|
+
export_associated?: boolean;
|
|
6874
|
+
export_fqn?: boolean;
|
|
6875
|
+
edoc_format?: 'YAML' | 'JSON';
|
|
6876
|
+
}
|
|
6877
|
+
export declare let authPromise: Promise<boolean>;
|
|
6878
|
+
export declare const getAuthPromise: () => Promise<boolean>;
|
|
6879
|
+
export { notifyAuthFailure, notifyAuthSDKSuccess, notifyAuthSuccess, notifyLogout, };
|
|
6880
|
+
/**
|
|
6881
|
+
* Perform authentication on the ThoughtSpot app as applicable.
|
|
6882
|
+
*/
|
|
6883
|
+
export declare const handleAuth: () => Promise<boolean>;
|
|
6884
|
+
/**
|
|
6885
|
+
* Prefetches static resources from the specified URL. Web browsers can then cache the
|
|
6886
|
+
* prefetched resources and serve them from the user's local disk to provide faster access
|
|
6887
|
+
* to your app.
|
|
6888
|
+
* @param url The URL provided for prefetch
|
|
6889
|
+
* @param prefetchFeatures Specify features which needs to be prefetched.
|
|
6890
|
+
* @param additionalFlags This can be used to add any URL flag.
|
|
6891
|
+
* @version SDK: 1.4.0 | ThoughtSpot: ts7.sep.cl, 7.2.1
|
|
6892
|
+
* @group Global methods
|
|
6893
|
+
*/
|
|
6894
|
+
export declare const prefetch: (url?: string, prefetchFeatures?: PrefetchFeatures[], additionalFlags?: {
|
|
6895
|
+
[key: string]: string | number | boolean;
|
|
6896
|
+
}) => void;
|
|
6897
|
+
export declare const createAndSetInitPromise: () => void;
|
|
6898
|
+
export declare const getInitPromise: () => Promise<ReturnType<typeof init>>;
|
|
6899
|
+
export declare const getIsInitCalled: () => boolean;
|
|
6900
|
+
/**
|
|
6901
|
+
* Initializes the Visual Embed SDK globally and perform
|
|
6902
|
+
* authentication if applicable. This function needs to be called before any ThoughtSpot
|
|
6903
|
+
* component like Liveboard etc can be embedded. But need not wait for AuthEvent.SUCCESS
|
|
6904
|
+
* to actually embed. That is handled internally.
|
|
6905
|
+
* @param embedConfig The configuration object containing ThoughtSpot host,
|
|
6906
|
+
* authentication mechanism and so on.
|
|
6907
|
+
* @example
|
|
6908
|
+
* ```js
|
|
6909
|
+
* const authStatus = init({
|
|
6910
|
+
* thoughtSpotHost: 'https://my.thoughtspot.cloud',
|
|
6911
|
+
* authType: AuthType.None,
|
|
6912
|
+
* });
|
|
6913
|
+
* authStatus.on(AuthStatus.FAILURE, (reason) => { // do something here });
|
|
6914
|
+
* ```
|
|
6915
|
+
* @returns {@link AuthEventEmitter} event emitter which emits events on authentication success,
|
|
6916
|
+
* failure and logout. See {@link AuthStatus}
|
|
6917
|
+
* @version SDK: 1.0.0 | ThoughtSpot ts7.april.cl, 7.2.1
|
|
6918
|
+
* @group Authentication / Init
|
|
6919
|
+
*/
|
|
6920
|
+
export declare const init: (embedConfig: EmbedConfig) => AuthEventEmitter;
|
|
6921
|
+
/**
|
|
6922
|
+
*
|
|
6923
|
+
*/
|
|
6924
|
+
export declare function disableAutoLogin(): void;
|
|
6925
|
+
/**
|
|
6926
|
+
* Logs out from ThoughtSpot. This also sets the autoLogin flag to false, to
|
|
6927
|
+
* prevent the SDK from automatically logging in again.
|
|
6928
|
+
*
|
|
6929
|
+
* You can call the `init` method again to re login, if autoLogin is set to
|
|
6930
|
+
* true in this second call it will be honored.
|
|
6931
|
+
* @param doNotDisableAutoLogin This flag when passed will not disable autoLogin
|
|
6932
|
+
* @returns Promise which resolves when logout completes.
|
|
6933
|
+
* @version SDK: 1.10.1 | ThoughtSpot: 8.2.0.cl, 8.4.1-sw
|
|
6934
|
+
* @group Global methods
|
|
6935
|
+
*/
|
|
6936
|
+
export declare const logout: (doNotDisableAutoLogin?: boolean) => Promise<boolean>;
|
|
6937
|
+
/**
|
|
6938
|
+
* Renders functions in a queue, resolves to next function only after the callback next
|
|
6939
|
+
* is called
|
|
6940
|
+
* @param fn The function being registered
|
|
6941
|
+
*/
|
|
6942
|
+
export declare const renderInQueue: (fn: (next?: (val?: any) => void) => Promise<any>) => Promise<any>;
|
|
6943
|
+
/**
|
|
6944
|
+
* Imports TML representation of the metadata objects into ThoughtSpot.
|
|
6945
|
+
* @param data
|
|
6946
|
+
* @returns imports TML data into ThoughtSpot
|
|
6947
|
+
* @example
|
|
6948
|
+
* ```js
|
|
6949
|
+
* executeTML({
|
|
6950
|
+
* //Array of metadata Tmls in string format
|
|
6951
|
+
* metadata_tmls: [
|
|
6952
|
+
* "'\''{\"guid\":\"9bd202f5-d431-44bf-9a07-b4f7be372125\",
|
|
6953
|
+
* \"liveboard\":{\"name\":\"Parameters Liveboard\"}}'\''"
|
|
6954
|
+
* ],
|
|
6955
|
+
* import_policy: 'PARTIAL', // Specifies the import policy for the TML import.
|
|
6956
|
+
* create_new: false, // If selected, creates TML objects with new GUIDs.
|
|
6957
|
+
* }).then(result => {
|
|
6958
|
+
* console.log(result);
|
|
6959
|
+
* }).catch(error => {
|
|
6960
|
+
* console.error(error);
|
|
6961
|
+
* });
|
|
6962
|
+
*```
|
|
6963
|
+
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
6964
|
+
* @group Global methods
|
|
6965
|
+
*/
|
|
6966
|
+
export declare const executeTML: (data: executeTMLInput) => Promise<any>;
|
|
6967
|
+
/**
|
|
6968
|
+
* Exports TML representation of the metadata objects from ThoughtSpot in JSON or YAML
|
|
6969
|
+
* format.
|
|
6970
|
+
* @param data
|
|
6971
|
+
* @returns exports TML data
|
|
6972
|
+
* @example
|
|
6973
|
+
* ```js
|
|
6974
|
+
* exportTML({
|
|
6975
|
+
* metadata: [
|
|
6976
|
+
* {
|
|
6977
|
+
* type: "LIVEBOARD", //Metadata Type
|
|
6978
|
+
* identifier: "9bd202f5-d431-44bf-9a07-b4f7be372125" //Metadata Id
|
|
6979
|
+
* }
|
|
6980
|
+
* ],
|
|
6981
|
+
* export_associated: false,//indicates whether to export associated metadata objects
|
|
6982
|
+
* export_fqn: false, //Adds FQNs of the referenced objects.For example, if you are
|
|
6983
|
+
* //exporting a Liveboard and its associated objects, the API
|
|
6984
|
+
* //returns the Liveboard TML data with the FQNs of the referenced
|
|
6985
|
+
* //worksheet. If the exported TML data includes FQNs, you don't need
|
|
6986
|
+
* //to manually add FQNs of the referenced objects during TML import.
|
|
6987
|
+
* edoc_format: "JSON" //It takes JSON or YAML value
|
|
6988
|
+
* }).then(result => {
|
|
6989
|
+
* console.log(result);
|
|
6990
|
+
* }).catch(error => {
|
|
6991
|
+
* console.error(error);
|
|
6992
|
+
* });
|
|
6993
|
+
* ```
|
|
6994
|
+
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
6995
|
+
* @group Global methods
|
|
6996
|
+
*/
|
|
6997
|
+
export declare const exportTML: (data: exportTMLInput) => Promise<any>;
|
|
6998
|
+
/**
|
|
6999
|
+
*
|
|
7000
|
+
*/
|
|
7001
|
+
export declare function reset(): void;
|
|
7002
|
+
|
|
7003
|
+
/**
|
|
7004
|
+
* Configuration for bodyless conversation options.
|
|
7005
|
+
* @group Embed components
|
|
7006
|
+
*/
|
|
7007
|
+
export interface BodylessConversationViewConfig extends ViewConfig {
|
|
7008
|
+
/**
|
|
7009
|
+
* The ID of the worksheet to use for the conversation.
|
|
7010
|
+
*/
|
|
7011
|
+
worksheetId: string;
|
|
7012
|
+
}
|
|
7013
|
+
/**
|
|
7014
|
+
* Create a conversation embed, which can be integrated inside
|
|
7015
|
+
* chatbots or other conversational interfaces.
|
|
7016
|
+
* @example
|
|
7017
|
+
* ```js
|
|
7018
|
+
* import { BodylessConversation } from '@thoughtspot/visual-embed-sdk';
|
|
7019
|
+
*
|
|
7020
|
+
* const conversation = new BodylessConversation({
|
|
7021
|
+
* worksheetId: 'worksheetId',
|
|
7022
|
+
* });
|
|
7023
|
+
*
|
|
7024
|
+
* const { container, error } = await conversation.sendMessage('show me sales by region');
|
|
7025
|
+
*
|
|
7026
|
+
* // append the container to the DOM
|
|
7027
|
+
* document.body.appendChild(container); // or to any other element
|
|
7028
|
+
* ```
|
|
7029
|
+
* @group Embed components
|
|
7030
|
+
* @version SDK: 1.33.1 | ThoughtSpot: 10.5.0.cl
|
|
7031
|
+
*/
|
|
7032
|
+
export declare class BodylessConversation {
|
|
7033
|
+
constructor(viewConfig: BodylessConversationViewConfig);
|
|
7034
|
+
sendMessage(userMessage: string): Promise<{
|
|
7035
|
+
error: any;
|
|
7036
|
+
container?: undefined;
|
|
7037
|
+
} | {
|
|
7038
|
+
container: HTMLDivElement;
|
|
7039
|
+
error?: undefined;
|
|
7040
|
+
}>;
|
|
7041
|
+
}
|
|
7042
|
+
|
|
7043
|
+
export type SessionInfo = {
|
|
7044
|
+
releaseVersion: string;
|
|
7045
|
+
userGUID: string;
|
|
7046
|
+
currentOrgId: number;
|
|
7047
|
+
privileges: string[];
|
|
7048
|
+
mixpanelToken: string;
|
|
7049
|
+
isPublicUser: boolean;
|
|
7050
|
+
clusterId: string;
|
|
7051
|
+
clusterName: string;
|
|
7052
|
+
[key: string]: any;
|
|
7053
|
+
};
|
|
7054
|
+
export type PreauthInfo = {
|
|
7055
|
+
info?: SessionInfo;
|
|
7056
|
+
headers: Record<string, string>;
|
|
7057
|
+
status: number;
|
|
7058
|
+
[key: string]: any;
|
|
7059
|
+
};
|
|
7060
|
+
/**
|
|
7061
|
+
* Processes the session info response and returns the session info object.
|
|
7062
|
+
* @param preauthInfoResp {any} Response from the session info API.
|
|
7063
|
+
* @returns {PreauthInfo} The session info object.
|
|
7064
|
+
* @example ```js
|
|
7065
|
+
* const preauthInfoResp = await fetch(sessionInfoPath);
|
|
7066
|
+
* const sessionInfo = await formatPreauthInfo(preauthInfoResp);
|
|
7067
|
+
* console.log(sessionInfo);
|
|
7068
|
+
* ```
|
|
7069
|
+
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
7070
|
+
*/
|
|
7071
|
+
export declare const formatPreauthInfo: (preauthInfoResp: any) => Promise<PreauthInfo>;
|
|
7072
|
+
/**
|
|
7073
|
+
* Returns the session info object and caches it for future use.
|
|
7074
|
+
* Once fetched the session info object is cached and returned from the cache on
|
|
7075
|
+
* subsequent calls.
|
|
7076
|
+
* @example ```js
|
|
7077
|
+
* const preauthInfo = await getPreauthInfo();
|
|
7078
|
+
* console.log(preauthInfo);
|
|
7079
|
+
* ```
|
|
7080
|
+
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
7081
|
+
* @returns {Promise<SessionInfo>} The session info object.
|
|
7082
|
+
*/
|
|
7083
|
+
export declare function getPreauthInfo(allowCache?: boolean): Promise<PreauthInfo>;
|
|
7084
|
+
/**
|
|
7085
|
+
* Returns the cached session info object and caches it for future use.
|
|
7086
|
+
* Once fetched the session info object is cached and returned from the cache on
|
|
7087
|
+
* subsequent calls.
|
|
7088
|
+
* This cache is cleared when inti is called OR resetCachedSessionInfo is called.
|
|
7089
|
+
* @example ```js
|
|
7090
|
+
* const sessionInfo = await getSessionInfo();
|
|
7091
|
+
* console.log(sessionInfo);
|
|
7092
|
+
* ```
|
|
7093
|
+
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
7094
|
+
* @returns {Promise<SessionInfo>} The session info object.
|
|
7095
|
+
*/
|
|
7096
|
+
export declare function getSessionInfo(): Promise<SessionInfo>;
|
|
7097
|
+
/**
|
|
7098
|
+
* Returns the cached session info object. If the client is not authenticated the
|
|
7099
|
+
* function will return null.
|
|
7100
|
+
* @example ```js
|
|
7101
|
+
* const sessionInfo = getCachedSessionInfo();
|
|
7102
|
+
* if (sessionInfo) {
|
|
7103
|
+
* console.log(sessionInfo);
|
|
7104
|
+
* } else {
|
|
7105
|
+
* console.log('Not authenticated');
|
|
7106
|
+
* }
|
|
7107
|
+
* ```
|
|
7108
|
+
* @returns {SessionInfo | null} The session info object.
|
|
7109
|
+
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
7110
|
+
*/
|
|
7111
|
+
export declare function getCachedSessionInfo(): SessionInfo | null;
|
|
7112
|
+
/**
|
|
7113
|
+
* Processes the session info response and returns the session info object.
|
|
7114
|
+
* @param sessionInfoResp {any} Response from the session info API.
|
|
7115
|
+
* @returns {SessionInfo} The session info object.
|
|
7116
|
+
* @example ```js
|
|
7117
|
+
* const sessionInfoResp = await fetch(sessionInfoPath);
|
|
7118
|
+
* const sessionInfo = getSessionDetails(sessionInfoResp);
|
|
7119
|
+
* console.log(sessionInfo);
|
|
7120
|
+
* ```
|
|
7121
|
+
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
7122
|
+
*/
|
|
7123
|
+
export declare const getSessionDetails: (sessionInfoResp: any) => SessionInfo;
|
|
7124
|
+
/**
|
|
7125
|
+
* Resets the cached session info object and forces a new fetch on the next call.
|
|
7126
|
+
* @example ```js
|
|
7127
|
+
* resetCachedSessionInfo();
|
|
7128
|
+
* const sessionInfo = await getSessionInfo();
|
|
7129
|
+
* console.log(sessionInfo);
|
|
7130
|
+
* ```
|
|
7131
|
+
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
7132
|
+
* @returns {void}
|
|
7133
|
+
*/
|
|
7134
|
+
export declare function resetCachedSessionInfo(): void;
|
|
7135
|
+
/**
|
|
7136
|
+
* Resets the cached preauth info object and forces a new fetch on the next call.
|
|
7137
|
+
* @example ```js
|
|
7138
|
+
* resetCachedPreauthInfo();
|
|
7139
|
+
* const preauthInfo = await getPreauthInfo();
|
|
7140
|
+
* console.log(preauthInfo);
|
|
7141
|
+
* ```
|
|
7142
|
+
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
7143
|
+
* @returns {void}
|
|
7144
|
+
*/
|
|
7145
|
+
export declare function resetCachedPreauthInfo(): void;
|
|
7146
|
+
|
|
7093
7147
|
/**
|
|
7094
7148
|
* The list of customization css variables. These
|
|
7095
7149
|
* are the only allowed variables possible.
|
|
@@ -7670,7 +7724,7 @@ export declare const getEmbedConfig: () => EmbedConfig;
|
|
|
7670
7724
|
* @version SDK: 1.27.0 | ThoughtSpot: *
|
|
7671
7725
|
* @group Global methods
|
|
7672
7726
|
*/
|
|
7673
|
-
export declare const setEmbedConfig: (newConfig: EmbedConfig) =>
|
|
7727
|
+
export declare const setEmbedConfig: (newConfig: EmbedConfig) => any;
|
|
7674
7728
|
|
|
7675
7729
|
export declare const EndPoints: {
|
|
7676
7730
|
CONFIG: string;
|
|
@@ -7903,6 +7957,7 @@ export declare class TsEmbed {
|
|
|
7903
7957
|
*/
|
|
7904
7958
|
protected isRendered: boolean;
|
|
7905
7959
|
protected hostEventClient: HostEventClient;
|
|
7960
|
+
protected isReadyForRenderPromise: Promise<void>;
|
|
7906
7961
|
constructor(domSelector: DOMSelector, viewConfig?: ViewConfig);
|
|
7907
7962
|
/**
|
|
7908
7963
|
* Handles errors within the SDK
|
|
@@ -8046,12 +8101,12 @@ export declare class TsEmbed {
|
|
|
8046
8101
|
*/
|
|
8047
8102
|
render(): Promise<TsEmbed>;
|
|
8048
8103
|
getIframeSrc(): string;
|
|
8049
|
-
protected handleRenderForPrerender():
|
|
8104
|
+
protected handleRenderForPrerender(): Promise<TsEmbed>;
|
|
8050
8105
|
/**
|
|
8051
8106
|
* Creates the preRender shell
|
|
8052
8107
|
* @param showPreRenderByDefault - Show the preRender after render, hidden by default
|
|
8053
8108
|
*/
|
|
8054
|
-
preRender(showPreRenderByDefault?: boolean): TsEmbed
|
|
8109
|
+
preRender(showPreRenderByDefault?: boolean): Promise<TsEmbed>;
|
|
8055
8110
|
/**
|
|
8056
8111
|
* Get the Post Url Params for THOUGHTSPOT from the current
|
|
8057
8112
|
* host app URL.
|
|
@@ -8082,7 +8137,7 @@ export declare class TsEmbed {
|
|
|
8082
8137
|
* Also, synchronizes the style of the PreRender component with the embedding
|
|
8083
8138
|
* element.
|
|
8084
8139
|
*/
|
|
8085
|
-
showPreRender():
|
|
8140
|
+
showPreRender(): Promise<TsEmbed>;
|
|
8086
8141
|
/**
|
|
8087
8142
|
* Synchronizes the style properties of the PreRender component with the embedding
|
|
8088
8143
|
* element. This function adjusts the position, width, and height of the PreRender
|