@thoughtspot/visual-embed-sdk 1.36.9 → 1.37.0-temp-nav

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 (115) hide show
  1. package/cjs/package.json +1 -1
  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 +1 -0
  5. package/cjs/src/auth.js.map +1 -1
  6. package/cjs/src/embed/app.d.ts +76 -0
  7. package/cjs/src/embed/app.d.ts.map +1 -1
  8. package/cjs/src/embed/app.js +18 -1
  9. package/cjs/src/embed/app.js.map +1 -1
  10. package/cjs/src/embed/app.spec.js +50 -0
  11. package/cjs/src/embed/app.spec.js.map +1 -1
  12. package/cjs/src/embed/liveboard.d.ts +2 -2
  13. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  14. package/cjs/src/embed/ts-embed.js +4 -1
  15. package/cjs/src/embed/ts-embed.js.map +1 -1
  16. package/cjs/src/index.d.ts.map +1 -1
  17. package/cjs/src/index.js +1 -0
  18. package/cjs/src/index.js.map +1 -1
  19. package/cjs/src/pages/embed-test.page.d.ts +8 -0
  20. package/cjs/src/pages/embed-test.page.d.ts.map +1 -0
  21. package/cjs/src/pages/embed-test.page.js +20 -0
  22. package/cjs/src/pages/embed-test.page.js.map +1 -0
  23. package/cjs/src/pages/home.page.d.ts +6 -0
  24. package/cjs/src/pages/home.page.d.ts.map +1 -0
  25. package/cjs/src/pages/home.page.js +12 -0
  26. package/cjs/src/pages/home.page.js.map +1 -0
  27. package/cjs/src/pages/login.page.d.ts +15 -0
  28. package/cjs/src/pages/login.page.d.ts.map +1 -0
  29. package/cjs/src/pages/login.page.js +22 -0
  30. package/cjs/src/pages/login.page.js.map +1 -0
  31. package/cjs/src/react/index.d.ts.map +1 -1
  32. package/cjs/src/react/index.js +1 -0
  33. package/cjs/src/react/index.js.map +1 -1
  34. package/cjs/src/tests/auth.test.d.ts +1 -0
  35. package/cjs/src/tests/auth.test.d.ts.map +1 -0
  36. package/cjs/src/tests/auth.test.js +1 -0
  37. package/cjs/src/tests/auth.test.js.map +1 -0
  38. package/cjs/src/tests/e2e/auth.spec.d.ts +2 -0
  39. package/cjs/src/tests/e2e/auth.spec.d.ts.map +1 -0
  40. package/cjs/src/tests/e2e/auth.spec.js +54 -0
  41. package/cjs/src/tests/e2e/auth.spec.js.map +1 -0
  42. package/cjs/src/types.d.ts +56 -13
  43. package/cjs/src/types.d.ts.map +1 -1
  44. package/cjs/src/types.js +39 -9
  45. package/cjs/src/types.js.map +1 -1
  46. package/cjs/src/utils/graphql/answerService/answerService.d.ts +35 -15
  47. package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  48. package/cjs/src/utils/graphql/answerService/answerService.js +35 -15
  49. package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
  50. package/cjs/src/utils/processData.js +6 -4
  51. package/cjs/src/utils/processData.js.map +1 -1
  52. package/dist/index-Cj4BVGHL.js +7371 -0
  53. package/dist/{index-Dg18PU5Z.js → index-Fhk1V_Gw.js} +1 -0
  54. package/dist/src/auth.d.ts +2 -1
  55. package/dist/src/auth.d.ts.map +1 -1
  56. package/dist/src/embed/app.d.ts +76 -0
  57. package/dist/src/embed/app.d.ts.map +1 -1
  58. package/dist/src/embed/liveboard.d.ts +2 -2
  59. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  60. package/dist/src/index.d.ts.map +1 -1
  61. package/dist/src/react/index.d.ts.map +1 -1
  62. package/dist/src/types.d.ts +56 -13
  63. package/dist/src/types.d.ts.map +1 -1
  64. package/dist/src/utils/graphql/answerService/answerService.d.ts +35 -15
  65. package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  66. package/dist/tsembed-react.es.js +107 -33
  67. package/dist/tsembed-react.js +106 -32
  68. package/dist/tsembed.es.js +107 -33
  69. package/dist/tsembed.js +106 -32
  70. package/dist/visual-embed-sdk-react-full.d.ts +171 -31
  71. package/dist/visual-embed-sdk-react.d.ts +171 -31
  72. package/dist/visual-embed-sdk.d.ts +171 -31
  73. package/lib/package.json +1 -1
  74. package/lib/src/auth.d.ts +2 -1
  75. package/lib/src/auth.d.ts.map +1 -1
  76. package/lib/src/auth.js +1 -0
  77. package/lib/src/auth.js.map +1 -1
  78. package/lib/src/embed/app.d.ts +76 -0
  79. package/lib/src/embed/app.d.ts.map +1 -1
  80. package/lib/src/embed/app.js +18 -1
  81. package/lib/src/embed/app.js.map +1 -1
  82. package/lib/src/embed/app.spec.js +50 -0
  83. package/lib/src/embed/app.spec.js.map +1 -1
  84. package/lib/src/embed/liveboard.d.ts +2 -2
  85. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  86. package/lib/src/embed/ts-embed.js +4 -1
  87. package/lib/src/embed/ts-embed.js.map +1 -1
  88. package/lib/src/index.d.ts.map +1 -1
  89. package/lib/src/index.js +1 -0
  90. package/lib/src/index.js.map +1 -1
  91. package/lib/src/react/index.d.ts.map +1 -1
  92. package/lib/src/react/index.js +1 -0
  93. package/lib/src/react/index.js.map +1 -1
  94. package/lib/src/types.d.ts +56 -13
  95. package/lib/src/types.d.ts.map +1 -1
  96. package/lib/src/types.js +39 -9
  97. package/lib/src/types.js.map +1 -1
  98. package/lib/src/utils/graphql/answerService/answerService.d.ts +35 -15
  99. package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  100. package/lib/src/utils/graphql/answerService/answerService.js +35 -15
  101. package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
  102. package/lib/src/utils/processData.js +6 -4
  103. package/lib/src/utils/processData.js.map +1 -1
  104. package/lib/src/visual-embed-sdk.d.ts +171 -31
  105. package/package.json +1 -1
  106. package/src/auth.ts +2 -1
  107. package/src/embed/app.spec.ts +70 -0
  108. package/src/embed/app.ts +104 -0
  109. package/src/embed/liveboard.ts +2 -2
  110. package/src/embed/ts-embed.ts +4 -0
  111. package/src/index.ts +2 -0
  112. package/src/react/index.tsx +2 -0
  113. package/src/types.ts +55 -12
  114. package/src/utils/graphql/answerService/answerService.ts +35 -15
  115. package/src/utils/processData.ts +6 -6
@@ -106,6 +106,20 @@ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
106
106
  AI_ANSWER = "aiAnswer",
107
107
  NONE = "none"
108
108
  }
109
+ export interface ModularHomeExperienceV3 {
110
+ /**
111
+ * Enabled the modular homepage version 3.
112
+ */
113
+ enabled?: boolean;
114
+ /**
115
+ * homePage values are v2/v3,
116
+ * v2 will show the modular homepage experience
117
+ * v3 will show the new modular homepage v3 experience.
118
+ *
119
+ * @default v2
120
+ */
121
+ homePage?: string;
122
+ }
109
123
  /**
110
124
  * The view configuration for full app embedding.
111
125
  * @group Embed components
@@ -174,6 +188,51 @@ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
174
188
  * ```
175
189
  */
176
190
  enablePendoHelp?: boolean;
191
+ /**
192
+ * Control the visibility of the hamburger icon on the top nav bar
193
+ * available when new navigation V3 is enabled.
194
+ *
195
+ * @default false
196
+ * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
197
+ * @example
198
+ * ```js
199
+ * const embed = new AppEmbed('#tsEmbed', {
200
+ * ... // other options
201
+ * hideHamburger : true,
202
+ * })
203
+ * ```
204
+ */
205
+ hideHamburger?: boolean;
206
+ /**
207
+ * Control the visibility of the Eureka search on the top nav bar
208
+ * this will control for both new V2 and new navigation V3.
209
+ *
210
+ * @default true
211
+ * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
212
+ * @example
213
+ * ```js
214
+ * const embed = new AppEmbed('#tsEmbed', {
215
+ * ... // other options
216
+ * hideObjectSearch: false,
217
+ * })
218
+ * ```
219
+ */
220
+ hideObjectSearch?: boolean;
221
+ /**
222
+ * Control the visibility of the notification on the top nav bar V3,
223
+ * available when new navigation V3 is enabled.
224
+ *
225
+ * @default true
226
+ * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
227
+ * @example
228
+ * ```js
229
+ * const embed = new AppEmbed('#tsEmbed', {
230
+ * ... // other options
231
+ * hideNotification: false,
232
+ * })
233
+ * ```
234
+ */
235
+ hideNotification?: boolean;
177
236
  /**
178
237
  * Control the visibility of the application switcher button on the nav-bar.
179
238
  * By default, the application switcher is shown.
@@ -367,6 +426,23 @@ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
367
426
  * ```
368
427
  */
369
428
  modularHomeExperience?: boolean;
429
+ /**
430
+ * Flag to control new navigation v3 home experience.
431
+ *
432
+ * @default false
433
+ * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
434
+ * @example
435
+ * ```js
436
+ * const embed = new AppEmbed('#tsEmbed', {
437
+ * ... // other options
438
+ * modularHomeExperienceV3 : {
439
+ * enabled: true,
440
+ * homePage: 'v2'
441
+ * },
442
+ * })
443
+ * ```
444
+ */
445
+ modularHomeExperienceV3?: ModularHomeExperienceV3;
370
446
  /**
371
447
  * Boolean to control if Liveboard header is sticky or not.
372
448
  * @example
@@ -1062,10 +1138,10 @@ declare module '@thoughtspot/visual-embed-sdk/embed/liveboard' {
1062
1138
  dataSourceId?: string;
1063
1139
  /**
1064
1140
  * This flag is for show/hide checkboxes for include or exclude
1065
- * cover and filter pages in the Liveboard PDF
1141
+ * cover page and filters in the Liveboard PDF.
1066
1142
  * @type {boolean}
1067
1143
  * @default true
1068
- * @version SDK: 1.38.0 | ThoughtSpot:10.8.0.cl
1144
+ * @version SDK: 1.37.0 | ThoughtSpot:10.8.0.cl
1069
1145
  * @example
1070
1146
  * ```js
1071
1147
  * const embed = new LiveboardEmbed('#embed-container', {
@@ -1735,7 +1811,8 @@ declare module '@thoughtspot/visual-embed-sdk/auth' {
1735
1811
  NO_COOKIE_ACCESS = "NO_COOKIE_ACCESS",
1736
1812
  EXPIRY = "EXPIRY",
1737
1813
  OTHER = "OTHER",
1738
- IDLE_SESSION_TIMEOUT = "IDLE_SESSION_TIMEOUT"
1814
+ IDLE_SESSION_TIMEOUT = "IDLE_SESSION_TIMEOUT",
1815
+ UNAUTHENTICATED_FAILURE = "UNAUTHENTICATED_FAILURE"
1739
1816
  }
1740
1817
  /**
1741
1818
  * Enum for auth status emitted by the emitter returned from {@link init}.
@@ -2206,7 +2283,19 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
2206
2283
  /**
2207
2284
  * @version SDK: 1.34.0| ThoughtSpot: 10.3.0.cl
2208
2285
  */
2209
- LiveboardSchedules = "liveboard-schedules"
2286
+ LiveboardSchedules = "liveboard-schedules",
2287
+ /**
2288
+ * Create new options in the insights left navigation,
2289
+ * available when new navigation V3 is enabled.
2290
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
2291
+ */
2292
+ Create = "create",
2293
+ /**
2294
+ * Spotter option in the insights left navigation,
2295
+ * available when new navigation V3 is enabled.
2296
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
2297
+ */
2298
+ Spotter = "spotter"
2210
2299
  }
2211
2300
  export type DOMSelector = string | HTMLElement;
2212
2301
  /**
@@ -2687,6 +2776,19 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
2687
2776
  * ```
2688
2777
  */
2689
2778
  disabledActions?: Action[];
2779
+ /**
2780
+ * The primary action to display on top of the viz for Liveboard and App Embed.
2781
+ * Use this to set the primary action.
2782
+ * @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
2783
+ * @example
2784
+ * ```js
2785
+ * const embed = new LiveboardEmbed('#embed', {
2786
+ * ... // other liveboard view config
2787
+ * primaryAction: Action.Download
2788
+ * });
2789
+ * ```
2790
+ */
2791
+ primaryAction?: Action | string;
2690
2792
  /**
2691
2793
  * The tooltip to display for disabled actions.
2692
2794
  * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
@@ -3113,8 +3215,8 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
3113
3215
  * Hide list page columns
3114
3216
  * For example: hiddenListColumns = [ListPageColumns.Author]
3115
3217
  *
3116
- * **Note**: This option is appplicable only in full app embedding.
3117
- * @version SDK: 1.38.0 | ThoughtSpot: 9.12.5.cl, 10.1.0.sw
3218
+ * **Note**: This option is available only in full app embedding.
3219
+ * @version SDK: 1.38.0 | ThoughtSpot: 10.9.0.cl
3118
3220
  * @example
3119
3221
  * ```js
3120
3222
  * const embed = new AppEmbed('#tsEmbed', {
@@ -3271,8 +3373,8 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
3271
3373
  }
3272
3374
  /**
3273
3375
  * List page columns that can be hidden.
3274
- * **Note**: This option is applicable only in full app embedding.
3275
- * @version SDK: 1.38.0 | ThoughtSpot: 9.12.5.cl, 10.1.0.sw
3376
+ * **Note**: This option is applicable to full app embedding only.
3377
+ * @version SDK: 1.38.0 | ThoughtSpot: 10.9.0.cl
3276
3378
  */
3277
3379
  export enum ListPageColumns {
3278
3380
  /**
@@ -4355,7 +4457,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
4355
4457
  * searchEmbed.trigger(HostEvent.TransformTableVizData, columnDataLite);
4356
4458
  * })
4357
4459
  * ```
4358
- * @version SDK: 1.38.0 | ThoughtSpot: 10.8.0.cl
4460
+ * @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl
4359
4461
  */
4360
4462
  TableVizRendered = "TableVizRendered",
4361
4463
  /**
@@ -4368,12 +4470,12 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
4368
4470
  * console.log('payload', payload);
4369
4471
  * })
4370
4472
  *```
4371
- * @version SDK : 1.38.0 | ThoughtSpot : 10.8.0.cl
4473
+ * @version SDK : 1.37.0 | ThoughtSpot : 10.8.0.cl
4372
4474
  */
4373
4475
  CreateLiveboard = "createLiveboard",
4374
4476
  /**
4375
4477
  * Emitted when a user creates a Model.
4376
- * @version SDK : 1.38.0 | ThoughtSpot : 10.8.0.cl
4478
+ * @version SDK : 1.37.0 | ThoughtSpot : 10.8.0.cl
4377
4479
  */
4378
4480
  CreateModel = "createModel"
4379
4481
  }
@@ -4815,7 +4917,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
4815
4917
  * ```js
4816
4918
  * liveboardEmbed.trigger(HostEvent.Remove)
4817
4919
  * ```
4818
- * @version SDK: 1.38.0 | ThoughtSpot: 10.8.0.cl, 10.10.0.sw
4920
+ * @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl, 10.10.0.sw
4819
4921
  */
4820
4922
  Remove = "delete",
4821
4923
  /**
@@ -5276,8 +5378,17 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
5276
5378
  /**
5277
5379
  * Get the Answer session for a Search or
5278
5380
  * Liveboard visualization.
5381
+ *
5382
+ * Note: This event is not typically used directly. Instead, use the
5383
+ * `getAnswerService()` method on the embed instance to get an AnswerService
5384
+ * object that provides a more convenient interface for working with answers.
5385
+ *
5279
5386
  * @example
5280
5387
  * ```js
5388
+ * // Preferred way to get an AnswerService
5389
+ * const service = await embed.getAnswerService();
5390
+ *
5391
+ * // Alternative direct usage (not recommended)
5281
5392
  * const {session} = await embed.trigger(
5282
5393
  * HostEvent.GetAnswerSession, {
5283
5394
  * vizId: '123', // For Liveboard Visualization.
@@ -5285,6 +5396,10 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
5285
5396
  * ```
5286
5397
  * @example
5287
5398
  * ```js
5399
+ * // Preferred way to get an AnswerService
5400
+ * const service = await embed.getAnswerService();
5401
+ *
5402
+ * // Alternative direct usage (not recommended)
5288
5403
  * const {session} = await embed.trigger( HostEvent.GetAnswerSession )
5289
5404
  * ```
5290
5405
  * @version SDK: 1.26.0 | ThoughtSpot: 9.10.0.cl, 10.1.0.sw
@@ -5410,7 +5525,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
5410
5525
  * searchEmbed.trigger(HostEvent.TransformTableVizData, columnDataLite);
5411
5526
  * })
5412
5527
  * ```
5413
- * @version SDK: 1.38.0 | ThoughtSpot: 10.8.0.cl
5528
+ * @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl
5414
5529
  */
5415
5530
  TransformTableVizData = "TransformTableVizData"
5416
5531
  }
@@ -5483,6 +5598,10 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
5483
5598
  ShowInsertToSlide = "insertInToSlide",
5484
5599
  PrimaryNavHidden = "primaryNavHidden",
5485
5600
  HideProfleAndHelp = "profileAndHelpInNavBarHidden",
5601
+ NavigationVersion = "navigationVersion",
5602
+ HideHamburger = "hideHamburger",
5603
+ HideObjectSearch = "hideObjectSearch",
5604
+ HideNotification = "hideNotification",
5486
5605
  HideApplicationSwitcher = "applicationSwitcherHidden",
5487
5606
  HideOrgSwitcher = "orgSwitcherHidden",
5488
5607
  IsSageEmbed = "isSageEmbed",
@@ -5538,7 +5657,8 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
5538
5657
  DataSourceId = "dataSourceId",
5539
5658
  preAuthCache = "preAuthCache",
5540
5659
  ShowSpotterLimitations = "showSpotterLimitations",
5541
- CoverAndFilterOptionInPDF = "coverAndFilterOptionInPDF"
5660
+ CoverAndFilterOptionInPDF = "coverAndFilterOptionInPDF",
5661
+ PrimaryAction = "primaryAction"
5542
5662
  }
5543
5663
  /**
5544
5664
  * ThoughtSpot application pages include actions and menu commands
@@ -6745,7 +6865,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
6745
6865
  * ```js
6746
6866
  * hiddenAction: [Action.ColumnRename]
6747
6867
  * ```
6748
- * @version SDK: 1.38.0 | ThoughtSpot Cloud: 10.8.0.cl
6868
+ * @version SDK: 1.37.0 | ThoughtSpot Cloud: 10.8.0.cl
6749
6869
  */
6750
6870
  ColumnRename = "columnRename",
6751
6871
  /**
@@ -6755,7 +6875,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
6755
6875
  * ```js
6756
6876
  * hiddenAction: [Action.CoverAndFilterOptionInPDF]
6757
6877
  * ```
6758
- * @version SDK: 1.38.0 | ThoughtSpot Cloud: 10.8.0.cl
6878
+ * @version SDK: 1.37.0 | ThoughtSpot Cloud: 10.8.0.cl
6759
6879
  */
6760
6880
  CoverAndFilterOptionInPDF = "coverAndFilterOptionInPDF"
6761
6881
  }
@@ -7478,29 +7598,49 @@ declare module '@thoughtspot/visual-embed-sdk/utils/graphql/answerService/answer
7478
7598
  dataValue: any;
7479
7599
  }
7480
7600
  /**
7481
- * Class representing the answer service provided with the
7482
- * custom action payload. This service could be used to run
7483
- * graphql queries in the context of the answer on which the
7484
- * custom action was triggered.
7601
+ * AnswerService provides a simple way to work with ThoughtSpot Answers.
7602
+ *
7603
+ * This service allows you to interact with ThoughtSpot Answers programmatically,
7604
+ * making it easy to customize visualizations, filter data, and extract insights
7605
+ * directly from your application.
7606
+ *
7607
+ * You can use this service to:
7608
+ * - Add or remove columns from Answers (`addColumns`, `removeColumns`, `addColumnsByName`)
7609
+ * - Apply filters to Answers (`addFilter`)
7610
+ * - Get data from Answers in different formats (JSON, CSV, PNG) (`fetchData`, `fetchCSVBlob`, `fetchPNGBlob`)
7611
+ * - Get data for specific points in visualizations (`getUnderlyingDataForPoint`)
7612
+ * - Run custom queries (`executeQuery`)
7613
+ * - Add visualizations to liveboards (`addDisplayedVizToLiveboard`)
7614
+ *
7485
7615
  * @example
7486
7616
  * ```js
7487
- * embed.on(EmbedEvent.CustomAction, e => {
7488
- * const underlying = await e.answerService.getUnderlyingDataForPoint([
7489
- * 'col name 1'
7490
- * ]);
7491
- * const data = await underlying.fetchData(0, 100);
7492
- * })
7617
+ * // Get the answer service
7618
+ * embed.on(EmbedEvent.Data, async (e) => {
7619
+ * const service = await embed.getAnswerService();
7620
+ *
7621
+ * // Add columns to the answer
7622
+ * await service.addColumnsByName(["Sales", "Region"]);
7623
+ *
7624
+ * // Get the data
7625
+ * const data = await service.fetchData();
7626
+ * console.log(data);
7627
+ * });
7493
7628
  * ```
7629
+ *
7494
7630
  * @example
7495
7631
  * ```js
7496
- * embed.on(EmbedEvent.Data, async (e) => {
7497
- * const service = await embed.getAnswerService();
7498
- * await service.addColumns([
7499
- * "<column guid>"
7632
+ * // Get data for a point in a visualization
7633
+ * embed.on(EmbedEvent.CustomAction, async (e) => {
7634
+ * const underlying = await e.answerService.getUnderlyingDataForPoint([
7635
+ * 'Product Name',
7636
+ * 'Sales Amount'
7500
7637
  * ]);
7501
- * console.log(await service.fetchData());
7638
+ *
7639
+ * const data = await underlying.fetchData(0, 100);
7640
+ * console.log(data);
7502
7641
  * });
7503
7642
  * ```
7643
+ *
7504
7644
  * @version SDK: 1.25.0| ThoughtSpot: 9.10.0.cl
7505
7645
  * @group Events
7506
7646
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thoughtspot/visual-embed-sdk",
3
- "version": "1.36.9",
3
+ "version": "1.37.0-temp-nav",
4
4
  "description": "ThoughtSpot Embed SDK",
5
5
  "module": "lib/src/index.js",
6
6
  "main": "dist/tsembed.js",
package/src/auth.ts CHANGED
@@ -40,7 +40,8 @@ export enum AuthFailureType {
40
40
  NO_COOKIE_ACCESS = 'NO_COOKIE_ACCESS',
41
41
  EXPIRY = 'EXPIRY',
42
42
  OTHER = 'OTHER',
43
- IDLE_SESSION_TIMEOUT = 'IDLE_SESSION_TIMEOUT'
43
+ IDLE_SESSION_TIMEOUT = 'IDLE_SESSION_TIMEOUT',
44
+ UNAUTHENTICATED_FAILURE = 'UNAUTHENTICATED_FAILURE',
44
45
  }
45
46
 
46
47
  /**
@@ -494,6 +494,76 @@ describe('App embed tests', () => {
494
494
  });
495
495
  });
496
496
 
497
+ test('Should add hideHamburger, hideObjectSearch, hideNotification flags to the iframe src', async () => {
498
+ const appEmbed = new AppEmbed(getRootEl(), {
499
+ ...defaultViewConfig,
500
+ hideHamburger: true,
501
+ hideObjectSearch: true,
502
+ hideNotification: true,
503
+ } as AppViewConfig);
504
+
505
+ appEmbed.render();
506
+ await executeAfterWait(() => {
507
+ expectUrlMatchesWithParams(
508
+ getIFrameSrc(),
509
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&hideHamburger=true&hideObjectSearch=true&hideNotification=true${defaultParams}${defaultParamsPost}#/home`,
510
+ );
511
+ });
512
+ });
513
+
514
+ test('Should not add when hideHamburger, hideObjectSearch, hideNotification values are not true to the iframe src', async () => {
515
+ const appEmbed = new AppEmbed(getRootEl(), {
516
+ ...defaultViewConfig,
517
+ hideHamburger: false,
518
+ hideObjectSearch: undefined,
519
+ hideNotification: null,
520
+ } as AppViewConfig);
521
+
522
+ appEmbed.render();
523
+ await executeAfterWait(() => {
524
+ expectUrlMatchesWithParams(
525
+ getIFrameSrc(),
526
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false${defaultParams}${defaultParamsPost}#/home`,
527
+ );
528
+ });
529
+ });
530
+
531
+ test('Should add navigationVersion=v3 when modularHomeExperienceV3 is true to the iframe src', async () => {
532
+ const appEmbed = new AppEmbed(getRootEl(), {
533
+ ...defaultViewConfig,
534
+ modularHomeExperienceV3: {
535
+ enabled: true,
536
+ homePage: 'v2',
537
+ },
538
+ } as AppViewConfig);
539
+
540
+ appEmbed.render();
541
+ await executeAfterWait(() => {
542
+ expectUrlMatchesWithParams(
543
+ getIFrameSrc(),
544
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true&navigationVersion=v3${defaultParams}${defaultParamsPost}#/home`,
545
+ );
546
+ });
547
+ });
548
+
549
+ test('Should not add navigationVersion when modularHomeExperienceV3 is false to the iframe src', async () => {
550
+ const appEmbed = new AppEmbed(getRootEl(), {
551
+ ...defaultViewConfig,
552
+ modularHomeExperienceV3: {
553
+ enabled: false,
554
+ homePage: 'v2',
555
+ },
556
+ } as AppViewConfig);
557
+
558
+ appEmbed.render();
559
+ await executeAfterWait(() => {
560
+ expectUrlMatchesWithParams(
561
+ getIFrameSrc(),
562
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true${defaultParams}${defaultParamsPost}#/home`,
563
+ );
564
+ });
565
+ });
566
+
497
567
  test('Should add enableAskSage flag to the iframe src', async () => {
498
568
  const appEmbed = new AppEmbed(getRootEl(), {
499
569
  ...defaultViewConfig,
package/src/embed/app.ts CHANGED
@@ -83,6 +83,22 @@ export enum HomePageSearchBarMode {
83
83
  AI_ANSWER = 'aiAnswer',
84
84
  NONE = 'none'
85
85
  }
86
+
87
+ export interface ModularHomeExperienceV3 {
88
+ /**
89
+ * Enabled the modular homepage version 3.
90
+ */
91
+ enabled?: boolean;
92
+ /**
93
+ * homePage values are v2/v3,
94
+ * v2 will show the modular homepage experience
95
+ * v3 will show the new modular homepage v3 experience.
96
+ *
97
+ * @default v2
98
+ */
99
+ homePage?: string;
100
+ }
101
+
86
102
  /**
87
103
  * The view configuration for full app embedding.
88
104
  * @group Embed components
@@ -151,6 +167,51 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
151
167
  * ```
152
168
  */
153
169
  enablePendoHelp?: boolean
170
+ /**
171
+ * Control the visibility of the hamburger icon on the top nav bar
172
+ * available when new navigation V3 is enabled.
173
+ *
174
+ * @default false
175
+ * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
176
+ * @example
177
+ * ```js
178
+ * const embed = new AppEmbed('#tsEmbed', {
179
+ * ... // other options
180
+ * hideHamburger : true,
181
+ * })
182
+ * ```
183
+ */
184
+ hideHamburger?: boolean;
185
+ /**
186
+ * Control the visibility of the Eureka search on the top nav bar
187
+ * this will control for both new V2 and new navigation V3.
188
+ *
189
+ * @default true
190
+ * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
191
+ * @example
192
+ * ```js
193
+ * const embed = new AppEmbed('#tsEmbed', {
194
+ * ... // other options
195
+ * hideObjectSearch: false,
196
+ * })
197
+ * ```
198
+ */
199
+ hideObjectSearch?: boolean;
200
+ /**
201
+ * Control the visibility of the notification on the top nav bar V3,
202
+ * available when new navigation V3 is enabled.
203
+ *
204
+ * @default true
205
+ * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
206
+ * @example
207
+ * ```js
208
+ * const embed = new AppEmbed('#tsEmbed', {
209
+ * ... // other options
210
+ * hideNotification: false,
211
+ * })
212
+ * ```
213
+ */
214
+ hideNotification?: boolean;
154
215
  /**
155
216
  * Control the visibility of the application switcher button on the nav-bar.
156
217
  * By default, the application switcher is shown.
@@ -344,6 +405,23 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
344
405
  * ```
345
406
  */
346
407
  modularHomeExperience?: boolean;
408
+ /**
409
+ * Flag to control new navigation v3 home experience.
410
+ *
411
+ * @default false
412
+ * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
413
+ * @example
414
+ * ```js
415
+ * const embed = new AppEmbed('#tsEmbed', {
416
+ * ... // other options
417
+ * modularHomeExperienceV3 : {
418
+ * enabled: true,
419
+ * homePage: 'v2'
420
+ * },
421
+ * })
422
+ * ```
423
+ */
424
+ modularHomeExperienceV3?: ModularHomeExperienceV3;
347
425
  /**
348
426
  * Boolean to control if Liveboard header is sticky or not.
349
427
  * @example
@@ -515,6 +593,9 @@ export class AppEmbed extends V1Embed {
515
593
  liveboardV2,
516
594
  showPrimaryNavbar,
517
595
  disableProfileAndHelp,
596
+ hideHamburger,
597
+ hideObjectSearch,
598
+ hideNotification,
518
599
  hideApplicationSwitcher,
519
600
  hideOrgSwitcher,
520
601
  enableSearchAssist,
@@ -525,6 +606,7 @@ export class AppEmbed extends V1Embed {
525
606
  showLiveboardDescription = true,
526
607
  hideHomepageLeftNav = false,
527
608
  modularHomeExperience = false,
609
+ modularHomeExperienceV3 = false,
528
610
  isLiveboardHeaderSticky = true,
529
611
  enableAskSage,
530
612
  collapseSearchBarInitially = false,
@@ -561,6 +643,18 @@ export class AppEmbed extends V1Embed {
561
643
 
562
644
  params = this.getBaseQueryParams(params);
563
645
 
646
+ if (hideObjectSearch) {
647
+ params[Param.HideObjectSearch] = !!hideObjectSearch;
648
+ }
649
+
650
+ if (hideHamburger) {
651
+ params[Param.HideHamburger] = !!hideHamburger;
652
+ }
653
+
654
+ if (hideNotification) {
655
+ params[Param.HideNotification] = !!hideNotification;
656
+ }
657
+
564
658
  if (fullHeight === true) {
565
659
  params[Param.fullHeight] = true;
566
660
  }
@@ -620,6 +714,16 @@ export class AppEmbed extends V1Embed {
620
714
  /* eslint-disable-next-line max-len */
621
715
  params[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
622
716
  }
717
+
718
+ if (modularHomeExperienceV3) {
719
+ if (modularHomeExperienceV3.enabled) {
720
+ params[Param.NavigationVersion] = 'v3';
721
+ }
722
+ if (modularHomeExperienceV3.homePage === 'v2') {
723
+ params[Param.ModularHomeExperienceEnabled] = true;
724
+ }
725
+ }
726
+
623
727
  const queryParams = getQueryParamString(params, true);
624
728
 
625
729
  return queryParams;
@@ -394,10 +394,10 @@ export interface LiveboardViewConfig
394
394
 
395
395
  /**
396
396
  * This flag is for show/hide checkboxes for include or exclude
397
- * cover and filter pages in the Liveboard PDF
397
+ * cover page and filters in the Liveboard PDF.
398
398
  * @type {boolean}
399
399
  * @default true
400
- * @version SDK: 1.38.0 | ThoughtSpot:10.8.0.cl
400
+ * @version SDK: 1.37.0 | ThoughtSpot:10.8.0.cl
401
401
  * @example
402
402
  * ```js
403
403
  * const embed = new LiveboardEmbed('#embed-container', {
@@ -540,6 +540,7 @@ export class TsEmbed {
540
540
  disableRedirectionLinksInNewTab,
541
541
  overrideOrgId,
542
542
  exposeTranslationIDs,
543
+ primaryAction,
543
544
  } = this.viewConfig;
544
545
 
545
546
  const { additionalFlags: additionalFlagsFromInit } = this.embedConfig;
@@ -558,6 +559,9 @@ export class TsEmbed {
558
559
  this.handleError('You cannot have both hidden Tabs and visible Tabs');
559
560
  return queryParams;
560
561
  }
562
+ if (primaryAction) {
563
+ queryParams[Param.PrimaryAction] = primaryAction;
564
+ }
561
565
 
562
566
  if (disabledActions?.length) {
563
567
  queryParams[Param.DisableActions] = disabledActions;
package/src/index.ts CHANGED
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  /**
2
4
  * Copyright (c) 2023
3
5
  *
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import React, { useRef } from 'react';
2
4
  import useDeepCompareEffect from 'use-deep-compare-effect';
3
5
  import { AuthEventEmitter } from '../auth';