@thoughtspot/visual-embed-sdk 1.36.9-primaryAction → 1.37.0-temp-nav

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 (127) hide show
  1. package/cjs/package.json +1 -1
  2. package/cjs/src/auth.d.ts +2 -1
  3. package/cjs/src/auth.d.ts.map +1 -1
  4. package/cjs/src/auth.js +1 -0
  5. package/cjs/src/auth.js.map +1 -1
  6. package/cjs/src/embed/app.d.ts +76 -0
  7. package/cjs/src/embed/app.d.ts.map +1 -1
  8. package/cjs/src/embed/app.js +18 -1
  9. package/cjs/src/embed/app.js.map +1 -1
  10. package/cjs/src/embed/app.spec.js +50 -0
  11. package/cjs/src/embed/app.spec.js.map +1 -1
  12. package/cjs/src/embed/liveboard.d.ts +2 -2
  13. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  14. package/cjs/src/embed/ts-embed.js +3 -3
  15. package/cjs/src/embed/ts-embed.js.map +1 -1
  16. package/cjs/src/index.d.ts.map +1 -1
  17. package/cjs/src/index.js +1 -0
  18. package/cjs/src/index.js.map +1 -1
  19. package/cjs/src/react/index.d.ts.map +1 -1
  20. package/cjs/src/react/index.js +1 -0
  21. package/cjs/src/react/index.js.map +1 -1
  22. package/cjs/src/types.d.ts +54 -27
  23. package/cjs/src/types.d.ts.map +1 -1
  24. package/cjs/src/types.js +38 -9
  25. package/cjs/src/types.js.map +1 -1
  26. package/cjs/src/utils/graphql/answerService/answerService.d.ts +35 -15
  27. package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  28. package/cjs/src/utils/graphql/answerService/answerService.js +35 -15
  29. package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
  30. package/cjs/src/utils/processData.js +6 -4
  31. package/cjs/src/utils/processData.js.map +1 -1
  32. package/dist/{index-BEyovSez.js → index-Cj4BVGHL.js} +2 -1
  33. package/dist/{index-Dg18PU5Z.js → index-Fhk1V_Gw.js} +1 -0
  34. package/dist/src/auth.d.ts +2 -1
  35. package/dist/src/auth.d.ts.map +1 -1
  36. package/dist/src/embed/app.d.ts +76 -0
  37. package/dist/src/embed/app.d.ts.map +1 -1
  38. package/dist/src/embed/liveboard.d.ts +2 -2
  39. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  40. package/dist/src/index.d.ts.map +1 -1
  41. package/dist/src/react/index.d.ts.map +1 -1
  42. package/dist/src/types.d.ts +54 -27
  43. package/dist/src/types.d.ts.map +1 -1
  44. package/dist/src/utils/graphql/answerService/answerService.d.ts +35 -15
  45. package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  46. package/dist/tsembed-react.es.js +105 -35
  47. package/dist/tsembed-react.js +104 -34
  48. package/dist/tsembed.es.js +105 -35
  49. package/dist/tsembed.js +104 -34
  50. package/dist/visual-embed-sdk-react-full.d.ts +169 -45
  51. package/dist/visual-embed-sdk-react.d.ts +169 -45
  52. package/dist/visual-embed-sdk.d.ts +169 -45
  53. package/lib/package.json +1 -1
  54. package/lib/src/auth.d.ts +2 -1
  55. package/lib/src/auth.d.ts.map +1 -1
  56. package/lib/src/auth.js +1 -0
  57. package/lib/src/auth.js.map +1 -1
  58. package/lib/src/embed/app.d.ts +76 -0
  59. package/lib/src/embed/app.d.ts.map +1 -1
  60. package/lib/src/embed/app.js +18 -1
  61. package/lib/src/embed/app.js.map +1 -1
  62. package/lib/src/embed/app.spec.js +50 -0
  63. package/lib/src/embed/app.spec.js.map +1 -1
  64. package/lib/src/embed/liveboard.d.ts +2 -2
  65. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  66. package/lib/src/embed/ts-embed.js +3 -3
  67. package/lib/src/embed/ts-embed.js.map +1 -1
  68. package/lib/src/index.d.ts.map +1 -1
  69. package/lib/src/index.js +1 -0
  70. package/lib/src/index.js.map +1 -1
  71. package/lib/src/react/index.d.ts.map +1 -1
  72. package/lib/src/react/index.js +1 -0
  73. package/lib/src/react/index.js.map +1 -1
  74. package/lib/src/types.d.ts +54 -27
  75. package/lib/src/types.d.ts.map +1 -1
  76. package/lib/src/types.js +38 -9
  77. package/lib/src/types.js.map +1 -1
  78. package/lib/src/utils/graphql/answerService/answerService.d.ts +35 -15
  79. package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  80. package/lib/src/utils/graphql/answerService/answerService.js +35 -15
  81. package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
  82. package/lib/src/utils/processData.js +6 -4
  83. package/lib/src/utils/processData.js.map +1 -1
  84. package/lib/src/visual-embed-sdk.d.ts +169 -45
  85. package/package.json +1 -1
  86. package/src/auth.ts +2 -1
  87. package/src/embed/app.spec.ts +70 -0
  88. package/src/embed/app.ts +104 -0
  89. package/src/embed/liveboard.ts +2 -2
  90. package/src/embed/ts-embed.ts +3 -4
  91. package/src/index.ts +2 -0
  92. package/src/react/index.tsx +2 -0
  93. package/src/types.ts +54 -31
  94. package/src/utils/graphql/answerService/answerService.ts +35 -15
  95. package/src/utils/processData.ts +6 -6
  96. package/dist/index-BJx3m5_V.js +0 -7370
  97. package/dist/index-Do_T8J8z.js +0 -7370
  98. package/dist/src/pages/embed-test.page.d.ts +0 -8
  99. package/dist/src/pages/embed-test.page.d.ts.map +0 -1
  100. package/dist/src/pages/home.page.d.ts +0 -6
  101. package/dist/src/pages/home.page.d.ts.map +0 -1
  102. package/dist/src/pages/login.page.d.ts +0 -15
  103. package/dist/src/pages/login.page.d.ts.map +0 -1
  104. package/dist/src/tests/auth.test.d.ts +0 -1
  105. package/dist/src/tests/auth.test.d.ts.map +0 -1
  106. package/dist/src/tests/e2e/auth.spec.d.ts +0 -2
  107. package/dist/src/tests/e2e/auth.spec.d.ts.map +0 -1
  108. package/lib/src/pages/embed-test.page.d.ts +0 -8
  109. package/lib/src/pages/embed-test.page.d.ts.map +0 -1
  110. package/lib/src/pages/embed-test.page.js +0 -16
  111. package/lib/src/pages/embed-test.page.js.map +0 -1
  112. package/lib/src/pages/home.page.d.ts +0 -6
  113. package/lib/src/pages/home.page.d.ts.map +0 -1
  114. package/lib/src/pages/home.page.js +0 -8
  115. package/lib/src/pages/home.page.js.map +0 -1
  116. package/lib/src/pages/login.page.d.ts +0 -15
  117. package/lib/src/pages/login.page.d.ts.map +0 -1
  118. package/lib/src/pages/login.page.js +0 -18
  119. package/lib/src/pages/login.page.js.map +0 -1
  120. package/lib/src/tests/auth.test.d.ts +0 -1
  121. package/lib/src/tests/auth.test.d.ts.map +0 -1
  122. package/lib/src/tests/auth.test.js +0 -1
  123. package/lib/src/tests/auth.test.js.map +0 -1
  124. package/lib/src/tests/e2e/auth.spec.d.ts +0 -2
  125. package/lib/src/tests/e2e/auth.spec.d.ts.map +0 -1
  126. package/lib/src/tests/e2e/auth.spec.js +0 -52
  127. package/lib/src/tests/e2e/auth.spec.js.map +0 -1
package/src/types.ts CHANGED
@@ -204,7 +204,19 @@ export enum HomeLeftNavItem {
204
204
  /**
205
205
  * @version SDK: 1.34.0| ThoughtSpot: 10.3.0.cl
206
206
  */
207
- LiveboardSchedules = 'liveboard-schedules'
207
+ LiveboardSchedules = 'liveboard-schedules',
208
+ /**
209
+ * Create new options in the insights left navigation,
210
+ * available when new navigation V3 is enabled.
211
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
212
+ */
213
+ Create = 'create',
214
+ /**
215
+ * Spotter option in the insights left navigation,
216
+ * available when new navigation V3 is enabled.
217
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
218
+ */
219
+ Spotter = 'spotter',
208
220
  }
209
221
  export type DOMSelector = string | HTMLElement;
210
222
 
@@ -712,6 +724,19 @@ export interface ViewConfig {
712
724
  * ```
713
725
  */
714
726
  disabledActions?: Action[];
727
+ /**
728
+ * The primary action to display on top of the viz for Liveboard and App Embed.
729
+ * Use this to set the primary action.
730
+ * @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
731
+ * @example
732
+ * ```js
733
+ * const embed = new LiveboardEmbed('#embed', {
734
+ * ... // other liveboard view config
735
+ * primaryAction: Action.Download
736
+ * });
737
+ * ```
738
+ */
739
+ primaryAction?: Action | string;
715
740
  /**
716
741
  * The tooltip to display for disabled actions.
717
742
  * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
@@ -740,23 +765,6 @@ export interface ViewConfig {
740
765
  * @important
741
766
  */
742
767
  hiddenActions?: Action[];
743
-
744
- /**
745
- * The primary action to display from the embedded.
746
- * This action will be displayed from the embedded.
747
- * Use this to set the primary action.
748
- * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
749
- * @example
750
- * ```js
751
- * const embed = new LiveboardEmbed('#embed', {
752
- * ... // other liveboard view config
753
- * primaryAction: 'download'
754
- * });
755
- * ```
756
- * @important
757
- */
758
- primaryAction?: string;
759
-
760
768
  /**
761
769
  * The list of actions to display from the primary menu, more menu
762
770
  * (...), and the contextual menu. These will be only actions that
@@ -787,8 +795,6 @@ export interface ViewConfig {
787
795
  * })
788
796
  * ```
789
797
  */
790
-
791
-
792
798
  showAlerts?: boolean;
793
799
  /**
794
800
  * The list of runtime filters to apply to a search Answer,
@@ -1157,8 +1163,8 @@ export interface ViewConfig {
1157
1163
  * Hide list page columns
1158
1164
  * For example: hiddenListColumns = [ListPageColumns.Author]
1159
1165
  *
1160
- * **Note**: This option is appplicable only in full app embedding.
1161
- * @version SDK: 1.38.0 | ThoughtSpot: 9.12.5.cl, 10.1.0.sw
1166
+ * **Note**: This option is available only in full app embedding.
1167
+ * @version SDK: 1.38.0 | ThoughtSpot: 10.9.0.cl
1162
1168
  * @example
1163
1169
  * ```js
1164
1170
  * const embed = new AppEmbed('#tsEmbed', {
@@ -1330,8 +1336,8 @@ export enum HomepageModule {
1330
1336
 
1331
1337
  /**
1332
1338
  * List page columns that can be hidden.
1333
- * **Note**: This option is applicable only in full app embedding.
1334
- * @version SDK: 1.38.0 | ThoughtSpot: 9.12.5.cl, 10.1.0.sw
1339
+ * **Note**: This option is applicable to full app embedding only.
1340
+ * @version SDK: 1.38.0 | ThoughtSpot: 10.9.0.cl
1335
1341
  */
1336
1342
  // eslint-disable-next-line no-shadow
1337
1343
  export enum ListPageColumns {
@@ -2420,7 +2426,7 @@ export enum EmbedEvent {
2420
2426
  * searchEmbed.trigger(HostEvent.TransformTableVizData, columnDataLite);
2421
2427
  * })
2422
2428
  * ```
2423
- * @version SDK: 1.38.0 | ThoughtSpot: 10.8.0.cl
2429
+ * @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl
2424
2430
  */
2425
2431
  TableVizRendered = 'TableVizRendered',
2426
2432
  /**
@@ -2433,12 +2439,12 @@ export enum EmbedEvent {
2433
2439
  * console.log('payload', payload);
2434
2440
  * })
2435
2441
  *```
2436
- * @version SDK : 1.38.0 | ThoughtSpot : 10.8.0.cl
2442
+ * @version SDK : 1.37.0 | ThoughtSpot : 10.8.0.cl
2437
2443
  */
2438
2444
  CreateLiveboard = 'createLiveboard',
2439
2445
  /**
2440
2446
  * Emitted when a user creates a Model.
2441
- * @version SDK : 1.38.0 | ThoughtSpot : 10.8.0.cl
2447
+ * @version SDK : 1.37.0 | ThoughtSpot : 10.8.0.cl
2442
2448
  */
2443
2449
  CreateModel = 'createModel',
2444
2450
  }
@@ -2882,7 +2888,7 @@ export enum HostEvent {
2882
2888
  * ```js
2883
2889
  * liveboardEmbed.trigger(HostEvent.Remove)
2884
2890
  * ```
2885
- * @version SDK: 1.38.0 | ThoughtSpot: 10.8.0.cl, 10.10.0.sw
2891
+ * @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl, 10.10.0.sw
2886
2892
  */
2887
2893
  Remove = 'delete',
2888
2894
  /**
@@ -3343,8 +3349,17 @@ export enum HostEvent {
3343
3349
  /**
3344
3350
  * Get the Answer session for a Search or
3345
3351
  * Liveboard visualization.
3352
+ *
3353
+ * Note: This event is not typically used directly. Instead, use the
3354
+ * `getAnswerService()` method on the embed instance to get an AnswerService
3355
+ * object that provides a more convenient interface for working with answers.
3356
+ *
3346
3357
  * @example
3347
3358
  * ```js
3359
+ * // Preferred way to get an AnswerService
3360
+ * const service = await embed.getAnswerService();
3361
+ *
3362
+ * // Alternative direct usage (not recommended)
3348
3363
  * const {session} = await embed.trigger(
3349
3364
  * HostEvent.GetAnswerSession, {
3350
3365
  * vizId: '123', // For Liveboard Visualization.
@@ -3352,6 +3367,10 @@ export enum HostEvent {
3352
3367
  * ```
3353
3368
  * @example
3354
3369
  * ```js
3370
+ * // Preferred way to get an AnswerService
3371
+ * const service = await embed.getAnswerService();
3372
+ *
3373
+ * // Alternative direct usage (not recommended)
3355
3374
  * const {session} = await embed.trigger( HostEvent.GetAnswerSession )
3356
3375
  * ```
3357
3376
  * @version SDK: 1.26.0 | ThoughtSpot: 9.10.0.cl, 10.1.0.sw
@@ -3477,7 +3496,7 @@ export enum HostEvent {
3477
3496
  * searchEmbed.trigger(HostEvent.TransformTableVizData, columnDataLite);
3478
3497
  * })
3479
3498
  * ```
3480
- * @version SDK: 1.38.0 | ThoughtSpot: 10.8.0.cl
3499
+ * @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl
3481
3500
  */
3482
3501
  TransformTableVizData = 'TransformTableVizData',
3483
3502
  }
@@ -3560,6 +3579,10 @@ export enum Param {
3560
3579
  ShowInsertToSlide = 'insertInToSlide',
3561
3580
  PrimaryNavHidden = 'primaryNavHidden',
3562
3581
  HideProfleAndHelp = 'profileAndHelpInNavBarHidden',
3582
+ NavigationVersion = 'navigationVersion',
3583
+ HideHamburger = 'hideHamburger',
3584
+ HideObjectSearch = 'hideObjectSearch',
3585
+ HideNotification = 'hideNotification',
3563
3586
  HideApplicationSwitcher = 'applicationSwitcherHidden',
3564
3587
  HideOrgSwitcher = 'orgSwitcherHidden',
3565
3588
  IsSageEmbed = 'isSageEmbed',
@@ -4842,7 +4865,7 @@ export enum Action {
4842
4865
  * ```js
4843
4866
  * hiddenAction: [Action.ColumnRename]
4844
4867
  * ```
4845
- * @version SDK: 1.38.0 | ThoughtSpot Cloud: 10.8.0.cl
4868
+ * @version SDK: 1.37.0 | ThoughtSpot Cloud: 10.8.0.cl
4846
4869
  */
4847
4870
  ColumnRename = 'columnRename',
4848
4871
  /**
@@ -4852,7 +4875,7 @@ export enum Action {
4852
4875
  * ```js
4853
4876
  * hiddenAction: [Action.CoverAndFilterOptionInPDF]
4854
4877
  * ```
4855
- * @version SDK: 1.38.0 | ThoughtSpot Cloud: 10.8.0.cl
4878
+ * @version SDK: 1.37.0 | ThoughtSpot Cloud: 10.8.0.cl
4856
4879
  */
4857
4880
  CoverAndFilterOptionInPDF = 'coverAndFilterOptionInPDF',
4858
4881
  }
@@ -26,29 +26,49 @@ export interface UnderlyingDataPoint {
26
26
  }
27
27
 
28
28
  /**
29
- * Class representing the answer service provided with the
30
- * custom action payload. This service could be used to run
31
- * graphql queries in the context of the answer on which the
32
- * custom action was triggered.
29
+ * AnswerService provides a simple way to work with ThoughtSpot Answers.
30
+ *
31
+ * This service allows you to interact with ThoughtSpot Answers programmatically,
32
+ * making it easy to customize visualizations, filter data, and extract insights
33
+ * directly from your application.
34
+ *
35
+ * You can use this service to:
36
+ * - Add or remove columns from Answers (`addColumns`, `removeColumns`, `addColumnsByName`)
37
+ * - Apply filters to Answers (`addFilter`)
38
+ * - Get data from Answers in different formats (JSON, CSV, PNG) (`fetchData`, `fetchCSVBlob`, `fetchPNGBlob`)
39
+ * - Get data for specific points in visualizations (`getUnderlyingDataForPoint`)
40
+ * - Run custom queries (`executeQuery`)
41
+ * - Add visualizations to liveboards (`addDisplayedVizToLiveboard`)
42
+ *
33
43
  * @example
34
44
  * ```js
35
- * embed.on(EmbedEvent.CustomAction, e => {
36
- * const underlying = await e.answerService.getUnderlyingDataForPoint([
37
- * 'col name 1'
38
- * ]);
39
- * const data = await underlying.fetchData(0, 100);
40
- * })
45
+ * // Get the answer service
46
+ * embed.on(EmbedEvent.Data, async (e) => {
47
+ * const service = await embed.getAnswerService();
48
+ *
49
+ * // Add columns to the answer
50
+ * await service.addColumnsByName(["Sales", "Region"]);
51
+ *
52
+ * // Get the data
53
+ * const data = await service.fetchData();
54
+ * console.log(data);
55
+ * });
41
56
  * ```
57
+ *
42
58
  * @example
43
59
  * ```js
44
- * embed.on(EmbedEvent.Data, async (e) => {
45
- * const service = await embed.getAnswerService();
46
- * await service.addColumns([
47
- * "<column guid>"
60
+ * // Get data for a point in a visualization
61
+ * embed.on(EmbedEvent.CustomAction, async (e) => {
62
+ * const underlying = await e.answerService.getUnderlyingDataForPoint([
63
+ * 'Product Name',
64
+ * 'Sales Amount'
48
65
  * ]);
49
- * console.log(await service.fetchData());
66
+ *
67
+ * const data = await underlying.fetchData(0, 100);
68
+ * console.log(data);
50
69
  * });
51
70
  * ```
71
+ *
52
72
  * @version SDK: 1.25.0| ThoughtSpot: 9.10.0.cl
53
73
  * @group Events
54
74
  */
@@ -80,15 +80,15 @@ export function processAuthFailure(e: any, containerEl: Element) {
80
80
  const {
81
81
  loginFailedMessage, authType, disableLoginFailurePage, autoLogin,
82
82
  } = getEmbedConfig();
83
- if (
84
- autoLogin
85
- && (authType === AuthType.TrustedAuthToken
86
- || authType === AuthType.TrustedAuthTokenCookieless)
87
- ) {
83
+
84
+ const isEmbeddedSSO = authType === AuthType.EmbeddedSSO;
85
+ const isTrustedAuth = authType === AuthType.TrustedAuthToken || authType === AuthType.TrustedAuthTokenCookieless;
86
+ const isEmbeddedSSOInfoFailure = isEmbeddedSSO && e?.data?.type === AuthFailureType.UNAUTHENTICATED_FAILURE;
87
+ if (autoLogin && isTrustedAuth) {
88
88
  // eslint-disable-next-line no-param-reassign
89
89
  containerEl.innerHTML = loginFailedMessage;
90
90
  notifyAuthFailure(AuthFailureType.IDLE_SESSION_TIMEOUT);
91
- } else if (authType !== AuthType.None && !disableLoginFailurePage) {
91
+ } else if (authType !== AuthType.None && !disableLoginFailurePage && !isEmbeddedSSOInfoFailure) {
92
92
  // eslint-disable-next-line no-param-reassign
93
93
  containerEl.innerHTML = loginFailedMessage;
94
94
  notifyAuthFailure(AuthFailureType.OTHER);