@thoughtspot/visual-embed-sdk 1.46.4 → 1.46.5-beta.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 (172) hide show
  1. package/cjs/package.json +2 -2
  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 +2 -1
  5. package/cjs/src/auth.js.map +1 -1
  6. package/cjs/src/authToken.d.ts.map +1 -1
  7. package/cjs/src/authToken.js.map +1 -1
  8. package/cjs/src/css-variables.d.ts +51 -17
  9. package/cjs/src/css-variables.d.ts.map +1 -1
  10. package/cjs/src/embed/app.d.ts +1 -0
  11. package/cjs/src/embed/app.d.ts.map +1 -1
  12. package/cjs/src/embed/app.js +10 -1
  13. package/cjs/src/embed/app.js.map +1 -1
  14. package/cjs/src/embed/app.spec.js +46 -1
  15. package/cjs/src/embed/app.spec.js.map +1 -1
  16. package/cjs/src/embed/base.d.ts.map +1 -1
  17. package/cjs/src/embed/base.js.map +1 -1
  18. package/cjs/src/embed/base.spec.js.map +1 -1
  19. package/cjs/src/embed/events.spec.js +72 -0
  20. package/cjs/src/embed/events.spec.js.map +1 -1
  21. package/cjs/src/embed/hostEventClient/contracts.d.ts +74 -3
  22. package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  23. package/cjs/src/embed/hostEventClient/contracts.js +7 -0
  24. package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
  25. package/cjs/src/embed/hostEventClient/host-event-client.d.ts +10 -0
  26. package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  27. package/cjs/src/embed/hostEventClient/host-event-client.js +46 -9
  28. package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
  29. package/cjs/src/embed/hostEventClient/host-event-client.spec.js +155 -0
  30. package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  31. package/cjs/src/embed/liveboard.d.ts +1 -0
  32. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  33. package/cjs/src/embed/liveboard.js +11 -2
  34. package/cjs/src/embed/liveboard.js.map +1 -1
  35. package/cjs/src/embed/liveboard.spec.js +96 -2
  36. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  37. package/cjs/src/embed/sage.d.ts.map +1 -1
  38. package/cjs/src/embed/sage.js.map +1 -1
  39. package/cjs/src/embed/search.spec.js.map +1 -1
  40. package/cjs/src/embed/ts-embed.d.ts +41 -2
  41. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  42. package/cjs/src/embed/ts-embed.js +41 -2
  43. package/cjs/src/embed/ts-embed.js.map +1 -1
  44. package/cjs/src/react/index.d.ts.map +1 -1
  45. package/cjs/src/react/index.js +58 -53
  46. package/cjs/src/react/index.js.map +1 -1
  47. package/cjs/src/types.d.ts +730 -32
  48. package/cjs/src/types.d.ts.map +1 -1
  49. package/cjs/src/types.js +734 -3
  50. package/cjs/src/types.js.map +1 -1
  51. package/cjs/src/utils/graphql/answerService/answerService.d.ts +4 -2
  52. package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  53. package/cjs/src/utils/graphql/answerService/answerService.js +4 -2
  54. package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
  55. package/cjs/src/utils/graphql/preview-service.d.ts.map +1 -1
  56. package/cjs/src/utils/graphql/preview-service.js.map +1 -1
  57. package/cjs/src/utils/processData.d.ts.map +1 -1
  58. package/cjs/src/utils/processData.js.map +1 -1
  59. package/dist/{index-DGV_zh53.js → index-DW2wEHqy.js} +1 -1
  60. package/dist/src/auth.d.ts +2 -1
  61. package/dist/src/auth.d.ts.map +1 -1
  62. package/dist/src/authToken.d.ts.map +1 -1
  63. package/dist/src/css-variables.d.ts +51 -17
  64. package/dist/src/css-variables.d.ts.map +1 -1
  65. package/dist/src/embed/app.d.ts +1 -0
  66. package/dist/src/embed/app.d.ts.map +1 -1
  67. package/dist/src/embed/base.d.ts.map +1 -1
  68. package/dist/src/embed/hostEventClient/contracts.d.ts +74 -3
  69. package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  70. package/dist/src/embed/hostEventClient/host-event-client.d.ts +10 -0
  71. package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  72. package/dist/src/embed/liveboard.d.ts +1 -0
  73. package/dist/src/embed/liveboard.d.ts.map +1 -1
  74. package/dist/src/embed/sage.d.ts.map +1 -1
  75. package/dist/src/embed/ts-embed.d.ts +41 -2
  76. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  77. package/dist/src/react/index.d.ts.map +1 -1
  78. package/dist/src/types.d.ts +730 -32
  79. package/dist/src/types.d.ts.map +1 -1
  80. package/dist/src/utils/graphql/answerService/answerService.d.ts +4 -2
  81. package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  82. package/dist/src/utils/graphql/preview-service.d.ts.map +1 -1
  83. package/dist/src/utils/processData.d.ts.map +1 -1
  84. package/dist/tsembed-react.es.js +917 -77
  85. package/dist/tsembed-react.js +915 -75
  86. package/dist/tsembed.es.js +859 -24
  87. package/dist/tsembed.js +857 -22
  88. package/dist/visual-embed-sdk-react-full.d.ts +892 -54
  89. package/dist/visual-embed-sdk-react.d.ts +892 -54
  90. package/dist/visual-embed-sdk.d.ts +912 -56
  91. package/lib/package.json +2 -2
  92. package/lib/src/auth.d.ts +2 -1
  93. package/lib/src/auth.d.ts.map +1 -1
  94. package/lib/src/auth.js +2 -1
  95. package/lib/src/auth.js.map +1 -1
  96. package/lib/src/authToken.d.ts.map +1 -1
  97. package/lib/src/authToken.js.map +1 -1
  98. package/lib/src/css-variables.d.ts +51 -17
  99. package/lib/src/css-variables.d.ts.map +1 -1
  100. package/lib/src/embed/app.d.ts +1 -0
  101. package/lib/src/embed/app.d.ts.map +1 -1
  102. package/lib/src/embed/app.js +10 -1
  103. package/lib/src/embed/app.js.map +1 -1
  104. package/lib/src/embed/app.spec.js +46 -1
  105. package/lib/src/embed/app.spec.js.map +1 -1
  106. package/lib/src/embed/base.d.ts.map +1 -1
  107. package/lib/src/embed/base.js.map +1 -1
  108. package/lib/src/embed/base.spec.js.map +1 -1
  109. package/lib/src/embed/events.spec.js +73 -1
  110. package/lib/src/embed/events.spec.js.map +1 -1
  111. package/lib/src/embed/hostEventClient/contracts.d.ts +74 -3
  112. package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  113. package/lib/src/embed/hostEventClient/contracts.js +7 -0
  114. package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
  115. package/lib/src/embed/hostEventClient/host-event-client.d.ts +10 -0
  116. package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  117. package/lib/src/embed/hostEventClient/host-event-client.js +46 -9
  118. package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
  119. package/lib/src/embed/hostEventClient/host-event-client.spec.js +155 -0
  120. package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  121. package/lib/src/embed/liveboard.d.ts +1 -0
  122. package/lib/src/embed/liveboard.d.ts.map +1 -1
  123. package/lib/src/embed/liveboard.js +11 -2
  124. package/lib/src/embed/liveboard.js.map +1 -1
  125. package/lib/src/embed/liveboard.spec.js +96 -2
  126. package/lib/src/embed/liveboard.spec.js.map +1 -1
  127. package/lib/src/embed/sage.d.ts.map +1 -1
  128. package/lib/src/embed/sage.js.map +1 -1
  129. package/lib/src/embed/search.spec.js.map +1 -1
  130. package/lib/src/embed/ts-embed.d.ts +41 -2
  131. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  132. package/lib/src/embed/ts-embed.js +42 -3
  133. package/lib/src/embed/ts-embed.js.map +1 -1
  134. package/lib/src/react/index.d.ts.map +1 -1
  135. package/lib/src/react/index.js +58 -53
  136. package/lib/src/react/index.js.map +1 -1
  137. package/lib/src/types.d.ts +730 -32
  138. package/lib/src/types.d.ts.map +1 -1
  139. package/lib/src/types.js +734 -3
  140. package/lib/src/types.js.map +1 -1
  141. package/lib/src/utils/graphql/answerService/answerService.d.ts +4 -2
  142. package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  143. package/lib/src/utils/graphql/answerService/answerService.js +4 -2
  144. package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
  145. package/lib/src/utils/graphql/preview-service.d.ts.map +1 -1
  146. package/lib/src/utils/graphql/preview-service.js.map +1 -1
  147. package/lib/src/utils/processData.d.ts.map +1 -1
  148. package/lib/src/utils/processData.js.map +1 -1
  149. package/lib/src/visual-embed-sdk.d.ts +912 -56
  150. package/package.json +2 -2
  151. package/src/auth.spec.ts +1 -1
  152. package/src/auth.ts +2 -1
  153. package/src/authToken.ts +0 -1
  154. package/src/css-variables.ts +51 -17
  155. package/src/embed/app.spec.ts +62 -3
  156. package/src/embed/app.ts +10 -1
  157. package/src/embed/base.spec.ts +1 -2
  158. package/src/embed/base.ts +1 -4
  159. package/src/embed/events.spec.ts +88 -0
  160. package/src/embed/hostEventClient/contracts.ts +74 -2
  161. package/src/embed/hostEventClient/host-event-client.spec.ts +257 -0
  162. package/src/embed/hostEventClient/host-event-client.ts +70 -15
  163. package/src/embed/liveboard.spec.ts +126 -2
  164. package/src/embed/liveboard.ts +11 -2
  165. package/src/embed/sage.ts +0 -1
  166. package/src/embed/search.spec.ts +0 -2
  167. package/src/embed/ts-embed.ts +43 -3
  168. package/src/react/index.tsx +76 -72
  169. package/src/types.ts +739 -31
  170. package/src/utils/graphql/answerService/answerService.ts +4 -5
  171. package/src/utils/graphql/preview-service.ts +0 -1
  172. package/src/utils/processData.ts +0 -5
@@ -426,37 +426,49 @@ export interface CustomCssVariables {
426
426
  /**
427
427
  * Padding of the groups in the Liveboard.
428
428
  *
429
- * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying this CSS variable.
429
+ * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and
430
+ * then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying
431
+ * this CSS variable.
430
432
  */
431
433
  "--ts-var-liveboard-group-padding"?: string;
432
434
  /**
433
435
  * Font size of the title of the groups in the Liveboard.
434
436
  *
435
- * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying this CSS variable.
437
+ * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and
438
+ * then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying
439
+ * this CSS variable.
436
440
  */
437
441
  "--ts-var-liveboard-group-title-font-size"?: string;
438
442
  /**
439
443
  * Font weight of the title of the groups in the Liveboard.
440
444
  *
441
- * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying this CSS variable.
445
+ * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and
446
+ * then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying
447
+ * this CSS variable.
442
448
  */
443
449
  "--ts-var-liveboard-group-title-font-weight"?: string;
444
450
  /**
445
451
  * Font size of the title of the tiles inside the groups in the Liveboard.
446
452
  *
447
- * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying this CSS variable.
453
+ * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and
454
+ * then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying
455
+ * this CSS variable.
448
456
  */
449
457
  "--ts-var-liveboard-group-tile-title-font-size"?: string;
450
458
  /**
451
459
  * Font weight of the title of the tiles inside the groups in the Liveboard.
452
460
  *
453
- * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying this CSS variable.
461
+ * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and
462
+ * then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying
463
+ * this CSS variable.
454
464
  */
455
465
  "--ts-var-liveboard-group-tile-title-font-weight"?: string;
456
466
  /**
457
467
  * Padding of the group tiles in the Liveboard.
458
468
  *
459
- * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying this CSS variable.
469
+ * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and
470
+ * then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying
471
+ * this CSS variable.
460
472
  */
461
473
  "--ts-var-liveboard-group-tile-padding"?: string;
462
474
  /**
@@ -466,13 +478,17 @@ export interface CustomCssVariables {
466
478
  /**
467
479
  * Background color of the groups in the Liveboard.
468
480
  *
469
- * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying this CSS variable.
481
+ * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and
482
+ * then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying
483
+ * this CSS variable.
470
484
  */
471
485
  "--ts-var-liveboard-group-background"?: string;
472
486
  /**
473
487
  * Border color of the groups in the Liveboard.
474
488
  *
475
- * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying this CSS variable.
489
+ * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and
490
+ * then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying
491
+ * this CSS variable.
476
492
  */
477
493
  "--ts-var-liveboard-group-border-color"?: string;
478
494
  /**
@@ -486,55 +502,73 @@ export interface CustomCssVariables {
486
502
  /**
487
503
  * Font color of the title of the groups in the Liveboard.
488
504
  *
489
- * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying this CSS variable.
505
+ * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and
506
+ * then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying
507
+ * this CSS variable.
490
508
  */
491
509
  "--ts-var-liveboard-group-title-font-color"?: string;
492
510
  /**
493
511
  * Font color of the description of the groups in the Liveboard.
494
512
  *
495
- * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying this CSS variable.
513
+ * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and
514
+ * then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying
515
+ * this CSS variable.
496
516
  */
497
517
  "--ts-var-liveboard-group-description-font-color"?: string;
498
518
  /**
499
519
  * Font color of the title of the tiles inside the groups in the Liveboard.
500
520
  *
501
- * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying this CSS variable.
521
+ * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and
522
+ * then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying
523
+ * this CSS variable.
502
524
  */
503
525
  "--ts-var-liveboard-group-tile-title-font-color"?: string;
504
526
  /**
505
527
  * Font color of the description of the tiles inside the groups in the Liveboard.
506
528
  *
507
- * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying this CSS variable.
529
+ * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and
530
+ * then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying
531
+ * this CSS variable.
508
532
  */
509
533
  "--ts-var-liveboard-group-tile-description-font-color"?: string;
510
534
  /**
511
535
  * Background color of the tiles inside the groups in the Liveboard.
512
536
  *
513
- * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying this CSS variable.
537
+ * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and
538
+ * then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying
539
+ * this CSS variable.
514
540
  */
515
541
  "--ts-var-liveboard-group-tile-background"?: string;
516
542
  /**
517
543
  * Background color of the filter chips in the Liveboard.
518
544
  *
519
- * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying this CSS variable.
545
+ * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and
546
+ * then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying
547
+ * this CSS variable.
520
548
  */
521
549
  "--ts-var-liveboard-chip-background"?: string;
522
550
  /**
523
551
  * Font color of the filter chips in the Liveboard.
524
552
  *
525
- * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying this CSS variable.
553
+ * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and
554
+ * then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying
555
+ * this CSS variable.
526
556
  */
527
557
  "--ts-var-liveboard-chip-color"?: string;
528
558
  /**
529
559
  * Background color of the filter chips in the Liveboard on hover.
530
560
  *
531
- * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying this CSS variable.
561
+ * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and
562
+ * then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying
563
+ * this CSS variable.
532
564
  */
533
565
  "--ts-var-liveboard-chip--hover-background"?: string;
534
566
  /**
535
567
  * Background color of the filter chips in the Liveboard on active.
536
568
  *
537
- * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying this CSS variable.
569
+ * Please enable the Liveboard Masterpieces feature in your ThoughtSpot instance and
570
+ * then set the isLiveboardMasterpiecesEnabled SDK flag to true to start modifying
571
+ * this CSS variable.
538
572
  */
539
573
  "--ts-var-liveboard-chip--active-background"?: string;
540
574
  /**
@@ -772,9 +806,11 @@ export interface UnderlyingDataPoint {
772
806
  * You can use this service to:
773
807
  *
774
808
  * - Add or remove columns from Answers (`addColumns`, `removeColumns`,
775
- * `addColumnsByName`) - Apply filters to Answers (`addFilter`)
809
+ * `addColumnsByName`)
810
+ * - Apply filters to Answers (`addFilter`)
776
811
  * - Get data from Answers in different formats (JSON, CSV, PNG) (`fetchData`,
777
- * `fetchCSVBlob`, `fetchPNGBlob`) - Get data for specific points in visualizations
812
+ * `fetchCSVBlob`, `fetchPNGBlob`)
813
+ * - Get data for specific points in visualizations
778
814
  * (`getUnderlyingDataForPoint`)
779
815
  * - Run custom queries (`executeQuery`)
780
816
  * - Add visualizations to Liveboards (`addDisplayedVizToLiveboard`)
@@ -3996,22 +4032,45 @@ export declare enum EmbedEvent {
3996
4032
  /**
3997
4033
  * Emitted when name, status (private or public) or filter values of a
3998
4034
  * Personalised view is updated.
4035
+ * This event is deprecated. Use {@link EmbedEvent.UpdatePersonalizedView} instead.
3999
4036
  * @returns viewName: string
4000
4037
  * @returns viewId: string
4001
4038
  * @returns liveboardId: string
4002
4039
  * @returns isPublic: boolean
4003
4040
  * @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw
4041
+ * @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
4004
4042
  */
4005
4043
  UpdatePersonalisedView = "updatePersonalisedView",
4044
+ /**
4045
+ * Emitted when name, status (private or public) or filter values of a
4046
+ * Personalized view is updated.
4047
+ * @returns viewName: string
4048
+ * @returns viewId: string
4049
+ * @returns liveboardId: string
4050
+ * @returns isPublic: boolean
4051
+ * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
4052
+ */
4053
+ UpdatePersonalizedView = "updatePersonalisedView",
4006
4054
  /**
4007
4055
  * Emitted when a Personalised view is saved.
4056
+ * This event is deprecated. Use {@link EmbedEvent.SavePersonalizedView} instead.
4008
4057
  * @returns viewName: string
4009
4058
  * @returns viewId: string
4010
4059
  * @returns liveboardId: string
4011
4060
  * @returns isPublic: boolean
4012
4061
  * @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw
4062
+ * @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
4013
4063
  */
4014
4064
  SavePersonalisedView = "savePersonalisedView",
4065
+ /**
4066
+ * Emitted when a Personalized view is saved.
4067
+ * @returns viewName: string
4068
+ * @returns viewId: string
4069
+ * @returns liveboardId: string
4070
+ * @returns isPublic: boolean
4071
+ * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
4072
+ */
4073
+ SavePersonalizedView = "savePersonalisedView",
4015
4074
  /**
4016
4075
  * Emitted when a Liveboard is reset.
4017
4076
  * @returns viewName: string
@@ -4023,11 +4082,41 @@ export declare enum EmbedEvent {
4023
4082
  ResetLiveboard = "resetLiveboard",
4024
4083
  /**
4025
4084
  * Emitted when a PersonalisedView is deleted.
4085
+ * This event is deprecated. Use {@link EmbedEvent.DeletePersonalizedView} instead.
4026
4086
  * @returns views: string[]
4027
4087
  * @returns liveboardId: string
4028
4088
  * @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw
4089
+ * @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
4029
4090
  */
4030
4091
  DeletePersonalisedView = "deletePersonalisedView",
4092
+ /**
4093
+ * Emitted when a PersonalizedView is deleted.
4094
+ * @returns views: string[]
4095
+ * @returns liveboardId: string
4096
+ * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
4097
+ */
4098
+ DeletePersonalizedView = "deletePersonalisedView",
4099
+ /**
4100
+ * Emitted when a user selects a different Personalized View or
4101
+ * resets to the original/default view on a Liveboard.
4102
+ * @example
4103
+ * ```js
4104
+ * liveboardEmbed.on(EmbedEvent.ChangePersonalizedView, (data) => {
4105
+ * console.log(data.viewName); // 'Q4 Revenue' or 'Original View'
4106
+ * console.log(data.viewId); // '2a021a12-...' or null (default)
4107
+ * console.log(data.liveboardId); // 'abc123...'
4108
+ * console.log(data.isPublic); // true | false
4109
+ * })
4110
+ * ```
4111
+ * @returns viewName: string - Name of the selected view,
4112
+ * or 'Original View' when reset to default.
4113
+ * @returns viewId: string | null - GUID of the selected view,
4114
+ * or null when reset to default.
4115
+ * @returns liveboardId: string
4116
+ * @returns isPublic: boolean
4117
+ * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
4118
+ */
4119
+ ChangePersonalizedView = "changePersonalisedView",
4031
4120
  /**
4032
4121
  * Emitted when a user creates a Worksheet.
4033
4122
  * @version SDK: 1.27.0 | ThoughtSpot: 9.8.0.cl, 9.8.0.sw
@@ -4061,7 +4150,8 @@ export declare enum EmbedEvent {
4061
4150
  * @param - Includes the following parameters:
4062
4151
  * - `payload`: The payload received from the embed related to the Data API call.
4063
4152
  * - `responder`: Contains elements that let developers define whether ThoughtSpot
4064
- * will run or block the search operation, and if blocked, which error message to provide.
4153
+ * will run or block the search operation, and if blocked, which error message to
4154
+ * provide.
4065
4155
  * - `execute` - When `execute` returns `true`, the search is run.
4066
4156
  * When `execute` returns `false`, the search is not executed.
4067
4157
  * - `error` - Developers can customize the user-facing error message when `execute`
@@ -4495,6 +4585,25 @@ export declare enum EmbedEvent {
4495
4585
  * );
4496
4586
  * }
4497
4587
  * ```
4588
+ *
4589
+ * **Context Parameter (SDK: 1.45.2+)**
4590
+ *
4591
+ * Starting from SDK version 1.45.2 | ThoughtSpot: 26.3.0.cl, you can optionally pass a
4592
+ * `ContextType` as the third parameter to the `trigger` method to specify the context
4593
+ * from which the event is triggered. This helps ThoughtSpot understand the current page
4594
+ * context (Search, Answer, Liveboard, or Spotter) for better event handling.
4595
+ *
4596
+ * @example
4597
+ * ```js
4598
+ * import { HostEvent, ContextType } from '@thoughtspot/visual-embed-sdk';
4599
+ *
4600
+ * // Trigger Pin event with Search context
4601
+ * appEmbed.trigger(HostEvent.Pin, {
4602
+ * vizId: "123",
4603
+ * liveboardId: "456"
4604
+ * }, ContextType.Search);
4605
+ * ```
4606
+ *
4498
4607
  * @group Events
4499
4608
  */
4500
4609
  export declare enum HostEvent {
@@ -4516,6 +4625,16 @@ export declare enum HostEvent {
4516
4625
  execute: true
4517
4626
  });
4518
4627
  * ```
4628
+ * @example
4629
+ * ```js
4630
+ * // Trigger search from search context
4631
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
4632
+ * appEmbed.trigger(HostEvent.Search, {
4633
+ * searchQuery: "[revenue] by [region]",
4634
+ * dataSources: ["cd252e5c-b552-49a8-821d-3eadaa049cca"],
4635
+ * execute: true
4636
+ * }, ContextType.Search);
4637
+ * ```
4519
4638
  */
4520
4639
  Search = "search",
4521
4640
  /**
@@ -4566,6 +4685,24 @@ export declare enum HostEvent {
4566
4685
  * });
4567
4686
  * })
4568
4687
  * ```
4688
+ * @example
4689
+ * ```js
4690
+ * // Drill down from answer context
4691
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
4692
+ * appEmbed.trigger(HostEvent.DrillDown, {
4693
+ * points: { clickedPoint, selectedPoints },
4694
+ * autoDrillDown: true
4695
+ * }, ContextType.Answer);
4696
+ * ```
4697
+ * @example
4698
+ * ```js
4699
+ * // Drill down from search context
4700
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
4701
+ * searchEmbed.trigger(HostEvent.DrillDown, {
4702
+ * points: { clickedPoint, selectedPoints },
4703
+ * columnGuid: "column-guid"
4704
+ * }, ContextType.Search);
4705
+ * ```
4569
4706
  * @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
4570
4707
  */
4571
4708
  DrillDown = "triggerDrillDown",
@@ -4586,6 +4723,13 @@ export declare enum HostEvent {
4586
4723
  * const url = embed.trigger(HostEvent.GetIframeUrl);
4587
4724
  * console.log("iFrameURL",url);
4588
4725
  * ```
4726
+ * @example
4727
+ * ```js
4728
+ * // Get iframe URL from specific context
4729
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
4730
+ * const url = await appEmbed.trigger(HostEvent.GetIframeUrl, {}, ContextType.Answer);
4731
+ * console.log("iFrameURL", url);
4732
+ * ```
4589
4733
  * @version SDK: 1.35.0 | ThoughtSpot: 10.4.0.cl
4590
4734
  */
4591
4735
  GetIframeUrl = "GetIframeUrl",
@@ -4599,6 +4743,15 @@ export declare enum HostEvent {
4599
4743
  * '730496d6-6903-4601-937e-2c691821af3c',
4600
4744
  * 'd547ec54-2a37-4516-a222-2b06719af726'])
4601
4745
  * ```
4746
+ * @example
4747
+ * ```js
4748
+ * // Set visible vizs from liveboard context
4749
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
4750
+ * liveboardEmbed.trigger(HostEvent.SetVisibleVizs, [
4751
+ * '730496d6-6903-4601-937e-2c691821af3c',
4752
+ * 'd547ec54-2a37-4516-a222-2b06719af726'
4753
+ * ], ContextType.Liveboard);
4754
+ * ```
4602
4755
  * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
4603
4756
  */
4604
4757
  SetVisibleVizs = "SetPinboardVisibleVizs",
@@ -4611,6 +4764,14 @@ export declare enum HostEvent {
4611
4764
  * tabId:'730496d6-6903-4601-937e-2c691821af3c'
4612
4765
  * })
4613
4766
  * ```
4767
+ * @example
4768
+ * ```js
4769
+ * // Set active tab from liveboard context
4770
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
4771
+ * liveboardEmbed.trigger(HostEvent.SetActiveTab, {
4772
+ * tabId: '730496d6-6903-4601-937e-2c691821af3c'
4773
+ * }, ContextType.Liveboard);
4774
+ * ```
4614
4775
  * @version SDK: 1.24.0 | ThoughtSpot: 9.5.0.cl, 9.5.1-sw
4615
4776
  */
4616
4777
  SetActiveTab = "SetActiveTab",
@@ -4644,6 +4805,15 @@ export declare enum HostEvent {
4644
4805
  * {columnName: "item type",operator: RuntimeFilterOp.EQ,values: ["Jackets"]}
4645
4806
  * ])
4646
4807
  * ```
4808
+ * @example
4809
+ * ```js
4810
+ * // Update runtime filters from liveboard context
4811
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
4812
+ * liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
4813
+ * {columnName: "region", operator: RuntimeFilterOp.EQ, values: ["west"]},
4814
+ * {columnName: "product", operator: RuntimeFilterOp.IN, values: ["shoes", "boots"]}
4815
+ * ], ContextType.Liveboard);
4816
+ * ```
4647
4817
  * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw
4648
4818
  * @important
4649
4819
  */
@@ -4677,6 +4847,14 @@ export declare enum HostEvent {
4677
4847
  * LiveboardEmbed.trigger(HostEvent.OpenFilter,
4678
4848
  * { column: {columnId: '<column-GUID>'}})
4679
4849
  * ```
4850
+ * @example
4851
+ * ```js
4852
+ * // Open filter from search context
4853
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
4854
+ * searchEmbed.trigger(HostEvent.OpenFilter, {
4855
+ * column: { columnId: '<column-GUID>', name: 'region', type: 'ATTRIBUTE', dataType: 'CHAR'}
4856
+ * }, ContextType.Search);
4857
+ * ```
4680
4858
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
4681
4859
  */
4682
4860
  OpenFilter = "openFilter",
@@ -4687,6 +4865,14 @@ export declare enum HostEvent {
4687
4865
  * ```js
4688
4866
  * searchEmbed.trigger(HostEvent.AddColumns, { columnIds: ['<column-GUID>','<column-GUID>'] })
4689
4867
  * ```
4868
+ * @example
4869
+ * ```js
4870
+ * // Add columns from search context
4871
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
4872
+ * searchEmbed.trigger(HostEvent.AddColumns, {
4873
+ * columnIds: ['col-guid-1', 'col-guid-2']
4874
+ * }, ContextType.Search);
4875
+ * ```
4690
4876
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
4691
4877
  */
4692
4878
  AddColumns = "addColumns",
@@ -4697,6 +4883,14 @@ export declare enum HostEvent {
4697
4883
  * ```js
4698
4884
  * searchEmbed.trigger(HostEvent.RemoveColumn, { columnId: '<column-Guid>' })
4699
4885
  * ```
4886
+ * @example
4887
+ * ```js
4888
+ * // Remove column from search context
4889
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
4890
+ * searchEmbed.trigger(HostEvent.RemoveColumn, {
4891
+ * columnId: 'column-guid'
4892
+ * }, ContextType.Search);
4893
+ * ```
4700
4894
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
4701
4895
  */
4702
4896
  RemoveColumn = "removeColumn",
@@ -4783,6 +4977,37 @@ export declare enum HostEvent {
4783
4977
  *
4784
4978
  * spotterEmbed.trigger(HostEvent.Pin, { vizId: latestSpotterVizId });
4785
4979
  * ```
4980
+ * @example
4981
+ * ```js
4982
+ * // Using context parameter to specify the context type (SDK: 1.45.2+)
4983
+ * // Pin from a search answer context
4984
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
4985
+ * appEmbed.trigger(HostEvent.Pin, {
4986
+ * vizId: "123",
4987
+ * newVizName: "Sales by region",
4988
+ * liveboardId: "456"
4989
+ * }, ContextType.Search);
4990
+ * ```
4991
+ * @example
4992
+ * ```js
4993
+ * // Pin from an answer context (explore modal/page) (SDK: 1.45.2+)
4994
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
4995
+ * appEmbed.trigger(HostEvent.Pin, {
4996
+ * vizId: "789",
4997
+ * newVizName: "Revenue trends",
4998
+ * liveboardId: "456"
4999
+ * }, ContextType.Answer);
5000
+ * ```
5001
+ * @example
5002
+ * ```js
5003
+ * // Pin from a spotter context (SDK: 1.45.2+)
5004
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5005
+ * appEmbed.trigger(HostEvent.Pin, {
5006
+ * vizId: latestSpotterVizId,
5007
+ * newVizName: "AI-generated insights",
5008
+ * liveboardId: "456"
5009
+ * }, ContextType.Spotter);
5010
+ * ```
4786
5011
  *
4787
5012
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
4788
5013
  */
@@ -4793,6 +5018,12 @@ export declare enum HostEvent {
4793
5018
  * @example
4794
5019
  * ```js
4795
5020
  * liveboardEmbed.trigger(HostEvent.LiveboardInfo)
5021
+ *```
5022
+ * @example
5023
+ * ```js
5024
+ * // Show liveboard info from liveboard context
5025
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5026
+ * liveboardEmbed.trigger(HostEvent.LiveboardInfo, {}, ContextType.Liveboard);
4796
5027
  * ```
4797
5028
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
4798
5029
  */
@@ -4803,6 +5034,12 @@ export declare enum HostEvent {
4803
5034
  * ```js
4804
5035
  * liveboardEmbed.trigger(HostEvent.Schedule)
4805
5036
  * ```
5037
+ * @example
5038
+ * ```js
5039
+ * // Schedule from liveboard context
5040
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5041
+ * liveboardEmbed.trigger(HostEvent.Schedule, {}, ContextType.Liveboard);
5042
+ * ```
4806
5043
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
4807
5044
  */
4808
5045
  Schedule = "subscription",
@@ -4812,6 +5049,12 @@ export declare enum HostEvent {
4812
5049
  * ```js
4813
5050
  * liveboardEmbed.trigger(HostEvent.ScheduleList)
4814
5051
  * ```
5052
+ * @example
5053
+ * ```js
5054
+ * // Manage schedules from liveboard context
5055
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5056
+ * liveboardEmbed.trigger(HostEvent.ScheduleList, {}, ContextType.Liveboard);
5057
+ * ```
4815
5058
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
4816
5059
  */
4817
5060
  SchedulesList = "schedule-list",
@@ -4822,6 +5065,18 @@ export declare enum HostEvent {
4822
5065
  * ```js
4823
5066
  * liveboardEmbed.trigger(HostEvent.ExportTML)
4824
5067
  * ```
5068
+ * @example
5069
+ * ```js
5070
+ * // Export TML from liveboard context
5071
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5072
+ * liveboardEmbed.trigger(HostEvent.ExportTML, {}, ContextType.Liveboard);
5073
+ * ```
5074
+ * @example
5075
+ * ```js
5076
+ * // Export TML from search-answer context
5077
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5078
+ * appEmbed.trigger(HostEvent.ExportTML, {}, ContextType.Search);
5079
+ * ```
4825
5080
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
4826
5081
  */
4827
5082
  ExportTML = "exportTSL",
@@ -4832,6 +5087,18 @@ export declare enum HostEvent {
4832
5087
  * ```js
4833
5088
  * liveboardEmbed.trigger(HostEvent.EditTML)
4834
5089
  * ```
5090
+ * @example
5091
+ * ```js
5092
+ * // Edit TML from liveboard context
5093
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5094
+ * liveboardEmbed.trigger(HostEvent.EditTML, {}, ContextType.Liveboard);
5095
+ * ```
5096
+ * @example
5097
+ * ```js
5098
+ * // Edit TML from search-answer context
5099
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5100
+ * appEmbed.trigger(HostEvent.EditTML, {}, ContextType.Search);
5101
+ * ```
4835
5102
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
4836
5103
  */
4837
5104
  EditTML = "editTSL",
@@ -4841,6 +5108,12 @@ export declare enum HostEvent {
4841
5108
  * ```js
4842
5109
  * liveboardEmbed.trigger(HostEvent.UpdateTML)
4843
5110
  * ```
5111
+ * @example
5112
+ * ```js
5113
+ * // Update TML from liveboard context
5114
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5115
+ * liveboardEmbed.trigger(HostEvent.UpdateTML, {}, ContextType.Liveboard);
5116
+ * ```
4844
5117
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
4845
5118
  */
4846
5119
  UpdateTML = "updateTSL",
@@ -4867,6 +5140,18 @@ export declare enum HostEvent {
4867
5140
  *
4868
5141
  * spotterEmbed.trigger(HostEvent.DownloadAsPdf, { vizId: latestSpotterVizId });
4869
5142
  * ```
5143
+ * @example
5144
+ * ```js
5145
+ * // Download as PDF from search-answer context
5146
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5147
+ * appEmbed.trigger(HostEvent.DownloadAsPdf, {}, ContextType.Search);
5148
+ * ```
5149
+ * @example
5150
+ * ```js
5151
+ * // Download as PDF from liveboard context
5152
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5153
+ * liveboardEmbed.trigger(HostEvent.DownloadAsPdf, {}, ContextType.Liveboard);
5154
+ * ```
4870
5155
  *
4871
5156
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
4872
5157
  */
@@ -4911,6 +5196,18 @@ export declare enum HostEvent {
4911
5196
  *
4912
5197
  * spotterEmbed.trigger(HostEvent.MakeACopy, { vizId: latestSpotterVizId });
4913
5198
  * ```
5199
+ * @example
5200
+ * ```js
5201
+ * // Make a copy from answer context
5202
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5203
+ * appEmbed.trigger(HostEvent.MakeACopy, {}, ContextType.Answer);
5204
+ * ```
5205
+ * @example
5206
+ * ```js
5207
+ * // Make a copy from search context
5208
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5209
+ * appEmbed.trigger(HostEvent.MakeACopy, {}, ContextType.Search);
5210
+ * ```
4914
5211
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
4915
5212
  */
4916
5213
  MakeACopy = "makeACopy",
@@ -4935,6 +5232,14 @@ export declare enum HostEvent {
4935
5232
  * ```js
4936
5233
  * liveboardEmbed.trigger(HostEvent.Explore, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
4937
5234
  * ```
5235
+ * @example
5236
+ * ```js
5237
+ * // Explore from liveboard context
5238
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5239
+ * liveboardEmbed.trigger(HostEvent.Explore, {
5240
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
5241
+ * }, ContextType.Liveboard);
5242
+ * ```
4938
5243
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
4939
5244
  */
4940
5245
  Explore = "explore",
@@ -4952,6 +5257,20 @@ export declare enum HostEvent {
4952
5257
  * ```js
4953
5258
  * searchEmbed.trigger(HostEvent.CreateMonitor)
4954
5259
  * ```
5260
+ * @example
5261
+ * ```js
5262
+ * // Create monitor from answer context
5263
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5264
+ * appEmbed.trigger(HostEvent.CreateMonitor, {}, ContextType.Answer);
5265
+ * ```
5266
+ * @example
5267
+ * ```js
5268
+ * // Create monitor from liveboard context
5269
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5270
+ * liveboardEmbed.trigger(HostEvent.CreateMonitor, {
5271
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
5272
+ * }, ContextType.Liveboard);
5273
+ * ```
4955
5274
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
4956
5275
  */
4957
5276
  CreateMonitor = "createMonitor",
@@ -4973,6 +5292,20 @@ export declare enum HostEvent {
4973
5292
  * ```js
4974
5293
  * vizEmbed.trigger(HostEvent.ManageMonitor)
4975
5294
  * ```
5295
+ * @example
5296
+ * ```js
5297
+ * // Manage monitor from answer context
5298
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5299
+ * appEmbed.trigger(HostEvent.ManageMonitor, {}, ContextType.Answer);
5300
+ * ```
5301
+ * @example
5302
+ * ```js
5303
+ * // Manage monitor from liveboard context
5304
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5305
+ * liveboardEmbed.trigger(HostEvent.ManageMonitor, {
5306
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
5307
+ * }, ContextType.Liveboard);
5308
+ * ```
4976
5309
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
4977
5310
  */
4978
5311
  ManageMonitor = "manageMonitor",
@@ -4998,6 +5331,26 @@ export declare enum HostEvent {
4998
5331
  * ```js
4999
5332
  * spotterEmbed.trigger(HostEvent.Edit);
5000
5333
  * ```
5334
+ * @example
5335
+ * ```js
5336
+ * // Using context parameter to edit liveboard context
5337
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5338
+ * liveboardEmbed.trigger(HostEvent.Edit, {}, ContextType.Liveboard);
5339
+ * ```
5340
+ * @example
5341
+ * ```js
5342
+ * // Edit from search context
5343
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5344
+ * appEmbed.trigger(HostEvent.Edit, {}, ContextType.Search);
5345
+ * ```
5346
+ * * @example
5347
+ * ```js
5348
+ * // Edit from spotter context
5349
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5350
+ * appEmbed.trigger(HostEvent.Edit, {
5351
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
5352
+ * }, ContextType.Spotter);
5353
+ * ```
5001
5354
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
5002
5355
  */
5003
5356
  Edit = "edit",
@@ -5015,6 +5368,20 @@ export declare enum HostEvent {
5015
5368
  * ```js
5016
5369
  * vizEmbed.trigger(HostEvent.CopyLink)
5017
5370
  * ```
5371
+ * @example
5372
+ * ```js
5373
+ * // Copy link from liveboard context
5374
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5375
+ * liveboardEmbed.trigger(HostEvent.CopyLink, {}, ContextType.Liveboard);
5376
+ * ```
5377
+ * @example
5378
+ * ```js
5379
+ * // Copy link from liveboard visualization context
5380
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5381
+ * liveboardEmbed.trigger(HostEvent.CopyLink, {
5382
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
5383
+ * }, ContextType.Liveboard);
5384
+ * ```
5018
5385
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
5019
5386
  */
5020
5387
  CopyLink = "embedDocument",
@@ -5032,6 +5399,20 @@ export declare enum HostEvent {
5032
5399
  * ```js
5033
5400
  * vizEmbed.trigger(HostEvent.Present)
5034
5401
  * ```
5402
+ * @example
5403
+ * ```js
5404
+ * // Present from liveboard visualization context
5405
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5406
+ * liveboardEmbed.trigger(HostEvent.Present, {
5407
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
5408
+ * }, ContextType.Liveboard);
5409
+ * ```
5410
+ * @example
5411
+ * ```js
5412
+ * // Present from liveboard context
5413
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5414
+ * liveboardEmbed.trigger(HostEvent.Present, {}, ContextType.Liveboard);
5415
+ * ```
5035
5416
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
5036
5417
  */
5037
5418
  Present = "present",
@@ -5060,6 +5441,22 @@ export declare enum HostEvent {
5060
5441
  * tml.answer.search_query // TML representation of the search query
5061
5442
  * );
5062
5443
  * })
5444
+ * ```
5445
+ * @example
5446
+ * ```js
5447
+ * // Get TML from search context
5448
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5449
+ * appEmbed.trigger(HostEvent.GetTML, {}, ContextType.Search).then((tml) => {
5450
+ * console.log(tml.answer.search_query);
5451
+ * });
5452
+ * ```
5453
+ * @example
5454
+ * ```js
5455
+ * // Get TML from search-answer context
5456
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5457
+ * appEmbed.trigger(HostEvent.GetTML, {}, ContextType.Search).then((tml) => {
5458
+ * console.log(tml.answer);
5459
+ * });
5063
5460
  * ```
5064
5461
  * @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1.sw
5065
5462
  * @important
@@ -5081,6 +5478,20 @@ export declare enum HostEvent {
5081
5478
  * ```js
5082
5479
  * searchEmbed.trigger(HostEvent.ShowUnderlyingData)
5083
5480
  * ```
5481
+ * @example
5482
+ * ```js
5483
+ * // Show underlying data from liveboard visualization context
5484
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5485
+ * appEmbed.trigger(HostEvent.ShowUnderlyingData, {
5486
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
5487
+ * }, ContextType.Liveboard);
5488
+ * ```
5489
+ * @example
5490
+ * ```js
5491
+ * // Show underlying data from search context
5492
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5493
+ * appEmbed.trigger(HostEvent.ShowUnderlyingData, {}, ContextType.Search);
5494
+ * ```
5084
5495
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
5085
5496
  */
5086
5497
  ShowUnderlyingData = "showUnderlyingData",
@@ -5098,6 +5509,18 @@ export declare enum HostEvent {
5098
5509
  * ```js
5099
5510
  * searchEmbed.trigger(HostEvent.Delete)
5100
5511
  * ```
5512
+ * @example
5513
+ * ```js
5514
+ * // Delete from liveboard context
5515
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5516
+ * liveboardEmbed.trigger(HostEvent.Delete, {}, ContextType.Liveboard);
5517
+ * ```
5518
+ * @example
5519
+ * ```js
5520
+ * // Delete from search context
5521
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5522
+ * appEmbed.trigger(HostEvent.Delete, {}, ContextType.Search);
5523
+ * ```
5101
5524
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
5102
5525
  */
5103
5526
  Delete = "onDeleteAnswer",
@@ -5118,6 +5541,20 @@ export declare enum HostEvent {
5118
5541
  * ```js
5119
5542
  * searchEmbed.trigger(HostEvent.SpotIQAnalyze)
5120
5543
  * ```
5544
+ * @example
5545
+ * ```js
5546
+ * // SpotIQ analyze from search-answer context
5547
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5548
+ * appEmbed.trigger(HostEvent.SpotIQAnalyze, { vizId: '730496d6-6903-4601-937e-2c691821af3c' }, ContextType.Search);
5549
+ * ```
5550
+ * @example
5551
+ * ```js
5552
+ * // SpotIQ analyze from search context
5553
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5554
+ * liveboardEmbed.trigger(HostEvent.SpotIQAnalyze, {
5555
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
5556
+ * }, ContextType.Liveboard);
5557
+ * ```
5121
5558
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
5122
5559
  */
5123
5560
  SpotIQAnalyze = "spotIQAnalyze",
@@ -5169,6 +5606,12 @@ export declare enum HostEvent {
5169
5606
  *
5170
5607
  * spotterEmbed.trigger(HostEvent.DownloadAsPng, { vizId: latestSpotterVizId });
5171
5608
  * ```
5609
+ * @example
5610
+ * ```js
5611
+ * // Download as PNG from search-answer context
5612
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5613
+ * appEmbed.trigger(HostEvent.DownloadAsPng, {}, ContextType.Search);
5614
+ * ```
5172
5615
  *
5173
5616
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
5174
5617
  */
@@ -5197,6 +5640,18 @@ export declare enum HostEvent {
5197
5640
  *
5198
5641
  * spotterEmbed.trigger(HostEvent.DownloadAsCsv, { vizId: latestSpotterVizId });
5199
5642
  * ```
5643
+ * @example
5644
+ * ```js
5645
+ * // Download as CSV from search-answer context
5646
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5647
+ * appEmbed.trigger(HostEvent.DownloadAsCsv, {}, ContextType.Search);
5648
+ * ```
5649
+ * @example
5650
+ * ```js
5651
+ * // Download as CSV from search context
5652
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5653
+ * searchEmbed.trigger(HostEvent.DownloadAsCsv, {}, ContextType.Search);
5654
+ * ```
5200
5655
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
5201
5656
  */
5202
5657
  DownloadAsCsv = "downloadAsCSV",
@@ -5224,6 +5679,18 @@ export declare enum HostEvent {
5224
5679
  *
5225
5680
  * spotterEmbed.trigger(HostEvent.DownloadAsXlsx, { vizId: latestSpotterVizId });
5226
5681
  * ```
5682
+ * @example
5683
+ * ```js
5684
+ * // Download as XLSX from answer context
5685
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5686
+ * appEmbed.trigger(HostEvent.DownloadAsXlsx, {}, ContextType.Answer);
5687
+ * ```
5688
+ * @example
5689
+ * ```js
5690
+ * // Download as XLSX from search context
5691
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5692
+ * searchEmbed.trigger(HostEvent.DownloadAsXlsx, {}, ContextType.Search);
5693
+ * ```
5227
5694
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
5228
5695
  */
5229
5696
  DownloadAsXlsx = "downloadAsXLSX",
@@ -5237,6 +5704,18 @@ export declare enum HostEvent {
5237
5704
  * ```js
5238
5705
  * searchEmbed.trigger(HostEvent.Share)
5239
5706
  * ```
5707
+ * @example
5708
+ * ```js
5709
+ * // Share from Liveboard context
5710
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5711
+ * liveboardEmbed.trigger(HostEvent.Share, {}, ContextType.Liveboard);
5712
+ * ```
5713
+ * @example
5714
+ * ```js
5715
+ * // Share from search-answer context
5716
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5717
+ * appEmbed.trigger(HostEvent.Share, {}, ContextType.Search);
5718
+ * ```
5240
5719
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
5241
5720
  */
5242
5721
  Share = "share",
@@ -5276,6 +5755,18 @@ export declare enum HostEvent {
5276
5755
  *
5277
5756
  * spotterEmbed.trigger(HostEvent.Save, { vizId: latestSpotterVizId });
5278
5757
  * ```
5758
+ * @example
5759
+ * ```js
5760
+ * // Save from answer context
5761
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5762
+ * appEmbed.trigger(HostEvent.Save, {}, ContextType.Answer);
5763
+ * ```
5764
+ * @example
5765
+ * ```js
5766
+ * // Save from search context
5767
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5768
+ * searchEmbed.trigger(HostEvent.Save, {}, ContextType.Search);
5769
+ * ```
5279
5770
  *
5280
5771
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
5281
5772
  */
@@ -5292,6 +5783,20 @@ export declare enum HostEvent {
5292
5783
  * ```js
5293
5784
  * vizEmbed.trigger(HostEvent.SyncToSheets)
5294
5785
  * ```
5786
+ * @example
5787
+ * ```js
5788
+ * // Sync to sheets from answer context
5789
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5790
+ * appEmbed.trigger(HostEvent.SyncToSheets, {}, ContextType.Answer);
5791
+ * ```
5792
+ * @example
5793
+ * ```js
5794
+ * // Sync to sheets from liveboard context
5795
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5796
+ * liveboardEmbed.trigger(HostEvent.SyncToSheets, {
5797
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
5798
+ * }, ContextType.Liveboard);
5799
+ * ```
5295
5800
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
5296
5801
  */
5297
5802
  SyncToSheets = "sync-to-sheets",
@@ -5308,6 +5813,20 @@ export declare enum HostEvent {
5308
5813
  * ```js
5309
5814
  * vizEmbed.trigger(HostEvent.SyncToOtherApps)
5310
5815
  * ```
5816
+ * @example
5817
+ * ```js
5818
+ * // Sync to other apps from answer context
5819
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5820
+ * appEmbed.trigger(HostEvent.SyncToOtherApps, {}, ContextType.Answer);
5821
+ * ```
5822
+ * @example
5823
+ * ```js
5824
+ * // Sync to other apps from liveboard context
5825
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5826
+ * liveboardEmbed.trigger(HostEvent.SyncToOtherApps, {
5827
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
5828
+ * }, ContextType.Liveboard);
5829
+ * ```
5311
5830
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
5312
5831
  */
5313
5832
  SyncToOtherApps = "sync-to-other-apps",
@@ -5324,6 +5843,20 @@ export declare enum HostEvent {
5324
5843
  * ```js
5325
5844
  * vizEmbed.trigger(HostEvent.ManagePipelines)
5326
5845
  * ```
5846
+ * @example
5847
+ * ```js
5848
+ * // Manage pipelines from answer context
5849
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5850
+ * appEmbed.trigger(HostEvent.ManagePipelines, {}, ContextType.Answer);
5851
+ * ```
5852
+ * @example
5853
+ * ```js
5854
+ * // Manage pipelines from liveboard context
5855
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5856
+ * liveboardEmbed.trigger(HostEvent.ManagePipelines, {
5857
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
5858
+ * }, ContextType.Liveboard);
5859
+ * ```
5327
5860
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
5328
5861
  */
5329
5862
  ManagePipelines = "manage-pipeline",
@@ -5336,6 +5869,12 @@ export declare enum HostEvent {
5336
5869
  * ```js
5337
5870
  * appEmbed.trigger(HostEvent.ResetSearch)
5338
5871
  * ```
5872
+ * @example
5873
+ * ```js
5874
+ * // Reset search from search context
5875
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5876
+ * searchEmbed.trigger(HostEvent.ResetSearch, {}, ContextType.Search);
5877
+ * ```
5339
5878
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.0.1.sw
5340
5879
  */
5341
5880
  ResetSearch = "resetSearch",
@@ -5347,6 +5886,13 @@ export declare enum HostEvent {
5347
5886
  * const data = await liveboardEmbed.trigger(HostEvent.GetFilters);
5348
5887
  * console.log('data', data);
5349
5888
  * ```
5889
+ * @example
5890
+ * ```js
5891
+ * // Get filters from liveboard context
5892
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5893
+ * const data = await liveboardEmbed.trigger(HostEvent.GetFilters, {}, ContextType.Liveboard);
5894
+ * console.log('filters', data);
5895
+ * ```
5350
5896
  * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
5351
5897
  */
5352
5898
  GetFilters = "getFilters",
@@ -5354,7 +5900,8 @@ export declare enum HostEvent {
5354
5900
  * Update one or several filters applied on a Liveboard.
5355
5901
  * @param - Includes the following keys:
5356
5902
  * - `filter`: A single filter object containing column name, filter operator, and
5357
- * values. - `filters`: Multiple filter objects with column name, filter operator,
5903
+ * values.
5904
+ * - `filters`: Multiple filter objects with column name, filter operator,
5358
5905
  * and values for each.
5359
5906
  *
5360
5907
  * Each filter object must include the following attributes:
@@ -5437,6 +5984,18 @@ export declare enum HostEvent {
5437
5984
  * }]
5438
5985
  * });
5439
5986
  * ```
5987
+ * @example
5988
+ * ```js
5989
+ * // Update filters from liveboard context
5990
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
5991
+ * liveboardEmbed.trigger(HostEvent.UpdateFilters, {
5992
+ * filter: {
5993
+ * column: "item type",
5994
+ * oper: "IN",
5995
+ * values: ["shoes", "boots"]
5996
+ * }
5997
+ * }, ContextType.Liveboard);
5998
+ * ```
5440
5999
  * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
5441
6000
  */
5442
6001
  UpdateFilters = "updateFilters",
@@ -5450,6 +6009,14 @@ export declare enum HostEvent {
5450
6009
  * );
5451
6010
  * })
5452
6011
  * ```
6012
+ * @example
6013
+ * ```js
6014
+ * // Get tabs from liveboard context
6015
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
6016
+ * liveboardEmbed.trigger(HostEvent.GetTabs, {}, ContextType.Liveboard).then((tabDetails) => {
6017
+ * console.log('tabs', tabDetails);
6018
+ * });
6019
+ * ```
5453
6020
  * @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl
5454
6021
  */
5455
6022
  GetTabs = "getTabs",
@@ -5463,6 +6030,15 @@ export declare enum HostEvent {
5463
6030
  * '430496d6-6903-4601-937e-2c691821af3c',
5464
6031
  * 'f547ec54-2a37-4516-a222-2b06719af726'])
5465
6032
  * ```
6033
+ * @example
6034
+ * ```js
6035
+ * // Set visible tabs from liveboard context
6036
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
6037
+ * liveboardEmbed.trigger(HostEvent.SetVisibleTabs, [
6038
+ * '430496d6-6903-4601-937e-2c691821af3c',
6039
+ * 'f547ec54-2a37-4516-a222-2b06719af726'
6040
+ * ], ContextType.Liveboard);
6041
+ * ```
5466
6042
  * @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw
5467
6043
  */
5468
6044
  SetVisibleTabs = "SetPinboardVisibleTabs",
@@ -5476,6 +6052,15 @@ export declare enum HostEvent {
5476
6052
  * '630496d6-6903-4601-937e-2c691821af3c',
5477
6053
  * 'i547ec54-2a37-4516-a222-2b06719af726'])
5478
6054
  * ```
6055
+ * @example
6056
+ * ```js
6057
+ * // Set hidden tabs from liveboard context
6058
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
6059
+ * liveboardEmbed.trigger(HostEvent.SetHiddenTabs, [
6060
+ * '630496d6-6903-4601-937e-2c691821af3c',
6061
+ * 'i547ec54-2a37-4516-a222-2b06719af726'
6062
+ * ], ContextType.Liveboard);
6063
+ * ```
5479
6064
  * @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw
5480
6065
  */
5481
6066
  SetHiddenTabs = "SetPinboardHiddenTabs",
@@ -5552,13 +6137,24 @@ export declare enum HostEvent {
5552
6137
  UpdateCrossFilter = "UpdateCrossFilter",
5553
6138
  /**
5554
6139
  * Trigger reset action for a personalized Liveboard view.
6140
+ * This event is deprecated. Use {@link HostEvent.ResetLiveboardPersonalizedView} instead.
5555
6141
  * @example
5556
6142
  * ```js
5557
6143
  * liveboardEmbed.trigger(HostEvent.ResetLiveboardPersonalisedView);
5558
6144
  * ```
5559
6145
  * @version SDK: 1.29.0 | ThoughtSpot Cloud: 10.1.0.cl, 10.1.0.sw
6146
+ * @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
5560
6147
  */
5561
6148
  ResetLiveboardPersonalisedView = "ResetLiveboardPersonalisedView",
6149
+ /**
6150
+ * Trigger reset action for a personalized Liveboard view.
6151
+ * @example
6152
+ * ```js
6153
+ * liveboardEmbed.trigger(HostEvent.ResetLiveboardPersonalizedView);
6154
+ * ```
6155
+ * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
6156
+ */
6157
+ ResetLiveboardPersonalizedView = "ResetLiveboardPersonalisedView",
5562
6158
  /**
5563
6159
  * Triggers an action to update Parameter values on embedded
5564
6160
  * Answers, Liveboard, and Spotter answer in Edit mode.
@@ -5575,6 +6171,16 @@ export declare enum HostEvent {
5575
6171
  * isVisibleToUser: false
5576
6172
  * }])
5577
6173
  * ```
6174
+ * @example
6175
+ * ```js
6176
+ * // Update parameters from liveboard context
6177
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
6178
+ * liveboardEmbed.trigger(HostEvent.UpdateParameters, [{
6179
+ * name: "Region Param",
6180
+ * value: "West",
6181
+ * isVisibleToUser: true
6182
+ * }], ContextType.Liveboard);
6183
+ * ```
5578
6184
  * @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
5579
6185
  */
5580
6186
  UpdateParameters = "UpdateParameters",
@@ -5594,18 +6200,77 @@ export declare enum HostEvent {
5594
6200
  * });
5595
6201
  *
5596
6202
  * spotterEmbed.trigger(HostEvent.GetParameters, { vizId: latestSpotterVizId });
6203
+ *```
6204
+ * @example
6205
+ * ```js
6206
+ * // Get parameters from liveboard context
6207
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
6208
+ * liveboardEmbed.trigger(HostEvent.GetParameters, {}, ContextType.Liveboard).then((parameters) => {
6209
+ * console.log('parameters', parameters);
6210
+ * });
5597
6211
  * ```
5598
6212
  * @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
5599
6213
  */
5600
6214
  GetParameters = "GetParameters",
5601
6215
  /**
5602
6216
  * Triggers an event to update a personalized view of a Liveboard.
6217
+ * This event is deprecated. Use {@link HostEvent.UpdatePersonalizedView} instead.
5603
6218
  * ```js
5604
6219
  * liveboardEmbed.trigger(HostEvent.UpdatePersonalisedView, {viewId: '1234'})
5605
6220
  * ```
6221
+ * @example
6222
+ * ```js
6223
+ * // Update personalized view from liveboard context
6224
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
6225
+ * liveboardEmbed.trigger(HostEvent.UpdatePersonalisedView, {
6226
+ * viewId: '1234'
6227
+ * }, ContextType.Liveboard);
6228
+ * ```
5606
6229
  * @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
6230
+ * @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
5607
6231
  */
5608
6232
  UpdatePersonalisedView = "UpdatePersonalisedView",
6233
+ /**
6234
+ * Triggers an event to update a personalized view of a Liveboard.
6235
+ * ```js
6236
+ * liveboardEmbed.trigger(HostEvent.UpdatePersonalisedView, {viewId: '1234'})
6237
+ * ```
6238
+ * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
6239
+ */
6240
+ UpdatePersonalizedView = "UpdatePersonalisedView",
6241
+ /**
6242
+ * Triggers selection of a specific Personalized View on a
6243
+ * Liveboard without reloading the embed. Pass either a
6244
+ * `viewId` (GUID) or `viewName`. If both are provided, `viewId` takes precedence.
6245
+ * If neither is provided, the Liveboard resets to the original/default view.
6246
+ * When a `viewName` is provided and multiple views share
6247
+ * the same name, the first match is selected.
6248
+ * @example
6249
+ * ```js
6250
+ * liveboardEmbed.trigger(
6251
+ * HostEvent.SelectPersonalizedView,
6252
+ * { viewId: '2a021a12-1aed-425d-984b-141ee916ce72' },
6253
+ * )
6254
+ * ```
6255
+ * @example
6256
+ * ```js
6257
+ * // Select by name
6258
+ * liveboardEmbed.trigger(
6259
+ * HostEvent.SelectPersonalizedView,
6260
+ * { viewName: 'Dr Smith Cardiology' },
6261
+ * )
6262
+ * ```
6263
+ * @example
6264
+ * ```js
6265
+ * // Reset to default view
6266
+ * liveboardEmbed.trigger(
6267
+ * HostEvent.SelectPersonalizedView,
6268
+ * {},
6269
+ * )
6270
+ * ```
6271
+ * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
6272
+ */
6273
+ SelectPersonalizedView = "SelectPersonalisedView",
5609
6274
  /**
5610
6275
  * @hidden
5611
6276
  * Notify when info call is completed successfully
@@ -5625,7 +6290,8 @@ export declare enum HostEvent {
5625
6290
  * add a name and description for the Answer.
5626
6291
  * @param - Includes the following keys:
5627
6292
  * - `vizId`: Refers to the Answer ID in Spotter embed and is **required** in Spotter
5628
- * embed. - `name`: Optional. Name string for the Answer.
6293
+ * embed.
6294
+ * - `name`: Optional. Name string for the Answer.
5629
6295
  * - `description`: Optional. Description text for the Answer.
5630
6296
  * @example
5631
6297
  * ```js
@@ -5644,6 +6310,34 @@ export declare enum HostEvent {
5644
6310
  *
5645
6311
  * spotterEmbed.trigger(HostEvent.SaveAnswer, { vizId: latestSpotterVizId });
5646
6312
  * ```
6313
+ * @example
6314
+ * ```js
6315
+ * // Using context parameter to save answer from search context
6316
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
6317
+ * const saveAnswerResponse = await appEmbed.trigger(HostEvent.SaveAnswer, {
6318
+ * name: "Regional sales analysis",
6319
+ * description: "Sales breakdown by region"
6320
+ * }, ContextType.Search);
6321
+ * ```
6322
+ * @example
6323
+ * ```js
6324
+ * // Save answer from answer context (explore modal)
6325
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
6326
+ * const saveAnswerResponse = await appEmbed.trigger(HostEvent.SaveAnswer, {
6327
+ * name: "Modified analysis",
6328
+ * description: "Updated from explore view"
6329
+ * }, ContextType.Answer);
6330
+ * ```
6331
+ * @example
6332
+ * ```js
6333
+ * // Save answer from spotter context
6334
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
6335
+ * const saveAnswerResponse = await appEmbed.trigger(HostEvent.SaveAnswer, {
6336
+ * vizId: latestSpotterVizId,
6337
+ * name: "AI insights",
6338
+ * description: "Generated from Spotter"
6339
+ * }, ContextType.Spotter);
6340
+ * ```
5647
6341
  * @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
5648
6342
  */
5649
6343
  SaveAnswer = "saveAnswer",
@@ -5685,6 +6379,15 @@ export declare enum HostEvent {
5685
6379
  * executeSearch: true,
5686
6380
  * })
5687
6381
  * ```
6382
+ * @example
6383
+ * ```js
6384
+ * // Spotter search from spotter context
6385
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
6386
+ * spotterEmbed.trigger(HostEvent.SpotterSearch, {
6387
+ * query: 'sales by region',
6388
+ * executeSearch: true
6389
+ * }, ContextType.Spotter);
6390
+ * ```
5688
6391
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
5689
6392
  */
5690
6393
  SpotterSearch = "SpotterSearch",
@@ -5695,6 +6398,12 @@ export declare enum HostEvent {
5695
6398
  * ```js
5696
6399
  * spotterEmbed.trigger(HostEvent.EditLastPrompt, "revenue per year");
5697
6400
  * ```
6401
+ * @example
6402
+ * ```js
6403
+ * // Edit last prompt from spotter context
6404
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
6405
+ * spotterEmbed.trigger(HostEvent.EditLastPrompt, "sales by region", ContextType.Spotter);
6406
+ * ```
5698
6407
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
5699
6408
  */
5700
6409
  EditLastPrompt = "EditLastPrompt",
@@ -5704,6 +6413,12 @@ export declare enum HostEvent {
5704
6413
  * ```js
5705
6414
  * spotterEmbed.trigger(HostEvent.PreviewSpotterData);
5706
6415
  * ```
6416
+ * @example
6417
+ * ```js
6418
+ * // Preview spotter data from spotter context
6419
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
6420
+ * spotterEmbed.trigger(HostEvent.PreviewSpotterData, {}, ContextType.Spotter);
6421
+ * ```
5707
6422
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
5708
6423
  */
5709
6424
  PreviewSpotterData = "PreviewSpotterData",
@@ -6816,13 +7531,25 @@ export declare enum Action {
6816
7531
  /**
6817
7532
  * The Liveboard Personalised Views dropdown.
6818
7533
  * Allows navigating to a personalized Liveboard View.
7534
+ * This action is deprecated. Use {@link Action.PersonalizedViewsDropdown} instead.
6819
7535
  * @example
6820
7536
  * ```js
6821
7537
  * disabledActions: [Action.PersonalisedViewsDropdown]
6822
7538
  * ```
6823
7539
  * @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 10.1.0.sw
7540
+ * @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
6824
7541
  */
6825
7542
  PersonalisedViewsDropdown = "personalisedViewsDropdown",
7543
+ /**
7544
+ * The Liveboard Personalized Views dropdown.
7545
+ * Allows navigating to a personalized Liveboard View.
7546
+ * @example
7547
+ * ```js
7548
+ * disabledActions: [Action.PersonalizedViewsDropdown]
7549
+ * ```
7550
+ * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
7551
+ */
7552
+ PersonalizedViewsDropdown = "personalisedViewsDropdown",
6826
7553
  /**
6827
7554
  * Action ID for show or hide the user details on a
6828
7555
  * Liveboard (Recently visited / social proof)
@@ -6910,14 +7637,27 @@ export declare enum Action {
6910
7637
  /**
6911
7638
  * The **Organize Favourites** action on Homepage
6912
7639
  * *Favorites* module.
7640
+ * This action is deprecated. Use {@link Action.OrganizeFavorites} instead.
6913
7641
  *
6914
7642
  * @example
6915
7643
  * ```js
6916
7644
  * disabledActions: [Action.OrganiseFavourites]
6917
7645
  * ```
6918
7646
  * @version SDK: 1.32.0 | ThoughtSpot: 10.0.0.cl
7647
+ * @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
6919
7648
  */
6920
7649
  OrganiseFavourites = "organiseFavourites",
7650
+ /**
7651
+ * The **Organize Favorites** action on Homepage
7652
+ * *Favorites* module.
7653
+ *
7654
+ * @example
7655
+ * ```js
7656
+ * disabledActions: [Action.OrganizeFavorites]
7657
+ * ```
7658
+ * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
7659
+ */
7660
+ OrganizeFavorites = "organiseFavourites",
6921
7661
  /**
6922
7662
  * The **AI Highlights** action on a Liveboard.
6923
7663
  *
@@ -7729,7 +8469,8 @@ export declare enum EmbedErrorCodes {
7729
8469
  *
7730
8470
  * - **errorType**: One of the predefined {@link ErrorDetailsTypes} values
7731
8471
  * - **message**: Human-readable error description (string or array of strings for
7732
- * multiple errors) - **code**: Machine-readable error identifier {@link EmbedErrorCodes}
8472
+ * multiple errors)
8473
+ * - **code**: Machine-readable error identifier {@link EmbedErrorCodes}
7733
8474
  * values
7734
8475
  * - **[key: string]**: Additional context-specific for backward compatibility
7735
8476
  *
@@ -7777,6 +8518,22 @@ export interface EmbedErrorDetailsEvent {
7777
8518
  /** Additional context-specific for backward compatibility */
7778
8519
  [key: string]: any;
7779
8520
  }
8521
+ /**
8522
+ * Context types for specifying the page context when triggering host events.
8523
+ * Used as the third parameter in the `trigger` method to help ThoughtSpot
8524
+ * understand the current page context for better event handling.
8525
+ *
8526
+ * @example
8527
+ * ```js
8528
+ * import { HostEvent, ContextType } from '@thoughtspot/visual-embed-sdk';
8529
+ *
8530
+ * // Trigger an event with specific context
8531
+ * embed.trigger(HostEvent.Pin, { vizId: "123", liveboardId: "456" }, ContextType.Search);
8532
+ * ```
8533
+ *
8534
+ * @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl
8535
+ * @group Events
8536
+ */
7780
8537
  export declare enum ContextType {
7781
8538
  /**
7782
8539
  * Search answer context for search page or edit viz dialog on liveboard page.
@@ -7793,7 +8550,11 @@ export declare enum ContextType {
7793
8550
  /**
7794
8551
  * Spotter context for spotter modal/page.
7795
8552
  */
7796
- Spotter = "spotter"
8553
+ Spotter = "spotter",
8554
+ /**
8555
+ * Other context for any other generic page.
8556
+ */
8557
+ Other = "other"
7797
8558
  }
7798
8559
  export interface DefaultAppInitData {
7799
8560
  customisations: CustomisationsInterface;
@@ -7896,33 +8657,6 @@ export interface ObjectIds {
7896
8657
  */
7897
8658
  modalTitle?: string;
7898
8659
  }
7899
- /**
7900
- * Context object for the embedded component.
7901
- * @example
7902
- * ```js
7903
- * const context = await embed.getCurrentContext();
7904
- * console.log(context);
7905
- * {
7906
- * stack: [
7907
- * {
7908
- * name: 'Liveboard',
7909
- * type: ContextType.Liveboard,
7910
- * objectIds: {
7911
- * liveboardId: '123',
7912
- * },
7913
- * },
7914
- * ],
7915
- * currentContext: {
7916
- * name: 'Liveboard',
7917
- * type: ContextType.Liveboard,
7918
- * objectIds: {
7919
- * liveboardId: '123',
7920
- * },
7921
- * },
7922
- * }
7923
- * ```
7924
- * @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl
7925
- */
7926
8660
  export interface ContextObject {
7927
8661
  /**
7928
8662
  * Stack of context objects.
@@ -7953,6 +8687,11 @@ export interface ContextObject {
7953
8687
  objectIds: ObjectIds;
7954
8688
  };
7955
8689
  }
8690
+ export interface LiveboardTab {
8691
+ id: string;
8692
+ name: string;
8693
+ [key: string]: any;
8694
+ }
7956
8695
  export declare enum UIPassthroughEvent {
7957
8696
  PinAnswerToLiveboard = "addVizToPinboard",
7958
8697
  SaveAnswer = "saveAnswer",
@@ -7960,7 +8699,14 @@ export declare enum UIPassthroughEvent {
7960
8699
  GetAvailableUIPassthroughs = "getAvailableUiPassthroughs",
7961
8700
  GetAnswerConfig = "getAnswerPageConfig",
7962
8701
  GetLiveboardConfig = "getPinboardPageConfig",
7963
- GetUnsavedAnswerTML = "getUnsavedAnswerTML"
8702
+ GetUnsavedAnswerTML = "getUnsavedAnswerTML",
8703
+ GetAnswerSession = "getAnswerSession",
8704
+ GetFilters = "getFilters",
8705
+ GetIframeUrl = "getIframeUrl",
8706
+ GetParameters = "getParameters",
8707
+ GetTML = "getTML",
8708
+ GetTabs = "getTabs",
8709
+ GetExportRequestForCurrentPinboard = "getExportRequestForCurrentPinboard"
7964
8710
  }
7965
8711
  export type UIPassthroughContractBase = {
7966
8712
  [UIPassthroughEvent.PinAnswerToLiveboard]: {
@@ -8024,17 +8770,75 @@ export type UIPassthroughContractBase = {
8024
8770
  tml: string;
8025
8771
  };
8026
8772
  };
8773
+ [UIPassthroughEvent.GetAnswerSession]: {
8774
+ request: {
8775
+ vizId?: string;
8776
+ };
8777
+ response: {
8778
+ session: SessionInterface;
8779
+ embedAnswerData?: Record<string, any>;
8780
+ };
8781
+ };
8782
+ [UIPassthroughEvent.GetFilters]: {
8783
+ request: {
8784
+ vizId?: string;
8785
+ };
8786
+ response: {
8787
+ liveboardFilters: Record<string, any>[];
8788
+ runtimeFilters: RuntimeFilter[];
8789
+ };
8790
+ };
8791
+ [UIPassthroughEvent.GetIframeUrl]: {
8792
+ request: Record<string, never>;
8793
+ response: {
8794
+ iframeUrl: string;
8795
+ };
8796
+ };
8797
+ [UIPassthroughEvent.GetParameters]: {
8798
+ request: Record<string, never>;
8799
+ response: {
8800
+ parameters: Record<string, any>[];
8801
+ };
8802
+ };
8803
+ [UIPassthroughEvent.GetTML]: {
8804
+ request: {
8805
+ vizId?: string;
8806
+ includeNonExecutedSearchTokens?: boolean;
8807
+ };
8808
+ response: Record<string, any>;
8809
+ };
8810
+ [UIPassthroughEvent.GetTabs]: {
8811
+ request: Record<string, never>;
8812
+ response: {
8813
+ orderedTabIds: string[];
8814
+ numberOfTabs: number;
8815
+ Tabs: LiveboardTab[];
8816
+ };
8817
+ };
8818
+ [UIPassthroughEvent.GetExportRequestForCurrentPinboard]: {
8819
+ request: Record<string, never>;
8820
+ response: {
8821
+ v2Content: string;
8822
+ };
8823
+ };
8027
8824
  };
8028
8825
  export type UIPassthroughRequest<T extends keyof UIPassthroughContractBase> = UIPassthroughContractBase[T]["request"];
8029
8826
  export type UIPassthroughResponse<T extends keyof UIPassthroughContractBase> = UIPassthroughContractBase[T]["response"];
8030
8827
  export type UIPassthroughArrayResponse<ApiName extends keyof UIPassthroughContractBase> = Array<{
8031
- redId?: string;
8828
+ refId?: string;
8032
8829
  value?: UIPassthroughResponse<ApiName>;
8033
8830
  error?: any;
8034
8831
  }>;
8035
8832
  export type EmbedApiHostEventMapping = {
8036
8833
  [HostEvent.Pin]: UIPassthroughEvent.PinAnswerToLiveboard;
8037
8834
  [HostEvent.SaveAnswer]: UIPassthroughEvent.SaveAnswer;
8835
+ [HostEvent.GetAnswerSession]: UIPassthroughEvent.GetAnswerSession;
8836
+ [HostEvent.GetFilters]: UIPassthroughEvent.GetFilters;
8837
+ [HostEvent.GetIframeUrl]: UIPassthroughEvent.GetIframeUrl;
8838
+ [HostEvent.GetParameters]: UIPassthroughEvent.GetParameters;
8839
+ [HostEvent.GetTML]: UIPassthroughEvent.GetTML;
8840
+ [HostEvent.GetTabs]: UIPassthroughEvent.GetTabs;
8841
+ [HostEvent.getExportRequestForCurrentPinboard]: UIPassthroughEvent.GetExportRequestForCurrentPinboard;
8038
8842
  };
8039
8843
  export type HostEventRequest<HostEventT extends HostEvent> = HostEventT extends keyof EmbedApiHostEventMapping ? UIPassthroughRequest<EmbedApiHostEventMapping[HostEventT]> : any;
8040
8844
  export type HostEventResponse<HostEventT extends HostEvent, ContextT extends ContextType> = HostEventT extends keyof EmbedApiHostEventMapping ? UIPassthroughResponse<EmbedApiHostEventMapping[HostEventT]> : any;
@@ -8042,6 +8846,10 @@ export type TriggerPayload<PayloadT, HostEventT extends HostEvent> = PayloadT |
8042
8846
  export type TriggerResponse<PayloadT, HostEventT extends HostEvent, ContextT extends ContextType> = PayloadT extends HostEventRequest<HostEventT> ? HostEventResponse<HostEventT, ContextT> : any;
8043
8847
  declare class HostEventClient {
8044
8848
  iFrame: HTMLIFrameElement;
8849
+ /** Host events with custom handlers
8850
+ * (setters or special logic) -
8851
+ * bound to instance for protected method access */
8852
+ private readonly customHandlers;
8045
8853
  constructor(iFrame?: HTMLIFrameElement);
8046
8854
  /**
8047
8855
  * A wrapper over process trigger to
@@ -8052,6 +8860,12 @@ declare class HostEventClient {
8052
8860
  protected processTrigger(message: HostEvent, data: any, context?: ContextType): Promise<any>;
8053
8861
  handleHostEventWithParam<UIPassthroughEventT extends UIPassthroughEvent>(apiName: UIPassthroughEventT, parameters: UIPassthroughRequest<UIPassthroughEventT>, context?: ContextType): Promise<UIPassthroughResponse<UIPassthroughEventT>>;
8054
8862
  hostEventFallback(hostEvent: HostEvent, data: any, context?: ContextType): Promise<any>;
8863
+ /**
8864
+ * For getter events that return data. Tries UI passthrough first;
8865
+ * if the app doesn't support it (no response data), falls back to
8866
+ * the legacy host event channel. Real errors are thrown as-is.
8867
+ */
8868
+ private getDataWithPassthroughFallback;
8055
8869
  /**
8056
8870
  * Setter for the iframe element used for host events
8057
8871
  * @param {HTMLIFrameElement} iFrame - the iframe element to set
@@ -8395,7 +9209,21 @@ declare class TsEmbed {
8395
9209
  * Triggers an event to the embedded app
8396
9210
  * @param {HostEvent} messageType The event type
8397
9211
  * @param {any} data The payload to send with the message
9212
+ * @param {ContextType} context Optional context type to specify the context from which the event is triggered.
9213
+ * Use ContextType.Search for search answer context, ContextType.Answer for answer/explore context,
9214
+ * ContextType.Liveboard for liveboard context, or ContextType.Spotter for spotter context.
9215
+ * Available from SDK version 1.45.2 | ThoughtSpot: 26.3.0.cl
8398
9216
  * @returns A promise that resolves with the response from the embedded app
9217
+ * @example
9218
+ * ```js
9219
+ * // Trigger Pin event with context (SDK: 1.45.2+)
9220
+ * import { HostEvent, ContextType } from '@thoughtspot/visual-embed-sdk';
9221
+ * embed.trigger(HostEvent.Pin, {
9222
+ * vizId: "123",
9223
+ * liveboardId: "456"
9224
+ * }, ContextType.Search);
9225
+ * ```
9226
+ * @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl (for context parameter)
8399
9227
  */
8400
9228
  trigger<HostEventT extends HostEvent, PayloadT, ContextT extends ContextType>(messageType: HostEventT, data?: TriggerPayload<PayloadT, HostEventT>, context?: ContextT): Promise<TriggerResponse<PayloadT, HostEventT, ContextT>>;
8401
9229
  /**
@@ -8416,8 +9244,33 @@ declare class TsEmbed {
8416
9244
  getIframeSrc(): string;
8417
9245
  protected handleRenderForPrerender(): Promise<TsEmbed>;
8418
9246
  /**
8419
- * Get the current context of the embedded TS component.
8420
- * @returns The current context object containing the page type and object ids.
9247
+ * Context object for the embedded component.
9248
+ * @returns {ContextObject} The current context object containing the page type and object ids.
9249
+ * @example
9250
+ * ```js
9251
+ * const context = await embed.getCurrentContext();
9252
+ * console.log(context);
9253
+ *
9254
+ * // Example output
9255
+ * {
9256
+ * stack: [
9257
+ * {
9258
+ * name: 'Liveboard',
9259
+ * type: ContextType.Liveboard,
9260
+ * objectIds: {
9261
+ * liveboardId: '123',
9262
+ * },
9263
+ * },
9264
+ * ],
9265
+ * currentContext: {
9266
+ * name: 'Liveboard',
9267
+ * type: ContextType.Liveboard,
9268
+ * objectIds: {
9269
+ * liveboardId: '123',
9270
+ * },
9271
+ * },
9272
+ * }
9273
+ * ```
8421
9274
  * @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl
8422
9275
  */
8423
9276
  getCurrentContext(): Promise<ContextObject>;
@@ -9656,6 +10509,7 @@ export declare class AppEmbed extends V1Embed {
9656
10509
  * @param pageId The ID of the page to be embedded.
9657
10510
  */
9658
10511
  getIFrameSrc(): string;
10512
+ private HEIGHT_CHANAGE_THRESHOLD;
9659
10513
  /**
9660
10514
  * Set the iframe height as per the computed height received
9661
10515
  * from the ThoughtSpot app.
@@ -9727,7 +10581,8 @@ export declare enum AuthFailureType {
9727
10581
  /**
9728
10582
  * The current authentication token or session has expired.
9729
10583
  *
9730
- * Emitted when the embed receives an auth-expiry signal and starts auth refresh handling.
10584
+ * Emitted when the embed receives an auth-expiry signal and starts auth refresh
10585
+ * handling.
9731
10586
  */
9732
10587
  EXPIRY = "EXPIRY",
9733
10588
  /**
@@ -10497,6 +11352,7 @@ export declare class LiveboardEmbed extends V1Embed {
10497
11352
  * to be loaded within the iFrame.
10498
11353
  */
10499
11354
  private getIFrameSrc;
11355
+ private HEIGHT_CHANAGE_THRESHOLD;
10500
11356
  /**
10501
11357
  * Set the iframe height as per the computed height received
10502
11358
  * from the ThoughtSpot app.