@thoughtspot/visual-embed-sdk
Version:
ThoughtSpot Embed SDK
163 lines • 5.71 kB
TypeScript
/**
* Copyright (c) 2023
*
* Embed ThoughtSpot Sage
* @summary TS Sage embed
* @author Mourya Balabhadra <mourya.balabhadra@thoughtspot.com>
*/
import { DOMSelector, BaseViewConfig, SearchLiveboardCommonViewConfig } from '../types';
import { V1Embed } from './ts-embed';
/**
* Configuration for search options
*/
export interface SearchOptions {
/**
* 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<BaseViewConfig, 'primaryAction' | 'runtimeFilters' | 'runtimeParameters' | 'excludeRuntimeFiltersfromURL' | 'excludeRuntimeParametersfromURL'> {
/**
* 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;
}
/**
* 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);
/**
* 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<SageEmbed>;
}
//# sourceMappingURL=sage.d.ts.map