@thoughtspot/visual-embed-sdk 1.37.0 → 1.37.1

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 (95) hide show
  1. package/cjs/package.json +2 -2
  2. package/cjs/src/auth.d.ts +9 -4
  3. package/cjs/src/auth.d.ts.map +1 -1
  4. package/cjs/src/auth.js +21 -0
  5. package/cjs/src/auth.js.map +1 -1
  6. package/cjs/src/auth.spec.js +48 -0
  7. package/cjs/src/auth.spec.js.map +1 -1
  8. package/cjs/src/embed/app.d.ts +99 -0
  9. package/cjs/src/embed/app.d.ts.map +1 -1
  10. package/cjs/src/embed/app.js +48 -3
  11. package/cjs/src/embed/app.js.map +1 -1
  12. package/cjs/src/embed/app.spec.js +61 -0
  13. package/cjs/src/embed/app.spec.js.map +1 -1
  14. package/cjs/src/embed/base.d.ts.map +1 -1
  15. package/cjs/src/embed/base.js +7 -0
  16. package/cjs/src/embed/base.js.map +1 -1
  17. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  18. package/cjs/src/embed/ts-embed.js +10 -5
  19. package/cjs/src/embed/ts-embed.js.map +1 -1
  20. package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
  21. package/cjs/src/embed/ts-embed.spec.js +105 -0
  22. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  23. package/cjs/src/types.d.ts +69 -4
  24. package/cjs/src/types.d.ts.map +1 -1
  25. package/cjs/src/types.js +54 -2
  26. package/cjs/src/types.js.map +1 -1
  27. package/cjs/src/utils/graphql/answerService/answerService.d.ts +35 -15
  28. package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  29. package/cjs/src/utils/graphql/answerService/answerService.js +35 -15
  30. package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
  31. package/cjs/src/utils/processData.js +6 -4
  32. package/cjs/src/utils/processData.js.map +1 -1
  33. package/dist/{index-DnIvX1FR.js → index-m9UtENc9.js} +1 -1
  34. package/dist/src/auth.d.ts +9 -4
  35. package/dist/src/auth.d.ts.map +1 -1
  36. package/dist/src/embed/app.d.ts +99 -0
  37. package/dist/src/embed/app.d.ts.map +1 -1
  38. package/dist/src/embed/base.d.ts.map +1 -1
  39. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  40. package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
  41. package/dist/src/types.d.ts +69 -4
  42. package/dist/src/types.d.ts.map +1 -1
  43. package/dist/src/utils/graphql/answerService/answerService.d.ts +35 -15
  44. package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  45. package/dist/tsembed-react.es.js +183 -31
  46. package/dist/tsembed-react.js +182 -30
  47. package/dist/tsembed.es.js +183 -31
  48. package/dist/tsembed.js +182 -30
  49. package/dist/visual-embed-sdk-react-full.d.ts +212 -23
  50. package/dist/visual-embed-sdk-react.d.ts +212 -23
  51. package/dist/visual-embed-sdk.d.ts +212 -23
  52. package/lib/package.json +2 -2
  53. package/lib/src/auth.d.ts +9 -4
  54. package/lib/src/auth.d.ts.map +1 -1
  55. package/lib/src/auth.js +21 -0
  56. package/lib/src/auth.js.map +1 -1
  57. package/lib/src/auth.spec.js +48 -0
  58. package/lib/src/auth.spec.js.map +1 -1
  59. package/lib/src/embed/app.d.ts +99 -0
  60. package/lib/src/embed/app.d.ts.map +1 -1
  61. package/lib/src/embed/app.js +47 -2
  62. package/lib/src/embed/app.js.map +1 -1
  63. package/lib/src/embed/app.spec.js +62 -1
  64. package/lib/src/embed/app.spec.js.map +1 -1
  65. package/lib/src/embed/base.d.ts.map +1 -1
  66. package/lib/src/embed/base.js +7 -0
  67. package/lib/src/embed/base.js.map +1 -1
  68. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  69. package/lib/src/embed/ts-embed.js +10 -5
  70. package/lib/src/embed/ts-embed.js.map +1 -1
  71. package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
  72. package/lib/src/embed/ts-embed.spec.js +105 -0
  73. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  74. package/lib/src/types.d.ts +69 -4
  75. package/lib/src/types.d.ts.map +1 -1
  76. package/lib/src/types.js +54 -2
  77. package/lib/src/types.js.map +1 -1
  78. package/lib/src/utils/graphql/answerService/answerService.d.ts +35 -15
  79. package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  80. package/lib/src/utils/graphql/answerService/answerService.js +35 -15
  81. package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
  82. package/lib/src/utils/processData.js +6 -4
  83. package/lib/src/utils/processData.js.map +1 -1
  84. package/lib/src/visual-embed-sdk.d.ts +212 -23
  85. package/package.json +2 -2
  86. package/src/auth.spec.ts +52 -0
  87. package/src/auth.ts +25 -3
  88. package/src/embed/app.spec.ts +88 -0
  89. package/src/embed/app.ts +133 -0
  90. package/src/embed/base.ts +9 -0
  91. package/src/embed/ts-embed.spec.ts +130 -0
  92. package/src/embed/ts-embed.ts +10 -4
  93. package/src/types.ts +68 -3
  94. package/src/utils/graphql/answerService/answerService.ts +35 -15
  95. package/src/utils/processData.ts +6 -6
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.37.0 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.37.1 */
2
2
  'use client';
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
@@ -712,6 +712,18 @@
712
712
  * @version SDK: 1.34.0| ThoughtSpot: 10.3.0.cl
713
713
  */
714
714
  HomeLeftNavItem["LiveboardSchedules"] = "liveboard-schedules";
715
+ /**
716
+ * Create new options in the insights left navigation,
717
+ * available when new navigation V3 is enabled.
718
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
719
+ */
720
+ HomeLeftNavItem["Create"] = "create";
721
+ /**
722
+ * Spotter option in the insights left navigation,
723
+ * available when new navigation V3 is enabled.
724
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
725
+ */
726
+ HomeLeftNavItem["Spotter"] = "spotter";
715
727
  })(exports.HomeLeftNavItem || (exports.HomeLeftNavItem = {}));
716
728
  /**
717
729
  * A map of the supported runtime filter operations
@@ -2124,9 +2136,12 @@
2124
2136
  * @example
2125
2137
  * ```js
2126
2138
  * searchEmbed.trigger(HostEvent.OpenFilter,
2127
- * { columnId: '<column-GUID>', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE'})
2139
+ * {column: { columnId: '<column-GUID>', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE'}})
2140
+ * ```
2141
+ * @example
2142
+ * ```js
2128
2143
  * LiveboardEmbed.trigger(HostEvent.OpenFilter,
2129
- * { columnId: '<column-GUID>'})
2144
+ * { column: {columnId: '<column-GUID>'}})
2130
2145
  * ```
2131
2146
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
2132
2147
  */
@@ -2735,6 +2750,25 @@
2735
2750
  * }]
2736
2751
  * });
2737
2752
  * ```
2753
+ * If there are multiple columns with the same name, consider
2754
+ * using `WORKSHEET_NAME::COLUMN_NAME` format.
2755
+ *
2756
+ * @example
2757
+ *
2758
+ * ```js
2759
+ * liveboardEmbed.trigger(HostEvent.UpdateFilters, {
2760
+ * filters: [{
2761
+ * column: "(Sample) Retail - Apparel::city",
2762
+ * oper: 'IN',
2763
+ * values: ["atlanta"]
2764
+ * },
2765
+ * {
2766
+ * column: "(Sample) Retail - Apparel::Region",
2767
+ * oper: 'IN',
2768
+ * values: ["West","Midwest"]
2769
+ * }]
2770
+ * });
2771
+ * ```
2738
2772
  * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
2739
2773
  */
2740
2774
  HostEvent["UpdateFilters"] = "updateFilters";
@@ -2794,8 +2828,17 @@
2794
2828
  /**
2795
2829
  * Get the Answer session for a Search or
2796
2830
  * Liveboard visualization.
2831
+ *
2832
+ * Note: This event is not typically used directly. Instead, use the
2833
+ * `getAnswerService()` method on the embed instance to get an AnswerService
2834
+ * object that provides a more convenient interface for working with answers.
2835
+ *
2797
2836
  * @example
2798
2837
  * ```js
2838
+ * // Preferred way to get an AnswerService
2839
+ * const service = await embed.getAnswerService();
2840
+ *
2841
+ * // Alternative direct usage (not recommended)
2799
2842
  * const {session} = await embed.trigger(
2800
2843
  * HostEvent.GetAnswerSession, {
2801
2844
  * vizId: '123', // For Liveboard Visualization.
@@ -2803,6 +2846,10 @@
2803
2846
  * ```
2804
2847
  * @example
2805
2848
  * ```js
2849
+ * // Preferred way to get an AnswerService
2850
+ * const service = await embed.getAnswerService();
2851
+ *
2852
+ * // Alternative direct usage (not recommended)
2806
2853
  * const {session} = await embed.trigger( HostEvent.GetAnswerSession )
2807
2854
  * ```
2808
2855
  * @version SDK: 1.26.0 | ThoughtSpot: 9.10.0.cl, 10.1.0.sw
@@ -3011,6 +3058,10 @@
3011
3058
  Param["ShowInsertToSlide"] = "insertInToSlide";
3012
3059
  Param["PrimaryNavHidden"] = "primaryNavHidden";
3013
3060
  Param["HideProfleAndHelp"] = "profileAndHelpInNavBarHidden";
3061
+ Param["NavigationVersion"] = "navigationVersion";
3062
+ Param["HideHamburger"] = "hideHamburger";
3063
+ Param["HideObjectSearch"] = "hideObjectSearch";
3064
+ Param["HideNotification"] = "hideNotification";
3014
3065
  Param["HideApplicationSwitcher"] = "applicationSwitcherHidden";
3015
3066
  Param["HideOrgSwitcher"] = "orgSwitcherHidden";
3016
3067
  Param["IsSageEmbed"] = "isSageEmbed";
@@ -3067,6 +3118,7 @@
3067
3118
  Param["preAuthCache"] = "preAuthCache";
3068
3119
  Param["ShowSpotterLimitations"] = "showSpotterLimitations";
3069
3120
  Param["CoverAndFilterOptionInPDF"] = "coverAndFilterOptionInPDF";
3121
+ Param["PrimaryAction"] = "primaryAction";
3070
3122
  })(Param || (Param = {}));
3071
3123
  /**
3072
3124
  * ThoughtSpot application pages include actions and menu commands
@@ -7304,29 +7356,49 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
7304
7356
  OperationType["GetTableWithHeadlineData"] = "GetTableWithHeadlineData";
7305
7357
  })(OperationType || (OperationType = {}));
7306
7358
  /**
7307
- * Class representing the answer service provided with the
7308
- * custom action payload. This service could be used to run
7309
- * graphql queries in the context of the answer on which the
7310
- * custom action was triggered.
7359
+ * AnswerService provides a simple way to work with ThoughtSpot Answers.
7360
+ *
7361
+ * This service allows you to interact with ThoughtSpot Answers programmatically,
7362
+ * making it easy to customize visualizations, filter data, and extract insights
7363
+ * directly from your application.
7364
+ *
7365
+ * You can use this service to:
7366
+ * - Add or remove columns from Answers (`addColumns`, `removeColumns`, `addColumnsByName`)
7367
+ * - Apply filters to Answers (`addFilter`)
7368
+ * - Get data from Answers in different formats (JSON, CSV, PNG) (`fetchData`, `fetchCSVBlob`, `fetchPNGBlob`)
7369
+ * - Get data for specific points in visualizations (`getUnderlyingDataForPoint`)
7370
+ * - Run custom queries (`executeQuery`)
7371
+ * - Add visualizations to liveboards (`addDisplayedVizToLiveboard`)
7372
+ *
7311
7373
  * @example
7312
7374
  * ```js
7313
- * embed.on(EmbedEvent.CustomAction, e => {
7314
- * const underlying = await e.answerService.getUnderlyingDataForPoint([
7315
- * 'col name 1'
7316
- * ]);
7317
- * const data = await underlying.fetchData(0, 100);
7318
- * })
7375
+ * // Get the answer service
7376
+ * embed.on(EmbedEvent.Data, async (e) => {
7377
+ * const service = await embed.getAnswerService();
7378
+ *
7379
+ * // Add columns to the answer
7380
+ * await service.addColumnsByName(["Sales", "Region"]);
7381
+ *
7382
+ * // Get the data
7383
+ * const data = await service.fetchData();
7384
+ * console.log(data);
7385
+ * });
7319
7386
  * ```
7387
+ *
7320
7388
  * @example
7321
7389
  * ```js
7322
- * embed.on(EmbedEvent.Data, async (e) => {
7323
- * const service = await embed.getAnswerService();
7324
- * await service.addColumns([
7325
- * "<column guid>"
7390
+ * // Get data for a point in a visualization
7391
+ * embed.on(EmbedEvent.CustomAction, async (e) => {
7392
+ * const underlying = await e.answerService.getUnderlyingDataForPoint([
7393
+ * 'Product Name',
7394
+ * 'Sales Amount'
7326
7395
  * ]);
7327
- * console.log(await service.fetchData());
7396
+ *
7397
+ * const data = await underlying.fetchData(0, 100);
7398
+ * console.log(data);
7328
7399
  * });
7329
7400
  * ```
7401
+ *
7330
7402
  * @version SDK: 1.25.0| ThoughtSpot: 9.10.0.cl
7331
7403
  * @group Events
7332
7404
  */
@@ -14589,6 +14661,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14589
14661
  AuthFailureType["EXPIRY"] = "EXPIRY";
14590
14662
  AuthFailureType["OTHER"] = "OTHER";
14591
14663
  AuthFailureType["IDLE_SESSION_TIMEOUT"] = "IDLE_SESSION_TIMEOUT";
14664
+ AuthFailureType["UNAUTHENTICATED_FAILURE"] = "UNAUTHENTICATED_FAILURE";
14592
14665
  })(AuthFailureType || (AuthFailureType = {}));
14593
14666
  /**
14594
14667
  * Enum for auth status emitted by the emitter returned from {@link init}.
@@ -14624,6 +14697,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14624
14697
  * @version SDK: 1.19.0
14625
14698
  */
14626
14699
  AuthStatus["WAITING_FOR_POPUP"] = "WAITING_FOR_POPUP";
14700
+ /**
14701
+ * Emitted when the SAML popup is closed without authentication
14702
+ */
14703
+ AuthStatus["SAML_POPUP_CLOSED_NO_AUTH"] = "SAML_POPUP_CLOSED_NO_AUTH";
14627
14704
  })(AuthStatus || (AuthStatus = {}));
14628
14705
  /**
14629
14706
  * Events which can be triggered on the emitter returned from {@link init}.
@@ -14844,14 +14921,26 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14844
14921
  * @param triggerText
14845
14922
  */
14846
14923
  async function samlPopupFlow(ssoURL, triggerContainer, triggerText) {
14924
+ let popupClosedCheck;
14847
14925
  const openPopup = () => {
14848
14926
  if (samlAuthWindow === null || samlAuthWindow.closed) {
14849
14927
  samlAuthWindow = window.open(ssoURL, '_blank', 'location=no,height=570,width=520,scrollbars=yes,status=yes');
14928
+ if (samlAuthWindow) {
14929
+ popupClosedCheck = setInterval(() => {
14930
+ if (samlAuthWindow.closed) {
14931
+ clearInterval(popupClosedCheck);
14932
+ if (samlCompletionPromise && !samlCompletionResolved) {
14933
+ authEE === null || authEE === void 0 ? void 0 : authEE.emit(AuthStatus.SAML_POPUP_CLOSED_NO_AUTH);
14934
+ }
14935
+ }
14936
+ }, 500);
14937
+ }
14850
14938
  }
14851
14939
  else {
14852
14940
  samlAuthWindow.focus();
14853
14941
  }
14854
14942
  };
14943
+ let samlCompletionResolved = false;
14855
14944
  authEE === null || authEE === void 0 ? void 0 : authEE.emit(AuthStatus.WAITING_FOR_POPUP);
14856
14945
  const containerEl = getDOMNode(triggerContainer);
14857
14946
  if (containerEl) {
@@ -14863,6 +14952,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14863
14952
  samlCompletionPromise = samlCompletionPromise || new Promise((resolve, reject) => {
14864
14953
  window.addEventListener('message', (e) => {
14865
14954
  if (e.data.type === exports.EmbedEvent.SAMLComplete) {
14955
+ samlCompletionResolved = true;
14956
+ if (popupClosedCheck) {
14957
+ clearInterval(popupClosedCheck);
14958
+ }
14866
14959
  e.source.close();
14867
14960
  resolve();
14868
14961
  }
@@ -15039,6 +15132,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15039
15132
  iFrame.style.width = '0';
15040
15133
  iFrame.style.height = '0';
15041
15134
  iFrame.style.border = '0';
15135
+ // Make it 'fixed' to keep it in a different stacking context.
15136
+ // This should solve the focus behaviours inside the iframe from
15137
+ // interfering with main body.
15138
+ iFrame.style.position = 'fixed';
15139
+ // Push it out of viewport.
15140
+ iFrame.style.top = '100vh';
15141
+ iFrame.style.left = '100vw';
15042
15142
  iFrame.classList.add('prefetchIframe');
15043
15143
  iFrame.classList.add(`prefetchIframeNum-${index}`);
15044
15144
  document.body.appendChild(iFrame);
@@ -15215,15 +15315,17 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15215
15315
  * @param containerEl
15216
15316
  */
15217
15317
  function processAuthFailure(e, containerEl) {
15318
+ var _a;
15218
15319
  const { loginFailedMessage, authType, disableLoginFailurePage, autoLogin, } = getEmbedConfig();
15219
- if (autoLogin
15220
- && (authType === AuthType.TrustedAuthToken
15221
- || authType === AuthType.TrustedAuthTokenCookieless)) {
15320
+ const isEmbeddedSSO = authType === AuthType.EmbeddedSSO;
15321
+ const isTrustedAuth = authType === AuthType.TrustedAuthToken || authType === AuthType.TrustedAuthTokenCookieless;
15322
+ const isEmbeddedSSOInfoFailure = isEmbeddedSSO && ((_a = e === null || e === void 0 ? void 0 : e.data) === null || _a === void 0 ? void 0 : _a.type) === AuthFailureType.UNAUTHENTICATED_FAILURE;
15323
+ if (autoLogin && isTrustedAuth) {
15222
15324
  // eslint-disable-next-line no-param-reassign
15223
15325
  containerEl.innerHTML = loginFailedMessage;
15224
15326
  notifyAuthFailure(AuthFailureType.IDLE_SESSION_TIMEOUT);
15225
15327
  }
15226
- else if (authType !== AuthType.None && !disableLoginFailurePage) {
15328
+ else if (authType !== AuthType.None && !disableLoginFailurePage && !isEmbeddedSSOInfoFailure) {
15227
15329
  // eslint-disable-next-line no-param-reassign
15228
15330
  containerEl.innerHTML = loginFailedMessage;
15229
15331
  notifyAuthFailure(AuthFailureType.OTHER);
@@ -15268,7 +15370,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15268
15370
  return e;
15269
15371
  }
15270
15372
 
15271
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.37.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={classnames:"^2.3.1",eventemitter3:"^4.0.7",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":"^8.28.0","@typescript-eslint/parser":"^8.28.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:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.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",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","typescript-eslint":"^8.29.1","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};
15373
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.37.1";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","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={classnames:"^2.3.1",eventemitter3:"^4.0.7",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":"^8.28.0","@typescript-eslint/parser":"^8.28.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:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.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",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","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};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};
15272
15374
 
15273
15375
  /**
15274
15376
  * Reloads the ThoughtSpot iframe.
@@ -15502,11 +15604,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15502
15604
  * @param responder
15503
15605
  */
15504
15606
  this.updateAuthToken = async (_, responder) => {
15505
- const { autoLogin = false, authType } = this.embedConfig; // Set autoLogin default to false
15506
- if (authType === AuthType.TrustedAuthTokenCookieless) {
15507
- let authToken = '';
15607
+ const { authType } = this.embedConfig;
15608
+ let { autoLogin } = this.embedConfig;
15609
+ // Default autoLogin: true for cookieless if undefined/null, otherwise false
15610
+ autoLogin = autoLogin !== null && autoLogin !== void 0 ? autoLogin : (authType === AuthType.TrustedAuthTokenCookieless);
15611
+ if (autoLogin && authType === AuthType.TrustedAuthTokenCookieless) {
15508
15612
  try {
15509
- authToken = await getAuthenticationToken(this.embedConfig);
15613
+ const authToken = await getAuthenticationToken(this.embedConfig);
15510
15614
  responder({
15511
15615
  type: exports.EmbedEvent.AuthExpire,
15512
15616
  data: { authToken },
@@ -15805,7 +15909,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15805
15909
  if (this.embedConfig.currencyFormat) {
15806
15910
  queryParams[Param.CurrencyFormat] = this.embedConfig.currencyFormat;
15807
15911
  }
15808
- const { disabledActions, disabledActionReason, hiddenActions, visibleActions, hiddenTabs, visibleTabs, showAlerts, additionalFlags: additionalFlagsFromView, locale, customizations, contextMenuTrigger, linkOverride, insertInToSlide, disableRedirectionLinksInNewTab, overrideOrgId, exposeTranslationIDs, } = this.viewConfig;
15912
+ const { disabledActions, disabledActionReason, hiddenActions, visibleActions, hiddenTabs, visibleTabs, showAlerts, additionalFlags: additionalFlagsFromView, locale, customizations, contextMenuTrigger, linkOverride, insertInToSlide, disableRedirectionLinksInNewTab, overrideOrgId, exposeTranslationIDs, primaryAction, } = this.viewConfig;
15809
15913
  const { additionalFlags: additionalFlagsFromInit } = this.embedConfig;
15810
15914
  const additionalFlags = {
15811
15915
  ...additionalFlagsFromInit,
@@ -15819,6 +15923,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15819
15923
  this.handleError('You cannot have both hidden Tabs and visible Tabs');
15820
15924
  return queryParams;
15821
15925
  }
15926
+ if (primaryAction) {
15927
+ queryParams[Param.PrimaryAction] = primaryAction;
15928
+ }
15822
15929
  if (disabledActions === null || disabledActions === void 0 ? void 0 : disabledActions.length) {
15823
15930
  queryParams[Param.DisableActions] = disabledActions;
15824
15931
  }
@@ -16983,6 +17090,31 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16983
17090
  HomePageSearchBarMode["AI_ANSWER"] = "aiAnswer";
16984
17091
  HomePageSearchBarMode["NONE"] = "none";
16985
17092
  })(HomePageSearchBarMode || (HomePageSearchBarMode = {}));
17093
+ /**
17094
+ * Define the version of the primary navbar
17095
+ * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
17096
+ */
17097
+ var PrimaryNavbarVersion;
17098
+ (function (PrimaryNavbarVersion) {
17099
+ /**
17100
+ * Sliding (v3) introduces a new left-side navigation hub featuring a tab switcher,
17101
+ * along with updates to the top navigation bar.
17102
+ * It serves as the foundational version of the PrimaryNavBar.
17103
+ */
17104
+ PrimaryNavbarVersion["Sliding"] = "v3";
17105
+ })(PrimaryNavbarVersion || (PrimaryNavbarVersion = {}));
17106
+ /**
17107
+ * Define the version of the home page
17108
+ * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
17109
+ */
17110
+ var HomePage;
17111
+ (function (HomePage) {
17112
+ /**
17113
+ * Modular (v2) introduces the updated Modular Home Experience.
17114
+ * It serves as the foundational version of the home page.
17115
+ */
17116
+ HomePage["Modular"] = "v2";
17117
+ })(HomePage || (HomePage = {}));
16986
17118
  /**
16987
17119
  * Embeds full ThoughtSpot experience in a host application.
16988
17120
  * @group Embed components
@@ -17037,9 +17169,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17037
17169
  * embedded Liveboard or visualization.
17038
17170
  */
17039
17171
  getEmbedParams() {
17040
- const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
17172
+ const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
17041
17173
  /* eslint-disable-next-line max-len */
17042
- dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, } = this.viewConfig;
17174
+ dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, } = this.viewConfig;
17043
17175
  let params = {};
17044
17176
  params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
17045
17177
  params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
@@ -17056,6 +17188,15 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17056
17188
  params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
17057
17189
  params[Param.IsUnifiedSearchExperienceEnabled] = isUnifiedSearchExperienceEnabled;
17058
17190
  params = this.getBaseQueryParams(params);
17191
+ if (hideObjectSearch) {
17192
+ params[Param.HideObjectSearch] = !!hideObjectSearch;
17193
+ }
17194
+ if (hideHamburger) {
17195
+ params[Param.HideHamburger] = !!hideHamburger;
17196
+ }
17197
+ if (hideNotification) {
17198
+ params[Param.HideNotification] = !!hideNotification;
17199
+ }
17059
17200
  if (fullHeight === true) {
17060
17201
  params[Param.fullHeight] = true;
17061
17202
  }
@@ -17103,6 +17244,17 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17103
17244
  /* eslint-disable-next-line max-len */
17104
17245
  params[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
17105
17246
  }
17247
+ if (discoveryExperience) {
17248
+ // primaryNavbarVersion v3 will enabled the new left navigation
17249
+ if (discoveryExperience.primaryNavbarVersion === PrimaryNavbarVersion.Sliding) {
17250
+ params[Param.NavigationVersion] = discoveryExperience.primaryNavbarVersion;
17251
+ }
17252
+ // homePage v2 will enable the modular home page
17253
+ // and it will override the modularHomeExperience value
17254
+ if (discoveryExperience.homePage === HomePage.Modular) {
17255
+ params[Param.ModularHomeExperienceEnabled] = true;
17256
+ }
17257
+ }
17106
17258
  const queryParams = getQueryParamString(params, true);
17107
17259
  return queryParams;
17108
17260
  }