@thoughtspot/visual-embed-sdk 1.32.0 → 1.32.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) 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 +1 -0
  9. package/cjs/src/embed/app.d.ts.map +1 -1
  10. package/cjs/src/embed/app.js +2 -2
  11. package/cjs/src/embed/app.js.map +1 -1
  12. package/cjs/src/embed/base.d.ts.map +1 -1
  13. package/cjs/src/embed/base.js +2 -0
  14. package/cjs/src/embed/base.js.map +1 -1
  15. package/cjs/src/embed/search.d.ts +14 -0
  16. package/cjs/src/embed/search.d.ts.map +1 -1
  17. package/cjs/src/embed/search.js +5 -3
  18. package/cjs/src/embed/search.js.map +1 -1
  19. package/cjs/src/embed/ts-embed.d.ts +1 -1
  20. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  21. package/cjs/src/embed/ts-embed.js +10 -6
  22. package/cjs/src/embed/ts-embed.js.map +1 -1
  23. package/cjs/src/errors.d.ts +11 -0
  24. package/cjs/src/errors.d.ts.map +1 -1
  25. package/cjs/src/errors.js +11 -0
  26. package/cjs/src/errors.js.map +1 -1
  27. package/cjs/src/mixpanel-service.d.ts.map +1 -1
  28. package/cjs/src/mixpanel-service.js +2 -1
  29. package/cjs/src/mixpanel-service.js.map +1 -1
  30. package/cjs/src/react/index.spec.js +1 -1
  31. package/cjs/src/react/index.spec.js.map +1 -1
  32. package/cjs/src/types.d.ts +167 -6
  33. package/cjs/src/types.d.ts.map +1 -1
  34. package/cjs/src/types.js +140 -3
  35. package/cjs/src/types.js.map +1 -1
  36. package/cjs/src/utils/processData.d.ts.map +1 -1
  37. package/cjs/src/utils/processData.js +2 -1
  38. package/cjs/src/utils/processData.js.map +1 -1
  39. package/cjs/src/utils/reporting.d.ts +16 -0
  40. package/cjs/src/utils/reporting.d.ts.map +1 -0
  41. package/cjs/src/utils/reporting.js +68 -0
  42. package/cjs/src/utils/reporting.js.map +1 -0
  43. package/cjs/src/utils/reporting.spec.d.ts +2 -0
  44. package/cjs/src/utils/reporting.spec.d.ts.map +1 -0
  45. package/cjs/src/utils/reporting.spec.js +76 -0
  46. package/cjs/src/utils/reporting.spec.js.map +1 -0
  47. package/dist/src/auth.d.ts.map +1 -1
  48. package/dist/src/authToken.d.ts.map +1 -1
  49. package/dist/src/embed/app.d.ts +1 -0
  50. package/dist/src/embed/app.d.ts.map +1 -1
  51. package/dist/src/embed/base.d.ts.map +1 -1
  52. package/dist/src/embed/search.d.ts +14 -0
  53. package/dist/src/embed/search.d.ts.map +1 -1
  54. package/dist/src/embed/ts-embed.d.ts +1 -1
  55. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  56. package/dist/src/errors.d.ts +11 -0
  57. package/dist/src/errors.d.ts.map +1 -1
  58. package/dist/src/mixpanel-service.d.ts.map +1 -1
  59. package/dist/src/types.d.ts +167 -6
  60. package/dist/src/types.d.ts.map +1 -1
  61. package/dist/src/utils/processData.d.ts.map +1 -1
  62. package/dist/src/utils/reporting.d.ts +16 -0
  63. package/dist/src/utils/reporting.d.ts.map +1 -0
  64. package/dist/src/utils/reporting.spec.d.ts +2 -0
  65. package/dist/src/utils/reporting.spec.d.ts.map +1 -0
  66. package/dist/tsembed-react.es.js +193 -36
  67. package/dist/tsembed-react.js +193 -36
  68. package/dist/tsembed.es.js +240 -37
  69. package/dist/tsembed.js +240 -37
  70. package/dist/visual-embed-sdk-react-full.d.ts +183 -7
  71. package/dist/visual-embed-sdk-react.d.ts +183 -7
  72. package/dist/visual-embed-sdk.d.ts +183 -7
  73. package/lib/package.json +1 -1
  74. package/lib/src/auth.d.ts.map +1 -1
  75. package/lib/src/auth.js +6 -5
  76. package/lib/src/auth.js.map +1 -1
  77. package/lib/src/authToken.d.ts.map +1 -1
  78. package/lib/src/authToken.js +5 -7
  79. package/lib/src/authToken.js.map +1 -1
  80. package/lib/src/embed/app.d.ts +1 -0
  81. package/lib/src/embed/app.d.ts.map +1 -1
  82. package/lib/src/embed/app.js +2 -2
  83. package/lib/src/embed/app.js.map +1 -1
  84. package/lib/src/embed/base.d.ts.map +1 -1
  85. package/lib/src/embed/base.js +2 -0
  86. package/lib/src/embed/base.js.map +1 -1
  87. package/lib/src/embed/search.d.ts +14 -0
  88. package/lib/src/embed/search.d.ts.map +1 -1
  89. package/lib/src/embed/search.js +5 -3
  90. package/lib/src/embed/search.js.map +1 -1
  91. package/lib/src/embed/ts-embed.d.ts +1 -1
  92. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  93. package/lib/src/embed/ts-embed.js +10 -6
  94. package/lib/src/embed/ts-embed.js.map +1 -1
  95. package/lib/src/errors.d.ts +11 -0
  96. package/lib/src/errors.d.ts.map +1 -1
  97. package/lib/src/errors.js +11 -0
  98. package/lib/src/errors.js.map +1 -1
  99. package/lib/src/mixpanel-service.d.ts.map +1 -1
  100. package/lib/src/mixpanel-service.js +2 -1
  101. package/lib/src/mixpanel-service.js.map +1 -1
  102. package/lib/src/react/index.spec.js +1 -1
  103. package/lib/src/react/index.spec.js.map +1 -1
  104. package/lib/src/types.d.ts +167 -6
  105. package/lib/src/types.d.ts.map +1 -1
  106. package/lib/src/types.js +140 -3
  107. package/lib/src/types.js.map +1 -1
  108. package/lib/src/utils/processData.d.ts.map +1 -1
  109. package/lib/src/utils/processData.js +2 -1
  110. package/lib/src/utils/processData.js.map +1 -1
  111. package/lib/src/utils/reporting.d.ts +16 -0
  112. package/lib/src/utils/reporting.d.ts.map +1 -0
  113. package/lib/src/utils/reporting.js +62 -0
  114. package/lib/src/utils/reporting.js.map +1 -0
  115. package/lib/src/utils/reporting.spec.d.ts +2 -0
  116. package/lib/src/utils/reporting.spec.d.ts.map +1 -0
  117. package/lib/src/utils/reporting.spec.js +74 -0
  118. package/lib/src/utils/reporting.spec.js.map +1 -0
  119. package/lib/src/visual-embed-sdk.d.ts +183 -7
  120. package/package.json +1 -1
  121. package/src/auth.ts +6 -5
  122. package/src/authToken.ts +5 -9
  123. package/src/embed/app.ts +3 -1
  124. package/src/embed/base.ts +3 -1
  125. package/src/embed/search.ts +19 -2
  126. package/src/embed/ts-embed.ts +13 -6
  127. package/src/errors.ts +11 -0
  128. package/src/mixpanel-service.ts +2 -1
  129. package/src/react/index.spec.tsx +1 -1
  130. package/src/types.ts +170 -3
  131. package/src/utils/processData.ts +2 -3
  132. package/src/utils/reporting.spec.ts +91 -0
  133. package/src/utils/reporting.ts +71 -0
@@ -365,6 +365,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
365
365
  * To set the initial state of the search bar in case of saved-answers.
366
366
  * @version SDK: 1.32.0 | Thoughtspot: 10.0.0.cl
367
367
  * @default false
368
+ * @deprecated Use {@link collapseSearchBar} instead
368
369
  */
369
370
  collapseSearchBarInitially?: boolean;
370
371
  /**
@@ -977,6 +978,19 @@ declare module '@thoughtspot/visual-embed-sdk/embed/search' {
977
978
  * ```
978
979
  */
979
980
  collapseDataSources?: boolean;
981
+ /**
982
+ * If set to true, the data panel is collapsed on load,
983
+ * but can be expanded manually.
984
+ * @version: SDK: 1.34.0 | ThoughtSpot: 10.3.0.cl
985
+ * @example
986
+ * ```js
987
+ * const embed = new SearchEmbed('#tsEmbed', {
988
+ * ... // other options
989
+ * collapseDataPanel:true,
990
+ * })
991
+ * ```
992
+ */
993
+ collapseDataPanel?: boolean;
980
994
  /**
981
995
  * Show or hide the data sources panel.
982
996
  * @version: SDK: 1.2.0 | ThoughtSpot: 9.1.0.sw
@@ -1125,6 +1139,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/search' {
1125
1139
  * To set the initial state of the search bar in case of saved-answers.
1126
1140
  * @default false
1127
1141
  * @version SDK: 1.32.0 | Thoughtspot: 10.0.0.cl
1142
+ * @deprecated Use {@link collapseSearchBar} instead
1128
1143
  */
1129
1144
  collapseSearchBarInitially?: boolean;
1130
1145
  /**
@@ -1735,7 +1750,11 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
1735
1750
  /**
1736
1751
  * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
1737
1752
  */
1738
- SpotIQAnalysis = "spotiq-analysis"
1753
+ SpotIQAnalysis = "spotiq-analysis",
1754
+ /**
1755
+ * @version SDK: 1.34.0| ThoughtSpot: 10.3.0.cl
1756
+ */
1757
+ LiveboardSchedules = "liveboard-schedules"
1739
1758
  }
1740
1759
  export type DOMSelector = string | HTMLElement;
1741
1760
  /**
@@ -2520,6 +2539,30 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
2520
2539
  * @version SDK: 1.31.2 | ThoughtSpot: 10.0.0.cl
2521
2540
  */
2522
2541
  enableV2Shell_experimental?: boolean;
2542
+ /**
2543
+ * To set the initial state of the search bar in case of saved-answers.
2544
+ * @default true
2545
+ * @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
2546
+ * @example
2547
+ * ```js
2548
+ * const embed = new LiveboardEmbed('#embed', {
2549
+ * liveboardId: '123',
2550
+ * collapseSearchBar: true
2551
+ * });
2552
+ */
2553
+ collapseSearchBar?: boolean;
2554
+ /**
2555
+ * This flag can be used to disable links inside the embedded app,
2556
+ * and disables redirection of links in a new tab.
2557
+ * @example
2558
+ * ```js
2559
+ * const embed = new LiveboardEmbed('#embed', {
2560
+ * disableRedirectionLinksInNewTab: true
2561
+ * });
2562
+ * ```
2563
+ * @version SDK: 1.32.1 | ThoughtSpot: 10.3.0.cl
2564
+ */
2565
+ disableRedirectionLinksInNewTab?: boolean;
2523
2566
  }
2524
2567
  /**
2525
2568
  * MessagePayload: Embed event payload: message type, data and status (start/end)
@@ -3264,6 +3307,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
3264
3307
  /**
3265
3308
  * Emitted when a user clicks the **Update TML** action on
3266
3309
  * embedded Liveboard.
3310
+ *
3267
3311
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
3268
3312
  * @example
3269
3313
  *```js
@@ -3275,6 +3319,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
3275
3319
  /**
3276
3320
  * Emitted when a user clicks the **Edit TML** action
3277
3321
  * on an embedded Liveboard.
3322
+ *
3278
3323
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
3279
3324
  * @example
3280
3325
  *```js
@@ -3882,16 +3927,20 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
3882
3927
  /**
3883
3928
  * Trigger the **Export TML** action on an embedded Liveboard or
3884
3929
  * Answer.
3930
+ *
3885
3931
  * @example
3886
3932
  * ```js
3887
3933
  * liveboardEmbed.trigger(HostEvent.ExportTML)
3888
3934
  * ```
3935
+ *
3889
3936
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
3890
3937
  */
3891
3938
  ExportTML = "exportTSL",
3892
3939
  /**
3893
3940
  * Trigger the **Edit TML** action on an embedded Liveboard or
3894
3941
  * saved Answers in the full application embedding.
3942
+ *
3943
+ *
3895
3944
  * @example
3896
3945
  * ```js
3897
3946
  * liveboardEmbed.trigger(HostEvent.EditTML)
@@ -3982,13 +4031,15 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
3982
4031
  *
3983
4032
  * @example
3984
4033
  * ```js
3985
- * appEmbed.trigger(HostEvent.CreateMonitor)
4034
+ * searchEmbed.trigger(HostEvent.CreateMonitor)
3986
4035
  * ```
3987
4036
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
3988
4037
  */
3989
4038
  CreateMonitor = "createMonitor",
3990
4039
  /**
3991
- * Trigger the **Manage alerts** action on a visualization
4040
+ * Trigger the **Manage alerts** action on a KPI chart
4041
+ * in a visualization or saved Answer.
4042
+ *
3992
4043
  * @param - an object with `vizId` as a key
3993
4044
  * @example
3994
4045
  * ```js
@@ -3996,6 +4047,16 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
3996
4047
  * vizId: '730496d6-6903-4601-937e-2c691821af3c'
3997
4048
  * })
3998
4049
  * ```
4050
+ *
4051
+ * @example
4052
+ * ```js
4053
+ * searchEmbed.trigger(HostEvent.ManageMonitor)
4054
+ * ```
4055
+ *
4056
+ * @example
4057
+ * ```js
4058
+ * vizEmbed.trigger(HostEvent.ManageMonitor)
4059
+ * ```
3999
4060
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
4000
4061
  */
4001
4062
  ManageMonitor = "manageMonitor",
@@ -4006,6 +4067,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
4006
4067
  * This event is not supported in visualization embed and search embed.
4007
4068
  * @param - object - To trigger the action for a specific visualization
4008
4069
  * in Liveboard embed, pass in `vizId` as a key.
4070
+ *
4009
4071
  * @example
4010
4072
  * ```js
4011
4073
  * liveboardEmbed.trigger(HostEvent.Edit)
@@ -4272,6 +4334,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
4272
4334
  /**
4273
4335
  * Get details of filters applied on the Liveboard.
4274
4336
  * Returns arrays containing Liveboard filter and runtime filter elements.
4337
+ *
4275
4338
  * @example
4276
4339
  * ```js
4277
4340
  * const data = await liveboardEmbed.trigger(HostEvent.GetFilters);
@@ -4567,7 +4630,8 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
4567
4630
  Enable2ColumnLayout = "enable2ColumnLayout",
4568
4631
  IsFullAppEmbed = "isFullAppEmbed",
4569
4632
  IsOnBeforeGetVizDataInterceptEnabled = "isOnBeforeGetVizDataInterceptEnabled",
4570
- FocusSearchBarOnRender = "focusSearchBarOnRender"
4633
+ FocusSearchBarOnRender = "focusSearchBarOnRender",
4634
+ DisableRedirectionLinksInNewTab = "disableRedirectionLinksInNewTab"
4571
4635
  }
4572
4636
  /**
4573
4637
  * ThoughtSpot application pages include actions and menu commands
@@ -4617,6 +4681,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
4617
4681
  * The **Save as View** action on the Answer
4618
4682
  * page. Saves an Answer as a View object in the full
4619
4683
  * application embedding mode.
4684
+ *
4620
4685
  * @example
4621
4686
  * ```js
4622
4687
  * disabledActions: [Action.SaveAsView]
@@ -4716,6 +4781,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
4716
4781
  */
4717
4782
  ConfigureFilter = "configureFilter",
4718
4783
  CollapseDataSources = "collapseDataSources",
4784
+ CollapseDataPanel = "collapseDataPanel",
4719
4785
  /**
4720
4786
  * The **Choose sources** button on Search page.
4721
4787
  * Allows selecting data sources for search queries.
@@ -5073,6 +5139,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
5073
5139
  /**
5074
5140
  * The **Delete** action for Answers in the full application
5075
5141
  * embedding mode.
5142
+ *
5076
5143
  * @example
5077
5144
  * ```js
5078
5145
  * disabledActions: [Action.AnswerDelete]
@@ -5111,12 +5178,15 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
5111
5178
  * The Create alert action on KPI charts.
5112
5179
  * @example
5113
5180
  * ```js
5114
- * disabledActions: [Action.CreateMonitor ]
5181
+ * disabledActions: [Action.CreateMonitor]
5115
5182
  * ```
5116
5183
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
5117
5184
  */
5118
5185
  CreateMonitor = "createMonitor",
5119
5186
  /**
5187
+ * @deprecated
5188
+ * Reports errors
5189
+ *
5120
5190
  * @example
5121
5191
  * ```js
5122
5192
  * disabledActions: [Action.ReportError]
@@ -5341,35 +5411,87 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
5341
5411
  */
5342
5412
  RenameModalTitleDescription = "renameModalTitleDescription",
5343
5413
  /**
5414
+ *
5415
+ * The **Request Verification** action on the Liveboard.
5416
+ * Triggers a Liveboard verification request.
5417
+ *
5418
+ * @example
5419
+ * ```js
5420
+ * disabledActions: [Action.RequestVerification]
5421
+ * ```
5344
5422
  *
5345
5423
  * @version SDK: 1.25.0 | Thoughtspot: 9.6.0.cl
5346
5424
  */
5347
5425
  RequestVerification = "requestVerification",
5348
5426
  /**
5427
+ *
5428
+ * Allows users to mark a Liveboard as verified.
5429
+ *
5430
+ * @example
5431
+ * ```js
5432
+ * disabledActions: [Action.MarkAsVerified]
5433
+ * ```
5349
5434
  * @version SDK: 1.25.0 | Thoughtspot: 9.6.0.cl
5350
5435
  */
5351
5436
  MarkAsVerified = "markAsVerified",
5352
5437
  /**
5438
+ * The **Add Tab** action on a Liveboard.
5439
+ * Allows adding a new tab to a Liveboard view.
5440
+ *
5441
+ * @example
5442
+ * ```js
5443
+ * disabledActions: [Action.AddTab]
5444
+ * ```
5353
5445
  * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
5354
5446
  */
5355
5447
  AddTab = "addTab",
5356
5448
  /**
5449
+ *
5450
+ * Initiates contextual change analysis on KPI charts.
5451
+ *
5452
+ * @example
5453
+ * ```js
5454
+ * disabledActions: [Action.EnableContextualChangeAnalysis]
5455
+ * ```
5357
5456
  * @version SDK: 1.25.0 | Thoughtspot: 9.6.0.cl
5358
5457
  */
5359
5458
  EnableContextualChangeAnalysis = "enableContextualChangeAnalysis",
5360
5459
  /**
5460
+ *
5461
+ * @example
5462
+ * ```js
5463
+ * disabledActions: [Action.ShowSageQuery]
5464
+ * ```
5465
+ *
5361
5466
  * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
5362
5467
  */
5363
5468
  ShowSageQuery = "showSageQuery",
5364
5469
  /**
5470
+ *
5471
+ * @example
5472
+ * ```js
5473
+ * disabledActions: [Action.EditSageAnswer]
5474
+ * ```
5365
5475
  * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
5366
5476
  */
5367
5477
  EditSageAnswer = "editSageAnswer",
5368
5478
  /**
5479
+ *
5480
+ * This action allows users to send feedback on AI-generated Answers.
5481
+ *
5482
+ * @example
5483
+ * ```js
5484
+ * disabledActions: [Action.SageAnswerFeedback]
5485
+ * ```
5369
5486
  * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
5370
5487
  */
5371
5488
  SageAnswerFeedback = "sageAnswerFeedback",
5372
5489
  /**
5490
+ *
5491
+ * @example
5492
+ * ```js
5493
+ * disabledActions: [Action.ModifySageAnswer]
5494
+ * ```
5373
5495
  * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
5374
5496
  */
5375
5497
  ModifySageAnswer = "modifySageAnswer",
@@ -5490,7 +5612,61 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
5490
5612
  * ```
5491
5613
  * @version SDK: 1.27.10 | Thoughtspot: 9.12.5.cl
5492
5614
  */
5493
- AIHighlights = "AIHighlights"
5615
+ AIHighlights = "AIHighlights",
5616
+ /**
5617
+ * Action ID for edit schedule action on schedule on homepage
5618
+ * @example
5619
+ * ```js
5620
+ * disabledActions: [Action.EditScheduleHomepage]
5621
+ * ```
5622
+ * @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
5623
+ */
5624
+ EditScheduleHomepage = "editScheduleHomepage",
5625
+ /**
5626
+ * Action ID for pause schedule action on schedule on homepage
5627
+ * @example
5628
+ * ```js
5629
+ * disabledActions: [Action.PauseScheduleHomepage]
5630
+ * ```
5631
+ * @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
5632
+ */
5633
+ PauseScheduleHomepage = "pauseScheduleHomepage",
5634
+ /**
5635
+ * Action ID for view schedule run action on schedule on homepage
5636
+ * @example
5637
+ * ```js
5638
+ * disabledActions: [Action.ViewScheduleRunHomepage]
5639
+ * ```
5640
+ * @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
5641
+ */
5642
+ ViewScheduleRunHomepage = "viewScheduleRunHomepage",
5643
+ /**
5644
+ * Action ID for unsubscribe schedule action on schedule on homepage
5645
+ * @example
5646
+ * ```js
5647
+ * disabledActions: [Action.UnsubscribeScheduleHomepage]
5648
+ * ```
5649
+ * @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
5650
+ */
5651
+ UnsubscribeScheduleHomepage = "unsubscribeScheduleHomepage",
5652
+ /**
5653
+ * Action ID for delete schedule action on schedule on homepage
5654
+ * @example
5655
+ * ```js
5656
+ * disabledActions: [Action.DeleteScheduleHomepage]
5657
+ * ```
5658
+ * @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
5659
+ */
5660
+ DeleteScheduleHomepage = "deleteScheduleHomepage",
5661
+ /**
5662
+ * The **Analyze CTA** action on KPI chart.
5663
+ * @example
5664
+ * ```js
5665
+ * disabledActions: [Action.KPIAnalysisCTA]
5666
+ * ```
5667
+ * @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
5668
+ */
5669
+ KPIAnalysisCTA = "kpiAnalysisCTA"
5494
5670
  }
5495
5671
  export interface AnswerServiceType {
5496
5672
  getAnswer?: (offset: number, batchSize: number) => any;
@@ -6428,7 +6604,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/ts-embed' {
6428
6604
  * @param queryParams
6429
6605
  * @returns queryParams
6430
6606
  */
6431
- protected getBaseQueryParams(queryParams?: {}): {};
6607
+ protected getBaseQueryParams(queryParams?: Record<any, any>): Record<any, any>;
6432
6608
  /**
6433
6609
  * Constructs the base URL string to load v1 of the ThoughtSpot app.
6434
6610
  * 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.32.0",
3
+ "version": "1.32.1",
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
 
package/src/embed/app.ts CHANGED
@@ -347,6 +347,7 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
347
347
  * To set the initial state of the search bar in case of saved-answers.
348
348
  * @version SDK: 1.32.0 | Thoughtspot: 10.0.0.cl
349
349
  * @default false
350
+ * @deprecated Use {@link collapseSearchBar} instead
350
351
  */
351
352
  collapseSearchBarInitially?: boolean;
352
353
  /**
@@ -451,6 +452,7 @@ export class AppEmbed extends V1Embed {
451
452
  isOnBeforeGetVizDataInterceptEnabled = false,
452
453
  /* eslint-disable-next-line max-len */
453
454
  dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL,
455
+ collapseSearchBar = true,
454
456
  } = this.viewConfig;
455
457
 
456
458
  let params = {};
@@ -503,7 +505,7 @@ export class AppEmbed extends V1Embed {
503
505
  params[Param.DataPanelV2Enabled] = dataPanelV2;
504
506
  params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
505
507
  params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
506
- params[Param.CollapseSearchBarInitially] = collapseSearchBarInitially;
508
+ params[Param.CollapseSearchBarInitially] = collapseSearchBarInitially || collapseSearchBar;
507
509
  params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
508
510
  if (dataPanelCustomGroupsAccordionInitialState
509
511
  === 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
  /**
@@ -88,6 +88,19 @@ export interface SearchViewConfig
88
88
  * ```
89
89
  */
90
90
  collapseDataSources?: boolean;
91
+ /**
92
+ * If set to true, the data panel is collapsed on load,
93
+ * but can be expanded manually.
94
+ * @version: SDK: 1.34.0 | ThoughtSpot: 10.3.0.cl
95
+ * @example
96
+ * ```js
97
+ * const embed = new SearchEmbed('#tsEmbed', {
98
+ * ... // other options
99
+ * collapseDataPanel:true,
100
+ * })
101
+ * ```
102
+ */
103
+ collapseDataPanel?: boolean;
91
104
  /**
92
105
  * Show or hide the data sources panel.
93
106
  * @version: SDK: 1.2.0 | ThoughtSpot: 9.1.0.sw
@@ -236,6 +249,7 @@ export interface SearchViewConfig
236
249
  * To set the initial state of the search bar in case of saved-answers.
237
250
  * @default false
238
251
  * @version SDK: 1.32.0 | Thoughtspot: 10.0.0.cl
252
+ * @deprecated Use {@link collapseSearchBar} instead
239
253
  */
240
254
  collapseSearchBarInitially?: boolean;
241
255
  /**
@@ -320,7 +334,8 @@ export class SearchEmbed extends TsEmbed {
320
334
  */
321
335
  private getDataSourceMode() {
322
336
  let dataSourceMode = DataSourceVisualMode.Expanded;
323
- if (this.viewConfig.collapseDataSources === true) {
337
+ if (this.viewConfig.collapseDataSources === true
338
+ || this.viewConfig.collapseDataPanel === true) {
324
339
  dataSourceMode = DataSourceVisualMode.Collapsed;
325
340
  }
326
341
  if (this.viewConfig.hideDataSources === true) {
@@ -351,6 +366,7 @@ export class SearchEmbed extends TsEmbed {
351
366
  dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL,
352
367
  focusSearchBarOnRender = true,
353
368
  excludeRuntimeParametersfromURL,
369
+ collapseSearchBar = true,
354
370
  } = this.viewConfig;
355
371
  const queryParams = this.getBaseQueryParams();
356
372
 
@@ -406,7 +422,8 @@ export class SearchEmbed extends TsEmbed {
406
422
  }
407
423
 
408
424
  queryParams[Param.searchEmbed] = true;
409
- queryParams[Param.CollapseSearchBarInitially] = collapseSearchBarInitially;
425
+ /* eslint-disable-next-line max-len */
426
+ queryParams[Param.CollapseSearchBarInitially] = collapseSearchBarInitially || collapseSearchBar;
410
427
  queryParams[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
411
428
  if (dataPanelCustomGroupsAccordionInitialState
412
429
  === DataPanelCustomColumnGroupsAccordionState.COLLAPSE_ALL
@@ -59,6 +59,7 @@ import {
59
59
  } from './base';
60
60
  import { AuthFailureType } from '../auth';
61
61
  import { getEmbedConfig } from './embedConfig';
62
+ import { ERROR_MESSAGE } from '../errors';
62
63
 
63
64
  const { version } = pkgInfo;
64
65
 
@@ -347,7 +348,7 @@ export class TsEmbed {
347
348
  data: { authToken },
348
349
  });
349
350
  } catch (e) {
350
- logger.error(`Received invalid token. Error : ${e?.message}`);
351
+ logger.error(`${ERROR_MESSAGE.INVALID_TOKEN_ERROR} Error : ${e?.message}`);
351
352
  processAuthFailure(e, this.isPreRendered ? this.preRenderWrapper : this.el);
352
353
  }
353
354
  } else if (autoLogin) {
@@ -387,7 +388,9 @@ export class TsEmbed {
387
388
  * @param queryParams
388
389
  * @returns queryParams
389
390
  */
390
- protected getBaseQueryParams(queryParams = {}) {
391
+ protected getBaseQueryParams(
392
+ queryParams: Record<any, any> = {},
393
+ ) {
391
394
  let hostAppUrl = window?.location?.host || '';
392
395
 
393
396
  // The below check is needed because TS Cloud firewall, blocks
@@ -438,6 +441,7 @@ export class TsEmbed {
438
441
  contextMenuTrigger,
439
442
  linkOverride,
440
443
  insertInToSlide,
444
+ disableRedirectionLinksInNewTab,
441
445
  } = this.viewConfig;
442
446
 
443
447
  if (Array.isArray(visibleActions) && Array.isArray(hiddenActions)) {
@@ -505,6 +509,9 @@ export class TsEmbed {
505
509
  if (insertInToSlide) {
506
510
  queryParams[Param.ShowInsertToSlide] = insertInToSlide;
507
511
  }
512
+ if (disableRedirectionLinksInNewTab) {
513
+ queryParams[Param.DisableRedirectionLinksInNewTab] = disableRedirectionLinksInNewTab;
514
+ }
508
515
 
509
516
  queryParams[Param.OverrideNativeConsole] = true;
510
517
  queryParams[Param.ClientLogLevel] = this.embedConfig.logLevel;
@@ -557,7 +564,7 @@ export class TsEmbed {
557
564
  iFrame.mozallowfullscreen = true;
558
565
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
559
566
  // @ts-ignore
560
- iFrame.allow = 'clipboard-read; clipboard-write';
567
+ iFrame.allow = 'clipboard-read; clipboard-write fullscreen';
561
568
 
562
569
  const {
563
570
  height: frameHeight,
@@ -1000,7 +1007,7 @@ export class TsEmbed {
1000
1007
  */
1001
1008
  public preRender(showPreRenderByDefault = false): TsEmbed {
1002
1009
  if (!this.viewConfig.preRenderId) {
1003
- logger.error('PreRender id is required for preRender');
1010
+ logger.error(ERROR_MESSAGE.PRERENDER_ID_MISSING);
1004
1011
  return this;
1005
1012
  }
1006
1013
  this.isPreRendered = true;
@@ -1107,7 +1114,7 @@ export class TsEmbed {
1107
1114
  */
1108
1115
  public showPreRender(): void {
1109
1116
  if (!this.viewConfig.preRenderId) {
1110
- logger.error('PreRender id is required for preRender');
1117
+ logger.error(ERROR_MESSAGE.PRERENDER_ID_MISSING);
1111
1118
  return;
1112
1119
  }
1113
1120
  if (!this.isPreRenderAvailable()) {
@@ -1155,7 +1162,7 @@ export class TsEmbed {
1155
1162
  */
1156
1163
  public syncPreRenderStyle(): void {
1157
1164
  if (!this.isPreRenderAvailable() || !this.el) {
1158
- logger.error('PreRender should be called before using syncPreRenderStyle');
1165
+ logger.error(ERROR_MESSAGE.SYNC_STYLE_CALLED_BEFORE_RENDER);
1159
1166
  return;
1160
1167
  }
1161
1168
  const elBoundingClient = this.el.getBoundingClientRect();
package/src/errors.ts CHANGED
@@ -4,4 +4,15 @@ export const ERROR_MESSAGE = {
4
4
  TRIGGER_TIMED_OUT: 'Trigger timedout in getting response',
5
5
  SEARCHEMBED_BETA_WRANING_MESSAGE: 'Search Embed is in Beta in this release.',
6
6
  SAGE_EMBED_BETA_WARNING_MESSAGE: 'Sage Embed is in Beta in this release.',
7
+ THIRD_PARTY_COOKIE_BLOCKED_ALERT: 'Third party cookie access is blocked on this browser, please allow third party cookies for this to work properly. \nYou can use `suppressNoCookieAccessAlert` to suppress this message.',
8
+ DUPLICATE_TOKEN_ERR: 'Duplicate token, please issue a new token every time getAuthToken callback is called. See https://developers.thoughtspot.com/docs/?pageid=embed-auth#trusted-auth-embed for more details.',
9
+ SDK_NOT_INITIALIZED: 'SDK not initialized',
10
+ SESSION_INFO_FAILED: 'Failed to get session info',
11
+ INVALID_TOKEN_ERROR: 'Received invalid token from getAuthToken callback or authToken endpoint.',
12
+ MIXPANEL_TOKEN_NOT_FOUND: 'Mixpanel token not found in session info',
13
+ PRERENDER_ID_MISSING: 'PreRender id is required for preRender',
14
+ SYNC_STYLE_CALLED_BEFORE_RENDER: 'PreRender should be called before using syncPreRenderStyle',
15
+ CSP_VIOLATION_ALERT: 'CSP violation detected. Please check the console errors for more details.',
16
+ CSP_FRAME_HOST_VIOLATION_LOG_MESSAGE: 'Please setup CSP Correctly for the Application to start working. You can know more about setting CSP Correctly here: https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts. \n In case you are still facing error, please read: https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts',
17
+ MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
7
18
  };