@thoughtspot/visual-embed-sdk 1.35.5-hostEvent.6 → 1.35.5-hostEvent.8

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 (105) hide show
  1. package/cjs/package.json +1 -1
  2. package/cjs/src/embed/app.d.ts +1 -1
  3. package/cjs/src/embed/base.d.ts +1 -1
  4. package/cjs/src/embed/base.js +1 -1
  5. package/cjs/src/embed/hostEventClient/contracts.d.ts +26 -30
  6. package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  7. package/cjs/src/embed/hostEventClient/contracts.js +10 -10
  8. package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
  9. package/cjs/src/embed/hostEventClient/host-event-client.d.ts +21 -7
  10. package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  11. package/cjs/src/embed/hostEventClient/host-event-client.js +62 -28
  12. package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
  13. package/cjs/src/embed/hostEventClient/host-event-client.spec.js +43 -39
  14. package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  15. package/cjs/src/embed/liveboard.d.ts +8 -7
  16. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  17. package/cjs/src/embed/liveboard.js +2 -2
  18. package/cjs/src/embed/liveboard.js.map +1 -1
  19. package/cjs/src/embed/liveboard.spec.js +4 -2
  20. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  21. package/cjs/src/embed/ts-embed.d.ts +14 -9
  22. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  23. package/cjs/src/embed/ts-embed.js +23 -15
  24. package/cjs/src/embed/ts-embed.js.map +1 -1
  25. package/cjs/src/embed/ts-embed.spec.js +4 -4
  26. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  27. package/cjs/src/index.d.ts +2 -2
  28. package/cjs/src/index.js +2 -2
  29. package/cjs/src/react/all-types-export.d.ts +1 -1
  30. package/cjs/src/react/all-types-export.js +2 -2
  31. package/cjs/src/types.d.ts +26 -21
  32. package/cjs/src/types.d.ts.map +1 -1
  33. package/cjs/src/types.js +20 -19
  34. package/cjs/src/types.js.map +1 -1
  35. package/dist/index-DaLHJaLd.js +7370 -0
  36. package/dist/index-nWevLycs.js +7370 -0
  37. package/dist/src/embed/app.d.ts +1 -1
  38. package/dist/src/embed/base.d.ts +1 -1
  39. package/dist/src/embed/hostEventClient/contracts.d.ts +26 -30
  40. package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  41. package/dist/src/embed/hostEventClient/host-event-client.d.ts +21 -7
  42. package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  43. package/dist/src/embed/liveboard.d.ts +8 -7
  44. package/dist/src/embed/liveboard.d.ts.map +1 -1
  45. package/dist/src/embed/ts-embed.d.ts +14 -9
  46. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  47. package/dist/src/index.d.ts +2 -2
  48. package/dist/src/react/all-types-export.d.ts +1 -1
  49. package/dist/src/types.d.ts +26 -21
  50. package/dist/src/types.d.ts.map +1 -1
  51. package/dist/tsembed-react.es.js +118 -76
  52. package/dist/tsembed-react.js +117 -75
  53. package/dist/tsembed.es.js +120 -78
  54. package/dist/tsembed.js +118 -76
  55. package/dist/visual-embed-sdk-react-full.d.ts +96 -75
  56. package/dist/visual-embed-sdk-react.d.ts +96 -75
  57. package/dist/visual-embed-sdk.d.ts +96 -75
  58. package/lib/package.json +1 -1
  59. package/lib/src/embed/app.d.ts +1 -1
  60. package/lib/src/embed/base.d.ts +1 -1
  61. package/lib/src/embed/base.js +1 -1
  62. package/lib/src/embed/hostEventClient/contracts.d.ts +26 -30
  63. package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  64. package/lib/src/embed/hostEventClient/contracts.js +9 -9
  65. package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
  66. package/lib/src/embed/hostEventClient/host-event-client.d.ts +21 -7
  67. package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  68. package/lib/src/embed/hostEventClient/host-event-client.js +64 -30
  69. package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
  70. package/lib/src/embed/hostEventClient/host-event-client.spec.js +43 -40
  71. package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  72. package/lib/src/embed/liveboard.d.ts +8 -7
  73. package/lib/src/embed/liveboard.d.ts.map +1 -1
  74. package/lib/src/embed/liveboard.js +2 -2
  75. package/lib/src/embed/liveboard.js.map +1 -1
  76. package/lib/src/embed/liveboard.spec.js +4 -2
  77. package/lib/src/embed/liveboard.spec.js.map +1 -1
  78. package/lib/src/embed/ts-embed.d.ts +14 -9
  79. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  80. package/lib/src/embed/ts-embed.js +23 -15
  81. package/lib/src/embed/ts-embed.js.map +1 -1
  82. package/lib/src/embed/ts-embed.spec.js +5 -5
  83. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  84. package/lib/src/index.d.ts +2 -2
  85. package/lib/src/index.js +2 -2
  86. package/lib/src/react/all-types-export.d.ts +1 -1
  87. package/lib/src/react/all-types-export.js +1 -1
  88. package/lib/src/types.d.ts +26 -21
  89. package/lib/src/types.d.ts.map +1 -1
  90. package/lib/src/types.js +20 -19
  91. package/lib/src/types.js.map +1 -1
  92. package/lib/src/visual-embed-sdk.d.ts +99 -78
  93. package/package.json +1 -1
  94. package/src/embed/app.ts +1 -1
  95. package/src/embed/base.ts +1 -1
  96. package/src/embed/hostEventClient/contracts.ts +43 -32
  97. package/src/embed/hostEventClient/host-event-client.spec.ts +58 -54
  98. package/src/embed/hostEventClient/host-event-client.ts +105 -48
  99. package/src/embed/liveboard.spec.ts +4 -2
  100. package/src/embed/liveboard.ts +8 -7
  101. package/src/embed/ts-embed.spec.ts +6 -6
  102. package/src/embed/ts-embed.ts +39 -28
  103. package/src/index.ts +2 -2
  104. package/src/react/all-types-export.ts +1 -1
  105. package/src/types.ts +26 -21
@@ -1160,7 +1160,7 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
1160
1160
  */
1161
1161
  showLiveboardVerifiedBadge?: boolean;
1162
1162
  /**
1163
- * This flag is used to enable/disable hide irrelevant filters in liveboard tab
1163
+ * This flag is used to enable/disable hide irrelevant filters in Liveboard tab
1164
1164
  * @type {boolean}
1165
1165
  * @default false
1166
1166
  * @version SDK: 1.36.0 | ThoughtSpot:10.6.0.cl
@@ -1474,7 +1474,7 @@ export interface LiveboardViewConfig extends Omit<ViewConfig, 'hiddenHomepageMod
1474
1474
  */
1475
1475
  enableAskSage?: boolean;
1476
1476
  /**
1477
- * This flag is used to enable the 2 column layout in liveboard
1477
+ * This flag is used to enable the 2 column layout on a Liveboard
1478
1478
  * @type {boolean}
1479
1479
  * @default false
1480
1480
  * @version SDK: 1.32.0 | ThoughtSpot:10.1.0.cl
@@ -1509,7 +1509,7 @@ export interface LiveboardViewConfig extends Omit<ViewConfig, 'hiddenHomepageMod
1509
1509
  */
1510
1510
  showPreviewLoader?: boolean;
1511
1511
  /**
1512
- * This flag is used to enable the compact header in liveboard
1512
+ * This flag is used to enable the compact header on a Liveboard
1513
1513
  * @type {boolean}
1514
1514
  * @default false
1515
1515
  * @version SDK: 1.35.0 | ThoughtSpot:10.3.0.cl
@@ -1523,7 +1523,7 @@ export interface LiveboardViewConfig extends Omit<ViewConfig, 'hiddenHomepageMod
1523
1523
  */
1524
1524
  isLiveboardCompactHeaderEnabled?: boolean;
1525
1525
  /**
1526
- * This flag is used to show/hide verified Icon in liveboard compact header
1526
+ * This flag is used to show/hide verified icon in the Liveboard compact header
1527
1527
  * @type {boolean}
1528
1528
  * @default true
1529
1529
  * @version SDK: 1.35.0 | ThoughtSpot:10.4.0.cl
@@ -1537,7 +1537,8 @@ export interface LiveboardViewConfig extends Omit<ViewConfig, 'hiddenHomepageMod
1537
1537
  */
1538
1538
  showLiveboardVerifiedBadge?: boolean;
1539
1539
  /**
1540
- * This flag is used to show/hide re-verify banner in liveboard compact header
1540
+ * This flag is used to show/hide the re-verify banner
1541
+ * in Liveboard compact header
1541
1542
  * @type {boolean}
1542
1543
  * @default true
1543
1544
  * @version SDK: 1.35.0 | ThoughtSpot:10.4.0.cl
@@ -1551,7 +1552,7 @@ export interface LiveboardViewConfig extends Omit<ViewConfig, 'hiddenHomepageMod
1551
1552
  */
1552
1553
  showLiveboardReverifyBanner?: boolean;
1553
1554
  /**
1554
- * This flag is used to enable/disable hide irrelevant filters in liveboard tab
1555
+ * This flag is used to enable/disable hide irrelevant filters in a Liveboard tab
1555
1556
  * @type {boolean}
1556
1557
  * @default false
1557
1558
  * @version SDK: 1.36.0 | ThoughtSpot:10.6.0.cl
@@ -1640,8 +1641,8 @@ export declare class LiveboardEmbed extends V1Embed {
1640
1641
  render(): Promise<LiveboardEmbed>;
1641
1642
  navigateToLiveboard(liveboardId: string, vizId?: string, activeTabId?: string): void;
1642
1643
  /**
1643
- * Returns the full url of the liveboard/viz which can be used to open
1644
- * this liveboard inside the full Thoughtspot application in a new tab.
1644
+ * Returns the full url of the Liveboard/visualization which can be used to open
1645
+ * this Liveboard inside the full Thoughtspot application in a new tab.
1645
1646
  * @returns url string
1646
1647
  */
1647
1648
  getLiveboardUrl(): string;
@@ -1744,7 +1745,7 @@ export declare class ConversationEmbed extends TsEmbed {
1744
1745
  * @summary ThoughtSpot Visual Embed SDK
1745
1746
  * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
1746
1747
  */
1747
- export { init, logout, prefetch, executeTML, exportTML, executeTMLInput, exportTMLInput, getEmbedConfig as getInitConfig, getSessionInfo, tokenizedFetch, getAnswerFromQuery, createLiveboardWithAnswers, SearchEmbed, SearchBarEmbed, PinboardEmbed, LiveboardEmbed, SageEmbed, AppEmbed, BodylessConversation, BodylessConversationViewConfig, ConversationEmbed, ConversationViewConfig, AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter, AnswerService, SessionInterface, UnderlyingDataPoint, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, ContextMenuTriggerOptions, EmbedConfig, SearchViewConfig, SearchBarViewConfig, LiveboardViewConfig, SageViewConfig, AppViewConfig, PrefetchFeatures, FrameParams, HomeLeftNavItem, HomepageModule, DOMSelector, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, CustomCssVariables, RuntimeParameter, LogLevel, uploadMixpanelEvent, MIXPANEL_EVENT, HomePageSearchBarMode, VizPoint, CustomActionPayload, UiPassthroughEvent, };
1748
+ export { init, logout, prefetch, executeTML, exportTML, executeTMLInput, exportTMLInput, getEmbedConfig as getInitConfig, getSessionInfo, tokenizedFetch, getAnswerFromQuery, createLiveboardWithAnswers, SearchEmbed, SearchBarEmbed, PinboardEmbed, LiveboardEmbed, SageEmbed, AppEmbed, BodylessConversation, BodylessConversationViewConfig, ConversationEmbed, ConversationViewConfig, AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter, AnswerService, SessionInterface, UnderlyingDataPoint, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, ContextMenuTriggerOptions, EmbedConfig, SearchViewConfig, SearchBarViewConfig, LiveboardViewConfig, SageViewConfig, AppViewConfig, PrefetchFeatures, FrameParams, HomeLeftNavItem, HomepageModule, DOMSelector, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, CustomCssVariables, RuntimeParameter, LogLevel, uploadMixpanelEvent, MIXPANEL_EVENT, HomePageSearchBarMode, VizPoint, CustomActionPayload, UIPassthroughEvent, };
1748
1749
 
1749
1750
  /**
1750
1751
  * Copyright (c) 2023
@@ -2804,8 +2805,12 @@ export interface ViewConfig {
2804
2805
  */
2805
2806
  enableCustomColumnGroups?: boolean;
2806
2807
  /**
2807
- * View content for another org directly without having to use the org switcher
2808
- * This flag is honoured if orgPerUrl feature is enabled for the ThoughtSpot cluster
2808
+ * Overrides an Org context for embedding application users.
2809
+ * This parameter allows a user authenticated to one Org to view the
2810
+ * objects from another Org.
2811
+ * The `overrideOrgId` setting is honoured only if the
2812
+ * Per Org URL feature is enabled on your ThoughtSpot instance.
2813
+ *
2809
2814
  * @example
2810
2815
  * ```js
2811
2816
  * const embed = new LiveboardEmbed('#embed', {
@@ -4062,7 +4067,7 @@ export declare enum HostEvent {
4062
4067
  * @param - autoDrillDown - Optional. If true, the drill down will be
4063
4068
  * done automatically on the most popular column.
4064
4069
  * @param - vizId [TS >= 9.8.0] - Optional. The GUID of the visualization to drill
4065
- * in case of a liveboard.
4070
+ * in case of a Liveboard.
4066
4071
  * @example
4067
4072
  * ```js
4068
4073
  * searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
@@ -4149,26 +4154,26 @@ export declare enum HostEvent {
4149
4154
  */
4150
4155
  SetActiveTab = "SetActiveTab",
4151
4156
  /**
4152
- * Update runtime filters applied on a Saved Answer or Liveboard. The
4153
- * runtime filters passed here are appended to the existing runtime
4154
- * filters.
4157
+ * Updates the runtime filters applied on a Liveboard. The filter
4158
+ * attributes passed with this event are appended to the existing runtime
4159
+ * filters applied on a Liveboard.
4160
+ *
4155
4161
  * Pass an array of runtime filters with the following attributes:
4156
4162
  *
4157
- * `columnName`
4158
- * _String_. The name of the column to filter on.
4163
+ * `columnName` - _String_. The name of the column to filter on.
4159
4164
  *
4160
- * `operator`
4161
- * Runtime filter operator to apply. For information,
4165
+ * `operator` - Runtime filter operator to apply. For more information,
4162
4166
  * see link:https://developers.thoughtspot.com/docs/?pageid=runtime-filters#rtOperator[Developer Documentation].
4163
4167
  *
4164
- * `values`
4165
- * List of operands. Some operators such as EQ, LE allow a single value, whereas
4166
- * operators such as BW and IN accept multiple operands.
4168
+ * `values` - List of operands. Some operators such as EQ and LE allow a
4169
+ * single value, whereas BW and IN accept multiple values.
4170
+ *
4171
+ * **Note**: `HostEvent.UpdateRuntimeFilters` is supported in `LiveboardEmbed`
4172
+ * and `AppEmbed` only. In full application embedding, this event updates
4173
+ * the runtime filters applied on the Liveboard and saved Answer objects.
4167
4174
  *
4168
- * **Note**: `HostEvent.UpdateRuntimeFilters` is not supported in
4169
- * Search embedding (SearchEmbed) and Natural Language Search
4170
- * embedding (SageEmbed).
4171
4175
  * @param - {@link RuntimeFilter}[] an array of {@link RuntimeFilter} Types.
4176
+ *
4172
4177
  * @example
4173
4178
  * ```js
4174
4179
  * liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
@@ -4867,7 +4872,7 @@ export declare enum HostEvent {
4867
4872
  */
4868
4873
  ResetLiveboardPersonalisedView = "ResetLiveboardPersonalisedView",
4869
4874
  /**
4870
- * Triggers Update RuntimeParameters for answers and liveboard
4875
+ * Triggers an event to Update Parameter values for Answers and Liveboard
4871
4876
  * @example
4872
4877
  * ```js
4873
4878
  * liveboardEmbed.trigger(HostEvent.UpdateParameters, [{
@@ -4889,7 +4894,7 @@ export declare enum HostEvent {
4889
4894
  */
4890
4895
  GetParameters = "GetParameters",
4891
4896
  /**
4892
- * Triggers update of persoanlised view for a liveboard
4897
+ * Triggers an event to update a persoanlised view of a Liveboard
4893
4898
  * ```js
4894
4899
  * liveboardEmbed.trigger(HostEvent.UpdatePersonalisedView, {viewId: '1234'})
4895
4900
  * ```
@@ -4905,7 +4910,7 @@ export declare enum HostEvent {
4905
4910
  * EmbedApi
4906
4911
  * @hidden
4907
4912
  */
4908
- UiPassthrough = "UiPassthrough"
4913
+ UIPassthrough = "UiPassthrough"
4909
4914
  }
4910
4915
  /**
4911
4916
  * The different visual modes that the data sources panel within
@@ -5878,7 +5883,7 @@ export declare enum Action {
5878
5883
  */
5879
5884
  ModifySageAnswer = "modifySageAnswer",
5880
5885
  /**
5881
- * The **Move to Tab** menu action on visualizations in liveboard edit mode.
5886
+ * The **Move to Tab** menu action on visualizations in Liveboard edit mode.
5882
5887
  * Allows moving a visualization to a different tab.
5883
5888
  * @example
5884
5889
  * ```js
@@ -5931,7 +5936,8 @@ export declare enum Action {
5931
5936
  */
5932
5937
  TML = "tml",
5933
5938
  /**
5934
- * Action Id for CreateLiveboard for liveboard list page & Pin Modal
5939
+ * Action ID for the create Liveboard option on the Liveboard list page
5940
+ * and Pin modal
5935
5941
  * @example
5936
5942
  * ```js
5937
5943
  * hiddenAction: [Action.CreateLiveboard]
@@ -6300,6 +6306,11 @@ export declare class TsEmbed {
6300
6306
  * will be rendered.
6301
6307
  */
6302
6308
  protected iFrame: HTMLIFrameElement;
6309
+ /**
6310
+ * Setter for the iframe element
6311
+ * @param {HTMLIFrameElement} iFrame HTMLIFrameElement
6312
+ */
6313
+ protected setIframeElement(iFrame: HTMLIFrameElement): void;
6303
6314
  protected viewConfig: ViewConfig;
6304
6315
  protected embedConfig: EmbedConfig;
6305
6316
  /**
@@ -6431,19 +6442,19 @@ export declare class TsEmbed {
6431
6442
  off(messageType: EmbedEvent, callback: MessageCallback): typeof TsEmbed.prototype;
6432
6443
  /**
6433
6444
  * Triggers an event to the embedded app
6434
- * @param messageType The event type
6435
- * @param data The payload to send with the message
6445
+ * @param {HostEvent} messageType The event type
6446
+ * @param {any} data The payload to send with the message
6436
6447
  * @returns A promise that resolves with the response from the embedded app
6437
6448
  */
6438
- trigger<HostEventT extends HostEvent>(messageType: HostEventT, data?: HostEventRequest<HostEventT>): Promise<HostEventResponse<HostEventT>>;
6449
+ trigger<HostEventT extends HostEvent, PayloadT>(messageType: HostEventT, data?: TriggerPayload<PayloadT, HostEventT>): Promise<TriggerResponse<PayloadT, HostEventT>>;
6439
6450
  /**
6440
6451
  * Triggers an event to the embedded app, skipping the UI flow.
6441
- * @param {UiPassthroughEvent} apiName - The name of the API to be triggered.
6442
- * @param {UiPassthroughRequest} parameters - The parameters to be passed to the API.
6443
- * @returns {Promise<UiPassthroughRequest>} - A promise that resolves with the response
6452
+ * @param {UIPassthroughEvent} apiName - The name of the API to be triggered.
6453
+ * @param {UIPassthroughRequest} parameters - The parameters to be passed to the API.
6454
+ * @returns {Promise<UIPassthroughRequest>} - A promise that resolves with the response
6444
6455
  * from the embedded app.
6445
6456
  */
6446
- triggerUiPassThrough<UiPassthroughEventT extends UiPassthroughEvent>(apiName: UiPassthroughEventT, parameters: UiPassthroughRequest<UiPassthroughEventT>): UiPassthroughArrayResponse<UiPassthroughEventT>;
6457
+ triggerUIPassThrough<UIPassthroughEventT extends UIPassthroughEvent>(apiName: UIPassthroughEventT, parameters: UIPassthroughRequest<UIPassthroughEventT>): Promise<UIPassthroughArrayResponse<UIPassthroughEventT>>;
6447
6458
  /**
6448
6459
  * Marks the ThoughtSpot object to have been rendered
6449
6460
  * Needs to be overridden by subclasses to do the actual
@@ -6517,7 +6528,7 @@ export declare class TsEmbed {
6517
6528
  /**
6518
6529
  * Returns the answerService which can be used to make arbitrary graphql calls on top
6519
6530
  * session.
6520
- * @param vizId [Optional] to get for a specific viz in case of a liveboard.
6531
+ * @param vizId [Optional] to get for a specific viz in case of a Liveboard.
6521
6532
  * @version SDK: 1.25.0 / ThoughtSpot 9.10.0
6522
6533
  */
6523
6534
  getAnswerService(vizId?: string): Promise<AnswerService>;
@@ -6562,16 +6573,16 @@ export declare class V1Embed extends TsEmbed {
6562
6573
  test__executeCallbacks: (eventType: EmbedEvent, data: any, eventPort?: void | MessagePort) => void;
6563
6574
  }
6564
6575
 
6565
- export declare enum UiPassthroughEvent {
6566
- addVizToPinboard = "addVizToPinboard",
6567
- saveAnswer = "saveAnswer",
6568
- getDiscoverabilityStatus = "getDiscoverabilityStatus",
6569
- getAvailableUiPassthroughs = "getAvailableUiPassthroughs",
6570
- getAnswerPageConfig = "getAnswerPageConfig",
6571
- getPinboardPageConfig = "getPinboardPageConfig"
6576
+ export declare enum UIPassthroughEvent {
6577
+ PinAnswerToLiveboard = "addVizToPinboard",
6578
+ SaveAnswer = "saveAnswer",
6579
+ GetDiscoverabilityStatus = "getDiscoverabilityStatus",
6580
+ GetAvailableUIPassthroughs = "getAvailableUIPassthroughs",
6581
+ GetAnswerConfig = "getAnswerPageConfig",
6582
+ GetLiveboardConfig = "getPinboardPageConfig"
6572
6583
  }
6573
- export type UiPassthroughContractBase = {
6574
- [UiPassthroughEvent.addVizToPinboard]: {
6584
+ export type UIPassthroughContractBase = {
6585
+ [UIPassthroughEvent.PinAnswerToLiveboard]: {
6575
6586
  request: {
6576
6587
  vizId?: string;
6577
6588
  newVizName: string;
@@ -6587,7 +6598,7 @@ export type UiPassthroughContractBase = {
6587
6598
  vizId: string;
6588
6599
  };
6589
6600
  };
6590
- [UiPassthroughEvent.saveAnswer]: {
6601
+ [UIPassthroughEvent.SaveAnswer]: {
6591
6602
  request: {
6592
6603
  name: string;
6593
6604
  description: string;
@@ -6596,53 +6607,49 @@ export type UiPassthroughContractBase = {
6596
6607
  };
6597
6608
  response: {
6598
6609
  answerId: string;
6599
- saveResponse: any;
6610
+ saveResponse?: any;
6600
6611
  shareResponse?: any;
6601
- errors?: any;
6602
6612
  };
6603
6613
  };
6604
- [UiPassthroughEvent.getDiscoverabilityStatus]: {
6614
+ [UIPassthroughEvent.GetDiscoverabilityStatus]: {
6605
6615
  request: any;
6606
6616
  response: {
6607
6617
  shouldShowDiscoverability: boolean;
6608
6618
  isDiscoverabilityCheckboxUnselectedPerOrg: boolean;
6609
6619
  };
6610
6620
  };
6611
- [UiPassthroughEvent.getAvailableUiPassthroughs]: {
6621
+ [UIPassthroughEvent.GetAvailableUIPassthroughs]: {
6612
6622
  request: any;
6613
6623
  response: {
6614
6624
  keys: string[];
6615
6625
  };
6616
6626
  };
6617
- [UiPassthroughEvent.getAnswerPageConfig]: {
6627
+ [UIPassthroughEvent.GetAnswerConfig]: {
6618
6628
  request: {
6619
6629
  vizId?: string;
6620
6630
  };
6621
6631
  response: any;
6622
6632
  };
6623
- [UiPassthroughEvent.getPinboardPageConfig]: {
6633
+ [UIPassthroughEvent.GetLiveboardConfig]: {
6624
6634
  request: any;
6625
6635
  response: any;
6626
6636
  };
6627
6637
  };
6628
- export type FlattenType<T> = T extends infer R ? {
6629
- [K in keyof R]: R[K];
6630
- } : never;
6631
- export type UiPassthroughRequest<T extends keyof UiPassthroughContractBase> = FlattenType<UiPassthroughContractBase[T]['request']>;
6632
- export type UiPassthroughResponse<T extends keyof UiPassthroughContractBase> = FlattenType<UiPassthroughContractBase[T]['response']>;
6633
- export type UiPassthroughArrayResponse<ApiName extends keyof UiPassthroughContractBase> = Promise<Array<{
6638
+ export type UIPassthroughRequest<T extends keyof UIPassthroughContractBase> = UIPassthroughContractBase[T]['request'];
6639
+ export type UIPassthroughResponse<T extends keyof UIPassthroughContractBase> = UIPassthroughContractBase[T]['response'];
6640
+ export type UIPassthroughArrayResponse<ApiName extends keyof UIPassthroughContractBase> = Array<{
6634
6641
  redId?: string;
6635
- value?: UiPassthroughResponse<ApiName>;
6642
+ value?: UIPassthroughResponse<ApiName>;
6636
6643
  error?: any;
6637
- }>>;
6644
+ }>;
6638
6645
  export type EmbedApiHostEventMapping = {
6639
- [HostEvent.Pin]: UiPassthroughEvent.addVizToPinboard;
6640
- [HostEvent.SaveAnswer]: UiPassthroughEvent.saveAnswer;
6646
+ [HostEvent.Pin]: UIPassthroughEvent.PinAnswerToLiveboard;
6647
+ [HostEvent.SaveAnswer]: UIPassthroughEvent.SaveAnswer;
6641
6648
  };
6642
- export type HostEventRequest<HostEventT extends HostEvent> = HostEventT extends keyof EmbedApiHostEventMapping ? FlattenType<UiPassthroughRequest<EmbedApiHostEventMapping[HostEventT]>> : any;
6643
- export type HostEventResponse<HostEventT extends HostEvent> = HostEventT extends keyof EmbedApiHostEventMapping ? {
6644
- value?: UiPassthroughResponse<EmbedApiHostEventMapping[HostEventT]>;
6645
- } : any;
6649
+ export type HostEventRequest<HostEventT extends HostEvent> = HostEventT extends keyof EmbedApiHostEventMapping ? UIPassthroughRequest<EmbedApiHostEventMapping[HostEventT]> : any;
6650
+ export type HostEventResponse<HostEventT extends HostEvent> = HostEventT extends keyof EmbedApiHostEventMapping ? UIPassthroughResponse<EmbedApiHostEventMapping[HostEventT]> : any;
6651
+ export type TriggerPayload<PayloadT, HostEventT extends HostEvent> = PayloadT | HostEventRequest<HostEventT>;
6652
+ export type TriggerResponse<PayloadT, HostEventT extends HostEvent> = PayloadT extends HostEventRequest<HostEventT> ? HostEventResponse<HostEventT> : any;
6646
6653
 
6647
6654
  export interface executeTMLInput {
6648
6655
  metadata_tmls: string[];
@@ -6681,7 +6688,7 @@ export declare const prefetch: (url?: string, prefetchFeatures?: PrefetchFeature
6681
6688
  /**
6682
6689
  * Initializes the Visual Embed SDK globally and perform
6683
6690
  * authentication if applicable. This function needs to be called before any ThoughtSpot
6684
- * component like liveboard etc can be embedded. But need not wait for AuthEvent.SUCCESS
6691
+ * component like Liveboard etc can be embedded. But need not wait for AuthEvent.SUCCESS
6685
6692
  * to actually embed. That is handled internally.
6686
6693
  * @param embedConfig The configuration object containing ThoughtSpot host,
6687
6694
  * authentication mechanism and so on.
@@ -7725,11 +7732,25 @@ export declare function getAuthenticationToken(embedConfig: EmbedConfig): Promis
7725
7732
  export declare const resetCachedAuthToken: () => void;
7726
7733
 
7727
7734
  export declare class HostEventClient {
7728
- thoughtSpotHost: string;
7729
- constructor(thoughtSpotHost: string);
7730
- executeUiPassthroughApi<UiPassthroughEventT extends UiPassthroughEvent>(iFrame: HTMLIFrameElement, apiName: UiPassthroughEventT, parameters: UiPassthroughRequest<UiPassthroughEventT>): UiPassthroughArrayResponse<UiPassthroughEventT>;
7731
- handleUiPassthroughForHostEvent<UiPassthroughEventT extends UiPassthroughEvent>(iFrame: HTMLIFrameElement, apiName: UiPassthroughEventT, parameters: UiPassthroughRequest<UiPassthroughEventT>): Promise<UiPassthroughResponse<UiPassthroughEventT>>;
7732
- hostEventFallback(iFrame: HTMLIFrameElement, hostEvent: HostEvent, data: any): Promise<any>;
7733
- executeHostEvent<T extends HostEvent>(iFrame: HTMLIFrameElement, hostEvent: HostEvent, payload?: HostEventRequest<T>): Promise<HostEventResponse<HostEvent>>;
7735
+ iFrame: HTMLIFrameElement;
7736
+ constructor(iFrame?: HTMLIFrameElement);
7737
+ /**
7738
+ * A wrapper over process trigger to
7739
+ * @param {HostEvent} message Host event to send
7740
+ * @param {any} data Data to send with the host event
7741
+ * @returns {Promise<any>} - the response from the process trigger
7742
+ */
7743
+ protected processTrigger(message: HostEvent, data: any): Promise<any>;
7744
+ handleHostEventWithParam<UIPassthroughEventT extends UIPassthroughEvent>(apiName: UIPassthroughEventT, parameters: UIPassthroughRequest<UIPassthroughEventT>): Promise<UIPassthroughResponse<UIPassthroughEventT>>;
7745
+ hostEventFallback(hostEvent: HostEvent, data: any): Promise<any>;
7746
+ /**
7747
+ * Setter for the iframe element used for host events
7748
+ * @param {HTMLIFrameElement} iFrame - the iframe element to set
7749
+ */
7750
+ setIframeElement(iFrame: HTMLIFrameElement): void;
7751
+ triggerUIPassthroughApi<UIPassthroughEventT extends UIPassthroughEvent>(apiName: UIPassthroughEventT, parameters: UIPassthroughRequest<UIPassthroughEventT>): Promise<UIPassthroughArrayResponse<UIPassthroughEventT>>;
7752
+ protected handlePinEvent(payload: HostEventRequest<HostEvent.Pin>): Promise<HostEventResponse<HostEvent.Pin>>;
7753
+ protected handleSaveAnswerEvent(payload: HostEventRequest<HostEvent.SaveAnswer>): Promise<any>;
7754
+ triggerHostEvent<HostEventT extends HostEvent, PayloadT>(hostEvent: HostEventT, payload?: TriggerPayload<PayloadT, HostEventT>): Promise<TriggerResponse<PayloadT, HostEventT>>;
7734
7755
  }
7735
7756