ashish-sdk
Version:
ThoughtSpot Embed SDK
441 lines • 14.6 kB
JavaScript
/**
* Copyright (c) 2022
*
* TypeScript type definitions for ThoughtSpot Visual Embed SDK
*
* @summary Type definitions for Embed SDK
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
*/
/**
* The authentication mechanism for allowing access to the
* the embedded app
*/
// eslint-disable-next-line no-shadow
export var AuthType;
(function (AuthType) {
/**
* No authentication. Use this only for testing purposes.
*/
AuthType["None"] = "None";
/**
* SSO using SAML
*/
AuthType["SSO"] = "SSO_SAML";
/**
* SSO using OIDC
*/
AuthType["OIDC"] = "SSO_OIDC";
/**
* Trusted authentication server
*/
AuthType["AuthServer"] = "AuthServer";
/**
* 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.
*/
AuthType["Basic"] = "Basic";
})(AuthType || (AuthType = {}));
/**
* A map of the supported runtime filter operations
*/
// eslint-disable-next-line no-shadow
export var RuntimeFilterOp;
(function (RuntimeFilterOp) {
/**
* Equals
*/
RuntimeFilterOp["EQ"] = "EQ";
/**
* Does not equal
*/
RuntimeFilterOp["NE"] = "NE";
/**
* Less than
*/
RuntimeFilterOp["LT"] = "LT";
/**
* Less than or equal to
*/
RuntimeFilterOp["LE"] = "LE";
/**
* Greater than
*/
RuntimeFilterOp["GT"] = "GT";
/**
* Greater than or equal to
*/
RuntimeFilterOp["GE"] = "GE";
/**
* Contains
*/
RuntimeFilterOp["CONTAINS"] = "CONTAINS";
/**
* Begins with
*/
RuntimeFilterOp["BEGINS_WITH"] = "BEGINS_WITH";
/**
* Ends with
*/
RuntimeFilterOp["ENDS_WITH"] = "ENDS_WITH";
/**
* Between, inclusive of higher value
*/
RuntimeFilterOp["BW_INC_MAX"] = "BW_INC_MAX";
/**
* Between, inclusive of lower value
*/
RuntimeFilterOp["BW_INC_MIN"] = "BW_INC_MIN";
/**
* Between, inclusive of both higher and lower value
*/
RuntimeFilterOp["BW_INC"] = "BW_INC";
/**
* Between, non-inclusive
*/
RuntimeFilterOp["BW"] = "BW";
/**
* Is included in this list of values
*/
RuntimeFilterOp["IN"] = "IN";
})(RuntimeFilterOp || (RuntimeFilterOp = {}));
/**
* Event types emitted by the embedded ThoughtSpot application.
*/
// eslint-disable-next-line no-shadow
export var EmbedEvent;
(function (EmbedEvent) {
/**
* Rendering has initialized.
* @return timestamp - The timestamp when the event was generated.
*/
EmbedEvent["Init"] = "init";
/**
* Authentication has either succeeded or failed.
* @return isLoggedIn - A Boolean specifying whether authentication was successful.
*/
EmbedEvent["AuthInit"] = "authInit";
/**
* The embed object container has loaded.
* @return timestamp - The timestamp when the event was generated.
*/
EmbedEvent["Load"] = "load";
/**
* Data pertaining to answer or Liveboard is received
* @return data - The answer or Liveboard data
*/
EmbedEvent["Data"] = "data";
/**
* Search/answer/Liveboard filters have been applied/updated
* @hidden
*/
EmbedEvent["FiltersChanged"] = "filtersChanged";
/**
* Search query has been updated
*/
EmbedEvent["QueryChanged"] = "queryChanged";
/**
* A drill down operation has been performed.
* @return additionalFilters - Any additional filters applied
* @return drillDownColumns - The columns on which drill down was performed
* @return nonFilteredColumns - The columns that were not filtered
*/
EmbedEvent["Drilldown"] = "drillDown";
/**
* One or more data sources have been selected.
* @return dataSourceIds - the list of data sources
*/
EmbedEvent["DataSourceSelected"] = "dataSourceSelected";
/**
* One or more data columns have been selected.
* @return columnIds - the list of columns
* @version SDK: 1.9.0 | ThoughtSpot: 8.2.0.cl
*/
EmbedEvent["AddRemoveColumns"] = "addRemoveColumns";
/**
* A custom action has been triggered
* @return actionId - The id of the custom action
* @return data - The answer or Liveboard data
*/
EmbedEvent["CustomAction"] = "customAction";
/**
* A click has been triggered on table/chart
* @return ContextMenuInputPoints - data point that is double clicked
* @version 1.10.0
*/
EmbedEvent["VizPointClick"] = "vizPointClick";
/**
* A double click has been triggered on table/chart
* @return ContextMenuInputPoints - data point that is double clicked
* @version 1.5.0 or later
*/
EmbedEvent["VizPointDoubleClick"] = "vizPointDoubleClick";
/**
* Event troggered when rendering a chart, call the supplied
* callback with the config overrides.
* @version 1.10.0
*/
EmbedEvent["GetVizConfigOverrides"] = "getVizConfigOverrides";
/**
* An error has occurred.
* @return error - An error object or message
*/
EmbedEvent["Error"] = "Error";
/**
* The embedded object has sent an alert
* @return alert - An alert object
*/
EmbedEvent["Alert"] = "alert";
/**
* The ThoughtSpot auth session has expired.
*/
EmbedEvent["AuthExpire"] = "ThoughtspotAuthExpired";
/**
* The height of the embedded Liveboard or visualization has been computed.
* @return data - The height of the embedded Liveboard or visualization
* @hidden
*/
EmbedEvent["EmbedHeight"] = "EMBED_HEIGHT";
/**
* The center of visible iframe viewport is calculated.
* @return data - The center of the visible Iframe viewport.
* @hidden
*/
EmbedEvent["EmbedIframeCenter"] = "EmbedIframeCenter";
/**
* Detects the route change.
*/
EmbedEvent["RouteChange"] = "ROUTE_CHANGE";
/**
* The v1 event type for Data
* @hidden
*/
EmbedEvent["V1Data"] = "exportVizDataToParent";
/**
* Emitted when the embed does not have cookie access. This
* happens on Safari where third-party cookies are blocked by default.
*
* @version 1.1.0 or later
*/
EmbedEvent["NoCookieAccess"] = "noCookieAccess";
/**
* Emitted when SAML is complete
* @private
* @hidden
*/
EmbedEvent["SAMLComplete"] = "samlComplete";
/**
* Emitted when any modal is opened in the app
* @version 1.6.0 or later
*/
EmbedEvent["DialogOpen"] = "dialog-open";
/**
* Emitted when any modal is closed in the app
* @version 1.6.0 or later
*/
EmbedEvent["DialogClose"] = "dialog-close";
})(EmbedEvent || (EmbedEvent = {}));
/**
* 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.
*/
// eslint-disable-next-line no-shadow
export var HostEvent;
(function (HostEvent) {
/**
* Trigger a search
* @param dataSourceIds - The list of data source GUIDs
* @param searchQuery - The search query
*/
HostEvent["Search"] = "search";
/**
* Trigger a drill on certain points by certain column
* @param points - an object containing selectedPoints/clickedPoints
* eg. { selectedPoints: []}
* @param columnGuid - a string guid of the column to drill by. This is optional,
* if not provided it will auto drill by the configured column. \
* @version 1.5.0 or later
*/
HostEvent["DrillDown"] = "triggerDrillDown";
/**
* Apply filters
* @hidden
*/
HostEvent["Filter"] = "filter";
/**
* Reload the answer or visualization
* @hidden
*/
HostEvent["Reload"] = "reload";
/**
* Set the visible visualizations on a Liveboard.
* @param - an array of ids of visualizations to show, the ids not passed
* will be hidden.
* @version 1.6.0 or later
*/
HostEvent["SetVisibleVizs"] = "SetPinboardVisibleVizs";
/**
* Update the runtime filters. The runtime filters passed here are extended
* on to the existing runtime filters if they exist.
* @param - {@link RuntimeFilter}[] an array of {@link RuntimeFilter} Types.
* @version 1.8.0 or later
*/
HostEvent["UpdateRuntimeFilters"] = "UpdateRuntimeFilters";
/**
* Highlight the point in the chart defined by the InputPoint passed.
* @verion 1.10.0
*/
HostEvent["HighlightPoint"] = "HighlightPoint";
})(HostEvent || (HostEvent = {}));
/**
* The different visual modes that the data sources panel within
* search could appear in, i.e., hidden, collapsed, or expanded.
*/
// eslint-disable-next-line no-shadow
export var DataSourceVisualMode;
(function (DataSourceVisualMode) {
/**
* Data source panel is hidden.
*/
DataSourceVisualMode["Hidden"] = "hide";
/**
* Data source panel is collapsed, but the user can manually expand it.
*/
DataSourceVisualMode["Collapsed"] = "collapse";
/**
* Data source panel is expanded, but the user can manually collapse it.
*/
DataSourceVisualMode["Expanded"] = "expand";
})(DataSourceVisualMode || (DataSourceVisualMode = {}));
/**
* The query params passed down to the embedded ThoughtSpot app
* containing configuration and/or visual information.
*/
// eslint-disable-next-line no-shadow
export var Param;
(function (Param) {
Param["DataSources"] = "dataSources";
Param["DataSourceMode"] = "dataSourceMode";
Param["DisableActions"] = "disableAction";
Param["DisableActionReason"] = "disableHint";
Param["ForceTable"] = "forceTable";
Param["preventLiveboardFilterRemoval"] = "preventPinboardFilterRemoval";
Param["SearchQuery"] = "searchQuery";
Param["HideActions"] = "hideAction";
Param["HideObjects"] = "hideObjects";
Param["HostAppUrl"] = "hostAppUrl";
Param["EnableVizTransformations"] = "enableVizTransform";
Param["EnableSearchAssist"] = "enableSearchAssist";
Param["HideResult"] = "hideResult";
Param["UseLastSelectedDataSource"] = "useLastSelectedSources";
Param["Tag"] = "tag";
Param["searchTokenString"] = "searchTokenString";
Param["executeSearch"] = "executeSearch";
Param["fullHeight"] = "isFullHeightPinboard";
Param["livedBoardEmbed"] = "isLiveboardEmbed";
Param["searchEmbed"] = "isSearchEmbed";
Param["Version"] = "sdkVersion";
Param["ViewPortHeight"] = "viewPortHeight";
Param["ViewPortWidth"] = "viewPortWidth";
Param["VisibleActions"] = "visibleAction";
Param["CustomCSSUrl"] = "customCssUrl";
})(Param || (Param = {}));
/**
* The list of actions that can be performed on visual ThoughtSpot
* entities, such as answers and Liveboards.
*/
// eslint-disable-next-line no-shadow
export var Action;
(function (Action) {
Action["Save"] = "save";
Action["Update"] = "update";
Action["SaveUntitled"] = "saveUntitled";
Action["SaveAsView"] = "saveAsView";
Action["MakeACopy"] = "makeACopy";
Action["EditACopy"] = "editACopy";
Action["CopyLink"] = "embedDocument";
Action["ResetLayout"] = "resetLayout";
Action["Schedule"] = "subscription";
Action["SchedulesList"] = "schedule-list";
Action["Share"] = "share";
Action["AddFilter"] = "addFilter";
Action["ConfigureFilter"] = "configureFilter";
Action["AddFormula"] = "addFormula";
Action["SearchOnTop"] = "searchOnTop";
Action["SpotIQAnalyze"] = "spotIQAnalyze";
Action["ExplainInsight"] = "explainInsight";
Action["SpotIQFollow"] = "spotIQFollow";
Action["ShareViz"] = "shareViz";
Action["ReplaySearch"] = "replaySearch";
Action["ShowUnderlyingData"] = "showUnderlyingData";
Action["Download"] = "download";
Action["DownloadAsPdf"] = "downloadAsPdf";
Action["DownloadAsCsv"] = "downloadAsCSV";
Action["DownloadAsXlsx"] = "downloadAsXLSX";
Action["DownloadTrace"] = "downloadTrace";
Action["ExportTML"] = "exportTSL";
Action["ImportTML"] = "importTSL";
Action["UpdateTML"] = "updateTSL";
Action["EditTML"] = "editTSL";
Action["Present"] = "present";
Action["ToggleSize"] = "toggleSize";
Action["Edit"] = "edit";
Action["EditTitle"] = "editTitle";
Action["Remove"] = "delete";
Action["Ungroup"] = "ungroup";
Action["Describe"] = "describe";
Action["Relate"] = "relate";
Action["CustomizeHeadlines"] = "customizeHeadlines";
/**
* @hidden
*/
Action["PinboardInfo"] = "pinboardInfo";
Action["LiveboardInfo"] = "pinboardInfo";
Action["SendAnswerFeedback"] = "sendFeedback";
Action["DownloadEmbraceQueries"] = "downloadEmbraceQueries";
Action["Pin"] = "pin";
Action["AnalysisInfo"] = "analysisInfo";
Action["Subscription"] = "subscription";
Action["Explore"] = "explore";
Action["DrillInclude"] = "context-menu-item-include";
Action["DrillExclude"] = "context-menu-item-exclude";
Action["CopyToClipboard"] = "context-menu-item-copy-to-clipboard";
Action["CopyAndEdit"] = "context-menu-item-copy-and-edit";
Action["DrillEdit"] = "context-menu-item-edit";
Action["EditMeasure"] = "context-menu-item-edit-measure";
Action["Separator"] = "context-menu-item-separator";
Action["DrillDown"] = "DRILL";
Action["RequestAccess"] = "requestAccess";
Action["QueryDetailsButtons"] = "queryDetailsButtons";
/**
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
*/
Action["Monitor"] = "createMonitor";
/**
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
*/
Action["AnswerDelete"] = "onDeleteAnswer";
/**
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
*/
Action["AnswerChartSwitcher"] = "answerChartSwitcher";
/**
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
*/
Action["AddToFavorites"] = "addToFavorites";
/**
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
*/
Action["EditDetails"] = "editDetails";
})(Action || (Action = {}));
// eslint-disable-next-line no-shadow
export var OperationType;
(function (OperationType) {
OperationType["GetChartWithData"] = "GetChartWithData";
OperationType["GetTableWithHeadlineData"] = "GetTableWithHeadlineData";
})(OperationType || (OperationType = {}));
//# sourceMappingURL=types.js.map