@thoughtspot/visual-embed-sdk 1.26.6 → 1.26.7

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 (263) hide show
  1. package/README.md +2 -2
  2. package/cjs/package.json +1 -1
  3. package/cjs/src/auth.d.ts +4 -4
  4. package/cjs/src/auth.d.ts.map +1 -1
  5. package/cjs/src/auth.js +16 -9
  6. package/cjs/src/auth.js.map +1 -1
  7. package/cjs/src/embed/app.d.ts +15 -15
  8. package/cjs/src/embed/app.d.ts.map +1 -1
  9. package/cjs/src/embed/app.js +4 -3
  10. package/cjs/src/embed/app.js.map +1 -1
  11. package/cjs/src/embed/app.spec.js +5 -4
  12. package/cjs/src/embed/app.spec.js.map +1 -1
  13. package/cjs/src/embed/base.d.ts +1 -1
  14. package/cjs/src/embed/base.d.ts.map +1 -1
  15. package/cjs/src/embed/base.js +9 -6
  16. package/cjs/src/embed/base.js.map +1 -1
  17. package/cjs/src/embed/base.spec.js +4 -3
  18. package/cjs/src/embed/base.spec.js.map +1 -1
  19. package/cjs/src/embed/embed.spec.js +2 -1
  20. package/cjs/src/embed/embed.spec.js.map +1 -1
  21. package/cjs/src/embed/embedConfig.d.ts +2 -1
  22. package/cjs/src/embed/embedConfig.d.ts.map +1 -1
  23. package/cjs/src/embed/embedConfig.js +2 -0
  24. package/cjs/src/embed/embedConfig.js.map +1 -1
  25. package/cjs/src/embed/events.spec.js +3 -2
  26. package/cjs/src/embed/events.spec.js.map +1 -1
  27. package/cjs/src/embed/liveboard.d.ts +35 -23
  28. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  29. package/cjs/src/embed/liveboard.js +8 -4
  30. package/cjs/src/embed/liveboard.js.map +1 -1
  31. package/cjs/src/embed/liveboard.spec.js +2 -1
  32. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  33. package/cjs/src/embed/sage.d.ts +48 -30
  34. package/cjs/src/embed/sage.d.ts.map +1 -1
  35. package/cjs/src/embed/sage.js +7 -6
  36. package/cjs/src/embed/sage.js.map +1 -1
  37. package/cjs/src/embed/sage.spec.js +3 -3
  38. package/cjs/src/embed/sage.spec.js.map +1 -1
  39. package/cjs/src/embed/search-bar.d.ts +22 -6
  40. package/cjs/src/embed/search-bar.d.ts.map +1 -1
  41. package/cjs/src/embed/search-bar.js.map +1 -1
  42. package/cjs/src/embed/search.d.ts +35 -16
  43. package/cjs/src/embed/search.d.ts.map +1 -1
  44. package/cjs/src/embed/search.js +10 -6
  45. package/cjs/src/embed/search.js.map +1 -1
  46. package/cjs/src/embed/search.spec.js +10 -0
  47. package/cjs/src/embed/search.spec.js.map +1 -1
  48. package/cjs/src/embed/ts-embed.d.ts +2 -1
  49. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  50. package/cjs/src/embed/ts-embed.js +45 -22
  51. package/cjs/src/embed/ts-embed.js.map +1 -1
  52. package/cjs/src/embed/ts-embed.spec.js +153 -32
  53. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  54. package/cjs/src/index.d.ts +2 -2
  55. package/cjs/src/index.d.ts.map +1 -1
  56. package/cjs/src/index.js +2 -1
  57. package/cjs/src/index.js.map +1 -1
  58. package/cjs/src/mixpanel-service.d.ts.map +1 -1
  59. package/cjs/src/mixpanel-service.js +2 -1
  60. package/cjs/src/mixpanel-service.js.map +1 -1
  61. package/cjs/src/react/index.d.ts +1 -1
  62. package/cjs/src/react/index.d.ts.map +1 -1
  63. package/cjs/src/react/index.js +2 -1
  64. package/cjs/src/react/index.js.map +1 -1
  65. package/cjs/src/react/index.spec.js +2 -2
  66. package/cjs/src/react/index.spec.js.map +1 -1
  67. package/cjs/src/types.d.ts +742 -237
  68. package/cjs/src/types.d.ts.map +1 -1
  69. package/cjs/src/types.js +653 -169
  70. package/cjs/src/types.js.map +1 -1
  71. package/cjs/src/utils/authService/authService.d.ts.map +1 -1
  72. package/cjs/src/utils/authService/authService.js +3 -2
  73. package/cjs/src/utils/authService/authService.js.map +1 -1
  74. package/cjs/src/utils/authService/authService.spec.js +3 -2
  75. package/cjs/src/utils/authService/authService.spec.js.map +1 -1
  76. package/cjs/src/utils/authService/tokenizedAuthService.d.ts.map +1 -1
  77. package/cjs/src/utils/authService/tokenizedAuthService.js +2 -1
  78. package/cjs/src/utils/authService/tokenizedAuthService.js.map +1 -1
  79. package/cjs/src/utils/graphql/answerService/answerService.d.ts +2 -4
  80. package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  81. package/cjs/src/utils/graphql/answerService/answerService.js +2 -4
  82. package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
  83. package/cjs/src/utils/logger.d.ts +18 -0
  84. package/cjs/src/utils/logger.d.ts.map +1 -0
  85. package/cjs/src/utils/logger.js +80 -0
  86. package/cjs/src/utils/logger.js.map +1 -0
  87. package/cjs/src/utils/logger.spec.d.ts +25 -0
  88. package/cjs/src/utils/logger.spec.d.ts.map +1 -0
  89. package/cjs/src/utils/logger.spec.js +116 -0
  90. package/cjs/src/utils/logger.spec.js.map +1 -0
  91. package/cjs/src/utils/processData.d.ts +6 -0
  92. package/cjs/src/utils/processData.d.ts.map +1 -1
  93. package/cjs/src/utils/processData.js +5 -1
  94. package/cjs/src/utils/processData.js.map +1 -1
  95. package/cjs/src/utils/processTrigger.js +1 -1
  96. package/dist/src/auth.d.ts +4 -4
  97. package/dist/src/auth.d.ts.map +1 -1
  98. package/dist/src/embed/app.d.ts +15 -15
  99. package/dist/src/embed/app.d.ts.map +1 -1
  100. package/dist/src/embed/base.d.ts +1 -1
  101. package/dist/src/embed/base.d.ts.map +1 -1
  102. package/dist/src/embed/embedConfig.d.ts +2 -1
  103. package/dist/src/embed/embedConfig.d.ts.map +1 -1
  104. package/dist/src/embed/liveboard.d.ts +35 -23
  105. package/dist/src/embed/liveboard.d.ts.map +1 -1
  106. package/dist/src/embed/sage.d.ts +48 -30
  107. package/dist/src/embed/sage.d.ts.map +1 -1
  108. package/dist/src/embed/search-bar.d.ts +22 -6
  109. package/dist/src/embed/search-bar.d.ts.map +1 -1
  110. package/dist/src/embed/search.d.ts +35 -16
  111. package/dist/src/embed/search.d.ts.map +1 -1
  112. package/dist/src/embed/ts-embed.d.ts +2 -1
  113. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  114. package/dist/src/index.d.ts +2 -2
  115. package/dist/src/index.d.ts.map +1 -1
  116. package/dist/src/mixpanel-service.d.ts.map +1 -1
  117. package/dist/src/react/index.d.ts +1 -1
  118. package/dist/src/react/index.d.ts.map +1 -1
  119. package/dist/src/types.d.ts +742 -237
  120. package/dist/src/types.d.ts.map +1 -1
  121. package/dist/src/utils/authService/authService.d.ts.map +1 -1
  122. package/dist/src/utils/authService/tokenizedAuthService.d.ts.map +1 -1
  123. package/dist/src/utils/graphql/answerService/answerService.d.ts +2 -4
  124. package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  125. package/dist/src/utils/logger.d.ts +18 -0
  126. package/dist/src/utils/logger.d.ts.map +1 -0
  127. package/dist/src/utils/logger.spec.d.ts +25 -0
  128. package/dist/src/utils/logger.spec.d.ts.map +1 -0
  129. package/dist/src/utils/processData.d.ts +6 -0
  130. package/dist/src/utils/processData.d.ts.map +1 -1
  131. package/dist/tsembed-react.es.js +3716 -3107
  132. package/dist/tsembed-react.js +3620 -3012
  133. package/dist/tsembed.es.js +9830 -9212
  134. package/dist/tsembed.js +15079 -14462
  135. package/dist/visual-embed-sdk-react-full.d.ts +923 -332
  136. package/dist/visual-embed-sdk-react.d.ts +923 -332
  137. package/dist/visual-embed-sdk.d.ts +923 -332
  138. package/lib/package.json +1 -1
  139. package/lib/src/auth.d.ts +4 -4
  140. package/lib/src/auth.d.ts.map +1 -1
  141. package/lib/src/auth.js +17 -10
  142. package/lib/src/auth.js.map +1 -1
  143. package/lib/src/embed/app.d.ts +15 -15
  144. package/lib/src/embed/app.d.ts.map +1 -1
  145. package/lib/src/embed/app.js +4 -3
  146. package/lib/src/embed/app.js.map +1 -1
  147. package/lib/src/embed/app.spec.js +5 -4
  148. package/lib/src/embed/app.spec.js.map +1 -1
  149. package/lib/src/embed/base.d.ts +1 -1
  150. package/lib/src/embed/base.d.ts.map +1 -1
  151. package/lib/src/embed/base.js +9 -6
  152. package/lib/src/embed/base.js.map +1 -1
  153. package/lib/src/embed/base.spec.js +5 -4
  154. package/lib/src/embed/base.spec.js.map +1 -1
  155. package/lib/src/embed/embed.spec.js +2 -1
  156. package/lib/src/embed/embed.spec.js.map +1 -1
  157. package/lib/src/embed/embedConfig.d.ts +2 -1
  158. package/lib/src/embed/embedConfig.d.ts.map +1 -1
  159. package/lib/src/embed/embedConfig.js +2 -0
  160. package/lib/src/embed/embedConfig.js.map +1 -1
  161. package/lib/src/embed/events.spec.js +3 -2
  162. package/lib/src/embed/events.spec.js.map +1 -1
  163. package/lib/src/embed/liveboard.d.ts +35 -23
  164. package/lib/src/embed/liveboard.d.ts.map +1 -1
  165. package/lib/src/embed/liveboard.js +8 -4
  166. package/lib/src/embed/liveboard.js.map +1 -1
  167. package/lib/src/embed/liveboard.spec.js +2 -1
  168. package/lib/src/embed/liveboard.spec.js.map +1 -1
  169. package/lib/src/embed/sage.d.ts +48 -30
  170. package/lib/src/embed/sage.d.ts.map +1 -1
  171. package/lib/src/embed/sage.js +7 -6
  172. package/lib/src/embed/sage.js.map +1 -1
  173. package/lib/src/embed/sage.spec.js +3 -3
  174. package/lib/src/embed/sage.spec.js.map +1 -1
  175. package/lib/src/embed/search-bar.d.ts +22 -6
  176. package/lib/src/embed/search-bar.d.ts.map +1 -1
  177. package/lib/src/embed/search-bar.js.map +1 -1
  178. package/lib/src/embed/search.d.ts +35 -16
  179. package/lib/src/embed/search.d.ts.map +1 -1
  180. package/lib/src/embed/search.js +11 -7
  181. package/lib/src/embed/search.js.map +1 -1
  182. package/lib/src/embed/search.spec.js +10 -0
  183. package/lib/src/embed/search.spec.js.map +1 -1
  184. package/lib/src/embed/ts-embed.d.ts +2 -1
  185. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  186. package/lib/src/embed/ts-embed.js +48 -25
  187. package/lib/src/embed/ts-embed.js.map +1 -1
  188. package/lib/src/embed/ts-embed.spec.js +153 -32
  189. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  190. package/lib/src/index.d.ts +2 -2
  191. package/lib/src/index.d.ts.map +1 -1
  192. package/lib/src/index.js +2 -2
  193. package/lib/src/index.js.map +1 -1
  194. package/lib/src/mixpanel-service.d.ts.map +1 -1
  195. package/lib/src/mixpanel-service.js +2 -1
  196. package/lib/src/mixpanel-service.js.map +1 -1
  197. package/lib/src/react/index.d.ts +1 -1
  198. package/lib/src/react/index.d.ts.map +1 -1
  199. package/lib/src/react/index.js +1 -1
  200. package/lib/src/react/index.js.map +1 -1
  201. package/lib/src/react/index.spec.js +2 -2
  202. package/lib/src/react/index.spec.js.map +1 -1
  203. package/lib/src/types.d.ts +742 -237
  204. package/lib/src/types.d.ts.map +1 -1
  205. package/lib/src/types.js +652 -168
  206. package/lib/src/types.js.map +1 -1
  207. package/lib/src/utils/authService/authService.d.ts.map +1 -1
  208. package/lib/src/utils/authService/authService.js +3 -2
  209. package/lib/src/utils/authService/authService.js.map +1 -1
  210. package/lib/src/utils/authService/authService.spec.js +4 -3
  211. package/lib/src/utils/authService/authService.spec.js.map +1 -1
  212. package/lib/src/utils/authService/tokenizedAuthService.d.ts.map +1 -1
  213. package/lib/src/utils/authService/tokenizedAuthService.js +2 -1
  214. package/lib/src/utils/authService/tokenizedAuthService.js.map +1 -1
  215. package/lib/src/utils/graphql/answerService/answerService.d.ts +2 -4
  216. package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  217. package/lib/src/utils/graphql/answerService/answerService.js +2 -4
  218. package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
  219. package/lib/src/utils/logger.d.ts +18 -0
  220. package/lib/src/utils/logger.d.ts.map +1 -0
  221. package/lib/src/utils/logger.js +74 -0
  222. package/lib/src/utils/logger.js.map +1 -0
  223. package/lib/src/utils/logger.spec.d.ts +25 -0
  224. package/lib/src/utils/logger.spec.d.ts.map +1 -0
  225. package/lib/src/utils/logger.spec.js +93 -0
  226. package/lib/src/utils/logger.spec.js.map +1 -0
  227. package/lib/src/utils/processData.d.ts +6 -0
  228. package/lib/src/utils/processData.d.ts.map +1 -1
  229. package/lib/src/utils/processData.js +4 -1
  230. package/lib/src/utils/processData.js.map +1 -1
  231. package/lib/src/utils/processTrigger.js +1 -1
  232. package/lib/src/visual-embed-sdk.d.ts +927 -336
  233. package/package.json +1 -1
  234. package/src/auth.ts +20 -13
  235. package/src/embed/app.spec.ts +5 -4
  236. package/src/embed/app.ts +23 -22
  237. package/src/embed/base.spec.ts +6 -5
  238. package/src/embed/base.ts +18 -11
  239. package/src/embed/embed.spec.ts +2 -1
  240. package/src/embed/embedConfig.ts +2 -0
  241. package/src/embed/events.spec.ts +3 -2
  242. package/src/embed/liveboard.spec.ts +2 -1
  243. package/src/embed/liveboard.ts +43 -27
  244. package/src/embed/sage.spec.ts +3 -3
  245. package/src/embed/sage.ts +54 -36
  246. package/src/embed/search-bar.tsx +22 -6
  247. package/src/embed/search.spec.ts +13 -0
  248. package/src/embed/search.ts +46 -21
  249. package/src/embed/ts-embed.spec.ts +182 -43
  250. package/src/embed/ts-embed.ts +78 -59
  251. package/src/index.ts +2 -0
  252. package/src/mixpanel-service.ts +2 -1
  253. package/src/react/index.spec.tsx +2 -2
  254. package/src/react/index.tsx +1 -0
  255. package/src/types.ts +753 -245
  256. package/src/utils/authService/authService.spec.ts +7 -6
  257. package/src/utils/authService/authService.ts +4 -2
  258. package/src/utils/authService/tokenizedAuthService.ts +2 -1
  259. package/src/utils/graphql/answerService/answerService.ts +2 -4
  260. package/src/utils/logger.spec.ts +108 -0
  261. package/src/utils/logger.ts +88 -0
  262. package/src/utils/processData.ts +4 -1
  263. package/src/utils/processTrigger.ts +1 -1
package/src/types.ts CHANGED
@@ -32,10 +32,14 @@ export enum AuthType {
32
32
  */
33
33
  None = 'None',
34
34
  /**
35
- * Passthrough SSO to the embedded App within the iframe. Requires least
35
+ * Passthrough SSO to the embedded application within the iframe. Requires least
36
36
  * configuration, but may not be supported by all IDPs. This will behave like `None`
37
37
  * if SSO is not configured on ThoughtSpot.
38
38
  *
39
+ * To use this:
40
+ * Your SAML or OpenID provider must allow iframe redirects.
41
+ * For example, if you are using Okta as IdP, you can enable iframe embedding.
42
+ *
39
43
  * @example
40
44
  * ```js
41
45
  * init({
@@ -43,12 +47,7 @@ export enum AuthType {
43
47
  * authType: AuthType.EmbeddedSSO,
44
48
  * });
45
49
  * ```
46
- * Set authentication type as Embedded SSO.
47
- *
48
- * To use this:
49
- * Your SAML or OpenID provider must allow iframe redirects.
50
- * eg. If you are using okta as IdP, you can enable iFrame embedding.
51
- * @version: SDK: 1.15.0 | ThouhgtSpot: 8.8.0.cl
50
+ * @version: SDK: 1.15.0 | ThoughtSpot: 8.8.0.cl
52
51
  */
53
52
  EmbeddedSSO = 'EmbeddedSSO',
54
53
  /**
@@ -67,10 +66,10 @@ export enum AuthType {
67
66
  SAML = 'SSO_SAML',
68
67
  /**
69
68
  * SSO using SAML
70
- * Will make the host application redirect to the SAML Idp. Use this
71
- * when the idp does not allow itself to be embedded.
69
+ * Makes the host application redirect to the SAML IdP. Use this
70
+ * if your IdP does not allow itself to be embedded.
72
71
  *
73
- * This redirects the host application to the SAML Idp. The host application
72
+ * This redirects the host application to the SAML IdP. The host application
74
73
  * will be redirected back to the ThoughtSpot app after authentication.
75
74
  *
76
75
  * @example
@@ -81,7 +80,7 @@ export enum AuthType {
81
80
  * });
82
81
  * ```
83
82
  *
84
- * This opens the SAML Idp in a popup window. The popup is triggered
83
+ * This opens the SAML IdP in a popup window. The popup is triggered
85
84
  * when the user clicks the trigger button. The popup window will be
86
85
  * closed automatically after authentication.
87
86
  * @example
@@ -95,8 +94,8 @@ export enum AuthType {
95
94
  * });
96
95
  * ```
97
96
  *
98
- * Can also use event to trigger the popup flow. Works the same
99
- * as above example.
97
+ * Can also use the event to trigger the popup flow. Works the same
98
+ * as the above example.
100
99
  * @example
101
100
  * ```js
102
101
  * const authEE = init({
@@ -120,7 +119,7 @@ export enum AuthType {
120
119
  OIDC = 'SSO_OIDC',
121
120
  /**
122
121
  * SSO using OIDC
123
- * Will make the host application redirect to the OIDC Idp.
122
+ * Will make the host application redirect to the OIDC IdP.
124
123
  * See code samples in {@link SAMLRedirect}.
125
124
  */
126
125
  OIDCRedirect = 'SSO_OIDC',
@@ -132,8 +131,8 @@ export enum AuthType {
132
131
  */
133
132
  AuthServer = 'AuthServer',
134
133
  /**
135
- * Trusted authentication server, Use your own authentication server
136
- * which returns a bearer token, generated using the secret_key obtained
134
+ * Trusted authentication server. Use your own authentication server
135
+ * which returns a bearer token, generated using the `secret_key` obtained
137
136
  * from ThoughtSpot.
138
137
  *
139
138
  * @example
@@ -150,11 +149,11 @@ export enum AuthType {
150
149
  */
151
150
  TrustedAuthToken = 'AuthServer',
152
151
  /**
153
- * Trusted authentication server Cookieless, Use you own authentication
154
- * server which returns a bearer token, generated using the secret_key
152
+ * Trusted authentication server Cookieless, Use your own authentication
153
+ * server which returns a bearer token, generated using the `secret_key`
155
154
  * obtained from ThoughtSpot. This uses a cookieless authentication
156
- * approach, recommended to by pass third-party cookie-blocking restriction
157
- * implemented by some browsers
155
+ * approach, recommended to bypass the third-party cookie-blocking restriction
156
+ * implemented by some browsers.
158
157
  *
159
158
  * @example
160
159
  * ```js
@@ -167,7 +166,7 @@ export enum AuthType {
167
166
  * .then((data) => data.token);
168
167
  * }
169
168
  * ```
170
- * @version SDK: 1.22.0| ThouhgtSpot: 9.3.0.cl, 9.5.1.sw
169
+ * @version SDK: 1.22.0| ThoughtSpot: 9.3.0.cl, 9.5.1.sw
171
170
  */
172
171
  TrustedAuthTokenCookieless = 'AuthServerCookieless',
173
172
  /**
@@ -294,13 +293,19 @@ export interface EmbedConfig {
294
293
  * The ThoughtSpot cluster hostname or IP address.
295
294
  */
296
295
  thoughtSpotHost: string;
296
+ /**
297
+ * If true, all the iframe links will have /v2 added automatically.
298
+ * If false, all the iframe links will have /v1 added automatically.
299
+ * If undefined, nothing will be added
300
+ */
301
+ enableReactShell?: boolean | undefined;
297
302
  /**
298
303
  * The authentication mechanism to use.
299
304
  */
300
305
  authType: AuthType;
301
306
  /**
302
307
  * [AuthServer] The trusted authentication endpoint to use to get the
303
- * authentication token. A GET request is made to the
308
+ * authentication token. A `GET` request is made to the
304
309
  * authentication API endpoint, which returns the token
305
310
  * as a plaintext response. For trusted authentication,
306
311
  * the `authEndpoint` or `getAuthToken` attribute is required.
@@ -313,8 +318,8 @@ export interface EmbedConfig {
313
318
  * attribute is required.
314
319
  *
315
320
  * It is advisable to fetch a new token inside this method and not
316
- * reuse and older issued token, as because when auth expires this is
317
- * called again and if it is called with an older token the authentication
321
+ * reuse the old issued token. When auth expires this method is
322
+ * called again and if it is called with an older token, the authentication
318
323
  * will not succeed.
319
324
  */
320
325
  getAuthToken?: () => Promise<string>;
@@ -325,7 +330,7 @@ export interface EmbedConfig {
325
330
  username?: string;
326
331
 
327
332
  /**
328
- * [Basic] The ThoughtSpot login password corresponding to the user name
333
+ * [Basic] The ThoughtSpot login password corresponding to the username
329
334
  *
330
335
  * Warning: This feature is primarily intended for developer testing. It is
331
336
  * strongly advised not to use this authentication method in production.
@@ -334,7 +339,7 @@ export interface EmbedConfig {
334
339
 
335
340
  /**
336
341
  * [SSO] For SSO Authentication, if `noRedirect` is set to true, it will
337
- * open the SAML auth flow in a popup, instead of redirecting browser in
342
+ * open the SAML auth flow in a popup, instead of redirecting the browser in
338
343
  * place.
339
344
  *
340
345
  * @default false
@@ -344,10 +349,10 @@ export interface EmbedConfig {
344
349
 
345
350
  /**
346
351
  * [SSO] For SSO Authentication, if `inPopup` is set to true, it will open
347
- * the SAML auth flow in a popup, instead of redirecting browser in place.
352
+ * the SAML auth flow in a popup, instead of redirecting the browser in place.
348
353
  *
349
- * Need to use this with authTriggerContainer. Or manually trigger
350
- * the AuthEvent.TRIGGER_SSO_POPUP event on a user interaction.
354
+ * Need to use this with `authTriggerContainer`. Or manually trigger
355
+ * the `AuthEvent.TRIGGER_SSO_POPUP` event on a user interaction.
351
356
  *
352
357
  * @default false
353
358
  * @version SDK: 1.18.0
@@ -355,13 +360,13 @@ export interface EmbedConfig {
355
360
  inPopup?: boolean;
356
361
 
357
362
  /**
358
- * [SSO] For SSO Authentication, one can supply an optional path param,
359
- * this will be the path on the host origin where the SAML flow will be
363
+ * [SSO] For SSO Authentication, one can supply an optional path param;
364
+ * This will be the path on the host origin where the SAML flow will be
360
365
  * terminated.
361
366
  *
362
367
  * Eg: "/dashboard", "#/foo" [Do not include the host]
363
368
  *
364
- * @version SDK: 1.10.2 | 8.2.0.cl, 8.4.1.sw
369
+ * @version SDK: 1.10.2 | ThoughtSpot 8.2.0.cl, 8.4.1.sw
365
370
  */
366
371
  redirectPath?: string;
367
372
 
@@ -369,19 +374,19 @@ export interface EmbedConfig {
369
374
  basepath?: string;
370
375
 
371
376
  /**
372
- * Should we encode URL Query Params using base64 encoding which thoughtspot
373
- * will generate for embedding. This provides additional security to
374
- * thoughtspot clusters against Cross site scripting attacks.
377
+ * Boolean to define if the query parameters in the ThoughtSpot URL
378
+ * should be encoded in base64. This provides additional security to
379
+ * Thoughtspot clusters against cross-site scripting attacks.
375
380
  *
376
381
  * @default false
377
382
  */
378
383
  shouldEncodeUrlQueryParams?: boolean;
379
384
 
380
385
  /**
381
- * Suppress cookie access alert when third party cookies are blocked by the
382
- * user's browser. Third party cookie blocking is the default behaviour on
383
- * Safari and opt-in for Firefox/Chrome. If you set this to `true`, you are
384
- * encouraged to handle `noCookieAccess` event, to show your own treatment
386
+ * Suppress cookie access alert when third-party cookies are blocked by the
387
+ * user's browser. Third-party cookie blocking is the default behaviour on
388
+ * some web browsers like Safari. If you set this attribute to `true`,
389
+ * you are encouraged to handle `noCookieAccess` event, to show your own treatment
385
390
  * in this case.
386
391
  *
387
392
  * @default false
@@ -389,16 +394,17 @@ export interface EmbedConfig {
389
394
  suppressNoCookieAccessAlert?: boolean;
390
395
 
391
396
  /**
392
- * Ignore cookie access alert when third party cookies are blocked by the
397
+ * Ignore the cookie access alert when third-party cookies are blocked by the
393
398
  * user's browser. If you set this to `true`, the embedded iframe behaviour
394
- * persist even in case of non logged in user.
399
+ * persists even in the case of a non-logged-in user.
395
400
  *
396
401
  * @default false
397
402
  */
398
403
  ignoreNoCookieAccess?: boolean;
399
404
 
400
405
  /**
401
- * Re-login when session expires with the previous login options
406
+ * Re-login a user with the previous login options
407
+ * when a user session expires.
402
408
  *
403
409
  * @default false
404
410
  */
@@ -406,8 +412,9 @@ export interface EmbedConfig {
406
412
 
407
413
  /**
408
414
  * Disable redirection to the login page when the embedded session expires
409
- * This flag is typically used alongside the combination of auth modes such as {@link
410
- * AuthType.AuthServer} and auto login behavior {@link EmbedConfig.autoLogin}
415
+ * This flag is typically used alongside the combination of authentication modes such
416
+ * as {@link AuthType.AuthServer} and auto-login behavior {@link
417
+ * EmbedConfig.autoLogin}
411
418
  *
412
419
  * @version SDK: 1.9.3 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw
413
420
  * @default false
@@ -415,23 +422,23 @@ export interface EmbedConfig {
415
422
  disableLoginRedirect?: boolean;
416
423
 
417
424
  /**
418
- * This message is displayed on the embed view when the login fails.
425
+ * This message is displayed in the embedded view when a user login fails.
419
426
  *
420
427
  * @version SDK: 1.10.1 | ThoughtSpot: 8.2.0.cl, 8.4.1.sw
421
428
  */
422
429
  loginFailedMessage?: string;
423
430
 
424
431
  /**
425
- * Calls the prefetch method internally when set to true
432
+ * Calls the prefetch method internally when set to `true`
426
433
  *
427
434
  * @default false
428
435
  */
429
436
  callPrefetch?: boolean;
430
437
 
431
438
  /**
432
- * When there are multiple embeds, queue the render of embed to start
433
- * after the previous embed's render is complete. This helps in the load
434
- * performance by decreasing the load on the browser.
439
+ * When there are multiple objects embedded, queue the rendering of embedded objects
440
+ * to start after the previous embed's render is complete. This helps improve
441
+ * performance by decreasing the load on the browser.
435
442
  *
436
443
  * @Version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
437
444
  * @default false
@@ -439,7 +446,7 @@ export interface EmbedConfig {
439
446
  queueMultiRenders?: boolean;
440
447
 
441
448
  /**
442
- * Dynamic CSS Url to be injected in the loaded application.
449
+ * Dynamic CSS URL to be injected in the loaded application.
443
450
  * You would also need to set `style-src` in the CSP settings.
444
451
  *
445
452
  * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
@@ -447,9 +454,9 @@ export interface EmbedConfig {
447
454
  */
448
455
  customCssUrl?: string;
449
456
  /**
450
- * [AuthServer|Basic] Detect if 3rd party cookies are enabled by doing an
457
+ * [AuthServer|Basic] Detect if third-party party cookies are enabled by doing an
451
458
  * additional call. This is slower and should be avoided. Listen to the
452
- * NO_COOKIE_ACCESS event to handle the situation.
459
+ * `NO_COOKIE_ACCESS` event to handle the situation.
453
460
  *
454
461
  * This is slightly slower than letting the browser handle the cookie check, as it
455
462
  * involves an extra network call.
@@ -458,27 +465,27 @@ export interface EmbedConfig {
458
465
  */
459
466
  detectCookieAccessSlow?: boolean;
460
467
  /**
461
- * Hide beta alert warning message for SearchEmbed.
468
+ * Hide the `beta` alert warning message for SearchEmbed.
462
469
  *
463
470
  * @version SDK: 1.12.0 | ThoughtSpot: 8.4.0.cl, 8.4.1.sw*
464
471
  */
465
472
  suppressSearchEmbedBetaWarning?: boolean;
466
473
 
467
474
  /**
468
- * Hide beta alert warning message for SageEmbed.
475
+ * Hide `beta` alert warning message for SageEmbed.
469
476
  *
470
477
  */
471
478
  suppressSageEmbedBetaWarning?: boolean;
472
479
  /**
473
480
  * Custom style params for embed Config.
474
481
  *
475
- * @version SDK: 1.17.0 | ThoughtSpot: 8.9.0.cl
482
+ * @version SDK: 1.17.0 | ThoughtSpot: 8.9.0.cl, 9.0.1.sw
476
483
  */
477
484
  customizations?: CustomisationsInterface;
478
485
  /**
479
- * For inPopup SAMLRedirect or OIDCRedirect Auth, we need a button which the user
480
- * click to trigger the flow. This is the containing element
481
- * for that button.
486
+ * For `inPopup` SAMLRedirect or OIDCRedirect authentication, we need a
487
+ * button that the user can click to trigger the flow.
488
+ * This attribute sets a containing element for that button.
482
489
  *
483
490
  * @example
484
491
  * ```js
@@ -488,11 +495,11 @@ export interface EmbedConfig {
488
495
  * authTriggerContainer: '#auth-trigger-container'
489
496
  * })
490
497
  * ```
491
- * @version SDK: 1.17.0 | ThoughtSpot: *
498
+ * @version SDK: 1.17.0 | ThoughtSpot: 8.9.0.cl, 9.0.1.sw
492
499
  */
493
500
  authTriggerContainer?: string | HTMLElement;
494
501
  /**
495
- * Specify that we want to use the AuthEvent.TRIGGER_SSO_POPUP event to trigger
502
+ * Specify that we want to use the `AuthEvent.TRIGGER_SSO_POPUP` event to trigger
496
503
  * SAML popup. This is useful when you want to trigger the popup on a custom user
497
504
  * action.
498
505
  *
@@ -500,13 +507,15 @@ export interface EmbedConfig {
500
507
  useEventForSAMLPopup?: boolean;
501
508
  /**
502
509
  * Text to show in the button which triggers the popup auth flow.
503
- * Default: "Authorize".
510
+ * Default: `Authorize`.
504
511
  *
505
- * @version SDK: 1.17.0 | ThoughtSpot: *
512
+ * @version SDK: 1.17.0 | ThoughtSpot: 8.9.0.cl, 9.0.1.sw
506
513
  */
507
514
  authTriggerText?: string;
508
515
  /**
509
- * Disable Full App access of Embedded app outside of the iFrame.
516
+ * Prevent users from accessing the full application or ThoughtSpot application pages
517
+ * access to the embedded application users
518
+ * outside of the iframe.
510
519
  *
511
520
  * @default true
512
521
  * @version SDK: 1.22.0 | ThoughtSpot: 9.3.0.cl, 9.5.1.sw
@@ -514,7 +523,7 @@ export interface EmbedConfig {
514
523
  blockNonEmbedFullAppAccess?: boolean;
515
524
 
516
525
  /**
517
- * Host config incase embedded app is inside TS app itself
526
+ * Host config in case embedded app is inside TS app itself
518
527
  *
519
528
  * @hidden
520
529
  */
@@ -538,23 +547,38 @@ export interface EmbedConfig {
538
547
  * @version SDK: 1.26.2 | ThoughtSpot: *
539
548
  */
540
549
  suppressErrorAlerts?: boolean;
550
+
551
+ /**
552
+ * Log level for the SDK.
553
+ *
554
+ * @default LogLevel.ERROR
555
+ * @example
556
+ * ```js
557
+ * init({
558
+ * ...embedConfig,
559
+ * logLevel: LogLevel.SILENT
560
+ * })
561
+ * ```
562
+ * @version SDK: 1.26.5 | ThoughtSpot: 9.10.0.cl
563
+ */
564
+ logLevel?: LogLevel;
541
565
  }
542
566
 
543
567
  // eslint-disable-next-line @typescript-eslint/no-empty-interface
544
- export interface LayoutConfig { }
568
+ export interface LayoutConfig {}
545
569
 
546
570
  /**
547
- * Embedded iFrame configuration
571
+ * Embedded iframe configuration
548
572
  *
549
573
  * @group Embed components
550
574
  */
551
575
  export interface FrameParams {
552
576
  /**
553
- * The width of the iFrame (unit is pixels if numeric).
577
+ * The width of the iframe (unit is pixels if numeric).
554
578
  */
555
579
  width?: number | string;
556
580
  /**
557
- * The height of the iFrame (unit is pixels if numeric).
581
+ * The height of the iframe (unit is pixels if numeric).
558
582
  */
559
583
  height?: number | string;
560
584
  /**
@@ -657,7 +681,6 @@ export interface ViewConfig {
657
681
  */
658
682
  runtimeParameters?: RuntimeParameter[];
659
683
  /**
660
- /**
661
684
  * The locale/language to use for the embedded view.
662
685
  *
663
686
  * @version SDK: 1.9.4 | ThoughtSpot 8.1.0.cl, 8.4.1.sw
@@ -755,31 +778,30 @@ export interface ViewConfig {
755
778
  */
756
779
  reorderedHomepageModules?: HomepageModule[];
757
780
  /**
758
- * The list of tab IDs to show in the embedded.
759
- * Only this Tabs will be shown in their respective LBs.
760
- * Use this to show an tabID.
781
+ * The list of tab IDs to show in the embedded Liveboard.
782
+ * Only the tabs specified in the array will be shown in the Liveboard.
761
783
  *
762
- * Use either this or hiddenTabs.
784
+ * Use either `visibleTabs` or `hiddenTabs`.
763
785
  *
764
786
  * @example
765
787
  * ```js
766
- * const embed = new LiveboardEmbed('#embed', {
767
- * ... // other liveboard view config
768
- * visibleTabs: [
788
+ * visibleTabs: [
769
789
  * '430496d6-6903-4601-937e-2c691821af3c',
770
- * 'f547ec54-2a37-4516-a222-2b06719af726']
771
- * });
790
+ * 'f547ec54-2a37-4516-a222-2b06719af726']
772
791
  * ```
773
792
  * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
774
793
  */
775
794
  visibleTabs?: string[];
776
795
  /**
777
- * homepageLeftNavItems : show/hide Homeapage Left Nav Bar Items
778
- * There are 8 home nav list items, we will send those item as list
779
- * which we want to hide for TSE.
780
- * eg: hiddenHomeLeftNavItems = [HomeLeftNavItem.Home] to hide home.
796
+ * homepageLeftNavItems : Show or hide the left navigation bar items.
797
+ * There are 8 eight home navigation list items.
798
+ * To hide these items, specify the string in the array.
781
799
  *
782
- * @version SDK: 1.27.0 | Thoughtspot: 9.8.0.cl
800
+ * ```js
801
+ * hiddenHomeLeftNavItems = [HomeLeftNavItem.Home]
802
+ * ```
803
+ *
804
+ * @version SDK: 1.27.0 | Thoughtspot: 9.10.0.cl
783
805
  */
784
806
  hiddenHomeLeftNavItems?: HomeLeftNavItem[];
785
807
  /**
@@ -795,7 +817,7 @@ export interface ViewConfig {
795
817
  * });
796
818
  * embed.showPreRender();
797
819
  * ```
798
- * @version SDK: 1.25.0 | Thoughtspot: 9.6.0.cl
820
+ * @version SDK: 1.25.0 | Thoughtspot: 9.6.0.cl, 9.8.0.sw
799
821
  */
800
822
  preRenderId?: string;
801
823
 
@@ -839,7 +861,7 @@ export type MessagePayload = {
839
861
  status?: string;
840
862
  };
841
863
  /**
842
- * MessageOptions: By Providing options, getting specific event start / end based on
864
+ * MessageOptions: By providing options, getting specific event start / end based on
843
865
  * option
844
866
  *
845
867
  * @group Events
@@ -847,7 +869,7 @@ export type MessagePayload = {
847
869
  export type MessageOptions = {
848
870
  /**
849
871
  * A boolean value indicating that start status events of this type
850
- * will be dispatched
872
+ * will be dispatched.
851
873
  */
852
874
  start?: boolean;
853
875
  };
@@ -857,7 +879,7 @@ export type MessageOptions = {
857
879
  * @group Events
858
880
  */
859
881
  export type MessageCallback = (
860
- /* payload: Message payload contain type, data and status */
882
+ /* payload: Message payload contains type, data, and status */
861
883
  payload: MessagePayload,
862
884
  /**
863
885
  * responder: Message callback function triggered when embed event
@@ -870,7 +892,7 @@ export type MessageCallback = (
870
892
  */
871
893
  export type MessageCallbackObj = {
872
894
  /**
873
- * options: It contains start, A boolean value indicating that start
895
+ * options: It contains start, a boolean value indicating that start
874
896
  * status events of this type will be dispatched
875
897
  */
876
898
  /* callback: Embed event message callback */
@@ -948,7 +970,7 @@ export enum RuntimeFilterOp {
948
970
  }
949
971
 
950
972
  /**
951
- * Home page module that can be hide
973
+ * Home page module that can be hidden
952
974
  */
953
975
  // eslint-disable-next-line no-shadow
954
976
  export enum HomepageModule {
@@ -965,7 +987,7 @@ export enum HomepageModule {
965
987
  */
966
988
  Favorite = 'FAVORITE',
967
989
  /**
968
- * List of answers and liveboards
990
+ * List of answers and Liveboards
969
991
  */
970
992
  MyLibrary = 'MY_LIBRARY',
971
993
  /**
@@ -999,7 +1021,7 @@ export interface RuntimeFilter {
999
1021
  values: (number | boolean | string)[];
1000
1022
  }
1001
1023
  /**
1002
- * A filter that can be applied to ThoughtSpot answers, Liveboards, or
1024
+ * A filter that can be applied to ThoughtSpot Answers, Liveboards, or
1003
1025
  * visualizations at runtime.
1004
1026
  */
1005
1027
  export interface RuntimeParameter {
@@ -1038,12 +1060,26 @@ export enum EmbedEvent {
1038
1060
  /**
1039
1061
  * Rendering has initialized.
1040
1062
  *
1063
+ * @example
1064
+ *```js
1065
+ * liveboardEmbed.on(EmbedEvent.Init, showLoader)
1066
+ * //show a loader
1067
+ * function showLoader() {
1068
+ * document.getElementById("loader");
1069
+ * }
1070
+ *```
1041
1071
  * @returns timestamp - The timestamp when the event was generated.
1042
1072
  */
1043
1073
  Init = 'init',
1044
1074
  /**
1045
1075
  * Authentication has either succeeded or failed.
1046
1076
  *
1077
+ * @example
1078
+ *```js
1079
+ * appEmbed.on(EmbedEvent.AuthInit, payload => {
1080
+ * console.log('AuthInit', payload);
1081
+ * })
1082
+ *```
1047
1083
  * @returns isLoggedIn - A Boolean specifying whether authentication was successful.
1048
1084
  */
1049
1085
  AuthInit = 'authInit',
@@ -1051,37 +1087,91 @@ export enum EmbedEvent {
1051
1087
  * The embed object container has loaded.
1052
1088
  *
1053
1089
  * @returns timestamp - The timestamp when the event was generated.
1090
+ * @example
1091
+ *```js
1092
+ * liveboardEmbed.on(EmbedEvent.Load, hideLoader)
1093
+ * //hide loader
1094
+ * function hideLoader() {
1095
+ * document.getElementById("loader");
1096
+ * }
1097
+ *```
1054
1098
  */
1055
1099
  Load = 'load',
1056
1100
  /**
1057
1101
  * Data pertaining to answer or Liveboard is received
1058
1102
  *
1059
1103
  * @return data - The answer or Liveboard data
1104
+ * @example
1105
+ *```js
1106
+ * liveboardEmbed.on(EmbedEvent.Data, payload => {
1107
+ * console.log('data', payload);
1108
+ * })
1109
+ *```
1060
1110
  * @important
1061
1111
  */
1062
1112
  Data = 'data',
1063
1113
  /**
1064
- * Search/answer/Liveboard filters have been applied/updated by the user.
1114
+ * Search/Answer/Liveboard filters have been applied/updated by the user.
1065
1115
  *
1066
1116
  * @hidden
1067
1117
  */
1068
1118
  FiltersChanged = 'filtersChanged',
1069
1119
  /**
1070
1120
  * Search query has been updated by the user.
1121
+ *
1122
+ * @example
1123
+ *```js
1124
+ * searchEmbed.on(EmbedEvent.QueryChanged, payload => console.log('data', payload))
1125
+ *```
1071
1126
  */
1072
1127
  QueryChanged = 'queryChanged',
1073
1128
  /**
1074
- * A drill down operation has been performed.
1129
+ * A drill-down operation has been performed.
1075
1130
  *
1076
1131
  * @returns additionalFilters - Any additional filters applied
1077
1132
  * @returns drillDownColumns - The columns on which drill down was performed
1078
1133
  * @returns nonFilteredColumns - The columns that were not filtered
1134
+ * @example
1135
+ *```js
1136
+ * searchEmbed.trigger(HostEvent.DrillDown, {
1137
+ * points: {
1138
+ * clickedPoint,
1139
+ * selectedPoints: selectedPoint
1140
+ * },
1141
+ * autoDrillDown: true,
1142
+ * })
1143
+ *```
1144
+ * In this example, `VizPointDoubleClick` event is used for
1145
+ * triggering the `DrillDown` event when an area or specific
1146
+ * data point on a table or chart is double-clicked.
1147
+ * @example
1148
+ *```js
1149
+ * searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
1150
+ * console.log(payload);
1151
+ * const clickedPoint = payload.data.clickedPoint;
1152
+ * const selectedPoint = payload.data.selectedPoints;
1153
+ * console.log('>>> called', clickedPoint);
1154
+ * embed.trigger(HostEvent.DrillDown, {
1155
+ * points: {
1156
+ * clickedPoint,
1157
+ * selectedPoints: selectedPoint
1158
+ * },
1159
+ * autoDrillDown: true,
1160
+ * })
1161
+ * })
1162
+ *```
1079
1163
  */
1080
1164
  Drilldown = 'drillDown',
1081
1165
  /**
1082
1166
  * One or more data sources have been selected.
1083
1167
  *
1084
1168
  * @returns dataSourceIds - the list of data sources
1169
+ * @example
1170
+ * ```js
1171
+ * searchEmbed.on(EmbedEvent.DataSourceSelected, payload => {
1172
+ * console.log('DataSourceSelected', payload);
1173
+ * })
1174
+ * ```
1085
1175
  */
1086
1176
  DataSourceSelected = 'dataSourceSelected',
1087
1177
  /**
@@ -1089,25 +1179,49 @@ export enum EmbedEvent {
1089
1179
  *
1090
1180
  * @returns columnIds - the list of columns
1091
1181
  * @version SDK: 1.10.0 | ThoughtSpot: 8.2.0.cl, 8.4.1.sw
1182
+ * @example
1183
+ * ```js
1184
+ * appEmbed.on(EmbedEvent.AddRemoveColumns, payload => {
1185
+ * console.log('AddRemoveColumns', payload);
1186
+ * })
1187
+ * ```
1092
1188
  */
1093
1189
  AddRemoveColumns = 'addRemoveColumns',
1094
1190
  /**
1095
- * A custom action has been triggered
1191
+ * A custom action has been triggered.
1096
1192
  *
1097
- * @returns actionId - The id of the custom action
1098
- * @returns data - The answer or Liveboard data
1193
+ * @returns actionId - ID of the custom action
1194
+ * @returns data - Response payload with the Answer or Liveboard data
1195
+ * @example
1196
+ * ```js
1197
+ * appEmbed.on(EmbedEvent.customAction, payload => {
1198
+ * const data = payload.data;
1199
+ * if (data.id === 'insert Custom Action ID here') {
1200
+ * console.log('Custom Action event:', data.embedAnswerData);
1201
+ * }
1202
+ * })
1203
+ * ```
1099
1204
  */
1100
1205
  CustomAction = 'customAction',
1101
1206
  /**
1102
- * Listen to double clicks on a visualization
1207
+ * Listen to double click actions on a visualization.
1103
1208
  *
1104
- * @return ContextMenuInputPoints - data point that is double clicked
1209
+ * @return ContextMenuInputPoints - Data point that is double-clicked
1105
1210
  * @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
1211
+ * @example
1212
+ * ```js
1213
+ * livebaordEmbed.on(EmbedEvent.VizPointDoubleClick, payload => {
1214
+ * console.log('VizPointDoubleClick', payload)
1215
+ * })
1216
+ * ```
1106
1217
  */
1107
1218
  VizPointDoubleClick = 'vizPointDoubleClick',
1108
1219
  /**
1109
- * Listen to clicks on a visualization in a liveboard or Search result.
1220
+ * Listen to clicks on a visualization in a Liveboard or Search result.
1110
1221
  *
1222
+ * @return viz, clickedPoint - metadata about the point that is clicked
1223
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1224
+ * @important
1111
1225
  * @example
1112
1226
  * ```js
1113
1227
  * embed.on(ThoughtSpotEmbed.Event.VizPointClick, ({data}) => {
@@ -1120,25 +1234,42 @@ export enum EmbedEvent {
1120
1234
  * )
1121
1235
  * });
1122
1236
  * ```
1123
- * @return viz, clickedPoint - metadata about point that is clicked
1124
- * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1125
- * @important
1126
1237
  */
1127
1238
  VizPointClick = 'vizPointClick',
1128
1239
  /**
1129
1240
  * An error has occurred.
1130
1241
  *
1131
1242
  * @returns error - An error object or message
1243
+ * @example
1244
+ * ```js
1245
+ * SearchEmbed.on(EmbedEvent.Error, showErrorMsg)
1246
+ * //show error messaage
1247
+ * function showErrorMsg() {
1248
+ * document.getElementById("error");
1249
+ * ```
1132
1250
  */
1133
1251
  Error = 'Error',
1134
1252
  /**
1135
- * The embedded object has sent an alert
1253
+ * The embedded object has sent an alert.
1136
1254
  *
1137
1255
  * @returns alert - An alert object
1256
+ * @example
1257
+ * ```js
1258
+ * searchEmbed.on(EmbedEvent.Alert)
1259
+ * ```
1138
1260
  */
1139
1261
  Alert = 'alert',
1140
1262
  /**
1141
1263
  * The ThoughtSpot auth session has expired.
1264
+ *
1265
+ * @example
1266
+ *```js
1267
+ * appEmbed.on(EmbedEvent.AuthExpire, showAuthExpired)
1268
+ * //show auth expired banner
1269
+ * function showAuthExpired() {
1270
+ * document.getElementById("authExpiredBanner");
1271
+ * }
1272
+ *```
1142
1273
  */
1143
1274
  AuthExpire = 'ThoughtspotAuthExpired',
1144
1275
  /**
@@ -1168,14 +1299,27 @@ export enum EmbedEvent {
1168
1299
  */
1169
1300
  EmbedIframeCenter = 'EmbedIframeCenter',
1170
1301
  /**
1171
- * Emitted when the "Get Data" button in Search Bar embed
1172
- * is clicked.
1302
+ * Emitted when the **Get Data** action is initiated.
1303
+ * Applicable to `SearchBarEmbed` only.
1173
1304
  *
1174
- * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.0.sw
1305
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
1306
+ * @example
1307
+ *```js
1308
+ * searchbarEmbed.on(EmbedEvent.GetDataClick)
1309
+ * .then(data => {
1310
+ * console.log('Answer Data:', data);
1311
+ * })
1312
+ *```
1175
1313
  */
1176
1314
  GetDataClick = 'getDataClick',
1177
1315
  /**
1178
1316
  * Detects the route change.
1317
+ *
1318
+ * @example
1319
+ *```js
1320
+ * searchEmbed.on(EmbedEvent.RouteChange, payload =>
1321
+ * console.log('data', payload))
1322
+ *```
1179
1323
  */
1180
1324
  RouteChange = 'ROUTE_CHANGE',
1181
1325
  /**
@@ -1185,10 +1329,15 @@ export enum EmbedEvent {
1185
1329
  */
1186
1330
  V1Data = 'exportVizDataToParent',
1187
1331
  /**
1188
- * Emitted when the embed does not have cookie access. This
1189
- * happens on Safari where third-party cookies are blocked by default.
1332
+ * Emitted when the embed does not have cookie access. This happens
1333
+ * when Safari and other Web browsers block third-party cookies
1334
+ * are blocked by default. `NoCookieAccess` can trigger
1190
1335
  *
1191
- * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 7.2.1
1336
+ * @example
1337
+ *```js
1338
+ * appEmbed.on(EmbedEvent.NoCookieAccess)
1339
+ *```
1340
+ * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 7.2.1.sw
1192
1341
  */
1193
1342
  NoCookieAccess = 'noCookieAccess',
1194
1343
  /**
@@ -1202,12 +1351,24 @@ export enum EmbedEvent {
1202
1351
  * Emitted when any modal is opened in the app
1203
1352
  *
1204
1353
  * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
1354
+ * @example
1355
+ *```js
1356
+ * appEmbed.on(EmbedEvent.DialogOpen, payload => {
1357
+ * console.log('dialog open', payload);
1358
+ * })
1359
+ *```
1205
1360
  */
1206
1361
  DialogOpen = 'dialog-open',
1207
1362
  /**
1208
1363
  * Emitted when any modal is closed in the app
1209
1364
  *
1210
1365
  * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
1366
+ * @example
1367
+ *```js
1368
+ * appEmbed.on(EmbedEvent.DialogClose, payload => {
1369
+ * console.log('dialog close', payload);
1370
+ * })
1371
+ *```
1211
1372
  */
1212
1373
  DialogClose = 'dialog-close',
1213
1374
  /**
@@ -1216,6 +1377,21 @@ export enum EmbedEvent {
1216
1377
  * other events on the rendered Liveboard.
1217
1378
  *
1218
1379
  * @version SDK: 1.9.1 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw
1380
+ * @example
1381
+ *```js
1382
+ * liveboardEmbed.on(EmbedEvent.LiveboardRendered, payload => {
1383
+ console.log('Liveboard is rendered', payload);
1384
+ })
1385
+ *```
1386
+ * The following example shows how to trigger
1387
+ * `SetVisibleVizs` event using LiveboardRendered embed event:
1388
+ * @example
1389
+ *```js
1390
+ * const embedRef = useEmbedRef();
1391
+ * const onLiveboardRendered = () => {
1392
+ * embed.trigger(HostEvent.SetVisibleVizs, ['viz1', 'viz2']);
1393
+ * };
1394
+ *```
1219
1395
  */
1220
1396
  LiveboardRendered = 'PinboardRendered',
1221
1397
  /**
@@ -1223,216 +1399,470 @@ export enum EmbedEvent {
1223
1399
  * is triggered on all events.
1224
1400
  *
1225
1401
  * @Version SDK: 1.10.0 | ThoughtSpot: 8.2.0.cl, 8.4.1.sw
1402
+ * @example
1403
+ *```js
1404
+ * appEmbed.on(EmbedEvent.ALL, payload => {
1405
+ * console.log('Embed Events', payload)
1406
+ * })
1407
+ *```
1226
1408
  */
1227
1409
  ALL = '*',
1228
1410
  /**
1229
1411
  * Emitted when an Answer is saved in the app
1230
1412
  *
1231
1413
  * @Version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1414
+ * @example
1415
+ *```js
1416
+ * //trigger when action starts
1417
+ * searchEmbed.on(EmbedEvent.Save, payload => {
1418
+ * console.log('Save', payload)
1419
+ * }, {
1420
+ * start: true
1421
+ * })
1422
+ * //trigger when action ends
1423
+ * searchEmbed.on(EmbedEvent.Save, payload => {
1424
+ * console.log('Save', payload)
1425
+ * })
1426
+ *```
1232
1427
  */
1233
1428
  Save = 'save',
1234
1429
  /**
1235
1430
  * Emitted when the download action is triggered on an answer
1236
1431
  *
1432
+ * **Note**: This event is deprecated in v1.21.0.
1433
+ * To fire an event when a download action is initiated on a chart or table,
1434
+ * use `EmbedEvent.DownloadAsPng`, `EmbedEvent.DownloadAsPDF`, `EmbedEvent.DownloadAsCSV`,
1435
+ * or `EmbedEvent.DownloadAsXLSX`
1436
+ *
1237
1437
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1438
+ * @example
1439
+ *```js
1440
+ * liveboardEmbed.trigger(HostEvent.Download, {
1441
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
1442
+ * })
1443
+ *```
1238
1444
  */
1239
1445
  Download = 'download',
1240
1446
  /**
1241
1447
  * Emitted when the download action is triggered on an answer
1242
1448
  *
1243
1449
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.0.sw
1450
+ * @example
1451
+ *```js
1452
+ * //trigger when action starts
1453
+ * searchEmbed.on(EmbedEvent.DownloadAsPng, payload => {
1454
+ * console.log('download PNG', payload)}, {start: true })
1455
+ * //trigger when action ends
1456
+ * searchEmbed.on(EmbedEvent.DownloadAsPng, payload => {
1457
+ * console.log('download PNG', payload)})
1458
+ *```
1244
1459
  */
1245
1460
  DownloadAsPng = 'downloadAsPng',
1246
1461
  /**
1247
1462
  * Emitted when the Download as PDF action is triggered on an answer
1248
1463
  *
1249
1464
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1465
+ * @example
1466
+ *```js
1467
+ * //trigger when action starts
1468
+ * searchEmbed.on(EmbedEvent.DownloadAsPdf, payload => {
1469
+ * console.log('download PDF', payload)}, {start: true })
1470
+ * //trigger when action ends
1471
+ * searchEmbed.on(EmbedEvent.DownloadAsPdf, payload => {
1472
+ * console.log('download PDF', payload)})
1473
+ *```
1250
1474
  */
1251
1475
  DownloadAsPdf = 'downloadAsPdf',
1252
1476
  /**
1253
1477
  * Emitted when the Download as CSV action is triggered on an answer
1254
1478
  *
1255
1479
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1480
+ * @example
1481
+ *```js
1482
+ * //trigger when action starts
1483
+ * searchEmbed.on(EmbedEvent.DownloadAsCSV, payload => {
1484
+ * console.log('download CSV', payload)}, {start: true })
1485
+ * //trigger when action ends
1486
+ * searchEmbed.on(EmbedEvent.DownloadAsCSV, payload => {
1487
+ * console.log('download CSV', payload)})
1488
+ *```
1256
1489
  */
1257
1490
  DownloadAsCsv = 'downloadAsCsv',
1258
1491
  /**
1259
1492
  * Emitted when the Download as XLSX action is triggered on an answer
1260
1493
  *
1261
1494
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1495
+ * @example
1496
+ *```js
1497
+ * //trigger when action starts
1498
+ * searchEmbed.on(EmbedEvent.DownloadAsXlsx, payload => {
1499
+ * console.log('download Xlsx', payload)}, { start: true })
1500
+ * //trigger when action ends
1501
+ * searchEmbed.on(EmbedEvent.DownloadAsXlsx, payload => {
1502
+ * console.log('download Xlsx', payload)})
1503
+ *```
1262
1504
  */
1263
1505
  DownloadAsXlsx = 'downloadAsXlsx',
1264
1506
  /**
1265
- * Emitted when an answer is deleted in the app
1507
+ * Emitted when an Answer is deleted in the app
1266
1508
  *
1267
1509
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1510
+ * @example
1511
+ *```js
1512
+ * //trigger when action starts
1513
+ * appEmbed.on(EmbedEvent.AnswerDelete, payload => {
1514
+ * console.log('delete answer', payload)}, {start: true })
1515
+ * //trigger when action is completed
1516
+ * appEmbed.on(EmbedEvent.AnswerDelete, payload => {
1517
+ * console.log('delete answer', payload)})
1518
+ *```
1268
1519
  */
1269
1520
  AnswerDelete = 'answerDelete',
1270
1521
  /**
1271
1522
  * Emitted when an answer is pinned to a Liveboard
1272
1523
  *
1273
1524
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1525
+ * @example
1526
+ *```js
1527
+ * //trigger when action starts
1528
+ * searchEmbed.on(EmbedEvent.Pin, payload => {
1529
+ * console.log('pin', payload)
1530
+ * }, {
1531
+ * start: true
1532
+ * })
1533
+ * //trigger when action ends
1534
+ * searchEmbed.on(EmbedEvent.Pin, payload => {
1535
+ * console.log('pin', payload)
1536
+ * })
1537
+ *```
1274
1538
  */
1275
1539
  Pin = 'pin',
1276
1540
  /**
1277
1541
  * Emitted when SpotIQ analysis is triggered
1278
1542
  *
1279
1543
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1544
+ * @example
1545
+ *```js
1546
+ * //trigger when action starts
1547
+ * searchEmbed.on(EmbedEvent.SpotIQAnalyze, payload => {
1548
+ * console.log('SpotIQAnalyze', payload)
1549
+ * }, {
1550
+ * start: true
1551
+ * })
1552
+ * //trigger when action ends
1553
+ * searchEmbed.on(EmbedEvent.SpotIQAnalyze, payload => {
1554
+ * console.log('SpotIQ analyze', payload)
1555
+ * })
1556
+ *```
1280
1557
  */
1281
1558
  SpotIQAnalyze = 'spotIQAnalyze',
1282
1559
  /**
1283
1560
  * Emitted when a user shares an object with another user or group
1284
1561
  *
1285
1562
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1563
+ * @example
1564
+ *```js
1565
+ * //trigger when action starts
1566
+ * searchEmbed.on(EmbedEvent.Share, payload => {
1567
+ * console.log('Share', payload)
1568
+ * }, {
1569
+ * start: true
1570
+ * })
1571
+ * //trigger when action ends
1572
+ * searchEmbed.on(EmbedEvent.Share, payload => {
1573
+ * console.log('Share', payload)
1574
+ * })
1575
+ *```
1286
1576
  */
1287
1577
  Share = 'share',
1288
1578
  /**
1289
- * Emitted when a user clicks the Include action to include a specific value or data
1290
- * on a chart or table
1579
+ * Emitted when a user clicks the **Include** action to include a specific value or
1580
+ * data on a chart or table.
1291
1581
  *
1292
1582
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1583
+ * @example
1584
+ *```js
1585
+ * appEmbed.on(EmbedEvent.DrillInclude, payload => {
1586
+ * console.log('Drill include', payload);
1587
+ * })
1588
+ *```
1293
1589
  */
1294
1590
  DrillInclude = 'context-menu-item-include',
1295
1591
  /**
1296
- * Emitted when a user clicks the Exclude action to exclude a specific value or data
1297
- * on a chart or table
1592
+ * Emitted when a user clicks the **Exclude** action to exclude a specific value or
1593
+ * data on a chart or table
1298
1594
  *
1299
1595
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1596
+ * @example
1597
+ *```js
1598
+ * appEmbed.on(EmbedEvent.DrillExclude, payload => {
1599
+ * console.log('Drill exclude', payload);
1600
+ * })
1601
+ *```
1300
1602
  */
1301
1603
  DrillExclude = 'context-menu-item-exclude',
1302
1604
  /**
1303
- * Emitted when copied column value on the app
1605
+ * Emitted when a column value is copied in the embedded app.
1304
1606
  *
1305
1607
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1608
+ * @example
1609
+ *```js
1610
+ * seachEmbed.on(EmbedEvent.CopyToClipboard, payload => {
1611
+ * console.log('copy to clipboard', payload);
1612
+ * })
1613
+ *```
1306
1614
  */
1307
1615
  CopyToClipboard = 'context-menu-item-copy-to-clipboard',
1308
1616
  /**
1309
- * Emitted when a user clicks the Update TML action
1617
+ * Emitted when a user clicks the **Update TML** action
1310
1618
  *
1311
1619
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1620
+ * @example
1621
+ *```js
1622
+ * liveboardEmbed.on(EmbedEvent.UpdateTML)
1623
+ * })
1624
+ *```
1312
1625
  */
1313
1626
  UpdateTML = 'updateTSL',
1314
1627
  /**
1315
- * Emitted when a user clicks the Edit TML action
1628
+ * Emitted when a user clicks the **Edit TML** action
1316
1629
  *
1317
1630
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1631
+ * @example
1632
+ *```js
1633
+ * appEmbed.on(EmbedEvent.EditTML, payload => {
1634
+ * console.log('Edit TML', payload);
1635
+ * })
1636
+ *```
1318
1637
  */
1319
1638
  EditTML = 'editTSL',
1320
1639
  /**
1321
- * Emitted when ExportTML trigger in answer on the app
1640
+ * Emitted when the **Export TML** action is triggered on an
1641
+ * an embedded object in the app
1322
1642
  *
1323
1643
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1644
+ * @example
1645
+ *```js
1646
+ * //trigger when action starts
1647
+ * searchEmbed.on(EmbedEvent.ExportTML, payload => {
1648
+ * console.log('Export TML', payload)}, { start: true })
1649
+ * //trigger when action ends
1650
+ * searchEmbed.on(EmbedEvent.ExportTML, payload => {
1651
+ * console.log('Export TML', payload)})
1652
+ *```
1324
1653
  */
1325
1654
  ExportTML = 'exportTSL',
1326
1655
  /**
1327
- * Emitted when an answer is saved as a view
1656
+ * Emitted when an Answer is saved as a View.
1328
1657
  *
1329
1658
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1659
+ * @example
1660
+ *```js
1661
+ * appEmbed.on(EmbedEvent.SaveAsView, payload => {
1662
+ * console.log('View', payload);
1663
+ * })
1664
+ *```
1330
1665
  */
1331
1666
  SaveAsView = 'saveAsView',
1332
1667
  /**
1333
- * Emitted when copy of existing answer on the app
1668
+ * Emitted when the user creates a copy of an Answer
1334
1669
  *
1335
1670
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1671
+ * @example
1672
+ *```js
1673
+ * //trigger when action starts
1674
+ * appEmbed.on(EmbedEvent.CopyAEdit, payload => {
1675
+ * console.log('Copy and edit', payload)}, {start: true })
1676
+ * //trigger when action ends
1677
+ * appEmbed.on(EmbedEvent.CopyAEdit, payload => {
1678
+ * console.log('Copy and edit', payload)})
1679
+ *```
1336
1680
  */
1337
1681
  CopyAEdit = 'copyAEdit',
1338
1682
  /**
1339
- * Emitted when a user clicks Show underlying data on an answe
1683
+ * Emitted when a user clicks Show underlying data on an Answer
1340
1684
  *
1341
1685
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1686
+ * @example
1687
+ *```js
1688
+ * liveboardEmbed.on(EmbedEvent.ShowUnderlyingData, payload => {
1689
+ * console.log('show data', payload);
1690
+ * })
1691
+ *```
1342
1692
  */
1343
1693
  ShowUnderlyingData = 'showUnderlyingData',
1344
1694
  /**
1345
- * Emitted when an answer is switched to a chart or table view
1695
+ * Emitted when an answer is switched to a chart or table view.
1346
1696
  *
1347
1697
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1698
+ * @example
1699
+ *```js
1700
+ * searchEmbed.on(EmbedEvent.AnswerChartSwitcher, payload => {
1701
+ * console.log('switch view', payload);
1702
+ * })
1703
+ *```
1348
1704
  */
1349
1705
  AnswerChartSwitcher = 'answerChartSwitcher',
1350
1706
  /**
1351
- * Internal event to communicate the initial settings back to the TS APP
1707
+ * Internal event to communicate the initial settings back to the ThoughtSpot app
1352
1708
  *
1353
1709
  * @hidden
1354
1710
  */
1355
1711
  APP_INIT = 'appInit',
1356
1712
  /**
1357
- * Emitted when a user clicks Show Liveboard details on a Liveboard
1713
+ * Emitted when a user clicks **Show Liveboard details** on a Liveboard
1358
1714
  *
1359
1715
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1716
+ * @example
1717
+ *```js
1718
+ * liveboardEmbed.on(EmbedEvent.AnswerChartSwitcher, payload => {
1719
+ * console.log('Liveboard details', payload);
1720
+ * })
1721
+ *```
1360
1722
  */
1361
1723
  LiveboardInfo = 'pinboardInfo',
1362
1724
  /**
1363
1725
  * Emitted when a user clicks on the Favorite icon on a Liveboard
1364
1726
  *
1365
1727
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1728
+ * @example
1729
+ *```js
1730
+ * liveboardEmbed.on(EmbedEvent.AddToFavorites, payload => {
1731
+ * console.log('favorites', payload);
1732
+ * })
1733
+ *```
1366
1734
  */
1367
1735
  AddToFavorites = 'addToFavorites',
1368
1736
  /**
1369
- * Emitted when a user clicks Schedule on a Liveboard
1737
+ * Emitted when a user clicks **Schedule** on a Liveboard
1370
1738
  *
1371
1739
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1740
+ * @example
1741
+ *```js
1742
+ * liveboardEmbed.on(EmbedEvent.Schedule, payload => {
1743
+ * console.log(`Liveboard schedule', payload);
1744
+ * })
1745
+ *```
1372
1746
  */
1373
1747
  Schedule = 'subscription',
1374
1748
  /**
1375
- * Emitted when a user clicks Edit on a Liveboard or visualization
1749
+ * Emitted when a user clicks **Edit** on a Liveboard or visualization
1376
1750
  *
1377
1751
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1752
+ * @example
1753
+ *```js
1754
+ * liveboardEmbed.on(EmbedEvent.Edit, payload => {
1755
+ * console.log(`Liveboard edit', payload);
1756
+ * })
1757
+ *```
1378
1758
  */
1379
1759
  Edit = 'edit',
1380
1760
  /**
1381
- * Emitted when a user clicks Make a copy on a Liveboard
1761
+ * Emitted when a user clicks *Make a copy* on a Liveboard
1382
1762
  *
1383
1763
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1764
+ * @example
1765
+ *```js
1766
+ * liveboardEmbed.on(EmbedEvent.MakeACopy, payload => {
1767
+ * console.log(`Copy', payload);
1768
+ * })
1769
+ *```
1384
1770
  */
1385
1771
  MakeACopy = 'makeACopy',
1386
1772
  /**
1387
- * Emitted when a user clicks Present on a Liveboard or visualization
1773
+ * Emitted when a user clicks **Present** on a Liveboard or visualization
1388
1774
  *
1389
1775
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1776
+ * @example
1777
+ *```js
1778
+ * liveboardEmbed.trigger(HostEvent.Present)
1779
+ *```
1780
+ * @example
1781
+ *```js
1782
+ * liveboardEmbed.on(EmbedEvent.Present, {
1783
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1784
+ * })
1785
+ *```
1390
1786
  */
1391
1787
  Present = 'present',
1392
1788
  /**
1393
- * Emitted when a user clicks Delete on a Liveboard
1789
+ * Emitted when a user clicks **Delete** on a visualization
1394
1790
  *
1395
1791
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1792
+ * @example
1793
+ *```js
1794
+ * liveboardEmbed.trigger(HostEvent.Delete,
1795
+ * {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1796
+ *```
1396
1797
  */
1397
1798
  Delete = 'delete',
1398
1799
  /**
1399
1800
  * Emitted when a user clicks Manage schedules on a Liveboard
1400
1801
  *
1401
1802
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1803
+ * @example
1804
+ *```js
1805
+ * liveboardEmbed.trigger(HostEvent.SchedulesList)
1806
+ *```
1402
1807
  */
1403
1808
  SchedulesList = 'schedule-list',
1404
1809
  /**
1405
- * Emitted when a user clicks Cancel in edit mode on a Liveboard
1810
+ * Emitted when a user clicks **Cancel** in edit mode on a Liveboard
1406
1811
  *
1407
1812
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1813
+ * @example
1814
+ *```js
1815
+ * liveboardEmbed.trigger(HostEvent.Cancel)
1816
+ *```
1408
1817
  */
1409
1818
  Cancel = 'cancel',
1410
1819
  /**
1411
- * Emitted when a user clicks Explore on a visualization
1820
+ * Emitted when a user clicks **Explore** on a visualization
1412
1821
  *
1413
1822
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1823
+ * @example
1824
+ *```js
1825
+ * liveboardEmbed.trigger(HostEvent.Explore, {
1826
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1827
+ *```
1414
1828
  */
1415
1829
  Explore = 'explore',
1416
1830
  /**
1417
- * Emitted when a user clicks Copy link action on a visualization
1831
+ * Emitted when a user clicks **Copy link** action on a visualization
1418
1832
  *
1419
1833
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1834
+ * @example
1835
+ *```js
1836
+ * liveboardEmbed.trigger(HostEvent.CopyLink, {
1837
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1838
+ *```
1420
1839
  */
1421
1840
  CopyLink = 'embedDocument',
1422
1841
  /**
1423
- * Emitted when a user interacts with cross filters on a visualization or liveboard
1842
+ * Emitted when a user interacts with cross filters on a visualization or Liveboard
1424
1843
  *
1425
- * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
1844
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.0.sw
1845
+ * @example
1846
+ *```js
1847
+ * liveboardEmbed.trigger(HostEvent.CrossFilterChanged, {
1848
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1849
+ *```
1426
1850
  */
1427
1851
  CrossFilterChanged = 'cross-filter-changed',
1428
1852
  /**
1429
1853
  * Emitted when a user right clicks on a visualization (chart or table)
1430
1854
  *
1431
- * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
1855
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.0.sw
1856
+ * @example
1857
+ *```js
1858
+ * LiveboardEmbed.on(EmbedEvent.VizPointRightClick, payload => {
1859
+ * console.log('VizPointClick', payload)
1860
+ * })
1861
+ *```
1432
1862
  */
1433
1863
  VizPointRightClick = 'vizPointRightClick',
1434
1864
  /**
1435
- * Emitted when a user clicks on Insert to slide on a visualization
1865
+ * Emitted when a user clicks **Insert to slide** on a visualization
1436
1866
  *
1437
1867
  * @hidden
1438
1868
  */
@@ -1440,52 +1870,52 @@ export enum EmbedEvent {
1440
1870
  /**
1441
1871
  * @hidden
1442
1872
  * Emitted when a user changes any filter on a Liveboard.
1443
- * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
1873
+ * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl, 9.5.0.sw
1444
1874
  */
1445
1875
  FilterChanged = 'filterChanged',
1446
1876
  /**
1447
- * Emitted when a user click on Go button in Sage Embed
1877
+ * Emitted when a user clicks the **Go** button on the Search page
1448
1878
  *
1449
- * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
1879
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
1450
1880
  */
1451
1881
  SageEmbedQuery = 'sageEmbedQuery',
1452
1882
  /**
1453
- * Emitten when a user select data source in Sage Embed
1883
+ * Emitted when a user selects a data source.
1454
1884
  *
1455
- * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
1885
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
1456
1886
  */
1457
1887
  SageWorksheetUpdated = 'sageWorksheetUpdated',
1458
1888
  /**
1459
- * Emitted when a user updates a connection in Data tab
1889
+ * Emitted when a user updates a connection on the **Data** page
1460
1890
  *
1461
- * @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl
1891
+ * @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl, 9.8.0.sw
1462
1892
  */
1463
1893
  UpdateConnection = 'updateConnection',
1464
1894
  /**
1465
- * Emitted when a user updates a connection in Data tab
1895
+ * Emitted when a user updates a connection on the **Data** page
1466
1896
  *
1467
- * @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl
1897
+ * @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl, 9.8.0.sw
1468
1898
  */
1469
1899
  CreateConnection = 'createConnection',
1470
1900
  /**
1471
1901
  * Emitted when name, status (private or public) or filter values of a
1472
- * PersonalisedView is updated.
1902
+ * Personalised view is updated.
1473
1903
  *
1474
1904
  * @returns viewName: string
1475
1905
  * @returns viewId: string
1476
1906
  * @returns liveboardId: string
1477
1907
  * @returns isPublic: boolean
1478
- * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
1908
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
1479
1909
  */
1480
1910
  UpdatePersonalisedView = 'updatePersonalisedView',
1481
1911
  /**
1482
- * Emitted when a PersonalisedView is saved.
1912
+ * Emitted when a Personalised view is saved.
1483
1913
  *
1484
1914
  * @returns viewName: string
1485
1915
  * @returns viewId: string
1486
1916
  * @returns liveboardId: string
1487
1917
  * @returns isPublic: boolean
1488
- * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
1918
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
1489
1919
  */
1490
1920
  SavePersonalisedView = 'savePersonalisedView',
1491
1921
  /**
@@ -1495,7 +1925,7 @@ export enum EmbedEvent {
1495
1925
  * @returns viewId: string
1496
1926
  * @returns liveboardId: string
1497
1927
  * @returns isPublic: boolean
1498
- * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
1928
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
1499
1929
  */
1500
1930
  ResetLiveboard = 'resetLiveboard',
1501
1931
  /**
@@ -1503,20 +1933,30 @@ export enum EmbedEvent {
1503
1933
  *
1504
1934
  * @returns views: string[]
1505
1935
  * @returns liveboardId: string
1506
- * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
1936
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
1507
1937
  */
1508
1938
  DeletePersonalisedView = 'deletePersonalisedView',
1509
1939
  /**
1510
- * Emitten when a user creates a new worksheet
1940
+ * Emitted when a user creates a new worksheet
1511
1941
  *
1512
1942
  * @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl
1513
1943
  */
1514
1944
  CreateWorksheet = 'createWorksheet',
1515
1945
  /**
1516
- * Emitted when a LB/viz is renamed
1517
- *
1518
- * @version SDK : 1.28.0 | ThoughtSpot: 9.11.0.cl
1519
- */
1946
+ * Emitted when Ask Sage is initialized.
1947
+ *
1948
+ * @returns viewName: string
1949
+ * @returns viewId: string
1950
+ * @returns liveboardId: string
1951
+ * @returns isPublic: boolean
1952
+ * @version SDK : 1.29.0 | Thoughtspot: 9.12.0.cl
1953
+ */
1954
+ AskSageInit = 'AskSageInit',
1955
+ /**
1956
+ * Emitted when a LB/viz is renamed
1957
+ *
1958
+ * @version SDK : 1.28.0 | ThoughtSpot: 9.11.0.cl
1959
+ */
1520
1960
  Rename = 'rename',
1521
1961
  }
1522
1962
 
@@ -1545,15 +1985,16 @@ export enum EmbedEvent {
1545
1985
  // eslint-disable-next-line no-shadow
1546
1986
  export enum HostEvent {
1547
1987
  /**
1548
- * Triggers a search query in AppEmbed and SearchEmbed
1549
- * deployments.
1988
+ * Triggers a search operation with the search tokens specified in
1989
+ * the search query string.
1990
+ * Supported in `AppEmbed` and `SearchEmbed` deployments.
1550
1991
  * Includes the following properties:
1551
1992
  *
1552
- * @param - dataSourceIds - The data source GUID to Search on
1993
+ * @param - `searchQuery` - query string with search tokens
1994
+ * @param - `dataSources` - Data source GUID to Search on
1553
1995
  * - Although an array, only a single source
1554
1996
  * is supported.
1555
- * @param - searchQuery - Query string with search tokens
1556
- * @param - execute - executes the existing / updated query
1997
+ * @param - `execute` - executes search and updates the existing query
1557
1998
  * @example
1558
1999
  * ```js
1559
2000
  * searchembed.trigger(HostEvent.Search, {
@@ -1573,6 +2014,10 @@ export enum HostEvent {
1573
2014
  * @param - columnGuid - Optional. GUID of the column to drill
1574
2015
  * by. If not provided it will auto drill by the configured
1575
2016
  * column.
2017
+ * @param - autoDrillDown - Optional. If true, the drill down will be
2018
+ * done automatically on the most popular column.
2019
+ * @param - vizId [TS >= 9.8.0] - Optional. The GUID of the visualization to drill
2020
+ * in case of a liveboard.
1576
2021
  * @example
1577
2022
  * ```js
1578
2023
  * searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
@@ -1589,6 +2034,25 @@ export enum HostEvent {
1589
2034
  * });
1590
2035
  * })
1591
2036
  * ```
2037
+ * @example
2038
+ * ```js
2039
+ * // Works with TS 9.8.0 and above
2040
+ *
2041
+ * liveboardEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
2042
+ * console.log(payload);
2043
+ * const clickedPoint = payload.data.clickedPoint;
2044
+ * const selectedPoint = payload.data.selectedPoints;
2045
+ * console.log('>>> called', clickedPoint);
2046
+ * liveboardEmbed.trigger(HostEvent.DrillDown, {
2047
+ * points: {
2048
+ * clickedPoint,
2049
+ * selectedPoints: selectedPoint
2050
+ * },
2051
+ * autoDrillDown: true,
2052
+ * vizId: payload.data.vizId
2053
+ * });
2054
+ * })
2055
+ * ```
1592
2056
  * @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
1593
2057
  */
1594
2058
  DrillDown = 'triggerDrillDown',
@@ -1605,7 +2069,7 @@ export enum HostEvent {
1605
2069
  */
1606
2070
  Reload = 'reload',
1607
2071
  /**
1608
- * Sets the visible visualizations on a Liveboard.
2072
+ * Display specific visualizations on a Liveboard.
1609
2073
  *
1610
2074
  * @param - An array of GUIDs of the visualization to show. The visualization IDs not passed
1611
2075
  * in this parameter will be hidden.
@@ -1619,7 +2083,7 @@ export enum HostEvent {
1619
2083
  */
1620
2084
  SetVisibleVizs = 'SetPinboardVisibleVizs',
1621
2085
  /**
1622
- * Set the Active Tab of a Liveboard.
2086
+ * Set a Liveboard tab as an active tab.
1623
2087
  *
1624
2088
  * @param - tabId - string of id of Tab to show
1625
2089
  * @example
@@ -1632,7 +2096,7 @@ export enum HostEvent {
1632
2096
  */
1633
2097
  SetActiveTab = 'SetActiveTab',
1634
2098
  /**
1635
- * Updates runtime filters applied on a Saved Answer or Liveboard. The
2099
+ * Update runtime filters applied on a Saved Answer or Liveboard. The
1636
2100
  * runtime filters passed here are appended to the existing runtime
1637
2101
  * filters.
1638
2102
  * Pass an array of runtime filters with the following attributes:
@@ -1658,10 +2122,11 @@ export enum HostEvent {
1658
2122
  */
1659
2123
  UpdateRuntimeFilters = 'UpdateRuntimeFilters',
1660
2124
  /**
1661
- * Navigate to a specific page in the embedded application without reloading the page.
2125
+ * Navigate to a specific page in the embedded ThoughtSpot application.
1662
2126
  * This is the same as calling `appEmbed.navigateToPage(path, true)`
1663
2127
  *
1664
- * @param - path - the path to navigate to (can be a number[1/-1] to go forward/back)
2128
+ * @param - `path` - the path to navigate to to go forward or back. The path value can
2129
+ * be a number; for example, `1`, `-1`.
1665
2130
  * @example
1666
2131
  * ```js
1667
2132
  * appEmbed.navigateToPage(-1)
@@ -1670,7 +2135,7 @@ export enum HostEvent {
1670
2135
  */
1671
2136
  Navigate = 'Navigate',
1672
2137
  /**
1673
- * Opens the filter panel for a particular column.
2138
+ * Open the filter panel for a particular column.
1674
2139
  * Works with Search and Liveboard embed.
1675
2140
  *
1676
2141
  * @param - { columnId: string,
@@ -1688,7 +2153,7 @@ export enum HostEvent {
1688
2153
  */
1689
2154
  OpenFilter = 'openFilter',
1690
2155
  /**
1691
- * Adds columns to the current search query.
2156
+ * Add columns to the current search query.
1692
2157
  *
1693
2158
  * @param - { columnIds: string[] }
1694
2159
  * @example
@@ -1699,7 +2164,7 @@ export enum HostEvent {
1699
2164
  */
1700
2165
  AddColumns = 'addColumns',
1701
2166
  /**
1702
- * Removes a column from the current search query.
2167
+ * Remove a column from the current search query.
1703
2168
  *
1704
2169
  * @param - { columnId: string }
1705
2170
  * @example
@@ -1710,27 +2175,29 @@ export enum HostEvent {
1710
2175
  */
1711
2176
  RemoveColumn = 'removeColumn',
1712
2177
  /**
1713
- * Gets the current Liveboard content.
2178
+ * Get the transient state of a Liveboard as encoded content.
2179
+ * This includes unsaved and ad hoc changes such as
2180
+ * Liveboard filters, runtime filters applied on visualizations on a
2181
+ * Liveboard, and Liveboard layout, changes to visualizations such as
2182
+ * sorting, toggling of legends, and data drill down.
1714
2183
  *
1715
2184
  * @example
1716
2185
  * ```js
1717
- * liveboardEmbed.trigger(HostEvent.getExportRequestForCurrentPinboard)
2186
+ * liveboardEmbed.trigger(HostEvent.getexportrequestforcurrentpinboard).then(
2187
+ * data=>console.log(data))
1718
2188
  * ```
1719
2189
  * @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl, 8.8.1.sw
1720
2190
  */
1721
2191
  getExportRequestForCurrentPinboard = 'getExportRequestForCurrentPinboard',
1722
2192
  /**
1723
- * Triggers the **Pin** action on an embedded object
2193
+ * Trigger the **Pin** action on an embedded object
1724
2194
  *
1725
2195
  * @param - Liveboard embed takes the `vizId` as a
1726
- * key. Can be left undefined when embedding Search, full app or
2196
+ * key. Can be left undefined when embedding Search, full app, or
1727
2197
  * a visualization.
1728
2198
  * @example
1729
2199
  * ```js
1730
- * liveboardEmbed.trigger(HostEvent.Pin, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1731
- * ```
1732
- * ```js
1733
- * vizEmbed.trigger(HostEvent.Pin)
2200
+ * appEmbed.trigger(HostEvent.Pin)
1734
2201
  * ```
1735
2202
  * ```js
1736
2203
  * searchEmbed.trigger(HostEvent.Pin)
@@ -1739,17 +2206,18 @@ export enum HostEvent {
1739
2206
  */
1740
2207
  Pin = 'pin',
1741
2208
  /**
1742
- * Triggers the **Show Liveboard details** action on a Liveboard
2209
+ * Trigger the **Show Liveboard details** action
2210
+ * on an embedded Liveboard.
1743
2211
  *
1744
2212
  * @example
1745
- * ```js
1746
- * liveboardEmbed.trigger(HostEvent.LiveboardInfo)
1747
- * ```
2213
+ *```js
2214
+ * liveboardEmbed.trigger(HostEvent.LiveboardInfo)
2215
+ *```
1748
2216
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1749
2217
  */
1750
2218
  LiveboardInfo = 'pinboardInfo',
1751
2219
  /**
1752
- * Triggers the **Schedule** action on a Liveboard
2220
+ * Trigger the **Schedule** action on an embedded Liveboard.
1753
2221
  *
1754
2222
  * @example
1755
2223
  * ```js
@@ -1759,7 +2227,7 @@ export enum HostEvent {
1759
2227
  */
1760
2228
  Schedule = 'subscription',
1761
2229
  /**
1762
- * Triggers the **Manage schedule** action on a Liveboard
2230
+ * Trigger the **Manage schedule** action on an embedded Liveboard
1763
2231
  *
1764
2232
  * @example
1765
2233
  * ```js
@@ -1769,7 +2237,7 @@ export enum HostEvent {
1769
2237
  */
1770
2238
  SchedulesList = 'schedule-list',
1771
2239
  /**
1772
- * Triggers the **Export TML** action on a Liveboard
2240
+ * Trigger the **Export TML** action on an embedded Liveboard.
1773
2241
  *
1774
2242
  * @example
1775
2243
  * ```js
@@ -1779,7 +2247,7 @@ export enum HostEvent {
1779
2247
  */
1780
2248
  ExportTML = 'exportTSL',
1781
2249
  /**
1782
- * Triggers the **Edit TML** action on a Liveboard
2250
+ * Trigger the **Edit TML** action on an embedded Liveboard.
1783
2251
  *
1784
2252
  * @example
1785
2253
  * ```js
@@ -1789,7 +2257,7 @@ export enum HostEvent {
1789
2257
  */
1790
2258
  EditTML = 'editTSL',
1791
2259
  /**
1792
- * Triggers the **Update TML** action on a Liveboard
2260
+ * Trigger the **Update TML** action on an embedded Liveboard.
1793
2261
  *
1794
2262
  * @example
1795
2263
  * ```js
@@ -1799,7 +2267,7 @@ export enum HostEvent {
1799
2267
  */
1800
2268
  UpdateTML = 'updateTSL',
1801
2269
  /**
1802
- * Triggers the **Download PDF** action on a Liveboard
2270
+ * Trigger the **Download PDF** action on an embedded Liveboard.
1803
2271
  *
1804
2272
  * @example
1805
2273
  * ```js
@@ -1809,8 +2277,8 @@ export enum HostEvent {
1809
2277
  */
1810
2278
  DownloadAsPdf = 'downloadAsPdf',
1811
2279
  /**
1812
- * Triggers the **Make a copy** action on a Liveboard, Search, or
1813
- * visualization page
2280
+ * Trigger the **Make a copy** action on a Liveboard, Search, or
2281
+ * visualization page.
1814
2282
  *
1815
2283
  * @example
1816
2284
  * ```js
@@ -1826,7 +2294,7 @@ export enum HostEvent {
1826
2294
  */
1827
2295
  MakeACopy = 'makeACopy',
1828
2296
  /**
1829
- * Triggers the **Delete** action on a Liveboard
2297
+ * Trigger the **Delete** action for a Liveboard.
1830
2298
  *
1831
2299
  * @example
1832
2300
  * ```js
@@ -1836,7 +2304,7 @@ export enum HostEvent {
1836
2304
  */
1837
2305
  Remove = 'delete',
1838
2306
  /**
1839
- * Triggers the **Explore* action on a visualization
2307
+ * Trigger the **Explore** action on a visualization.
1840
2308
  *
1841
2309
  * @param - an object with `vizId` as a key
1842
2310
  * @example
@@ -1847,7 +2315,7 @@ export enum HostEvent {
1847
2315
  */
1848
2316
  Explore = 'explore',
1849
2317
  /**
1850
- * Triggers the **Create alert** action on a visualization
2318
+ * Trigger the **Create alert** action on a visualization
1851
2319
  *
1852
2320
  * @param - an object with `vizId` as a key
1853
2321
  * @example
@@ -1860,7 +2328,7 @@ export enum HostEvent {
1860
2328
  */
1861
2329
  CreateMonitor = 'createMonitor',
1862
2330
  /**
1863
- * Triggers the **Manage alerts** action on a visualization
2331
+ * Trigger the **Manage alerts** action on a visualization
1864
2332
  *
1865
2333
  * @param - an object with `vizId` as a key
1866
2334
  * @example
@@ -1873,7 +2341,7 @@ export enum HostEvent {
1873
2341
  */
1874
2342
  ManageMonitor = 'manageMonitor',
1875
2343
  /**
1876
- * Triggers the **Edit** action on a Liveboard or visualization
2344
+ * Trigger the **Edit** action on a Liveboard or visualization
1877
2345
  *
1878
2346
  * @param - object - To trigger the action for a specific visualization
1879
2347
  * in Liveboard embed, pass in `vizId` as a key.
@@ -1894,7 +2362,7 @@ export enum HostEvent {
1894
2362
  */
1895
2363
  Edit = 'edit',
1896
2364
  /**
1897
- * Triggers the **Copy link** action on a Liveboard or visualization
2365
+ * Trigger the **Copy link** action on a Liveboard or visualization
1898
2366
  *
1899
2367
  * @param - object - to trigger the action for a
1900
2368
  * specific visualization in Liveboard embed, pass in `vizId` as a key
@@ -1912,7 +2380,7 @@ export enum HostEvent {
1912
2380
  */
1913
2381
  CopyLink = 'embedDocument',
1914
2382
  /**
1915
- * Triggers the **Present** action on a Liveboard or visualization
2383
+ * Trigger the **Present** action on a Liveboard or visualization
1916
2384
  *
1917
2385
  * @param - object - to trigger the action for a specific visualization
1918
2386
  * in Liveboard embed, pass in `vizId` as a key
@@ -1930,7 +2398,7 @@ export enum HostEvent {
1930
2398
  */
1931
2399
  Present = 'present',
1932
2400
  /**
1933
- * Gets TML for the current search.
2401
+ * Get TML for the current search.
1934
2402
  *
1935
2403
  * @example
1936
2404
  * ```js
@@ -1945,7 +2413,7 @@ export enum HostEvent {
1945
2413
  */
1946
2414
  GetTML = 'getTML',
1947
2415
  /**
1948
- * Triggers the **Show underlying data** action on visualization or search
2416
+ * Trigger the **Show underlying data** action on visualization or search
1949
2417
  *
1950
2418
  * @param - an object with vizId as a key
1951
2419
  * @example
@@ -1963,7 +2431,9 @@ export enum HostEvent {
1963
2431
  */
1964
2432
  ShowUnderlyingData = 'showUnderlyingData',
1965
2433
  /**
1966
- * Triggers the **Delete** action on visualization or search
2434
+ * Trigger the **Delete** action for a visualization
2435
+ * in an embedded Liveboard, or a chart or table
2436
+ * generated from Search.
1967
2437
  *
1968
2438
  * @param - Liveboard embed takes an object with `vizId` as a key.
1969
2439
  * Can be left empty if embedding Search or visualization.
@@ -1973,16 +2443,13 @@ export enum HostEvent {
1973
2443
  * '730496d6-6903-4601-937e-2c691821af3c'})
1974
2444
  * ```
1975
2445
  * ```js
1976
- * vizEmbed.trigger(HostEvent.Delete)
1977
- * ```
1978
- * ```js
1979
2446
  * searchEmbed.trigger(HostEvent.Delete)
1980
2447
  * ```
1981
2448
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
1982
2449
  */
1983
2450
  Delete = 'onDeleteAnswer',
1984
2451
  /**
1985
- * Triggers the **SpotIQ analyze** action on visualization
2452
+ * Trigger the **SpotIQ analyze** action on visualization
1986
2453
  * or search.
1987
2454
  *
1988
2455
  * @param - Liveboard embed takes `vizId` as a
@@ -2003,7 +2470,7 @@ export enum HostEvent {
2003
2470
  */
2004
2471
  SpotIQAnalyze = 'spotIQAnalyze',
2005
2472
  /**
2006
- * Triggers the **Download** action on charts in
2473
+ * Trigger the **Download** action on charts in
2007
2474
  * the embedded view.
2008
2475
  *
2009
2476
  * @example
@@ -2012,17 +2479,15 @@ export enum HostEvent {
2012
2479
  * '730496d6-6903-4601-937e-2c691821af3c'})
2013
2480
  * ```
2014
2481
  * ```js
2015
- * vizEmbed.trigger(HostEvent.Download)
2482
+ * embed.trigger(HostEvent.Download)
2016
2483
  * ```
2017
- * ```js
2018
- * searchEmbed.trigger(HostEvent.Download)
2019
- * ```
2020
- * @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw ,Use {@link DownloadAsPng}
2484
+ * @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw
2485
+ * Use {@link DownloadAsPng}
2021
2486
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2022
2487
  */
2023
2488
  Download = 'downloadAsPng',
2024
2489
  /**
2025
- * Triggers the **Download** > **PNG** action on
2490
+ * Trigger the **Download** > **PNG** action on
2026
2491
  * charts in the embedded view.
2027
2492
  *
2028
2493
  * @example
@@ -2038,7 +2503,7 @@ export enum HostEvent {
2038
2503
  */
2039
2504
  DownloadAsPng = 'downloadAsPng',
2040
2505
  /**
2041
- * Triggers the **Download** > **CSV** action on tables in
2506
+ * Trigger the **Download** > **CSV** action on tables in
2042
2507
  * the embedded view.
2043
2508
  *
2044
2509
  * @example
@@ -2056,7 +2521,7 @@ export enum HostEvent {
2056
2521
  */
2057
2522
  DownloadAsCsv = 'downloadAsCSV',
2058
2523
  /**
2059
- * Triggers the **Download** > **XLSX** action on tables
2524
+ * Trigger the **Download** > **XLSX** action on tables
2060
2525
  * in the embedded view.
2061
2526
  *
2062
2527
  * @example
@@ -2074,7 +2539,7 @@ export enum HostEvent {
2074
2539
  */
2075
2540
  DownloadAsXlsx = 'downloadAsXLSX',
2076
2541
  /**
2077
- * Triggers the **Share** action on an embedded
2542
+ * Trigger the **Share** action on an embedded
2078
2543
  * Liveboard or Answer.
2079
2544
  *
2080
2545
  * @example
@@ -2088,7 +2553,7 @@ export enum HostEvent {
2088
2553
  */
2089
2554
  Share = 'share',
2090
2555
  /**
2091
- * Triggers the **Save** action on a Liveboard or Answer.
2556
+ * Trigger the **Save** action on a Liveboard or Answer.
2092
2557
  * Saves the changes.
2093
2558
  *
2094
2559
  * @example
@@ -2102,7 +2567,7 @@ export enum HostEvent {
2102
2567
  */
2103
2568
  Save = 'save',
2104
2569
  /**
2105
- * Triggers the **Sync to Sheets** action on an embedded visualization or Answer
2570
+ * Trigger the **Sync to Sheets** action on an embedded visualization or Answer
2106
2571
  * Sends data from an Answer or Liveboard visualization to a Google sheet.
2107
2572
  *
2108
2573
  * @param - an object with `vizId` as a key
@@ -2118,7 +2583,7 @@ export enum HostEvent {
2118
2583
  */
2119
2584
  SyncToSheets = 'sync-to-sheets',
2120
2585
  /**
2121
- * Triggers the **Sync to Other Apps** action on an embedded visualization or Answer
2586
+ * Trigger the **Sync to Other Apps** action on an embedded visualization or Answer
2122
2587
  * Sends data from an Answer or Liveboard visualization to third-party apps such
2123
2588
  * as Slack, Salesforce, Microsoft Teams, ServiceNow and so on.
2124
2589
  *
@@ -2135,7 +2600,7 @@ export enum HostEvent {
2135
2600
  */
2136
2601
  SyncToOtherApps = 'sync-to-other-apps',
2137
2602
  /**
2138
- * Triggers the **Manage pipelines** action on an embedded
2603
+ * Trigger the **Manage pipelines** action on an embedded
2139
2604
  * visualization or Answer.
2140
2605
  * Allows users to manage ThoughtSpot Sync pipelines.
2141
2606
  *
@@ -2152,18 +2617,21 @@ export enum HostEvent {
2152
2617
  */
2153
2618
  ManagePipelines = 'manage-pipeline',
2154
2619
  /**
2155
- * Triggers the Reset search on the Search page
2620
+ * Reset search operation on the Search or Answer page.
2156
2621
  *
2157
2622
  * @example
2158
2623
  * ```js
2159
2624
  * searchEmbed.trigger(HostEvent.ResetSearch)
2160
2625
  * ```
2626
+ * ```js
2627
+ * appEmbed.trigger(HostEvent.ResetSearch)
2628
+ * ```
2161
2629
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.0.1.sw
2162
2630
  */
2163
2631
  ResetSearch = 'resetSearch',
2164
2632
  /**
2165
2633
  * @hidden
2166
- * Gets the currents visible and runtime filters applied on a Liveboard
2634
+ * Get the currents visible and runtime filters applied on a Liveboard
2167
2635
  * @example
2168
2636
  * liveboardEmbed.trigger(HostEvent.GetFilters)
2169
2637
  * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
@@ -2171,7 +2639,7 @@ export enum HostEvent {
2171
2639
  GetFilters = 'getFilters',
2172
2640
  /**
2173
2641
  * @hidden
2174
- * Updates the visible filters on the Liveboard.
2642
+ * Update the visible filters on the Liveboard.
2175
2643
  * @param - filter: filter object containing column name and filter operation and values
2176
2644
  * @example
2177
2645
  *
@@ -2184,7 +2652,7 @@ export enum HostEvent {
2184
2652
  */
2185
2653
  UpdateFilters = 'updateFilters',
2186
2654
  /**
2187
- * Get Tab for the current Liveboard.
2655
+ * Get tab details for the current Liveboard.
2188
2656
  *
2189
2657
  * @example
2190
2658
  * ```js
@@ -2198,9 +2666,9 @@ export enum HostEvent {
2198
2666
  */
2199
2667
  GetTabs = 'getTabs',
2200
2668
  /**
2201
- * Set the visible Tabs on a Liveboard.
2669
+ * Set the visible tabs on a Liveboard.
2202
2670
  *
2203
- * @param - an array of ids of Tabs to show, the ids not passed
2671
+ * @param - an array of ids of tabs to show, the IDs not passed
2204
2672
  * will be hidden.
2205
2673
  * @example
2206
2674
  * ```js
@@ -2214,8 +2682,8 @@ export enum HostEvent {
2214
2682
  /**
2215
2683
  * Set the hidden tabs on a Liveboard.
2216
2684
  *
2217
- * @param - an array of ids of Tabs to hide, the ids not passed
2218
- * will be shown.
2685
+ * @param - an array of the IDs of the tabs to hide.
2686
+ * The IDs not passed will be shown.
2219
2687
  * @example
2220
2688
  * ```js
2221
2689
  * liveboardEmbed.trigger(HostEvent.SetHiddenTabs, [
@@ -2226,9 +2694,10 @@ export enum HostEvent {
2226
2694
  */
2227
2695
  SetHiddenTabs = 'SetPinboardHiddenTabs',
2228
2696
  /**
2229
- * Updates the search query for sage embed.
2697
+ * Updates the search query string for Natural Language Search operations.
2230
2698
  *
2231
- * @param - searchOptions: an object queryString and option to execute the query.
2699
+ * @param - `queryString`: Text string in Natural Language format
2700
+ * @param - `executeSearch`: Boolean to execute search and update search query
2232
2701
  * @example
2233
2702
  * ```js
2234
2703
  * sageEmbed.trigger(HostEvent.UpdateSageQuery, {
@@ -2236,7 +2705,7 @@ export enum HostEvent {
2236
2705
  * executeSearch: true,
2237
2706
  * })
2238
2707
  * ```
2239
- * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
2708
+ * @version SDK: 1.26.0 | Thoughtspot: 9.8.0.cl, 9.8.0.sw
2240
2709
  */
2241
2710
  UpdateSageQuery = 'updateSageQuery',
2242
2711
  /**
@@ -2249,26 +2718,38 @@ export enum HostEvent {
2249
2718
  * vizId: '123', // For Liveboard Visualization.
2250
2719
  * })
2251
2720
  * ```
2721
+ * @version SDK: 1.26.0 | Thoughtspot: 9.10.0.cl
2252
2722
  */
2253
2723
  GetAnswerSession = 'getAnswerSession',
2724
+ /**
2725
+ * Trigger Ask Sage for viz
2726
+ *
2727
+ * @example
2728
+ * ```js
2729
+ * liveboardEmbed.trigger(HostEvent.AskSage,
2730
+ * {vizId:'730496d6-6903-4601-937e-2c691821af3c'})
2731
+ * ```
2732
+ * @version SDK: 1.29.0 | Thoughtspot: 9.12.0.cl
2733
+ */
2734
+ AskSage = 'AskSage',
2254
2735
  }
2255
2736
 
2256
2737
  /**
2257
2738
  * The different visual modes that the data sources panel within
2258
- * search could appear in, i.e., hidden, collapsed, or expanded.
2739
+ * search could appear in, such as hidden, collapsed, or expanded.
2259
2740
  */
2260
2741
  // eslint-disable-next-line no-shadow
2261
2742
  export enum DataSourceVisualMode {
2262
2743
  /**
2263
- * Data source panel is hidden.
2744
+ * The data source panel is hidden.
2264
2745
  */
2265
2746
  Hidden = 'hide',
2266
2747
  /**
2267
- * Data source panel is collapsed, but the user can manually expand it.
2748
+ * The data source panel is collapsed, but the user can manually expand it.
2268
2749
  */
2269
2750
  Collapsed = 'collapse',
2270
2751
  /**
2271
- * Data source panel is expanded, but the user can manually collapse it.
2752
+ * The data source panel is expanded, but the user can manually collapse it.
2272
2753
  */
2273
2754
  Expanded = 'expand',
2274
2755
  }
@@ -2348,6 +2829,10 @@ export enum Param {
2348
2829
  IsProductTour = 'isProductTour',
2349
2830
  HideSearchBarTitle = 'hideSearchBarTitle',
2350
2831
  HideSageAnswerHeader = 'hideSageAnswerHeader',
2832
+ HideSearchBar = 'hideSearchBar',
2833
+ ClientLogLevel = 'clientLogLevel',
2834
+ OverrideNativeConsole = 'overrideConsoleLogs',
2835
+ enableAskSage = 'enableAskSage',
2351
2836
  }
2352
2837
 
2353
2838
  /**
@@ -2409,9 +2894,11 @@ export enum Action {
2409
2894
  SaveAsView = 'saveAsView',
2410
2895
  /**
2411
2896
  * The **Make a copy** action on a Liveboard or Answer
2412
- * page.
2413
- * Creates a copy of the Liveboard, visualization,
2414
- * or Answer.
2897
+ * page. Creates a copy of the Liveboard.
2898
+ * In LiveboardEmbed, the **Make a copy** action is not available for
2899
+ * visualizations in the embedded Liveboard view.
2900
+ * In AppEmbed, the **Make a copy** action is available on both
2901
+ * Liveboards and visualizations.
2415
2902
  *
2416
2903
  * @example
2417
2904
  * ```js
@@ -2595,7 +3082,7 @@ export enum Action {
2595
3082
  */
2596
3083
  DownloadAsPdf = 'downloadAsPdf',
2597
3084
  /**
2598
- * The **Download** > **CSV** menu action for tables on a Liveboard
3085
+ * The **Download** > **CSV** menu action for tables on a Liveboard
2599
3086
  * or Answer page.
2600
3087
  * Downloads a visualization or Answer in the XLSX format.
2601
3088
  *
@@ -3127,6 +3614,7 @@ export enum Action {
3127
3614
  */
3128
3615
  RenameModalTitleDescription = 'renameModalTitleDescription',
3129
3616
  /**
3617
+ *
3130
3618
  * @version SDK: 1.25.0 | Thoughtspot: 9.6.0.cl
3131
3619
  */
3132
3620
  RequestVerification = 'requestVerification',
@@ -3208,6 +3696,17 @@ export enum Action {
3208
3696
  * @version SDK: 1.29.0 | Thoughtspot: 9.10.0.cl
3209
3697
  */
3210
3698
  VerifiedLiveboard = 'verifiedLiveboard',
3699
+
3700
+ /**
3701
+ * Action ID for ask sage button
3702
+ *
3703
+ * @example
3704
+ * ```js
3705
+ * hiddenAction: [Action.AskAi]
3706
+ * ```
3707
+ * @version SDK: 1.29.0 | Thoughtspot: 9.12.0.cl
3708
+ */
3709
+ AskAi = 'AskAi',
3211
3710
  }
3212
3711
 
3213
3712
  export interface AnswerServiceType {
@@ -3237,15 +3736,15 @@ export interface ColumnValue {
3237
3736
  [key: string]: any;
3238
3737
  };
3239
3738
  value:
3240
- | string
3241
- | number
3242
- | boolean
3243
- | {
3244
- v: {
3245
- s: number;
3246
- e: number;
3247
- };
3248
- };
3739
+ | string
3740
+ | number
3741
+ | boolean
3742
+ | {
3743
+ v: {
3744
+ s: number;
3745
+ e: number;
3746
+ };
3747
+ };
3249
3748
  }
3250
3749
 
3251
3750
  export interface VizPoint {
@@ -3273,3 +3772,12 @@ export interface CustomActionPayload {
3273
3772
  session: SessionInterface;
3274
3773
  vizId?: string;
3275
3774
  }
3775
+
3776
+ export enum LogLevel {
3777
+ SILENT = 'SILENT',
3778
+ ERROR = 'ERROR',
3779
+ WARN = 'WARN',
3780
+ INFO = 'INFO',
3781
+ DEBUG = 'DEBUG',
3782
+ TRACE = 'TRACE',
3783
+ }