@thoughtspot/visual-embed-sdk 1.37.0 → 1.37.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 (95) hide show
  1. package/cjs/package.json +2 -2
  2. package/cjs/src/auth.d.ts +9 -4
  3. package/cjs/src/auth.d.ts.map +1 -1
  4. package/cjs/src/auth.js +21 -0
  5. package/cjs/src/auth.js.map +1 -1
  6. package/cjs/src/auth.spec.js +48 -0
  7. package/cjs/src/auth.spec.js.map +1 -1
  8. package/cjs/src/embed/app.d.ts +99 -0
  9. package/cjs/src/embed/app.d.ts.map +1 -1
  10. package/cjs/src/embed/app.js +48 -3
  11. package/cjs/src/embed/app.js.map +1 -1
  12. package/cjs/src/embed/app.spec.js +61 -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 +7 -0
  16. package/cjs/src/embed/base.js.map +1 -1
  17. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  18. package/cjs/src/embed/ts-embed.js +10 -5
  19. package/cjs/src/embed/ts-embed.js.map +1 -1
  20. package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
  21. package/cjs/src/embed/ts-embed.spec.js +105 -0
  22. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  23. package/cjs/src/types.d.ts +69 -4
  24. package/cjs/src/types.d.ts.map +1 -1
  25. package/cjs/src/types.js +54 -2
  26. package/cjs/src/types.js.map +1 -1
  27. package/cjs/src/utils/graphql/answerService/answerService.d.ts +35 -15
  28. package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  29. package/cjs/src/utils/graphql/answerService/answerService.js +35 -15
  30. package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
  31. package/cjs/src/utils/processData.js +6 -4
  32. package/cjs/src/utils/processData.js.map +1 -1
  33. package/dist/{index-DnIvX1FR.js → index-m9UtENc9.js} +1 -1
  34. package/dist/src/auth.d.ts +9 -4
  35. package/dist/src/auth.d.ts.map +1 -1
  36. package/dist/src/embed/app.d.ts +99 -0
  37. package/dist/src/embed/app.d.ts.map +1 -1
  38. package/dist/src/embed/base.d.ts.map +1 -1
  39. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  40. package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
  41. package/dist/src/types.d.ts +69 -4
  42. package/dist/src/types.d.ts.map +1 -1
  43. package/dist/src/utils/graphql/answerService/answerService.d.ts +35 -15
  44. package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  45. package/dist/tsembed-react.es.js +183 -31
  46. package/dist/tsembed-react.js +182 -30
  47. package/dist/tsembed.es.js +183 -31
  48. package/dist/tsembed.js +182 -30
  49. package/dist/visual-embed-sdk-react-full.d.ts +212 -23
  50. package/dist/visual-embed-sdk-react.d.ts +212 -23
  51. package/dist/visual-embed-sdk.d.ts +212 -23
  52. package/lib/package.json +2 -2
  53. package/lib/src/auth.d.ts +9 -4
  54. package/lib/src/auth.d.ts.map +1 -1
  55. package/lib/src/auth.js +21 -0
  56. package/lib/src/auth.js.map +1 -1
  57. package/lib/src/auth.spec.js +48 -0
  58. package/lib/src/auth.spec.js.map +1 -1
  59. package/lib/src/embed/app.d.ts +99 -0
  60. package/lib/src/embed/app.d.ts.map +1 -1
  61. package/lib/src/embed/app.js +47 -2
  62. package/lib/src/embed/app.js.map +1 -1
  63. package/lib/src/embed/app.spec.js +62 -1
  64. package/lib/src/embed/app.spec.js.map +1 -1
  65. package/lib/src/embed/base.d.ts.map +1 -1
  66. package/lib/src/embed/base.js +7 -0
  67. package/lib/src/embed/base.js.map +1 -1
  68. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  69. package/lib/src/embed/ts-embed.js +10 -5
  70. package/lib/src/embed/ts-embed.js.map +1 -1
  71. package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
  72. package/lib/src/embed/ts-embed.spec.js +105 -0
  73. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  74. package/lib/src/types.d.ts +69 -4
  75. package/lib/src/types.d.ts.map +1 -1
  76. package/lib/src/types.js +54 -2
  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 +212 -23
  85. package/package.json +2 -2
  86. package/src/auth.spec.ts +52 -0
  87. package/src/auth.ts +25 -3
  88. package/src/embed/app.spec.ts +88 -0
  89. package/src/embed/app.ts +133 -0
  90. package/src/embed/base.ts +9 -0
  91. package/src/embed/ts-embed.spec.ts +130 -0
  92. package/src/embed/ts-embed.ts +10 -4
  93. package/src/types.ts +68 -3
  94. package/src/utils/graphql/answerService/answerService.ts +35 -15
  95. package/src/utils/processData.ts +6 -6
@@ -289,7 +289,8 @@ export declare enum AuthFailureType {
289
289
  NO_COOKIE_ACCESS = "NO_COOKIE_ACCESS",
290
290
  EXPIRY = "EXPIRY",
291
291
  OTHER = "OTHER",
292
- IDLE_SESSION_TIMEOUT = "IDLE_SESSION_TIMEOUT"
292
+ IDLE_SESSION_TIMEOUT = "IDLE_SESSION_TIMEOUT",
293
+ UNAUTHENTICATED_FAILURE = "UNAUTHENTICATED_FAILURE"
293
294
  }
294
295
  /**
295
296
  * Enum for auth status emitted by the emitter returned from {@link init}.
@@ -323,7 +324,11 @@ export declare enum AuthStatus {
323
324
  * or by the trigger button.
324
325
  * @version SDK: 1.19.0
325
326
  */
326
- WAITING_FOR_POPUP = "WAITING_FOR_POPUP"
327
+ WAITING_FOR_POPUP = "WAITING_FOR_POPUP",
328
+ /**
329
+ * Emitted when the SAML popup is closed without authentication
330
+ */
331
+ SAML_POPUP_CLOSED_NO_AUTH = "SAML_POPUP_CLOSED_NO_AUTH"
327
332
  }
328
333
  /**
329
334
  * Event emitter returned from {@link init}.
@@ -341,10 +346,10 @@ export interface AuthEventEmitter {
341
346
  * @param event
342
347
  * @param listener
343
348
  */
344
- on(event: AuthStatus.SDK_SUCCESS | AuthStatus.LOGOUT | AuthStatus.WAITING_FOR_POPUP, listener: () => void): this;
349
+ on(event: AuthStatus.SDK_SUCCESS | AuthStatus.LOGOUT | AuthStatus.WAITING_FOR_POPUP | AuthStatus.SAML_POPUP_CLOSED_NO_AUTH, listener: () => void): this;
345
350
  on(event: AuthStatus.SUCCESS, listener: (sessionInfo: any) => void): this;
346
351
  once(event: AuthStatus.FAILURE, listener: (failureType: AuthFailureType) => void): this;
347
- once(event: AuthStatus.SDK_SUCCESS | AuthStatus.LOGOUT | AuthStatus.WAITING_FOR_POPUP, listener: () => void): this;
352
+ once(event: AuthStatus.SDK_SUCCESS | AuthStatus.LOGOUT | AuthStatus.WAITING_FOR_POPUP | AuthStatus.SAML_POPUP_CLOSED_NO_AUTH, listener: () => void): this;
348
353
  once(event: AuthStatus.SUCCESS, listener: (sessionInfo: any) => void): this;
349
354
  /**
350
355
  * Trigger an event on the emitter returned from init.
@@ -1072,6 +1077,43 @@ export declare enum HomePageSearchBarMode {
1072
1077
  AI_ANSWER = "aiAnswer",
1073
1078
  NONE = "none"
1074
1079
  }
1080
+ /**
1081
+ * Define the version of the primary navbar
1082
+ * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
1083
+ */
1084
+ export declare enum PrimaryNavbarVersion {
1085
+ /**
1086
+ * Sliding (v3) introduces a new left-side navigation hub featuring a tab switcher,
1087
+ * along with updates to the top navigation bar.
1088
+ * It serves as the foundational version of the PrimaryNavBar.
1089
+ */
1090
+ Sliding = "v3"
1091
+ }
1092
+ /**
1093
+ * Define the version of the home page
1094
+ * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
1095
+ */
1096
+ export declare enum HomePage {
1097
+ /**
1098
+ * Modular (v2) introduces the updated Modular Home Experience.
1099
+ * It serves as the foundational version of the home page.
1100
+ */
1101
+ Modular = "v2"
1102
+ }
1103
+ /**
1104
+ * Define the discovery experience
1105
+ * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
1106
+ */
1107
+ export interface DiscoveryExperience {
1108
+ /**
1109
+ * primaryNavbarVersion determines the version of the navigation version.
1110
+ */
1111
+ primaryNavbarVersion?: PrimaryNavbarVersion;
1112
+ /**
1113
+ * homePage determines the version of the home page.
1114
+ */
1115
+ homePage?: HomePage;
1116
+ }
1075
1117
  /**
1076
1118
  * The view configuration for full app embedding.
1077
1119
  * @group Embed components
@@ -1140,6 +1182,51 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
1140
1182
  * ```
1141
1183
  */
1142
1184
  enablePendoHelp?: boolean;
1185
+ /**
1186
+ * Control the visibility of the hamburger icon on the top nav bar
1187
+ * available when new navigation V3 is enabled.
1188
+ *
1189
+ * @default false
1190
+ * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
1191
+ * @example
1192
+ * ```js
1193
+ * const embed = new AppEmbed('#tsEmbed', {
1194
+ * ... // other options
1195
+ * hideHamburger : true,
1196
+ * })
1197
+ * ```
1198
+ */
1199
+ hideHamburger?: boolean;
1200
+ /**
1201
+ * Control the visibility of the Eureka search on the top nav bar
1202
+ * this will control for both new V2 and new navigation V3.
1203
+ *
1204
+ * @default true
1205
+ * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
1206
+ * @example
1207
+ * ```js
1208
+ * const embed = new AppEmbed('#tsEmbed', {
1209
+ * ... // other options
1210
+ * hideObjectSearch: false,
1211
+ * })
1212
+ * ```
1213
+ */
1214
+ hideObjectSearch?: boolean;
1215
+ /**
1216
+ * Control the visibility of the notification on the top nav bar V3,
1217
+ * available when new navigation V3 is enabled.
1218
+ *
1219
+ * @default true
1220
+ * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
1221
+ * @example
1222
+ * ```js
1223
+ * const embed = new AppEmbed('#tsEmbed', {
1224
+ * ... // other options
1225
+ * hideNotification: false,
1226
+ * })
1227
+ * ```
1228
+ */
1229
+ hideNotification?: boolean;
1143
1230
  /**
1144
1231
  * Control the visibility of the application switcher button on the nav-bar.
1145
1232
  * By default, the application switcher is shown.
@@ -1333,6 +1420,23 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
1333
1420
  * ```
1334
1421
  */
1335
1422
  modularHomeExperience?: boolean;
1423
+ /**
1424
+ * To configure the top-left navigation and home page experience
1425
+ *
1426
+ * @default false
1427
+ * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
1428
+ * @example
1429
+ * ```js
1430
+ * const embed = new AppEmbed('#tsEmbed', {
1431
+ * ... // other options
1432
+ * discoveryExperience : {
1433
+ * primaryNavbarVersion: PrimaryNavbarVersion.Sliding,
1434
+ * homePage: HompePage.Modular,
1435
+ * },
1436
+ * })
1437
+ * ```
1438
+ */
1439
+ discoveryExperience?: DiscoveryExperience;
1336
1440
  /**
1337
1441
  * Boolean to control if Liveboard header is sticky or not.
1338
1442
  * @example
@@ -2144,7 +2248,19 @@ export declare enum HomeLeftNavItem {
2144
2248
  /**
2145
2249
  * @version SDK: 1.34.0| ThoughtSpot: 10.3.0.cl
2146
2250
  */
2147
- LiveboardSchedules = "liveboard-schedules"
2251
+ LiveboardSchedules = "liveboard-schedules",
2252
+ /**
2253
+ * Create new options in the insights left navigation,
2254
+ * available when new navigation V3 is enabled.
2255
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
2256
+ */
2257
+ Create = "create",
2258
+ /**
2259
+ * Spotter option in the insights left navigation,
2260
+ * available when new navigation V3 is enabled.
2261
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
2262
+ */
2263
+ Spotter = "spotter"
2148
2264
  }
2149
2265
  export type DOMSelector = string | HTMLElement;
2150
2266
  /**
@@ -2625,6 +2741,19 @@ export interface ViewConfig {
2625
2741
  * ```
2626
2742
  */
2627
2743
  disabledActions?: Action[];
2744
+ /**
2745
+ * The primary action to display on top of the viz for Liveboard and App Embed.
2746
+ * Use this to set the primary action.
2747
+ * @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
2748
+ * @example
2749
+ * ```js
2750
+ * const embed = new LiveboardEmbed('#embed', {
2751
+ * ... // other liveboard view config
2752
+ * primaryAction: Action.Download
2753
+ * });
2754
+ * ```
2755
+ */
2756
+ primaryAction?: Action | string;
2628
2757
  /**
2629
2758
  * The tooltip to display for disabled actions.
2630
2759
  * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
@@ -4544,9 +4673,12 @@ export declare enum HostEvent {
4544
4673
  * @example
4545
4674
  * ```js
4546
4675
  * searchEmbed.trigger(HostEvent.OpenFilter,
4547
- * { columnId: '<column-GUID>', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE'})
4676
+ * {column: { columnId: '<column-GUID>', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE'}})
4677
+ * ```
4678
+ * @example
4679
+ * ```js
4548
4680
  * LiveboardEmbed.trigger(HostEvent.OpenFilter,
4549
- * { columnId: '<column-GUID>'})
4681
+ * { column: {columnId: '<column-GUID>'}})
4550
4682
  * ```
4551
4683
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
4552
4684
  */
@@ -5155,6 +5287,25 @@ export declare enum HostEvent {
5155
5287
  * }]
5156
5288
  * });
5157
5289
  * ```
5290
+ * If there are multiple columns with the same name, consider
5291
+ * using `WORKSHEET_NAME::COLUMN_NAME` format.
5292
+ *
5293
+ * @example
5294
+ *
5295
+ * ```js
5296
+ * liveboardEmbed.trigger(HostEvent.UpdateFilters, {
5297
+ * filters: [{
5298
+ * column: "(Sample) Retail - Apparel::city",
5299
+ * oper: 'IN',
5300
+ * values: ["atlanta"]
5301
+ * },
5302
+ * {
5303
+ * column: "(Sample) Retail - Apparel::Region",
5304
+ * oper: 'IN',
5305
+ * values: ["West","Midwest"]
5306
+ * }]
5307
+ * });
5308
+ * ```
5158
5309
  * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
5159
5310
  */
5160
5311
  UpdateFilters = "updateFilters",
@@ -5214,8 +5365,17 @@ export declare enum HostEvent {
5214
5365
  /**
5215
5366
  * Get the Answer session for a Search or
5216
5367
  * Liveboard visualization.
5368
+ *
5369
+ * Note: This event is not typically used directly. Instead, use the
5370
+ * `getAnswerService()` method on the embed instance to get an AnswerService
5371
+ * object that provides a more convenient interface for working with answers.
5372
+ *
5217
5373
  * @example
5218
5374
  * ```js
5375
+ * // Preferred way to get an AnswerService
5376
+ * const service = await embed.getAnswerService();
5377
+ *
5378
+ * // Alternative direct usage (not recommended)
5219
5379
  * const {session} = await embed.trigger(
5220
5380
  * HostEvent.GetAnswerSession, {
5221
5381
  * vizId: '123', // For Liveboard Visualization.
@@ -5223,6 +5383,10 @@ export declare enum HostEvent {
5223
5383
  * ```
5224
5384
  * @example
5225
5385
  * ```js
5386
+ * // Preferred way to get an AnswerService
5387
+ * const service = await embed.getAnswerService();
5388
+ *
5389
+ * // Alternative direct usage (not recommended)
5226
5390
  * const {session} = await embed.trigger( HostEvent.GetAnswerSession )
5227
5391
  * ```
5228
5392
  * @version SDK: 1.26.0 | ThoughtSpot: 9.10.0.cl, 10.1.0.sw
@@ -5421,6 +5585,10 @@ export declare enum Param {
5421
5585
  ShowInsertToSlide = "insertInToSlide",
5422
5586
  PrimaryNavHidden = "primaryNavHidden",
5423
5587
  HideProfleAndHelp = "profileAndHelpInNavBarHidden",
5588
+ NavigationVersion = "navigationVersion",
5589
+ HideHamburger = "hideHamburger",
5590
+ HideObjectSearch = "hideObjectSearch",
5591
+ HideNotification = "hideNotification",
5424
5592
  HideApplicationSwitcher = "applicationSwitcherHidden",
5425
5593
  HideOrgSwitcher = "orgSwitcherHidden",
5426
5594
  IsSageEmbed = "isSageEmbed",
@@ -5476,7 +5644,8 @@ export declare enum Param {
5476
5644
  DataSourceId = "dataSourceId",
5477
5645
  preAuthCache = "preAuthCache",
5478
5646
  ShowSpotterLimitations = "showSpotterLimitations",
5479
- CoverAndFilterOptionInPDF = "coverAndFilterOptionInPDF"
5647
+ CoverAndFilterOptionInPDF = "coverAndFilterOptionInPDF",
5648
+ PrimaryAction = "primaryAction"
5480
5649
  }
5481
5650
  /**
5482
5651
  * ThoughtSpot application pages include actions and menu commands
@@ -7690,29 +7859,49 @@ export interface UnderlyingDataPoint {
7690
7859
  dataValue: any;
7691
7860
  }
7692
7861
  /**
7693
- * Class representing the answer service provided with the
7694
- * custom action payload. This service could be used to run
7695
- * graphql queries in the context of the answer on which the
7696
- * custom action was triggered.
7862
+ * AnswerService provides a simple way to work with ThoughtSpot Answers.
7863
+ *
7864
+ * This service allows you to interact with ThoughtSpot Answers programmatically,
7865
+ * making it easy to customize visualizations, filter data, and extract insights
7866
+ * directly from your application.
7867
+ *
7868
+ * You can use this service to:
7869
+ * - Add or remove columns from Answers (`addColumns`, `removeColumns`, `addColumnsByName`)
7870
+ * - Apply filters to Answers (`addFilter`)
7871
+ * - Get data from Answers in different formats (JSON, CSV, PNG) (`fetchData`, `fetchCSVBlob`, `fetchPNGBlob`)
7872
+ * - Get data for specific points in visualizations (`getUnderlyingDataForPoint`)
7873
+ * - Run custom queries (`executeQuery`)
7874
+ * - Add visualizations to liveboards (`addDisplayedVizToLiveboard`)
7875
+ *
7697
7876
  * @example
7698
7877
  * ```js
7699
- * embed.on(EmbedEvent.CustomAction, e => {
7700
- * const underlying = await e.answerService.getUnderlyingDataForPoint([
7701
- * 'col name 1'
7702
- * ]);
7703
- * const data = await underlying.fetchData(0, 100);
7704
- * })
7878
+ * // Get the answer service
7879
+ * embed.on(EmbedEvent.Data, async (e) => {
7880
+ * const service = await embed.getAnswerService();
7881
+ *
7882
+ * // Add columns to the answer
7883
+ * await service.addColumnsByName(["Sales", "Region"]);
7884
+ *
7885
+ * // Get the data
7886
+ * const data = await service.fetchData();
7887
+ * console.log(data);
7888
+ * });
7705
7889
  * ```
7890
+ *
7706
7891
  * @example
7707
7892
  * ```js
7708
- * embed.on(EmbedEvent.Data, async (e) => {
7709
- * const service = await embed.getAnswerService();
7710
- * await service.addColumns([
7711
- * "<column guid>"
7893
+ * // Get data for a point in a visualization
7894
+ * embed.on(EmbedEvent.CustomAction, async (e) => {
7895
+ * const underlying = await e.answerService.getUnderlyingDataForPoint([
7896
+ * 'Product Name',
7897
+ * 'Sales Amount'
7712
7898
  * ]);
7713
- * console.log(await service.fetchData());
7899
+ *
7900
+ * const data = await underlying.fetchData(0, 100);
7901
+ * console.log(data);
7714
7902
  * });
7715
7903
  * ```
7904
+ *
7716
7905
  * @version SDK: 1.25.0| ThoughtSpot: 9.10.0.cl
7717
7906
  * @group Events
7718
7907
  */