@thoughtspot/visual-embed-sdk 1.21.0-alpha.9 → 1.21.0-react.0

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