@thoughtspot/visual-embed-sdk 1.35.2 → 1.35.4

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 (209) hide show
  1. package/cjs/package.json +1 -1
  2. package/cjs/src/auth.spec.js +12 -0
  3. package/cjs/src/auth.spec.js.map +1 -1
  4. package/cjs/src/authToken.spec.js +1 -1
  5. package/cjs/src/authToken.spec.js.map +1 -1
  6. package/cjs/src/embed/app.d.ts +1 -1
  7. package/cjs/src/embed/app.d.ts.map +1 -1
  8. package/cjs/src/embed/app.js +4 -3
  9. package/cjs/src/embed/app.js.map +1 -1
  10. package/cjs/src/embed/base.d.ts +1 -1
  11. package/cjs/src/embed/base.js +1 -1
  12. package/cjs/src/embed/bodyless-conversation.spec.js +0 -1
  13. package/cjs/src/embed/bodyless-conversation.spec.js.map +1 -1
  14. package/cjs/src/embed/hostEventClient/contracts.d.ts +79 -0
  15. package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -0
  16. package/cjs/src/embed/hostEventClient/contracts.js +14 -0
  17. package/cjs/src/embed/hostEventClient/contracts.js.map +1 -0
  18. package/cjs/src/embed/hostEventClient/host-event-client.d.ts +25 -0
  19. package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -0
  20. package/cjs/src/embed/hostEventClient/host-event-client.js +89 -0
  21. package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -0
  22. package/cjs/src/embed/hostEventClient/host-event-client.spec.d.ts +2 -0
  23. package/cjs/src/embed/hostEventClient/host-event-client.spec.d.ts.map +1 -0
  24. package/cjs/src/embed/hostEventClient/host-event-client.spec.js +191 -0
  25. package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -0
  26. package/cjs/src/embed/liveboard.d.ts +10 -8
  27. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  28. package/cjs/src/embed/liveboard.js +3 -3
  29. package/cjs/src/embed/liveboard.js.map +1 -1
  30. package/cjs/src/embed/liveboard.spec.js +34 -2
  31. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  32. package/cjs/src/embed/search.spec.js +11 -0
  33. package/cjs/src/embed/search.spec.js.map +1 -1
  34. package/cjs/src/embed/searchEmbed-basic-auth.spec.d.ts +2 -0
  35. package/cjs/src/embed/searchEmbed-basic-auth.spec.d.ts.map +1 -0
  36. package/cjs/src/embed/searchEmbed-basic-auth.spec.js +104 -0
  37. package/cjs/src/embed/searchEmbed-basic-auth.spec.js.map +1 -0
  38. package/cjs/src/embed/ts-embed.d.ts +21 -4
  39. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  40. package/cjs/src/embed/ts-embed.js +33 -9
  41. package/cjs/src/embed/ts-embed.js.map +1 -1
  42. package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
  43. package/cjs/src/embed/ts-embed.spec.js +38 -1
  44. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  45. package/cjs/src/hostEventsTypeMapping.d.ts +2 -0
  46. package/cjs/src/hostEventsTypeMapping.d.ts.map +1 -0
  47. package/cjs/src/hostEventsTypeMapping.js +4 -0
  48. package/cjs/src/hostEventsTypeMapping.js.map +1 -0
  49. package/cjs/src/index.d.ts +2 -1
  50. package/cjs/src/index.d.ts.map +1 -1
  51. package/cjs/src/index.js +3 -1
  52. package/cjs/src/index.js.map +1 -1
  53. package/cjs/src/react/all-types-export.d.ts +1 -1
  54. package/cjs/src/react/all-types-export.d.ts.map +1 -1
  55. package/cjs/src/react/all-types-export.js +2 -1
  56. package/cjs/src/react/all-types-export.js.map +1 -1
  57. package/cjs/src/types.d.ts +38 -23
  58. package/cjs/src/types.d.ts.map +1 -1
  59. package/cjs/src/types.js +31 -20
  60. package/cjs/src/types.js.map +1 -1
  61. package/cjs/src/utils/embedApi/contracts.d.ts +101 -0
  62. package/cjs/src/utils/embedApi/contracts.d.ts.map +1 -0
  63. package/cjs/src/utils/embedApi/contracts.js +17 -0
  64. package/cjs/src/utils/embedApi/contracts.js.map +1 -0
  65. package/cjs/src/utils/embedApi/embedApiClient.d.ts +12 -0
  66. package/cjs/src/utils/embedApi/embedApiClient.d.ts.map +1 -0
  67. package/cjs/src/utils/embedApi/embedApiClient.js +46 -0
  68. package/cjs/src/utils/embedApi/embedApiClient.js.map +1 -0
  69. package/cjs/src/utils/embedApi/processEmbedApi.d.ts +9 -0
  70. package/cjs/src/utils/embedApi/processEmbedApi.d.ts.map +1 -0
  71. package/cjs/src/utils/embedApi/processEmbedApi.js +18 -0
  72. package/cjs/src/utils/embedApi/processEmbedApi.js.map +1 -0
  73. package/dist/{index-DoPTJLbd.js → index-BBBimG1x.js} +1 -1
  74. package/dist/index-CENLvayL.js +7370 -0
  75. package/dist/index-CbltIawo.js +7370 -0
  76. package/dist/index-CoQfqaHj.js +7370 -0
  77. package/dist/index-CzwzS0P4.js +7370 -0
  78. package/dist/index-DFwi_pV_.js +7370 -0
  79. package/dist/index-DOIjN0N_.js +7370 -0
  80. package/dist/index-DYBx8SuE.js +7370 -0
  81. package/dist/index-DaLHJaLd.js +7370 -0
  82. package/dist/index-nWevLycs.js +7370 -0
  83. package/dist/src/embed/app.d.ts +1 -1
  84. package/dist/src/embed/app.d.ts.map +1 -1
  85. package/dist/src/embed/base.d.ts +1 -1
  86. package/dist/src/embed/hostEventClient/contracts.d.ts +79 -0
  87. package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -0
  88. package/dist/src/embed/hostEventClient/host-event-client.d.ts +25 -0
  89. package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -0
  90. package/dist/src/embed/hostEventClient/host-event-client.spec.d.ts +2 -0
  91. package/dist/src/embed/hostEventClient/host-event-client.spec.d.ts.map +1 -0
  92. package/dist/src/embed/liveboard.d.ts +10 -8
  93. package/dist/src/embed/liveboard.d.ts.map +1 -1
  94. package/dist/src/embed/searchEmbed-basic-auth.spec.d.ts +2 -0
  95. package/dist/src/embed/searchEmbed-basic-auth.spec.d.ts.map +1 -0
  96. package/dist/src/embed/ts-embed.d.ts +21 -4
  97. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  98. package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
  99. package/dist/src/hostEventsTypeMapping.d.ts +2 -0
  100. package/dist/src/hostEventsTypeMapping.d.ts.map +1 -0
  101. package/dist/src/index.d.ts +2 -1
  102. package/dist/src/index.d.ts.map +1 -1
  103. package/dist/src/react/all-types-export.d.ts +1 -1
  104. package/dist/src/react/all-types-export.d.ts.map +1 -1
  105. package/dist/src/types.d.ts +38 -23
  106. package/dist/src/types.d.ts.map +1 -1
  107. package/dist/src/utils/embedApi/contracts.d.ts +101 -0
  108. package/dist/src/utils/embedApi/contracts.d.ts.map +1 -0
  109. package/dist/src/utils/embedApi/embedApiClient.d.ts +12 -0
  110. package/dist/src/utils/embedApi/embedApiClient.d.ts.map +1 -0
  111. package/dist/src/utils/embedApi/processEmbedApi.d.ts +9 -0
  112. package/dist/src/utils/embedApi/processEmbedApi.d.ts.map +1 -0
  113. package/dist/tsembed-react.es.js +164 -37
  114. package/dist/tsembed-react.js +163 -36
  115. package/dist/tsembed.es.js +166 -39
  116. package/dist/tsembed.js +164 -37
  117. package/dist/visual-embed-sdk-react-full.d.ts +170 -38
  118. package/dist/visual-embed-sdk-react.d.ts +170 -38
  119. package/dist/visual-embed-sdk.d.ts +170 -38
  120. package/lib/package.json +1 -1
  121. package/lib/src/auth.spec.js +12 -0
  122. package/lib/src/auth.spec.js.map +1 -1
  123. package/lib/src/authToken.spec.js +1 -1
  124. package/lib/src/authToken.spec.js.map +1 -1
  125. package/lib/src/embed/app.d.ts +1 -1
  126. package/lib/src/embed/app.d.ts.map +1 -1
  127. package/lib/src/embed/app.js +4 -3
  128. package/lib/src/embed/app.js.map +1 -1
  129. package/lib/src/embed/base.d.ts +1 -1
  130. package/lib/src/embed/base.js +1 -1
  131. package/lib/src/embed/bodyless-conversation.spec.js +0 -1
  132. package/lib/src/embed/bodyless-conversation.spec.js.map +1 -1
  133. package/lib/src/embed/hostEventClient/contracts.d.ts +79 -0
  134. package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -0
  135. package/lib/src/embed/hostEventClient/contracts.js +11 -0
  136. package/lib/src/embed/hostEventClient/contracts.js.map +1 -0
  137. package/lib/src/embed/hostEventClient/host-event-client.d.ts +25 -0
  138. package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -0
  139. package/lib/src/embed/hostEventClient/host-event-client.js +85 -0
  140. package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -0
  141. package/lib/src/embed/hostEventClient/host-event-client.spec.d.ts +2 -0
  142. package/lib/src/embed/hostEventClient/host-event-client.spec.d.ts.map +1 -0
  143. package/lib/src/embed/hostEventClient/host-event-client.spec.js +188 -0
  144. package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -0
  145. package/lib/src/embed/liveboard.d.ts +10 -8
  146. package/lib/src/embed/liveboard.d.ts.map +1 -1
  147. package/lib/src/embed/liveboard.js +3 -3
  148. package/lib/src/embed/liveboard.js.map +1 -1
  149. package/lib/src/embed/liveboard.spec.js +34 -2
  150. package/lib/src/embed/liveboard.spec.js.map +1 -1
  151. package/lib/src/embed/search.spec.js +11 -0
  152. package/lib/src/embed/search.spec.js.map +1 -1
  153. package/lib/src/embed/searchEmbed-basic-auth.spec.d.ts +2 -0
  154. package/lib/src/embed/searchEmbed-basic-auth.spec.d.ts.map +1 -0
  155. package/lib/src/embed/searchEmbed-basic-auth.spec.js +101 -0
  156. package/lib/src/embed/searchEmbed-basic-auth.spec.js.map +1 -0
  157. package/lib/src/embed/ts-embed.d.ts +21 -4
  158. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  159. package/lib/src/embed/ts-embed.js +33 -9
  160. package/lib/src/embed/ts-embed.js.map +1 -1
  161. package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
  162. package/lib/src/embed/ts-embed.spec.js +40 -3
  163. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  164. package/lib/src/hostEventsTypeMapping.d.ts +2 -0
  165. package/lib/src/hostEventsTypeMapping.d.ts.map +1 -0
  166. package/lib/src/hostEventsTypeMapping.js +2 -0
  167. package/lib/src/hostEventsTypeMapping.js.map +1 -0
  168. package/lib/src/index.d.ts +2 -1
  169. package/lib/src/index.d.ts.map +1 -1
  170. package/lib/src/index.js +2 -1
  171. package/lib/src/index.js.map +1 -1
  172. package/lib/src/react/all-types-export.d.ts +1 -1
  173. package/lib/src/react/all-types-export.d.ts.map +1 -1
  174. package/lib/src/react/all-types-export.js +1 -1
  175. package/lib/src/react/all-types-export.js.map +1 -1
  176. package/lib/src/types.d.ts +38 -23
  177. package/lib/src/types.d.ts.map +1 -1
  178. package/lib/src/types.js +31 -20
  179. package/lib/src/types.js.map +1 -1
  180. package/lib/src/utils/embedApi/contracts.d.ts +101 -0
  181. package/lib/src/utils/embedApi/contracts.d.ts.map +1 -0
  182. package/lib/src/utils/embedApi/contracts.js +14 -0
  183. package/lib/src/utils/embedApi/contracts.js.map +1 -0
  184. package/lib/src/utils/embedApi/embedApiClient.d.ts +12 -0
  185. package/lib/src/utils/embedApi/embedApiClient.d.ts.map +1 -0
  186. package/lib/src/utils/embedApi/embedApiClient.js +42 -0
  187. package/lib/src/utils/embedApi/embedApiClient.js.map +1 -0
  188. package/lib/src/utils/embedApi/processEmbedApi.d.ts +9 -0
  189. package/lib/src/utils/embedApi/processEmbedApi.d.ts.map +1 -0
  190. package/lib/src/utils/embedApi/processEmbedApi.js +14 -0
  191. package/lib/src/utils/embedApi/processEmbedApi.js.map +1 -0
  192. package/lib/src/visual-embed-sdk.d.ts +181 -38
  193. package/package.json +1 -1
  194. package/src/auth.spec.ts +13 -0
  195. package/src/authToken.spec.ts +1 -1
  196. package/src/embed/app.ts +7 -4
  197. package/src/embed/base.ts +1 -1
  198. package/src/embed/bodyless-conversation.spec.ts +0 -1
  199. package/src/embed/hostEventClient/contracts.ts +105 -0
  200. package/src/embed/hostEventClient/host-event-client.spec.ts +254 -0
  201. package/src/embed/hostEventClient/host-event-client.ts +139 -0
  202. package/src/embed/liveboard.spec.ts +36 -2
  203. package/src/embed/liveboard.ts +13 -8
  204. package/src/embed/search.spec.ts +15 -0
  205. package/src/embed/ts-embed.spec.ts +53 -1
  206. package/src/embed/ts-embed.ts +60 -16
  207. package/src/index.ts +2 -0
  208. package/src/react/all-types-export.ts +1 -0
  209. package/src/types.ts +37 -22
@@ -9,6 +9,15 @@
9
9
  import isEqual from 'lodash/isEqual';
10
10
  import isEmpty from 'lodash/isEmpty';
11
11
  import isObject from 'lodash/isObject';
12
+ import {
13
+ HostEventRequest,
14
+ HostEventResponse,
15
+ TriggerPayload,
16
+ TriggerResponse,
17
+ UIPassthroughArrayResponse,
18
+ UIPassthroughEvent,
19
+ UIPassthroughRequest,
20
+ } from './hostEventClient/contracts';
12
21
  import { logger } from '../utils/logger';
13
22
  import { getAuthenticationToken } from '../authToken';
14
23
  import { AnswerService } from '../utils/graphql/answerService/answerService';
@@ -62,6 +71,7 @@ import {
62
71
  import { AuthFailureType } from '../auth';
63
72
  import { getEmbedConfig } from './embedConfig';
64
73
  import { ERROR_MESSAGE } from '../errors';
74
+ import { HostEventClient } from './hostEventClient/host-event-client';
65
75
 
66
76
  const { version } = pkgInfo;
67
77
 
@@ -77,7 +87,7 @@ const TS_EMBED_ID = '_thoughtspot-embed';
77
87
  * We cannot rename v1 event types to maintain backward compatibility
78
88
  * @internal
79
89
  */
80
- const V1EventMap = {};
90
+ const V1EventMap: Record<string, any> = {};
81
91
 
82
92
  /**
83
93
  * Base class for embedding v2 experience
@@ -111,6 +121,15 @@ export class TsEmbed {
111
121
  */
112
122
  protected iFrame: HTMLIFrameElement;
113
123
 
124
+ /**
125
+ * Setter for the iframe element
126
+ * @param {HTMLIFrameElement} iFrame HTMLIFrameElement
127
+ */
128
+ protected setIframeElement(iFrame: HTMLIFrameElement): void {
129
+ this.iFrame = iFrame;
130
+ this.hostEventClient.setIframeElement(iFrame);
131
+ }
132
+
114
133
  protected viewConfig: ViewConfig;
115
134
 
116
135
  protected embedConfig: EmbedConfig;
@@ -121,8 +140,8 @@ export class TsEmbed {
121
140
  protected thoughtSpotHost: string;
122
141
 
123
142
  /*
124
- * This is the base to access ThoughtSpot V2.
125
- */
143
+ * This is the base to access ThoughtSpot V2.
144
+ */
126
145
  protected thoughtSpotV2Base: string;
127
146
 
128
147
  /**
@@ -159,6 +178,8 @@ export class TsEmbed {
159
178
 
160
179
  private resizeObserver: ResizeObserver;
161
180
 
181
+ protected hostEventClient: HostEventClient;
182
+
162
183
  constructor(domSelector: DOMSelector, viewConfig?: ViewConfig) {
163
184
  this.el = getDOMNode(domSelector);
164
185
  // TODO: handle error
@@ -180,6 +201,7 @@ export class TsEmbed {
180
201
  uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
181
202
  ...viewConfig,
182
203
  });
204
+ this.hostEventClient = new HostEventClient(this.iFrame);
183
205
  }
184
206
 
185
207
  /**
@@ -241,7 +263,7 @@ export class TsEmbed {
241
263
  return eventData;
242
264
  }
243
265
 
244
- private subscribedListeners = {};
266
+ private subscribedListeners: Record<string, any> = {};
245
267
 
246
268
  /**
247
269
  * Adds a global event listener to window for "message" events.
@@ -594,6 +616,9 @@ export class TsEmbed {
594
616
 
595
617
  iFrame.style.width = `${width}`;
596
618
  iFrame.style.height = `${height}`;
619
+ // Set minimum height to the frame so that,
620
+ // scaling down on the fullheight doesn't make it too small.
621
+ iFrame.style.minHeight = `${height}`;
597
622
  iFrame.style.border = '0';
598
623
  iFrame.name = 'ThoughtSpot Embedded Analytics';
599
624
  return iFrame;
@@ -606,7 +631,7 @@ export class TsEmbed {
606
631
  this.insertIntoDOM(child);
607
632
  }
608
633
  if (this.insertedDomEl instanceof Node) {
609
- this.insertedDomEl[this.embedNodeKey] = this;
634
+ (this.insertedDomEl as any)[this.embedNodeKey] = this;
610
635
  }
611
636
  }
612
637
 
@@ -644,7 +669,7 @@ export class TsEmbed {
644
669
  return;
645
670
  }
646
671
 
647
- this.iFrame = this.iFrame || this.createIframeEl(url);
672
+ this.setIframeElement(this.iFrame || this.createIframeEl(url));
648
673
  this.iFrame.addEventListener('load', () => {
649
674
  nextInQueue();
650
675
  const loadTimestamp = Date.now();
@@ -714,7 +739,7 @@ export class TsEmbed {
714
739
  if (this.preRenderWrapper && this.preRenderChild) {
715
740
  this.isPreRendered = true;
716
741
  if (this.preRenderChild instanceof HTMLIFrameElement) {
717
- this.iFrame = this.preRenderChild;
742
+ this.setIframeElement(this.preRenderChild);
718
743
  }
719
744
  this.insertedDomEl = this.preRenderWrapper;
720
745
  this.isRendered = true;
@@ -763,7 +788,7 @@ export class TsEmbed {
763
788
  this.preRenderWrapper = preRenderWrapper;
764
789
 
765
790
  if (preRenderChild instanceof HTMLIFrameElement) {
766
- this.iFrame = preRenderChild;
791
+ this.setIframeElement(preRenderChild);
767
792
  }
768
793
  this.insertedDomEl = preRenderWrapper;
769
794
 
@@ -980,10 +1005,14 @@ export class TsEmbed {
980
1005
 
981
1006
  /**
982
1007
  * Triggers an event to the embedded app
983
- * @param messageType The event type
984
- * @param data The payload to send with the message
1008
+ * @param {HostEvent} messageType The event type
1009
+ * @param {any} data The payload to send with the message
1010
+ * @returns A promise that resolves with the response from the embedded app
985
1011
  */
986
- public trigger(messageType: HostEvent, data: any = {}): Promise<any> {
1012
+ public async trigger<HostEventT extends HostEvent, PayloadT>(
1013
+ messageType: HostEventT,
1014
+ data?: TriggerPayload<PayloadT, HostEventT>,
1015
+ ): Promise<TriggerResponse<PayloadT, HostEventT>> {
987
1016
  uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
988
1017
 
989
1018
  if (!this.isRendered) {
@@ -995,7 +1024,23 @@ export class TsEmbed {
995
1024
  this.handleError('Host event type is undefined');
996
1025
  return null;
997
1026
  }
998
- return processTrigger(this.iFrame, messageType, this.thoughtSpotHost, data);
1027
+
1028
+ return this.hostEventClient.triggerHostEvent(messageType, data);
1029
+ }
1030
+
1031
+ /**
1032
+ * Triggers an event to the embedded app, skipping the UI flow.
1033
+ * @param {UIPassthroughEvent} apiName - The name of the API to be triggered.
1034
+ * @param {UIPassthroughRequest} parameters - The parameters to be passed to the API.
1035
+ * @returns {Promise<UIPassthroughRequest>} - A promise that resolves with the response
1036
+ * from the embedded app.
1037
+ */
1038
+ public async triggerUIPassThrough<UIPassthroughEventT extends UIPassthroughEvent>(
1039
+ apiName: UIPassthroughEventT,
1040
+ parameters: UIPassthroughRequest<UIPassthroughEventT>,
1041
+ ): Promise<UIPassthroughArrayResponse<UIPassthroughEventT>> {
1042
+ const response = this.hostEventClient.triggerUIPassthroughApi(apiName, parameters);
1043
+ return response;
999
1044
  }
1000
1045
 
1001
1046
  /**
@@ -1101,14 +1146,14 @@ export class TsEmbed {
1101
1146
 
1102
1147
  private validatePreRenderViewConfig = (viewConfig: ViewConfig) => {
1103
1148
  const preRenderAllowedKeys = ['preRenderId', 'vizId', 'liveboardId'];
1104
- const preRenderedObject = this.insertedDomEl?.[this.embedNodeKey] as TsEmbed;
1149
+ const preRenderedObject = (this.insertedDomEl as any)?.[this.embedNodeKey] as TsEmbed;
1105
1150
  if (!preRenderedObject) return;
1106
1151
  if (viewConfig.preRenderId) {
1107
1152
  const allOtherKeys = Object.keys(viewConfig).filter(
1108
1153
  (key) => !preRenderAllowedKeys.includes(key) && !key.startsWith('on'),
1109
1154
  );
1110
1155
 
1111
- allOtherKeys.forEach((key) => {
1156
+ allOtherKeys.forEach((key: keyof ViewConfig) => {
1112
1157
  if (
1113
1158
  !isUndefined(viewConfig[key])
1114
1159
  && !isEqual(viewConfig[key], preRenderedObject.viewConfig[key])
@@ -1237,12 +1282,11 @@ export class TsEmbed {
1237
1282
  /**
1238
1283
  * Returns the answerService which can be used to make arbitrary graphql calls on top
1239
1284
  * session.
1240
- * @param vizId [Optional] to get for a specific viz in case of a liveboard.
1285
+ * @param vizId [Optional] to get for a specific viz in case of a Liveboard.
1241
1286
  * @version SDK: 1.25.0 / ThoughtSpot 9.10.0
1242
1287
  */
1243
1288
  public async getAnswerService(vizId?: string): Promise<AnswerService> {
1244
1289
  const { session } = await this.trigger(HostEvent.GetAnswerSession, vizId ? { vizId } : {});
1245
-
1246
1290
  return new AnswerService(session, null, this.embedConfig.thoughtSpotHost);
1247
1291
  }
1248
1292
  }
package/src/index.ts CHANGED
@@ -61,6 +61,7 @@ import { uploadMixpanelEvent, MIXPANEL_EVENT } from './mixpanel-service';
61
61
  import { tokenizedFetch } from './tokenizedFetch';
62
62
  import { getAnswerFromQuery } from './utils/graphql/nlsService/nls-answer-service';
63
63
  import { createLiveboardWithAnswers } from './utils/liveboardService/liveboardService';
64
+ import { UIPassthroughEvent } from './embed/hostEventClient/contracts';
64
65
 
65
66
  export {
66
67
  init,
@@ -127,6 +128,7 @@ export {
127
128
  HomePageSearchBarMode,
128
129
  VizPoint,
129
130
  CustomActionPayload,
131
+ UIPassthroughEvent,
130
132
  };
131
133
 
132
134
  export { resetCachedAuthToken } from './authToken';
@@ -51,4 +51,5 @@ export {
51
51
  CustomCssVariables,
52
52
  RuntimeParameter,
53
53
  resetCachedAuthToken,
54
+ UIPassthroughEvent,
54
55
  } from '../index';
package/src/types.ts CHANGED
@@ -1088,8 +1088,12 @@ export interface ViewConfig {
1088
1088
  */
1089
1089
  enableCustomColumnGroups?: boolean;
1090
1090
  /**
1091
- * View content for another org directly without having to use the org switcher
1092
- * This flag is honoured if orgPerUrl feature is enabled for the ThoughtSpot cluster
1091
+ * Overrides an Org context for embedding application users.
1092
+ * This parameter allows a user authenticated to one Org to view the
1093
+ * objects from another Org.
1094
+ * The `overrideOrgId` setting is honoured only if the
1095
+ * Per Org URL feature is enabled on your ThoughtSpot instance.
1096
+ *
1093
1097
  * @example
1094
1098
  * ```js
1095
1099
  * const embed = new LiveboardEmbed('#embed', {
@@ -1714,8 +1718,8 @@ export enum EmbedEvent {
1714
1718
  *
1715
1719
  * **Note**: This event is deprecated in v1.21.0.
1716
1720
  * To fire an event when a download action is initiated on a chart or table,
1717
- * use `EmbedEvent.DownloadAsPng`, `EmbedEvent.DownloadAsPDF`, `EmbedEvent.DownloadAsCSV`,
1718
- * or `EmbedEvent.DownloadAsXLSX`
1721
+ * use `EmbedEvent.DownloadAsPng`, `EmbedEvent.DownloadAsPDF`,
1722
+ * `EmbedEvent.DownloadAsCSV`, or `EmbedEvent.DownloadAsXLSX`
1719
1723
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1720
1724
  * @example
1721
1725
  *```js
@@ -2365,7 +2369,7 @@ export enum HostEvent {
2365
2369
  * @param - autoDrillDown - Optional. If true, the drill down will be
2366
2370
  * done automatically on the most popular column.
2367
2371
  * @param - vizId [TS >= 9.8.0] - Optional. The GUID of the visualization to drill
2368
- * in case of a liveboard.
2372
+ * in case of a Liveboard.
2369
2373
  * @example
2370
2374
  * ```js
2371
2375
  * searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
@@ -2452,26 +2456,26 @@ export enum HostEvent {
2452
2456
  */
2453
2457
  SetActiveTab = 'SetActiveTab',
2454
2458
  /**
2455
- * Update runtime filters applied on a Saved Answer or Liveboard. The
2456
- * runtime filters passed here are appended to the existing runtime
2457
- * filters.
2459
+ * Updates the runtime filters applied on a Liveboard. The filter
2460
+ * attributes passed with this event are appended to the existing runtime
2461
+ * filters applied on a Liveboard.
2462
+ *
2458
2463
  * Pass an array of runtime filters with the following attributes:
2459
2464
  *
2460
- * `columnName`
2461
- * _String_. The name of the column to filter on.
2465
+ * `columnName` - _String_. The name of the column to filter on.
2462
2466
  *
2463
- * `operator`
2464
- * Runtime filter operator to apply. For information,
2467
+ * `operator` - Runtime filter operator to apply. For more information,
2465
2468
  * see link:https://developers.thoughtspot.com/docs/?pageid=runtime-filters#rtOperator[Developer Documentation].
2466
2469
  *
2467
- * `values`
2468
- * List of operands. Some operators such as EQ, LE allow a single value, whereas
2469
- * operators such as BW and IN accept multiple operands.
2470
+ * `values` - List of operands. Some operators such as EQ and LE allow a
2471
+ * single value, whereas BW and IN accept multiple values.
2472
+ *
2473
+ * **Note**: `HostEvent.UpdateRuntimeFilters` is supported in `LiveboardEmbed`
2474
+ * and `AppEmbed` only. In full application embedding, this event updates
2475
+ * the runtime filters applied on the Liveboard and saved Answer objects.
2470
2476
  *
2471
- * **Note**: `HostEvent.UpdateRuntimeFilters` is not supported in
2472
- * Search embedding (SearchEmbed) and Natural Language Search
2473
- * embedding (SageEmbed).
2474
2477
  * @param - {@link RuntimeFilter}[] an array of {@link RuntimeFilter} Types.
2478
+ *
2475
2479
  * @example
2476
2480
  * ```js
2477
2481
  * liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
@@ -3170,7 +3174,7 @@ export enum HostEvent {
3170
3174
  */
3171
3175
  ResetLiveboardPersonalisedView = 'ResetLiveboardPersonalisedView',
3172
3176
  /**
3173
- * Triggers Update RuntimeParameters for answers and liveboard
3177
+ * Triggers an event to Update Parameter values for Answers and Liveboard
3174
3178
  * @example
3175
3179
  * ```js
3176
3180
  * liveboardEmbed.trigger(HostEvent.UpdateParameters, [{
@@ -3192,13 +3196,23 @@ export enum HostEvent {
3192
3196
  */
3193
3197
  GetParameters = 'GetParameters',
3194
3198
  /**
3195
- * Triggers update of persoanlised view for a liveboard
3199
+ * Triggers an event to update a persoanlised view of a Liveboard
3196
3200
  * ```js
3197
3201
  * liveboardEmbed.trigger(HostEvent.UpdatePersonalisedView, {viewId: '1234'})
3198
3202
  * ```
3199
3203
  * @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
3200
3204
  */
3201
3205
  UpdatePersonalisedView = 'UpdatePersonalisedView',
3206
+ /**
3207
+ * Triggers the action to get the current view of the liveboard
3208
+ * @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
3209
+ */
3210
+ SaveAnswer = 'saveAnswer',
3211
+ /**
3212
+ * EmbedApi
3213
+ * @hidden
3214
+ */
3215
+ UIPassthrough = 'UiPassthrough',
3202
3216
  }
3203
3217
 
3204
3218
  /**
@@ -4179,7 +4193,7 @@ export enum Action {
4179
4193
  */
4180
4194
  ModifySageAnswer = 'modifySageAnswer',
4181
4195
  /**
4182
- * The **Move to Tab** menu action on visualizations in liveboard edit mode.
4196
+ * The **Move to Tab** menu action on visualizations in Liveboard edit mode.
4183
4197
  * Allows moving a visualization to a different tab.
4184
4198
  * @example
4185
4199
  * ```js
@@ -4234,7 +4248,8 @@ export enum Action {
4234
4248
  TML = 'tml',
4235
4249
 
4236
4250
  /**
4237
- * Action Id for CreateLiveboard for liveboard list page & Pin Modal
4251
+ * Action ID for the create Liveboard option on the Liveboard list page
4252
+ * and Pin modal
4238
4253
  * @example
4239
4254
  * ```js
4240
4255
  * hiddenAction: [Action.CreateLiveboard]