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

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