@thoughtspot/visual-embed-sdk 1.20.2 → 1.20.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (368) hide show
  1. package/README.md +1 -1
  2. package/cjs/package.json +171 -0
  3. package/cjs/src/auth.d.ts +183 -0
  4. package/cjs/src/auth.d.ts.map +1 -0
  5. package/cjs/src/auth.js +457 -0
  6. package/cjs/src/auth.js.map +1 -0
  7. package/cjs/src/auth.spec.d.ts +13 -0
  8. package/cjs/src/auth.spec.d.ts.map +1 -0
  9. package/cjs/src/auth.spec.js +397 -0
  10. package/cjs/src/auth.spec.js.map +1 -0
  11. package/cjs/src/config.d.ts +22 -0
  12. package/cjs/src/config.d.ts.map +1 -0
  13. package/cjs/src/config.js +70 -0
  14. package/cjs/src/config.js.map +1 -0
  15. package/cjs/src/config.spec.d.ts +5 -0
  16. package/cjs/src/config.spec.d.ts.map +1 -0
  17. package/cjs/src/config.spec.js +65 -0
  18. package/cjs/src/config.spec.js.map +1 -0
  19. package/cjs/src/embed/app.d.ts +168 -0
  20. package/cjs/src/embed/app.d.ts.map +1 -0
  21. package/cjs/src/embed/app.js +215 -0
  22. package/cjs/src/embed/app.js.map +1 -0
  23. package/cjs/src/embed/app.spec.d.ts +2 -0
  24. package/cjs/src/embed/app.spec.d.ts.map +1 -0
  25. package/cjs/src/embed/app.spec.js +239 -0
  26. package/cjs/src/embed/app.spec.js.map +1 -0
  27. package/cjs/src/embed/base.d.ts +79 -0
  28. package/cjs/src/embed/base.d.ts.map +1 -0
  29. package/cjs/src/embed/base.js +229 -0
  30. package/cjs/src/embed/base.js.map +1 -0
  31. package/cjs/src/embed/base.spec.d.ts +2 -0
  32. package/cjs/src/embed/base.spec.d.ts.map +1 -0
  33. package/cjs/src/embed/base.spec.js +198 -0
  34. package/cjs/src/embed/base.spec.js.map +1 -0
  35. package/cjs/src/embed/embed.spec.d.ts +2 -0
  36. package/cjs/src/embed/embed.spec.d.ts.map +1 -0
  37. package/cjs/src/embed/embed.spec.js +74 -0
  38. package/cjs/src/embed/embed.spec.js.map +1 -0
  39. package/cjs/src/embed/events.spec.d.ts +2 -0
  40. package/cjs/src/embed/events.spec.d.ts.map +1 -0
  41. package/cjs/src/embed/events.spec.js +238 -0
  42. package/cjs/src/embed/events.spec.js.map +1 -0
  43. package/cjs/src/embed/liveboard.d.ts +150 -0
  44. package/cjs/src/embed/liveboard.d.ts.map +1 -0
  45. package/cjs/src/embed/liveboard.js +168 -0
  46. package/cjs/src/embed/liveboard.js.map +1 -0
  47. package/cjs/src/embed/liveboard.spec.d.ts +2 -0
  48. package/cjs/src/embed/liveboard.spec.d.ts.map +1 -0
  49. package/cjs/src/embed/liveboard.spec.js +229 -0
  50. package/cjs/src/embed/liveboard.spec.js.map +1 -0
  51. package/cjs/src/embed/pinboard.spec.d.ts +2 -0
  52. package/cjs/src/embed/pinboard.spec.d.ts.map +1 -0
  53. package/cjs/src/embed/pinboard.spec.js +148 -0
  54. package/cjs/src/embed/pinboard.spec.js.map +1 -0
  55. package/cjs/src/embed/search-bar.d.ts +50 -0
  56. package/cjs/src/embed/search-bar.d.ts.map +1 -0
  57. package/cjs/src/embed/search-bar.js +63 -0
  58. package/cjs/src/embed/search-bar.js.map +1 -0
  59. package/cjs/src/embed/search.d.ts +129 -0
  60. package/cjs/src/embed/search.d.ts.map +1 -0
  61. package/cjs/src/embed/search.js +121 -0
  62. package/cjs/src/embed/search.js.map +1 -0
  63. package/cjs/src/embed/search.spec.d.ts +2 -0
  64. package/cjs/src/embed/search.spec.d.ts.map +1 -0
  65. package/cjs/src/embed/search.spec.js +238 -0
  66. package/cjs/src/embed/search.spec.js.map +1 -0
  67. package/cjs/src/embed/searchEmbed-basic-auth.spec.d.ts +2 -0
  68. package/cjs/src/embed/searchEmbed-basic-auth.spec.d.ts.map +1 -0
  69. package/cjs/src/embed/searchEmbed-basic-auth.spec.js +103 -0
  70. package/cjs/src/embed/searchEmbed-basic-auth.spec.js.map +1 -0
  71. package/cjs/src/embed/ts-embed.d.ts +323 -0
  72. package/cjs/src/embed/ts-embed.d.ts.map +1 -0
  73. package/cjs/src/embed/ts-embed.js +719 -0
  74. package/cjs/src/embed/ts-embed.js.map +1 -0
  75. package/cjs/src/embed/ts-embed.spec.d.ts +2 -0
  76. package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -0
  77. package/cjs/src/embed/ts-embed.spec.js +771 -0
  78. package/cjs/src/embed/ts-embed.spec.js.map +1 -0
  79. package/cjs/src/errors.d.ts +7 -0
  80. package/cjs/src/errors.d.ts.map +1 -0
  81. package/cjs/src/errors.js +10 -0
  82. package/cjs/src/errors.js.map +1 -0
  83. package/cjs/src/index.d.ts +18 -0
  84. package/cjs/src/index.d.ts.map +1 -0
  85. package/cjs/src/index.js +42 -0
  86. package/cjs/src/index.js.map +1 -0
  87. package/cjs/src/mixpanel-service.d.ts +29 -0
  88. package/cjs/src/mixpanel-service.d.ts.map +1 -0
  89. package/cjs/src/mixpanel-service.js +76 -0
  90. package/cjs/src/mixpanel-service.js.map +1 -0
  91. package/cjs/src/mixpanel-service.spec.d.ts +2 -0
  92. package/cjs/src/mixpanel-service.spec.d.ts.map +1 -0
  93. package/cjs/src/mixpanel-service.spec.js +63 -0
  94. package/cjs/src/mixpanel-service.spec.js.map +1 -0
  95. package/cjs/src/react/all-types-export.d.ts +3 -0
  96. package/cjs/src/react/all-types-export.d.ts.map +1 -0
  97. package/cjs/src/react/all-types-export.js +29 -0
  98. package/cjs/src/react/all-types-export.js.map +1 -0
  99. package/cjs/src/react/all-types-export.spec.d.ts +2 -0
  100. package/cjs/src/react/all-types-export.spec.d.ts.map +1 -0
  101. package/cjs/src/react/all-types-export.spec.js +13 -0
  102. package/cjs/src/react/all-types-export.spec.js.map +1 -0
  103. package/cjs/src/react/index.d.ts +95 -0
  104. package/cjs/src/react/index.d.ts.map +1 -0
  105. package/cjs/src/react/index.js +121 -0
  106. package/cjs/src/react/index.js.map +1 -0
  107. package/cjs/src/react/index.spec.d.ts +3 -0
  108. package/cjs/src/react/index.spec.d.ts.map +1 -0
  109. package/cjs/src/react/index.spec.js +138 -0
  110. package/cjs/src/react/index.spec.js.map +1 -0
  111. package/cjs/src/react/util.d.ts +19 -0
  112. package/cjs/src/react/util.d.ts.map +1 -0
  113. package/cjs/src/react/util.js +25 -0
  114. package/cjs/src/react/util.js.map +1 -0
  115. package/cjs/src/test/test-utils.d.ts +48 -0
  116. package/cjs/src/test/test-utils.d.ts.map +1 -0
  117. package/cjs/src/test/test-utils.js +108 -0
  118. package/cjs/src/test/test-utils.js.map +1 -0
  119. package/cjs/src/types.d.ts +2020 -0
  120. package/cjs/src/types.d.ts.map +1 -0
  121. package/cjs/src/types.js +1543 -0
  122. package/cjs/src/types.js.map +1 -0
  123. package/cjs/src/utils/answerService.d.ts +10 -0
  124. package/cjs/src/utils/answerService.d.ts.map +1 -0
  125. package/cjs/src/utils/answerService.js +61 -0
  126. package/cjs/src/utils/answerService.js.map +1 -0
  127. package/cjs/src/utils/answerService.spec.d.ts +2 -0
  128. package/cjs/src/utils/answerService.spec.d.ts.map +1 -0
  129. package/cjs/src/utils/answerService.spec.js +31 -0
  130. package/cjs/src/utils/answerService.spec.js.map +1 -0
  131. package/cjs/src/utils/authService.d.ts +37 -0
  132. package/cjs/src/utils/authService.d.ts.map +1 -0
  133. package/cjs/src/utils/authService.js +106 -0
  134. package/cjs/src/utils/authService.js.map +1 -0
  135. package/cjs/src/utils/authService.spec.d.ts +2 -0
  136. package/cjs/src/utils/authService.spec.d.ts.map +1 -0
  137. package/cjs/src/utils/authService.spec.js +72 -0
  138. package/cjs/src/utils/authService.spec.js.map +1 -0
  139. package/cjs/src/utils/processData.d.ts +16 -0
  140. package/cjs/src/utils/processData.d.ts.map +1 -0
  141. package/cjs/src/utils/processData.js +110 -0
  142. package/cjs/src/utils/processData.js.map +1 -0
  143. package/cjs/src/utils/processData.spec.d.ts +2 -0
  144. package/cjs/src/utils/processData.spec.d.ts.map +1 -0
  145. package/cjs/src/utils/processData.spec.js +142 -0
  146. package/cjs/src/utils/processData.spec.js.map +1 -0
  147. package/cjs/src/utils/processTrigger.d.ts +10 -0
  148. package/cjs/src/utils/processTrigger.d.ts.map +1 -0
  149. package/cjs/src/utils/processTrigger.js +63 -0
  150. package/cjs/src/utils/processTrigger.js.map +1 -0
  151. package/cjs/src/utils/processTrigger.spec.d.ts +2 -0
  152. package/cjs/src/utils/processTrigger.spec.d.ts.map +1 -0
  153. package/cjs/src/utils/processTrigger.spec.js +58 -0
  154. package/cjs/src/utils/processTrigger.spec.js.map +1 -0
  155. package/cjs/src/utils.d.ts +68 -0
  156. package/cjs/src/utils.d.ts.map +1 -0
  157. package/cjs/src/utils.js +196 -0
  158. package/cjs/src/utils.js.map +1 -0
  159. package/cjs/src/utils.spec.d.ts +5 -0
  160. package/cjs/src/utils.spec.d.ts.map +1 -0
  161. package/cjs/src/utils.spec.js +98 -0
  162. package/cjs/src/utils.spec.js.map +1 -0
  163. package/dist/src/auth.d.ts +54 -5
  164. package/dist/src/auth.d.ts.map +1 -1
  165. package/dist/src/auth.spec.d.ts +3 -0
  166. package/dist/src/auth.spec.d.ts.map +1 -1
  167. package/dist/src/config.d.ts +1 -0
  168. package/dist/src/config.d.ts.map +1 -1
  169. package/dist/src/embed/app.d.ts +35 -6
  170. package/dist/src/embed/app.d.ts.map +1 -1
  171. package/dist/src/embed/base.d.ts +20 -9
  172. package/dist/src/embed/base.d.ts.map +1 -1
  173. package/dist/src/embed/liveboard.d.ts +17 -5
  174. package/dist/src/embed/liveboard.d.ts.map +1 -1
  175. package/dist/src/embed/search-bar.d.ts +3 -0
  176. package/dist/src/embed/search-bar.d.ts.map +1 -1
  177. package/dist/src/embed/search.d.ts +9 -1
  178. package/dist/src/embed/search.d.ts.map +1 -1
  179. package/dist/src/embed/ts-embed.d.ts +65 -7
  180. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  181. package/dist/src/errors.d.ts.map +1 -1
  182. package/dist/src/index.d.ts +2 -2
  183. package/dist/src/index.d.ts.map +1 -1
  184. package/dist/src/mixpanel-service.d.ts +8 -0
  185. package/dist/src/mixpanel-service.d.ts.map +1 -1
  186. package/dist/src/react/all-types-export.d.ts +3 -0
  187. package/dist/src/react/all-types-export.d.ts.map +1 -0
  188. package/dist/src/react/all-types-export.spec.d.ts +2 -0
  189. package/dist/src/react/all-types-export.spec.d.ts.map +1 -0
  190. package/dist/src/react/index.d.ts +72 -0
  191. package/dist/src/react/index.d.ts.map +1 -1
  192. package/dist/src/react/util.d.ts +4 -0
  193. package/dist/src/react/util.d.ts.map +1 -1
  194. package/dist/src/test/test-utils.d.ts +11 -2
  195. package/dist/src/test/test-utils.d.ts.map +1 -1
  196. package/dist/src/types.d.ts +499 -96
  197. package/dist/src/types.d.ts.map +1 -1
  198. package/dist/src/utils/answerService.d.ts +7 -0
  199. package/dist/src/utils/answerService.d.ts.map +1 -1
  200. package/dist/src/utils/authService.d.ts +30 -0
  201. package/dist/src/utils/authService.d.ts.map +1 -1
  202. package/dist/src/utils/processData.d.ts +12 -0
  203. package/dist/src/utils/processData.d.ts.map +1 -1
  204. package/dist/src/utils/processTrigger.d.ts +7 -0
  205. package/dist/src/utils/processTrigger.d.ts.map +1 -1
  206. package/dist/src/utils.d.ts +12 -0
  207. package/dist/src/utils.d.ts.map +1 -1
  208. package/dist/tsembed-react.es.js +28024 -0
  209. package/dist/tsembed-react.js +27966 -0
  210. package/dist/tsembed.es.js +18114 -305
  211. package/dist/tsembed.js +18088 -327
  212. package/dist/visual-embed-sdk-react-full.d.ts +3092 -0
  213. package/dist/visual-embed-sdk-react.d.ts +2781 -0
  214. package/dist/visual-embed-sdk.d.ts +2944 -0
  215. package/lib/package.json +15 -14
  216. package/lib/src/auth.d.ts +54 -5
  217. package/lib/src/auth.d.ts.map +1 -1
  218. package/lib/src/auth.js +91 -31
  219. package/lib/src/auth.js.map +1 -1
  220. package/lib/src/auth.spec.d.ts +3 -0
  221. package/lib/src/auth.spec.d.ts.map +1 -1
  222. package/lib/src/auth.spec.js +37 -6
  223. package/lib/src/auth.spec.js.map +1 -1
  224. package/lib/src/config.d.ts +1 -0
  225. package/lib/src/config.d.ts.map +1 -1
  226. package/lib/src/config.js +5 -3
  227. package/lib/src/config.js.map +1 -1
  228. package/lib/src/config.spec.js.map +1 -1
  229. package/lib/src/embed/app.d.ts +35 -6
  230. package/lib/src/embed/app.d.ts.map +1 -1
  231. package/lib/src/embed/app.js +55 -16
  232. package/lib/src/embed/app.js.map +1 -1
  233. package/lib/src/embed/app.spec.js +41 -12
  234. package/lib/src/embed/app.spec.js.map +1 -1
  235. package/lib/src/embed/base.d.ts +20 -9
  236. package/lib/src/embed/base.d.ts.map +1 -1
  237. package/lib/src/embed/base.js +31 -15
  238. package/lib/src/embed/base.js.map +1 -1
  239. package/lib/src/embed/base.spec.js.map +1 -1
  240. package/lib/src/embed/embed.spec.js +1 -1
  241. package/lib/src/embed/embed.spec.js.map +1 -1
  242. package/lib/src/embed/liveboard.d.ts +17 -5
  243. package/lib/src/embed/liveboard.d.ts.map +1 -1
  244. package/lib/src/embed/liveboard.js +49 -37
  245. package/lib/src/embed/liveboard.js.map +1 -1
  246. package/lib/src/embed/liveboard.spec.js +37 -30
  247. package/lib/src/embed/liveboard.spec.js.map +1 -1
  248. package/lib/src/embed/pinboard.spec.js +14 -26
  249. package/lib/src/embed/pinboard.spec.js.map +1 -1
  250. package/lib/src/embed/search-bar.d.ts +3 -0
  251. package/lib/src/embed/search-bar.d.ts.map +1 -1
  252. package/lib/src/embed/search-bar.js +5 -6
  253. package/lib/src/embed/search-bar.js.map +1 -1
  254. package/lib/src/embed/search.d.ts +9 -1
  255. package/lib/src/embed/search.d.ts.map +1 -1
  256. package/lib/src/embed/search.js +18 -14
  257. package/lib/src/embed/search.js.map +1 -1
  258. package/lib/src/embed/search.spec.js +16 -19
  259. package/lib/src/embed/search.spec.js.map +1 -1
  260. package/lib/src/embed/searchEmbed-basic-auth.spec.js +4 -0
  261. package/lib/src/embed/searchEmbed-basic-auth.spec.js.map +1 -1
  262. package/lib/src/embed/ts-embed.d.ts +65 -7
  263. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  264. package/lib/src/embed/ts-embed.js +154 -77
  265. package/lib/src/embed/ts-embed.js.map +1 -1
  266. package/lib/src/embed/ts-embed.spec.js +46 -24
  267. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  268. package/lib/src/errors.d.ts.map +1 -1
  269. package/lib/src/errors.js.map +1 -1
  270. package/lib/src/index.d.ts +2 -2
  271. package/lib/src/index.d.ts.map +1 -1
  272. package/lib/src/index.js +4 -4
  273. package/lib/src/index.js.map +1 -1
  274. package/lib/src/mixpanel-service.d.ts +8 -0
  275. package/lib/src/mixpanel-service.d.ts.map +1 -1
  276. package/lib/src/mixpanel-service.js +13 -1
  277. package/lib/src/mixpanel-service.js.map +1 -1
  278. package/lib/src/mixpanel-service.spec.js.map +1 -1
  279. package/lib/src/react/all-types-export.d.ts +3 -0
  280. package/lib/src/react/all-types-export.d.ts.map +1 -0
  281. package/lib/src/react/all-types-export.js +5 -0
  282. package/lib/src/react/all-types-export.js.map +1 -0
  283. package/lib/src/react/all-types-export.spec.d.ts +2 -0
  284. package/lib/src/react/all-types-export.spec.d.ts.map +1 -0
  285. package/lib/src/react/all-types-export.spec.js +10 -0
  286. package/lib/src/react/all-types-export.spec.js.map +1 -0
  287. package/lib/src/react/index.d.ts +72 -0
  288. package/lib/src/react/index.d.ts.map +1 -1
  289. package/lib/src/react/index.js +79 -7
  290. package/lib/src/react/index.js.map +1 -1
  291. package/lib/src/react/index.spec.js +27 -6
  292. package/lib/src/react/index.spec.js.map +1 -1
  293. package/lib/src/react/util.d.ts +4 -0
  294. package/lib/src/react/util.d.ts.map +1 -1
  295. package/lib/src/react/util.js +4 -0
  296. package/lib/src/react/util.js.map +1 -1
  297. package/lib/src/test/test-utils.d.ts +11 -2
  298. package/lib/src/test/test-utils.d.ts.map +1 -1
  299. package/lib/src/test/test-utils.js +36 -25
  300. package/lib/src/test/test-utils.js.map +1 -1
  301. package/lib/src/types.d.ts +499 -96
  302. package/lib/src/types.d.ts.map +1 -1
  303. package/lib/src/types.js +374 -68
  304. package/lib/src/types.js.map +1 -1
  305. package/lib/src/utils/answerService.d.ts +7 -0
  306. package/lib/src/utils/answerService.d.ts.map +1 -1
  307. package/lib/src/utils/answerService.js +7 -0
  308. package/lib/src/utils/answerService.js.map +1 -1
  309. package/lib/src/utils/answerService.spec.js.map +1 -1
  310. package/lib/src/utils/authService.d.ts +30 -0
  311. package/lib/src/utils/authService.d.ts.map +1 -1
  312. package/lib/src/utils/authService.js +39 -2
  313. package/lib/src/utils/authService.js.map +1 -1
  314. package/lib/src/utils/authService.spec.js.map +1 -1
  315. package/lib/src/utils/processData.d.ts +12 -0
  316. package/lib/src/utils/processData.d.ts.map +1 -1
  317. package/lib/src/utils/processData.js +33 -5
  318. package/lib/src/utils/processData.js.map +1 -1
  319. package/lib/src/utils/processData.spec.js.map +1 -1
  320. package/lib/src/utils/processTrigger.d.ts +7 -0
  321. package/lib/src/utils/processTrigger.d.ts.map +1 -1
  322. package/lib/src/utils/processTrigger.js +17 -3
  323. package/lib/src/utils/processTrigger.js.map +1 -1
  324. package/lib/src/utils/processTrigger.spec.js.map +1 -1
  325. package/lib/src/utils.d.ts +12 -0
  326. package/lib/src/utils.d.ts.map +1 -1
  327. package/lib/src/utils.js +24 -19
  328. package/lib/src/utils.js.map +1 -1
  329. package/lib/src/utils.spec.js.map +1 -1
  330. package/package.json +15 -14
  331. package/src/auth.spec.ts +83 -133
  332. package/src/auth.ts +148 -115
  333. package/src/config.spec.ts +2 -4
  334. package/src/config.ts +5 -3
  335. package/src/embed/app.spec.ts +57 -14
  336. package/src/embed/app.ts +91 -36
  337. package/src/embed/base.spec.ts +3 -9
  338. package/src/embed/base.ts +51 -53
  339. package/src/embed/embed.spec.ts +5 -6
  340. package/src/embed/liveboard.spec.ts +56 -37
  341. package/src/embed/liveboard.ts +66 -64
  342. package/src/embed/pinboard.spec.ts +26 -29
  343. package/src/embed/search-bar.tsx +10 -8
  344. package/src/embed/search.spec.ts +31 -21
  345. package/src/embed/search.ts +26 -20
  346. package/src/embed/searchEmbed-basic-auth.spec.ts +22 -28
  347. package/src/embed/ts-embed.spec.ts +99 -144
  348. package/src/embed/ts-embed.ts +188 -162
  349. package/src/errors.ts +3 -6
  350. package/src/index.ts +6 -10
  351. package/src/mixpanel-service.spec.ts +1 -3
  352. package/src/mixpanel-service.ts +13 -1
  353. package/src/react/index.spec.tsx +66 -13
  354. package/src/react/index.tsx +111 -62
  355. package/src/react/util.ts +8 -4
  356. package/src/test/test-utils.ts +43 -39
  357. package/src/types.ts +498 -98
  358. package/src/utils/answerService.spec.ts +3 -5
  359. package/src/utils/answerService.ts +21 -17
  360. package/src/utils/authService.spec.ts +26 -41
  361. package/src/utils/authService.ts +47 -21
  362. package/src/utils/processData.spec.ts +26 -59
  363. package/src/utils/processData.ts +36 -14
  364. package/src/utils/processTrigger.spec.ts +1 -6
  365. package/src/utils/processTrigger.ts +18 -9
  366. package/src/utils.spec.ts +8 -12
  367. package/src/utils.ts +25 -26
  368. package/lib/src/visual-embed-sdk.d.ts +0 -2419
package/src/auth.ts CHANGED
@@ -1,6 +1,9 @@
1
1
  import EventEmitter from 'eventemitter3';
2
+ import _ from 'lodash';
2
3
  import { initMixpanel } from './mixpanel-service';
3
- import { AuthType, DOMSelector, EmbedConfig, EmbedEvent, Param } from './types';
4
+ import {
5
+ AuthType, DOMSelector, EmbedConfig, EmbedEvent, Param,
6
+ } from './types';
4
7
  import { getDOMNode, getRedirectUrl } from './utils';
5
8
  // eslint-disable-next-line import/no-cycle
6
9
  import {
@@ -18,30 +21,35 @@ export let loggedInStatus = false;
18
21
  export let samlAuthWindow: Window = null;
19
22
  // eslint-disable-next-line import/no-mutable-exports
20
23
  export let samlCompletionPromise: Promise<void> = null;
21
- let sessionInfo: any = null;
22
- let sessionInfoResolver: (value: any) => void = null;
23
- const sessionInfoPromise = new Promise((resolve) => {
24
+ let sessionInfo: sessionInfoInterface = null;
25
+ let sessionInfoResolver: (value: sessionInfoInterface) => void = null;
26
+ const sessionInfoPromise = new Promise((resolve:(value: sessionInfoInterface) => void) => {
24
27
  sessionInfoResolver = resolve;
25
28
  });
26
29
  let releaseVersion = '';
27
30
 
28
- export const SSO_REDIRECTION_MARKER_GUID =
29
- '5e16222e-ef02-43e9-9fbd-24226bf3ce5b';
31
+ export const SSO_REDIRECTION_MARKER_GUID = '5e16222e-ef02-43e9-9fbd-24226bf3ce5b';
30
32
 
31
33
  export const EndPoints = {
32
34
  AUTH_VERIFICATION: '/callosum/v1/session/info',
33
- SAML_LOGIN_TEMPLATE: (targetUrl: string) =>
34
- `/callosum/v1/saml/login?targetURLPath=${targetUrl}`,
35
- OIDC_LOGIN_TEMPLATE: (targetUrl: string) =>
36
- `/callosum/v1/oidc/login?targetURLPath=${targetUrl}`,
35
+ SAML_LOGIN_TEMPLATE: (targetUrl: string) => `/callosum/v1/saml/login?targetURLPath=${targetUrl}`,
36
+ OIDC_LOGIN_TEMPLATE: (targetUrl: string) => `/callosum/v1/oidc/login?targetURLPath=${targetUrl}`,
37
37
  TOKEN_LOGIN: '/callosum/v1/session/login/token',
38
38
  BASIC_LOGIN: '/callosum/v1/session/login',
39
39
  LOGOUT: '/callosum/v1/session/logout',
40
40
  };
41
41
 
42
+ interface sessionInfoInterface {
43
+ userGUID: any;
44
+ isPublicUser: any;
45
+ mixpanelToken: any;
46
+ [key:string]:any;
47
+ }
48
+
42
49
  /**
43
50
  * Enum for auth failure types. This is the parameter passed to the listner
44
51
  * of {@link AuthStatus.FAILURE}.
52
+ *
45
53
  * @group Authentication / Init
46
54
  */
47
55
  export enum AuthFailureType {
@@ -53,6 +61,7 @@ export enum AuthFailureType {
53
61
 
54
62
  /**
55
63
  * Enum for auth status emitted by the emitter returned from {@link init}.
64
+ *
56
65
  * @group Authentication / Init
57
66
  */
58
67
  export enum AuthStatus {
@@ -76,6 +85,7 @@ export enum AuthStatus {
76
85
  * Emitted when inPopup: true in the SAMLRedirect flow.
77
86
  * And, we are waiting for popup to be triggered either programatically
78
87
  * or by the trigger button.
88
+ *
79
89
  * @version SDK: 1.19.0
80
90
  */
81
91
  WAITING_FOR_POPUP = 'WAITING_FOR_POPUP',
@@ -83,28 +93,37 @@ export enum AuthStatus {
83
93
 
84
94
  /**
85
95
  * Event emitter returned from {@link init}.
96
+ *
86
97
  * @group Authentication / Init
87
98
  */
88
99
  export interface AuthEventEmitter {
89
100
  /**
90
- * Registed a listener on Auth failure.
101
+ * Register a listener on Auth failure.
102
+ *
103
+ * @param event
104
+ * @param listener
105
+ */
106
+ on(event: AuthStatus.FAILURE, listener: (failureType: AuthFailureType) => void): this;
107
+ /**
108
+ * Register a listener on Auth SDK success.
109
+ *
91
110
  * @param event
92
111
  * @param listener
93
112
  */
94
113
  on(
95
- event: AuthStatus.FAILURE,
96
- listener: (failureType: AuthFailureType) => void,
97
- ): this;
98
- on(
99
- event:
100
- | AuthStatus.SDK_SUCCESS
101
- | AuthStatus.LOGOUT
102
- | AuthStatus.WAITING_FOR_POPUP,
114
+ event: AuthStatus.SDK_SUCCESS | AuthStatus.LOGOUT | AuthStatus.WAITING_FOR_POPUP,
103
115
  listener: () => void,
104
116
  ): this;
105
117
  on(event: AuthStatus.SUCCESS, listener: (sessionInfo: any) => void): this;
118
+ once(event: AuthStatus.FAILURE, listener: (failureType: AuthFailureType) => void): this;
119
+ once(
120
+ event: AuthStatus.SDK_SUCCESS | AuthStatus.LOGOUT | AuthStatus.WAITING_FOR_POPUP,
121
+ listener: () => void,
122
+ ): this;
123
+ once(event: AuthStatus.SUCCESS, listener: (sessionInfo: any) => void): this;
106
124
  /**
107
125
  * Trigger an event on the emitter returned from init.
126
+ *
108
127
  * @param {@link AuthEvent}
109
128
  */
110
129
  emit(event: AuthEvent): void;
@@ -112,6 +131,7 @@ export interface AuthEventEmitter {
112
131
 
113
132
  /**
114
133
  * Events which can be triggered on the emitter returned from {@link init}.
134
+ *
115
135
  * @group Authentication / Init
116
136
  */
117
137
  export enum AuthEvent {
@@ -124,16 +144,24 @@ export enum AuthEvent {
124
144
 
125
145
  let authEE: EventEmitter<AuthStatus | AuthEvent>;
126
146
 
147
+ /**
148
+ *
149
+ */
127
150
  export function getAuthEE(): EventEmitter<AuthStatus | AuthEvent> {
128
151
  return authEE;
129
152
  }
130
153
 
131
- export function setAuthEE(
132
- eventEmitter: EventEmitter<AuthStatus | AuthEvent>,
133
- ): void {
154
+ /**
155
+ *
156
+ * @param eventEmitter
157
+ */
158
+ export function setAuthEE(eventEmitter: EventEmitter<AuthStatus | AuthEvent>): void {
134
159
  authEE = eventEmitter;
135
160
  }
136
161
 
162
+ /**
163
+ *
164
+ */
137
165
  export function notifyAuthSDKSuccess(): void {
138
166
  if (!authEE) {
139
167
  console.error('SDK not initialized');
@@ -142,6 +170,9 @@ export function notifyAuthSDKSuccess(): void {
142
170
  authEE.emit(AuthStatus.SDK_SUCCESS);
143
171
  }
144
172
 
173
+ /**
174
+ *
175
+ */
145
176
  export function notifyAuthSuccess(): void {
146
177
  if (!authEE) {
147
178
  console.error('SDK not initialized');
@@ -150,6 +181,10 @@ export function notifyAuthSuccess(): void {
150
181
  authEE.emit(AuthStatus.SUCCESS, sessionInfo);
151
182
  }
152
183
 
184
+ /**
185
+ *
186
+ * @param failureType
187
+ */
153
188
  export function notifyAuthFailure(failureType: AuthFailureType): void {
154
189
  if (!authEE) {
155
190
  console.error('SDK not initialized');
@@ -158,6 +193,9 @@ export function notifyAuthFailure(failureType: AuthFailureType): void {
158
193
  authEE.emit(AuthStatus.FAILURE, failureType);
159
194
  }
160
195
 
196
+ /**
197
+ *
198
+ */
161
199
  export function notifyLogout(): void {
162
200
  if (!authEE) {
163
201
  console.error('SDK not initialized');
@@ -166,8 +204,31 @@ export function notifyLogout(): void {
166
204
  authEE.emit(AuthStatus.LOGOUT);
167
205
  }
168
206
 
207
+ export const initSession = (sessionDetails: sessionInfoInterface) => {
208
+ if (_.isNull(sessionInfo)) {
209
+ sessionInfo = sessionDetails;
210
+ initMixpanel(sessionInfo);
211
+ sessionInfoResolver(sessionInfo);
212
+ }
213
+ };
214
+
215
+ export const getSessionDetails = (sessionInfoResp: any):sessionInfoInterface => {
216
+ const devMixpanelToken = sessionInfoResp.configInfo.mixpanelConfig.devSdkKey;
217
+ const prodMixpanelToken = sessionInfoResp.configInfo.mixpanelConfig.prodSdkKey;
218
+ const mixpanelToken = sessionInfoResp.configInfo.mixpanelConfig.production
219
+ ? prodMixpanelToken
220
+ : devMixpanelToken;
221
+ return {
222
+ userGUID: sessionInfoResp.userGUID,
223
+ mixpanelToken,
224
+ isPublicUser: sessionInfoResp.configInfo.isPublicUser,
225
+ ...sessionInfoResp,
226
+ };
227
+ };
228
+
169
229
  /**
170
230
  * Check if we are logged into the ThoughtSpot cluster
231
+ *
171
232
  * @param thoughtSpotHost The ThoughtSpot cluster hostname or IP
172
233
  */
173
234
  async function isLoggedIn(thoughtSpotHost: string): Promise<boolean> {
@@ -176,6 +237,9 @@ async function isLoggedIn(thoughtSpotHost: string): Promise<boolean> {
176
237
  try {
177
238
  response = await fetchSessionInfoService(authVerificationUrl);
178
239
  const sessionInfoResp = await response.json();
240
+ const sessionDetails = getSessionDetails(sessionInfoResp);
241
+ // Store user session details from session info
242
+ initSession(sessionDetails);
179
243
  releaseVersion = sessionInfoResp.releaseVersion;
180
244
  } catch (e) {
181
245
  return false;
@@ -191,24 +255,22 @@ export function getReleaseVersion() {
191
255
  }
192
256
 
193
257
  /**
194
- * Return a promise that resolves with the session information when authentication is
195
- * successful. And info is available.
258
+ * Return a promise that resolves with the session information when
259
+ * authentication is successful. And info is available.
260
+ *
196
261
  * @group Global methods
197
262
  */
198
- export function getSessionInfo(): Promise<any> {
263
+ export function getSessionInfo(): Promise<sessionInfoInterface> {
199
264
  return sessionInfoPromise;
200
265
  }
201
266
 
202
- export function initSession(sessionDetails: any) {
203
- sessionInfo = sessionDetails;
204
- initMixpanel(sessionInfo);
205
- sessionInfoResolver(sessionInfo);
206
- }
207
-
208
- const DUPLICATE_TOKEN_ERR =
209
- 'Duplicate token, please issue a new token every time getAuthToken callback is called.' +
210
- 'See https://developers.thoughtspot.com/docs/?pageid=embed-auth#trusted-auth-embed for more details.';
267
+ const DUPLICATE_TOKEN_ERR = 'Duplicate token, please issue a new token every time getAuthToken callback is called.'
268
+ + 'See https://developers.thoughtspot.com/docs/?pageid=embed-auth#trusted-auth-embed for more details.';
211
269
  let prevAuthToken: string = null;
270
+ /**
271
+ *
272
+ * @param authtoken
273
+ */
212
274
  function alertForDuplicateToken(authtoken: string) {
213
275
  if (prevAuthToken === authtoken) {
214
276
  // eslint-disable-next-line no-alert
@@ -230,18 +292,14 @@ function isAtSSORedirectUrl(): boolean {
230
292
  */
231
293
  function removeSSORedirectUrlMarker(): void {
232
294
  // Note (sunny): This will leave a # around even if it was not in the URL
233
- // to begin with. Trying to remove the hash by changing window.location will reload
234
- // the page which we don't want. We'll live with adding an unnecessary hash to the
235
- // parent page URL until we find any use case where that creates an issue.
236
- window.location.hash = window.location.hash.replace(
237
- SSO_REDIRECTION_MARKER_GUID,
238
- '',
239
- );
295
+ // to begin with. Trying to remove the hash by changing window.location will
296
+ // reload the page which we don't want. We'll live with adding an
297
+ // unnecessary hash to the parent page URL until we find any use case where
298
+ // that creates an issue.
299
+ window.location.hash = window.location.hash.replace(SSO_REDIRECTION_MARKER_GUID, '');
240
300
  }
241
301
 
242
- export const getAuthenticaionToken = async (
243
- embedConfig: EmbedConfig,
244
- ): Promise<any> => {
302
+ export const getAuthenticaionToken = async (embedConfig: EmbedConfig): Promise<any> => {
245
303
  const { authEndpoint, getAuthToken } = embedConfig;
246
304
  let authToken = null;
247
305
  if (getAuthToken) {
@@ -256,40 +314,30 @@ export const getAuthenticaionToken = async (
256
314
 
257
315
  /**
258
316
  * Perform token based authentication
317
+ *
259
318
  * @param embedConfig The embed configuration
260
319
  */
261
- export const doTokenAuth = async (
262
- embedConfig: EmbedConfig,
263
- ): Promise<boolean> => {
320
+ export const doTokenAuth = async (embedConfig: EmbedConfig): Promise<boolean> => {
264
321
  const {
265
- thoughtSpotHost,
266
- username,
267
- authEndpoint,
268
- getAuthToken,
322
+ thoughtSpotHost, username, authEndpoint, getAuthToken,
269
323
  } = embedConfig;
270
324
  if (!authEndpoint && !getAuthToken) {
271
- throw new Error(
272
- 'Either auth endpoint or getAuthToken function must be provided',
273
- );
325
+ throw new Error('Either auth endpoint or getAuthToken function must be provided');
274
326
  }
275
327
  loggedInStatus = await isLoggedIn(thoughtSpotHost);
276
328
  if (!loggedInStatus) {
277
329
  const authToken = await getAuthenticaionToken(embedConfig);
278
330
  let resp;
279
331
  try {
280
- resp = await fetchAuthPostService(
281
- thoughtSpotHost,
282
- username,
283
- authToken,
284
- );
332
+ resp = await fetchAuthPostService(thoughtSpotHost, username, authToken);
285
333
  } catch (e) {
286
334
  resp = await fetchAuthService(thoughtSpotHost, username, authToken);
287
335
  }
288
336
  // token login issues a 302 when successful
289
337
  loggedInStatus = resp.ok || resp.type === 'opaqueredirect';
290
338
  if (loggedInStatus && embedConfig.detectCookieAccessSlow) {
291
- // When 3rd party cookie access is blocked, this will fail because cookies will
292
- // not be sent with the call.
339
+ // When 3rd party cookie access is blocked, this will fail because
340
+ // cookies will not be sent with the call.
293
341
  loggedInStatus = await isLoggedIn(thoughtSpotHost);
294
342
  }
295
343
  }
@@ -298,16 +346,13 @@ export const doTokenAuth = async (
298
346
 
299
347
  /**
300
348
  * Validate embedConfig parameters required for cookielessTokenAuth
349
+ *
301
350
  * @param embedConfig The embed configuration
302
351
  */
303
- export const doCookielessTokenAuth = async (
304
- embedConfig: EmbedConfig,
305
- ): Promise<boolean> => {
352
+ export const doCookielessTokenAuth = async (embedConfig: EmbedConfig): Promise<boolean> => {
306
353
  const { authEndpoint, getAuthToken } = embedConfig;
307
354
  if (!authEndpoint && !getAuthToken) {
308
- throw new Error(
309
- 'Either auth endpoint or getAuthToken function must be provided',
310
- );
355
+ throw new Error('Either auth endpoint or getAuthToken function must be provided');
311
356
  }
312
357
  return Promise.resolve(true);
313
358
  };
@@ -318,19 +363,14 @@ export const doCookielessTokenAuth = async (
318
363
  *
319
364
  * Warning: This feature is primarily intended for developer testing. It is
320
365
  * strongly advised not to use this authentication method in production.
366
+ *
321
367
  * @param embedConfig The embed configuration
322
368
  */
323
- export const doBasicAuth = async (
324
- embedConfig: EmbedConfig,
325
- ): Promise<boolean> => {
369
+ export const doBasicAuth = async (embedConfig: EmbedConfig): Promise<boolean> => {
326
370
  const { thoughtSpotHost, username, password } = embedConfig;
327
371
  const loggedIn = await isLoggedIn(thoughtSpotHost);
328
372
  if (!loggedIn) {
329
- const response = await fetchBasicAuthService(
330
- thoughtSpotHost,
331
- username,
332
- password,
333
- );
373
+ const response = await fetchBasicAuthService(thoughtSpotHost, username, password);
334
374
  loggedInStatus = response.ok;
335
375
  if (embedConfig.detectCookieAccessSlow) {
336
376
  loggedInStatus = await isLoggedIn(thoughtSpotHost);
@@ -341,11 +381,13 @@ export const doBasicAuth = async (
341
381
  return loggedInStatus;
342
382
  };
343
383
 
344
- async function samlPopupFlow(
345
- ssoURL: string,
346
- triggerContainer: DOMSelector,
347
- triggerText: string,
348
- ) {
384
+ /**
385
+ *
386
+ * @param ssoURL
387
+ * @param triggerContainer
388
+ * @param triggerText
389
+ */
390
+ async function samlPopupFlow(ssoURL: string, triggerContainer: DOMSelector, triggerText: string) {
349
391
  const openPopup = () => {
350
392
  if (samlAuthWindow === null || samlAuthWindow.closed) {
351
393
  samlAuthWindow = window.open(
@@ -360,15 +402,13 @@ async function samlPopupFlow(
360
402
  authEE?.emit(AuthStatus.WAITING_FOR_POPUP);
361
403
  const containerEl = getDOMNode(triggerContainer);
362
404
  if (containerEl) {
363
- containerEl.innerHTML =
364
- '<button id="ts-auth-btn" class="ts-auth-btn" style="margin: auto;"></button>';
405
+ containerEl.innerHTML = '<button id="ts-auth-btn" class="ts-auth-btn" style="margin: auto;"></button>';
365
406
  const authElem = document.getElementById('ts-auth-btn');
366
407
  authElem.textContent = triggerText;
367
408
  authElem.addEventListener('click', openPopup, { once: true });
368
409
  }
369
- samlCompletionPromise =
370
- samlCompletionPromise ||
371
- new Promise<void>((resolve, reject) => {
410
+ samlCompletionPromise = samlCompletionPromise
411
+ || new Promise<void>((resolve, reject) => {
372
412
  window.addEventListener('message', (e) => {
373
413
  if (e.data.type === EmbedEvent.SAMLComplete) {
374
414
  (e.source as Window).close();
@@ -383,12 +423,11 @@ async function samlPopupFlow(
383
423
 
384
424
  /**
385
425
  * Perform SAML authentication
426
+ *
386
427
  * @param embedConfig The embed configuration
428
+ * @param ssoEndPoint
387
429
  */
388
- const doSSOAuth = async (
389
- embedConfig: EmbedConfig,
390
- ssoEndPoint: string,
391
- ): Promise<void> => {
430
+ const doSSOAuth = async (embedConfig: EmbedConfig, ssoEndPoint: string): Promise<void> => {
392
431
  const { thoughtSpotHost } = embedConfig;
393
432
  const loggedIn = await isLoggedIn(thoughtSpotHost);
394
433
  if (loggedIn) {
@@ -414,7 +453,7 @@ const doSSOAuth = async (
414
453
  embedConfig.authTriggerContainer,
415
454
  embedConfig.authTriggerText,
416
455
  );
417
- loggedInStatus = true;
456
+ loggedInStatus = await isLoggedIn(thoughtSpotHost);
418
457
  return;
419
458
  }
420
459
 
@@ -423,20 +462,18 @@ const doSSOAuth = async (
423
462
 
424
463
  export const doSamlAuth = async (embedConfig: EmbedConfig) => {
425
464
  const { thoughtSpotHost } = embedConfig;
426
- // redirect for SSO, when the SSO authentication is done, this page will be loaded
427
- // again and the same JS will execute again.
465
+ // redirect for SSO, when the SSO authentication is done, this page will be
466
+ // loaded again and the same JS will execute again.
428
467
  const ssoRedirectUrl = embedConfig.inPopup
429
468
  ? `${thoughtSpotHost}/v2/#/embed/saml-complete`
430
469
  : getRedirectUrl(
431
- window.location.href,
432
- SSO_REDIRECTION_MARKER_GUID,
433
- embedConfig.redirectPath,
434
- );
470
+ window.location.href,
471
+ SSO_REDIRECTION_MARKER_GUID,
472
+ embedConfig.redirectPath,
473
+ );
435
474
 
436
475
  // bring back the page to the same URL
437
- const ssoEndPoint = `${EndPoints.SAML_LOGIN_TEMPLATE(
438
- encodeURIComponent(ssoRedirectUrl),
439
- )}`;
476
+ const ssoEndPoint = `${EndPoints.SAML_LOGIN_TEMPLATE(encodeURIComponent(ssoRedirectUrl))}`;
440
477
 
441
478
  await doSSOAuth(embedConfig, ssoEndPoint);
442
479
  return loggedInStatus;
@@ -444,21 +481,18 @@ export const doSamlAuth = async (embedConfig: EmbedConfig) => {
444
481
 
445
482
  export const doOIDCAuth = async (embedConfig: EmbedConfig) => {
446
483
  const { thoughtSpotHost } = embedConfig;
447
- // redirect for SSO, when the SSO authentication is done, this page will be loaded
448
- // again and the same JS will execute again.
449
- const ssoRedirectUrl =
450
- embedConfig.noRedirect || embedConfig.inPopup
451
- ? `${thoughtSpotHost}/v2/#/embed/saml-complete`
452
- : getRedirectUrl(
453
- window.location.href,
454
- SSO_REDIRECTION_MARKER_GUID,
455
- embedConfig.redirectPath,
456
- );
484
+ // redirect for SSO, when the SSO authentication is done, this page will be
485
+ // loaded again and the same JS will execute again.
486
+ const ssoRedirectUrl = embedConfig.noRedirect || embedConfig.inPopup
487
+ ? `${thoughtSpotHost}/v2/#/embed/saml-complete`
488
+ : getRedirectUrl(
489
+ window.location.href,
490
+ SSO_REDIRECTION_MARKER_GUID,
491
+ embedConfig.redirectPath,
492
+ );
457
493
 
458
494
  // bring back the page to the same URL
459
- const ssoEndPoint = `${EndPoints.OIDC_LOGIN_TEMPLATE(
460
- encodeURIComponent(ssoRedirectUrl),
461
- )}`;
495
+ const ssoEndPoint = `${EndPoints.OIDC_LOGIN_TEMPLATE(encodeURIComponent(ssoRedirectUrl))}`;
462
496
 
463
497
  await doSSOAuth(embedConfig, ssoEndPoint);
464
498
  return loggedInStatus;
@@ -473,11 +507,10 @@ export const logout = async (embedConfig: EmbedConfig): Promise<boolean> => {
473
507
 
474
508
  /**
475
509
  * Perform authentication on the ThoughtSpot cluster
510
+ *
476
511
  * @param embedConfig The embed configuration
477
512
  */
478
- export const authenticate = async (
479
- embedConfig: EmbedConfig,
480
- ): Promise<boolean> => {
513
+ export const authenticate = async (embedConfig: EmbedConfig): Promise<boolean> => {
481
514
  const { authType } = embedConfig;
482
515
  switch (authType) {
483
516
  case AuthType.SSO:
@@ -59,8 +59,7 @@ describe('getThoughtSpotHost', () => {
59
59
  expect(
60
60
  getThoughtSpotHost({
61
61
  ...embedConfig,
62
- thoughtSpotHost:
63
- 'http://1.2.3.4:8088/v2/?foo=bar&baz=42#myhash',
62
+ thoughtSpotHost: 'http://1.2.3.4:8088/v2/?foo=bar&baz=42#myhash',
64
63
  }),
65
64
  ).toBe('http://1.2.3.4:8088/v2');
66
65
  });
@@ -70,8 +69,7 @@ describe('getThoughtSpotHost', () => {
70
69
  getThoughtSpotHost({
71
70
  ...embedConfig,
72
71
  authType: AuthType.SAML,
73
- thoughtSpotHost:
74
- 'http://1.2.3.4:8088/v2/?foo=bar&baz=42#myhash',
72
+ thoughtSpotHost: 'http://1.2.3.4:8088/v2/?foo=bar&baz=42#myhash',
75
73
  }),
76
74
  ).toBe('http://1.2.3.4:8088/v2');
77
75
  });
package/src/config.ts CHANGED
@@ -23,6 +23,7 @@ const urlRegex = new RegExp(
23
23
  /**
24
24
  * Parse and construct the ThoughtSpot hostname or IP address
25
25
  * from the embed configuration object.
26
+ *
26
27
  * @param config
27
28
  */
28
29
  export const getThoughtSpotHost = (config: EmbedConfig): string => {
@@ -51,9 +52,10 @@ export const getV2BasePath = (config: EmbedConfig): string => {
51
52
 
52
53
  const tsHost = getThoughtSpotHost(config);
53
54
 
54
- // This is to handle when e2e's. Search is run on pods for comp-blink-test-pipeline
55
- // with baseUrl=https://localhost:8443.
56
- // This is to handle when the developer is developing in their local environment.
55
+ // This is to handle when e2e's. Search is run on pods for
56
+ // comp-blink-test-pipeline with baseUrl=https://localhost:8443.
57
+ // This is to handle when the developer is developing in their local
58
+ // environment.
57
59
  if (tsHost.includes('://localhost') && !tsHost.includes(':8443')) {
58
60
  return '';
59
61
  }