@thoughtspot/visual-embed-sdk 1.36.2 → 1.36.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (271) hide show
  1. package/cjs/package.json +1 -1
  2. package/cjs/src/authToken.d.ts.map +1 -1
  3. package/cjs/src/authToken.js +10 -3
  4. package/cjs/src/authToken.js.map +1 -1
  5. package/cjs/src/embed/app.d.ts +14 -0
  6. package/cjs/src/embed/app.d.ts.map +1 -1
  7. package/cjs/src/embed/app.js +5 -2
  8. package/cjs/src/embed/app.js.map +1 -1
  9. package/cjs/src/embed/app.spec.js +17 -0
  10. package/cjs/src/embed/app.spec.js.map +1 -1
  11. package/cjs/src/embed/base.d.ts +4 -0
  12. package/cjs/src/embed/base.d.ts.map +1 -1
  13. package/cjs/src/embed/base.js +27 -1
  14. package/cjs/src/embed/base.js.map +1 -1
  15. package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
  16. package/cjs/src/embed/bodyless-conversation.js +1 -1
  17. package/cjs/src/embed/bodyless-conversation.js.map +1 -1
  18. package/cjs/src/embed/conversation.d.ts.map +1 -1
  19. package/cjs/src/embed/conversation.js +1 -1
  20. package/cjs/src/embed/conversation.js.map +1 -1
  21. package/cjs/src/embed/embedConfig.d.ts +1 -1
  22. package/cjs/src/embed/embedConfig.d.ts.map +1 -1
  23. package/cjs/src/embed/embedConfig.js +5 -4
  24. package/cjs/src/embed/embedConfig.js.map +1 -1
  25. package/cjs/src/embed/liveboard.d.ts +6 -3
  26. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  27. package/cjs/src/embed/liveboard.js +4 -5
  28. package/cjs/src/embed/liveboard.js.map +1 -1
  29. package/cjs/src/embed/liveboard.spec.js +11 -11
  30. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  31. package/cjs/src/embed/sage.d.ts.map +1 -1
  32. package/cjs/src/embed/sage.js +1 -1
  33. package/cjs/src/embed/sage.js.map +1 -1
  34. package/cjs/src/embed/search-bar.d.ts.map +1 -1
  35. package/cjs/src/embed/search-bar.js +1 -1
  36. package/cjs/src/embed/search-bar.js.map +1 -1
  37. package/cjs/src/embed/search.d.ts.map +1 -1
  38. package/cjs/src/embed/search.js +1 -1
  39. package/cjs/src/embed/search.js.map +1 -1
  40. package/cjs/src/embed/ts-embed.d.ts +4 -3
  41. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  42. package/cjs/src/embed/ts-embed.js +25 -16
  43. package/cjs/src/embed/ts-embed.js.map +1 -1
  44. package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
  45. package/cjs/src/embed/ts-embed.spec.js +71 -5
  46. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  47. package/cjs/src/errors.d.ts +1 -0
  48. package/cjs/src/errors.d.ts.map +1 -1
  49. package/cjs/src/errors.js +1 -0
  50. package/cjs/src/errors.js.map +1 -1
  51. package/cjs/src/react/all-types-export.d.ts +1 -1
  52. package/cjs/src/react/all-types-export.d.ts.map +1 -1
  53. package/cjs/src/react/all-types-export.js +2 -1
  54. package/cjs/src/react/all-types-export.js.map +1 -1
  55. package/cjs/src/react/index.d.ts +16 -0
  56. package/cjs/src/react/index.d.ts.map +1 -1
  57. package/cjs/src/react/index.js +25 -2
  58. package/cjs/src/react/index.js.map +1 -1
  59. package/cjs/src/types.d.ts +85 -66
  60. package/cjs/src/types.d.ts.map +1 -1
  61. package/cjs/src/types.js +78 -59
  62. package/cjs/src/types.js.map +1 -1
  63. package/cjs/src/utils/with-resolvers-polyfill.d.ts +1 -0
  64. package/cjs/src/utils/with-resolvers-polyfill.d.ts.map +1 -0
  65. package/cjs/src/utils/with-resolvers-polyfill.js +12 -0
  66. package/cjs/src/utils/with-resolvers-polyfill.js.map +1 -0
  67. package/cjs/src/utils.d.ts +27 -0
  68. package/cjs/src/utils.d.ts.map +1 -1
  69. package/cjs/src/utils.js +45 -1
  70. package/cjs/src/utils.js.map +1 -1
  71. package/cjs/src/utils.spec.js +15 -0
  72. package/cjs/src/utils.spec.js.map +1 -1
  73. package/dist/{index-B3hd6DTM.js → index-NZYq1Tu3.js} +1 -1
  74. package/dist/src/authToken.d.ts.map +1 -1
  75. package/dist/src/embed/app.d.ts +14 -0
  76. package/dist/src/embed/app.d.ts.map +1 -1
  77. package/dist/src/embed/base.d.ts +4 -0
  78. package/dist/src/embed/base.d.ts.map +1 -1
  79. package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
  80. package/dist/src/embed/conversation.d.ts.map +1 -1
  81. package/dist/src/embed/embedConfig.d.ts +1 -1
  82. package/dist/src/embed/embedConfig.d.ts.map +1 -1
  83. package/dist/src/embed/liveboard.d.ts +6 -3
  84. package/dist/src/embed/liveboard.d.ts.map +1 -1
  85. package/dist/src/embed/sage.d.ts.map +1 -1
  86. package/dist/src/embed/search-bar.d.ts.map +1 -1
  87. package/dist/src/embed/search.d.ts.map +1 -1
  88. package/dist/src/embed/ts-embed.d.ts +4 -3
  89. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  90. package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
  91. package/dist/src/errors.d.ts +1 -0
  92. package/dist/src/errors.d.ts.map +1 -1
  93. package/dist/src/react/all-types-export.d.ts +1 -1
  94. package/dist/src/react/all-types-export.d.ts.map +1 -1
  95. package/dist/src/react/index.d.ts +16 -0
  96. package/dist/src/react/index.d.ts.map +1 -1
  97. package/dist/src/types.d.ts +85 -66
  98. package/dist/src/types.d.ts.map +1 -1
  99. package/dist/src/utils/with-resolvers-polyfill.d.ts +1 -0
  100. package/dist/src/utils/with-resolvers-polyfill.d.ts.map +1 -0
  101. package/dist/src/utils.d.ts +27 -0
  102. package/dist/src/utils.d.ts.map +1 -1
  103. package/dist/tsembed-react.es.js +458 -108
  104. package/dist/tsembed-react.js +456 -105
  105. package/dist/tsembed.es.js +197 -98
  106. package/dist/tsembed.js +196 -97
  107. package/dist/visual-embed-sdk-react-full.d.ts +1324 -1269
  108. package/dist/visual-embed-sdk-react.d.ts +814 -759
  109. package/dist/visual-embed-sdk.d.ts +113 -72
  110. package/lib/package.json +1 -1
  111. package/lib/src/authToken.d.ts.map +1 -1
  112. package/lib/src/authToken.js +10 -3
  113. package/lib/src/authToken.js.map +1 -1
  114. package/lib/src/embed/app.d.ts +14 -0
  115. package/lib/src/embed/app.d.ts.map +1 -1
  116. package/lib/src/embed/app.js +5 -2
  117. package/lib/src/embed/app.js.map +1 -1
  118. package/lib/src/embed/app.spec.js +17 -0
  119. package/lib/src/embed/app.spec.js.map +1 -1
  120. package/lib/src/embed/base.d.ts +4 -0
  121. package/lib/src/embed/base.d.ts.map +1 -1
  122. package/lib/src/embed/base.js +24 -1
  123. package/lib/src/embed/base.js.map +1 -1
  124. package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
  125. package/lib/src/embed/bodyless-conversation.js +1 -1
  126. package/lib/src/embed/bodyless-conversation.js.map +1 -1
  127. package/lib/src/embed/conversation.d.ts.map +1 -1
  128. package/lib/src/embed/conversation.js +1 -1
  129. package/lib/src/embed/conversation.js.map +1 -1
  130. package/lib/src/embed/embedConfig.d.ts +1 -1
  131. package/lib/src/embed/embedConfig.d.ts.map +1 -1
  132. package/lib/src/embed/embedConfig.js +5 -4
  133. package/lib/src/embed/embedConfig.js.map +1 -1
  134. package/lib/src/embed/liveboard.d.ts +6 -3
  135. package/lib/src/embed/liveboard.d.ts.map +1 -1
  136. package/lib/src/embed/liveboard.js +4 -5
  137. package/lib/src/embed/liveboard.js.map +1 -1
  138. package/lib/src/embed/liveboard.spec.js +11 -11
  139. package/lib/src/embed/liveboard.spec.js.map +1 -1
  140. package/lib/src/embed/sage.d.ts.map +1 -1
  141. package/lib/src/embed/sage.js +1 -1
  142. package/lib/src/embed/sage.js.map +1 -1
  143. package/lib/src/embed/search-bar.d.ts.map +1 -1
  144. package/lib/src/embed/search-bar.js +1 -1
  145. package/lib/src/embed/search-bar.js.map +1 -1
  146. package/lib/src/embed/search.d.ts.map +1 -1
  147. package/lib/src/embed/search.js +1 -1
  148. package/lib/src/embed/search.js.map +1 -1
  149. package/lib/src/embed/ts-embed.d.ts +4 -3
  150. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  151. package/lib/src/embed/ts-embed.js +26 -17
  152. package/lib/src/embed/ts-embed.js.map +1 -1
  153. package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
  154. package/lib/src/embed/ts-embed.spec.js +71 -5
  155. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  156. package/lib/src/errors.d.ts +1 -0
  157. package/lib/src/errors.d.ts.map +1 -1
  158. package/lib/src/errors.js +1 -0
  159. package/lib/src/errors.js.map +1 -1
  160. package/lib/src/react/all-types-export.d.ts +1 -1
  161. package/lib/src/react/all-types-export.d.ts.map +1 -1
  162. package/lib/src/react/all-types-export.js +1 -1
  163. package/lib/src/react/all-types-export.js.map +1 -1
  164. package/lib/src/react/index.d.ts +16 -0
  165. package/lib/src/react/index.d.ts.map +1 -1
  166. package/lib/src/react/index.js +23 -1
  167. package/lib/src/react/index.js.map +1 -1
  168. package/lib/src/types.d.ts +85 -66
  169. package/lib/src/types.d.ts.map +1 -1
  170. package/lib/src/types.js +78 -59
  171. package/lib/src/types.js.map +1 -1
  172. package/lib/src/utils/with-resolvers-polyfill.d.ts +1 -0
  173. package/lib/src/utils/with-resolvers-polyfill.d.ts.map +1 -0
  174. package/lib/src/utils/with-resolvers-polyfill.js +12 -0
  175. package/lib/src/utils/with-resolvers-polyfill.js.map +1 -0
  176. package/lib/src/utils.d.ts +27 -0
  177. package/lib/src/utils.d.ts.map +1 -1
  178. package/lib/src/utils.js +41 -0
  179. package/lib/src/utils.js.map +1 -1
  180. package/lib/src/utils.spec.js +16 -1
  181. package/lib/src/utils.spec.js.map +1 -1
  182. package/lib/src/visual-embed-sdk.d.ts +114 -73
  183. package/package.json +1 -1
  184. package/src/authToken.ts +11 -3
  185. package/src/embed/app.spec.ts +27 -0
  186. package/src/embed/app.ts +21 -1
  187. package/src/embed/base.ts +41 -1
  188. package/src/embed/bodyless-conversation.ts +2 -1
  189. package/src/embed/conversation.ts +2 -1
  190. package/src/embed/embedConfig.ts +5 -4
  191. package/src/embed/liveboard.spec.ts +11 -11
  192. package/src/embed/liveboard.ts +9 -7
  193. package/src/embed/sage.ts +1 -2
  194. package/src/embed/search-bar.tsx +1 -2
  195. package/src/embed/search.ts +1 -2
  196. package/src/embed/ts-embed.spec.ts +83 -5
  197. package/src/embed/ts-embed.ts +33 -17
  198. package/src/errors.ts +1 -0
  199. package/src/react/all-types-export.ts +1 -0
  200. package/src/react/index.tsx +27 -2
  201. package/src/types.ts +89 -70
  202. package/src/utils/with-resolvers-polyfill.ts +11 -0
  203. package/src/utils.spec.ts +21 -0
  204. package/src/utils.ts +52 -0
  205. package/cjs/src/embed/searchEmbed-basic-auth.spec.d.ts +0 -2
  206. package/cjs/src/embed/searchEmbed-basic-auth.spec.d.ts.map +0 -1
  207. package/cjs/src/embed/searchEmbed-basic-auth.spec.js +0 -104
  208. package/cjs/src/embed/searchEmbed-basic-auth.spec.js.map +0 -1
  209. package/cjs/src/hostEventsTypeMapping.d.ts +0 -2
  210. package/cjs/src/hostEventsTypeMapping.d.ts.map +0 -1
  211. package/cjs/src/hostEventsTypeMapping.js +0 -4
  212. package/cjs/src/hostEventsTypeMapping.js.map +0 -1
  213. package/cjs/src/utils/embedApi/contracts.d.ts +0 -101
  214. package/cjs/src/utils/embedApi/contracts.d.ts.map +0 -1
  215. package/cjs/src/utils/embedApi/contracts.js +0 -17
  216. package/cjs/src/utils/embedApi/contracts.js.map +0 -1
  217. package/cjs/src/utils/embedApi/embedApiClient.d.ts +0 -12
  218. package/cjs/src/utils/embedApi/embedApiClient.d.ts.map +0 -1
  219. package/cjs/src/utils/embedApi/embedApiClient.js +0 -46
  220. package/cjs/src/utils/embedApi/embedApiClient.js.map +0 -1
  221. package/cjs/src/utils/embedApi/processEmbedApi.d.ts +0 -9
  222. package/cjs/src/utils/embedApi/processEmbedApi.d.ts.map +0 -1
  223. package/cjs/src/utils/embedApi/processEmbedApi.js +0 -18
  224. package/cjs/src/utils/embedApi/processEmbedApi.js.map +0 -1
  225. package/dist/index-BBBimG1x.js +0 -7370
  226. package/dist/index-BGnxP5NY.js +0 -7370
  227. package/dist/index-CENLvayL.js +0 -7370
  228. package/dist/index-CR5u7BMC.js +0 -7370
  229. package/dist/index-CbltIawo.js +0 -7370
  230. package/dist/index-CoQfqaHj.js +0 -7370
  231. package/dist/index-CzwzS0P4.js +0 -7370
  232. package/dist/index-D-9WUCUl.js +0 -7370
  233. package/dist/index-DFwi_pV_.js +0 -7370
  234. package/dist/index-DOIjN0N_.js +0 -7370
  235. package/dist/index-DYBx8SuE.js +0 -7370
  236. package/dist/index-DaLHJaLd.js +0 -7370
  237. package/dist/index-DnJX-gN2.js +0 -7370
  238. package/dist/index-DpuhnTj2.js +0 -7370
  239. package/dist/index-IDmSUe93.js +0 -7370
  240. package/dist/index-nWevLycs.js +0 -7370
  241. package/dist/index-vxW97_xb.js +0 -7370
  242. package/dist/src/embed/searchEmbed-basic-auth.spec.d.ts +0 -2
  243. package/dist/src/embed/searchEmbed-basic-auth.spec.d.ts.map +0 -1
  244. package/dist/src/hostEventsTypeMapping.d.ts +0 -2
  245. package/dist/src/hostEventsTypeMapping.d.ts.map +0 -1
  246. package/dist/src/utils/embedApi/contracts.d.ts +0 -101
  247. package/dist/src/utils/embedApi/contracts.d.ts.map +0 -1
  248. package/dist/src/utils/embedApi/embedApiClient.d.ts +0 -12
  249. package/dist/src/utils/embedApi/embedApiClient.d.ts.map +0 -1
  250. package/dist/src/utils/embedApi/processEmbedApi.d.ts +0 -9
  251. package/dist/src/utils/embedApi/processEmbedApi.d.ts.map +0 -1
  252. package/lib/src/embed/searchEmbed-basic-auth.spec.d.ts +0 -2
  253. package/lib/src/embed/searchEmbed-basic-auth.spec.d.ts.map +0 -1
  254. package/lib/src/embed/searchEmbed-basic-auth.spec.js +0 -101
  255. package/lib/src/embed/searchEmbed-basic-auth.spec.js.map +0 -1
  256. package/lib/src/hostEventsTypeMapping.d.ts +0 -2
  257. package/lib/src/hostEventsTypeMapping.d.ts.map +0 -1
  258. package/lib/src/hostEventsTypeMapping.js +0 -2
  259. package/lib/src/hostEventsTypeMapping.js.map +0 -1
  260. package/lib/src/utils/embedApi/contracts.d.ts +0 -101
  261. package/lib/src/utils/embedApi/contracts.d.ts.map +0 -1
  262. package/lib/src/utils/embedApi/contracts.js +0 -14
  263. package/lib/src/utils/embedApi/contracts.js.map +0 -1
  264. package/lib/src/utils/embedApi/embedApiClient.d.ts +0 -12
  265. package/lib/src/utils/embedApi/embedApiClient.d.ts.map +0 -1
  266. package/lib/src/utils/embedApi/embedApiClient.js +0 -42
  267. package/lib/src/utils/embedApi/embedApiClient.js.map +0 -1
  268. package/lib/src/utils/embedApi/processEmbedApi.d.ts +0 -9
  269. package/lib/src/utils/embedApi/processEmbedApi.d.ts.map +0 -1
  270. package/lib/src/utils/embedApi/processEmbedApi.js +0 -14
  271. package/lib/src/utils/embedApi/processEmbedApi.js.map +0 -1
package/dist/tsembed.js CHANGED
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.36.2 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.36.4 */
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
4
4
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
@@ -346,7 +346,35 @@
346
346
  return ['boolean', 'boolean'];
347
347
  }
348
348
  return ['', ''];
349
- };
349
+ };
350
+ const sdkWindowKey = '_tsEmbedSDK';
351
+ /**
352
+ * Stores a value in the global `window` object under the `_tsEmbedSDK` namespace.
353
+ * @param key - The key under which the value will be stored.
354
+ * @param value - The value to store.
355
+ * @param options - Additional options.
356
+ * @param options.ignoreIfAlreadyExists - Does not set if value for key is set.
357
+ *
358
+ * @returns The stored value.
359
+ *
360
+ * @version SDK: 1.36.2 | ThoughtSpot: *
361
+ */
362
+ function storeValueInWindow(key, value, options = {}) {
363
+ if (!window[sdkWindowKey]) {
364
+ window[sdkWindowKey] = {};
365
+ }
366
+ if (options.ignoreIfAlreadyExists && key in window[sdkWindowKey]) {
367
+ return window[sdkWindowKey][key];
368
+ }
369
+ window[sdkWindowKey][key] = value;
370
+ return value;
371
+ }
372
+ /**
373
+ * Retrieves a stored value from the global `window` object under the `_tsEmbedSDK` namespace.
374
+ * @param key - The key whose value needs to be retrieved.
375
+ * @returns The stored value or `undefined` if the key is not found.
376
+ */
377
+ const getValueFromWindow = (key) => { var _a; return (_a = window === null || window === void 0 ? void 0 : window[sdkWindowKey]) === null || _a === void 0 ? void 0 : _a[key]; };
350
378
 
351
379
  /**
352
380
  * Copyright (c) 2023
@@ -737,8 +765,8 @@
737
765
  */
738
766
  EmbedEvent["Load"] = "load";
739
767
  /**
740
- * Data pertaining to answer or Liveboard is received
741
- * @return data - The answer or Liveboard data
768
+ * Data pertaining to an Answer or Liveboard is received
769
+ * @return data - The Answer or Liveboard data
742
770
  * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
743
771
  * @example
744
772
  *```js
@@ -912,7 +940,7 @@
912
940
  */
913
941
  EmbedEvent["Alert"] = "alert";
914
942
  /**
915
- * The ThoughtSpot auth session has expired.
943
+ * The ThoughtSpot authentication session has expired.
916
944
  * @version SDK: 1.4.0 | ThoughtSpot: ts7.sep.cl, 8.4.1.sw
917
945
  * @example
918
946
  *```js
@@ -982,7 +1010,7 @@
982
1010
  /**
983
1011
  * Emitted when the embed does not have cookie access. This happens
984
1012
  * when Safari and other Web browsers block third-party cookies
985
- * are blocked by default. `NoCookieAccess` can trigger
1013
+ * are blocked by default. `NoCookieAccess` can trigger.
986
1014
  * @example
987
1015
  *```js
988
1016
  * appEmbed.on(EmbedEvent.NoCookieAccess)
@@ -1070,7 +1098,7 @@
1070
1098
  */
1071
1099
  EmbedEvent["Save"] = "save";
1072
1100
  /**
1073
- * Emitted when the download action is triggered on an answer
1101
+ * Emitted when the download action is triggered on an Answer.
1074
1102
  *
1075
1103
  * **Note**: This event is deprecated in v1.21.0.
1076
1104
  * To fire an event when a download action is initiated on a chart or table,
@@ -1086,7 +1114,7 @@
1086
1114
  */
1087
1115
  EmbedEvent["Download"] = "download";
1088
1116
  /**
1089
- * Emitted when the download action is triggered on an answer
1117
+ * Emitted when the download action is triggered on an Answer.
1090
1118
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.0.sw
1091
1119
  * @example
1092
1120
  *```js
@@ -1100,7 +1128,7 @@
1100
1128
  */
1101
1129
  EmbedEvent["DownloadAsPng"] = "downloadAsPng";
1102
1130
  /**
1103
- * Emitted when the Download as PDF action is triggered on an answer
1131
+ * Emitted when the Download as PDF action is triggered on an Answer
1104
1132
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1105
1133
  * @example
1106
1134
  *```js
@@ -1114,7 +1142,7 @@
1114
1142
  */
1115
1143
  EmbedEvent["DownloadAsPdf"] = "downloadAsPdf";
1116
1144
  /**
1117
- * Emitted when the Download as CSV action is triggered on an answer
1145
+ * Emitted when the Download as CSV action is triggered on an Answer.
1118
1146
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1119
1147
  * @example
1120
1148
  *```js
@@ -1128,7 +1156,7 @@
1128
1156
  */
1129
1157
  EmbedEvent["DownloadAsCsv"] = "downloadAsCsv";
1130
1158
  /**
1131
- * Emitted when the Download as XLSX action is triggered on an answer
1159
+ * Emitted when the Download as XLSX action is triggered on an Answer.
1132
1160
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1133
1161
  * @example
1134
1162
  *```js
@@ -1156,7 +1184,8 @@
1156
1184
  */
1157
1185
  EmbedEvent["AnswerDelete"] = "answerDelete";
1158
1186
  /**
1159
- * Emitted when an answer is pinned to a Liveboard
1187
+ * Emitted when a user initiates the Pin action to
1188
+ * add an Answer to a Liveboard.
1160
1189
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1161
1190
  * @example
1162
1191
  *```js
@@ -1294,7 +1323,7 @@
1294
1323
  */
1295
1324
  EmbedEvent["SaveAsView"] = "saveAsView";
1296
1325
  /**
1297
- * Emitted when the user creates a copy of an Answer
1326
+ * Emitted when the user creates a copy of an Answer.
1298
1327
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1299
1328
  * @example
1300
1329
  *```js
@@ -1308,7 +1337,7 @@
1308
1337
  */
1309
1338
  EmbedEvent["CopyAEdit"] = "copyAEdit";
1310
1339
  /**
1311
- * Emitted when a user clicks Show underlying data on an Answer
1340
+ * Emitted when a user clicks *Show underlying data* on an Answer.
1312
1341
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1313
1342
  * @example
1314
1343
  *```js
@@ -1319,7 +1348,7 @@
1319
1348
  */
1320
1349
  EmbedEvent["ShowUnderlyingData"] = "showUnderlyingData";
1321
1350
  /**
1322
- * Emitted when an answer is switched to a chart or table view.
1351
+ * Emitted when an Answer is switched to a chart or table view.
1323
1352
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1324
1353
  * @example
1325
1354
  *```js
@@ -1453,11 +1482,12 @@
1453
1482
  */
1454
1483
  EmbedEvent["CopyLink"] = "embedDocument";
1455
1484
  /**
1456
- * Emitted when a user interacts with cross filters on a visualization or Liveboard
1485
+ * Emitted when a user interacts with cross filters on a
1486
+ * visualization or Liveboard.
1457
1487
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.0.sw
1458
1488
  * @example
1459
1489
  *```js
1460
- * liveboardEmbed.trigger(HostEvent.CrossFilterChanged, {
1490
+ * liveboardEmbed.on(EmbedEvent.CrossFilterChanged, {
1461
1491
  * vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1462
1492
  *```
1463
1493
  */
@@ -1551,8 +1581,8 @@
1551
1581
  */
1552
1582
  EmbedEvent["DeletePersonalisedView"] = "deletePersonalisedView";
1553
1583
  /**
1554
- * Emitted when a user creates a new worksheet
1555
- * @version SDK : 1.27.0 | ThoughtSpot Cloud: 9.8.0.cl
1584
+ * Emitted when a user creates a Worksheet.
1585
+ * @version SDK : 1.27.0 | ThoughtSpot: 9.8.0.cl, 9.8.0.sw
1556
1586
  */
1557
1587
  EmbedEvent["CreateWorksheet"] = "createWorksheet";
1558
1588
  /**
@@ -1565,8 +1595,8 @@
1565
1595
  */
1566
1596
  EmbedEvent["AskSageInit"] = "AskSageInit";
1567
1597
  /**
1568
- * Emitted when a LB/viz is renamed
1569
- * @version SDK : 1.28.0 | ThoughtSpot: 9.10.5.cl
1598
+ * Emitted when a Liveboard or visualization is renamed.
1599
+ * @version SDK : 1.28.0 | ThoughtSpot: 9.10.5.cl, 10.1.0.sw
1570
1600
  */
1571
1601
  EmbedEvent["Rename"] = "rename";
1572
1602
  /**
@@ -1630,8 +1660,7 @@
1630
1660
  EmbedEvent["OnBeforeGetVizDataIntercept"] = "onBeforeGetVizDataIntercept";
1631
1661
  /**
1632
1662
  * Emitted when parameter changes in an Answer
1633
- * or Liveboard
1634
- *
1663
+ * or Liveboard.
1635
1664
  * ```js
1636
1665
  * liveboardEmbed.on(EmbedEvent.ParameterChanged, (payload) => {
1637
1666
  * console.log('payload', payload);
@@ -1658,7 +1687,7 @@
1658
1687
  */
1659
1688
  EmbedEvent["TableVizRendered"] = "TableVizRendered";
1660
1689
  /**
1661
- * Emitted when the liveboard is created from pin modal or liveboard list page.
1690
+ * Emitted when the liveboard is created from pin modal or Liveboard list page.
1662
1691
  * You can use this event as a hook to trigger
1663
1692
  * other events on liveboard creation.
1664
1693
  *
@@ -1803,7 +1832,7 @@
1803
1832
  */
1804
1833
  HostEvent["Filter"] = "filter";
1805
1834
  /**
1806
- * Reload the answer or visualization
1835
+ * Reload the Answer or visualization
1807
1836
  * @hidden
1808
1837
  */
1809
1838
  HostEvent["Reload"] = "reload";
@@ -1853,12 +1882,10 @@
1853
1882
  * and `AppEmbed` only. In full application embedding, this event updates
1854
1883
  * the runtime filters applied on the Liveboard and saved Answer objects.
1855
1884
  *
1856
- *
1857
- * Pass an array of runtime filters with the following attributes:
1858
- *
1885
+ * @param - Pass an array of {@link RuntimeFilter} with the following attributes:
1859
1886
  * `columnName` - _String_. The name of the column to filter on.
1860
1887
  *
1861
- * `operator` - Runtime filter operator to apply. For more information,
1888
+ * `operator` - {@link RuntimeFilterOp} to apply. For more information,
1862
1889
  * see link:https://developers.thoughtspot.com/docs/?pageid=runtime-filters#rtOperator[Developer Documentation].
1863
1890
  *
1864
1891
  * `values` - List of operands. Some operators such as EQ and LE allow a
@@ -1870,7 +1897,7 @@
1870
1897
  * will be cleared, restoring the original visualization
1871
1898
  * with the updated filters.
1872
1899
  *
1873
- * @param - {@link RuntimeFilter}[] an array of {@link RuntimeFilter} Types.
1900
+
1874
1901
  * @example
1875
1902
  * ```js
1876
1903
  * liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
@@ -2109,6 +2136,11 @@
2109
2136
  * appEmbed.trigger(HostEvent.Remove)
2110
2137
  * ```
2111
2138
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2139
+ * * @example
2140
+ * ```js
2141
+ * liveboardEmbed.trigger(HostEvent.Remove)
2142
+ * ```
2143
+ * @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl, 10.10.0.sw
2112
2144
  */
2113
2145
  HostEvent["Remove"] = "delete";
2114
2146
  /**
@@ -2519,7 +2551,7 @@
2519
2551
  * ```js
2520
2552
  * liveboardEmbed.trigger(HostEvent.GetTabs).then((tabDetails) => {
2521
2553
  * console.log(
2522
- * tabDetails // TabDetails of current LB
2554
+ * tabDetails // TabDetails of current Liveboard
2523
2555
  * );
2524
2556
  * })
2525
2557
  * ```
@@ -2567,7 +2599,7 @@
2567
2599
  */
2568
2600
  HostEvent["UpdateSageQuery"] = "updateSageQuery";
2569
2601
  /**
2570
- * Get the answer session for a Search or
2602
+ * Get the Answer session for a Search or
2571
2603
  * Liveboard visualization.
2572
2604
  * @example
2573
2605
  * ```js
@@ -2746,6 +2778,7 @@
2746
2778
  Param["HostAppUrl"] = "hostAppUrl";
2747
2779
  Param["EnableVizTransformations"] = "enableVizTransform";
2748
2780
  Param["EnableSearchAssist"] = "enableSearchAssist";
2781
+ Param["EnablePendoHelp"] = "enablePendoHelp";
2749
2782
  Param["HideResult"] = "hideResult";
2750
2783
  Param["UseLastSelectedDataSource"] = "useLastSelectedSources";
2751
2784
  Param["Tag"] = "tag";
@@ -2978,9 +3011,10 @@
2978
3011
  */
2979
3012
  Action["AddDataPanelObjects"] = "addDataPanelObjects";
2980
3013
  /**
2981
- * Filter configuration options on a Liveboard page.
2982
- * Allows configuring filters on a
2983
- * Liveboard.
3014
+ * The filter configuration options for a Liveboard.
3015
+ * The configuration options are available when adding
3016
+ * filters on a Liveboard.
3017
+ *
2984
3018
  * @example
2985
3019
  * ```js
2986
3020
  * disabledActions: [Action.ConfigureFilter]
@@ -3078,14 +3112,17 @@
3078
3112
  * @hidden
3079
3113
  */
3080
3114
  Action["SpotIQFollow"] = "spotIQFollow";
3115
+ /**
3116
+ * The Share action for a Liveboard visualization.
3117
+ */
3081
3118
  Action["ShareViz"] = "shareViz";
3082
3119
  /**
3083
3120
  * @hidden
3084
3121
  */
3085
3122
  Action["ReplaySearch"] = "replaySearch";
3086
3123
  /**
3087
- * The **Show underlying data** menu action on a visualization or
3088
- * Answer page.
3124
+ * The **Show underlying data** menu action on a
3125
+ * visualization or Answer page.
3089
3126
  * Displays detailed information and raw data
3090
3127
  * for a given visualization.
3091
3128
  * @example
@@ -3095,8 +3132,8 @@
3095
3132
  */
3096
3133
  Action["ShowUnderlyingData"] = "showUnderlyingData";
3097
3134
  /**
3098
- * The **Download** menu action on Liveboard visualizations
3099
- * and Answers.
3135
+ * The **Download** menu action on Liveboard
3136
+ * visualizations and Answers.
3100
3137
  * Allows downloading a visualization or Answer.
3101
3138
  * @example
3102
3139
  * ```js
@@ -3117,11 +3154,10 @@
3117
3154
  /**
3118
3155
  *
3119
3156
  *The **Download PDF** action that downloads a Liveboard,
3120
- *visualization, or Answer as a PDF file.
3157
+ * visualization, or Answer as a PDF file.
3121
3158
  *
3122
- *
3123
- ***NOTE**: The **Download** > **PDF** action is available on
3124
- *visualizations and Answers if the data is in tabular format.
3159
+ * **NOTE**: The **Download** > **PDF** option is available for
3160
+ * tables in visualizations and Answers.
3125
3161
  * @example
3126
3162
  * ```js
3127
3163
  * disabledActions: [Action.DownloadAsPdf]
@@ -3153,9 +3189,11 @@
3153
3189
  */
3154
3190
  Action["DownloadTrace"] = "downloadTrace";
3155
3191
  /**
3156
- * The **Export TML** menu action on Liveboard, Answers
3157
- * Worksheets and Data Connections page.
3158
- * Exports an object as a TML file.
3192
+ * The **Export TML** menu action on a Liveboard, Answer, and
3193
+ * the Data Workspace pages for data objects and connections.
3194
+ *
3195
+ * Allows exporting an object as a TML file.
3196
+ *
3159
3197
  * @example
3160
3198
  * ```js
3161
3199
  * disabledActions: [Action.ExportTML]
@@ -3163,7 +3201,8 @@
3163
3201
  */
3164
3202
  Action["ExportTML"] = "exportTSL";
3165
3203
  /**
3166
- * The **Import TML** menu action for Liveboards and Answers.
3204
+ * The **Import TML** menu action on the
3205
+ * *Data Workspace* > *Utilities* page.
3167
3206
  * Imports TML representation of ThoughtSpot objects.
3168
3207
  * @example
3169
3208
  * ```js
@@ -3173,7 +3212,7 @@
3173
3212
  Action["ImportTML"] = "importTSL";
3174
3213
  /**
3175
3214
  * The **Update TML** menu action for Liveboards and Answers.
3176
- * Update TML representation of ThoughtSpot objects.
3215
+ * Updates TML representation of ThoughtSpot objects.
3177
3216
  * @example
3178
3217
  * ```js
3179
3218
  * disabledActions: [Action.UpdateTML]
@@ -3200,8 +3239,11 @@
3200
3239
  */
3201
3240
  Action["Present"] = "present";
3202
3241
  /**
3203
- * The tile resize options in the visualization menu.
3204
- * Allows switching between different preset layouts.
3242
+ * The visualization tile resize option.
3243
+ * Also available via More `...` options menu on a visualization.
3244
+ * Allows resizing visualization tiles and switching
3245
+ * between different preset layout option.
3246
+ *
3205
3247
  * @example
3206
3248
  * ```js
3207
3249
  * disabledActions: [Action.ToggleSize]
@@ -3227,8 +3269,9 @@
3227
3269
  */
3228
3270
  Action["EditTitle"] = "editTitle";
3229
3271
  /**
3230
- * The **Delete** menu action on Liveboards and visualizations.
3231
- * Deletes a Liveboard or a visualization from a Liveboard.
3272
+ * The **Delete** action on a Liveboard, *Liveboards* and
3273
+ * *Answers* list pages in full application embedding.
3274
+ *
3232
3275
  * @example
3233
3276
  * ```js
3234
3277
  * disabledActions: [Action.Remove]
@@ -3305,8 +3348,9 @@
3305
3348
  */
3306
3349
  Action["Explore"] = "explore";
3307
3350
  /**
3308
- * The action to include data points on a drilled-down Answer
3309
- * or visualization
3351
+ * The contextual menu action to include a specific data point
3352
+ * when drilling down a table or chart on an Answer.
3353
+ *
3310
3354
  * @example
3311
3355
  * ```js
3312
3356
  * disabledActions: [Action.DrillInclude]
@@ -3314,8 +3358,8 @@
3314
3358
  */
3315
3359
  Action["DrillInclude"] = "context-menu-item-include";
3316
3360
  /**
3317
- * The action to exclude data points on a drilled-down Answer
3318
- * or visualization
3361
+ * The contextual menu action to exclude a specific data point
3362
+ * when drilling down a table or chart on an Answer.
3319
3363
  * @example
3320
3364
  * ```js
3321
3365
  * disabledActions: [Action.DrillInclude]
@@ -3462,7 +3506,7 @@
3462
3506
  * Allows users to manage data sync pipelines to third-party apps.
3463
3507
  * @example
3464
3508
  * ```js
3465
- * disabledActions: [Action.SyncToOtherApps]
3509
+ * disabledActions: [Action.ManagePipelines]
3466
3510
  * ```
3467
3511
  * @version SDK: 1.18.0| ThoughtSpot: 8.10.0.cl, 9.0.1.sw
3468
3512
  */
@@ -3781,7 +3825,7 @@
3781
3825
  /**
3782
3826
  * Action ID for the Parent TML action
3783
3827
  * The parent action **TML** must be included to access TML-related options
3784
- * within the cascading menu (specific to the answer page)
3828
+ * within the cascading menu (specific to the Answer page)
3785
3829
  * @example
3786
3830
  * ```js
3787
3831
  * // to include specific TML actions
@@ -3820,8 +3864,10 @@
3820
3864
  */
3821
3865
  Action["VerifiedLiveboard"] = "verifiedLiveboard";
3822
3866
  /**
3823
- * The *Ask Sage* action for Answers and visualizations.
3824
- * Allows initiating a Natural Language Search query.
3867
+ * Action ID for the *Ask Sage* In Natural Language Search embed,
3868
+ * *Spotter* in Liveboard, full app, and Spotter embed.
3869
+ *
3870
+ * Allows initiating a conversation with ThoughtSpot AI analyst.
3825
3871
  *
3826
3872
  * @example
3827
3873
  * ```js
@@ -4017,7 +4063,8 @@
4017
4063
  */
4018
4064
  Action["DeletePreviousPrompt"] = "deletePreviousPrompt";
4019
4065
  /**
4020
- * Action ID for hide/disable edit of tokens on spotter results.
4066
+ * Action ID for hide or disable editing tokens generated from
4067
+ * Spotter results.
4021
4068
  * @example
4022
4069
  * ```js
4023
4070
  * hiddenAction: [Action.EditTokens]
@@ -6490,6 +6537,7 @@
6490
6537
  CSP_VIOLATION_ALERT: 'CSP violation detected. Please check the console errors for more details.',
6491
6538
  CSP_FRAME_HOST_VIOLATION_LOG_MESSAGE: 'Please set up CSP correctly for the application to start working. For more information, see https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts. \n If the issue persists, refer to https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts',
6492
6539
  MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
6540
+ RENDER_CALLED_BEFORE_INIT: 'Looks like render was called before calling init, the render won\'t start until init is called.\nFor more info check\n1. https://developers.thoughtspot.com/docs/Function_init#_init\n2.https://developers.thoughtspot.com/docs/getting-started#initSdk',
6493
6541
  };
6494
6542
 
6495
6543
  const EndPoints = {
@@ -6606,13 +6654,18 @@
6606
6654
  });
6607
6655
  }
6608
6656
 
6609
- let cachedAuthToken = null;
6657
+ const cacheAuthTokenKey = 'cachedAuthToken';
6658
+ const getCacheAuthToken = () => getValueFromWindow(cacheAuthTokenKey);
6659
+ const storeAuthTokenInCache = (token) => {
6660
+ storeValueInWindow(cacheAuthTokenKey, token);
6661
+ };
6610
6662
  // This method can be used to get the authToken using the embedConfig
6611
6663
  /**
6612
6664
  *
6613
6665
  * @param embedConfig
6614
6666
  */
6615
6667
  async function getAuthenticationToken(embedConfig) {
6668
+ const cachedAuthToken = getCacheAuthToken();
6616
6669
  // Since we don't have token validation enabled , we cannot tell if the
6617
6670
  // cached token is valid or not. So we will always fetch a new token.
6618
6671
  if (cachedAuthToken && !embedConfig.disableTokenVerification) {
@@ -6643,10 +6696,11 @@
6643
6696
  logger$3.error(`${ERROR_MESSAGE.INVALID_TOKEN_ERROR} Error : ${e.message}`);
6644
6697
  throw e;
6645
6698
  }
6646
- cachedAuthToken = authToken;
6699
+ storeAuthTokenInCache(authToken);
6647
6700
  return authToken;
6648
6701
  }
6649
6702
  const validateAuthToken = async (embedConfig, authToken, suppressAlert) => {
6703
+ const cachedAuthToken = getCacheAuthToken();
6650
6704
  if (embedConfig.disableTokenVerification) {
6651
6705
  logger$3.info('Token verification is disabled. Assuming token is valid.');
6652
6706
  return true;
@@ -6680,17 +6734,17 @@
6680
6734
  * @group Authentication / Init
6681
6735
  */
6682
6736
  const resetCachedAuthToken = () => {
6683
- cachedAuthToken = null;
6737
+ storeAuthTokenInCache(null);
6684
6738
  };
6685
6739
 
6686
- let config = {};
6740
+ const configKey = 'embedConfig';
6687
6741
  /**
6688
6742
  * Gets the configuration embed was initialized with.
6689
6743
  * @returns {@link EmbedConfig} The configuration embed was initialized with.
6690
6744
  * @version SDK: 1.19.0 | ThoughtSpot: *
6691
6745
  * @group Global methods
6692
6746
  */
6693
- const getEmbedConfig = () => config;
6747
+ const getEmbedConfig = () => getValueFromWindow(configKey) || {};
6694
6748
  /**
6695
6749
  * Sets the configuration embed was initialized with.
6696
6750
  * And returns the new configuration.
@@ -6699,8 +6753,8 @@
6699
6753
  * @group Global methods
6700
6754
  */
6701
6755
  const setEmbedConfig = (newConfig) => {
6702
- config = newConfig;
6703
- return newConfig;
6756
+ storeValueInWindow(configKey, newConfig);
6757
+ return getValueFromWindow(configKey);
6704
6758
  };
6705
6759
 
6706
6760
  /**
@@ -14708,6 +14762,18 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14708
14762
  }
14709
14763
  };
14710
14764
 
14765
+ if (typeof Promise.withResolvers === 'undefined') {
14766
+ Promise.withResolvers = () => {
14767
+ let resolve;
14768
+ let reject;
14769
+ const promise = new Promise((res, rej) => {
14770
+ resolve = res;
14771
+ reject = rej;
14772
+ });
14773
+ return { promise, resolve, reject };
14774
+ };
14775
+ }
14776
+
14711
14777
  /* eslint-disable camelcase */
14712
14778
  /* eslint-disable import/no-mutable-exports */
14713
14779
  /**
@@ -14814,6 +14880,25 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14814
14880
  }
14815
14881
  return newConfig;
14816
14882
  }
14883
+ const initFlagKey = 'initFlagKey';
14884
+ const createAndSetInitPromise = () => {
14885
+ const { promise: initPromise, resolve: initPromiseResolve,
14886
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
14887
+ // @ts-ignore
14888
+ } = Promise.withResolvers();
14889
+ const initFlagStore = {
14890
+ initPromise,
14891
+ isInitCalled: false,
14892
+ initPromiseResolve,
14893
+ };
14894
+ storeValueInWindow(initFlagKey, initFlagStore, {
14895
+ // In case of diff imports the promise might be already set
14896
+ ignoreIfAlreadyExists: true,
14897
+ });
14898
+ };
14899
+ createAndSetInitPromise();
14900
+ const getInitPromise = () => { var _a; return (_a = getValueFromWindow(initFlagKey)) === null || _a === void 0 ? void 0 : _a.initPromise; };
14901
+ const getIsInitCalled = () => { var _a; return !!((_a = getValueFromWindow(initFlagKey)) === null || _a === void 0 ? void 0 : _a.isInitCalled); };
14817
14902
  /**
14818
14903
  * Initializes the Visual Embed SDK globally and perform
14819
14904
  * authentication if applicable. This function needs to be called before any ThoughtSpot
@@ -14860,6 +14945,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14860
14945
  if (getEmbedConfig().callPrefetch) {
14861
14946
  prefetch(getEmbedConfig().thoughtSpotHost);
14862
14947
  }
14948
+ // Resolves the promise created in the initPromiseKey
14949
+ getValueFromWindow(initFlagKey).initPromiseResolve(authEE);
14950
+ getValueFromWindow(initFlagKey).isInitCalled = true;
14863
14951
  return authEE;
14864
14952
  };
14865
14953
  /**
@@ -15130,7 +15218,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15130
15218
  return e;
15131
15219
  }
15132
15220
 
15133
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.36.2";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","eslint-plugin-comment-length":"1.7.3","eslint-plugin-jsdoc":"^46.9.0","fs-extra":"^10.0.0","gh-pages":"6.3.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^5.3.4"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
15221
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.36.4";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","eslint-plugin-comment-length":"1.7.3","eslint-plugin-jsdoc":"^46.9.0","fs-extra":"^10.0.0","gh-pages":"6.3.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^5.3.4"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
15134
15222
 
15135
15223
  /**
15136
15224
  * Reloads the ThoughtSpot iframe.
@@ -15439,13 +15527,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15439
15527
  }
15440
15528
  };
15441
15529
  this.el = getDOMNode(domSelector);
15442
- // TODO: handle error
15443
- this.embedConfig = getEmbedConfig();
15444
- if (!this.embedConfig.authTriggerContainer && !this.embedConfig.useEventForSAMLPopup) {
15445
- this.embedConfig.authTriggerContainer = domSelector;
15446
- }
15447
- this.thoughtSpotHost = getThoughtSpotHost(this.embedConfig);
15448
- this.thoughtSpotV2Base = getV2BasePath(this.embedConfig);
15449
15530
  this.eventHandlerMap = new Map();
15450
15531
  this.isError = false;
15451
15532
  this.viewConfig = {
@@ -15453,12 +15534,21 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15453
15534
  excludeRuntimeParametersfromURL: false,
15454
15535
  ...viewConfig,
15455
15536
  };
15456
- this.shouldEncodeUrlQueryParams = this.embedConfig.shouldEncodeUrlQueryParams;
15457
15537
  this.registerAppInit();
15458
15538
  uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
15459
15539
  ...viewConfig,
15460
15540
  });
15461
15541
  this.hostEventClient = new HostEventClient(this.iFrame);
15542
+ this.isReadyForRenderPromise = getInitPromise().then(async () => {
15543
+ const embedConfig = getEmbedConfig();
15544
+ this.embedConfig = embedConfig;
15545
+ if (!embedConfig.authTriggerContainer && !embedConfig.useEventForSAMLPopup) {
15546
+ this.embedConfig.authTriggerContainer = domSelector;
15547
+ }
15548
+ this.thoughtSpotHost = getThoughtSpotHost(embedConfig);
15549
+ this.thoughtSpotV2Base = getV2BasePath(embedConfig);
15550
+ this.shouldEncodeUrlQueryParams = embedConfig.shouldEncodeUrlQueryParams;
15551
+ });
15462
15552
  }
15463
15553
  /**
15464
15554
  * Throws error encountered during initialization.
@@ -16176,6 +16266,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16176
16266
  * @param args
16177
16267
  */
16178
16268
  async render() {
16269
+ if (!getIsInitCalled()) {
16270
+ logger$3.error(ERROR_MESSAGE.RENDER_CALLED_BEFORE_INIT);
16271
+ }
16272
+ await this.isReadyForRenderPromise;
16179
16273
  this.isRendered = true;
16180
16274
  return this;
16181
16275
  }
@@ -16183,21 +16277,20 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16183
16277
  return '';
16184
16278
  }
16185
16279
  handleRenderForPrerender() {
16186
- this.render();
16280
+ return this.render();
16187
16281
  }
16188
16282
  /**
16189
16283
  * Creates the preRender shell
16190
16284
  * @param showPreRenderByDefault - Show the preRender after render, hidden by default
16191
16285
  */
16192
- preRender(showPreRenderByDefault = false) {
16286
+ async preRender(showPreRenderByDefault = false) {
16193
16287
  if (!this.viewConfig.preRenderId) {
16194
16288
  logger$3.error(ERROR_MESSAGE.PRERENDER_ID_MISSING);
16195
16289
  return this;
16196
16290
  }
16197
16291
  this.isPreRendered = true;
16198
16292
  this.showPreRenderByDefault = showPreRenderByDefault;
16199
- this.handleRenderForPrerender();
16200
- return this;
16293
+ return this.handleRenderForPrerender();
16201
16294
  }
16202
16295
  /**
16203
16296
  * Get the Post Url Params for THOUGHTSPOT from the current
@@ -16250,6 +16343,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16250
16343
  * @returns
16251
16344
  */
16252
16345
  async prerenderGeneric() {
16346
+ if (!getIsInitCalled()) {
16347
+ logger$3.error(ERROR_MESSAGE.RENDER_CALLED_BEFORE_INIT);
16348
+ }
16349
+ await this.isReadyForRenderPromise;
16253
16350
  const prerenderFrameSrc = this.getRootIframeSrc();
16254
16351
  this.isRendered = true;
16255
16352
  return this.renderIFrame(prerenderFrameSrc);
@@ -16263,17 +16360,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16263
16360
  * Also, synchronizes the style of the PreRender component with the embedding
16264
16361
  * element.
16265
16362
  */
16266
- showPreRender() {
16363
+ async showPreRender() {
16267
16364
  if (!this.viewConfig.preRenderId) {
16268
16365
  logger$3.error(ERROR_MESSAGE.PRERENDER_ID_MISSING);
16269
- return;
16366
+ return this;
16270
16367
  }
16271
16368
  if (!this.isPreRenderAvailable()) {
16272
16369
  const isAvailable = this.connectPreRendered();
16273
16370
  if (!isAvailable) {
16274
16371
  // if the Embed component is not preRendered , Render it now and
16275
- this.preRender(true);
16276
- return;
16372
+ return this.preRender(true);
16277
16373
  }
16278
16374
  this.validatePreRenderViewConfig(this.viewConfig);
16279
16375
  }
@@ -16296,6 +16392,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16296
16392
  this.beforePrerenderVisible();
16297
16393
  removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events']);
16298
16394
  this.subscribeToEvents();
16395
+ return this;
16299
16396
  }
16300
16397
  /**
16301
16398
  * Synchronizes the style properties of the PreRender component with the embedding
@@ -16557,7 +16654,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16557
16654
  getEmbedParams() {
16558
16655
  const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
16559
16656
  /* eslint-disable-next-line max-len */
16560
- dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, } = this.viewConfig;
16657
+ dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, } = this.viewConfig;
16561
16658
  let params = {};
16562
16659
  params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
16563
16660
  params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
@@ -16602,6 +16699,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16602
16699
  if (homePageSearchBarMode) {
16603
16700
  params[Param.HomePageSearchBarMode] = homePageSearchBarMode;
16604
16701
  }
16702
+ if (enablePendoHelp !== undefined) {
16703
+ params[Param.EnablePendoHelp] = enablePendoHelp;
16704
+ }
16605
16705
  params[Param.DataPanelV2Enabled] = dataPanelV2;
16606
16706
  params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
16607
16707
  params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
@@ -16710,7 +16810,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16710
16810
  * to be embedded.
16711
16811
  */
16712
16812
  async render() {
16713
- super.render();
16813
+ await super.render();
16714
16814
  const src = this.getIFrameSrc();
16715
16815
  await this.renderV1Embed(src);
16716
16816
  return this;
@@ -16989,12 +17089,11 @@ query GetEurekaVizSnapshots(
16989
17089
  this.navigateToLiveboard(libId);
16990
17090
  }
16991
17091
  }
16992
- handleRenderForPrerender() {
17092
+ async handleRenderForPrerender() {
16993
17093
  if (isUndefined$1(this.viewConfig.liveboardId)) {
16994
- this.prerenderGeneric();
16995
- return;
17094
+ return this.prerenderGeneric();
16996
17095
  }
16997
- super.handleRenderForPrerender();
17096
+ return super.handleRenderForPrerender();
16998
17097
  }
16999
17098
  /**
17000
17099
  * Triggers an event to the embedded app
@@ -17019,7 +17118,7 @@ query GetEurekaVizSnapshots(
17019
17118
  * visualization ID and the runtime filters.
17020
17119
  */
17021
17120
  async render() {
17022
- super.render();
17121
+ await super.render();
17023
17122
  const src = this.getIFrameSrc();
17024
17123
  await this.renderV1Embed(src);
17025
17124
  this.showPreviewLoader();
@@ -17227,7 +17326,7 @@ query GetEurekaVizSnapshots(
17227
17326
  * Render the embedded ThoughtSpot search
17228
17327
  */
17229
17328
  async render() {
17230
- super.render();
17329
+ await super.render();
17231
17330
  this.viewConfig;
17232
17331
  const src = this.getIFrameSrc();
17233
17332
  await this.renderIFrame(src);
@@ -17294,7 +17393,7 @@ query GetEurekaVizSnapshots(
17294
17393
  * Render the embedded ThoughtSpot search
17295
17394
  */
17296
17395
  async render() {
17297
- super.render();
17396
+ await super.render();
17298
17397
  const src = this.getIFrameSrc();
17299
17398
  await this.renderIFrame(src);
17300
17399
  return this;
@@ -17718,7 +17817,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
17718
17817
  return `${this.getEmbedBasePath(query)}/embed/${path}${tsPostHashParams}`;
17719
17818
  }
17720
17819
  async render() {
17721
- super.render();
17820
+ await super.render();
17722
17821
  const src = this.getIframeSrc();
17723
17822
  await this.renderIFrame(src);
17724
17823
  return this;
@@ -17846,7 +17945,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
17846
17945
  return `${this.getEmbedBasePath(query)}/embed/${path}${tsPostHashParams}`;
17847
17946
  }
17848
17947
  async render() {
17849
- super.render();
17948
+ await super.render();
17850
17949
  const src = this.getIframeSrc();
17851
17950
  await this.renderIFrame(src);
17852
17951
  return this;
@@ -17922,7 +18021,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
17922
18021
  * @returns {SageEmbed} Eureka/Sage embed
17923
18022
  */
17924
18023
  async render() {
17925
- super.render();
18024
+ await super.render();
17926
18025
  const src = this.getIFrameSrc();
17927
18026
  await this.renderV1Embed(src);
17928
18027
  return this;