@thoughtspot/visual-embed-sdk 1.36.1 → 1.36.3

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 (203) hide show
  1. package/cjs/package.json +1 -1
  2. package/cjs/src/auth.d.ts.map +1 -1
  3. package/cjs/src/auth.js +2 -1
  4. package/cjs/src/auth.js.map +1 -1
  5. package/cjs/src/authToken.d.ts.map +1 -1
  6. package/cjs/src/authToken.js +10 -3
  7. package/cjs/src/authToken.js.map +1 -1
  8. package/cjs/src/embed/app.d.ts +14 -0
  9. package/cjs/src/embed/app.d.ts.map +1 -1
  10. package/cjs/src/embed/app.js +4 -1
  11. package/cjs/src/embed/app.js.map +1 -1
  12. package/cjs/src/embed/app.spec.js +17 -0
  13. package/cjs/src/embed/app.spec.js.map +1 -1
  14. package/cjs/src/embed/base.d.ts.map +1 -1
  15. package/cjs/src/embed/base.js +2 -2
  16. package/cjs/src/embed/base.js.map +1 -1
  17. package/cjs/src/embed/base.spec.js +24 -0
  18. package/cjs/src/embed/base.spec.js.map +1 -1
  19. package/cjs/src/embed/embedConfig.d.ts +1 -1
  20. package/cjs/src/embed/embedConfig.d.ts.map +1 -1
  21. package/cjs/src/embed/embedConfig.js +5 -4
  22. package/cjs/src/embed/embedConfig.js.map +1 -1
  23. package/cjs/src/embed/liveboard.d.ts +4 -1
  24. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  25. package/cjs/src/embed/liveboard.js.map +1 -1
  26. package/cjs/src/types.d.ts +85 -66
  27. package/cjs/src/types.d.ts.map +1 -1
  28. package/cjs/src/types.js +78 -59
  29. package/cjs/src/types.js.map +1 -1
  30. package/cjs/src/utils/resetServices.d.ts +8 -0
  31. package/cjs/src/utils/resetServices.d.ts.map +1 -0
  32. package/cjs/src/utils/resetServices.js +18 -0
  33. package/cjs/src/utils/resetServices.js.map +1 -0
  34. package/cjs/src/utils/resetServices.spec.d.ts +2 -0
  35. package/cjs/src/utils/resetServices.spec.d.ts.map +1 -0
  36. package/cjs/src/utils/resetServices.spec.js +18 -0
  37. package/cjs/src/utils/resetServices.spec.js.map +1 -0
  38. package/cjs/src/utils/sessionInfoService.d.ts +14 -2
  39. package/cjs/src/utils/sessionInfoService.d.ts.map +1 -1
  40. package/cjs/src/utils/sessionInfoService.js +18 -3
  41. package/cjs/src/utils/sessionInfoService.js.map +1 -1
  42. package/cjs/src/utils.d.ts +12 -0
  43. package/cjs/src/utils.d.ts.map +1 -1
  44. package/cjs/src/utils.js +21 -1
  45. package/cjs/src/utils.js.map +1 -1
  46. package/cjs/src/utils.spec.js +15 -0
  47. package/cjs/src/utils.spec.js.map +1 -1
  48. package/dist/{index-B3hd6DTM.js → index-BJx3m5_V.js} +1 -1
  49. package/dist/src/auth.d.ts.map +1 -1
  50. package/dist/src/authToken.d.ts.map +1 -1
  51. package/dist/src/embed/app.d.ts +14 -0
  52. package/dist/src/embed/app.d.ts.map +1 -1
  53. package/dist/src/embed/base.d.ts.map +1 -1
  54. package/dist/src/embed/embedConfig.d.ts +1 -1
  55. package/dist/src/embed/embedConfig.d.ts.map +1 -1
  56. package/dist/src/embed/liveboard.d.ts +4 -1
  57. package/dist/src/embed/liveboard.d.ts.map +1 -1
  58. package/dist/src/types.d.ts +85 -66
  59. package/dist/src/types.d.ts.map +1 -1
  60. package/dist/src/utils/resetServices.d.ts +8 -0
  61. package/dist/src/utils/resetServices.d.ts.map +1 -0
  62. package/dist/src/utils/resetServices.spec.d.ts +2 -0
  63. package/dist/src/utils/resetServices.spec.d.ts.map +1 -0
  64. package/dist/src/utils/sessionInfoService.d.ts +14 -2
  65. package/dist/src/utils/sessionInfoService.d.ts.map +1 -1
  66. package/dist/src/utils.d.ts +12 -0
  67. package/dist/src/utils.d.ts.map +1 -1
  68. package/dist/tsembed-react.es.js +117 -70
  69. package/dist/tsembed-react.js +116 -69
  70. package/dist/tsembed.es.js +160 -75
  71. package/dist/tsembed.js +159 -74
  72. package/dist/visual-embed-sdk-react-full.d.ts +118 -70
  73. package/dist/visual-embed-sdk-react.d.ts +118 -70
  74. package/dist/visual-embed-sdk.d.ts +118 -70
  75. package/lib/package.json +1 -1
  76. package/lib/src/auth.d.ts.map +1 -1
  77. package/lib/src/auth.js +3 -2
  78. package/lib/src/auth.js.map +1 -1
  79. package/lib/src/authToken.d.ts.map +1 -1
  80. package/lib/src/authToken.js +10 -3
  81. package/lib/src/authToken.js.map +1 -1
  82. package/lib/src/embed/app.d.ts +14 -0
  83. package/lib/src/embed/app.d.ts.map +1 -1
  84. package/lib/src/embed/app.js +4 -1
  85. package/lib/src/embed/app.js.map +1 -1
  86. package/lib/src/embed/app.spec.js +17 -0
  87. package/lib/src/embed/app.spec.js.map +1 -1
  88. package/lib/src/embed/base.d.ts.map +1 -1
  89. package/lib/src/embed/base.js +2 -2
  90. package/lib/src/embed/base.js.map +1 -1
  91. package/lib/src/embed/base.spec.js +24 -0
  92. package/lib/src/embed/base.spec.js.map +1 -1
  93. package/lib/src/embed/embedConfig.d.ts +1 -1
  94. package/lib/src/embed/embedConfig.d.ts.map +1 -1
  95. package/lib/src/embed/embedConfig.js +5 -4
  96. package/lib/src/embed/embedConfig.js.map +1 -1
  97. package/lib/src/embed/liveboard.d.ts +4 -1
  98. package/lib/src/embed/liveboard.d.ts.map +1 -1
  99. package/lib/src/embed/liveboard.js.map +1 -1
  100. package/lib/src/types.d.ts +85 -66
  101. package/lib/src/types.d.ts.map +1 -1
  102. package/lib/src/types.js +78 -59
  103. package/lib/src/types.js.map +1 -1
  104. package/lib/src/utils/resetServices.d.ts +8 -0
  105. package/lib/src/utils/resetServices.d.ts.map +1 -0
  106. package/lib/src/utils/resetServices.js +14 -0
  107. package/lib/src/utils/resetServices.js.map +1 -0
  108. package/lib/src/utils/resetServices.spec.d.ts +2 -0
  109. package/lib/src/utils/resetServices.spec.d.ts.map +1 -0
  110. package/lib/src/utils/resetServices.spec.js +15 -0
  111. package/lib/src/utils/resetServices.spec.js.map +1 -0
  112. package/lib/src/utils/sessionInfoService.d.ts +14 -2
  113. package/lib/src/utils/sessionInfoService.d.ts.map +1 -1
  114. package/lib/src/utils/sessionInfoService.js +16 -2
  115. package/lib/src/utils/sessionInfoService.js.map +1 -1
  116. package/lib/src/utils.d.ts +12 -0
  117. package/lib/src/utils.d.ts.map +1 -1
  118. package/lib/src/utils.js +18 -0
  119. package/lib/src/utils.js.map +1 -1
  120. package/lib/src/utils.spec.js +16 -1
  121. package/lib/src/utils.spec.js.map +1 -1
  122. package/lib/src/visual-embed-sdk.d.ts +118 -70
  123. package/package.json +1 -1
  124. package/src/auth.ts +3 -2
  125. package/src/authToken.ts +11 -3
  126. package/src/embed/app.spec.ts +27 -0
  127. package/src/embed/app.ts +19 -0
  128. package/src/embed/base.spec.ts +26 -0
  129. package/src/embed/base.ts +2 -2
  130. package/src/embed/embedConfig.ts +5 -4
  131. package/src/embed/liveboard.ts +4 -1
  132. package/src/types.ts +89 -70
  133. package/src/utils/resetServices.spec.ts +15 -0
  134. package/src/utils/resetServices.ts +14 -0
  135. package/src/utils/sessionInfoService.ts +17 -2
  136. package/src/utils.spec.ts +21 -0
  137. package/src/utils.ts +21 -0
  138. package/cjs/src/embed/searchEmbed-basic-auth.spec.d.ts +0 -2
  139. package/cjs/src/embed/searchEmbed-basic-auth.spec.d.ts.map +0 -1
  140. package/cjs/src/embed/searchEmbed-basic-auth.spec.js +0 -104
  141. package/cjs/src/embed/searchEmbed-basic-auth.spec.js.map +0 -1
  142. package/cjs/src/hostEventsTypeMapping.d.ts +0 -2
  143. package/cjs/src/hostEventsTypeMapping.d.ts.map +0 -1
  144. package/cjs/src/hostEventsTypeMapping.js +0 -4
  145. package/cjs/src/hostEventsTypeMapping.js.map +0 -1
  146. package/cjs/src/utils/embedApi/contracts.d.ts +0 -101
  147. package/cjs/src/utils/embedApi/contracts.d.ts.map +0 -1
  148. package/cjs/src/utils/embedApi/contracts.js +0 -17
  149. package/cjs/src/utils/embedApi/contracts.js.map +0 -1
  150. package/cjs/src/utils/embedApi/embedApiClient.d.ts +0 -12
  151. package/cjs/src/utils/embedApi/embedApiClient.d.ts.map +0 -1
  152. package/cjs/src/utils/embedApi/embedApiClient.js +0 -46
  153. package/cjs/src/utils/embedApi/embedApiClient.js.map +0 -1
  154. package/cjs/src/utils/embedApi/processEmbedApi.d.ts +0 -9
  155. package/cjs/src/utils/embedApi/processEmbedApi.d.ts.map +0 -1
  156. package/cjs/src/utils/embedApi/processEmbedApi.js +0 -18
  157. package/cjs/src/utils/embedApi/processEmbedApi.js.map +0 -1
  158. package/dist/index-BBBimG1x.js +0 -7370
  159. package/dist/index-BGnxP5NY.js +0 -7370
  160. package/dist/index-CENLvayL.js +0 -7370
  161. package/dist/index-CR5u7BMC.js +0 -7370
  162. package/dist/index-CbltIawo.js +0 -7370
  163. package/dist/index-CoQfqaHj.js +0 -7370
  164. package/dist/index-CzwzS0P4.js +0 -7370
  165. package/dist/index-D-9WUCUl.js +0 -7370
  166. package/dist/index-DFwi_pV_.js +0 -7370
  167. package/dist/index-DOIjN0N_.js +0 -7370
  168. package/dist/index-DYBx8SuE.js +0 -7370
  169. package/dist/index-DaLHJaLd.js +0 -7370
  170. package/dist/index-DnJX-gN2.js +0 -7370
  171. package/dist/index-IDmSUe93.js +0 -7370
  172. package/dist/index-nWevLycs.js +0 -7370
  173. package/dist/index-vxW97_xb.js +0 -7370
  174. package/dist/src/embed/searchEmbed-basic-auth.spec.d.ts +0 -2
  175. package/dist/src/embed/searchEmbed-basic-auth.spec.d.ts.map +0 -1
  176. package/dist/src/hostEventsTypeMapping.d.ts +0 -2
  177. package/dist/src/hostEventsTypeMapping.d.ts.map +0 -1
  178. package/dist/src/utils/embedApi/contracts.d.ts +0 -101
  179. package/dist/src/utils/embedApi/contracts.d.ts.map +0 -1
  180. package/dist/src/utils/embedApi/embedApiClient.d.ts +0 -12
  181. package/dist/src/utils/embedApi/embedApiClient.d.ts.map +0 -1
  182. package/dist/src/utils/embedApi/processEmbedApi.d.ts +0 -9
  183. package/dist/src/utils/embedApi/processEmbedApi.d.ts.map +0 -1
  184. package/lib/src/embed/searchEmbed-basic-auth.spec.d.ts +0 -2
  185. package/lib/src/embed/searchEmbed-basic-auth.spec.d.ts.map +0 -1
  186. package/lib/src/embed/searchEmbed-basic-auth.spec.js +0 -101
  187. package/lib/src/embed/searchEmbed-basic-auth.spec.js.map +0 -1
  188. package/lib/src/hostEventsTypeMapping.d.ts +0 -2
  189. package/lib/src/hostEventsTypeMapping.d.ts.map +0 -1
  190. package/lib/src/hostEventsTypeMapping.js +0 -2
  191. package/lib/src/hostEventsTypeMapping.js.map +0 -1
  192. package/lib/src/utils/embedApi/contracts.d.ts +0 -101
  193. package/lib/src/utils/embedApi/contracts.d.ts.map +0 -1
  194. package/lib/src/utils/embedApi/contracts.js +0 -14
  195. package/lib/src/utils/embedApi/contracts.js.map +0 -1
  196. package/lib/src/utils/embedApi/embedApiClient.d.ts +0 -12
  197. package/lib/src/utils/embedApi/embedApiClient.d.ts.map +0 -1
  198. package/lib/src/utils/embedApi/embedApiClient.js +0 -42
  199. package/lib/src/utils/embedApi/embedApiClient.js.map +0 -1
  200. package/lib/src/utils/embedApi/processEmbedApi.d.ts +0 -9
  201. package/lib/src/utils/embedApi/processEmbedApi.d.ts.map +0 -1
  202. package/lib/src/utils/embedApi/processEmbedApi.js +0 -14
  203. package/lib/src/utils/embedApi/processEmbedApi.js.map +0 -1
package/src/embed/app.ts CHANGED
@@ -137,6 +137,20 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
137
137
  * ```
138
138
  */
139
139
  disableProfileAndHelp?: boolean;
140
+ /**
141
+ * @version SDK: 1.36.3 | ThoughtSpot: 10.1.0.cl
142
+ * @default true
143
+ * Whether the help menu in the top nav bar should be served
144
+ * from Pendo or ThoughtSpot's internal help items.
145
+ * @example
146
+ * ```js
147
+ * const embed = new AppEmbed('#tsEmbed', {
148
+ * ... // other options
149
+ * enablePendoHelp: false,
150
+ * });
151
+ * ```
152
+ */
153
+ enablePendoHelp?: boolean
140
154
  /**
141
155
  * Control the visibility of the application switcher button on the nav-bar.
142
156
  * By default, the application switcher is shown.
@@ -526,6 +540,7 @@ export class AppEmbed extends V1Embed {
526
540
  hideIrrelevantChipsInLiveboardTabs = false,
527
541
  homePageSearchBarMode,
528
542
  isUnifiedSearchExperienceEnabled = true,
543
+ enablePendoHelp = true,
529
544
  } = this.viewConfig;
530
545
 
531
546
  let params = {};
@@ -583,6 +598,10 @@ export class AppEmbed extends V1Embed {
583
598
  params[Param.HomePageSearchBarMode] = homePageSearchBarMode;
584
599
  }
585
600
 
601
+ if (enablePendoHelp !== undefined) {
602
+ params[Param.EnablePendoHelp] = enablePendoHelp;
603
+ }
604
+
586
605
  params[Param.DataPanelV2Enabled] = dataPanelV2;
587
606
  params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
588
607
  params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
@@ -4,10 +4,12 @@ import EventEmitter from 'eventemitter3';
4
4
  import { EmbedConfig } from '../index';
5
5
  import * as auth from '../auth';
6
6
  import * as authService from '../utils/authService/authService';
7
+ import * as tokenAuthServices from '../utils/authService/tokenizedAuthService';
7
8
  import * as authTokenService from '../authToken';
8
9
  import * as index from '../index';
9
10
  import * as base from './base';
10
11
  import * as embedConfigInstance from './embedConfig';
12
+ import * as resetService from '../utils/resetServices';
11
13
 
12
14
  import {
13
15
  executeAfterWait,
@@ -413,6 +415,19 @@ describe('Base TS Embed', () => {
413
415
  expect(embedConfigInstance.getEmbedConfig().autoLogin).toBe(false);
414
416
  });
415
417
 
418
+ test('Logout method should reset caches', async () => {
419
+ jest.spyOn(tokenAuthServices, 'fetchLogoutService').mockResolvedValueOnce({});
420
+ jest.spyOn(resetService, 'resetAllCachedServices');
421
+ index.init({
422
+ thoughtSpotHost,
423
+ authType: index.AuthType.None,
424
+ autoLogin: true,
425
+ });
426
+ expect(resetService.resetAllCachedServices).toHaveBeenCalledTimes(1);
427
+ await index.logout();
428
+ expect(resetService.resetAllCachedServices).toHaveBeenCalledTimes(2);
429
+ });
430
+
416
431
  test('config sanity, no ts host', () => {
417
432
  expect(() => {
418
433
  index.init({
@@ -481,3 +496,14 @@ describe('Base without init', () => {
481
496
  expect(logger.error).toHaveBeenCalledTimes(4);
482
497
  });
483
498
  });
499
+
500
+ describe('Init tests', () => {
501
+ test('clear caches on init', () => {
502
+ jest.spyOn(resetService, 'resetAllCachedServices');
503
+ base.init({
504
+ thoughtSpotHost,
505
+ authType: index.AuthType.None,
506
+ });
507
+ expect(resetService.resetAllCachedServices).toBeCalled();
508
+ });
509
+ });
package/src/embed/base.ts CHANGED
@@ -9,7 +9,6 @@
9
9
  */
10
10
  import EventEmitter from 'eventemitter3';
11
11
  import { registerReportingObserver } from '../utils/reporting';
12
- import { resetCachedAuthToken } from '../authToken';
13
12
  import { logger, setGlobalLogLevelOverride } from '../utils/logger';
14
13
  import { tokenizedFetch } from '../tokenizedFetch';
15
14
  import { EndPoints } from '../utils/authService/authService';
@@ -34,6 +33,7 @@ import {
34
33
  import { uploadMixpanelEvent, MIXPANEL_EVENT } from '../mixpanel-service';
35
34
  import { getEmbedConfig, setEmbedConfig } from './embedConfig';
36
35
  import { getQueryParamString } from '../utils';
36
+ import { resetAllCachedServices } from '../utils/resetServices';
37
37
 
38
38
  const CONFIG_DEFAULTS: Partial<EmbedConfig> = {
39
39
  loginFailedMessage: 'Not logged in',
@@ -193,7 +193,7 @@ function backwardCompat(embedConfig: EmbedConfig): EmbedConfig {
193
193
  */
194
194
  export const init = (embedConfig: EmbedConfig): AuthEventEmitter => {
195
195
  sanity(embedConfig);
196
- resetCachedAuthToken();
196
+ resetAllCachedServices();
197
197
  embedConfig = setEmbedConfig(
198
198
  backwardCompat({
199
199
  ...CONFIG_DEFAULTS,
@@ -1,6 +1,7 @@
1
+ import { getValueFromWindow, storeValueInWindow } from '../utils';
1
2
  import { EmbedConfig } from '../types';
2
3
 
3
- let config = {} as EmbedConfig;
4
+ const configKey = 'embedConfig';
4
5
 
5
6
  /**
6
7
  * Gets the configuration embed was initialized with.
@@ -8,7 +9,7 @@ let config = {} as EmbedConfig;
8
9
  * @version SDK: 1.19.0 | ThoughtSpot: *
9
10
  * @group Global methods
10
11
  */
11
- export const getEmbedConfig = (): EmbedConfig => config;
12
+ export const getEmbedConfig = (): EmbedConfig => getValueFromWindow(configKey) || {};
12
13
 
13
14
  /**
14
15
  * Sets the configuration embed was initialized with.
@@ -18,6 +19,6 @@ export const getEmbedConfig = (): EmbedConfig => config;
18
19
  * @group Global methods
19
20
  */
20
21
  export const setEmbedConfig = (newConfig: EmbedConfig) => {
21
- config = newConfig;
22
- return newConfig;
22
+ storeValueInWindow(configKey, newConfig);
23
+ return getValueFromWindow(configKey);
23
24
  };
@@ -293,7 +293,10 @@ export interface LiveboardViewConfig
293
293
  */
294
294
  showPreviewLoader?: boolean;
295
295
  /**
296
- * This flag is used to enable the compact header on a Liveboard
296
+ * Enables or disables the compact header feature on a Liveboard.
297
+ * Compact Liveboard header is turned off by default on Liveboards in
298
+ * ThoughtSpot Embedded apps.
299
+ *
297
300
  * @type {boolean}
298
301
  * @default false
299
302
  * @version SDK: 1.35.0 | ThoughtSpot:10.3.0.cl
package/src/types.ts CHANGED
@@ -213,12 +213,12 @@ export type DOMSelector = string | HTMLElement;
213
213
  * Use {@link CustomCssVariables} or css rules.
214
214
  */
215
215
  export interface customCssInterface {
216
- /**
217
- * The custom css variables, which can be set.
218
- * The allowed list is in the CustomCssVariables
219
- * interface. For more information, see
220
- * link:https://developers.thoughtspot.com/docs/css-variables-reference
221
- */
216
+ /**
217
+ * The custom css variables, which can be set.
218
+ * The variables are available in the {@link CustomCssVariables}
219
+ * interface. For more information, see
220
+ * link:https://developers.thoughtspot.com/docs/css-variables-reference[CSS variable reference].
221
+ */
222
222
  variables?: CustomCssVariables;
223
223
  /**
224
224
  * Can be used to define a custom font face
@@ -770,7 +770,7 @@ export interface ViewConfig {
770
770
  */
771
771
  showAlerts?: boolean;
772
772
  /**
773
- * The list of runtime filters to apply to a search answer,
773
+ * The list of runtime filters to apply to a search Answer,
774
774
  * visualization, or Liveboard.
775
775
  * @version SDK: 1.9.4 | ThoughtSpot 8.1.0.cl, 8.4.1.sw
776
776
  * @example
@@ -789,7 +789,7 @@ export interface ViewConfig {
789
789
  */
790
790
  runtimeFilters?: RuntimeFilter[];
791
791
  /**
792
- * The list of parameter override to apply to a search answer,
792
+ * The list of parameter override to apply to a search Answer,
793
793
  * visualization, or Liveboard.
794
794
  * @version SDK : 1.25.0 | ThoughtSpot: 9.2.0.cl, 9.5.0.sw
795
795
  * @example
@@ -807,7 +807,7 @@ export interface ViewConfig {
807
807
  */
808
808
  runtimeParameters?: RuntimeParameter[];
809
809
  /**
810
- * The locale/language to use for the embedded view.
810
+ * The locale settings to apply to the embedded view.
811
811
  * @version SDK: 1.9.4 | ThoughtSpot 8.1.0.cl, 8.4.1.sw
812
812
  * @example
813
813
  * ```js
@@ -872,7 +872,7 @@ export interface ViewConfig {
872
872
  */
873
873
  contextMenuTrigger?: ContextMenuTriggerOptions;
874
874
  /**
875
- * Flag to override openNew tab context menu link
875
+ * Flag to override the *Open Link in New Tab* context menu option.
876
876
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
877
877
  * @example
878
878
  * ```js
@@ -1012,7 +1012,7 @@ export interface ViewConfig {
1012
1012
  preRenderId?: string;
1013
1013
 
1014
1014
  /**
1015
- * Determines whether the PreRender component should not dynamically track the size
1015
+ * Determines if the PreRender component should dynamically track the size
1016
1016
  * of its embedding element and adjust its own size accordingly.
1017
1017
  * Enabling this option allows the PreRender component to automatically adapt
1018
1018
  * its dimensions based on changes to the size of the embedding element.
@@ -1402,8 +1402,8 @@ export enum EmbedEvent {
1402
1402
  */
1403
1403
  Load = 'load',
1404
1404
  /**
1405
- * Data pertaining to answer or Liveboard is received
1406
- * @return data - The answer or Liveboard data
1405
+ * Data pertaining to an Answer or Liveboard is received
1406
+ * @return data - The Answer or Liveboard data
1407
1407
  * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
1408
1408
  * @example
1409
1409
  *```js
@@ -1577,7 +1577,7 @@ export enum EmbedEvent {
1577
1577
  */
1578
1578
  Alert = 'alert',
1579
1579
  /**
1580
- * The ThoughtSpot auth session has expired.
1580
+ * The ThoughtSpot authentication session has expired.
1581
1581
  * @version SDK: 1.4.0 | ThoughtSpot: ts7.sep.cl, 8.4.1.sw
1582
1582
  * @example
1583
1583
  *```js
@@ -1649,7 +1649,7 @@ export enum EmbedEvent {
1649
1649
  /**
1650
1650
  * Emitted when the embed does not have cookie access. This happens
1651
1651
  * when Safari and other Web browsers block third-party cookies
1652
- * are blocked by default. `NoCookieAccess` can trigger
1652
+ * are blocked by default. `NoCookieAccess` can trigger.
1653
1653
  * @example
1654
1654
  *```js
1655
1655
  * appEmbed.on(EmbedEvent.NoCookieAccess)
@@ -1737,7 +1737,7 @@ export enum EmbedEvent {
1737
1737
  */
1738
1738
  Save = 'save',
1739
1739
  /**
1740
- * Emitted when the download action is triggered on an answer
1740
+ * Emitted when the download action is triggered on an Answer.
1741
1741
  *
1742
1742
  * **Note**: This event is deprecated in v1.21.0.
1743
1743
  * To fire an event when a download action is initiated on a chart or table,
@@ -1753,7 +1753,7 @@ export enum EmbedEvent {
1753
1753
  */
1754
1754
  Download = 'download',
1755
1755
  /**
1756
- * Emitted when the download action is triggered on an answer
1756
+ * Emitted when the download action is triggered on an Answer.
1757
1757
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.0.sw
1758
1758
  * @example
1759
1759
  *```js
@@ -1767,7 +1767,7 @@ export enum EmbedEvent {
1767
1767
  */
1768
1768
  DownloadAsPng = 'downloadAsPng',
1769
1769
  /**
1770
- * Emitted when the Download as PDF action is triggered on an answer
1770
+ * Emitted when the Download as PDF action is triggered on an Answer
1771
1771
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1772
1772
  * @example
1773
1773
  *```js
@@ -1781,7 +1781,7 @@ export enum EmbedEvent {
1781
1781
  */
1782
1782
  DownloadAsPdf = 'downloadAsPdf',
1783
1783
  /**
1784
- * Emitted when the Download as CSV action is triggered on an answer
1784
+ * Emitted when the Download as CSV action is triggered on an Answer.
1785
1785
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1786
1786
  * @example
1787
1787
  *```js
@@ -1795,7 +1795,7 @@ export enum EmbedEvent {
1795
1795
  */
1796
1796
  DownloadAsCsv = 'downloadAsCsv',
1797
1797
  /**
1798
- * Emitted when the Download as XLSX action is triggered on an answer
1798
+ * Emitted when the Download as XLSX action is triggered on an Answer.
1799
1799
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1800
1800
  * @example
1801
1801
  *```js
@@ -1823,7 +1823,8 @@ export enum EmbedEvent {
1823
1823
  */
1824
1824
  AnswerDelete = 'answerDelete',
1825
1825
  /**
1826
- * Emitted when an answer is pinned to a Liveboard
1826
+ * Emitted when a user initiates the Pin action to
1827
+ * add an Answer to a Liveboard.
1827
1828
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1828
1829
  * @example
1829
1830
  *```js
@@ -1961,7 +1962,7 @@ export enum EmbedEvent {
1961
1962
  */
1962
1963
  SaveAsView = 'saveAsView',
1963
1964
  /**
1964
- * Emitted when the user creates a copy of an Answer
1965
+ * Emitted when the user creates a copy of an Answer.
1965
1966
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1966
1967
  * @example
1967
1968
  *```js
@@ -1975,7 +1976,7 @@ export enum EmbedEvent {
1975
1976
  */
1976
1977
  CopyAEdit = 'copyAEdit',
1977
1978
  /**
1978
- * Emitted when a user clicks Show underlying data on an Answer
1979
+ * Emitted when a user clicks *Show underlying data* on an Answer.
1979
1980
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1980
1981
  * @example
1981
1982
  *```js
@@ -1986,7 +1987,7 @@ export enum EmbedEvent {
1986
1987
  */
1987
1988
  ShowUnderlyingData = 'showUnderlyingData',
1988
1989
  /**
1989
- * Emitted when an answer is switched to a chart or table view.
1990
+ * Emitted when an Answer is switched to a chart or table view.
1990
1991
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1991
1992
  * @example
1992
1993
  *```js
@@ -2120,11 +2121,12 @@ export enum EmbedEvent {
2120
2121
  */
2121
2122
  CopyLink = 'embedDocument',
2122
2123
  /**
2123
- * Emitted when a user interacts with cross filters on a visualization or Liveboard
2124
+ * Emitted when a user interacts with cross filters on a
2125
+ * visualization or Liveboard.
2124
2126
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.0.sw
2125
2127
  * @example
2126
2128
  *```js
2127
- * liveboardEmbed.trigger(HostEvent.CrossFilterChanged, {
2129
+ * liveboardEmbed.on(EmbedEvent.CrossFilterChanged, {
2128
2130
  * vizId: '730496d6-6903-4601-937e-2c691821af3c'})
2129
2131
  *```
2130
2132
  */
@@ -2218,8 +2220,8 @@ export enum EmbedEvent {
2218
2220
  */
2219
2221
  DeletePersonalisedView = 'deletePersonalisedView',
2220
2222
  /**
2221
- * Emitted when a user creates a new worksheet
2222
- * @version SDK : 1.27.0 | ThoughtSpot Cloud: 9.8.0.cl
2223
+ * Emitted when a user creates a Worksheet.
2224
+ * @version SDK : 1.27.0 | ThoughtSpot: 9.8.0.cl, 9.8.0.sw
2223
2225
  */
2224
2226
  CreateWorksheet = 'createWorksheet',
2225
2227
  /**
@@ -2232,8 +2234,8 @@ export enum EmbedEvent {
2232
2234
  */
2233
2235
  AskSageInit = 'AskSageInit',
2234
2236
  /**
2235
- * Emitted when a LB/viz is renamed
2236
- * @version SDK : 1.28.0 | ThoughtSpot: 9.10.5.cl
2237
+ * Emitted when a Liveboard or visualization is renamed.
2238
+ * @version SDK : 1.28.0 | ThoughtSpot: 9.10.5.cl, 10.1.0.sw
2237
2239
  */
2238
2240
  Rename = 'rename',
2239
2241
  /**
@@ -2297,8 +2299,7 @@ export enum EmbedEvent {
2297
2299
  OnBeforeGetVizDataIntercept = 'onBeforeGetVizDataIntercept',
2298
2300
  /**
2299
2301
  * Emitted when parameter changes in an Answer
2300
- * or Liveboard
2301
- *
2302
+ * or Liveboard.
2302
2303
  * ```js
2303
2304
  * liveboardEmbed.on(EmbedEvent.ParameterChanged, (payload) => {
2304
2305
  * console.log('payload', payload);
@@ -2325,7 +2326,7 @@ export enum EmbedEvent {
2325
2326
  */
2326
2327
  TableVizRendered = 'TableVizRendered',
2327
2328
  /**
2328
- * Emitted when the liveboard is created from pin modal or liveboard list page.
2329
+ * Emitted when the liveboard is created from pin modal or Liveboard list page.
2329
2330
  * You can use this event as a hook to trigger
2330
2331
  * other events on liveboard creation.
2331
2332
  *
@@ -2470,7 +2471,7 @@ export enum HostEvent {
2470
2471
  */
2471
2472
  Filter = 'filter',
2472
2473
  /**
2473
- * Reload the answer or visualization
2474
+ * Reload the Answer or visualization
2474
2475
  * @hidden
2475
2476
  */
2476
2477
  Reload = 'reload',
@@ -2520,12 +2521,10 @@ export enum HostEvent {
2520
2521
  * and `AppEmbed` only. In full application embedding, this event updates
2521
2522
  * the runtime filters applied on the Liveboard and saved Answer objects.
2522
2523
  *
2523
- *
2524
- * Pass an array of runtime filters with the following attributes:
2525
- *
2524
+ * @param - Pass an array of {@link RuntimeFilter} with the following attributes:
2526
2525
  * `columnName` - _String_. The name of the column to filter on.
2527
2526
  *
2528
- * `operator` - Runtime filter operator to apply. For more information,
2527
+ * `operator` - {@link RuntimeFilterOp} to apply. For more information,
2529
2528
  * see link:https://developers.thoughtspot.com/docs/?pageid=runtime-filters#rtOperator[Developer Documentation].
2530
2529
  *
2531
2530
  * `values` - List of operands. Some operators such as EQ and LE allow a
@@ -2537,7 +2536,7 @@ export enum HostEvent {
2537
2536
  * will be cleared, restoring the original visualization
2538
2537
  * with the updated filters.
2539
2538
  *
2540
- * @param - {@link RuntimeFilter}[] an array of {@link RuntimeFilter} Types.
2539
+
2541
2540
  * @example
2542
2541
  * ```js
2543
2542
  * liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
@@ -2776,6 +2775,11 @@ export enum HostEvent {
2776
2775
  * appEmbed.trigger(HostEvent.Remove)
2777
2776
  * ```
2778
2777
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2778
+ * * @example
2779
+ * ```js
2780
+ * liveboardEmbed.trigger(HostEvent.Remove)
2781
+ * ```
2782
+ * @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl, 10.10.0.sw
2779
2783
  */
2780
2784
  Remove = 'delete',
2781
2785
  /**
@@ -3186,7 +3190,7 @@ export enum HostEvent {
3186
3190
  * ```js
3187
3191
  * liveboardEmbed.trigger(HostEvent.GetTabs).then((tabDetails) => {
3188
3192
  * console.log(
3189
- * tabDetails // TabDetails of current LB
3193
+ * tabDetails // TabDetails of current Liveboard
3190
3194
  * );
3191
3195
  * })
3192
3196
  * ```
@@ -3234,7 +3238,7 @@ export enum HostEvent {
3234
3238
  */
3235
3239
  UpdateSageQuery = 'updateSageQuery',
3236
3240
  /**
3237
- * Get the answer session for a Search or
3241
+ * Get the Answer session for a Search or
3238
3242
  * Liveboard visualization.
3239
3243
  * @example
3240
3244
  * ```js
@@ -3413,6 +3417,7 @@ export enum Param {
3413
3417
  HostAppUrl = 'hostAppUrl',
3414
3418
  EnableVizTransformations = 'enableVizTransform',
3415
3419
  EnableSearchAssist = 'enableSearchAssist',
3420
+ EnablePendoHelp = 'enablePendoHelp',
3416
3421
  HideResult = 'hideResult',
3417
3422
  UseLastSelectedDataSource = 'useLastSelectedSources',
3418
3423
  Tag = 'tag',
@@ -3645,9 +3650,10 @@ export enum Action {
3645
3650
  */
3646
3651
  AddDataPanelObjects = 'addDataPanelObjects',
3647
3652
  /**
3648
- * Filter configuration options on a Liveboard page.
3649
- * Allows configuring filters on a
3650
- * Liveboard.
3653
+ * The filter configuration options for a Liveboard.
3654
+ * The configuration options are available when adding
3655
+ * filters on a Liveboard.
3656
+ *
3651
3657
  * @example
3652
3658
  * ```js
3653
3659
  * disabledActions: [Action.ConfigureFilter]
@@ -3745,14 +3751,17 @@ export enum Action {
3745
3751
  * @hidden
3746
3752
  */
3747
3753
  SpotIQFollow = 'spotIQFollow',
3754
+ /**
3755
+ * The Share action for a Liveboard visualization.
3756
+ */
3748
3757
  ShareViz = 'shareViz',
3749
3758
  /**
3750
3759
  * @hidden
3751
3760
  */
3752
3761
  ReplaySearch = 'replaySearch',
3753
3762
  /**
3754
- * The **Show underlying data** menu action on a visualization or
3755
- * Answer page.
3763
+ * The **Show underlying data** menu action on a
3764
+ * visualization or Answer page.
3756
3765
  * Displays detailed information and raw data
3757
3766
  * for a given visualization.
3758
3767
  * @example
@@ -3762,8 +3771,8 @@ export enum Action {
3762
3771
  */
3763
3772
  ShowUnderlyingData = 'showUnderlyingData',
3764
3773
  /**
3765
- * The **Download** menu action on Liveboard visualizations
3766
- * and Answers.
3774
+ * The **Download** menu action on Liveboard
3775
+ * visualizations and Answers.
3767
3776
  * Allows downloading a visualization or Answer.
3768
3777
  * @example
3769
3778
  * ```js
@@ -3784,11 +3793,10 @@ export enum Action {
3784
3793
  /**
3785
3794
  *
3786
3795
  *The **Download PDF** action that downloads a Liveboard,
3787
- *visualization, or Answer as a PDF file.
3796
+ * visualization, or Answer as a PDF file.
3788
3797
  *
3789
- *
3790
- ***NOTE**: The **Download** > **PDF** action is available on
3791
- *visualizations and Answers if the data is in tabular format.
3798
+ * **NOTE**: The **Download** > **PDF** option is available for
3799
+ * tables in visualizations and Answers.
3792
3800
  * @example
3793
3801
  * ```js
3794
3802
  * disabledActions: [Action.DownloadAsPdf]
@@ -3820,9 +3828,11 @@ export enum Action {
3820
3828
  */
3821
3829
  DownloadTrace = 'downloadTrace',
3822
3830
  /**
3823
- * The **Export TML** menu action on Liveboard, Answers
3824
- * Worksheets and Data Connections page.
3825
- * Exports an object as a TML file.
3831
+ * The **Export TML** menu action on a Liveboard, Answer, and
3832
+ * the Data Workspace pages for data objects and connections.
3833
+ *
3834
+ * Allows exporting an object as a TML file.
3835
+ *
3826
3836
  * @example
3827
3837
  * ```js
3828
3838
  * disabledActions: [Action.ExportTML]
@@ -3830,7 +3840,8 @@ export enum Action {
3830
3840
  */
3831
3841
  ExportTML = 'exportTSL',
3832
3842
  /**
3833
- * The **Import TML** menu action for Liveboards and Answers.
3843
+ * The **Import TML** menu action on the
3844
+ * *Data Workspace* > *Utilities* page.
3834
3845
  * Imports TML representation of ThoughtSpot objects.
3835
3846
  * @example
3836
3847
  * ```js
@@ -3840,7 +3851,7 @@ export enum Action {
3840
3851
  ImportTML = 'importTSL',
3841
3852
  /**
3842
3853
  * The **Update TML** menu action for Liveboards and Answers.
3843
- * Update TML representation of ThoughtSpot objects.
3854
+ * Updates TML representation of ThoughtSpot objects.
3844
3855
  * @example
3845
3856
  * ```js
3846
3857
  * disabledActions: [Action.UpdateTML]
@@ -3867,8 +3878,11 @@ export enum Action {
3867
3878
  */
3868
3879
  Present = 'present',
3869
3880
  /**
3870
- * The tile resize options in the visualization menu.
3871
- * Allows switching between different preset layouts.
3881
+ * The visualization tile resize option.
3882
+ * Also available via More `...` options menu on a visualization.
3883
+ * Allows resizing visualization tiles and switching
3884
+ * between different preset layout option.
3885
+ *
3872
3886
  * @example
3873
3887
  * ```js
3874
3888
  * disabledActions: [Action.ToggleSize]
@@ -3894,8 +3908,9 @@ export enum Action {
3894
3908
  */
3895
3909
  EditTitle = 'editTitle',
3896
3910
  /**
3897
- * The **Delete** menu action on Liveboards and visualizations.
3898
- * Deletes a Liveboard or a visualization from a Liveboard.
3911
+ * The **Delete** action on a Liveboard, *Liveboards* and
3912
+ * *Answers* list pages in full application embedding.
3913
+ *
3899
3914
  * @example
3900
3915
  * ```js
3901
3916
  * disabledActions: [Action.Remove]
@@ -3972,8 +3987,9 @@ export enum Action {
3972
3987
  */
3973
3988
  Explore = 'explore',
3974
3989
  /**
3975
- * The action to include data points on a drilled-down Answer
3976
- * or visualization
3990
+ * The contextual menu action to include a specific data point
3991
+ * when drilling down a table or chart on an Answer.
3992
+ *
3977
3993
  * @example
3978
3994
  * ```js
3979
3995
  * disabledActions: [Action.DrillInclude]
@@ -3982,8 +3998,8 @@ export enum Action {
3982
3998
 
3983
3999
  DrillInclude = 'context-menu-item-include',
3984
4000
  /**
3985
- * The action to exclude data points on a drilled-down Answer
3986
- * or visualization
4001
+ * The contextual menu action to exclude a specific data point
4002
+ * when drilling down a table or chart on an Answer.
3987
4003
  * @example
3988
4004
  * ```js
3989
4005
  * disabledActions: [Action.DrillInclude]
@@ -4130,7 +4146,7 @@ export enum Action {
4130
4146
  * Allows users to manage data sync pipelines to third-party apps.
4131
4147
  * @example
4132
4148
  * ```js
4133
- * disabledActions: [Action.SyncToOtherApps]
4149
+ * disabledActions: [Action.ManagePipelines]
4134
4150
  * ```
4135
4151
  * @version SDK: 1.18.0| ThoughtSpot: 8.10.0.cl, 9.0.1.sw
4136
4152
  */
@@ -4450,7 +4466,7 @@ export enum Action {
4450
4466
  /**
4451
4467
  * Action ID for the Parent TML action
4452
4468
  * The parent action **TML** must be included to access TML-related options
4453
- * within the cascading menu (specific to the answer page)
4469
+ * within the cascading menu (specific to the Answer page)
4454
4470
  * @example
4455
4471
  * ```js
4456
4472
  * // to include specific TML actions
@@ -4491,8 +4507,10 @@ export enum Action {
4491
4507
  VerifiedLiveboard = 'verifiedLiveboard',
4492
4508
 
4493
4509
  /**
4494
- * The *Ask Sage* action for Answers and visualizations.
4495
- * Allows initiating a Natural Language Search query.
4510
+ * Action ID for the *Ask Sage* In Natural Language Search embed,
4511
+ * *Spotter* in Liveboard, full app, and Spotter embed.
4512
+ *
4513
+ * Allows initiating a conversation with ThoughtSpot AI analyst.
4496
4514
  *
4497
4515
  * @example
4498
4516
  * ```js
@@ -4701,7 +4719,8 @@ export enum Action {
4701
4719
  */
4702
4720
  DeletePreviousPrompt = 'deletePreviousPrompt',
4703
4721
  /**
4704
- * Action ID for hide/disable edit of tokens on spotter results.
4722
+ * Action ID for hide or disable editing tokens generated from
4723
+ * Spotter results.
4705
4724
  * @example
4706
4725
  * ```js
4707
4726
  * hiddenAction: [Action.EditTokens]
@@ -0,0 +1,15 @@
1
+ import * as authToken from '../authToken';
2
+ import { resetAllCachedServices } from './resetServices';
3
+ import * as sessionInfoService from './sessionInfoService';
4
+
5
+ describe('resetAllServices', () => {
6
+ it('should reset all services', () => {
7
+ const resetCachedAuthTokenSpy = jest.spyOn(authToken, 'resetCachedAuthToken');
8
+ const resetCachedSessionInfoSpy = jest.spyOn(sessionInfoService, 'resetCachedSessionInfo');
9
+ const resetCachedPreauthInfoSpy = jest.spyOn(sessionInfoService, 'resetCachedPreauthInfo');
10
+ resetAllCachedServices();
11
+ expect(resetCachedAuthTokenSpy).toHaveBeenCalled();
12
+ expect(resetCachedSessionInfoSpy).toHaveBeenCalled();
13
+ expect(resetCachedPreauthInfoSpy).toHaveBeenCalled();
14
+ });
15
+ });
@@ -0,0 +1,14 @@
1
+ import { resetCachedAuthToken } from '../authToken';
2
+ import { resetCachedPreauthInfo, resetCachedSessionInfo } from './sessionInfoService';
3
+
4
+ /**
5
+ * This function resets all the services that are cached in the SDK.
6
+ * This is to be called when the user logs out of the application and also
7
+ * when init is called again.
8
+ * @version SDK: 1.30.2 | ThoughtSpot: *
9
+ */
10
+ export function resetAllCachedServices(): void {
11
+ resetCachedAuthToken();
12
+ resetCachedSessionInfo();
13
+ resetCachedPreauthInfo();
14
+ }