UNPKG

@thoughtspot/visual-embed-sdk

Version:
245 lines 7.61 kB
import { BaseViewConfig, RuntimeFilter, RuntimeParameter } from '../types'; import { TsEmbed } from './ts-embed'; /** * Configuration for search options */ export interface SearchOptions { /** * 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<BaseViewConfig, 'primaryAction'> { /** * 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; /** * 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.41.1 | ThoughtSpot Cloud: 10.14.0.cl * @example * ```js * // Replace <EmbedComponent> with embed component name. For example, SageEmbed, AppEmbed, or SearchBarEmbed * const embed = new <EmbedComponent>('#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; /** * enablePastConversationsSidebar : Controls the visibility of the past conversations * sidebar. * * Supported embed types: `SpotterEmbed` * @default false * @example * ```js * const embed = new SpotterEmbed('#tsEmbed', { * ... //other embed view config * enablePastConversationsSidebar : true, * }) * ``` * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl */ enablePastConversationsSidebar?: boolean; /** * updatedSpotterChatPrompt : Controls the updated spotter chat prompt. * * Supported embed types: `SpotterEmbed` * @default false * @example * ```js * const embed = new SpotterEmbed('#tsEmbed', { * ... //other embed view config * updatedSpotterChatPrompt : true, * }) * ``` * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl */ updatedSpotterChatPrompt?: 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<any, any>; getIframeSrc(): string; render(): Promise<SpotterEmbed>; } /** * 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); } //# sourceMappingURL=conversation.d.ts.map