@thoughtspot/visual-embed-sdk 1.35.12 → 1.35.14

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 (132) hide show
  1. package/cjs/package.json +1 -2
  2. package/cjs/src/auth.d.ts +2 -1
  3. package/cjs/src/auth.d.ts.map +1 -1
  4. package/cjs/src/auth.js +3 -1
  5. package/cjs/src/auth.js.map +1 -1
  6. package/cjs/src/embed/app.d.ts.map +1 -1
  7. package/cjs/src/embed/app.js +2 -0
  8. package/cjs/src/embed/app.js.map +1 -1
  9. package/cjs/src/embed/conversation.d.ts +44 -0
  10. package/cjs/src/embed/conversation.d.ts.map +1 -1
  11. package/cjs/src/embed/conversation.js +10 -1
  12. package/cjs/src/embed/conversation.js.map +1 -1
  13. package/cjs/src/embed/conversation.spec.js +36 -0
  14. package/cjs/src/embed/conversation.spec.js.map +1 -1
  15. package/cjs/src/embed/hostEventClient/contracts.d.ts +3 -3
  16. package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  17. package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  18. package/cjs/src/embed/hostEventClient/host-event-client.js +6 -1
  19. package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
  20. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  21. package/cjs/src/embed/liveboard.js +8 -2
  22. package/cjs/src/embed/liveboard.js.map +1 -1
  23. package/cjs/src/embed/search-bar.d.ts.map +1 -1
  24. package/cjs/src/embed/search-bar.js +4 -2
  25. package/cjs/src/embed/search-bar.js.map +1 -1
  26. package/cjs/src/embed/search.d.ts.map +1 -1
  27. package/cjs/src/embed/search.js +4 -2
  28. package/cjs/src/embed/search.js.map +1 -1
  29. package/cjs/src/embed/search.spec.js +56 -3
  30. package/cjs/src/embed/search.spec.js.map +1 -1
  31. package/cjs/src/embed/ts-embed.d.ts +6 -0
  32. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  33. package/cjs/src/embed/ts-embed.js +38 -13
  34. package/cjs/src/embed/ts-embed.js.map +1 -1
  35. package/cjs/src/embed/ts-embed.spec.js +132 -130
  36. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  37. package/cjs/src/types.d.ts +43 -17
  38. package/cjs/src/types.d.ts.map +1 -1
  39. package/cjs/src/types.js +35 -7
  40. package/cjs/src/types.js.map +1 -1
  41. package/cjs/src/utils/processData.d.ts.map +1 -1
  42. package/cjs/src/utils/processData.js +9 -2
  43. package/cjs/src/utils/processData.js.map +1 -1
  44. package/cjs/src/utils/processData.spec.js +51 -0
  45. package/cjs/src/utils/processData.spec.js.map +1 -1
  46. package/dist/index-B3hd6DTM.js +7370 -0
  47. package/dist/index-vxW97_xb.js +7370 -0
  48. package/dist/src/auth.d.ts +2 -1
  49. package/dist/src/auth.d.ts.map +1 -1
  50. package/dist/src/embed/app.d.ts.map +1 -1
  51. package/dist/src/embed/conversation.d.ts +44 -0
  52. package/dist/src/embed/conversation.d.ts.map +1 -1
  53. package/dist/src/embed/hostEventClient/contracts.d.ts +3 -3
  54. package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  55. package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  56. package/dist/src/embed/liveboard.d.ts.map +1 -1
  57. package/dist/src/embed/search-bar.d.ts.map +1 -1
  58. package/dist/src/embed/search.d.ts.map +1 -1
  59. package/dist/src/embed/ts-embed.d.ts +6 -0
  60. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  61. package/dist/src/types.d.ts +43 -17
  62. package/dist/src/types.d.ts.map +1 -1
  63. package/dist/src/utils/processData.d.ts.map +1 -1
  64. package/dist/tsembed-react.es.js +122 -34
  65. package/dist/tsembed-react.js +121 -33
  66. package/dist/tsembed.es.js +122 -34
  67. package/dist/tsembed.js +121 -33
  68. package/dist/visual-embed-sdk-react-full.d.ts +92 -21
  69. package/dist/visual-embed-sdk-react.d.ts +92 -21
  70. package/dist/visual-embed-sdk.d.ts +92 -21
  71. package/lib/package.json +1 -2
  72. package/lib/src/auth.d.ts +2 -1
  73. package/lib/src/auth.d.ts.map +1 -1
  74. package/lib/src/auth.js +3 -1
  75. package/lib/src/auth.js.map +1 -1
  76. package/lib/src/embed/app.d.ts.map +1 -1
  77. package/lib/src/embed/app.js +2 -0
  78. package/lib/src/embed/app.js.map +1 -1
  79. package/lib/src/embed/conversation.d.ts +44 -0
  80. package/lib/src/embed/conversation.d.ts.map +1 -1
  81. package/lib/src/embed/conversation.js +10 -1
  82. package/lib/src/embed/conversation.js.map +1 -1
  83. package/lib/src/embed/conversation.spec.js +36 -0
  84. package/lib/src/embed/conversation.spec.js.map +1 -1
  85. package/lib/src/embed/hostEventClient/contracts.d.ts +3 -3
  86. package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  87. package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  88. package/lib/src/embed/hostEventClient/host-event-client.js +6 -1
  89. package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
  90. package/lib/src/embed/liveboard.d.ts.map +1 -1
  91. package/lib/src/embed/liveboard.js +8 -2
  92. package/lib/src/embed/liveboard.js.map +1 -1
  93. package/lib/src/embed/search-bar.d.ts.map +1 -1
  94. package/lib/src/embed/search-bar.js +4 -2
  95. package/lib/src/embed/search-bar.js.map +1 -1
  96. package/lib/src/embed/search.d.ts.map +1 -1
  97. package/lib/src/embed/search.js +4 -2
  98. package/lib/src/embed/search.js.map +1 -1
  99. package/lib/src/embed/search.spec.js +56 -3
  100. package/lib/src/embed/search.spec.js.map +1 -1
  101. package/lib/src/embed/ts-embed.d.ts +6 -0
  102. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  103. package/lib/src/embed/ts-embed.js +38 -13
  104. package/lib/src/embed/ts-embed.js.map +1 -1
  105. package/lib/src/embed/ts-embed.spec.js +133 -131
  106. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  107. package/lib/src/types.d.ts +43 -17
  108. package/lib/src/types.d.ts.map +1 -1
  109. package/lib/src/types.js +35 -7
  110. package/lib/src/types.js.map +1 -1
  111. package/lib/src/utils/processData.d.ts.map +1 -1
  112. package/lib/src/utils/processData.js +9 -2
  113. package/lib/src/utils/processData.js.map +1 -1
  114. package/lib/src/utils/processData.spec.js +51 -0
  115. package/lib/src/utils/processData.spec.js.map +1 -1
  116. package/lib/src/visual-embed-sdk.d.ts +92 -21
  117. package/package.json +1 -2
  118. package/src/auth.ts +3 -1
  119. package/src/embed/app.ts +2 -0
  120. package/src/embed/conversation.spec.ts +52 -3
  121. package/src/embed/conversation.ts +60 -1
  122. package/src/embed/hostEventClient/contracts.ts +3 -3
  123. package/src/embed/hostEventClient/host-event-client.ts +7 -1
  124. package/src/embed/liveboard.ts +9 -4
  125. package/src/embed/search-bar.tsx +6 -4
  126. package/src/embed/search.spec.ts +71 -3
  127. package/src/embed/search.ts +6 -5
  128. package/src/embed/ts-embed.spec.ts +153 -180
  129. package/src/embed/ts-embed.ts +46 -30
  130. package/src/types.ts +44 -15
  131. package/src/utils/processData.spec.ts +63 -0
  132. package/src/utils/processData.ts +12 -2
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.35.12 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.35.14 */
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) :
@@ -1060,6 +1060,11 @@
1060
1060
  * @hidden
1061
1061
  */
1062
1062
  EmbedEvent["AuthFailure"] = "ThoughtspotAuthFailure";
1063
+ /**
1064
+ * ThoughtSpot failed to re validate the auth session.
1065
+ * @hidden
1066
+ */
1067
+ EmbedEvent["IdleSessionTimeout"] = "IdleSessionTimeout";
1063
1068
  /**
1064
1069
  * ThoughtSpot failed to validate the auth session.
1065
1070
  * @hidden
@@ -1783,6 +1788,19 @@
1783
1788
  * @version SDK: 1.35.12 | ThoughtSpot: 10.7.0.cl
1784
1789
  */
1785
1790
  EmbedEvent["TableVizRendered"] = "TableVizRendered";
1791
+ /**
1792
+ * Emitted when the liveboard is created from pin modal or liveboard list page.
1793
+ * You can use this event as a hook to trigger
1794
+ * other events on liveboard creation.
1795
+ *
1796
+ * ```js
1797
+ * liveboardEmbed.on(EmbedEvent.CreateLiveboard, (payload) => {
1798
+ * console.log('payload', payload);
1799
+ * })
1800
+ *```
1801
+ * @version SDK : 1.36.0 | ThoughtSpot : 10.8.0.cl
1802
+ */
1803
+ EmbedEvent["CreateLiveboard"] = "createLiveboard";
1786
1804
  })(exports.EmbedEvent || (exports.EmbedEvent = {}));
1787
1805
  /**
1788
1806
  * Event types that can be triggered by the host application
@@ -2789,6 +2807,7 @@
2789
2807
  Param["HideResult"] = "hideResult";
2790
2808
  Param["UseLastSelectedDataSource"] = "useLastSelectedSources";
2791
2809
  Param["Tag"] = "tag";
2810
+ Param["AutoLogin"] = "autoLogin";
2792
2811
  Param["searchTokenString"] = "searchTokenString";
2793
2812
  Param["executeSearch"] = "executeSearch";
2794
2813
  Param["fullHeight"] = "isFullHeightPinboard";
@@ -2871,10 +2890,10 @@
2871
2890
  Param["SpotterEnabled"] = "isSpotterExperienceEnabled";
2872
2891
  Param["IsUnifiedSearchExperienceEnabled"] = "isUnifiedSearchExperienceEnabled";
2873
2892
  Param["OverrideOrgId"] = "orgId";
2874
- Param["EnableFlipTooltipToContextMenu"] = "flipTooltipToContextMenuEnabled";
2875
2893
  Param["OauthPollingInterval"] = "oAuthPollingInterval";
2876
2894
  Param["IsForceRedirect"] = "isForceRedirect";
2877
2895
  Param["DataSourceId"] = "dataSourceId";
2896
+ Param["ShowSpotterLimitations"] = "showSpotterLimitations";
2878
2897
  })(Param || (Param = {}));
2879
2898
  /**
2880
2899
  * ThoughtSpot application pages include actions and menu commands
@@ -4081,10 +4100,17 @@
4081
4100
  ContextMenuTriggerOptions["RIGHT_CLICK"] = "right-click";
4082
4101
  ContextMenuTriggerOptions["BOTH_CLICKS"] = "both-clicks";
4083
4102
  })(ContextMenuTriggerOptions || (ContextMenuTriggerOptions = {}));
4103
+ /**
4104
+ * Enum options to show or suppress Visual Embed SDK and
4105
+ * ThoughtSpot application logs in the console output.
4106
+ * This attribute doesn't support suppressing
4107
+ * browser warnings or errors.
4108
+ */
4084
4109
  exports.LogLevel = void 0;
4085
4110
  (function (LogLevel) {
4086
4111
  /**
4087
- * No logs will be logged in the console.
4112
+ * No application or SDK-related logs will be logged
4113
+ * in the console output.
4088
4114
  * @example
4089
4115
  * ```js
4090
4116
  * init({
@@ -4096,7 +4122,7 @@
4096
4122
  */
4097
4123
  LogLevel["SILENT"] = "SILENT";
4098
4124
  /**
4099
- * Only ERROR logs will be logged in the console.
4125
+ * Log only errors in the console output.
4100
4126
  * @example
4101
4127
  * ```js
4102
4128
  * init({
@@ -4108,7 +4134,7 @@
4108
4134
  */
4109
4135
  LogLevel["ERROR"] = "ERROR";
4110
4136
  /**
4111
- * Only WARN and ERROR logs will be logged in the console.
4137
+ * Log only warnings and errors in the console output.
4112
4138
  * @example
4113
4139
  * ```js
4114
4140
  * init({
@@ -4120,7 +4146,8 @@
4120
4146
  */
4121
4147
  LogLevel["WARN"] = "WARN";
4122
4148
  /**
4123
- * Only INFO, WARN, and ERROR logs will be logged in the console.
4149
+ * Log only the information alerts, warnings, and errors
4150
+ * in the console output.
4124
4151
  * @example
4125
4152
  * ```js
4126
4153
  * init({
@@ -4132,7 +4159,8 @@
4132
4159
  */
4133
4160
  LogLevel["INFO"] = "INFO";
4134
4161
  /**
4135
- * Only DEBUG, INFO, WARN, and ERROR logs will be logged in the console.
4162
+ * Log debug messages, warnings, information alerts,
4163
+ * and errors in the console output.
4136
4164
  * @example
4137
4165
  * ```js
4138
4166
  * init({
@@ -4144,7 +4172,7 @@
4144
4172
  */
4145
4173
  LogLevel["DEBUG"] = "DEBUG";
4146
4174
  /**
4147
- * All logs will be logged in the console.
4175
+ * All logs will be logged in the browser console.
4148
4176
  * @example
4149
4177
  * ```js
4150
4178
  * init({
@@ -14167,6 +14195,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14167
14195
  AuthFailureType["NO_COOKIE_ACCESS"] = "NO_COOKIE_ACCESS";
14168
14196
  AuthFailureType["EXPIRY"] = "EXPIRY";
14169
14197
  AuthFailureType["OTHER"] = "OTHER";
14198
+ AuthFailureType["IDLE_SESSION_TIMEOUT"] = "IDLE_SESSION_TIMEOUT";
14170
14199
  })(AuthFailureType || (AuthFailureType = {}));
14171
14200
  /**
14172
14201
  * Enum for auth status emitted by the emitter returned from {@link init}.
@@ -14472,7 +14501,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14472
14501
  ? `${thoughtSpotHost}/v2/#/embed/saml-complete`
14473
14502
  : getRedirectUrl(window.location.href, SSO_REDIRECTION_MARKER_GUID, embedConfig.redirectPath);
14474
14503
  // bring back the page to the same URL
14475
- const ssoEndPoint = `${EndPoints.OIDC_LOGIN_TEMPLATE(encodeURIComponent(ssoRedirectUrl))}`;
14504
+ const baseEndpoint = `${EndPoints.OIDC_LOGIN_TEMPLATE(encodeURIComponent(ssoRedirectUrl))}`;
14505
+ const ssoEndPoint = `${baseEndpoint}${baseEndpoint.includes('?') ? '&' : '?'}forceSAMLAutoRedirect=true`;
14476
14506
  await doSSOAuth(embedConfig, ssoEndPoint);
14477
14507
  return loggedInStatus;
14478
14508
  };
@@ -14619,8 +14649,15 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14619
14649
  * @param containerEl
14620
14650
  */
14621
14651
  function processAuthFailure(e, containerEl) {
14622
- const { loginFailedMessage, authType, disableLoginFailurePage } = getEmbedConfig();
14623
- if (authType !== AuthType.None && !disableLoginFailurePage) {
14652
+ const { loginFailedMessage, authType, disableLoginFailurePage, autoLogin, } = getEmbedConfig();
14653
+ if (autoLogin
14654
+ && (authType === AuthType.TrustedAuthToken
14655
+ || authType === AuthType.TrustedAuthTokenCookieless)) {
14656
+ // eslint-disable-next-line no-param-reassign
14657
+ containerEl.innerHTML = loginFailedMessage;
14658
+ notifyAuthFailure(AuthFailureType.IDLE_SESSION_TIMEOUT);
14659
+ }
14660
+ else if (authType !== AuthType.None && !disableLoginFailurePage) {
14624
14661
  // eslint-disable-next-line no-param-reassign
14625
14662
  containerEl.innerHTML = loginFailedMessage;
14626
14663
  notifyAuthFailure(AuthFailureType.OTHER);
@@ -14665,7 +14702,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14665
14702
  return e;
14666
14703
  }
14667
14704
 
14668
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.35.12";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",dompurify:"^2.3.4",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};
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};
14669
14706
 
14670
14707
  /**
14671
14708
  * Reloads the ThoughtSpot iframe.
@@ -14790,7 +14827,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14790
14827
  if (!payload || !('newVizName' in payload)) {
14791
14828
  return this.hostEventFallback(exports.HostEvent.Pin, payload);
14792
14829
  }
14793
- return this.handleHostEventWithParam(UIPassthroughEvent.PinAnswerToLiveboard, payload);
14830
+ const formattedPayload = {
14831
+ ...payload,
14832
+ pinboardId: payload.liveboardId,
14833
+ newPinboardName: payload.newLiveboardName,
14834
+ };
14835
+ return this.handleHostEventWithParam(UIPassthroughEvent.PinAnswerToLiveboard, formattedPayload);
14794
14836
  }
14795
14837
  async handleSaveAnswerEvent(payload) {
14796
14838
  var _a, _b, _c, _d;
@@ -14909,12 +14951,37 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14909
14951
  }
14910
14952
  notifyAuthFailure(AuthFailureType.EXPIRY);
14911
14953
  };
14954
+ /**
14955
+ * Auto Login and send updated authToken to the iFrame to avoid user session logout
14956
+ * @param _
14957
+ * @param responder
14958
+ */
14959
+ this.idleSessionTimeout = (_, responder) => {
14960
+ handleAuth().then(async () => {
14961
+ let authToken = '';
14962
+ try {
14963
+ authToken = await getAuthenticationToken(this.embedConfig);
14964
+ responder({
14965
+ type: exports.EmbedEvent.IdleSessionTimeout,
14966
+ data: { authToken },
14967
+ });
14968
+ }
14969
+ catch (e) {
14970
+ logger$3.error(`${ERROR_MESSAGE.INVALID_TOKEN_ERROR} Error : ${e === null || e === void 0 ? void 0 : e.message}`);
14971
+ processAuthFailure(e, this.isPreRendered ? this.preRenderWrapper : this.el);
14972
+ }
14973
+ }).catch((e) => {
14974
+ logger$3.error(`Auto Login failed, Error : ${e === null || e === void 0 ? void 0 : e.message}`);
14975
+ });
14976
+ notifyAuthFailure(AuthFailureType.IDLE_SESSION_TIMEOUT);
14977
+ };
14912
14978
  /**
14913
14979
  * Register APP_INIT event and sendback init payload
14914
14980
  */
14915
14981
  this.registerAppInit = () => {
14916
14982
  this.on(exports.EmbedEvent.APP_INIT, this.appInitCb, { start: false }, true);
14917
14983
  this.on(exports.EmbedEvent.AuthExpire, this.updateAuthToken, { start: false }, true);
14984
+ this.on(exports.EmbedEvent.IdleSessionTimeout, this.idleSessionTimeout, { start: false }, true);
14918
14985
  };
14919
14986
  this.showPreRenderByDefault = false;
14920
14987
  this.validatePreRenderViewConfig = (viewConfig) => {
@@ -15097,7 +15164,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15097
15164
  * @param query
15098
15165
  */
15099
15166
  getEmbedBasePath(query) {
15100
- let queryString = (query.startsWith('?')) ? query : `?${query}`;
15167
+ let queryString = query.startsWith('?') ? query : `?${query}`;
15101
15168
  if (this.shouldEncodeUrlQueryParams) {
15102
15169
  queryString = `?base64UrlEncodedFlags=${getEncodedQueryParamsString(queryString.substr(1))}`;
15103
15170
  }
@@ -15112,20 +15179,22 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15112
15179
  * @returns queryParams
15113
15180
  */
15114
15181
  getBaseQueryParams(queryParams = {}) {
15115
- var _a, _b, _c;
15182
+ var _a, _b;
15116
15183
  let hostAppUrl = ((_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.host) || '';
15117
15184
  // The below check is needed because TS Cloud firewall, blocks
15118
15185
  // localhost/127.0.0.1 in any url param.
15119
15186
  if (hostAppUrl.includes('localhost') || hostAppUrl.includes('127.0.0.1')) {
15120
15187
  hostAppUrl = 'local-host';
15121
15188
  }
15189
+ const blockNonEmbedFullAppAccess = (_b = this.embedConfig.blockNonEmbedFullAppAccess) !== null && _b !== void 0 ? _b : true;
15122
15190
  queryParams[Param.EmbedApp] = true;
15123
15191
  queryParams[Param.HostAppUrl] = encodeURIComponent(hostAppUrl);
15124
15192
  queryParams[Param.ViewPortHeight] = window.innerHeight;
15125
15193
  queryParams[Param.ViewPortWidth] = window.innerWidth;
15126
15194
  queryParams[Param.Version] = version;
15127
15195
  queryParams[Param.AuthType] = this.embedConfig.authType;
15128
- queryParams[Param.blockNonEmbedFullAppAccess] = (_b = this.embedConfig.blockNonEmbedFullAppAccess) !== null && _b !== void 0 ? _b : true;
15196
+ queryParams[Param.blockNonEmbedFullAppAccess] = blockNonEmbedFullAppAccess;
15197
+ queryParams[Param.AutoLogin] = this.embedConfig.autoLogin;
15129
15198
  if (this.embedConfig.disableLoginRedirect === true || this.embedConfig.autoLogin === true) {
15130
15199
  queryParams[Param.DisableLoginRedirect] = true;
15131
15200
  }
@@ -15147,15 +15216,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15147
15216
  if (this.embedConfig.currencyFormat) {
15148
15217
  queryParams[Param.CurrencyFormat] = this.embedConfig.currencyFormat;
15149
15218
  }
15150
- const { disabledActions, disabledActionReason, hiddenActions, visibleActions, hiddenTabs, visibleTabs, showAlerts, additionalFlags: additionalFlagsFromView, locale, customizations, contextMenuTrigger, linkOverride, insertInToSlide, disableRedirectionLinksInNewTab, overrideOrgId, enableFlipTooltipToContextMenu = false, } = this.viewConfig;
15219
+ const { disabledActions, disabledActionReason, hiddenActions, visibleActions, hiddenTabs, visibleTabs, showAlerts, additionalFlags: additionalFlagsFromView, locale, customizations, contextMenuTrigger, linkOverride, insertInToSlide, disableRedirectionLinksInNewTab, overrideOrgId, } = this.viewConfig;
15151
15220
  const { additionalFlags: additionalFlagsFromInit } = this.embedConfig;
15152
15221
  const additionalFlags = {
15153
15222
  ...additionalFlagsFromInit,
15154
15223
  ...additionalFlagsFromView,
15155
15224
  };
15156
- if (enableFlipTooltipToContextMenu) {
15157
- queryParams[Param.EnableFlipTooltipToContextMenu] = enableFlipTooltipToContextMenu;
15158
- }
15159
15225
  if (Array.isArray(visibleActions) && Array.isArray(hiddenActions)) {
15160
15226
  this.handleError('You cannot have both hidden actions and visible actions');
15161
15227
  return queryParams;
@@ -15194,8 +15260,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15194
15260
  else if (contextMenuTrigger === ContextMenuTriggerOptions.BOTH_CLICKS) {
15195
15261
  queryParams[Param.ContextMenuTrigger] = 'both';
15196
15262
  }
15197
- const spriteUrl = (customizations === null || customizations === void 0 ? void 0 : customizations.iconSpriteUrl)
15198
- || ((_c = this.embedConfig.customizations) === null || _c === void 0 ? void 0 : _c.iconSpriteUrl);
15263
+ const embedCustomizations = this.embedConfig.customizations;
15264
+ const spriteUrl = (customizations === null || customizations === void 0 ? void 0 : customizations.iconSpriteUrl) || (embedCustomizations === null || embedCustomizations === void 0 ? void 0 : embedCustomizations.iconSpriteUrl);
15199
15265
  if (spriteUrl) {
15200
15266
  queryParams[Param.IconSpriteUrl] = spriteUrl.replace('https://', '');
15201
15267
  }
@@ -15267,7 +15333,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15267
15333
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
15268
15334
  // @ts-ignore
15269
15335
  iFrame.allow = 'clipboard-read; clipboard-write; fullscreen;';
15270
- const { height: frameHeight, width: frameWidth, ...restParams } = this.viewConfig.frameParams || {};
15336
+ const frameParams = this.viewConfig.frameParams;
15337
+ const { height: frameHeight, width: frameWidth, ...restParams } = frameParams || {};
15271
15338
  const width = getCssDimension(frameWidth || DEFAULT_EMBED_WIDTH);
15272
15339
  const height = getCssDimension(frameHeight || DEFAULT_EMBED_HEIGHT);
15273
15340
  setAttributes(iFrame, restParams);
@@ -15372,8 +15439,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15372
15439
  }
15373
15440
  connectPreRendered() {
15374
15441
  const preRenderIds = this.getPreRenderIds();
15375
- this.preRenderWrapper = this.preRenderWrapper
15376
- || document.getElementById(preRenderIds.wrapper);
15442
+ const preRenderWrapperElement = document.getElementById(preRenderIds.wrapper);
15443
+ this.preRenderWrapper = this.preRenderWrapper || preRenderWrapperElement;
15377
15444
  this.preRenderChild = this.preRenderChild || document.getElementById(preRenderIds.child);
15378
15445
  if (this.preRenderWrapper && this.preRenderChild) {
15379
15446
  this.isPreRendered = true;
@@ -15875,7 +15942,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15875
15942
  const filterQuery = getFilterQuery(runtimeFilters || []);
15876
15943
  queryString = [filterQuery, queryString].filter(Boolean).join('&');
15877
15944
  }
15878
- return (this.viewConfig.enableV2Shell_experimental)
15945
+ return this.viewConfig.enableV2Shell_experimental
15879
15946
  ? this.getEmbedBasePath(queryString)
15880
15947
  : this.getV1EmbedBasePath(queryString);
15881
15948
  }
@@ -15930,8 +15997,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15930
15997
  if (dataSource) {
15931
15998
  queryParams[Param.DataSources] = `["${dataSource}"]`;
15932
15999
  }
15933
- if ((searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.searchTokenString) && !excludeSearchTokenStringFromURL) {
15934
- queryParams[Param.searchTokenString] = encodeURIComponent(searchOptions.searchTokenString);
16000
+ if (searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.searchTokenString) {
16001
+ if (!excludeSearchTokenStringFromURL) {
16002
+ queryParams[Param.searchTokenString] = encodeURIComponent(searchOptions.searchTokenString);
16003
+ }
15935
16004
  if (searchOptions.executeSearch) {
15936
16005
  queryParams[Param.executeSearch] = true;
15937
16006
  }
@@ -16134,8 +16203,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16134
16203
  if (dataSource) {
16135
16204
  queryParams[Param.DataSources] = `["${dataSource}"]`;
16136
16205
  }
16137
- if ((searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.searchTokenString) && !excludeSearchTokenStringFromURL) {
16138
- queryParams[Param.searchTokenString] = encodeURIComponent(searchOptions.searchTokenString);
16206
+ if (searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.searchTokenString) {
16207
+ if (!excludeSearchTokenStringFromURL) {
16208
+ queryParams[Param.searchTokenString] = encodeURIComponent(searchOptions.searchTokenString);
16209
+ }
16139
16210
  if (searchOptions.executeSearch) {
16140
16211
  queryParams[Param.executeSearch] = true;
16141
16212
  }
@@ -16330,6 +16401,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16330
16401
  '/embed/insights/viz/',
16331
16402
  '/liveboard/',
16332
16403
  '/insights/liveboard/',
16404
+ '/tsl-editor/PINBOARD_ANSWER_BOOK/',
16405
+ '/import-tsl/PINBOARD_ANSWER_BOOK/',
16333
16406
  ];
16334
16407
  if (liveboardRelatedRoutes.some((path) => data.data.currentPath.startsWith(path))) {
16335
16408
  // Ignore the height reset of the frame, if the navigation is
@@ -16591,6 +16664,12 @@ query GetEurekaVizSnapshots(
16591
16664
  * @summary Liveboard & visualization embed
16592
16665
  * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
16593
16666
  */
16667
+ const liveboardHeightWhitelistedRoutes = [
16668
+ '/embed/viz/',
16669
+ '/embed/insights/viz/',
16670
+ '/tsl-editor/PINBOARD_ANSWER_BOOK/',
16671
+ '/import-tsl/PINBOARD_ANSWER_BOOK/',
16672
+ ];
16594
16673
  /**
16595
16674
  * Embed a ThoughtSpot Liveboard or visualization. When rendered it already
16596
16675
  * waits for the authentication to complete, so you need not wait for
@@ -16625,8 +16704,8 @@ query GetEurekaVizSnapshots(
16625
16704
  responder({ type: exports.EmbedEvent.EmbedIframeCenter, data: obj });
16626
16705
  };
16627
16706
  this.setIframeHeightForNonEmbedLiveboard = (data) => {
16628
- if (data.data.currentPath.startsWith('/embed/viz/')
16629
- || data.data.currentPath.startsWith('/embed/insights/viz/')) {
16707
+ const routePath = data.data.currentPath;
16708
+ if (liveboardHeightWhitelistedRoutes.some((path) => routePath.startsWith(path))) {
16630
16709
  return;
16631
16710
  }
16632
16711
  this.setIFrameHeight(this.defaultHeight);
@@ -16910,7 +16989,7 @@ query GetEurekaVizSnapshots(
16910
16989
  this.viewConfig = viewConfig;
16911
16990
  }
16912
16991
  getIframeSrc() {
16913
- const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, } = this.viewConfig;
16992
+ const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, } = this.viewConfig;
16914
16993
  const path = 'insights/conv-assist';
16915
16994
  if (!worksheetId) {
16916
16995
  this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
@@ -16923,6 +17002,15 @@ query GetEurekaVizSnapshots(
16923
17002
  if (!isUndefined_1(hideSourceSelection)) {
16924
17003
  queryParams[Param.HideSourceSelection] = !!hideSourceSelection;
16925
17004
  }
17005
+ if (!isUndefined_1(dataPanelV2)) {
17006
+ queryParams[Param.DataPanelV2Enabled] = !!dataPanelV2;
17007
+ }
17008
+ if (!isUndefined_1(showSpotterLimitations)) {
17009
+ queryParams[Param.ShowSpotterLimitations] = !!showSpotterLimitations;
17010
+ }
17011
+ if (!isUndefined_1(hideSampleQuestions)) {
17012
+ queryParams[Param.HideSampleQuestions] = !!hideSampleQuestions;
17013
+ }
16926
17014
  let query = '';
16927
17015
  const queryParamsString = getQueryParamString(queryParams, true);
16928
17016
  if (queryParamsString) {