@thoughtspot/visual-embed-sdk 1.24.0-sage.3 → 1.24.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 (183) hide show
  1. package/README.md +1 -1
  2. package/cjs/package.json +9 -1
  3. package/cjs/src/auth.d.ts.map +1 -1
  4. package/cjs/src/auth.js +3 -0
  5. package/cjs/src/auth.js.map +1 -1
  6. package/cjs/src/css-variables.d.ts +38 -0
  7. package/cjs/src/css-variables.d.ts.map +1 -1
  8. package/cjs/src/embed/app.d.ts +32 -1
  9. package/cjs/src/embed/app.d.ts.map +1 -1
  10. package/cjs/src/embed/app.js +11 -8
  11. package/cjs/src/embed/app.js.map +1 -1
  12. package/cjs/src/embed/app.spec.js +46 -0
  13. package/cjs/src/embed/app.spec.js.map +1 -1
  14. package/cjs/src/embed/base.d.ts +4 -1
  15. package/cjs/src/embed/base.d.ts.map +1 -1
  16. package/cjs/src/embed/base.js +6 -3
  17. package/cjs/src/embed/base.js.map +1 -1
  18. package/cjs/src/embed/liveboard.d.ts +5 -1
  19. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  20. package/cjs/src/embed/liveboard.js +5 -2
  21. package/cjs/src/embed/liveboard.js.map +1 -1
  22. package/cjs/src/embed/liveboard.spec.js +23 -7
  23. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  24. package/cjs/src/embed/search-bar.d.ts +6 -0
  25. package/cjs/src/embed/search-bar.d.ts.map +1 -1
  26. package/cjs/src/embed/search-bar.js +5 -2
  27. package/cjs/src/embed/search-bar.js.map +1 -1
  28. package/cjs/src/embed/search.d.ts +15 -2
  29. package/cjs/src/embed/search.d.ts.map +1 -1
  30. package/cjs/src/embed/search.js +8 -2
  31. package/cjs/src/embed/search.js.map +1 -1
  32. package/cjs/src/embed/search.spec.js +49 -0
  33. package/cjs/src/embed/search.spec.js.map +1 -1
  34. package/cjs/src/embed/ts-embed.d.ts +3 -1
  35. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  36. package/cjs/src/embed/ts-embed.js +28 -8
  37. package/cjs/src/embed/ts-embed.js.map +1 -1
  38. package/cjs/src/embed/ts-embed.spec.js +139 -3
  39. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  40. package/cjs/src/index.d.ts +2 -2
  41. package/cjs/src/index.d.ts.map +1 -1
  42. package/cjs/src/index.js +3 -1
  43. package/cjs/src/index.js.map +1 -1
  44. package/cjs/src/mixpanel-service.d.ts +1 -0
  45. package/cjs/src/mixpanel-service.d.ts.map +1 -1
  46. package/cjs/src/mixpanel-service.js +10 -3
  47. package/cjs/src/mixpanel-service.js.map +1 -1
  48. package/cjs/src/mixpanel-service.spec.js +12 -3
  49. package/cjs/src/mixpanel-service.spec.js.map +1 -1
  50. package/cjs/src/react/index.d.ts +15 -15
  51. package/cjs/src/react/index.d.ts.map +1 -1
  52. package/cjs/src/react/index.js +7 -3
  53. package/cjs/src/react/index.js.map +1 -1
  54. package/cjs/src/react/index.spec.js +12 -0
  55. package/cjs/src/react/index.spec.js.map +1 -1
  56. package/cjs/src/types.d.ts +176 -9
  57. package/cjs/src/types.d.ts.map +1 -1
  58. package/cjs/src/types.js +133 -7
  59. package/cjs/src/types.js.map +1 -1
  60. package/cjs/src/utils.d.ts +7 -1
  61. package/cjs/src/utils.d.ts.map +1 -1
  62. package/cjs/src/utils.js +20 -1
  63. package/cjs/src/utils.js.map +1 -1
  64. package/cjs/src/utils.spec.js +24 -0
  65. package/cjs/src/utils.spec.js.map +1 -1
  66. package/dist/src/auth.d.ts.map +1 -1
  67. package/dist/src/css-variables.d.ts +38 -0
  68. package/dist/src/css-variables.d.ts.map +1 -1
  69. package/dist/src/embed/app.d.ts +32 -1
  70. package/dist/src/embed/app.d.ts.map +1 -1
  71. package/dist/src/embed/base.d.ts +4 -1
  72. package/dist/src/embed/base.d.ts.map +1 -1
  73. package/dist/src/embed/liveboard.d.ts +5 -1
  74. package/dist/src/embed/liveboard.d.ts.map +1 -1
  75. package/dist/src/embed/search-bar.d.ts +6 -0
  76. package/dist/src/embed/search-bar.d.ts.map +1 -1
  77. package/dist/src/embed/search.d.ts +15 -2
  78. package/dist/src/embed/search.d.ts.map +1 -1
  79. package/dist/src/embed/ts-embed.d.ts +3 -1
  80. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  81. package/dist/src/index.d.ts +2 -2
  82. package/dist/src/index.d.ts.map +1 -1
  83. package/dist/src/mixpanel-service.d.ts +1 -0
  84. package/dist/src/mixpanel-service.d.ts.map +1 -1
  85. package/dist/src/react/index.d.ts +15 -15
  86. package/dist/src/react/index.d.ts.map +1 -1
  87. package/dist/src/types.d.ts +176 -9
  88. package/dist/src/types.d.ts.map +1 -1
  89. package/dist/src/utils.d.ts +7 -1
  90. package/dist/src/utils.d.ts.map +1 -1
  91. package/dist/tsembed-react.es.js +226 -35
  92. package/dist/tsembed-react.js +219 -34
  93. package/dist/tsembed.es.js +228 -36
  94. package/dist/tsembed.js +221 -35
  95. package/dist/visual-embed-sdk-react-full.d.ts +512 -248
  96. package/dist/visual-embed-sdk-react.d.ts +514 -250
  97. package/dist/visual-embed-sdk.d.ts +277 -14
  98. package/lib/package.json +9 -1
  99. package/lib/src/auth.d.ts.map +1 -1
  100. package/lib/src/auth.js +3 -0
  101. package/lib/src/auth.js.map +1 -1
  102. package/lib/src/css-variables.d.ts +38 -0
  103. package/lib/src/css-variables.d.ts.map +1 -1
  104. package/lib/src/embed/app.d.ts +32 -1
  105. package/lib/src/embed/app.d.ts.map +1 -1
  106. package/lib/src/embed/app.js +11 -8
  107. package/lib/src/embed/app.js.map +1 -1
  108. package/lib/src/embed/app.spec.js +46 -0
  109. package/lib/src/embed/app.spec.js.map +1 -1
  110. package/lib/src/embed/base.d.ts +4 -1
  111. package/lib/src/embed/base.d.ts.map +1 -1
  112. package/lib/src/embed/base.js +6 -3
  113. package/lib/src/embed/base.js.map +1 -1
  114. package/lib/src/embed/liveboard.d.ts +5 -1
  115. package/lib/src/embed/liveboard.d.ts.map +1 -1
  116. package/lib/src/embed/liveboard.js +6 -3
  117. package/lib/src/embed/liveboard.js.map +1 -1
  118. package/lib/src/embed/liveboard.spec.js +23 -7
  119. package/lib/src/embed/liveboard.spec.js.map +1 -1
  120. package/lib/src/embed/search-bar.d.ts +6 -0
  121. package/lib/src/embed/search-bar.d.ts.map +1 -1
  122. package/lib/src/embed/search-bar.js +6 -3
  123. package/lib/src/embed/search-bar.js.map +1 -1
  124. package/lib/src/embed/search.d.ts +15 -2
  125. package/lib/src/embed/search.d.ts.map +1 -1
  126. package/lib/src/embed/search.js +9 -3
  127. package/lib/src/embed/search.js.map +1 -1
  128. package/lib/src/embed/search.spec.js +49 -0
  129. package/lib/src/embed/search.spec.js.map +1 -1
  130. package/lib/src/embed/ts-embed.d.ts +3 -1
  131. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  132. package/lib/src/embed/ts-embed.js +29 -9
  133. package/lib/src/embed/ts-embed.js.map +1 -1
  134. package/lib/src/embed/ts-embed.spec.js +140 -4
  135. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  136. package/lib/src/index.d.ts +2 -2
  137. package/lib/src/index.d.ts.map +1 -1
  138. package/lib/src/index.js +2 -2
  139. package/lib/src/index.js.map +1 -1
  140. package/lib/src/mixpanel-service.d.ts +1 -0
  141. package/lib/src/mixpanel-service.d.ts.map +1 -1
  142. package/lib/src/mixpanel-service.js +10 -3
  143. package/lib/src/mixpanel-service.js.map +1 -1
  144. package/lib/src/mixpanel-service.spec.js +12 -3
  145. package/lib/src/mixpanel-service.spec.js.map +1 -1
  146. package/lib/src/react/index.d.ts +15 -15
  147. package/lib/src/react/index.d.ts.map +1 -1
  148. package/lib/src/react/index.js +5 -3
  149. package/lib/src/react/index.js.map +1 -1
  150. package/lib/src/react/index.spec.js +13 -1
  151. package/lib/src/react/index.spec.js.map +1 -1
  152. package/lib/src/types.d.ts +176 -9
  153. package/lib/src/types.d.ts.map +1 -1
  154. package/lib/src/types.js +132 -6
  155. package/lib/src/types.js.map +1 -1
  156. package/lib/src/utils.d.ts +7 -1
  157. package/lib/src/utils.d.ts.map +1 -1
  158. package/lib/src/utils.js +18 -0
  159. package/lib/src/utils.js.map +1 -1
  160. package/lib/src/utils.spec.js +25 -1
  161. package/lib/src/utils.spec.js.map +1 -1
  162. package/lib/src/visual-embed-sdk.d.ts +280 -17
  163. package/package.json +9 -1
  164. package/src/auth.ts +6 -3
  165. package/src/css-variables.ts +47 -0
  166. package/src/embed/app.spec.ts +63 -0
  167. package/src/embed/app.ts +50 -15
  168. package/src/embed/base.ts +9 -6
  169. package/src/embed/liveboard.spec.ts +29 -10
  170. package/src/embed/liveboard.ts +11 -2
  171. package/src/embed/search-bar.tsx +19 -6
  172. package/src/embed/search.spec.ts +61 -0
  173. package/src/embed/search.ts +34 -3
  174. package/src/embed/ts-embed.spec.ts +162 -8
  175. package/src/embed/ts-embed.ts +30 -9
  176. package/src/index.ts +4 -0
  177. package/src/mixpanel-service.spec.ts +12 -3
  178. package/src/mixpanel-service.ts +10 -3
  179. package/src/react/index.spec.tsx +33 -2
  180. package/src/react/index.tsx +37 -26
  181. package/src/types.ts +263 -92
  182. package/src/utils.spec.ts +31 -0
  183. package/src/utils.ts +23 -0
package/src/types.ts CHANGED
@@ -178,6 +178,17 @@ export enum AuthType {
178
178
  Basic = 'Basic',
179
179
  }
180
180
 
181
+ export enum HomeLeftNavItem {
182
+ QueryBuilder = 'query-builder',
183
+ Home = 'insights-home',
184
+ Liveboards = 'liveboards',
185
+ Answers = 'answers',
186
+ MonitorSubscription = 'monitor-alerts',
187
+ SpotIQAnalysis = 'spotiq-analysis',
188
+ Tutorials = 'tutorials',
189
+ Documentation = 'documentation',
190
+ Community = 'community',
191
+ }
181
192
  export type DOMSelector = string | HTMLElement;
182
193
 
183
194
  /**
@@ -451,6 +462,7 @@ export interface EmbedConfig {
451
462
  * @version SDK: 1.12.0 | ThoughtSpot: 8.4.0.cl, 8.4.1.sw*
452
463
  */
453
464
  suppressSearchEmbedBetaWarning?: boolean;
465
+
454
466
  /**
455
467
  * Hide beta alert warning message for SageEmbed.
456
468
  *
@@ -502,16 +514,26 @@ export interface EmbedConfig {
502
514
 
503
515
  /**
504
516
  * Host config incase embedded app is inside TS app itself
517
+ *
518
+ * @hidden
505
519
  */
506
520
  hostConfig?: {
507
521
  hostUserGuid: string;
508
522
  hostClusterId: string;
509
523
  hostClusterName: string;
510
- }
524
+ };
525
+
526
+ /**
527
+ * Pendo API key to enable Pendo tracking to your own subscription, the key
528
+ * is added as an additional key to the embed, as per this [doc](https://support.pendo.io/hc/en-us/articles/360032201951-Send-data-to-multiple-subscriptions).
529
+ *
530
+ * @version SDK: 1.27.0 | ThoughtSpot: 9.8.0.cl
531
+ */
532
+ pendoTrackingKey?: string;
511
533
  }
512
534
 
513
535
  // eslint-disable-next-line @typescript-eslint/no-empty-interface
514
- export interface LayoutConfig { }
536
+ export interface LayoutConfig {}
515
537
 
516
538
  /**
517
539
  * Embedded iFrame configuration
@@ -619,6 +641,11 @@ export interface ViewConfig {
619
641
  * visualization, or Liveboard.
620
642
  */
621
643
  runtimeFilters?: RuntimeFilter[];
644
+ /**
645
+ * The list of parameter override to apply to a search answer,
646
+ * visualization, or Liveboard.
647
+ */
648
+ runtimeParameters?: RuntimeParameter[];
622
649
  /**
623
650
  * The locale/language to use for the embedded view.
624
651
  *
@@ -723,6 +750,13 @@ export interface ViewConfig {
723
750
  * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
724
751
  */
725
752
  hiddenTabs?: string[];
753
+ /**
754
+ * Hide the home page modules
755
+ * eg: hiddenHomepageModules = [HomepageModule.MyLibrary]
756
+ *
757
+ * @version SDK: 1.27.0 | Thoughtspot: 9.8.0.cl
758
+ */
759
+ hiddenHomepageModules?: HomepageModule[];
726
760
  /**
727
761
  * The list of tab IDs to show in the embedded.
728
762
  * Only this Tabs will be shown in their respective LBs.
@@ -742,6 +776,15 @@ export interface ViewConfig {
742
776
  * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
743
777
  */
744
778
  visibleTabs?: string[];
779
+ /**
780
+ * homepageLeftNavItems : show/hide Homeapage Left Nav Bar Items
781
+ * There are 8 home nav list items, we will send those item as list
782
+ * which we want to hide for TSE.
783
+ * eg: hiddenHomeLeftNavItems = [HomeLeftNavItem.Home] to hide home.
784
+ *
785
+ * @version SDK: 1.27.0 | Thoughtspot: 9.8.0.cl
786
+ */
787
+ hiddenHomeLeftNavItems?: HomeLeftNavItem[];
745
788
  }
746
789
 
747
790
  /**
@@ -866,6 +909,37 @@ export enum RuntimeFilterOp {
866
909
  IN = 'IN',
867
910
  }
868
911
 
912
+ /**
913
+ * Home page module that can be hide
914
+ */
915
+ // eslint-disable-next-line no-shadow
916
+ export enum HomepageModule {
917
+ /**
918
+ * Search bar
919
+ */
920
+ Search = 'search',
921
+ /**
922
+ * kPI watchlist module
923
+ */
924
+ Watchlist = 'watchlist',
925
+ /**
926
+ * favorite objects
927
+ */
928
+ Favorite = 'favorite',
929
+ /**
930
+ * List of answers and liveboards
931
+ */
932
+ MyLibrary = 'mylibrary',
933
+ /**
934
+ * Trending list
935
+ */
936
+ Trending = 'trending',
937
+ /**
938
+ * Learning videos
939
+ */
940
+ Learning = 'learning',
941
+ }
942
+
869
943
  /**
870
944
  * A filter that can be applied to ThoughtSpot answers, Liveboards, or
871
945
  * visualizations at runtime.
@@ -886,6 +960,20 @@ export interface RuntimeFilter {
886
960
  */
887
961
  values: (number | boolean | string)[];
888
962
  }
963
+ /**
964
+ * A filter that can be applied to ThoughtSpot answers, Liveboards, or
965
+ * visualizations at runtime.
966
+ */
967
+ export interface RuntimeParameter {
968
+ /**
969
+ * The name of the runtime parameter to filter on (case-sensitive)
970
+ */
971
+ name: string;
972
+ /**
973
+ * Values
974
+ */
975
+ value: number | boolean | string;
976
+ }
889
977
 
890
978
  /**
891
979
  * Event types emitted by the embedded ThoughtSpot application.
@@ -1312,23 +1400,74 @@ export enum EmbedEvent {
1312
1400
  */
1313
1401
  InsertIntoSlide = 'insertInToSlide',
1314
1402
  /**
1403
+ * @hidden
1315
1404
  * Emitted when a user changes any filter on a Liveboard.
1316
- *
1317
1405
  * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
1318
1406
  */
1319
1407
  FilterChanged = 'filterChanged',
1320
1408
  /**
1321
1409
  * Emitted when a user click on Go button in Sage Embed
1322
1410
  *
1323
- * @version SDK : 1.27.0 | Thoughtspot: 9.7.0.cl
1411
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
1324
1412
  */
1325
1413
  SageEmbedQuery = 'sageEmbedQuery',
1326
1414
  /**
1327
1415
  * Emitten when a user select data source in Sage Embed
1328
1416
  *
1329
- * @version SDK : 1.27.0 | Thoughtspot: 9.7.0.cl
1417
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
1330
1418
  */
1331
1419
  SageWorksheetUpdated = 'sageWorksheetUpdated',
1420
+ /**
1421
+ * Emitten when a user updates a connection in Data tab
1422
+ *
1423
+ * @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl
1424
+ */
1425
+ UpdateConnection = 'updateConnection',
1426
+ /**
1427
+ * Emitted when name, status (private or public) or filter values of a
1428
+ * PersonalisedView is updated.
1429
+ *
1430
+ * @returns viewName: string
1431
+ * @returns viewId: string
1432
+ * @returns liveboardId: string
1433
+ * @returns isPublic: boolean
1434
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
1435
+ */
1436
+ UpdatePersonalisedView = 'updatePersonalisedView',
1437
+ /**
1438
+ * Emitted when a PersonalisedView is saved.
1439
+ *
1440
+ * @returns viewName: string
1441
+ * @returns viewId: string
1442
+ * @returns liveboardId: string
1443
+ * @returns isPublic: boolean
1444
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
1445
+ */
1446
+ SavePersonalisedView = 'savePersonalisedView',
1447
+ /**
1448
+ * Emitted when a Liveboard is reset.
1449
+ *
1450
+ * @returns viewName: string
1451
+ * @returns viewId: string
1452
+ * @returns liveboardId: string
1453
+ * @returns isPublic: boolean
1454
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
1455
+ */
1456
+ ResetLiveboard = 'resetLiveboard',
1457
+ /**
1458
+ * Emitted when a PersonalisedView is deleted.
1459
+ *
1460
+ * @returns views: string[]
1461
+ * @returns liveboardId: string
1462
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
1463
+ */
1464
+ DeletePersonalisedView = 'deletePersonalisedView',
1465
+ /**
1466
+ * Emitten when a user creates a new worksheet
1467
+ *
1468
+ * @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl
1469
+ */
1470
+ CreateWorksheet = 'createWorksheet',
1332
1471
  }
1333
1472
 
1334
1473
  /**
@@ -1973,16 +2112,16 @@ export enum HostEvent {
1973
2112
  */
1974
2113
  ResetSearch = 'resetSearch',
1975
2114
  /**
2115
+ * @hidden
1976
2116
  * Gets the currents visible and runtime filters applied on a Liveboard
1977
- *
1978
2117
  * @example
1979
2118
  * liveboardEmbed.trigger(HostEvent.GetFilters)
1980
2119
  * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
1981
2120
  */
1982
2121
  GetFilters = 'getFilters',
1983
2122
  /**
2123
+ * @hidden
1984
2124
  * Updates the visible filters on the Liveboard.
1985
- *
1986
2125
  * @param - filter: filter object containing column name and filter operation and values
1987
2126
  * @example
1988
2127
  *
@@ -2108,7 +2247,7 @@ export enum Param {
2108
2247
  DisableLoginRedirect = 'disableLoginRedirect',
2109
2248
  visibleVizs = 'pinboardVisibleVizs',
2110
2249
  LiveboardV2Enabled = 'isPinboardV2Enabled',
2111
- DataPanelV2Enabled ='enableDataPanelV2',
2250
+ DataPanelV2Enabled = 'enableDataPanelV2',
2112
2251
  ShowAlerts = 'showAlerts',
2113
2252
  Locale = 'locale',
2114
2253
  CustomStyle = 'customStyle',
@@ -2138,7 +2277,10 @@ export enum Param {
2138
2277
  HideTabPanel = 'hideTabPanel',
2139
2278
  HideSampleQuestions = 'hideSampleQuestions',
2140
2279
  WorksheetId = 'worksheet',
2141
- Query = 'query'
2280
+ Query = 'query',
2281
+ HideHomepageLeftNav = 'hideHomepageLeftNav',
2282
+ ModularHomeExperienceEnabled = 'modularHomeExperience',
2283
+ PendoTrackingKey = 'additionalPendoKey',
2142
2284
  }
2143
2285
 
2144
2286
  /**
@@ -2170,15 +2312,15 @@ export enum Param {
2170
2312
  */
2171
2313
  // eslint-disable-next-line no-shadow
2172
2314
  export enum Action {
2173
- /**
2174
- * The **Save** action on an Answer or Liveboard.
2175
- * Allows users to save the changes.
2176
- *
2177
- * @example
2178
- * ```js
2179
- * disabledActions: [Action.SaveAsView]
2180
- * ```
2181
- */
2315
+ /**
2316
+ * The **Save** action on an Answer or Liveboard.
2317
+ * Allows users to save the changes.
2318
+ *
2319
+ * @example
2320
+ * ```js
2321
+ * disabledActions: [Action.SaveAsView]
2322
+ * ```
2323
+ */
2182
2324
  Save = 'save',
2183
2325
  /**
2184
2326
  * @hidden
@@ -2432,25 +2574,25 @@ export enum Action {
2432
2574
  * ```
2433
2575
  */
2434
2576
  ImportTML = 'importTSL',
2435
- /**
2436
- * The **Update TML** menu action for Liveboards and Answers.
2437
- * Update TML representation of ThoughtSpot objects.
2438
- *
2439
- * @example
2440
- * ```js
2441
- * disabledActions: [Action.UpdateTML]
2442
- * ```
2443
- */
2577
+ /**
2578
+ * The **Update TML** menu action for Liveboards and Answers.
2579
+ * Update TML representation of ThoughtSpot objects.
2580
+ *
2581
+ * @example
2582
+ * ```js
2583
+ * disabledActions: [Action.UpdateTML]
2584
+ * ```
2585
+ */
2444
2586
  UpdateTML = 'updateTSL',
2445
- /**
2446
- * The **Edit TML** menu action for Liveboards and Answers.
2447
- * Opens the TML editor.
2448
- *
2449
- * @example
2450
- * ```js
2451
- * disabledActions: [Action.EditTML]
2452
- * ```
2453
- */
2587
+ /**
2588
+ * The **Edit TML** menu action for Liveboards and Answers.
2589
+ * Opens the TML editor.
2590
+ *
2591
+ * @example
2592
+ * ```js
2593
+ * disabledActions: [Action.EditTML]
2594
+ * ```
2595
+ */
2454
2596
  EditTML = 'editTSL',
2455
2597
  /**
2456
2598
  * The **Present** menu action for Liveboards and Answers.
@@ -2557,14 +2699,14 @@ export enum Action {
2557
2699
  * @hidden
2558
2700
  */
2559
2701
  AnalysisInfo = 'analysisInfo',
2560
- /**
2561
- * The **Schedule** menu action on a Liveboard.
2562
- *
2563
- * @example
2564
- * ```js
2565
- * disabledActions: [Action.Subscription]
2566
- * ```
2567
- */
2702
+ /**
2703
+ * The **Schedule** menu action on a Liveboard.
2704
+ *
2705
+ * @example
2706
+ * ```js
2707
+ * disabledActions: [Action.Subscription]
2708
+ * ```
2709
+ */
2568
2710
  Subscription = 'subscription',
2569
2711
  /**
2570
2712
  * The **Explore** action on Liveboard visualizations
@@ -2586,26 +2728,26 @@ export enum Action {
2586
2728
  */
2587
2729
 
2588
2730
  DrillInclude = 'context-menu-item-include',
2589
- /**
2590
- * The action to exclude data points on a drilled-down Answer
2591
- * or visualization
2592
- *
2593
- * @example
2594
- * ```js
2595
- * disabledActions: [Action.DrillInclude]
2596
- * ```
2597
- */
2731
+ /**
2732
+ * The action to exclude data points on a drilled-down Answer
2733
+ * or visualization
2734
+ *
2735
+ * @example
2736
+ * ```js
2737
+ * disabledActions: [Action.DrillInclude]
2738
+ * ```
2739
+ */
2598
2740
  DrillExclude = 'context-menu-item-exclude',
2599
- /**
2600
- * The **Copy to clipboard** menu action on tables in an Answer
2601
- * or Liveboard.
2602
- * Copies the selected data point.
2603
- *
2604
- * @example
2605
- * ```js
2606
- * disabledActions: [Action.CopyToClipboard]
2607
- * ```
2608
- */
2741
+ /**
2742
+ * The **Copy to clipboard** menu action on tables in an Answer
2743
+ * or Liveboard.
2744
+ * Copies the selected data point.
2745
+ *
2746
+ * @example
2747
+ * ```js
2748
+ * disabledActions: [Action.CopyToClipboard]
2749
+ * ```
2750
+ */
2609
2751
  CopyToClipboard = 'context-menu-item-copy-to-clipboard',
2610
2752
  CopyAndEdit = 'context-menu-item-copy-and-edit',
2611
2753
  /**
@@ -2614,37 +2756,37 @@ export enum Action {
2614
2756
  DrillEdit = 'context-menu-item-edit',
2615
2757
  EditMeasure = 'context-menu-item-edit-measure',
2616
2758
  Separator = 'context-menu-item-separator',
2617
- /**
2618
- * The **Drill down** menu action on Answers and Liveboard
2619
- * visualizations.
2620
- * Allows drilling down to a specific data point on a chart or table.
2621
- *
2622
- * @example
2623
- * ```js
2624
- * disabledActions: [Action.DrillDown]
2625
- * ```
2626
- */
2759
+ /**
2760
+ * The **Drill down** menu action on Answers and Liveboard
2761
+ * visualizations.
2762
+ * Allows drilling down to a specific data point on a chart or table.
2763
+ *
2764
+ * @example
2765
+ * ```js
2766
+ * disabledActions: [Action.DrillDown]
2767
+ * ```
2768
+ */
2627
2769
  DrillDown = 'DRILL',
2628
- /**
2629
- * The request access action on Liveboards.
2630
- * Allows users with view permissions to request edit access to a Liveboard.
2631
- *
2632
- * @example
2633
- * ```js
2634
- * disabledActions: [Action.RequestAccess]
2635
- * ```
2636
- */
2770
+ /**
2771
+ * The request access action on Liveboards.
2772
+ * Allows users with view permissions to request edit access to a Liveboard.
2773
+ *
2774
+ * @example
2775
+ * ```js
2776
+ * disabledActions: [Action.RequestAccess]
2777
+ * ```
2778
+ */
2637
2779
  RequestAccess = 'requestAccess',
2638
- /**
2639
- * The **Query visualizer** and **Query SQL** buttons in Query details panel
2640
- * of the Answer page
2641
- *
2642
- * @example
2643
- * ```js
2644
- * disabledActions: [Action.QueryDetailsButtons]
2645
- * ```
2646
- */
2647
- QueryDetailsButtons = 'QueryDetailsButtons',
2780
+ /**
2781
+ * The **Query visualizer** and **Query SQL** buttons in Query details panel
2782
+ * of the Answer page
2783
+ *
2784
+ * @example
2785
+ * ```js
2786
+ * disabledActions: [Action.QueryDetailsButtons]
2787
+ * ```
2788
+ */
2789
+ QueryDetailsButtons = 'queryDetailsButtons',
2648
2790
  /**
2649
2791
  * The **Delete** action for Answers.
2650
2792
  *
@@ -2949,6 +3091,35 @@ export enum Action {
2949
3091
  * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
2950
3092
  */
2951
3093
  ModifySageAnswer = 'modifySageAnswer',
3094
+ /**
3095
+ * The **Move to Tab** menu action on visualizations in liveboard edit mode.
3096
+ * Allows moving a visualization to a different tab.
3097
+ *
3098
+ * @example
3099
+ * ```js
3100
+ * disabledActions: [Action.MoveToTab]
3101
+ * ```
3102
+ */
3103
+ MoveToTab = 'onContainerMove',
3104
+ /**
3105
+ * The **Manage Alertsb** menu action on KPI visualizations.
3106
+ *
3107
+ * @example
3108
+ * ```js
3109
+ * disabledActions: [Action.ManageMonitor]
3110
+ * ```
3111
+ */
3112
+ ManageMonitor = 'ManageMonitor',
3113
+ /**
3114
+ * Action ID for Liveboard Personalised Views dropdown
3115
+ *
3116
+ * @example
3117
+ * ```js
3118
+ * disabledActions: [Action.PersonalisedViewsDropdown]
3119
+ * ```
3120
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
3121
+ */
3122
+ PersonalisedViewsDropdown = 'personalisedViewsDropdown',
2952
3123
  }
2953
3124
 
2954
3125
  export interface SessionInterface {
package/src/utils.spec.ts CHANGED
@@ -10,6 +10,7 @@ import {
10
10
  appendToUrlHash,
11
11
  getRedirectUrl,
12
12
  checkReleaseVersionInBeta,
13
+ getRuntimeParameters,
13
14
  } from './utils';
14
15
  import { RuntimeFilterOp } from './types';
15
16
 
@@ -65,6 +66,36 @@ describe('unit test for utils', () => {
65
66
  'col1=foo&op1=EQ&val1=42&col2=bar&op2=BW_INC&val2=1&val2=10&col3=baz&op3=CONTAINS&val3=abc',
66
67
  );
67
68
  });
69
+ test('getParameterOverride', () => {
70
+ expect(getRuntimeParameters([])).toBe(null);
71
+
72
+ expect(
73
+ getRuntimeParameters([
74
+ {
75
+ name: 'foo',
76
+ value: 'bar',
77
+ },
78
+ ]),
79
+ ).toBe('param1=foo&paramVal1=bar');
80
+
81
+ const params = [
82
+ {
83
+ name: 'foo',
84
+ value: 42,
85
+ },
86
+ {
87
+ name: 'bar',
88
+ value: 'abc',
89
+ },
90
+ {
91
+ name: 'baz',
92
+ value: true,
93
+ },
94
+ ];
95
+ expect(getRuntimeParameters(params)).toBe(
96
+ 'param1=foo&paramVal1=42&param2=bar&paramVal2=abc&param3=baz&paramVal3=true',
97
+ );
98
+ });
68
99
 
69
100
  test('getCssDimension', () => {
70
101
  expect(getCssDimension(100)).toBe('100px');
package/src/utils.ts CHANGED
@@ -15,6 +15,7 @@ import {
15
15
  CustomisationsInterface,
16
16
  DOMSelector,
17
17
  ViewConfig,
18
+ RuntimeParameter,
18
19
  } from './types';
19
20
 
20
21
  /**
@@ -43,6 +44,28 @@ export const getFilterQuery = (runtimeFilters: RuntimeFilter[]): string => {
43
44
  return null;
44
45
  };
45
46
 
47
+ /**
48
+ * Construct a runtime parameter override query string from the given option.
49
+ *
50
+ * @param runtimeParameters
51
+ */
52
+ export const getRuntimeParameters = (runtimeParameters: RuntimeParameter[]): string => {
53
+ if (runtimeParameters && runtimeParameters.length) {
54
+ const params = runtimeParameters.map((param, valueIndex) => {
55
+ const index = valueIndex + 1;
56
+ const filterExpr = [];
57
+ filterExpr.push(`param${index}=${encodeURIComponent(param.name)}`);
58
+ filterExpr.push(`paramVal${index}=${encodeURIComponent(param.value)}`);
59
+
60
+ return filterExpr.join('&');
61
+ });
62
+
63
+ return `${params.join('&')}`;
64
+ }
65
+
66
+ return null;
67
+ };
68
+
46
69
  /**
47
70
  * Convert a value to a string representation to be sent as a query
48
71
  * parameter to the ThoughtSpot app.