@thoughtspot/visual-embed-sdk 1.35.14 → 1.36.0

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 (172) hide show
  1. package/cjs/package.json +2 -3
  2. package/cjs/src/auth.d.ts +5 -0
  3. package/cjs/src/auth.d.ts.map +1 -1
  4. package/cjs/src/auth.js +7 -0
  5. package/cjs/src/auth.js.map +1 -1
  6. package/cjs/src/embed/ts-embed.d.ts +6 -0
  7. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  8. package/cjs/src/embed/ts-embed.js +27 -0
  9. package/cjs/src/embed/ts-embed.js.map +1 -1
  10. package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
  11. package/cjs/src/embed/ts-embed.spec.js +73 -1
  12. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  13. package/cjs/src/react/index.spec.js +2 -2
  14. package/cjs/src/react/index.spec.js.map +1 -1
  15. package/cjs/src/types.d.ts +13 -2
  16. package/cjs/src/types.d.ts.map +1 -1
  17. package/cjs/src/types.js +12 -2
  18. package/cjs/src/types.js.map +1 -1
  19. package/cjs/src/utils/authService/authService.d.ts +1 -0
  20. package/cjs/src/utils/authService/authService.d.ts.map +1 -1
  21. package/cjs/src/utils/authService/authService.js +1 -0
  22. package/cjs/src/utils/authService/authService.js.map +1 -1
  23. package/cjs/src/utils/authService/index.d.ts +1 -1
  24. package/cjs/src/utils/authService/index.d.ts.map +1 -1
  25. package/cjs/src/utils/authService/index.js +2 -1
  26. package/cjs/src/utils/authService/index.js.map +1 -1
  27. package/cjs/src/utils/authService/tokenizedAuthService.d.ts +10 -0
  28. package/cjs/src/utils/authService/tokenizedAuthService.d.ts.map +1 -1
  29. package/cjs/src/utils/authService/tokenizedAuthService.js +27 -1
  30. package/cjs/src/utils/authService/tokenizedAuthService.js.map +1 -1
  31. package/cjs/src/utils/authService/tokenizedAuthService.spec.js +58 -1
  32. package/cjs/src/utils/authService/tokenizedAuthService.spec.js.map +1 -1
  33. package/cjs/src/utils/sessionInfoService.d.ts +30 -0
  34. package/cjs/src/utils/sessionInfoService.d.ts.map +1 -1
  35. package/cjs/src/utils/sessionInfoService.js +59 -1
  36. package/cjs/src/utils/sessionInfoService.js.map +1 -1
  37. package/dist/{index-B3hd6DTM.js → index-V2oBuwy6.js} +1 -1
  38. package/dist/src/auth.d.ts +5 -0
  39. package/dist/src/auth.d.ts.map +1 -1
  40. package/dist/src/embed/ts-embed.d.ts +6 -0
  41. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  42. package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
  43. package/dist/src/types.d.ts +13 -2
  44. package/dist/src/types.d.ts.map +1 -1
  45. package/dist/src/utils/authService/authService.d.ts +1 -0
  46. package/dist/src/utils/authService/authService.d.ts.map +1 -1
  47. package/dist/src/utils/authService/index.d.ts +1 -1
  48. package/dist/src/utils/authService/index.d.ts.map +1 -1
  49. package/dist/src/utils/authService/tokenizedAuthService.d.ts +10 -0
  50. package/dist/src/utils/authService/tokenizedAuthService.d.ts.map +1 -1
  51. package/dist/src/utils/sessionInfoService.d.ts +30 -0
  52. package/dist/src/utils/sessionInfoService.d.ts.map +1 -1
  53. package/dist/tsembed-react.es.js +129 -5
  54. package/dist/tsembed-react.js +128 -4
  55. package/dist/tsembed.es.js +130 -5
  56. package/dist/tsembed.js +129 -4
  57. package/dist/visual-embed-sdk-react-full.d.ts +48 -2
  58. package/dist/visual-embed-sdk-react.d.ts +48 -2
  59. package/dist/visual-embed-sdk.d.ts +48 -2
  60. package/lib/package.json +2 -3
  61. package/lib/src/auth.d.ts +5 -0
  62. package/lib/src/auth.d.ts.map +1 -1
  63. package/lib/src/auth.js +8 -1
  64. package/lib/src/auth.js.map +1 -1
  65. package/lib/src/embed/ts-embed.d.ts +6 -0
  66. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  67. package/lib/src/embed/ts-embed.js +27 -0
  68. package/lib/src/embed/ts-embed.js.map +1 -1
  69. package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
  70. package/lib/src/embed/ts-embed.spec.js +73 -1
  71. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  72. package/lib/src/react/index.spec.js +2 -2
  73. package/lib/src/react/index.spec.js.map +1 -1
  74. package/lib/src/types.d.ts +13 -2
  75. package/lib/src/types.d.ts.map +1 -1
  76. package/lib/src/types.js +12 -2
  77. package/lib/src/types.js.map +1 -1
  78. package/lib/src/utils/authService/authService.d.ts +1 -0
  79. package/lib/src/utils/authService/authService.d.ts.map +1 -1
  80. package/lib/src/utils/authService/authService.js +1 -0
  81. package/lib/src/utils/authService/authService.js.map +1 -1
  82. package/lib/src/utils/authService/index.d.ts +1 -1
  83. package/lib/src/utils/authService/index.d.ts.map +1 -1
  84. package/lib/src/utils/authService/index.js +1 -1
  85. package/lib/src/utils/authService/index.js.map +1 -1
  86. package/lib/src/utils/authService/tokenizedAuthService.d.ts +10 -0
  87. package/lib/src/utils/authService/tokenizedAuthService.d.ts.map +1 -1
  88. package/lib/src/utils/authService/tokenizedAuthService.js +25 -0
  89. package/lib/src/utils/authService/tokenizedAuthService.js.map +1 -1
  90. package/lib/src/utils/authService/tokenizedAuthService.spec.js +59 -2
  91. package/lib/src/utils/authService/tokenizedAuthService.spec.js.map +1 -1
  92. package/lib/src/utils/sessionInfoService.d.ts +30 -0
  93. package/lib/src/utils/sessionInfoService.d.ts.map +1 -1
  94. package/lib/src/utils/sessionInfoService.js +57 -1
  95. package/lib/src/utils/sessionInfoService.js.map +1 -1
  96. package/lib/src/visual-embed-sdk.d.ts +48 -2
  97. package/package.json +2 -3
  98. package/src/auth.ts +8 -1
  99. package/src/embed/ts-embed.spec.ts +95 -1
  100. package/src/embed/ts-embed.ts +31 -0
  101. package/src/react/index.spec.tsx +2 -2
  102. package/src/types.ts +14 -2
  103. package/src/utils/authService/authService.ts +1 -0
  104. package/src/utils/authService/index.ts +5 -1
  105. package/src/utils/authService/tokenizedAuthService.spec.ts +66 -2
  106. package/src/utils/authService/tokenizedAuthService.ts +26 -0
  107. package/src/utils/sessionInfoService.ts +64 -1
  108. package/cjs/src/embed/searchEmbed-basic-auth.spec.d.ts +0 -2
  109. package/cjs/src/embed/searchEmbed-basic-auth.spec.d.ts.map +0 -1
  110. package/cjs/src/embed/searchEmbed-basic-auth.spec.js +0 -104
  111. package/cjs/src/embed/searchEmbed-basic-auth.spec.js.map +0 -1
  112. package/cjs/src/hostEventsTypeMapping.d.ts +0 -2
  113. package/cjs/src/hostEventsTypeMapping.d.ts.map +0 -1
  114. package/cjs/src/hostEventsTypeMapping.js +0 -4
  115. package/cjs/src/hostEventsTypeMapping.js.map +0 -1
  116. package/cjs/src/utils/embedApi/contracts.d.ts +0 -101
  117. package/cjs/src/utils/embedApi/contracts.d.ts.map +0 -1
  118. package/cjs/src/utils/embedApi/contracts.js +0 -17
  119. package/cjs/src/utils/embedApi/contracts.js.map +0 -1
  120. package/cjs/src/utils/embedApi/embedApiClient.d.ts +0 -12
  121. package/cjs/src/utils/embedApi/embedApiClient.d.ts.map +0 -1
  122. package/cjs/src/utils/embedApi/embedApiClient.js +0 -46
  123. package/cjs/src/utils/embedApi/embedApiClient.js.map +0 -1
  124. package/cjs/src/utils/embedApi/processEmbedApi.d.ts +0 -9
  125. package/cjs/src/utils/embedApi/processEmbedApi.d.ts.map +0 -1
  126. package/cjs/src/utils/embedApi/processEmbedApi.js +0 -18
  127. package/cjs/src/utils/embedApi/processEmbedApi.js.map +0 -1
  128. package/dist/index-BBBimG1x.js +0 -7370
  129. package/dist/index-BGnxP5NY.js +0 -7370
  130. package/dist/index-CENLvayL.js +0 -7370
  131. package/dist/index-CbltIawo.js +0 -7370
  132. package/dist/index-CoQfqaHj.js +0 -7370
  133. package/dist/index-CzwzS0P4.js +0 -7370
  134. package/dist/index-D-9WUCUl.js +0 -7370
  135. package/dist/index-DFwi_pV_.js +0 -7370
  136. package/dist/index-DOIjN0N_.js +0 -7370
  137. package/dist/index-DYBx8SuE.js +0 -7370
  138. package/dist/index-DaLHJaLd.js +0 -7370
  139. package/dist/index-DnJX-gN2.js +0 -7370
  140. package/dist/index-IDmSUe93.js +0 -7370
  141. package/dist/index-nWevLycs.js +0 -7370
  142. package/dist/index-vxW97_xb.js +0 -7370
  143. package/dist/src/embed/searchEmbed-basic-auth.spec.d.ts +0 -2
  144. package/dist/src/embed/searchEmbed-basic-auth.spec.d.ts.map +0 -1
  145. package/dist/src/hostEventsTypeMapping.d.ts +0 -2
  146. package/dist/src/hostEventsTypeMapping.d.ts.map +0 -1
  147. package/dist/src/utils/embedApi/contracts.d.ts +0 -101
  148. package/dist/src/utils/embedApi/contracts.d.ts.map +0 -1
  149. package/dist/src/utils/embedApi/embedApiClient.d.ts +0 -12
  150. package/dist/src/utils/embedApi/embedApiClient.d.ts.map +0 -1
  151. package/dist/src/utils/embedApi/processEmbedApi.d.ts +0 -9
  152. package/dist/src/utils/embedApi/processEmbedApi.d.ts.map +0 -1
  153. package/lib/src/embed/searchEmbed-basic-auth.spec.d.ts +0 -2
  154. package/lib/src/embed/searchEmbed-basic-auth.spec.d.ts.map +0 -1
  155. package/lib/src/embed/searchEmbed-basic-auth.spec.js +0 -101
  156. package/lib/src/embed/searchEmbed-basic-auth.spec.js.map +0 -1
  157. package/lib/src/hostEventsTypeMapping.d.ts +0 -2
  158. package/lib/src/hostEventsTypeMapping.d.ts.map +0 -1
  159. package/lib/src/hostEventsTypeMapping.js +0 -2
  160. package/lib/src/hostEventsTypeMapping.js.map +0 -1
  161. package/lib/src/utils/embedApi/contracts.d.ts +0 -101
  162. package/lib/src/utils/embedApi/contracts.d.ts.map +0 -1
  163. package/lib/src/utils/embedApi/contracts.js +0 -14
  164. package/lib/src/utils/embedApi/contracts.js.map +0 -1
  165. package/lib/src/utils/embedApi/embedApiClient.d.ts +0 -12
  166. package/lib/src/utils/embedApi/embedApiClient.d.ts.map +0 -1
  167. package/lib/src/utils/embedApi/embedApiClient.js +0 -42
  168. package/lib/src/utils/embedApi/embedApiClient.js.map +0 -1
  169. package/lib/src/utils/embedApi/processEmbedApi.d.ts +0 -9
  170. package/lib/src/utils/embedApi/processEmbedApi.d.ts.map +0 -1
  171. package/lib/src/utils/embedApi/processEmbedApi.js +0 -14
  172. package/lib/src/utils/embedApi/processEmbedApi.js.map +0 -1
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.35.14 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.36.0 */
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
4
4
  typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) :
@@ -2735,8 +2735,17 @@
2735
2735
  */
2736
2736
  HostEvent["UpdatePersonalisedView"] = "UpdatePersonalisedView";
2737
2737
  /**
2738
- * Triggers the action to get the current view of the Liveboard.
2739
- * @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
2738
+ * @hidden
2739
+ * Notify when info call is completed successfully
2740
+ * ```js
2741
+ * liveboardEmbed.trigger(HostEvent.InfoSuccess, data);
2742
+ *```
2743
+ * @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
2744
+ */
2745
+ HostEvent["InfoSuccess"] = "InfoSuccess";
2746
+ /**
2747
+ * Triggers the action to get the current view of the liveboard
2748
+ * @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
2740
2749
  */
2741
2750
  HostEvent["SaveAnswer"] = "saveAnswer";
2742
2751
  /**
@@ -2893,6 +2902,7 @@
2893
2902
  Param["OauthPollingInterval"] = "oAuthPollingInterval";
2894
2903
  Param["IsForceRedirect"] = "isForceRedirect";
2895
2904
  Param["DataSourceId"] = "dataSourceId";
2905
+ Param["preAuthCache"] = "preAuthCache";
2896
2906
  Param["ShowSpotterLimitations"] = "showSpotterLimitations";
2897
2907
  })(Param || (Param = {}));
2898
2908
  /**
@@ -6549,6 +6559,7 @@
6549
6559
  const EndPoints = {
6550
6560
  AUTH_VERIFICATION: '/callosum/v1/session/info',
6551
6561
  SESSION_INFO: '/callosum/v1/session/info',
6562
+ PREAUTH_INFO: '/prism/preauth/info',
6552
6563
  SAML_LOGIN_TEMPLATE: (targetUrl) => `/callosum/v1/saml/login?targetURLPath=${targetUrl}`,
6553
6564
  OIDC_LOGIN_TEMPLATE: (targetUrl) => `/callosum/v1/oidc/login?targetURLPath=${targetUrl}`,
6554
6565
  TOKEN_LOGIN: '/callosum/v1/session/login/token',
@@ -14090,6 +14101,31 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14090
14101
  return r;
14091
14102
  });
14092
14103
  }
14104
+ /**
14105
+ * Fetches the session info from the ThoughtSpot server.
14106
+ * @param thoughtspotHost
14107
+ * @returns {Promise<any>}
14108
+ * @example
14109
+ * ```js
14110
+ * const response = await sessionInfoService();
14111
+ * ```
14112
+ */
14113
+ async function fetchPreauthInfoService(thoughtspotHost) {
14114
+ const sessionInfoPath = `${thoughtspotHost}${EndPoints.PREAUTH_INFO}`;
14115
+ const handleError = (e) => {
14116
+ const error = new Error(`Failed to fetch auth info: ${e.message || e.statusText}`);
14117
+ error.status = e.status; // Attach the status code to the error object
14118
+ throw error;
14119
+ };
14120
+ try {
14121
+ const response = await tokenizedFailureLoggedFetch(sessionInfoPath);
14122
+ return response;
14123
+ }
14124
+ catch (e) {
14125
+ handleError(e);
14126
+ return null;
14127
+ }
14128
+ }
14093
14129
  /**
14094
14130
  * Fetches the session info from the ThoughtSpot server.
14095
14131
  * @param thoughtspotHost
@@ -14128,6 +14164,62 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14128
14164
  }
14129
14165
 
14130
14166
  let sessionInfo = null;
14167
+ let preauthInfo = null;
14168
+ /**
14169
+ * Processes the session info response and returns the session info object.
14170
+ * @param preauthInfoResp {any} Response from the session info API.
14171
+ * @returns {PreauthInfo} The session info object.
14172
+ * @example ```js
14173
+ * const preauthInfoResp = await fetch(sessionInfoPath);
14174
+ * const sessionInfo = await formatPreauthInfo(preauthInfoResp);
14175
+ * console.log(sessionInfo);
14176
+ * ```
14177
+ * @version SDK: 1.28.3 | ThoughtSpot: *
14178
+ */
14179
+ const formatPreauthInfo = async (preauthInfoResp) => {
14180
+ var _a;
14181
+ try {
14182
+ // Convert Headers to a plain object
14183
+ const headers = {};
14184
+ (_a = preauthInfoResp === null || preauthInfoResp === void 0 ? void 0 : preauthInfoResp.headers) === null || _a === void 0 ? void 0 : _a.forEach((value, key) => {
14185
+ headers[key] = value;
14186
+ });
14187
+ const data = await preauthInfoResp.json();
14188
+ return {
14189
+ ...data,
14190
+ status: 200,
14191
+ headers,
14192
+ };
14193
+ }
14194
+ catch (error) {
14195
+ return null;
14196
+ }
14197
+ };
14198
+ /**
14199
+ * Returns the session info object and caches it for future use.
14200
+ * Once fetched the session info object is cached and returned from the cache on
14201
+ * subsequent calls.
14202
+ * @example ```js
14203
+ * const preauthInfo = await getPreauthInfo();
14204
+ * console.log(preauthInfo);
14205
+ * ```
14206
+ * @version SDK: 1.28.3 | ThoughtSpot: *
14207
+ * @returns {Promise<SessionInfo>} The session info object.
14208
+ */
14209
+ async function getPreauthInfo(allowCache = true) {
14210
+ if (!allowCache || !preauthInfo) {
14211
+ try {
14212
+ const host = getEmbedConfig().thoughtSpotHost;
14213
+ const sessionResponse = await fetchPreauthInfoService(host);
14214
+ const processedPreauthInfo = await formatPreauthInfo(sessionResponse);
14215
+ preauthInfo = processedPreauthInfo;
14216
+ }
14217
+ catch (error) {
14218
+ return null;
14219
+ }
14220
+ }
14221
+ return preauthInfo;
14222
+ }
14131
14223
  /**
14132
14224
  * Returns the session info object and caches it for future use.
14133
14225
  * Once fetched the session info object is cached and returned from the cache on
@@ -14211,6 +14303,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14211
14303
  * Emits when the SDK authenticates successfully
14212
14304
  */
14213
14305
  AuthStatus["SDK_SUCCESS"] = "SDK_SUCCESS";
14306
+ /**
14307
+ * @hidden
14308
+ * Emits when iframe is loaded and session info is available
14309
+ */
14310
+ AuthStatus["SESSION_INFO_SUCCESS"] = "SESSION_INFO_SUCCESS";
14214
14311
  /**
14215
14312
  * Emits when the app sends an authentication success message
14216
14313
  */
@@ -14302,6 +14399,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14302
14399
  */
14303
14400
  async function postLoginService() {
14304
14401
  try {
14402
+ getPreauthInfo();
14305
14403
  const sessionInfo = await getSessionInfo();
14306
14404
  releaseVersion = sessionInfo.releaseVersion;
14307
14405
  const embedConfig = getEmbedConfig();
@@ -14702,7 +14800,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14702
14800
  return e;
14703
14801
  }
14704
14802
 
14705
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.35.14";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","html-react-parser":"^1.4.12",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":"^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:"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};
14803
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.36.0";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};
14706
14804
 
14707
14805
  /**
14708
14806
  * Reloads the ThoughtSpot iframe.
@@ -15065,6 +15163,21 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15065
15163
  }
15066
15164
  return null;
15067
15165
  }
15166
+ /**
15167
+ * Checks if preauth cache is enabled
15168
+ * from the view config and embed config
15169
+ * @returns boolean
15170
+ */
15171
+ isPreAuthCacheEnabled() {
15172
+ // Disable preauth cache when:
15173
+ // 1. overrideOrgId is present since:
15174
+ // - cached auth info would be for wrong org
15175
+ // - info call response changes for each different overrideOrgId
15176
+ // 2. disablePreauthCache is explicitly set to true
15177
+ const isDisabled = (this.viewConfig.overrideOrgId !== undefined
15178
+ || this.embedConfig.disablePreauthCache === true);
15179
+ return !isDisabled;
15180
+ }
15068
15181
  /**
15069
15182
  * fix for ts7.sep.cl
15070
15183
  * will be removed for ts7.oct.cl
@@ -15283,6 +15396,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15283
15396
  if (overrideOrgId !== undefined) {
15284
15397
  queryParams[Param.OverrideOrgId] = overrideOrgId;
15285
15398
  }
15399
+ if (this.isPreAuthCacheEnabled()) {
15400
+ queryParams[Param.preAuthCache] = true;
15401
+ }
15286
15402
  queryParams[Param.OverrideNativeConsole] = true;
15287
15403
  queryParams[Param.ClientLogLevel] = this.embedConfig.logLevel;
15288
15404
  if (isObject_1(additionalFlags) && !isEmpty_1(additionalFlags)) {
@@ -15401,6 +15517,14 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15401
15517
  elHeight: this.iFrame.clientHeight,
15402
15518
  timeTookToLoad: loadTimestamp - initTimestamp,
15403
15519
  });
15520
+ // Send info event if preauth cache is enabled
15521
+ if (this.isPreAuthCacheEnabled()) {
15522
+ getPreauthInfo().then((data) => {
15523
+ if (data === null || data === void 0 ? void 0 : data.info) {
15524
+ this.trigger(exports.HostEvent.InfoSuccess, data);
15525
+ }
15526
+ });
15527
+ }
15404
15528
  });
15405
15529
  this.iFrame.addEventListener('error', () => {
15406
15530
  nextInQueue();
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.35.14 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.36.0 */
2
2
  function _mergeNamespaces(n, m) {
3
3
  m.forEach(function (e) {
4
4
  e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
@@ -2598,8 +2598,17 @@ var HostEvent;
2598
2598
  */
2599
2599
  HostEvent["UpdatePersonalisedView"] = "UpdatePersonalisedView";
2600
2600
  /**
2601
- * Triggers the action to get the current view of the Liveboard.
2602
- * @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
2601
+ * @hidden
2602
+ * Notify when info call is completed successfully
2603
+ * ```js
2604
+ * liveboardEmbed.trigger(HostEvent.InfoSuccess, data);
2605
+ *```
2606
+ * @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
2607
+ */
2608
+ HostEvent["InfoSuccess"] = "InfoSuccess";
2609
+ /**
2610
+ * Triggers the action to get the current view of the liveboard
2611
+ * @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
2603
2612
  */
2604
2613
  HostEvent["SaveAnswer"] = "saveAnswer";
2605
2614
  /**
@@ -2756,6 +2765,7 @@ var Param;
2756
2765
  Param["OauthPollingInterval"] = "oAuthPollingInterval";
2757
2766
  Param["IsForceRedirect"] = "isForceRedirect";
2758
2767
  Param["DataSourceId"] = "dataSourceId";
2768
+ Param["preAuthCache"] = "preAuthCache";
2759
2769
  Param["ShowSpotterLimitations"] = "showSpotterLimitations";
2760
2770
  })(Param || (Param = {}));
2761
2771
  /**
@@ -6415,6 +6425,7 @@ const ERROR_MESSAGE = {
6415
6425
  const EndPoints = {
6416
6426
  AUTH_VERIFICATION: '/callosum/v1/session/info',
6417
6427
  SESSION_INFO: '/callosum/v1/session/info',
6428
+ PREAUTH_INFO: '/prism/preauth/info',
6418
6429
  SAML_LOGIN_TEMPLATE: (targetUrl) => `/callosum/v1/saml/login?targetURLPath=${targetUrl}`,
6419
6430
  OIDC_LOGIN_TEMPLATE: (targetUrl) => `/callosum/v1/oidc/login?targetURLPath=${targetUrl}`,
6420
6431
  TOKEN_LOGIN: '/callosum/v1/session/login/token',
@@ -7227,7 +7238,7 @@ class AnswerService {
7227
7238
  async getTML() {
7228
7239
  const { object } = await this.executeQuery(getAnswerTML, {});
7229
7240
  const edoc = object[0].edoc;
7230
- const YAML = await import('./index-vxW97_xb.js');
7241
+ const YAML = await import('./index-V2oBuwy6.js');
7231
7242
  const parsedDoc = YAML.parse(edoc);
7232
7243
  return {
7233
7244
  answer: {
@@ -14012,6 +14023,31 @@ function tokenizedFailureLoggedFetch(url, options = {}) {
14012
14023
  return r;
14013
14024
  });
14014
14025
  }
14026
+ /**
14027
+ * Fetches the session info from the ThoughtSpot server.
14028
+ * @param thoughtspotHost
14029
+ * @returns {Promise<any>}
14030
+ * @example
14031
+ * ```js
14032
+ * const response = await sessionInfoService();
14033
+ * ```
14034
+ */
14035
+ async function fetchPreauthInfoService(thoughtspotHost) {
14036
+ const sessionInfoPath = `${thoughtspotHost}${EndPoints.PREAUTH_INFO}`;
14037
+ const handleError = (e) => {
14038
+ const error = new Error(`Failed to fetch auth info: ${e.message || e.statusText}`);
14039
+ error.status = e.status; // Attach the status code to the error object
14040
+ throw error;
14041
+ };
14042
+ try {
14043
+ const response = await tokenizedFailureLoggedFetch(sessionInfoPath);
14044
+ return response;
14045
+ }
14046
+ catch (e) {
14047
+ handleError(e);
14048
+ return null;
14049
+ }
14050
+ }
14015
14051
  /**
14016
14052
  * Fetches the session info from the ThoughtSpot server.
14017
14053
  * @param thoughtspotHost
@@ -14063,6 +14099,62 @@ async function isActiveService(thoughtSpotHost) {
14063
14099
  }
14064
14100
 
14065
14101
  let sessionInfo = null;
14102
+ let preauthInfo = null;
14103
+ /**
14104
+ * Processes the session info response and returns the session info object.
14105
+ * @param preauthInfoResp {any} Response from the session info API.
14106
+ * @returns {PreauthInfo} The session info object.
14107
+ * @example ```js
14108
+ * const preauthInfoResp = await fetch(sessionInfoPath);
14109
+ * const sessionInfo = await formatPreauthInfo(preauthInfoResp);
14110
+ * console.log(sessionInfo);
14111
+ * ```
14112
+ * @version SDK: 1.28.3 | ThoughtSpot: *
14113
+ */
14114
+ const formatPreauthInfo = async (preauthInfoResp) => {
14115
+ var _a;
14116
+ try {
14117
+ // Convert Headers to a plain object
14118
+ const headers = {};
14119
+ (_a = preauthInfoResp === null || preauthInfoResp === void 0 ? void 0 : preauthInfoResp.headers) === null || _a === void 0 ? void 0 : _a.forEach((value, key) => {
14120
+ headers[key] = value;
14121
+ });
14122
+ const data = await preauthInfoResp.json();
14123
+ return {
14124
+ ...data,
14125
+ status: 200,
14126
+ headers,
14127
+ };
14128
+ }
14129
+ catch (error) {
14130
+ return null;
14131
+ }
14132
+ };
14133
+ /**
14134
+ * Returns the session info object and caches it for future use.
14135
+ * Once fetched the session info object is cached and returned from the cache on
14136
+ * subsequent calls.
14137
+ * @example ```js
14138
+ * const preauthInfo = await getPreauthInfo();
14139
+ * console.log(preauthInfo);
14140
+ * ```
14141
+ * @version SDK: 1.28.3 | ThoughtSpot: *
14142
+ * @returns {Promise<SessionInfo>} The session info object.
14143
+ */
14144
+ async function getPreauthInfo(allowCache = true) {
14145
+ if (!allowCache || !preauthInfo) {
14146
+ try {
14147
+ const host = getEmbedConfig().thoughtSpotHost;
14148
+ const sessionResponse = await fetchPreauthInfoService(host);
14149
+ const processedPreauthInfo = await formatPreauthInfo(sessionResponse);
14150
+ preauthInfo = processedPreauthInfo;
14151
+ }
14152
+ catch (error) {
14153
+ return null;
14154
+ }
14155
+ }
14156
+ return preauthInfo;
14157
+ }
14066
14158
  /**
14067
14159
  * Returns the session info object and caches it for future use.
14068
14160
  * Once fetched the session info object is cached and returned from the cache on
@@ -14146,6 +14238,11 @@ var AuthStatus;
14146
14238
  * Emits when the SDK authenticates successfully
14147
14239
  */
14148
14240
  AuthStatus["SDK_SUCCESS"] = "SDK_SUCCESS";
14241
+ /**
14242
+ * @hidden
14243
+ * Emits when iframe is loaded and session info is available
14244
+ */
14245
+ AuthStatus["SESSION_INFO_SUCCESS"] = "SESSION_INFO_SUCCESS";
14149
14246
  /**
14150
14247
  * Emits when the app sends an authentication success message
14151
14248
  */
@@ -14201,6 +14298,7 @@ async function notifyAuthSuccess() {
14201
14298
  return;
14202
14299
  }
14203
14300
  try {
14301
+ getPreauthInfo();
14204
14302
  const sessionInfo = await getSessionInfo();
14205
14303
  authEE.emit(AuthStatus.SUCCESS, sessionInfo);
14206
14304
  }
@@ -14255,6 +14353,7 @@ async function isLoggedIn(thoughtSpotHost) {
14255
14353
  */
14256
14354
  async function postLoginService() {
14257
14355
  try {
14356
+ getPreauthInfo();
14258
14357
  const sessionInfo = await getSessionInfo();
14259
14358
  releaseVersion = sessionInfo.releaseVersion;
14260
14359
  const embedConfig = getEmbedConfig();
@@ -14922,7 +15021,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
14922
15021
  return e;
14923
15022
  }
14924
15023
 
14925
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.35.14";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={".":{"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","html-react-parser":"^1.4.12",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":"^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:"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,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};
15024
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.36.0";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={".":{"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,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};
14926
15025
 
14927
15026
  /**
14928
15027
  * Reloads the ThoughtSpot iframe.
@@ -15285,6 +15384,21 @@ class TsEmbed {
15285
15384
  }
15286
15385
  return null;
15287
15386
  }
15387
+ /**
15388
+ * Checks if preauth cache is enabled
15389
+ * from the view config and embed config
15390
+ * @returns boolean
15391
+ */
15392
+ isPreAuthCacheEnabled() {
15393
+ // Disable preauth cache when:
15394
+ // 1. overrideOrgId is present since:
15395
+ // - cached auth info would be for wrong org
15396
+ // - info call response changes for each different overrideOrgId
15397
+ // 2. disablePreauthCache is explicitly set to true
15398
+ const isDisabled = (this.viewConfig.overrideOrgId !== undefined
15399
+ || this.embedConfig.disablePreauthCache === true);
15400
+ return !isDisabled;
15401
+ }
15288
15402
  /**
15289
15403
  * fix for ts7.sep.cl
15290
15404
  * will be removed for ts7.oct.cl
@@ -15503,6 +15617,9 @@ class TsEmbed {
15503
15617
  if (overrideOrgId !== undefined) {
15504
15618
  queryParams[Param.OverrideOrgId] = overrideOrgId;
15505
15619
  }
15620
+ if (this.isPreAuthCacheEnabled()) {
15621
+ queryParams[Param.preAuthCache] = true;
15622
+ }
15506
15623
  queryParams[Param.OverrideNativeConsole] = true;
15507
15624
  queryParams[Param.ClientLogLevel] = this.embedConfig.logLevel;
15508
15625
  if (isObject_1(additionalFlags) && !isEmpty_1(additionalFlags)) {
@@ -15621,6 +15738,14 @@ class TsEmbed {
15621
15738
  elHeight: this.iFrame.clientHeight,
15622
15739
  timeTookToLoad: loadTimestamp - initTimestamp,
15623
15740
  });
15741
+ // Send info event if preauth cache is enabled
15742
+ if (this.isPreAuthCacheEnabled()) {
15743
+ getPreauthInfo().then((data) => {
15744
+ if (data === null || data === void 0 ? void 0 : data.info) {
15745
+ this.trigger(HostEvent.InfoSuccess, data);
15746
+ }
15747
+ });
15748
+ }
15624
15749
  });
15625
15750
  this.iFrame.addEventListener('error', () => {
15626
15751
  nextInQueue();