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