@thoughtspot/visual-embed-sdk 1.26.1 → 1.26.2

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 (267) hide show
  1. package/cjs/package.json +2 -2
  2. package/cjs/src/auth.d.ts +0 -12
  3. package/cjs/src/auth.d.ts.map +1 -1
  4. package/cjs/src/auth.js +16 -54
  5. package/cjs/src/auth.js.map +1 -1
  6. package/cjs/src/auth.spec.d.ts.map +1 -1
  7. package/cjs/src/auth.spec.js +42 -32
  8. package/cjs/src/auth.spec.js.map +1 -1
  9. package/cjs/src/authToken.d.ts +4 -0
  10. package/cjs/src/authToken.d.ts.map +1 -0
  11. package/cjs/src/authToken.js +61 -0
  12. package/cjs/src/authToken.js.map +1 -0
  13. package/cjs/src/embed/TsEmbed.d.ts +302 -0
  14. package/cjs/src/embed/TsEmbed.d.ts.map +1 -0
  15. package/cjs/src/embed/TsEmbed.js +851 -0
  16. package/cjs/src/embed/TsEmbed.js.map +1 -0
  17. package/cjs/src/embed/base.d.ts +0 -9
  18. package/cjs/src/embed/base.d.ts.map +1 -1
  19. package/cjs/src/embed/base.js +21 -44
  20. package/cjs/src/embed/base.js.map +1 -1
  21. package/cjs/src/embed/base.spec.js +15 -14
  22. package/cjs/src/embed/base.spec.js.map +1 -1
  23. package/cjs/src/embed/embedConfig.d.ts +18 -0
  24. package/cjs/src/embed/embedConfig.d.ts.map +1 -0
  25. package/cjs/src/embed/embedConfig.js +25 -0
  26. package/cjs/src/embed/embedConfig.js.map +1 -0
  27. package/cjs/src/embed/search.d.ts.map +1 -1
  28. package/cjs/src/embed/search.js +3 -1
  29. package/cjs/src/embed/search.js.map +1 -1
  30. package/cjs/src/embed/searchEmbed-basic-auth.spec.js +3 -2
  31. package/cjs/src/embed/searchEmbed-basic-auth.spec.js.map +1 -1
  32. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  33. package/cjs/src/embed/ts-embed.js +5 -3
  34. package/cjs/src/embed/ts-embed.js.map +1 -1
  35. package/cjs/src/embed/ts-embed.spec.js +58 -49
  36. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  37. package/cjs/src/index.d.ts +2 -1
  38. package/cjs/src/index.d.ts.map +1 -1
  39. package/cjs/src/index.js +2 -1
  40. package/cjs/src/index.js.map +1 -1
  41. package/cjs/src/tokenizedFetch.d.ts +2 -0
  42. package/cjs/src/tokenizedFetch.d.ts.map +1 -0
  43. package/cjs/src/tokenizedFetch.js +20 -0
  44. package/cjs/src/tokenizedFetch.js.map +1 -0
  45. package/cjs/src/types.d.ts +6 -0
  46. package/cjs/src/types.d.ts.map +1 -1
  47. package/cjs/src/types.js.map +1 -1
  48. package/cjs/src/utils/answerService.d.ts +10 -0
  49. package/cjs/src/utils/answerService.d.ts.map +1 -0
  50. package/cjs/src/utils/answerService.js +61 -0
  51. package/cjs/src/utils/answerService.js.map +1 -0
  52. package/cjs/src/utils/answerService.spec.d.ts +2 -0
  53. package/cjs/src/utils/answerService.spec.d.ts.map +1 -0
  54. package/cjs/src/utils/answerService.spec.js +31 -0
  55. package/cjs/src/utils/answerService.spec.js.map +1 -0
  56. package/cjs/src/utils/authService/authService.d.ts +45 -0
  57. package/cjs/src/utils/authService/authService.d.ts.map +1 -0
  58. package/cjs/src/utils/authService/authService.js +115 -0
  59. package/cjs/src/utils/authService/authService.js.map +1 -0
  60. package/cjs/src/utils/authService/authService.spec.d.ts +2 -0
  61. package/cjs/src/utils/authService/authService.spec.d.ts.map +1 -0
  62. package/cjs/src/utils/authService/authService.spec.js +82 -0
  63. package/cjs/src/utils/authService/authService.spec.js.map +1 -0
  64. package/cjs/src/utils/authService/index.d.ts +3 -0
  65. package/cjs/src/utils/authService/index.d.ts.map +1 -0
  66. package/cjs/src/utils/authService/index.js +14 -0
  67. package/cjs/src/utils/authService/index.js.map +1 -0
  68. package/cjs/src/utils/authService/tokenisedAuthSerice.d.ts +11 -0
  69. package/cjs/src/utils/authService/tokenisedAuthSerice.d.ts.map +1 -0
  70. package/cjs/src/utils/authService/tokenisedAuthSerice.js +44 -0
  71. package/cjs/src/utils/authService/tokenisedAuthSerice.js.map +1 -0
  72. package/cjs/src/utils/authService/tokenizedAuthService.d.ts +11 -0
  73. package/cjs/src/utils/authService/tokenizedAuthService.d.ts.map +1 -0
  74. package/cjs/src/utils/authService/tokenizedAuthService.js +44 -0
  75. package/cjs/src/utils/authService/tokenizedAuthService.js.map +1 -0
  76. package/cjs/src/utils/authService.d.ts +12 -1
  77. package/cjs/src/utils/authService.d.ts.map +1 -1
  78. package/cjs/src/utils/authService.js +32 -16
  79. package/cjs/src/utils/authService.js.map +1 -1
  80. package/cjs/src/utils/authService.spec.js +3 -4
  81. package/cjs/src/utils/authService.spec.js.map +1 -1
  82. package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  83. package/cjs/src/utils/graphql/answerService/answerService.js +2 -1
  84. package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
  85. package/cjs/src/utils/graphql/answerService/answerService.spec.js +15 -3
  86. package/cjs/src/utils/graphql/answerService/answerService.spec.js.map +1 -1
  87. package/cjs/src/utils/graphql/graphql-request.spec.d.ts +2 -0
  88. package/cjs/src/utils/graphql/graphql-request.spec.d.ts.map +1 -0
  89. package/cjs/src/utils/graphql/graphql-request.spec.js +39 -0
  90. package/cjs/src/utils/graphql/graphql-request.spec.js.map +1 -0
  91. package/cjs/src/utils/logger.d.ts +28 -0
  92. package/cjs/src/utils/logger.d.ts.map +1 -0
  93. package/cjs/src/utils/logger.js +82 -0
  94. package/cjs/src/utils/logger.js.map +1 -0
  95. package/cjs/src/utils/processData.d.ts.map +1 -1
  96. package/cjs/src/utils/processData.js +5 -4
  97. package/cjs/src/utils/processData.js.map +1 -1
  98. package/cjs/src/utils/processData.spec.js +8 -7
  99. package/cjs/src/utils/processData.spec.js.map +1 -1
  100. package/dist/src/auth.d.ts +0 -12
  101. package/dist/src/auth.d.ts.map +1 -1
  102. package/dist/src/auth.spec.d.ts.map +1 -1
  103. package/dist/src/authToken.d.ts +4 -0
  104. package/dist/src/authToken.d.ts.map +1 -0
  105. package/dist/src/embed/base.d.ts +0 -9
  106. package/dist/src/embed/base.d.ts.map +1 -1
  107. package/dist/src/embed/embedConfig.d.ts +18 -0
  108. package/dist/src/embed/embedConfig.d.ts.map +1 -0
  109. package/dist/src/embed/search.d.ts.map +1 -1
  110. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  111. package/dist/src/index.d.ts +2 -1
  112. package/dist/src/index.d.ts.map +1 -1
  113. package/dist/src/tokenizedFetch.d.ts +2 -0
  114. package/dist/src/tokenizedFetch.d.ts.map +1 -0
  115. package/dist/src/types.d.ts +6 -0
  116. package/dist/src/types.d.ts.map +1 -1
  117. package/dist/src/utils/answerService.d.ts +10 -0
  118. package/dist/src/utils/answerService.d.ts.map +1 -0
  119. package/dist/src/utils/answerService.spec.d.ts +2 -0
  120. package/dist/src/utils/answerService.spec.d.ts.map +1 -0
  121. package/dist/src/utils/authService/authService.d.ts +45 -0
  122. package/dist/src/utils/authService/authService.d.ts.map +1 -0
  123. package/dist/src/utils/authService/authService.spec.d.ts +2 -0
  124. package/dist/src/utils/authService/authService.spec.d.ts.map +1 -0
  125. package/dist/src/utils/authService/index.d.ts +3 -0
  126. package/dist/src/utils/authService/index.d.ts.map +1 -0
  127. package/dist/src/utils/authService/tokenisedAuthSerice.d.ts +11 -0
  128. package/dist/src/utils/authService/tokenisedAuthSerice.d.ts.map +1 -0
  129. package/dist/src/utils/authService/tokenizedAuthService.d.ts +11 -0
  130. package/dist/src/utils/authService/tokenizedAuthService.d.ts.map +1 -0
  131. package/dist/src/utils/authService.d.ts +12 -1
  132. package/dist/src/utils/authService.d.ts.map +1 -1
  133. package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  134. package/dist/src/utils/graphql/graphql-request.spec.d.ts +2 -0
  135. package/dist/src/utils/graphql/graphql-request.spec.d.ts.map +1 -0
  136. package/dist/src/utils/logger.d.ts +28 -0
  137. package/dist/src/utils/logger.d.ts.map +1 -0
  138. package/dist/src/utils/processData.d.ts.map +1 -1
  139. package/dist/tsembed-react.es.js +201 -140
  140. package/dist/tsembed-react.js +201 -140
  141. package/dist/tsembed.es.js +230 -171
  142. package/dist/tsembed.js +230 -171
  143. package/dist/visual-embed-sdk-react-full.d.ts +23 -21
  144. package/dist/visual-embed-sdk-react.d.ts +23 -21
  145. package/dist/visual-embed-sdk.d.ts +23 -21
  146. package/lib/package.json +2 -2
  147. package/lib/src/auth.d.ts +0 -12
  148. package/lib/src/auth.d.ts.map +1 -1
  149. package/lib/src/auth.js +11 -48
  150. package/lib/src/auth.js.map +1 -1
  151. package/lib/src/auth.spec.d.ts.map +1 -1
  152. package/lib/src/auth.spec.js +42 -32
  153. package/lib/src/auth.spec.js.map +1 -1
  154. package/lib/src/authToken.d.ts +4 -0
  155. package/lib/src/authToken.d.ts.map +1 -0
  156. package/lib/src/authToken.js +56 -0
  157. package/lib/src/authToken.js.map +1 -0
  158. package/lib/src/embed/TsEmbed.d.ts +302 -0
  159. package/lib/src/embed/TsEmbed.d.ts.map +1 -0
  160. package/lib/src/embed/TsEmbed.js +847 -0
  161. package/lib/src/embed/TsEmbed.js.map +1 -0
  162. package/lib/src/embed/base.d.ts +0 -9
  163. package/lib/src/embed/base.d.ts.map +1 -1
  164. package/lib/src/embed/base.js +21 -43
  165. package/lib/src/embed/base.js.map +1 -1
  166. package/lib/src/embed/base.spec.js +15 -14
  167. package/lib/src/embed/base.spec.js.map +1 -1
  168. package/lib/src/embed/embedConfig.d.ts +18 -0
  169. package/lib/src/embed/embedConfig.d.ts.map +1 -0
  170. package/lib/src/embed/embedConfig.js +20 -0
  171. package/lib/src/embed/embedConfig.js.map +1 -0
  172. package/lib/src/embed/search.d.ts.map +1 -1
  173. package/lib/src/embed/search.js +4 -2
  174. package/lib/src/embed/search.js.map +1 -1
  175. package/lib/src/embed/searchEmbed-basic-auth.spec.js +3 -2
  176. package/lib/src/embed/searchEmbed-basic-auth.spec.js.map +1 -1
  177. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  178. package/lib/src/embed/ts-embed.js +4 -2
  179. package/lib/src/embed/ts-embed.js.map +1 -1
  180. package/lib/src/embed/ts-embed.spec.js +58 -49
  181. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  182. package/lib/src/index.d.ts +2 -1
  183. package/lib/src/index.d.ts.map +1 -1
  184. package/lib/src/index.js +2 -1
  185. package/lib/src/index.js.map +1 -1
  186. package/lib/src/tokenizedFetch.d.ts +2 -0
  187. package/lib/src/tokenizedFetch.d.ts.map +1 -0
  188. package/lib/src/tokenizedFetch.js +16 -0
  189. package/lib/src/tokenizedFetch.js.map +1 -0
  190. package/lib/src/types.d.ts +6 -0
  191. package/lib/src/types.d.ts.map +1 -1
  192. package/lib/src/types.js.map +1 -1
  193. package/lib/src/utils/answerService.d.ts +10 -0
  194. package/lib/src/utils/answerService.d.ts.map +1 -0
  195. package/lib/src/utils/answerService.js +57 -0
  196. package/lib/src/utils/answerService.js.map +1 -0
  197. package/lib/src/utils/answerService.spec.d.ts +2 -0
  198. package/lib/src/utils/answerService.spec.d.ts.map +1 -0
  199. package/lib/src/utils/answerService.spec.js +29 -0
  200. package/lib/src/utils/answerService.spec.js.map +1 -0
  201. package/lib/src/utils/authService/authService.d.ts +45 -0
  202. package/lib/src/utils/authService/authService.d.ts.map +1 -0
  203. package/lib/src/utils/authService/authService.js +107 -0
  204. package/lib/src/utils/authService/authService.js.map +1 -0
  205. package/lib/src/utils/authService/authService.spec.d.ts +2 -0
  206. package/lib/src/utils/authService/authService.spec.d.ts.map +1 -0
  207. package/lib/src/utils/authService/authService.spec.js +80 -0
  208. package/lib/src/utils/authService/authService.spec.js.map +1 -0
  209. package/lib/src/utils/authService/index.d.ts +3 -0
  210. package/lib/src/utils/authService/index.d.ts.map +1 -0
  211. package/lib/src/utils/authService/index.js +3 -0
  212. package/lib/src/utils/authService/index.js.map +1 -0
  213. package/lib/src/utils/authService/tokenisedAuthSerice.d.ts +11 -0
  214. package/lib/src/utils/authService/tokenisedAuthSerice.d.ts.map +1 -0
  215. package/lib/src/utils/authService/tokenisedAuthSerice.js +39 -0
  216. package/lib/src/utils/authService/tokenisedAuthSerice.js.map +1 -0
  217. package/lib/src/utils/authService/tokenizedAuthService.d.ts +11 -0
  218. package/lib/src/utils/authService/tokenizedAuthService.d.ts.map +1 -0
  219. package/lib/src/utils/authService/tokenizedAuthService.js +39 -0
  220. package/lib/src/utils/authService/tokenizedAuthService.js.map +1 -0
  221. package/lib/src/utils/authService.d.ts +12 -1
  222. package/lib/src/utils/authService.d.ts.map +1 -1
  223. package/lib/src/utils/authService.js +26 -10
  224. package/lib/src/utils/authService.js.map +1 -1
  225. package/lib/src/utils/authService.spec.js +1 -2
  226. package/lib/src/utils/authService.spec.js.map +1 -1
  227. package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  228. package/lib/src/utils/graphql/answerService/answerService.js +2 -1
  229. package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
  230. package/lib/src/utils/graphql/answerService/answerService.spec.js +14 -3
  231. package/lib/src/utils/graphql/answerService/answerService.spec.js.map +1 -1
  232. package/lib/src/utils/graphql/graphql-request.spec.d.ts +2 -0
  233. package/lib/src/utils/graphql/graphql-request.spec.d.ts.map +1 -0
  234. package/lib/src/utils/graphql/graphql-request.spec.js +36 -0
  235. package/lib/src/utils/graphql/graphql-request.spec.js.map +1 -0
  236. package/lib/src/utils/logger.d.ts +28 -0
  237. package/lib/src/utils/logger.d.ts.map +1 -0
  238. package/lib/src/utils/logger.js +75 -0
  239. package/lib/src/utils/logger.js.map +1 -0
  240. package/lib/src/utils/processData.d.ts.map +1 -1
  241. package/lib/src/utils/processData.js +4 -3
  242. package/lib/src/utils/processData.js.map +1 -1
  243. package/lib/src/utils/processData.spec.js +8 -7
  244. package/lib/src/utils/processData.spec.js.map +1 -1
  245. package/lib/src/visual-embed-sdk.d.ts +28 -22
  246. package/package.json +2 -2
  247. package/src/auth.spec.ts +77 -63
  248. package/src/auth.ts +12 -55
  249. package/src/authToken.ts +66 -0
  250. package/src/embed/base.spec.ts +18 -17
  251. package/src/embed/base.ts +26 -51
  252. package/src/embed/embedConfig.ts +23 -0
  253. package/src/embed/search.ts +10 -10
  254. package/src/embed/searchEmbed-basic-auth.spec.ts +3 -2
  255. package/src/embed/ts-embed.spec.ts +87 -75
  256. package/src/embed/ts-embed.ts +11 -20
  257. package/src/index.ts +8 -2
  258. package/src/tokenizedFetch.ts +18 -0
  259. package/src/types.ts +34 -23
  260. package/src/utils/{authService.spec.ts → authService/authService.spec.ts} +2 -3
  261. package/src/utils/{authService.ts → authService/authService.ts} +29 -34
  262. package/src/utils/authService/index.ts +9 -0
  263. package/src/utils/authService/tokenizedAuthService.ts +40 -0
  264. package/src/utils/graphql/answerService/answerService.spec.ts +16 -4
  265. package/src/utils/graphql/answerService/answerService.ts +2 -1
  266. package/src/utils/processData.spec.ts +19 -16
  267. package/src/utils/processData.ts +3 -2
@@ -5034,6 +5034,188 @@
5034
5034
 
5035
5035
  var isEqual_1 = isEqual;
5036
5036
 
5037
+ const EndPoints = {
5038
+ AUTH_VERIFICATION: '/callosum/v1/session/info',
5039
+ SAML_LOGIN_TEMPLATE: (targetUrl) => `/callosum/v1/saml/login?targetURLPath=${targetUrl}`,
5040
+ OIDC_LOGIN_TEMPLATE: (targetUrl) => `/callosum/v1/oidc/login?targetURLPath=${targetUrl}`,
5041
+ TOKEN_LOGIN: '/callosum/v1/session/login/token',
5042
+ BASIC_LOGIN: '/callosum/v1/session/login',
5043
+ LOGOUT: '/callosum/v1/session/logout',
5044
+ EXECUTE_TML: '/api/rest/2.0/metadata/tml/import',
5045
+ EXPORT_TML: '/api/rest/2.0/metadata/tml/export',
5046
+ IS_ACTIVE: '/callosum/v1/session/isactive',
5047
+ };
5048
+ /**
5049
+ *
5050
+ * @param url
5051
+ * @param options
5052
+ */
5053
+ function failureLoggedFetch(url, options = {}) {
5054
+ return fetch(url, options).then(async (r) => {
5055
+ var _a;
5056
+ if (!r.ok && r.type !== 'opaqueredirect' && r.type !== 'opaque') {
5057
+ console.error('Failure', await ((_a = r.text) === null || _a === void 0 ? void 0 : _a.call(r)));
5058
+ }
5059
+ return r;
5060
+ });
5061
+ }
5062
+ /**
5063
+ * Service to validate a auth token against a ThoughtSpot host.
5064
+ *
5065
+ * @param thoughtSpotHost : ThoughtSpot host to verify the token against.
5066
+ * @param authToken : Auth token to verify.
5067
+ */
5068
+ async function verifyTokenService(thoughtSpotHost, authToken) {
5069
+ const authVerificationUrl = `${thoughtSpotHost}${EndPoints.IS_ACTIVE}`;
5070
+ try {
5071
+ const res = await fetch(authVerificationUrl, {
5072
+ headers: {
5073
+ Authorization: `Bearer ${authToken}`,
5074
+ 'x-requested-by': 'ThoughtSpot',
5075
+ },
5076
+ credentials: 'omit',
5077
+ });
5078
+ return res.ok;
5079
+ }
5080
+ catch (e) {
5081
+ console.error(`Token Verification Service failed : ${e.message}`);
5082
+ }
5083
+ return false;
5084
+ }
5085
+ /**
5086
+ *
5087
+ * @param authEndpoint
5088
+ */
5089
+ async function fetchAuthTokenService(authEndpoint) {
5090
+ return fetch(authEndpoint);
5091
+ }
5092
+ /**
5093
+ *
5094
+ * @param thoughtSpotHost
5095
+ * @param username
5096
+ * @param authToken
5097
+ */
5098
+ async function fetchAuthService(thoughtSpotHost, username, authToken) {
5099
+ return failureLoggedFetch(`${thoughtSpotHost}${EndPoints.TOKEN_LOGIN}?username=${username}&auth_token=${authToken}`, {
5100
+ credentials: 'include',
5101
+ // We do not want to follow the redirect, as it starts giving a CORS
5102
+ // error
5103
+ redirect: 'manual',
5104
+ });
5105
+ }
5106
+ /**
5107
+ *
5108
+ * @param thoughtSpotHost
5109
+ * @param username
5110
+ * @param authToken
5111
+ */
5112
+ async function fetchAuthPostService(thoughtSpotHost, username, authToken) {
5113
+ return failureLoggedFetch(`${thoughtSpotHost}${EndPoints.TOKEN_LOGIN}`, {
5114
+ method: 'POST',
5115
+ headers: {
5116
+ 'content-type': 'application/x-www-form-urlencoded',
5117
+ 'x-requested-by': 'ThoughtSpot',
5118
+ },
5119
+ body: `username=${encodeURIComponent(username)}&auth_token=${encodeURIComponent(authToken)}`,
5120
+ credentials: 'include',
5121
+ // We do not want to follow the redirect, as it starts giving a CORS
5122
+ // error
5123
+ redirect: 'manual',
5124
+ });
5125
+ }
5126
+ /**
5127
+ *
5128
+ * @param thoughtSpotHost
5129
+ * @param username
5130
+ * @param password
5131
+ */
5132
+ async function fetchBasicAuthService(thoughtSpotHost, username, password) {
5133
+ return failureLoggedFetch(`${thoughtSpotHost}${EndPoints.BASIC_LOGIN}`, {
5134
+ method: 'POST',
5135
+ headers: {
5136
+ 'content-type': 'application/x-www-form-urlencoded',
5137
+ 'x-requested-by': 'ThoughtSpot',
5138
+ },
5139
+ body: `username=${encodeURIComponent(username)}&password=${encodeURIComponent(password)}`,
5140
+ credentials: 'include',
5141
+ });
5142
+ }
5143
+
5144
+ const DUPLICATE_TOKEN_ERR = 'Duplicate token, please issue a new token every time getAuthToken callback is called.'
5145
+ + 'See https://developers.thoughtspot.com/docs/?pageid=embed-auth#trusted-auth-embed for more details.';
5146
+ const INVALID_TOKEN_ERR = 'Invalid token received form token callback or authToken endpoint.';
5147
+ let cachedAuthToken = null;
5148
+ // This method can be used to get the authToken using the embedConfig
5149
+ const getAuthenticationToken = async (embedConfig) => {
5150
+ if (cachedAuthToken) {
5151
+ let isCachedTokenStillValid;
5152
+ try {
5153
+ isCachedTokenStillValid = await validateAuthToken(embedConfig, cachedAuthToken, true);
5154
+ }
5155
+ catch {
5156
+ isCachedTokenStillValid = false;
5157
+ }
5158
+ if (isCachedTokenStillValid)
5159
+ return cachedAuthToken;
5160
+ }
5161
+ const { authEndpoint, getAuthToken } = embedConfig;
5162
+ let authToken = null;
5163
+ if (getAuthToken) {
5164
+ authToken = await getAuthToken();
5165
+ }
5166
+ else {
5167
+ const response = await fetchAuthTokenService(authEndpoint);
5168
+ authToken = await response.text();
5169
+ }
5170
+ // this will throw error if the token is not valid
5171
+ await validateAuthToken(embedConfig, authToken);
5172
+ cachedAuthToken = authToken;
5173
+ return authToken;
5174
+ };
5175
+ const validateAuthToken = async (embedConfig, authToken, suppressAlert) => {
5176
+ try {
5177
+ const isTokenValid = await verifyTokenService(embedConfig.thoughtSpotHost, authToken);
5178
+ if (isTokenValid)
5179
+ return true;
5180
+ }
5181
+ catch {
5182
+ return false;
5183
+ }
5184
+ if (cachedAuthToken && cachedAuthToken === authToken) {
5185
+ if (!embedConfig.suppressErrorAlerts && !suppressAlert) {
5186
+ // eslint-disable-next-line no-alert
5187
+ alert(DUPLICATE_TOKEN_ERR);
5188
+ }
5189
+ throw new Error(DUPLICATE_TOKEN_ERR);
5190
+ }
5191
+ else {
5192
+ throw new Error(INVALID_TOKEN_ERR);
5193
+ }
5194
+ };
5195
+
5196
+ let config = {};
5197
+ /**
5198
+ * Gets the configuration embed was initialized with.
5199
+ *
5200
+ * @returns {@link EmbedConfig} The configuration embed was initialized with.
5201
+ * @version SDK: 1.19.0 | ThoughtSpot: *
5202
+ * @group Global methods
5203
+ */
5204
+ const getEmbedConfig = () => config;
5205
+
5206
+ const tokenizedFetch = async (input, init) => {
5207
+ const embedConfig = getEmbedConfig();
5208
+ if (embedConfig.authType !== AuthType.TrustedAuthTokenCookieless) {
5209
+ return fetch(input, init);
5210
+ }
5211
+ const req = new Request(input, init);
5212
+ const authToken = await getAuthenticationToken(embedConfig);
5213
+ if (authToken) {
5214
+ req.headers.append('Authorization', `Bearer ${authToken}`);
5215
+ }
5216
+ return fetch(req);
5217
+ };
5218
+
5037
5219
  /**
5038
5220
  *
5039
5221
  * @param root0
@@ -5282,7 +5464,7 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
5282
5464
  */
5283
5465
  async fetchCSVBlob(userLocale = 'en-us', includeInfo = false) {
5284
5466
  const fetchUrl = this.getFetchCSVBlobUrl(userLocale, includeInfo);
5285
- return fetch(fetchUrl, {
5467
+ return tokenizedFetch(fetchUrl, {
5286
5468
  credentials: 'include',
5287
5469
  });
5288
5470
  }
@@ -11916,14 +12098,13 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
11916
12098
  return new _Set(values);
11917
12099
  };
11918
12100
 
11919
- // eslint-disable-next-line import/no-cycle
11920
12101
  /**
11921
12102
  *
11922
12103
  * @param url
11923
12104
  * @param options
11924
12105
  */
11925
- function failureLoggedFetch(url, options = {}) {
11926
- return fetch(url, options).then(async (r) => {
12106
+ function tokenisedFailureLoggedFetch(url, options = {}) {
12107
+ return tokenizedFetch(url, options).then(async (r) => {
11927
12108
  var _a;
11928
12109
  if (!r.ok && r.type !== 'opaqueredirect' && r.type !== 'opaque') {
11929
12110
  console.error('Failure', await ((_a = r.text) === null || _a === void 0 ? void 0 : _a.call(r)));
@@ -11936,81 +12117,7 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
11936
12117
  * @param authVerificationUrl
11937
12118
  */
11938
12119
  function fetchSessionInfoService(authVerificationUrl) {
11939
- return failureLoggedFetch(authVerificationUrl, {
11940
- credentials: 'include',
11941
- });
11942
- }
11943
- /**
11944
- * Service to validate a auth token against a ThoughtSpot host.
11945
- *
11946
- * @param thoughtSpotHost : ThoughtSpot host to verify the token against.
11947
- * @param authToken : Auth token to verify.
11948
- */
11949
- function verifyTokenService(thoughtSpotHost, authToken) {
11950
- const authVerificationUrl = `${thoughtSpotHost}${EndPoints.IS_ACTIVE}`;
11951
- return fetch(authVerificationUrl, {
11952
- headers: {
11953
- Authorization: `Bearer ${authToken}`,
11954
- 'x-requested-by': 'ThoughtSpot',
11955
- },
11956
- credentials: 'omit',
11957
- });
11958
- }
11959
- /**
11960
- *
11961
- * @param authEndpoint
11962
- */
11963
- async function fetchAuthTokenService(authEndpoint) {
11964
- return fetch(authEndpoint);
11965
- }
11966
- /**
11967
- *
11968
- * @param thoughtSpotHost
11969
- * @param username
11970
- * @param authToken
11971
- */
11972
- async function fetchAuthService(thoughtSpotHost, username, authToken) {
11973
- return failureLoggedFetch(`${thoughtSpotHost}${EndPoints.TOKEN_LOGIN}?username=${username}&auth_token=${authToken}`, {
11974
- credentials: 'include',
11975
- // We do not want to follow the redirect, as it starts giving a CORS
11976
- // error
11977
- redirect: 'manual',
11978
- });
11979
- }
11980
- /**
11981
- *
11982
- * @param thoughtSpotHost
11983
- * @param username
11984
- * @param authToken
11985
- */
11986
- async function fetchAuthPostService(thoughtSpotHost, username, authToken) {
11987
- return failureLoggedFetch(`${thoughtSpotHost}${EndPoints.TOKEN_LOGIN}`, {
11988
- method: 'POST',
11989
- headers: {
11990
- 'content-type': 'application/x-www-form-urlencoded',
11991
- 'x-requested-by': 'ThoughtSpot',
11992
- },
11993
- body: `username=${encodeURIComponent(username)}&auth_token=${encodeURIComponent(authToken)}`,
11994
- credentials: 'include',
11995
- // We do not want to follow the redirect, as it starts giving a CORS
11996
- // error
11997
- redirect: 'manual',
11998
- });
11999
- }
12000
- /**
12001
- *
12002
- * @param thoughtSpotHost
12003
- * @param username
12004
- * @param password
12005
- */
12006
- async function fetchBasicAuthService(thoughtSpotHost, username, password) {
12007
- return failureLoggedFetch(`${thoughtSpotHost}${EndPoints.BASIC_LOGIN}`, {
12008
- method: 'POST',
12009
- headers: {
12010
- 'content-type': 'application/x-www-form-urlencoded',
12011
- 'x-requested-by': 'ThoughtSpot',
12012
- },
12013
- body: `username=${encodeURIComponent(username)}&password=${encodeURIComponent(password)}`,
12120
+ return tokenisedFailureLoggedFetch(authVerificationUrl, {
12014
12121
  credentials: 'include',
12015
12122
  });
12016
12123
  }
@@ -12028,17 +12135,6 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
12028
12135
  });
12029
12136
  let releaseVersion = '';
12030
12137
  const SSO_REDIRECTION_MARKER_GUID = '5e16222e-ef02-43e9-9fbd-24226bf3ce5b';
12031
- const EndPoints = {
12032
- AUTH_VERIFICATION: '/callosum/v1/session/info',
12033
- SAML_LOGIN_TEMPLATE: (targetUrl) => `/callosum/v1/saml/login?targetURLPath=${targetUrl}`,
12034
- OIDC_LOGIN_TEMPLATE: (targetUrl) => `/callosum/v1/oidc/login?targetURLPath=${targetUrl}`,
12035
- TOKEN_LOGIN: '/callosum/v1/session/login/token',
12036
- BASIC_LOGIN: '/callosum/v1/session/login',
12037
- LOGOUT: '/callosum/v1/session/logout',
12038
- EXECUTE_TML: '/api/rest/2.0/metadata/tml/import',
12039
- EXPORT_TML: '/api/rest/2.0/metadata/tml/export',
12040
- IS_ACTIVE: '/callosum/v1/session/isactive',
12041
- };
12042
12138
  /**
12043
12139
  * Enum for auth failure types. This is the parameter passed to the listner
12044
12140
  * of {@link AuthStatus.FAILURE}.
@@ -12184,21 +12280,6 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
12184
12280
  function getReleaseVersion() {
12185
12281
  return releaseVersion;
12186
12282
  }
12187
- const DUPLICATE_TOKEN_ERR = 'Duplicate token, please issue a new token every time getAuthToken callback is called.'
12188
- + 'See https://developers.thoughtspot.com/docs/?pageid=embed-auth#trusted-auth-embed for more details.';
12189
- let prevAuthToken = null;
12190
- /**
12191
- *
12192
- * @param authtoken
12193
- */
12194
- function alertForDuplicateToken(authtoken) {
12195
- if (prevAuthToken === authtoken) {
12196
- // eslint-disable-next-line no-alert
12197
- alert(DUPLICATE_TOKEN_ERR);
12198
- throw new Error(DUPLICATE_TOKEN_ERR);
12199
- }
12200
- prevAuthToken = authtoken;
12201
- }
12202
12283
  /**
12203
12284
  * Check if we are stuck at the SSO redirect URL
12204
12285
  */
@@ -12216,19 +12297,6 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
12216
12297
  // that creates an issue.
12217
12298
  window.location.hash = window.location.hash.replace(SSO_REDIRECTION_MARKER_GUID, '');
12218
12299
  }
12219
- const getAuthenticationToken = async (embedConfig) => {
12220
- const { authEndpoint, getAuthToken } = embedConfig;
12221
- let authToken = null;
12222
- if (getAuthToken) {
12223
- authToken = await getAuthToken();
12224
- alertForDuplicateToken(authToken);
12225
- }
12226
- else {
12227
- const response = await fetchAuthTokenService(authEndpoint);
12228
- authToken = await response.text();
12229
- }
12230
- return authToken;
12231
- };
12232
12300
  /**
12233
12301
  * Perform token based authentication
12234
12302
  *
@@ -12269,16 +12337,17 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
12269
12337
  if (!authEndpoint && !getAuthToken) {
12270
12338
  throw new Error('Either auth endpoint or getAuthToken function must be provided');
12271
12339
  }
12340
+ let authSuccess = false;
12272
12341
  try {
12273
12342
  const authToken = await getAuthenticationToken(embedConfig);
12274
- const response = await verifyTokenService(embedConfig.thoughtSpotHost, authToken);
12275
- if (!response.ok)
12276
- return false;
12343
+ if (authToken) {
12344
+ authSuccess = true;
12345
+ }
12277
12346
  }
12278
- catch (e) {
12279
- return false;
12347
+ catch {
12348
+ authSuccess = false;
12280
12349
  }
12281
- return true;
12350
+ return authSuccess;
12282
12351
  };
12283
12352
  /**
12284
12353
  * Perform basic authentication to the ThoughtSpot cluster using the cluster
@@ -12420,27 +12489,18 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
12420
12489
  };
12421
12490
 
12422
12491
  /* eslint-disable camelcase */
12423
- let config = {};
12424
12492
  const CONFIG_DEFAULTS = {
12425
12493
  loginFailedMessage: 'Not logged in',
12426
12494
  authTriggerText: 'Authorize',
12427
12495
  authType: AuthType.None,
12428
12496
  };
12429
12497
  let authPromise;
12430
- /**
12431
- * Gets the configuration embed was initialized with.
12432
- *
12433
- * @returns {@link EmbedConfig} The configuration embed was initialized with.
12434
- * @version SDK: 1.19.0 | ThoughtSpot: *
12435
- * @group Global methods
12436
- */
12437
- const getEmbedConfig = () => config;
12438
12498
  const getAuthPromise = () => authPromise;
12439
12499
  /**
12440
12500
  * Perform authentication on the ThoughtSpot app as applicable.
12441
12501
  */
12442
12502
  const handleAuth = () => {
12443
- authPromise = authenticate(config);
12503
+ authPromise = authenticate(getEmbedConfig());
12444
12504
  authPromise.then((isLoggedIn) => {
12445
12505
  if (!isLoggedIn) {
12446
12506
  notifyAuthFailure(AuthFailureType.SDK);
@@ -12463,7 +12523,7 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
12463
12523
  *
12464
12524
  */
12465
12525
  function disableAutoLogin() {
12466
- config.autoLogin = false;
12526
+ getEmbedConfig().autoLogin = false;
12467
12527
  }
12468
12528
  let renderQueue = Promise.resolve();
12469
12529
  /**
@@ -12473,7 +12533,7 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
12473
12533
  * @param fn The function being registered
12474
12534
  */
12475
12535
  const renderInQueue = (fn) => {
12476
- const { queueMultiRenders = false } = config;
12536
+ const { queueMultiRenders = false } = getEmbedConfig();
12477
12537
  if (queueMultiRenders) {
12478
12538
  renderQueue = renderQueue.then(() => new Promise((res) => fn(res)));
12479
12539
  return renderQueue;
@@ -12518,9 +12578,9 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
12518
12578
  * @param containerEl
12519
12579
  */
12520
12580
  function processNoCookieAccess(e, containerEl) {
12521
- const { loginFailedMessage, suppressNoCookieAccessAlert, ignoreNoCookieAccess, } = getEmbedConfig();
12581
+ const { loginFailedMessage, suppressNoCookieAccessAlert, ignoreNoCookieAccess, suppressErrorAlerts, } = getEmbedConfig();
12522
12582
  if (!ignoreNoCookieAccess) {
12523
- if (!suppressNoCookieAccessAlert) {
12583
+ if (!suppressNoCookieAccessAlert && !suppressErrorAlerts) {
12524
12584
  // eslint-disable-next-line no-alert
12525
12585
  alert('Third party cookie access is blocked on this browser, please allow third party cookies for this to work properly. \nYou can use `suppressNoCookieAccessAlert` to suppress this message.');
12526
12586
  }
@@ -12638,7 +12698,7 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
12638
12698
  });
12639
12699
  }
12640
12700
 
12641
- var name="@thoughtspot/visual-embed-sdk";var version="1.26.1";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",start:"gatsby develop","build:gatsby":"npm run clean:gatsby && gatsby build --prefix-paths","build:gatsby:noprefix":"npm run clean:gatsby && gatsby build","serve:gatsby":"gatsby serve","clean:gatsby":"gatsby clean","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","docs-cmd":"node scripts/gatsby-commands.js",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme","test-sdk":"jest -c jest.config.sdk.js --runInBand","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs",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"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",dompurify:"^2.3.4","eslint-plugin-comment-length":"^0.9.2","eslint-plugin-jsdoc":"^46.9.0",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"^2.45.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.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/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","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","fs-extra":"^10.0.0",gatsby:"3.13.1","gatsby-plugin-algolia":"^0.22.2","gatsby-plugin-catch-links":"^3.1.0","gatsby-plugin-env-variables":"^2.1.0","gatsby-plugin-intl":"^0.3.3","gatsby-plugin-manifest":"^3.2.0","gatsby-plugin-output":"^0.1.3","gatsby-plugin-sass":"6.7.0","gatsby-plugin-sitemap":"^4.10.0","gatsby-source-filesystem":"3.1.0","gatsby-transformer-asciidoc":"2.1.0","gatsby-transformer-rehype":"2.0.0","gh-pages":"^3.1.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:"2.30.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"};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","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,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.js",limit:"43 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};
12701
+ var name="@thoughtspot/visual-embed-sdk";var version="1.26.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",start:"gatsby develop","build:gatsby":"npm run clean:gatsby && gatsby build --prefix-paths","build:gatsby:noprefix":"npm run clean:gatsby && gatsby build","serve:gatsby":"gatsby serve","clean:gatsby":"gatsby clean","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","docs-cmd":"node scripts/gatsby-commands.js",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme","test-sdk":"jest -c jest.config.sdk.js --runInBand","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs",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"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",dompurify:"^2.3.4","eslint-plugin-comment-length":"^0.9.2","eslint-plugin-jsdoc":"^46.9.0",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"^2.45.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.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/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","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","fs-extra":"^10.0.0",gatsby:"3.13.1","gatsby-plugin-algolia":"^0.22.2","gatsby-plugin-catch-links":"^3.1.0","gatsby-plugin-env-variables":"^2.1.0","gatsby-plugin-intl":"^0.3.3","gatsby-plugin-manifest":"^3.2.0","gatsby-plugin-output":"^0.1.3","gatsby-plugin-sass":"6.7.0","gatsby-plugin-sitemap":"^4.10.0","gatsby-source-filesystem":"3.1.0","gatsby-transformer-asciidoc":"2.1.0","gatsby-transformer-rehype":"2.0.0","gh-pages":"^3.1.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:"2.30.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"};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","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,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.js",limit:"44 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};
12642
12702
 
12643
12703
  /**
12644
12704
  * Copyright (c) 2022
@@ -13918,7 +13978,8 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
13918
13978
  const src = this.getIFrameSrc(answerId);
13919
13979
  this.renderIFrame(src);
13920
13980
  getAuthPromise().then(() => {
13921
- if (checkReleaseVersionInBeta(getReleaseVersion(), getEmbedConfig().suppressSearchEmbedBetaWarning)) {
13981
+ if (checkReleaseVersionInBeta(getReleaseVersion(), getEmbedConfig().suppressSearchEmbedBetaWarning
13982
+ || getEmbedConfig().suppressErrorAlerts)) {
13922
13983
  alert(ERROR_MESSAGE.SEARCHEMBED_BETA_WRANING_MESSAGE);
13923
13984
  }
13924
13985
  });