@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
@@ -279,7 +279,8 @@ export declare enum AuthFailureType {
279
279
  NO_COOKIE_ACCESS = "NO_COOKIE_ACCESS",
280
280
  EXPIRY = "EXPIRY",
281
281
  OTHER = "OTHER",
282
- IDLE_SESSION_TIMEOUT = "IDLE_SESSION_TIMEOUT"
282
+ IDLE_SESSION_TIMEOUT = "IDLE_SESSION_TIMEOUT",
283
+ UNAUTHENTICATED_FAILURE = "UNAUTHENTICATED_FAILURE"
283
284
  }
284
285
  /**
285
286
  * Enum for auth status emitted by the emitter returned from {@link init}.
@@ -313,7 +314,11 @@ export declare enum AuthStatus {
313
314
  * or by the trigger button.
314
315
  * @version SDK: 1.19.0
315
316
  */
316
- WAITING_FOR_POPUP = "WAITING_FOR_POPUP"
317
+ WAITING_FOR_POPUP = "WAITING_FOR_POPUP",
318
+ /**
319
+ * Emitted when the SAML popup is closed without authentication
320
+ */
321
+ SAML_POPUP_CLOSED_NO_AUTH = "SAML_POPUP_CLOSED_NO_AUTH"
317
322
  }
318
323
  /**
319
324
  * Event emitter returned from {@link init}.
@@ -331,10 +336,10 @@ export interface AuthEventEmitter {
331
336
  * @param event
332
337
  * @param listener
333
338
  */
334
- on(event: AuthStatus.SDK_SUCCESS | AuthStatus.LOGOUT | AuthStatus.WAITING_FOR_POPUP, listener: () => void): this;
339
+ on(event: AuthStatus.SDK_SUCCESS | AuthStatus.LOGOUT | AuthStatus.WAITING_FOR_POPUP | AuthStatus.SAML_POPUP_CLOSED_NO_AUTH, listener: () => void): this;
335
340
  on(event: AuthStatus.SUCCESS, listener: (sessionInfo: any) => void): this;
336
341
  once(event: AuthStatus.FAILURE, listener: (failureType: AuthFailureType) => void): this;
337
- once(event: AuthStatus.SDK_SUCCESS | AuthStatus.LOGOUT | AuthStatus.WAITING_FOR_POPUP, listener: () => void): this;
342
+ once(event: AuthStatus.SDK_SUCCESS | AuthStatus.LOGOUT | AuthStatus.WAITING_FOR_POPUP | AuthStatus.SAML_POPUP_CLOSED_NO_AUTH, listener: () => void): this;
338
343
  once(event: AuthStatus.SUCCESS, listener: (sessionInfo: any) => void): this;
339
344
  /**
340
345
  * Trigger an event on the emitter returned from init.
@@ -1062,6 +1067,43 @@ export declare enum HomePageSearchBarMode {
1062
1067
  AI_ANSWER = "aiAnswer",
1063
1068
  NONE = "none"
1064
1069
  }
1070
+ /**
1071
+ * Define the version of the primary navbar
1072
+ * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
1073
+ */
1074
+ export declare enum PrimaryNavbarVersion {
1075
+ /**
1076
+ * Sliding (v3) introduces a new left-side navigation hub featuring a tab switcher,
1077
+ * along with updates to the top navigation bar.
1078
+ * It serves as the foundational version of the PrimaryNavBar.
1079
+ */
1080
+ Sliding = "v3"
1081
+ }
1082
+ /**
1083
+ * Define the version of the home page
1084
+ * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
1085
+ */
1086
+ export declare enum HomePage {
1087
+ /**
1088
+ * Modular (v2) introduces the updated Modular Home Experience.
1089
+ * It serves as the foundational version of the home page.
1090
+ */
1091
+ Modular = "v2"
1092
+ }
1093
+ /**
1094
+ * Define the discovery experience
1095
+ * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
1096
+ */
1097
+ export interface DiscoveryExperience {
1098
+ /**
1099
+ * primaryNavbarVersion determines the version of the navigation version.
1100
+ */
1101
+ primaryNavbarVersion?: PrimaryNavbarVersion;
1102
+ /**
1103
+ * homePage determines the version of the home page.
1104
+ */
1105
+ homePage?: HomePage;
1106
+ }
1065
1107
  /**
1066
1108
  * The view configuration for full app embedding.
1067
1109
  * @group Embed components
@@ -1130,6 +1172,51 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
1130
1172
  * ```
1131
1173
  */
1132
1174
  enablePendoHelp?: boolean;
1175
+ /**
1176
+ * Control the visibility of the hamburger icon on the top nav bar
1177
+ * available when new navigation V3 is enabled.
1178
+ *
1179
+ * @default false
1180
+ * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
1181
+ * @example
1182
+ * ```js
1183
+ * const embed = new AppEmbed('#tsEmbed', {
1184
+ * ... // other options
1185
+ * hideHamburger : true,
1186
+ * })
1187
+ * ```
1188
+ */
1189
+ hideHamburger?: boolean;
1190
+ /**
1191
+ * Control the visibility of the Eureka search on the top nav bar
1192
+ * this will control for both new V2 and new navigation V3.
1193
+ *
1194
+ * @default true
1195
+ * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
1196
+ * @example
1197
+ * ```js
1198
+ * const embed = new AppEmbed('#tsEmbed', {
1199
+ * ... // other options
1200
+ * hideObjectSearch: false,
1201
+ * })
1202
+ * ```
1203
+ */
1204
+ hideObjectSearch?: boolean;
1205
+ /**
1206
+ * Control the visibility of the notification on the top nav bar V3,
1207
+ * available when new navigation V3 is enabled.
1208
+ *
1209
+ * @default true
1210
+ * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
1211
+ * @example
1212
+ * ```js
1213
+ * const embed = new AppEmbed('#tsEmbed', {
1214
+ * ... // other options
1215
+ * hideNotification: false,
1216
+ * })
1217
+ * ```
1218
+ */
1219
+ hideNotification?: boolean;
1133
1220
  /**
1134
1221
  * Control the visibility of the application switcher button on the nav-bar.
1135
1222
  * By default, the application switcher is shown.
@@ -1323,6 +1410,23 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
1323
1410
  * ```
1324
1411
  */
1325
1412
  modularHomeExperience?: boolean;
1413
+ /**
1414
+ * To configure the top-left navigation and home page experience
1415
+ *
1416
+ * @default false
1417
+ * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
1418
+ * @example
1419
+ * ```js
1420
+ * const embed = new AppEmbed('#tsEmbed', {
1421
+ * ... // other options
1422
+ * discoveryExperience : {
1423
+ * primaryNavbarVersion: PrimaryNavbarVersion.Sliding,
1424
+ * homePage: HompePage.Modular,
1425
+ * },
1426
+ * })
1427
+ * ```
1428
+ */
1429
+ discoveryExperience?: DiscoveryExperience;
1326
1430
  /**
1327
1431
  * Boolean to control if Liveboard header is sticky or not.
1328
1432
  * @example
@@ -2134,7 +2238,19 @@ export declare enum HomeLeftNavItem {
2134
2238
  /**
2135
2239
  * @version SDK: 1.34.0| ThoughtSpot: 10.3.0.cl
2136
2240
  */
2137
- LiveboardSchedules = "liveboard-schedules"
2241
+ LiveboardSchedules = "liveboard-schedules",
2242
+ /**
2243
+ * Create new options in the insights left navigation,
2244
+ * available when new navigation V3 is enabled.
2245
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
2246
+ */
2247
+ Create = "create",
2248
+ /**
2249
+ * Spotter option in the insights left navigation,
2250
+ * available when new navigation V3 is enabled.
2251
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
2252
+ */
2253
+ Spotter = "spotter"
2138
2254
  }
2139
2255
  export type DOMSelector = string | HTMLElement;
2140
2256
  /**
@@ -2615,6 +2731,19 @@ export interface ViewConfig {
2615
2731
  * ```
2616
2732
  */
2617
2733
  disabledActions?: Action[];
2734
+ /**
2735
+ * The primary action to display on top of the viz for Liveboard and App Embed.
2736
+ * Use this to set the primary action.
2737
+ * @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
2738
+ * @example
2739
+ * ```js
2740
+ * const embed = new LiveboardEmbed('#embed', {
2741
+ * ... // other liveboard view config
2742
+ * primaryAction: Action.Download
2743
+ * });
2744
+ * ```
2745
+ */
2746
+ primaryAction?: Action | string;
2618
2747
  /**
2619
2748
  * The tooltip to display for disabled actions.
2620
2749
  * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
@@ -4534,9 +4663,12 @@ export declare enum HostEvent {
4534
4663
  * @example
4535
4664
  * ```js
4536
4665
  * searchEmbed.trigger(HostEvent.OpenFilter,
4537
- * { columnId: '<column-GUID>', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE'})
4666
+ * {column: { columnId: '<column-GUID>', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE'}})
4667
+ * ```
4668
+ * @example
4669
+ * ```js
4538
4670
  * LiveboardEmbed.trigger(HostEvent.OpenFilter,
4539
- * { columnId: '<column-GUID>'})
4671
+ * { column: {columnId: '<column-GUID>'}})
4540
4672
  * ```
4541
4673
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
4542
4674
  */
@@ -5145,6 +5277,25 @@ export declare enum HostEvent {
5145
5277
  * }]
5146
5278
  * });
5147
5279
  * ```
5280
+ * If there are multiple columns with the same name, consider
5281
+ * using `WORKSHEET_NAME::COLUMN_NAME` format.
5282
+ *
5283
+ * @example
5284
+ *
5285
+ * ```js
5286
+ * liveboardEmbed.trigger(HostEvent.UpdateFilters, {
5287
+ * filters: [{
5288
+ * column: "(Sample) Retail - Apparel::city",
5289
+ * oper: 'IN',
5290
+ * values: ["atlanta"]
5291
+ * },
5292
+ * {
5293
+ * column: "(Sample) Retail - Apparel::Region",
5294
+ * oper: 'IN',
5295
+ * values: ["West","Midwest"]
5296
+ * }]
5297
+ * });
5298
+ * ```
5148
5299
  * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
5149
5300
  */
5150
5301
  UpdateFilters = "updateFilters",
@@ -5204,8 +5355,17 @@ export declare enum HostEvent {
5204
5355
  /**
5205
5356
  * Get the Answer session for a Search or
5206
5357
  * Liveboard visualization.
5358
+ *
5359
+ * Note: This event is not typically used directly. Instead, use the
5360
+ * `getAnswerService()` method on the embed instance to get an AnswerService
5361
+ * object that provides a more convenient interface for working with answers.
5362
+ *
5207
5363
  * @example
5208
5364
  * ```js
5365
+ * // Preferred way to get an AnswerService
5366
+ * const service = await embed.getAnswerService();
5367
+ *
5368
+ * // Alternative direct usage (not recommended)
5209
5369
  * const {session} = await embed.trigger(
5210
5370
  * HostEvent.GetAnswerSession, {
5211
5371
  * vizId: '123', // For Liveboard Visualization.
@@ -5213,6 +5373,10 @@ export declare enum HostEvent {
5213
5373
  * ```
5214
5374
  * @example
5215
5375
  * ```js
5376
+ * // Preferred way to get an AnswerService
5377
+ * const service = await embed.getAnswerService();
5378
+ *
5379
+ * // Alternative direct usage (not recommended)
5216
5380
  * const {session} = await embed.trigger( HostEvent.GetAnswerSession )
5217
5381
  * ```
5218
5382
  * @version SDK: 1.26.0 | ThoughtSpot: 9.10.0.cl, 10.1.0.sw
@@ -5411,6 +5575,10 @@ export declare enum Param {
5411
5575
  ShowInsertToSlide = "insertInToSlide",
5412
5576
  PrimaryNavHidden = "primaryNavHidden",
5413
5577
  HideProfleAndHelp = "profileAndHelpInNavBarHidden",
5578
+ NavigationVersion = "navigationVersion",
5579
+ HideHamburger = "hideHamburger",
5580
+ HideObjectSearch = "hideObjectSearch",
5581
+ HideNotification = "hideNotification",
5414
5582
  HideApplicationSwitcher = "applicationSwitcherHidden",
5415
5583
  HideOrgSwitcher = "orgSwitcherHidden",
5416
5584
  IsSageEmbed = "isSageEmbed",
@@ -5466,7 +5634,8 @@ export declare enum Param {
5466
5634
  DataSourceId = "dataSourceId",
5467
5635
  preAuthCache = "preAuthCache",
5468
5636
  ShowSpotterLimitations = "showSpotterLimitations",
5469
- CoverAndFilterOptionInPDF = "coverAndFilterOptionInPDF"
5637
+ CoverAndFilterOptionInPDF = "coverAndFilterOptionInPDF",
5638
+ PrimaryAction = "primaryAction"
5470
5639
  }
5471
5640
  /**
5472
5641
  * ThoughtSpot application pages include actions and menu commands
@@ -7777,29 +7946,49 @@ export interface UnderlyingDataPoint {
7777
7946
  dataValue: any;
7778
7947
  }
7779
7948
  /**
7780
- * Class representing the answer service provided with the
7781
- * custom action payload. This service could be used to run
7782
- * graphql queries in the context of the answer on which the
7783
- * custom action was triggered.
7949
+ * AnswerService provides a simple way to work with ThoughtSpot Answers.
7950
+ *
7951
+ * This service allows you to interact with ThoughtSpot Answers programmatically,
7952
+ * making it easy to customize visualizations, filter data, and extract insights
7953
+ * directly from your application.
7954
+ *
7955
+ * You can use this service to:
7956
+ * - Add or remove columns from Answers (`addColumns`, `removeColumns`, `addColumnsByName`)
7957
+ * - Apply filters to Answers (`addFilter`)
7958
+ * - Get data from Answers in different formats (JSON, CSV, PNG) (`fetchData`, `fetchCSVBlob`, `fetchPNGBlob`)
7959
+ * - Get data for specific points in visualizations (`getUnderlyingDataForPoint`)
7960
+ * - Run custom queries (`executeQuery`)
7961
+ * - Add visualizations to liveboards (`addDisplayedVizToLiveboard`)
7962
+ *
7784
7963
  * @example
7785
7964
  * ```js
7786
- * embed.on(EmbedEvent.CustomAction, e => {
7787
- * const underlying = await e.answerService.getUnderlyingDataForPoint([
7788
- * 'col name 1'
7789
- * ]);
7790
- * const data = await underlying.fetchData(0, 100);
7791
- * })
7965
+ * // Get the answer service
7966
+ * embed.on(EmbedEvent.Data, async (e) => {
7967
+ * const service = await embed.getAnswerService();
7968
+ *
7969
+ * // Add columns to the answer
7970
+ * await service.addColumnsByName(["Sales", "Region"]);
7971
+ *
7972
+ * // Get the data
7973
+ * const data = await service.fetchData();
7974
+ * console.log(data);
7975
+ * });
7792
7976
  * ```
7977
+ *
7793
7978
  * @example
7794
7979
  * ```js
7795
- * embed.on(EmbedEvent.Data, async (e) => {
7796
- * const service = await embed.getAnswerService();
7797
- * await service.addColumns([
7798
- * "<column guid>"
7980
+ * // Get data for a point in a visualization
7981
+ * embed.on(EmbedEvent.CustomAction, async (e) => {
7982
+ * const underlying = await e.answerService.getUnderlyingDataForPoint([
7983
+ * 'Product Name',
7984
+ * 'Sales Amount'
7799
7985
  * ]);
7800
- * console.log(await service.fetchData());
7986
+ *
7987
+ * const data = await underlying.fetchData(0, 100);
7988
+ * console.log(data);
7801
7989
  * });
7802
7990
  * ```
7991
+ *
7803
7992
  * @version SDK: 1.25.0| ThoughtSpot: 9.10.0.cl
7804
7993
  * @group Events
7805
7994
  */