@thoughtspot/visual-embed-sdk 1.47.1 → 1.47.2

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 (78) hide show
  1. package/cjs/package.json +3 -3
  2. package/cjs/src/embed/app.d.ts +13 -0
  3. package/cjs/src/embed/app.d.ts.map +1 -1
  4. package/cjs/src/embed/app.js +4 -1
  5. package/cjs/src/embed/app.js.map +1 -1
  6. package/cjs/src/embed/app.spec.js +29 -0
  7. package/cjs/src/embed/app.spec.js.map +1 -1
  8. package/cjs/src/embed/hostEventClient/contracts.d.ts +4 -1
  9. package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  10. package/cjs/src/embed/hostEventClient/host-event-client.spec.js +2 -2
  11. package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  12. package/cjs/src/embed/liveboard.d.ts +13 -0
  13. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  14. package/cjs/src/embed/liveboard.js +4 -1
  15. package/cjs/src/embed/liveboard.js.map +1 -1
  16. package/cjs/src/embed/liveboard.spec.js +32 -0
  17. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  18. package/cjs/src/embed/ts-embed.d.ts +13 -1
  19. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  20. package/cjs/src/embed/ts-embed.js +14 -0
  21. package/cjs/src/embed/ts-embed.js.map +1 -1
  22. package/cjs/src/types.d.ts +108 -6
  23. package/cjs/src/types.d.ts.map +1 -1
  24. package/cjs/src/types.js +104 -2
  25. package/cjs/src/types.js.map +1 -1
  26. package/dist/{index-CUgxBnPm.js → index-CFZ7RDZ9.js} +1 -1
  27. package/dist/src/embed/app.d.ts +13 -0
  28. package/dist/src/embed/app.d.ts.map +1 -1
  29. package/dist/src/embed/hostEventClient/contracts.d.ts +4 -1
  30. package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  31. package/dist/src/embed/liveboard.d.ts +13 -0
  32. package/dist/src/embed/liveboard.d.ts.map +1 -1
  33. package/dist/src/embed/ts-embed.d.ts +13 -1
  34. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  35. package/dist/src/types.d.ts +108 -6
  36. package/dist/src/types.d.ts.map +1 -1
  37. package/dist/tsembed-react.es.js +131 -9
  38. package/dist/tsembed-react.js +130 -8
  39. package/dist/tsembed.es.js +131 -9
  40. package/dist/tsembed.js +130 -8
  41. package/dist/visual-embed-sdk-react-full.d.ts +147 -6
  42. package/dist/visual-embed-sdk-react.d.ts +147 -6
  43. package/dist/visual-embed-sdk.d.ts +147 -6
  44. package/lib/package.json +3 -3
  45. package/lib/src/embed/app.d.ts +13 -0
  46. package/lib/src/embed/app.d.ts.map +1 -1
  47. package/lib/src/embed/app.js +4 -1
  48. package/lib/src/embed/app.js.map +1 -1
  49. package/lib/src/embed/app.spec.js +29 -0
  50. package/lib/src/embed/app.spec.js.map +1 -1
  51. package/lib/src/embed/hostEventClient/contracts.d.ts +4 -1
  52. package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  53. package/lib/src/embed/hostEventClient/host-event-client.spec.js +2 -2
  54. package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  55. package/lib/src/embed/liveboard.d.ts +13 -0
  56. package/lib/src/embed/liveboard.d.ts.map +1 -1
  57. package/lib/src/embed/liveboard.js +4 -1
  58. package/lib/src/embed/liveboard.js.map +1 -1
  59. package/lib/src/embed/liveboard.spec.js +32 -0
  60. package/lib/src/embed/liveboard.spec.js.map +1 -1
  61. package/lib/src/embed/ts-embed.d.ts +13 -1
  62. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  63. package/lib/src/embed/ts-embed.js +14 -0
  64. package/lib/src/embed/ts-embed.js.map +1 -1
  65. package/lib/src/types.d.ts +108 -6
  66. package/lib/src/types.d.ts.map +1 -1
  67. package/lib/src/types.js +104 -2
  68. package/lib/src/types.js.map +1 -1
  69. package/lib/src/visual-embed-sdk.d.ts +147 -6
  70. package/package.json +3 -3
  71. package/src/embed/app.spec.ts +38 -0
  72. package/src/embed/app.ts +18 -0
  73. package/src/embed/hostEventClient/contracts.ts +2 -1
  74. package/src/embed/hostEventClient/host-event-client.spec.ts +2 -2
  75. package/src/embed/liveboard.spec.ts +41 -0
  76. package/src/embed/liveboard.ts +18 -0
  77. package/src/embed/ts-embed.ts +15 -0
  78. package/src/types.ts +107 -2
@@ -4563,7 +4563,54 @@ export enum EmbedEvent {
4563
4563
  * ```
4564
4564
  * @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl
4565
4565
  */
4566
- RefreshAuthToken = "RefreshAuthToken"
4566
+ RefreshAuthToken = "RefreshAuthToken",
4567
+ /**
4568
+ * Triggered whenever the page context changes, returning the current context along with the navigation stack.
4569
+ * @example
4570
+ * ```js
4571
+ * embed.on(EmbedEvent.EmbedPageContextChanged, (payload) => {
4572
+ * console.log('payload', payload);
4573
+ * })
4574
+ * ```
4575
+ * @version SDK: 1.47.2 | ThoughtSpot: 26.3.0.cl
4576
+ */
4577
+ EmbedPageContextChanged = "EmbedPageContextChanged",
4578
+ /**
4579
+ * Represents a special embed event that is triggered whenever any host event is subscribed.
4580
+ *
4581
+ * You can listen to this event when you need to dispatch a host event during load or render,
4582
+ * particularly in situations where timing issues may occur.
4583
+ *
4584
+ * @example
4585
+ * ```js
4586
+ * embed.on(`${HostEvent.Save} Subscribed`, () => {
4587
+ * // make action
4588
+ * });
4589
+ * ```
4590
+ *
4591
+ * @example
4592
+ * ```js
4593
+ * embed.on(subscribedEvent(HostEvent.Save), () => {
4594
+ * // make action
4595
+ * });
4596
+ * ```
4597
+ * @version SDK: 1.48.0 | ThoughtSpot: 26.4.0.cl
4598
+ */
4599
+ Subscribed = "Subscribed",
4600
+ /**
4601
+ * Emitted when a user clicks the **Send Test Email** button in the
4602
+ * Liveboard schedule modal. Requires `isSendNowLiveboardSchedulingEnabled`
4603
+ * to be enabled.
4604
+ * @example
4605
+ * ```js
4606
+ * liveboardEmbed.on(EmbedEvent.SendTestScheduleEmail, (payload) => {
4607
+ * console.log('Send test email', payload);
4608
+ * // payload: { liveboardId: string, sendToSelf: boolean }
4609
+ * })
4610
+ * ```
4611
+ * @version SDK: 1.48.0 | ThoughtSpot Cloud: 26.5.0.cl
4612
+ */
4613
+ SendTestScheduleEmail = "sendTestScheduleEmail"
4567
4614
  }
4568
4615
  /**
4569
4616
  * Event types that can be triggered by the host application
@@ -6261,7 +6308,8 @@ export enum HostEvent {
6261
6308
  * ```js
6262
6309
  * // Get parameters from liveboard context
6263
6310
  * import { ContextType } from '@thoughtspot/visual-embed-sdk';
6264
- * liveboardEmbed.trigger(HostEvent.GetParameters, {}, ContextType.Liveboard).then((parameters) => {
6311
+ * liveboardEmbed.trigger(HostEvent.GetParameters, {},
6312
+ * ContextType.Liveboard).then((parameters) => {
6265
6313
  * console.log('parameters', parameters);
6266
6314
  * });
6267
6315
  * ```
@@ -6612,7 +6660,27 @@ export enum HostEvent {
6612
6660
  * ```
6613
6661
  * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
6614
6662
  */
6615
- GetPageContext = "GetPageContext"
6663
+ GetPageContext = "GetPageContext",
6664
+ /**
6665
+ * Trigger the **Send Test Email** action in the Liveboard schedule modal.
6666
+ * Sends a test schedule email to self or all recipients.
6667
+ * Requires `isSendNowLiveboardSchedulingEnabled` to be enabled.
6668
+ * @example
6669
+ * ```js
6670
+ * liveboardEmbed.trigger(HostEvent.SendTestScheduleEmail, {
6671
+ * sendToSelf: true,
6672
+ * })
6673
+ * ```
6674
+ * @example
6675
+ * ```js
6676
+ * // Send to all recipients
6677
+ * liveboardEmbed.trigger(HostEvent.SendTestScheduleEmail, {
6678
+ * sendToSelf: false,
6679
+ * })
6680
+ * ```
6681
+ * @version SDK: 1.48.0 | ThoughtSpot Cloud: 26.5.0.cl
6682
+ */
6683
+ SendTestScheduleEmail = "sendTestScheduleEmail"
6616
6684
  }
6617
6685
  /**
6618
6686
  * The different visual modes that the data sources panel within
@@ -6951,7 +7019,7 @@ export enum Action {
6951
7019
  * ```js
6952
7020
  * disabledActions: [Action.DownloadLiveboard]
6953
7021
  * ```
6954
- * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
7022
+ * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
6955
7023
  */
6956
7024
  DownloadLiveboard = "downloadLiveboard",
6957
7025
  /**
@@ -6964,6 +7032,26 @@ export enum Action {
6964
7032
  * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
6965
7033
  */
6966
7034
  DownloadLiveboardAsContinuousPDF = "downloadLiveboardAsContinuousPDF",
7035
+ /**
7036
+ * The **Download Liveboard as XLSX** menu action on a Liveboard.
7037
+ * Allows downloading the entire Liveboard as an XLSX file.
7038
+ * @example
7039
+ * ```js
7040
+ * disabledActions: [Action.DownloadLiveboardAsXlsx]
7041
+ * ```
7042
+ * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
7043
+ */
7044
+ DownloadLiveboardAsXlsx = "downloadLiveboardAsXlsx",
7045
+ /**
7046
+ * The **Download Liveboard as CSV** menu action on a Liveboard.
7047
+ * Allows downloading the entire Liveboard as a CSV file.
7048
+ * @example
7049
+ * ```js
7050
+ * disabledActions: [Action.DownloadLiveboardAsCsv]
7051
+ * ```
7052
+ * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
7053
+ */
7054
+ DownloadLiveboardAsCsv = "downloadLiveboardAsCsv",
6967
7055
  /**
6968
7056
  * @hidden
6969
7057
  */
@@ -8223,7 +8311,19 @@ export enum Action {
8223
8311
  * ```
8224
8312
  * @version SDK: 1.45.0 | ThoughtSpot: 26.4.0.cl
8225
8313
  */
8226
- IncludeCurrentPeriod = "includeCurrentPeriod"
8314
+ IncludeCurrentPeriod = "includeCurrentPeriod",
8315
+ /**
8316
+ * The **Send Test Email** button in the Liveboard schedule modal.
8317
+ * Allows sending a test schedule email to self or all recipients.
8318
+ * Requires `isSendNowLiveboardSchedulingEnabled` to be enabled.
8319
+ * @example
8320
+ * ```js
8321
+ * disabledActions: [Action.SendTestScheduleEmail]
8322
+ * hiddenActions: [Action.SendTestScheduleEmail]
8323
+ * ```
8324
+ * @version SDK: 1.48.0 | ThoughtSpot Cloud: 26.5.0.cl
8325
+ */
8326
+ SendTestScheduleEmail = "sendTestScheduleEmail"
8227
8327
  }
8228
8328
  export enum PrefetchFeatures {
8229
8329
  FullApp = "FullApp",
@@ -8925,7 +9025,10 @@ export type UIPassthroughContractBase = {
8925
9025
  [UIPassthroughEvent.GetExportRequestForCurrentPinboard]: {
8926
9026
  request: Record<string, never>;
8927
9027
  response: {
8928
- v2Content: string;
9028
+ data: {
9029
+ v2Content: string;
9030
+ };
9031
+ type: UIPassthroughEvent.GetExportRequestForCurrentPinboard;
8929
9032
  };
8930
9033
  };
8931
9034
  [UIPassthroughEvent.UpdateFilters]: {
@@ -9428,6 +9531,18 @@ class TsEmbed {
9428
9531
  * @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl
9429
9532
  */
9430
9533
  getCurrentContext(): Promise<ContextObject>;
9534
+ /**
9535
+ * Generates the event name for a "Subscribed" embed event.
9536
+ *
9537
+ * This helper appends the "Subscribed" suffix to a given host or action event,
9538
+ * allowing you to listen for subscription lifecycle events in a consistent format.
9539
+ *
9540
+ * @param eventName - The host or action event to generate the subscribed event name for.
9541
+ * @returns The formatted event name (e.g., "Save Subscribed").
9542
+ *
9543
+ * @version SDK: 1.47.2 | ThoughtSpot: 26.3.0.cl
9544
+ */
9545
+ subscribedEvent(eventName: HostEvent | Action): string;
9431
9546
  /**
9432
9547
  * Creates the preRender shell
9433
9548
  * @param showPreRenderByDefault - Show the preRender after render, hidden by default
@@ -10694,6 +10809,19 @@ export interface AppViewConfig extends AllEmbedViewConfig {
10694
10809
  * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
10695
10810
  */
10696
10811
  enableHomepageAnnouncement?: boolean;
10812
+ /**
10813
+ * If set to true, enables visualization data caching on the Liveboard.
10814
+ * @type {boolean}
10815
+ * @version SDK: 1.49.0 | ThoughtSpot: 26.6.0.cl
10816
+ * @example
10817
+ * ```js
10818
+ * const embed = new AppEmbed('#tsEmbed', {
10819
+ * ... // other options
10820
+ * enableLiveboardDataCache: true,
10821
+ * })
10822
+ * ```
10823
+ */
10824
+ enableLiveboardDataCache?: boolean;
10697
10825
  }
10698
10826
  /**
10699
10827
  * APP_INIT data shape for AppEmbed.
@@ -11572,6 +11700,19 @@ export interface LiveboardViewConfig extends BaseViewConfig, SearchLiveboardComm
11572
11700
  * ```
11573
11701
  */
11574
11702
  spotterChatConfig?: SpotterChatViewConfig;
11703
+ /**
11704
+ * If set to true, enables visualization data caching on the Liveboard.
11705
+ * @type {boolean}
11706
+ * @version SDK: 1.49.0 | ThoughtSpot: 26.6.0.cl
11707
+ * @example
11708
+ * ```js
11709
+ * const embed = new LiveboardEmbed('#embed-container', {
11710
+ * ... // other options
11711
+ * enableLiveboardDataCache: true,
11712
+ * })
11713
+ * ```
11714
+ */
11715
+ enableLiveboardDataCache?: boolean;
11575
11716
  }
11576
11717
  /**
11577
11718
  * Embed a ThoughtSpot Liveboard or visualization. When rendered it already
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thoughtspot/visual-embed-sdk",
3
- "version": "1.47.1",
3
+ "version": "1.47.2",
4
4
  "description": "ThoughtSpot Embed SDK",
5
5
  "module": "lib/src/index.js",
6
6
  "main": "dist/tsembed.js",
@@ -70,7 +70,7 @@
70
70
  "dependencies": {
71
71
  "classnames": "^2.3.1",
72
72
  "eventemitter3": "^4.0.7",
73
- "lodash": "^4.17.23",
73
+ "lodash": "^4.18.1",
74
74
  "mixpanel-browser": "2.47.0",
75
75
  "ts-deepmerge": "^6.0.2",
76
76
  "tslib": "^2.5.3",
@@ -126,7 +126,7 @@
126
126
  "jest-environment-jsdom": "^29.7.0",
127
127
  "jest-fetch-mock": "^3.0.3",
128
128
  "jsdom": "^17.0.0",
129
- "prettier": "2.1.2",
129
+ "prettier": "3.8.1",
130
130
  "react": "^16.14.0",
131
131
  "react-dom": "^16.14.0",
132
132
  "react-resizable": "^1.11.0",
@@ -1208,6 +1208,44 @@ describe('App embed tests', () => {
1208
1208
  });
1209
1209
  });
1210
1210
 
1211
+ test('should set enableLiveboardDataCache to true in url', async () => {
1212
+ const appEmbed = new AppEmbed(getRootEl(), {
1213
+ ...defaultViewConfig,
1214
+ enableLiveboardDataCache: true,
1215
+ } as AppViewConfig);
1216
+ appEmbed.render();
1217
+ await executeAfterWait(() => {
1218
+ expectUrlMatchesWithParams(
1219
+ getIFrameSrc(),
1220
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableLiveboardDataCache=true${defaultParamsPost}#/home`,
1221
+ );
1222
+ });
1223
+ });
1224
+
1225
+ test('should set enableLiveboardDataCache to false in url', async () => {
1226
+ const appEmbed = new AppEmbed(getRootEl(), {
1227
+ ...defaultViewConfig,
1228
+ enableLiveboardDataCache: false,
1229
+ } as AppViewConfig);
1230
+ appEmbed.render();
1231
+ await executeAfterWait(() => {
1232
+ expectUrlMatchesWithParams(
1233
+ getIFrameSrc(),
1234
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableLiveboardDataCache=false${defaultParamsPost}#/home`,
1235
+ );
1236
+ });
1237
+ });
1238
+
1239
+ test('should not set enableLiveboardDataCache in url when not provided', async () => {
1240
+ const appEmbed = new AppEmbed(getRootEl(), {
1241
+ ...defaultViewConfig,
1242
+ } as AppViewConfig);
1243
+ appEmbed.render();
1244
+ await executeAfterWait(() => {
1245
+ expect(getIFrameSrc()).not.toContain('enableLiveboardDataCache');
1246
+ });
1247
+ });
1248
+
1211
1249
  test('Should add HomePageSearchBarMode flag with object search to the iframe src', async () => {
1212
1250
  const appEmbed = new AppEmbed(getRootEl(), {
1213
1251
  ...defaultViewConfig,
package/src/embed/app.ts CHANGED
@@ -785,6 +785,19 @@ export interface AppViewConfig extends AllEmbedViewConfig {
785
785
  * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
786
786
  */
787
787
  enableHomepageAnnouncement?: boolean;
788
+ /**
789
+ * If set to true, enables visualization data caching on the Liveboard.
790
+ * @type {boolean}
791
+ * @version SDK: 1.49.0 | ThoughtSpot: 26.6.0.cl
792
+ * @example
793
+ * ```js
794
+ * const embed = new AppEmbed('#tsEmbed', {
795
+ * ... // other options
796
+ * enableLiveboardDataCache: true,
797
+ * })
798
+ * ```
799
+ */
800
+ enableLiveboardDataCache?: boolean;
788
801
  }
789
802
 
790
803
  /**
@@ -894,6 +907,7 @@ export class AppEmbed extends V1Embed {
894
907
  isThisPeriodInDateFiltersEnabled,
895
908
  enableHomepageAnnouncement = false,
896
909
  isContinuousLiveboardPDFEnabled,
910
+ enableLiveboardDataCache,
897
911
  } = this.viewConfig;
898
912
 
899
913
  let params: any = {};
@@ -1036,6 +1050,10 @@ export class AppEmbed extends V1Embed {
1036
1050
 
1037
1051
  this.defaultHeight = minimumHeight || this.defaultHeight;
1038
1052
 
1053
+ if (enableLiveboardDataCache !== undefined) {
1054
+ params[Param.EnableLiveboardDataCache] = enableLiveboardDataCache;
1055
+ }
1056
+
1039
1057
  params[Param.DataPanelV2Enabled] = dataPanelV2;
1040
1058
  params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
1041
1059
  params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
@@ -137,7 +137,8 @@ export type UIPassthroughContractBase = {
137
137
  [UIPassthroughEvent.GetExportRequestForCurrentPinboard]: {
138
138
  request: Record<string, never>;
139
139
  response: {
140
- v2Content: string;
140
+ data: { v2Content: string };
141
+ type: UIPassthroughEvent.GetExportRequestForCurrentPinboard;
141
142
  };
142
143
  };
143
144
  [UIPassthroughEvent.UpdateFilters]: {
@@ -494,11 +494,11 @@ describe('HostEventClient', () => {
494
494
  const { client } = createHostEventClient();
495
495
  mockProcessTrigger
496
496
  .mockResolvedValueOnce(mockGetAvailablePassthroughs())
497
- .mockResolvedValueOnce([{ value: { v2Content: 'exportData' } }]);
497
+ .mockResolvedValueOnce([{ value: { data: { v2Content: 'exportData' }, type: 'getExportRequestForCurrentPinboard' } }]);
498
498
 
499
499
  const result = await client.triggerHostEvent(HostEvent.getExportRequestForCurrentPinboard, {});
500
500
 
501
- expect(result).toEqual({ v2Content: 'exportData' });
501
+ expect(result).toEqual({ data: { v2Content: 'exportData' }, type: 'getExportRequestForCurrentPinboard' });
502
502
  });
503
503
 
504
504
  it('should fall back to legacy for GetFilters when passthrough returns null', async () => {
@@ -427,6 +427,47 @@ describe('Liveboard/viz embed tests', () => {
427
427
  });
428
428
  });
429
429
 
430
+ test('should set enableLiveboardDataCache to true in url', async () => {
431
+ const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
432
+ enableLiveboardDataCache: true,
433
+ ...defaultViewConfig,
434
+ liveboardId,
435
+ } as LiveboardViewConfig);
436
+ liveboardEmbed.render();
437
+ await executeAfterWait(() => {
438
+ expectUrlMatchesWithParams(
439
+ getIFrameSrc(),
440
+ `http://${thoughtSpotHost}/?embedApp=true${defaultParams}&enableLiveboardDataCache=true${prefixParams}#/embed/viz/${liveboardId}`,
441
+ );
442
+ });
443
+ });
444
+
445
+ test('should set enableLiveboardDataCache to false in url', async () => {
446
+ const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
447
+ enableLiveboardDataCache: false,
448
+ ...defaultViewConfig,
449
+ liveboardId,
450
+ } as LiveboardViewConfig);
451
+ liveboardEmbed.render();
452
+ await executeAfterWait(() => {
453
+ expectUrlMatchesWithParams(
454
+ getIFrameSrc(),
455
+ `http://${thoughtSpotHost}/?embedApp=true${defaultParams}&enableLiveboardDataCache=false${prefixParams}#/embed/viz/${liveboardId}`,
456
+ );
457
+ });
458
+ });
459
+
460
+ test('should not set enableLiveboardDataCache in url when not provided', async () => {
461
+ const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
462
+ ...defaultViewConfig,
463
+ liveboardId,
464
+ } as LiveboardViewConfig);
465
+ liveboardEmbed.render();
466
+ await executeAfterWait(() => {
467
+ expect(getIFrameSrc()).not.toContain('enableLiveboardDataCache');
468
+ });
469
+ });
470
+
430
471
  test('should render viz', async () => {
431
472
  const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
432
473
  ...defaultViewConfig,
@@ -534,6 +534,19 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
534
534
  * ```
535
535
  */
536
536
  spotterChatConfig?: SpotterChatViewConfig;
537
+ /**
538
+ * If set to true, enables visualization data caching on the Liveboard.
539
+ * @type {boolean}
540
+ * @version SDK: 1.49.0 | ThoughtSpot: 26.6.0.cl
541
+ * @example
542
+ * ```js
543
+ * const embed = new LiveboardEmbed('#embed-container', {
544
+ * ... // other options
545
+ * enableLiveboardDataCache: true,
546
+ * })
547
+ * ```
548
+ */
549
+ enableLiveboardDataCache?: boolean;
537
550
  }
538
551
 
539
552
  /**
@@ -627,6 +640,7 @@ export class LiveboardEmbed extends V1Embed {
627
640
  spotterChatConfig,
628
641
  isThisPeriodInDateFiltersEnabled,
629
642
  isContinuousLiveboardPDFEnabled,
643
+ enableLiveboardDataCache,
630
644
  } = this.viewConfig;
631
645
 
632
646
  const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
@@ -744,6 +758,10 @@ export class LiveboardEmbed extends V1Embed {
744
758
  params[Param.IsWYSIWYGLiveboardPDFEnabled] = isContinuousLiveboardPDFEnabled;
745
759
  }
746
760
 
761
+ if (enableLiveboardDataCache !== undefined) {
762
+ params[Param.EnableLiveboardDataCache] = enableLiveboardDataCache;
763
+ }
764
+
747
765
  params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
748
766
  params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
749
767
  params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
@@ -1541,6 +1541,21 @@ export class TsEmbed {
1541
1541
  });
1542
1542
  }
1543
1543
 
1544
+ /**
1545
+ * Generates the event name for a "Subscribed" embed event.
1546
+ *
1547
+ * This helper appends the "Subscribed" suffix to a given host or action event,
1548
+ * allowing you to listen for subscription lifecycle events in a consistent format.
1549
+ *
1550
+ * @param eventName - The host or action event to generate the subscribed event name for.
1551
+ * @returns The formatted event name (e.g., "Save Subscribed").
1552
+ *
1553
+ * @version SDK: 1.47.2 | ThoughtSpot: 26.3.0.cl
1554
+ */
1555
+ public subscribedEvent(eventName: HostEvent | Action): string {
1556
+ return `${eventName} ${EmbedEvent.Subscribed}`;
1557
+ }
1558
+
1544
1559
  /**
1545
1560
  * Creates the preRender shell
1546
1561
  * @param showPreRenderByDefault - Show the preRender after render, hidden by default
package/src/types.ts CHANGED
@@ -3636,6 +3636,56 @@ export enum EmbedEvent {
3636
3636
  * @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl
3637
3637
  */
3638
3638
  RefreshAuthToken = 'RefreshAuthToken',
3639
+
3640
+ /**
3641
+ * Triggered whenever the page context changes, returning the current context along with the navigation stack.
3642
+ * @example
3643
+ * ```js
3644
+ * embed.on(EmbedEvent.EmbedPageContextChanged, (payload) => {
3645
+ * console.log('payload', payload);
3646
+ * })
3647
+ * ```
3648
+ * @version SDK: 1.47.2 | ThoughtSpot: 26.3.0.cl
3649
+ */
3650
+ EmbedPageContextChanged = 'EmbedPageContextChanged',
3651
+
3652
+ /**
3653
+ * Represents a special embed event that is triggered whenever any host event is subscribed.
3654
+ *
3655
+ * You can listen to this event when you need to dispatch a host event during load or render,
3656
+ * particularly in situations where timing issues may occur.
3657
+ *
3658
+ * @example
3659
+ * ```js
3660
+ * embed.on(`${HostEvent.Save} Subscribed`, () => {
3661
+ * // make action
3662
+ * });
3663
+ * ```
3664
+ *
3665
+ * @example
3666
+ * ```js
3667
+ * embed.on(subscribedEvent(HostEvent.Save), () => {
3668
+ * // make action
3669
+ * });
3670
+ * ```
3671
+ * @version SDK: 1.48.0 | ThoughtSpot: 26.4.0.cl
3672
+ */
3673
+ Subscribed = 'Subscribed',
3674
+
3675
+ /**
3676
+ * Emitted when a user clicks the **Send Test Email** button in the
3677
+ * Liveboard schedule modal. Requires `isSendNowLiveboardSchedulingEnabled`
3678
+ * to be enabled.
3679
+ * @example
3680
+ * ```js
3681
+ * liveboardEmbed.on(EmbedEvent.SendTestScheduleEmail, (payload) => {
3682
+ * console.log('Send test email', payload);
3683
+ * // payload: { liveboardId: string, sendToSelf: boolean }
3684
+ * })
3685
+ * ```
3686
+ * @version SDK: 1.48.0 | ThoughtSpot Cloud: 26.5.0.cl
3687
+ */
3688
+ SendTestScheduleEmail = 'sendTestScheduleEmail',
3639
3689
  }
3640
3690
 
3641
3691
  /**
@@ -5336,7 +5386,8 @@ export enum HostEvent {
5336
5386
  * ```js
5337
5387
  * // Get parameters from liveboard context
5338
5388
  * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5339
- * liveboardEmbed.trigger(HostEvent.GetParameters, {}, ContextType.Liveboard).then((parameters) => {
5389
+ * liveboardEmbed.trigger(HostEvent.GetParameters, {},
5390
+ * ContextType.Liveboard).then((parameters) => {
5340
5391
  * console.log('parameters', parameters);
5341
5392
  * });
5342
5393
  * ```
@@ -5690,6 +5741,26 @@ export enum HostEvent {
5690
5741
  * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
5691
5742
  */
5692
5743
  GetPageContext = 'GetPageContext',
5744
+ /**
5745
+ * Trigger the **Send Test Email** action in the Liveboard schedule modal.
5746
+ * Sends a test schedule email to self or all recipients.
5747
+ * Requires `isSendNowLiveboardSchedulingEnabled` to be enabled.
5748
+ * @example
5749
+ * ```js
5750
+ * liveboardEmbed.trigger(HostEvent.SendTestScheduleEmail, {
5751
+ * sendToSelf: true,
5752
+ * })
5753
+ * ```
5754
+ * @example
5755
+ * ```js
5756
+ * // Send to all recipients
5757
+ * liveboardEmbed.trigger(HostEvent.SendTestScheduleEmail, {
5758
+ * sendToSelf: false,
5759
+ * })
5760
+ * ```
5761
+ * @version SDK: 1.48.0 | ThoughtSpot Cloud: 26.5.0.cl
5762
+ */
5763
+ SendTestScheduleEmail = 'sendTestScheduleEmail',
5693
5764
  }
5694
5765
 
5695
5766
  /**
@@ -5846,6 +5917,7 @@ export enum Param {
5846
5917
  IsWYSIWYGLiveboardPDFEnabled = 'isWYSIWYGLiveboardPDFEnabled',
5847
5918
  isLiveboardXLSXCSVDownloadEnabled = 'isLiveboardXLSXCSVDownloadEnabled',
5848
5919
  isGranularXLSXCSVSchedulesEnabled = 'isGranularXLSXCSVSchedulesEnabled',
5920
+ isSendNowLiveboardSchedulingEnabled = 'isSendNowLiveboardSchedulingEnabled',
5849
5921
  isCentralizedLiveboardFilterUXEnabled = 'isCentralizedLiveboardFilterUXEnabled',
5850
5922
  isLinkParametersEnabled = 'isLinkParametersEnabled',
5851
5923
  EnablePastConversationsSidebar = 'enablePastConversationsSidebar',
@@ -5865,6 +5937,7 @@ export enum Param {
5865
5937
  HideToolResponseCardBranding = 'hideToolResponseCardBranding',
5866
5938
  ToolResponseCardBrandingLabel = 'toolResponseCardBrandingLabel',
5867
5939
  EnableHomepageAnnouncement = 'enableHomepageAnnouncement',
5940
+ EnableLiveboardDataCache = 'enableLiveboardDataCache',
5868
5941
  }
5869
5942
 
5870
5943
  /**
@@ -6187,7 +6260,7 @@ export enum Action {
6187
6260
  * ```js
6188
6261
  * disabledActions: [Action.DownloadLiveboard]
6189
6262
  * ```
6190
- * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
6263
+ * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
6191
6264
  */
6192
6265
  DownloadLiveboard = 'downloadLiveboard',
6193
6266
  /**
@@ -6200,6 +6273,26 @@ export enum Action {
6200
6273
  * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
6201
6274
  */
6202
6275
  DownloadLiveboardAsContinuousPDF = 'downloadLiveboardAsContinuousPDF',
6276
+ /**
6277
+ * The **Download Liveboard as XLSX** menu action on a Liveboard.
6278
+ * Allows downloading the entire Liveboard as an XLSX file.
6279
+ * @example
6280
+ * ```js
6281
+ * disabledActions: [Action.DownloadLiveboardAsXlsx]
6282
+ * ```
6283
+ * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
6284
+ */
6285
+ DownloadLiveboardAsXlsx = 'downloadLiveboardAsXlsx',
6286
+ /**
6287
+ * The **Download Liveboard as CSV** menu action on a Liveboard.
6288
+ * Allows downloading the entire Liveboard as a CSV file.
6289
+ * @example
6290
+ * ```js
6291
+ * disabledActions: [Action.DownloadLiveboardAsCsv]
6292
+ * ```
6293
+ * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
6294
+ */
6295
+ DownloadLiveboardAsCsv = 'downloadLiveboardAsCsv',
6203
6296
  /**
6204
6297
  * @hidden
6205
6298
  */
@@ -7481,6 +7574,18 @@ export enum Action {
7481
7574
  * @version SDK: 1.45.0 | ThoughtSpot: 26.4.0.cl
7482
7575
  */
7483
7576
  IncludeCurrentPeriod = 'includeCurrentPeriod',
7577
+ /**
7578
+ * The **Send Test Email** button in the Liveboard schedule modal.
7579
+ * Allows sending a test schedule email to self or all recipients.
7580
+ * Requires `isSendNowLiveboardSchedulingEnabled` to be enabled.
7581
+ * @example
7582
+ * ```js
7583
+ * disabledActions: [Action.SendTestScheduleEmail]
7584
+ * hiddenActions: [Action.SendTestScheduleEmail]
7585
+ * ```
7586
+ * @version SDK: 1.48.0 | ThoughtSpot Cloud: 26.5.0.cl
7587
+ */
7588
+ SendTestScheduleEmail = 'sendTestScheduleEmail',
7484
7589
  }
7485
7590
  export interface AnswerServiceType {
7486
7591
  getAnswer?: (offset: number, batchSize: number) => any;