diff --git a/package-lock.json b/package-lock.json index 9673e28a..e6b1e8b0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@thoughtspot/visual-embed-sdk", - "version": "1.42.1", + "version": "1.42.1-HE2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@thoughtspot/visual-embed-sdk", - "version": "1.42.1", + "version": "1.42.1-HE2", "license": "ThoughtSpot Development Tools End User License Agreement", "dependencies": { "classnames": "^2.3.1", diff --git a/package.json b/package.json index c205d9fd..cbc2bab7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@thoughtspot/visual-embed-sdk", - "version": "1.42.1", + "version": "1.42.1-HE2.0.2", "description": "ThoughtSpot Embed SDK", "module": "lib/src/index.js", "main": "dist/tsembed.js", @@ -57,7 +57,7 @@ "test": "npm run test-sdk", "posttest": "cat ./coverage/sdk/lcov.info | npx coveralls-next", "is-publish-allowed": "node scripts/is-publish-allowed.js", - "prepublishOnly": "npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build", + "prepublishOnly": "npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build", "check-size": "npm run build && size-limit", "publish-dev": "npm publish --tag dev", "publish-prod": "npm publish --tag latest", diff --git a/src/embed/conversation.ts b/src/embed/conversation.ts index 139ba205..0340916a 100644 --- a/src/embed/conversation.ts +++ b/src/embed/conversation.ts @@ -3,6 +3,8 @@ import { ERROR_MESSAGE } from '../errors'; import { Param, BaseViewConfig, RuntimeFilter, RuntimeParameter } from '../types'; import { TsEmbed } from './ts-embed'; import { getQueryParamString, getFilterQuery, getRuntimeParameters } from '../utils'; +import { ContextType } from './hostEventClient/contracts'; +import { PageContextOptions } from 'visual-embed-sdk'; /** * Configuration for search options @@ -280,6 +282,11 @@ export class SpotterEmbed extends TsEmbed { await this.renderIFrame(src); return this; } + + public async getCurrentContext(): Promise { + const context = await super.getCurrentContext(); + return context; + } } /** diff --git a/src/embed/hostEventClient/contracts.ts b/src/embed/hostEventClient/contracts.ts index f82077b7..f6f096a4 100644 --- a/src/embed/hostEventClient/contracts.ts +++ b/src/embed/hostEventClient/contracts.ts @@ -93,7 +93,7 @@ export type HostEventRequest = ? UIPassthroughRequest : any; -export type HostEventResponse = +export type HostEventResponse = HostEventT extends keyof EmbedApiHostEventMapping ? UIPassthroughResponse : any; @@ -101,5 +101,18 @@ export type HostEventResponse = // trigger response and request export type TriggerPayload = PayloadT | HostEventRequest; -export type TriggerResponse = - PayloadT extends HostEventRequest ? HostEventResponse : any; +export type TriggerResponse = + PayloadT extends HostEventRequest ? HostEventResponse : any; + + export enum ContextType { + Search = 'search', + Liveboard = 'liveboard', + Answer = 'answer', + Spotter = 'spotter', + Default = 'default', + } + + export enum PageType { + PAGE = 'page', + DIALOG = 'dialog', + } \ No newline at end of file diff --git a/src/embed/hostEventClient/host-event-client.ts b/src/embed/hostEventClient/host-event-client.ts index a98812ea..c2478ed5 100644 --- a/src/embed/hostEventClient/host-event-client.ts +++ b/src/embed/hostEventClient/host-event-client.ts @@ -8,6 +8,7 @@ import { UIPassthroughResponse, TriggerPayload, TriggerResponse, + ContextType, } from './contracts'; export class HostEventClient { @@ -23,7 +24,7 @@ export class HostEventClient { * @param {any} data Data to send with the host event * @returns {Promise} - the response from the process trigger */ - protected async processTrigger(message: HostEvent, data: any): Promise { + protected async processTrigger(message: HostEvent, data: any, context?: ContextType): Promise { if (!this.iFrame) { throw new Error('Iframe element is not set'); } @@ -34,6 +35,7 @@ export class HostEventClient { message, thoughtspotHost, data, + context, ); } @@ -65,8 +67,9 @@ export class HostEventClient { public async hostEventFallback( hostEvent: HostEvent, data: any, + context?: ContextType, ): Promise { - return this.processTrigger(hostEvent, data); + return this.processTrigger(hostEvent, data, context); } /** @@ -91,7 +94,7 @@ export class HostEventClient { protected async handlePinEvent( payload: HostEventRequest, - ): Promise> { + ): Promise> { if (!payload || !('newVizName' in payload)) { return this.hostEventFallback(HostEvent.Pin, payload); } @@ -132,10 +135,12 @@ export class HostEventClient { public async triggerHostEvent< HostEventT extends HostEvent, PayloadT, + ContextT extends ContextType, >( hostEvent: HostEventT, payload?: TriggerPayload, - ): Promise> { + context?: ContextT, + ): Promise> { switch (hostEvent) { case HostEvent.Pin: return this.handlePinEvent(payload as HostEventRequest) as any; @@ -144,7 +149,7 @@ export class HostEventClient { payload as HostEventRequest, ) as any; default: - return this.hostEventFallback(hostEvent, payload); + return this.hostEventFallback(hostEvent, payload, context); } } } diff --git a/src/embed/liveboard.ts b/src/embed/liveboard.ts index e374f2da..8483fe02 100644 --- a/src/embed/liveboard.ts +++ b/src/embed/liveboard.ts @@ -25,8 +25,9 @@ import { calculateVisibleElementData, getQueryParamString, isUndefined } from '. import { getAuthPromise } from './base'; import { TsEmbed, V1Embed } from './ts-embed'; import { addPreviewStylesIfNotPresent } from '../utils/global-styles'; -import { TriggerPayload, TriggerResponse } from './hostEventClient/contracts'; +import { ContextType, TriggerPayload, TriggerResponse } from './hostEventClient/contracts'; import { logger } from '../utils/logger'; +import { PageContextOptions } from 'visual-embed-sdk'; /** @@ -738,10 +739,11 @@ export class LiveboardEmbed extends V1Embed { * @param {any} data The payload to send with the message * @returns A promise that resolves with the response from the embedded app */ - public trigger( + public trigger( messageType: HostEventT, data: TriggerPayload = ({} as any), - ): Promise> { + context?: ContextT, + ): Promise> { const dataWithVizId: any = data; if (messageType === HostEvent.SetActiveTab) { this.setActiveTab(data as { tabId: string }); @@ -750,7 +752,7 @@ export class LiveboardEmbed extends V1Embed { if (typeof dataWithVizId === 'object' && this.viewConfig.vizId) { dataWithVizId.vizId = this.viewConfig.vizId; } - return super.trigger(messageType, dataWithVizId); + return super.trigger(messageType, dataWithVizId, context); } /** * Destroys the ThoughtSpot embed, and remove any nodes from the DOM. @@ -827,6 +829,11 @@ export class LiveboardEmbed extends V1Embed { return url; } + + public async getCurrentContext(): Promise { + const context = await super.getCurrentContext(); + return context; + } } /** diff --git a/src/embed/sage.ts b/src/embed/sage.ts index 8d4a582c..857c90e0 100644 --- a/src/embed/sage.ts +++ b/src/embed/sage.ts @@ -6,6 +6,7 @@ * @author Mourya Balabhadra */ +import { PageContextOptions } from 'visual-embed-sdk'; import { DOMSelector, Param, BaseViewConfig, SearchLiveboardCommonViewConfig } from '../types'; import { getQueryParamString } from '../utils'; import { V1Embed } from './ts-embed'; @@ -229,4 +230,9 @@ export class SageEmbed extends V1Embed { return this; } + + public async getCurrentContext(): Promise { + const context = await super.getCurrentContext(); + return context; + } } diff --git a/src/embed/search-bar.tsx b/src/embed/search-bar.tsx index bc5f0262..7b034523 100644 --- a/src/embed/search-bar.tsx +++ b/src/embed/search-bar.tsx @@ -2,6 +2,7 @@ import { SearchLiveboardCommonViewConfig, BaseViewConfig, DefaultAppInitData, Pa import { getQueryParamString } from '../utils'; import { TsEmbed } from './ts-embed'; import { SearchOptions } from './search'; +import { PageContextOptions } from 'visual-embed-sdk'; /** * @group Embed components @@ -198,4 +199,9 @@ export class SearchBarEmbed extends TsEmbed { const defaultAppInitData = await super.getAppInitData(); return { ...defaultAppInitData, ...this.getSearchInitData() }; } + + public async getCurrentContext(): Promise { + const context = await super.getCurrentContext(); + return context; + } } diff --git a/src/embed/search.ts b/src/embed/search.ts index 534db212..aae9fe66 100644 --- a/src/embed/search.ts +++ b/src/embed/search.ts @@ -26,6 +26,8 @@ import { ERROR_MESSAGE } from '../errors'; import { getAuthPromise } from './base'; import { getReleaseVersion } from '../auth'; import { getEmbedConfig } from './embedConfig'; +import { PageContextOptions } from 'visual-embed-sdk'; +import { ContextType, PageType } from './hostEventClient/contracts'; /** * Configuration for search options. @@ -536,4 +538,9 @@ export class SearchEmbed extends TsEmbed { }); return this; } + + public async getCurrentContext(): Promise { + const context = await super.getCurrentContext(); + return context; + } } diff --git a/src/embed/ts-embed.ts b/src/embed/ts-embed.ts index 2d380e0a..e9b23454 100644 --- a/src/embed/ts-embed.ts +++ b/src/embed/ts-embed.ts @@ -10,11 +10,13 @@ import isEqual from 'lodash/isEqual'; import isEmpty from 'lodash/isEmpty'; import isObject from 'lodash/isObject'; import { + ContextType, TriggerPayload, TriggerResponse, UIPassthroughArrayResponse, UIPassthroughEvent, UIPassthroughRequest, + PageType, } from './hostEventClient/contracts'; import { logger } from '../utils/logger'; import { getAuthenticationToken } from '../authToken'; @@ -71,6 +73,7 @@ import { getEmbedConfig } from './embedConfig'; import { ERROR_MESSAGE } from '../errors'; import { getPreauthInfo } from '../utils/sessionInfoService'; import { HostEventClient } from './hostEventClient/host-event-client'; +import { PageContextOptions } from '../../visual-embed-sdk'; const { version } = pkgInfo; @@ -1268,10 +1271,11 @@ export class TsEmbed { * @param {any} data The payload to send with the message * @returns A promise that resolves with the response from the embedded app */ - public async trigger( + public async trigger( messageType: HostEventT, data: TriggerPayload = {} as any, - ): Promise> { + context?: ContextT, + ): Promise> { uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`); if (!this.isRendered) { @@ -1294,7 +1298,7 @@ export class TsEmbed { } // send an empty object, this is needed for liveboard default handlers - return this.hostEventClient.triggerHostEvent(messageType, data); + return this.hostEventClient.triggerHostEvent(messageType, data, context); } /** @@ -1336,6 +1340,13 @@ export class TsEmbed { return this.render(); } + public async getCurrentContext(): Promise { + this.executeAfterEmbedContainerLoaded(async () => { + const context = await this.trigger(HostEvent.GetPageContext, {}); + return context; + }); + } + /** * Creates the preRender shell * @param showPreRenderByDefault - Show the preRender after render, hidden by default diff --git a/src/types.ts b/src/types.ts index 5af6ccf0..69e3bcf9 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1835,7 +1835,7 @@ export enum EmbedEvent { */ Load = 'load', /** - * Data pertaining to an Answer or Liveboard is received. + * Data pertaining to an Answer, Liveboard or Spotter visualization is received. * The event payload includes the raw data of the object. * @return data - Answer of Liveboard data * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw @@ -3209,7 +3209,7 @@ export enum HostEvent { * the following parameters: * * @param - * `vizId`- GUID of the saved Answer or visualization to pin to a Liveboard. + * `vizId`- GUID of the saved Answer or Spotter visualization ID to pin to a Liveboard. * Optional when pinning a new chart or table generated from a Search query. * **Required** in Spotter Embed. * @param @@ -3261,10 +3261,16 @@ export enum HostEvent { * ``` * @example * ```js - * const pinResponse = await spotterEmbed.trigger(HostEvent.Pin, { - * vizId:'730496d6-6903-4601-937e-2c691821af3c' - * }); - * ``` + + * // You can use the Data event dispatched on each answer creation to get the vizId and use in Pin host event. + * let latestSpotterVizId = ''; + * spotterEmbed.on(EmbedEvent.Data, (payload) => { + * latestSpotterVizId = payload.data.id; + * }); + * + * spotterEmbed.trigger(HostEvent.Pin, { vizId: latestSpotterVizId }); + * ``` + * * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw */ Pin = 'pin', @@ -3339,10 +3345,15 @@ export enum HostEvent { * ``` * @example * ```js - * spotterEmbed.trigger(HostEvent.DownloadAsPdf, { - * vizId:'730496d6-6903-4601-937e-2c691821af3c' - * }); - * ``` + + * // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsPdf host event. + * let latestSpotterVizId = ''; + * spotterEmbed.on(EmbedEvent.Data, (payload) => { + * latestSpotterVizId = payload.data.id; + * }); + * + * spotterEmbed.trigger(HostEvent.DownloadAsPdf, { vizId: latestSpotterVizId }); + * ``` * * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw */ @@ -3369,10 +3380,14 @@ export enum HostEvent { * ``` * @example * ```js - * const pinResponse = await spotterEmbed.trigger(HostEvent.MakeACopy, { - * vizId:'730496d6-6903-4601-937e-2c691821af3c' - * }); - * ``` + * // You can use the Data event dispatched on each answer creation to get the vizId and use in MakeACopy host event. + * let latestSpotterVizId = ''; + * spotterEmbed.on(EmbedEvent.Data, (payload) => { + * latestSpotterVizId = payload.data.id; + * }); + * + * spotterEmbed.trigger(HostEvent.MakeACopy, { vizId: latestSpotterVizId }); + * ``` * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw */ MakeACopy = 'makeACopy', @@ -3457,15 +3472,7 @@ export enum HostEvent { * ``` * @example * ```js - * const pinResponse = await spotterEmbed.trigger(HostEvent.Edit, { - * vizId:'730496d6-6903-4601-937e-2c691821af3c' - * }); - * ``` - * @example - * ```js - * const editResponse = await spotterEmbed.trigger(HostEvent.Edit, { - * vizId:'730496d6-6903-4601-937e-2c691821af3c' - * }); + * spotterEmbed.trigger(HostEvent.Edit); * ``` * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw */ @@ -3514,16 +3521,23 @@ export enum HostEvent { * ); * }) * ``` - * @example + * * @example * ```js - * spotterEmbed.trigger(HostEvent.GetTML, { - * vizId: '730496d6-6903-4601-937e-2c691821af3c' + + * // You can use the Data event dispatched on each answer creation to get the vizId and use in Pin host event. + * let latestSpotterVizId = ''; + * spotterEmbed.on(EmbedEvent.Data, (payload) => { + * latestSpotterVizId = payload.data.id; + * }); + * + * spotterEmbed.trigger(HostEvent.GetTML, { + * vizId: latestSpotterVizId * }).then((tml) => { * console.log( * tml.answer.search_query // TML representation of the search query * ); * }) - * ``` + * ``` * @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1.sw * @important */ @@ -3587,7 +3601,7 @@ export enum HostEvent { /** * Trigger the **Download** action on charts in * the embedded view. - * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed. + * @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed. * @example * ```js * liveboardEmbed.trigger(HostEvent.Download, {vizId: @@ -3597,10 +3611,14 @@ export enum HostEvent { * embed.trigger(HostEvent.Download) * ``` * ```js - * spotterEmbed.trigger(HostEvent.Download, { - * vizId:'730496d6-6903-4601-937e-2c691821af3c' - * }); - * ``` + * // You can use the Data event dispatched on each answer creation to get the vizId and use in Download host event. + * let latestSpotterVizId = ''; + * spotterEmbed.on(EmbedEvent.Data, (payload) => { + * latestSpotterVizId = payload.data.id; + * }); + * + * spotterEmbed.trigger(HostEvent.Download, { vizId: latestSpotterVizId }); + * ``` * @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw * Use {@link DownloadAsPng} * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw @@ -3618,9 +3636,13 @@ export enum HostEvent { * * searchEmbed.trigger(HostEvent.DownloadAsPng) * - * spotterEmbed.trigger(HostEvent.DownloadAsPng, { - * vizId:"730496d6-6903-4601-937e-2c691821af3c" - * }) + * // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsPng host event. + * let latestSpotterVizId = ''; + * spotterEmbed.on(EmbedEvent.Data, (payload) => { + * latestSpotterVizId = payload.data.id; + * }); + * + * spotterEmbed.trigger(HostEvent.DownloadAsPng, { vizId: latestSpotterVizId }); * ``` * * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw @@ -3629,7 +3651,7 @@ export enum HostEvent { /** * Trigger the **Download** > **CSV** action on tables in * the embedded view. - * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed. + * @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed. * @example * ```js * liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId: @@ -3642,9 +3664,13 @@ export enum HostEvent { * searchEmbed.trigger(HostEvent.DownloadAsCsv) * ``` * ```js - * spotterEmbed.trigger(HostEvent.DownloadAsCsv, { - * vizId:"730496d6-6903-4601-937e-2c691821af3c" - * }) + * // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsCsv host event. + * let latestSpotterVizId = ''; + * spotterEmbed.on(EmbedEvent.Data, (payload) => { + * latestSpotterVizId = payload.data.id; + * }); + * + * spotterEmbed.trigger(HostEvent.DownloadAsCsv, { vizId: latestSpotterVizId }); * ``` * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw */ @@ -3652,7 +3678,7 @@ export enum HostEvent { /** * Trigger the **Download** > **XLSX** action on tables * in the embedded view. - * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed. + * @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed. * @example * ```js * liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId: @@ -3665,9 +3691,13 @@ export enum HostEvent { * searchEmbed.trigger(HostEvent.DownloadAsXlsx) * ``` * ```js - * spotterEmbed.trigger(HostEvent.downloadAsXLSX, { - * vizId:"730496d6-6903-4601-937e-2c691821af3c" - * }) + * // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsXlsx host event. + * let latestSpotterVizId = ''; + * spotterEmbed.on(EmbedEvent.Data, (payload) => { + * latestSpotterVizId = payload.data.id; + * }); + * + * spotterEmbed.trigger(HostEvent.DownloadAsXlsx, { vizId: latestSpotterVizId }); * ``` * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw */ @@ -3704,7 +3734,7 @@ export enum HostEvent { * ``` * * ```js - * // Save an Answer in Spotter (requires vizId) + * // Save a Visualization in Spotter (requires vizId) * spotterEmbed.trigger(HostEvent.Save, { * vizId: "730496d6-6903-4601-937e-2c691821af3c" * }) @@ -4026,11 +4056,13 @@ export enum HostEvent { * }); *``` *```js - * spotterEmbed.trigger(HostEvent.GetParameters, { - * vizId: '730496d6-6903-4601-937e-2c691821af3c' - * }).then((parameter) => { - * console.log('parameters', parameter); - * }); + * // You can use the Data event dispatched on each answer creation to get the vizId and use in GetParameters host event. + * let latestSpotterVizId = ''; + * spotterEmbed.on(EmbedEvent.Data, (payload) => { + * latestSpotterVizId = payload.data.id; + * }); + * + * spotterEmbed.trigger(HostEvent.GetParameters, { vizId: latestSpotterVizId }); *``` * @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw */ @@ -4073,11 +4105,13 @@ export enum HostEvent { * ``` * @example * ```js - * const saveAnswerResponse = await spotterEmbed.trigger(HostEvent.SaveAnswer, { - * vizId: '730496d6-6903-4601-937e-2c691821af3c', - * name: "Sales by states", - * description: "Total sales by states in MidWest" + * // You can use the Data event dispatched on each answer creation to get the vizId and use in SaveAnswer host event. + * let latestSpotterVizId = ''; + * spotterEmbed.on(EmbedEvent.Data, (payload) => { + * latestSpotterVizId = payload.data.id; * }); + * + * spotterEmbed.trigger(HostEvent.SaveAnswer, { vizId: latestSpotterVizId }); * ``` * @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl */ @@ -4161,12 +4195,15 @@ export enum HostEvent { DeleteLastPrompt = 'DeleteLastPrompt', /** * Toggle the visualization to chart or table view. - * @param - `vizId ` refers to the answer id in spotter Embed, it is required in spotter Embed. + * @param - `vizId ` refers to the Visualization ID in Spotter embed and is required. * @example * ```js - * spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, { - * vizId:'b535c760-8bbe-4e6f-bb26-af56b4129a1e' + * let latestSpotterVizId = ''; + * spotterEmbed.on(EmbedEvent.Data, (payload) => { + * latestSpotterVizId = payload.data.id; * }); + * + * spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, { vizId: latestSpotterVizId }); *``` * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl */ @@ -4195,12 +4232,16 @@ export enum HostEvent { */ VisibleEmbedCoordinates = 'visibleEmbedCoordinates', /** - * Trigger the *Ask Spotter* action for visualizations - * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed. + * Trigger the *Spotter* action for visualizations present on the liveboard's vizzes. + * @param - `vizId` refers to the Visualization ID in Spotter embed and is required. * @example * ```js - * spotterEmbed.trigger(HostEvent.AskSpotter, - * {vizId:'730496d6-6903-4601-937e-2c691821af3c'}) + * let latestSpotterVizId = ''; + * spotterEmbed.on(EmbedEvent.Data, (payload) => { + * latestSpotterVizId = payload.data.id; + * }); + * + * spotterEmbed.trigger(HostEvent.AskSpotter, { vizId: latestSpotterVizId }); * ``` * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl */ @@ -4216,6 +4257,16 @@ export enum HostEvent { * ``` */ UpdateEmbedParams = 'updateEmbedParams', + + /** + * @hidden + * Triggers the get of the page context. + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.GetPageContext); + * ``` + */ + GetPageContext = 'GetPageContext', } /** diff --git a/src/utils/processTrigger.ts b/src/utils/processTrigger.ts index ae907dfa..d27b3acf 100644 --- a/src/utils/processTrigger.ts +++ b/src/utils/processTrigger.ts @@ -3,6 +3,7 @@ import { HostEvent, MessagePayload } from '../types'; import { logger } from '../utils/logger'; import { handlePresentEvent } from '../utils'; import { getEmbedConfig } from '../embed/embedConfig'; +import { ContextType } from 'src/embed/hostEventClient/contracts'; /** * Reloads the ThoughtSpot iframe. @@ -22,12 +23,13 @@ export const reload = (iFrame: HTMLIFrameElement) => { * @param message * @param message.type * @param message.data + * @param message.context * @param thoughtSpotHost * @param channel */ function postIframeMessage( iFrame: HTMLIFrameElement, - message: { type: HostEvent; data: any }, + message: { type: HostEvent; data: any, context?: any }, thoughtSpotHost: string, channel?: MessageChannel, ) { @@ -42,12 +44,14 @@ export const TRIGGER_TIMEOUT = 30000; * @param messageType * @param thoughtSpotHost * @param data + * @param context */ export function processTrigger( iFrame: HTMLIFrameElement, messageType: HostEvent, thoughtSpotHost: string, data: any, + context?: ContextType, ): Promise { return new Promise((res, rej) => { if (messageType === HostEvent.Reload) { @@ -83,6 +87,6 @@ export function processTrigger( res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT)); }, TRIGGER_TIMEOUT); - return postIframeMessage(iFrame, { type: messageType, data }, thoughtSpotHost, channel); + return postIframeMessage(iFrame, { type: messageType, data, context }, thoughtSpotHost, channel); }); } diff --git a/static/typedoc/typedoc.json b/static/typedoc/typedoc.json index 2ab1d747..5f033137 100644 --- a/static/typedoc/typedoc.json +++ b/static/typedoc/typedoc.json @@ -48,7 +48,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5435, + "line": 5476, "character": 4 } ], @@ -76,7 +76,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4581, + "line": 4622, "character": 4 } ], @@ -104,7 +104,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4510, + "line": 4551, "character": 4 } ], @@ -128,7 +128,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4499, + "line": 4540, "character": 4 } ], @@ -152,7 +152,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4562, + "line": 4603, "character": 4 } ], @@ -176,7 +176,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4571, + "line": 4612, "character": 4 } ], @@ -204,7 +204,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4591, + "line": 4632, "character": 4 } ], @@ -232,7 +232,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5229, + "line": 5270, "character": 4 } ], @@ -260,7 +260,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4951, + "line": 4992, "character": 4 } ], @@ -288,7 +288,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5402, + "line": 5443, "character": 4 } ], @@ -316,7 +316,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4939, + "line": 4980, "character": 4 } ], @@ -344,7 +344,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4927, + "line": 4968, "character": 4 } ], @@ -373,7 +373,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5391, + "line": 5432, "character": 4 } ], @@ -401,7 +401,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5064, + "line": 5105, "character": 4 } ], @@ -429,7 +429,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5098, + "line": 5139, "character": 4 } ], @@ -457,7 +457,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5153, + "line": 5194, "character": 4 } ], @@ -485,7 +485,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5087, + "line": 5128, "character": 4 } ], @@ -513,7 +513,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5121, + "line": 5162, "character": 4 } ], @@ -541,7 +541,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5163, + "line": 5204, "character": 4 } ], @@ -569,7 +569,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5132, + "line": 5173, "character": 4 } ], @@ -597,7 +597,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5185, + "line": 5226, "character": 4 } ], @@ -625,7 +625,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5142, + "line": 5183, "character": 4 } ], @@ -653,7 +653,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5109, + "line": 5150, "character": 4 } ], @@ -681,7 +681,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5173, + "line": 5214, "character": 4 } ], @@ -709,7 +709,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5075, + "line": 5116, "character": 4 } ], @@ -737,7 +737,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5533, + "line": 5574, "character": 4 } ], @@ -761,7 +761,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4553, + "line": 4594, "character": 4 } ], @@ -789,7 +789,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4544, + "line": 4585, "character": 4 } ], @@ -817,7 +817,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4532, + "line": 4573, "character": 4 } ], @@ -845,7 +845,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5609, + "line": 5650, "character": 4 } ], @@ -869,7 +869,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4521, + "line": 4562, "character": 4 } ], @@ -884,7 +884,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4878, + "line": 4919, "character": 4 } ], @@ -908,7 +908,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4458, + "line": 4499, "character": 4 } ], @@ -932,7 +932,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4877, + "line": 4918, "character": 4 } ], @@ -960,7 +960,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5619, + "line": 5660, "character": 4 } ], @@ -988,7 +988,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5366, + "line": 5407, "character": 4 } ], @@ -1016,7 +1016,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4971, + "line": 5012, "character": 4 } ], @@ -1044,7 +1044,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5022, + "line": 5063, "character": 4 } ], @@ -1072,7 +1072,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5590, + "line": 5631, "character": 4 } ], @@ -1100,7 +1100,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5502, + "line": 5543, "character": 4 } ], @@ -1128,7 +1128,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5521, + "line": 5562, "character": 4 } ], @@ -1152,7 +1152,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4641, + "line": 4682, "character": 4 } ], @@ -1176,7 +1176,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4674, + "line": 4715, "character": 4 } ], @@ -1201,7 +1201,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4664, + "line": 4705, "character": 4 } ], @@ -1225,7 +1225,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4651, + "line": 4692, "character": 4 } ], @@ -1249,7 +1249,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4684, + "line": 4725, "character": 4 } ], @@ -1273,7 +1273,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4894, + "line": 4935, "character": 4 } ], @@ -1297,7 +1297,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4867, + "line": 4908, "character": 4 } ], @@ -1321,7 +1321,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4858, + "line": 4899, "character": 4 } ], @@ -1345,7 +1345,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4760, + "line": 4801, "character": 4 } ], @@ -1369,7 +1369,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4449, + "line": 4490, "character": 4 } ], @@ -1397,7 +1397,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4960, + "line": 5001, "character": 4 } ], @@ -1412,7 +1412,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4883, + "line": 4924, "character": 4 } ], @@ -1440,7 +1440,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5579, + "line": 5620, "character": 4 } ], @@ -1468,7 +1468,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5273, + "line": 5314, "character": 4 } ], @@ -1496,7 +1496,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5448, + "line": 5489, "character": 4 } ], @@ -1520,7 +1520,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4728, + "line": 4769, "character": 4 } ], @@ -1544,7 +1544,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4768, + "line": 4809, "character": 4 } ], @@ -1572,7 +1572,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5600, + "line": 5641, "character": 4 } ], @@ -1600,7 +1600,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5239, + "line": 5280, "character": 4 } ], @@ -1628,7 +1628,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5250, + "line": 5291, "character": 4 } ], @@ -1652,7 +1652,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4847, + "line": 4888, "character": 4 } ], @@ -1677,7 +1677,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4700, + "line": 4741, "character": 4 } ], @@ -1701,7 +1701,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4710, + "line": 4751, "character": 4 } ], @@ -1729,7 +1729,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5635, + "line": 5676, "character": 4 } ], @@ -1757,7 +1757,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5512, + "line": 5553, "character": 4 } ], @@ -1781,7 +1781,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4809, + "line": 4850, "character": 4 } ], @@ -1809,7 +1809,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5334, + "line": 5375, "character": 4 } ], @@ -1833,7 +1833,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4440, + "line": 4481, "character": 4 } ], @@ -1857,7 +1857,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5314, + "line": 5355, "character": 4 } ], @@ -1885,7 +1885,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5012, + "line": 5053, "character": 4 } ], @@ -1913,7 +1913,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5491, + "line": 5532, "character": 4 } ], @@ -1941,7 +1941,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5219, + "line": 5260, "character": 4 } ], @@ -1968,7 +1968,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5294, + "line": 5335, "character": 4 } ], @@ -1992,7 +1992,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5303, + "line": 5344, "character": 4 } ], @@ -2020,7 +2020,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5424, + "line": 5465, "character": 4 } ], @@ -2048,7 +2048,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5459, + "line": 5500, "character": 4 } ], @@ -2076,7 +2076,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5324, + "line": 5365, "character": 4 } ], @@ -2100,7 +2100,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4826, + "line": 4867, "character": 4 } ], @@ -2124,7 +2124,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5679, + "line": 5720, "character": 4 } ], @@ -2148,7 +2148,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4738, + "line": 4779, "character": 4 } ], @@ -2176,7 +2176,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5545, + "line": 5586, "character": 4 } ], @@ -2201,7 +2201,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4917, + "line": 4958, "character": 4 } ], @@ -2225,7 +2225,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4778, + "line": 4819, "character": 4 } ], @@ -2253,7 +2253,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5691, + "line": 5732, "character": 4 } ], @@ -2281,7 +2281,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5053, + "line": 5094, "character": 4 } ], @@ -2309,7 +2309,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5413, + "line": 5454, "character": 4 } ], @@ -2337,7 +2337,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5199, + "line": 5240, "character": 4 } ], @@ -2368,7 +2368,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4981, + "line": 5022, "character": 4 } ], @@ -2392,7 +2392,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4903, + "line": 4944, "character": 4 } ], @@ -2420,7 +2420,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5209, + "line": 5250, "character": 4 } ], @@ -2448,7 +2448,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5557, + "line": 5598, "character": 4 } ], @@ -2476,7 +2476,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5285, + "line": 5326, "character": 4 } ], @@ -2500,7 +2500,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4409, + "line": 4450, "character": 4 } ], @@ -2524,7 +2524,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4427, + "line": 4468, "character": 4 } ], @@ -2548,7 +2548,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4472, + "line": 4513, "character": 4 } ], @@ -2572,7 +2572,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4481, + "line": 4522, "character": 4 } ], @@ -2587,7 +2587,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4884, + "line": 4925, "character": 4 } ], @@ -2611,7 +2611,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4490, + "line": 4531, "character": 4 } ], @@ -2629,7 +2629,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4616, + "line": 4657, "character": 4 } ], @@ -2657,7 +2657,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5260, + "line": 5301, "character": 4 } ], @@ -2681,7 +2681,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4631, + "line": 4672, "character": 4 } ], @@ -2705,7 +2705,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4604, + "line": 4645, "character": 4 } ], @@ -2733,7 +2733,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5568, + "line": 5609, "character": 4 } ], @@ -2761,7 +2761,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5668, + "line": 5709, "character": 4 } ], @@ -2789,7 +2789,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5646, + "line": 5687, "character": 4 } ], @@ -2817,7 +2817,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5657, + "line": 5698, "character": 4 } ], @@ -2841,7 +2841,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4839, + "line": 4880, "character": 4 } ], @@ -2869,7 +2869,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5002, + "line": 5043, "character": 4 } ], @@ -2897,7 +2897,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4991, + "line": 5032, "character": 4 } ], @@ -2925,7 +2925,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5032, + "line": 5073, "character": 4 } ], @@ -2953,7 +2953,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5042, + "line": 5083, "character": 4 } ], @@ -2985,7 +2985,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5353, + "line": 5394, "character": 4 } ], @@ -3009,7 +3009,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4750, + "line": 4791, "character": 4 } ], @@ -3037,7 +3037,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5481, + "line": 5522, "character": 4 } ], @@ -3061,7 +3061,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4719, + "line": 4760, "character": 4 } ], @@ -3089,7 +3089,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5377, + "line": 5418, "character": 4 } ], @@ -3117,7 +3117,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5470, + "line": 5511, "character": 4 } ], @@ -3253,7 +3253,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4400, + "line": 4441, "character": 12 } ] @@ -3826,7 +3826,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5712, + "line": 5753, "character": 4 } ], @@ -3841,7 +3841,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5710, + "line": 5751, "character": 4 } ], @@ -3856,7 +3856,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5711, + "line": 5752, "character": 4 } ], @@ -3877,7 +3877,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5709, + "line": 5750, "character": 12 } ] @@ -3901,7 +3901,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5797, + "line": 5838, "character": 4 } ], @@ -3916,7 +3916,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5795, + "line": 5836, "character": 4 } ], @@ -3931,7 +3931,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5798, + "line": 5839, "character": 4 } ], @@ -3946,7 +3946,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5796, + "line": 5837, "character": 4 } ], @@ -3968,7 +3968,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5794, + "line": 5835, "character": 12 } ] @@ -3992,7 +3992,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5788, + "line": 5829, "character": 4 } ], @@ -4007,7 +4007,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5787, + "line": 5828, "character": 4 } ], @@ -4022,7 +4022,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5786, + "line": 5827, "character": 4 } ], @@ -4043,7 +4043,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5785, + "line": 5826, "character": 12 } ] @@ -4154,7 +4154,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4234, + "line": 4275, "character": 4 } ], @@ -4172,7 +4172,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4238, + "line": 4279, "character": 4 } ], @@ -4190,7 +4190,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4230, + "line": 4271, "character": 4 } ], @@ -4211,7 +4211,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4226, + "line": 4267, "character": 12 } ] @@ -4797,7 +4797,7 @@ "kindString": "Enumeration member", "flags": {}, "comment": { - "shortText": "Data pertaining to an Answer or Liveboard is received.\nThe event payload includes the raw data of the object.", + "shortText": "Data pertaining to an Answer, Liveboard or Spotter visualization is received.\nThe event payload includes the raw data of the object.", "tags": [ { "tag": "returns", @@ -7287,12 +7287,12 @@ "tags": [ { "tag": "param", - "text": "`vizId ` refers to the answer id in spotter Embed, it is required in spotter Embed.", + "text": "`vizId ` refers to the Visualization ID in Spotter embed and is required.", "param": "-" }, { "tag": "example", - "text": "\n```js\nspotterEmbed.trigger(HostEvent.AnswerChartSwitcher, {\n vizId:'b535c760-8bbe-4e6f-bb26-af56b4129a1e'\n});\n```" + "text": "\n```js\nlet latestSpotterVizId = '';\nspotterEmbed.on(EmbedEvent.Data, (payload) => {\n latestSpotterVizId = payload.data.id;\n});\n\nspotterEmbed.trigger(HostEvent.AnswerChartSwitcher, { vizId: latestSpotterVizId });\n```" }, { "tag": "version", @@ -7303,7 +7303,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4173, + "line": 4210, "character": 4 } ], @@ -7331,7 +7331,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3980, + "line": 4010, "character": 4 } ], @@ -7344,16 +7344,16 @@ "kindString": "Enumeration member", "flags": {}, "comment": { - "shortText": "Trigger the *Ask Spotter* action for visualizations", + "shortText": "Trigger the *Spotter* action for visualizations present on the liveboard's vizzes.", "tags": [ { "tag": "param", - "text": "`vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.", + "text": "`vizId` refers to the Visualization ID in Spotter embed and is required.", "param": "-" }, { "tag": "example", - "text": "\n```js\nspotterEmbed.trigger(HostEvent.AskSpotter,\n{vizId:'730496d6-6903-4601-937e-2c691821af3c'})\n```" + "text": "\n```js\nlet latestSpotterVizId = '';\nspotterEmbed.on(EmbedEvent.Data, (payload) => {\n latestSpotterVizId = payload.data.id;\n});\n\nspotterEmbed.trigger(HostEvent.AskSpotter, { vizId: latestSpotterVizId });\n```" }, { "tag": "version", @@ -7364,7 +7364,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4207, + "line": 4248, "character": 4 } ], @@ -7397,7 +7397,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3489, + "line": 3496, "character": 4 } ], @@ -7434,7 +7434,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3419, + "line": 3434, "character": 4 } ], @@ -7467,7 +7467,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3566, + "line": 3580, "character": 4 } ], @@ -7495,7 +7495,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4161, + "line": 4195, "character": 4 } ], @@ -7512,12 +7512,12 @@ "tags": [ { "tag": "param", - "text": "`vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.", + "text": "`vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.", "param": "-" }, { "tag": "example", - "text": "\n```js\nliveboardEmbed.trigger(HostEvent.Download, {vizId:\n'730496d6-6903-4601-937e-2c691821af3c'})\n```\n```js\nembed.trigger(HostEvent.Download)\n```\n```js\nspotterEmbed.trigger(HostEvent.Download, {\n vizId:'730496d6-6903-4601-937e-2c691821af3c'\n });\n```" + "text": "\n```js\nliveboardEmbed.trigger(HostEvent.Download, {vizId:\n'730496d6-6903-4601-937e-2c691821af3c'})\n```\n```js\nembed.trigger(HostEvent.Download)\n```\n```js\n// You can use the Data event dispatched on each answer creation to get the vizId and use in Download host event.\nlet latestSpotterVizId = '';\nspotterEmbed.on(EmbedEvent.Data, (payload) => {\n latestSpotterVizId = payload.data.id;\n});\n\nspotterEmbed.trigger(HostEvent.Download, { vizId: latestSpotterVizId });\n```" }, { "tag": "deprecated", @@ -7532,7 +7532,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3608, + "line": 3626, "character": 4 } ], @@ -7549,12 +7549,12 @@ "tags": [ { "tag": "param", - "text": "`vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.", + "text": "`vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.", "param": "-" }, { "tag": "example", - "text": "\n```js\nliveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId:\n'730496d6-6903-4601-937e-2c691821af3c'})\n```\n```js\nvizEmbed.trigger(HostEvent.DownloadAsCsv)\n```\n```js\nsearchEmbed.trigger(HostEvent.DownloadAsCsv)\n```\n```js\nspotterEmbed.trigger(HostEvent.DownloadAsCsv, {\n vizId:\"730496d6-6903-4601-937e-2c691821af3c\"\n})\n```" + "text": "\n```js\nliveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId:\n'730496d6-6903-4601-937e-2c691821af3c'})\n```\n```js\nvizEmbed.trigger(HostEvent.DownloadAsCsv)\n```\n```js\nsearchEmbed.trigger(HostEvent.DownloadAsCsv)\n```\n```js\n// You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsCsv host event.\nlet latestSpotterVizId = '';\nspotterEmbed.on(EmbedEvent.Data, (payload) => {\n latestSpotterVizId = payload.data.id;\n});\n\nspotterEmbed.trigger(HostEvent.DownloadAsCsv, { vizId: latestSpotterVizId });\n```" }, { "tag": "version", @@ -7565,7 +7565,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3651, + "line": 3677, "character": 4 } ], @@ -7591,7 +7591,7 @@ }, { "tag": "example", - "text": "\n```js\nspotterEmbed.trigger(HostEvent.DownloadAsPdf, {\n vizId:'730496d6-6903-4601-937e-2c691821af3c'\n });\n```\n" + "text": "\n```js\n\n// You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsPdf host event.\nlet latestSpotterVizId = '';\nspotterEmbed.on(EmbedEvent.Data, (payload) => {\n latestSpotterVizId = payload.data.id;\n});\n\nspotterEmbed.trigger(HostEvent.DownloadAsPdf, { vizId: latestSpotterVizId });\n```\n" }, { "tag": "version", @@ -7602,7 +7602,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3349, + "line": 3360, "character": 4 } ], @@ -7619,7 +7619,7 @@ "tags": [ { "tag": "example", - "text": "\n```js\nliveboardEmbed.trigger(HostEvent.DownloadAsPng,\n{vizId:'730496d6-6903-4601-937e-2c691821af3c'})\n\nvizEmbed.trigger(HostEvent.DownloadAsPng)\n\nsearchEmbed.trigger(HostEvent.DownloadAsPng)\n\nspotterEmbed.trigger(HostEvent.DownloadAsPng, {\n vizId:\"730496d6-6903-4601-937e-2c691821af3c\"\n})\n```\n" + "text": "\n```js\nliveboardEmbed.trigger(HostEvent.DownloadAsPng,\n{vizId:'730496d6-6903-4601-937e-2c691821af3c'})\n\nvizEmbed.trigger(HostEvent.DownloadAsPng)\n\nsearchEmbed.trigger(HostEvent.DownloadAsPng)\n\n// You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsPng host event.\nlet latestSpotterVizId = '';\nspotterEmbed.on(EmbedEvent.Data, (payload) => {\n latestSpotterVizId = payload.data.id;\n});\n\nspotterEmbed.trigger(HostEvent.DownloadAsPng, { vizId: latestSpotterVizId });\n```\n" }, { "tag": "version", @@ -7630,7 +7630,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3628, + "line": 3650, "character": 4 } ], @@ -7647,12 +7647,12 @@ "tags": [ { "tag": "param", - "text": "`vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.", + "text": "`vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.", "param": "-" }, { "tag": "example", - "text": "\n```js\nliveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId:\n'730496d6-6903-4601-937e-2c691821af3c'})\n```\n```js\nvizEmbed.trigger(HostEvent.DownloadAsXlsx)\n```\n```js\nsearchEmbed.trigger(HostEvent.DownloadAsXlsx)\n```\n```js\nspotterEmbed.trigger(HostEvent.downloadAsXLSX, {\n vizId:\"730496d6-6903-4601-937e-2c691821af3c\"\n})\n```" + "text": "\n```js\nliveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId:\n'730496d6-6903-4601-937e-2c691821af3c'})\n```\n```js\nvizEmbed.trigger(HostEvent.DownloadAsXlsx)\n```\n```js\nsearchEmbed.trigger(HostEvent.DownloadAsXlsx)\n```\n```js\n// You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsXlsx host event.\nlet latestSpotterVizId = '';\nspotterEmbed.on(EmbedEvent.Data, (payload) => {\n latestSpotterVizId = payload.data.id;\n});\n\nspotterEmbed.trigger(HostEvent.DownloadAsXlsx, { vizId: latestSpotterVizId });\n```" }, { "tag": "version", @@ -7663,7 +7663,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3674, + "line": 3704, "character": 4 } ], @@ -7752,11 +7752,7 @@ }, { "tag": "example", - "text": "\n```js\nconst pinResponse = await spotterEmbed.trigger(HostEvent.Edit, {\n vizId:'730496d6-6903-4601-937e-2c691821af3c'\n });\n```" - }, - { - "tag": "example", - "text": "\n```js\nconst editResponse = await spotterEmbed.trigger(HostEvent.Edit, {\n vizId:'730496d6-6903-4601-937e-2c691821af3c'\n });\n```" + "text": "\n```js\nspotterEmbed.trigger(HostEvent.Edit);\n```" }, { "tag": "version", @@ -7767,7 +7763,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3472, + "line": 3479, "character": 4 } ], @@ -7800,7 +7796,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4134, + "line": 4168, "character": 4 } ], @@ -7828,7 +7824,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3318, + "line": 3324, "character": 4 } ], @@ -7861,7 +7857,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3402, + "line": 3417, "character": 4 } ], @@ -7889,7 +7885,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3308, + "line": 3314, "character": 4 } ], @@ -7922,7 +7918,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3970, + "line": 4000, "character": 4 } ], @@ -7950,7 +7946,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3797, + "line": 3827, "character": 4 } ], @@ -7995,7 +7991,7 @@ "tags": [ { "tag": "param", - "text": "`vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.\n```js\nliveboardEmbed.trigger(HostEvent.GetParameters).then((parameter) => {\n console.log('parameters', parameter);\n});\n```\n```js\nspotterEmbed.trigger(HostEvent.GetParameters, {\n vizId: '730496d6-6903-4601-937e-2c691821af3c'\n}).then((parameter) => {\n console.log('parameters', parameter);\n});\n```", + "text": "`vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.\n```js\nliveboardEmbed.trigger(HostEvent.GetParameters).then((parameter) => {\n console.log('parameters', parameter);\n});\n```\n```js\n// You can use the Data event dispatched on each answer creation to get the vizId and use in GetParameters host event.\nlet latestSpotterVizId = '';\nspotterEmbed.on(EmbedEvent.Data, (payload) => {\n latestSpotterVizId = payload.data.id;\n});\n\nspotterEmbed.trigger(HostEvent.GetParameters, { vizId: latestSpotterVizId });\n```", "param": "-" }, { @@ -8007,7 +8003,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4037, + "line": 4069, "character": 4 } ], @@ -8024,11 +8020,7 @@ "tags": [ { "tag": "example", - "text": "\n```js\nsearchEmbed.trigger(HostEvent.GetTML).then((tml) => {\n console.log(\n tml.answer.search_query // TML representation of the search query\n );\n})\n```" - }, - { - "tag": "example", - "text": "\n```js\nspotterEmbed.trigger(HostEvent.GetTML, {\n vizId: '730496d6-6903-4601-937e-2c691821af3c'\n}).then((tml) => {\n console.log(\n tml.answer.search_query // TML representation of the search query\n );\n})\n```" + "text": "\n```js\nsearchEmbed.trigger(HostEvent.GetTML).then((tml) => {\n console.log(\n tml.answer.search_query // TML representation of the search query\n );\n})\n```\n* @example\n```js\n\n// You can use the Data event dispatched on each answer creation to get the vizId and use in Pin host event.\nlet latestSpotterVizId = '';\nspotterEmbed.on(EmbedEvent.Data, (payload) => {\n latestSpotterVizId = payload.data.id;\n});\n\nspotterEmbed.trigger(HostEvent.GetTML, {\n vizId: latestSpotterVizId\n}).then((tml) => {\n console.log(\n tml.answer.search_query // TML representation of the search query\n );\n})\n```" }, { "tag": "version", @@ -8043,7 +8035,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3530, + "line": 3544, "character": 4 } ], @@ -8071,7 +8063,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3900, + "line": 3930, "character": 4 } ], @@ -8099,7 +8091,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3280, + "line": 3286, "character": 4 } ], @@ -8132,7 +8124,7 @@ }, { "tag": "example", - "text": "\n```js\nconst pinResponse = await spotterEmbed.trigger(HostEvent.MakeACopy, {\n vizId:'730496d6-6903-4601-937e-2c691821af3c'\n });\n```" + "text": "\n```js\n// You can use the Data event dispatched on each answer creation to get the vizId and use in MakeACopy host event.\nlet latestSpotterVizId = '';\nspotterEmbed.on(EmbedEvent.Data, (payload) => {\n latestSpotterVizId = payload.data.id;\n});\n\nspotterEmbed.trigger(HostEvent.MakeACopy, { vizId: latestSpotterVizId });\n```" }, { "tag": "version", @@ -8143,7 +8135,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3378, + "line": 3393, "character": 4 } ], @@ -8184,7 +8176,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3440, + "line": 3455, "character": 4 } ], @@ -8217,7 +8209,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3774, + "line": 3804, "character": 4 } ], @@ -8304,7 +8296,7 @@ "tags": [ { "tag": "param", - "text": "\n`vizId`- GUID of the saved Answer or visualization to pin to a Liveboard.\n Optional when pinning a new chart or table generated from a Search query.\n **Required** in Spotter Embed." + "text": "\n`vizId`- GUID of the saved Answer or Spotter visualization ID to pin to a Liveboard.\n Optional when pinning a new chart or table generated from a Search query.\n **Required** in Spotter Embed." }, { "tag": "param", @@ -8344,7 +8336,7 @@ }, { "tag": "example", - "text": "\n```js\nconst pinResponse = await spotterEmbed.trigger(HostEvent.Pin, {\n vizId:'730496d6-6903-4601-937e-2c691821af3c'\n });\n```" + "text": "\n```js\n\n// You can use the Data event dispatched on each answer creation to get the vizId and use in Pin host event.\nlet latestSpotterVizId = '';\nspotterEmbed.on(EmbedEvent.Data, (payload) => {\n latestSpotterVizId = payload.data.id;\n});\n\nspotterEmbed.trigger(HostEvent.Pin, { vizId: latestSpotterVizId });\n```\n" }, { "tag": "version", @@ -8355,7 +8347,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3270, + "line": 3276, "character": 4 } ], @@ -8388,7 +8380,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3506, + "line": 3513, "character": 4 } ], @@ -8416,7 +8408,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4143, + "line": 4177, "character": 4 } ], @@ -8448,7 +8440,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3392, + "line": 3407, "character": 4 } ], @@ -8509,7 +8501,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4005, + "line": 4035, "character": 4 } ], @@ -8537,7 +8529,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3786, + "line": 3816, "character": 4 } ], @@ -8565,7 +8557,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4152, + "line": 4186, "character": 4 } ], @@ -8587,7 +8579,7 @@ }, { "tag": "example", - "text": "\n```js\n// Save changes in a Liveboard\nliveboardEmbed.trigger(HostEvent.Save)\n```\n\n```js\n// Save the current Answer in Search embed\nsearchEmbed.trigger(HostEvent.Save)\n```\n\n```js\n// Save an Answer in Spotter (requires vizId)\nspotterEmbed.trigger(HostEvent.Save, {\n vizId: \"730496d6-6903-4601-937e-2c691821af3c\"\n})\n```\n\n```js\n// How to get the vizId in Spotter?\n\n// You can use the Data event dispatched on each answer creation to get the vizId.\nlet latestSpotterVizId = '';\nspotterEmbed.on(EmbedEvent.Data, (payload) => {\n latestSpotterVizId = payload.data.id;\n});\n\nspotterEmbed.trigger(HostEvent.Save, { vizId: latestSpotterVizId });\n```\n" + "text": "\n```js\n// Save changes in a Liveboard\nliveboardEmbed.trigger(HostEvent.Save)\n```\n\n```js\n// Save the current Answer in Search embed\nsearchEmbed.trigger(HostEvent.Save)\n```\n\n```js\n// Save a Visualization in Spotter (requires vizId)\nspotterEmbed.trigger(HostEvent.Save, {\n vizId: \"730496d6-6903-4601-937e-2c691821af3c\"\n})\n```\n\n```js\n// How to get the vizId in Spotter?\n\n// You can use the Data event dispatched on each answer creation to get the vizId.\nlet latestSpotterVizId = '';\nspotterEmbed.on(EmbedEvent.Data, (payload) => {\n latestSpotterVizId = payload.data.id;\n});\n\nspotterEmbed.trigger(HostEvent.Save, { vizId: latestSpotterVizId });\n```\n" }, { "tag": "version", @@ -8598,7 +8590,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3727, + "line": 3757, "character": 4 } ], @@ -8629,7 +8621,7 @@ }, { "tag": "example", - "text": "\n```js\nconst saveAnswerResponse = await spotterEmbed.trigger(HostEvent.SaveAnswer, {\n vizId: '730496d6-6903-4601-937e-2c691821af3c',\n name: \"Sales by states\",\n description: \"Total sales by states in MidWest\"\n});\n```" + "text": "\n```js\n// You can use the Data event dispatched on each answer creation to get the vizId and use in SaveAnswer host event.\nlet latestSpotterVizId = '';\nspotterEmbed.on(EmbedEvent.Data, (payload) => {\n latestSpotterVizId = payload.data.id;\n});\n\nspotterEmbed.trigger(HostEvent.SaveAnswer, { vizId: latestSpotterVizId });\n```" }, { "tag": "version", @@ -8640,7 +8632,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4084, + "line": 4118, "character": 4 } ], @@ -8668,7 +8660,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3289, + "line": 3295, "character": 4 } ], @@ -8696,7 +8688,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3298, + "line": 3304, "character": 4 } ], @@ -8801,7 +8793,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3926, + "line": 3956, "character": 4 } ], @@ -8834,7 +8826,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3913, + "line": 3943, "character": 4 } ], @@ -8895,7 +8887,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3687, + "line": 3717, "character": 4 } ], @@ -8928,7 +8920,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3549, + "line": 3563, "character": 4 } ], @@ -8961,7 +8953,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3586, + "line": 3600, "character": 4 } ], @@ -8999,7 +8991,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4124, + "line": 4158, "character": 4 } ], @@ -9032,7 +9024,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3758, + "line": 3788, "character": 4 } ], @@ -9065,7 +9057,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3742, + "line": 3772, "character": 4 } ], @@ -9098,7 +9090,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4109, + "line": 4143, "character": 4 } ], @@ -9126,7 +9118,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3996, + "line": 4026, "character": 4 } ], @@ -9176,7 +9168,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3887, + "line": 3917, "character": 4 } ], @@ -9200,7 +9192,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4019, + "line": 4049, "character": 4 } ], @@ -9224,7 +9216,7 @@ "sources": [ { "fileName": "types.ts", - "line": 4045, + "line": 4077, "character": 4 } ], @@ -9300,7 +9292,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3940, + "line": 3970, "character": 4 } ], @@ -9328,7 +9320,7 @@ "sources": [ { "fileName": "types.ts", - "line": 3327, + "line": 3333, "character": 4 } ], @@ -9673,7 +9665,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5872, + "line": 5913, "character": 4 } ], @@ -9701,7 +9693,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5833, + "line": 5874, "character": 4 } ], @@ -9729,7 +9721,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5858, + "line": 5899, "character": 4 } ], @@ -9757,7 +9749,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5821, + "line": 5862, "character": 4 } ], @@ -9785,7 +9777,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5884, + "line": 5925, "character": 4 } ], @@ -9813,7 +9805,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5845, + "line": 5886, "character": 4 } ], @@ -9837,7 +9829,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5808, + "line": 5849, "character": 12 } ] @@ -10018,7 +10010,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5699, + "line": 5740, "character": 4 } ], @@ -10033,7 +10025,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5701, + "line": 5742, "character": 4 } ], @@ -10048,7 +10040,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5700, + "line": 5741, "character": 4 } ], @@ -10063,7 +10055,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5702, + "line": 5743, "character": 4 } ], @@ -10085,7 +10077,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5698, + "line": 5739, "character": 12 } ] @@ -27466,7 +27458,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5743, + "line": 5784, "character": 4 } ], @@ -27488,7 +27480,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5744, + "line": 5785, "character": 8 } ], @@ -27507,7 +27499,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5745, + "line": 5786, "character": 8 } ], @@ -27543,7 +27535,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5747, + "line": 5788, "character": 4 } ], @@ -27565,7 +27557,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5755, + "line": 5796, "character": 8 } ], @@ -27586,7 +27578,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5756, + "line": 5797, "character": 8 } ], @@ -27607,7 +27599,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5749, + "line": 5790, "character": 8 } ], @@ -27625,7 +27617,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5748, + "line": 5789, "character": 8 } ], @@ -27643,7 +27635,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5750, + "line": 5791, "character": 8 } ], @@ -27665,7 +27657,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5751, + "line": 5792, "character": 12 } ], @@ -27687,7 +27679,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5752, + "line": 5793, "character": 16 } ], @@ -27771,7 +27763,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5759, + "line": 5800, "character": 4 } ], @@ -27792,7 +27784,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5760, + "line": 5801, "character": 4 } ], @@ -27817,7 +27809,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5742, + "line": 5783, "character": 17 } ] @@ -43151,7 +43143,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5735, + "line": 5776, "character": 4 } ], @@ -43172,7 +43164,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5736, + "line": 5777, "character": 4 } ], @@ -43198,7 +43190,7 @@ "sources": [ { "fileName": "types.ts", - "line": 5734, + "line": 5775, "character": 17 } ] diff --git a/visual-embed-sdk.d.ts b/visual-embed-sdk.d.ts new file mode 100644 index 00000000..0b16b91b --- /dev/null +++ b/visual-embed-sdk.d.ts @@ -0,0 +1,9631 @@ +// Generated by dts-bundle-generator v9.5.1 + +/** + * The list of customization css variables. These + * are the only allowed variables possible. + */ +export interface CustomCssVariables { + /** + * Background color of the Liveboard, visualization, Search, and Answer pages. + */ + "--ts-var-root-background"?: string; + /** + * Color of the text on application pages. + */ + "--ts-var-root-color"?: string; + /** + * Font type for the text on application pages. + */ + "--ts-var-root-font-family"?: string; + /** + * Text transformation specification for UI elements in the app. + */ + "--ts-var-root-text-transform"?: string; + /** + * Font color of the text on toggle buttons such as + * **All**, **Answers**, and **Liveboards** on the Home page (Classic experience), + * the text color of the chart and table tiles on Home page (New modular Homepage + * experience), title text on the AI-generated charts and tables, and object titles on + * list pages such as *Liveboards* and *Answers*. + * The default color code is #2770EF. + * + */ + "--ts-var-application-color"?: string; + /** + * Background color of the top navigation panel. + */ + "--ts-var-nav-background"?: string; + /** + * Font color of the top navigation panel. + */ + "--ts-var-nav-color"?: string; + /** + * Background color of the *Search data* button. + */ + "--ts-var-search-data-button-background"?: string; + /** + * Color of the text on the *Search data* button. + */ + "--ts-var-search-data-button-font-color"?: string; + /** + * Font of the text on the *Search data* button. + */ + "--ts-var-search-data-button-font-family"?: string; + /** + * Font color of the text in the Search bar. + */ + "--ts-var-search-bar-text-font-color"?: string; + /** + * Font of the text in the Search bar. + */ + "--ts-var-search-bar-text-font-family"?: string; + /** + * Font style of the text in the Search bar. + */ + "--ts-var-search-bar-text-font-style"?: string; + /** + * Background color of the search bar. + */ + "--ts-var-search-bar-background"?: string; + /** + * Background color of the search suggestions panel. + */ + "--ts-var-search-auto-complete-background"?: string; + /** + * Background color of the navigation panel that allows you to undo, redo, and reset + * search operations. + */ + "--ts-var-search-navigation-button-background"?: string; + /** + * Background color of the navigation help text that appears at the bottom of the + * search suggestions panel. + */ + "--ts-var-search-bar-navigation-help-text-background"?: string; + /** + * Background color of the search suggestion block on hover. + */ + "--ts-var-search-bar-auto-complete-hover-background"?: string; + /** + * Font color of the text in the search suggestion panel. + */ + "--ts-var-search-auto-complete-font-color"?: string; + /** + * Font color of the sub-text that appears below the keyword in the search suggestion + * panel. + */ + "--ts-var-search-auto-complete-subtext-font-color"?: string; + /** + * Background color of the input box in the Spotter page. + */ + "--ts-var-spotter-input-background"?: string; + /** + * Background color of the previously asked prompt message in the Spotter page. + */ + "--ts-var-spotter-prompt-background"?: string; + /** + * Background color of the data panel. + */ + "--ts-var-answer-data-panel-background-color"?: string; + /** + * Background color of the vertical panel on the right side of the Answer page, which + * includes the options to edit charts and tables. + */ + "--ts-var-answer-edit-panel-background-color"?: string; + /** + * Background color of the chart switcher on search results and Answer pages. + */ + "--ts-var-answer-view-table-chart-switcher-background"?: string; + /** + * Background color of the currently selected chart type in the chart switcher. + */ + "--ts-var-answer-view-table-chart-switcher-active-background"?: string; + /** + * Border-radius of main buttons. + * For example, the *Search data* button in the top navigation panel. + */ + "--ts-var-button-border-radius"?: string; + /** + * Border-radius of small buttons such as secondary buttons. + * For example, share and favorite buttons. + */ + "--ts-var-button--icon-border-radius"?: string; + /** + * Font color of the text on primary buttons. For example, the primary buttons on + * Liveboard*, Answer, *Data* workspace, *SpotIQ*, or *Home* page. + */ + "--ts-var-button--primary-color"?: string; + /** + * Font family specification for the text on primary buttons. + */ + "--ts-var-button--primary--font-family"?: string; + /** + * Background color of the primary buttons. For example, the primary buttons such as + * Pin* and *Save*. + */ + "--ts-var-button--primary-background"?: string; + /** + * Background color of the primary buttons on hover. + */ + "--ts-var-button--primary--hover-background"?: string; + /** + * Backgroud color of the primary buttons when active. + */ + "--ts-var-button--primary--active-background"?: string; + /** + * Font color of the text on the secondary buttons. + */ + "--ts-var-button--secondary-color"?: string; + /** + * Font family specification for the text on the secondary buttons. + */ + "--ts-var-button--secondary--font-family"?: string; + /** + * Background color of the secondary buttons. + */ + "--ts-var-button--secondary-background"?: string; + /** + * Background color of the secondary button on hover. + */ + "--ts-var-button--secondary--hover-background"?: string; + /** + * Backgroud color of the secondary buttons when active. + */ + "--ts-var-button--secondary--active-background"?: string; + /** + * Font color of the tertiary button. For example, the *Undo*, *Redo*, and *Reset* + * buttons on the *Search* page. + */ + "--ts-var-button--tertiary-color"?: string; + /** + * Background color of the tertiary button. + */ + "--ts-var-button--tertiary-background"?: string; + /** + * Background color of the tertiary button when a user hovers over these buttons. + */ + "--ts-var-button--tertiary--hover-background"?: string; + /** + * Backgroud color of the tertiary buttons when active. + */ + "--ts-var-button--tertiary--active-background"?: string; + /** + * Font color of the title text of a visualization or Answer. + */ + "--ts-var-viz-title-color"?: string; + /** + * Font family specification for the title text of a visualization/Answer. + */ + "--ts-var-viz-title-font-family"?: string; + /** + * Text transformation specification for visualization and Answer titles. + */ + "--ts-var-viz-title-text-transform"?: string; + /** + * Font color of the description text and subtitle of a visualization or Answer. + */ + "--ts-var-viz-description-color"?: string; + /** + * Font family specification of description text and subtitle of a visualization or + * Answer. + */ + "--ts-var-viz-description-font-family"?: string; + /** + * Text transformation specification for description text and subtitle of a + * visualization or Answer. + */ + "--ts-var-viz-description-text-transform"?: string; + /** + * Border-radius for the visualization tiles and header panel on a Liveboard. + */ + "--ts-var-viz-border-radius"?: string; + /** + * Box shadow property for the visualization tiles and header panel on a Liveboard. + */ + "--ts-var-viz-box-shadow"?: string; + /** + * Background color of the visualization tiles and header panel on a Liveboard. + */ + "--ts-var-viz-background"?: string; + /** + * Background color of the legend on a visualization or Answer. + */ + "--ts-var-viz-legend-hover-background"?: string; + /** + * Background color of the selected chart type on the chart selection widget. + */ + "--ts-var-answer-chart-select-background"?: string; + /** + * Background color of the chart type element when a user hovers over a chart type on + * the chart selection widget. + */ + "--ts-var-answer-chart-hover-background"?: string; + /** + * Border-radius of filter chips. + */ + "--ts-var-chip-border-radius"?: string; + /** + * Shadow effect for filter chips. + */ + "--ts-var-chip-box-shadow"?: string; + /** + * Background color of filter chips. + */ + "--ts-var-chip-background"?: string; + /** + * Font color of the filter label when a filter chip is selected + */ + "--ts-var-chip--active-color"?: string; + /** + * Background color of the filter chips when selected. + */ + "--ts-var-chip--active-background"?: string; + /** + * Font color of the text on filter chips when hovered over. + */ + "--ts-var-chip--hover-color"?: string; + /** + * Background color of filter chips on hover. + */ + "--ts-var-chip--hover-background"?: string; + /** + * Font color of the text on filter chips. + */ + "--ts-var-chip-color"?: string; + /** + * Font family specification for the text on filter chips. + */ + "--ts-var-chip-title-font-family"?: string; + /** + * Font color of axis title on charts. + */ + "--ts-var-axis-title-color"?: string; + /** + * Font family specification for the X and Y axis title text. + */ + "--ts-var-axis-title-font-family"?: string; + /** + * Font color of the X and Y axis labels. + */ + "--ts-var-axis-data-label-color"?: string; + /** + * Font family specification for X and Y axis labels. + */ + "--ts-var-axis-data-label-font-family"?: string; + /** + * Font color of the menu items. + */ + "--ts-var-menu-color"?: string; + /** + * Background color of menu panels. + */ + "--ts-var-menu-background"?: string; + /** + * Font family specification for the menu items. + */ + "--ts-var-menu-font-family"?: string; + /** + * Text capitalization specification for the menu items. + */ + "--ts-var-menu-text-transform"?: string; + /** + * Background color for menu items on hover. + */ + "--ts-var-menu--hover-background"?: string; + /** + * Text color for selected menu items. + */ + "--ts-var-menu-selected-text-color"?: string; + /** + * Background color of the dialogs. + */ + "--ts-var-dialog-body-background"?: string; + /** + * Font color of the body text displayed on dialogs. + */ + "--ts-var-dialog-body-color"?: string; + /** + * Background color of the header text on dialogs. + */ + "--ts-var-dialog-header-background"?: string; + /** + * Font color of the header text on dialogs. + */ + "--ts-var-dialog-header-color"?: string; + /** + * Background color of the footer area on dialogs. + */ + "--ts-var-dialog-footer-background"?: string; + /** + * Background for selected state in list + */ + "--ts-var-list-selected-background"?: string; + /** + * Background for hover state in list + */ + "--ts-var-list-hover-background"?: string; + /** + * Background for hover state in segment control. + */ + "--ts-var-segment-control-hover-background"?: string; + /** + * Text color for slected item in modular home's watchlist. + */ + "--ts-var-home-watchlist-selected-text-color"?: string; + /** + * Text color for favorite carousel find your favorites card in modular home. + */ + "--ts-var-home-favorite-suggestion-card-text-color"?: string; + /** + * Icon color for favorite carousel find your favorites card in modular home. + */ + "--ts-var-home-favorite-suggestion-card-icon-color"?: string; + /** + * Background for favorite carousel find your favorites card in modular home. + */ + "--ts-var-home-favorite-suggestion-card-background"?: string; + /** + * Border color of checkbox in error state. + */ + "--ts-var-checkbox-error-border"?: string; + /** + * Border color of checkbox. + */ + "--ts-var-checkbox-border-color"?: string; + /** + * Border color of checkbox in hover state. + */ + "--ts-var-checkbox-hover-border"?: string; + /** + * Border and font color of checkbox in active state. + */ + "--ts-var-checkbox-active-color"?: string; + /** + * Border color and font color of checkbox in checked state. + */ + "--ts-var-checkbox-checked-color"?: string; + /** + * Border and font color of checkbox in disabled state. + */ + "--ts-var-checkbox-checked-disabled"?: string; + /** + * Background color of checkbox. + */ + "--ts-var-checkbox-background-color"?: string; + /** + * Height of the tiles in the Liveboard. + */ + "--ts-var-viz-tile-height"?: string; + /** + * Background color of the layout in the Liveboard. + */ + "--ts-var-liveboard-layout-background"?: string; + /** + * Font color of the title of the layout in the Liveboard. + */ + "--ts-var-liveboard-layout-title-color"?: string; + /** + * Font size of the title of the layout in the Liveboard. + */ + "--ts-var-liveboard-layout-title-fontsize"?: string; + /** + * Background color of the header in the Liveboard. + */ + "--ts-var-liveboard-header-background"?: string; + /** + * Font size of the header in the Liveboard. + */ + "--ts-var-liveboard-header-fontsize"?: string; + /** + * Font color of the header in the Liveboard. + */ + "--ts-var-liveboard-header-font-color"?: string; + /** + * Border color of the tiles in the Liveboard. + */ + "--ts-var-liveboard-tile-border-color"?: string; + /** + * Background color of the tiles in the Liveboard. + */ + "--ts-var-liveboard-tile-background"?: string; + /** + * Border radius of the tiles in the Liveboard. + */ + "--ts-var-liveboard-tile-border-radius"?: string; + /** + * Padding of the tiles in the Liveboard. + */ + "--ts-var-liveboard-tile-padding"?: string; + /** + * Background color of the table header in the Liveboard. + */ + "--ts-var-liveboard-tile-table-header-background"?: string; + /** + * Padding of the groups in the Liveboard. + * + * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable. + */ + "--ts-var-liveboard-group-padding"?: string; + /** + * Padding of the title of the groups in the Liveboard. + * + * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable. + */ + "--ts-var-liveboard-group-title-padding"?: string; + /** + * Font size of the title of the groups in the Liveboard. + * + * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable. + */ + "--ts-var-liveboard-group-title-font-size"?: string; + /** + * Font weight of the title of the groups in the Liveboard. + * + * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable. + */ + "--ts-var-liveboard-group-title-font-weight"?: string; + /** + * Font size of the title of the tiles inside the groups in the Liveboard. + * + * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable. + */ + "--ts-var-liveboard-group-tile-title-font-size"?: string; + /** + * Font weight of the title of the tiles inside the groups in the Liveboard. + * + * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable. + */ + "--ts-var-liveboard-group-tile-title-font-weight"?: string; + /** + * Font size of the description of the groups in the Liveboard. + * + * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable. + */ + "--ts-var-liveboard-group-description-font-size"?: string; + /** + * Font weight of the description of the groups in the Liveboard. + * + * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable. + */ + "--ts-var-liveboard-group-description-font-weight"?: string; + /** + * Border of the group tiles in the Liveboard. + * + * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable. + */ + "--ts-var-liveboard-group-tile-border"?: string; + /** + * Padding of the group tiles in the Liveboard. + * + * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable. + */ + "--ts-var-liveboard-group-tile-padding"?: string; + /** + * Padding of the answer viz in the Liveboard. + */ + "--ts-var-liveboard-answer-viz-padding"?: string; + /** + * Background color of the groups in the Liveboard. + * + * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable. + */ + "--ts-var-liveboard-group-background"?: string; + /** + * Border color of the groups in the Liveboard. + * + * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable. + */ + "--ts-var-liveboard-group-border-color"?: string; + /** + * Font color of the heading of the note title in the Liveboard. + */ + "--ts-var-liveboard-notetitle-heading-font-color"?: string; + /** + * Font color of the body of the note title in the Liveboard. + */ + "--ts-var-liveboard-notetitle-body-font-color"?: string; + /** + * Font color of the title of the groups in the Liveboard. + * + * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable. + */ + "--ts-var-liveboard-group-title-font-color"?: string; + /** + * Font color of the description of the groups in the Liveboard. + * + * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable. + */ + "--ts-var-liveboard-group-description-font-color"?: string; + /** + * Font color of the title of the tiles inside the groups in the Liveboard. + * + * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable. + */ + "--ts-var-liveboard-group-tile-title-font-color"?: string; + /** + * Font color of the description of the tiles inside the groups in the Liveboard. + * + * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable. + */ + "--ts-var-liveboard-group-tile-description-font-color"?: string; + /** + * Background color of the tiles inside the groups in the Liveboard. + * + * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable. + */ + "--ts-var-liveboard-group-tile-background"?: string; + /** + * Background color of the filter chips in the Liveboard. + * + * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable. + */ + "--ts-var-liveboard-chip-background"?: string; + /** + * Font color of the filter chips in the Liveboard. + * + * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable. + */ + "--ts-var-liveboard-chip-color"?: string; + /** + * Background color of the filter chips in the Liveboard on hover. + * + * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable. + */ + "--ts-var-liveboard-chip--hover-background"?: string; + /** + * Background color of the filter chips in the Liveboard on active. + * + * Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable. + */ + "--ts-var-liveboard-chip--active-background"?: string; + /** + * Width of the side panel in the Liveboard. + */ + "--ts-var-side-panel-width"?: string; + /** + * Background color of the edit bar in the Liveboard. + */ + "--ts-var-liveboard-edit-bar-background"?: string; + /** + * Breakpoint for the dual column layout in the Liveboard. + */ + "--ts-var-liveboard-dual-column-breakpoint"?: string; + /** + * Breakpoint for the single column layout in the Liveboard. + */ + "--ts-var-liveboard-single-column-breakpoint"?: string; + /** + * Background color of the cross filter layout in the Liveboard. + */ + "--ts-var-liveboard-cross-filter-layout-background"?: string; + /** + * Border color of the active tab in the Liveboard. + */ + "--ts-var-liveboard-tab-active-border-color"?: string; + /** + * Font color of the hover tab in the Liveboard. + */ + "--ts-var-liveboard-tab-hover-color"?: string; + /** + * Font size of the title of the tiles in the Liveboard. + */ + "--ts-var-liveboard-tile-title-fontsize"?: string; + /** + * Font weight of the title of the tiles in the Liveboard. + */ + "--ts-var-liveboard-tile-title-fontweight"?: string; + /** + * Font weight of the description of the tiles in the Liveboard. + */ + "--ts-var-liveboard-tile-description-font-weight"?: string; + /** + * Opacity of the description of the tiles in the Liveboard. + */ + "--ts-var-liveboard-tile-description-opacity"?: string; + /** + * Background color of the parameter chips in the Liveboard. + */ + "--ts-var-parameter-chip-background"?: string; + /** + * Font color of the parameter chips in the Liveboard. + */ + "--ts-var-parameter-chip-text-color"?: string; + /** + * Background color of the parameter chips in the Liveboard on hover. + */ + "--ts-var-parameter-chip-hover-background"?: string; + /** + * Font color of the parameter chips in the Liveboard on hover. + */ + "--ts-var-parameter-chip-hover-text-color"?: string; + /** + * Background color of the parameter chips in the Liveboard on active. + */ + "--ts-var-parameter-chip-active-background"?: string; + /** + * Font color of the parameter chips in the Liveboard on active. + */ + "--ts-var-parameter-chip-active-text-color"?: string; + /** + * Background color of the action button in the Liveboard header. + */ + "--ts-var-liveboard-header-action-button-background"?: string; + /** + * Font color of the action button in the Liveboard header. + */ + "--ts-var-liveboard-header-action-button-font-color"?: string; + /** + * Font color of the action button in the Liveboard header on hover. + */ + "--ts-var-liveboard-header-action-button-hover-color"?: string; + /** + * Font color of the action button in the Liveboard header on active. + */ + "--ts-var-liveboard-header-action-button-active-color"?: string; + /** + * Background color of the badge in the Liveboard header. + */ + "--ts-var-liveboard-header-badge-background"?: string; + /** + * Font color of the badge in the Liveboard header. + */ + "--ts-var-liveboard-header-badge-font-color"?: string; + /** + * Background color of the modified badge in the Liveboard header. + */ + "--ts-var-liveboard-header-badge-modified-background"?: string; + /** + * Font color of the modified badge in the Liveboard header. + */ + "--ts-var-liveboard-header-badge-modified-font-color"?: string; + /** + * Font color of the badge in the Liveboard header on hover. + */ + "--ts-var-liveboard-header-badge-hover-color"?: string; + /** + * Font color of the badge in the Liveboard header on active. + */ + "--ts-var-liveboard-header-badge-active-color"?: string; + /** + * Font color of the hero text in the KPI widget. + */ + "--ts-var-kpi-hero-color"?: string; + /** + * Font color of the comparison text in the KPI widget. + */ + "--ts-var-kpi-comparison-color"?: string; + /** + * Font color of the analyze text in the KPI widget. + */ + "--ts-var-kpi-analyze-text-color"?: string; + /** + * Font color of the legend title in the heatmap chart. + */ + "--ts-var-chart-heatmap-legend-title-color"?: string; + /** + * Font color of the legend label in the heatmap chart. + */ + "--ts-var-chart-heatmap-legend-label-color"?: string; + /** + * Font color of the legend title in the treemap chart. + */ + "--ts-var-chart-treemap-legend-title-color"?: string; + /** + * Font color of the legend label in the treemap chart. + */ + "--ts-var-chart-treemap-legend-label-color"?: string; + /** + * Color of the positive change in the KPI. + */ + "--ts-var-kpi-positive-change-color"?: string; + /** + * Color of the negative change in the KPI. + */ + "--ts-var-kpi-negative-change-color"?: string; + /** + * Background color of the change analysis insights. + */ + "--ts-var-change-analysis-insights-background"?: string; + /** + * Background color of the forecasting card in the SpotIQ analyze. + */ + "--ts-var-spotiq-analyze-forecasting-card-background"?: string; + /** + * Background color of the outlier card in the SpotIQ analyze. + */ + "--ts-var-spotiq-analyze-outlier-card-background"?: string; + /** + * Background color of the trend card in the SpotIQ analyze. + */ + "--ts-var-spotiq-analyze-trend-card-background"?: string; + /** + * Background color of the crosscorrelation card in the SpotIQ analyze. + */ + "--ts-var-spotiq-analyze-crosscorrelation-card-background"?: string; + /** + * Background color of the summary header in the CCA modal. + */ + "--ts-var-cca-modal-summary-header-background"?: string; +} +export interface SessionInterface { + sessionId: string; + genNo: number; + acSession: { + sessionId: string; + genNo: number; + }; +} +export interface UnderlyingDataPoint { + columnId: string; + dataValue: any; +} +/** + * AnswerService provides a simple way to work with ThoughtSpot Answers. + * + * This service allows you to interact with ThoughtSpot Answers programmatically, + * making it easy to customize visualizations, filter data, and extract insights + * directly from your application. + * + * You can use this service to: + * + * - Add or remove columns from Answers (`addColumns`, `removeColumns`, `addColumnsByName`) + * - Apply filters to Answers (`addFilter`) + * - Get data from Answers in different formats (JSON, CSV, PNG) (`fetchData`, `fetchCSVBlob`, `fetchPNGBlob`) + * - Get data for specific points in visualizations (`getUnderlyingDataForPoint`) + * - Run custom queries (`executeQuery`) + * - Add visualizations to Liveboards (`addDisplayedVizToLiveboard`) + * + * @example + * ```js + * // Get the answer service + * embed.on(EmbedEvent.Data, async (e) => { + * const service = await embed.getAnswerService(); + * + * // Add columns to the answer + * await service.addColumnsByName(["Sales", "Region"]); + * + * // Get the data + * const data = await service.fetchData(); + * console.log(data); + * }); + * ``` + * + * @example + * ```js + * // Get data for a point in a visualization + * embed.on(EmbedEvent.CustomAction, async (e) => { + * const underlying = await e.answerService.getUnderlyingDataForPoint([ + * 'Product Name', + * 'Sales Amount' + * ]); + * + * const data = await underlying.fetchData(0, 100); + * console.log(data); + * }); + * ``` + * + * @version SDK: 1.25.0| ThoughtSpot: 9.10.0.cl + * @group Events + */ +export declare class AnswerService { + private session; + private thoughtSpotHost; + private selectedPoints?; + private answer; + private tmlOverride; + /** + * Should not need to be called directly. + * @param session + * @param answer + * @param thoughtSpotHost + * @param selectedPoints + */ + constructor(session: SessionInterface, answer: any, thoughtSpotHost: string, selectedPoints?: VizPoint[]); + /** + * Get the details about the source used in the answer. + * This can be used to get the list of all columns in the data source for example. + */ + getSourceDetail(): Promise; + /** + * Remove columnIds and return updated answer session. + * @param columnIds + * @returns + */ + removeColumns(columnIds: string[]): Promise; + /** + * Add columnIds and return updated answer session. + * @param columnIds + * @returns + */ + addColumns(columnIds: string[]): Promise; + /** + * Add columns by names and return updated answer session. + * @param columnNames + * @returns + * @example + * ```js + * embed.on(EmbedEvent.Data, async (e) => { + * const service = await embed.getAnswerService(); + * await service.addColumnsByName([ + * "col name 1", + * "col name 2" + * ]); + * console.log(await service.fetchData()); + * }); + */ + addColumnsByName(columnNames: string[]): Promise; + /** + * Add a filter to the answer. + * @param columnName + * @param operator + * @param values + * @returns + */ + addFilter(columnName: string, operator: RuntimeFilterOp, values: RuntimeFilter["values"]): Promise; + getSQLQuery(): Promise; + /** + * Fetch data from the answer. + * @param offset + * @param size + * @returns + */ + fetchData(offset?: number, size?: number): Promise<{ + columns: any; + data: any; + }>; + /** + * Fetch the data for the answer as a CSV blob. This might be + * quicker for larger data. + * @param userLocale + * @param includeInfo Include the CSV header in the output + * @returns Response + */ + fetchCSVBlob(userLocale?: string, includeInfo?: boolean): Promise; + /** + * Fetch the data for the answer as a PNG blob. This might be + * quicker for larger data. + * @param userLocale + * @param includeInfo + * @param omitBackground Omit the background in the PNG + * @param deviceScaleFactor The scale factor for the PNG + * @return Response + */ + fetchPNGBlob(userLocale?: string, omitBackground?: boolean, deviceScaleFactor?: number): Promise; + /** + * Just get the internal URL for this answer's data + * as a CSV blob. + * @param userLocale + * @param includeInfo + * @returns + */ + getFetchCSVBlobUrl(userLocale?: string, includeInfo?: boolean): string; + /** + * Just get the internal URL for this answer's data + * as a PNG blob. + * @param userLocale + * @param omitBackground + * @param deviceScaleFactor + */ + getFetchPNGBlobUrl(userLocale?: string, omitBackground?: boolean, deviceScaleFactor?: number): string; + /** + * Get underlying data given a point and the output column names. + * In case of a context menu action, the selectedPoints are + * automatically passed. + * @param outputColumnNames + * @param selectedPoints + * @example + * ```js + * embed.on(EmbedEvent.CustomAction, e => { + * const underlying = await e.answerService.getUnderlyingDataForPoint([ + * 'col name 1' // The column should exist in the data source. + * ]); + * const data = await underlying.fetchData(0, 100); + * }) + * ``` + * @version SDK: 1.25.0| ThoughtSpot: 9.10.0.cl + */ + getUnderlyingDataForPoint(outputColumnNames: string[], selectedPoints?: UnderlyingDataPoint[]): Promise; + /** + * Execute a custom graphql query in the context of the answer. + * @param query graphql query + * @param variables graphql variables + * @returns + */ + executeQuery(query: string, variables: any): Promise; + /** + * Get the internal session details for the answer. + * @returns + */ + getSession(): SessionInterface; + getAnswer(): Promise; + getTML(): Promise; + addDisplayedVizToLiveboard(liveboardId: string): Promise; + setTMLOverride(override: any): void; +} +/** + * The authentication mechanism for allowing access to the + * the embedded app + * @group Authentication / Init + */ +export declare enum AuthType { + /** + * No authentication on the SDK. Pass-through to the embedded App. Alias for + * `Passthrough`. + * @example + * ```js + * init({ + * // ... + * authType: AuthType.None, + * }); + * ``` + */ + None = "None", + /** + * Passthrough SSO to the embedded application within the iframe. Requires least + * configuration, but may not be supported by all IDPs. This will behave like `None` + * if SSO is not configured on ThoughtSpot. + * + * To use this: + * Your SAML or OpenID provider must allow iframe redirects. + * For example, if you are using Okta as IdP, you can enable iframe embedding. + * @example + * ```js + * init({ + * // ... + * authType: AuthType.EmbeddedSSO, + * }); + * ``` + * @version: SDK: 1.15.0 | ThoughtSpot: 8.8.0.cl + */ + EmbeddedSSO = "EmbeddedSSO", + /** + * SSO using SAML + * @deprecated Use {@link SAMLRedirect} instead + * @hidden + */ + SSO = "SSO_SAML", + /** + * SSO using SAML + * @deprecated Use {@link SAMLRedirect} instead + * @hidden + */ + SAML = "SSO_SAML", + /** + * SSO using SAML + * Makes the host application redirect to the SAML IdP. Use this + * if your IdP does not allow itself to be embedded. + * + * This redirects the host application to the SAML IdP. The host application + * will be redirected back to the ThoughtSpot app after authentication. + * @example + * ```js + * init({ + * // ... + * authType: AuthType.SAMLRedirect, + * }); + * ``` + * + * This opens the SAML IdP in a popup window. The popup is triggered + * when the user clicks the trigger button. The popup window will be + * closed automatically after authentication. + * @example + * ```js + * init({ + * // ... + * authType: AuthType.SAMLRedirect, + * authTriggerText: 'Login with SAML', + * authTriggerContainer: '#tsEmbed', + * inPopup: true, + * }); + * ``` + * + * Can also use the event to trigger the popup flow. Works the same + * as the above example. + * @example + * ```js + * const authEE = init({ + * // ... + * authType: AuthType.SAMLRedirect, + * inPopup: true, + * }); + * + * someButtonOnYourPage.addEventListener('click', () => { + * authEE.emit(AuthEvent.TRIGGER_SSO_POPUP); + * }); + * ``` + */ + SAMLRedirect = "SSO_SAML", + /** + * SSO using OIDC + * @hidden + * @deprecated Use {@link OIDCRedirect} instead + */ + OIDC = "SSO_OIDC", + /** + * SSO using OIDC + * Will make the host application redirect to the OIDC IdP. + * See code samples in {@link SAMLRedirect}. + */ + OIDCRedirect = "SSO_OIDC", + /** + * Trusted authentication server + * @hidden + * @deprecated Use {@link TrustedAuth} instead + */ + AuthServer = "AuthServer", + /** + * Trusted authentication server. Use your own authentication server + * which returns a bearer token, generated using the `secret_key` obtained + * from ThoughtSpot. + * @example + * ```js + * init({ + * // ... + * authType: AuthType.TrustedAuthToken, + * getAuthToken: () => { + * return fetch('https://my-backend.app/ts-token') + * .then((response) => response.json()) + * .then((data) => data.token); + * } + * }); + * ``` + */ + TrustedAuthToken = "AuthServer", + /** + * Trusted authentication server Cookieless, Use your own authentication + * server which returns a bearer token, generated using the `secret_key` + * obtained from ThoughtSpot. This uses a cookieless authentication + * approach, recommended to bypass the third-party cookie-blocking restriction + * implemented by some browsers. + * @example + * ```js + * init({ + * // ... + * authType: AuthType.TrustedAuthTokenCookieless, + * getAuthToken: () => { + * return fetch('https://my-backend.app/ts-token') + * .then((response) => response.json()) + * .then((data) => data.token); + * } + * ``` + * @version SDK: 1.22.0| ThoughtSpot: 9.3.0.cl, 9.5.1.sw + */ + TrustedAuthTokenCookieless = "AuthServerCookieless", + /** + * Use the ThoughtSpot login API to authenticate to the cluster directly. + * + * Warning: This feature is primarily intended for developer testing. It is + * strongly advised not to use this authentication method in production. + */ + Basic = "Basic" +} +/** + * + * This option does not apply to the classic homepage experience. + * To access the updated modular homepage, + * set `modularHomeExperience` to `true` + * (available as Early Access feature in 9.12.5.cl). + * + */ +export declare enum HomeLeftNavItem { + /** + * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl + */ + SearchData = "search-data", + /** + * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl + */ + Home = "insights-home", + /** + * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl + */ + Liveboards = "liveboards", + /** + * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl + */ + Answers = "answers", + /** + * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl + */ + MonitorSubscription = "monitor-alerts", + /** + * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl + */ + SpotIQAnalysis = "spotiq-analysis", + /** + * @version SDK: 1.34.0| ThoughtSpot: 10.3.0.cl + */ + LiveboardSchedules = "liveboard-schedules", + /** + * Create new options in the insights left navigation, + * available when new navigation V3 is enabled. + * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl + */ + Create = "create", + /** + * Spotter option in the insights left navigation, + * available when new navigation V3 is enabled. + * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl + */ + Spotter = "spotter", + /** + * Favorites option in the insights left navigation, + * available when new navigation V3 is enabled. + * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl + */ + Favorites = "favorites" +} +export type DOMSelector = string | HTMLElement; +/** + * inline customCSS within the {@link CustomisationsInterface}. + * Use {@link CustomCssVariables} or css rules. + */ +export interface customCssInterface { + /** + * The custom css variables, which can be set. + * The variables are available in the {@link CustomCssVariables} + * interface. For more information, see + * link:https://developers.thoughtspot.com/docs/css-variables-reference[CSS variable reference]. + */ + variables?: CustomCssVariables; + /** + * Can be used to define a custom font face + * like: + * @example + * ```js + * rules_UNSTABLE?: { + * "@font-face": { + * "font-family": "custom-font", + * "src": url("/path/") + * }; + * }; + * ``` + * + * Also, custom css rules outside of variables. + * @example + * ```js + * rules_UNSTABLE?: { + * ".thoughtspot_class_name": { + * "border-radius": "10px", + * margin: "20px" + * }; + * }; + * ``` + */ + rules_UNSTABLE?: { + [selector: string]: { + [declaration: string]: string; + }; + }; +} +/** + * Styles within the {@link CustomisationsInterface}. + */ +export interface CustomStyles { + customCSSUrl?: string; + customCSS?: customCssInterface; +} +/** + * Configuration to define the customization on the Embedded + * ThoughtSpot components. + * You can customize styles, text strings, and icons. + * For more information, see link:https://developers.thoughtspot.com/docs/custom-css[CSS customization framework]. + * @example + * ```js + * init({ + * // ... + * customizations: { + * style: { + * customCSS: { + * variables: {}, + * rules_UNSTABLE: {} + * } + * }, + * content: { + * strings: { + * 'LIVEBOARDS': 'Dashboards', + * 'ANSWERS': 'Visualizations', + * 'Edit': 'Modify', + * 'Show underlying data': 'Show source data', + * 'SpotIQ': 'Insights', + * 'Monitor': 'Alerts', + * } + * }, + * iconSpriteUrl: 'https://my-custom-icon-sprite.svg' + * } + * }) + * ``` + */ +export interface CustomisationsInterface { + style?: CustomStyles; + content?: { + /** + * @version SDK: 1.26.0 | 9.7.0.cl + */ + strings?: Record; + stringIDs?: Record; + stringIDsUrl?: string; + [key: string]: any; + }; + iconSpriteUrl?: string; +} +/** + * The configuration object for embedding ThoughtSpot content. + * It includes the ThoughtSpot hostname or IP address, + * the type of authentication, and the authentication endpoint + * if a trusted authentication server is used. + * @group Authentication / Init + */ +export interface EmbedConfig { + /** + * The ThoughtSpot cluster hostname or IP address. + */ + thoughtSpotHost: string; + /** + * The authentication mechanism to use. + */ + authType: AuthType; + /** + * [AuthServer] The trusted authentication endpoint to use to get the + * authentication token. A `GET` request is made to the + * authentication API endpoint, which returns the token + * as a plaintext response. For trusted authentication, + * the `authEndpoint` or `getAuthToken` attribute is required. + */ + authEndpoint?: string; + /** + * [AuthServer] A function that invokes the trusted authentication endpoint + * and returns a Promise that resolves to the `auth token` string. + * For trusted authentication, the `authEndpoint` or `getAuthToken` + * attribute is required. + * + * It is advisable to fetch a new token inside this method and not + * reuse the old issued token. When auth expires this method is + * called again and if it is called with an older token, the authentication + * will not succeed. + */ + getAuthToken?: () => Promise; + /** + * [AuthServer / Basic] The user name of the ThoughtSpot user. This + * attribute is required for trusted authentication. + */ + username?: string; + /** + * [Basic] The ThoughtSpot login password corresponding to the username + * + * Warning: This feature is primarily intended for developer testing. It is + * strongly advised not to use this authentication method in production. + */ + password?: string; + /** + * [SSO] For SSO Authentication, if `noRedirect` is set to true, it will + * open the SAML auth flow in a popup, instead of redirecting the browser in + * place. + * @default false + * @deprecated + */ + noRedirect?: boolean; + /** + * [SSO] For SSO Authentication, if `inPopup` is set to true, it will open + * the SAML auth flow in a popup, instead of redirecting the browser in place. + * + * Need to use this with `authTriggerContainer`. Or manually trigger + * the `AuthEvent.TRIGGER_SSO_POPUP` event on a user interaction. + * @default false + * @version SDK: 1.18.0 + */ + inPopup?: boolean; + /** + * [SSO] For SSO Authentication, one can supply an optional path param; + * This will be the path on the host origin where the SAML flow will be + * terminated. + * + * Eg: "/dashboard", "#/foo" [Do not include the host] + * @version SDK: 1.10.2 | ThoughtSpot 8.2.0.cl, 8.4.1.sw + */ + redirectPath?: string; + /** @internal */ + basepath?: string; + /** + * Boolean to define if the query parameters in the ThoughtSpot URL + * should be encoded in base64. This provides additional security to + * ThoughtSpot clusters against cross-site scripting attacks. + * @default false + */ + shouldEncodeUrlQueryParams?: boolean; + /** + * Suppress cookie access alert when third-party cookies are blocked by the + * user's browser. Third-party cookie blocking is the default behaviour on + * some web browsers like Safari. If you set this attribute to `true`, + * you are encouraged to handle `noCookieAccess` event, to show your own treatment + * in this case. + * @default false + */ + suppressNoCookieAccessAlert?: boolean; + /** + * Ignore the cookie access alert when third-party cookies are blocked by the + * user's browser. If you set this to `true`, the embedded iframe behaviour + * persists even in the case of a non-logged-in user. + * @default false + */ + ignoreNoCookieAccess?: boolean; + /** + * Re-login a user with the previous login options + * when a user session expires. + * @default false + */ + autoLogin?: boolean; + /** + * Disable redirection to the login page when the embedded session expires + * This flag is typically used alongside the combination of authentication modes such + * as {@link AuthType.AuthServer} and auto-login behavior {@link + * EmbedConfig.autoLogin} + * @version SDK: 1.9.3 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw + * @default false + */ + disableLoginRedirect?: boolean; + /** + * This message is displayed in the embedded view when a user login fails. + * @version SDK: 1.10.1 | ThoughtSpot: 8.2.0.cl, 8.4.1.sw + */ + loginFailedMessage?: string; + /** + * Calls the prefetch method internally when set to `true` + * @default false + */ + callPrefetch?: boolean; + /** + * When there are multiple objects embedded, queue the rendering of embedded objects + * to start after the previous embed's render is complete. This helps improve + * performance by decreasing the load on the browser. + * @Version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1 + * @default false + */ + queueMultiRenders?: boolean; + /** + * [AuthServer|Basic] Detect if third-party party cookies are enabled by doing an + * additional call. This is slower and should be avoided. Listen to the + * `NO_COOKIE_ACCESS` event to handle the situation. + * + * This is slightly slower than letting the browser handle the cookie check, as it + * involves an extra network call. + * @version SDK: 1.10.4 | ThoughtSpot: 8.2.0.cl, 8.4.1.sw + */ + detectCookieAccessSlow?: boolean; + /** + * Hide the `beta` alert warning message for SearchEmbed. + * @version SDK: 1.12.0 | ThoughtSpot: 8.4.0.cl, 8.4.1.sw* + */ + suppressSearchEmbedBetaWarning?: boolean; + /** + * Hide `beta` alert warning message for SageEmbed. + * + */ + suppressSageEmbedBetaWarning?: boolean; + /** + * Custom style params for embed Config. + * @version SDK: 1.17.0 | ThoughtSpot: 8.9.0.cl, 9.0.1.sw + */ + customizations?: CustomisationsInterface; + /** + * For `inPopup` SAMLRedirect or OIDCRedirect authentication, we need a + * button that the user can click to trigger the flow. + * This attribute sets a containing element for that button. + * @example + * ```js + * init({ + * authType: AuthType.SAMLRedirect, + * inPopup: true, + * authTriggerContainer: '#auth-trigger-container' + * }) + * ``` + * @version SDK: 1.17.0 | ThoughtSpot: 8.9.0.cl, 9.0.1.sw + */ + authTriggerContainer?: string | HTMLElement; + /** + * Specify that we want to use the `AuthEvent.TRIGGER_SSO_POPUP` event to trigger + * SAML popup. This is useful when you want to trigger the popup on a custom user + * action. + * + */ + useEventForSAMLPopup?: boolean; + /** + * Text to show in the button which triggers the popup auth flow. + * Default: `Authorize`. + * @version SDK: 1.17.0 | ThoughtSpot: 8.9.0.cl, 9.0.1.sw + */ + authTriggerText?: string; + /** + * Prevent users from accessing the full application or ThoughtSpot application pages + * access to the embedded application users + * outside of the iframe. + * @default true + * @version SDK: 1.22.0 | ThoughtSpot: 9.3.0.cl, 9.5.1.sw + */ + blockNonEmbedFullAppAccess?: boolean; + /** + * Host config in case embedded app is inside TS app itself + * @hidden + */ + hostConfig?: { + hostUserGuid: string; + hostClusterId: string; + hostClusterName: string; + }; + /** + * Pendo API key to enable Pendo tracking to your own subscription, the key + * is added as an additional key to the embed, as per this link:https://support.pendo.io/hc/en-us/articles/360032201951-Send-data-to-multiple-subscriptions[document]. + * @version SDK: 1.27.0 | ThoughtSpot: 9.8.0.cl + */ + pendoTrackingKey?: string; + /** + * If passed as true all alerts will be suppressed in the embedded app. + * @version SDK: 1.26.2 | ThoughtSpot: * + */ + suppressErrorAlerts?: boolean; + /** + * Suppress or show specific types of logs in the console output. + * For example, `LogLevel.ERROR` shows only Visual Embed SDK and + * ThoughtSpot application errors and suppresses + * other logs such as warnings, information alerts, + * and debug messages in the console output. + * + * @default LogLevel.ERROR + * @example + * ```js + * init({ + * ...embedConfig, + * logLevel: LogLevel.SILENT + * }) + * ``` + * @version SDK: 1.26.7 | ThoughtSpot: 9.10.0.cl + */ + logLevel?: LogLevel; + /** + * Disables the Mixpanel tracking from the SDK. + * @version SDK: 1.27.9 + */ + disableSDKTracking?: boolean; + /** + * Overrides default/user preferred locale for date formatting + * @version SDK: 1.28.4 | ThoughtSpot: 10.0.0.cl, 9.5.0.sw + */ + dateFormatLocale?: string; + /** + * Overrides default/user preferred locale for number formatting + * @version SDK: 1.28.4 | ThoughtSpot: 10.0.0.cl, 9.5.0.sw + */ + numberFormatLocale?: string; + /** + * Format to be used for currency when currency format is set to infer from browser + * @version SDK: 1.28.4 | ThoughtSpot: 10.0.0.cl, 9.5.0.sw + */ + currencyFormat?: string; + /** + * This flag is used to disable the token verification in the SDK. + * Enabling this flag will also disable the caching of the token. + * @hidden + * @example + * ```js + * init({ + * ...embedConfig, + * disableTokenVerification : true + * }) + * ``` + * @version SDK: 1.28.5 | ThoughtSpot: 9.10.0.cl, 10.1.0.sw + */ + disableTokenVerification?: boolean; + /** + * This flag is used to disable showing the login failure page in the embedded app. + * @version SDK 1.32.3 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw + */ + disableLoginFailurePage?: boolean; + /** + * This is an object (key/val) of override flags which will be applied + * to the internal embedded object. This can be used to add any + * URL flag. + * Warning: This option is for advanced use only and is used internally + * to control embed behavior in non-regular ways. We do not publish the + * list of supported keys and values associated with each. + * @example + * ```js + * const embed = new LiveboardEmbed('#embed', { + * ... // other liveboard view config + * additionalFlags: { + * flag1: 'value1', + * flag2: 'value2' + * } + * }); + * ``` + * @version SDK: 1.33.5 | ThoughtSpot: * + */ + additionalFlags?: { + [key: string]: string | number | boolean; + }; + /** + * This is an object (key/val) for customVariables being + * used by the third party tool's script. + * @example + * ```js + * const embed = new LiveboardEmbed('#embed', { + * ... // other liveboard view config + * customVariablesForThirdPartyTools: { + * key1: 'value1', + * key2: 'value2' + * } + * }); + * ``` + * @version SDK 1.37.0 | ThoughtSpot: 10.8.0.cl + */ + customVariablesForThirdPartyTools?: Record; + disablePreauthCache?: boolean; + /** + * Disable fullscreen presentation mode functionality. When enabled, prevents entering + * and exiting fullscreen mode for embedded visualizations during presentations. + * @default true (feature is disabled by default) + * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl + * @example + * ```js + * init({ + * ... // other embed config options + * disableFullscreenPresentation: false, // enables the feature + * }) + * ``` + */ + disableFullscreenPresentation?: boolean; + /** + * Custom Actions allows users to define interactive UI actions (like buttons or menu + * items) that appear in ThoughtSpot's visualizations, answers, and Liveboards. These + * actions enable users to trigger custom workflows — such as navigating to an + * external app, calling an API, or opening a modal — based on the data context of + * what they clicked can be used to trigger custom logic when the action is clicked. + * @version SDK: 1.43.0 | ThoughtSpot: 10.14.0.cl + * @example + * ```js + * import { CustomActionPosition, CustomActionTarget } from '@thoughtspot/visual-embed-sdk'; + * init({ + * ... // other embed config options + * customActions: [ + * { + * name: 'customAction', + * id: 'customAction', + * target: CustomActionTarget.VISUALIZATION, + * position: CustomActionPosition.PRIMARY, + * } + * } + * ] + * }) + * ``` + */ + customActions?: CustomAction[]; +} +export interface LayoutConfig { +} +/** + * Embedded iframe configuration + * @group Embed components + */ +export interface FrameParams { + /** + * The width of the iframe (unit is pixels if numeric). + */ + width?: number | string; + /** + * The height of the iframe (unit is pixels if numeric). + */ + height?: number | string; + /** + * Set to 'lazy' to enable lazy loading of the embedded TS frame. + * This will defer loading of the frame until it comes into the + * viewport. This is useful for performance optimization. + */ + loading?: "lazy" | "eager" | "auto"; + /** + * This parameters will be passed on the iframe + * as is. + */ + [key: string]: string | number | boolean | undefined; +} +/** + * The common configuration object for an embedded view. + */ +export interface BaseViewConfig { + /** + * @hidden + */ + layoutConfig?: LayoutConfig; + /** + * The width and height dimensions to render an embedded + * object inside your app. Specify the values in pixels or percentage. + * + * Supported embed types: `AppEmbed`, `LiveboardEmbed`, `SageEmbed`, `SearchEmbed`, `SpotterAgentEmbed`, `SpotterEmbed`, `SearchBarEmbed` + * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 7.2.1 + * @example + * ```js + * // Replace with embed component name. For example, AppEmbed, SearchEmbed, or LiveboardEmbed + * const embed = new ('#tsEmbed', { + * ... // other embed view config + * frameParams: { + * width: '500px' | '50%', + * height: '400px' | '60%', + * }, + * }) + * ``` + */ + frameParams?: FrameParams; + /** + * @hidden + */ + theme?: string; + /** + * @hidden + */ + styleSheet__unstable?: string; + /** + * The list of actions to disable from the primary menu, more menu + * (...), and the contextual menu. These actions will be disabled + * for the user. + * Use this to disable actions. + * + * Supported embed types: `AppEmbed`, `LiveboardEmbed`, `SageEmbed`, `SearchEmbed`, `SpotterAgentEmbed`, `SpotterEmbed`, `SearchBarEmbed` + * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw + * @example + * ```js + * // Replace with embed component name. For example, AppEmbed, SearchEmbed, or LiveboardEmbed + * const embed = new ('#tsEmbed', { + * ... // other embed view config + * disabledActions: [Action.Download, Action.Save], + * }); + * ``` + */ + disabledActions?: Action[]; + /** + * The tooltip to display for disabled actions. + * + * Supported embed types: `AppEmbed`, `LiveboardEmbed`, `SageEmbed`, `SearchEmbed`, `SpotterAgentEmbed`, `SpotterEmbed`, `SearchBarEmbed` + * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw + * @example + * ```js + * // Replace with embed component name. For example, AppEmbed, SearchEmbed, or LiveboardEmbed + * const embed = new ('#tsEmbed', { + * ... // other embed view config + * disabledActions: [Action.Download, Action.Save], + * disabledActionReason: "Reason for disabling", + * }); + * ``` + */ + disabledActionReason?: string; + /** + * The list of actions to hide from the embedded. + * This actions will be hidden from the user. + * Use this to hide an action. + * + * Supported embed types: `AppEmbed`, `LiveboardEmbed`, `SageEmbed`, `SearchEmbed`, `SpotterAgentEmbed`, `SpotterEmbed`, `SearchBarEmbed` + * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw + * @example + * ```js + * // Replace with embed component name. For example, AppEmbed, SearchEmbed, or LiveboardEmbed + * const embed = new ('#tsEmbed', { + * ... // other embed view config + * hiddenActions: [Action.Download, Action.Export], + * }); + * ``` + * @important + */ + hiddenActions?: Action[]; + /** + * The list of actions to display from the primary menu, more menu + * (...), and the contextual menu. These will be only actions that + * are visible to the user. + * Use this to hide all actions except the ones you want to show. + * + * Use either this or hiddenActions. + * + * Supported embed types: `AppEmbed`, `LiveboardEmbed`, `SageEmbed`, `SearchEmbed`, `SpotterAgentEmbed`, `SpotterEmbed`, `SearchBarEmbed` + * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw + * @important + * @example + * ```js + * // Replace with embed component name. For example, AppEmbed, SearchEmbed, or LiveboardEmbed + * const embed = new ('#tsEmbed', { + * ... // other embed view config + * visibleActions: [Action.Download, Action.Export], + * }); + * ``` + */ + visibleActions?: Action[]; + /** + * The locale settings to apply to the embedded view. + * + * Supported embed types: `AppEmbed`, `LiveboardEmbed`, `SageEmbed`, `SearchEmbed`, `SpotterAgentEmbed`, `SpotterEmbed`, `SearchBarEmbed` + * @version SDK: 1.9.4 | ThoughtSpot 8.1.0.cl, 8.4.1.sw + * @example + * ```js + * // Replace with embed component name. For example, AppEmbed, SearchEmbed, or LiveboardEmbed + * const embed = new ('#tsEmbed', { + * ... // other embed view config + * locale:'en', + * }) + * ``` + */ + locale?: string; + /** + * This is an object (key/val) of override flags which will be applied + * to the internal embedded object. This can be used to add any + * URL flag. + * If the same flags are passed in init, they will be overriden by the values here. + * Warning: This option is for advanced use only and is used internally + * to control embed behavior in non-regular ways. We do not publish the + * list of supported keys and values associated with each. + * + * Supported embed types: `AppEmbed`, `LiveboardEmbed`, `SageEmbed`, `SearchEmbed`, `SpotterAgentEmbed`, `SpotterEmbed`, `SearchBarEmbed` + * @example + * ```js + * // Replace with embed component name. For example, AppEmbed, SearchEmbed, or LiveboardEmbed + * const embed = new ('#tsEmbed', { + * ... // other embed view config + * additionalFlags: { + * flag1: 'value1', + * flag2: 'value2' + * }, + * }); + * ``` + * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw + */ + additionalFlags?: { + [key: string]: string | number | boolean; + }; + /** + * Dynamic CSSUrl and customCSS to be injected in the loaded application. + * You would also need to set `style-src` in the CSP settings. + * @version SDK: 1.17.2 | ThoughtSpot: 8.4.1.sw, 8.4.0.cl + * @default '' + */ + customizations?: CustomisationsInterface; + /** + * Insert as a sibling of the target container, instead of appending to a + * child inside it. + * + * Supported embed types: `AppEmbed`, `LiveboardEmbed`, `SageEmbed`, `SearchEmbed`, `SpotterAgentEmbed`, `SpotterEmbed`, `SearchBarEmbed` + * @version SDK: 1.2.0 | ThoughtSpot: 9.0.0.cl, 9.0.0.sw + * @example + * ```js + * // Replace with embed component name. For example, AppEmbed, SearchEmbed, or LiveboardEmbed + * const embed = new ('#tsEmbed', { + * ... // other embed view config + * insertAsSibling:true, + * }) + * ``` + */ + insertAsSibling?: boolean; + /** + * Use a pre-rendered iframe from a pool of pre-rendered iframes + * if available and matches the configuration. + * @version SDK: 1.22.0 + * @hidden + * + * See [docs]() on how to create a prerender pool. + */ + usePrerenderedIfAvailable?: boolean; + /** + * PreRender id to be used for PreRendering the embed. + * Use PreRender to render the embed in the background and then + * show or hide the rendered embed using showPreRender or hidePreRender respectively. + * + * Supported embed types: `AppEmbed`, `LiveboardEmbed`, `SageEmbed`, `SearchEmbed`, `SpotterAgentEmbed`, `SpotterEmbed`, `SearchBarEmbed` + * @example + * ```js + * // Replace with embed component name. For example, AppEmbed, SearchEmbed, or LiveboardEmbed + * const embed = new ('#tsEmbed', { + * ... // other embed view config + * preRenderId: "preRenderId-123", + * }); + * embed.showPreRender(); + * ``` + * @version SDK: 1.25.0 | ThoughtSpot: 9.6.0.cl, 9.8.0.sw + */ + preRenderId?: string; + /** + * Determines if the PreRender component should dynamically track the size + * of its embedding element and adjust its own size accordingly. + * Enabling this option allows the PreRender component to automatically adapt + * its dimensions based on changes to the size of the embedding element. + * @type {boolean} + * @default false + * @version SDK: 1.24.0 | ThoughtSpot:9.4.0.cl, 9.4.0.sw + * @example + * ```js + * // Disable tracking PreRender size in the configuration + * const config = { + * doNotTrackPreRenderSize: true, + * }; + * + * // Instantiate an object with the configuration + * const myComponent = new MyComponent(config); + * ``` + */ + doNotTrackPreRenderSize?: boolean; + /** + * Enable the V2 shell. This can provide performance benefits + * due to a lighterweight shell. + * + * Supported embed types: `AppEmbed`, `LiveboardEmbed`, `SageEmbed`, `SearchEmbed`, `SpotterAgentEmbed`, `SpotterEmbed`, `SearchBarEmbed` + * @example + * ```js + * // Replace with embed component name. For example, AppEmbed, SearchEmbed, or LiveboardEmbed + * const embed = new ('#tsEmbed', { + * ... // other embed view config + * enableV2Shell_experimental: true, + * }); + * ``` + * @version SDK: 1.31.2 | ThoughtSpot: 10.0.0.cl + */ + enableV2Shell_experimental?: boolean; + /** + * For internal tracking of the embed component type. + * @hidden + */ + embedComponentType?: string; + /** + * This flag can be used to expose translation IDs on the embedded app. + * @default false + * @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl + */ + exposeTranslationIDs?: boolean; + /** + * This flag can be used to disable links inside the embedded app, + * and disable redirection of links in a new tab. + * + * Supported embed types: `AppEmbed`, `LiveboardEmbed`, `SageEmbed`, `SearchEmbed`, `SpotterAgentEmbed`, `SpotterEmbed`, `SearchBarEmbed` + * @example + * ```js + * // Replace with embed component name. For example, AppEmbed, SearchEmbed, or LiveboardEmbed + * const embed = new ('#tsEmbed', { + * ... // other embed view config + * disableRedirectionLinksInNewTab: true, + * }); + * ``` + * @version SDK: 1.32.1 | ThoughtSpot: 10.3.0.cl + */ + disableRedirectionLinksInNewTab?: boolean; + /** + * Overrides an Org context for embedding application users. + * This parameter allows a user authenticated to one Org to view the + * objects from another Org. + * The `overrideOrgId` setting is honoured only if the + * Per Org URL feature is enabled on your ThoughtSpot instance. + * + * Supported embed types: `AppEmbed`, `LiveboardEmbed`, `SageEmbed`, `SearchEmbed`, `SpotterAgentEmbed`, `SpotterEmbed`, `SearchBarEmbed` + * @example + * ```js + * // Replace with embed component name. For example, AppEmbed, SearchEmbed, or LiveboardEmbed + * const embed = new ('#tsEmbed', { + * ... // other embed view config + * overrideOrgId: 142536, + * }); + * ``` + * @version SDK: 1.35.0 | ThoughtSpot: 10.5.0.cl + */ + overrideOrgId?: number; + /** + * Flag to override the *Open Link in New Tab* context menu option. + * + * Supported embed types: `AppEmbed`, `LiveboardEmbed`, `SageEmbed`, `SearchEmbed`, `SpotterAgentEmbed`, `SpotterEmbed`, `SearchBarEmbed` + * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl + * @example + * ```js + * // Replace with embed component name. For example, AppEmbed, SearchEmbed, or LiveboardEmbed + * const embed = new ('#tsEmbed', { + * ... // other embed view config + * linkOverride:false, + * }) + * ``` + */ + linkOverride?: boolean; + /** + * The primary action to display on top of the viz for Liveboard and App Embed. + * Use this to set the primary action. + * + * Supported embed types: `AppEmbed`, `LiveboardEmbed` + * @version SDK: 1.39.0 | ThoughtSpot: 10.11.0.cl + * @example + * ```js + * // Replace with embed component name. For example, AppEmbed or LiveboardEmbed + * const embed = new ('#tsEmbed', { + * ... // other embed view config + * primaryAction: Action.Download + * }); + * ``` + */ + primaryAction?: Action | string; + /** + * flag to enable insert into slides action + * @hidden + * @private + */ + insertInToSlide?: boolean; + /** + * Show alert messages and toast messages in the embed. + * Supported embed in all embed types. + * + * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw + * @example + * ```js + * const embed = new AppEmbed('#tsEmbed', { + * ... // other embed view config + * showAlerts:true, + * }) + * ``` + */ + showAlerts?: boolean; + /** + * Custom Actions allows users to define interactive UI actions (like buttons or menu + * items) that appear in ThoughtSpot's visualizations, answers, and Liveboards. These + * actions enable users to trigger custom workflows — such as navigating to an + * external app, calling an API, or opening a modal — based on the data context of + * what they clicked can be used to trigger custom logic when the action is clicked. + * + * Supported embed types: `AppEmbed`, `LiveboardEmbed`, `SageEmbed`, `SearchEmbed`, `SpotterEmbed` + * @version SDK: 1.43.0 | ThoughtSpot: 10.14.0.cl + * @example + * ```js + * import { CustomActionPosition, CustomActionTarget } from '@thoughtspot/visual-embed-sdk'; + * // Use supported embed types such as AppEmbed or LiveboardEmbed + * const embed = new LiveboardEmbed('#tsEmbed', { + * ... // other embed config options + * customActions: [ + * { + * name: 'customAction', + * id: 'customAction', + * target: CustomActionTarget.VISUALIZATION, + * position: CustomActionPosition.PRIMARY, + * } + * } + * ] + * }) + * ``` + */ + customActions?: CustomAction[]; +} +/** + * The configuration object for Home page embeds configs. + */ +export interface HomePageConfig { + /** + * Hide list page columns + * For example: hiddenListColumns = [ListPageColumns.Author] + * + * **Note**: This option is currently available only in full app embedding and requires importing the ListPageColumns enum. + * At present, it can be used with Liveboard and Answer list pages, and starting with version 10.14.0.cl, it will also be supported for the Home page. + * + * Supported embed types: `AppEmbed` + * @version SDK: 1.38.0 | ThoughtSpot: 10.9.0.cl + * @example + * ```js + * import { ListPageColumns } from '@thoughtspot/visual-embed-sdk'; + * + * const embed = new AppEmbed('#tsEmbed', { + * ... //other embed view config + * hiddenListColumns : [ListPageColumns.Favorite,ListPageColumns.Author], + * }) + * ``` + */ + hiddenListColumns?: ListPageColumns[]; + /** + * Hide the home page modules + * For example: hiddenHomepageModules = [HomepageModule.MyLibrary] + * + * **Note**: This option does not apply to the classic homepage. + * To access the updated modular homepage, set + * `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl). + * To use it, you need to import `HomepageModule` enum. + * + * Supported embed types: `AppEmbed` + * @version SDK: 1.28.0 | ThoughtSpot: 9.12.5.cl, 10.1.0.sw + * @example + * ```js + * import { HomepageModule } from '@thoughtspot/visual-embed-sdk'; + * + * const embed = new AppEmbed('#tsEmbed', { + * ... //other embed view config + * hiddenHomepageModules : [HomepageModule.Favorite,HomepageModule.Learning], + * }) + * ``` + */ + hiddenHomepageModules?: HomepageModule[]; + /** + * reordering the home page modules + * eg: reorderedHomepageModules = [HomepageModule.MyLibrary, HomepageModule.Watchlist] + * + * **Note**: This option does not apply to the classic homepage. + * To access the updated modular homepage, set + * `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl). + * To use it, you need to import `HomepageModule` enum. + * + * Supported embed types: `AppEmbed` + * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl, 10.1.0.sw + * @example + * ```js + * import { HomepageModule } from '@thoughtspot/visual-embed-sdk'; + * + * const embed = new AppEmbed('#tsEmbed', { + * ... //other embed view config + * reorderedHomepageModules:[HomepageModule.Favorite,HomepageModule.MyLibrary], + * }) + * ``` + */ + reorderedHomepageModules?: HomepageModule[]; + /** + * homepageLeftNavItems : Show or hide the left navigation bar items. + * There are 8 eight home navigation list items. + * To hide these items, specify the string in the array. + * + * Supported embed types: `AppEmbed` + * @example + * ```js + * import { HomeLeftNavItem } from '@thoughtspot/visual-embed-sdk'; + * + * const embed = new AppEmbed('#tsEmbed', { + * ... //other embed view config + * hiddenHomeLeftNavItems : [HomeLeftNavItem.Home,HomeLeftNavItem.Answers], + * }) + * ``` + * + * **Note**: This option does not apply to the classic homepage. + * To access the updated modular homepage, set + * `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl). + * To use it, you need to import `HomeLeftNavItem` enum. + * @version SDK: 1.28.0 | ThoughtSpot: 9.12.5.cl, 10.1.0.sw + */ + hiddenHomeLeftNavItems?: HomeLeftNavItem[]; +} +/** + * The configuration object for common Search and Liveboard embeds configs. + */ +export interface SearchLiveboardCommonViewConfig { + /** + * The list of runtime filters to apply to a search Answer, + * visualization, or Liveboard. + * + * Supported embed types: `AppEmbed`, `LiveboardEmbed`, `SearchEmbed` + * @version SDK: 1.9.4 | ThoughtSpot 8.1.0.cl, 8.4.1.sw + * @example + * ```js + * // Replace with embed component name. For example, AppEmbed, SearchEmbed, or LiveboardEmbed + * const embed = new ('#tsEmbed', { + * ... // other embed view config + * runtimeFilters: [ + * { + * columnName: 'value', + * operator: RuntimeFilterOp.EQ, + * values: ['string' | 123 | true], + * }, + * ], + * }) + * ``` + */ + runtimeFilters?: RuntimeFilter[]; + /** + * The list of parameter override to apply to a search Answer, + * visualization, or Liveboard. + * + * Supported embed types: `AppEmbed`, `LiveboardEmbed`, `SearchEmbed` + * @version SDK : 1.25.0 | ThoughtSpot: 9.2.0.cl, 9.5.0.sw + * @example + * ```js + * // Replace with embed component name. For example, AppEmbed, SearchEmbed, or LiveboardEmbed + * const embed = new ('#tsEmbed', { + * ... // other embed view config + * runtimeParameters: [ + * { + * name: 'value', + * value: 'string' | 123 | true, + * }, + * ] + * }) + * ``` + */ + runtimeParameters?: RuntimeParameter[]; + /** + * flag to set ContextMenu Trigger to either left or right click. + * + * Supported embed types: `AppEmbed`, `SageEmbed`, `SearchEmbed` + * @example + * ```js + * // Replace with embed component name. For example, AppEmbed, SageEmbed, or SearchEmbed + * const embed = new ('#tsEmbed', { + * ... // other embed view config + * contextMenuTrigger:ContextMenuTriggerOptions.LEFT_CLICK || RIGHT_CLICK, + * }) + * ``` + * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl + */ + contextMenuTrigger?: ContextMenuTriggerOptions; + /** + * Boolean to exclude runtimeFilters in the URL + * By default it is true, this flag removes runtime filters from the URL + * when set to false, runtime filters will be included in the URL. + * + * Irrespective of this flag, runtime filters ( if passed ) will be applied to the + * embedded view. + * @default false + * @version SDK: 1.24.0 | ThoughtSpot: 9.5.0.cl + */ + excludeRuntimeFiltersfromURL?: boolean; + /** + * Boolean to exclude runtimeParameters from the URL + * when set to true, this flag removes runtime parameters from the URL. + * + * Irrespective of this flag, runtime filters ( if passed ) will be applied to the + * embedded view. + * @default false + * @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl + */ + excludeRuntimeParametersfromURL?: boolean; + /** + * To set the initial state of the search bar in case of saved Answers. + * + * Supported embed types: `SageEmbed`, `AppEmbed`, `SearchBarEmbed` + * @default true + * @version SDK: 1.34.0 | ThoughtSpot: 10.3.0.cl + * @example + * ```js + * // Replace with embed component name. For example, SageEmbed, AppEmbed, or SearchBarEmbed + * const embed = new ('#tsEmbed', { + * ... // other embed view config + * collapseSearchBar: true, + * }); + */ + collapseSearchBar?: boolean; + /** + * Flag to control Data panel experience + * + * Supported embed types: `SageEmbed`, `AppEmbed`, `SearchBarEmbed`, `LiveboardEmbed`, `SearchEmbed` + * @default true + * @version SDK: 1.43.0 | ThoughtSpot Cloud: 10.14.0.cl + * @example + * ```js + * // Replace with embed component name. For example, SageEmbed, AppEmbed, or SearchBarEmbed + * const embed = new ('#tsEmbed', { + * ... // other embed view config + * dataPanelV2: true, + * }) + * ``` + */ + dataPanelV2?: boolean; + /** + * To enable custom column groups in data panel v2 + * + * Supported embed types: `SageEmbed`, `SearchBarEmbed`, `LiveboardEmbed`, `SearchEmbed` + * @version SDK: 1.32.0 | ThoughtSpot: 10.0.0.cl, 10.1.0.sw + * @default false + * @example + * ```js + * // Replace with embed component name. For example, SageEmbed, SearchBarEmbed, or LiveboardEmbed + * const embed = new ('#tsEmbed', { + * ... // other embed view config + * enableCustomColumnGroups: true, + * }); + * ``` + */ + enableCustomColumnGroups?: boolean; +} +/** + * The configuration object for common Liveboard and App embeds configs. + */ +export interface LiveboardAppEmbedViewConfig { + /** + * Show or hide Liveboard header + * + * Supported embed types: `AppEmbed`, `LiveboardEmbed` + * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl + * @default false + * @example + * ```js + * // Replace with embed component name. For example, AppEmbed or LiveboardEmbed + * const embed = new ('#tsEmbed', { + * ... // other embed view config + * hideLiveboardHeader : true, + * }) + * ``` + */ + hideLiveboardHeader?: boolean; + /** + * Show or hide Liveboard title + * + * Supported embed types: `AppEmbed`, `LiveboardEmbed` + * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl + * @default false + * @example + * ```js + * // Replace with embed component name. For example, AppEmbed or LiveboardEmbed + * const embed = new ('#tsEmbed', { + * ... // other embed view config + * showLiveboardTitle:true, + * }) + * ``` + */ + showLiveboardTitle?: boolean; + /** + * Show or hide Liveboard description + * + * Supported embed types: `AppEmbed`, `LiveboardEmbed` + * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl + * @default false + * @example + * ```js + * // Replace with embed component name. For example, AppEmbed or LiveboardEmbed + * const embed = new ('#tsEmbed', { + * ... // other embed view config + * showLiveboardDescription:true, + * }) + * ``` + */ + showLiveboardDescription?: boolean; + /** + * Boolean to control if Liveboard header is sticky or not. + * + * Supported embed types: `AppEmbed`, `LiveboardEmbed` + * @example + * ```js + * // Replace with embed component name. For example, AppEmbed or LiveboardEmbed + * const embed = new ('#embed', { + * ... // other app view config + * isLiveboardHeaderSticky: true, + * }); + * ``` + * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl + */ + isLiveboardHeaderSticky?: boolean; + /** + * This attribute can be used to enable the two-column layout on an embedded Liveboard + * + * Supported embed types: `AppEmbed`, `LiveboardEmbed` + * @type {boolean} + * @default false + * @version SDK: 1.32.0 | ThoughtSpot:10.1.0.cl + * @example + * ```js + * // Replace with embed component name. For example, AppEmbed or LiveboardEmbed + * const embed = new ('#tsEmbed', { + * ... // other embed view config + * enable2ColumnLayout: true, + * }) + * ``` + */ + enable2ColumnLayout?: boolean; + /** + * This flag can be used to enable the compact header in Liveboard + * + * Supported embed types: `AppEmbed`, `LiveboardEmbed` + * @type {boolean} + * @default false + * @version SDK: 1.35.0 | ThoughtSpot:10.3.0.cl + * @example + * ```js + * // Replace with embed component name. For example, AppEmbed or LiveboardEmbed + * const embed = new ('#tsEmbed', { + * ... // other embed view config + * isLiveboardCompactHeaderEnabled: true, + * }) + * ``` + */ + isLiveboardCompactHeaderEnabled?: boolean; + /** + * This flag can be used to show or hide the Liveboard verified icon in the compact + * header. + * + * Supported embed types: `AppEmbed`, `LiveboardEmbed` + * @version SDK: 1.35.0 | ThoughtSpot:10.4.0.cl + * @default true + * @example + * ```js + * // Replace with embed component name. For example, AppEmbed or LiveboardEmbed + * const embed = new ('#tsEmbed', { + * ... // other embed view config + * showLiveboardVerifiedBadge: true, + * }) + * ``` + */ + showLiveboardVerifiedBadge?: boolean; + /** + * This flag is used to enable/disable hide irrelevant filters in Liveboard tab + * + * **Note**: This feature is supported only if compact header is enabled on your Liveboard. To enable compact header, use the `isLiveboardCompactHeaderEnabled` attribute. + * + * Supported embed types: `AppEmbed`, `LiveboardEmbed` + * @version SDK: 1.36.0 | ThoughtSpot:10.6.0.cl + * @default false + * @example + * ```js + * // Replace with embed component name. For example, AppEmbed or LiveboardEmbed + * const embed = new ('#tsEmbed', { + * ... // other embed view config + * hideIrrelevantChipsInLiveboardTabs: true, + * isLiveboardCompactHeaderEnabled: true, + * }) + * ``` + */ + hideIrrelevantChipsInLiveboardTabs?: boolean; + /** + * This flag can be used to show or hide the re-verify banner on the Liveboard + * compact header + * + * Supported embed types: `AppEmbed`, `LiveboardEmbed` + * @version SDK: 1.35.0 | ThoughtSpot:10.4.0.cl + * @default true + * @example + * ```js + * // Replace with embed component name. For example, AppEmbed or LiveboardEmbed + * const embed = new ('#tsEmbed', { + * ... // other embed view config + * showLiveboardReverifyBanner: true, + * }) + * ``` + */ + showLiveboardReverifyBanner?: boolean; + /** + * enable or disable ask sage + * + * Supported embed types: `AppEmbed`, `LiveboardEmbed` + * @version SDK: 1.29.0 | Thoughtspot: 9.12.0.cl + * @default false + * @example + * ```js + * // Replace with embed component name. For example, AppEmbed, SpotterEmbed, or LiveboardEmbed + * const embed = new ('#tsEmbed', { + * ... // other embed view config + * enableAskSage:true, + * }) + * ``` + */ + enableAskSage?: boolean; + /** + * This flag is used to show or hide checkboxes for including or excluding + * the cover and filters pages in the Liveboard PDF. + * + * Supported embed types: `AppEmbed`, `LiveboardEmbed` + * @version SDK: 1.40.0 | ThoughtSpot:10.8.0.cl + * @example + * ```js + * // Replace with embed component name. For example, AppEmbed or LiveboardEmbed + * const embed = new ('#tsEmbed', { + * ... // other embed view config + * coverAndFilterOptionInPDF: false, + * }) + * ``` + */ + coverAndFilterOptionInPDF?: boolean; + /** + * This flag is used to enable or disable the XLSX/CSV download option for Liveboards. + * + * Supported embed types: `AppEmbed`, `LiveboardEmbed` + * @version SDK: 1.41.0 | ThoughtSpot: 10.14.0.cl + * @example + * ```js + * // Replace with embed component name. For example, AppEmbed or LiveboardEmbed + * const embed = new ('#tsEmbed', { + * ... // other embed view config + * liveboardXLSXCSVDownload: true, + * }) + * ``` + */ + liveboardXLSXCSVDownload?: boolean; + /** + * This flag is used to enable or disable the link parameters in liveboard. + * + * Supported embed types: `AppEmbed`, `LiveboardEmbed` + * @version SDK: 1.42.0 | ThoughtSpot: 10.14.0.cl + * @example + * ```js + * // Replace with embed component name. For example, AppEmbed or LiveboardEmbed + * const embed = new ('#tsEmbed', { + * ... // other embed view config + * isLinkParametersEnabled: true, + * }) + * ``` + */ + isLinkParametersEnabled?: boolean; +} +export interface AllEmbedViewConfig extends BaseViewConfig, SearchLiveboardCommonViewConfig, HomePageConfig, LiveboardAppEmbedViewConfig { +} +/** + * MessagePayload: Embed event payload: message type, data and status (start/end) + * @group Events + */ +export type MessagePayload = { + type: string; + data: any; + status?: string; +}; +/** + * MessageOptions: By providing options, getting specific event start / end based on + * option + * @group Events + */ +export type MessageOptions = { + /** + * A boolean value indicating that start status events of this type + * will be dispatched. + */ + start?: boolean; +}; +/** + * MessageCallback: Embed event message callback + * @group Events + */ +export type MessageCallback = (payload: MessagePayload, +/** + * responder: Message callback function triggered when embed event + * initiated + */ +responder?: (data: any) => void) => void; +/** + * A map of the supported runtime filter operations + */ +export declare enum RuntimeFilterOp { + /** + * Equals + */ + EQ = "EQ", + /** + * Does not equal + */ + NE = "NE", + /** + * Less than + */ + LT = "LT", + /** + * Less than or equal to + */ + LE = "LE", + /** + * Greater than + */ + GT = "GT", + /** + * Greater than or equal to + */ + GE = "GE", + /** + * Contains + */ + CONTAINS = "CONTAINS", + /** + * Begins with + */ + BEGINS_WITH = "BEGINS_WITH", + /** + * Ends with + */ + ENDS_WITH = "ENDS_WITH", + /** + * Between, inclusive of higher value + */ + BW_INC_MAX = "BW_INC_MAX", + /** + * Between, inclusive of lower value + */ + BW_INC_MIN = "BW_INC_MIN", + /** + * Between, inclusive of both higher and lower value + */ + BW_INC = "BW_INC", + /** + * Between, non-inclusive + */ + BW = "BW", + /** + * Is included in this list of values + */ + IN = "IN", + /** + * Is not included in this list of values + */ + NOT_IN = "NOT_IN" +} +/** + * Home page module that can be hidden. + * **Note**: This option does not apply to the classic homepage. + * To access the updated modular homepage, set + * `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl). + * @version SDK: 1.28.0 | ThoughtSpot: 9.12.5.cl, 10.1.0.sw + */ +export declare enum HomepageModule { + /** + * Search bar + */ + Search = "SEARCH", + /** + * kPI watchlist module + */ + Watchlist = "WATCHLIST", + /** + * favorite objects + */ + Favorite = "FAVORITE", + /** + * List of answers and Liveboards + */ + MyLibrary = "MY_LIBRARY", + /** + * Trending list + */ + Trending = "TRENDING", + /** + * Learning videos + */ + Learning = "LEARNING" +} +/** + * List page columns that can be hidden. + * **Note**: This option is applicable to full app embedding only. + * @version SDK: 1.38.0 | ThoughtSpot: 10.9.0.cl + */ +export declare enum ListPageColumns { + /** + * Favourite + */ + Favourite = "FAVOURITE", + /** + * Tags + */ + Tags = "TAGS", + /** + * Author + */ + Author = "AUTHOR", + /** + * Last viewed/Last modified + */ + DateSort = "DATE_SORT", + /** + * Share + */ + Share = "SHARE" +} +/** + * A filter that can be applied to ThoughtSpot answers, Liveboards, or + * visualizations at runtime. + */ +export interface RuntimeFilter { + /** + * The name of the column to filter on (case-sensitive) + */ + columnName: string; + /** + * The operator to apply + */ + operator: RuntimeFilterOp; + /** + * The list of operands. Some operators like EQ, LE accept + * a single operand, whereas other operators like BW and IN accept multiple + * operands. + */ + values: (number | boolean | string | bigint)[]; +} +/** + * A filter that can be applied to ThoughtSpot Answers, Liveboards, or + * visualizations at runtime. + */ +export interface RuntimeParameter { + /** + * The name of the runtime parameter to filter on (case-sensitive) + */ + name: string; + /** + * Values + */ + value: number | boolean | string; +} +/** + * Event types emitted by the embedded ThoughtSpot application. + * + * To add an event listener use the corresponding + * {@link LiveboardEmbed.on} or {@link AppEmbed.on} or {@link SearchEmbed.on} method. + * @example + * ```js + * import { EmbedEvent } from '@thoughtspot/visual-embed-sdk'; + * // Or + * // const { EmbedEvent } = window.tsembed; + * + * // create the liveboard embed. + * + * liveboardEmbed.on(EmbedEvent.Drilldown, (drilldown) => { + * console.log('Drilldown event', drilldown); + * })); + * ``` + * + * If you are using React components for embedding, you can register to any + * events from the `EmbedEvent` list by using the `on` convention. + * For example,`onAlert`, `onCopyToClipboard` and so on. + * @example + * ```js + * // ... + * const MyComponent = ({ dataSources }) => { + * const onLoad = () => { + * console.log(EmbedEvent.Load, {}); + * }; + * + * return ( + * + * ); + * }; + * ``` + * @group Events + */ +export declare enum EmbedEvent { + /** + * Rendering has initialized. + * @example + *```js + * liveboardEmbed.on(EmbedEvent.Init, showLoader) + * //show a loader + * function showLoader() { + * document.getElementById("loader"); + * } + *``` + * @returns timestamp - The timestamp when the event was generated. + */ + Init = "init", + /** + * Authentication has either succeeded or failed. + * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw + * @example + *```js + * appEmbed.on(EmbedEvent.AuthInit, payload => { + * console.log('AuthInit', payload); + * }) + *``` + * @returns isLoggedIn - A Boolean specifying whether authentication was successful. + */ + AuthInit = "authInit", + /** + * The embed object container has loaded. + * @returns timestamp - The timestamp when the event was generated. + * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw + * @example + *```js + * liveboardEmbed.on(EmbedEvent.Load, hideLoader) + * //hide loader + * function hideLoader() { + * document.getElementById("loader"); + * } + *``` + */ + Load = "load", + /** + * Data pertaining to an Answer, Liveboard or Spotter visualization is received. + * The event payload includes the raw data of the object. + * @return data - Answer of Liveboard data + * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw + * @example + *```js + * liveboardEmbed.on(EmbedEvent.Data, payload => { + * console.log('data', payload); + * }) + *``` + * @important + */ + Data = "data", + /** + * Search query has been updated by the user. + * @version SDK: 1.4.0 | ThoughtSpot: ts7.sep.cl, 8.4.1.sw + * @example + *```js + * searchEmbed.on(EmbedEvent.QueryChanged, payload => console.log('data', payload)) + *``` + */ + QueryChanged = "queryChanged", + /** + * A drill-down operation has been performed. + * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw + * @returns additionalFilters - Any additional filters applied + * @returns drillDownColumns - The columns on which drill down was performed + * @returns nonFilteredColumns - The columns that were not filtered + * @example + *```js + * searchEmbed.on(EmbedEvent.DrillDown, { + * points: { + * clickedPoint, + * selectedPoints: selectedPoint + * }, + * autoDrillDown: true, + * }) + *``` + * In this example, `VizPointDoubleClick` event is used for + * triggering the `DrillDown` event when an area or specific + * data point on a table or chart is double-clicked. + * @example + *```js + * searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => { + * console.log(payload); + * const clickedPoint = payload.data.clickedPoint; + * const selectedPoint = payload.data.selectedPoints; + * console.log('>>> called', clickedPoint); + * embed.trigger(HostEvent.DrillDown, { + * points: { + * clickedPoint, + * selectedPoints: selectedPoint + * }, + * autoDrillDown: true, + * }) + * }) + *``` + */ + Drilldown = "drillDown", + /** + * One or more data sources have been selected. + * @returns dataSourceIds - the list of data sources + * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw + * @example + * ```js + * searchEmbed.on(EmbedEvent.DataSourceSelected, payload => { + * console.log('DataSourceSelected', payload); + * }) + * ``` + */ + DataSourceSelected = "dataSourceSelected", + /** + * One or more data columns have been selected. + * @returns columnIds - the list of columns + * @version SDK: 1.10.0 | ThoughtSpot: 8.2.0.cl, 8.4.1.sw + * @example + * ```js + * appEmbed.on(EmbedEvent.AddRemoveColumns, payload => { + * console.log('AddRemoveColumns', payload); + * }) + * ``` + */ + AddRemoveColumns = "addRemoveColumns", + /** + * A custom action has been triggered. + * @returns actionId - ID of the custom action + * @returns payload {@link CustomActionPayload} - Response payload with the + * Answer or Liveboard data + * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw + * @example + * ```js + * appEmbed.on(EmbedEvent.customAction, payload => { + * const data = payload.data; + * if (data.id === 'insert Custom Action ID here') { + * console.log('Custom Action event:', data.embedAnswerData); + * } + * }) + * ``` + */ + CustomAction = "customAction", + /** + * Listen to double click actions on a visualization. + * @return ContextMenuInputPoints - Data point that is double-clicked + * @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1 + * @example + * ```js + * LiveboardEmbed.on(EmbedEvent.VizPointDoubleClick, payload => { + * console.log('VizPointDoubleClick', payload); + * }) + * ``` + */ + VizPointDoubleClick = "vizPointDoubleClick", + /** + * Listen to clicks on a visualization in a Liveboard or Search result. + * @return viz, clickedPoint - metadata about the point that is clicked + * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw + * @important + * @example + * ```js + * embed.on(EmbedEvent.VizPointClick, ({data}) => { + * console.log( + * data.vizId, // viz id + * data.clickedPoint.selectedAttributes[0].value, + * data.clickedPoint.selectedAttributes[0].column.name, + * data.clickedPoint.selectedMeasures[0].value, + * data.clickedPoint.selectedMeasures[0].column.name, + * ) + * }); + * ``` + */ + VizPointClick = "vizPointClick", + /** + * An error has occurred. This event is fired for the following error types: + * + * `API` - API call failure error. + * `FULLSCREEN` - Error when presenting a Liveboard or visualization in full screen + * mode. `SINGLE_VALUE_FILTER` - Error due to multiple values in the single value + * filter. `NON_EXIST_FILTER` - Error due to a non-existent filter. + * `INVALID_DATE_VALUE` - Invalid date value error. + * `INVALID_OPERATOR` - Use of invalid operator during filter application. + * + * For more information, see https://developers.thoughtspot.com/docs/events-app-integration#errorType + * @returns error - An error object or message + * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw + * @example + * ```js + * // API error + * SearchEmbed.on(EmbedEvent.Error, (error) => { + * console.log(error); + * // { type: "Error", data: { errorType: "API", error: { message: '...', error: '...' } } } + * }); + * ``` + * @example + * ```js + * // Fullscreen error (Errors during presenting of a liveboard) + * LiveboardEmbed.on(EmbedEvent.Error, (error) => { + * console.log(error); + * // { type: "Error", data: { errorType: "FULLSCREEN", error: { + * // message: "Fullscreen API is not enabled", + * // stack: "..." + * // } }} + * }) + * ``` + */ + Error = "Error", + /** + * The embedded object has sent an alert. + * @returns alert - An alert object + * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw + * @example + * ```js + * searchEmbed.on(EmbedEvent.Alert) + * ``` + */ + Alert = "alert", + /** + * The ThoughtSpot authentication session has expired. + * @version SDK: 1.4.0 | ThoughtSpot: ts7.sep.cl, 8.4.1.sw + * @example + *```js + * appEmbed.on(EmbedEvent.AuthExpire, showAuthExpired) + * //show auth expired banner + * function showAuthExpired() { + * document.getElementById("authExpiredBanner"); + * } + *``` + */ + AuthExpire = "ThoughtspotAuthExpired", + /** + * ThoughtSpot failed to validate the auth session. + * @hidden + */ + AuthFailure = "ThoughtspotAuthFailure", + /** + * ThoughtSpot failed to re validate the auth session. + * @hidden + */ + IdleSessionTimeout = "IdleSessionTimeout", + /** + * ThoughtSpot failed to validate the auth session. + * @hidden + */ + AuthLogout = "ThoughtspotAuthLogout", + /** + * The height of the embedded Liveboard or visualization has been computed. + * @returns data - The height of the embedded Liveboard or visualization + * @hidden + */ + EmbedHeight = "EMBED_HEIGHT", + /** + * The center of visible iframe viewport is calculated. + * @returns data - The center of the visible Iframe viewport. + * @hidden + */ + EmbedIframeCenter = "EmbedIframeCenter", + /** + * Emitted when the **Get Data** action is initiated. + * Applicable to `SearchBarEmbed` only. + * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw + * @example + *```js + * searchbarEmbed.on(EmbedEvent.GetDataClick) + * .then(data => { + * console.log('Answer Data:', data); + * }) + *``` + */ + GetDataClick = "getDataClick", + /** + * Detects the route change. + * @version SDK: 1.7.0 | ThoughtSpot: 8.0.0.cl, 8.4.1.sw + * @example + *```js + * searchEmbed.on(EmbedEvent.RouteChange, payload => + * console.log('data', payload)) + *``` + */ + RouteChange = "ROUTE_CHANGE", + /** + * The v1 event type for Data + * @hidden + */ + V1Data = "exportVizDataToParent", + /** + * Emitted when the embed does not have cookie access. This happens + * when Safari and other Web browsers block third-party cookies + * are blocked by default. `NoCookieAccess` can trigger. + * @example + *```js + * appEmbed.on(EmbedEvent.NoCookieAccess) + *``` + * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 7.2.1.sw + */ + NoCookieAccess = "noCookieAccess", + /** + * Emitted when SAML is complete + * @private + * @hidden + */ + SAMLComplete = "samlComplete", + /** + * Emitted when any modal is opened in the app + * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw + * @example + *```js + * appEmbed.on(EmbedEvent.DialogOpen, payload => { + * console.log('dialog open', payload); + * }) + *``` + */ + DialogOpen = "dialog-open", + /** + * Emitted when any modal is closed in the app + * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw + * @example + *```js + * appEmbed.on(EmbedEvent.DialogClose, payload => { + * console.log('dialog close', payload); + * }) + *``` + */ + DialogClose = "dialog-close", + /** + * Emitted when the Liveboard shell loads. + * You can use this event as a hook to trigger + * other events on the rendered Liveboard. + * @version SDK: 1.9.1 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw + * @example + *```js + * liveboardEmbed.on(EmbedEvent.LiveboardRendered, payload => { + console.log('Liveboard is rendered', payload); + }) + *``` + * The following example shows how to trigger + * `SetVisibleVizs` event using LiveboardRendered embed event: + * @example + *```js + * const embedRef = useEmbedRef(); + * const onLiveboardRendered = () => { + * embed.trigger(HostEvent.SetVisibleVizs, ['viz1', 'viz2']); + * }; + *``` + */ + LiveboardRendered = "PinboardRendered", + /** + * Emits all events. + * @Version SDK: 1.10.0 | ThoughtSpot: 8.2.0.cl, 8.4.1.sw + * @example + *```js + * appEmbed.on(EmbedEvent.ALL, payload => { + * console.log('Embed Events', payload) + * }) + *``` + */ + ALL = "*", + /** + * Emitted when an Answer is saved in the app + * @Version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw + * @example + *```js + * //Emit when action starts + * searchEmbed.on(EmbedEvent.Save, payload => { + * console.log('Save', payload) + * }, { + * start: true + * }) + * //emit when action ends + * searchEmbed.on(EmbedEvent.Save, payload => { + * console.log('Save', payload) + * }) + *``` + */ + Save = "save", + /** + * Emitted when the download action is triggered on an Answer. + * + * **Note**: This event is deprecated in v1.21.0. + * To fire an event when a download action is initiated on a chart or table, + * use `EmbedEvent.DownloadAsPng`, `EmbedEvent.DownloadAsPDF`, + * `EmbedEvent.DownloadAsCSV`, or `EmbedEvent.DownloadAsXLSX` + * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw + * @example + *```js + * liveboardEmbed.on(EmbedEvent.Download, { + * vizId: '730496d6-6903-4601-937e-2c691821af3c' + * }) + *``` + */ + Download = "download", + /** + * Emitted when the download action is triggered on an Answer. + * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.0.sw + * @example + *```js + * //emit when action starts + * searchEmbed.on(EmbedEvent.DownloadAsPng, payload => { + * console.log('download PNG', payload)}, {start: true }) + * //emit when action ends + * searchEmbed.on(EmbedEvent.DownloadAsPng, payload => { + * console.log('download PNG', payload)}) + *``` + */ + DownloadAsPng = "downloadAsPng", + /** + * Emitted when the Download as PDF action is triggered on an Answer + * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw + * @example + *```js + * //emit when action starts + * searchEmbed.on(EmbedEvent.DownloadAsPdf, payload => { + * console.log('download PDF', payload)}, {start: true }) + * //emit when action ends + * searchEmbed.on(EmbedEvent.DownloadAsPdf, payload => { + * console.log('download PDF', payload)}) + *``` + */ + DownloadAsPdf = "downloadAsPdf", + /** + * Emitted when the Download as CSV action is triggered on an Answer. + * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw + * @example + *```js + * //emit when action starts + * searchEmbed.on(EmbedEvent.DownloadAsCSV, payload => { + * console.log('download CSV', payload)}, {start: true }) + * //emit when action ends + * searchEmbed.on(EmbedEvent.DownloadAsCSV, payload => { + * console.log('download CSV', payload)}) + *``` + */ + DownloadAsCsv = "downloadAsCsv", + /** + * Emitted when the Download as XLSX action is triggered on an Answer. + * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw + * @example + *```js + * //emit when action starts + * searchEmbed.on(EmbedEvent.DownloadAsXlsx, payload => { + * console.log('download Xlsx', payload)}, { start: true }) + * //emit when action ends + * searchEmbed.on(EmbedEvent.DownloadAsXlsx, payload => { + * console.log('download Xlsx', payload)}) + *``` + */ + DownloadAsXlsx = "downloadAsXlsx", + /** + * Emitted when an Answer is deleted in the app + * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw + * @example + *```js + * //emit when action starts + * appEmbed.on(EmbedEvent.AnswerDelete, payload => { + * console.log('delete answer', payload)}, {start: true }) + * //trigger when action is completed + * appEmbed.on(EmbedEvent.AnswerDelete, payload => { + * console.log('delete answer', payload)}) + *``` + */ + AnswerDelete = "answerDelete", + /** + * Emitted when a user initiates the Pin action to + * add an Answer to a Liveboard. + * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw + * @example + *```js + * //emit when action starts + * searchEmbed.on(EmbedEvent.Pin, payload => { + * console.log('pin', payload) + * }, { + * start: true + * }) + * //emit when action ends + * searchEmbed.on(EmbedEvent.Pin, payload => { + * console.log('pin', payload) + * }) + *``` + */ + Pin = "pin", + /** + * Emitted when SpotIQ analysis is triggered + * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw + * @example + *```js + * //emit when action starts + * searchEmbed.on(EmbedEvent.SpotIQAnalyze, payload => { + * console.log('SpotIQAnalyze', payload) + * }, { + * start: true + * }) + * //emit when action ends + * searchEmbed.on(EmbedEvent.SpotIQAnalyze, payload => { + * console.log('SpotIQ analyze', payload) + * }) + *``` + */ + SpotIQAnalyze = "spotIQAnalyze", + /** + * Emitted when a user shares an object with another user or group + * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw + * @example + *```js + * //emit when action starts + * searchEmbed.on(EmbedEvent.Share, payload => { + * console.log('Share', payload) + * }, { + * start: true + * }) + * //emit when action ends + * searchEmbed.on(EmbedEvent.Share, payload => { + * console.log('Share', payload) + * }) + *``` + */ + Share = "share", + /** + * Emitted when a user clicks the **Include** action to include a specific value or + * data on a chart or table. + * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw + * @example + *```js + * appEmbed.on(EmbedEvent.DrillInclude, payload => { + * console.log('Drill include', payload); + * }) + *``` + */ + DrillInclude = "context-menu-item-include", + /** + * Emitted when a user clicks the **Exclude** action to exclude a specific value or + * data on a chart or table + * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw + * @example + *```js + * appEmbed.on(EmbedEvent.DrillExclude, payload => { + * console.log('Drill exclude', payload); + * }) + *``` + */ + DrillExclude = "context-menu-item-exclude", + /** + * Emitted when a column value is copied in the embedded app. + * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw + * @example + *```js + * seachEmbed.on(EmbedEvent.CopyToClipboard, payload => { + * console.log('copy to clipboard', payload); + * }) + *``` + */ + CopyToClipboard = "context-menu-item-copy-to-clipboard", + /** + * Emitted when a user clicks the **Update TML** action on + * embedded Liveboard. + * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw + * @example + *```js + * liveboardEmbed.on(EmbedEvent.UpdateTML) + * }) + *``` + */ + UpdateTML = "updateTSL", + /** + * Emitted when a user clicks the **Edit TML** action + * on an embedded Liveboard. + * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw + * @example + *```js + * appEmbed.on(EmbedEvent.EditTML, payload => { + * console.log('Edit TML', payload); + * }) + *``` + */ + EditTML = "editTSL", + /** + * Emitted when the **Export TML** action is triggered on an + * an embedded object in the app + * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw + * @example + *```js + * //emit when action starts + * searchEmbed.on(EmbedEvent.ExportTML, payload => { + * console.log('Export TML', payload)}, { start: true }) + * //emit when action ends + * searchEmbed.on(EmbedEvent.ExportTML, payload => { + * console.log('Export TML', payload)}) + *``` + */ + ExportTML = "exportTSL", + /** + * Emitted when an Answer is saved as a View. + * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw + * @example + *```js + * appEmbed.on(EmbedEvent.SaveAsView, payload => { + * console.log('View', payload); + * }) + *``` + */ + SaveAsView = "saveAsView", + /** + * Emitted when the user creates a copy of an Answer. + * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw + * @example + *```js + * //emit when action starts + * appEmbed.on(EmbedEvent.CopyAEdit, payload => { + * console.log('Copy and edit', payload)}, {start: true }) + * //emit when action ends + * appEmbed.on(EmbedEvent.CopyAEdit, payload => { + * console.log('Copy and edit', payload)}) + *``` + */ + CopyAEdit = "copyAEdit", + /** + * Emitted when a user clicks *Show underlying data* on an Answer. + * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw + * @example + *```js + * liveboardEmbed.on(EmbedEvent.ShowUnderlyingData, payload => { + * console.log('show data', payload); + * }) + *``` + */ + ShowUnderlyingData = "showUnderlyingData", + /** + * Emitted when an Answer is switched to a chart or table view. + * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw + * @example + *```js + * searchEmbed.on(EmbedEvent.AnswerChartSwitcher, payload => { + * console.log('switch view', payload); + * }) + *``` + */ + AnswerChartSwitcher = "answerChartSwitcher", + /** + * Internal event to communicate the initial settings back to the ThoughtSpot app + * @hidden + */ + APP_INIT = "appInit", + /** + * Internal event to clear the cached info + * @hidden + */ + CLEAR_INFO_CACHE = "clearInfoCache", + /** + * Emitted when a user clicks **Show Liveboard details** on a Liveboard + * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw + * @example + *```js + * liveboardEmbed.on(EmbedEvent.LiveboardInfo, payload => { + * console.log('Liveboard details', payload); + * }) + *``` + */ + LiveboardInfo = "pinboardInfo", + /** + * Emitted when a user clicks on the Favorite icon on a Liveboard + * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw + * @example + *```js + * liveboardEmbed.on(EmbedEvent.AddToFavorites, payload => { + * console.log('favorites', payload); + * }) + *``` + */ + AddToFavorites = "addToFavorites", + /** + * Emitted when a user clicks **Schedule** on a Liveboard + * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw + * @example + *```js + * liveboardEmbed.on(EmbedEvent.Schedule, payload => { + * console.log(`Liveboard schedule', payload); + * }) + *``` + */ + Schedule = "subscription", + /** + * Emitted when a user clicks **Edit** on a Liveboard or visualization + * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw + * @example + *```js + * liveboardEmbed.on(EmbedEvent.Edit, payload => { + * console.log(`Liveboard edit', payload); + * }) + *``` + */ + Edit = "edit", + /** + * Emitted when a user clicks *Make a copy* on a Liveboard + * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw + * @example + *```js + * liveboardEmbed.on(EmbedEvent.MakeACopy, payload => { + * console.log(`Copy', payload); + * }) + *``` + */ + MakeACopy = "makeACopy", + /** + * Emitted when a user clicks **Present** on a Liveboard or visualization + * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw + * @example + *```js + * liveboardEmbed.on(EmbedEvent.Present) + *``` + * @example + *```js + * liveboardEmbed.on(EmbedEvent.Present, { + * vizId: '730496d6-6903-4601-937e-2c691821af3c'}) + * }) + *``` + */ + Present = "present", + /** + * Emitted when a user clicks **Delete** on a visualization + * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw + * @example + *```js + * liveboardEmbed.on(EmbedEvent.Delete, + * {vizId: '730496d6-6903-4601-937e-2c691821af3c'}) + *``` + */ + Delete = "delete", + /** + * Emitted when a user clicks Manage schedules on a Liveboard + * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw + * @example + *```js + * liveboardEmbed.on(EmbedEvent.SchedulesList) + *``` + */ + SchedulesList = "schedule-list", + /** + * Emitted when a user clicks **Cancel** in edit mode on a Liveboard + * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw + * @example + *```js + * liveboardEmbed.on(EmbedEvent.Cancel) + *``` + */ + Cancel = "cancel", + /** + * Emitted when a user clicks **Explore** on a visualization + * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw + * @example + *```js + * liveboardEmbed.on(EmbedEvent.Explore, { + * vizId: '730496d6-6903-4601-937e-2c691821af3c'}) + *``` + */ + Explore = "explore", + /** + * Emitted when a user clicks **Copy link** action on a visualization. + * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw + * @example + *```js + * liveboardEmbed.on(EmbedEvent.CopyLink, { + * vizId: '730496d6-6903-4601-937e-2c691821af3c'}) + *``` + */ + CopyLink = "embedDocument", + /** + * Emitted when a user interacts with cross filters on a + * visualization or Liveboard. + * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.0.sw + * @example + *```js + * liveboardEmbed.on(EmbedEvent.CrossFilterChanged, { + * vizId: '730496d6-6903-4601-937e-2c691821af3c'}) + *``` + */ + CrossFilterChanged = "cross-filter-changed", + /** + * Emitted when a user right clicks on a visualization (chart or table) + * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.0.sw + * @example + *```js + * LiveboardEmbed.on(EmbedEvent.VizPointRightClick, payload => { + * console.log('VizPointClick', payload) + * }) + *``` + */ + VizPointRightClick = "vizPointRightClick", + /** + * Emitted when a user clicks **Insert to slide** on a visualization + * @hidden + */ + InsertIntoSlide = "insertInToSlide", + /** + * Emitted when a user changes any filter on a Liveboard. + * Returns filter type and name, column name and ID, and runtime + * filter details. + * @example + * + *```js + * LiveboardEmbed.on(EmbedEvent.FilterChanged, (payload) => { + * console.log('payload', payload); + * }) + * + * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl, 9.5.0.sw + */ + FilterChanged = "filterChanged", + /** + * Emitted when a user clicks the **Go** button to initiate + * a Natural Language Search query + * @version SDK : 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw + */ + SageEmbedQuery = "sageEmbedQuery", + /** + * Emitted when a user selects a data source on the embedded + * Natural Language Search interface. + * + * @version SDK : 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw + */ + SageWorksheetUpdated = "sageWorksheetUpdated", + /** + * Emitted when a user updates a connection on the **Data** page + * @version SDK : 1.27.0 | ThoughtSpot: 9.8.0.cl, 9.8.0.sw + */ + UpdateConnection = "updateConnection", + /** + * Emitted when a user updates a connection on the **Data** page + * @version SDK : 1.27.0 | ThoughtSpot: 9.8.0.cl, 9.8.0.sw + */ + CreateConnection = "createConnection", + /** + * Emitted when name, status (private or public) or filter values of a + * Personalised view is updated. + * @returns viewName: string + * @returns viewId: string + * @returns liveboardId: string + * @returns isPublic: boolean + * @version SDK : 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw + */ + UpdatePersonalisedView = "updatePersonalisedView", + /** + * Emitted when a Personalised view is saved. + * @returns viewName: string + * @returns viewId: string + * @returns liveboardId: string + * @returns isPublic: boolean + * @version SDK : 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw + */ + SavePersonalisedView = "savePersonalisedView", + /** + * Emitted when a Liveboard is reset. + * @returns viewName: string + * @returns viewId: string + * @returns liveboardId: string + * @returns isPublic: boolean + * @version SDK : 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw + */ + ResetLiveboard = "resetLiveboard", + /** + * Emitted when a PersonalisedView is deleted. + * @returns views: string[] + * @returns liveboardId: string + * @version SDK : 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw + */ + DeletePersonalisedView = "deletePersonalisedView", + /** + * Emitted when a user creates a Worksheet. + * @version SDK : 1.27.0 | ThoughtSpot: 9.8.0.cl, 9.8.0.sw + */ + CreateWorksheet = "createWorksheet", + /** + * Emitted when the *Ask Sage* is initialized. + * @returns viewName: string + * @returns viewId: string + * @returns liveboardId: string + * @returns isPublic: boolean + * @version SDK : 1.29.0 | ThoughtSpot Cloud: 9.12.0.cl + */ + AskSageInit = "AskSageInit", + /** + * Emitted when a Liveboard or visualization is renamed. + * @version SDK : 1.28.0 | ThoughtSpot: 9.10.5.cl, 10.1.0.sw + */ + Rename = "rename", + /** + * + * This event can be emitted to intercept search execution initiated by + * the users and implement the logic to allow or restrict search execution. + * You can can also show custom error text if the search query must be + * restricted due to your application or business requirements. + + * Prerequisite: Set `isOnBeforeGetVizDataInterceptEnabled` to `true` + * for this embed event to get emitted. + * @param: payload + * @param: responder + * Contains elements that lets developers define whether ThoughtSpot + * should run the search, and if not, what error message + * should be shown to the user. + * + * execute: When execute returns `true`, the search will be run. + * When execute returns `false`, the search will not be executed. + * + * error: Developers can customize the error message text when `execute` + * returns `false` using the error parameter in responder. + * @version SDK : 1.29.0 | ThoughtSpot: 10.3.0.cl + * @example + *```js + * .on(EmbedEvent.OnBeforeGetVizDataIntercept, + * (payload, responder) => { + * responder({ + * data: { + * execute:false, + * error: { + * //Provide a custom error message to explain to your end user + * //why their search did not run + * errorText: "This search query cannot be run. + * Please contact your administrator for more details." + * } + * }}) + * }) + * ``` + * + *```js + * .on(EmbedEvent.OnBeforeGetVizDataIntercept, + * (payload, responder) => { + * const query = payload.data.data.answer.search_query + * responder({ + * data: { + * // returns true as long as the query does not include + * // both the 'sales' AND the 'county' column + * execute: !(query.includes("sales")&&query.includes("county")), + * error: { + * //Provide a custom error message to explain to your end user + * // why their search did not run, and which searches are accepted by your custom logic. + * errorText: "You can't use this query :" + query + ". + * The 'sales' measures can never be used at the 'county' level. + * Please try another measure, or remove 'county' from your search." + * } + * }}) + * }) + *``` + */ + OnBeforeGetVizDataIntercept = "onBeforeGetVizDataIntercept", + /** + * Emitted when parameter changes in an Answer + * or Liveboard. + * ```js + * liveboardEmbed.on(EmbedEvent.ParameterChanged, (payload) => { + * console.log('payload', payload); + * }) + *``` + * @version SDK : 1.29.0 | ThoughtSpot: 10.3.0.cl + */ + ParameterChanged = "parameterChanged", + /** + * Emits when a table visualization is rendered in + * the ThoughtSpot embedded app. + * + * You can also use this event as a hook to trigger host events + * such as `HostEvent.TransformTableVizData` on the table visualization. + * The event payload contains the data used in the rendered table. + * You can extract the relevant data from the payload + * stored in `payload.data.data.columnDataLite`. + * + * `columnDataLite` is a multidimensional array that contains + * data values for each column, which was used in the query to + * generate the table visualization. To find and modify specific cell data, + * you can either loop through the array or directly access a cell if + * you know its position and data index. + * + * In the following code sample, the first cell in the first column + * (`columnDataLite[0].dataValue[0]`) is set to `new fob`. + * Note that any changes made to the data in the payload will only update the + * visual presentation and do not affect the underlying data. + * To persist data value modifications after a reload or during chart + * interactions such as drill down, ensure that the modified + * payload in the `columnDataLite` is passed on to + * `HostEvent.TransformTableVizData` and trigger an update to + * the table visualization. + * + * If the Row-Level Security (RLS) rules are applied on the + * Worksheet or Model, exercise caution when changing column + * or table cell values to maintain data security. + * + * @example + * ```js + * searchEmbed.on(EmbedEvent.TableVizRendered, (payload) => { + * console.log(payload); + * const columnDataLite = payload.data.data.columnDataLite; + * columnDataLite[0].dataValue[0]="new fob"; + * console.log('>>> new Data', columnDataLite); + * searchEmbed.trigger(HostEvent.TransformTableVizData, columnDataLite); + * }) + * ``` + * @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl + */ + TableVizRendered = "TableVizRendered", + /** + * Emitted when the liveboard is created from pin modal or Liveboard list page. + * You can use this event as a hook to trigger + * other events on liveboard creation. + * + * ```js + * liveboardEmbed.on(EmbedEvent.CreateLiveboard, (payload) => { + * console.log('payload', payload); + * }) + *``` + * @version SDK : 1.37.0 | ThoughtSpot: 10.8.0.cl + */ + CreateLiveboard = "createLiveboard", + /** + * Emitted when a user creates a Model. + * @version SDK : 1.37.0 | ThoughtSpot: 10.8.0.cl + */ + CreateModel = "createModel", + /** + * @hidden + * Emitted when a user exits present mode. + * @version SDK : 1.40.0 | ThoughtSpot: 10.11.0.cl + */ + ExitPresentMode = "exitPresentMode", + /** + * Emitted when a user requests the full height lazy load data. + * @version SDK : 1.39.0 | ThoughtSpot : 10.10.0.cl + * @hidden + */ + RequestVisibleEmbedCoordinates = "requestVisibleEmbedCoordinates", + /** + * Emitted when Spotter response is text data + * @example + * ```js + * spotterEmbed.on(EmbedEvent.SpotterData, (payload) => { + * console.log('payload', payload); + * }) + *``` + * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl + */ + SpotterData = "SpotterData", + /** + * Emitted when user opens up the worksheet preview modal in Spotter embed. + * @example + * ```js + * spotterEmbed.on(EmbedEvent.PreviewSpotterData, (payload) => { + * console.log('payload', payload); + * }) + *``` + * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl + */ + PreviewSpotterData = "PreviewSpotterData", + /** + * Emitted when the Spotter query is triggered in Spotter embed. + * @example + * ```js + * spotterEmbed.on(EmbedEvent.SpotterQueryTriggered, (payload) => { + * console.log('payload', payload); + * }) + *``` + * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl + */ + SpotterQueryTriggered = "SpotterQueryTriggered", + /** + * Emitted when the last Spotter query is edited in Spotter embed. + * @example + * ```js + * spotterEmbed.on(EmbedEvent.LastPromptEdited, (payload) => { + * console.log('payload', payload); + * }) + *``` + * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl + */ + LastPromptEdited = "LastPromptEdited", + /** + * Emitted when the last Spotter query is deleted in Spotter embed. + * @example + * ```js + * spotterEmbed.on(EmbedEvent.LastPromptDeleted, (payload) => { + * console.log('payload', payload); + * }) + *``` + * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl + */ + LastPromptDeleted = "LastPromptDeleted", + /** + * Emitted when the coversation is reset in spotter embed. + * @example + * ```js + * spotterEmbed.on(EmbedEvent.ResetSpotterConversation, (payload) => { + * console.log('payload', payload); + * }) + *``` + * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl + */ + ResetSpotterConversation = "ResetSpotterConversation", + /** + * Emitted when the *Spotter* is initialized. + * @example + * ```js + * spotterEmbed.on(EmbedEvent.SpotterInit, (payload) => { + * console.log('payload', payload); + * }) + *``` + * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl + */ + SpotterInit = "spotterInit", + /** + * @hidden + * Triggers when the embed listener is ready to receive events. + * This is used to trigger events after the embed container is loaded. + * @example + * ```js + * liveboardEmbed.on(EmbedEvent.EmbedListenerReady, () => { + * console.log('EmbedListenerReady'); + * }) + * ``` + */ + EmbedListenerReady = "EmbedListenerReady", + /** + * Emitted when the organization is switched. + * @example + * ```js + * appEmbed.on(EmbedEvent.OrgSwitched, (payload) => { + * console.log('payload', payload); + * }) + * ``` + * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl + */ + OrgSwitched = "orgSwitched" +} +/** + * Event types that can be triggered by the host application + * to the embedded ThoughtSpot app. + * + * To trigger an event use the corresponding + * {@link LiveboardEmbed.trigger} or {@link AppEmbed.trigger} or {@link + * SearchEmbed.trigger} method. + * @example + * ```js + * import { HostEvent } from '@thoughtspot/visual-embed-sdk'; + * // Or + * // const { HostEvent } = window.tsembed; + * + * // create the liveboard embed. + * + * liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [ + * { columnName: 'state', operator: RuntimeFilterOp.EQ, values: ["california"]} + * ]); + * ``` + * @example + * If using React components to embed, use the format shown in this example: + * + * ```js + * const selectVizs = () => { + * embedRef.current.trigger(HostEvent.SetVisibleVizs, [ + * "715e4613-c891-4884-be44-aa8d13701c06", + * "3f84d633-e325-44b2-be25-c6650e5a49cf" + * ]); + * }; + * ``` + * + * + * You can also attach an Embed event to a Host event to trigger + * a specific action as shown in this example: + * @example + * ```js + * const EmbeddedComponent = () => { + * const embedRef = useRef(null); // import { useRef } from react + * const onLiveboardRendered = () => { + * embedRef.current.trigger(HostEvent.SetVisibleVizs, ['viz1', 'viz2']); + * }; + * + * return ( + * + * ); + * } + * ``` + * @group Events + */ +export declare enum HostEvent { + /** + * Triggers a search operation with the search tokens specified in + * the search query string. + * Supported in `AppEmbed` and `SearchEmbed` deployments. + * Includes the following properties: + * @param - `searchQuery` - query string with search tokens + * @param - `dataSources` - Data source GUID to Search on + * - Although an array, only a single source + * is supported. + * @param - `execute` - executes search and updates the existing query + * @example + * ```js + * searchembed.trigger(HostEvent.Search, { + searchQuery: "[sales] by [item type]", + dataSources: ["cd252e5c-b552-49a8-821d-3eadaa049cca"], + execute: true + }); + * ``` + */ + Search = "search", + /** + * Triggers a drill on certain points of the specified column + * Includes the following properties: + * @param - points - an object containing selectedPoints/clickedPoints + * to drill to. For example, { selectedPoints: []} + * @param - columnGuid - Optional. GUID of the column to drill + * by. If not provided it will auto drill by the configured + * column. + * @param - autoDrillDown - Optional. If true, the drill down will be + * done automatically on the most popular column. + * @param - vizId [TS >= 9.8.0] - Optional. The GUID of the visualization to drill + * in case of a Liveboard. + * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed. + * @example + * ```js + * searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => { + * console.log(payload); + * const clickedPoint = payload.data.clickedPoint; + * const selectedPoint = payload.data.selectedPoints; + * console.log('>>> called', clickedPoint); + * searchEmbed.trigger(HostEvent.DrillDown, { + * points: { + * clickedPoint, + * selectedPoints: selectedPoint + * }, + * autoDrillDown: true, + * }); + * }) + * ``` + * @example + * ```js + * // Works with TS 9.8.0 and above + * + * liveboardEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => { + * console.log(payload); + * const clickedPoint = payload.data.clickedPoint; + * const selectedPoint = payload.data.selectedPoints; + * console.log('>>> called', clickedPoint); + * liveboardEmbed.trigger(HostEvent.DrillDown, { + * points: { + * clickedPoint, + * selectedPoints: selectedPoint + * }, + * columnGuid: "", + * vizId: payload.data.vizId + * }); + * }) + * ``` + * @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1 + */ + DrillDown = "triggerDrillDown", + /** + * Apply filters + * @hidden + */ + Filter = "filter", + /** + * Reload the Answer or visualization + * @hidden + */ + Reload = "reload", + /** + * Get iframe URL for the current embed view on the playground. + * Developers can use this URL to embed a ThoughtSpot object + * in apps like Salesforce or Sharepoint. + * @example + * ```js + * const url = embed.trigger(HostEvent.GetIframeUrl); + * console.log("iFrameURL",url); + * ``` + * @version SDK: 1.35.0 | ThoughtSpot: 10.4.0.cl + */ + GetIframeUrl = "GetIframeUrl", + /** + * Display specific visualizations on a Liveboard. + * @param - An array of GUIDs of the visualization to show. The visualization IDs not passed + * in this parameter will be hidden. + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.SetVisibleVizs, [ + * '730496d6-6903-4601-937e-2c691821af3c', + * 'd547ec54-2a37-4516-a222-2b06719af726']) + * ``` + * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw + */ + SetVisibleVizs = "SetPinboardVisibleVizs", + /** + * Set a Liveboard tab as an active tab. + * @param - tabId - string of id of Tab to show + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.SetActiveTab,{ + * tabId:'730496d6-6903-4601-937e-2c691821af3c' + * }) + * ``` + * @version SDK: 1.24.0 | ThoughtSpot: 9.5.0.cl, 9.5.1-sw + */ + SetActiveTab = "SetActiveTab", + /** + * Updates the runtime filters applied on a Liveboard. The filter + * attributes passed with this event are appended to the existing runtime + * filters applied on a Liveboard. + * + * **Note**: `HostEvent.UpdateRuntimeFilters` is supported in `LiveboardEmbed` + * and `AppEmbed` only. In full application embedding, this event updates + * the runtime filters applied on the Liveboard and saved Answer objects. + * + * @param - Pass an array of {@link RuntimeFilter} with the following attributes: + * `columnName` - _String_. The name of the column to filter on. + * + * `operator` - {@link RuntimeFilterOp} to apply. For more information, + * see link:https://developers.thoughtspot.com/docs/?pageid=runtime-filters#rtOperator[Developer Documentation]. + * + * `values` - List of operands. Some operators such as EQ and LE allow a + * single value, whereas BW and IN accept multiple values. + * + * **Note**: Updating runtime filters resets the ThoughtSpot + * object to its original state and applies new filter conditions. + * Any user changes (like drilling into a visualization) + * will be cleared, restoring the original visualization + * with the updated filters. + * + + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [ + * {columnName: "state",operator: RuntimeFilterOp.EQ,values: ["michigan"]}, + * {columnName: "item type",operator: RuntimeFilterOp.EQ,values: ["Jackets"]} + * ]) + * ``` + * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw + * @important + */ + UpdateRuntimeFilters = "UpdateRuntimeFilters", + /** + * Navigate to a specific page in the embedded ThoughtSpot application. + * This is the same as calling `appEmbed.navigateToPage(path, true)`. + * @param - `path` - the path to navigate to to go forward or back. The path value can + * be a number; for example, `1`, `-1`. + * @example + * ```js + * appEmbed.navigateToPage(-1) + * ``` + * @version SDK: 1.12.0 | ThoughtSpot 8.4.0.cl, 8.4.1.sw + */ + Navigate = "Navigate", + /** + * Open the filter panel for a particular column. + * Works with Search and Liveboard embed. + * @param - { columnId: string, + * name: string, + * type: ATTRIBUTE/MEASURE, + * dataType: INT64/CHAR/DATE } + * @example + * ```js + * searchEmbed.trigger(HostEvent.OpenFilter, + * {column: { columnId: '', name: 'column name', type: 'ATTRIBUTE', dataType: 'INT64'}}) + * ``` + * @example + * ```js + * LiveboardEmbed.trigger(HostEvent.OpenFilter, + * { column: {columnId: ''}}) + * ``` + * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl + */ + OpenFilter = "openFilter", + /** + * Add columns to the current search query. + * @param - { columnIds: string[] } + * @example + * ```js + * searchEmbed.trigger(HostEvent.AddColumns, { columnIds: ['',''] }) + * ``` + * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl + */ + AddColumns = "addColumns", + /** + * Remove a column from the current search query. + * @param - { columnId: string } + * @example + * ```js + * searchEmbed.trigger(HostEvent.RemoveColumn, { columnId: '' }) + * ``` + * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl + */ + RemoveColumn = "removeColumn", + /** + * Get the transient state of a Liveboard as encoded content. + * This includes unsaved and ad hoc changes such as + * Liveboard filters, runtime filters applied on visualizations on a + * Liveboard, and Liveboard layout, changes to visualizations such as + * sorting, toggling of legends, and data drill down. + * For more information, see + * link:https://developers.thoughtspot.com/docs/fetch-data-and-report-apis#transient-lb-content[Liveboard data with unsaved changes]. + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.getExportRequestForCurrentPinboard).then( + * data=>console.log(data)) + * ``` + * @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl, 8.8.1.sw + */ + getExportRequestForCurrentPinboard = "getExportRequestForCurrentPinboard", + /** + * Trigger **Pin** action on an embedded object. + * If no parameters are defined, the pin action is triggered + * for the Answer that the user is currently on + * and a modal opens for Liveboard selection. + * To add an Answer or visualization to a Liveboard programmatically without + * showing requiring additional user input via *Pin to Liveboard* modal, define + * the following parameters: + * + * @param + * `vizId`- GUID of the saved Answer or Spotter visualization ID to pin to a Liveboard. + * Optional when pinning a new chart or table generated from a Search query. + * **Required** in Spotter Embed. + * @param + * `liveboardID` - GUID of the Liveboard to pin an Answer. If there is no Liveboard, + * specify the `newLiveboardName` parameter to create a new Liveboard. + * @param + * `tabId` - GUID of the Liveboard tab. Adds the Answer to the Liveboard tab + * specified in the code. + * @param + * `newVizName` - Name string for the Answer or visualization. If defined, + * this parameter adds a new visualization object or creates a copy of the + * Answer or visualization specified in `vizId`. + * Required attribute. + * @param + * `newLiveboardName` - Name string for the Liveboard. + * Creates a new Liveboard object with the specified name. + * @param + * `newTabName` - Name of the tab. Adds a new tab Liveboard specified + * in the code. + * + * @example + * ```js + * const pinResponse = await appEmbed.trigger(HostEvent.Pin, { + * vizId: "123", + * newVizName: "Sales by region", + * liveboardId: "123", + * tabId: "123" + * }); + * ``` + * @example + * ```js + * const pinResponse = await appEmbed.trigger(HostEvent.Pin, { + * newVizName: "Total sales of Jackets", + * liveboardId: "123" + * }); + * ``` + * + * @example + * ```js + * const pinResponse = await searchEmbed.trigger(HostEvent.Pin, { + * newVizName: "Sales by state", + * newLiveboardName: "Sales", + * newTabName: "Products" + * }); + * ``` + * @example + * ```js + * appEmbed.trigger(HostEvent.Pin) + * ``` + * @example + * ```js + + * // You can use the Data event dispatched on each answer creation to get the vizId and use in Pin host event. + * let latestSpotterVizId = ''; + * spotterEmbed.on(EmbedEvent.Data, (payload) => { + * latestSpotterVizId = payload.data.id; + * }); + * + * spotterEmbed.trigger(HostEvent.Pin, { vizId: latestSpotterVizId }); + * ``` + * + * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw + */ + Pin = "pin", + /** + * Trigger the **Show Liveboard details** action + * on an embedded Liveboard. + * @example + *```js + * liveboardEmbed.trigger(HostEvent.LiveboardInfo) + *``` + * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw + */ + LiveboardInfo = "pinboardInfo", + /** + * Trigger the **Schedule** action on an embedded Liveboard. + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.Schedule) + * ``` + * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw + */ + Schedule = "subscription", + /** + * Trigger the **Manage schedule** action on an embedded Liveboard + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.ScheduleList) + * ``` + * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw + */ + SchedulesList = "schedule-list", + /** + * Trigger the **Export TML** action on an embedded Liveboard or + * Answer. + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.ExportTML) + * ``` + * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw + */ + ExportTML = "exportTSL", + /** + * Trigger the **Edit TML** action on an embedded Liveboard or + * saved Answers in the full application embedding. + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.EditTML) + * ``` + * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw + */ + EditTML = "editTSL", + /** + * Trigger the **Update TML** action on an embedded Liveboard. + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.UpdateTML) + * ``` + * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw + */ + UpdateTML = "updateTSL", + /** + * Trigger the **Download PDF** action on an embedded Liveboard, + * visualization or Answer. + * + * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed. + * + * **NOTE**: The **Download** > **PDF** action is available on + * visualizations and Answers if the data is in tabular format. + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.DownloadAsPdf) + * ``` + * @example + * ```js + + * // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsPdf host event. + * let latestSpotterVizId = ''; + * spotterEmbed.on(EmbedEvent.Data, (payload) => { + * latestSpotterVizId = payload.data.id; + * }); + * + * spotterEmbed.trigger(HostEvent.DownloadAsPdf, { vizId: latestSpotterVizId }); + * ``` + * + * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw + */ + DownloadAsPdf = "downloadAsPdf", + /** + * Trigger the **Make a copy** action on a Liveboard, + * visualization, or Answer page. + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.MakeACopy) + * ``` + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.MakeACopy, { + * vizId: '730496d6-6903-4601-937e-2c691821af3c'}) + * ``` + * @example + * ```js + * vizEmbed.trigger(HostEvent.MakeACopy) + * ``` + * @example + * ```js + * searchEmbed.trigger(HostEvent.MakeACopy) + * ``` + * @example + * ```js + * // You can use the Data event dispatched on each answer creation to get the vizId and use in MakeACopy host event. + * let latestSpotterVizId = ''; + * spotterEmbed.on(EmbedEvent.Data, (payload) => { + * latestSpotterVizId = payload.data.id; + * }); + * + * spotterEmbed.trigger(HostEvent.MakeACopy, { vizId: latestSpotterVizId }); + * ``` + * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw + */ + MakeACopy = "makeACopy", + /** + * Trigger the **Delete** action for a Liveboard. + * @example + * ```js + * appEmbed.trigger(HostEvent.Remove) + * ``` + * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw + * * @example + * ```js + * liveboardEmbed.trigger(HostEvent.Remove) + * ``` + * @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl, 10.10.0.sw + */ + Remove = "delete", + /** + * Trigger the **Explore** action on a visualization. + * @param - an object with `vizId` as a key + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.Explore, {vizId: '730496d6-6903-4601-937e-2c691821af3c'}) + * ``` + * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw + */ + Explore = "explore", + /** + * Trigger the **Create alert** action on a KPI chart + * in a Liveboard or saved Answer. + * @param - an object with `vizId` as a key + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.CreateMonitor, { + * vizId: '730496d6-6903-4601-937e-2c691821af3c' + * }) + * ``` + * @example + * ```js + * searchEmbed.trigger(HostEvent.CreateMonitor) + * ``` + * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw + */ + CreateMonitor = "createMonitor", + /** + * Trigger the **Manage alerts** action on a KPI chart + * in a visualization or saved Answer. + * @param - an object with `vizId` as a key + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.ManageMonitor, { + * vizId: '730496d6-6903-4601-937e-2c691821af3c' + * }) + * ``` + * @example + * ```js + * searchEmbed.trigger(HostEvent.ManageMonitor) + * ``` + * @example + * ```js + * vizEmbed.trigger(HostEvent.ManageMonitor) + * ``` + * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw + */ + ManageMonitor = "manageMonitor", + /** + * Trigger the **Edit** action on a Liveboard or a visualization + * on a Liveboard. + * + * This event is not supported in visualization embed and search embed. + * @param - object - To trigger the action for a specific visualization + * in Liveboard embed, pass in `vizId` as a key. + * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed. + * + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.Edit) + * ``` + * ```js + * liveboardEmbed.trigger(HostEvent.Edit, {vizId: + * '730496d6-6903-4601-937e-2c691821af3c'}) + * ``` + * @example + * ```js + * spotterEmbed.trigger(HostEvent.Edit); + * ``` + * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw + */ + Edit = "edit", + /** + * Trigger the **Copy link** action on a Liveboard or visualization + * @param - object - to trigger the action for a + * specific visualization in Liveboard embed, pass in `vizId` as a key + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.CopyLink) + * ``` + * ```js + * liveboardEmbed.trigger(HostEvent.CopyLink, {vizId: '730496d6-6903-4601-937e-2c691821af3c'}) + * ``` + * ```js + * vizEmbed.trigger((HostEvent.CopyLink) + * ``` + * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw + */ + CopyLink = "embedDocument", + /** + * Trigger the **Present** action on a Liveboard or visualization + * @param - object - to trigger the action for a specific visualization + * in Liveboard embed, pass in `vizId` as a key + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.Present) + * ``` + * ```js + * liveboardEmbed.trigger(HostEvent.Present, {vizId: '730496d6-6903-4601-937e-2c691821af3c'}) + * ``` + * ```js + * vizEmbed.trigger((HostEvent.Present) + * ``` + * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw + */ + Present = "present", + /** + * Get TML for the current search. + * @example + * ```js + * searchEmbed.trigger(HostEvent.GetTML).then((tml) => { + * console.log( + * tml.answer.search_query // TML representation of the search query + * ); + * }) + * ``` + * * @example + * ```js + + * // You can use the Data event dispatched on each answer creation to get the vizId and use in Pin host event. + * let latestSpotterVizId = ''; + * spotterEmbed.on(EmbedEvent.Data, (payload) => { + * latestSpotterVizId = payload.data.id; + * }); + * + * spotterEmbed.trigger(HostEvent.GetTML, { + * vizId: latestSpotterVizId + * }).then((tml) => { + * console.log( + * tml.answer.search_query // TML representation of the search query + * ); + * }) + * ``` + * @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1.sw + * @important + */ + GetTML = "getTML", + /** + * Trigger the **Show underlying data** action on a + * chart or table. + * + * @param - an object with vizId as a key + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.ShowUnderlyingData, {vizId: + * '730496d6-6903-4601-937e-2c691821af3c'}) + * ``` + * ```js + * vizEmbed.trigger(HostEvent.ShowUnderlyingData) + * ``` + * ```js + * searchEmbed.trigger(HostEvent.ShowUnderlyingData) + * ``` + * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw + */ + ShowUnderlyingData = "showUnderlyingData", + /** + * Trigger the **Delete** action for a visualization + * in an embedded Liveboard, or a chart or table + * generated from Search. + * @param - Liveboard embed takes an object with `vizId` as a key. + * Can be left empty if embedding Search or visualization. + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.Delete, {vizId: + * '730496d6-6903-4601-937e-2c691821af3c'}) + * ``` + * ```js + * searchEmbed.trigger(HostEvent.Delete) + * ``` + * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw + */ + Delete = "onDeleteAnswer", + /** + * Trigger the **SpotIQ analyze** action on a + * chart or table. + * @param - Liveboard embed takes `vizId` as a + * key. Can be left undefined when embedding Search or + * visualization. + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.SpotIQAnalyze, {vizId: + * '730496d6-6903-4601-937e-2c691821af3c'}) + * ``` + * ```js + * vizEmbed.trigger(HostEvent.SpotIQAnalyze) + * ``` + * ```js + * searchEmbed.trigger(HostEvent.SpotIQAnalyze) + * ``` + * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw + */ + SpotIQAnalyze = "spotIQAnalyze", + /** + * Trigger the **Download** action on charts in + * the embedded view. + * @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed. + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.Download, {vizId: + * '730496d6-6903-4601-937e-2c691821af3c'}) + * ``` + * ```js + * embed.trigger(HostEvent.Download) + * ``` + * ```js + * // You can use the Data event dispatched on each answer creation to get the vizId and use in Download host event. + * let latestSpotterVizId = ''; + * spotterEmbed.on(EmbedEvent.Data, (payload) => { + * latestSpotterVizId = payload.data.id; + * }); + * + * spotterEmbed.trigger(HostEvent.Download, { vizId: latestSpotterVizId }); + * ``` + * @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw + * Use {@link DownloadAsPng} + * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw + */ + Download = "downloadAsPng", + /** + * Trigger the **Download** > **PNG** action on + * charts in the embedded view. + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.DownloadAsPng, + * {vizId:'730496d6-6903-4601-937e-2c691821af3c'}) + * + * vizEmbed.trigger(HostEvent.DownloadAsPng) + * + * searchEmbed.trigger(HostEvent.DownloadAsPng) + * + * // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsPng host event. + * let latestSpotterVizId = ''; + * spotterEmbed.on(EmbedEvent.Data, (payload) => { + * latestSpotterVizId = payload.data.id; + * }); + * + * spotterEmbed.trigger(HostEvent.DownloadAsPng, { vizId: latestSpotterVizId }); + * ``` + * + * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw + */ + DownloadAsPng = "downloadAsPng", + /** + * Trigger the **Download** > **CSV** action on tables in + * the embedded view. + * @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed. + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId: + * '730496d6-6903-4601-937e-2c691821af3c'}) + * ``` + * ```js + * vizEmbed.trigger(HostEvent.DownloadAsCsv) + * ``` + * ```js + * searchEmbed.trigger(HostEvent.DownloadAsCsv) + * ``` + * ```js + * // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsCsv host event. + * let latestSpotterVizId = ''; + * spotterEmbed.on(EmbedEvent.Data, (payload) => { + * latestSpotterVizId = payload.data.id; + * }); + * + * spotterEmbed.trigger(HostEvent.DownloadAsCsv, { vizId: latestSpotterVizId }); + * ``` + * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw + */ + DownloadAsCsv = "downloadAsCSV", + /** + * Trigger the **Download** > **XLSX** action on tables + * in the embedded view. + * @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed. + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId: + * '730496d6-6903-4601-937e-2c691821af3c'}) + * ``` + * ```js + * vizEmbed.trigger(HostEvent.DownloadAsXlsx) + * ``` + * ```js + * searchEmbed.trigger(HostEvent.DownloadAsXlsx) + * ``` + * ```js + * // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsXlsx host event. + * let latestSpotterVizId = ''; + * spotterEmbed.on(EmbedEvent.Data, (payload) => { + * latestSpotterVizId = payload.data.id; + * }); + * + * spotterEmbed.trigger(HostEvent.DownloadAsXlsx, { vizId: latestSpotterVizId }); + * ``` + * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw + */ + DownloadAsXlsx = "downloadAsXLSX", + /** + * Trigger the **Share** action on an embedded + * Liveboard or Answer. + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.Share) + * ``` + * ```js + * searchEmbed.trigger(HostEvent.Share) + * ``` + * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw + */ + Share = "share", + /** + * Trigger the **Save** action on a Liveboard, Answer, or Spotter. + * Saves the changes. + * + * @param - `vizId` refers to the Spotter Visualization Id used in Spotter embed. + * It is required and can be retrieved from the data embed event. + * + * @example + * ```js + * // Save changes in a Liveboard + * liveboardEmbed.trigger(HostEvent.Save) + * ``` + * + * ```js + * // Save the current Answer in Search embed + * searchEmbed.trigger(HostEvent.Save) + * ``` + * + * ```js + * // Save a Visualization in Spotter (requires vizId) + * spotterEmbed.trigger(HostEvent.Save, { + * vizId: "730496d6-6903-4601-937e-2c691821af3c" + * }) + * ``` + * + * ```js + * // How to get the vizId in Spotter? + * + * // You can use the Data event dispatched on each answer creation to get the vizId. + * let latestSpotterVizId = ''; + * spotterEmbed.on(EmbedEvent.Data, (payload) => { + * latestSpotterVizId = payload.data.id; + * }); + * + * spotterEmbed.trigger(HostEvent.Save, { vizId: latestSpotterVizId }); + * ``` + * + * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw + */ + Save = "save", + /** + * Trigger the **Sync to Sheets** action on an embedded visualization or Answer + * Sends data from an Answer or Liveboard visualization to a Google sheet. + * @param - an object with `vizId` as a key + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.SyncToSheets, {vizId: + * '730496d6-6903-4601-937e-2c691821af3c'}) + * ``` + * ```js + * vizEmbed.trigger(HostEvent.SyncToSheets) + * ``` + * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw + */ + SyncToSheets = "sync-to-sheets", + /** + * Trigger the **Sync to Other Apps** action on an embedded visualization or Answer + * Sends data from an Answer or Liveboard visualization to third-party apps such + * as Slack, Salesforce, Microsoft Teams, ServiceNow and so on. + * @param - an object with vizId as a key + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.SyncToOtherApps, {vizId: + * '730496d6-6903-4601-937e-2c691821af3c'}) + * ``` + * ```js + * vizEmbed.trigger(HostEvent.SyncToOtherApps) + * ``` + * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw + */ + SyncToOtherApps = "sync-to-other-apps", + /** + * Trigger the **Manage pipelines** action on an embedded + * visualization or Answer. + * Allows users to manage ThoughtSpot Sync pipelines. + * @param - an object with `vizId` as a key + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.ManagePipelines, {vizId: + * '730496d6-6903-4601-937e-2c691821af3c'}) + * ``` + * ```js + * vizEmbed.trigger(HostEvent.ManagePipelines) + * ``` + * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw + */ + ManagePipelines = "manage-pipeline", + /** + * Reset search operation on the Search or Answer page. + * @example + * ```js + * searchEmbed.trigger(HostEvent.ResetSearch) + * ``` + * ```js + * appEmbed.trigger(HostEvent.ResetSearch) + * ``` + * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.0.1.sw + */ + ResetSearch = "resetSearch", + /** + * Get details of filters applied on the Liveboard. + * Returns arrays containing Liveboard filter and runtime filter elements. + * @example + * ```js + * const data = await liveboardEmbed.trigger(HostEvent.GetFilters); + * console.log('data', data); + * ``` + * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl + */ + GetFilters = "getFilters", + /** + * Update one or several filters applied on a Liveboard. + * @param - `filter`: a single filter object containing column name, + * filter operator, and values. + * @param - `filters`: multiple filter objects with column name, filter operator, + * and values for each. + * + * Each filter object must include the following attributes: + * + * `column` - Name of the column to filter on. + * + * `oper` - Filter operator, for example, EQ, IN, CONTAINS. + * For information about the supported filter operators, + * see link:https://developers.thoughtspot.com/docs/runtime-filters#rtOperator[Developer Documentation]. + * + * `values` - An array of one or several values. The value definition on the + * data type you choose to filter on. For a complete list of supported data types, + * see + * link:https://developers.thoughtspot.com/docs/runtime-filters#_supported_data_types[Supported + * data types]. + * + * `type` - To update filters for date time, specify the date format type. + * For more information and examples, see link:https://developers.thoughtspot.com/docs/embed-liveboard#_date_filters[Date filters]. + * @example + * ```js + * + * liveboardEmbed.trigger(HostEvent.UpdateFilters, { + * filter: { + * column: "item type", + * oper: "IN", + * values: ["bags","shirts"] + * } + * }); + * ``` + * @example + * ```js + * + * liveboardEmbed.trigger(HostEvent.UpdateFilters, { + * filter: { + * column: "date", + * oper: "EQ", + * values: ["JULY","2023"], + * type: "MONTH_YEAR" + * } + * }); + * ``` + * @example + * + * ```js + * liveboardEmbed.trigger(HostEvent.UpdateFilters, { + * filters: [{ + * column: "Item Type", + * oper: 'IN', + * values: ["bags","shirts"] + * }, + * { + * column: "Region", + * oper: 'IN', + * values: ["West","Midwest"] + * }, + * { + * column: "Date", + * oper: 'EQ', + * values: ["2023-07-31"], + * type: "EXACT_DATE" + * }] + * }); + * ``` + * If there are multiple columns with the same name, consider + * using `WORKSHEET_NAME::COLUMN_NAME` format. + * + * @example + * + * ```js + * liveboardEmbed.trigger(HostEvent.UpdateFilters, { + * filters: [{ + * column: "(Sample) Retail - Apparel::city", + * oper: 'IN', + * values: ["atlanta"] + * }, + * { + * column: "(Sample) Retail - Apparel::Region", + * oper: 'IN', + * values: ["West","Midwest"] + * }] + * }); + * ``` + * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl + */ + UpdateFilters = "updateFilters", + /** + * Get tab details for the current Liveboard. + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.GetTabs).then((tabDetails) => { + * console.log( + * tabDetails // TabDetails of current Liveboard + * ); + * }) + * ``` + * @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl + */ + GetTabs = "getTabs", + /** + * Set the visible tabs on a Liveboard. + * @param - an array of ids of tabs to show, the IDs not passed + * will be hidden. + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.SetVisibleTabs, [ + * '430496d6-6903-4601-937e-2c691821af3c', + * 'f547ec54-2a37-4516-a222-2b06719af726']) + * ``` + * @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw + */ + SetVisibleTabs = "SetPinboardVisibleTabs", + /** + * Set the hidden tabs on a Liveboard. + * @param - an array of the IDs of the tabs to hide. + * The IDs not passed will be shown. + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.SetHiddenTabs, [ + * '630496d6-6903-4601-937e-2c691821af3c', + * 'i547ec54-2a37-4516-a222-2b06719af726']) + * ``` + * @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw + */ + SetHiddenTabs = "SetPinboardHiddenTabs", + /** + * Updates the search query string for Natural Language Search operations. + * @param - `queryString`: Text string in Natural Language format + * @param - `executeSearch`: Boolean to execute search and update search query + * @example + * ```js + * sageEmbed.trigger(HostEvent.UpdateSageQuery, { + * queryString: 'revenue per year', + * executeSearch: true, + * }) + * ``` + * @version SDK: 1.26.0 | ThoughtSpot: 9.8.0.cl, 9.8.0.sw + */ + UpdateSageQuery = "updateSageQuery", + /** + * Get the Answer session for a Search or + * Liveboard visualization. + * + * Note: This event is not typically used directly. Instead, use the + * `getAnswerService()` method on the embed instance to get an AnswerService + * object that provides a more convenient interface for working with answers. + * + * @example + * ```js + * // Preferred way to get an AnswerService + * const service = await embed.getAnswerService(); + * + * // Alternative direct usage (not recommended) + * const {session} = await embed.trigger( + * HostEvent.GetAnswerSession, { + * vizId: '123', // For Liveboard Visualization. + * }) + * ``` + * @example + * ```js + * // Preferred way to get an AnswerService + * const service = await embed.getAnswerService(); + * + * // Alternative direct usage (not recommended) + * const {session} = await embed.trigger( HostEvent.GetAnswerSession ) + * ``` + * @version SDK: 1.26.0 | ThoughtSpot: 9.10.0.cl, 10.1.0.sw + */ + GetAnswerSession = "getAnswerSession", + /** + * Trigger the *Ask Sage* action for visualizations + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.AskSage, + * {vizId:'730496d6-6903-4601-937e-2c691821af3c'}) + * ``` + * @version SDK: 1.29.0 | ThoughtSpot Cloud: 9.12.0.cl + */ + AskSage = "AskSage", + /** + * Trigger cross filter update action on a Liveboard. + * + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.UpdateCrossFilter, { + * vizId: 'b535c760-8bbe-4e6f-bb26-af56b4129a1e', + * conditions: [ + * { columnName: 'Category', values: ['mfgr#12','mfgr#14'] }, + * { columnName: 'color', values: ['mint','hot'] }, + * ], + * }); + * ``` + * @version SDK: 1.29.0 | ThoughtSpot Cloud: 10.0.0.cl, 10.1.0.sw + */ + UpdateCrossFilter = "UpdateCrossFilter", + /** + * Trigger reset action for a personalized Liveboard view. + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.ResetLiveboardPersonalisedView); + * ``` + * @version SDK: 1.29.0 | ThoughtSpot Cloud: 10.1.0.cl, 10.1.0.sw + */ + ResetLiveboardPersonalisedView = "ResetLiveboardPersonalisedView", + /** + * Triggers an action to update Parameter values on embedded + * Answers, Liveboard and Spotter answer in Edit mode. + * + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.UpdateParameters, [{ + * name: "Color", + * value: "almond" + * }]) + * + * @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw + */ + UpdateParameters = "UpdateParameters", + /** + * Triggers GetParameters to fetch the runtime Parameters. + * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed. + * ```js + * liveboardEmbed.trigger(HostEvent.GetParameters).then((parameter) => { + * console.log('parameters', parameter); + * }); + *``` + *```js + * // You can use the Data event dispatched on each answer creation to get the vizId and use in GetParameters host event. + * let latestSpotterVizId = ''; + * spotterEmbed.on(EmbedEvent.Data, (payload) => { + * latestSpotterVizId = payload.data.id; + * }); + * + * spotterEmbed.trigger(HostEvent.GetParameters, { vizId: latestSpotterVizId }); + *``` + * @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw + */ + GetParameters = "GetParameters", + /** + * Triggers an event to update a personalized view of a Liveboard. + * ```js + * liveboardEmbed.trigger(HostEvent.UpdatePersonalisedView, {viewId: '1234'}) + * ``` + * @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl + */ + UpdatePersonalisedView = "UpdatePersonalisedView", + /** + * @hidden + * Notify when info call is completed successfully + * ```js + * liveboardEmbed.trigger(HostEvent.InfoSuccess, data); + *``` + * @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl + */ + InfoSuccess = "InfoSuccess", + /** + * Trigger the save action for an Answer. + * To programmatically save an answer without opening the + * *Describe your Answer* modal, define the `name` and `description` + * properties. + * If no parameters are specified, the save action is + * triggered with a modal to prompt users to + * add a name and description for the Answer. + * @param - optional attributes to set Answer properties. + * `name` - Name string for the Answer. + * `description` - Description text for the Answer. + * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed. + * @example + * ```js + * const saveAnswerResponse = await searchEmbed.trigger(HostEvent.SaveAnswer, { + * name: "Sales by states", + * description: "Total sales by states in MidWest" + * }); + * ``` + * @example + * ```js + * // You can use the Data event dispatched on each answer creation to get the vizId and use in SaveAnswer host event. + * let latestSpotterVizId = ''; + * spotterEmbed.on(EmbedEvent.Data, (payload) => { + * latestSpotterVizId = payload.data.id; + * }); + * + * spotterEmbed.trigger(HostEvent.SaveAnswer, { vizId: latestSpotterVizId }); + * ``` + * @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl + */ + SaveAnswer = "saveAnswer", + /** + * EmbedApi + * @hidden + */ + UIPassthrough = "UiPassthrough", + /** + * Triggers the table visualization re-render with the updated data. + * Includes the following properties: + * @param - `columnDataLite` - an array of object containing the + * data value modifications retrieved from the `EmbedEvent.TableVizRendered` + * payload.For example, { columnDataLite: []}`. + * + * @example + * ```js + * searchEmbed.on(EmbedEvent.TableVizRendered, (payload) => { + * console.log(payload); + * const columnDataLite = payload.data.data.columnDataLite; + * columnDataLite[0].dataValue[0]="new fob"; + * console.log('>>> new Data', columnDataLite); + * searchEmbed.trigger(HostEvent.TransformTableVizData, columnDataLite); + * }) + * ``` + * @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl + */ + TransformTableVizData = "TransformTableVizData", + /** + * Triggers a search operation with the search tokens specified in + * the search query string in spotter embed. + * @param - `query`: Text string in Natural Language format + * @param - `executeSearch`: Boolean to execute search and update search query + * @example + * ```js + * spotterEmbed.trigger(HostEvent.SpotterSearch, { + * query: 'revenue per year', + * executeSearch: true, + * }) + * ``` + * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl + */ + SpotterSearch = "SpotterSearch", + /** + * Edits the last prompt in spotter embed. + * @param - `query`: Text string + * @example + * ```js + * spotterEmbed.trigger(HostEvent.EditLastPrompt, "revenue per year"); + * ``` + * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl + */ + EditLastPrompt = "EditLastPrompt", + /** + * Opens the Worksheet preview modal in Spotter Embed. + * @example + * ```js + * spotterEmbed.trigger(HostEvent.PreviewSpotterData); + * ``` + * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl + */ + PreviewSpotterData = "PreviewSpotterData", + /** + * Resets the Spotter Embed Conversation. + * @example + * ```js + * spotterEmbed.trigger(HostEvent.ResetSpotterConversation); + * ``` + * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl + */ + ResetSpotterConversation = "ResetSpotterConversation", + /** + * Deletes the last prompt in spotter embed. + * @example + * ```js + * spotterEmbed.trigger(HostEvent.DeleteLastPrompt); + * ``` + * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl + */ + DeleteLastPrompt = "DeleteLastPrompt", + /** + * Toggle the visualization to chart or table view. + * @param - `vizId ` refers to the Visualization ID in Spotter embed and is required. + * @example + * ```js + * let latestSpotterVizId = ''; + * spotterEmbed.on(EmbedEvent.Data, (payload) => { + * latestSpotterVizId = payload.data.id; + * }); + * + * spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, { vizId: latestSpotterVizId }); + *``` + * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl + */ + AnswerChartSwitcher = "answerChartSwitcher", + /** + * @hidden + * Trigger exit from presentation mode when user exits fullscreen. + * This is automatically triggered by the SDK when fullscreen mode is exited. + * ```js + * liveboardEmbed.trigger(HostEvent.ExitPresentMode); + *``` + * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl + */ + ExitPresentMode = "exitPresentMode", + /** + * Triggers the full height lazy load data. + * @example + * ```js + * liveboardEmbed.on(EmbedEvent.RequestVisibleEmbedCoordinates, (payload) => { + * console.log(payload); + * }); + * ``` + * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl + * + * @hidden + */ + VisibleEmbedCoordinates = "visibleEmbedCoordinates", + /** + * Trigger the *Spotter* action for visualizations present on the liveboard's vizzes. + * @param - `vizId` refers to the Visualization ID in Spotter embed and is required. + * @example + * ```js + * let latestSpotterVizId = ''; + * spotterEmbed.on(EmbedEvent.Data, (payload) => { + * latestSpotterVizId = payload.data.id; + * }); + * + * spotterEmbed.trigger(HostEvent.AskSpotter, { vizId: latestSpotterVizId }); + * ``` + * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl + */ + AskSpotter = "AskSpotter", + /** + * @hidden + * Triggers the update of the embed params. + * + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.UpdateEmbedParams, viewConfig); + * ``` + */ + UpdateEmbedParams = "updateEmbedParams", + /** + * @hidden + * Triggers the get of the page context. + * @example + * ```js + * liveboardEmbed.trigger(HostEvent.GetPageContext); + * ``` + */ + GetPageContext = "GetPageContext" +} +/** + * The different visual modes that the data sources panel within + * search could appear in, such as hidden, collapsed, or expanded. + */ +export declare enum DataSourceVisualMode { + /** + * The data source panel is hidden. + */ + Hidden = "hide", + /** + * The data source panel is collapsed, but the user can manually expand it. + */ + Collapsed = "collapse", + /** + * The data source panel is expanded, but the user can manually collapse it. + */ + Expanded = "expand" +} +/** + * ThoughtSpot application pages include actions and menu commands + * for various user-initiated operations. These actions are represented + * as enumeration members in the SDK. To show, hide, or disable + * specific actions in the embedded view, define the Action + * enumeration members in the `disabledActions`, `visibleActions`, + * or `hiddenActions` array. + * @example + * ```js + * const embed = new LiveboardEmbed('#tsEmbed', { + * ... //other embed view config + * visibleActions: [Action.Save, Action.Edit, Action.Present, ActionAction.Explore], + * disabledActions: [Action.Download], + * //hiddenActions: [], // Set either this or visibleActions + * }) + * ``` + * @example + * ```js + * const embed = new LiveboardEmbed('#tsEmbed', { + * ... //other embed view config + * //visibleActions: [], + * disabledActions: [Action.Download], + * hiddenActions: [Action.Edit, ActionAction.Explore], + * }) + * ``` + * See also link:https://developers.thoughtspot.com/docs/actions[Action IDs in the SDK] + */ +export declare enum Action { + /** + * The **Save** action on an Answer or Liveboard. + * Allows users to save the changes. + * @example + * ```js + * disabledActions: [Action.Save] + * ``` + */ + Save = "save", + /** + * @hidden + */ + Update = "update", + /** + * @hidden + */ + SaveUntitled = "saveUntitled", + /** + * The **Save as View** action on the Answer + * page. Saves an Answer as a View object in the full + * application embedding mode. + * @example + * ```js + * disabledActions: [Action.SaveAsView] + * ``` + */ + SaveAsView = "saveAsView", + /** + * The **Make a copy** action on a Liveboard or Answer + * page. Creates a copy of the Liveboard. + * In LiveboardEmbed, the **Make a copy** action is not available for + * visualizations in the embedded Liveboard view. + * In AppEmbed, the **Make a copy** action is available on both + * Liveboards and visualizations. + * @example + * ```js + * disabledActions: [Action.MakeACopy] + * ``` + */ + MakeACopy = "makeACopy", + /** + * The **Copy and Edit** action on a Liveboard. + * This action is now replaced with `Action.MakeACopy`. + * @example + * ```js + * disabledActions: [Action.EditACopy] + * ``` + */ + EditACopy = "editACopy", + /** + * The **Copy link** menu action on a Liveboard visualization. + * Copies the visualization URL + * @example + * ```js + * disabledActions: [Action.CopyLink] + * ``` + */ + CopyLink = "embedDocument", + /** + * @hidden + */ + ResetLayout = "resetLayout", + /** + * The **Schedule** menu action on a Liveboard. + * Allows scheduling a Liveboard job, for example, + * sending periodic notifications. + * @example + * ```js + * disabledActions: [Action.Schedule] + * ``` + */ + Schedule = "subscription", + /** + * The **Manage schedules** menu action on a Liveboard. + * Allows users to manage scheduled Liveboard jobs. + * @example + * ```js + * disabledActions: [Action.SchedulesList] + * ``` + */ + SchedulesList = "schedule-list", + /** + * The **Share** action on a Liveboard, Answer, or Worksheet. + * Allows users to share an object with other users and groups. + * @example + * ```js + * disabledActions: [Action.Share] + * ``` + */ + Share = "share", + /** + * The **Add filter** action on a Liveboard page. + * Allows adding filters to visualizations on a Liveboard. + * @example + * ```js + * disabledActions: [Action.AddFilter] + * ``` + */ + AddFilter = "addFilter", + /** + * The **Add Data Panel Objects** action on the data panel v2. + * Allows to show action menu to add different objects (such as + * formulas, Parameters) in data panel new experience. + * @example + * ```js + * disabledActions: [Action.AddDataPanelObjects] + * ``` + * @version SDK: 1.32.0 | ThoughtSpot: 10.0.0.cl, 10.1.0.sw + */ + AddDataPanelObjects = "addDataPanelObjects", + /** + * The filter configuration options for a Liveboard. + * The configuration options are available when adding + * filters on a Liveboard. + * + * @example + * ```js + * disabledActions: [Action.ConfigureFilter] + * ``` + */ + ConfigureFilter = "configureFilter", + /** + * The **Collapse data sources** icon on the Search page. + * Collapses the panel showing data sources. + * + * @example + * ```js + * disabledActions: [Action.CollapseDataPanel] + * ``` + * @version: SDK: 1.1.0 | ThoughtSpot Cloud: ts7.may.cl, 8.4.1.sw + */ + CollapseDataSources = "collapseDataSources", + /** + * The **Collapse data panel** icon on the Search page. + * Collapses the data panel view. + * + * @version: SDK: 1.34.0 | ThoughtSpot Cloud: 10.3.0.cl + * + * @example + * ```js + * disabledActions: [Action.CollapseDataPanel] + * ``` + */ + CollapseDataPanel = "collapseDataPanel", + /** + * The **Choose sources** button on Search page. + * Allows selecting data sources for search queries. + * @example + * ```js + * disabledActions: [Action.ChooseDataSources] + * ``` + */ + ChooseDataSources = "chooseDataSources", + /** + * The **Create formula** action on a Search or Answer page. + * Allows adding formulas to an Answer. + * @example + * ```js + * disabledActions: [Action.AddFormula] + * ``` + */ + AddFormula = "addFormula", + /** + * The **Add parameter** action on a Liveboard or Answer. + * Allows adding Parameters to a Liveboard or Answer. + * @example + * ```js + * disabledActions: [Action.AddParameter] + * ``` + */ + AddParameter = "addParameter", + /** + * The **Add Column Set** action on a Answer. + * Allows adding column sets to a Answer. + * @example + * ```js + * disabledActions: [Action.AddColumnSet] + * ``` + * @version SDK: 1.32.0 | ThoughtSpot: 10.0.0.cl, 10.1.0.sw + */ + AddColumnSet = "addSimpleCohort", + /** + * The **Add Query Set** action on a Answer. + * Allows adding query sets to a Answer. + * @example + * ```js + * disabledActions: [Action.AddQuerySet] + * ``` + * @version SDK: 1.32.0 | ThoughtSpot: 10.0.0.cl, 10.1.0.sw + */ + AddQuerySet = "addAdvancedCohort", + /** + * @hidden + */ + SearchOnTop = "searchOnTop", + /** + * The **SpotIQ analyze** menu action on a visualization or + * Answer page. + * @example + * ```js + * disabledActions: [Action.SpotIQAnalyze] + * ``` + */ + SpotIQAnalyze = "spotIQAnalyze", + /** + * @hidden + */ + ExplainInsight = "explainInsight", + /** + * @hidden + */ + SpotIQFollow = "spotIQFollow", + /** + * The Share action for a Liveboard visualization. + */ + ShareViz = "shareViz", + /** + * @hidden + */ + ReplaySearch = "replaySearch", + /** + * The **Show underlying data** menu action on a + * visualization or Answer page. + * Displays detailed information and raw data + * for a given visualization. + * @example + * ```js + * disabledActions: [Action.ShowUnderlyingData] + * ``` + */ + ShowUnderlyingData = "showUnderlyingData", + /** + * The **Download** menu action on Liveboard + * visualizations and Answers. + * Allows downloading a visualization or Answer. + * @example + * ```js + * disabledActions: [Action.DownloadAsPng] + * ``` + */ + Download = "download", + /** + * The **Download** > **PNG** menu action for charts on a Liveboard + * or Answer page. + * Downloads a visualization or Answer as a PNG file. + * @example + * ```js + * disabledActions: [Action.DownloadAsPng] + * ``` + */ + DownloadAsPng = "downloadAsPng", + /** + * + *The **Download PDF** action that downloads a Liveboard, + * visualization, or Answer as a PDF file. + * + * **NOTE**: The **Download** > **PDF** option is available for + * tables in visualizations and Answers. + * @example + * ```js + * disabledActions: [Action.DownloadAsPdf] + * ``` + */ + DownloadAsPdf = "downloadAsPdf", + /** + * The **Download** > **CSV** menu action for tables on a Liveboard + * or Answer page. + * Downloads a visualization or Answer in the XLSX format. + * @example + * ```js + * disabledActions: [Action.DownloadAsCsv] + * ``` + */ + DownloadAsCsv = "downloadAsCSV", + /** + * The **Download** > **XLSX** menu action for tables on a Liveboard + * or Answer page. + * Downloads a visualization or Answer in the XLSX format. + * @example + * ```js + * disabledActions: [Action.DownloadAsXlsx] + * ``` + */ + DownloadAsXlsx = "downloadAsXLSX", + /** + * @hidden + */ + DownloadTrace = "downloadTrace", + /** + * The **Export TML** menu action on a Liveboard, Answer, and + * the Data Workspace pages for data objects and connections. + * + * Allows exporting an object as a TML file. + * + * @example + * ```js + * disabledActions: [Action.ExportTML] + * ``` + */ + ExportTML = "exportTSL", + /** + * The **Import TML** menu action on the + * *Data Workspace* > *Utilities* page. + * Imports TML representation of ThoughtSpot objects. + * @example + * ```js + * disabledActions: [Action.ImportTML] + * ``` + */ + ImportTML = "importTSL", + /** + * The **Update TML** menu action for Liveboards and Answers. + * Updates TML representation of ThoughtSpot objects. + * @example + * ```js + * disabledActions: [Action.UpdateTML] + * ``` + */ + UpdateTML = "updateTSL", + /** + * The **Edit TML** menu action for Liveboards and Answers. + * Opens the TML editor. + * @example + * ```js + * disabledActions: [Action.EditTML] + * ``` + */ + EditTML = "editTSL", + /** + * The **Present** menu action for Liveboards and Answers. + * Allows presenting a Liveboard or visualization in + * slideshow mode. + * @example + * ```js + * disabledActions: [Action.Present] + * ``` + */ + Present = "present", + /** + * The visualization tile resize option. + * Also available via More `...` options menu on a visualization. + * Allows resizing visualization tiles and switching + * between different preset layout option. + * + * @example + * ```js + * disabledActions: [Action.ToggleSize] + * ``` + */ + ToggleSize = "toggleSize", + /** + * The *Edit* action on the Liveboard page and in the + * visualization menu. + * Opens a Liveboard or visualization in edit mode. + * @example + * ```js + * disabledActions: [Action.Edit] + * ``` + */ + Edit = "edit", + /** + * The text edit option for Liveboard and visualization titles. + * @example + * ```js + * disabledActions: [Action.EditTitle] + * ``` + */ + EditTitle = "editTitle", + /** + * The **Delete** action on a Liveboard, *Liveboards* and + * *Answers* list pages in full application embedding. + * + * @example + * ```js + * disabledActions: [Action.Remove] + * ``` + */ + Remove = "delete", + /** + * @hidden + */ + Ungroup = "ungroup", + /** + * @hidden + */ + Describe = "describe", + /** + * @hidden + */ + Relate = "relate", + /** + * @hidden + */ + CustomizeHeadlines = "customizeHeadlines", + /** + * @hidden + */ + PinboardInfo = "pinboardInfo", + /** + * The **Show Liveboard details** menu action on a Liveboard. + * Displays details such as the name, description, and + * author of the Liveboard, and timestamp of Liveboard creation + * and update. + * @example + * ```js + * disabledActions: [Action.LiveboardInfo] + * ``` + */ + LiveboardInfo = "pinboardInfo", + /** + * @hidden + */ + SendAnswerFeedback = "sendFeedback", + /** + * @hidden + */ + DownloadEmbraceQueries = "downloadEmbraceQueries", + /** + * The **Pin** menu action on an Answer or + * Search results page. + * @example + * ```js + * disabledActions: [Action.Pin] + * ``` + */ + Pin = "pin", + /** + * @hidden + */ + AnalysisInfo = "analysisInfo", + /** + * The **Schedule** menu action on a Liveboard. + * Allows scheduling a Liveboard job. + * @example + * ```js + * disabledActions: [Action.Subscription] + * ``` + */ + Subscription = "subscription", + /** + * The **Explore** action on Liveboard visualizations + * @example + * ```js + * disabledActions: [Action.Explore] + * ``` + */ + Explore = "explore", + /** + * The contextual menu action to include a specific data point + * when drilling down a table or chart on an Answer. + * + * @example + * ```js + * disabledActions: [Action.DrillInclude] + * ``` + */ + DrillInclude = "context-menu-item-include", + /** + * The contextual menu action to exclude a specific data point + * when drilling down a table or chart on an Answer. + * @example + * ```js + * disabledActions: [Action.DrillInclude] + * ``` + */ + DrillExclude = "context-menu-item-exclude", + /** + * The **Copy to clipboard** menu action on tables in an Answer + * or Liveboard. + * Copies the selected data point. + * @example + * ```js + * disabledActions: [Action.CopyToClipboard] + * ``` + */ + CopyToClipboard = "context-menu-item-copy-to-clipboard", + CopyAndEdit = "context-menu-item-copy-and-edit", + /** + * @hidden + */ + DrillEdit = "context-menu-item-edit", + EditMeasure = "context-menu-item-edit-measure", + Separator = "context-menu-item-separator", + /** + * The **Drill down** menu action on Answers and Liveboard + * visualizations. + * Allows drilling down to a specific data point on a chart or table. + * @example + * ```js + * disabledActions: [Action.DrillDown] + * ``` + */ + DrillDown = "DRILL", + /** + * The request access action on Liveboards. + * Allows users with view permissions to request edit access to a Liveboard. + * @example + * ```js + * disabledActions: [Action.RequestAccess] + * ``` + */ + RequestAccess = "requestAccess", + /** + * The **Query visualizer** and **Query SQL** buttons in + * Query details panel of the Answer page. + * + * **Query visualizer** - Displays the tables + * and filters used in a search query. + * **Query SQL** - Displays the SQL statements used + * in a search query to fetch data. + * @example + * ```js + * disabledActions: [Action.QueryDetailsButtons] + * ``` + */ + QueryDetailsButtons = "queryDetailsButtons", + /** + * The **Delete** action for Answers in the full application + * embedding mode. + * @example + * ```js + * disabledActions: [Action.AnswerDelete] + * ``` + * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw + */ + AnswerDelete = "onDeleteAnswer", + /** + * The chart switcher icon on Answer page and + * visualizations in edit mode. + * Allows switching to the table or chart mode + * when editing a visualization. + * @example + * ```js + * disabledActions: [Action.AnswerChartSwitcher] + * ``` + * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw + */ + AnswerChartSwitcher = "answerChartSwitcher", + /** + * The Favorites icon (*) for Answers, + * Liveboard, and data objects like Worksheet, Model, + * Tables and Views. + * Allows adding an object to the user's favorites list. + * @example + * ```js + * disabledActions: [Action.AddToFavorites] + * ``` + * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw + */ + AddToFavorites = "addToFavorites", + /** + * The edit icon on Liveboards (Classic experience). + * @example + * ```js + * disabledActions: [Action.EditDetails] + * ``` + * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw + */ + EditDetails = "editDetails", + /** + * The *Create alert* action for KPI charts. + * Allows users to schedule threshold-based alerts + * for KPI charts. + * @example + * ```js + * disabledActions: [Action.CreateMonitor] + * ``` + * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw + */ + CreateMonitor = "createMonitor", + /** + * @deprecated + * Reports errors + * @example + * ```js + * disabledActions: [Action.ReportError] + * ``` + * @version SDK: 1.11.1 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw + */ + ReportError = "reportError", + /** + * The **Sync to sheets** action on Answers and Liveboard visualizations. + * Allows sending data to a Google Sheet. + * @example + * ```js + * disabledActions: [Action.SyncToSheets] + * ``` + * @version SDK: 1.18.0| ThoughtSpot: 8.10.0.cl, 9.0.1.sw + */ + SyncToSheets = "sync-to-sheets", + /** + * The **Sync to other apps** action on Answers and Liveboard visualizations. + * Allows sending data to third-party apps like Slack, Salesforce, + * Microsoft Teams, and so on. + * @example + * ```js + * disabledActions: [Action.SyncToOtherApps] + * ``` + * @version SDK: 1.18.0| ThoughtSpot: 8.10.0.cl, 9.0.1.sw + */ + SyncToOtherApps = "sync-to-other-apps", + /** + * The **Manage pipelines** action on Answers and Liveboard visualizations. + * Allows users to manage data sync pipelines to third-party apps. + * @example + * ```js + * disabledActions: [Action.ManagePipelines] + * ``` + * @version SDK: 1.18.0| ThoughtSpot: 8.10.0.cl, 9.0.1.sw + */ + ManagePipelines = "manage-pipeline", + /** + * The **Filter** action on Liveboard visualizations. + * Allows users to apply cross-filters on a Liveboard. + * @example + * ```js + * disabledActions: [Action.CrossFilter] + * ``` + * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.8.0.sw + */ + CrossFilter = "context-menu-item-cross-filter", + /** + * The **Sync to Slack** action on Liveboard visualizations. + * Allows sending data to third-party apps Slack + * @example + * ```js + * disabledActions: [Action.SyncToSlack] + * ``` + * @version @version SDK : 1.32.0 | ThoughtSpot Cloud: 10.1.0.cl + */ + SyncToSlack = "syncToSlack", + /** + * The **Sync to Teams** action on Liveboard visualizations. + * Allows sending data to third-party apps Team + * @example + * ```js + * disabledActions: [Action.SyncToTeams] + * ``` + * @version @version SDK : 1.32.0 | ThoughtSpot Cloud: 10.1.0.cl + */ + SyncToTeams = "syncToTeams", + /** + * The **Remove** action that appears when cross filters are applied + * on a Liveboard. + * Removes filters applied o a visualization. + * @example + * ```js + * disabledActions: [Action.RemoveCrossFilter] + * ``` + * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.1.sw + */ + RemoveCrossFilter = "context-menu-item-remove-cross-filter", + /** + * The **Aggregate** option in the chart axis or the + * table column customization menu. + * Provides aggregation options to analyze the data on a chart or table. + * @example + * ```js + * disabledActions: [Action.AxisMenuAggregate] + * ``` + * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.1.sw + */ + AxisMenuAggregate = "axisMenuAggregate", + /** + * The **Time bucket** option in the chart axis or table column + * customization menu. + * Allows defining time metric for date comparison. + * @example + * ```js + * disabledActions: [Action.AxisMenuTimeBucket] + * ``` + * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.1.sw + */ + AxisMenuTimeBucket = "axisMenuTimeBucket", + /** + * The **Filter** action in the chart axis or table column + * customization menu. + * Allows adding, editing, or removing filters. + * + * @example + * ```js + * disabledActions: [Action.AxisMenuFilter] + * ``` + * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.1.sw + */ + AxisMenuFilter = "axisMenuFilter", + /** + * The **Conditional formatting** action on chart or table. + * Allows adding rules for conditional formatting of data + * points on a chart or table. + * @example + * ```js + * disabledActions: [Action.AxisMenuConditionalFormat] + * ``` + * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.1.sw + */ + AxisMenuConditionalFormat = "axisMenuConditionalFormat", + /** + * The **Sort** menu action on a table or chart axis + * Sorts data in ascending or descending order. + * Allows adding, editing, or removing filters. + * @example + * ```js + * disabledActions: [Action.AxisMenuConditionalFormat] + * ``` + * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.1.sw + */ + AxisMenuSort = "axisMenuSort", + /** + * The **Group** option in the chart axis or table column + * customization menu. + * Allows grouping data points if the axes use the same + * unit of measurement and a similar scale. + * @example + * ```js + * disabledActions: [Action.AxisMenuGroup] + * ``` + * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.1.sw + */ + AxisMenuGroup = "axisMenuGroup", + /** + * The **Position** option in the axis customization menu. + * Allows changing the position of the axis to the + * left or right side of the chart. + * @example + * ```js + * disabledActions: [Action.AxisMenuPosition] + * ``` + * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.1.sw + */ + AxisMenuPosition = "axisMenuPosition", + /** + * The **Rename** option in the chart axis or table column customization menu. + * Renames the axis label on a chart or the column header on a table. + * @example + * ```js + * disabledActions: [Action.AxisMenuRename] + * ``` + * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.1.sw + */ + AxisMenuRename = "axisMenuRename", + /** + * The **Edit** action in the axis customization menu. + * Allows editing the axis name, position, minimum and maximum values, + * and format of a column. + * @example + * ```js + * disabledActions: [Action.AxisMenuEdit] + * ``` + * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.1.sw + */ + AxisMenuEdit = "axisMenuEdit", + /** + * The **Number format** action to customize the format of + * the data labels on a chart or table. + * @example + * ```js + * disabledActions: [Action.AxisMenuNumberFormat] + * ``` + * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.1.sw + */ + AxisMenuNumberFormat = "axisMenuNumberFormat", + /** + * The **Text wrapping** action on a table. + * Wraps or clips column text on a table. + * @example + * ```js + * disabledActions: [Action.AxisMenuTextWrapping] + * ``` + * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.1.sw + */ + AxisMenuTextWrapping = "axisMenuTextWrapping", + /** + * The **Remove** action in the chart axis or table column + * customization menu. + * Removes the data labels from a chart or the column of a + * table visualization. + * @example + * ```js + * disabledActions: [Action.AxisMenuRemove] + * ``` + * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.1.sw + */ + AxisMenuRemove = "axisMenuRemove", + /** + * @hidden + */ + InsertInToSlide = "insertInToSlide", + /** + * The **Rename** menu action on Liveboards and visualizations. + * Allows renaming a Liveboard or visualization. + * @example + * ```js + * disabledActions: [Action.RenameModalTitleDescription] + * ``` + * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl, 9.8.0.sw + */ + RenameModalTitleDescription = "renameModalTitleDescription", + /** + * The *Request verification* action on a Liveboard. + * Initiates a request for Liveboard verification. + * @example + * ```js + * disabledActions: [Action.RequestVerification] + * ``` + * @version SDK: 1.25.0 | ThoughtSpot: 9.6.0.cl, 10.1.0.sw + */ + RequestVerification = "requestVerification", + /** + * + * Allows users to mark a Liveboard as verified. + * @example + * ```js + * disabledActions: [Action.MarkAsVerified] + * ``` + * @version SDK: 1.25.0 | ThoughtSpot: 9.6.0.cl, 10.1.0.sw + */ + MarkAsVerified = "markAsVerified", + /** + * The **Add Tab** action on a Liveboard. + * Allows adding a new tab to a Liveboard view. + * @example + * ```js + * disabledActions: [Action.AddTab] + * ``` + * @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw + */ + AddTab = "addTab", + /** + * + *Initiates contextual change analysis on KPI charts. + * @example + * ```js + * disabledActions: [Action.EnableContextualChangeAnalysis] + * ``` + * @version SDK: 1.25.0 | ThoughtSpot Cloud: 9.6.0.cl + */ + EnableContextualChangeAnalysis = "enableContextualChangeAnalysis", + /** + * Action ID to hide or disable Iterative Change Analysis option + * on contextual change analysis Inisght charts context menu + * + * @example + * ```js + * disabledActions: [Action.EnableIterativeChangeAnalysis] + * ``` + * @version SDK: 1.41.0 | ThoughtSpot Cloud: 9.12.0.cl + */ + EnableIterativeChangeAnalysis = "enableIterativeChangeAnalysis", + /** + * Action ID to hide or disable Natural Language Search query. + * + * @example + * ```js + * disabledActions: [Action.ShowSageQuery] + * ``` + * @version SDK: 1.26.0 | ThoughtSpot Cloud: 9.7.0.cl + */ + ShowSageQuery = "showSageQuery", + /** + * + * Action ID to hide or disable the edit option for the + * results generated from the + * Natural Language Search query. + * + * @example + * ```js + * disabledActions: [Action.EditSageAnswer] + * ``` + * @version SDK: 1.26.0 | ThoughtSpot Cloud: 9.7.0.cl + */ + EditSageAnswer = "editSageAnswer", + /** + * The feedback widget for AI-generated Answers. + * Allows users to send feedback on the Answers generated + * from a Natural Language Search query. + * + * @example + * ```js + * disabledActions: [Action.SageAnswerFeedback] + * ``` + * @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl + */ + SageAnswerFeedback = "sageAnswerFeedback", + /** + * + * @example + * ```js + * disabledActions: [Action.ModifySageAnswer] + * ``` + * @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl + */ + ModifySageAnswer = "modifySageAnswer", + /** + * The **Move to Tab** menu action on visualizations in Liveboard edit mode. + * Allows moving a visualization to a different tab. + * @example + * ```js + * disabledActions: [Action.MoveToTab] + * ``` + */ + MoveToTab = "onContainerMove", + /** + * The **Manage Alerts** menu action on KPI visualizations. + * Allows creating, viewing, and editing monitor + * alerts for a KPI chart. + * + * @example + * ```js + * disabledActions: [Action.ManageMonitor] + * ``` + */ + ManageMonitor = "manageMonitor", + /** + * The Liveboard Personalised Views dropdown. + * Allows navigating to a personalized Liveboard View. + * @example + * ```js + * disabledActions: [Action.PersonalisedViewsDropdown] + * ``` + * @version SDK : 1.26.0 | ThoughtSpot: 9.7.0.cl, 10.1.0.sw + */ + PersonalisedViewsDropdown = "personalisedViewsDropdown", + /** + * Action ID for show or hide the user details on a + * Liveboard (Recently visited / social proof) + * @example + * ```js + * disabledActions: [Action.LiveboardUsers] + * ``` + * @version SDK : 1.26.0 | ThoughtSpot: 9.7.0.cl, 10.1.0.sw + */ + LiveboardUsers = "liveboardUsers", + /** + * Action ID for the Parent TML action + * The parent action **TML** must be included to access TML-related options + * within the cascading menu (specific to the Answer page) + * @example + * ```js + * // to include specific TML actions + * visibleActions: [Action.TML, Action.ExportTML, Action.EditTML] + * + * ``` + * @example + * ```js + * hiddenAction: [Action.TML] // hide all TML actions + * disabledActions: [Action.TML] // to disable all TML actions + * ``` + * @version SDK : 1.28.3 | ThoughtSpot: 9.12.0.cl, 10.1.0.sw + */ + TML = "tml", + /** + * The **Create Liveboard* action on + * the Liveboards page and the Pin modal. + * Allows users to create a Liveboard. + * + * @example + * ```js + * hiddenAction: [Action.CreateLiveboard] + * disabledActions: [Action.CreateLiveboard] + * ``` + * @version SDK: 1.32.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw + */ + CreateLiveboard = "createLiveboard", + /** + * Action ID for to hide or disable the + * Verified Liveboard banner. + * @example + * ```js + * hiddenAction: [Action.VerifiedLiveboard] + * ``` + * @version SDK: 1.29.0 | ThoughtSpot: 9.10.0.cl, 10.1.0.sw + */ + VerifiedLiveboard = "verifiedLiveboard", + /** + * Action ID for the *Ask Sage* In Natural Language Search embed, + * *Spotter* in Liveboard, full app, and Spotter embed. + * + * Allows initiating a conversation with ThoughtSpot AI analyst. + * + * @example + * ```js + * hiddenAction: [Action.AskAi] + * ``` + * @version SDK: 1.29.0 | ThoughtSpot Cloud: 9.12.0.cl + */ + AskAi = "AskAi", + /** + * The **Add KPI to Watchlist** action on Home page watchlist. + * Adds a KPI chart to the watchlist on the Home page. + * @example + * ```js + * disabledActions: [Action.AddToWatchlist] + * ``` + * @version SDK : 1.27.9 | ThoughtSpot Cloud: 9.12.5.cl + */ + AddToWatchlist = "addToWatchlist", + /** + * The **Remove from watchlist** menu action on KPI watchlist. + * Removes a KPI chart from the watchlist on the Home page. + * @example + * ```js + * disabledActions: [Action.RemoveFromWatchlist] + * ``` + * @version SDK : 1.27.9 | ThoughtSpot: 9.12.5.cl + */ + RemoveFromWatchlist = "removeFromWatchlist", + /** + * The **Organize Favourites** action on Homepage + * *Favorites* module. + * + * @example + * ```js + * disabledActions: [Action.OrganiseFavourites] + * ``` + * @version SDK : 1.32.0 | ThoughtSpot: 10.0.0.cl + */ + OrganiseFavourites = "organiseFavourites", + /** + * The **AI Highlights** action on a Liveboard. + * + * @example + * ```js + * hiddenAction: [Action.AIHighlights] + * ``` + * @version SDK: 1.27.10 | ThoughtSpot Cloud: 9.12.5.cl + */ + AIHighlights = "AIHighlights", + /** + * The *Edit* action on the *Liveboard Schedules* page + * (new Homepage experience). + * Allows editing Liveboard schedules. + * + * @example + * ```js + * disabledActions: [Action.EditScheduleHomepage] + * ``` + * @version SDK: 1.34.0 | ThoughtSpot Cloud: 10.3.0.cl + */ + EditScheduleHomepage = "editScheduleHomepage", + /** + * The *Pause* action on the *Liveboard Schedules* page + * Pauses a scheduled Liveboard job. + * @example + * ```js + * disabledActions: [Action.PauseScheduleHomepage] + * ``` + * @version SDK: 1.34.0 | ThoughtSpot Cloud: 10.3.0.cl + */ + PauseScheduleHomepage = "pauseScheduleHomepage", + /** + * The **View run history** action **Liveboard Schedules** page. + * Allows viewing schedule run history. + * @example + * ```js + * disabledActions: [Action.ViewScheduleRunHomepage] + * ``` + * @version SDK: 1.34.0 | ThoughtSpot: 10.3.0.cl + */ + ViewScheduleRunHomepage = "viewScheduleRunHomepage", + /** + * Action ID to hide or disable the + * unsubscribe option for Liveboard schedules. + * @example + * ```js + * disabledActions: [Action.UnsubscribeScheduleHomepage] + * ``` + * @version SDK: 1.34.0 | ThoughtSpot: 10.3.0.cl + */ + UnsubscribeScheduleHomepage = "unsubscribeScheduleHomepage", + /** + * The **Manage Tags** action on Homepage Favourite Module. + * @example + * ```js + * disabledActions: [Action.ManageTags] + * ``` + * @version SDK : 1.34.0 | ThoughtSpot Cloud: 10.3.0.cl + */ + ManageTags = "manageTags", + /** + * The **Delete** action on the **Liveboard Schedules* page. + * Deletes a Liveboard schedule. + * @example + * ```js + * disabledActions: [Action.DeleteScheduleHomepage] + * ``` + * @version SDK: 1.34.0 | ThoughtSpot: 10.3.0.cl + */ + DeleteScheduleHomepage = "deleteScheduleHomepage", + /** + * The **Analyze CTA** action on KPI chart. + * @example + * ```js + * disabledActions: [Action.KPIAnalysisCTA] + * ``` + * @version SDK: 1.34.0 | ThoughtSpot Cloud: 10.3.0.cl + */ + KPIAnalysisCTA = "kpiAnalysisCTA", + /** + * Action ID for disabling chip reorder in Answer and Liveboard + * @example + * ```js + * const disabledActions = [Action.DisableChipReorder] + * ``` + * @version SDK: 1.36.0 | ThoughtSpot Cloud: 10.6.0.cl + */ + DisableChipReorder = "disableChipReorder", + /** + * Action ID to show, hide, or disable filters + * in a Liveboard tab. + * + * @example + * ```js + * hiddenAction: [Action.ChangeFilterVisibilityInTab] + * ``` + * @version SDK: 1.36.0 | ThoughtSpot Cloud: 10.6.0.cl + */ + ChangeFilterVisibilityInTab = "changeFilterVisibilityInTab", + /** + * The **Preview data** button on the Spotter interface. + * Allows previewing the data used for Spotter queries. + * + * @example + * ```js + * hiddenAction: [Action.PreviewDataSpotter] + * ``` + * @version SDK: 1.36.0 | ThoughtSpot Cloud: 10.6.0.cl + */ + PreviewDataSpotter = "previewDataSpotter", + /** + * The **Reset** link on the Spotter interface. + * Resets the conversation with Spotter. + * + * @example + * ```js + * hiddenAction: [Action.ResetSpotterChat] + * ``` + * @version SDK: 1.36.0 | ThoughtSpot Cloud: 10.6.0.cl + */ + ResetSpotterChat = "resetSpotterChat", + /** + * Action ID for hide or disable the + * Spotter feedback widget. + * + * @example + * ```js + * hiddenAction: [Action.SpotterFeedback] + * ``` + * @version SDK: 1.36.0 | ThoughtSpot Cloud: 10.6.0.cl + */ + SpotterFeedback = "spotterFeedback", + /** + * Action ID for hide or disable + * the previous prompt edit option in Spotter. + * + * @example + * ```js + * hiddenAction: [Action.EditPreviousPrompt] + * ``` + * @version SDK: 1.36.0 | ThoughtSpot Cloud: 10.6.0.cl + */ + EditPreviousPrompt = "editPreviousPrompt", + /** + * Action ID for hide or disable + * the previous prompt deletion option in Spotter. + * + * @example + * ```js + * hiddenAction: [Action.DeletePreviousPrompt] + * ``` + * @version SDK: 1.36.0 | ThoughtSpot Cloud: 10.6.0.cl + */ + DeletePreviousPrompt = "deletePreviousPrompt", + /** + * Action ID for hide or disable editing tokens generated from + * Spotter results. + * @example + * ```js + * hiddenAction: [Action.EditTokens] + * ``` + * @version SDK: 1.36.0 | ThoughtSpot Cloud: 10.6.0.cl + */ + EditTokens = "editTokens", + /** + * Action ID for hiding rename option for Column rename + * @example + * ```js + * hiddenAction: [Action.ColumnRename] + * ``` + * @version SDK: 1.37.0 | ThoughtSpot Cloud: 10.8.0.cl + */ + ColumnRename = "columnRename", + /** + * Action ID for hide checkboxes for include or exclude + * cover and filter pages in the Liveboard PDF + * @example + * ```js + * hiddenAction: [Action.CoverAndFilterOptionInPDF] + * ``` + * @version SDK: 1.37.0 | ThoughtSpot Cloud: 10.8.0.cl + */ + CoverAndFilterOptionInPDF = "coverAndFilterOptionInPDF", + /** + * Action ID for hide or disable the + * Spotter in conversation training widget. + * The Add to Coaching feature is currently in beta + * and is disabled by default on embed deployments. + * To enable this feature on your instance, + * contact ThoughtSpot Support. + * @example + * ```js + * hiddenAction: [Action.InConversationTraining] + * disabledActions: [Action.InConversationTraining] + * + * ``` + * @version SDK: 1.39.0 | ThoughtSpot Cloud: 10.10.0.cl + */ + InConversationTraining = "InConversationTraining", + /** + * Action ID to hide the warnings banner in + * Spotter results. It's an EA feature and + * handled by LD. + * @example + * ```js + * hiddenAction: [Action.SpotterWarningsBanner] + * ``` + * @version SDK: 1.41.0 | ThoughtSpot Cloud: 10.13.0.cl + */ + SpotterWarningsBanner = "SpotterWarningsBanner", + /** + * Action ID to hide the warnings border on the knowledge + * card in Spotter results. It's an EA feature and + * handled by LD. + * @example + * ```js + * hiddenAction: [Action.SpotterWarningsOnTokens] + * ``` + * @version SDK: 1.41.0 | ThoughtSpot Cloud: 10.13.0.cl + */ + SpotterWarningsOnTokens = "SpotterWarningsOnTokens", + /** + * Action ID to disable the click event handler on knowledge + * card in Spotter results. It's an EA feature and + * handled by LD. + * @example + * ```js + * hiddenAction: [Action.SpotterTokenQuickEdit] + * ``` + * @version SDK: 1.41.0 | ThoughtSpot Cloud: 10.13.0.cl + */ + SpotterTokenQuickEdit = "SpotterTokenQuickEdit", + /** + * The **PNG screenshot in email** option in the schedule email dialog. + * Includes a PNG screenshot in the notification email body. + * @example + * ```js + * disabledActions: [Action.PngScreenshotInEmail] + * ``` + * ``` + * @version SDK: 1.42.0 | ThoughtSpot Cloud: 10.14.0.cl + */ + PngScreenshotInEmail = "pngScreenshotInEmail", + /** + * The **Remove attachment** action in the schedule email dialog. + * Removes an attachment from the email configuration. + * @example + * ```js + * disabledActions: [Action.RemoveAttachment] + * ``` + * ``` + * ``` + * @version SDK: 1.42.0 | ThoughtSpot Cloud: 10.14.0.cl + */ + RemoveAttachment = "removeAttachment" +} +export declare enum PrefetchFeatures { + FullApp = "FullApp", + SearchEmbed = "SearchEmbed", + LiveboardEmbed = "LiveboardEmbed", + VizEmbed = "VizEmbed" +} +/** + * Enum for options to change context trigger. + * The `BOTH_CLICKS` option is available from 10.8.0.cl. + */ +export declare enum ContextMenuTriggerOptions { + LEFT_CLICK = "left-click", + RIGHT_CLICK = "right-click", + BOTH_CLICKS = "both-clicks" +} +export interface ColumnValue { + column: { + id: string; + name: string; + dataType: string; + [key: string]: any; + }; + value: string | number | boolean | { + v: { + s: number; + e: number; + }; + }; +} +export interface VizPoint { + selectedAttributes: ColumnValue[]; + selectedMeasures: ColumnValue[]; +} +/** + * @group Events + */ +export interface CustomActionPayload { + contextMenuPoints?: { + clickedPoint: VizPoint; + selectedPoints: VizPoint[]; + }; + embedAnswerData: { + name: string; + id: string; + sources: { + header: { + guid: string; + }; + }; + columns: any[]; + data: any[]; + [key: string]: any; + }; + session: SessionInterface; + vizId?: string; +} +export interface CustomAction { + name: string; + id: string; + position: CustomActionsPosition; + target: CustomActionTarget; + metadataIds?: { + answerIds?: string[]; + liveboardIds?: string[]; + vizIds?: string[]; + }; + dataModelIds?: { + modelIds?: string[]; + modelColumnNames?: string[]; + }; + orgIds?: string[]; + groupIds?: string[]; +} +/** + * Enum options to show custom actions at different + * positions in the application. + */ +export declare enum CustomActionsPosition { + PRIMARY = "PRIMARY", + MENU = "MENU", + CONTEXTMENU = "CONTEXTMENU" +} +/** + * Enum options to mention the target of the custom action. + */ +export declare enum CustomActionTarget { + LIVEBOARD = "LIVEBOARD", + VIZ = "VIZ", + ANSWER = "ANSWER", + SPOTTER = "SPOTTER" +} +/** + * Enum options to show or suppress Visual Embed SDK and + * ThoughtSpot application logs in the console output. + * This attribute doesn't support suppressing + * browser warnings or errors. + */ +export declare enum LogLevel { + /** + * No application or SDK-related logs will be logged + * in the console output. + * @example + * ```js + * init({ + * ... //other embed view config, + * logLevel: LogLevel.SILENT, + * }) + * ``` + * @version SDK: 1.26.7 | ThoughtSpot Cloud: 9.10.0.cl + */ + SILENT = "SILENT", + /** + * Log only errors in the console output. + * @example + * ```js + * init({ + * ... //other embed view config, + * logLevel: LogLevel.ERROR, + * }) + * ``` + * @version SDK: 1.26.7 | ThoughtSpot Cloud: 9.10.0.cl + */ + ERROR = "ERROR", + /** + * Log only warnings and errors in the console output. + * @example + * ```js + * init({ + * ... //other embed view config, + * logLevel: LogLevel.WARN, + * }) + * ``` + * @version SDK: 1.26.7 | ThoughtSpot Cloud: 9.10.0.cl + */ + WARN = "WARN", + /** + * Log only the information alerts, warnings, and errors + * in the console output. + * @example + * ```js + * init({ + * ... //other embed view config, + * logLevel: LogLevel.INFO, + * }) + * ``` + * @version SDK: 1.26.7 | ThoughtSpot Cloud: 9.10.0.cl + */ + INFO = "INFO", + /** + * Log debug messages, warnings, information alerts, + * and errors in the console output. + * @example + * ```js + * init({ + * ... //other embed view config, + * logLevel: LogLevel.DEBUG, + * }) + * ``` + * @version SDK: 1.26.7 | ThoughtSpot Cloud: 9.10.0.cl + */ + DEBUG = "DEBUG", + /** + * All logs will be logged in the browser console. + * @example + * ```js + * init({ + * ... //other embed view config, + * logLevel: LogLevel.TRACE, + * }) + * ``` + * @version SDK: 1.26.7 | ThoughtSpot Cloud: 9.10.0.cl + */ + TRACE = "TRACE" +} +export interface DefaultAppInitData { + customisations: CustomisationsInterface; + authToken: string; + runtimeFilterParams: string | null; + runtimeParameterParams: string | null; + hiddenHomepageModules: HomepageModule[]; + reorderedHomepageModules: string[]; + hostConfig: Record; + hiddenHomeLeftNavItems: string[]; + customVariablesForThirdPartyTools: Record; + hiddenListColumns: ListPageColumns[]; + customActions: CustomAction[]; +} +export declare enum UIPassthroughEvent { + PinAnswerToLiveboard = "addVizToPinboard", + SaveAnswer = "saveAnswer", + GetDiscoverabilityStatus = "getDiscoverabilityStatus", + GetAvailableUIPassthroughs = "getAvailableUiPassthroughs", + GetAnswerConfig = "getAnswerPageConfig", + GetLiveboardConfig = "getPinboardPageConfig" +} +export type UIPassthroughContractBase = { + [UIPassthroughEvent.PinAnswerToLiveboard]: { + request: { + vizId?: string; + newVizName: string; + newVizDescription?: string; + liveboardId?: string; + tabId?: string; + newLiveboardName?: string; + newTabName?: string; + }; + response: { + liveboardId: string; + tabId: string; + vizId: string; + }; + }; + [UIPassthroughEvent.SaveAnswer]: { + request: { + name: string; + description: string; + vizId?: string; + isDiscoverable?: boolean; + }; + response: { + answerId: string; + saveResponse?: any; + shareResponse?: any; + }; + }; + [UIPassthroughEvent.GetDiscoverabilityStatus]: { + request: any; + response: { + shouldShowDiscoverability: boolean; + isDiscoverabilityCheckboxUnselectedPerOrg: boolean; + }; + }; + [UIPassthroughEvent.GetAvailableUIPassthroughs]: { + request: any; + response: { + keys: string[]; + }; + }; + [UIPassthroughEvent.GetAnswerConfig]: { + request: { + vizId?: string; + }; + response: any; + }; + [UIPassthroughEvent.GetLiveboardConfig]: { + request: any; + response: any; + }; +}; +export type UIPassthroughRequest = UIPassthroughContractBase[T]["request"]; +export type UIPassthroughResponse = UIPassthroughContractBase[T]["response"]; +export type UIPassthroughArrayResponse = Array<{ + redId?: string; + value?: UIPassthroughResponse; + error?: any; +}>; +export type EmbedApiHostEventMapping = { + [HostEvent.Pin]: UIPassthroughEvent.PinAnswerToLiveboard; + [HostEvent.SaveAnswer]: UIPassthroughEvent.SaveAnswer; +}; +export type HostEventRequest = HostEventT extends keyof EmbedApiHostEventMapping ? UIPassthroughRequest : any; +export type HostEventResponse = HostEventT extends keyof EmbedApiHostEventMapping ? UIPassthroughResponse : any; +export type TriggerPayload = PayloadT | HostEventRequest; +export type TriggerResponse = PayloadT extends HostEventRequest ? HostEventResponse : any; +declare enum ContextType { + Search = "search", + Liveboard = "liveboard", + Answer = "answer", + Spotter = "spotter", + Default = "default" +} +declare class HostEventClient { + iFrame: HTMLIFrameElement; + constructor(iFrame?: HTMLIFrameElement); + /** + * A wrapper over process trigger to + * @param {HostEvent} message Host event to send + * @param {any} data Data to send with the host event + * @returns {Promise} - the response from the process trigger + */ + protected processTrigger(message: HostEvent, data: any, context?: ContextType): Promise; + handleHostEventWithParam(apiName: UIPassthroughEventT, parameters: UIPassthroughRequest): Promise>; + hostEventFallback(hostEvent: HostEvent, data: any, context?: ContextType): Promise; + /** + * Setter for the iframe element used for host events + * @param {HTMLIFrameElement} iFrame - the iframe element to set + */ + setIframeElement(iFrame: HTMLIFrameElement): void; + triggerUIPassthroughApi(apiName: UIPassthroughEventT, parameters: UIPassthroughRequest): Promise>; + protected handlePinEvent(payload: HostEventRequest): Promise>; + protected handleSaveAnswerEvent(payload: HostEventRequest): Promise; + triggerHostEvent(hostEvent: HostEventT, payload?: TriggerPayload, context?: ContextT): Promise>; +} +declare class TsEmbed { + /** + * The DOM node which was inserted by the SDK to either + * render the iframe or display an error message. + * This is useful for removing the DOM node when the + * embed instance is destroyed. + */ + protected insertedDomEl: Node; + /** + * The DOM node where the ThoughtSpot app is to be embedded. + */ + protected el: HTMLElement; + /** + * The key to store the embed instance in the DOM node + */ + protected embedNodeKey: string; + protected isAppInitialized: boolean; + /** + * A reference to the iframe within which the ThoughtSpot app + * will be rendered. + */ + protected iFrame: HTMLIFrameElement; + /** + * Setter for the iframe element + * @param {HTMLIFrameElement} iFrame HTMLIFrameElement + */ + protected setIframeElement(iFrame: HTMLIFrameElement): void; + protected viewConfig: AllEmbedViewConfig & { + visibleTabs?: string[]; + hiddenTabs?: string[]; + showAlerts?: boolean; + }; + protected embedConfig: EmbedConfig; + /** + * The ThoughtSpot hostname or IP address + */ + protected thoughtSpotHost: string; + protected thoughtSpotV2Base: string; + /** + * A map of event handlers for particular message types triggered + * by the embedded app; multiple event handlers can be registered + * against a particular message type. + */ + private eventHandlerMap; + /** + * A flag that is set to true post render. + */ + protected isRendered: boolean; + /** + * A flag to mark if an error has occurred. + */ + private isError; + /** + * A flag that is set to true post preRender. + */ + private isPreRendered; + /** + * Should we encode URL Query Params using base64 encoding which thoughtspot + * will generate for embedding. This provides additional security to + * thoughtspot clusters against Cross site scripting attacks. + * @default false + */ + private shouldEncodeUrlQueryParams; + private defaultHiddenActions; + private resizeObserver; + protected hostEventClient: HostEventClient; + protected isReadyForRenderPromise: Promise; + /** + * Handler for fullscreen change events + */ + private fullscreenChangeHandler; + constructor(domSelector: DOMSelector, viewConfig?: AllEmbedViewConfig); + /** + * Throws error encountered during initialization. + */ + private throwInitError; + /** + * Handles errors within the SDK + * @param error The error message or object + */ + protected handleError(error: string | Record): void; + /** + * Extracts the type field from the event payload + * @param event The window message event + */ + private getEventType; + /** + * Extracts the port field from the event payload + * @param event The window message event + * @returns + */ + private getEventPort; + /** + * Checks if preauth cache is enabled + * from the view config and embed config + * @returns boolean + */ + private isPreAuthCacheEnabled; + /** + * Checks if current embed is FullAppEmbed with visible primary navbar + * @returns boolean + */ + private isFullAppEmbedWithVisiblePrimaryNavbar; + /** + * fix for ts7.sep.cl + * will be removed for ts7.oct.cl + * @param event + * @param eventType + * @hidden + */ + private formatEventData; + private subscribedListeners; + /** + * Subscribe to network events (online/offline) that should + * work regardless of auth status + */ + private subscribeToNetworkEvents; + /** + * Subscribe to message events that depend on successful iframe setup + */ + private subscribeToMessageEvents; + /** + * Adds event listeners for both network and message events. + * This maintains backward compatibility with the existing method. + * Adds a global event listener to window for "message" events. + * ThoughtSpot detects if a particular event is targeted to this + * embed instance through an identifier contained in the payload, + * and executes the registered callbacks accordingly. + */ + private subscribeToEvents; + private unsubscribeToNetworkEvents; + private unsubscribeToMessageEvents; + private unsubscribeToEvents; + protected getAuthTokenForCookielessInit(): Promise; + protected getDefaultAppInitData(): Promise; + protected getAppInitData(): Promise; + /** + * Send Custom style as part of payload of APP_INIT + * @param _ + * @param responder + */ + private appInitCb; + /** + * Sends updated auth token to the iFrame to avoid user logout + * @param _ + * @param responder + */ + private updateAuthToken; + /** + * Auto Login and send updated authToken to the iFrame to avoid user session logout + * @param _ + * @param responder + */ + private idleSessionTimeout; + /** + * Register APP_INIT event and sendback init payload + */ + private registerAppInit; + /** + * Constructs the base URL string to load the ThoughtSpot app. + * @param query + */ + protected getEmbedBasePath(query: string): string; + protected getUpdateEmbedParamsObject(): Record; + /** + * Common query params set for all the embed modes. + * @param queryParams + * @returns queryParams + */ + protected getBaseQueryParams(queryParams?: Record): Record; + /** + * Constructs the base URL string to load v1 of the ThoughtSpot app. + * This is used for embedding Liveboards, visualizations, and full application. + * @param queryString The query string to append to the URL. + * @param isAppEmbed A Boolean parameter to specify if you are embedding + * the full application. + */ + protected getV1EmbedBasePath(queryString: string): string; + protected getEmbedParams(): string; + protected getEmbedParamsObject(): Record; + protected getRootIframeSrc(): string; + protected createIframeEl(frameSrc: string): HTMLIFrameElement; + protected handleInsertionIntoDOM(child: string | Node): void; + /** + * Renders the embedded ThoughtSpot app in an iframe and sets up + * event listeners. + * @param url - The URL of the embedded ThoughtSpot app. + */ + protected renderIFrame(url: string): Promise; + protected createPreRenderWrapper(): HTMLDivElement; + protected preRenderWrapper: HTMLElement; + protected preRenderChild: HTMLElement; + protected connectPreRendered(): boolean; + protected isPreRenderAvailable(): boolean; + protected createPreRenderChild(child: string | Node): HTMLElement; + protected insertIntoDOMForPreRender(child: string | Node): void; + private showPreRenderByDefault; + protected insertIntoDOM(child: string | Node): void; + /** + * Sets the height of the iframe + * @param height The height in pixels + */ + protected setIFrameHeight(height: number | string): void; + /** + * Executes all registered event handlers for a particular event type + * @param eventType The event type + * @param data The payload invoked with the event handler + * @param eventPort The event Port for a specific MessageChannel + */ + protected executeCallbacks(eventType: EmbedEvent, data: any, eventPort?: MessagePort | void): void; + /** + * Returns the ThoughtSpot hostname or IP address. + */ + protected getThoughtSpotHost(): string; + /** + * Gets the v1 event type (if applicable) for the EmbedEvent type + * @param eventType The v2 event type + * @returns The corresponding v1 event type if one exists + * or else the v2 event type itself + */ + protected getCompatibleEventType(eventType: EmbedEvent): EmbedEvent; + /** + * Calculates the iframe center for the current visible viewPort + * of iframe using Scroll position of Host App, offsetTop for iframe + * in Host app. ViewPort height of the tab. + * @returns iframe Center in visible viewport, + * Iframe height, + * View port height. + */ + protected getIframeCenter(): { + iframeCenter: number; + iframeScrolled: number; + iframeHeight: number; + viewPortHeight: number; + iframeVisibleViewPort: number; + }; + /** + * Registers an event listener to trigger an alert when the ThoughtSpot app + * sends an event of a particular message type to the host application. + * @param messageType The message type + * @param callback A callback as a function + * @param options The message options + * @param isSelf + * @param isRegisteredBySDK + * @example + * ```js + * tsEmbed.on(EmbedEvent.Error, (data) => { + * console.error(data); + * }); + * ``` + * @example + * ```js + * tsEmbed.on(EmbedEvent.Save, (data) => { + * console.log("Answer save clicked", data); + * }, { + * start: true // This will trigger the callback on start of save + * }); + * ``` + */ + on(messageType: EmbedEvent, callback: MessageCallback, options?: MessageOptions, isRegisteredBySDK?: boolean): typeof TsEmbed.prototype; + /** + * Removes an event listener for a particular event type. + * @param messageType The message type + * @param callback The callback to remove + * @example + * ```js + * const errorHandler = (data) => { console.error(data); }; + * tsEmbed.on(EmbedEvent.Error, errorHandler); + * tsEmbed.off(EmbedEvent.Error, errorHandler); + * ``` + */ + off(messageType: EmbedEvent, callback: MessageCallback): typeof TsEmbed.prototype; + /** + * Triggers an event on specific Port registered against + * for the EmbedEvent + * @param eventType The message type + * @param data The payload to send + * @param eventPort + * @param payload + */ + private triggerEventOnPort; + /** + * @hidden + * Internal state to track if the embed container is loaded. + * This is used to trigger events after the embed container is loaded. + */ + isEmbedContainerLoaded: boolean; + /** + * @hidden + * Internal state to track the callbacks to be executed after the embed container + * is loaded. + * This is used to trigger events after the embed container is loaded. + */ + private embedContainerReadyCallbacks; + protected getPreRenderObj(): T; + private checkEmbedContainerLoaded; + private executeEmbedContainerReadyCallbacks; + /** + * Executes a callback after the embed container is loaded. + * @param callback The callback to execute + */ + protected executeAfterEmbedContainerLoaded(callback: () => void): void; + protected createEmbedContainerHandler: (source: EmbedEvent.AuthInit | EmbedEvent.EmbedListenerReady) => () => void; + /** + * Triggers an event to the embedded app + * @param {HostEvent} messageType The event type + * @param {any} data The payload to send with the message + * @returns A promise that resolves with the response from the embedded app + */ + trigger(messageType: HostEventT, data?: TriggerPayload, context?: ContextT): Promise>; + /** + * Triggers an event to the embedded app, skipping the UI flow. + * @param {UIPassthroughEvent} apiName - The name of the API to be triggered. + * @param {UIPassthroughRequest} parameters - The parameters to be passed to the API. + * @returns {Promise} - A promise that resolves with the response + * from the embedded app. + */ + triggerUIPassThrough(apiName: UIPassthroughEventT, parameters: UIPassthroughRequest): Promise>; + /** + * Marks the ThoughtSpot object to have been rendered + * Needs to be overridden by subclasses to do the actual + * rendering of the iframe. + * @param args + */ + render(): Promise; + getIframeSrc(): string; + protected handleRenderForPrerender(): Promise; + getCurrentContext(): Promise; + /** + * Creates the preRender shell + * @param showPreRenderByDefault - Show the preRender after render, hidden by default + */ + preRender(showPreRenderByDefault?: boolean, replaceExistingPreRender?: boolean): Promise; + /** + * Get the Post Url Params for THOUGHTSPOT from the current + * host app URL. + * THOUGHTSPOT URL params starts with a prefix "ts-" + * @version SDK: 1.14.0 | ThoughtSpot: 8.4.0.cl, 8.4.1-sw + */ + getThoughtSpotPostUrlParams(additionalParams?: { + [key: string]: string | number; + }): string; + /** + * Destroys the ThoughtSpot embed, and remove any nodes from the DOM. + * @version SDK: 1.19.1 | ThoughtSpot: * + */ + destroy(): void; + getUnderlyingFrameElement(): HTMLIFrameElement; + /** + * Prerenders a generic instance of the TS component. + * This means without the path but with the flags already applied. + * This is useful for prerendering the component in the background. + * @version SDK: 1.22.0 + * @returns + */ + prerenderGeneric(): Promise; + protected beforePrerenderVisible(): void; + private validatePreRenderViewConfig; + /** + * Displays the PreRender component. + * If the component is not preRendered, it attempts to create and render it. + * Also, synchronizes the style of the PreRender component with the embedding + * element. + */ + showPreRender(): Promise; + /** + * Synchronizes the style properties of the PreRender component with the embedding + * element. This function adjusts the position, width, and height of the PreRender + * component + * to match the dimensions and position of the embedding element. + * @throws {Error} Throws an error if the embedding element (passed as domSelector) + * is not defined or not found. + */ + syncPreRenderStyle(): void; + /** + * Hides the PreRender component if it is available. + * If the component is not preRendered, it issues a warning. + */ + hidePreRender(): void; + /** + * Retrieves unique HTML element IDs for PreRender-related elements. + * These IDs are constructed based on the provided 'preRenderId' from 'viewConfig'. + * @returns {object} An object containing the IDs for the PreRender elements. + * @property {string} wrapper - The HTML element ID for the PreRender wrapper. + * @property {string} child - The HTML element ID for the PreRender child. + */ + getPreRenderIds(): { + wrapper: string; + child: string; + }; + /** + * Returns the answerService which can be used to make arbitrary graphql calls on top + * session. + * @param vizId [Optional] to get for a specific viz in case of a Liveboard. + * @version SDK: 1.25.0 / ThoughtSpot 9.10.0 + */ + getAnswerService(vizId?: string): Promise; + /** + * Set up fullscreen change detection to automatically trigger ExitPresentMode + * when user exits fullscreen mode + */ + private setupFullscreenChangeHandler; + /** + * Remove fullscreen change handler + */ + private removeFullscreenChangeHandler; +} +declare class V1Embed extends TsEmbed { + protected viewConfig: AllEmbedViewConfig; + constructor(domSelector: DOMSelector, viewConfig: AllEmbedViewConfig); + /** + * Render the app in an iframe and set up event handlers + * @param iframeSrc + */ + protected renderV1Embed(iframeSrc: string): Promise; + protected getRootIframeSrc(): string; + /** + * @inheritdoc + * @example + * ```js + * tsEmbed.on(EmbedEvent.Error, (data) => { + * console.error(data); + * }); + * ``` + * @example + * ```js + * tsEmbed.on(EmbedEvent.Save, (data) => { + * console.log("Answer save clicked", data); + * }, { + * start: true // This will trigger the callback on start of save + * }); + * ``` + */ + on(messageType: EmbedEvent, callback: MessageCallback, options?: MessageOptions): typeof TsEmbed.prototype; + /** + * Only for testing purposes. + * @hidden + */ + test__executeCallbacks: (eventType: EmbedEvent, data: any, eventPort?: void | MessagePort) => void; +} +/** + * Pages within the ThoughtSpot app that can be embedded. + */ +export declare enum Page { + /** + * Home page + */ + Home = "home", + /** + * Search page + */ + Search = "search", + /** + * Saved answers listing page + */ + Answers = "answers", + /** + * Liveboards listing page + */ + Liveboards = "liveboards", + /** + * @hidden + */ + Pinboards = "pinboards", + /** + * Data management page + */ + Data = "data", + /** + * SpotIQ listing page + */ + SpotIQ = "insights", + /** + * Monitor Alerts Page + */ + Monitor = "monitor" +} +/** + * Define the initial state os column custom group accordions + * in data panel v2. + */ +export declare enum DataPanelCustomColumnGroupsAccordionState { + /** + * Expand all the accordion initially in data panel v2. + */ + EXPAND_ALL = "EXPAND_ALL", + /** + * Collapse all the accordions initially in data panel v2. + */ + COLLAPSE_ALL = "COLLAPSE_ALL", + /** + * Expand the first accordion and collapse the rest. + */ + EXPAND_FIRST = "EXPAND_FIRST" +} +export declare enum HomePageSearchBarMode { + OBJECT_SEARCH = "objectSearch", + AI_ANSWER = "aiAnswer", + NONE = "none" +} +/** + * Define the version of the primary navbar + * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl + */ +export declare enum PrimaryNavbarVersion { + /** + * Sliding (v3) introduces a new left-side navigation hub featuring a tab switcher, + * along with updates to the top navigation bar. + * It serves as the foundational version of the PrimaryNavBar. + */ + Sliding = "v3" +} +/** + * Define the version of the home page + * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl + */ +export declare enum HomePage { + /** + * Modular (v2) introduces the updated Modular Home Experience. + * It serves as the foundational version of the home page. + */ + Modular = "v2", + /** + * ModularWithStylingChanges (v3) introduces Modular Home Experience + * with styling changes. + */ + ModularWithStylingChanges = "v3" +} +/** + * Define the version of the list page + * @version SDK: 1.40.0 | ThoughtSpot: 10.12.0.cl + */ +export declare enum ListPage { + /** + * List (v2) is the traditional List Experience. + * It serves as the foundational version of the list page. + */ + List = "v2", + /** + * ListWithUXChanges (v3) introduces the new updated list page with UX changes. + */ + ListWithUXChanges = "v3" +} +/** + * Define the discovery experience + * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl + */ +export interface DiscoveryExperience { + /** + * primaryNavbarVersion determines the version of the navigation version. + */ + primaryNavbarVersion?: PrimaryNavbarVersion; + /** + * homePage determines the version of the home page. + */ + homePage?: HomePage; + /** + * listPageVersion determines the version of the list page. + */ + listPageVersion?: ListPage; +} +/** + * The view configuration for full app embedding. + * @group Embed components + */ +export interface AppViewConfig extends AllEmbedViewConfig { + /** + * If true, the top navigation bar within the ThoughtSpot app + * is displayed. By default, the navigation bar is hidden. + * This flag also controls the homepage left navigation bar. + * + * Supported embed types: `AppEmbed` + * @default true + * @version SDK: 1.2.0 | ThoughtSpot: 8.4.0.cl + * @example + * ```js + * const embed = new AppEmbed('#tsEmbed', { + * ... // other embed view config + * showPrimaryNavbar:true, + * }) + * ``` + */ + showPrimaryNavbar?: boolean; + /** + * Control the visibility of the left navigation bar on the Homepage. + * If showPrimaryNavbar is true, that is, if the Global and Homepage + * nav-bars are visible, this flag will only hide the homepage left nav-bar. + * The showPrimaryNavbar flag takes precedence over the hideHomepageLeftNav. + * + * **Note**: This option does not apply to the classic homepage. + * To access the updated modular homepage, set + * `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl). + * + * Supported embed types: `AppEmbed` + * @default false + * @version SDK: 1.28.0 | ThoughtSpot: 9.12.5.cl + * @example + * ```js + * const embed = new AppEmbed('#tsEmbed', { + * ... // other embed view config + * hideHomepageLeftNav : true, + * }) + * ``` + */ + hideHomepageLeftNav?: boolean; + /** + * Control the visibility of the help (?) and profile buttons on the + * Global nav-bar. By default, these buttons are visible on the nav-bar. + * + * Supported embed types: `AppEmbed` + * @default false + * @version SDK: 1.2.0 | ThoughtSpot: 8.4.0.cl + * @example + * ```js + * const embed = new AppEmbed('#tsEmbed', { + * ... // other embed view config + * disableProfileAndHelp: true, + * }) + * ``` + */ + disableProfileAndHelp?: boolean; + /** + * @version SDK: 1.36.3 | ThoughtSpot: 10.1.0.cl + * @default true + * Whether the help menu in the top nav bar should be served + * from Pendo or ThoughtSpot's internal help items. + * + * Supported embed types: `AppEmbed` + * @example + * ```js + * const embed = new AppEmbed('#tsEmbed', { + * ... // other embed view config + * enablePendoHelp: false, + * }); + * ``` + */ + enablePendoHelp?: boolean; + /** + * Control the visibility of the hamburger icon on the top nav bar + * available when new navigation V3 is enabled. + * + * Supported embed types: `AppEmbed` + * @default false + * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl + * @example + * ```js + * const embed = new AppEmbed('#tsEmbed', { + * ... // other embed view config + * hideHamburger : true, + * }) + * ``` + */ + hideHamburger?: boolean; + /** + * Control the visibility of the Eureka search on the top nav bar + * this will control for both new V2 and new navigation V3. + * + * Supported embed types: `AppEmbed` + * @default true + * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl + * @example + * ```js + * const embed = new AppEmbed('#tsEmbed', { + * ... // other embed view config + * hideObjectSearch: false, + * }) + * ``` + */ + hideObjectSearch?: boolean; + /** + * Control the visibility of the notification on the top nav bar V3, + * available when new navigation V3 is enabled. + * + * Supported embed types: `AppEmbed` + * @default true + * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl + * @example + * ```js + * const embed = new AppEmbed('#tsEmbed', { + * ... // other embed view config + * hideNotification: false, + * }) + * ``` + */ + hideNotification?: boolean; + /** + * Control the visibility of the application switcher button on the nav-bar. + * By default, the application switcher is shown. + * + * **Note**: This option does not apply to the classic homepage. + * To access the updated modular homepage, set + * `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl). + * + * Supported embed types: `AppEmbed` + * @version SDK: 1.28.0 | ThoughtSpot: 9.12.5.cl + * @default false + * @example + * ```js + * const embed = new AppEmbed('#tsEmbed', { + * ... // other embed view config + * hideApplicationSwitcher : true, + * }) + * ``` + */ + hideApplicationSwitcher?: boolean; + /** + * Control the visibility of the Org switcher button on the nav-bar. + * By default, the Org switcher button is shown. + * + * **Note**: This option does not apply to the classic homepage. + * To access the updated modular homepage, set + * `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl). + * + * Supported embed types: `AppEmbed` + * @version SDK: 1.28.0 | ThoughtSpot: 9.12.5.cl + * @default true + * @example + * ```js + * const embed = new AppEmbed('#tsEmbed', { + * ... // other embed view config + * hideOrgSwitcher : true, + * }) + * ``` + */ + hideOrgSwitcher?: boolean; + /** + * A URL path to the embedded application page + * If both path and pageId attributes are defined, the path definition + * takes precedence. This is the path post the `#/` in the URL of the standalone + * ThoughtSpot app. Use this to open the embedded view to a specific path. + * + * For eg, if you want the component to open to a specific Liveboard + * you could set the path to `pinboard//tab/`. + * + * Supported embed types: `AppEmbed` + * @version SDK: 1.1.0 | ThoughtSpot: 9.4.0.cl + * @example + * ```js + * const embed = new AppEmbed('#tsEmbed', { + * ... // other embed view config + * path:"pinboard/1234/tab/7464", + * }) + * ``` + */ + path?: string; + /** + * The application page to set as the start page + * in the embedded view. + * + * Use this to open to particular page in the app. To open to a specific + * path within the app, use the `path` attribute which is more flexible. + * + * Supported embed types: `AppEmbed` + * @version SDK: 1.1.0 | ThoughtSpot: 9.4.0.cl + * @example + * ```js + * const embed = new AppEmbed('#tsEmbed', { + * ... // other embed view config + * pageId : Page.Answers | Page.Data, + * }) + * ``` + */ + pageId?: Page; + /** + * This puts a filter tag on the application. All metadata lists in the + * application, such as Liveboards and answers, would be filtered by this + * tag. + * + * Supported embed types: `AppEmbed` + * @version SDK: 1.1.0 | ThoughtSpot: 9.4.0.cl + * @example + * ```js + * const embed = new AppEmbed('#tsEmbed', { + * ... // other embed view config + * tag:'value', + * }) + * ``` + */ + tag?: string; + /** + * Hide tag filter chips that appear when content is filtered by tags. + * When enabled, this automatically: + * - Hides tag filter indicators/chips from the UI + * + * This provides a clean interface without tag-related UI elements. + * + * Supported embed types: `AppEmbed` + * @version SDK: 1.44.0 | ThoughtSpot: 10.15.0.cl + * @example + * ```js + * // Simple usage - automatically hides all tag-related UI + * const embed = new AppEmbed('#tsEmbed', { + * ... // other embed view config + * tag: 'Some Tag', + * hideTagFilterChips: true, // This is all you need! + * }); + * ``` + */ + hideTagFilterChips?: boolean; + /** + * The array of GUIDs to be hidden + * + * Supported embed types: `AppEmbed` + * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw + * @example + * ```js + * const embed = new AppEmbed('#tsEmbed', { + * ... // other embed view config + * hideObjects: [ + * '430496d6-6903-4601-937e-2c691821af3c', + * 'f547ec54-2a37-4516-a222-2b06719af726' + * ] + * }) + * ``` + */ + hideObjects?: string[]; + /** + * Render liveboards using the new v2 rendering mode + * This is a transient flag which is primarily meant for internal use + * + * Supported embed types: `AppEmbed` + * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw + * @hidden + */ + liveboardV2?: boolean; + /** + * If set to true, the Search Assist feature is enabled. + * + * Supported embed types: `AppEmbed` + * @default true + * @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl, 8.8.1-sw + * @example + * ```js + * const embed = new AppEmbed('#tsEmbed', { + * ... // other embed view config + * enableSearchAssist: true, + * }) + * ``` + */ + enableSearchAssist?: boolean; + /** + * If set to true, the Liveboard container dynamically resizes + * according to the height of the Liveboard. + * + * **Note**: Using fullHeight loads all visualizations + * on the Liveboard simultaneously, which results in + * multiple warehouse queries and potentially a + * longer wait for the topmost visualizations to + * display on the screen. Setting fullHeight to + * `false` fetches visualizations incrementally as + * users scroll the page to view the charts and tables. + * + * Supported embed types: `AppEmbed` + * @version SDK: 1.21.0 | ThoughtSpot: 9.4.0.cl, 9.4.0-sw + * @example + * ```js + * const embed = new AppEmbed('#tsEmbed', { + * ... // other embed view config + * fullHeight: true, + * }) + * ``` + */ + fullHeight?: boolean; + /** + * Flag to control new Modular Home experience. + * + * Supported embed types: `AppEmbed` + * @default false + * @version SDK: 1.28.0 | ThoughtSpot: 9.12.5.cl + * @example + * ```js + * const embed = new AppEmbed('#tsEmbed', { + * ... // other embed view config + * modularHomeExperience : true, + * }) + * ``` + */ + modularHomeExperience?: boolean; + /** + * To configure the top-left navigation and home page experience + * + * Supported embed types: `AppEmbed` + * @default false + * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl + * @example + * ```js + * const embed = new AppEmbed('#tsEmbed', { + * ... // other embed view config + * discoveryExperience : { + * primaryNavbarVersion: PrimaryNavbarVersion.Sliding, + * homePage: HomePage.Modular, + * }, + * }) + * ``` + */ + discoveryExperience?: DiscoveryExperience; + /** + * To set the initial state of the search bar in case of saved-answers. + * @version SDK: 1.32.0 | ThoughtSpot: 10.0.0.cl + * @default false + * @deprecated Use {@link collapseSearchBar} instead + */ + collapseSearchBarInitially?: boolean; + /** + * This controls the initial behaviour of custom column groups accordion. + * It takes DataPanelCustomColumnGroupsAccordionState enum values as input. + * List of different enum values:- + * - EXPAND_ALL: Expand all the accordion initially in data panel v2. + * - COLLAPSE_ALL: Collapse all the accordions initially in data panel v2. + * - EXPAND_FIRST: Expand the first accordion and collapse the rest. + * + * Supported embed types: `AppEmbed` + * @version SDK: 1.32.0 | ThoughtSpot: 10.0.0.cl + * @default DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL + * @example + * ```js + * const embed = new AppEmbed('#embed', { + * ... // other app view config + * dataPanelCustomGroupsAccordionInitialState: + * DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, + * }); + * ``` + */ + dataPanelCustomGroupsAccordionInitialState?: DataPanelCustomColumnGroupsAccordionState; + /** + * Flag that allows using `EmbedEvent.OnBeforeGetVizDataIntercept`. + * @version SDK : 1.29.0 | ThoughtSpot: 10.1.0.cl + */ + isOnBeforeGetVizDataInterceptEnabled?: boolean; + /** + * Flag to use home page search bar mode + * + * Supported embed types: `AppEmbed` + * @version SDK : 1.33.0 | ThoughtSpot: 10.3.0.cl + */ + homePageSearchBarMode?: HomePageSearchBarMode; + /** + * This flag is used to enable unified search experience for full app embed. + * + * Supported embed types: `AppEmbed` + * @version SDK: 1.34.0 | ThoughtSpot:10.5.0.cl + * @default true + * @example + * ```js + * const embed = new AppEmbed('#tsEmbed', { + * ... // other embed view config + * isUnifiedSearchExperienceEnabled: true, + * }) + * ``` + */ + isUnifiedSearchExperienceEnabled?: boolean; + /** + * This flag is used to enable/disable the styling and grouping in a Liveboard + * + * Supported embed types: `AppEmbed`, `LiveboardEmbed` + * @type {boolean} + * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl + * @example + * ```js + * // Replace with embed component name. For example, AppEmbed or LiveboardEmbed + * const embed = new ('#tsEmbed', { + * ... // other embed view config + * isLiveboardStylingAndGroupingEnabled: true, + * }) + * ``` + */ + isLiveboardStylingAndGroupingEnabled?: boolean; + /** + * This flag is used to enable/disable the png embedding of liveboard in scheduled mails + * + * Supported embed types: `AppEmbed`, `LiveboardEmbed` + * @type {boolean} + * @version SDK: 1.42.0 | ThoughtSpot: 10.14.0.cl + * @example + * ```js + * // Replace with embed component name. For example, AppEmbed or LiveboardEmbed + * const embed = new ('#tsEmbed', { + * ... // other embed view config + * isPNGInScheduledEmailsEnabled: true, + * }) + * ``` + */ + isPNGInScheduledEmailsEnabled?: boolean; + /** + * This flag is used to enable the full height lazy load data. + * + * @example + * ```js + * const embed = new AppEmbed('#embed-container', { + * // ...other options + * fullHeight: true, + * lazyLoadingForFullHeight: true, + * }) + * ``` + * + * @type {boolean} + * @default false + * @version SDK: 1.40.0 | ThoughtSpot:10.12.0.cl + */ + lazyLoadingForFullHeight?: boolean; + /** + * The margin to be used for lazy loading. + * + * For example, if the margin is set to '10px', + * the visualization will be loaded 10px before the its top edge is visible in the + * viewport. + * + * The format is similar to CSS margin. + * + * @example + * ```js + * const embed = new AppEmbed('#embed-container', { + * // ...other options + * fullHeight: true, + * lazyLoadingForFullHeight: true, + * // Using 0px, the visualization will be only loaded when its visible in the viewport. + * lazyLoadingMargin: '0px', + * }) + * ``` + * @type {string} + * @version SDK: 1.40.0 | ThoughtSpot:10.12.0.cl + */ + lazyLoadingMargin?: string; +} +/** + * Embeds full ThoughtSpot experience in a host application. + * @group Embed components + */ +export declare class AppEmbed extends V1Embed { + protected viewConfig: AppViewConfig; + private defaultHeight; + constructor(domSelector: DOMSelector, viewConfig: AppViewConfig); + /** + * Constructs a map of parameters to be passed on to the + * embedded Liveboard or visualization. + */ + protected getEmbedParams(): string; + private sendFullHeightLazyLoadData; + /** + * This is a handler for the RequestVisibleEmbedCoordinates event. + * It is used to send the visible coordinates data to the host application. + * @param data The event payload + * @param responder The responder function + */ + private requestVisibleEmbedCoordinatesHandler; + /** + * Constructs the URL of the ThoughtSpot app page to be rendered. + * @param pageId The ID of the page to be embedded. + */ + getIFrameSrc(): string; + /** + * Set the iframe height as per the computed height received + * from the ThoughtSpot app. + * @param data The event payload + */ + protected updateIFrameHeight: (data: MessagePayload) => void; + private embedIframeCenter; + private setIframeHeightForNonEmbedLiveboard; + /** + * Gets the ThoughtSpot route of the page for a particular page ID. + * @param pageId The identifier for a page in the ThoughtSpot app. + * @param modularHomeExperience + */ + private getPageRoute; + /** + * Formats the path provided by the user. + * @param path The URL path. + * @returns The URL path that the embedded app understands. + */ + private formatPath; + /** + * Navigate to particular page for app embed. eg:answers/pinboards/home + * This is used for embedding answers, pinboards, visualizations and full application + * only. + * @param path string | number The string, set to iframe src and navigate to new page + * eg: appEmbed.navigateToPage('pinboards') + * When used with `noReload` (default: true) this can also be a number + * like 1/-1 to go forward/back. + * @param noReload boolean Trigger the navigation without reloading the page + * @version SDK: 1.12.0 | ThoughtSpot: 8.4.0.cl, 8.4.1-sw + */ + navigateToPage(path: string | number, noReload?: boolean): void; + /** + * Destroys the ThoughtSpot embed, and remove any nodes from the DOM. + * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl + */ + destroy(): void; + private postRender; + private registerLazyLoadEvents; + private unregisterLazyLoadEvents; + /** + * Renders the embedded application pages in the ThoughtSpot app. + * @param renderOptions An object containing the page ID + * to be embedded. + */ + render(): Promise; +} +/** + * Enum for auth failure types. This is the parameter passed to the listner + * of {@link AuthStatus.FAILURE}. + * @group Authentication / Init + */ +export declare enum AuthFailureType { + SDK = "SDK", + NO_COOKIE_ACCESS = "NO_COOKIE_ACCESS", + EXPIRY = "EXPIRY", + OTHER = "OTHER", + IDLE_SESSION_TIMEOUT = "IDLE_SESSION_TIMEOUT", + UNAUTHENTICATED_FAILURE = "UNAUTHENTICATED_FAILURE" +} +/** + * Enum for auth status emitted by the emitter returned from {@link init}. + * @group Authentication / Init + */ +export declare enum AuthStatus { + /** + * Emits when the SDK fails to authenticate + */ + FAILURE = "FAILURE", + /** + * Emits when the SDK authenticates successfully + */ + SDK_SUCCESS = "SDK_SUCCESS", + /** + * @hidden + * Emits when iframe is loaded and session info is available + */ + SESSION_INFO_SUCCESS = "SESSION_INFO_SUCCESS", + /** + * Emits when the app sends an authentication success message + */ + SUCCESS = "SUCCESS", + /** + * Emits when a user logs out + */ + LOGOUT = "LOGOUT", + /** + * Emitted when inPopup is true in the SAMLRedirect flow and the + * popup is waiting to be triggered either programmatically + * or by the trigger button. + * @version SDK: 1.19.0 + */ + WAITING_FOR_POPUP = "WAITING_FOR_POPUP", + /** + * Emitted when the SAML popup is closed without authentication + */ + SAML_POPUP_CLOSED_NO_AUTH = "SAML_POPUP_CLOSED_NO_AUTH" +} +/** + * Event emitter returned from {@link init}. + * @group Authentication / Init + */ +export interface AuthEventEmitter { + /** + * Register a listener on Auth failure. + * @param event + * @param listener + */ + on(event: AuthStatus.FAILURE, listener: (failureType: AuthFailureType) => void): this; + /** + * Register a listener on Auth SDK success. + * @param event + * @param listener + */ + on(event: AuthStatus.SDK_SUCCESS | AuthStatus.LOGOUT | AuthStatus.WAITING_FOR_POPUP | AuthStatus.SAML_POPUP_CLOSED_NO_AUTH, listener: () => void): this; + on(event: AuthStatus.SUCCESS, listener: (sessionInfo: any) => void): this; + once(event: AuthStatus.FAILURE, listener: (failureType: AuthFailureType) => void): this; + once(event: AuthStatus.SDK_SUCCESS | AuthStatus.LOGOUT | AuthStatus.WAITING_FOR_POPUP | AuthStatus.SAML_POPUP_CLOSED_NO_AUTH, listener: () => void): this; + once(event: AuthStatus.SUCCESS, listener: (sessionInfo: any) => void): this; + /** + * Trigger an event on the emitter returned from init. + * @param {@link AuthEvent} + */ + emit(event: AuthEvent, ...args: any[]): boolean; + /** + * Remove listener from the emitter returned from init. + * @param event + * @param listener + * @param context + * @param once + */ + off(event: AuthStatus, listener: (...args: any[]) => void, context: any, once: boolean): this; + /** + * Remove all the event listeners + * @param event + */ + removeAllListeners(event: AuthStatus): this; +} +/** + * Events which can be triggered on the emitter returned from {@link init}. + * @group Authentication / Init + */ +export declare enum AuthEvent { + /** + * Manually trigger the SSO popup. This is useful when + * authStatus is SAMLRedirect/OIDCRedirect and inPopup is set to true + */ + TRIGGER_SSO_POPUP = "TRIGGER_SSO_POPUP" +} +export interface executeTMLInput { + metadata_tmls: string[]; + import_policy?: "PARTIAL" | "ALL_OR_NONE" | "VALIDATE_ONLY"; + create_new?: boolean; +} +export interface exportTMLInput { + metadata: { + identifier: string; + type?: "LIVEBOARD" | "ANSWER" | "LOGICAL_TABLE" | "CONNECTION"; + }[]; + export_associated?: boolean; + export_fqn?: boolean; + edoc_format?: "YAML" | "JSON"; +} +/** + * Prefetches static resources from the specified URL. Web browsers can then cache the + * prefetched resources and serve them from the user's local disk to provide faster access + * to your app. + * @param url The URL provided for prefetch + * @param prefetchFeatures Specify features which needs to be prefetched. + * @param additionalFlags This can be used to add any URL flag. + * @version SDK: 1.4.0 | ThoughtSpot: ts7.sep.cl, 7.2.1 + * @group Global methods + */ +export declare const prefetch: (url?: string, prefetchFeatures?: PrefetchFeatures[], additionalFlags?: { + [key: string]: string | number | boolean; +}) => void; +/** + * Initializes the Visual Embed SDK globally and perform + * authentication if applicable. This function needs to be called before any ThoughtSpot + * component like Liveboard etc can be embedded. But need not wait for AuthEvent.SUCCESS + * to actually embed. That is handled internally. + * @param embedConfig The configuration object containing ThoughtSpot host, + * authentication mechanism and so on. + * @example + * ```js + * const authStatus = init({ + * thoughtSpotHost: 'https://my.thoughtspot.cloud', + * authType: AuthType.None, + * }); + * authStatus.on(AuthStatus.FAILURE, (reason) => { // do something here }); + * ``` + * @returns {@link AuthEventEmitter} event emitter which emits events on authentication success, + * failure and logout. See {@link AuthStatus} + * @version SDK: 1.0.0 | ThoughtSpot ts7.april.cl, 7.2.1 + * @group Authentication / Init + */ +export declare const init: (embedConfig: EmbedConfig) => AuthEventEmitter; +/** + * Logs out from ThoughtSpot. This also sets the autoLogin flag to false, to + * prevent the SDK from automatically logging in again. + * + * You can call the `init` method again to re login, if autoLogin is set to + * true in this second call it will be honored. + * @param doNotDisableAutoLogin This flag when passed will not disable autoLogin + * @returns Promise which resolves when logout completes. + * @version SDK: 1.10.1 | ThoughtSpot: 8.2.0.cl, 8.4.1-sw + * @group Global methods + */ +export declare const logout: (doNotDisableAutoLogin?: boolean) => Promise; +/** + * Imports TML representation of the metadata objects into ThoughtSpot. + * @param data + * @returns imports TML data into ThoughtSpot + * @example + * ```js + * executeTML({ + * //Array of metadata Tmls in string format + * metadata_tmls: [ + * "'\''{\"guid\":\"9bd202f5-d431-44bf-9a07-b4f7be372125\", + * \"liveboard\":{\"name\":\"Parameters Liveboard\"}}'\''" + * ], + * import_policy: 'PARTIAL', // Specifies the import policy for the TML import. + * create_new: false, // If selected, creates TML objects with new GUIDs. + * }).then(result => { + * console.log(result); + * }).catch(error => { + * console.error(error); + * }); + *``` + * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl + * @group Global methods + */ +export declare const executeTML: (data: executeTMLInput) => Promise; +/** + * Exports TML representation of the metadata objects from ThoughtSpot in JSON or YAML + * format. + * @param data + * @returns exports TML data + * @example + * ```js + * exportTML({ + * metadata: [ + * { + * type: "LIVEBOARD", //Metadata Type + * identifier: "9bd202f5-d431-44bf-9a07-b4f7be372125" //Metadata Id + * } + * ], + * export_associated: false,//indicates whether to export associated metadata objects + * export_fqn: false, //Adds FQNs of the referenced objects.For example, if you are + * //exporting a Liveboard and its associated objects, the API + * //returns the Liveboard TML data with the FQNs of the referenced + * //worksheet. If the exported TML data includes FQNs, you don't need + * //to manually add FQNs of the referenced objects during TML import. + * edoc_format: "JSON" //It takes JSON or YAML value + * }).then(result => { + * console.log(result); + * }).catch(error => { + * console.error(error); + * }); + * ``` + * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl + * @group Global methods + */ +export declare const exportTML: (data: exportTMLInput) => Promise; +declare enum ContextType$1 { + Search = "search", + Liveboard = "liveboard", + Answer = "answer", + Spotter = "spotter", + Default = "default" +} +declare enum PageType { + PAGE = "page", + DIALOG = "dialog" +} +export interface ObjectIds { + answerId?: string; + liveboardId?: string; + vizIds?: string[]; + dataModelIds?: string[]; +} +export type PageContextOptions = { + page: ContextType$1; + pageType: PageType; + objectIds: ObjectIds; +}; +/** + * The configuration for the embedded Liveboard or visualization page view. + * @group Embed components + */ +export interface LiveboardViewConfig extends BaseViewConfig, SearchLiveboardCommonViewConfig, LiveboardAppEmbedViewConfig { + /** + * If set to true, the embedded object container dynamically resizes + * according to the height of the Liveboard. + * + * **Note**: Using fullHeight loads all visualizations on the + * Liveboard simultaneously, which results in multiple warehouse + * queries and potentially a longer wait for the topmost + * visualizations to display on the screen. + * Setting `fullHeight` to `false` fetches visualizations + * incrementally as users scroll the page to view the charts and tables. + * + * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 7.2.1 + * + * Supported embed types: `LiveboardEmbed` + * @example + * ```js + * const embed = new LiveboardEmbed('#embed', { + * ... // other liveboard view config + * fullHeight: true, + * }); + * ``` + */ + fullHeight?: boolean; + /** + * This is the minimum height(in pixels) for a full-height Liveboard. + * Setting this height helps resolve issues with empty Liveboards and + * other screens navigable from a Liveboard. + * + * Supported embed types: `LiveboardEmbed` + * @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1 + * @default 500 + * @example + * ```js + * const embed = new LiveboardEmbed('#embed', { + * ... // other liveboard view config + * fullHeight: true, + * defaultHeight: 600, + * }); + * ``` + */ + defaultHeight?: number; + /** + * @Deprecated If set to true, the context menu in visualizations will be enabled. + * @example + * ```js + * const embed = new LiveboardEmbed('#tsEmbed', { + * ... //other embed view config + * enableVizTransformations:true, + * }) + * ``` + * @version: SDK: 1.1.0 | ThoughtSpot: 8.1.0.sw + */ + enableVizTransformations?: boolean; + /** + * The Liveboard to display in the embedded view. + * Use either liveboardId or pinboardId to reference the Liveboard to embed. + * + * Supported embed types: `LiveboardEmbed` + * @version SDK: 1.3.0 | ThoughtSpot ts7.aug.cl, 7.2.1 + * @example + * ```js + * const embed = new LiveboardEmbed('#tsEmbed', { + * ... //other embed view config + * liveboardId:id of liveboard, + * }) + */ + liveboardId?: string; + /** + * To support backward compatibility + * @hidden + */ + pinboardId?: string; + /** + * The visualization within the Liveboard to display. + * + * Supported embed types: `LiveboardEmbed` + * @version SDK: 1.9.1 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw + * @example + * ```js + * const embed = new LiveboardEmbed('#tsEmbed', { + * ... //other embed view config + * vizId:'430496d6-6903-4601-937e-2c691821af3c', + * }) + * ``` + */ + vizId?: string; + /** + * If set to true, all filter chips from a + * Liveboard page will be read-only (no X buttons) + * + * Supported embed types: `LiveboardEmbed` + * @version SDK: 1.3.0 | ThoughtSpot ts7.aug.cl, 7.2.1.sw + * @example + * ```js + * const embed = new LiveboardEmbed('#tsEmbed', { + * ... //other embed view config + * preventLiveboardFilterRemoval:true, + * }) + * ``` + */ + preventLiveboardFilterRemoval?: boolean; + /** + * Array of visualization IDs which should be visible when the Liveboard + * renders. This can be changed by triggering the `SetVisibleVizs` + * event. + * + * Supported embed types: `LiveboardEmbed` + * @version SDK: 1.9.1 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw + * @example + * ```js + * const embed = new LiveboardEmbed('#tsEmbed', { + * ... //other embed view config + * visibleVizs: [ + * '430496d6-6903-4601-937e-2c691821af3c', + * 'f547ec54-2a37-4516-a222-2b06719af726' + * ] + * }) + */ + visibleVizs?: string[]; + /** + * To support backward compatibility + * @hidden + */ + preventPinboardFilterRemoval?: boolean; + /** + * Render embedded Liveboards and visualizations in the + * new Liveboard experience mode. + * + * Supported embed types: `LiveboardEmbed` + * @version SDK: 1.14.0 | ThoughtSpot: 8.6.0.cl, 8.8.1-sw + * @example + * ```js + * const embed = new LiveboardEmbed('#tsEmbed', { + * ... //other embed view config + * liveboardV2:true, + * }) + * ``` + */ + liveboardV2?: boolean; + /** + * Set a Liveboard tab as an active tab. + * Specify the tab ID. + * + * Supported embed types: `LiveboardEmbed` + * @example + * ```js + * const embed = new LiveboardEmbed('#tsEmbed', { + * ... //other embed view config + * activeTabId:'id-1234', + * }) + * ``` + * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw + */ + activeTabId?: string; + /** + * Show or hide the tab panel of the embedded Liveboard. + * + * Supported embed types: `LiveboardEmbed` + * @version SDK: 1.25.0 | ThoughtSpot: 9.6.0.cl, 9.8.0.sw + * @example + * ```js + * const embed = new LiveboardEmbed('#tsEmbed', { + * ... //other embed view config + * hideTabPanel:true, + * }) + * ``` + */ + hideTabPanel?: boolean; + /** + * Show a preview image of the visualization before the visualization loads. + * Only works for visualizations embeds with a viz id. + * + * Also, viz snashot should be enabled in the ThoughtSpot instance. + * Contact ThoughtSpot support to enable this feature. + * + * Since, this will show preview images, be careful that it may show + * undesired data to the user when using row level security. + * + * Supported embed types: `LiveboardEmbed` + * @example + * ```js + * const embed = new LiveboardEmbed('#tsEmbed', { + * liveboardId: 'liveboard-id', + * vizId: 'viz-id', + * showPreviewLoader: true, + * }); + * embed.render(); + * ``` + * @version SDK: 1.32.0 | ThoughtSpot: 10.0.0.cl + */ + showPreviewLoader?: boolean; + /** + * The Liveboard to run on regular intervals to fetch the cdw token. + * + * Supported embed types: `LiveboardEmbed` + * @hidden + * @version SDK: 1.35.0 | ThoughtSpot:10.6.0.cl + * @example + * ```js + * const embed = new LiveboardEmbed('#tsEmbed', { + * ... //other embed view config + * oAuthPollingInterval: value in milliseconds, + * }) + */ + oAuthPollingInterval?: number; + /** + * The Liveboard is set to force a token fetch during the initial load. + * + * Supported embed types: `LiveboardEmbed` + * @hidden + * @version SDK: 1.35.0 | ThoughtSpot:10.6.0.cl + * @example + * ```js + * const embed = new LiveboardEmbed('#tsEmbed', { + * ... //other embed view config + * isForceRedirect: false, + * }) + */ + isForceRedirect?: boolean; + /** + * The source connection ID for authentication. + * @hidden + * @version SDK: 1.35.0 | ThoughtSpot:10.6.0.cl + * + * Supported embed types: `LiveboardEmbed` + * @example + * ```js + * const embed = new LiveboardEmbed('#tsEmbed', { + * ... //other embed view config + * dataSourceId: '', + * }) + */ + dataSourceId?: string; + /** + * The list of tab IDs to hide from the embedded. + * This Tabs will be hidden from their respective LBs. + * Use this to hide an tabID. + * + * Supported embed types: `LiveboardEmbed` + * @example + * ```js + * const embed = new LiveboardEmbed('#tsEmbed', { + * ... // other embed view config + * hiddenTabs: [ + * '430496d6-6903-4601-937e-2c691821af3c', + * 'f547ec54-2a37-4516-a222-2b06719af726' + * ] + * }); + * ``` + * @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 10.1.0.sw + */ + hiddenTabs?: string[]; + /** + * The list of tab IDs to show in the embedded Liveboard. + * Only the tabs specified in the array will be shown in the Liveboard. + * + * Use either `visibleTabs` or `hiddenTabs`. + * + * Supported embed types: `LiveboardEmbed` + * @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 10.1.0.sw + * @example + * ```js + * const embed = new LiveboardEmbed('#tsEmbed', { + * ... // other embed view config + * visibleTabs: [ + * '430496d6-6903-4601-937e-2c691821af3c', + * 'f547ec54-2a37-4516-a222-2b06719af726' + * ] + * }) + * ``` + */ + visibleTabs?: string[]; + /** + * This flag is used to enable/disable the styling and grouping in a Liveboard + * + * Supported embed types: `LiveboardEmbed`, `AppEmbed` + * @type {boolean} + * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl + * @example + * ```js + * // Replace with embed component name. For example, AppEmbed or LiveboardEmbed + * const embed = new ('#tsEmbed', { + * ... // other embed view config + * isLiveboardStylingAndGroupingEnabled: true, + * }) + * ``` + */ + isLiveboardStylingAndGroupingEnabled?: boolean; + /** + * This flag is used to enable/disable the png embedding of liveboard in scheduled mails + * + * Supported embed types: `AppEmbed`, `LiveboardEmbed` + * @type {boolean} + * @version SDK: 1.42.0 | ThoughtSpot: 10.14.0.cl + * @example + * ```js + * // Replace with embed component name. For example, AppEmbed or LiveboardEmbed + * const embed = new ('#tsEmbed', { + * ... // other embed view config + * isPNGInScheduledEmailsEnabled: true, + * }) + * ``` + */ + isPNGInScheduledEmailsEnabled?: boolean; + /** + * This flag is used to enable the full height lazy load data. + * + * @example + * ```js + * const embed = new LiveboardEmbed('#embed-container', { + * // ...other options + * fullHeight: true, + * lazyLoadingForFullHeight: true, + * }) + * ``` + * + * @type {boolean} + * @default false + * @version SDK: 1.40.0 | ThoughtSpot:10.12.0.cl + */ + lazyLoadingForFullHeight?: boolean; + /** + * The margin to be used for lazy loading. + * + * For example, if the margin is set to '10px', + * the visualization will be loaded 10px before the its top edge is visible in the + * viewport. + * + * The format is similar to CSS margin. + * + * @example + * ```js + * const embed = new LiveboardEmbed('#embed-container', { + * // ...other options + * fullHeight: true, + * lazyLoadingForFullHeight: true, + * // Using 0px, the visualization will be only loaded when its visible in the viewport. + * lazyLoadingMargin: '0px', + * }) + * ``` + * @type {string} + * @version SDK: 1.40.0 | ThoughtSpot:10.12.0.cl + */ + lazyLoadingMargin?: string; + /** + * showSpotterLimitations : show limitation text + * of the spotter underneath the chat input. + * default is false. + * + * @example + * ```js + * const embed = new LiveboardEmbed('#embed-container', { + * // ...other options + * showSpotterLimitations: true, + * }) + * ``` + * @type {boolean} + * @version SDK: 1.41.1 | ThoughtSpot: 10.5.0.cl + */ + showSpotterLimitations?: boolean; +} +/** + * Embed a ThoughtSpot Liveboard or visualization. When rendered it already + * waits for the authentication to complete, so you need not wait for + * `AuthStatus.SUCCESS`. + * @example + * ```js + * import { .. } from '@thoughtspot/visual-embed-sdk'; + * init({ ... }); + * const embed = new LiveboardEmbed("#container", { + * liveboardId: , + * // .. other params here. + * }) + * ``` + * @group Embed components + */ +export declare class LiveboardEmbed extends V1Embed { + protected viewConfig: LiveboardViewConfig; + private defaultHeight; + constructor(domSelector: DOMSelector, viewConfig: LiveboardViewConfig); + /** + * Construct a map of params to be passed on to the + * embedded Liveboard or visualization. + */ + protected getEmbedParams(): string; + protected getEmbedParamsObject(): any; + private getIframeSuffixSrc; + private sendFullHeightLazyLoadData; + /** + * This is a handler for the RequestVisibleEmbedCoordinates event. + * It is used to send the visible coordinates data to the host application. + * @param data The event payload + * @param responder The responder function + */ + private requestVisibleEmbedCoordinatesHandler; + /** + * Construct the URL of the embedded ThoughtSpot Liveboard or visualization + * to be loaded within the iFrame. + */ + private getIFrameSrc; + /** + * Set the iframe height as per the computed height received + * from the ThoughtSpot app. + * @param data The event payload + */ + private updateIFrameHeight; + private embedIframeCenter; + private setIframeHeightForNonEmbedLiveboard; + private setActiveTab; + private showPreviewLoader; + /** + * @hidden + * Internal state to track the current liveboard id. + * This is used to navigate to the correct liveboard when the prerender is visible. + */ + currentLiveboardState: { + liveboardId: string; + vizId: string; + activeTabId: string; + }; + protected beforePrerenderVisible(): void; + protected handleRenderForPrerender(): Promise; + /** + * Triggers an event to the embedded app + * @param {HostEvent} messageType The event type + * @param {any} data The payload to send with the message + * @returns A promise that resolves with the response from the embedded app + */ + trigger(messageType: HostEventT, data?: TriggerPayload, context?: ContextT): Promise>; + /** + * Destroys the ThoughtSpot embed, and remove any nodes from the DOM. + * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl + */ + destroy(): void; + private postRender; + private registerLazyLoadEvents; + private unregisterLazyLoadEvents; + /** + * Render an embedded ThoughtSpot Liveboard or visualization + * @param renderOptions An object specifying the Liveboard ID, + * visualization ID and the runtime filters. + */ + render(): Promise; + navigateToLiveboard(liveboardId: string, vizId?: string, activeTabId?: string): void; + /** + * Returns the full url of the Liveboard/visualization which can be used to open + * this Liveboard inside the full ThoughtSpot application in a new tab. + * @returns url string + */ + getLiveboardUrl(): string; + getCurrentContext(): Promise; +} +/** + * @hidden + */ +export declare class PinboardEmbed extends LiveboardEmbed { +} +/** + * Configuration for search options. + * + */ +export interface SearchOptions { + /** + * Search tokens to pass in the query. + */ + searchTokenString: string; + /** + * Boolean to define if the search should be executed or not. + * If it is executed, the focus is placed on the results. + * If it’s not executed, the focus is placed at the end of + * the token string in the search bar. + */ + executeSearch?: boolean; +} +declare enum DataPanelCustomColumnGroupsAccordionState$1 { + /** + * Expand all the accordion initially in data panel v2. + */ + EXPAND_ALL = "EXPAND_ALL", + /** + * Collapse all the accordions initially in data panel v2. + */ + COLLAPSE_ALL = "COLLAPSE_ALL", + /** + * Expand the first accordion and collapse the rest. + */ + EXPAND_FIRST = "EXPAND_FIRST" +} +/** + * The configuration attributes for the embedded search view. + * @group Embed components + */ +export interface SearchViewConfig extends SearchLiveboardCommonViewConfig, Omit { + /** + * If set to true, the data sources panel is collapsed on load, + * but can be expanded manually. + * + * Supported embed types: `SearchEmbed` + * @version: SDK: 1.1.0 | ThoughtSpot: 8.1.0.sw + * @example + * ```js + * const embed = new SearchEmbed('#tsEmbed', { + * ... // other embed view config + * collapseDataSources:true, + * }) + * ``` + */ + collapseDataSources?: boolean; + /** + * If set to true, the data panel is collapsed on load, + * but can be expanded manually. + * + * Supported embed types: `SearchEmbed` + * @version: SDK: 1.34.0 | ThoughtSpot: 10.3.0.cl + * @example + * ```js + * const embed = new SearchEmbed('#tsEmbed', { + * ... // other embed view config + * collapseDataPanel:true, + * }) + * ``` + */ + collapseDataPanel?: boolean; + /** + * Show or hide the data sources panel. + * + * Supported embed types: `SearchEmbed` + * @version: SDK: 1.2.0 | ThoughtSpot: 9.1.0.sw + * @example + * ```js + * const embed = new SearchEmbed('#tsEmbed', { + * ... // other embed view config + * hideDataSources:true, + * }) + * ``` + */ + hideDataSources?: boolean; + /** + * Show or hide the charts and tables in search answers. + * This attribute can be used to create a custom visualization + * using raw answer data. + * + * Supported embed types: `SearchEmbed` + * @version: SDK: 1.2.0 | ThoughtSpot: 9.1.0.sw + * @example + * ```js + * const embed = new SearchEmbed('#tsEmbed', { + * ... // other embed view config + * hideResults:true, + * }) + * ``` + */ + hideResults?: boolean; + /** + * If set to true, the Search Assist feature is enabled. + * + * Supported embed types: `SearchEmbed` + * @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl, 8.8.1-sw + * @example + * ```js + * const embed = new SearchEmbed('#tsEmbed', { + * ... // other embed view config + * enableSearchAssist:true, + * }) + * ``` + */ + enableSearchAssist?: boolean; + /** + * If set to true, the tabular view is set as the default + * format for presenting search data. + * + * Supported embed types: `SearchEmbed` + * @version: SDK: 1.1.0 | ThoughtSpot: 8.1.0.sw + * @example + * ```js + * const embed = new SearchEmbed('#tsEmbed', { + * ... // other embed view config + * forceTable:true, + * }) + */ + forceTable?: boolean; + /** + * The array of data source GUIDs to set on load. + * Only a single data source is supported currently. + * @deprecated Use `dataSource` instead. + * + * Supported embed types: `SearchEmbed` + * @example + * ```js + * const embed = new SearchEmbed('#tsEmbed', { + * ... // other embed view config + * dataSources:['id-234','id-456'], + * }) + * ``` + */ + dataSources?: string[]; + /** + * The array of data source GUIDs to set on load. + * + * Supported embed types: `SearchEmbed` + * @version: SDK: 1.19.0 + * @example + * ```js + * const embed = new SearchEmbed('#tsEmbed', { + * ... // other embed view config + * dataSource:'id-234', + * }) + * ``` + */ + dataSource?: string; + /** + * The initial search query to load the answer with. + * @deprecated + * + * Use {@link searchOptions} instead. + */ + searchQuery?: string; + /** + * Configuration for search options. + * Includes the following properties: + * + * `searchTokenString`: Search tokens to pass in the query. + * + * `executeSearch`: Boolean to define if the search should be executed or not. + * If it is executed, the focus is placed on the results. + * If it’s not executed, the focus is placed at the end of + * the token string in the search bar. + * + * Supported embed types: `SearchEmbed` + * @example + * ```js + * searchOptions: { + * searchTokenString: '[quantity purchased] [region]', + * executeSearch: true, + * } + * ``` + */ + searchOptions?: SearchOptions; + /** + * Exclude the search token string from the URL. + * If set to true, the search token string is not appended to the URL. + * + * Supported embed types: `SearchEmbed` + * @version: SDK: 1.35.7 | ThoughtSpot: 10.8.0.cl + * @example + * ```js + * const embed = new SearchEmbed('#tsEmbed', { + * searchOptions: { + * searchTokenString: '[quantity purchased] [region]', + * executeSearch: true, + * }, + * excludeSearchTokenStringFromURL: true, + * }); + * ``` + */ + excludeSearchTokenStringFromURL?: boolean; + /** + * The GUID of a saved answer to load initially. + * + * Supported embed types: `SearchEmbed` + * @version: SDK: 1.1.0 | ThoughtSpot: 8.1.0.sw + * @example + * ```js + * const embed = new SearchEmbed('#tsEmbed', { + * ... // other embed view config + * answerId:'sed-1234', + * }) + * ``` + */ + answerId?: string; + /** + * If set to true, the search page will render without the Search Bar + * The chart/table should still be visible. + * + * Supported embed types: `SearchEmbed` + * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.0.sw + * @example + * ```js + * const embed = new SearchEmbed('#tsEmbed', { + * ... // other embed view config + * hideSearchBar:true, + * }) + * ``` + */ + hideSearchBar?: boolean; + /** + * Flag to set if last selected dataSource should be used + * + * Supported embed types: `SearchEmbed` + * @version: SDK: 1.24.0 + */ + useLastSelectedSources?: boolean; + /** + * To set the initial state of the search bar in case of saved-answers. + * @default false + * @version SDK: 1.32.0 | ThoughtSpot: 10.0.0.cl + * @deprecated Use {@link collapseSearchBar} instead + */ + collapseSearchBarInitially?: boolean; + /** + * Flag to enable onBeforeSearchExecute Embed Event + * + * Supported embed types: `SearchEmbed` + * @version: SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl + */ + isOnBeforeGetVizDataInterceptEnabled?: boolean; + /** + * This controls the initial behaviour of custom column groups accordion. + * It takes DataPanelCustomColumnGroupsAccordionState enum values as input. + * List of different enum values:- + * - EXPAND_ALL: Expand all the accordion initially in data panel v2. + * - COLLAPSE_ALL: Collapse all the accordions initially in data panel v2. + * - EXPAND_FIRST: Expand the first accordion and collapse the rest. + * + * Supported embed types: `SearchEmbed` + * @version SDK: 1.32.0 | ThoughtSpot: 10.0.0.cl + * @default DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL + * @example + * ```js + * const embed = new SearchEmbed('#tsEmbed', { + * ... // other embed view config + * dataPanelCustomGroupsAccordionInitialState: + * DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, + * }); + * ``` + */ + dataPanelCustomGroupsAccordionInitialState?: DataPanelCustomColumnGroupsAccordionState$1; + /** + * Flag to remove focus from search bar initially when user + * lands on search embed page. + * + * Supported embed types: `SearchEmbed` + * @version SDK: 1.32.0 | ThoughtSpot: 10.3.0.cl + * @default true + * @example + * ```js + * const embed = new SearchEmbed('#tsEmbed', { + * ... // other embed view config + * focusSearchBarOnRender: false, + * }); + * ``` + */ + focusSearchBarOnRender?: boolean; +} +export interface SearchAppInitData extends DefaultAppInitData { + searchOptions?: SearchOptions; +} +/** + * Embed ThoughtSpot search + * @group Embed components + */ +export declare class SearchEmbed extends TsEmbed { + /** + * The view configuration for the embedded ThoughtSpot search. + */ + protected viewConfig: SearchViewConfig; + constructor(domSelector: DOMSelector, viewConfig: SearchViewConfig); + /** + * Get the state of the data sources panel that the embedded + * ThoughtSpot search will be initialized with. + */ + private getDataSourceMode; + protected getSearchInitData(): { + searchOptions?: { + searchTokenString: string; + }; + }; + protected getAppInitData(): Promise; + protected getEmbedParamsObject(): Record; + protected getEmbedParams(): string; + /** + * Construct the URL of the embedded ThoughtSpot search to be + * loaded in the iframe + * @param answerId The GUID of a saved answer + * @param dataSources A list of data source GUIDs + */ + getIFrameSrc(): string; + /** + * Render the embedded ThoughtSpot search + */ + render(): Promise; + getCurrentContext(): Promise; +} +/** + * @group Embed components + */ +export interface SearchBarViewConfig extends BaseViewConfig, SearchLiveboardCommonViewConfig { + /** + * The array of data source GUIDs to set on load. + * Only a single data source is supported currently. + * + * Supported embed types: `SearchBarEmbed` + * @deprecated Use `dataSource` instead + * @version: SDK: 1.1.0 | ThoughtSpot: 8.1.1-sw + * @example + * ```js + * const embed = new SearchBarEmbed('#tsEmbed', { + * ... //other embed view config + * dataSources:['id-2345','id-2345'], + * }) + * ``` + */ + dataSources?: string[]; + /** + * Pass the ID of the source to be selected. + * + * Supported embed types: `SearchBarEmbed` + * @version: SDK: 1.19.0, ThoughtSpot 9.0.0.cl, 9.0.1.sw + * @example + * ```js + * const embed = new SearchBarEmbed('#tsEmbed', { + * ... //other embed view config + * dataSource:'id-2345', + * }) + * ``` + */ + dataSource?: string; + /** + * Boolean to define if the last selected data source should be used + * + * Supported embed types: `SearchBarEmbed` + * @version: SDK: 1.24.0, ThoughtSpot 9.5.0.cl, 9.5.0.sw + * @example + * ```js + * const embed = new SearchBarEmbed('#tsEmbed', { + * ... //other embed view config + * useLastSelectedSources:false, + * }) + * ``` + */ + useLastSelectedSources?: boolean; + /** + * Configuration for search options. + * Includes the following properties: + * + * `searchTokenString`: Search tokens to pass in the query. + * + * `executeSearch`: Boolean to define if the search should be executed or not. + * If it is executed, the focus is placed on the results. + * If it’s not executed, the focus is placed at the end of + * the token string in the search bar. + * + * Supported embed types: `SearchBarEmbed` + * @version: SDK: 1.2.0 | ThoughtSpot: 9.4.0.sw + * @example + * ```js + * const embed = new SearchBarEmbed('#tsEmbed', { + * ... //other embed view config + * searchOptions: { + * searchTokenString: '[quantity purchased] [region]', + * executeSearch: true, + * } + * }) + * ``` + */ + searchOptions?: SearchOptions; + /** + * Exclude the search token string from the URL. + * If set to true, the search token string is not appended to the URL. + * + * Supported embed types: `SearchBarEmbed` + * @version: SDK: 1.35.7 | ThoughtSpot: 10.8.0.cl + * @example + * ```js + * const embed = new SearchEmbed('#tsEmbed', { + * searchOptions: { + * searchTokenString: '[quantity purchased] [region]', + * executeSearch: true, + * }, + * excludeSearchTokenStringFromURL: true, + * }); + * ``` + */ + excludeSearchTokenStringFromURL?: boolean; +} +interface SearchAppInitData$1 extends DefaultAppInitData { + searchOptions: SearchOptions; +} +/** + * Embed ThoughtSpot search bar + * @version: SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1-sw + * @group Embed components + */ +export declare class SearchBarEmbed extends TsEmbed { + /** + * The view configuration for the embedded ThoughtSpot search bar. + */ + protected viewConfig: SearchBarViewConfig; + protected embedComponentType: string; + constructor(domSelector: string, viewConfig: SearchBarViewConfig); + protected getEmbedParamsObject(): Record; + /** + * Construct the URL of the embedded ThoughtSpot search to be + * loaded in the iframe + * @param dataSources A list of data source GUIDs + */ + private getIFrameSrc; + /** + * Render the embedded ThoughtSpot search + */ + render(): Promise; + protected getSearchInitData(): { + searchOptions: SearchOptions; + }; + protected getAppInitData(): Promise; + getCurrentContext(): Promise; +} +/** + * Configuration for bodyless conversation options. + * @group Embed components + */ +export interface SpotterAgentEmbedViewConfig extends Omit { + /** + * The ID of the worksheet to use for the conversation. + */ + worksheetId: string; +} +/** + * Configuration for conversation options. + * @deprecated from SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl + * Use {@link SpotterAgentEmbedViewConfig} instead + * @group Embed components + */ +export interface BodylessConversationViewConfig extends SpotterAgentEmbedViewConfig { +} +export interface SpotterAgentMessageViewConfig extends SpotterAgentEmbedViewConfig { + sessionId: string; + genNo: number; + acSessionId: string; + acGenNo: number; + convId: string; + messageId: string; +} +declare class ConversationMessage extends TsEmbed { + protected viewConfig: SpotterAgentMessageViewConfig; + constructor(container: HTMLElement, viewConfig: SpotterAgentMessageViewConfig); + protected getEmbedParamsObject(): Record; + getIframeSrc(): string; + render(): Promise; +} +/** + * Create a conversation embed, which can be integrated inside + * chatbots or other conversational interfaces. + * @example + * ```js + * import { SpotterAgentEmbed } from '@thoughtspot/visual-embed-sdk'; + * + * const conversation = new SpotterAgentEmbed({ + * worksheetId: 'worksheetId', + * }); + * + * const { container, error } = await conversation.sendMessage('show me sales by region'); + * + * // append the container to the DOM + * document.body.appendChild(container); // or to any other element + * ``` + * @group Embed components + * @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl + */ +export declare class SpotterAgentEmbed { + private viewConfig; + private conversationService; + constructor(viewConfig: SpotterAgentEmbedViewConfig); + sendMessage(userMessage: string): Promise<{ + error: any; + container?: undefined; + viz?: undefined; + } | { + container: HTMLDivElement; + viz: ConversationMessage; + error?: undefined; + }>; + /** + * Send a message to the conversation service and return only the data. + * @param userMessage - The message to send to the conversation service. + * @returns The data from the conversation service. + */ + sendMessageData(userMessage: string): Promise<{ + error: any; + data?: undefined; + } | { + data: { + convId: any; + messageId: any; + sessionId: any; + genNo: any; + acSessionId: any; + acGenNo: any; + }; + error?: undefined; + }>; +} +/** + * Create a conversation embed, which can be integrated inside + * chatbots or other conversational interfaces. + * @deprecated from SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl + * Use {@link SpotterAgentEmbed} instead + * @example + * ```js + * import { SpotterAgentEmbed } from '@thoughtspot/visual-embed-sdk'; + * + * const conversation = new SpotterAgentEmbed({ + * worksheetId: 'worksheetId', + * }); + * + * const { container, error } = await conversation.sendMessage('show me sales by region'); + * + * // append the container to the DOM + * document.body.appendChild(container); // or to any other element + * ``` + * @group Embed components + */ +export declare class BodylessConversation extends SpotterAgentEmbed { + constructor(viewConfig: BodylessConversationViewConfig); +} +interface SearchOptions$1 { + /** + * The query string to pass to start the Conversation. + */ + searchQuery: string; +} +/** + * The configuration for the embedded spotterEmbed options. + * @group Embed components + */ +export interface SpotterEmbedViewConfig extends Omit { + /** + * The ID of the data source object. For example, Model, View, or Table. Spotter uses + * this object to query data and generate Answers. + */ + worksheetId: string; + /** + * Ability to pass a starting search query to the conversation. + */ + searchOptions?: SearchOptions$1; + /** + * disableSourceSelection : Disables data source selection + * but still display the selected data source. + * + * Supported embed types: `SpotterEmbed` + * @example + * ```js + * const embed = new SpotterEmbed('#tsEmbed', { + * ... //other embed view config + * disableSourceSelection : true, + * }) + * ``` + * @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl + */ + disableSourceSelection?: boolean; + /** + * hideSourceSelection : Hide data source selection + * + * Supported embed types: `SpotterEmbed` + * @example + * ```js + * const embed = new SpotterEmbed('#tsEmbed', { + * ... //other embed view config + * hideSourceSelection : true, + * }) + * ``` + * @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl + */ + hideSourceSelection?: boolean; + /** + * Flag to control Data panel experience + * + * Supported embed types: `SageEmbed`, `AppEmbed`, `SearchBarEmbed`, `LiveboardEmbed`, `SearchEmbed` + * @default true + * @version SDK: 1.43.0 | ThoughtSpot Cloud: 10.14.0.cl + * @example + * ```js + * // Replace with embed component name. For example, SageEmbed, AppEmbed, or SearchBarEmbed + * const embed = new ('#tsEmbed', { + * ... // other embed view config + * dataPanelV2: true, + * }) + * ``` + */ + dataPanelV2?: boolean; + /** + * showSpotterLimitations : show limitation text + * of the spotter underneath the chat input. + * default is false. + * + * Supported embed types: `SpotterEmbed` + * @example + * ```js + * const embed = new SpotterEmbed('#tsEmbed', { + * ... //other embed view config + * showSpotterLimitations : true, + * }) + * ``` + * @version SDK: 1.36.0 | ThoughtSpot: 10.5.0.cl + */ + showSpotterLimitations?: boolean; + /** + * hideSampleQuestions : Hide sample questions on + * the initial screen of the conversation. + * + * Supported embed types: `SpotterEmbed` + * @example + * ```js + * const embed = new SpotterEmbed('#tsEmbed', { + * ... //other embed view config + * hideSampleQuestions : true, + * }) + * ``` + * @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl + */ + hideSampleQuestions?: boolean; + /** + * The list of runtime filters to apply to a search Answer, + * visualization, or Liveboard. + * + * Supported embed types: `SpotterEmbed` + * @example + * ```js + * const embed = new SpotterEmbed('#tsEmbed', { + * // other embed view config + * runtimeFilters: [ + * { + * columnName: 'color', + * operator: RuntimeFilterOp.EQ, + * values: ['red'], + * }, + * ], + * }) + * ``` + * @version SDK: 1.41.0 | ThoughtSpot: 10.13.0.cl + */ + runtimeFilters?: RuntimeFilter[]; + /** + * Flag to control whether runtime filters should be included in the URL. + * If true, filters will be passed via app initialization payload instead. + * If false/undefined, filters will be added to URL (default behavior). + * + * Supported embed types: `SpotterEmbed` + * @default false + * @version SDK: 1.41.0 | ThoughtSpot: 10.13.0.cl + */ + excludeRuntimeFiltersfromURL?: boolean; + /** + * The list of runtime parameters to apply to the conversation. + * + * Supported embed types: `SpotterEmbed` + * @example + * ```js + * const embed = new SpotterEmbed('#tsEmbed', { + * // other embed view config + * runtimeParameters: [ + * { + * name: 'Integer Param', + * value: 10, + * }, + * ], + * }) + * ``` + * @version SDK: 1.41.0 | ThoughtSpot: 10.13.0.cl + */ + runtimeParameters?: RuntimeParameter[]; + /** + * Flag to control whether runtime parameters should be included in the URL. + * If true, parameters will be passed via app initialization payload instead. + * If false/undefined, parameters will be added to URL (default behavior). + * + * Supported embed types: `SpotterEmbed` + * @default false + * @version SDK: 1.41.0 | ThoughtSpot: 10.13.0.cl + */ + excludeRuntimeParametersfromURL?: boolean; +} +/** + * The configuration for the embedded spotterEmbed options. + * @deprecated from SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl + * Use {@link SpotterEmbedViewConfig} instead + * @group Embed components + */ +export interface ConversationViewConfig extends SpotterEmbedViewConfig { +} +/** + * Embed ThoughtSpot AI Conversation. + * @group Embed components + * @example + * ```js + * const conversation = new SpotterEmbed('#tsEmbed', { + * worksheetId: 'worksheetId', + * searchOptions: { + * searchQuery: 'searchQuery', + * }, + * }); + * conversation.render(); + * ``` + * @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl + */ +export declare class SpotterEmbed extends TsEmbed { + protected viewConfig: SpotterEmbedViewConfig; + constructor(container: HTMLElement, viewConfig: SpotterEmbedViewConfig); + protected getEmbedParamsObject(): Record; + getIframeSrc(): string; + render(): Promise; + getCurrentContext(): Promise; +} +/** + * Embed ThoughtSpot AI Conversation. + * @deprecated from SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl + * Use {@link SpotterEmbed} instead + * @group Embed components + * @example + * ```js + * const conversation = new SpotterEmbed('#tsEmbed', { + * worksheetId: 'worksheetId', + * searchOptions: { + * searchQuery: 'searchQuery', + * }, + * }); + * conversation.render(); + * ``` + * @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl + */ +export declare class ConversationEmbed extends SpotterEmbed { + protected viewConfig: ConversationViewConfig; + constructor(container: HTMLElement, viewConfig: ConversationViewConfig); +} +export type SessionInfo = { + releaseVersion: string; + userGUID: string; + currentOrgId: number; + privileges: string[]; + mixpanelToken: string; + isPublicUser: boolean; + clusterId: string; + clusterName: string; + [key: string]: any; +}; +/** + * Returns the cached session info object and caches it for future use. + * Once fetched the session info object is cached and returned from the cache on + * subsequent calls. + * This cache is cleared when inti is called OR resetCachedSessionInfo is called. + * @example ```js + * const sessionInfo = await getSessionInfo(); + * console.log(sessionInfo); + * ``` + * @version SDK: 1.28.3 | ThoughtSpot: * + * @returns {Promise} The session info object. + */ +export declare function getSessionInfo(): Promise; +interface SearchOptions$2 { + /** + * The query string to pass for Natural Language Search. + */ + searchQuery: string; + /** + * Boolean to define if the search should be executed or not. + * If it is executed, the focus is placed on the results. + * If it’s not executed, the focus is placed at the end of + * the token string in the search bar. + */ + executeSearch?: boolean; +} +/** + * The configuration attributes for the embedded Natural language search view. Based on + * GPT and LLM. + * @version: SDK: 1.23.0 | ThoughtSpot: 9.8.0.cl, 9.8.0.sw + * + * Note: This embed will be deprecated from SDK: 1.40.0 | ThoughtSpot: 10.13.0.cl + * @group Embed components + */ +export interface SageViewConfig extends SearchLiveboardCommonViewConfig, Omit { + /** + * If set to true, a list of Liveboard and Answers related + * to the natural language search will be shown below the + * AI generated answer. + * @deprecated Currently Liveboard and Answers related + * to the natural language search will not be shown for sage + * embed + */ + showObjectResults?: boolean; + /** + * flag used by the TS product tour page to show the blue search bar + * even after the search is completed. This is different from ThoughtSpot Embedded + * Sage Embed experience where it mimics closer to the non-embed case. + * The Sample questions container is collapsed when this value is set after + * does a search. + * @version SDK: 1.26.0 | ThoughtSpot: 9.8.0.cl + * @hidden + */ + isProductTour?: boolean; + /** + * Show or hide the search bar title. + * @version SDK: 1.29.0 | ThoughtSpot: 9.8.0.cl, 9.8.0.sw + * @deprecated ThoughtSpot: 9.10.0.cl | search bar doesn't have the title from 9.10.0.cl + */ + hideSearchBarTitle?: boolean; + /** + * Show or hide the Answer header, that is, the `AI Answer` title + * at the top of the Answer page. + * @version SDK: 1.26.0 | ThoughtSpot: 9.10.0.cl + */ + hideSageAnswerHeader?: boolean; + /** + * Disable the worksheet selection option. + * @version SDK: 1.26.0 | ThoughtSpot: 9.8.0.cl, 9.8.0.sw + */ + disableWorksheetChange?: boolean; + /** + * Hide the worksheet selection panel. + * @version SDK: 1.26.0 | ThoughtSpot: 9.8.0.cl, 9.8.0.sw + */ + hideWorksheetSelector?: boolean; + /** + * Show or hide autocomplete suggestions for the search query string. + * @version SDK: 1.26.0 | ThoughtSpot: 9.8.0.cl, 9.8.0.sw + */ + hideAutocompleteSuggestions?: boolean; + /** + * Show or hide autocomplete suggestions for the search query string. + * @deprecated + * Currently, the object suggestions will not be shown for Natural Language Search. + * You can use {@link hideAutocompleteSuggestions} instead. + */ + showObjectSuggestions?: boolean; + /** + * Show or hide sample questions. + * The sample questions are autogenerated based on the worksheet + * selected for the search operation. + * + * Supported embed types: `SageEmbed` + * @version SDK: 1.26.0 | ThoughtSpot: 9.8.0.cl, 9.8.0.sw + * @example + * ```js + * const embed = new SageEmbed('#tsEmbed', { + * ... //other embed view config + * hideSampleQuestions : true, + * }) + * ``` + */ + hideSampleQuestions?: boolean; + /** + * The data source GUID (Worksheet GUID) to set on load. + */ + dataSource?: string; + /** + * Includes the following properties: + * + * `searchQuery`: The search query string to pass in the search bar. + * Supports Natural Language Search queries. + * + * `executeSearch`: Boolean to define if the search should be executed or not. + * If it is executed, the focus is placed on the results. + * If it’s not executed, the focus is placed at the end of + * the token string in the search bar. + * + * Supported embed types: `SageEmbed` + * @example + * ```js + * searchOptions: { + * searchQuery: 'average sales by country and product type', + * executeSearch: true, + * } + * ``` + * @version SDK: 1.26.0 | ThoughtSpot: 9.8.0.cl, 9.8.0.sw + */ + searchOptions?: SearchOptions$2; +} +/** + * Embed ThoughtSpot LLM and GPT-based Natural Language Search component. + * @version: SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl, 9.5.1-sw + * + * Note: This embed will be deprecated from SDK: 1.40.0 | ThoughtSpot: 10.13.0.cl + * @group Embed components + */ +export declare class SageEmbed extends V1Embed { + /** + * The view configuration for the embedded ThoughtSpot sage. + * + */ + protected viewConfig: SageViewConfig; + constructor(domSelector: DOMSelector, viewConfig: SageViewConfig); + protected getEmbedParamsObject(): Record; + /** + * Constructs a map of parameters to be passed on to the + * embedded Eureka or Sage search page. + * @returns {string} query string + */ + protected getEmbedParams(): string; + /** + * Construct the URL of the embedded ThoughtSpot sage to be + * loaded in the iframe + * @returns {string} iframe url + */ + getIFrameSrc(): string; + /** + * Render the embedded ThoughtSpot Sage + * @returns {SageEmbed} Eureka/Sage embed + */ + render(): Promise; + getCurrentContext(): Promise; +} +/** + * Gets the embed configuration settings that were used to + * initialize the SDK. + * @returns {@link EmbedConfig} + * + * @example + * ```js + * import { getInitConfig } from '@thoughtspot/visual-embed-sdk'; + * // Call the getInitConfig method to retrieve the embed configuration + * const config = getInitConfig(); + * // Log the configuration settings + * console.log(config); + * ``` + * Returns the link:https://developers.thoughtspot.com/docs/Interface_EmbedConfig[EmbedConfig] + * object, which contains the configuration settings used to + * initialize the SDK, including the following: + * + * - `thoughtSpotHost` - ThoughtSpot host URL + * - `authType`: The authentication method used. For example, + * `AuthServerCookieless` for `AuthType.TrustedAuthTokenCookieless` + * - `customizations` - Style, text, and icon customization settings + * that were applied during the SDK initialization. + * + * The following JSON output shows the embed configuration + * settings returned from the code in the previous example: + * + * @example + * ```json + * { + * "thoughtSpotHost": "https://{ThoughtSpot-Host}", + * "authType": "AuthServerCookieless", + * "customizations": { + * "style": { + * "customCSS": { + * "variables": { + * "--ts-var-button--secondary-background": "#7492d5", + * "--ts-var-button--secondary--hovers-background": "#aac2f8", + * "--ts-var-root-background": "#f1f4f8" + * } + * } + * } + * }, + * "loginFailedMessage": "Login failed, please try again", + * "authTriggerText": "Authorize", + * "disableTokenVerification": true, + * "authTriggerContainer": "#your-own-div" + * } + * ``` + * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw, and later + * @group Global methods + */ +declare const getEmbedConfig: () => EmbedConfig; +/** + * Enum of mixpanel events + * @hidden + */ +export declare const MIXPANEL_EVENT: { + VISUAL_SDK_RENDER_START: string; + VISUAL_SDK_CALLED_INIT: string; + VISUAL_SDK_RENDER_COMPLETE: string; + VISUAL_SDK_RENDER_FAILED: string; + VISUAL_SDK_TRIGGER: string; + VISUAL_SDK_ON: string; + VISUAL_SDK_IFRAME_LOAD_PERFORMANCE: string; + VISUAL_SDK_EMBED_CREATE: string; + VERCEL_INTEGRATION_COMPLETED: string; +}; +/** + * Pushes the event with its Property key-value map to mixpanel. + * @param eventId + * @param eventProps + */ +export declare function uploadMixpanelEvent(eventId: string, eventProps?: {}): void; +/** + * Fetch wrapper that adds the authentication token to the request. + * Use this to call the ThoughtSpot APIs when using the visual embed sdk. + * The interface for this method is the same as Web `Fetch`. + * @param input + * @param init + * @example + * ```js + * tokenizedFetch("/api/rest/2.0/auth/session/user", { + * // .. fetch options .. + * }); + *``` + * @version SDK: 1.28.0 + * @group Global methods + */ +export declare const tokenizedFetch: typeof fetch; +/** + * Get answer from natural language query + * @param query string + * @param worksheetId string + * @returns AnswerService and the suggestion response. + * @version SDK: 1.33.1 | ThoughtSpot: 10.3.0.cl + * @example + * ```js + * const { answer } = await getAnswerFromQuery('revenue', 'worksheetId'); + * ``` + */ +export declare const getAnswerFromQuery: (query: string, worksheetId: string) => Promise<{ + answer: AnswerService; + suggestion: any; +}>; +/** + * Creates a new Liveboard in ThoughtSpot using the provided AnswerService instances. + * + * Each answer will be added as a visualization to the newly created Liveboard. + * + * @param {AnswerService[]} answers - An array of initialized `AnswerService` instances + * representing the answers to be added to the Liveboard. + * @param {string} name - The name of the Liveboard to create. + * @returns result Promise + * @version SDK: 1.33.1 | ThoughtSpot: * + * @example + * ```js + * import { EmbedEvent, AnswerService } from "@thoughtspot/visual-embed-sdk"; + * + * embed.on(EmbedEvent.Data, async () => { + * try { + * const answerService = await embed.getAnswerService(); + * const lb = await createLiveboardWithAnswers( + * [answerService], + * "My Liveboard" + * ); + * console.log("Liveboard created:", lb); + * } catch (err) { + * console.error("Failed to create liveboard:", err); + * } + * }); + * ``` + */ +export declare const createLiveboardWithAnswers: (answers: AnswerService[], name: string) => Promise; +/** + * Resets the auth token and a new token will be fetched on the next request. + * @example + * ```js + * resetCachedAuthToken(); + * ``` + * @version SDK: 1.28.0 | ThoughtSpot: * + * @group Authentication / Init + */ +export declare const resetCachedAuthToken: () => void; + +export { + getEmbedConfig as getInitConfig, +}; + +export {};