@thoughtspot/visual-embed-sdk 1.41.0-pre-render-1 → 1.41.0

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 (220) hide show
  1. package/cjs/package.json +3 -3
  2. package/cjs/src/embed/app.d.ts +6 -1
  3. package/cjs/src/embed/app.d.ts.map +1 -1
  4. package/cjs/src/embed/app.js +19 -1
  5. package/cjs/src/embed/app.js.map +1 -1
  6. package/cjs/src/embed/app.spec.js +60 -3
  7. package/cjs/src/embed/app.spec.js.map +1 -1
  8. package/cjs/src/embed/bodyless-conversation.d.ts +0 -1
  9. package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
  10. package/cjs/src/embed/bodyless-conversation.js +3 -7
  11. package/cjs/src/embed/bodyless-conversation.js.map +1 -1
  12. package/cjs/src/embed/conversation.d.ts +0 -1
  13. package/cjs/src/embed/conversation.d.ts.map +1 -1
  14. package/cjs/src/embed/conversation.js +2 -7
  15. package/cjs/src/embed/conversation.js.map +1 -1
  16. package/cjs/src/embed/liveboard.d.ts +0 -1
  17. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  18. package/cjs/src/embed/liveboard.js +4 -27
  19. package/cjs/src/embed/liveboard.js.map +1 -1
  20. package/cjs/src/embed/liveboard.spec.js +25 -31
  21. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  22. package/cjs/src/embed/sage.d.ts +0 -1
  23. package/cjs/src/embed/sage.d.ts.map +1 -1
  24. package/cjs/src/embed/sage.js +6 -10
  25. package/cjs/src/embed/sage.js.map +1 -1
  26. package/cjs/src/embed/search-bar.d.ts +0 -1
  27. package/cjs/src/embed/search-bar.d.ts.map +1 -1
  28. package/cjs/src/embed/search-bar.js +7 -11
  29. package/cjs/src/embed/search-bar.js.map +1 -1
  30. package/cjs/src/embed/search.d.ts +0 -1
  31. package/cjs/src/embed/search.d.ts.map +1 -1
  32. package/cjs/src/embed/search.js +8 -7
  33. package/cjs/src/embed/search.js.map +1 -1
  34. package/cjs/src/embed/ts-embed.d.ts +4 -6
  35. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  36. package/cjs/src/embed/ts-embed.js +20 -21
  37. package/cjs/src/embed/ts-embed.js.map +1 -1
  38. package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
  39. package/cjs/src/embed/ts-embed.spec.js +122 -0
  40. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  41. package/cjs/src/errors.d.ts +10 -0
  42. package/cjs/src/errors.d.ts.map +1 -1
  43. package/cjs/src/errors.js +11 -1
  44. package/cjs/src/errors.js.map +1 -1
  45. package/cjs/src/index.d.ts +2 -2
  46. package/cjs/src/index.d.ts.map +1 -1
  47. package/cjs/src/index.js +3 -1
  48. package/cjs/src/index.js.map +1 -1
  49. package/cjs/src/react/index.d.ts +1 -1
  50. package/cjs/src/react/index.d.ts.map +1 -1
  51. package/cjs/src/react/index.js +2 -1
  52. package/cjs/src/react/index.js.map +1 -1
  53. package/cjs/src/types.d.ts +135 -17
  54. package/cjs/src/types.d.ts.map +1 -1
  55. package/cjs/src/types.js +40 -21
  56. package/cjs/src/types.js.map +1 -1
  57. package/cjs/src/utils/custom-actions.d.ts +12 -0
  58. package/cjs/src/utils/custom-actions.d.ts.map +1 -0
  59. package/cjs/src/utils/custom-actions.js +180 -0
  60. package/cjs/src/utils/custom-actions.js.map +1 -0
  61. package/cjs/src/utils/custom-actions.spec.d.ts +2 -0
  62. package/cjs/src/utils/custom-actions.spec.d.ts.map +1 -0
  63. package/cjs/src/utils/custom-actions.spec.js +399 -0
  64. package/cjs/src/utils/custom-actions.spec.js.map +1 -0
  65. package/cjs/src/utils/processData.d.ts.map +1 -1
  66. package/cjs/src/utils/processData.js +10 -0
  67. package/cjs/src/utils/processData.js.map +1 -1
  68. package/cjs/src/utils/processData.spec.js +11 -0
  69. package/cjs/src/utils/processData.spec.js.map +1 -1
  70. package/cjs/src/utils.d.ts +7 -0
  71. package/cjs/src/utils.d.ts.map +1 -1
  72. package/cjs/src/utils.js +11 -1
  73. package/cjs/src/utils.js.map +1 -1
  74. package/cjs/src/utils.spec.js +28 -0
  75. package/cjs/src/utils.spec.js.map +1 -1
  76. package/dist/{index-CmEQfuE3.js → index-B_mxAan8.js} +1 -1
  77. package/dist/src/embed/app.d.ts +6 -1
  78. package/dist/src/embed/app.d.ts.map +1 -1
  79. package/dist/src/embed/bodyless-conversation.d.ts +0 -1
  80. package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
  81. package/dist/src/embed/conversation.d.ts +0 -1
  82. package/dist/src/embed/conversation.d.ts.map +1 -1
  83. package/dist/src/embed/liveboard.d.ts +0 -1
  84. package/dist/src/embed/liveboard.d.ts.map +1 -1
  85. package/dist/src/embed/sage.d.ts +0 -1
  86. package/dist/src/embed/sage.d.ts.map +1 -1
  87. package/dist/src/embed/search-bar.d.ts +0 -1
  88. package/dist/src/embed/search-bar.d.ts.map +1 -1
  89. package/dist/src/embed/search.d.ts +0 -1
  90. package/dist/src/embed/search.d.ts.map +1 -1
  91. package/dist/src/embed/ts-embed.d.ts +4 -6
  92. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  93. package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
  94. package/dist/src/errors.d.ts +10 -0
  95. package/dist/src/errors.d.ts.map +1 -1
  96. package/dist/src/index.d.ts +2 -2
  97. package/dist/src/index.d.ts.map +1 -1
  98. package/dist/src/react/index.d.ts +1 -1
  99. package/dist/src/react/index.d.ts.map +1 -1
  100. package/dist/src/types.d.ts +135 -17
  101. package/dist/src/types.d.ts.map +1 -1
  102. package/dist/src/utils/custom-actions.d.ts +12 -0
  103. package/dist/src/utils/custom-actions.d.ts.map +1 -0
  104. package/dist/src/utils/custom-actions.spec.d.ts +2 -0
  105. package/dist/src/utils/custom-actions.spec.d.ts.map +1 -0
  106. package/dist/src/utils/processData.d.ts.map +1 -1
  107. package/dist/src/utils.d.ts +7 -0
  108. package/dist/src/utils.d.ts.map +1 -1
  109. package/dist/tsembed-react.es.js +1704 -250
  110. package/dist/tsembed-react.js +1703 -249
  111. package/dist/tsembed.es.js +1704 -250
  112. package/dist/tsembed.js +1703 -249
  113. package/dist/visual-embed-sdk-react-full.d.ts +146 -31
  114. package/dist/visual-embed-sdk-react.d.ts +146 -31
  115. package/dist/visual-embed-sdk.d.ts +146 -31
  116. package/lib/package.json +3 -3
  117. package/lib/src/embed/app.d.ts +6 -1
  118. package/lib/src/embed/app.d.ts.map +1 -1
  119. package/lib/src/embed/app.js +19 -1
  120. package/lib/src/embed/app.js.map +1 -1
  121. package/lib/src/embed/app.spec.js +60 -3
  122. package/lib/src/embed/app.spec.js.map +1 -1
  123. package/lib/src/embed/bodyless-conversation.d.ts +0 -1
  124. package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
  125. package/lib/src/embed/bodyless-conversation.js +3 -7
  126. package/lib/src/embed/bodyless-conversation.js.map +1 -1
  127. package/lib/src/embed/conversation.d.ts +0 -1
  128. package/lib/src/embed/conversation.d.ts.map +1 -1
  129. package/lib/src/embed/conversation.js +2 -7
  130. package/lib/src/embed/conversation.js.map +1 -1
  131. package/lib/src/embed/liveboard.d.ts +0 -1
  132. package/lib/src/embed/liveboard.d.ts.map +1 -1
  133. package/lib/src/embed/liveboard.js +4 -27
  134. package/lib/src/embed/liveboard.js.map +1 -1
  135. package/lib/src/embed/liveboard.spec.js +25 -31
  136. package/lib/src/embed/liveboard.spec.js.map +1 -1
  137. package/lib/src/embed/sage.d.ts +0 -1
  138. package/lib/src/embed/sage.d.ts.map +1 -1
  139. package/lib/src/embed/sage.js +6 -10
  140. package/lib/src/embed/sage.js.map +1 -1
  141. package/lib/src/embed/search-bar.d.ts +0 -1
  142. package/lib/src/embed/search-bar.d.ts.map +1 -1
  143. package/lib/src/embed/search-bar.js +7 -11
  144. package/lib/src/embed/search-bar.js.map +1 -1
  145. package/lib/src/embed/search.d.ts +0 -1
  146. package/lib/src/embed/search.d.ts.map +1 -1
  147. package/lib/src/embed/search.js +8 -7
  148. package/lib/src/embed/search.js.map +1 -1
  149. package/lib/src/embed/ts-embed.d.ts +4 -6
  150. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  151. package/lib/src/embed/ts-embed.js +20 -21
  152. package/lib/src/embed/ts-embed.js.map +1 -1
  153. package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
  154. package/lib/src/embed/ts-embed.spec.js +123 -1
  155. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  156. package/lib/src/errors.d.ts +10 -0
  157. package/lib/src/errors.d.ts.map +1 -1
  158. package/lib/src/errors.js +10 -0
  159. package/lib/src/errors.js.map +1 -1
  160. package/lib/src/index.d.ts +2 -2
  161. package/lib/src/index.d.ts.map +1 -1
  162. package/lib/src/index.js +2 -2
  163. package/lib/src/index.js.map +1 -1
  164. package/lib/src/react/index.d.ts +1 -1
  165. package/lib/src/react/index.d.ts.map +1 -1
  166. package/lib/src/react/index.js +1 -1
  167. package/lib/src/react/index.js.map +1 -1
  168. package/lib/src/types.d.ts +135 -17
  169. package/lib/src/types.d.ts.map +1 -1
  170. package/lib/src/types.js +39 -20
  171. package/lib/src/types.js.map +1 -1
  172. package/lib/src/utils/custom-actions.d.ts +12 -0
  173. package/lib/src/utils/custom-actions.d.ts.map +1 -0
  174. package/lib/src/utils/custom-actions.js +175 -0
  175. package/lib/src/utils/custom-actions.js.map +1 -0
  176. package/lib/src/utils/custom-actions.spec.d.ts +2 -0
  177. package/lib/src/utils/custom-actions.spec.d.ts.map +1 -0
  178. package/lib/src/utils/custom-actions.spec.js +397 -0
  179. package/lib/src/utils/custom-actions.spec.js.map +1 -0
  180. package/lib/src/utils/processData.d.ts.map +1 -1
  181. package/lib/src/utils/processData.js +10 -0
  182. package/lib/src/utils/processData.js.map +1 -1
  183. package/lib/src/utils/processData.spec.js +11 -0
  184. package/lib/src/utils/processData.spec.js.map +1 -1
  185. package/lib/src/utils.d.ts +7 -0
  186. package/lib/src/utils.d.ts.map +1 -1
  187. package/lib/src/utils.js +9 -0
  188. package/lib/src/utils.js.map +1 -1
  189. package/lib/src/utils.spec.js +29 -1
  190. package/lib/src/utils.spec.js.map +1 -1
  191. package/lib/src/visual-embed-sdk.d.ts +147 -32
  192. package/package.json +3 -3
  193. package/src/embed/app.spec.ts +85 -3
  194. package/src/embed/app.ts +21 -0
  195. package/src/embed/bodyless-conversation.ts +3 -8
  196. package/src/embed/conversation.ts +2 -17
  197. package/src/embed/liveboard.spec.ts +35 -35
  198. package/src/embed/liveboard.ts +4 -32
  199. package/src/embed/sage.ts +7 -12
  200. package/src/embed/search-bar.tsx +7 -14
  201. package/src/embed/search.ts +7 -18
  202. package/src/embed/ts-embed.spec.ts +136 -2
  203. package/src/embed/ts-embed.ts +25 -28
  204. package/src/errors.ts +11 -0
  205. package/src/index.ts +4 -0
  206. package/src/react/index.tsx +1 -0
  207. package/src/types.ts +198 -76
  208. package/src/utils/custom-actions.spec.ts +431 -0
  209. package/src/utils/custom-actions.ts +217 -0
  210. package/src/utils/processData.spec.ts +12 -0
  211. package/src/utils/processData.ts +10 -0
  212. package/src/utils.spec.ts +34 -0
  213. package/src/utils.ts +10 -0
  214. package/dist/index-BDlM0f0T.js +0 -7371
  215. package/dist/index-D1pyb7RG.js +0 -7371
  216. package/dist/index-DeFzsyFF.js +0 -7371
  217. package/dist/index-Dpf0rd6w.js +0 -7371
  218. package/dist/index-UuEbsISo.js +0 -7447
  219. package/dist/index-e3Uw3YFO.js +0 -7371
  220. package/dist/index-k7pkZMhx.js +0 -7371
@@ -35,6 +35,7 @@ import {
35
35
  removeStyleProperties,
36
36
  isUndefined,
37
37
  } from '../utils';
38
+ import { getCustomActions } from '../utils/custom-actions';
38
39
  import {
39
40
  getThoughtSpotHost,
40
41
  URL_MAX_LENGTH,
@@ -198,11 +199,11 @@ export class TsEmbed {
198
199
  uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
199
200
  ...viewConfig,
200
201
  });
201
- const embedConfig = getEmbedConfig();
202
- this.embedConfig = embedConfig;
203
-
204
202
  this.hostEventClient = new HostEventClient(this.iFrame);
203
+
205
204
  this.isReadyForRenderPromise = getInitPromise().then(async () => {
205
+ const embedConfig = getEmbedConfig();
206
+ this.embedConfig = embedConfig;
206
207
  if (!embedConfig.authTriggerContainer && !embedConfig.useEventForSAMLPopup) {
207
208
  this.embedConfig.authTriggerContainer = domSelector;
208
209
  }
@@ -380,6 +381,16 @@ export class TsEmbed {
380
381
 
381
382
  protected async getDefaultAppInitData(): Promise<DefaultAppInitData> {
382
383
  const authToken = await this.getAuthTokenForCookielessInit();
384
+ const customActionsResult = getCustomActions([
385
+ ...(this.viewConfig.customActions || []),
386
+ ...(this.embedConfig.customActions || [])
387
+ ]);
388
+ if (customActionsResult.errors.length > 0) {
389
+ this.handleError({
390
+ type: 'CUSTOM_ACTION_VALIDATION',
391
+ message: customActionsResult.errors,
392
+ });
393
+ }
383
394
  return {
384
395
  customisations: getCustomisations(this.embedConfig, this.viewConfig),
385
396
  authToken,
@@ -398,6 +409,7 @@ export class TsEmbed {
398
409
  customVariablesForThirdPartyTools:
399
410
  this.embedConfig.customVariablesForThirdPartyTools || {},
400
411
  hiddenListColumns: this.viewConfig.hiddenListColumns || [],
412
+ customActions: customActionsResult.actions,
401
413
  };
402
414
  }
403
415
 
@@ -482,10 +494,10 @@ export class TsEmbed {
482
494
  this.on(EmbedEvent.APP_INIT, this.appInitCb, { start: false }, true);
483
495
  this.on(EmbedEvent.AuthExpire, this.updateAuthToken, { start: false }, true);
484
496
  this.on(EmbedEvent.IdleSessionTimeout, this.idleSessionTimeout, { start: false }, true);
485
-
486
- const embedListenerReadyHandler = this.createEmbedContainerHandler(EmbedEvent.EmbedListenerReady);
497
+
498
+ const embedListenerReadyHandler = this.createEmbedContainerHandler(EmbedEvent.EmbedListenerReady);
487
499
  this.on(EmbedEvent.EmbedListenerReady, embedListenerReadyHandler, { start: false }, true);
488
-
500
+
489
501
  const authInitHandler = this.createEmbedContainerHandler(EmbedEvent.AuthInit);
490
502
  this.on(EmbedEvent.AuthInit, authInitHandler, { start: false }, true);
491
503
  };
@@ -508,12 +520,6 @@ export class TsEmbed {
508
520
  return `${basePath}#`;
509
521
  }
510
522
 
511
- protected getUpdateEmbedParamsObject() {
512
- let queryParams = this.getEmbedParamsObject();
513
- queryParams = { ...this.viewConfig, ...queryParams };
514
- return queryParams;
515
- }
516
-
517
523
  /**
518
524
  * Common query params set for all the embed modes.
519
525
  * @param queryParams
@@ -696,15 +702,10 @@ export class TsEmbed {
696
702
  }
697
703
 
698
704
  protected getEmbedParams() {
699
- const queryParams = this.getEmbedParamsObject();
705
+ const queryParams = this.getBaseQueryParams();
700
706
  return getQueryParamString(queryParams);
701
707
  }
702
708
 
703
- protected getEmbedParamsObject() {
704
- const params = this.getBaseQueryParams();
705
- return params;
706
- }
707
-
708
709
  protected getRootIframeSrc() {
709
710
  const query = this.getEmbedParams();
710
711
  return this.getEmbedBasePath(query);
@@ -1139,12 +1140,12 @@ export class TsEmbed {
1139
1140
  }
1140
1141
  }
1141
1142
 
1142
- /**
1143
+ /**
1143
1144
  * @hidden
1144
1145
  * Internal state to track if the embed container is loaded.
1145
1146
  * This is used to trigger events after the embed container is loaded.
1146
1147
  */
1147
- public isEmbedContainerLoaded = false;
1148
+ public isEmbedContainerLoaded = false;
1148
1149
 
1149
1150
  /**
1150
1151
  * @hidden
@@ -1190,7 +1191,7 @@ export class TsEmbed {
1190
1191
  } else {
1191
1192
  logger.debug('pushing callback to embedContainerReadyCallbacks', callback);
1192
1193
  this.embedContainerReadyCallbacks.push(callback);
1193
- }
1194
+ }
1194
1195
  }
1195
1196
 
1196
1197
  protected createEmbedContainerHandler = (source: EmbedEvent.AuthInit | EmbedEvent.EmbedListenerReady) => () => {
@@ -1278,7 +1279,7 @@ export class TsEmbed {
1278
1279
  * Creates the preRender shell
1279
1280
  * @param showPreRenderByDefault - Show the preRender after render, hidden by default
1280
1281
  */
1281
- public async preRender(showPreRenderByDefault = false): Promise<TsEmbed> {
1282
+ public async preRender(showPreRenderByDefault = false): Promise<TsEmbed> {
1282
1283
  if (!this.viewConfig.preRenderId) {
1283
1284
  logger.error(ERROR_MESSAGE.PRERENDER_ID_MISSING);
1284
1285
  return this;
@@ -1406,14 +1407,8 @@ export class TsEmbed {
1406
1407
  return this.preRender(true);
1407
1408
  }
1408
1409
  this.validatePreRenderViewConfig(this.viewConfig);
1409
- logger.debug('triggering UpdateEmbedParams', this.viewConfig);
1410
- this.executeAfterEmbedContainerLoaded(() => {
1411
- this.trigger(HostEvent.UpdateEmbedParams, this.getUpdateEmbedParamsObject());
1412
- });
1413
1410
  }
1414
1411
 
1415
- this.beforePrerenderVisible();
1416
-
1417
1412
  if (this.el) {
1418
1413
  this.syncPreRenderStyle();
1419
1414
  if (!this.viewConfig.doNotTrackPreRenderSize) {
@@ -1431,6 +1426,8 @@ export class TsEmbed {
1431
1426
  }
1432
1427
  }
1433
1428
 
1429
+ this.beforePrerenderVisible();
1430
+
1434
1431
  removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events']);
1435
1432
 
1436
1433
  this.subscribeToEvents();
package/src/errors.ts CHANGED
@@ -19,3 +19,14 @@ export const ERROR_MESSAGE = {
19
19
  RENDER_CALLED_BEFORE_INIT: 'Looks like render was called before calling init, the render won\'t start until init is called.\nFor more info check\n1. https://developers.thoughtspot.com/docs/Function_init#_init\n2.https://developers.thoughtspot.com/docs/getting-started#initSdk',
20
20
  SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
21
21
  };
22
+
23
+ export const CUSTOM_ACTIONS_ERROR_MESSAGE = {
24
+ INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
25
+ MISSING_REQUIRED_FIELDS: (id: string, missingFields: string[]) => `Custom Action Validation Error for '${id}': Missing required fields: ${missingFields.join(', ')}`,
26
+ UNSUPPORTED_TARGET: (id: string, targetType: string) => `Custom Action Validation Error for '${id}': Target type '${targetType}' is not supported`,
27
+ INVALID_POSITION: (position: string, targetType: string, supportedPositions: string) => `Position '${position}' is not supported for ${targetType.toLowerCase()}-level custom actions. Supported positions: ${supportedPositions}`,
28
+ INVALID_METADATA_IDS: (targetType: string, invalidIds: string[], supportedIds: string) => `Invalid metadata IDs for ${targetType.toLowerCase()}-level custom actions: ${invalidIds.join(', ')}. Supported metadata IDs: ${supportedIds}`,
29
+ INVALID_DATA_MODEL_IDS: (targetType: string, invalidIds: string[], supportedIds: string) => `Invalid data model IDs for ${targetType.toLowerCase()}-level custom actions: ${invalidIds.join(', ')}. Supported data model IDs: ${supportedIds}`,
30
+ INVALID_FIELDS: (targetType: string, invalidFields: string[], supportedFields: string) => `Invalid fields for ${targetType.toLowerCase()}-level custom actions: ${invalidFields.join(', ')}. Supported fields: ${supportedFields}`,
31
+ DUPLICATE_IDS: (id: string, duplicateNames: string[], keptName: string) => `Duplicate custom action ID '${id}' found. Actions with names '${duplicateNames.join("', '")}' will be ignored. Keeping '${keptName}'.`,
32
+ };
package/src/index.ts CHANGED
@@ -62,6 +62,8 @@ import {
62
62
  VizPoint,
63
63
  CustomActionPayload,
64
64
  ListPageColumns,
65
+ CustomActionsPosition,
66
+ CustomActionTarget,
65
67
  } from './types';
66
68
  import { CustomCssVariables } from './css-variables';
67
69
  import { SageEmbed, SageViewConfig } from './embed/sage';
@@ -148,6 +150,8 @@ export {
148
150
  UIPassthroughEvent,
149
151
  ListPageColumns,
150
152
  DataPanelCustomColumnGroupsAccordionState,
153
+ CustomActionsPosition,
154
+ CustomActionTarget,
151
155
  };
152
156
 
153
157
  export { resetCachedAuthToken } from './authToken';
@@ -600,4 +600,5 @@ export {
600
600
  LogLevel,
601
601
  getSessionInfo,
602
602
  ListPageColumns,
603
+ CustomActionsPosition,
603
604
  } from '../index';
package/src/types.ts CHANGED
@@ -14,7 +14,7 @@ import type { SessionInterface } from './utils/graphql/answerService/answerServi
14
14
  * the embedded app
15
15
  * @group Authentication / Init
16
16
  */
17
- // eslint-disable-next-line no-shadow
17
+
18
18
  export enum AuthType {
19
19
  /**
20
20
  * No authentication on the SDK. Pass-through to the embedded App. Alias for
@@ -231,12 +231,12 @@ export type DOMSelector = string | HTMLElement;
231
231
  * Use {@link CustomCssVariables} or css rules.
232
232
  */
233
233
  export interface customCssInterface {
234
- /**
235
- * The custom css variables, which can be set.
236
- * The variables are available in the {@link CustomCssVariables}
237
- * interface. For more information, see
238
- * link:https://developers.thoughtspot.com/docs/css-variables-reference[CSS variable reference].
239
- */
234
+ /**
235
+ * The custom css variables, which can be set.
236
+ * The variables are available in the {@link CustomCssVariables}
237
+ * interface. For more information, see
238
+ * link:https://developers.thoughtspot.com/docs/css-variables-reference[CSS variable reference].
239
+ */
240
240
  variables?: CustomCssVariables;
241
241
  /**
242
242
  * Can be used to define a custom font face
@@ -262,7 +262,7 @@ export interface customCssInterface {
262
262
  * };
263
263
  * ```
264
264
  */
265
- // eslint-disable-next-line camelcase
265
+
266
266
  rules_UNSTABLE?: {
267
267
  [selector: string]: {
268
268
  [declaration: string]: string;
@@ -648,7 +648,7 @@ export interface EmbedConfig {
648
648
  * ```
649
649
  * @version SDK 1.37.0 | ThoughtSpot: 10.8.0.cl
650
650
  */
651
- customVariablesForThirdPartyTools?: Record<string, any>;
651
+ customVariablesForThirdPartyTools?: Record< string, any >;
652
652
 
653
653
  disablePreauthCache?: boolean;
654
654
 
@@ -666,10 +666,36 @@ export interface EmbedConfig {
666
666
  * ```
667
667
  */
668
668
  disableFullscreenPresentation?: boolean;
669
+
670
+ /**
671
+ * Custom Actions allows users to define interactive UI actions (like buttons or menu
672
+ * items) that appear in ThoughtSpot's visualizations, answers, and Liveboards. These
673
+ * actions enable users to trigger custom workflows — such as navigating to an
674
+ * external app, calling an API, or opening a modal — based on the data context of
675
+ * what they clicked can be used to trigger custom logic when the action is clicked.
676
+ * @version SDK: 1.43.0 | ThoughtSpot: 10.14.0.cl
677
+ * @example
678
+ * ```js
679
+ * import { CustomActionPosition, CustomActionTarget } from '@thoughtspot/visual-embed-sdk';
680
+ * init({
681
+ * ... // other embed config options
682
+ * customActions: [
683
+ * {
684
+ * name: 'customAction',
685
+ * id: 'customAction',
686
+ * target: CustomActionTarget.VISUALIZATION,
687
+ * position: CustomActionPosition.PRIMARY,
688
+ * }
689
+ * }
690
+ * ]
691
+ * })
692
+ * ```
693
+ */
694
+ customActions?: CustomAction[];
669
695
  }
670
696
 
671
697
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
672
- export interface LayoutConfig { }
698
+ export interface LayoutConfig {}
673
699
 
674
700
  /**
675
701
  * Embedded iframe configuration
@@ -731,7 +757,7 @@ export interface BaseViewConfig {
731
757
  /**
732
758
  * @hidden
733
759
  */
734
- // eslint-disable-next-line camelcase
760
+
735
761
  styleSheet__unstable?: string;
736
762
  /**
737
763
  * The list of actions to disable from the primary menu, more menu
@@ -931,7 +957,7 @@ export interface BaseViewConfig {
931
957
  * ```
932
958
  * @version SDK: 1.31.2 | ThoughtSpot: 10.0.0.cl
933
959
  */
934
- // eslint-disable-next-line camelcase
960
+
935
961
  enableV2Shell_experimental?: boolean;
936
962
  /**
937
963
  * For internal tracking of the embed component type.
@@ -1030,6 +1056,34 @@ export interface BaseViewConfig {
1030
1056
  * ```
1031
1057
  */
1032
1058
  showAlerts?: boolean;
1059
+ /**
1060
+ * Custom Actions allows users to define interactive UI actions (like buttons or menu
1061
+ * items) that appear in ThoughtSpot's visualizations, answers, and Liveboards. These
1062
+ * actions enable users to trigger custom workflows — such as navigating to an
1063
+ * external app, calling an API, or opening a modal — based on the data context of
1064
+ * what they clicked can be used to trigger custom logic when the action is clicked.
1065
+ *
1066
+ * Supported embed types: `AppEmbed`, `LiveboardEmbed`, `SageEmbed`, `SearchEmbed`, `SpotterEmbed`
1067
+ * @version SDK: 1.43.0 | ThoughtSpot: 10.14.0.cl
1068
+ * @example
1069
+ * ```js
1070
+ * import { CustomActionPosition, CustomActionTarget } from '@thoughtspot/visual-embed-sdk';
1071
+ * // Use supported embed types such as AppEmbed or LiveboardEmbed
1072
+ * const embed = new LiveboardEmbed('#tsEmbed', {
1073
+ * ... // other embed config options
1074
+ * customActions: [
1075
+ * {
1076
+ * name: 'customAction',
1077
+ * id: 'customAction',
1078
+ * target: CustomActionTarget.VISUALIZATION,
1079
+ * position: CustomActionPosition.PRIMARY,
1080
+ * }
1081
+ * }
1082
+ * ]
1083
+ * })
1084
+ * ```
1085
+ */
1086
+ customActions?: CustomAction[];
1033
1087
  }
1034
1088
 
1035
1089
  /**
@@ -1040,7 +1094,8 @@ export interface HomePageConfig {
1040
1094
  * Hide list page columns
1041
1095
  * For example: hiddenListColumns = [ListPageColumns.Author]
1042
1096
  *
1043
- * **Note**: This option is available only in full app embedding. To use it, you need to import `ListPageColumns` enum.
1097
+ * **Note**: This option is currently available only in full app embedding and requires importing the ListPageColumns enum.
1098
+ * At present, it can be used with Liveboard and Answer list pages, and starting with version 10.14.0.cl, it will also be supported for the Home page.
1044
1099
  *
1045
1100
  * Supported embed types: `AppEmbed`
1046
1101
  * @version SDK: 1.38.0 | ThoughtSpot: 10.9.0.cl
@@ -1358,7 +1413,8 @@ export interface LiveboardAppEmbedViewConfig {
1358
1413
  */
1359
1414
  isLiveboardCompactHeaderEnabled?: boolean;
1360
1415
  /**
1361
- * This flag can be used to show or hide the Liveboard verified icon in the compact header.
1416
+ * This flag can be used to show or hide the Liveboard verified icon in the compact
1417
+ * header.
1362
1418
  *
1363
1419
  * Supported embed types: `AppEmbed`, `LiveboardEmbed`
1364
1420
  * @version SDK: 1.35.0 | ThoughtSpot:10.4.0.cl
@@ -1375,6 +1431,8 @@ export interface LiveboardAppEmbedViewConfig {
1375
1431
  showLiveboardVerifiedBadge?: boolean;
1376
1432
  /**
1377
1433
  * This flag is used to enable/disable hide irrelevant filters in Liveboard tab
1434
+ *
1435
+ * **Note**: This feature is supported only if compact header is enabled on your Liveboard. To enable compact header, use the `isLiveboardCompactHeaderEnabled` attribute.
1378
1436
  *
1379
1437
  * Supported embed types: `AppEmbed`, `LiveboardEmbed`
1380
1438
  * @version SDK: 1.36.0 | ThoughtSpot:10.6.0.cl
@@ -1385,12 +1443,14 @@ export interface LiveboardAppEmbedViewConfig {
1385
1443
  * const embed = new <EmbedComponent>('#tsEmbed', {
1386
1444
  * ... // other embed view config
1387
1445
  * hideIrrelevantChipsInLiveboardTabs: true,
1446
+ * isLiveboardCompactHeaderEnabled: true,
1388
1447
  * })
1389
1448
  * ```
1390
1449
  */
1391
1450
  hideIrrelevantChipsInLiveboardTabs?: boolean;
1392
1451
  /**
1393
- * This flag can be used to show or hide the re-verify banner on the Liveboard compact header
1452
+ * This flag can be used to show or hide the re-verify banner on the Liveboard
1453
+ * compact header
1394
1454
  *
1395
1455
  * Supported embed types: `AppEmbed`, `LiveboardEmbed`
1396
1456
  * @version SDK: 1.35.0 | ThoughtSpot:10.4.0.cl
@@ -1421,25 +1481,41 @@ export interface LiveboardAppEmbedViewConfig {
1421
1481
  * ```
1422
1482
  */
1423
1483
  enableAskSage?: boolean;
1424
- /**
1425
- * This flag is used to show or hide checkboxes for including or excluding
1426
- * the cover and filters pages in the Liveboard PDF.
1427
- *
1428
- * Supported embed types: `AppEmbed`, `LiveboardEmbed`
1429
- * @version SDK: 1.40.0 | ThoughtSpot:10.8.0.cl
1430
- * @example
1431
- * ```js
1432
- * // Replace <EmbedComponent> with embed component name. For example, AppEmbed or LiveboardEmbed
1433
- * const embed = new <EmbedComponent>('#tsEmbed', {
1434
- * ... // other embed view config
1435
- * coverAndFilterOptionInPDF: false,
1436
- * })
1437
- * ```
1438
- */
1484
+ /**
1485
+ * This flag is used to show or hide checkboxes for including or excluding
1486
+ * the cover and filters pages in the Liveboard PDF.
1487
+ *
1488
+ * Supported embed types: `AppEmbed`, `LiveboardEmbed`
1489
+ * @version SDK: 1.40.0 | ThoughtSpot:10.8.0.cl
1490
+ * @example
1491
+ * ```js
1492
+ * // Replace <EmbedComponent> with embed component name. For example, AppEmbed or LiveboardEmbed
1493
+ * const embed = new <EmbedComponent>('#tsEmbed', {
1494
+ * ... // other embed view config
1495
+ * coverAndFilterOptionInPDF: false,
1496
+ * })
1497
+ * ```
1498
+ */
1439
1499
  coverAndFilterOptionInPDF?: boolean;
1500
+ /**
1501
+ * This flag is used to enable or disable the XLSX/CSV download option for Liveboards.
1502
+ *
1503
+ * Supported embed types: `AppEmbed`, `LiveboardEmbed`
1504
+ * @version SDK: 1.41.0 | ThoughtSpot: 10.14.0.cl
1505
+ * @example
1506
+ * ```js
1507
+ * // Replace <EmbedComponent> with embed component name. For example, AppEmbed or LiveboardEmbed
1508
+ * const embed = new <EmbedComponent>('#tsEmbed', {
1509
+ * ... // other embed view config
1510
+ * liveboardXLSXCSVDownload: true,
1511
+ * })
1512
+ * ```
1513
+ */
1514
+ liveboardXLSXCSVDownload?: boolean;
1515
+
1440
1516
  }
1441
1517
 
1442
- export interface AllEmbedViewConfig extends BaseViewConfig, SearchLiveboardCommonViewConfig, HomePageConfig, LiveboardAppEmbedViewConfig { }
1518
+ export interface AllEmbedViewConfig extends BaseViewConfig, SearchLiveboardCommonViewConfig, HomePageConfig, LiveboardAppEmbedViewConfig {}
1443
1519
 
1444
1520
  /**
1445
1521
  * MessagePayload: Embed event payload: message type, data and status (start/end)
@@ -1500,7 +1576,7 @@ export type QueryParams = {
1500
1576
  /**
1501
1577
  * A map of the supported runtime filter operations
1502
1578
  */
1503
- // eslint-disable-next-line no-shadow
1579
+
1504
1580
  export enum RuntimeFilterOp {
1505
1581
  /**
1506
1582
  * Equals
@@ -1571,7 +1647,7 @@ export enum RuntimeFilterOp {
1571
1647
  * `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl).
1572
1648
  * @version SDK: 1.28.0 | ThoughtSpot: 9.12.5.cl, 10.1.0.sw
1573
1649
  */
1574
- // eslint-disable-next-line no-shadow
1650
+
1575
1651
  export enum HomepageModule {
1576
1652
  /**
1577
1653
  * Search bar
@@ -1604,7 +1680,7 @@ export enum HomepageModule {
1604
1680
  * **Note**: This option is applicable to full app embedding only.
1605
1681
  * @version SDK: 1.38.0 | ThoughtSpot: 10.9.0.cl
1606
1682
  */
1607
- // eslint-disable-next-line no-shadow
1683
+
1608
1684
  export enum ListPageColumns {
1609
1685
  /**
1610
1686
  * Favourite
@@ -1702,7 +1778,7 @@ export interface RuntimeParameter {
1702
1778
  * ```
1703
1779
  * @group Events
1704
1780
  */
1705
- // eslint-disable-next-line no-shadow
1781
+
1706
1782
  export enum EmbedEvent {
1707
1783
  /**
1708
1784
  * Rendering has initialized.
@@ -2345,6 +2421,11 @@ export enum EmbedEvent {
2345
2421
  * @hidden
2346
2422
  */
2347
2423
  APP_INIT = 'appInit',
2424
+ /**
2425
+ * Internal event to clear the cached info
2426
+ * @hidden
2427
+ */
2428
+ CLEAR_INFO_CACHE = 'clearInfoCache',
2348
2429
  /**
2349
2430
  * Emitted when a user clicks **Show Liveboard details** on a Liveboard
2350
2431
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
@@ -2693,25 +2774,25 @@ export enum EmbedEvent {
2693
2774
  * ```
2694
2775
  * @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl
2695
2776
  */
2696
- TableVizRendered = 'TableVizRendered',
2697
- /**
2698
- * Emitted when the liveboard is created from pin modal or Liveboard list page.
2699
- * You can use this event as a hook to trigger
2700
- * other events on liveboard creation.
2701
- *
2702
- * ```js
2703
- * liveboardEmbed.on(EmbedEvent.CreateLiveboard, (payload) => {
2704
- * console.log('payload', payload);
2705
- * })
2706
- *```
2707
- * @version SDK : 1.37.0 | ThoughtSpot: 10.8.0.cl
2708
- */
2777
+ TableVizRendered = 'TableVizRendered',
2778
+ /**
2779
+ * Emitted when the liveboard is created from pin modal or Liveboard list page.
2780
+ * You can use this event as a hook to trigger
2781
+ * other events on liveboard creation.
2782
+ *
2783
+ * ```js
2784
+ * liveboardEmbed.on(EmbedEvent.CreateLiveboard, (payload) => {
2785
+ * console.log('payload', payload);
2786
+ * })
2787
+ *```
2788
+ * @version SDK : 1.37.0 | ThoughtSpot: 10.8.0.cl
2789
+ */
2709
2790
  CreateLiveboard = 'createLiveboard',
2710
2791
  /**
2711
2792
  * Emitted when a user creates a Model.
2712
2793
  * @version SDK : 1.37.0 | ThoughtSpot: 10.8.0.cl
2713
2794
  */
2714
- CreateModel = 'createModel',
2795
+ CreateModel = 'createModel',
2715
2796
  /**
2716
2797
  * @hidden
2717
2798
  * Emitted when a user exits present mode.
@@ -2813,6 +2894,17 @@ export enum EmbedEvent {
2813
2894
  * ```
2814
2895
  */
2815
2896
  EmbedListenerReady = 'EmbedListenerReady',
2897
+ /**
2898
+ * Emitted when the organization is switched.
2899
+ * @example
2900
+ * ```js
2901
+ * appEmbed.on(EmbedEvent.OrgSwitched, (payload) => {
2902
+ * console.log('payload', payload);
2903
+ * })
2904
+ * ```
2905
+ * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
2906
+ */
2907
+ OrgSwitched = 'orgSwitched',
2816
2908
  }
2817
2909
 
2818
2910
  /**
@@ -2868,7 +2960,7 @@ export enum EmbedEvent {
2868
2960
  * ```
2869
2961
  * @group Events
2870
2962
  */
2871
- // eslint-disable-next-line no-shadow
2963
+
2872
2964
  export enum HostEvent {
2873
2965
  /**
2874
2966
  * Triggers a search operation with the search tokens specified in
@@ -3923,7 +4015,7 @@ export enum HostEvent {
3923
4015
  *```
3924
4016
  * @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
3925
4017
  */
3926
- InfoSuccess = 'InfoSuccess',
4018
+ InfoSuccess = 'InfoSuccess',
3927
4019
  /**
3928
4020
  * Trigger the save action for an Answer.
3929
4021
  * To programmatically save an answer without opening the
@@ -4077,24 +4169,13 @@ export enum HostEvent {
4077
4169
  * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
4078
4170
  */
4079
4171
  AskSpotter = 'AskSpotter',
4080
-
4081
- /**
4082
- * @hidden
4083
- * Triggers the update of the embed params.
4084
- *
4085
- * @example
4086
- * ```js
4087
- * liveboardEmbed.trigger(HostEvent.UpdateEmbedParams, viewConfig);
4088
- * ```
4089
- */
4090
- UpdateEmbedParams = 'updateEmbedParams',
4091
4172
  }
4092
4173
 
4093
4174
  /**
4094
4175
  * The different visual modes that the data sources panel within
4095
4176
  * search could appear in, such as hidden, collapsed, or expanded.
4096
4177
  */
4097
- // eslint-disable-next-line no-shadow
4178
+
4098
4179
  export enum DataSourceVisualMode {
4099
4180
  /**
4100
4181
  * The data source panel is hidden.
@@ -4114,7 +4195,7 @@ export enum DataSourceVisualMode {
4114
4195
  * The query params passed down to the embedded ThoughtSpot app
4115
4196
  * containing configuration and/or visual information.
4116
4197
  */
4117
- // eslint-disable-next-line no-shadow
4198
+
4118
4199
  export enum Param {
4119
4200
  EmbedApp = 'embedApp',
4120
4201
  DataSources = 'dataSources',
@@ -4193,6 +4274,7 @@ export enum Param {
4193
4274
  Query = 'query',
4194
4275
  HideHomepageLeftNav = 'hideHomepageLeftNav',
4195
4276
  ModularHomeExperienceEnabled = 'modularHomeExperience',
4277
+ HomepageVersion = 'homepageVersion',
4196
4278
  ListPageVersion = 'listpageVersion',
4197
4279
  PendoTrackingKey = 'additionalPendoKey',
4198
4280
  LiveboardHeaderSticky = 'isLiveboardHeaderSticky',
@@ -4233,7 +4315,8 @@ export enum Param {
4233
4315
  isSpotterAgentEmbed = 'isSpotterAgentEmbed',
4234
4316
  IsLiveboardStylingAndGroupingEnabled = 'isLiveboardStylingAndGroupingEnabled',
4235
4317
  IsLazyLoadingForEmbedEnabled = 'isLazyLoadingForEmbedEnabled',
4236
- RootMarginForLazyLoad = 'rootMarginForLazyLoad'
4318
+ RootMarginForLazyLoad = 'rootMarginForLazyLoad',
4319
+ LiveboardXLSXCSVDownload = 'isLiveboardXLSXCSVDownloadEnabled',
4237
4320
  }
4238
4321
 
4239
4322
  /**
@@ -4263,7 +4346,7 @@ export enum Param {
4263
4346
  * ```
4264
4347
  * See also link:https://developers.thoughtspot.com/docs/actions[Action IDs in the SDK]
4265
4348
  */
4266
- // eslint-disable-next-line no-shadow
4349
+
4267
4350
  export enum Action {
4268
4351
  /**
4269
4352
  * The **Save** action on an Answer or Liveboard.
@@ -4808,7 +4891,7 @@ export enum Action {
4808
4891
  * The Favorites icon (*) for Answers,
4809
4892
  * Liveboard, and data objects like Worksheet, Model,
4810
4893
  * Tables and Views.
4811
- * Allows adding an object to the users favorites list.
4894
+ * Allows adding an object to the user's favorites list.
4812
4895
  * @example
4813
4896
  * ```js
4814
4897
  * disabledActions: [Action.AddToFavorites]
@@ -5564,15 +5647,15 @@ export interface ColumnValue {
5564
5647
  [key: string]: any;
5565
5648
  };
5566
5649
  value:
5567
- | string
5568
- | number
5569
- | boolean
5570
- | {
5571
- v: {
5572
- s: number;
5573
- e: number;
5574
- };
5575
- };
5650
+ | string
5651
+ | number
5652
+ | boolean
5653
+ | {
5654
+ v: {
5655
+ s: number;
5656
+ e: number;
5657
+ };
5658
+ };
5576
5659
  }
5577
5660
 
5578
5661
  export interface VizPoint {
@@ -5604,6 +5687,44 @@ export interface CustomActionPayload {
5604
5687
  vizId?: string;
5605
5688
  }
5606
5689
 
5690
+ export interface CustomAction {
5691
+ name: string;
5692
+ id: string;
5693
+ position: CustomActionsPosition;
5694
+ target: CustomActionTarget;
5695
+ metadataIds?: {
5696
+ answerIds?: string[];
5697
+ liveboardIds?: string[];
5698
+ vizIds?: string[];
5699
+ };
5700
+ dataModelIds?: {
5701
+ modelIds?: string[];
5702
+ modelColumnNames?: string[];
5703
+ }
5704
+ orgIds?: string[];
5705
+ groupIds?: string[];
5706
+ }
5707
+
5708
+ /**
5709
+ * Enum options to show custom actions at different
5710
+ * positions in the application.
5711
+ */
5712
+ export enum CustomActionsPosition {
5713
+ PRIMARY = 'PRIMARY',
5714
+ MENU = 'MENU',
5715
+ CONTEXTMENU = 'CONTEXTMENU',
5716
+ }
5717
+
5718
+ /**
5719
+ * Enum options to mention the target of the custom action.
5720
+ */
5721
+ export enum CustomActionTarget {
5722
+ LIVEBOARD = 'LIVEBOARD',
5723
+ VIZ = 'VIZ',
5724
+ ANSWER = 'ANSWER',
5725
+ SPOTTER = 'SPOTTER',
5726
+ }
5727
+
5607
5728
  /**
5608
5729
  * Enum options to show or suppress Visual Embed SDK and
5609
5730
  * ThoughtSpot application logs in the console output.
@@ -5701,4 +5822,5 @@ export interface DefaultAppInitData {
5701
5822
  hiddenHomeLeftNavItems: string[];
5702
5823
  customVariablesForThirdPartyTools: Record<string, any>;
5703
5824
  hiddenListColumns: ListPageColumns[];
5825
+ customActions: CustomAction[];
5704
5826
  }