@thoughtspot/visual-embed-sdk 1.42.1-HE2.0 → 1.42.1-HE2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/cjs/package.json +2 -2
  2. package/cjs/src/embed/conversation.d.ts +2 -0
  3. package/cjs/src/embed/conversation.d.ts.map +1 -1
  4. package/cjs/src/embed/conversation.js +4 -0
  5. package/cjs/src/embed/conversation.js.map +1 -1
  6. package/cjs/src/embed/hostEventClient/contracts.d.ts +5 -1
  7. package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  8. package/cjs/src/embed/hostEventClient/contracts.js +7 -2
  9. package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
  10. package/cjs/src/embed/liveboard.d.ts +2 -0
  11. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  12. package/cjs/src/embed/liveboard.js +4 -0
  13. package/cjs/src/embed/liveboard.js.map +1 -1
  14. package/cjs/src/embed/sage.d.ts +2 -0
  15. package/cjs/src/embed/sage.d.ts.map +1 -1
  16. package/cjs/src/embed/sage.js +4 -0
  17. package/cjs/src/embed/sage.js.map +1 -1
  18. package/cjs/src/embed/search-bar.d.ts +2 -0
  19. package/cjs/src/embed/search-bar.d.ts.map +1 -1
  20. package/cjs/src/embed/search-bar.js +4 -0
  21. package/cjs/src/embed/search-bar.js.map +1 -1
  22. package/cjs/src/embed/search.d.ts +2 -0
  23. package/cjs/src/embed/search.d.ts.map +1 -1
  24. package/cjs/src/embed/search.js +4 -0
  25. package/cjs/src/embed/search.js.map +1 -1
  26. package/cjs/src/embed/ts-embed.d.ts +1 -0
  27. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  28. package/cjs/src/embed/ts-embed.js +12 -0
  29. package/cjs/src/embed/ts-embed.js.map +1 -1
  30. package/cjs/src/types.d.ts +10 -1
  31. package/cjs/src/types.d.ts.map +1 -1
  32. package/cjs/src/types.js +9 -0
  33. package/cjs/src/types.js.map +1 -1
  34. package/dist/index-BFdRRz03.js +7371 -0
  35. package/dist/src/embed/conversation.d.ts +2 -0
  36. package/dist/src/embed/conversation.d.ts.map +1 -1
  37. package/dist/src/embed/hostEventClient/contracts.d.ts +5 -1
  38. package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  39. package/dist/src/embed/liveboard.d.ts +2 -0
  40. package/dist/src/embed/liveboard.d.ts.map +1 -1
  41. package/dist/src/embed/sage.d.ts +2 -0
  42. package/dist/src/embed/sage.d.ts.map +1 -1
  43. package/dist/src/embed/search-bar.d.ts +2 -0
  44. package/dist/src/embed/search-bar.d.ts.map +1 -1
  45. package/dist/src/embed/search.d.ts +2 -0
  46. package/dist/src/embed/search.d.ts.map +1 -1
  47. package/dist/src/embed/ts-embed.d.ts +1 -0
  48. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  49. package/dist/src/types.d.ts +10 -1
  50. package/dist/src/types.d.ts.map +1 -1
  51. package/dist/tsembed-react.es.js +66 -21
  52. package/dist/tsembed-react.js +65 -20
  53. package/dist/tsembed.es.js +66 -21
  54. package/dist/tsembed.js +65 -20
  55. package/dist/visual-embed-sdk-react-full.d.ts +39 -2
  56. package/dist/visual-embed-sdk-react.d.ts +39 -2
  57. package/dist/visual-embed-sdk.d.ts +39 -2
  58. package/lib/package.json +2 -2
  59. package/lib/src/embed/conversation.d.ts +2 -0
  60. package/lib/src/embed/conversation.d.ts.map +1 -1
  61. package/lib/src/embed/conversation.js +4 -0
  62. package/lib/src/embed/conversation.js.map +1 -1
  63. package/lib/src/embed/hostEventClient/contracts.d.ts +5 -1
  64. package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  65. package/lib/src/embed/hostEventClient/contracts.js +6 -1
  66. package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
  67. package/lib/src/embed/liveboard.d.ts +2 -0
  68. package/lib/src/embed/liveboard.d.ts.map +1 -1
  69. package/lib/src/embed/liveboard.js +4 -0
  70. package/lib/src/embed/liveboard.js.map +1 -1
  71. package/lib/src/embed/sage.d.ts +2 -0
  72. package/lib/src/embed/sage.d.ts.map +1 -1
  73. package/lib/src/embed/sage.js +4 -0
  74. package/lib/src/embed/sage.js.map +1 -1
  75. package/lib/src/embed/search-bar.d.ts +2 -0
  76. package/lib/src/embed/search-bar.d.ts.map +1 -1
  77. package/lib/src/embed/search-bar.js +4 -0
  78. package/lib/src/embed/search-bar.js.map +1 -1
  79. package/lib/src/embed/search.d.ts +2 -0
  80. package/lib/src/embed/search.d.ts.map +1 -1
  81. package/lib/src/embed/search.js +4 -0
  82. package/lib/src/embed/search.js.map +1 -1
  83. package/lib/src/embed/ts-embed.d.ts +1 -0
  84. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  85. package/lib/src/embed/ts-embed.js +12 -0
  86. package/lib/src/embed/ts-embed.js.map +1 -1
  87. package/lib/src/types.d.ts +10 -1
  88. package/lib/src/types.d.ts.map +1 -1
  89. package/lib/src/types.js +9 -0
  90. package/lib/src/types.js.map +1 -1
  91. package/package.json +2 -2
  92. package/src/embed/conversation.ts +7 -0
  93. package/src/embed/hostEventClient/contracts.ts +6 -1
  94. package/src/embed/liveboard.ts +6 -0
  95. package/src/embed/sage.ts +6 -0
  96. package/src/embed/search-bar.tsx +6 -0
  97. package/src/embed/search.ts +7 -0
  98. package/src/embed/ts-embed.ts +14 -0
  99. package/src/types.ts +10 -0
package/src/embed/sage.ts CHANGED
@@ -6,6 +6,7 @@
6
6
  * @author Mourya Balabhadra <mourya.balabhadra@thoughtspot.com>
7
7
  */
8
8
 
9
+ import { PageContextOptions } from 'visual-embed-sdk';
9
10
  import { DOMSelector, Param, BaseViewConfig, SearchLiveboardCommonViewConfig } from '../types';
10
11
  import { getQueryParamString } from '../utils';
11
12
  import { V1Embed } from './ts-embed';
@@ -229,4 +230,9 @@ export class SageEmbed extends V1Embed {
229
230
 
230
231
  return this;
231
232
  }
233
+
234
+ public async getCurrentContext(): Promise<PageContextOptions> {
235
+ const context = await super.getCurrentContext();
236
+ return context;
237
+ }
232
238
  }
@@ -2,6 +2,7 @@ import { SearchLiveboardCommonViewConfig, BaseViewConfig, DefaultAppInitData, Pa
2
2
  import { getQueryParamString } from '../utils';
3
3
  import { TsEmbed } from './ts-embed';
4
4
  import { SearchOptions } from './search';
5
+ import { PageContextOptions } from 'visual-embed-sdk';
5
6
 
6
7
  /**
7
8
  * @group Embed components
@@ -198,4 +199,9 @@ export class SearchBarEmbed extends TsEmbed {
198
199
  const defaultAppInitData = await super.getAppInitData();
199
200
  return { ...defaultAppInitData, ...this.getSearchInitData() };
200
201
  }
202
+
203
+ public async getCurrentContext(): Promise<PageContextOptions> {
204
+ const context = await super.getCurrentContext();
205
+ return context;
206
+ }
201
207
  }
@@ -26,6 +26,8 @@ import { ERROR_MESSAGE } from '../errors';
26
26
  import { getAuthPromise } from './base';
27
27
  import { getReleaseVersion } from '../auth';
28
28
  import { getEmbedConfig } from './embedConfig';
29
+ import { PageContextOptions } from 'visual-embed-sdk';
30
+ import { ContextType, PageType } from './hostEventClient/contracts';
29
31
 
30
32
  /**
31
33
  * Configuration for search options.
@@ -536,4 +538,9 @@ export class SearchEmbed extends TsEmbed {
536
538
  });
537
539
  return this;
538
540
  }
541
+
542
+ public async getCurrentContext(): Promise<PageContextOptions> {
543
+ const context = await super.getCurrentContext();
544
+ return context;
545
+ }
539
546
  }
@@ -16,6 +16,7 @@ import {
16
16
  UIPassthroughArrayResponse,
17
17
  UIPassthroughEvent,
18
18
  UIPassthroughRequest,
19
+ PageType,
19
20
  } from './hostEventClient/contracts';
20
21
  import { logger } from '../utils/logger';
21
22
  import { getAuthenticationToken } from '../authToken';
@@ -72,6 +73,7 @@ import { getEmbedConfig } from './embedConfig';
72
73
  import { ERROR_MESSAGE } from '../errors';
73
74
  import { getPreauthInfo } from '../utils/sessionInfoService';
74
75
  import { HostEventClient } from './hostEventClient/host-event-client';
76
+ import { PageContextOptions } from '../../visual-embed-sdk';
75
77
 
76
78
  const { version } = pkgInfo;
77
79
 
@@ -1338,6 +1340,18 @@ export class TsEmbed {
1338
1340
  return this.render();
1339
1341
  }
1340
1342
 
1343
+ public async getCurrentContext(): Promise<any> {
1344
+ this.executeAfterEmbedContainerLoaded(async () => {
1345
+ const context = await this.trigger(HostEvent.GetPageContext, {});
1346
+ return context;
1347
+ });
1348
+ return {
1349
+ page: ContextType.Default,
1350
+ pageType: PageType.PAGE,
1351
+ objectIds: {},
1352
+ };
1353
+ }
1354
+
1341
1355
  /**
1342
1356
  * Creates the preRender shell
1343
1357
  * @param showPreRenderByDefault - Show the preRender after render, hidden by default
package/src/types.ts CHANGED
@@ -4257,6 +4257,16 @@ export enum HostEvent {
4257
4257
  * ```
4258
4258
  */
4259
4259
  UpdateEmbedParams = 'updateEmbedParams',
4260
+
4261
+ /**
4262
+ * @hidden
4263
+ * Triggers the get of the page context.
4264
+ * @example
4265
+ * ```js
4266
+ * liveboardEmbed.trigger(HostEvent.GetPageContext);
4267
+ * ```
4268
+ */
4269
+ GetPageContext = 'GetPageContext',
4260
4270
  }
4261
4271
 
4262
4272
  /**