@thoughtspot/visual-embed-sdk 1.20.1 → 1.20.3

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