@thoughtspot/visual-embed-sdk 1.36.2 → 1.36.4

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 (271) hide show
  1. package/cjs/package.json +1 -1
  2. package/cjs/src/authToken.d.ts.map +1 -1
  3. package/cjs/src/authToken.js +10 -3
  4. package/cjs/src/authToken.js.map +1 -1
  5. package/cjs/src/embed/app.d.ts +14 -0
  6. package/cjs/src/embed/app.d.ts.map +1 -1
  7. package/cjs/src/embed/app.js +5 -2
  8. package/cjs/src/embed/app.js.map +1 -1
  9. package/cjs/src/embed/app.spec.js +17 -0
  10. package/cjs/src/embed/app.spec.js.map +1 -1
  11. package/cjs/src/embed/base.d.ts +4 -0
  12. package/cjs/src/embed/base.d.ts.map +1 -1
  13. package/cjs/src/embed/base.js +27 -1
  14. package/cjs/src/embed/base.js.map +1 -1
  15. package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
  16. package/cjs/src/embed/bodyless-conversation.js +1 -1
  17. package/cjs/src/embed/bodyless-conversation.js.map +1 -1
  18. package/cjs/src/embed/conversation.d.ts.map +1 -1
  19. package/cjs/src/embed/conversation.js +1 -1
  20. package/cjs/src/embed/conversation.js.map +1 -1
  21. package/cjs/src/embed/embedConfig.d.ts +1 -1
  22. package/cjs/src/embed/embedConfig.d.ts.map +1 -1
  23. package/cjs/src/embed/embedConfig.js +5 -4
  24. package/cjs/src/embed/embedConfig.js.map +1 -1
  25. package/cjs/src/embed/liveboard.d.ts +6 -3
  26. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  27. package/cjs/src/embed/liveboard.js +4 -5
  28. package/cjs/src/embed/liveboard.js.map +1 -1
  29. package/cjs/src/embed/liveboard.spec.js +11 -11
  30. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  31. package/cjs/src/embed/sage.d.ts.map +1 -1
  32. package/cjs/src/embed/sage.js +1 -1
  33. package/cjs/src/embed/sage.js.map +1 -1
  34. package/cjs/src/embed/search-bar.d.ts.map +1 -1
  35. package/cjs/src/embed/search-bar.js +1 -1
  36. package/cjs/src/embed/search-bar.js.map +1 -1
  37. package/cjs/src/embed/search.d.ts.map +1 -1
  38. package/cjs/src/embed/search.js +1 -1
  39. package/cjs/src/embed/search.js.map +1 -1
  40. package/cjs/src/embed/ts-embed.d.ts +4 -3
  41. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  42. package/cjs/src/embed/ts-embed.js +25 -16
  43. package/cjs/src/embed/ts-embed.js.map +1 -1
  44. package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
  45. package/cjs/src/embed/ts-embed.spec.js +71 -5
  46. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  47. package/cjs/src/errors.d.ts +1 -0
  48. package/cjs/src/errors.d.ts.map +1 -1
  49. package/cjs/src/errors.js +1 -0
  50. package/cjs/src/errors.js.map +1 -1
  51. package/cjs/src/react/all-types-export.d.ts +1 -1
  52. package/cjs/src/react/all-types-export.d.ts.map +1 -1
  53. package/cjs/src/react/all-types-export.js +2 -1
  54. package/cjs/src/react/all-types-export.js.map +1 -1
  55. package/cjs/src/react/index.d.ts +16 -0
  56. package/cjs/src/react/index.d.ts.map +1 -1
  57. package/cjs/src/react/index.js +25 -2
  58. package/cjs/src/react/index.js.map +1 -1
  59. package/cjs/src/types.d.ts +85 -66
  60. package/cjs/src/types.d.ts.map +1 -1
  61. package/cjs/src/types.js +78 -59
  62. package/cjs/src/types.js.map +1 -1
  63. package/cjs/src/utils/with-resolvers-polyfill.d.ts +1 -0
  64. package/cjs/src/utils/with-resolvers-polyfill.d.ts.map +1 -0
  65. package/cjs/src/utils/with-resolvers-polyfill.js +12 -0
  66. package/cjs/src/utils/with-resolvers-polyfill.js.map +1 -0
  67. package/cjs/src/utils.d.ts +27 -0
  68. package/cjs/src/utils.d.ts.map +1 -1
  69. package/cjs/src/utils.js +45 -1
  70. package/cjs/src/utils.js.map +1 -1
  71. package/cjs/src/utils.spec.js +15 -0
  72. package/cjs/src/utils.spec.js.map +1 -1
  73. package/dist/{index-B3hd6DTM.js → index-NZYq1Tu3.js} +1 -1
  74. package/dist/src/authToken.d.ts.map +1 -1
  75. package/dist/src/embed/app.d.ts +14 -0
  76. package/dist/src/embed/app.d.ts.map +1 -1
  77. package/dist/src/embed/base.d.ts +4 -0
  78. package/dist/src/embed/base.d.ts.map +1 -1
  79. package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
  80. package/dist/src/embed/conversation.d.ts.map +1 -1
  81. package/dist/src/embed/embedConfig.d.ts +1 -1
  82. package/dist/src/embed/embedConfig.d.ts.map +1 -1
  83. package/dist/src/embed/liveboard.d.ts +6 -3
  84. package/dist/src/embed/liveboard.d.ts.map +1 -1
  85. package/dist/src/embed/sage.d.ts.map +1 -1
  86. package/dist/src/embed/search-bar.d.ts.map +1 -1
  87. package/dist/src/embed/search.d.ts.map +1 -1
  88. package/dist/src/embed/ts-embed.d.ts +4 -3
  89. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  90. package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
  91. package/dist/src/errors.d.ts +1 -0
  92. package/dist/src/errors.d.ts.map +1 -1
  93. package/dist/src/react/all-types-export.d.ts +1 -1
  94. package/dist/src/react/all-types-export.d.ts.map +1 -1
  95. package/dist/src/react/index.d.ts +16 -0
  96. package/dist/src/react/index.d.ts.map +1 -1
  97. package/dist/src/types.d.ts +85 -66
  98. package/dist/src/types.d.ts.map +1 -1
  99. package/dist/src/utils/with-resolvers-polyfill.d.ts +1 -0
  100. package/dist/src/utils/with-resolvers-polyfill.d.ts.map +1 -0
  101. package/dist/src/utils.d.ts +27 -0
  102. package/dist/src/utils.d.ts.map +1 -1
  103. package/dist/tsembed-react.es.js +458 -108
  104. package/dist/tsembed-react.js +456 -105
  105. package/dist/tsembed.es.js +197 -98
  106. package/dist/tsembed.js +196 -97
  107. package/dist/visual-embed-sdk-react-full.d.ts +1324 -1269
  108. package/dist/visual-embed-sdk-react.d.ts +814 -759
  109. package/dist/visual-embed-sdk.d.ts +113 -72
  110. package/lib/package.json +1 -1
  111. package/lib/src/authToken.d.ts.map +1 -1
  112. package/lib/src/authToken.js +10 -3
  113. package/lib/src/authToken.js.map +1 -1
  114. package/lib/src/embed/app.d.ts +14 -0
  115. package/lib/src/embed/app.d.ts.map +1 -1
  116. package/lib/src/embed/app.js +5 -2
  117. package/lib/src/embed/app.js.map +1 -1
  118. package/lib/src/embed/app.spec.js +17 -0
  119. package/lib/src/embed/app.spec.js.map +1 -1
  120. package/lib/src/embed/base.d.ts +4 -0
  121. package/lib/src/embed/base.d.ts.map +1 -1
  122. package/lib/src/embed/base.js +24 -1
  123. package/lib/src/embed/base.js.map +1 -1
  124. package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
  125. package/lib/src/embed/bodyless-conversation.js +1 -1
  126. package/lib/src/embed/bodyless-conversation.js.map +1 -1
  127. package/lib/src/embed/conversation.d.ts.map +1 -1
  128. package/lib/src/embed/conversation.js +1 -1
  129. package/lib/src/embed/conversation.js.map +1 -1
  130. package/lib/src/embed/embedConfig.d.ts +1 -1
  131. package/lib/src/embed/embedConfig.d.ts.map +1 -1
  132. package/lib/src/embed/embedConfig.js +5 -4
  133. package/lib/src/embed/embedConfig.js.map +1 -1
  134. package/lib/src/embed/liveboard.d.ts +6 -3
  135. package/lib/src/embed/liveboard.d.ts.map +1 -1
  136. package/lib/src/embed/liveboard.js +4 -5
  137. package/lib/src/embed/liveboard.js.map +1 -1
  138. package/lib/src/embed/liveboard.spec.js +11 -11
  139. package/lib/src/embed/liveboard.spec.js.map +1 -1
  140. package/lib/src/embed/sage.d.ts.map +1 -1
  141. package/lib/src/embed/sage.js +1 -1
  142. package/lib/src/embed/sage.js.map +1 -1
  143. package/lib/src/embed/search-bar.d.ts.map +1 -1
  144. package/lib/src/embed/search-bar.js +1 -1
  145. package/lib/src/embed/search-bar.js.map +1 -1
  146. package/lib/src/embed/search.d.ts.map +1 -1
  147. package/lib/src/embed/search.js +1 -1
  148. package/lib/src/embed/search.js.map +1 -1
  149. package/lib/src/embed/ts-embed.d.ts +4 -3
  150. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  151. package/lib/src/embed/ts-embed.js +26 -17
  152. package/lib/src/embed/ts-embed.js.map +1 -1
  153. package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
  154. package/lib/src/embed/ts-embed.spec.js +71 -5
  155. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  156. package/lib/src/errors.d.ts +1 -0
  157. package/lib/src/errors.d.ts.map +1 -1
  158. package/lib/src/errors.js +1 -0
  159. package/lib/src/errors.js.map +1 -1
  160. package/lib/src/react/all-types-export.d.ts +1 -1
  161. package/lib/src/react/all-types-export.d.ts.map +1 -1
  162. package/lib/src/react/all-types-export.js +1 -1
  163. package/lib/src/react/all-types-export.js.map +1 -1
  164. package/lib/src/react/index.d.ts +16 -0
  165. package/lib/src/react/index.d.ts.map +1 -1
  166. package/lib/src/react/index.js +23 -1
  167. package/lib/src/react/index.js.map +1 -1
  168. package/lib/src/types.d.ts +85 -66
  169. package/lib/src/types.d.ts.map +1 -1
  170. package/lib/src/types.js +78 -59
  171. package/lib/src/types.js.map +1 -1
  172. package/lib/src/utils/with-resolvers-polyfill.d.ts +1 -0
  173. package/lib/src/utils/with-resolvers-polyfill.d.ts.map +1 -0
  174. package/lib/src/utils/with-resolvers-polyfill.js +12 -0
  175. package/lib/src/utils/with-resolvers-polyfill.js.map +1 -0
  176. package/lib/src/utils.d.ts +27 -0
  177. package/lib/src/utils.d.ts.map +1 -1
  178. package/lib/src/utils.js +41 -0
  179. package/lib/src/utils.js.map +1 -1
  180. package/lib/src/utils.spec.js +16 -1
  181. package/lib/src/utils.spec.js.map +1 -1
  182. package/lib/src/visual-embed-sdk.d.ts +114 -73
  183. package/package.json +1 -1
  184. package/src/authToken.ts +11 -3
  185. package/src/embed/app.spec.ts +27 -0
  186. package/src/embed/app.ts +21 -1
  187. package/src/embed/base.ts +41 -1
  188. package/src/embed/bodyless-conversation.ts +2 -1
  189. package/src/embed/conversation.ts +2 -1
  190. package/src/embed/embedConfig.ts +5 -4
  191. package/src/embed/liveboard.spec.ts +11 -11
  192. package/src/embed/liveboard.ts +9 -7
  193. package/src/embed/sage.ts +1 -2
  194. package/src/embed/search-bar.tsx +1 -2
  195. package/src/embed/search.ts +1 -2
  196. package/src/embed/ts-embed.spec.ts +83 -5
  197. package/src/embed/ts-embed.ts +33 -17
  198. package/src/errors.ts +1 -0
  199. package/src/react/all-types-export.ts +1 -0
  200. package/src/react/index.tsx +27 -2
  201. package/src/types.ts +89 -70
  202. package/src/utils/with-resolvers-polyfill.ts +11 -0
  203. package/src/utils.spec.ts +21 -0
  204. package/src/utils.ts +52 -0
  205. package/cjs/src/embed/searchEmbed-basic-auth.spec.d.ts +0 -2
  206. package/cjs/src/embed/searchEmbed-basic-auth.spec.d.ts.map +0 -1
  207. package/cjs/src/embed/searchEmbed-basic-auth.spec.js +0 -104
  208. package/cjs/src/embed/searchEmbed-basic-auth.spec.js.map +0 -1
  209. package/cjs/src/hostEventsTypeMapping.d.ts +0 -2
  210. package/cjs/src/hostEventsTypeMapping.d.ts.map +0 -1
  211. package/cjs/src/hostEventsTypeMapping.js +0 -4
  212. package/cjs/src/hostEventsTypeMapping.js.map +0 -1
  213. package/cjs/src/utils/embedApi/contracts.d.ts +0 -101
  214. package/cjs/src/utils/embedApi/contracts.d.ts.map +0 -1
  215. package/cjs/src/utils/embedApi/contracts.js +0 -17
  216. package/cjs/src/utils/embedApi/contracts.js.map +0 -1
  217. package/cjs/src/utils/embedApi/embedApiClient.d.ts +0 -12
  218. package/cjs/src/utils/embedApi/embedApiClient.d.ts.map +0 -1
  219. package/cjs/src/utils/embedApi/embedApiClient.js +0 -46
  220. package/cjs/src/utils/embedApi/embedApiClient.js.map +0 -1
  221. package/cjs/src/utils/embedApi/processEmbedApi.d.ts +0 -9
  222. package/cjs/src/utils/embedApi/processEmbedApi.d.ts.map +0 -1
  223. package/cjs/src/utils/embedApi/processEmbedApi.js +0 -18
  224. package/cjs/src/utils/embedApi/processEmbedApi.js.map +0 -1
  225. package/dist/index-BBBimG1x.js +0 -7370
  226. package/dist/index-BGnxP5NY.js +0 -7370
  227. package/dist/index-CENLvayL.js +0 -7370
  228. package/dist/index-CR5u7BMC.js +0 -7370
  229. package/dist/index-CbltIawo.js +0 -7370
  230. package/dist/index-CoQfqaHj.js +0 -7370
  231. package/dist/index-CzwzS0P4.js +0 -7370
  232. package/dist/index-D-9WUCUl.js +0 -7370
  233. package/dist/index-DFwi_pV_.js +0 -7370
  234. package/dist/index-DOIjN0N_.js +0 -7370
  235. package/dist/index-DYBx8SuE.js +0 -7370
  236. package/dist/index-DaLHJaLd.js +0 -7370
  237. package/dist/index-DnJX-gN2.js +0 -7370
  238. package/dist/index-DpuhnTj2.js +0 -7370
  239. package/dist/index-IDmSUe93.js +0 -7370
  240. package/dist/index-nWevLycs.js +0 -7370
  241. package/dist/index-vxW97_xb.js +0 -7370
  242. package/dist/src/embed/searchEmbed-basic-auth.spec.d.ts +0 -2
  243. package/dist/src/embed/searchEmbed-basic-auth.spec.d.ts.map +0 -1
  244. package/dist/src/hostEventsTypeMapping.d.ts +0 -2
  245. package/dist/src/hostEventsTypeMapping.d.ts.map +0 -1
  246. package/dist/src/utils/embedApi/contracts.d.ts +0 -101
  247. package/dist/src/utils/embedApi/contracts.d.ts.map +0 -1
  248. package/dist/src/utils/embedApi/embedApiClient.d.ts +0 -12
  249. package/dist/src/utils/embedApi/embedApiClient.d.ts.map +0 -1
  250. package/dist/src/utils/embedApi/processEmbedApi.d.ts +0 -9
  251. package/dist/src/utils/embedApi/processEmbedApi.d.ts.map +0 -1
  252. package/lib/src/embed/searchEmbed-basic-auth.spec.d.ts +0 -2
  253. package/lib/src/embed/searchEmbed-basic-auth.spec.d.ts.map +0 -1
  254. package/lib/src/embed/searchEmbed-basic-auth.spec.js +0 -101
  255. package/lib/src/embed/searchEmbed-basic-auth.spec.js.map +0 -1
  256. package/lib/src/hostEventsTypeMapping.d.ts +0 -2
  257. package/lib/src/hostEventsTypeMapping.d.ts.map +0 -1
  258. package/lib/src/hostEventsTypeMapping.js +0 -2
  259. package/lib/src/hostEventsTypeMapping.js.map +0 -1
  260. package/lib/src/utils/embedApi/contracts.d.ts +0 -101
  261. package/lib/src/utils/embedApi/contracts.d.ts.map +0 -1
  262. package/lib/src/utils/embedApi/contracts.js +0 -14
  263. package/lib/src/utils/embedApi/contracts.js.map +0 -1
  264. package/lib/src/utils/embedApi/embedApiClient.d.ts +0 -12
  265. package/lib/src/utils/embedApi/embedApiClient.d.ts.map +0 -1
  266. package/lib/src/utils/embedApi/embedApiClient.js +0 -42
  267. package/lib/src/utils/embedApi/embedApiClient.js.map +0 -1
  268. package/lib/src/utils/embedApi/processEmbedApi.d.ts +0 -9
  269. package/lib/src/utils/embedApi/processEmbedApi.d.ts.map +0 -1
  270. package/lib/src/utils/embedApi/processEmbedApi.js +0 -14
  271. package/lib/src/utils/embedApi/processEmbedApi.js.map +0 -1
@@ -250,6 +250,195 @@ type EmbedComponent = typeof SearchEmbed | typeof AppEmbed | typeof LiveboardEmb
250
250
  * @returns {React.MutableRefObject<T extends TsEmbed>} ref
251
251
  */
252
252
  export function useEmbedRef<T extends EmbedComponent>(): React.MutableRefObject<React.ComponentRef<T>>;
253
+ /**
254
+ *
255
+ * @param config - EmbedConfig
256
+ * @returns AuthEventEmitter
257
+ * @example
258
+ * ```
259
+ * function Component() {
260
+ * const authEE = useInit({ ...initConfig });
261
+ * return <LiveboardEmbed ref={ref} liveboardId={<id>} />
262
+ * }
263
+ * ```
264
+ * @version SDK: 1.36.2 | ThoughtSpot: *
265
+ */
266
+ export function useInit(config: EmbedConfig): React.MutableRefObject<AuthEventEmitter>;
267
+
268
+ export declare let loggedInStatus: boolean;
269
+ export declare let samlAuthWindow: Window;
270
+ export declare let samlCompletionPromise: Promise<void>;
271
+ export declare const SSO_REDIRECTION_MARKER_GUID = "5e16222e-ef02-43e9-9fbd-24226bf3ce5b";
272
+ /**
273
+ * Enum for auth failure types. This is the parameter passed to the listner
274
+ * of {@link AuthStatus.FAILURE}.
275
+ * @group Authentication / Init
276
+ */
277
+ export declare enum AuthFailureType {
278
+ SDK = "SDK",
279
+ NO_COOKIE_ACCESS = "NO_COOKIE_ACCESS",
280
+ EXPIRY = "EXPIRY",
281
+ OTHER = "OTHER",
282
+ IDLE_SESSION_TIMEOUT = "IDLE_SESSION_TIMEOUT"
283
+ }
284
+ /**
285
+ * Enum for auth status emitted by the emitter returned from {@link init}.
286
+ * @group Authentication / Init
287
+ */
288
+ export declare enum AuthStatus {
289
+ /**
290
+ * Emits when the SDK fails to authenticate
291
+ */
292
+ FAILURE = "FAILURE",
293
+ /**
294
+ * Emits when the SDK authenticates successfully
295
+ */
296
+ SDK_SUCCESS = "SDK_SUCCESS",
297
+ /**
298
+ * @hidden
299
+ * Emits when iframe is loaded and session info is available
300
+ */
301
+ SESSION_INFO_SUCCESS = "SESSION_INFO_SUCCESS",
302
+ /**
303
+ * Emits when the app sends an authentication success message
304
+ */
305
+ SUCCESS = "SUCCESS",
306
+ /**
307
+ * Emits when a user logs out
308
+ */
309
+ LOGOUT = "LOGOUT",
310
+ /**
311
+ * Emitted when inPopup is true in the SAMLRedirect flow and the
312
+ * popup is waiting to be triggered either programmatically
313
+ * or by the trigger button.
314
+ * @version SDK: 1.19.0
315
+ */
316
+ WAITING_FOR_POPUP = "WAITING_FOR_POPUP"
317
+ }
318
+ /**
319
+ * Event emitter returned from {@link init}.
320
+ * @group Authentication / Init
321
+ */
322
+ export interface AuthEventEmitter {
323
+ /**
324
+ * Register a listener on Auth failure.
325
+ * @param event
326
+ * @param listener
327
+ */
328
+ on(event: AuthStatus.FAILURE, listener: (failureType: AuthFailureType) => void): this;
329
+ /**
330
+ * Register a listener on Auth SDK success.
331
+ * @param event
332
+ * @param listener
333
+ */
334
+ on(event: AuthStatus.SDK_SUCCESS | AuthStatus.LOGOUT | AuthStatus.WAITING_FOR_POPUP, listener: () => void): this;
335
+ on(event: AuthStatus.SUCCESS, listener: (sessionInfo: any) => void): this;
336
+ once(event: AuthStatus.FAILURE, listener: (failureType: AuthFailureType) => void): this;
337
+ once(event: AuthStatus.SDK_SUCCESS | AuthStatus.LOGOUT | AuthStatus.WAITING_FOR_POPUP, listener: () => void): this;
338
+ once(event: AuthStatus.SUCCESS, listener: (sessionInfo: any) => void): this;
339
+ /**
340
+ * Trigger an event on the emitter returned from init.
341
+ * @param {@link AuthEvent}
342
+ */
343
+ emit(event: AuthEvent, ...args: any[]): boolean;
344
+ /**
345
+ * Remove listener from the emitter returned from init.
346
+ * @param event
347
+ * @param listener
348
+ * @param context
349
+ * @param once
350
+ */
351
+ off(event: AuthStatus, listener: (...args: any[]) => void, context: any, once: boolean): this;
352
+ /**
353
+ * Remove all the event listeners
354
+ * @param event
355
+ */
356
+ removeAllListeners(event: AuthStatus): this;
357
+ }
358
+ /**
359
+ * Events which can be triggered on the emitter returned from {@link init}.
360
+ * @group Authentication / Init
361
+ */
362
+ export declare enum AuthEvent {
363
+ /**
364
+ * Manually trigger the SSO popup. This is useful when
365
+ * authStatus is SAMLRedirect/OIDCRedirect and inPopup is set to true
366
+ */
367
+ TRIGGER_SSO_POPUP = "TRIGGER_SSO_POPUP"
368
+ }
369
+ /**
370
+ *
371
+ */
372
+ export declare function getAuthEE(): EventEmitter<AuthStatus | AuthEvent>;
373
+ /**
374
+ *
375
+ * @param eventEmitter
376
+ */
377
+ export declare function setAuthEE(eventEmitter: EventEmitter<AuthStatus | AuthEvent>): void;
378
+ /**
379
+ *
380
+ */
381
+ export declare function notifyAuthSDKSuccess(): void;
382
+ /**
383
+ *
384
+ */
385
+ export declare function notifyAuthSuccess(): Promise<void>;
386
+ /**
387
+ *
388
+ * @param failureType
389
+ */
390
+ export declare function notifyAuthFailure(failureType: AuthFailureType): void;
391
+ /**
392
+ *
393
+ */
394
+ export declare function notifyLogout(): void;
395
+ /**
396
+ * Services to be called after the login is successful,
397
+ * This should be called after the cookie is set for cookie auth or
398
+ * after the token is set for cookieless.
399
+ * @return {Promise<void>}
400
+ * @example
401
+ * ```js
402
+ * await postLoginService();
403
+ * ```
404
+ * @version SDK: 1.28.3 | ThoughtSpot: *
405
+ */
406
+ export declare function postLoginService(): Promise<void>;
407
+ /**
408
+ * Return releaseVersion if available
409
+ */
410
+ export declare function getReleaseVersion(): string;
411
+ /**
412
+ * Perform token based authentication
413
+ * @param embedConfig The embed configuration
414
+ */
415
+ export declare const doTokenAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
416
+ /**
417
+ * Validate embedConfig parameters required for cookielessTokenAuth
418
+ * @param embedConfig The embed configuration
419
+ */
420
+ export declare const doCookielessTokenAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
421
+ /**
422
+ * Perform basic authentication to the ThoughtSpot cluster using the cluster
423
+ * credentials.
424
+ *
425
+ * Warning: This feature is primarily intended for developer testing. It is
426
+ * strongly advised not to use this authentication method in production.
427
+ * @param embedConfig The embed configuration
428
+ */
429
+ export declare const doBasicAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
430
+ export declare const doSamlAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
431
+ export declare const doOIDCAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
432
+ export declare const logout: (embedConfig: EmbedConfig) => Promise<boolean>;
433
+ /**
434
+ * Perform authentication on the ThoughtSpot cluster
435
+ * @param embedConfig The embed configuration
436
+ */
437
+ export declare const authenticate: (embedConfig: EmbedConfig) => Promise<boolean>;
438
+ /**
439
+ * Check if we are authenticated to the ThoughtSpot cluster
440
+ */
441
+ export declare const isAuthenticated: () => boolean;
253
442
 
254
443
  /**
255
444
  * @group Embed components
@@ -927,6 +1116,20 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
927
1116
  * ```
928
1117
  */
929
1118
  disableProfileAndHelp?: boolean;
1119
+ /**
1120
+ * @version SDK: 1.36.3 | ThoughtSpot: 10.1.0.cl
1121
+ * @default true
1122
+ * Whether the help menu in the top nav bar should be served
1123
+ * from Pendo or ThoughtSpot's internal help items.
1124
+ * @example
1125
+ * ```js
1126
+ * const embed = new AppEmbed('#tsEmbed', {
1127
+ * ... // other options
1128
+ * enablePendoHelp: false,
1129
+ * });
1130
+ * ```
1131
+ */
1132
+ enablePendoHelp?: boolean;
930
1133
  /**
931
1134
  * Control the visibility of the application switcher button on the nav-bar.
932
1135
  * By default, the application switcher is shown.
@@ -1568,7 +1771,10 @@ export interface LiveboardViewConfig extends Omit<ViewConfig, 'hiddenHomepageMod
1568
1771
  */
1569
1772
  showPreviewLoader?: boolean;
1570
1773
  /**
1571
- * This flag is used to enable the compact header on a Liveboard
1774
+ * Enables or disables the compact header feature on a Liveboard.
1775
+ * Compact Liveboard header is turned off by default on Liveboards in
1776
+ * ThoughtSpot Embedded apps.
1777
+ *
1572
1778
  * @type {boolean}
1573
1779
  * @default false
1574
1780
  * @version SDK: 1.35.0 | ThoughtSpot:10.3.0.cl
@@ -1685,7 +1891,7 @@ export declare class LiveboardEmbed extends V1Embed {
1685
1891
  */
1686
1892
  protected getEmbedParams(): string;
1687
1893
  protected beforePrerenderVisible(): void;
1688
- protected handleRenderForPrerender(): void;
1894
+ protected handleRenderForPrerender(): Promise<TsEmbed>;
1689
1895
  /**
1690
1896
  * Triggers an event to the embedded app
1691
1897
  * @param {HostEvent} messageType The event type
@@ -1713,169 +1919,31 @@ export declare class LiveboardEmbed extends V1Embed {
1713
1919
  export declare class PinboardEmbed extends LiveboardEmbed {
1714
1920
  }
1715
1921
 
1716
- export type EmbedEventHandlers = {
1717
- [key in keyof typeof EmbedEvent as `on${Capitalize<key>}`]?: MessageCallback;
1718
- };
1719
- export interface EmbedProps extends ViewConfig, EmbedEventHandlers {
1720
- className?: string;
1721
- }
1722
- export interface ViewConfigAndListeners<T extends ViewConfig> {
1723
- viewConfig: T;
1724
- listeners: {
1725
- [key in EmbedEvent]?: MessageCallback;
1726
- };
1727
- }
1728
- /**
1729
- *
1730
- * @param props
1731
- */
1732
- export function getViewPropsAndListeners<T extends EmbedProps, U extends ViewConfig>(props: T): ViewConfigAndListeners<U>;
1733
-
1734
1922
  /**
1735
- * Configuration for search options
1923
+ * Copyright (c) 2023
1924
+ *
1925
+ * TypeScript type definitions for ThoughtSpot Visual Embed SDK
1926
+ * @summary Type definitions for Embed SDK
1927
+ * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
1736
1928
  */
1737
- export interface SearchOptions {
1738
- /**
1739
- * The query string to pass to start the Conversation.
1740
- */
1741
- searchQuery: string;
1742
- }
1743
1929
  /**
1744
- * The configuration for the embedded conversationEmbed options.
1745
- * @group Embed components
1930
+ * The authentication mechanism for allowing access to the
1931
+ * the embedded app
1932
+ * @group Authentication / Init
1746
1933
  */
1747
- export interface ConversationViewConfig extends ViewConfig {
1748
- /**
1749
- * The ID of the worksheet to use for the conversation.
1750
- */
1751
- worksheetId: string;
1752
- /**
1753
- * Ability to pass a starting search query to the conversation.
1754
- */
1755
- searchOptions?: SearchOptions;
1934
+ export declare enum AuthType {
1756
1935
  /**
1757
- * disableSourceSelection : Disables data source selection
1758
- * but still display the selected data source.
1936
+ * No authentication on the SDK. Pass-through to the embedded App. Alias for
1937
+ * `Passthrough`.
1759
1938
  * @example
1760
1939
  * ```js
1761
- * const embed = new ConversationEmbed('#tsEmbed', {
1762
- * ... // other options
1763
- * disableSourceSelection : true,
1764
- * })
1940
+ * init({
1941
+ * // ...
1942
+ * authType: AuthType.None,
1943
+ * });
1765
1944
  * ```
1766
- * @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
1767
1945
  */
1768
- disableSourceSelection?: boolean;
1769
- /**
1770
- * hideSourceSelection : Hide data source selection
1771
- * @example
1772
- * ```js
1773
- * const embed = new ConversationEmbed('#tsEmbed', {
1774
- * ... // other options
1775
- * hideSourceSelection : true,
1776
- * })
1777
- * ```
1778
- * @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
1779
- */
1780
- hideSourceSelection?: boolean;
1781
- /**
1782
- * Flag to control Data panel experience
1783
- * @default false
1784
- * @version SDK: 1.36.0 | ThoughtSpot Cloud: 10.4.0.cl
1785
- * @example
1786
- * ```js
1787
- * const embed = new AppEmbed('#tsEmbed', {
1788
- * ... // other options
1789
- * dataPanelV2: true,
1790
- * })
1791
- * ```
1792
- */
1793
- dataPanelV2?: boolean;
1794
- /**
1795
- * showSpotterLimitations : show limitation text
1796
- * of the spotter underneath the chat input.
1797
- * default is false.
1798
- * @example
1799
- * ```js
1800
- * const embed = new ConversationEmbed('#tsEmbed', {
1801
- * ... // other options
1802
- * showSpotterLimitations : true,
1803
- * })
1804
- * ```
1805
- * @version SDK: 1.36.0 | Thoughtspot: 10.5.0.cl
1806
- */
1807
- showSpotterLimitations?: boolean;
1808
- /**
1809
- * hideSampleQuestions : Hide sample questions on
1810
- * the initial screen of the conversation.
1811
- * @example
1812
- * ```js
1813
- * const embed = new ConversationEmbed('#tsEmbed', {
1814
- * ... // other options
1815
- * hideSampleQuestions : true,
1816
- * })
1817
- * ```
1818
- * @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
1819
- */
1820
- hideSampleQuestions?: boolean;
1821
- }
1822
- /**
1823
- * Embed ThoughtSpot AI Conversation.
1824
- * @group Embed components
1825
- * @example
1826
- * ```js
1827
- * const conversation = new ConversationEmbed('#tsEmbed', {
1828
- * worksheetId: 'worksheetId',
1829
- * searchOptions: {
1830
- * searchQuery: 'searchQuery',
1831
- * },
1832
- * });
1833
- * conversation.render();
1834
- * ```
1835
- * @version SDK: 1.33.1 | ThoughtSpot: 10.5.0.cl
1836
- */
1837
- export declare class ConversationEmbed extends TsEmbed {
1838
- protected viewConfig: ConversationViewConfig;
1839
- constructor(container: HTMLElement, viewConfig: ConversationViewConfig);
1840
- getIframeSrc(): string;
1841
- render(): Promise<ConversationEmbed>;
1842
- }
1843
-
1844
- /**
1845
- * Copyright (c) 2023
1846
- *
1847
- * ThoughtSpot Visual Embed SDK for embedding ThoughtSpot analytics
1848
- * in other web applications.
1849
- * @summary ThoughtSpot Visual Embed SDK
1850
- * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
1851
- */
1852
- export { init, logout, prefetch, executeTML, exportTML, executeTMLInput, exportTMLInput, getEmbedConfig as getInitConfig, getSessionInfo, tokenizedFetch, getAnswerFromQuery, createLiveboardWithAnswers, SearchEmbed, SearchBarEmbed, PinboardEmbed, LiveboardEmbed, SageEmbed, AppEmbed, BodylessConversation, BodylessConversationViewConfig, ConversationEmbed, ConversationViewConfig, AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter, AnswerService, SessionInterface, UnderlyingDataPoint, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, ContextMenuTriggerOptions, EmbedConfig, SearchViewConfig, SearchBarViewConfig, LiveboardViewConfig, SageViewConfig, AppViewConfig, PrefetchFeatures, FrameParams, HomeLeftNavItem, HomepageModule, DOMSelector, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, CustomCssVariables, RuntimeParameter, LogLevel, uploadMixpanelEvent, MIXPANEL_EVENT, HomePageSearchBarMode, VizPoint, CustomActionPayload, UIPassthroughEvent, };
1853
-
1854
- /**
1855
- * Copyright (c) 2023
1856
- *
1857
- * TypeScript type definitions for ThoughtSpot Visual Embed SDK
1858
- * @summary Type definitions for Embed SDK
1859
- * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
1860
- */
1861
- /**
1862
- * The authentication mechanism for allowing access to the
1863
- * the embedded app
1864
- * @group Authentication / Init
1865
- */
1866
- export declare enum AuthType {
1867
- /**
1868
- * No authentication on the SDK. Pass-through to the embedded App. Alias for
1869
- * `Passthrough`.
1870
- * @example
1871
- * ```js
1872
- * init({
1873
- * // ...
1874
- * authType: AuthType.None,
1875
- * });
1876
- * ```
1877
- */
1878
- None = "None",
1946
+ None = "None",
1879
1947
  /**
1880
1948
  * Passthrough SSO to the embedded application within the iframe. Requires least
1881
1949
  * configuration, but may not be supported by all IDPs. This will behave like `None`
@@ -2061,9 +2129,9 @@ export type DOMSelector = string | HTMLElement;
2061
2129
  export interface customCssInterface {
2062
2130
  /**
2063
2131
  * The custom css variables, which can be set.
2064
- * The allowed list is in the CustomCssVariables
2132
+ * The variables are available in the {@link CustomCssVariables}
2065
2133
  * interface. For more information, see
2066
- * link:https://developers.thoughtspot.com/docs/css-variables-reference
2134
+ * link:https://developers.thoughtspot.com/docs/css-variables-reference[CSS variable reference].
2067
2135
  */
2068
2136
  variables?: CustomCssVariables;
2069
2137
  /**
@@ -2590,7 +2658,7 @@ export interface ViewConfig {
2590
2658
  */
2591
2659
  showAlerts?: boolean;
2592
2660
  /**
2593
- * The list of runtime filters to apply to a search answer,
2661
+ * The list of runtime filters to apply to a search Answer,
2594
2662
  * visualization, or Liveboard.
2595
2663
  * @version SDK: 1.9.4 | ThoughtSpot 8.1.0.cl, 8.4.1.sw
2596
2664
  * @example
@@ -2609,7 +2677,7 @@ export interface ViewConfig {
2609
2677
  */
2610
2678
  runtimeFilters?: RuntimeFilter[];
2611
2679
  /**
2612
- * The list of parameter override to apply to a search answer,
2680
+ * The list of parameter override to apply to a search Answer,
2613
2681
  * visualization, or Liveboard.
2614
2682
  * @version SDK : 1.25.0 | ThoughtSpot: 9.2.0.cl, 9.5.0.sw
2615
2683
  * @example
@@ -2627,7 +2695,7 @@ export interface ViewConfig {
2627
2695
  */
2628
2696
  runtimeParameters?: RuntimeParameter[];
2629
2697
  /**
2630
- * The locale/language to use for the embedded view.
2698
+ * The locale settings to apply to the embedded view.
2631
2699
  * @version SDK: 1.9.4 | ThoughtSpot 8.1.0.cl, 8.4.1.sw
2632
2700
  * @example
2633
2701
  * ```js
@@ -2694,7 +2762,7 @@ export interface ViewConfig {
2694
2762
  */
2695
2763
  contextMenuTrigger?: ContextMenuTriggerOptions;
2696
2764
  /**
2697
- * Flag to override openNew tab context menu link
2765
+ * Flag to override the *Open Link in New Tab* context menu option.
2698
2766
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
2699
2767
  * @example
2700
2768
  * ```js
@@ -2833,7 +2901,7 @@ export interface ViewConfig {
2833
2901
  */
2834
2902
  preRenderId?: string;
2835
2903
  /**
2836
- * Determines whether the PreRender component should not dynamically track the size
2904
+ * Determines if the PreRender component should dynamically track the size
2837
2905
  * of its embedding element and adjust its own size accordingly.
2838
2906
  * Enabling this option allows the PreRender component to automatically adapt
2839
2907
  * its dimensions based on changes to the size of the embedding element.
@@ -3205,8 +3273,8 @@ export declare enum EmbedEvent {
3205
3273
  */
3206
3274
  Load = "load",
3207
3275
  /**
3208
- * Data pertaining to answer or Liveboard is received
3209
- * @return data - The answer or Liveboard data
3276
+ * Data pertaining to an Answer or Liveboard is received
3277
+ * @return data - The Answer or Liveboard data
3210
3278
  * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
3211
3279
  * @example
3212
3280
  *```js
@@ -3380,7 +3448,7 @@ export declare enum EmbedEvent {
3380
3448
  */
3381
3449
  Alert = "alert",
3382
3450
  /**
3383
- * The ThoughtSpot auth session has expired.
3451
+ * The ThoughtSpot authentication session has expired.
3384
3452
  * @version SDK: 1.4.0 | ThoughtSpot: ts7.sep.cl, 8.4.1.sw
3385
3453
  * @example
3386
3454
  *```js
@@ -3450,7 +3518,7 @@ export declare enum EmbedEvent {
3450
3518
  /**
3451
3519
  * Emitted when the embed does not have cookie access. This happens
3452
3520
  * when Safari and other Web browsers block third-party cookies
3453
- * are blocked by default. `NoCookieAccess` can trigger
3521
+ * are blocked by default. `NoCookieAccess` can trigger.
3454
3522
  * @example
3455
3523
  *```js
3456
3524
  * appEmbed.on(EmbedEvent.NoCookieAccess)
@@ -3538,7 +3606,7 @@ export declare enum EmbedEvent {
3538
3606
  */
3539
3607
  Save = "save",
3540
3608
  /**
3541
- * Emitted when the download action is triggered on an answer
3609
+ * Emitted when the download action is triggered on an Answer.
3542
3610
  *
3543
3611
  * **Note**: This event is deprecated in v1.21.0.
3544
3612
  * To fire an event when a download action is initiated on a chart or table,
@@ -3554,7 +3622,7 @@ export declare enum EmbedEvent {
3554
3622
  */
3555
3623
  Download = "download",
3556
3624
  /**
3557
- * Emitted when the download action is triggered on an answer
3625
+ * Emitted when the download action is triggered on an Answer.
3558
3626
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.0.sw
3559
3627
  * @example
3560
3628
  *```js
@@ -3568,7 +3636,7 @@ export declare enum EmbedEvent {
3568
3636
  */
3569
3637
  DownloadAsPng = "downloadAsPng",
3570
3638
  /**
3571
- * Emitted when the Download as PDF action is triggered on an answer
3639
+ * Emitted when the Download as PDF action is triggered on an Answer
3572
3640
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
3573
3641
  * @example
3574
3642
  *```js
@@ -3582,7 +3650,7 @@ export declare enum EmbedEvent {
3582
3650
  */
3583
3651
  DownloadAsPdf = "downloadAsPdf",
3584
3652
  /**
3585
- * Emitted when the Download as CSV action is triggered on an answer
3653
+ * Emitted when the Download as CSV action is triggered on an Answer.
3586
3654
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
3587
3655
  * @example
3588
3656
  *```js
@@ -3596,7 +3664,7 @@ export declare enum EmbedEvent {
3596
3664
  */
3597
3665
  DownloadAsCsv = "downloadAsCsv",
3598
3666
  /**
3599
- * Emitted when the Download as XLSX action is triggered on an answer
3667
+ * Emitted when the Download as XLSX action is triggered on an Answer.
3600
3668
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
3601
3669
  * @example
3602
3670
  *```js
@@ -3624,7 +3692,8 @@ export declare enum EmbedEvent {
3624
3692
  */
3625
3693
  AnswerDelete = "answerDelete",
3626
3694
  /**
3627
- * Emitted when an answer is pinned to a Liveboard
3695
+ * Emitted when a user initiates the Pin action to
3696
+ * add an Answer to a Liveboard.
3628
3697
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
3629
3698
  * @example
3630
3699
  *```js
@@ -3762,7 +3831,7 @@ export declare enum EmbedEvent {
3762
3831
  */
3763
3832
  SaveAsView = "saveAsView",
3764
3833
  /**
3765
- * Emitted when the user creates a copy of an Answer
3834
+ * Emitted when the user creates a copy of an Answer.
3766
3835
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
3767
3836
  * @example
3768
3837
  *```js
@@ -3776,7 +3845,7 @@ export declare enum EmbedEvent {
3776
3845
  */
3777
3846
  CopyAEdit = "copyAEdit",
3778
3847
  /**
3779
- * Emitted when a user clicks Show underlying data on an Answer
3848
+ * Emitted when a user clicks *Show underlying data* on an Answer.
3780
3849
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
3781
3850
  * @example
3782
3851
  *```js
@@ -3787,7 +3856,7 @@ export declare enum EmbedEvent {
3787
3856
  */
3788
3857
  ShowUnderlyingData = "showUnderlyingData",
3789
3858
  /**
3790
- * Emitted when an answer is switched to a chart or table view.
3859
+ * Emitted when an Answer is switched to a chart or table view.
3791
3860
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
3792
3861
  * @example
3793
3862
  *```js
@@ -3921,11 +3990,12 @@ export declare enum EmbedEvent {
3921
3990
  */
3922
3991
  CopyLink = "embedDocument",
3923
3992
  /**
3924
- * Emitted when a user interacts with cross filters on a visualization or Liveboard
3993
+ * Emitted when a user interacts with cross filters on a
3994
+ * visualization or Liveboard.
3925
3995
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.0.sw
3926
3996
  * @example
3927
3997
  *```js
3928
- * liveboardEmbed.trigger(HostEvent.CrossFilterChanged, {
3998
+ * liveboardEmbed.on(EmbedEvent.CrossFilterChanged, {
3929
3999
  * vizId: '730496d6-6903-4601-937e-2c691821af3c'})
3930
4000
  *```
3931
4001
  */
@@ -4019,8 +4089,8 @@ export declare enum EmbedEvent {
4019
4089
  */
4020
4090
  DeletePersonalisedView = "deletePersonalisedView",
4021
4091
  /**
4022
- * Emitted when a user creates a new worksheet
4023
- * @version SDK : 1.27.0 | ThoughtSpot Cloud: 9.8.0.cl
4092
+ * Emitted when a user creates a Worksheet.
4093
+ * @version SDK : 1.27.0 | ThoughtSpot: 9.8.0.cl, 9.8.0.sw
4024
4094
  */
4025
4095
  CreateWorksheet = "createWorksheet",
4026
4096
  /**
@@ -4033,8 +4103,8 @@ export declare enum EmbedEvent {
4033
4103
  */
4034
4104
  AskSageInit = "AskSageInit",
4035
4105
  /**
4036
- * Emitted when a LB/viz is renamed
4037
- * @version SDK : 1.28.0 | ThoughtSpot: 9.10.5.cl
4106
+ * Emitted when a Liveboard or visualization is renamed.
4107
+ * @version SDK : 1.28.0 | ThoughtSpot: 9.10.5.cl, 10.1.0.sw
4038
4108
  */
4039
4109
  Rename = "rename",
4040
4110
  /**
@@ -4098,8 +4168,7 @@ export declare enum EmbedEvent {
4098
4168
  OnBeforeGetVizDataIntercept = "onBeforeGetVizDataIntercept",
4099
4169
  /**
4100
4170
  * Emitted when parameter changes in an Answer
4101
- * or Liveboard
4102
- *
4171
+ * or Liveboard.
4103
4172
  * ```js
4104
4173
  * liveboardEmbed.on(EmbedEvent.ParameterChanged, (payload) => {
4105
4174
  * console.log('payload', payload);
@@ -4126,7 +4195,7 @@ export declare enum EmbedEvent {
4126
4195
  */
4127
4196
  TableVizRendered = "TableVizRendered",
4128
4197
  /**
4129
- * Emitted when the liveboard is created from pin modal or liveboard list page.
4198
+ * Emitted when the liveboard is created from pin modal or Liveboard list page.
4130
4199
  * You can use this event as a hook to trigger
4131
4200
  * other events on liveboard creation.
4132
4201
  *
@@ -4269,7 +4338,7 @@ export declare enum HostEvent {
4269
4338
  */
4270
4339
  Filter = "filter",
4271
4340
  /**
4272
- * Reload the answer or visualization
4341
+ * Reload the Answer or visualization
4273
4342
  * @hidden
4274
4343
  */
4275
4344
  Reload = "reload",
@@ -4319,12 +4388,10 @@ export declare enum HostEvent {
4319
4388
  * and `AppEmbed` only. In full application embedding, this event updates
4320
4389
  * the runtime filters applied on the Liveboard and saved Answer objects.
4321
4390
  *
4322
- *
4323
- * Pass an array of runtime filters with the following attributes:
4324
- *
4391
+ * @param - Pass an array of {@link RuntimeFilter} with the following attributes:
4325
4392
  * `columnName` - _String_. The name of the column to filter on.
4326
4393
  *
4327
- * `operator` - Runtime filter operator to apply. For more information,
4394
+ * `operator` - {@link RuntimeFilterOp} to apply. For more information,
4328
4395
  * see link:https://developers.thoughtspot.com/docs/?pageid=runtime-filters#rtOperator[Developer Documentation].
4329
4396
  *
4330
4397
  * `values` - List of operands. Some operators such as EQ and LE allow a
@@ -4336,7 +4403,7 @@ export declare enum HostEvent {
4336
4403
  * will be cleared, restoring the original visualization
4337
4404
  * with the updated filters.
4338
4405
  *
4339
- * @param - {@link RuntimeFilter}[] an array of {@link RuntimeFilter} Types.
4406
+
4340
4407
  * @example
4341
4408
  * ```js
4342
4409
  * liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
@@ -4575,6 +4642,11 @@ export declare enum HostEvent {
4575
4642
  * appEmbed.trigger(HostEvent.Remove)
4576
4643
  * ```
4577
4644
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
4645
+ * * @example
4646
+ * ```js
4647
+ * liveboardEmbed.trigger(HostEvent.Remove)
4648
+ * ```
4649
+ * @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl, 10.10.0.sw
4578
4650
  */
4579
4651
  Remove = "delete",
4580
4652
  /**
@@ -4985,7 +5057,7 @@ export declare enum HostEvent {
4985
5057
  * ```js
4986
5058
  * liveboardEmbed.trigger(HostEvent.GetTabs).then((tabDetails) => {
4987
5059
  * console.log(
4988
- * tabDetails // TabDetails of current LB
5060
+ * tabDetails // TabDetails of current Liveboard
4989
5061
  * );
4990
5062
  * })
4991
5063
  * ```
@@ -5033,7 +5105,7 @@ export declare enum HostEvent {
5033
5105
  */
5034
5106
  UpdateSageQuery = "updateSageQuery",
5035
5107
  /**
5036
- * Get the answer session for a Search or
5108
+ * Get the Answer session for a Search or
5037
5109
  * Liveboard visualization.
5038
5110
  * @example
5039
5111
  * ```js
@@ -5208,6 +5280,7 @@ export declare enum Param {
5208
5280
  HostAppUrl = "hostAppUrl",
5209
5281
  EnableVizTransformations = "enableVizTransform",
5210
5282
  EnableSearchAssist = "enableSearchAssist",
5283
+ EnablePendoHelp = "enablePendoHelp",
5211
5284
  HideResult = "hideResult",
5212
5285
  UseLastSelectedDataSource = "useLastSelectedSources",
5213
5286
  Tag = "tag",
@@ -5432,9 +5505,10 @@ export declare enum Action {
5432
5505
  */
5433
5506
  AddDataPanelObjects = "addDataPanelObjects",
5434
5507
  /**
5435
- * Filter configuration options on a Liveboard page.
5436
- * Allows configuring filters on a
5437
- * Liveboard.
5508
+ * The filter configuration options for a Liveboard.
5509
+ * The configuration options are available when adding
5510
+ * filters on a Liveboard.
5511
+ *
5438
5512
  * @example
5439
5513
  * ```js
5440
5514
  * disabledActions: [Action.ConfigureFilter]
@@ -5532,14 +5606,17 @@ export declare enum Action {
5532
5606
  * @hidden
5533
5607
  */
5534
5608
  SpotIQFollow = "spotIQFollow",
5609
+ /**
5610
+ * The Share action for a Liveboard visualization.
5611
+ */
5535
5612
  ShareViz = "shareViz",
5536
5613
  /**
5537
5614
  * @hidden
5538
5615
  */
5539
5616
  ReplaySearch = "replaySearch",
5540
5617
  /**
5541
- * The **Show underlying data** menu action on a visualization or
5542
- * Answer page.
5618
+ * The **Show underlying data** menu action on a
5619
+ * visualization or Answer page.
5543
5620
  * Displays detailed information and raw data
5544
5621
  * for a given visualization.
5545
5622
  * @example
@@ -5549,8 +5626,8 @@ export declare enum Action {
5549
5626
  */
5550
5627
  ShowUnderlyingData = "showUnderlyingData",
5551
5628
  /**
5552
- * The **Download** menu action on Liveboard visualizations
5553
- * and Answers.
5629
+ * The **Download** menu action on Liveboard
5630
+ * visualizations and Answers.
5554
5631
  * Allows downloading a visualization or Answer.
5555
5632
  * @example
5556
5633
  * ```js
@@ -5571,11 +5648,10 @@ export declare enum Action {
5571
5648
  /**
5572
5649
  *
5573
5650
  *The **Download PDF** action that downloads a Liveboard,
5574
- *visualization, or Answer as a PDF file.
5575
- *
5651
+ * visualization, or Answer as a PDF file.
5576
5652
  *
5577
- ***NOTE**: The **Download** > **PDF** action is available on
5578
- *visualizations and Answers if the data is in tabular format.
5653
+ * **NOTE**: The **Download** > **PDF** option is available for
5654
+ * tables in visualizations and Answers.
5579
5655
  * @example
5580
5656
  * ```js
5581
5657
  * disabledActions: [Action.DownloadAsPdf]
@@ -5607,9 +5683,11 @@ export declare enum Action {
5607
5683
  */
5608
5684
  DownloadTrace = "downloadTrace",
5609
5685
  /**
5610
- * The **Export TML** menu action on Liveboard, Answers
5611
- * Worksheets and Data Connections page.
5612
- * Exports an object as a TML file.
5686
+ * The **Export TML** menu action on a Liveboard, Answer, and
5687
+ * the Data Workspace pages for data objects and connections.
5688
+ *
5689
+ * Allows exporting an object as a TML file.
5690
+ *
5613
5691
  * @example
5614
5692
  * ```js
5615
5693
  * disabledActions: [Action.ExportTML]
@@ -5617,7 +5695,8 @@ export declare enum Action {
5617
5695
  */
5618
5696
  ExportTML = "exportTSL",
5619
5697
  /**
5620
- * The **Import TML** menu action for Liveboards and Answers.
5698
+ * The **Import TML** menu action on the
5699
+ * *Data Workspace* > *Utilities* page.
5621
5700
  * Imports TML representation of ThoughtSpot objects.
5622
5701
  * @example
5623
5702
  * ```js
@@ -5627,7 +5706,7 @@ export declare enum Action {
5627
5706
  ImportTML = "importTSL",
5628
5707
  /**
5629
5708
  * The **Update TML** menu action for Liveboards and Answers.
5630
- * Update TML representation of ThoughtSpot objects.
5709
+ * Updates TML representation of ThoughtSpot objects.
5631
5710
  * @example
5632
5711
  * ```js
5633
5712
  * disabledActions: [Action.UpdateTML]
@@ -5654,8 +5733,11 @@ export declare enum Action {
5654
5733
  */
5655
5734
  Present = "present",
5656
5735
  /**
5657
- * The tile resize options in the visualization menu.
5658
- * Allows switching between different preset layouts.
5736
+ * The visualization tile resize option.
5737
+ * Also available via More `...` options menu on a visualization.
5738
+ * Allows resizing visualization tiles and switching
5739
+ * between different preset layout option.
5740
+ *
5659
5741
  * @example
5660
5742
  * ```js
5661
5743
  * disabledActions: [Action.ToggleSize]
@@ -5681,8 +5763,9 @@ export declare enum Action {
5681
5763
  */
5682
5764
  EditTitle = "editTitle",
5683
5765
  /**
5684
- * The **Delete** menu action on Liveboards and visualizations.
5685
- * Deletes a Liveboard or a visualization from a Liveboard.
5766
+ * The **Delete** action on a Liveboard, *Liveboards* and
5767
+ * *Answers* list pages in full application embedding.
5768
+ *
5686
5769
  * @example
5687
5770
  * ```js
5688
5771
  * disabledActions: [Action.Remove]
@@ -5759,8 +5842,9 @@ export declare enum Action {
5759
5842
  */
5760
5843
  Explore = "explore",
5761
5844
  /**
5762
- * The action to include data points on a drilled-down Answer
5763
- * or visualization
5845
+ * The contextual menu action to include a specific data point
5846
+ * when drilling down a table or chart on an Answer.
5847
+ *
5764
5848
  * @example
5765
5849
  * ```js
5766
5850
  * disabledActions: [Action.DrillInclude]
@@ -5768,8 +5852,8 @@ export declare enum Action {
5768
5852
  */
5769
5853
  DrillInclude = "context-menu-item-include",
5770
5854
  /**
5771
- * The action to exclude data points on a drilled-down Answer
5772
- * or visualization
5855
+ * The contextual menu action to exclude a specific data point
5856
+ * when drilling down a table or chart on an Answer.
5773
5857
  * @example
5774
5858
  * ```js
5775
5859
  * disabledActions: [Action.DrillInclude]
@@ -5916,7 +6000,7 @@ export declare enum Action {
5916
6000
  * Allows users to manage data sync pipelines to third-party apps.
5917
6001
  * @example
5918
6002
  * ```js
5919
- * disabledActions: [Action.SyncToOtherApps]
6003
+ * disabledActions: [Action.ManagePipelines]
5920
6004
  * ```
5921
6005
  * @version SDK: 1.18.0| ThoughtSpot: 8.10.0.cl, 9.0.1.sw
5922
6006
  */
@@ -6235,7 +6319,7 @@ export declare enum Action {
6235
6319
  /**
6236
6320
  * Action ID for the Parent TML action
6237
6321
  * The parent action **TML** must be included to access TML-related options
6238
- * within the cascading menu (specific to the answer page)
6322
+ * within the cascading menu (specific to the Answer page)
6239
6323
  * @example
6240
6324
  * ```js
6241
6325
  * // to include specific TML actions
@@ -6274,8 +6358,10 @@ export declare enum Action {
6274
6358
  */
6275
6359
  VerifiedLiveboard = "verifiedLiveboard",
6276
6360
  /**
6277
- * The *Ask Sage* action for Answers and visualizations.
6278
- * Allows initiating a Natural Language Search query.
6361
+ * Action ID for the *Ask Sage* In Natural Language Search embed,
6362
+ * *Spotter* in Liveboard, full app, and Spotter embed.
6363
+ *
6364
+ * Allows initiating a conversation with ThoughtSpot AI analyst.
6279
6365
  *
6280
6366
  * @example
6281
6367
  * ```js
@@ -6471,7 +6557,8 @@ export declare enum Action {
6471
6557
  */
6472
6558
  DeletePreviousPrompt = "deletePreviousPrompt",
6473
6559
  /**
6474
- * Action ID for hide/disable edit of tokens on spotter results.
6560
+ * Action ID for hide or disable editing tokens generated from
6561
+ * Spotter results.
6475
6562
  * @example
6476
6563
  * ```js
6477
6564
  * hiddenAction: [Action.EditTokens]
@@ -6634,69 +6721,208 @@ export interface DefaultAppInitData {
6634
6721
  customVariablesForThirdPartyTools: Record<string, any>;
6635
6722
  }
6636
6723
 
6724
+ export type EmbedEventHandlers = {
6725
+ [key in keyof typeof EmbedEvent as `on${Capitalize<key>}`]?: MessageCallback;
6726
+ };
6727
+ export interface EmbedProps extends ViewConfig, EmbedEventHandlers {
6728
+ className?: string;
6729
+ }
6730
+ export interface ViewConfigAndListeners<T extends ViewConfig> {
6731
+ viewConfig: T;
6732
+ listeners: {
6733
+ [key in EmbedEvent]?: MessageCallback;
6734
+ };
6735
+ }
6637
6736
  /**
6638
- * Copyright (c) 2022
6639
- *
6640
- * Base classes
6641
- * @summary Base classes
6642
- * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
6643
- */
6644
- /**
6645
- * Global prefix for all Thoughtspot postHash Params.
6646
- */
6647
- export declare const THOUGHTSPOT_PARAM_PREFIX = "ts-";
6737
+ *
6738
+ * @param props
6739
+ */
6740
+ export function getViewPropsAndListeners<T extends EmbedProps, U extends ViewConfig>(props: T): ViewConfigAndListeners<U>;
6741
+
6648
6742
  /**
6649
- * Base class for embedding v2 experience
6650
- * Note: the v2 version of ThoughtSpot Blink is built on the new stack:
6651
- * React+GraphQL
6743
+ * Configuration for search options
6652
6744
  */
6653
- export declare class TsEmbed {
6745
+ export interface SearchOptions {
6654
6746
  /**
6655
- * The DOM node which was inserted by the SDK to either
6656
- * render the iframe or display an error message.
6657
- * This is useful for removing the DOM node when the
6658
- * embed instance is destroyed.
6747
+ * The query string to pass to start the Conversation.
6659
6748
  */
6660
- protected insertedDomEl: Node;
6749
+ searchQuery: string;
6750
+ }
6751
+ /**
6752
+ * The configuration for the embedded conversationEmbed options.
6753
+ * @group Embed components
6754
+ */
6755
+ export interface ConversationViewConfig extends ViewConfig {
6661
6756
  /**
6662
- * The DOM node where the ThoughtSpot app is to be embedded.
6757
+ * The ID of the worksheet to use for the conversation.
6663
6758
  */
6664
- protected el: HTMLElement;
6759
+ worksheetId: string;
6665
6760
  /**
6666
- * The key to store the embed instance in the DOM node
6761
+ * Ability to pass a starting search query to the conversation.
6667
6762
  */
6668
- protected embedNodeKey: string;
6669
- protected isAppInitialized: boolean;
6763
+ searchOptions?: SearchOptions;
6670
6764
  /**
6671
- * A reference to the iframe within which the ThoughtSpot app
6672
- * will be rendered.
6765
+ * disableSourceSelection : Disables data source selection
6766
+ * but still display the selected data source.
6767
+ * @example
6768
+ * ```js
6769
+ * const embed = new ConversationEmbed('#tsEmbed', {
6770
+ * ... // other options
6771
+ * disableSourceSelection : true,
6772
+ * })
6773
+ * ```
6774
+ * @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
6673
6775
  */
6674
- protected iFrame: HTMLIFrameElement;
6776
+ disableSourceSelection?: boolean;
6675
6777
  /**
6676
- * Setter for the iframe element
6677
- * @param {HTMLIFrameElement} iFrame HTMLIFrameElement
6778
+ * hideSourceSelection : Hide data source selection
6779
+ * @example
6780
+ * ```js
6781
+ * const embed = new ConversationEmbed('#tsEmbed', {
6782
+ * ... // other options
6783
+ * hideSourceSelection : true,
6784
+ * })
6785
+ * ```
6786
+ * @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
6678
6787
  */
6679
- protected setIframeElement(iFrame: HTMLIFrameElement): void;
6680
- protected viewConfig: ViewConfig;
6681
- protected embedConfig: EmbedConfig;
6788
+ hideSourceSelection?: boolean;
6682
6789
  /**
6683
- * The ThoughtSpot hostname or IP address
6790
+ * Flag to control Data panel experience
6791
+ * @default false
6792
+ * @version SDK: 1.36.0 | ThoughtSpot Cloud: 10.4.0.cl
6793
+ * @example
6794
+ * ```js
6795
+ * const embed = new AppEmbed('#tsEmbed', {
6796
+ * ... // other options
6797
+ * dataPanelV2: true,
6798
+ * })
6799
+ * ```
6684
6800
  */
6685
- protected thoughtSpotHost: string;
6686
- protected thoughtSpotV2Base: string;
6801
+ dataPanelV2?: boolean;
6687
6802
  /**
6688
- * A flag that is set to true post render.
6803
+ * showSpotterLimitations : show limitation text
6804
+ * of the spotter underneath the chat input.
6805
+ * default is false.
6806
+ * @example
6807
+ * ```js
6808
+ * const embed = new ConversationEmbed('#tsEmbed', {
6809
+ * ... // other options
6810
+ * showSpotterLimitations : true,
6811
+ * })
6812
+ * ```
6813
+ * @version SDK: 1.36.0 | Thoughtspot: 10.5.0.cl
6689
6814
  */
6690
- protected isRendered: boolean;
6691
- protected hostEventClient: HostEventClient;
6692
- constructor(domSelector: DOMSelector, viewConfig?: ViewConfig);
6815
+ showSpotterLimitations?: boolean;
6693
6816
  /**
6694
- * Handles errors within the SDK
6695
- * @param error The error message or object
6817
+ * hideSampleQuestions : Hide sample questions on
6818
+ * the initial screen of the conversation.
6819
+ * @example
6820
+ * ```js
6821
+ * const embed = new ConversationEmbed('#tsEmbed', {
6822
+ * ... // other options
6823
+ * hideSampleQuestions : true,
6824
+ * })
6825
+ * ```
6826
+ * @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
6696
6827
  */
6697
- protected handleError(error: string | Record<string, unknown>): void;
6698
- protected getAuthTokenForCookielessInit(): Promise<string>;
6699
- protected getDefaultAppInitData(): Promise<DefaultAppInitData>;
6828
+ hideSampleQuestions?: boolean;
6829
+ }
6830
+ /**
6831
+ * Embed ThoughtSpot AI Conversation.
6832
+ * @group Embed components
6833
+ * @example
6834
+ * ```js
6835
+ * const conversation = new ConversationEmbed('#tsEmbed', {
6836
+ * worksheetId: 'worksheetId',
6837
+ * searchOptions: {
6838
+ * searchQuery: 'searchQuery',
6839
+ * },
6840
+ * });
6841
+ * conversation.render();
6842
+ * ```
6843
+ * @version SDK: 1.33.1 | ThoughtSpot: 10.5.0.cl
6844
+ */
6845
+ export declare class ConversationEmbed extends TsEmbed {
6846
+ protected viewConfig: ConversationViewConfig;
6847
+ constructor(container: HTMLElement, viewConfig: ConversationViewConfig);
6848
+ getIframeSrc(): string;
6849
+ render(): Promise<ConversationEmbed>;
6850
+ }
6851
+
6852
+ /**
6853
+ * Copyright (c) 2023
6854
+ *
6855
+ * ThoughtSpot Visual Embed SDK for embedding ThoughtSpot analytics
6856
+ * in other web applications.
6857
+ * @summary ThoughtSpot Visual Embed SDK
6858
+ * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
6859
+ */
6860
+ export { init, logout, prefetch, executeTML, exportTML, executeTMLInput, exportTMLInput, getEmbedConfig as getInitConfig, getSessionInfo, tokenizedFetch, getAnswerFromQuery, createLiveboardWithAnswers, SearchEmbed, SearchBarEmbed, PinboardEmbed, LiveboardEmbed, SageEmbed, AppEmbed, BodylessConversation, BodylessConversationViewConfig, ConversationEmbed, ConversationViewConfig, AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter, AnswerService, SessionInterface, UnderlyingDataPoint, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, ContextMenuTriggerOptions, EmbedConfig, SearchViewConfig, SearchBarViewConfig, LiveboardViewConfig, SageViewConfig, AppViewConfig, PrefetchFeatures, FrameParams, HomeLeftNavItem, HomepageModule, DOMSelector, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, CustomCssVariables, RuntimeParameter, LogLevel, uploadMixpanelEvent, MIXPANEL_EVENT, HomePageSearchBarMode, VizPoint, CustomActionPayload, UIPassthroughEvent, };
6861
+
6862
+ /**
6863
+ * Copyright (c) 2022
6864
+ *
6865
+ * Base classes
6866
+ * @summary Base classes
6867
+ * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
6868
+ */
6869
+ /**
6870
+ * Global prefix for all Thoughtspot postHash Params.
6871
+ */
6872
+ export declare const THOUGHTSPOT_PARAM_PREFIX = "ts-";
6873
+ /**
6874
+ * Base class for embedding v2 experience
6875
+ * Note: the v2 version of ThoughtSpot Blink is built on the new stack:
6876
+ * React+GraphQL
6877
+ */
6878
+ export declare class TsEmbed {
6879
+ /**
6880
+ * The DOM node which was inserted by the SDK to either
6881
+ * render the iframe or display an error message.
6882
+ * This is useful for removing the DOM node when the
6883
+ * embed instance is destroyed.
6884
+ */
6885
+ protected insertedDomEl: Node;
6886
+ /**
6887
+ * The DOM node where the ThoughtSpot app is to be embedded.
6888
+ */
6889
+ protected el: HTMLElement;
6890
+ /**
6891
+ * The key to store the embed instance in the DOM node
6892
+ */
6893
+ protected embedNodeKey: string;
6894
+ protected isAppInitialized: boolean;
6895
+ /**
6896
+ * A reference to the iframe within which the ThoughtSpot app
6897
+ * will be rendered.
6898
+ */
6899
+ protected iFrame: HTMLIFrameElement;
6900
+ /**
6901
+ * Setter for the iframe element
6902
+ * @param {HTMLIFrameElement} iFrame HTMLIFrameElement
6903
+ */
6904
+ protected setIframeElement(iFrame: HTMLIFrameElement): void;
6905
+ protected viewConfig: ViewConfig;
6906
+ protected embedConfig: EmbedConfig;
6907
+ /**
6908
+ * The ThoughtSpot hostname or IP address
6909
+ */
6910
+ protected thoughtSpotHost: string;
6911
+ protected thoughtSpotV2Base: string;
6912
+ /**
6913
+ * A flag that is set to true post render.
6914
+ */
6915
+ protected isRendered: boolean;
6916
+ protected hostEventClient: HostEventClient;
6917
+ protected isReadyForRenderPromise: Promise<void>;
6918
+ constructor(domSelector: DOMSelector, viewConfig?: ViewConfig);
6919
+ /**
6920
+ * Handles errors within the SDK
6921
+ * @param error The error message or object
6922
+ */
6923
+ protected handleError(error: string | Record<string, unknown>): void;
6924
+ protected getAuthTokenForCookielessInit(): Promise<string>;
6925
+ protected getDefaultAppInitData(): Promise<DefaultAppInitData>;
6700
6926
  protected getAppInitData(): Promise<DefaultAppInitData>;
6701
6927
  /**
6702
6928
  * Constructs the base URL string to load the ThoughtSpot app.
@@ -6832,12 +7058,12 @@ export declare class TsEmbed {
6832
7058
  */
6833
7059
  render(): Promise<TsEmbed>;
6834
7060
  getIframeSrc(): string;
6835
- protected handleRenderForPrerender(): void;
7061
+ protected handleRenderForPrerender(): Promise<TsEmbed>;
6836
7062
  /**
6837
7063
  * Creates the preRender shell
6838
7064
  * @param showPreRenderByDefault - Show the preRender after render, hidden by default
6839
7065
  */
6840
- preRender(showPreRenderByDefault?: boolean): TsEmbed;
7066
+ preRender(showPreRenderByDefault?: boolean): Promise<TsEmbed>;
6841
7067
  /**
6842
7068
  * Get the Post Url Params for THOUGHTSPOT from the current
6843
7069
  * host app URL.
@@ -6868,7 +7094,7 @@ export declare class TsEmbed {
6868
7094
  * Also, synchronizes the style of the PreRender component with the embedding
6869
7095
  * element.
6870
7096
  */
6871
- showPreRender(): void;
7097
+ showPreRender(): Promise<TsEmbed>;
6872
7098
  /**
6873
7099
  * Synchronizes the style properties of the PreRender component with the embedding
6874
7100
  * element. This function adjusts the position, width, and height of the PreRender
@@ -7020,522 +7246,66 @@ export type HostEventResponse<HostEventT extends HostEvent> = HostEventT extends
7020
7246
  export type TriggerPayload<PayloadT, HostEventT extends HostEvent> = PayloadT | HostEventRequest<HostEventT>;
7021
7247
  export type TriggerResponse<PayloadT, HostEventT extends HostEvent> = PayloadT extends HostEventRequest<HostEventT> ? HostEventResponse<HostEventT> : any;
7022
7248
 
7023
- export interface executeTMLInput {
7024
- metadata_tmls: string[];
7025
- import_policy?: 'PARTIAL' | 'ALL_OR_NONE' | 'VALIDATE_ONLY';
7026
- create_new?: boolean;
7027
- }
7028
- export interface exportTMLInput {
7029
- metadata: {
7030
- identifier: string;
7031
- type?: 'LIVEBOARD' | 'ANSWER' | 'LOGICAL_TABLE' | 'CONNECTION';
7032
- }[];
7033
- export_associated?: boolean;
7034
- export_fqn?: boolean;
7035
- edoc_format?: 'YAML' | 'JSON';
7036
- }
7037
- export declare let authPromise: Promise<boolean>;
7038
- export declare const getAuthPromise: () => Promise<boolean>;
7039
- export { notifyAuthFailure, notifyAuthSDKSuccess, notifyAuthSuccess, notifyLogout, };
7040
- /**
7041
- * Perform authentication on the ThoughtSpot app as applicable.
7042
- */
7043
- export declare const handleAuth: () => Promise<boolean>;
7044
- /**
7045
- * Prefetches static resources from the specified URL. Web browsers can then cache the
7046
- * prefetched resources and serve them from the user's local disk to provide faster access
7047
- * to your app.
7048
- * @param url The URL provided for prefetch
7049
- * @param prefetchFeatures Specify features which needs to be prefetched.
7050
- * @param additionalFlags This can be used to add any URL flag.
7051
- * @version SDK: 1.4.0 | ThoughtSpot: ts7.sep.cl, 7.2.1
7052
- * @group Global methods
7053
- */
7054
- export declare const prefetch: (url?: string, prefetchFeatures?: PrefetchFeatures[], additionalFlags?: {
7055
- [key: string]: string | number | boolean;
7056
- }) => void;
7057
- /**
7058
- * Initializes the Visual Embed SDK globally and perform
7059
- * authentication if applicable. This function needs to be called before any ThoughtSpot
7060
- * component like Liveboard etc can be embedded. But need not wait for AuthEvent.SUCCESS
7061
- * to actually embed. That is handled internally.
7062
- * @param embedConfig The configuration object containing ThoughtSpot host,
7063
- * authentication mechanism and so on.
7064
- * @example
7065
- * ```js
7066
- * const authStatus = init({
7067
- * thoughtSpotHost: 'https://my.thoughtspot.cloud',
7068
- * authType: AuthType.None,
7069
- * });
7070
- * authStatus.on(AuthStatus.FAILURE, (reason) => { // do something here });
7071
- * ```
7072
- * @returns {@link AuthEventEmitter} event emitter which emits events on authentication success,
7073
- * failure and logout. See {@link AuthStatus}
7074
- * @version SDK: 1.0.0 | ThoughtSpot ts7.april.cl, 7.2.1
7075
- * @group Authentication / Init
7076
- */
7077
- export declare const init: (embedConfig: EmbedConfig) => AuthEventEmitter;
7078
- /**
7079
- *
7080
- */
7081
- export declare function disableAutoLogin(): void;
7082
- /**
7083
- * Logs out from ThoughtSpot. This also sets the autoLogin flag to false, to
7084
- * prevent the SDK from automatically logging in again.
7085
- *
7086
- * You can call the `init` method again to re login, if autoLogin is set to
7087
- * true in this second call it will be honored.
7088
- * @param doNotDisableAutoLogin This flag when passed will not disable autoLogin
7089
- * @returns Promise which resolves when logout completes.
7090
- * @version SDK: 1.10.1 | ThoughtSpot: 8.2.0.cl, 8.4.1-sw
7091
- * @group Global methods
7092
- */
7093
- export declare const logout: (doNotDisableAutoLogin?: boolean) => Promise<boolean>;
7094
- /**
7095
- * Renders functions in a queue, resolves to next function only after the callback next
7096
- * is called
7097
- * @param fn The function being registered
7098
- */
7099
- export declare const renderInQueue: (fn: (next?: (val?: any) => void) => Promise<any>) => Promise<any>;
7100
- /**
7101
- * Imports TML representation of the metadata objects into ThoughtSpot.
7102
- * @param data
7103
- * @returns imports TML data into ThoughtSpot
7104
- * @example
7105
- * ```js
7106
- * executeTML({
7107
- * //Array of metadata Tmls in string format
7108
- * metadata_tmls: [
7109
- * "'\''{\"guid\":\"9bd202f5-d431-44bf-9a07-b4f7be372125\",
7110
- * \"liveboard\":{\"name\":\"Parameters Liveboard\"}}'\''"
7111
- * ],
7112
- * import_policy: 'PARTIAL', // Specifies the import policy for the TML import.
7113
- * create_new: false, // If selected, creates TML objects with new GUIDs.
7114
- * }).then(result => {
7115
- * console.log(result);
7116
- * }).catch(error => {
7117
- * console.error(error);
7118
- * });
7119
- *```
7120
- * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
7121
- * @group Global methods
7122
- */
7123
- export declare const executeTML: (data: executeTMLInput) => Promise<any>;
7124
- /**
7125
- * Exports TML representation of the metadata objects from ThoughtSpot in JSON or YAML
7126
- * format.
7127
- * @param data
7128
- * @returns exports TML data
7129
- * @example
7130
- * ```js
7131
- * exportTML({
7132
- * metadata: [
7133
- * {
7134
- * type: "LIVEBOARD", //Metadata Type
7135
- * identifier: "9bd202f5-d431-44bf-9a07-b4f7be372125" //Metadata Id
7136
- * }
7137
- * ],
7138
- * export_associated: false,//indicates whether to export associated metadata objects
7139
- * export_fqn: false, //Adds FQNs of the referenced objects.For example, if you are
7140
- * //exporting a Liveboard and its associated objects, the API
7141
- * //returns the Liveboard TML data with the FQNs of the referenced
7142
- * //worksheet. If the exported TML data includes FQNs, you don't need
7143
- * //to manually add FQNs of the referenced objects during TML import.
7144
- * edoc_format: "JSON" //It takes JSON or YAML value
7145
- * }).then(result => {
7146
- * console.log(result);
7147
- * }).catch(error => {
7148
- * console.error(error);
7149
- * });
7150
- * ```
7151
- * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
7152
- * @group Global methods
7153
- */
7154
- export declare const exportTML: (data: exportTMLInput) => Promise<any>;
7155
- /**
7156
- *
7157
- */
7158
- export declare function reset(): void;
7159
-
7160
7249
  /**
7161
- * Configuration for bodyless conversation options.
7162
- * @group Embed components
7250
+ * The list of customization css variables. These
7251
+ * are the only allowed variables possible.
7163
7252
  */
7164
- export interface BodylessConversationViewConfig extends ViewConfig {
7253
+ export interface CustomCssVariables {
7165
7254
  /**
7166
- * The ID of the worksheet to use for the conversation.
7255
+ * Background color of the Liveboard, visualization, Search, and Answer pages.
7167
7256
  */
7168
- worksheetId: string;
7169
- }
7170
- /**
7171
- * Create a conversation embed, which can be integrated inside
7172
- * chatbots or other conversational interfaces.
7173
- * @example
7174
- * ```js
7175
- * import { BodylessConversation } from '@thoughtspot/visual-embed-sdk';
7176
- *
7177
- * const conversation = new BodylessConversation({
7178
- * worksheetId: 'worksheetId',
7179
- * });
7180
- *
7181
- * const { container, error } = await conversation.sendMessage('show me sales by region');
7182
- *
7183
- * // append the container to the DOM
7184
- * document.body.appendChild(container); // or to any other element
7185
- * ```
7186
- * @group Embed components
7187
- * @version SDK: 1.33.1 | ThoughtSpot: 10.5.0.cl
7188
- */
7189
- export declare class BodylessConversation {
7190
- constructor(viewConfig: BodylessConversationViewConfig);
7191
- sendMessage(userMessage: string): Promise<{
7192
- error: any;
7193
- container?: undefined;
7194
- } | {
7195
- container: HTMLDivElement;
7196
- error?: undefined;
7197
- }>;
7198
- }
7199
-
7200
- export declare let loggedInStatus: boolean;
7201
- export declare let samlAuthWindow: Window;
7202
- export declare let samlCompletionPromise: Promise<void>;
7203
- export declare const SSO_REDIRECTION_MARKER_GUID = "5e16222e-ef02-43e9-9fbd-24226bf3ce5b";
7204
- /**
7205
- * Enum for auth failure types. This is the parameter passed to the listner
7206
- * of {@link AuthStatus.FAILURE}.
7207
- * @group Authentication / Init
7208
- */
7209
- export declare enum AuthFailureType {
7210
- SDK = "SDK",
7211
- NO_COOKIE_ACCESS = "NO_COOKIE_ACCESS",
7212
- EXPIRY = "EXPIRY",
7213
- OTHER = "OTHER",
7214
- IDLE_SESSION_TIMEOUT = "IDLE_SESSION_TIMEOUT"
7215
- }
7216
- /**
7217
- * Enum for auth status emitted by the emitter returned from {@link init}.
7218
- * @group Authentication / Init
7219
- */
7220
- export declare enum AuthStatus {
7257
+ '--ts-var-root-background'?: string;
7221
7258
  /**
7222
- * Emits when the SDK fails to authenticate
7259
+ * Color of the text on application pages.
7223
7260
  */
7224
- FAILURE = "FAILURE",
7261
+ '--ts-var-root-color'?: string;
7225
7262
  /**
7226
- * Emits when the SDK authenticates successfully
7263
+ * Font type for the text on application pages.
7227
7264
  */
7228
- SDK_SUCCESS = "SDK_SUCCESS",
7265
+ '--ts-var-root-font-family'?: string;
7229
7266
  /**
7230
- * @hidden
7231
- * Emits when iframe is loaded and session info is available
7267
+ * Text transformation specification for UI elements in the app.
7232
7268
  */
7233
- SESSION_INFO_SUCCESS = "SESSION_INFO_SUCCESS",
7269
+ '--ts-var-root-text-transform'?: string;
7234
7270
  /**
7235
- * Emits when the app sends an authentication success message
7271
+ * Font color of the text on toggle buttons such as
7272
+ * **All**, **Answers**, and **Liveboards** on the Home page (Classic experience),
7273
+ * the text color of the chart and table tiles on Home page (New modular Homepage
7274
+ * experience), and title text on the AI-generated charts and tables.
7275
+ * The default color code is #2770EF.
7276
+ *
7236
7277
  */
7237
- SUCCESS = "SUCCESS",
7278
+ '--ts-var-application-color'?: string;
7238
7279
  /**
7239
- * Emits when a user logs out
7280
+ * Background color of the top navigation panel.
7240
7281
  */
7241
- LOGOUT = "LOGOUT",
7282
+ '--ts-var-nav-background'?: string;
7242
7283
  /**
7243
- * Emitted when inPopup is true in the SAMLRedirect flow and the
7244
- * popup is waiting to be triggered either programmatically
7245
- * or by the trigger button.
7246
- * @version SDK: 1.19.0
7284
+ * Font color of the top navigation panel.
7247
7285
  */
7248
- WAITING_FOR_POPUP = "WAITING_FOR_POPUP"
7249
- }
7250
- /**
7251
- * Event emitter returned from {@link init}.
7252
- * @group Authentication / Init
7253
- */
7254
- export interface AuthEventEmitter {
7286
+ '--ts-var-nav-color'?: string;
7255
7287
  /**
7256
- * Register a listener on Auth failure.
7257
- * @param event
7258
- * @param listener
7288
+ * Background color of the *Search data* button.
7259
7289
  */
7260
- on(event: AuthStatus.FAILURE, listener: (failureType: AuthFailureType) => void): this;
7290
+ '--ts-var-search-data-button-background'?: string;
7261
7291
  /**
7262
- * Register a listener on Auth SDK success.
7263
- * @param event
7264
- * @param listener
7292
+ * Color of the text on the *Search data* button.
7265
7293
  */
7266
- on(event: AuthStatus.SDK_SUCCESS | AuthStatus.LOGOUT | AuthStatus.WAITING_FOR_POPUP, listener: () => void): this;
7267
- on(event: AuthStatus.SUCCESS, listener: (sessionInfo: any) => void): this;
7268
- once(event: AuthStatus.FAILURE, listener: (failureType: AuthFailureType) => void): this;
7269
- once(event: AuthStatus.SDK_SUCCESS | AuthStatus.LOGOUT | AuthStatus.WAITING_FOR_POPUP, listener: () => void): this;
7270
- once(event: AuthStatus.SUCCESS, listener: (sessionInfo: any) => void): this;
7294
+ '--ts-var-search-data-button-font-color'?: string;
7271
7295
  /**
7272
- * Trigger an event on the emitter returned from init.
7273
- * @param {@link AuthEvent}
7296
+ * Font of the text on the *Search data* button.
7274
7297
  */
7275
- emit(event: AuthEvent, ...args: any[]): boolean;
7298
+ '--ts-var-search-data-button-font-family'?: string;
7276
7299
  /**
7277
- * Remove listener from the emitter returned from init.
7278
- * @param event
7279
- * @param listener
7280
- * @param context
7281
- * @param once
7300
+ * Font color of the text in the Search bar.
7282
7301
  */
7283
- off(event: AuthStatus, listener: (...args: any[]) => void, context: any, once: boolean): this;
7302
+ '--ts-var-search-bar-text-font-color'?: string;
7284
7303
  /**
7285
- * Remove all the event listeners
7286
- * @param event
7304
+ * Font of the text in the Search bar.
7287
7305
  */
7288
- removeAllListeners(event: AuthStatus): this;
7289
- }
7290
- /**
7291
- * Events which can be triggered on the emitter returned from {@link init}.
7292
- * @group Authentication / Init
7293
- */
7294
- export declare enum AuthEvent {
7306
+ '--ts-var-search-bar-text-font-family'?: string;
7295
7307
  /**
7296
- * Manually trigger the SSO popup. This is useful when
7297
- * authStatus is SAMLRedirect/OIDCRedirect and inPopup is set to true
7298
- */
7299
- TRIGGER_SSO_POPUP = "TRIGGER_SSO_POPUP"
7300
- }
7301
- /**
7302
- *
7303
- */
7304
- export declare function getAuthEE(): EventEmitter<AuthStatus | AuthEvent>;
7305
- /**
7306
- *
7307
- * @param eventEmitter
7308
- */
7309
- export declare function setAuthEE(eventEmitter: EventEmitter<AuthStatus | AuthEvent>): void;
7310
- /**
7311
- *
7312
- */
7313
- export declare function notifyAuthSDKSuccess(): void;
7314
- /**
7315
- *
7316
- */
7317
- export declare function notifyAuthSuccess(): Promise<void>;
7318
- /**
7319
- *
7320
- * @param failureType
7321
- */
7322
- export declare function notifyAuthFailure(failureType: AuthFailureType): void;
7323
- /**
7324
- *
7325
- */
7326
- export declare function notifyLogout(): void;
7327
- /**
7328
- * Services to be called after the login is successful,
7329
- * This should be called after the cookie is set for cookie auth or
7330
- * after the token is set for cookieless.
7331
- * @return {Promise<void>}
7332
- * @example
7333
- * ```js
7334
- * await postLoginService();
7335
- * ```
7336
- * @version SDK: 1.28.3 | ThoughtSpot: *
7337
- */
7338
- export declare function postLoginService(): Promise<void>;
7339
- /**
7340
- * Return releaseVersion if available
7341
- */
7342
- export declare function getReleaseVersion(): string;
7343
- /**
7344
- * Perform token based authentication
7345
- * @param embedConfig The embed configuration
7346
- */
7347
- export declare const doTokenAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
7348
- /**
7349
- * Validate embedConfig parameters required for cookielessTokenAuth
7350
- * @param embedConfig The embed configuration
7351
- */
7352
- export declare const doCookielessTokenAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
7353
- /**
7354
- * Perform basic authentication to the ThoughtSpot cluster using the cluster
7355
- * credentials.
7356
- *
7357
- * Warning: This feature is primarily intended for developer testing. It is
7358
- * strongly advised not to use this authentication method in production.
7359
- * @param embedConfig The embed configuration
7360
- */
7361
- export declare const doBasicAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
7362
- export declare const doSamlAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
7363
- export declare const doOIDCAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
7364
- export declare const logout: (embedConfig: EmbedConfig) => Promise<boolean>;
7365
- /**
7366
- * Perform authentication on the ThoughtSpot cluster
7367
- * @param embedConfig The embed configuration
7368
- */
7369
- export declare const authenticate: (embedConfig: EmbedConfig) => Promise<boolean>;
7370
- /**
7371
- * Check if we are authenticated to the ThoughtSpot cluster
7372
- */
7373
- export declare const isAuthenticated: () => boolean;
7374
-
7375
- export type SessionInfo = {
7376
- releaseVersion: string;
7377
- userGUID: string;
7378
- currentOrgId: number;
7379
- privileges: string[];
7380
- mixpanelToken: string;
7381
- isPublicUser: boolean;
7382
- clusterId: string;
7383
- clusterName: string;
7384
- [key: string]: any;
7385
- };
7386
- export type PreauthInfo = {
7387
- info?: SessionInfo;
7388
- headers: Record<string, string>;
7389
- status: number;
7390
- [key: string]: any;
7391
- };
7392
- /**
7393
- * Processes the session info response and returns the session info object.
7394
- * @param preauthInfoResp {any} Response from the session info API.
7395
- * @returns {PreauthInfo} The session info object.
7396
- * @example ```js
7397
- * const preauthInfoResp = await fetch(sessionInfoPath);
7398
- * const sessionInfo = await formatPreauthInfo(preauthInfoResp);
7399
- * console.log(sessionInfo);
7400
- * ```
7401
- * @version SDK: 1.28.3 | ThoughtSpot: *
7402
- */
7403
- export declare const formatPreauthInfo: (preauthInfoResp: any) => Promise<PreauthInfo>;
7404
- /**
7405
- * Returns the session info object and caches it for future use.
7406
- * Once fetched the session info object is cached and returned from the cache on
7407
- * subsequent calls.
7408
- * @example ```js
7409
- * const preauthInfo = await getPreauthInfo();
7410
- * console.log(preauthInfo);
7411
- * ```
7412
- * @version SDK: 1.28.3 | ThoughtSpot: *
7413
- * @returns {Promise<SessionInfo>} The session info object.
7414
- */
7415
- export declare function getPreauthInfo(allowCache?: boolean): Promise<PreauthInfo>;
7416
- /**
7417
- * Returns the cached session info object and caches it for future use.
7418
- * Once fetched the session info object is cached and returned from the cache on
7419
- * subsequent calls.
7420
- * This cache is cleared when inti is called OR resetCachedSessionInfo is called.
7421
- * @example ```js
7422
- * const sessionInfo = await getSessionInfo();
7423
- * console.log(sessionInfo);
7424
- * ```
7425
- * @version SDK: 1.28.3 | ThoughtSpot: *
7426
- * @returns {Promise<SessionInfo>} The session info object.
7427
- */
7428
- export declare function getSessionInfo(): Promise<SessionInfo>;
7429
- /**
7430
- * Returns the cached session info object. If the client is not authenticated the
7431
- * function will return null.
7432
- * @example ```js
7433
- * const sessionInfo = getCachedSessionInfo();
7434
- * if (sessionInfo) {
7435
- * console.log(sessionInfo);
7436
- * } else {
7437
- * console.log('Not authenticated');
7438
- * }
7439
- * ```
7440
- * @returns {SessionInfo | null} The session info object.
7441
- * @version SDK: 1.28.3 | ThoughtSpot: *
7442
- */
7443
- export declare function getCachedSessionInfo(): SessionInfo | null;
7444
- /**
7445
- * Processes the session info response and returns the session info object.
7446
- * @param sessionInfoResp {any} Response from the session info API.
7447
- * @returns {SessionInfo} The session info object.
7448
- * @example ```js
7449
- * const sessionInfoResp = await fetch(sessionInfoPath);
7450
- * const sessionInfo = getSessionDetails(sessionInfoResp);
7451
- * console.log(sessionInfo);
7452
- * ```
7453
- * @version SDK: 1.28.3 | ThoughtSpot: *
7454
- */
7455
- export declare const getSessionDetails: (sessionInfoResp: any) => SessionInfo;
7456
- /**
7457
- * Resets the cached session info object and forces a new fetch on the next call.
7458
- * @example ```js
7459
- * resetCachedSessionInfo();
7460
- * const sessionInfo = await getSessionInfo();
7461
- * console.log(sessionInfo);
7462
- * ```
7463
- * @version SDK: 1.28.3 | ThoughtSpot: *
7464
- * @returns {void}
7465
- */
7466
- export declare function resetCachedSessionInfo(): void;
7467
- /**
7468
- * Resets the cached preauth info object and forces a new fetch on the next call.
7469
- * @example ```js
7470
- * resetCachedPreauthInfo();
7471
- * const preauthInfo = await getPreauthInfo();
7472
- * console.log(preauthInfo);
7473
- * ```
7474
- * @version SDK: 1.28.3 | ThoughtSpot: *
7475
- * @returns {void}
7476
- */
7477
- export declare function resetCachedPreauthInfo(): void;
7478
-
7479
- /**
7480
- * The list of customization css variables. These
7481
- * are the only allowed variables possible.
7482
- */
7483
- export interface CustomCssVariables {
7484
- /**
7485
- * Background color of the Liveboard, visualization, Search, and Answer pages.
7486
- */
7487
- '--ts-var-root-background'?: string;
7488
- /**
7489
- * Color of the text on application pages.
7490
- */
7491
- '--ts-var-root-color'?: string;
7492
- /**
7493
- * Font type for the text on application pages.
7494
- */
7495
- '--ts-var-root-font-family'?: string;
7496
- /**
7497
- * Text transformation specification for UI elements in the app.
7498
- */
7499
- '--ts-var-root-text-transform'?: string;
7500
- /**
7501
- * Font color of the text on toggle buttons such as
7502
- * **All**, **Answers**, and **Liveboards** on the Home page (Classic experience),
7503
- * the text color of the chart and table tiles on Home page (New modular Homepage
7504
- * experience), and title text on the AI-generated charts and tables.
7505
- * The default color code is #2770EF.
7506
- *
7507
- */
7508
- '--ts-var-application-color'?: string;
7509
- /**
7510
- * Background color of the top navigation panel.
7511
- */
7512
- '--ts-var-nav-background'?: string;
7513
- /**
7514
- * Font color of the top navigation panel.
7515
- */
7516
- '--ts-var-nav-color'?: string;
7517
- /**
7518
- * Background color of the *Search data* button.
7519
- */
7520
- '--ts-var-search-data-button-background'?: string;
7521
- /**
7522
- * Color of the text on the *Search data* button.
7523
- */
7524
- '--ts-var-search-data-button-font-color'?: string;
7525
- /**
7526
- * Font of the text on the *Search data* button.
7527
- */
7528
- '--ts-var-search-data-button-font-family'?: string;
7529
- /**
7530
- * Font color of the text in the Search bar.
7531
- */
7532
- '--ts-var-search-bar-text-font-color'?: string;
7533
- /**
7534
- * Font of the text in the Search bar.
7535
- */
7536
- '--ts-var-search-bar-text-font-family'?: string;
7537
- /**
7538
- * Font style of the text in the Search bar.
7308
+ * Font style of the text in the Search bar.
7539
7309
  */
7540
7310
  '--ts-var-search-bar-text-font-style'?: string;
7541
7311
  /**
@@ -8042,6 +7812,291 @@ export declare class AnswerService {
8042
7812
  setTMLOverride(override: any): void;
8043
7813
  }
8044
7814
 
7815
+ import '../utils/with-resolvers-polyfill';
7816
+ export interface executeTMLInput {
7817
+ metadata_tmls: string[];
7818
+ import_policy?: 'PARTIAL' | 'ALL_OR_NONE' | 'VALIDATE_ONLY';
7819
+ create_new?: boolean;
7820
+ }
7821
+ export interface exportTMLInput {
7822
+ metadata: {
7823
+ identifier: string;
7824
+ type?: 'LIVEBOARD' | 'ANSWER' | 'LOGICAL_TABLE' | 'CONNECTION';
7825
+ }[];
7826
+ export_associated?: boolean;
7827
+ export_fqn?: boolean;
7828
+ edoc_format?: 'YAML' | 'JSON';
7829
+ }
7830
+ export declare let authPromise: Promise<boolean>;
7831
+ export declare const getAuthPromise: () => Promise<boolean>;
7832
+ export { notifyAuthFailure, notifyAuthSDKSuccess, notifyAuthSuccess, notifyLogout, };
7833
+ /**
7834
+ * Perform authentication on the ThoughtSpot app as applicable.
7835
+ */
7836
+ export declare const handleAuth: () => Promise<boolean>;
7837
+ /**
7838
+ * Prefetches static resources from the specified URL. Web browsers can then cache the
7839
+ * prefetched resources and serve them from the user's local disk to provide faster access
7840
+ * to your app.
7841
+ * @param url The URL provided for prefetch
7842
+ * @param prefetchFeatures Specify features which needs to be prefetched.
7843
+ * @param additionalFlags This can be used to add any URL flag.
7844
+ * @version SDK: 1.4.0 | ThoughtSpot: ts7.sep.cl, 7.2.1
7845
+ * @group Global methods
7846
+ */
7847
+ export declare const prefetch: (url?: string, prefetchFeatures?: PrefetchFeatures[], additionalFlags?: {
7848
+ [key: string]: string | number | boolean;
7849
+ }) => void;
7850
+ export declare const createAndSetInitPromise: () => void;
7851
+ export declare const getInitPromise: () => Promise<ReturnType<typeof init>>;
7852
+ export declare const getIsInitCalled: () => boolean;
7853
+ /**
7854
+ * Initializes the Visual Embed SDK globally and perform
7855
+ * authentication if applicable. This function needs to be called before any ThoughtSpot
7856
+ * component like Liveboard etc can be embedded. But need not wait for AuthEvent.SUCCESS
7857
+ * to actually embed. That is handled internally.
7858
+ * @param embedConfig The configuration object containing ThoughtSpot host,
7859
+ * authentication mechanism and so on.
7860
+ * @example
7861
+ * ```js
7862
+ * const authStatus = init({
7863
+ * thoughtSpotHost: 'https://my.thoughtspot.cloud',
7864
+ * authType: AuthType.None,
7865
+ * });
7866
+ * authStatus.on(AuthStatus.FAILURE, (reason) => { // do something here });
7867
+ * ```
7868
+ * @returns {@link AuthEventEmitter} event emitter which emits events on authentication success,
7869
+ * failure and logout. See {@link AuthStatus}
7870
+ * @version SDK: 1.0.0 | ThoughtSpot ts7.april.cl, 7.2.1
7871
+ * @group Authentication / Init
7872
+ */
7873
+ export declare const init: (embedConfig: EmbedConfig) => AuthEventEmitter;
7874
+ /**
7875
+ *
7876
+ */
7877
+ export declare function disableAutoLogin(): void;
7878
+ /**
7879
+ * Logs out from ThoughtSpot. This also sets the autoLogin flag to false, to
7880
+ * prevent the SDK from automatically logging in again.
7881
+ *
7882
+ * You can call the `init` method again to re login, if autoLogin is set to
7883
+ * true in this second call it will be honored.
7884
+ * @param doNotDisableAutoLogin This flag when passed will not disable autoLogin
7885
+ * @returns Promise which resolves when logout completes.
7886
+ * @version SDK: 1.10.1 | ThoughtSpot: 8.2.0.cl, 8.4.1-sw
7887
+ * @group Global methods
7888
+ */
7889
+ export declare const logout: (doNotDisableAutoLogin?: boolean) => Promise<boolean>;
7890
+ /**
7891
+ * Renders functions in a queue, resolves to next function only after the callback next
7892
+ * is called
7893
+ * @param fn The function being registered
7894
+ */
7895
+ export declare const renderInQueue: (fn: (next?: (val?: any) => void) => Promise<any>) => Promise<any>;
7896
+ /**
7897
+ * Imports TML representation of the metadata objects into ThoughtSpot.
7898
+ * @param data
7899
+ * @returns imports TML data into ThoughtSpot
7900
+ * @example
7901
+ * ```js
7902
+ * executeTML({
7903
+ * //Array of metadata Tmls in string format
7904
+ * metadata_tmls: [
7905
+ * "'\''{\"guid\":\"9bd202f5-d431-44bf-9a07-b4f7be372125\",
7906
+ * \"liveboard\":{\"name\":\"Parameters Liveboard\"}}'\''"
7907
+ * ],
7908
+ * import_policy: 'PARTIAL', // Specifies the import policy for the TML import.
7909
+ * create_new: false, // If selected, creates TML objects with new GUIDs.
7910
+ * }).then(result => {
7911
+ * console.log(result);
7912
+ * }).catch(error => {
7913
+ * console.error(error);
7914
+ * });
7915
+ *```
7916
+ * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
7917
+ * @group Global methods
7918
+ */
7919
+ export declare const executeTML: (data: executeTMLInput) => Promise<any>;
7920
+ /**
7921
+ * Exports TML representation of the metadata objects from ThoughtSpot in JSON or YAML
7922
+ * format.
7923
+ * @param data
7924
+ * @returns exports TML data
7925
+ * @example
7926
+ * ```js
7927
+ * exportTML({
7928
+ * metadata: [
7929
+ * {
7930
+ * type: "LIVEBOARD", //Metadata Type
7931
+ * identifier: "9bd202f5-d431-44bf-9a07-b4f7be372125" //Metadata Id
7932
+ * }
7933
+ * ],
7934
+ * export_associated: false,//indicates whether to export associated metadata objects
7935
+ * export_fqn: false, //Adds FQNs of the referenced objects.For example, if you are
7936
+ * //exporting a Liveboard and its associated objects, the API
7937
+ * //returns the Liveboard TML data with the FQNs of the referenced
7938
+ * //worksheet. If the exported TML data includes FQNs, you don't need
7939
+ * //to manually add FQNs of the referenced objects during TML import.
7940
+ * edoc_format: "JSON" //It takes JSON or YAML value
7941
+ * }).then(result => {
7942
+ * console.log(result);
7943
+ * }).catch(error => {
7944
+ * console.error(error);
7945
+ * });
7946
+ * ```
7947
+ * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
7948
+ * @group Global methods
7949
+ */
7950
+ export declare const exportTML: (data: exportTMLInput) => Promise<any>;
7951
+ /**
7952
+ *
7953
+ */
7954
+ export declare function reset(): void;
7955
+
7956
+ /**
7957
+ * Configuration for bodyless conversation options.
7958
+ * @group Embed components
7959
+ */
7960
+ export interface BodylessConversationViewConfig extends ViewConfig {
7961
+ /**
7962
+ * The ID of the worksheet to use for the conversation.
7963
+ */
7964
+ worksheetId: string;
7965
+ }
7966
+ /**
7967
+ * Create a conversation embed, which can be integrated inside
7968
+ * chatbots or other conversational interfaces.
7969
+ * @example
7970
+ * ```js
7971
+ * import { BodylessConversation } from '@thoughtspot/visual-embed-sdk';
7972
+ *
7973
+ * const conversation = new BodylessConversation({
7974
+ * worksheetId: 'worksheetId',
7975
+ * });
7976
+ *
7977
+ * const { container, error } = await conversation.sendMessage('show me sales by region');
7978
+ *
7979
+ * // append the container to the DOM
7980
+ * document.body.appendChild(container); // or to any other element
7981
+ * ```
7982
+ * @group Embed components
7983
+ * @version SDK: 1.33.1 | ThoughtSpot: 10.5.0.cl
7984
+ */
7985
+ export declare class BodylessConversation {
7986
+ constructor(viewConfig: BodylessConversationViewConfig);
7987
+ sendMessage(userMessage: string): Promise<{
7988
+ error: any;
7989
+ container?: undefined;
7990
+ } | {
7991
+ container: HTMLDivElement;
7992
+ error?: undefined;
7993
+ }>;
7994
+ }
7995
+
7996
+ export type SessionInfo = {
7997
+ releaseVersion: string;
7998
+ userGUID: string;
7999
+ currentOrgId: number;
8000
+ privileges: string[];
8001
+ mixpanelToken: string;
8002
+ isPublicUser: boolean;
8003
+ clusterId: string;
8004
+ clusterName: string;
8005
+ [key: string]: any;
8006
+ };
8007
+ export type PreauthInfo = {
8008
+ info?: SessionInfo;
8009
+ headers: Record<string, string>;
8010
+ status: number;
8011
+ [key: string]: any;
8012
+ };
8013
+ /**
8014
+ * Processes the session info response and returns the session info object.
8015
+ * @param preauthInfoResp {any} Response from the session info API.
8016
+ * @returns {PreauthInfo} The session info object.
8017
+ * @example ```js
8018
+ * const preauthInfoResp = await fetch(sessionInfoPath);
8019
+ * const sessionInfo = await formatPreauthInfo(preauthInfoResp);
8020
+ * console.log(sessionInfo);
8021
+ * ```
8022
+ * @version SDK: 1.28.3 | ThoughtSpot: *
8023
+ */
8024
+ export declare const formatPreauthInfo: (preauthInfoResp: any) => Promise<PreauthInfo>;
8025
+ /**
8026
+ * Returns the session info object and caches it for future use.
8027
+ * Once fetched the session info object is cached and returned from the cache on
8028
+ * subsequent calls.
8029
+ * @example ```js
8030
+ * const preauthInfo = await getPreauthInfo();
8031
+ * console.log(preauthInfo);
8032
+ * ```
8033
+ * @version SDK: 1.28.3 | ThoughtSpot: *
8034
+ * @returns {Promise<SessionInfo>} The session info object.
8035
+ */
8036
+ export declare function getPreauthInfo(allowCache?: boolean): Promise<PreauthInfo>;
8037
+ /**
8038
+ * Returns the cached session info object and caches it for future use.
8039
+ * Once fetched the session info object is cached and returned from the cache on
8040
+ * subsequent calls.
8041
+ * This cache is cleared when inti is called OR resetCachedSessionInfo is called.
8042
+ * @example ```js
8043
+ * const sessionInfo = await getSessionInfo();
8044
+ * console.log(sessionInfo);
8045
+ * ```
8046
+ * @version SDK: 1.28.3 | ThoughtSpot: *
8047
+ * @returns {Promise<SessionInfo>} The session info object.
8048
+ */
8049
+ export declare function getSessionInfo(): Promise<SessionInfo>;
8050
+ /**
8051
+ * Returns the cached session info object. If the client is not authenticated the
8052
+ * function will return null.
8053
+ * @example ```js
8054
+ * const sessionInfo = getCachedSessionInfo();
8055
+ * if (sessionInfo) {
8056
+ * console.log(sessionInfo);
8057
+ * } else {
8058
+ * console.log('Not authenticated');
8059
+ * }
8060
+ * ```
8061
+ * @returns {SessionInfo | null} The session info object.
8062
+ * @version SDK: 1.28.3 | ThoughtSpot: *
8063
+ */
8064
+ export declare function getCachedSessionInfo(): SessionInfo | null;
8065
+ /**
8066
+ * Processes the session info response and returns the session info object.
8067
+ * @param sessionInfoResp {any} Response from the session info API.
8068
+ * @returns {SessionInfo} The session info object.
8069
+ * @example ```js
8070
+ * const sessionInfoResp = await fetch(sessionInfoPath);
8071
+ * const sessionInfo = getSessionDetails(sessionInfoResp);
8072
+ * console.log(sessionInfo);
8073
+ * ```
8074
+ * @version SDK: 1.28.3 | ThoughtSpot: *
8075
+ */
8076
+ export declare const getSessionDetails: (sessionInfoResp: any) => SessionInfo;
8077
+ /**
8078
+ * Resets the cached session info object and forces a new fetch on the next call.
8079
+ * @example ```js
8080
+ * resetCachedSessionInfo();
8081
+ * const sessionInfo = await getSessionInfo();
8082
+ * console.log(sessionInfo);
8083
+ * ```
8084
+ * @version SDK: 1.28.3 | ThoughtSpot: *
8085
+ * @returns {void}
8086
+ */
8087
+ export declare function resetCachedSessionInfo(): void;
8088
+ /**
8089
+ * Resets the cached preauth info object and forces a new fetch on the next call.
8090
+ * @example ```js
8091
+ * resetCachedPreauthInfo();
8092
+ * const preauthInfo = await getPreauthInfo();
8093
+ * console.log(preauthInfo);
8094
+ * ```
8095
+ * @version SDK: 1.28.3 | ThoughtSpot: *
8096
+ * @returns {void}
8097
+ */
8098
+ export declare function resetCachedPreauthInfo(): void;
8099
+
8045
8100
  /**
8046
8101
  * Gets the configuration embed was initialized with.
8047
8102
  * @returns {@link EmbedConfig} The configuration embed was initialized with.
@@ -8056,7 +8111,7 @@ export declare const getEmbedConfig: () => EmbedConfig;
8056
8111
  * @version SDK: 1.27.0 | ThoughtSpot: *
8057
8112
  * @group Global methods
8058
8113
  */
8059
- export declare const setEmbedConfig: (newConfig: EmbedConfig) => EmbedConfig;
8114
+ export declare const setEmbedConfig: (newConfig: EmbedConfig) => any;
8060
8115
 
8061
8116
  export declare const EndPoints: {
8062
8117
  CONFIG: string;