@thoughtspot/visual-embed-sdk 1.33.0-alpha.1 → 1.33.0-alpha.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 (143) hide show
  1. package/cjs/package.json +1 -1
  2. package/cjs/src/auth.d.ts.map +1 -1
  3. package/cjs/src/auth.js +6 -5
  4. package/cjs/src/auth.js.map +1 -1
  5. package/cjs/src/authToken.d.ts.map +1 -1
  6. package/cjs/src/authToken.js +5 -7
  7. package/cjs/src/authToken.js.map +1 -1
  8. package/cjs/src/embed/app.d.ts +12 -1
  9. package/cjs/src/embed/app.d.ts.map +1 -1
  10. package/cjs/src/embed/app.js +13 -4
  11. package/cjs/src/embed/app.js.map +1 -1
  12. package/cjs/src/embed/app.spec.js +30 -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 +2 -0
  16. package/cjs/src/embed/base.js.map +1 -1
  17. package/cjs/src/embed/search.d.ts +15 -1
  18. package/cjs/src/embed/search.d.ts.map +1 -1
  19. package/cjs/src/embed/search.js +6 -4
  20. package/cjs/src/embed/search.js.map +1 -1
  21. package/cjs/src/embed/search.spec.js +9 -9
  22. package/cjs/src/embed/search.spec.js.map +1 -1
  23. package/cjs/src/embed/ts-embed.d.ts +1 -1
  24. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  25. package/cjs/src/embed/ts-embed.js +10 -6
  26. package/cjs/src/embed/ts-embed.js.map +1 -1
  27. package/cjs/src/errors.d.ts +11 -0
  28. package/cjs/src/errors.d.ts.map +1 -1
  29. package/cjs/src/errors.js +11 -0
  30. package/cjs/src/errors.js.map +1 -1
  31. package/cjs/src/mixpanel-service.d.ts.map +1 -1
  32. package/cjs/src/mixpanel-service.js +2 -1
  33. package/cjs/src/mixpanel-service.js.map +1 -1
  34. package/cjs/src/react/index.spec.js +1 -1
  35. package/cjs/src/react/index.spec.js.map +1 -1
  36. package/cjs/src/types.d.ts +155 -6
  37. package/cjs/src/types.d.ts.map +1 -1
  38. package/cjs/src/types.js +128 -3
  39. package/cjs/src/types.js.map +1 -1
  40. package/cjs/src/utils/processData.d.ts.map +1 -1
  41. package/cjs/src/utils/processData.js +2 -1
  42. package/cjs/src/utils/processData.js.map +1 -1
  43. package/cjs/src/utils/reporting.d.ts +16 -0
  44. package/cjs/src/utils/reporting.d.ts.map +1 -0
  45. package/cjs/src/utils/reporting.js +68 -0
  46. package/cjs/src/utils/reporting.js.map +1 -0
  47. package/cjs/src/utils/reporting.spec.d.ts +2 -0
  48. package/cjs/src/utils/reporting.spec.d.ts.map +1 -0
  49. package/cjs/src/utils/reporting.spec.js +76 -0
  50. package/cjs/src/utils/reporting.spec.js.map +1 -0
  51. package/dist/src/auth.d.ts.map +1 -1
  52. package/dist/src/authToken.d.ts.map +1 -1
  53. package/dist/src/embed/app.d.ts +12 -1
  54. package/dist/src/embed/app.d.ts.map +1 -1
  55. package/dist/src/embed/base.d.ts.map +1 -1
  56. package/dist/src/embed/search.d.ts +15 -1
  57. package/dist/src/embed/search.d.ts.map +1 -1
  58. package/dist/src/embed/ts-embed.d.ts +1 -1
  59. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  60. package/dist/src/errors.d.ts +11 -0
  61. package/dist/src/errors.d.ts.map +1 -1
  62. package/dist/src/mixpanel-service.d.ts.map +1 -1
  63. package/dist/src/types.d.ts +155 -6
  64. package/dist/src/types.d.ts.map +1 -1
  65. package/dist/src/utils/processData.d.ts.map +1 -1
  66. package/dist/src/utils/reporting.d.ts +16 -0
  67. package/dist/src/utils/reporting.d.ts.map +1 -0
  68. package/dist/src/utils/reporting.spec.d.ts +2 -0
  69. package/dist/src/utils/reporting.spec.d.ts.map +1 -0
  70. package/dist/tsembed-react.es.js +192 -38
  71. package/dist/tsembed-react.js +192 -38
  72. package/dist/tsembed.es.js +239 -39
  73. package/dist/tsembed.js +239 -39
  74. package/dist/visual-embed-sdk-react-full.d.ts +183 -9
  75. package/dist/visual-embed-sdk-react.d.ts +183 -9
  76. package/dist/visual-embed-sdk.d.ts +183 -9
  77. package/lib/package.json +1 -1
  78. package/lib/src/auth.d.ts.map +1 -1
  79. package/lib/src/auth.js +6 -5
  80. package/lib/src/auth.js.map +1 -1
  81. package/lib/src/authToken.d.ts.map +1 -1
  82. package/lib/src/authToken.js +5 -7
  83. package/lib/src/authToken.js.map +1 -1
  84. package/lib/src/embed/app.d.ts +12 -1
  85. package/lib/src/embed/app.d.ts.map +1 -1
  86. package/lib/src/embed/app.js +12 -3
  87. package/lib/src/embed/app.js.map +1 -1
  88. package/lib/src/embed/app.spec.js +31 -1
  89. package/lib/src/embed/app.spec.js.map +1 -1
  90. package/lib/src/embed/base.d.ts.map +1 -1
  91. package/lib/src/embed/base.js +2 -0
  92. package/lib/src/embed/base.js.map +1 -1
  93. package/lib/src/embed/search.d.ts +15 -1
  94. package/lib/src/embed/search.d.ts.map +1 -1
  95. package/lib/src/embed/search.js +6 -4
  96. package/lib/src/embed/search.js.map +1 -1
  97. package/lib/src/embed/search.spec.js +9 -9
  98. package/lib/src/embed/search.spec.js.map +1 -1
  99. package/lib/src/embed/ts-embed.d.ts +1 -1
  100. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  101. package/lib/src/embed/ts-embed.js +10 -6
  102. package/lib/src/embed/ts-embed.js.map +1 -1
  103. package/lib/src/errors.d.ts +11 -0
  104. package/lib/src/errors.d.ts.map +1 -1
  105. package/lib/src/errors.js +11 -0
  106. package/lib/src/errors.js.map +1 -1
  107. package/lib/src/mixpanel-service.d.ts.map +1 -1
  108. package/lib/src/mixpanel-service.js +2 -1
  109. package/lib/src/mixpanel-service.js.map +1 -1
  110. package/lib/src/react/index.spec.js +1 -1
  111. package/lib/src/react/index.spec.js.map +1 -1
  112. package/lib/src/types.d.ts +155 -6
  113. package/lib/src/types.d.ts.map +1 -1
  114. package/lib/src/types.js +128 -3
  115. package/lib/src/types.js.map +1 -1
  116. package/lib/src/utils/processData.d.ts.map +1 -1
  117. package/lib/src/utils/processData.js +2 -1
  118. package/lib/src/utils/processData.js.map +1 -1
  119. package/lib/src/utils/reporting.d.ts +16 -0
  120. package/lib/src/utils/reporting.d.ts.map +1 -0
  121. package/lib/src/utils/reporting.js +62 -0
  122. package/lib/src/utils/reporting.js.map +1 -0
  123. package/lib/src/utils/reporting.spec.d.ts +2 -0
  124. package/lib/src/utils/reporting.spec.d.ts.map +1 -0
  125. package/lib/src/utils/reporting.spec.js +74 -0
  126. package/lib/src/utils/reporting.spec.js.map +1 -0
  127. package/lib/src/visual-embed-sdk.d.ts +183 -9
  128. package/package.json +1 -1
  129. package/src/auth.ts +6 -5
  130. package/src/authToken.ts +5 -9
  131. package/src/embed/app.spec.ts +46 -0
  132. package/src/embed/app.ts +20 -3
  133. package/src/embed/base.ts +3 -1
  134. package/src/embed/search.spec.ts +9 -9
  135. package/src/embed/search.ts +21 -4
  136. package/src/embed/ts-embed.ts +13 -6
  137. package/src/errors.ts +11 -0
  138. package/src/mixpanel-service.ts +2 -1
  139. package/src/react/index.spec.tsx +1 -1
  140. package/src/types.ts +158 -3
  141. package/src/utils/processData.ts +2 -3
  142. package/src/utils/reporting.spec.ts +91 -0
  143. package/src/utils/reporting.ts +71 -0
@@ -92,6 +92,11 @@ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
92
92
  */
93
93
  EXPAND_FIRST = "EXPAND_FIRST"
94
94
  }
95
+ export enum HomePageSearchBarMode {
96
+ OBJECT_SEARCH = "objectSearch",
97
+ AI_ANSWER = "aiAnswer",
98
+ NONE = "none"
99
+ }
95
100
  /**
96
101
  * The view configuration for full app embedding.
97
102
  * @group Embed components
@@ -280,7 +285,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
280
285
  fullHeight?: boolean;
281
286
  /**
282
287
  * Flag to control Data panel experience
283
- * @default false
288
+ * @default true
284
289
  * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
285
290
  * @example
286
291
  * ```js
@@ -365,6 +370,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
365
370
  * To set the initial state of the search bar in case of saved-answers.
366
371
  * @version SDK: 1.32.0 | Thoughtspot: 10.0.0.cl
367
372
  * @default false
373
+ * @deprecated Use {@link collapseSearchBar} instead
368
374
  */
369
375
  collapseSearchBarInitially?: boolean;
370
376
  /**
@@ -418,6 +424,11 @@ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
418
424
  * @version SDK : 1.29.0 | Thoughtspot : 10.1.0.cl
419
425
  */
420
426
  isOnBeforeGetVizDataInterceptEnabled?: boolean;
427
+ /**
428
+ * Flag to use home page search bar mode
429
+ * @version SDK : 1.33.0 | Thoughtspot : 10.2.0.cl
430
+ */
431
+ homePageSearchBarMode?: HomePageSearchBarMode;
421
432
  }
422
433
  /**
423
434
  * Embeds full ThoughtSpot experience in a host application.
@@ -977,6 +988,19 @@ declare module '@thoughtspot/visual-embed-sdk/embed/search' {
977
988
  * ```
978
989
  */
979
990
  collapseDataSources?: boolean;
991
+ /**
992
+ * If set to true, the data panel is collapsed on load,
993
+ * but can be expanded manually.
994
+ * @version: SDK: 1.34.0 | ThoughtSpot: 10.3.0.cl
995
+ * @example
996
+ * ```js
997
+ * const embed = new SearchEmbed('#tsEmbed', {
998
+ * ... // other options
999
+ * collapseDataPanel:true,
1000
+ * })
1001
+ * ```
1002
+ */
1003
+ collapseDataPanel?: boolean;
980
1004
  /**
981
1005
  * Show or hide the data sources panel.
982
1006
  * @version: SDK: 1.2.0 | ThoughtSpot: 9.1.0.sw
@@ -1105,7 +1129,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/search' {
1105
1129
  hideSearchBar?: boolean;
1106
1130
  /**
1107
1131
  * Flag to control Data panel experience
1108
- * @default false
1132
+ * @default true
1109
1133
  * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
1110
1134
  * @example
1111
1135
  * ```js
@@ -1125,6 +1149,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/search' {
1125
1149
  * To set the initial state of the search bar in case of saved-answers.
1126
1150
  * @default false
1127
1151
  * @version SDK: 1.32.0 | Thoughtspot: 10.0.0.cl
1152
+ * @deprecated Use {@link collapseSearchBar} instead
1128
1153
  */
1129
1154
  collapseSearchBarInitially?: boolean;
1130
1155
  /**
@@ -1735,7 +1760,11 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
1735
1760
  /**
1736
1761
  * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
1737
1762
  */
1738
- SpotIQAnalysis = "spotiq-analysis"
1763
+ SpotIQAnalysis = "spotiq-analysis",
1764
+ /**
1765
+ * @version SDK: 1.34.0| ThoughtSpot: 10.3.0.cl
1766
+ */
1767
+ LiveboardSchedules = "liveboard-schedules"
1739
1768
  }
1740
1769
  export type DOMSelector = string | HTMLElement;
1741
1770
  /**
@@ -2520,6 +2549,30 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
2520
2549
  * @version SDK: 1.31.2 | ThoughtSpot: 10.0.0.cl
2521
2550
  */
2522
2551
  enableV2Shell_experimental?: boolean;
2552
+ /**
2553
+ * To set the initial state of the search bar in case of saved-answers.
2554
+ * @default true
2555
+ * @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
2556
+ * @example
2557
+ * ```js
2558
+ * const embed = new LiveboardEmbed('#embed', {
2559
+ * liveboardId: '123',
2560
+ * collapseSearchBar: true
2561
+ * });
2562
+ */
2563
+ collapseSearchBar?: boolean;
2564
+ /**
2565
+ * This flag can be used to disable links inside the embedded app,
2566
+ * and disables redirection of links in a new tab.
2567
+ * @example
2568
+ * ```js
2569
+ * const embed = new LiveboardEmbed('#embed', {
2570
+ * disableRedirectionLinksInNewTab: true
2571
+ * });
2572
+ * ```
2573
+ * @version SDK: 1.32.1 | ThoughtSpot: 10.3.0.cl
2574
+ */
2575
+ disableRedirectionLinksInNewTab?: boolean;
2523
2576
  }
2524
2577
  /**
2525
2578
  * MessagePayload: Embed event payload: message type, data and status (start/end)
@@ -3982,13 +4035,15 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
3982
4035
  *
3983
4036
  * @example
3984
4037
  * ```js
3985
- * appEmbed.trigger(HostEvent.CreateMonitor)
4038
+ * searchEmbed.trigger(HostEvent.CreateMonitor)
3986
4039
  * ```
3987
4040
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
3988
4041
  */
3989
4042
  CreateMonitor = "createMonitor",
3990
4043
  /**
3991
- * Trigger the **Manage alerts** action on a visualization
4044
+ * Trigger the **Manage alerts** action on a KPI chart
4045
+ * in a visualization or saved Answer.
4046
+ *
3992
4047
  * @param - an object with `vizId` as a key
3993
4048
  * @example
3994
4049
  * ```js
@@ -3996,6 +4051,16 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
3996
4051
  * vizId: '730496d6-6903-4601-937e-2c691821af3c'
3997
4052
  * })
3998
4053
  * ```
4054
+ *
4055
+ * @example
4056
+ * ```js
4057
+ * searchEmbed.trigger(HostEvent.ManageMonitor)
4058
+ * ```
4059
+ *
4060
+ * @example
4061
+ * ```js
4062
+ * vizEmbed.trigger(HostEvent.ManageMonitor)
4063
+ * ```
3999
4064
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
4000
4065
  */
4001
4066
  ManageMonitor = "manageMonitor",
@@ -4567,7 +4632,9 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
4567
4632
  Enable2ColumnLayout = "enable2ColumnLayout",
4568
4633
  IsFullAppEmbed = "isFullAppEmbed",
4569
4634
  IsOnBeforeGetVizDataInterceptEnabled = "isOnBeforeGetVizDataInterceptEnabled",
4570
- FocusSearchBarOnRender = "focusSearchBarOnRender"
4635
+ FocusSearchBarOnRender = "focusSearchBarOnRender",
4636
+ DisableRedirectionLinksInNewTab = "disableRedirectionLinksInNewTab",
4637
+ HomePageSearchBarMode = "homePageSearchBarMode"
4571
4638
  }
4572
4639
  /**
4573
4640
  * ThoughtSpot application pages include actions and menu commands
@@ -4716,6 +4783,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
4716
4783
  */
4717
4784
  ConfigureFilter = "configureFilter",
4718
4785
  CollapseDataSources = "collapseDataSources",
4786
+ CollapseDataPanel = "collapseDataPanel",
4719
4787
  /**
4720
4788
  * The **Choose sources** button on Search page.
4721
4789
  * Allows selecting data sources for search queries.
@@ -5111,12 +5179,15 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
5111
5179
  * The Create alert action on KPI charts.
5112
5180
  * @example
5113
5181
  * ```js
5114
- * disabledActions: [Action.CreateMonitor ]
5182
+ * disabledActions: [Action.CreateMonitor]
5115
5183
  * ```
5116
5184
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
5117
5185
  */
5118
5186
  CreateMonitor = "createMonitor",
5119
5187
  /**
5188
+ * @deprecated
5189
+ * Reports errors
5190
+ *
5120
5191
  * @example
5121
5192
  * ```js
5122
5193
  * disabledActions: [Action.ReportError]
@@ -5341,35 +5412,84 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
5341
5412
  */
5342
5413
  RenameModalTitleDescription = "renameModalTitleDescription",
5343
5414
  /**
5415
+ *
5416
+ * @example
5417
+ * ```js
5418
+ * disabledActions: [Action.RequestVerification]
5419
+ * ```
5344
5420
  *
5345
5421
  * @version SDK: 1.25.0 | Thoughtspot: 9.6.0.cl
5346
5422
  */
5347
5423
  RequestVerification = "requestVerification",
5348
5424
  /**
5425
+ *
5426
+ * Allows users to mark a Liveboard as verified.
5427
+ *
5428
+ * @example
5429
+ * ```js
5430
+ * disabledActions: [Action.MarkAsVerified]
5431
+ * ```
5349
5432
  * @version SDK: 1.25.0 | Thoughtspot: 9.6.0.cl
5350
5433
  */
5351
5434
  MarkAsVerified = "markAsVerified",
5352
5435
  /**
5436
+ * The **Add Tab** action on a Liveboard.
5437
+ * Allows adding a new tab to a Liveboard view.
5438
+ *
5439
+ * @example
5440
+ * ```js
5441
+ * disabledActions: [Action.AddTab]
5442
+ * ```
5353
5443
  * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
5354
5444
  */
5355
5445
  AddTab = "addTab",
5356
5446
  /**
5447
+ *
5448
+ * Initiates contextual change analysis on KPI charts.
5449
+ *
5450
+ * @example
5451
+ * ```js
5452
+ * disabledActions: [Action.EnableContextualChangeAnalysis]
5453
+ * ```
5357
5454
  * @version SDK: 1.25.0 | Thoughtspot: 9.6.0.cl
5358
5455
  */
5359
5456
  EnableContextualChangeAnalysis = "enableContextualChangeAnalysis",
5360
5457
  /**
5458
+ *
5459
+ * @example
5460
+ * ```js
5461
+ * disabledActions: [Action.ShowSageQuery]
5462
+ * ```
5463
+ *
5361
5464
  * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
5362
5465
  */
5363
5466
  ShowSageQuery = "showSageQuery",
5364
5467
  /**
5468
+ *
5469
+ * @example
5470
+ * ```js
5471
+ * disabledActions: [Action.EditSageAnswer]
5472
+ * ```
5365
5473
  * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
5366
5474
  */
5367
5475
  EditSageAnswer = "editSageAnswer",
5368
5476
  /**
5477
+ *
5478
+ * This action allows users to send feedback on AI-generated Answers.
5479
+ *
5480
+ * @example
5481
+ * ```js
5482
+ * disabledActions: [Action.SageAnswerFeedback]
5483
+ * ```
5369
5484
  * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
5370
5485
  */
5371
5486
  SageAnswerFeedback = "sageAnswerFeedback",
5372
5487
  /**
5488
+ *
5489
+ * @example
5490
+ * ```js
5491
+ * disabledActions: [Action.ModifySageAnswer]
5492
+ * ```
5373
5493
  * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
5374
5494
  */
5375
5495
  ModifySageAnswer = "modifySageAnswer",
@@ -5490,7 +5610,61 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
5490
5610
  * ```
5491
5611
  * @version SDK: 1.27.10 | Thoughtspot: 9.12.5.cl
5492
5612
  */
5493
- AIHighlights = "AIHighlights"
5613
+ AIHighlights = "AIHighlights",
5614
+ /**
5615
+ * Action ID for edit schedule action on schedule on homepage
5616
+ * @example
5617
+ * ```js
5618
+ * disabledActions: [Action.EditScheduleHomepage]
5619
+ * ```
5620
+ * @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
5621
+ */
5622
+ EditScheduleHomepage = "editScheduleHomepage",
5623
+ /**
5624
+ * Action ID for pause schedule action on schedule on homepage
5625
+ * @example
5626
+ * ```js
5627
+ * disabledActions: [Action.PauseScheduleHomepage]
5628
+ * ```
5629
+ * @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
5630
+ */
5631
+ PauseScheduleHomepage = "pauseScheduleHomepage",
5632
+ /**
5633
+ * Action ID for view schedule run action on schedule on homepage
5634
+ * @example
5635
+ * ```js
5636
+ * disabledActions: [Action.ViewScheduleRunHomepage]
5637
+ * ```
5638
+ * @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
5639
+ */
5640
+ ViewScheduleRunHomepage = "viewScheduleRunHomepage",
5641
+ /**
5642
+ * Action ID for unsubscribe schedule action on schedule on homepage
5643
+ * @example
5644
+ * ```js
5645
+ * disabledActions: [Action.UnsubscribeScheduleHomepage]
5646
+ * ```
5647
+ * @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
5648
+ */
5649
+ UnsubscribeScheduleHomepage = "unsubscribeScheduleHomepage",
5650
+ /**
5651
+ * Action ID for delete schedule action on schedule on homepage
5652
+ * @example
5653
+ * ```js
5654
+ * disabledActions: [Action.DeleteScheduleHomepage]
5655
+ * ```
5656
+ * @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
5657
+ */
5658
+ DeleteScheduleHomepage = "deleteScheduleHomepage",
5659
+ /**
5660
+ * The **Analyze CTA** action on KPI chart.
5661
+ * @example
5662
+ * ```js
5663
+ * disabledActions: [Action.KPIAnalysisCTA]
5664
+ * ```
5665
+ * @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
5666
+ */
5667
+ KPIAnalysisCTA = "kpiAnalysisCTA"
5494
5668
  }
5495
5669
  export interface AnswerServiceType {
5496
5670
  getAnswer?: (offset: number, batchSize: number) => any;
@@ -6428,7 +6602,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/ts-embed' {
6428
6602
  * @param queryParams
6429
6603
  * @returns queryParams
6430
6604
  */
6431
- protected getBaseQueryParams(queryParams?: {}): {};
6605
+ protected getBaseQueryParams(queryParams?: Record<any, any>): Record<any, any>;
6432
6606
  /**
6433
6607
  * Constructs the base URL string to load v1 of the ThoughtSpot app.
6434
6608
  * This is used for embedding Liveboards, visualizations, and full application.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thoughtspot/visual-embed-sdk",
3
- "version": "1.33.0-alpha.1",
3
+ "version": "1.33.0-alpha.2",
4
4
  "description": "ThoughtSpot Embed SDK",
5
5
  "module": "lib/src/index.js",
6
6
  "main": "dist/tsembed.js",
package/src/auth.ts CHANGED
@@ -16,6 +16,7 @@ import {
16
16
  import { isActiveService } from './utils/authService/tokenizedAuthService';
17
17
  import { logger } from './utils/logger';
18
18
  import { getSessionInfo } from './utils/sessionInfoService';
19
+ import { ERROR_MESSAGE } from './errors';
19
20
 
20
21
  // eslint-disable-next-line import/no-mutable-exports
21
22
  export let loggedInStatus = false;
@@ -151,7 +152,7 @@ export function setAuthEE(eventEmitter: EventEmitter<AuthStatus | AuthEvent>): v
151
152
  */
152
153
  export function notifyAuthSDKSuccess(): void {
153
154
  if (!authEE) {
154
- logger.error('SDK not initialized');
155
+ logger.error(ERROR_MESSAGE.SDK_NOT_INITIALIZED);
155
156
  return;
156
157
  }
157
158
  authEE.emit(AuthStatus.SDK_SUCCESS);
@@ -162,14 +163,14 @@ export function notifyAuthSDKSuccess(): void {
162
163
  */
163
164
  export async function notifyAuthSuccess(): Promise<void> {
164
165
  if (!authEE) {
165
- logger.error('SDK not initialized');
166
+ logger.error(ERROR_MESSAGE.SDK_NOT_INITIALIZED);
166
167
  return;
167
168
  }
168
169
  try {
169
170
  const sessionInfo = await getSessionInfo();
170
171
  authEE.emit(AuthStatus.SUCCESS, sessionInfo);
171
172
  } catch (e) {
172
- logger.error('Failed to get session info');
173
+ logger.error(ERROR_MESSAGE.SESSION_INFO_FAILED);
173
174
  }
174
175
  }
175
176
 
@@ -179,7 +180,7 @@ export async function notifyAuthSuccess(): Promise<void> {
179
180
  */
180
181
  export function notifyAuthFailure(failureType: AuthFailureType): void {
181
182
  if (!authEE) {
182
- logger.error('SDK not initialized');
183
+ logger.error(ERROR_MESSAGE.SDK_NOT_INITIALIZED);
183
184
  return;
184
185
  }
185
186
  authEE.emit(AuthStatus.FAILURE, failureType);
@@ -190,7 +191,7 @@ export function notifyAuthFailure(failureType: AuthFailureType): void {
190
191
  */
191
192
  export function notifyLogout(): void {
192
193
  if (!authEE) {
193
- logger.error('SDK not initialized');
194
+ logger.error(ERROR_MESSAGE.SDK_NOT_INITIALIZED);
194
195
  return;
195
196
  }
196
197
  authEE.emit(AuthStatus.LOGOUT);
package/src/authToken.ts CHANGED
@@ -1,12 +1,8 @@
1
+ import { ERROR_MESSAGE } from './errors';
1
2
  import { EmbedConfig } from './types';
2
3
  import { fetchAuthTokenService, verifyTokenService } from './utils/authService/authService';
3
4
  import { logger } from './utils/logger';
4
5
 
5
- const DUPLICATE_TOKEN_ERR = 'Duplicate token, please issue a new token every time getAuthToken callback is called.'
6
- + 'See https://developers.thoughtspot.com/docs/?pageid=embed-auth#trusted-auth-embed for more details.';
7
-
8
- const INVALID_TOKEN_ERR = 'Invalid token received form token callback or authToken endpoint.';
9
-
10
6
  let cachedAuthToken: string | null = null;
11
7
 
12
8
  // This method can be used to get the authToken using the embedConfig
@@ -38,7 +34,7 @@ export async function getAuthenticationToken(embedConfig: EmbedConfig): Promise<
38
34
  // this will throw error if the token is not valid
39
35
  await validateAuthToken(embedConfig, authToken);
40
36
  } catch (e) {
41
- logger.error(`Received invalid token from getAuthToken callback or authToken endpoint. Error : ${e.message}`);
37
+ logger.error(`${ERROR_MESSAGE.INVALID_TOKEN_ERROR} Error : ${e.message}`);
42
38
  throw e;
43
39
  }
44
40
 
@@ -65,11 +61,11 @@ const validateAuthToken = async (
65
61
  if (cachedAuthToken && cachedAuthToken === authToken) {
66
62
  if (!embedConfig.suppressErrorAlerts && !suppressAlert) {
67
63
  // eslint-disable-next-line no-alert
68
- alert(DUPLICATE_TOKEN_ERR);
64
+ alert(ERROR_MESSAGE.DUPLICATE_TOKEN_ERR);
69
65
  }
70
- throw new Error(DUPLICATE_TOKEN_ERR);
66
+ throw new Error(ERROR_MESSAGE.DUPLICATE_TOKEN_ERR);
71
67
  } else {
72
- throw new Error(INVALID_TOKEN_ERR);
68
+ throw new Error(ERROR_MESSAGE.INVALID_TOKEN_ERROR);
73
69
  }
74
70
  };
75
71
 
@@ -3,6 +3,7 @@ import {
3
3
  AppViewConfig,
4
4
  DataPanelCustomColumnGroupsAccordionState,
5
5
  Page,
6
+ HomePageSearchBarMode,
6
7
  } from './app';
7
8
  import { init } from '../index';
8
9
  import {
@@ -431,6 +432,51 @@ describe('App embed tests', () => {
431
432
  });
432
433
  });
433
434
 
435
+ test('Should add HomePageSearchBarMode flag with object search to the iframe src', async () => {
436
+ const appEmbed = new AppEmbed(getRootEl(), {
437
+ ...defaultViewConfig,
438
+ homePageSearchBarMode: HomePageSearchBarMode.OBJECT_SEARCH,
439
+ } as AppViewConfig);
440
+
441
+ await appEmbed.render();
442
+ await executeAfterWait(() => {
443
+ expectUrlMatchesWithParams(
444
+ getIFrameSrc(),
445
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&homePageSearchBarMode=objectSearch${defaultParams}${defaultParamsPost}#/home`,
446
+ );
447
+ });
448
+ });
449
+
450
+ test('Should add HomePageSearchBarMode flag with ai answer to the iframe src', async () => {
451
+ const appEmbed = new AppEmbed(getRootEl(), {
452
+ ...defaultViewConfig,
453
+ homePageSearchBarMode: HomePageSearchBarMode.AI_ANSWER,
454
+ } as AppViewConfig);
455
+
456
+ await appEmbed.render();
457
+ await executeAfterWait(() => {
458
+ expectUrlMatchesWithParams(
459
+ getIFrameSrc(),
460
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&homePageSearchBarMode=aiAnswer${defaultParams}${defaultParamsPost}#/home`,
461
+ );
462
+ });
463
+ });
464
+
465
+ test('Should add HomePageSearchBarMode flag with none to the iframe src', async () => {
466
+ const appEmbed = new AppEmbed(getRootEl(), {
467
+ ...defaultViewConfig,
468
+ homePageSearchBarMode: HomePageSearchBarMode.NONE,
469
+ } as AppViewConfig);
470
+
471
+ await appEmbed.render();
472
+ await executeAfterWait(() => {
473
+ expectUrlMatchesWithParams(
474
+ getIFrameSrc(),
475
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&homePageSearchBarMode=none${defaultParams}${defaultParamsPost}#/home`,
476
+ );
477
+ });
478
+ });
479
+
434
480
  test('Should add dataPanelCustomGroupsAccordionInitialState flag to the iframe src', async () => {
435
481
  const appEmbed = new AppEmbed(getRootEl(), {
436
482
  ...defaultViewConfig,
package/src/embed/app.ts CHANGED
@@ -74,6 +74,11 @@ export enum DataPanelCustomColumnGroupsAccordionState {
74
74
  EXPAND_FIRST = 'EXPAND_FIRST',
75
75
  }
76
76
 
77
+ export enum HomePageSearchBarMode {
78
+ OBJECT_SEARCH = 'objectSearch',
79
+ AI_ANSWER = 'aiAnswer',
80
+ NONE = 'none'
81
+ }
77
82
  /**
78
83
  * The view configuration for full app embedding.
79
84
  * @group Embed components
@@ -262,7 +267,7 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
262
267
  fullHeight?: boolean;
263
268
  /**
264
269
  * Flag to control Data panel experience
265
- * @default false
270
+ * @default true
266
271
  * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
267
272
  * @example
268
273
  * ```js
@@ -347,6 +352,7 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
347
352
  * To set the initial state of the search bar in case of saved-answers.
348
353
  * @version SDK: 1.32.0 | Thoughtspot: 10.0.0.cl
349
354
  * @default false
355
+ * @deprecated Use {@link collapseSearchBar} instead
350
356
  */
351
357
  collapseSearchBarInitially?: boolean;
352
358
  /**
@@ -400,6 +406,11 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
400
406
  * @version SDK : 1.29.0 | Thoughtspot : 10.1.0.cl
401
407
  */
402
408
  isOnBeforeGetVizDataInterceptEnabled?: boolean;
409
+ /**
410
+ * Flag to use home page search bar mode
411
+ * @version SDK : 1.33.0 | Thoughtspot : 10.2.0.cl
412
+ */
413
+ homePageSearchBarMode?: HomePageSearchBarMode;
403
414
  }
404
415
 
405
416
  /**
@@ -437,7 +448,7 @@ export class AppEmbed extends V1Embed {
437
448
  hideOrgSwitcher,
438
449
  enableSearchAssist,
439
450
  fullHeight,
440
- dataPanelV2 = false,
451
+ dataPanelV2 = true,
441
452
  hideLiveboardHeader = false,
442
453
  showLiveboardTitle = true,
443
454
  showLiveboardDescription = true,
@@ -451,6 +462,8 @@ export class AppEmbed extends V1Embed {
451
462
  isOnBeforeGetVizDataInterceptEnabled = false,
452
463
  /* eslint-disable-next-line max-len */
453
464
  dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL,
465
+ collapseSearchBar = true,
466
+ homePageSearchBarMode,
454
467
  } = this.viewConfig;
455
468
 
456
469
  let params = {};
@@ -500,10 +513,14 @@ export class AppEmbed extends V1Embed {
500
513
  ] = isOnBeforeGetVizDataInterceptEnabled;
501
514
  }
502
515
 
516
+ if (homePageSearchBarMode) {
517
+ params[Param.HomePageSearchBarMode] = homePageSearchBarMode;
518
+ }
519
+
503
520
  params[Param.DataPanelV2Enabled] = dataPanelV2;
504
521
  params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
505
522
  params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
506
- params[Param.CollapseSearchBarInitially] = collapseSearchBarInitially;
523
+ params[Param.CollapseSearchBarInitially] = collapseSearchBarInitially || collapseSearchBar;
507
524
  params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
508
525
  if (dataPanelCustomGroupsAccordionInitialState
509
526
  === DataPanelCustomColumnGroupsAccordionState.COLLAPSE_ALL
package/src/embed/base.ts CHANGED
@@ -8,6 +8,7 @@
8
8
  * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
9
9
  */
10
10
  import EventEmitter from 'eventemitter3';
11
+ import { registerReportingObserver } from '../utils/reporting';
11
12
  import { resetCachedAuthToken } from '../authToken';
12
13
  import { logger, setGlobalLogLevelOverride } from '../utils/logger';
13
14
  import { tokenizedFetch } from '../tokenizedFetch';
@@ -188,6 +189,7 @@ export const init = (embedConfig: EmbedConfig): AuthEventEmitter => {
188
189
  );
189
190
 
190
191
  setGlobalLogLevelOverride(embedConfig.logLevel);
192
+ registerReportingObserver();
191
193
 
192
194
  const authEE = new EventEmitter<AuthStatus | AuthEvent>();
193
195
  setAuthEE(authEE);
@@ -252,7 +254,7 @@ export const renderInQueue = (fn: (next?: (val?: any) => void) => Promise<any>):
252
254
  return renderQueue;
253
255
  }
254
256
  // Sending an empty function to keep it consistent with the above usage.
255
- return fn(() => { }); // eslint-disable-line @typescript-eslint/no-empty-function
257
+ return fn(() => {}); // eslint-disable-line @typescript-eslint/no-empty-function
256
258
  };
257
259
 
258
260
  /**
@@ -52,7 +52,7 @@ describe('Search embed tests', () => {
52
52
  await executeAfterWait(() => {
53
53
  expectUrlMatchesWithParams(
54
54
  getIFrameSrc(),
55
- `http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&enableDataPanelV2=false&dataSourceMode=expand&useLastSelectedSources=false${prefixParams}#/embed/answer`,
55
+ `http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&enableDataPanelV2=true&dataSourceMode=expand&useLastSelectedSources=false${prefixParams}#/embed/answer`,
56
56
  );
57
57
  });
58
58
  });
@@ -416,16 +416,16 @@ describe('Search embed tests', () => {
416
416
  });
417
417
  });
418
418
 
419
- test('should set enableDataPanelV2 to true if data panel v2 flag is true', async () => {
419
+ test('should set enableDataPanelV2 to false if data panel v2 flag is false', async () => {
420
420
  const searchEmbed = new SearchEmbed(getRootEl(), {
421
421
  ...defaultViewConfig,
422
- dataPanelV2: true,
422
+ dataPanelV2: false,
423
423
  });
424
424
  searchEmbed.render();
425
425
  await executeAfterWait(() => {
426
426
  expectUrlMatchesWithParams(
427
427
  getIFrameSrc(),
428
- `http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSourceMode=expand&enableDataPanelV2=true&useLastSelectedSources=false${prefixParams}#/embed/saved-answer/${answerId}`,
428
+ `http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSourceMode=expand&enableDataPanelV2=false&useLastSelectedSources=false${prefixParams}#/embed/saved-answer/${answerId}`,
429
429
  );
430
430
  });
431
431
  });
@@ -438,7 +438,7 @@ describe('Search embed tests', () => {
438
438
  await executeAfterWait(() => {
439
439
  expectUrlMatchesWithParams(
440
440
  getIFrameSrc(),
441
- `http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSourceMode=expand&enableDataPanelV2=false&useLastSelectedSources=true${prefixParams}#/embed/saved-answer/${answerId}`,
441
+ `http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSourceMode=expand&enableDataPanelV2=true&useLastSelectedSources=true${prefixParams}#/embed/saved-answer/${answerId}`,
442
442
  );
443
443
  });
444
444
  });
@@ -453,7 +453,7 @@ describe('Search embed tests', () => {
453
453
  await executeAfterWait(() => {
454
454
  expectUrlMatchesWithParams(
455
455
  getIFrameSrc(),
456
- `http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSources=[%22data-source-1%22]&dataSourceMode=expand&enableDataPanelV2=false&useLastSelectedSources=false${prefixParams}#/embed/saved-answer/${answerId}`,
456
+ `http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSources=[%22data-source-1%22]&dataSourceMode=expand&enableDataPanelV2=true&useLastSelectedSources=false${prefixParams}#/embed/saved-answer/${answerId}`,
457
457
  );
458
458
  });
459
459
  });
@@ -468,7 +468,7 @@ describe('Search embed tests', () => {
468
468
  await executeAfterWait(() => {
469
469
  expectUrlMatchesWithParams(
470
470
  getIFrameSrc(),
471
- `http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSources=[%22data-source-1%22]&dataSourceMode=expand&enableDataPanelV2=false&useLastSelectedSources=false${prefixParams}#/embed/saved-answer/${answerId}`,
471
+ `http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSources=[%22data-source-1%22]&dataSourceMode=expand&enableDataPanelV2=true&useLastSelectedSources=false${prefixParams}#/embed/saved-answer/${answerId}`,
472
472
  );
473
473
  });
474
474
  });
@@ -499,7 +499,7 @@ describe('Search embed tests', () => {
499
499
  await executeAfterWait(() => {
500
500
  expectUrlMatchesWithParams(
501
501
  getIFrameSrc(),
502
- `http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSourceMode=expand&enableDataPanelV2=false&useLastSelectedSources=false&hideSearchBar=true${prefixParams}#/embed/saved-answer/${answerId}`,
502
+ `http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSourceMode=expand&enableDataPanelV2=true&useLastSelectedSources=false&hideSearchBar=true${prefixParams}#/embed/saved-answer/${answerId}`,
503
503
  );
504
504
  });
505
505
  });
@@ -514,7 +514,7 @@ describe('Search embed tests', () => {
514
514
  await executeAfterWait(() => {
515
515
  expectUrlMatchesWithParams(
516
516
  getIFrameSrc(),
517
- `http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSourceMode=expand&enableDataPanelV2=false&useLastSelectedSources=false&dataPanelCustomGroupsAccordionInitialState=EXPAND_FIRST${prefixParams}#/embed/saved-answer/${answerId}`,
517
+ `http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSourceMode=expand&enableDataPanelV2=true&useLastSelectedSources=false&dataPanelCustomGroupsAccordionInitialState=EXPAND_FIRST${prefixParams}#/embed/saved-answer/${answerId}`,
518
518
  );
519
519
  });
520
520
  });