@thoughtspot/visual-embed-sdk 1.22.0-alpha.7 → 1.22.0-alpha.9

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.
@@ -0,0 +1,3471 @@
1
+ // Generated by dts-bundle v0.7.3
2
+ // Dependencies for this module:
3
+ // ../../eventemitter3
4
+
5
+ declare module '@thoughtspot/visual-embed-sdk' {
6
+ /**
7
+ * Copyright (c) 2023
8
+ *
9
+ * ThoughtSpot Visual Embed SDK for embedding ThoughtSpot analytics
10
+ * in other web applications.
11
+ *
12
+ * @summary ThoughtSpot Visual Embed SDK
13
+ * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
14
+ */
15
+ import { AppEmbed, Page, AppViewConfig } from '@thoughtspot/visual-embed-sdk/embed/app';
16
+ import { init, prefetch, logout, getEmbedConfig, executeTML, exportTML } from '@thoughtspot/visual-embed-sdk/embed/base';
17
+ import { PinboardEmbed, LiveboardViewConfig, LiveboardEmbed } from '@thoughtspot/visual-embed-sdk/embed/liveboard';
18
+ import { SearchEmbed, SearchViewConfig } from '@thoughtspot/visual-embed-sdk/embed/search';
19
+ import { SearchBarEmbed, SearchBarViewConfig } from '@thoughtspot/visual-embed-sdk/embed/search-bar';
20
+ import { AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter, getSessionInfo } from '@thoughtspot/visual-embed-sdk/auth';
21
+ import { AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, EmbedConfig, PrefetchFeatures, FrameParams, DOMSelector, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, ContextMenuTriggerOptions } from '@thoughtspot/visual-embed-sdk/types';
22
+ import { CustomCssVariables } from '@thoughtspot/visual-embed-sdk/css-variables';
23
+ import { SageEmbed, SageViewConfig } from '@thoughtspot/visual-embed-sdk/embed/sage';
24
+ export { init, logout, prefetch, executeTML, exportTML, getEmbedConfig as getInitConfig, getSessionInfo, SearchEmbed, SearchBarEmbed, PinboardEmbed, LiveboardEmbed, SageEmbed, AppEmbed, AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, ContextMenuTriggerOptions, EmbedConfig, SearchViewConfig, SearchBarViewConfig, LiveboardViewConfig, SageViewConfig, AppViewConfig, PrefetchFeatures, FrameParams, DOMSelector, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, CustomCssVariables, };
25
+ }
26
+
27
+ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
28
+ /**
29
+ * Copyright (c) 2022
30
+ *
31
+ * Full application embedding
32
+ * https://developers.thoughtspot.com/docs/?pageid=full-embed
33
+ *
34
+ * @summary Full app embed
35
+ * @module
36
+ * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
37
+ */
38
+ import { DOMSelector, ViewConfig, MessagePayload } from '@thoughtspot/visual-embed-sdk/types';
39
+ import { V1Embed } from '@thoughtspot/visual-embed-sdk/embed/ts-embed';
40
+ /**
41
+ * Pages within the ThoughtSpot app that can be embedded.
42
+ */
43
+ export enum Page {
44
+ /**
45
+ * Home page
46
+ */
47
+ Home = "home",
48
+ /**
49
+ * Search page
50
+ */
51
+ Search = "search",
52
+ /**
53
+ * Saved answers listing page
54
+ */
55
+ Answers = "answers",
56
+ /**
57
+ * Liveboards listing page
58
+ */
59
+ Liveboards = "liveboards",
60
+ /**
61
+ * @hidden
62
+ */
63
+ Pinboards = "pinboards",
64
+ /**
65
+ * Data management page
66
+ */
67
+ Data = "data",
68
+ /**
69
+ * SpotIQ listing page
70
+ */
71
+ SpotIQ = "spotiq"
72
+ }
73
+ /**
74
+ * The view configuration for full app embedding.
75
+ *
76
+ * @group Embed components
77
+ */
78
+ export interface AppViewConfig extends ViewConfig {
79
+ /**
80
+ * If true, the main navigation bar within the ThoughtSpot app
81
+ * is displayed. By default, the navigation bar is hidden.
82
+ */
83
+ showPrimaryNavbar?: boolean;
84
+ /**
85
+ * If true, help and profile buttons will hide on NavBar. By default,
86
+ * they are shown.
87
+ */
88
+ disableProfileAndHelp?: boolean;
89
+ /**
90
+ * If true, application switcher button will hide on NavBar. By default,
91
+ * they are shown.
92
+ */
93
+ hideApplicationSwitcher?: boolean;
94
+ /**
95
+ * If true, org switcher button will hide on NavBar. By default,
96
+ * they are shown.
97
+ */
98
+ hideOrgSwitcher?: boolean;
99
+ /**
100
+ * A URL path within the app that is to be embedded.
101
+ * If both path and pageId attributes are defined, the path definition
102
+ * takes precedence.
103
+ */
104
+ path?: string;
105
+ /**
106
+ * The application page to set as the start page
107
+ * in the embedded view.
108
+ */
109
+ pageId?: Page;
110
+ /**
111
+ * This puts a filter tag on the application. All metadata lists in the
112
+ * application, such as Liveboards and answers, would be filtered by this
113
+ * tag.
114
+ */
115
+ tag?: string;
116
+ /**
117
+ * The array of GUIDs to be hidden
118
+ */
119
+ hideObjects?: string[];
120
+ /**
121
+ * Render liveboards using the new v2 rendering mode
122
+ * This is a transient flag which is primarily meant for internal use
123
+ *
124
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
125
+ * @hidden
126
+ */
127
+ liveboardV2?: boolean;
128
+ /**
129
+ * If set to true, the Search Assist feature is enabled.
130
+ *
131
+ * @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl, 8.8.1-sw
132
+ */
133
+ enableSearchAssist?: boolean;
134
+ /**
135
+ * If set to true, the embedded object container dynamically resizes
136
+ * according to the height of the pages which support fullHeight mode.
137
+ *
138
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.4.0.cl, 9.4.0-sw
139
+ */
140
+ fullHeight?: boolean;
141
+ }
142
+ /**
143
+ * Embeds full ThoughtSpot experience in a host application.
144
+ *
145
+ * @group Embed components
146
+ */
147
+ export class AppEmbed extends V1Embed {
148
+ protected viewConfig: AppViewConfig;
149
+ constructor(domSelector: DOMSelector, viewConfig: AppViewConfig);
150
+ /**
151
+ * Constructs a map of parameters to be passed on to the
152
+ * embedded Liveboard or visualization.
153
+ */
154
+ protected getEmbedParams(): string;
155
+ /**
156
+ * Set the iframe height as per the computed height received
157
+ * from the ThoughtSpot app.
158
+ *
159
+ * @param data The event payload
160
+ */
161
+ protected updateIFrameHeight: (data: MessagePayload) => void;
162
+ /**
163
+ * Navigate to particular page for app embed. eg:answers/pinboards/home
164
+ * This is used for embedding answers, pinboards, visualizations and full application
165
+ * only.
166
+ *
167
+ * @param path string | number The string, set to iframe src and navigate to new page
168
+ * eg: appEmbed.navigateToPage('pinboards')
169
+ * When used with `noReload` (default: true) this can also be a number
170
+ * like 1/-1 to go forward/back.
171
+ * @param noReload boolean Trigger the navigation without reloading the page
172
+ * @version SDK: 1.12.0 | ThoughtSpot: 8.4.0.cl, 8.4.1-sw
173
+ */
174
+ navigateToPage(path: string | number, noReload?: boolean): void;
175
+ /**
176
+ * Renders the embedded application pages in the ThoughtSpot app.
177
+ *
178
+ * @param renderOptions An object containing the page ID
179
+ * to be embedded.
180
+ */
181
+ render(): AppEmbed;
182
+ }
183
+ }
184
+
185
+ declare module '@thoughtspot/visual-embed-sdk/embed/base' {
186
+ import { EmbedConfig, PrefetchFeatures } from '@thoughtspot/visual-embed-sdk/types';
187
+ import { notifyAuthFailure, notifyAuthSDKSuccess, notifyAuthSuccess, notifyLogout, AuthEventEmitter } from '@thoughtspot/visual-embed-sdk/auth';
188
+ export interface executeTMLInput {
189
+ metadata_tmls: string[];
190
+ import_policy?: 'PARTIAL' | 'ALL_OR_NONE' | 'VALIDATE_ONLY';
191
+ create_new?: boolean;
192
+ }
193
+ export interface exportTMLInput {
194
+ metadata: {
195
+ identifier: string;
196
+ type?: 'LIVEBOARD' | 'ANSWER' | 'LOGICAL_TABLE' | 'CONNECTION';
197
+ }[];
198
+ export_associated?: boolean;
199
+ export_fqn?: boolean;
200
+ edoc_format?: 'YAML' | 'JSON';
201
+ }
202
+ export let authPromise: Promise<boolean>;
203
+ /**
204
+ * Gets the configuration embed was initialized with.
205
+ *
206
+ * @returns {@link EmbedConfig} The configuration embed was initialized with.
207
+ * @version SDK: 1.19.0 | ThoughtSpot: *
208
+ * @group Global methods
209
+ */
210
+ export const getEmbedConfig: () => EmbedConfig;
211
+ export const getAuthPromise: () => Promise<boolean>;
212
+ export { notifyAuthFailure, notifyAuthSDKSuccess, notifyAuthSuccess, notifyLogout, };
213
+ /**
214
+ * Perform authentication on the ThoughtSpot app as applicable.
215
+ */
216
+ export const handleAuth: () => Promise<boolean>;
217
+ /**
218
+ * Prefetches static resources from the specified URL. Web browsers can then cache the
219
+ * prefetched resources and serve them from the user's local disk to provide faster access
220
+ * to your app.
221
+ *
222
+ * @param url The URL provided for prefetch
223
+ * @param prefetchFeatures Specify features which needs to be prefetched.
224
+ * @version SDK: 1.4.0 | ThoughtSpot: ts7.sep.cl, 7.2.1
225
+ * @group Global methods
226
+ */
227
+ export const prefetch: (url?: string, prefetchFeatures?: PrefetchFeatures[]) => void;
228
+ /**
229
+ * Initializes the Visual Embed SDK globally and perform
230
+ * authentication if applicable. This function needs to be called before any ThoughtSpot
231
+ * component like liveboard etc can be embedded. But need not wait for AuthEvent.SUCCESS
232
+ * to actually embed. That is handled internally.
233
+ *
234
+ * @param embedConfig The configuration object containing ThoughtSpot host,
235
+ * authentication mechanism and so on.
236
+ * @example
237
+ * ```js
238
+ * const authStatus = init({
239
+ * thoughtSpotHost: 'https://my.thoughtspot.cloud',
240
+ * authType: AuthType.None,
241
+ * });
242
+ * authStatus.on(AuthStatus.FAILURE, (reason) => { // do something here });
243
+ * ```
244
+ * @returns {@link AuthEventEmitter} event emitter which emits events on authentication success,
245
+ * failure and logout. See {@link AuthStatus}
246
+ * @version SDK: 1.0.0 | ThoughtSpot ts7.april.cl, 7.2.1
247
+ * @group Authentication / Init
248
+ */
249
+ export const init: (embedConfig: EmbedConfig) => AuthEventEmitter;
250
+ /**
251
+ *
252
+ */
253
+ export function disableAutoLogin(): void;
254
+ /**
255
+ * Logs out from ThoughtSpot. This also sets the autoLogin flag to false, to
256
+ * prevent the SDK from automatically logging in again.
257
+ *
258
+ * You can call the `init` method again to re login, if autoLogin is set to
259
+ * true in this second call it will be honored.
260
+ *
261
+ * @param doNotDisableAutoLogin This flag when passed will not disable autoLogin
262
+ * @returns Promise which resolves when logout completes.
263
+ * @version SDK: 1.10.1 | ThoughtSpot: 8.2.0.cl, 8.4.1-sw
264
+ * @group Global methods
265
+ */
266
+ export const logout: (doNotDisableAutoLogin?: boolean) => Promise<boolean>;
267
+ /**
268
+ * Renders functions in a queue, resolves to next function only after the callback next
269
+ * is called
270
+ *
271
+ * @param fn The function being registered
272
+ */
273
+ export const renderInQueue: (fn: (next?: (val?: any) => void) => Promise<any>) => Promise<any>;
274
+ export const executeTML: (data: executeTMLInput) => Promise<any>;
275
+ export const exportTML: (data: exportTMLInput) => Promise<any>;
276
+ /**
277
+ *
278
+ */
279
+ export function reset(): void;
280
+ }
281
+
282
+ declare module '@thoughtspot/visual-embed-sdk/embed/liveboard' {
283
+ /**
284
+ * Copyright (c) 2022
285
+ *
286
+ * Embed a ThoughtSpot Liveboard or visualization
287
+ * https://developers.thoughtspot.com/docs/?pageid=embed-pinboard
288
+ * https://developers.thoughtspot.com/docs/?pageid=embed-a-viz
289
+ *
290
+ * @summary Liveboard & visualization embed
291
+ * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
292
+ */
293
+ import { DOMSelector, HostEvent, ViewConfig } from '@thoughtspot/visual-embed-sdk/types';
294
+ import { V1Embed } from '@thoughtspot/visual-embed-sdk/embed/ts-embed';
295
+ /**
296
+ * The configuration for the embedded Liveboard or visualization page view.
297
+ *
298
+ * @group Embed components
299
+ */
300
+ export interface LiveboardViewConfig extends ViewConfig {
301
+ /**
302
+ * If set to true, the embedded object container dynamically resizes
303
+ * according to the height of the Liveboard.
304
+ *
305
+ * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 7.2.1
306
+ */
307
+ fullHeight?: boolean;
308
+ /**
309
+ * This is the minimum height(in pixels) for a full height Liveboard.
310
+ * Setting this height helps resolves issues with empty Liveboards and
311
+ * other screens navigable from a Liveboard.
312
+ *
313
+ * @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
314
+ * @default 500
315
+ */
316
+ defaultHeight?: number;
317
+ /**
318
+ * @Deprecated If set to true, the context menu in visualizations will be enabled.
319
+ */
320
+ enableVizTransformations?: boolean;
321
+ /**
322
+ * The Liveboard to display in the embedded view.
323
+ * Use either of liveboardId or pinboardId to reference the Liveboard to embed.
324
+ *
325
+ * @version SDK: 1.3.0 | ThoughtSpot ts7.aug.cl, 7.2.1
326
+ */
327
+ liveboardId?: string;
328
+ /**
329
+ * To support backward compatibility
330
+ *
331
+ * @hidden
332
+ */
333
+ pinboardId?: string;
334
+ /**
335
+ * The visualization within the Liveboard to display.
336
+ */
337
+ vizId?: string;
338
+ /**
339
+ * If set to true, all filter chips from a
340
+ * Liveboard page will be read-only (no X buttons)
341
+ *
342
+ * @version SDK: 1.3.0 | ThoughtSpot ts7.aug.cl, 7.2.1
343
+ */
344
+ preventLiveboardFilterRemoval?: boolean;
345
+ /**
346
+ * Array of viz ids which should be visible when the liveboard
347
+ * first renders. This can be changed by triggering the "SetVisibleVizs"
348
+ * event.
349
+ *
350
+ * @version SDK: 1.9.1 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
351
+ */
352
+ visibleVizs?: string[];
353
+ /**
354
+ * To support backward compatibilty
355
+ *
356
+ * @hidden
357
+ */
358
+ preventPinboardFilterRemoval?: boolean;
359
+ /**
360
+ * Render embedded Liveboards and visualizations in the new Liveboard experience mode
361
+ *
362
+ * @version SDK: 1.14.0 | ThoughtSpot: 8.6.0.cl, 8.8.1-sw
363
+ */
364
+ liveboardV2?: boolean;
365
+ /**
366
+ * Tab Id of the Liveboard that is supposed to be active
367
+ *
368
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
369
+ */
370
+ activeTabId?: string;
371
+ }
372
+ /**
373
+ * Embed a ThoughtSpot Liveboard or a Thoughtspot visualization. When rendered it already
374
+ * waits for the authentication to complete, so no need to wait for AuthStatus.SUCCESS.
375
+ *
376
+ * @example
377
+ * ```js
378
+ * import { .. } from '@thoughtspot/visual-embed-sdk';
379
+ * init({ ... });
380
+ * const embed = new LiveboardEmbed("#container", {
381
+ * liveboardId: <your-id-here>,
382
+ * // .. other params here.
383
+ * })
384
+ * ```
385
+ * @group Embed components
386
+ */
387
+ export class LiveboardEmbed extends V1Embed {
388
+ protected viewConfig: LiveboardViewConfig;
389
+ constructor(domSelector: DOMSelector, viewConfig: LiveboardViewConfig);
390
+ /**
391
+ * Construct a map of params to be passed on to the
392
+ * embedded Liveboard or visualization.
393
+ */
394
+ protected getEmbedParams(): string;
395
+ /**
396
+ * Triggers an event to the embedded app
397
+ *
398
+ * @param messageType The event type
399
+ * @param data The payload to send with the message
400
+ */
401
+ trigger(messageType: HostEvent, data?: any): Promise<any>;
402
+ /**
403
+ * Render an embedded ThoughtSpot Liveboard or visualization
404
+ *
405
+ * @param renderOptions An object specifying the Liveboard ID,
406
+ * visualization ID and the runtime filters.
407
+ */
408
+ render(): LiveboardEmbed;
409
+ navigateToLiveboard(liveboardId: string, vizId?: string, activeTabId?: string): void;
410
+ }
411
+ /**
412
+ * @hidden
413
+ */
414
+ export class PinboardEmbed extends LiveboardEmbed {
415
+ }
416
+ }
417
+
418
+ declare module '@thoughtspot/visual-embed-sdk/embed/search' {
419
+ /**
420
+ * Copyright (c) 2022
421
+ *
422
+ * Embed ThoughtSpot search or a saved answer
423
+ *
424
+ * @summary Search embed
425
+ * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
426
+ */
427
+ import { DOMSelector, Action, ViewConfig } from '@thoughtspot/visual-embed-sdk/types';
428
+ import { TsEmbed } from '@thoughtspot/visual-embed-sdk/embed/ts-embed';
429
+ /**
430
+ * Configuration for search options
431
+ */
432
+ export interface SearchOptions {
433
+ /**
434
+ * The tml string to load the answer
435
+ */
436
+ searchTokenString: string;
437
+ /**
438
+ * Boolean to determine if the search should be executed or not.
439
+ * if it is executed, put the focus on the results.
440
+ * if it’s not executed, put the focus in the search bar - at the end of
441
+ * the tokens
442
+ */
443
+ executeSearch?: boolean;
444
+ }
445
+ /**
446
+ * The configuration attributes for the embedded search view.
447
+ *
448
+ * @group Embed components
449
+ */
450
+ export interface SearchViewConfig extends ViewConfig {
451
+ /**
452
+ * If set to true, the data sources panel is collapsed on load,
453
+ * but can be expanded manually.
454
+ */
455
+ collapseDataSources?: boolean;
456
+ /**
457
+ * If set to true, hides the data sources panel.
458
+ */
459
+ hideDataSources?: boolean;
460
+ /**
461
+ * If set to true, hides the charts and tables in search answers.
462
+ * This attribute can be used to create a custom visualization
463
+ * using raw answer data.
464
+ */
465
+ hideResults?: boolean;
466
+ /**
467
+ * If set to true, the Search Assist feature is enabled.
468
+ *
469
+ * @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl, 8.8.1-sw
470
+ */
471
+ enableSearchAssist?: boolean;
472
+ /**
473
+ * If set to true, the tabular view is set as the default
474
+ * format for presenting search data.
475
+ */
476
+ forceTable?: boolean;
477
+ /**
478
+ * The array of data source GUIDs to set on load.
479
+ * Only a single dataSource supported currently.
480
+ *
481
+ * @deprecated Use dataSource instead
482
+ */
483
+ dataSources?: string[];
484
+ /**
485
+ * The array of data source GUIDs to set on load.
486
+ *
487
+ * @version: SDK: 1.19.0
488
+ */
489
+ dataSource?: string;
490
+ /**
491
+ * The initial search query to load the answer with.
492
+ *
493
+ * @deprecated Use {@link searchOptions} instead
494
+ */
495
+ searchQuery?: string;
496
+ /**
497
+ * Configuration for search options
498
+ */
499
+ searchOptions?: SearchOptions;
500
+ /**
501
+ * The GUID of a saved answer to load initially.
502
+ */
503
+ answerId?: string;
504
+ /**
505
+ * If set to true, search page will render without the Search Bar
506
+ * The chart/table should still be visible.
507
+ *
508
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
509
+ */
510
+ hideSearchBar?: boolean;
511
+ }
512
+ export const HiddenActionItemByDefaultForSearchEmbed: Action[];
513
+ /**
514
+ * Embed ThoughtSpot search
515
+ *
516
+ * @group Embed components
517
+ */
518
+ export class SearchEmbed extends TsEmbed {
519
+ /**
520
+ * The view configuration for the embedded ThoughtSpot search.
521
+ */
522
+ protected viewConfig: SearchViewConfig;
523
+ constructor(domSelector: DOMSelector, viewConfig: SearchViewConfig);
524
+ protected getEmbedParams(): string;
525
+ /**
526
+ * Render the embedded ThoughtSpot search
527
+ */
528
+ render(): SearchEmbed;
529
+ }
530
+ }
531
+
532
+ declare module '@thoughtspot/visual-embed-sdk/embed/search-bar' {
533
+ import { ViewConfig } from '@thoughtspot/visual-embed-sdk/types';
534
+ import { TsEmbed } from '@thoughtspot/visual-embed-sdk/embed/ts-embed';
535
+ import { SearchOptions } from '@thoughtspot/visual-embed-sdk/embed/search';
536
+ /**
537
+ * @group Embed components
538
+ */
539
+ export interface SearchBarViewConfig extends Omit<ViewConfig, 'runtimeFilters' | 'showAlerts'> {
540
+ /**
541
+ * The array of data source GUIDs to set on load.
542
+ * Only a single dataSource supported currently.
543
+ *
544
+ * @deprecated Use dataSource instead
545
+ */
546
+ dataSources?: string[];
547
+ /**
548
+ * The array of data source GUIDs to set on load.
549
+ *
550
+ * @version: SDK: 1.19.0
551
+ */
552
+ dataSource?: string;
553
+ /**
554
+ * Configuration for search options
555
+ */
556
+ searchOptions?: SearchOptions;
557
+ }
558
+ /**
559
+ * Embed ThoughtSpot search bar
560
+ *
561
+ * @version: SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1-sw
562
+ * @group Embed components
563
+ */
564
+ export class SearchBarEmbed extends TsEmbed {
565
+ /**
566
+ * The view configuration for the embedded ThoughtSpot search bar.
567
+ */
568
+ protected viewConfig: SearchBarViewConfig;
569
+ constructor(domSelector: string, viewConfig: SearchBarViewConfig);
570
+ /**
571
+ * Render the embedded ThoughtSpot search
572
+ */
573
+ render(): SearchBarEmbed;
574
+ }
575
+ }
576
+
577
+ declare module '@thoughtspot/visual-embed-sdk/auth' {
578
+ import EventEmitter from 'eventemitter3';
579
+ import { EmbedConfig } from '@thoughtspot/visual-embed-sdk/types';
580
+ export let loggedInStatus: boolean;
581
+ export let samlAuthWindow: Window;
582
+ export let samlCompletionPromise: Promise<void>;
583
+ export const SSO_REDIRECTION_MARKER_GUID = "5e16222e-ef02-43e9-9fbd-24226bf3ce5b";
584
+ export const EndPoints: {
585
+ AUTH_VERIFICATION: string;
586
+ SAML_LOGIN_TEMPLATE: (targetUrl: string) => string;
587
+ OIDC_LOGIN_TEMPLATE: (targetUrl: string) => string;
588
+ TOKEN_LOGIN: string;
589
+ BASIC_LOGIN: string;
590
+ LOGOUT: string;
591
+ EXECUTE_TML: string;
592
+ EXPORT_TML: string;
593
+ };
594
+ interface sessionInfoInterface {
595
+ userGUID: any;
596
+ isPublicUser: any;
597
+ mixpanelToken: any;
598
+ [key: string]: any;
599
+ }
600
+ /**
601
+ * Enum for auth failure types. This is the parameter passed to the listner
602
+ * of {@link AuthStatus.FAILURE}.
603
+ *
604
+ * @group Authentication / Init
605
+ */
606
+ export enum AuthFailureType {
607
+ SDK = "SDK",
608
+ NO_COOKIE_ACCESS = "NO_COOKIE_ACCESS",
609
+ EXPIRY = "EXPIRY",
610
+ OTHER = "OTHER"
611
+ }
612
+ /**
613
+ * Enum for auth status emitted by the emitter returned from {@link init}.
614
+ *
615
+ * @group Authentication / Init
616
+ */
617
+ export enum AuthStatus {
618
+ /**
619
+ * Emits when the SDK fails to authenticate
620
+ */
621
+ FAILURE = "FAILURE",
622
+ /**
623
+ * Emits when the SDK authenticates successfully
624
+ */
625
+ SDK_SUCCESS = "SDK_SUCCESS",
626
+ /**
627
+ * Emits when the app sends an authentication success message
628
+ */
629
+ SUCCESS = "SUCCESS",
630
+ /**
631
+ * Emits when a user logs out
632
+ */
633
+ LOGOUT = "LOGOUT",
634
+ /**
635
+ * Emitted when inPopup: true in the SAMLRedirect flow.
636
+ * And, we are waiting for popup to be triggered either programatically
637
+ * or by the trigger button.
638
+ *
639
+ * @version SDK: 1.19.0
640
+ */
641
+ WAITING_FOR_POPUP = "WAITING_FOR_POPUP"
642
+ }
643
+ /**
644
+ * Event emitter returned from {@link init}.
645
+ *
646
+ * @group Authentication / Init
647
+ */
648
+ export interface AuthEventEmitter {
649
+ /**
650
+ * Register a listener on Auth failure.
651
+ *
652
+ * @param event
653
+ * @param listener
654
+ */
655
+ on(event: AuthStatus.FAILURE, listener: (failureType: AuthFailureType) => void): this;
656
+ /**
657
+ * Register a listener on Auth SDK success.
658
+ *
659
+ * @param event
660
+ * @param listener
661
+ */
662
+ on(event: AuthStatus.SDK_SUCCESS | AuthStatus.LOGOUT | AuthStatus.WAITING_FOR_POPUP, listener: () => void): this;
663
+ on(event: AuthStatus.SUCCESS, listener: (sessionInfo: any) => void): this;
664
+ once(event: AuthStatus.FAILURE, listener: (failureType: AuthFailureType) => void): this;
665
+ once(event: AuthStatus.SDK_SUCCESS | AuthStatus.LOGOUT | AuthStatus.WAITING_FOR_POPUP, listener: () => void): this;
666
+ once(event: AuthStatus.SUCCESS, listener: (sessionInfo: any) => void): this;
667
+ /**
668
+ * Trigger an event on the emitter returned from init.
669
+ *
670
+ * @param {@link AuthEvent}
671
+ */
672
+ emit(event: AuthEvent): void;
673
+ }
674
+ /**
675
+ * Events which can be triggered on the emitter returned from {@link init}.
676
+ *
677
+ * @group Authentication / Init
678
+ */
679
+ export enum AuthEvent {
680
+ /**
681
+ * Manually trigger the SSO popup. This is useful with
682
+ * authStatus: SAMLRedirect/OIDCRedicre and inPopup: true
683
+ */
684
+ TRIGGER_SSO_POPUP = "TRIGGER_SSO_POPUP"
685
+ }
686
+ /**
687
+ *
688
+ */
689
+ export function getAuthEE(): EventEmitter<AuthStatus | AuthEvent>;
690
+ /**
691
+ *
692
+ * @param eventEmitter
693
+ */
694
+ export function setAuthEE(eventEmitter: EventEmitter<AuthStatus | AuthEvent>): void;
695
+ /**
696
+ *
697
+ */
698
+ export function notifyAuthSDKSuccess(): void;
699
+ /**
700
+ *
701
+ */
702
+ export function notifyAuthSuccess(): void;
703
+ /**
704
+ *
705
+ * @param failureType
706
+ */
707
+ export function notifyAuthFailure(failureType: AuthFailureType): void;
708
+ /**
709
+ *
710
+ */
711
+ export function notifyLogout(): void;
712
+ export const initSession: (sessionDetails: sessionInfoInterface) => void;
713
+ export const getSessionDetails: (sessionInfoResp: any) => sessionInfoInterface;
714
+ /**
715
+ * Return releaseVersion if available
716
+ */
717
+ export function getReleaseVersion(): string;
718
+ /**
719
+ * Return a promise that resolves with the session information when
720
+ * authentication is successful. And info is available.
721
+ *
722
+ * @group Global methods
723
+ */
724
+ export function getSessionInfo(): Promise<sessionInfoInterface>;
725
+ export const getAuthenticaionToken: (embedConfig: EmbedConfig) => Promise<any>;
726
+ /**
727
+ * Perform token based authentication
728
+ *
729
+ * @param embedConfig The embed configuration
730
+ */
731
+ export const doTokenAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
732
+ /**
733
+ * Validate embedConfig parameters required for cookielessTokenAuth
734
+ *
735
+ * @param embedConfig The embed configuration
736
+ */
737
+ export const doCookielessTokenAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
738
+ /**
739
+ * Perform basic authentication to the ThoughtSpot cluster using the cluster
740
+ * credentials.
741
+ *
742
+ * Warning: This feature is primarily intended for developer testing. It is
743
+ * strongly advised not to use this authentication method in production.
744
+ *
745
+ * @param embedConfig The embed configuration
746
+ */
747
+ export const doBasicAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
748
+ export const doSamlAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
749
+ export const doOIDCAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
750
+ export const logout: (embedConfig: EmbedConfig) => Promise<boolean>;
751
+ /**
752
+ * Perform authentication on the ThoughtSpot cluster
753
+ *
754
+ * @param embedConfig The embed configuration
755
+ */
756
+ export const authenticate: (embedConfig: EmbedConfig) => Promise<boolean>;
757
+ /**
758
+ * Check if we are authenticated to the ThoughtSpot cluster
759
+ */
760
+ export const isAuthenticated: () => boolean;
761
+ export {};
762
+ }
763
+
764
+ declare module '@thoughtspot/visual-embed-sdk/types' {
765
+ /**
766
+ * Copyright (c) 2023
767
+ *
768
+ * TypeScript type definitions for ThoughtSpot Visual Embed SDK
769
+ *
770
+ * @summary Type definitions for Embed SDK
771
+ * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
772
+ */
773
+ import { CustomCssVariables } from '@thoughtspot/visual-embed-sdk/css-variables';
774
+ /**
775
+ * The authentication mechanism for allowing access to the
776
+ * the embedded app
777
+ *
778
+ * @group Authentication / Init
779
+ */
780
+ export enum AuthType {
781
+ /**
782
+ * No authentication on the SDK. Passthrough to the embedded App. Alias for
783
+ * `Passthrough`.
784
+ *
785
+ * @example
786
+ * ```js
787
+ * init({
788
+ * // ...
789
+ * authType: AuthType.None,
790
+ * });
791
+ * ```
792
+ */
793
+ None = "None",
794
+ /**
795
+ * Passthrough SSO to the embedded App within the iframe. Requires least
796
+ * configuration, but may not be supported by all IDPs. This will behave like `None`
797
+ * if SSO is not configured on ThoughtSpot.
798
+ *
799
+ * @example
800
+ * ```js
801
+ * init({
802
+ * // ...
803
+ * authType: AuthType.EmbeddedSSO,
804
+ * });
805
+ * ```
806
+ * Set authentication type as Embedded SSO.
807
+ *
808
+ * To use this:
809
+ * Your SAML or OpenID provider must allow iframe redirects.
810
+ * eg. If you are using okta as IdP, you can enable iFrame embedding.
811
+ * @version: SDK: 1.15.0 | ThouhgtSpot: 8.8.0.cl
812
+ */
813
+ EmbeddedSSO = "EmbeddedSSO",
814
+ /**
815
+ * SSO using SAML
816
+ *
817
+ * @deprecated Use {@link SAMLRedirect} instead
818
+ * @hidden
819
+ */
820
+ SSO = "SSO_SAML",
821
+ /**
822
+ * SSO using SAML
823
+ *
824
+ * @deprecated Use {@link SAMLRedirect} instead
825
+ * @hidden
826
+ */
827
+ SAML = "SSO_SAML",
828
+ /**
829
+ * SSO using SAML
830
+ * Will make the host application redirect to the SAML Idp. Use this
831
+ * when the idp does not allow itself to be embedded.
832
+ *
833
+ * This redirects the host application to the SAML Idp. The host application
834
+ * will be redirected back to the ThoughtSpot app after authentication.
835
+ *
836
+ * @example
837
+ * ```js
838
+ * init({
839
+ * // ...
840
+ * authType: AuthType.SAMLRedirect,
841
+ * });
842
+ * ```
843
+ *
844
+ * This opens the SAML Idp in a popup window. The popup is triggered
845
+ * when the user clicks the trigger button. The popup window will be
846
+ * closed automatically after authentication.
847
+ * @example
848
+ * ```js
849
+ * init({
850
+ * // ...
851
+ * authType: AuthType.SAMLRedirect,
852
+ * authTriggerText: 'Login with SAML',
853
+ * authTriggerContainer: '#embed-container',
854
+ * inPopup: true,
855
+ * });
856
+ * ```
857
+ *
858
+ * Can also use event to trigger the popup flow. Works the same
859
+ * as above example.
860
+ * @example
861
+ * ```js
862
+ * const authEE = init({
863
+ * // ...
864
+ * authType: AuthType.SAMLRedirect,
865
+ * inPopup: true,
866
+ * });
867
+ *
868
+ * someButtonOnYourPage.addEventListener('click', () => {
869
+ * authEE.emit(AuthEvent.TRIGGER_SSO_POPUP);
870
+ * });
871
+ * ```
872
+ */
873
+ SAMLRedirect = "SSO_SAML",
874
+ /**
875
+ * SSO using OIDC
876
+ *
877
+ * @hidden
878
+ * @deprecated Use {@link OIDCRedirect} instead
879
+ */
880
+ OIDC = "SSO_OIDC",
881
+ /**
882
+ * SSO using OIDC
883
+ * Will make the host application redirect to the OIDC Idp.
884
+ * See code samples in {@link SAMLRedirect}.
885
+ */
886
+ OIDCRedirect = "SSO_OIDC",
887
+ /**
888
+ * Trusted authentication server
889
+ *
890
+ * @hidden
891
+ * @deprecated Use {@link TrustedAuth} instead
892
+ */
893
+ AuthServer = "AuthServer",
894
+ /**
895
+ * Trusted authentication server, Use your own authentication server
896
+ * which returns a bearer token, generated using the secret_key obtained
897
+ * from ThoughtSpot.
898
+ *
899
+ * @example
900
+ * ```js
901
+ * init({
902
+ * // ...
903
+ * authType: AuthType.TrustedAuthToken,
904
+ * getAuthToken: () => {
905
+ * return fetch('https://my-backend.app/ts-token')
906
+ * .then((response) => response.json())
907
+ * .then((data) => data.token);
908
+ * }
909
+ * ```
910
+ */
911
+ TrustedAuthToken = "AuthServer",
912
+ /**
913
+ * Trusted authentication server Cookieless, Use you own authentication
914
+ * server which returns a bearer token, generated using the secret_key
915
+ * obtained from ThoughtSpot. This uses a cookieless authentication
916
+ * approach, recommended to by pass third-party cookie-blocking restriction
917
+ * implemented by some browsers
918
+ *
919
+ * @example
920
+ * ```js
921
+ * init({
922
+ * // ...
923
+ * authType: AuthType.TrustedAuthTokenCookieless,
924
+ * getAuthToken: () => {
925
+ * return fetch('https://my-backend.app/ts-token')
926
+ * .then((response) => response.json())
927
+ * .then((data) => data.token);
928
+ * }
929
+ * ```
930
+ * @version SDK: 1.22.0| ThouhgtSpot: 9.3.0.cl, 9.5.1-sw
931
+ */
932
+ TrustedAuthTokenCookieless = "AuthServerCookieless",
933
+ /**
934
+ * Use the ThoughtSpot login API to authenticate to the cluster directly.
935
+ *
936
+ * Warning: This feature is primarily intended for developer testing. It is
937
+ * strongly advised not to use this authentication method in production.
938
+ */
939
+ Basic = "Basic"
940
+ }
941
+ export type DOMSelector = string | HTMLElement;
942
+ /**
943
+ * inline customCSS within the {@link CustomisationsInterface}.
944
+ * Use {@link CustomCssVariables} or css rules.
945
+ */
946
+ export interface customCssInterface {
947
+ /**
948
+ * The custom css variables, which can be set.
949
+ * The allowed list is in the CustomCssVariables
950
+ * interface.
951
+ * Or here: https://try-everywhere.thoughtspot.cloud/resources/static/css/custom_variables.css
952
+ */
953
+ variables?: CustomCssVariables;
954
+ /**
955
+ * Can be used to define a custom font face
956
+ * like:
957
+ *
958
+ * @example
959
+ * ```js
960
+ * rules_UNSTABLE?: {
961
+ * "@font-face": {
962
+ * "font-family": "custom-font",
963
+ * "src": url("/path/")
964
+ * };
965
+ * };
966
+ * ```
967
+ *
968
+ * Also, custom css rules outside of variables.
969
+ * @example
970
+ * ```js
971
+ * rules_UNSTABLE?: {
972
+ * ".thoughtspot_class_name": {
973
+ * "border-radius": "10px",
974
+ * margin: "20px"
975
+ * };
976
+ * };
977
+ * ```
978
+ */
979
+ rules_UNSTABLE?: {
980
+ [selector: string]: {
981
+ [declaration: string]: string;
982
+ };
983
+ };
984
+ }
985
+ /**
986
+ * Styles within the {@link CustomisationsInterface}.
987
+ */
988
+ export interface CustomStyles {
989
+ customCSSUrl?: string;
990
+ customCSS?: customCssInterface;
991
+ }
992
+ /**
993
+ * Configuration to define the customization on the Embedded
994
+ * Thoughtspot components.
995
+ *
996
+ * @example
997
+ * ```js
998
+ * init({
999
+ * // ...
1000
+ * customizations: {
1001
+ * style: {
1002
+ * customCSS: {
1003
+ * variables: {},
1004
+ * rules_UNSTABLE: {}
1005
+ * }
1006
+ * },
1007
+ * content: {
1008
+ * strings: {
1009
+ * 'LIVEBOARDS': 'Dashboards'
1010
+ * }
1011
+ * },
1012
+ * iconSpriteUrl: 'https://my-custom-icon-sprite.svg'
1013
+ * }
1014
+ * })
1015
+ * ```
1016
+ */
1017
+ export interface CustomisationsInterface {
1018
+ style?: CustomStyles;
1019
+ content?: {
1020
+ strings?: Record<string, any>;
1021
+ [key: string]: any;
1022
+ };
1023
+ iconSpriteUrl?: string;
1024
+ }
1025
+ /**
1026
+ * The configuration object for embedding ThoughtSpot content.
1027
+ * It includes the ThoughtSpot hostname or IP address,
1028
+ * the type of authentication, and the authentication endpoint
1029
+ * if a trusted authentication server is used.
1030
+ *
1031
+ * @group Authentication / Init
1032
+ */
1033
+ export interface EmbedConfig {
1034
+ /**
1035
+ * The ThoughtSpot cluster hostname or IP address.
1036
+ */
1037
+ thoughtSpotHost: string;
1038
+ /**
1039
+ * The authentication mechanism to use.
1040
+ */
1041
+ authType: AuthType;
1042
+ /**
1043
+ * [AuthServer] The trusted authentication endpoint to use to get the
1044
+ * authentication token. A GET request is made to the
1045
+ * authentication API endpoint, which returns the token
1046
+ * as a plaintext response. For trusted authentication,
1047
+ * the `authEndpoint` or `getAuthToken` attribute is required.
1048
+ */
1049
+ authEndpoint?: string;
1050
+ /**
1051
+ * [AuthServer] A function that invokes the trusted authentication endpoint
1052
+ * and returns a Promise that resolves to the `auth token` string.
1053
+ * For trusted authentication, the `authEndpoint` or `getAuthToken`
1054
+ * attribute is required.
1055
+ *
1056
+ * It is advisable to fetch a new token inside this method and not
1057
+ * reuse and older issued token, as because when auth expires this is
1058
+ * called again and if it is called with an older token the authentication
1059
+ * will not succeed.
1060
+ */
1061
+ getAuthToken?: () => Promise<string>;
1062
+ /**
1063
+ * [AuthServer / Basic] The user name of the ThoughtSpot user. This
1064
+ * attribute is required for trusted authentication.
1065
+ */
1066
+ username?: string;
1067
+ /**
1068
+ * [Basic] The ThoughtSpot login password corresponding to the user name
1069
+ *
1070
+ * Warning: This feature is primarily intended for developer testing. It is
1071
+ * strongly advised not to use this authentication method in production.
1072
+ */
1073
+ password?: string;
1074
+ /**
1075
+ * [SSO] For SSO Authentication, if `noRedirect` is set to true, it will
1076
+ * open the SAML auth flow in a popup, instead of redirecting browser in
1077
+ * place.
1078
+ *
1079
+ * @default false
1080
+ * @deprecated
1081
+ */
1082
+ noRedirect?: boolean;
1083
+ /**
1084
+ * [SSO] For SSO Authentication, if `inPopup` is set to true, it will open
1085
+ * the SAML auth flow in a popup, instead of redirecting browser in place.
1086
+ *
1087
+ * Need to use this with authTriggerContainer. Or manually trigger
1088
+ * the AuthEvent.TRIGGER_SSO_POPUP event on a user interaction.
1089
+ *
1090
+ * @default false
1091
+ * @version SDK: 1.18.0
1092
+ */
1093
+ inPopup?: boolean;
1094
+ /**
1095
+ * [SSO] For SSO Authentication, one can supply an optional path param,
1096
+ * this will be the path on the host origin where the SAML flow will be
1097
+ * terminated.
1098
+ *
1099
+ * Eg: "/dashboard", "#/foo" [Do not include the host]
1100
+ *
1101
+ * @version SDK: 1.10.2 | 8.2.0.cl, 8.4.1-sw
1102
+ */
1103
+ redirectPath?: string;
1104
+ /** @internal */
1105
+ basepath?: string;
1106
+ /**
1107
+ * Should we encode URL Query Params using base64 encoding which thoughtspot
1108
+ * will generate for embedding. This provides additional security to
1109
+ * thoughtspot clusters against Cross site scripting attacks.
1110
+ *
1111
+ * @default false
1112
+ */
1113
+ shouldEncodeUrlQueryParams?: boolean;
1114
+ /**
1115
+ * Suppress cookie access alert when third party cookies are blocked by the
1116
+ * user's browser. Third party cookie blocking is the default behaviour on
1117
+ * Safari and opt-in for Firefox/Chrome. If you set this to `true`, you are
1118
+ * encouraged to handle `noCookieAccess` event, to show your own treatment
1119
+ * in this case.
1120
+ *
1121
+ * @default false
1122
+ */
1123
+ suppressNoCookieAccessAlert?: boolean;
1124
+ /**
1125
+ * Ignore cookie access alert when third party cookies are blocked by the
1126
+ * user's browser. If you set this to `true`, the embedded iframe behaviour
1127
+ * persist even in case of non logged in user.
1128
+ *
1129
+ * @default false
1130
+ */
1131
+ ignoreNoCookieAccess?: boolean;
1132
+ /**
1133
+ * Re-login when session expires with the previous login options
1134
+ *
1135
+ * @default false
1136
+ */
1137
+ autoLogin?: boolean;
1138
+ /**
1139
+ * Disable redirection to the login page when the embedded session expires
1140
+ * This flag is typically used alongside the combination of auth modes such as {@link
1141
+ * AuthType.AuthServer} and auto login behavior {@link EmbedConfig.autoLogin}
1142
+ *
1143
+ * @version SDK: 1.9.3 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
1144
+ * @default false
1145
+ */
1146
+ disableLoginRedirect?: boolean;
1147
+ /**
1148
+ * This message is displayed on the embed view when the login fails.
1149
+ *
1150
+ * @version SDK: 1.10.1 | ThoughtSpot: 8.2.0.cl, 8.4.1-sw
1151
+ */
1152
+ loginFailedMessage?: string;
1153
+ /**
1154
+ * Calls the prefetch method internally when set to true
1155
+ *
1156
+ * @default false
1157
+ */
1158
+ callPrefetch?: boolean;
1159
+ /**
1160
+ * When there are multiple embeds, queue the render of embed to start
1161
+ * after the previous embed's render is complete. This helps in the load
1162
+ * performance by decreasing the load on the browser.
1163
+ *
1164
+ * @Version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
1165
+ * @default false
1166
+ */
1167
+ queueMultiRenders?: boolean;
1168
+ /**
1169
+ * Dynamic CSS Url to be injected in the loaded application.
1170
+ * You would also need to set `style-src` in the CSP settings.
1171
+ *
1172
+ * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1-sw
1173
+ * @default ''
1174
+ */
1175
+ customCssUrl?: string;
1176
+ /**
1177
+ * [AuthServer|Basic] Detect if 3rd party cookies are enabled by doing an
1178
+ * additional call. This is slower and should be avoided. Listen to the
1179
+ * NO_COOKIE_ACCESS event to handle the situation.
1180
+ *
1181
+ * This is slightly slower than letting the browser handle the cookie check, as it
1182
+ * involves an extra network call.
1183
+ *
1184
+ * @version SDK: 1.10.4 | ThoughtSpot: 8.2.0.cl, 8.4.1-sw
1185
+ */
1186
+ detectCookieAccessSlow?: boolean;
1187
+ /**
1188
+ * Hide beta alert warning message for SearchEmbed.
1189
+ *
1190
+ * @version SDK: 1.12.0 | ThoughtSpot: 8.4.0.cl, 8.4.1-sw*
1191
+ */
1192
+ suppressSearchEmbedBetaWarning?: boolean;
1193
+ /**
1194
+ * Hide beta alert warning message for SageEmbed.
1195
+ *
1196
+ */
1197
+ suppressSageEmbedBetaWarning?: boolean;
1198
+ /**
1199
+ * Custom style params for embed Config.
1200
+ *
1201
+ * @version SDK: 1.17.0 | ThoughtSpot: 8.9.0.cl
1202
+ */
1203
+ customizations?: CustomisationsInterface;
1204
+ /**
1205
+ * For inPopup SAMLRedirect or OIDCRedirect Auth, we need a button which the user
1206
+ * click to trigger the flow. This is the containing element
1207
+ * for that button.
1208
+ *
1209
+ * @example
1210
+ * ```js
1211
+ * init({
1212
+ * authType: AuthType.SAMLRedirect,
1213
+ * inPopup: true,
1214
+ * authTriggerContainer: '#auth-trigger-container'
1215
+ * })
1216
+ * ```
1217
+ * @version SDK: 1.17.0 | ThoughtSpot: *
1218
+ */
1219
+ authTriggerContainer?: string | HTMLElement;
1220
+ /**
1221
+ * Specify that we want to use the AuthEvent.TRIGGER_SSO_POPUP event to trigger
1222
+ * SAML popup. This is useful when you want to trigger the popup on a custom user
1223
+ * action.
1224
+ *
1225
+ */
1226
+ useEventForSAMLPopup?: boolean;
1227
+ /**
1228
+ * Text to show in the button which triggers the popup auth flow.
1229
+ * Default: "Authorize".
1230
+ *
1231
+ * @version SDK: 1.17.0 | ThoughtSpot: *
1232
+ */
1233
+ authTriggerText?: string;
1234
+ /**
1235
+ * Disable Full App access of Embedded app outside of the iFrame.
1236
+ *
1237
+ * @default true
1238
+ * @version SDK: 1.22.0 | ThoughtSpot: 9.3.0.cl, 9.5.1-sw
1239
+ */
1240
+ blockNonEmbedFullAppAccess?: boolean;
1241
+ /**
1242
+ * Host config incase embedded app is inside TS app itself
1243
+ */
1244
+ hostConfig?: {
1245
+ hostUserGuid: string;
1246
+ hostClusterId: string;
1247
+ hostClusterName: string;
1248
+ };
1249
+ }
1250
+ export interface LayoutConfig {
1251
+ }
1252
+ /**
1253
+ * Embedded iFrame configuration
1254
+ *
1255
+ * @group Embed components
1256
+ */
1257
+ export interface FrameParams {
1258
+ /**
1259
+ * The width of the iFrame (unit is pixels if numeric).
1260
+ */
1261
+ width?: number | string;
1262
+ /**
1263
+ * The height of the iFrame (unit is pixels if numeric).
1264
+ */
1265
+ height?: number | string;
1266
+ /**
1267
+ * Set to 'lazy' to enable lazy loading of the embedded TS frame.
1268
+ * This will defer loading of the frame until it comes into the
1269
+ * viewport. This is useful for performance optimization.
1270
+ */
1271
+ loading?: 'lazy' | 'eager' | 'auto';
1272
+ /**
1273
+ * This parameters will be passed on the iframe
1274
+ * as is.
1275
+ */
1276
+ [key: string]: string | number | boolean | undefined;
1277
+ }
1278
+ /**
1279
+ * The configuration object for an embedded view.
1280
+ */
1281
+ export interface ViewConfig {
1282
+ /**
1283
+ * @hidden
1284
+ */
1285
+ layoutConfig?: LayoutConfig;
1286
+ /**
1287
+ * The <b>width</b> and <b>height</b> dimensions to render an embedded
1288
+ * object inside your app. Specify the values in pixels or percentage.
1289
+ */
1290
+ frameParams?: FrameParams;
1291
+ /**
1292
+ * @hidden
1293
+ */
1294
+ theme?: string;
1295
+ /**
1296
+ * @hidden
1297
+ */
1298
+ styleSheet__unstable?: string;
1299
+ /**
1300
+ * The list of actions to disable from the primary menu, more menu
1301
+ * (...), and the contextual menu. These actions will be disabled
1302
+ * for the user.
1303
+ * Use this to disable actions.
1304
+ *
1305
+ * @example
1306
+ * ```js
1307
+ * const embed = new LiveboardEmbed('#embed', {
1308
+ * ... // other liveboard view config
1309
+ * disabledActions: [Action.Download, Action.Save]
1310
+ * });
1311
+ * ```
1312
+ */
1313
+ disabledActions?: Action[];
1314
+ /**
1315
+ * The tooltip to display for disabled actions.
1316
+ */
1317
+ disabledActionReason?: string;
1318
+ /**
1319
+ * The list of actions to hide from the embedded.
1320
+ * This actions will be hidden from the user.
1321
+ * Use this to hide an action.
1322
+ *
1323
+ * @example
1324
+ * ```js
1325
+ * const embed = new LiveboardEmbed('#embed', {
1326
+ * ... // other liveboard view config
1327
+ * hiddenActions: [Action.Download, Action.Export]
1328
+ * });
1329
+ * ```
1330
+ * @important
1331
+ */
1332
+ hiddenActions?: Action[];
1333
+ /**
1334
+ * The list of actions to display from the primary menu, more menu
1335
+ * (...), and the contextual menu. These will be only actions that
1336
+ * are visible to the user.
1337
+ * Use this to hide all actions except the ones you want to show.
1338
+ *
1339
+ * Use either this or hiddenActions.
1340
+ *
1341
+ * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1-sw
1342
+ * @important
1343
+ */
1344
+ visibleActions?: Action[];
1345
+ /**
1346
+ * Show alert messages and toast messages in the embedded view.
1347
+ *
1348
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
1349
+ */
1350
+ showAlerts?: boolean;
1351
+ /**
1352
+ * The list of runtime filters to apply to a search answer,
1353
+ * visualization, or Liveboard.
1354
+ */
1355
+ runtimeFilters?: RuntimeFilter[];
1356
+ /**
1357
+ * The locale/language to use for the embedded view.
1358
+ *
1359
+ * @version SDK: 1.9.4 | ThoughtSpot 8.1.0.cl, 8.4.1-sw
1360
+ */
1361
+ locale?: string;
1362
+ /**
1363
+ * This is an object (key/val) of override flags which will be applied
1364
+ * to the internal embedded object. This can be used to add any
1365
+ * URL flag.
1366
+ * Warning: This option is for advanced use only and is used internally
1367
+ * to control embed behavior in non-regular ways. We do not publish the
1368
+ * list of supported keys and values associated with each.
1369
+ *
1370
+ * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
1371
+ */
1372
+ additionalFlags?: {
1373
+ [key: string]: string | number | boolean;
1374
+ };
1375
+ /**
1376
+ * Dynamic CSSUrl and customCSS to be injected in the loaded application.
1377
+ * You would also need to set `style-src` in the CSP settings.
1378
+ *
1379
+ * @version SDK: 1.17.2 | ThoughtSpot: 8.4.1-sw, 8.4.0.cl
1380
+ * @default ''
1381
+ */
1382
+ customizations?: CustomisationsInterface;
1383
+ /**
1384
+ * Insert as a sibling of the target container, instead of appending to a
1385
+ * child inside it.
1386
+ */
1387
+ insertAsSibling?: boolean;
1388
+ /**
1389
+ * flag to set ContextMenu Trigger to either left or right click.
1390
+ *
1391
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
1392
+ */
1393
+ contextMenuTrigger?: ContextMenuTriggerOptions;
1394
+ /**
1395
+ * flag to override openNew tab context menu link
1396
+ *
1397
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
1398
+ */
1399
+ linkOverride?: boolean;
1400
+ /**
1401
+ * flag to enable insert into slides action
1402
+ *
1403
+ * @hidden
1404
+ * @private
1405
+ */
1406
+ insertInToSlide?: boolean;
1407
+ /**
1408
+ * Use a pre-rendered iframe from a pool of pre-rendered iframes
1409
+ * if available and matches the configuration.
1410
+ *
1411
+ * @version SDK: 1.22.0
1412
+ * @hidden
1413
+ *
1414
+ * See [docs]() on how to create a prerender pool.
1415
+ */
1416
+ usePrerenderedIfAvailable?: boolean;
1417
+ /**
1418
+ * Boolean to exclude runtimeFilters in the URL
1419
+ *
1420
+ * @default false
1421
+ * @hidden
1422
+ */
1423
+ excludeRuntimeFiltersfromURL?: boolean;
1424
+ }
1425
+ /**
1426
+ * MessagePayload: Embed event payload: message type, data and status (start/end)
1427
+ *
1428
+ * @group Events
1429
+ */
1430
+ export type MessagePayload = {
1431
+ type: string;
1432
+ data: any;
1433
+ status?: string;
1434
+ };
1435
+ /**
1436
+ * MessageOptions: By Providing options, getting specific event start / end based on
1437
+ * option
1438
+ *
1439
+ * @group Events
1440
+ */
1441
+ export type MessageOptions = {
1442
+ /**
1443
+ * A boolean value indicating that start status events of this type
1444
+ * will be dispatched
1445
+ */
1446
+ start?: boolean;
1447
+ };
1448
+ /**
1449
+ * MessageCallback: Embed event message callback
1450
+ *
1451
+ * @group Events
1452
+ */
1453
+ export type MessageCallback = (payload: MessagePayload,
1454
+ /**
1455
+ * responder: Message callback function triggered when embed event
1456
+ * initiated
1457
+ */
1458
+ responder?: (data: any) => void) => void;
1459
+ /**
1460
+ * MessageCallbackObj: contains message options & callback function
1461
+ */
1462
+ export type MessageCallbackObj = {
1463
+ /**
1464
+ * options: It contains start, A boolean value indicating that start
1465
+ * status events of this type will be dispatched
1466
+ */
1467
+ options: MessageOptions;
1468
+ callback: MessageCallback;
1469
+ };
1470
+ export type GenericCallbackFn = (...args: any[]) => any;
1471
+ export type QueryParams = {
1472
+ [key: string]: string;
1473
+ };
1474
+ /**
1475
+ * A map of the supported runtime filter operations
1476
+ */
1477
+ export enum RuntimeFilterOp {
1478
+ /**
1479
+ * Equals
1480
+ */
1481
+ EQ = "EQ",
1482
+ /**
1483
+ * Does not equal
1484
+ */
1485
+ NE = "NE",
1486
+ /**
1487
+ * Less than
1488
+ */
1489
+ LT = "LT",
1490
+ /**
1491
+ * Less than or equal to
1492
+ */
1493
+ LE = "LE",
1494
+ /**
1495
+ * Greater than
1496
+ */
1497
+ GT = "GT",
1498
+ /**
1499
+ * Greater than or equal to
1500
+ */
1501
+ GE = "GE",
1502
+ /**
1503
+ * Contains
1504
+ */
1505
+ CONTAINS = "CONTAINS",
1506
+ /**
1507
+ * Begins with
1508
+ */
1509
+ BEGINS_WITH = "BEGINS_WITH",
1510
+ /**
1511
+ * Ends with
1512
+ */
1513
+ ENDS_WITH = "ENDS_WITH",
1514
+ /**
1515
+ * Between, inclusive of higher value
1516
+ */
1517
+ BW_INC_MAX = "BW_INC_MAX",
1518
+ /**
1519
+ * Between, inclusive of lower value
1520
+ */
1521
+ BW_INC_MIN = "BW_INC_MIN",
1522
+ /**
1523
+ * Between, inclusive of both higher and lower value
1524
+ */
1525
+ BW_INC = "BW_INC",
1526
+ /**
1527
+ * Between, non-inclusive
1528
+ */
1529
+ BW = "BW",
1530
+ /**
1531
+ * Is included in this list of values
1532
+ */
1533
+ IN = "IN"
1534
+ }
1535
+ /**
1536
+ * A filter that can be applied to ThoughtSpot answers, Liveboards, or
1537
+ * visualizations at runtime.
1538
+ */
1539
+ export interface RuntimeFilter {
1540
+ /**
1541
+ * The name of the column to filter on (case-sensitive)
1542
+ */
1543
+ columnName: string;
1544
+ /**
1545
+ * The operator to apply
1546
+ */
1547
+ operator: RuntimeFilterOp;
1548
+ /**
1549
+ * The list of operands. Some operators like EQ, LE accept
1550
+ * a single operand, whereas other operators like BW and IN accept multiple
1551
+ * operands.
1552
+ */
1553
+ values: (number | boolean | string)[];
1554
+ }
1555
+ /**
1556
+ * Event types emitted by the embedded ThoughtSpot application.
1557
+ *
1558
+ * To add an event listener use the corresponding
1559
+ * {@link LiveboardEmbed.on} or {@link AppEmbed.on} or {@link SearchEmbed.on} method.
1560
+ *
1561
+ * @example
1562
+ * ```js
1563
+ * import { EmbedEvent } from '@thoughtspot/visual-embed-sdk';
1564
+ * // Or
1565
+ * // const { EmbedEvent } = window.tsembed;
1566
+ *
1567
+ * // create the liveboard embed.
1568
+ *
1569
+ * liveboardEmbed.on(EmbedEvent.Drilldown, (drilldown) => {
1570
+ * console.log('Drilldown event', drilldown);
1571
+ * }));
1572
+ * ```
1573
+ * @group Events
1574
+ */
1575
+ export enum EmbedEvent {
1576
+ /**
1577
+ * Rendering has initialized.
1578
+ *
1579
+ * @returns timestamp - The timestamp when the event was generated.
1580
+ */
1581
+ Init = "init",
1582
+ /**
1583
+ * Authentication has either succeeded or failed.
1584
+ *
1585
+ * @returns isLoggedIn - A Boolean specifying whether authentication was successful.
1586
+ */
1587
+ AuthInit = "authInit",
1588
+ /**
1589
+ * The embed object container has loaded.
1590
+ *
1591
+ * @returns timestamp - The timestamp when the event was generated.
1592
+ */
1593
+ Load = "load",
1594
+ /**
1595
+ * Data pertaining to answer or Liveboard is received
1596
+ *
1597
+ * @return data - The answer or Liveboard data
1598
+ * @important
1599
+ */
1600
+ Data = "data",
1601
+ /**
1602
+ * Search/answer/Liveboard filters have been applied/updated by the user.
1603
+ *
1604
+ * @hidden
1605
+ */
1606
+ FiltersChanged = "filtersChanged",
1607
+ /**
1608
+ * Search query has been updated by the user.
1609
+ */
1610
+ QueryChanged = "queryChanged",
1611
+ /**
1612
+ * A drill down operation has been performed.
1613
+ *
1614
+ * @returns additionalFilters - Any additional filters applied
1615
+ * @returns drillDownColumns - The columns on which drill down was performed
1616
+ * @returns nonFilteredColumns - The columns that were not filtered
1617
+ */
1618
+ Drilldown = "drillDown",
1619
+ /**
1620
+ * One or more data sources have been selected.
1621
+ *
1622
+ * @returns dataSourceIds - the list of data sources
1623
+ */
1624
+ DataSourceSelected = "dataSourceSelected",
1625
+ /**
1626
+ * One or more data columns have been selected.
1627
+ *
1628
+ * @returns columnIds - the list of columns
1629
+ * @version SDK: 1.10.0 | ThoughtSpot: 8.2.0.cl, 8.4.1-sw
1630
+ */
1631
+ AddRemoveColumns = "addRemoveColumns",
1632
+ /**
1633
+ * A custom action has been triggered
1634
+ *
1635
+ * @returns actionId - The id of the custom action
1636
+ * @returns data - The answer or Liveboard data
1637
+ */
1638
+ CustomAction = "customAction",
1639
+ /**
1640
+ * Listen to double clicks on a visualization
1641
+ *
1642
+ * @return ContextMenuInputPoints - data point that is double clicked
1643
+ * @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
1644
+ */
1645
+ VizPointDoubleClick = "vizPointDoubleClick",
1646
+ /**
1647
+ * Listen to clicks on a visualization in a liveboard or Search result.
1648
+ *
1649
+ * @example
1650
+ * ```js
1651
+ * embed.on(ThoughtSpotEmbed.Event.VizPointClick, ({data}) => {
1652
+ * console.log(
1653
+ * data.vizId, // viz id
1654
+ * data.clickedPoint.selectedAttributes[0].value,
1655
+ * data.clickedPoint.selectedAttributes[0].column.name,
1656
+ * data.clickedPoint.selectedMeasures[0].value,
1657
+ * data.clickedPoint.selectedMeasures[0].column.name,
1658
+ * )
1659
+ * });
1660
+ * ```
1661
+ * @return viz, clickedPoint - metadata about point that is clicked
1662
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
1663
+ * @important
1664
+ */
1665
+ VizPointClick = "vizPointClick",
1666
+ /**
1667
+ * An error has occurred.
1668
+ *
1669
+ * @returns error - An error object or message
1670
+ */
1671
+ Error = "Error",
1672
+ /**
1673
+ * The embedded object has sent an alert
1674
+ *
1675
+ * @returns alert - An alert object
1676
+ */
1677
+ Alert = "alert",
1678
+ /**
1679
+ * The ThoughtSpot auth session has expired.
1680
+ */
1681
+ AuthExpire = "ThoughtspotAuthExpired",
1682
+ /**
1683
+ * ThoughtSpot failed to validate the auth session.
1684
+ *
1685
+ * @hidden
1686
+ */
1687
+ AuthFailure = "ThoughtspotAuthFailure",
1688
+ /**
1689
+ * ThoughtSpot failed to validate the auth session.
1690
+ *
1691
+ * @hidden
1692
+ */
1693
+ AuthLogout = "ThoughtspotAuthLogout",
1694
+ /**
1695
+ * The height of the embedded Liveboard or visualization has been computed.
1696
+ *
1697
+ * @returns data - The height of the embedded Liveboard or visualization
1698
+ * @hidden
1699
+ */
1700
+ EmbedHeight = "EMBED_HEIGHT",
1701
+ /**
1702
+ * The center of visible iframe viewport is calculated.
1703
+ *
1704
+ * @returns data - The center of the visible Iframe viewport.
1705
+ * @hidden
1706
+ */
1707
+ EmbedIframeCenter = "EmbedIframeCenter",
1708
+ /**
1709
+ * Emitted when the "Get Data" button in Search Bar embed
1710
+ * is clicked.
1711
+ *
1712
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.0-sw
1713
+ */
1714
+ GetDataClick = "getDataClick",
1715
+ /**
1716
+ * Detects the route change.
1717
+ */
1718
+ RouteChange = "ROUTE_CHANGE",
1719
+ /**
1720
+ * The v1 event type for Data
1721
+ *
1722
+ * @hidden
1723
+ */
1724
+ V1Data = "exportVizDataToParent",
1725
+ /**
1726
+ * Emitted when the embed does not have cookie access. This
1727
+ * happens on Safari where third-party cookies are blocked by default.
1728
+ *
1729
+ * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 7.2.1
1730
+ */
1731
+ NoCookieAccess = "noCookieAccess",
1732
+ /**
1733
+ * Emitted when SAML is complete
1734
+ *
1735
+ * @private
1736
+ * @hidden
1737
+ */
1738
+ SAMLComplete = "samlComplete",
1739
+ /**
1740
+ * Emitted when any modal is opened in the app
1741
+ *
1742
+ * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1-sw
1743
+ */
1744
+ DialogOpen = "dialog-open",
1745
+ /**
1746
+ * Emitted when any modal is closed in the app
1747
+ *
1748
+ * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1-sw
1749
+ */
1750
+ DialogClose = "dialog-close",
1751
+ /**
1752
+ * Emitted when the Liveboard shell loads.
1753
+ * You can use this event as a hook to trigger
1754
+ * other events on the rendered Liveboard.
1755
+ *
1756
+ * @version SDK: 1.9.1 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
1757
+ */
1758
+ LiveboardRendered = "PinboardRendered",
1759
+ /**
1760
+ * This can be used to register an event listener which
1761
+ * is triggered on all events.
1762
+ *
1763
+ * @Version SDK: 1.10.0 | ThoughtSpot: 8.2.0.cl, 8.4.1-sw
1764
+ */
1765
+ ALL = "*",
1766
+ /**
1767
+ * Emitted when answer is saved in the app
1768
+ *
1769
+ * @Version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
1770
+ */
1771
+ Save = "save",
1772
+ /**
1773
+ * Emitted when the download action is triggered on an answer
1774
+ *
1775
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
1776
+ */
1777
+ Download = "download",
1778
+ /**
1779
+ * Emitted when the download action is triggered on an answer
1780
+ *
1781
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.0-sw
1782
+ */
1783
+ DownloadAsPng = "downloadAsPng",
1784
+ /**
1785
+ * Emitted when the Download as PDF action is triggered on an answer
1786
+ *
1787
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
1788
+ */
1789
+ DownloadAsPdf = "downloadAsPdf",
1790
+ /**
1791
+ * Emitted when the Download as CSV action is triggered on an answer
1792
+ *
1793
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
1794
+ */
1795
+ DownloadAsCsv = "downloadAsCsv",
1796
+ /**
1797
+ * Emitted when the Download as XLSX action is triggered on an answer
1798
+ *
1799
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
1800
+ */
1801
+ DownloadAsXlsx = "downloadAsXlsx",
1802
+ /**
1803
+ * Emitted when an answer is deleted in the app
1804
+ *
1805
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
1806
+ */
1807
+ AnswerDelete = "answerDelete",
1808
+ /**
1809
+ * Emitted when an answer is pinned to a Liveboard
1810
+ *
1811
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
1812
+ */
1813
+ Pin = "pin",
1814
+ /**
1815
+ * Emitted when SpotIQ analysis is triggered
1816
+ *
1817
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
1818
+ */
1819
+ SpotIQAnalyze = "spotIQAnalyze",
1820
+ /**
1821
+ * Emitted when a user shares an object with another user or group
1822
+ *
1823
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
1824
+ */
1825
+ Share = "share",
1826
+ /**
1827
+ * Emitted when a user clicks the Include action to include a specific value or data
1828
+ * on a chart or table
1829
+ *
1830
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
1831
+ */
1832
+ DrillInclude = "context-menu-item-include",
1833
+ /**
1834
+ * Emitted when a user clicks the Exclude action to exclude a specific value or data
1835
+ * on a chart or table
1836
+ *
1837
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
1838
+ */
1839
+ DrillExclude = "context-menu-item-exclude",
1840
+ /**
1841
+ * Emitted when copied column value on the app
1842
+ *
1843
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
1844
+ */
1845
+ CopyToClipboard = "context-menu-item-copy-to-clipboard",
1846
+ /**
1847
+ * Emitted when a user clicks the Update TML action
1848
+ *
1849
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
1850
+ */
1851
+ UpdateTML = "updateTSL",
1852
+ /**
1853
+ * Emitted when a user clicks the Edit TML action
1854
+ *
1855
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
1856
+ */
1857
+ EditTML = "editTSL",
1858
+ /**
1859
+ * Emitted when ExportTML trigger in answer on the app
1860
+ *
1861
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
1862
+ */
1863
+ ExportTML = "exportTSL",
1864
+ /**
1865
+ * Emitted when an answer is saved as a view
1866
+ *
1867
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
1868
+ */
1869
+ SaveAsView = "saveAsView",
1870
+ /**
1871
+ * Emitted when copy of existing answer on the app
1872
+ *
1873
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
1874
+ */
1875
+ CopyAEdit = "copyAEdit",
1876
+ /**
1877
+ * Emitted when a user clicks Show underlying data on an answe
1878
+ *
1879
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
1880
+ */
1881
+ ShowUnderlyingData = "showUnderlyingData",
1882
+ /**
1883
+ * Emitted when an answer is switched to a chart or table view
1884
+ *
1885
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
1886
+ */
1887
+ AnswerChartSwitcher = "answerChartSwitcher",
1888
+ /**
1889
+ * Internal event to communicate the initial settings back to the TS APP
1890
+ *
1891
+ * @hidden
1892
+ */
1893
+ APP_INIT = "appInit",
1894
+ /**
1895
+ * Emitted when a user clicks Show Liveboard details on a Liveboard
1896
+ *
1897
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
1898
+ */
1899
+ LiveboardInfo = "pinboardInfo",
1900
+ /**
1901
+ * Emitted when a user clicks on the Favorite icon on a Liveboard
1902
+ *
1903
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
1904
+ */
1905
+ AddToFavorites = "addToFavorites",
1906
+ /**
1907
+ * Emitted when a user clicks Schedule on a Liveboard
1908
+ *
1909
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
1910
+ */
1911
+ Schedule = "subscription",
1912
+ /**
1913
+ * Emitted when a user clicks Edit on a Liveboard or visualization
1914
+ *
1915
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
1916
+ */
1917
+ Edit = "edit",
1918
+ /**
1919
+ * Emitted when a user clicks Make a copy on a Liveboard
1920
+ *
1921
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
1922
+ */
1923
+ MakeACopy = "makeACopy",
1924
+ /**
1925
+ * Emitted when a user clicks Present on a Liveboard or visualization
1926
+ *
1927
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
1928
+ */
1929
+ Present = "present",
1930
+ /**
1931
+ * Emitted when a user clicks Delete on a Liveboard
1932
+ *
1933
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
1934
+ */
1935
+ Delete = "delete",
1936
+ /**
1937
+ * Emitted when a user clicks Manage schedules on a Liveboard
1938
+ *
1939
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
1940
+ */
1941
+ SchedulesList = "schedule-list",
1942
+ /**
1943
+ * Emitted when a user clicks Cancel in edit mode on a Liveboard
1944
+ *
1945
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
1946
+ */
1947
+ Cancel = "cancel",
1948
+ /**
1949
+ * Emitted when a user clicks Explore on a visualization
1950
+ *
1951
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
1952
+ */
1953
+ Explore = "explore",
1954
+ /**
1955
+ * Emitted when a user clicks Copy link action on a visualization
1956
+ *
1957
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
1958
+ */
1959
+ CopyLink = "embedDocument",
1960
+ /**
1961
+ * Emitted when a user interacts with cross filters on a visualization or liveboard
1962
+ *
1963
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
1964
+ */
1965
+ CrossFilterChanged = "cross-filter-changed",
1966
+ /**
1967
+ * Emitted when a user right clicks on a visualization (chart or table)
1968
+ *
1969
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
1970
+ */
1971
+ VizPointRightClick = "vizPointRightClick",
1972
+ /**
1973
+ * Emitted when a user clicks on Insert to slide on a visualization
1974
+ *
1975
+ * @hidden
1976
+ */
1977
+ InsertIntoSlide = "insertInToSlide"
1978
+ }
1979
+ /**
1980
+ * Event types that can be triggered by the host application
1981
+ * to the embedded ThoughtSpot app
1982
+ *
1983
+ * To trigger an event use the corresponding
1984
+ * {@link LiveboardEmbed.trigger} or {@link AppEmbed.trigger} or {@link
1985
+ * SearchEmbed.trigger} method.
1986
+ *
1987
+ * @example
1988
+ * ```js
1989
+ * import { HostEvent } from '@thoughtspot/visual-embed-sdk';
1990
+ * // Or
1991
+ * // const { HostEvent } = window.tsembed;
1992
+ *
1993
+ * // create the liveboard embed.
1994
+ *
1995
+ * liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
1996
+ * { columnName: 'state, operator: RuntimeFilterOp.EQ, values: ['california']}
1997
+ * ]);
1998
+ * ```
1999
+ * @group Events
2000
+ */
2001
+ export enum HostEvent {
2002
+ /**
2003
+ * Trigger a search
2004
+ *
2005
+ * @param - dataSourceIds - The data source GUID to Search on
2006
+ * - Although an array, only a single source
2007
+ * is supported at this time.
2008
+ * @param - searchQuery - The search query
2009
+ * @param - execute - execute the existing / updated query
2010
+ * @example
2011
+ * ```js
2012
+ * searchEmbed.trigger(HostEvent.Search, {
2013
+ * searchQuery: "[sales] by [item type],
2014
+ * dataSources: ["cd252e5c-b552-49a8-821d-3eadaa049cca"]
2015
+ * execute: true
2016
+ * })
2017
+ * ```
2018
+ */
2019
+ Search = "search",
2020
+ /**
2021
+ * Trigger a drill on certain points by certain column
2022
+ *
2023
+ * @param - points - an object containing selectedPoints/clickedPoints
2024
+ * eg. { selectedPoints: []}
2025
+ * @param - columnGuid - a string guid of the column to drill by. This is optional,
2026
+ * if not provided it will auto drill by the configured
2027
+ * column.
2028
+ * @example
2029
+ * ```js
2030
+ * searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
2031
+ * console.log(payload);
2032
+ * const clickedPoint = payload.data.clickedPoint;
2033
+ * const selectedPoint = payload.data.selectedPoints;
2034
+ * console.log('>>> called', clickedPoint);
2035
+ * searchEmbed.trigger(HostEvent.DrillDown, {
2036
+ * points: {
2037
+ * clickedPoint,
2038
+ * selectedPoints: selectedPoint
2039
+ * },
2040
+ * autoDrillDown: true,
2041
+ * });
2042
+ * })
2043
+ * ```
2044
+ * @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
2045
+ */
2046
+ DrillDown = "triggerDrillDown",
2047
+ /**
2048
+ * Apply filters
2049
+ *
2050
+ * @hidden
2051
+ */
2052
+ Filter = "filter",
2053
+ /**
2054
+ * Reload the answer or visualization
2055
+ *
2056
+ * @hidden
2057
+ */
2058
+ Reload = "reload",
2059
+ /**
2060
+ * Set the visible visualizations on a Liveboard.
2061
+ *
2062
+ * @param - an array of ids of visualizations to show, the ids not passed
2063
+ * will be hidden.
2064
+ * @example
2065
+ * ```js
2066
+ * liveboardEmbed.trigger(HostEvent.SetVisibleVizs, [
2067
+ * '730496d6-6903-4601-937e-2c691821af3c',
2068
+ * 'd547ec54-2a37-4516-a222-2b06719af726'])
2069
+ * ```
2070
+ * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1-sw
2071
+ */
2072
+ SetVisibleVizs = "SetPinboardVisibleVizs",
2073
+ /**
2074
+ * Update the runtime filters. The runtime filters passed here are extended
2075
+ * on to the existing runtime filters if they exist.
2076
+ *
2077
+ * @param - {@link RuntimeFilter}[] an array of {@link RuntimeFilter} Types.
2078
+ * @example
2079
+ * ```js
2080
+ * liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
2081
+ * {columnName: "state",operator: RuntimeFilterOp.EQ,values: ["michigan"]},
2082
+ * {columnName: "item type",operator: RuntimeFilterOp.EQ,values: ["Jackets"]}
2083
+ * ])
2084
+ * ```
2085
+ * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
2086
+ * @important
2087
+ */
2088
+ UpdateRuntimeFilters = "UpdateRuntimeFilters",
2089
+ /**
2090
+ * Navigate to a specific page in App embed without any reload.
2091
+ * This is the same as calling `appEmbed.navigateToPage(path, true)`
2092
+ *
2093
+ * @param - path - the path to navigate to (can be a number[1/-1] to go forward/back)
2094
+ * @example
2095
+ * ```js
2096
+ * appEmbed.navigateToPage(-1)
2097
+ * ```
2098
+ * @version SDK: 1.12.0 | ThoughtSpot 8.4.0.cl, 8.4.1-sw
2099
+ */
2100
+ Navigate = "Navigate",
2101
+ /**
2102
+ * Opens the filter panel for a particular column.
2103
+ * Works with Search embed.
2104
+ *
2105
+ * @param - { columnId: string,
2106
+ * name: string,
2107
+ * type: INT64/CHAR/DATE,
2108
+ * dataType: ATTRIBUTE/MEASURE }
2109
+ * @example
2110
+ * ```js
2111
+ * searchEmbed.trigger(HostEvent.OpenFilter,
2112
+ * { columnId: '123', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE' })
2113
+ * ```
2114
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
2115
+ */
2116
+ OpenFilter = "openFilter",
2117
+ /**
2118
+ * Adds the columns to the current Search.
2119
+ *
2120
+ * @param - { columnIds: string[] }
2121
+ * @example
2122
+ * ```js
2123
+ * searchEmbed.trigger(HostEvent.AddColumns, { columnIds: ['123', '456'] })
2124
+ * ```
2125
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
2126
+ */
2127
+ AddColumns = "addColumns",
2128
+ /**
2129
+ * Removes a column from the current Search.
2130
+ *
2131
+ * @param - { columnId: string }
2132
+ * @example
2133
+ * ```js
2134
+ * searchEmbed.trigger(HostEvent.RemoveColumn, { columnId: '123' })
2135
+ * ```
2136
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
2137
+ */
2138
+ RemoveColumn = "removeColumn",
2139
+ /**
2140
+ * Gets the current pinboard content.
2141
+ *
2142
+ * @example
2143
+ * ```js
2144
+ * liveboardEmbed.trigger(HostEvent.getExportRequestForCurrentPinboard)
2145
+ * ```
2146
+ * @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl, 8.8.1-sw
2147
+ */
2148
+ getExportRequestForCurrentPinboard = "getExportRequestForCurrentPinboard",
2149
+ /**
2150
+ * Triggers the Pin action on an embedded object
2151
+ *
2152
+ * @param - incase of Liveboard embed, takes in an object with vizId as a key
2153
+ * can be left empty for search and visualization embeds
2154
+ * @example
2155
+ * ```js
2156
+ * liveboardEmbed.trigger(HostEvent.Pin, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
2157
+ * vizEmbed.trigger(HostEvent.Pin)
2158
+ * searchEmbed.trigger(HostEvent.Pin)
2159
+ * ```
2160
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
2161
+ */
2162
+ Pin = "pin",
2163
+ /**
2164
+ * Triggers the Show Liveboard details action on a Liveboard
2165
+ *
2166
+ * @example
2167
+ * ```js
2168
+ * liveboardEmbed.trigger(HostEvent.LiveboardInfo)
2169
+ * ```
2170
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
2171
+ */
2172
+ LiveboardInfo = "pinboardInfo",
2173
+ /**
2174
+ * Triggers the Schedule action on a Liveboard
2175
+ *
2176
+ * @example
2177
+ * ```js
2178
+ * liveboardEmbed.trigger(HostEvent.Schedule)
2179
+ * ```
2180
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
2181
+ */
2182
+ Schedule = "subscription",
2183
+ /**
2184
+ * Triggers the Manage schedule action on a Liveboard
2185
+ *
2186
+ * @example
2187
+ * ```js
2188
+ * liveboardEmbed.trigger(HostEvent.ScheduleList)
2189
+ * ```
2190
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
2191
+ */
2192
+ SchedulesList = "schedule-list",
2193
+ /**
2194
+ * Triggers the Export TML action on a Liveboard
2195
+ *
2196
+ * @example
2197
+ * ```js
2198
+ * liveboardEmbed.trigger(HostEvent.ExportTML)
2199
+ * ```
2200
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
2201
+ */
2202
+ ExportTML = "exportTSL",
2203
+ /**
2204
+ * Triggers the Edit TML action on a Liveboard
2205
+ *
2206
+ * @example
2207
+ * ```js
2208
+ * liveboardEmbed.trigger(HostEvent.EditTML)
2209
+ * ```
2210
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
2211
+ */
2212
+ EditTML = "editTSL",
2213
+ /**
2214
+ * Triggers the Update TML action on a Liveboard
2215
+ *
2216
+ * @example
2217
+ * ```js
2218
+ * liveboardEmbed.trigger(HostEvent.UpdateTML)
2219
+ * ```
2220
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
2221
+ */
2222
+ UpdateTML = "updateTSL",
2223
+ /**
2224
+ * Triggers the Download PDF action on a Liveboard
2225
+ *
2226
+ * @example
2227
+ * ```js
2228
+ * liveboardEmbed.trigger(HostEvent.DownloadAsPdf)
2229
+ * ```
2230
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
2231
+ */
2232
+ DownloadAsPdf = "downloadAsPdf",
2233
+ /**
2234
+ * Triggers the Make a copy action on a Liveboard, search or visualization
2235
+ *
2236
+ * @example
2237
+ * ```js
2238
+ * liveboardEmbed.trigger(HostEvent.MakeACopy, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
2239
+ * vizEmbed.trigger(HostEvent.MakeACopy)
2240
+ * searchEmbed.trigger(HostEvent.MakeACopy)
2241
+ * ```
2242
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
2243
+ */
2244
+ MakeACopy = "makeACopy",
2245
+ /**
2246
+ * Triggers the Delete action on a Liveboard
2247
+ *
2248
+ * @example
2249
+ * ```js
2250
+ * appEmbed.trigger(HostEvent.Remove)
2251
+ * ```
2252
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
2253
+ */
2254
+ Remove = "delete",
2255
+ /**
2256
+ * Triggers the Explore action on a visualization
2257
+ *
2258
+ * @param - an object with vizId as a key
2259
+ * @example
2260
+ * ```js
2261
+ * liveboardEmbed.trigger(HostEvent.Explore, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
2262
+ * ```
2263
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
2264
+ */
2265
+ Explore = "explore",
2266
+ /**
2267
+ * Triggers the Create alert action on a visualization
2268
+ *
2269
+ * @param - an object with vizId as a key
2270
+ * @example
2271
+ * ```js
2272
+ * liveboardEmbed.trigger(HostEvent.CreateMonitor {
2273
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
2274
+ * })
2275
+ * ```
2276
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
2277
+ */
2278
+ CreateMonitor = "createMonitor",
2279
+ /**
2280
+ * Triggers the Manage alert action on a visualization
2281
+ *
2282
+ * @param - an object with vizId as a key
2283
+ * @example
2284
+ * ```js
2285
+ * liveboardEmbed.trigger(HostEvent.ManageMonitor, {
2286
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
2287
+ * })
2288
+ * ```
2289
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
2290
+ */
2291
+ ManageMonitor = "manageMonitor",
2292
+ /**
2293
+ * Triggers the Edit action on a Liveboard or visualization
2294
+ *
2295
+ * @param - object - to trigger the action for a specfic visualization
2296
+ * in Liveboard embed, pass in vizId as a key
2297
+ * @example
2298
+ * ```js
2299
+ * liveboardEmbed.trigger(HostEvent.Edit)
2300
+ *
2301
+ * liveboardEmbed.trigger(HostEvent.Edit, {vizId:
2302
+ * '730496d6-6903-4601-937e-2c691821af3c'})
2303
+ *
2304
+ * vizEmbed.trigger((HostEvent.Edit)
2305
+ * ```
2306
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
2307
+ */
2308
+ Edit = "edit",
2309
+ /**
2310
+ * Triggers the Copy link action on a Liveboard or visualization
2311
+ *
2312
+ * @param - object - to trigger the action for a s
2313
+ * pecfic visualization in Liveboard embed, pass in vizId as a key
2314
+ * @example
2315
+ * ```js
2316
+ * liveboardEmbed.trigger(HostEvent.CopyLink)
2317
+ * liveboardEmbed.trigger(HostEvent.CopyLink, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
2318
+ * vizEmbed.trigger((HostEvent.CopyLink)
2319
+ * ```
2320
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
2321
+ */
2322
+ CopyLink = "embedDocument",
2323
+ /**
2324
+ * Triggers the Present action on a Liveboard or visualization
2325
+ *
2326
+ * @param - object - to trigger the action for a specfic visualization
2327
+ * in Liveboard embed, pass in vizId as a key
2328
+ * @example
2329
+ * ```js
2330
+ * liveboardEmbed.trigger(HostEvent.Present)
2331
+ * liveboardEmbed.trigger(HostEvent.Present, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
2332
+ * vizEmbed.trigger((HostEvent.Present)
2333
+ * ```
2334
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
2335
+ */
2336
+ Present = "present",
2337
+ /**
2338
+ * Get TML for the current search.
2339
+ *
2340
+ * @example
2341
+ * ```js
2342
+ * searchEmbed.trigger(HostEvent.GetTML).then((tml) => {
2343
+ * console.log(
2344
+ * tml.search_query // TML representation of the search query
2345
+ * );
2346
+ * })
2347
+ * ```
2348
+ * @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1-sw
2349
+ * @important
2350
+ */
2351
+ GetTML = "getTML",
2352
+ /**
2353
+ * Triggers the ShowUnderlyingData action on visualization or search
2354
+ *
2355
+ * @param - an object with vizId as a key
2356
+ * @example
2357
+ * ```js
2358
+ * liveboardEmbed.trigger(HostEvent.ShowUnderlyingData, {vizId:
2359
+ * '730496d6-6903-4601-937e-2c691821af3c'})
2360
+ *
2361
+ * vizEmbed.trigger(HostEvent.ShowUnderlyingData)
2362
+ *
2363
+ * searchEmbed.trigger(HostEvent.ShowUnderlyingData)
2364
+ * ```
2365
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
2366
+ */
2367
+ ShowUnderlyingData = "showUnderlyingData",
2368
+ /**
2369
+ * Triggers the Delete action on visualization or search
2370
+ *
2371
+ * @param - incase of Liveboard embed, takes in an object with vizId as a key
2372
+ * can be left empty for search and visualization embeds
2373
+ * @example
2374
+ * ```js
2375
+ * liveboardEmbed.trigger(HostEvent.Delete, {vizId:
2376
+ * '730496d6-6903-4601-937e-2c691821af3c'})
2377
+ *
2378
+ * vizEmbed.trigger(HostEvent.Delete)
2379
+ *
2380
+ * searchEmbed.trigger(HostEvent.Delete)
2381
+ * ```
2382
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
2383
+ */
2384
+ Delete = "onDeleteAnswer",
2385
+ /**
2386
+ * Triggers the SpotIQAnalyze action on visualization or search
2387
+ *
2388
+ * @param - incase of Liveboard embed, takes in an object with vizId as a key
2389
+ * can be left empty for search and visualization embeds
2390
+ * @example
2391
+ * ```js
2392
+ * liveboardEmbed.trigger(HostEvent.SpotIQAnalyze, {vizId:
2393
+ * '730496d6-6903-4601-937e-2c691821af3c'})
2394
+ *
2395
+ * vizEmbed.trigger(HostEvent.SpotIQAnalyze)
2396
+ *
2397
+ * searchEmbed.trigger(HostEvent.SpotIQAnalyze)
2398
+ * ```
2399
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
2400
+ */
2401
+ SpotIQAnalyze = "spotIQAnalyze",
2402
+ /**
2403
+ * Triggers the Download action on visualization or search when Displaymode is Chart
2404
+ *
2405
+ * @example
2406
+ * ```js
2407
+ * liveboardEmbed.trigger(HostEvent.Download, {vizId:
2408
+ * '730496d6-6903-4601-937e-2c691821af3c'})
2409
+ *
2410
+ * vizEmbed.trigger(HostEvent.Download)
2411
+ *
2412
+ * searchEmbed.trigger(HostEvent.Download)
2413
+ * ```
2414
+ * @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1-sw ,Use {@link DownloadAsPng}
2415
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
2416
+ */
2417
+ Download = "downloadAsPng",
2418
+ /**
2419
+ * Triggers the Download action on visualization or search when Displaymode is Chart
2420
+ *
2421
+ * @example
2422
+ * ```js
2423
+ * liveboardEmbed.trigger(HostEvent.DownloadAsPng,
2424
+ * {vizId:'730496d6-6903-4601-937e-2c691821af3c'})
2425
+ *
2426
+ * vizEmbed.trigger(HostEvent.DownloadAsPng)
2427
+ *
2428
+ * searchEmbed.trigger(HostEvent.DownloadAsPng)
2429
+ * ```
2430
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1-sw
2431
+ */
2432
+ DownloadAsPng = "downloadAsPng",
2433
+ /**
2434
+ * Triggers the downloadAsCSV action on visualization or search
2435
+ *
2436
+ * @example
2437
+ * ```js
2438
+ * liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId:
2439
+ * '730496d6-6903-4601-937e-2c691821af3c'})
2440
+ *
2441
+ * vizEmbed.trigger(HostEvent.DownloadAsCsv)
2442
+ *
2443
+ * searchEmbed.trigger(HostEvent.DownloadAsCsv)
2444
+ * ```
2445
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
2446
+ */
2447
+ DownloadAsCsv = "downloadAsCSV",
2448
+ /**
2449
+ * Triggers the downloadAsXLSX action on visualization or search
2450
+ *
2451
+ * @example
2452
+ * ```js
2453
+ * liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId:
2454
+ * '730496d6-6903-4601-937e-2c691821af3c'})
2455
+ *
2456
+ * vizEmbed.trigger(HostEvent.DownloadAsXlsx)
2457
+ *
2458
+ * searchEmbed.trigger(HostEvent.DownloadAsXlsx)
2459
+ * ```
2460
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
2461
+ */
2462
+ DownloadAsXlsx = "downloadAsXLSX",
2463
+ /**
2464
+ * Triggers the Share action on a liveboard or answer
2465
+ *
2466
+ * @example
2467
+ * ```js
2468
+ * liveboardEmbed.trigger(HostEvent.Share)
2469
+ *
2470
+ * searchEmbed.trigger(HostEvent.Share)
2471
+ * ```
2472
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
2473
+ */
2474
+ Share = "share",
2475
+ /**
2476
+ * Trigger the Save action on a liveboard or answer
2477
+ *
2478
+ * @example
2479
+ * ```js
2480
+ * liveboardEmbed.trigger(HostEvent.Save)
2481
+ *
2482
+ * searchEmbed.trigger(HostEvent.Save)
2483
+ * ```
2484
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
2485
+ */
2486
+ Save = "save",
2487
+ /**
2488
+ * Triggers the SyncToSheets action on visualization
2489
+ *
2490
+ * @param - an object with vizId as a key
2491
+ * @example
2492
+ * ```js
2493
+ * liveboardEmbed.trigger(HostEvent.SyncToSheets, {vizId:
2494
+ * '730496d6-6903-4601-937e-2c691821af3c'})
2495
+ *
2496
+ * vizEmbed.trigger(HostEvent.SyncToSheets)
2497
+ * ```
2498
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
2499
+ */
2500
+ SyncToSheets = "sync-to-sheets",
2501
+ /**
2502
+ * Triggers the SyncToOtherApps action on visualization
2503
+ *
2504
+ * @param - an object with vizId as a key
2505
+ * @example
2506
+ * ```js
2507
+ * liveboardEmbed.trigger(HostEvent.SyncToOtherApps, {vizId:
2508
+ * '730496d6-6903-4601-937e-2c691821af3c'})
2509
+ *
2510
+ * vizEmbed.trigger(HostEvent.SyncToOtherApps)
2511
+ * ```
2512
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
2513
+ */
2514
+ SyncToOtherApps = "sync-to-other-apps",
2515
+ /**
2516
+ * Triggers the ManagePipelines action on visualization
2517
+ *
2518
+ * @param - an object with vizId as a key
2519
+ * @example
2520
+ * ```js
2521
+ * liveboardEmbed.trigger(HostEvent.ManagePipelines, {vizId:
2522
+ * '730496d6-6903-4601-937e-2c691821af3c'})
2523
+ *
2524
+ * vizEmbed.trigger(HostEvent.ManagePipelines)
2525
+ * ```
2526
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
2527
+ */
2528
+ ManagePipelines = "manage-pipeline",
2529
+ /**
2530
+ * Triggers the Reset search in answer
2531
+ *
2532
+ * @example
2533
+ * ```js
2534
+ * searchEmbed.trigger(HostEvent.ResetSearch)
2535
+ * ```
2536
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.0.1-sw
2537
+ */
2538
+ ResetSearch = "resetSearch"
2539
+ }
2540
+ /**
2541
+ * The different visual modes that the data sources panel within
2542
+ * search could appear in, i.e., hidden, collapsed, or expanded.
2543
+ */
2544
+ export enum DataSourceVisualMode {
2545
+ /**
2546
+ * Data source panel is hidden.
2547
+ */
2548
+ Hidden = "hide",
2549
+ /**
2550
+ * Data source panel is collapsed, but the user can manually expand it.
2551
+ */
2552
+ Collapsed = "collapse",
2553
+ /**
2554
+ * Data source panel is expanded, but the user can manually collapse it.
2555
+ */
2556
+ Expanded = "expand"
2557
+ }
2558
+ /**
2559
+ * The query params passed down to the embedded ThoughtSpot app
2560
+ * containing configuration and/or visual information.
2561
+ */
2562
+ export enum Param {
2563
+ EmbedApp = "embedApp",
2564
+ DataSources = "dataSources",
2565
+ DataSourceMode = "dataSourceMode",
2566
+ DisableActions = "disableAction",
2567
+ DisableActionReason = "disableHint",
2568
+ ForceTable = "forceTable",
2569
+ preventLiveboardFilterRemoval = "preventPinboardFilterRemoval",
2570
+ SearchQuery = "searchQuery",
2571
+ HideActions = "hideAction",
2572
+ HideObjects = "hideObjects",
2573
+ HostAppUrl = "hostAppUrl",
2574
+ EnableVizTransformations = "enableVizTransform",
2575
+ EnableSearchAssist = "enableSearchAssist",
2576
+ HideResult = "hideResult",
2577
+ UseLastSelectedDataSource = "useLastSelectedSources",
2578
+ Tag = "tag",
2579
+ searchTokenString = "searchTokenString",
2580
+ executeSearch = "executeSearch",
2581
+ fullHeight = "isFullHeightPinboard",
2582
+ livedBoardEmbed = "isLiveboardEmbed",
2583
+ searchEmbed = "isSearchEmbed",
2584
+ vizEmbed = "isVizEmbed",
2585
+ Version = "sdkVersion",
2586
+ ViewPortHeight = "viewPortHeight",
2587
+ ViewPortWidth = "viewPortWidth",
2588
+ VisibleActions = "visibleAction",
2589
+ CustomCSSUrl = "customCssUrl",
2590
+ DisableLoginRedirect = "disableLoginRedirect",
2591
+ visibleVizs = "pinboardVisibleVizs",
2592
+ LiveboardV2Enabled = "isPinboardV2Enabled",
2593
+ ShowAlerts = "showAlerts",
2594
+ Locale = "locale",
2595
+ CustomStyle = "customStyle",
2596
+ ForceSAMLAutoRedirect = "forceSAMLAutoRedirect",
2597
+ AuthType = "authType",
2598
+ IconSpriteUrl = "iconSprite",
2599
+ cookieless = "cookieless",
2600
+ ContextMenuTrigger = "isContextMenuEnabledOnLeftClick",
2601
+ LinkOverride = "linkOverride",
2602
+ blockNonEmbedFullAppAccess = "blockNonEmbedFullAppAccess",
2603
+ ShowInsertToSlide = "insertInToSlide",
2604
+ PrimaryNavHidden = "primaryNavHidden",
2605
+ HideProfleAndHelp = "profileAndHelpInNavBarHidden",
2606
+ HideApplicationSwitcher = "applicationSwitcherHidden",
2607
+ HideOrgSwitcher = "orgSwitcherHidden",
2608
+ IsSageEmbed = "isSageEmbed",
2609
+ HideWorksheetSelector = "hideWorksheetSelector",
2610
+ DisableWorksheetChange = "disableWorksheetChange",
2611
+ HideEurekaResults = "hideEurekaResults",
2612
+ HideEurekaSuggestions = "hideEurekaSuggestions"
2613
+ }
2614
+ /**
2615
+ * The list of actions that can be performed on visual ThoughtSpot
2616
+ * entities, such as answers and Liveboards.
2617
+ *
2618
+ * This enum is used to specify the actions that could be disabled,
2619
+ * hidden or made visible.
2620
+ *
2621
+ * @example
2622
+ * ```js
2623
+ * const embed = new LiveboardEmbed('#embed-container', {
2624
+ * ... // other options
2625
+ * visibleActions: [Action.Save, Action.Explore],
2626
+ * disableActions: [Action.Save],
2627
+ * hiddenActions: [Action.Download], // Set either this or visibleActions
2628
+ * })
2629
+ * ```
2630
+ */
2631
+ export enum Action {
2632
+ Save = "save",
2633
+ /**
2634
+ * @hidden
2635
+ */
2636
+ Update = "update",
2637
+ /**
2638
+ * @hidden
2639
+ */
2640
+ SaveUntitled = "saveUntitled",
2641
+ SaveAsView = "saveAsView",
2642
+ MakeACopy = "makeACopy",
2643
+ EditACopy = "editACopy",
2644
+ CopyLink = "embedDocument",
2645
+ /**
2646
+ * @hidden
2647
+ */
2648
+ ResetLayout = "resetLayout",
2649
+ Schedule = "subscription",
2650
+ SchedulesList = "schedule-list",
2651
+ Share = "share",
2652
+ AddFilter = "addFilter",
2653
+ ConfigureFilter = "configureFilter",
2654
+ CollapseDataSources = "collapseDataSources",
2655
+ ChooseDataSources = "chooseDataSources",
2656
+ AddFormula = "addFormula",
2657
+ AddParameter = "addParameter",
2658
+ /**
2659
+ * @hidden
2660
+ */
2661
+ SearchOnTop = "searchOnTop",
2662
+ SpotIQAnalyze = "spotIQAnalyze",
2663
+ /**
2664
+ * @hidden
2665
+ */
2666
+ ExplainInsight = "explainInsight",
2667
+ /**
2668
+ * @hidden
2669
+ */
2670
+ SpotIQFollow = "spotIQFollow",
2671
+ ShareViz = "shareViz",
2672
+ /**
2673
+ * @hidden
2674
+ */
2675
+ ReplaySearch = "replaySearch",
2676
+ ShowUnderlyingData = "showUnderlyingData",
2677
+ Download = "download",
2678
+ DownloadAsPng = "downloadAsPng",
2679
+ DownloadAsPdf = "downloadAsPdf",
2680
+ DownloadAsCsv = "downloadAsCSV",
2681
+ DownloadAsXlsx = "downloadAsXLSX",
2682
+ /**
2683
+ * @hidden
2684
+ */
2685
+ DownloadTrace = "downloadTrace",
2686
+ ExportTML = "exportTSL",
2687
+ ImportTML = "importTSL",
2688
+ UpdateTML = "updateTSL",
2689
+ EditTML = "editTSL",
2690
+ Present = "present",
2691
+ ToggleSize = "toggleSize",
2692
+ Edit = "edit",
2693
+ EditTitle = "editTitle",
2694
+ Remove = "delete",
2695
+ /**
2696
+ * @hidden
2697
+ */
2698
+ Ungroup = "ungroup",
2699
+ /**
2700
+ * @hidden
2701
+ */
2702
+ Describe = "describe",
2703
+ /**
2704
+ * @hidden
2705
+ */
2706
+ Relate = "relate",
2707
+ /**
2708
+ * @hidden
2709
+ */
2710
+ CustomizeHeadlines = "customizeHeadlines",
2711
+ /**
2712
+ * @hidden
2713
+ */
2714
+ PinboardInfo = "pinboardInfo",
2715
+ LiveboardInfo = "pinboardInfo",
2716
+ /**
2717
+ * @hidden
2718
+ */
2719
+ SendAnswerFeedback = "sendFeedback",
2720
+ /**
2721
+ * @hidden
2722
+ */
2723
+ DownloadEmbraceQueries = "downloadEmbraceQueries",
2724
+ /**
2725
+ * Pin action.
2726
+ */
2727
+ Pin = "pin",
2728
+ /**
2729
+ * @hidden
2730
+ */
2731
+ AnalysisInfo = "analysisInfo",
2732
+ Subscription = "subscription",
2733
+ /**
2734
+ * Explore action.
2735
+ */
2736
+ Explore = "explore",
2737
+ DrillInclude = "context-menu-item-include",
2738
+ DrillExclude = "context-menu-item-exclude",
2739
+ CopyToClipboard = "context-menu-item-copy-to-clipboard",
2740
+ CopyAndEdit = "context-menu-item-copy-and-edit",
2741
+ /**
2742
+ * @hidden
2743
+ */
2744
+ DrillEdit = "context-menu-item-edit",
2745
+ EditMeasure = "context-menu-item-edit-measure",
2746
+ Separator = "context-menu-item-separator",
2747
+ DrillDown = "DRILL",
2748
+ RequestAccess = "requestAccess",
2749
+ QueryDetailsButtons = "queryDetailsButtons",
2750
+ /**
2751
+ * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
2752
+ */
2753
+ AnswerDelete = "onDeleteAnswer",
2754
+ /**
2755
+ * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
2756
+ */
2757
+ AnswerChartSwitcher = "answerChartSwitcher",
2758
+ /**
2759
+ * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
2760
+ */
2761
+ AddToFavorites = "addToFavorites",
2762
+ /**
2763
+ * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
2764
+ */
2765
+ EditDetails = "editDetails",
2766
+ /**
2767
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
2768
+ */
2769
+ CreateMonitor = "createMonitor",
2770
+ /**
2771
+ * @version SDK: 1.11.1 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
2772
+ */
2773
+ ReportError = "reportError",
2774
+ SyncToSheets = "sync-to-sheets",
2775
+ SyncToOtherApps = "sync-to-other-apps",
2776
+ ManagePipelines = "manage-pipeline",
2777
+ /**
2778
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
2779
+ */
2780
+ CrossFilter = "context-menu-item-cross-filter",
2781
+ /**
2782
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
2783
+ */
2784
+ RemoveCrossFilter = "context-menu-item-remove-cross-filter",
2785
+ /**
2786
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
2787
+ */
2788
+ AxisMenuAggregate = "axisMenuAggregate",
2789
+ /**
2790
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
2791
+ */
2792
+ AxisMenuTimeBucket = "axisMenuTimeBucket",
2793
+ /**
2794
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
2795
+ */
2796
+ AxisMenuFilter = "axisMenuFilter",
2797
+ /**
2798
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
2799
+ */
2800
+ AxisMenuConditionalFormat = "axisMenuConditionalFormat",
2801
+ /**
2802
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
2803
+ */
2804
+ AxisMenuSort = "axisMenuSort",
2805
+ /**
2806
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
2807
+ */
2808
+ AxisMenuGroup = "axisMenuGroup",
2809
+ /**
2810
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
2811
+ */
2812
+ AxisMenuPosition = "axisMenuPosition",
2813
+ /**
2814
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
2815
+ */
2816
+ AxisMenuRename = "axisMenuRename",
2817
+ /**
2818
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
2819
+ */
2820
+ AxisMenuEdit = "axisMenuEdit",
2821
+ /**
2822
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
2823
+ */
2824
+ AxisMenuNumberFormat = "axisMenuNumberFormat",
2825
+ /**
2826
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
2827
+ */
2828
+ AxisMenuTextWrapping = "axisMenuTextWrapping",
2829
+ /**
2830
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
2831
+ */
2832
+ AxisMenuRemove = "axisMenuRemove",
2833
+ /**
2834
+ * @hidden
2835
+ */
2836
+ InsertInToSlide = "insertInToSlide",
2837
+ /**
2838
+ * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
2839
+ */
2840
+ RenameModalTitleDescription = "renameModalTitleDescription"
2841
+ }
2842
+ export interface SessionInterface {
2843
+ sessionId: string;
2844
+ genNo: number;
2845
+ acSession: {
2846
+ sessionId: string;
2847
+ genNo: number;
2848
+ };
2849
+ }
2850
+ export enum OperationType {
2851
+ GetChartWithData = "GetChartWithData",
2852
+ GetTableWithHeadlineData = "GetTableWithHeadlineData"
2853
+ }
2854
+ export interface AnswerServiceType {
2855
+ getAnswer?: (offset: number, batchSize: number) => any;
2856
+ }
2857
+ export enum PrefetchFeatures {
2858
+ FullApp = "FullApp",
2859
+ SearchEmbed = "SearchEmbed",
2860
+ LiveboardEmbed = "LiveboardEmbed",
2861
+ VizEmbed = "VizEmbed"
2862
+ }
2863
+ /**
2864
+ * Enum for options to change context trigger
2865
+ */
2866
+ export enum ContextMenuTriggerOptions {
2867
+ LEFT_CLICK = "left-click",
2868
+ RIGHT_CLICK = "right-click"
2869
+ }
2870
+ }
2871
+
2872
+ declare module '@thoughtspot/visual-embed-sdk/css-variables' {
2873
+ /**
2874
+ * The list of customization css variables. These
2875
+ * are the only allowed variables possible.
2876
+ */
2877
+ export interface CustomCssVariables {
2878
+ /**
2879
+ * Background color of the Liveboard, visualization, Search, and Answer pages.
2880
+ */
2881
+ '--ts-var-root-background'?: string;
2882
+ /**
2883
+ * Color of the text on application pages.
2884
+ */
2885
+ '--ts-var-root-color'?: string;
2886
+ /**
2887
+ * Font type for the text on application pages.
2888
+ */
2889
+ '--ts-var-root-font-family'?: string;
2890
+ /**
2891
+ * Text transformation specification for UI elements in the app.
2892
+ */
2893
+ '--ts-var-root-text-transform'?: string;
2894
+ /**
2895
+ * Background color of the top navigation panel.
2896
+ */
2897
+ '--ts-var-nav-background'?: string;
2898
+ /**
2899
+ * Font color of the top navigation panel.
2900
+ */
2901
+ '--ts-var-nav-color'?: string;
2902
+ /**
2903
+ * Background color of the *Search data* button.
2904
+ */
2905
+ '--ts-var-search-data-button-background'?: string;
2906
+ /**
2907
+ * Color of the text on the *Search data* button.
2908
+ */
2909
+ '--ts-var-search-data-button-font-color'?: string;
2910
+ /**
2911
+ * Font of the text on the *Search data* button.
2912
+ */
2913
+ '--ts-var-search-data-button-font-family'?: string;
2914
+ /**
2915
+ * Font color of the text in the Search bar.
2916
+ */
2917
+ '--ts-var-search-bar-text-font-color'?: string;
2918
+ /**
2919
+ * Font of the text in the Search bar.
2920
+ */
2921
+ '--ts-var-search-bar-text-font-family'?: string;
2922
+ /**
2923
+ * Font style of the text in the Search bar.
2924
+ */
2925
+ '--ts-var-search-bar-text-font-style'?: string;
2926
+ /**
2927
+ * Background color of the search bar.
2928
+ */
2929
+ '--ts-var-search-bar-background'?: string;
2930
+ /**
2931
+ * Background color of the search suggestions panel.
2932
+ */
2933
+ '--ts-var-search-auto-complete-background'?: string;
2934
+ /**
2935
+ * Background color of the navigation panel that allows you to undo, redo, and reset
2936
+ * search operations.
2937
+ */
2938
+ '--ts-var-search-navigation-button-background'?: string;
2939
+ /**
2940
+ * Background color of the navigation help text that appears at the bottom of the
2941
+ * search suggestions panel.
2942
+ */
2943
+ '--ts-var-search-bar-navigation-help-text-background'?: string;
2944
+ /**
2945
+ * Background color of the search suggestion block on hover.
2946
+ */
2947
+ '--ts-var-search-bar-auto-complete-hover-background'?: string;
2948
+ /**
2949
+ * Font color of the text in the search suggestion panel.
2950
+ */
2951
+ '--ts-var-search-auto-complete-font-color'?: string;
2952
+ /**
2953
+ * Font color of the sub-text that appears below the keyword in the search suggestion
2954
+ * panel.
2955
+ */
2956
+ '--ts-var-search-auto-complete-subtext-font-color'?: string;
2957
+ /**
2958
+ * Background color of the data panel.
2959
+ */
2960
+ '--ts-var-answer-data-panel-background-color'?: string;
2961
+ /**
2962
+ * Background color of the vertical panel on the right side of the Answer page, which
2963
+ * includes the options to edit charts and tables.
2964
+ */
2965
+ '--ts-var-answer-edit-panel-background-color'?: string;
2966
+ /**
2967
+ * Background color of the chart switcher on search results and Answer pages.
2968
+ */
2969
+ '--ts-var-answer-view-table-chart-switcher-background'?: string;
2970
+ /**
2971
+ * Background color of the currently selected chart type in the chart switcher.
2972
+ */
2973
+ '--ts-var-answer-view-table-chart-switcher-active-background'?: string;
2974
+ /**
2975
+ * Border-radius of main buttons.
2976
+ * For example, the *Search data* button in the top navigation panel.
2977
+ */
2978
+ '--ts-var-button-border-radius'?: string;
2979
+ /**
2980
+ * Border-radius of small buttons such as secondary buttons.
2981
+ * For example, share and favorite buttons.
2982
+ */
2983
+ '--ts-var-button--icon-border-radius'?: string;
2984
+ /**
2985
+ * Font color of the text on primary buttons. For example, the primary buttons on
2986
+ * Liveboard*, Answer, *Data* workspace, *SpotIQ*, or *Home* page.
2987
+ */
2988
+ '--ts-var-button--primary-color'?: string;
2989
+ /**
2990
+ * Font family specification for the text on primary buttons.
2991
+ */
2992
+ '--ts-var-button--primary--font-family'?: string;
2993
+ /**
2994
+ * Background color of the primary buttons. For example, the primary buttons such as
2995
+ * Pin* and *Save*.
2996
+ */
2997
+ '---ts-var-button--primary-background'?: string;
2998
+ /**
2999
+ * Background color of the primary buttons on hover.
3000
+ */
3001
+ '--ts-var-button--primary--hover-background'?: string;
3002
+ /**
3003
+ * Font color of the text on the secondary buttons.
3004
+ */
3005
+ '--ts-var-button--secondary-color'?: string;
3006
+ /**
3007
+ * Font family specification for the text on the secondary buttons.
3008
+ */
3009
+ '--ts-var-button--secondary--font-family'?: string;
3010
+ /**
3011
+ * Background color of the secondary buttons.
3012
+ */
3013
+ '--ts-var-button--secondary-background'?: string;
3014
+ /**
3015
+ * Background color of the secondary button on hover.
3016
+ */
3017
+ '--ts-var-button--secondary--hover-background'?: string;
3018
+ /**
3019
+ * Font color of the tertiary button. For example, the *Undo*, *Redo*, and *Reset*
3020
+ * buttons on the *Search* page.
3021
+ */
3022
+ '--ts-var-button--tertiary-color'?: string;
3023
+ /**
3024
+ * Background color of the tertiary button.
3025
+ */
3026
+ '--ts-var-button--tertiary-background'?: string;
3027
+ /**
3028
+ * Background color of the tertiary button when a user hovers over these buttons.
3029
+ */
3030
+ '--ts-var-button--tertiary--hover-background'?: string;
3031
+ /**
3032
+ * Font color of the title text of a visualization or Answer.
3033
+ */
3034
+ '--ts-var-viz-title-color'?: string;
3035
+ /**
3036
+ * Font family specification for the title text of a visualization/Answer.
3037
+ */
3038
+ '--ts-var-viz-title-font-family'?: string;
3039
+ /**
3040
+ * Text transformation specification for visualization and Answer titles.
3041
+ */
3042
+ '--ts-var-viz-title-text-transform'?: string;
3043
+ /**
3044
+ * Font color of the description text and subtitle of a visualization or Answer.
3045
+ */
3046
+ '--ts-var-viz-description-color'?: string;
3047
+ /**
3048
+ * Font family specification of description text and subtitle of a visualization or
3049
+ * Answer.
3050
+ */
3051
+ '--ts-var-viz-description-font-family'?: string;
3052
+ /**
3053
+ * Text transformation specification for description text and subtitle of a
3054
+ * visualization or Answer.
3055
+ */
3056
+ '--ts-var-viz-description-text-transform'?: string;
3057
+ /**
3058
+ * Border-radius for the visualization tiles and header panel on a Liveboard.
3059
+ */
3060
+ '--ts-var-viz-border-radius'?: string;
3061
+ /**
3062
+ * Box shadow property for the visualization tiles and header panel on a Liveboard.
3063
+ */
3064
+ '--ts-var-viz-box-shadow'?: string;
3065
+ /**
3066
+ * Background color of the visualization tiles and header panel on a Liveboard.
3067
+ */
3068
+ '--ts-var-viz-background'?: string;
3069
+ /**
3070
+ * Background color of the legend on a visualization or Answer.
3071
+ */
3072
+ '--ts-var-viz-legend-hover-background'?: string;
3073
+ /**
3074
+ * Background color of the selected chart type on the chart selection widget.
3075
+ */
3076
+ '--ts-var-answer-chart-select-background'?: string;
3077
+ /**
3078
+ * Background color of the chart type element when a user hovers over a chart type on
3079
+ * the chart selection widget.
3080
+ */
3081
+ '--ts-var-answer-chart-hover-background'?: string;
3082
+ /**
3083
+ * Border-radius of filter chips.
3084
+ */
3085
+ '--ts-var-chip-border-radius'?: string;
3086
+ /**
3087
+ * Shadow effect for filter chips.
3088
+ */
3089
+ '--ts-var-chip-box-shadow'?: string;
3090
+ /**
3091
+ * Background color of filter chips.
3092
+ */
3093
+ '--ts-var-chip-background'?: string;
3094
+ /**
3095
+ * Font color of the filter label when a filter chip is selected
3096
+ */
3097
+ '--ts-var-chip--active-color'?: string;
3098
+ /**
3099
+ * Background color of the filter chips when selected.
3100
+ */
3101
+ '--ts-var-chip--active-background'?: string;
3102
+ /**
3103
+ * Font color of the text on filter chips when hovered over.
3104
+ */
3105
+ '--ts-var-chip--hover-color'?: string;
3106
+ /**
3107
+ * Background color of filter chips on hover.
3108
+ */
3109
+ '--ts-var-chip--hover-background'?: string;
3110
+ /**
3111
+ * Font color of the text on filter chips.
3112
+ */
3113
+ '--ts-var-chip-color'?: string;
3114
+ /**
3115
+ * Font family specification for the text on filter chips.
3116
+ */
3117
+ '--ts-var-chip-title-font-family'?: string;
3118
+ /**
3119
+ * Font color of axis title on charts.
3120
+ */
3121
+ '--ts-var-axis-title-color'?: string;
3122
+ /**
3123
+ * Font family specification for the X and Y axis title text.
3124
+ */
3125
+ '--ts-var-axis-title-font-family'?: string;
3126
+ /**
3127
+ * Font color of the X and Y axis labels.
3128
+ */
3129
+ '--ts-var-axis-data-label-color'?: string;
3130
+ /**
3131
+ * Font family specification for X and Y axis labels.
3132
+ */
3133
+ '--ts-var-axis-data-label-font-family'?: string;
3134
+ /**
3135
+ * Font color of the menu items.
3136
+ */
3137
+ '--ts-var-menu-color'?: string;
3138
+ /**
3139
+ * Background color of menu panels.
3140
+ */
3141
+ '--ts-var-menu-background'?: string;
3142
+ /**
3143
+ * Font family specification for the menu items.
3144
+ */
3145
+ '--ts-var-menu-font-family'?: string;
3146
+ /**
3147
+ * Text capitalization specification for the menu items.
3148
+ */
3149
+ '--ts-var-menu-text-transform'?: string;
3150
+ /**
3151
+ * Background color for menu items on hover.
3152
+ */
3153
+ '--ts-var-menu--hover-background'?: string;
3154
+ /**
3155
+ * Background color of the dialogs.
3156
+ */
3157
+ '--ts-var-dialog-body-background'?: string;
3158
+ /**
3159
+ * Font color of the body text displayed on dialogs.
3160
+ */
3161
+ '--ts-var-dialog-body-color'?: string;
3162
+ /**
3163
+ * Background color of the header text on dialogs.
3164
+ */
3165
+ '--ts-var-dialog-header-background'?: string;
3166
+ /**
3167
+ * Font color of the header text on dialogs.
3168
+ */
3169
+ '--ts-var-dialog-header-color'?: string;
3170
+ /**
3171
+ * Background color of the footer area on dialogs.
3172
+ */
3173
+ '--ts-var-dialog-footer-background'?: string;
3174
+ }
3175
+ }
3176
+
3177
+ declare module '@thoughtspot/visual-embed-sdk/embed/sage' {
3178
+ /**
3179
+ * Copyright (c) 2023
3180
+ *
3181
+ * Embed ThoughtSpot Sage
3182
+ *
3183
+ * @summary TS Sage embed
3184
+ * @author Mourya Balabhadra <mourya.balabhadra@thoughtspot.com>
3185
+ */
3186
+ import { Action, DOMSelector, ViewConfig } from '@thoughtspot/visual-embed-sdk/types';
3187
+ import { V1Embed } from '@thoughtspot/visual-embed-sdk/embed/ts-embed';
3188
+ /**
3189
+ * The configuration attributes for the embedded Natural language search view. Based on
3190
+ * GPT and LLM.
3191
+ *
3192
+ * @group Embed components
3193
+ */
3194
+ export interface SageViewConfig extends ViewConfig {
3195
+ /**
3196
+ * If set to true, object results are shown.
3197
+ */
3198
+ showObjectResults?: boolean;
3199
+ /**
3200
+ * flag to disable changing worksheet. default false.
3201
+ */
3202
+ disableWorksheetChange?: boolean;
3203
+ /**
3204
+ * flag to hide worksheet selector. default false.
3205
+ */
3206
+ hideWorksheetSelector?: boolean;
3207
+ /**
3208
+ * If set to true, the object search suggestions are not shown
3209
+ *
3210
+ */
3211
+ showObjectSuggestions?: boolean;
3212
+ }
3213
+ export const HiddenActionItemByDefaultForSageEmbed: Action[];
3214
+ /**
3215
+ * Embed ThoughtSpot LLM and GPT based natural language search component.
3216
+ *
3217
+ * @group Embed components
3218
+ */
3219
+ export class SageEmbed extends V1Embed {
3220
+ /**
3221
+ * The view configuration for the embedded ThoughtSpot sage.
3222
+ *
3223
+ */
3224
+ protected viewConfig: SageViewConfig;
3225
+ constructor(domSelector: DOMSelector, viewConfig: SageViewConfig);
3226
+ /**
3227
+ * Constructs a map of parameters to be passed on to the
3228
+ * embedded Eureka or Sage search page.
3229
+ *
3230
+ * @returns {string} query string
3231
+ */
3232
+ protected getEmbedParams(): string;
3233
+ /**
3234
+ * Render the embedded ThoughtSpot Sage
3235
+ *
3236
+ * @returns {SageEmbed} Eureka/Sage embed
3237
+ */
3238
+ render(): SageEmbed;
3239
+ }
3240
+ }
3241
+
3242
+ declare module '@thoughtspot/visual-embed-sdk/embed/ts-embed' {
3243
+ /**
3244
+ * Copyright (c) 2022
3245
+ *
3246
+ * Base classes
3247
+ *
3248
+ * @summary Base classes
3249
+ * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
3250
+ */
3251
+ import { DOMSelector, HostEvent, EmbedEvent, MessageCallback, EmbedConfig, MessageOptions, ViewConfig } from '@thoughtspot/visual-embed-sdk/types';
3252
+ /**
3253
+ * Global prefix for all Thoughtspot postHash Params.
3254
+ */
3255
+ export const THOUGHTSPOT_PARAM_PREFIX = "ts-";
3256
+ /**
3257
+ * Base class for embedding v2 experience
3258
+ * Note: the v2 version of ThoughtSpot Blink is built on the new stack:
3259
+ * React+GraphQL
3260
+ */
3261
+ export class TsEmbed {
3262
+ protected isAppInitialized: boolean;
3263
+ /**
3264
+ * A reference to the iframe within which the ThoughtSpot app
3265
+ * will be rendered.
3266
+ */
3267
+ protected iFrame: HTMLIFrameElement;
3268
+ protected viewConfig: ViewConfig;
3269
+ protected embedConfig: EmbedConfig;
3270
+ /**
3271
+ * The ThoughtSpot hostname or IP address
3272
+ */
3273
+ protected thoughtSpotHost: string;
3274
+ protected thoughtSpotV2Base: string;
3275
+ constructor(domSelector: DOMSelector, viewConfig?: ViewConfig);
3276
+ /**
3277
+ * Handles errors within the SDK
3278
+ *
3279
+ * @param error The error message or object
3280
+ */
3281
+ protected handleError(error: string | Record<string, unknown>): void;
3282
+ /**
3283
+ * Constructs the base URL string to load the ThoughtSpot app.
3284
+ *
3285
+ * @param query
3286
+ */
3287
+ protected getEmbedBasePath(query: string): string;
3288
+ /**
3289
+ * Common query params set for all the embed modes.
3290
+ *
3291
+ * @param queryParams
3292
+ * @returns queryParams
3293
+ */
3294
+ protected getBaseQueryParams(queryParams?: {}): {};
3295
+ /**
3296
+ * Constructs the base URL string to load v1 of the ThoughtSpot app.
3297
+ * This is used for embedding Liveboards, visualizations, and full application.
3298
+ *
3299
+ * @param queryString The query string to append to the URL.
3300
+ * @param isAppEmbed A Boolean parameter to specify if you are embedding
3301
+ * the full application.
3302
+ */
3303
+ protected getV1EmbedBasePath(queryString: string): string;
3304
+ protected getEmbedParams(): string;
3305
+ protected getRootIframeSrc(): string;
3306
+ protected createIframeEl(frameSrc: string): HTMLIFrameElement;
3307
+ /**
3308
+ * Renders the embedded ThoughtSpot app in an iframe and sets up
3309
+ * event listeners.
3310
+ *
3311
+ * @param url
3312
+ * @param frameOptions
3313
+ */
3314
+ protected renderIFrame(url: string): Promise<any>;
3315
+ protected insertIntoDOM(child: string | Node): void;
3316
+ /**
3317
+ * Sets the height of the iframe
3318
+ *
3319
+ * @param height The height in pixels
3320
+ */
3321
+ protected setIFrameHeight(height: number | string): void;
3322
+ /**
3323
+ * Executes all registered event handlers for a particular event type
3324
+ *
3325
+ * @param eventType The event type
3326
+ * @param data The payload invoked with the event handler
3327
+ * @param eventPort The event Port for a specific MessageChannel
3328
+ */
3329
+ protected executeCallbacks(eventType: EmbedEvent, data: any, eventPort?: MessagePort | void): void;
3330
+ /**
3331
+ * Returns the ThoughtSpot hostname or IP address.
3332
+ */
3333
+ protected getThoughtSpotHost(): string;
3334
+ /**
3335
+ * Gets the v1 event type (if applicable) for the EmbedEvent type
3336
+ *
3337
+ * @param eventType The v2 event type
3338
+ * @returns The corresponding v1 event type if one exists
3339
+ * or else the v2 event type itself
3340
+ */
3341
+ protected getCompatibleEventType(eventType: EmbedEvent): EmbedEvent;
3342
+ /**
3343
+ * Calculates the iframe center for the current visible viewPort
3344
+ * of iframe using Scroll position of Host App, offsetTop for iframe
3345
+ * in Host app. ViewPort height of the tab.
3346
+ *
3347
+ * @returns iframe Center in visible viewport,
3348
+ * Iframe height,
3349
+ * View port height.
3350
+ */
3351
+ protected getIframeCenter(): {
3352
+ iframeCenter: number;
3353
+ iframeScrolled: number;
3354
+ iframeHeight: number;
3355
+ viewPortHeight: number;
3356
+ iframeVisibleViewPort: number;
3357
+ };
3358
+ /**
3359
+ * Registers an event listener to trigger an alert when the ThoughtSpot app
3360
+ * sends an event of a particular message type to the host application.
3361
+ *
3362
+ * @param messageType The message type
3363
+ * @param callback A callback as a function
3364
+ * @param options The message options
3365
+ * @example
3366
+ * ```js
3367
+ * tsEmbed.on(EmbedEvent.Error, (data) => {
3368
+ * console.error(data);
3369
+ * });
3370
+ * ```
3371
+ * @example
3372
+ * ```js
3373
+ * tsEmbed.on(EmbedEvent.Save, (data) => {
3374
+ * console.log("Answer save clicked", data);
3375
+ * }, {
3376
+ * start: true // This will trigger the callback on start of save
3377
+ * });
3378
+ * ```
3379
+ */
3380
+ on(messageType: EmbedEvent, callback: MessageCallback, options?: MessageOptions): typeof TsEmbed.prototype;
3381
+ /**
3382
+ * Removes an event listener for a particular event type.
3383
+ *
3384
+ * @param messageType The message type
3385
+ * @param callback The callback to remove
3386
+ * @example
3387
+ * ```js
3388
+ * const errorHandler = (data) => { console.error(data); };
3389
+ * tsEmbed.on(EmbedEvent.Error, errorHandler);
3390
+ * tsEmbed.off(EmbedEvent.Error, errorHandler);
3391
+ * ```
3392
+ */
3393
+ off(messageType: EmbedEvent, callback: MessageCallback): typeof TsEmbed.prototype;
3394
+ /**
3395
+ * Triggers an event to the embedded app
3396
+ *
3397
+ * @param messageType The event type
3398
+ * @param data The payload to send with the message
3399
+ */
3400
+ trigger(messageType: HostEvent, data?: any): Promise<any>;
3401
+ /**
3402
+ * Marks the ThoughtSpot object to have been rendered
3403
+ * Needs to be overridden by subclasses to do the actual
3404
+ * rendering of the iframe.
3405
+ *
3406
+ * @param args
3407
+ */
3408
+ render(): TsEmbed;
3409
+ /**
3410
+ * Get the Post Url Params for THOUGHTSPOT from the current
3411
+ * host app URL.
3412
+ * THOUGHTSPOT URL params starts with a prefix "ts-"
3413
+ *
3414
+ * @version SDK: 1.14.0 | ThoughtSpot: 8.4.0.cl, 8.4.1-sw
3415
+ */
3416
+ getThoughtSpotPostUrlParams(): string;
3417
+ /**
3418
+ * Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
3419
+ *
3420
+ * @version SDK: 1.19.1 | ThoughtSpot: *
3421
+ */
3422
+ destroy(): void;
3423
+ getUnderlyingFrameElement(): HTMLIFrameElement;
3424
+ /**
3425
+ * Prerenders a generic instance of the TS component.
3426
+ * This means without the path but with the flags already applied.
3427
+ * This is useful for prerendering the component in the background.
3428
+ *
3429
+ * @version SDK: 1.22.0
3430
+ * @returns
3431
+ */
3432
+ prerenderGeneric(): Promise<any>;
3433
+ }
3434
+ /**
3435
+ * Base class for embedding v1 experience
3436
+ * Note: The v1 version of ThoughtSpot Blink works on the AngularJS stack
3437
+ * which is currently under migration to v2
3438
+ *
3439
+ * @inheritdoc
3440
+ */
3441
+ export class V1Embed extends TsEmbed {
3442
+ protected viewConfig: ViewConfig;
3443
+ constructor(domSelector: DOMSelector, viewConfig: ViewConfig);
3444
+ /**
3445
+ * Render the app in an iframe and set up event handlers
3446
+ *
3447
+ * @param iframeSrc
3448
+ */
3449
+ protected renderV1Embed(iframeSrc: string): any;
3450
+ protected getRootIframeSrc(): string;
3451
+ /**
3452
+ * @inheritdoc
3453
+ * @example
3454
+ * ```js
3455
+ * tsEmbed.on(EmbedEvent.Error, (data) => {
3456
+ * console.error(data);
3457
+ * });
3458
+ * ```
3459
+ * @example
3460
+ * ```js
3461
+ * tsEmbed.on(EmbedEvent.Save, (data) => {
3462
+ * console.log("Answer save clicked", data);
3463
+ * }, {
3464
+ * start: true // This will trigger the callback on start of save
3465
+ * });
3466
+ * ```
3467
+ */
3468
+ on(messageType: EmbedEvent, callback: MessageCallback, options?: MessageOptions): typeof TsEmbed.prototype;
3469
+ }
3470
+ }
3471
+