@thoughtspot/visual-embed-sdk 1.45.3 → 1.46.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 (50) hide show
  1. package/cjs/package.json +1 -1
  2. package/cjs/src/auth.d.ts +35 -2
  3. package/cjs/src/auth.d.ts.map +1 -1
  4. package/cjs/src/auth.js +35 -2
  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 +5 -5
  8. package/cjs/src/embed/app.js.map +1 -1
  9. package/cjs/src/embed/app.spec.js +87 -119
  10. package/cjs/src/embed/app.spec.js.map +1 -1
  11. package/cjs/src/embed/conversation.d.ts +1 -1
  12. package/cjs/src/types.d.ts +56 -52
  13. package/cjs/src/types.d.ts.map +1 -1
  14. package/cjs/src/types.js +55 -51
  15. package/cjs/src/types.js.map +1 -1
  16. package/dist/{index-BuwECGdm.js → index-BQvLEoxp.js} +1 -1
  17. package/dist/src/auth.d.ts +35 -2
  18. package/dist/src/auth.d.ts.map +1 -1
  19. package/dist/src/embed/app.d.ts.map +1 -1
  20. package/dist/src/embed/conversation.d.ts +1 -1
  21. package/dist/src/types.d.ts +56 -52
  22. package/dist/src/types.d.ts.map +1 -1
  23. package/dist/tsembed-react.es.js +98 -61
  24. package/dist/tsembed-react.js +97 -60
  25. package/dist/tsembed.es.js +98 -61
  26. package/dist/tsembed.js +97 -60
  27. package/dist/visual-embed-sdk-react-full.d.ts +92 -55
  28. package/dist/visual-embed-sdk-react.d.ts +90 -53
  29. package/dist/visual-embed-sdk.d.ts +92 -55
  30. package/lib/package.json +1 -1
  31. package/lib/src/auth.d.ts +35 -2
  32. package/lib/src/auth.d.ts.map +1 -1
  33. package/lib/src/auth.js +35 -2
  34. package/lib/src/auth.js.map +1 -1
  35. package/lib/src/embed/app.d.ts.map +1 -1
  36. package/lib/src/embed/app.js +5 -5
  37. package/lib/src/embed/app.js.map +1 -1
  38. package/lib/src/embed/app.spec.js +87 -119
  39. package/lib/src/embed/app.spec.js.map +1 -1
  40. package/lib/src/embed/conversation.d.ts +1 -1
  41. package/lib/src/types.d.ts +56 -52
  42. package/lib/src/types.d.ts.map +1 -1
  43. package/lib/src/types.js +55 -51
  44. package/lib/src/types.js.map +1 -1
  45. package/package.json +1 -1
  46. package/src/auth.ts +35 -2
  47. package/src/embed/app.spec.ts +171 -211
  48. package/src/embed/app.ts +15 -10
  49. package/src/embed/conversation.ts +1 -1
  50. package/src/types.ts +57 -53
package/src/embed/app.ts CHANGED
@@ -60,7 +60,7 @@ export enum Page {
60
60
  /**
61
61
  * Monitor Alerts Page
62
62
  */
63
- Monitor = 'monitor'
63
+ Monitor = 'monitor',
64
64
  }
65
65
 
66
66
  /**
@@ -230,7 +230,7 @@ export interface AppViewConfig extends AllEmbedViewConfig {
230
230
  * });
231
231
  * ```
232
232
  */
233
- enablePendoHelp?: boolean
233
+ enablePendoHelp?: boolean;
234
234
  /**
235
235
  * Control the visibility of the hamburger icon on
236
236
  * the top navigation bar in the V3 navigation experience.
@@ -740,7 +740,6 @@ export class AppEmbed extends V1Embed {
740
740
 
741
741
  private defaultHeight = 500;
742
742
 
743
-
744
743
  constructor(domSelector: DOMSelector, viewConfig: AppViewConfig) {
745
744
  viewConfig.embedComponentType = 'AppEmbed';
746
745
  super(domSelector, viewConfig);
@@ -748,7 +747,10 @@ export class AppEmbed extends V1Embed {
748
747
  this.on(EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
749
748
  this.on(EmbedEvent.EmbedHeight, this.updateIFrameHeight);
750
749
  this.on(EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
751
- this.on(EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
750
+ this.on(
751
+ EmbedEvent.RequestVisibleEmbedCoordinates,
752
+ this.requestVisibleEmbedCoordinatesHandler,
753
+ );
752
754
  }
753
755
  }
754
756
 
@@ -942,7 +944,9 @@ export class AppEmbed extends V1Embed {
942
944
  }
943
945
 
944
946
  if (isLiveboardStylingAndGroupingEnabled !== undefined) {
945
- params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
947
+ params[
948
+ Param.IsLiveboardStylingAndGroupingEnabled
949
+ ] = isLiveboardStylingAndGroupingEnabled;
946
950
  }
947
951
 
948
952
  if (isPNGInScheduledEmailsEnabled !== undefined) {
@@ -996,6 +1000,10 @@ export class AppEmbed extends V1Embed {
996
1000
  params[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
997
1001
  }
998
1002
 
1003
+ if (modularHomeExperience !== undefined) {
1004
+ params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
1005
+ }
1006
+
999
1007
  // Set navigation to v2 by default to avoid problems like the app
1000
1008
  // switcher (9-dot menu) not showing when v3 navigation is turned on
1001
1009
  // at the cluster level.
@@ -1005,9 +1013,6 @@ export class AppEmbed extends V1Embed {
1005
1013
  // Set homePageVersion to v2 by default to reset the LD flag value
1006
1014
  // for the homepageVersion.
1007
1015
  params[Param.HomepageVersion] = 'v2';
1008
- // Set listpageVersion to v2 by default to reset the LD flag value
1009
- // for the listpageVersion.
1010
- params[Param.ListPageVersion] = ListPage.List;
1011
1016
  if (discoveryExperience) {
1012
1017
  // primaryNavbarVersion v3 will enabled the new left navigation
1013
1018
  if (discoveryExperience.primaryNavbarVersion === PrimaryNavbarVersion.Sliding) {
@@ -1029,8 +1034,8 @@ export class AppEmbed extends V1Embed {
1029
1034
  params[Param.HomepageVersion] = HomePage.ModularWithStylingChanges;
1030
1035
  }
1031
1036
 
1032
- // listPageVersion v3 will enable the new list page
1033
- if (discoveryExperience.listPageVersion === ListPage.ListWithUXChanges) {
1037
+ // listPageVersion can be changed to v2 or v3
1038
+ if (discoveryExperience.listPageVersion !== undefined) {
1034
1039
  params[Param.ListPageVersion] = discoveryExperience.listPageVersion;
1035
1040
  }
1036
1041
  }
@@ -162,7 +162,7 @@ export interface SpotterEmbedViewConfig extends Omit<BaseViewConfig, 'primaryAct
162
162
  *
163
163
  * Supported embed types: `SageEmbed`, `AppEmbed`, `SearchBarEmbed`, `LiveboardEmbed`, `SearchEmbed`
164
164
  * @default true
165
- * @version SDK: 1.41.1 | ThoughtSpot Cloud: 10.14.0.cl
165
+ * @deprecated from SDK 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
166
166
  * @example
167
167
  * ```js
168
168
  * // Replace <EmbedComponent> with embed component name. For example, SageEmbed, AppEmbed, or SearchBarEmbed
package/src/types.ts CHANGED
@@ -1361,7 +1361,7 @@ export interface SearchLiveboardCommonViewConfig {
1361
1361
  *
1362
1362
  * Supported embed types: `SageEmbed`, `AppEmbed`, `SearchBarEmbed`, `LiveboardEmbed`, `SearchEmbed`
1363
1363
  * @default true
1364
- * @version SDK: 1.41.1 | ThoughtSpot Cloud: 10.14.0.cl
1364
+ * @deprecated from SDK 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
1365
1365
  * @example
1366
1366
  * ```js
1367
1367
  * // Replace <EmbedComponent> with embed component name. For example, SageEmbed, AppEmbed, or SearchBarEmbed
@@ -2859,65 +2859,69 @@ export enum EmbedEvent {
2859
2859
  Rename = 'rename',
2860
2860
  /**
2861
2861
  *
2862
- * This event can be emitted to intercept search execution initiated by
2863
- * users and implement logic to allow or restrict search execution.
2864
- * You can also show custom error text if the search query must be
2865
- * restricted due to your application or business requirements.
2866
-
2867
- * Prerequisite: Set `isOnBeforeGetVizDataInterceptEnabled` to `true`
2868
- * for this embed event to get emitted.
2869
- * @param - Includes the following event listener parameters:
2862
+ * This event allows developers to intercept search execution
2863
+ * and implement logic that decides whether Search Data should return
2864
+ * data or block the search operation.
2865
+ *
2866
+ * **Prerequisite**: Set`isOnBeforeGetVizDataInterceptEnabled` to `true`
2867
+ * to ensure that `EmbedEvent.OnBeforeGetVizDataIntercept` is emitted
2868
+ * when the embedding application user tries to run a search query.
2869
+ *
2870
+ * This framework applies only to `AppEmbed` and `SearchEmbed`.
2871
+ * @param - Includes the following parameters:
2870
2872
  * - `payload`: The payload received from the embed related to the Data API call.
2871
2873
  * - `responder`: Contains elements that let developers define whether ThoughtSpot
2872
- * should run the search, and if not, what error message
2873
- * should be shown to the user.
2874
+ * will run or block the search operation, and if blocked, which error message to provide.
2874
2875
  *
2875
- * `execute` - When `execute` returns `true`, the search will be run.
2876
- * When `execute` returns `false`, the search will not be executed.
2876
+ * `execute` - When `execute` returns `true`, the search is run.
2877
+ * When `execute` returns `false`, the search is not executed.
2877
2878
  *
2878
- * `error` - Developers can customize the error message text when `execute`
2879
- * is `false` using the `errorText` and `errorDescription` parameters in responder.
2880
- *
2881
- * `errorText` - The error message text to be shown to the user.
2882
- * `errorDescription (ThoughtSpot: 10.15.0.cl and above)` - The error description to be shown to the user.
2879
+ * `error` - Developers can customize the user-facing error message when `execute`
2880
+ * is `false` by using the `error` parameters in `responder`.
2881
+ * `errorText` - The error message text shown to the user.
2883
2882
  * @version SDK : 1.29.0 | ThoughtSpot: 10.3.0.cl
2884
2883
  * @example
2885
- *```js
2886
- * embed.on(EmbedEvent.OnBeforeGetVizDataIntercept,
2887
- * (payload, responder) => {
2888
- * responder({
2889
- * data: {
2890
- * execute:false,
2891
- * error: {
2892
- * //Provide a custom error message to explain to your end user
2893
- * //why their search did not run
2894
- * errorText: "This search query cannot be run.
2895
- * Please contact your administrator for more details."
2896
- * }
2897
- * }})
2898
- * })
2884
+ *
2885
+ * This example blocks search operation and returns a custom error message:
2886
+ * ```js
2887
+ * embed.on(EmbedEvent.OnBeforeGetVizDataIntercept, (payload, responder) => {
2888
+ * responder({
2889
+ * data: {
2890
+ * execute: false,
2891
+ * error: {
2892
+ * // Provide a custom error message to explain why the search did not run.
2893
+ * errorText: 'This search query cannot be run. Please contact your administrator for more details.',
2894
+ * },
2895
+ * },
2896
+ * });
2897
+ * });
2899
2898
  * ```
2899
+ * @example
2900
2900
  *
2901
- *```js
2902
- * embed.on(EmbedEvent.OnBeforeGetVizDataIntercept,
2903
- * (payload, responder) => {
2904
- * const query = payload.data.data.answer.search_query
2905
- * responder({
2906
- * data: {
2907
- * // returns true as long as the query does not include
2908
- * // both the 'sales' AND the 'county' column
2909
- * execute: !(query.includes("sales")&&query.includes("county")),
2910
- * error: {
2911
- * //Provide a custom error message to explain to your end user
2912
- * // why their search did not run, and which searches are accepted by your custom logic.
2913
- * errorText: "Error Occurred",
2914
- * errorDescription: "You can't use this query :" + query + ".
2915
- * The 'sales' measures can never be used at the 'county' level.
2916
- * Please try another measure, or remove 'county' from your search."
2917
- * }
2918
- * }})
2919
- * })
2920
- *```
2901
+ * This example allows the search operation to run
2902
+ * unless the query contains both `sales` and `county`,
2903
+ * and returns a custom error message if the query is rejected:
2904
+ * ```js
2905
+ * embed.on(EmbedEvent.OnBeforeGetVizDataIntercept, (payload, responder) => {
2906
+ * // Record the search query submitted by the end user.
2907
+ * const query = payload.data.data.answer.search_query;
2908
+ *
2909
+ * responder({
2910
+ * data: {
2911
+ * // Returns true as long as the query does not include both `sales` and `county`.
2912
+ * execute: !(query.includes('sales') && query.includes('county')),
2913
+ * error: {
2914
+ * // Provide a custom error message when the query is blocked by your logic.
2915
+ * errorText:
2916
+ * "You can't use this query: "
2917
+ * + query
2918
+ * + ". The 'sales' measure can never be used at the 'county' level. "
2919
+ * + "Please try another measure or remove 'county' from your search.",
2920
+ * },
2921
+ * },
2922
+ * });
2923
+ * });
2924
+ * ```
2921
2925
  */
2922
2926
  OnBeforeGetVizDataIntercept = 'onBeforeGetVizDataIntercept',
2923
2927
  /**
@@ -6907,4 +6911,4 @@ export interface ContextObject {
6907
6911
  type: ContextType;
6908
6912
  objectIds: ObjectIds;
6909
6913
  }
6910
- }
6914
+ }