@thoughtspot/visual-embed-sdk 1.28.4 → 1.28.5

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 (61) hide show
  1. package/cjs/package.json +1 -1
  2. package/cjs/src/authToken.d.ts.map +1 -1
  3. package/cjs/src/authToken.js +8 -1
  4. package/cjs/src/authToken.js.map +1 -1
  5. package/cjs/src/authToken.spec.d.ts +2 -0
  6. package/cjs/src/authToken.spec.d.ts.map +1 -0
  7. package/cjs/src/authToken.spec.js +29 -0
  8. package/cjs/src/authToken.spec.js.map +1 -0
  9. package/cjs/src/types.d.ts +93 -48
  10. package/cjs/src/types.d.ts.map +1 -1
  11. package/cjs/src/types.js +76 -48
  12. package/cjs/src/types.js.map +1 -1
  13. package/dist/src/authToken.d.ts.map +1 -1
  14. package/dist/src/authToken.spec.d.ts +2 -0
  15. package/dist/src/authToken.spec.d.ts.map +1 -0
  16. package/dist/src/types.d.ts +93 -48
  17. package/dist/src/types.d.ts.map +1 -1
  18. package/dist/tsembed-react.es.js +84 -50
  19. package/dist/tsembed-react.js +84 -50
  20. package/dist/tsembed.es.js +84 -50
  21. package/dist/tsembed.js +84 -50
  22. package/dist/visual-embed-sdk-react-full.d.ts +93 -48
  23. package/dist/visual-embed-sdk-react.d.ts +93 -48
  24. package/dist/visual-embed-sdk.d.ts +93 -48
  25. package/lib/package.json +1 -1
  26. package/lib/src/authToken.d.ts.map +1 -1
  27. package/lib/src/authToken.js +8 -1
  28. package/lib/src/authToken.js.map +1 -1
  29. package/lib/src/authToken.spec.d.ts +2 -0
  30. package/lib/src/authToken.spec.d.ts.map +1 -0
  31. package/lib/src/authToken.spec.js +26 -0
  32. package/lib/src/authToken.spec.js.map +1 -0
  33. package/lib/src/types.d.ts +93 -48
  34. package/lib/src/types.d.ts.map +1 -1
  35. package/lib/src/types.js +76 -48
  36. package/lib/src/types.js.map +1 -1
  37. package/lib/src/visual-embed-sdk.d.ts +93 -48
  38. package/package.json +1 -1
  39. package/src/authToken.spec.ts +31 -0
  40. package/src/authToken.ts +8 -1
  41. package/src/types.ts +94 -48
  42. package/cjs/src/utils/authService/tokenizedAuthService.spec.d.ts +0 -2
  43. package/cjs/src/utils/authService/tokenizedAuthService.spec.d.ts.map +0 -1
  44. package/cjs/src/utils/authService/tokenizedAuthService.spec.js +0 -32
  45. package/cjs/src/utils/authService/tokenizedAuthService.spec.js.map +0 -1
  46. package/cjs/src/utils/sessionInfoService.d.ts +0 -66
  47. package/cjs/src/utils/sessionInfoService.d.ts.map +0 -1
  48. package/cjs/src/utils/sessionInfoService.js +0 -92
  49. package/cjs/src/utils/sessionInfoService.js.map +0 -1
  50. package/dist/src/utils/authService/tokenizedAuthService.spec.d.ts +0 -2
  51. package/dist/src/utils/authService/tokenizedAuthService.spec.d.ts.map +0 -1
  52. package/dist/src/utils/sessionInfoService.d.ts +0 -66
  53. package/dist/src/utils/sessionInfoService.d.ts.map +0 -1
  54. package/lib/src/utils/authService/tokenizedAuthService.spec.d.ts +0 -2
  55. package/lib/src/utils/authService/tokenizedAuthService.spec.d.ts.map +0 -1
  56. package/lib/src/utils/authService/tokenizedAuthService.spec.js +0 -29
  57. package/lib/src/utils/authService/tokenizedAuthService.spec.js.map +0 -1
  58. package/lib/src/utils/sessionInfoService.d.ts +0 -66
  59. package/lib/src/utils/sessionInfoService.d.ts.map +0 -1
  60. package/lib/src/utils/sessionInfoService.js +0 -85
  61. package/lib/src/utils/sessionInfoService.js.map +0 -1
@@ -2005,6 +2005,23 @@ export interface EmbedConfig {
2005
2005
  * @version SDK: 1.28.4 | Thoughtspot: 10.0.0.cl, 9.5.0.sw
2006
2006
  */
2007
2007
  currencyFormat?: string;
2008
+ /**
2009
+ * This flag is used to disable the token verification in the SDK.
2010
+ * Enabling this flag will also disable the caching of the token.
2011
+ *
2012
+ * @hidden
2013
+ *
2014
+ * @example
2015
+ * ```js
2016
+ * init({
2017
+ * ...embedConfig,
2018
+ * disableTokenVerification : true
2019
+ * })
2020
+ * ```
2021
+ *
2022
+ * @version SDK: 1.28.5 | Thoughtspot: *
2023
+ */
2024
+ disableTokenVerification?: boolean;
2008
2025
  }
2009
2026
  export interface LayoutConfig {
2010
2027
  }
@@ -2655,6 +2672,8 @@ export enum EmbedEvent {
2655
2672
  /**
2656
2673
  * Authentication has either succeeded or failed.
2657
2674
  *
2675
+ * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
2676
+ *
2658
2677
  * @example
2659
2678
  *```js
2660
2679
  * appEmbed.on(EmbedEvent.AuthInit, payload => {
@@ -2668,6 +2687,8 @@ export enum EmbedEvent {
2668
2687
  * The embed object container has loaded.
2669
2688
  *
2670
2689
  * @returns timestamp - The timestamp when the event was generated.
2690
+ *
2691
+ * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
2671
2692
  * @example
2672
2693
  *```js
2673
2694
  * liveboardEmbed.on(EmbedEvent.Load, hideLoader)
@@ -2682,6 +2703,8 @@ export enum EmbedEvent {
2682
2703
  * Data pertaining to answer or Liveboard is received
2683
2704
  *
2684
2705
  * @return data - The answer or Liveboard data
2706
+ *
2707
+ * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
2685
2708
  * @example
2686
2709
  *```js
2687
2710
  * liveboardEmbed.on(EmbedEvent.Data, payload => {
@@ -2700,6 +2723,7 @@ export enum EmbedEvent {
2700
2723
  /**
2701
2724
  * Search query has been updated by the user.
2702
2725
  *
2726
+ * @version SDK: 1.4.0 | ThoughtSpot: ts7.sep.cl, 8.4.1.sw
2703
2727
  * @example
2704
2728
  *```js
2705
2729
  * searchEmbed.on(EmbedEvent.QueryChanged, payload => console.log('data', payload))
@@ -2709,12 +2733,14 @@ export enum EmbedEvent {
2709
2733
  /**
2710
2734
  * A drill-down operation has been performed.
2711
2735
  *
2736
+ * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
2737
+ *
2712
2738
  * @returns additionalFilters - Any additional filters applied
2713
2739
  * @returns drillDownColumns - The columns on which drill down was performed
2714
2740
  * @returns nonFilteredColumns - The columns that were not filtered
2715
2741
  * @example
2716
2742
  *```js
2717
- * searchEmbed.trigger(EmbedEvent.DrillDown, {
2743
+ * searchEmbed.on(EmbedEvent.DrillDown, {
2718
2744
  * points: {
2719
2745
  * clickedPoint,
2720
2746
  * selectedPoints: selectedPoint
@@ -2747,6 +2773,8 @@ export enum EmbedEvent {
2747
2773
  * One or more data sources have been selected.
2748
2774
  *
2749
2775
  * @returns dataSourceIds - the list of data sources
2776
+ *
2777
+ * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
2750
2778
  * @example
2751
2779
  * ```js
2752
2780
  * searchEmbed.on(EmbedEvent.DataSourceSelected, payload => {
@@ -2774,6 +2802,8 @@ export enum EmbedEvent {
2774
2802
  * @returns actionId - ID of the custom action
2775
2803
  * @returns payload {@link CustomActionPayload} - Response payload with the
2776
2804
  * Answer or Liveboard data
2805
+ *
2806
+ * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
2777
2807
  * @example
2778
2808
  * ```js
2779
2809
  * appEmbed.on(EmbedEvent.customAction, payload => {
@@ -2821,22 +2851,23 @@ export enum EmbedEvent {
2821
2851
  /**
2822
2852
  * An error has occurred. This event is fired for the following error types:
2823
2853
  *
2824
- * API - API call failure error.
2854
+ * `API`: API call failure error.
2825
2855
  *
2826
- * FULLSCREEN - Error when presenting a Liveboard or visualization in full screen
2827
- * mode.
2856
+ * `FULLSCREEN`: Error when presenting a Liveboard or visualization in full screen mode.
2828
2857
  *
2829
- * SINGLE_VALUE_FILTER - Error due to multiple values in the single value filter.
2858
+ * `SINGLE_VALUE_FILTER`: Error due to multiple values in the single value filter.
2830
2859
  *
2831
- * NON_EXIST_FILTER - Error due to a non-existent filter.
2860
+ * `NON_EXIST_FILTER`: Error due to a non-existent filter.
2832
2861
  *
2833
- * INVALID_DATE_VALUE - Invalid date value error.
2862
+ * `INVALID_DATE_VALUE`: Invalid date value error.
2834
2863
  *
2835
- * INVALID_OPERATOR - Use of invalid operator during filter application.
2864
+ * `INVALID_OPERATOR`: Use of invalid operator during filter application.
2836
2865
  *
2837
- * For more information, see [Developer Documentation](https://developers.thoughtspot.com/docs/events-app-integration#errorType)
2866
+ * For more information, see https://developers.thoughtspot.com/docs/events-app-integration#errorType.
2838
2867
  *
2839
2868
  * @returns error - An error object or message
2869
+ *
2870
+ * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
2840
2871
  * @example
2841
2872
  * ```js
2842
2873
  * // API error
@@ -2862,6 +2893,9 @@ export enum EmbedEvent {
2862
2893
  * The embedded object has sent an alert.
2863
2894
  *
2864
2895
  * @returns alert - An alert object
2896
+ *
2897
+ * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
2898
+ *
2865
2899
  * @example
2866
2900
  * ```js
2867
2901
  * searchEmbed.on(EmbedEvent.Alert)
@@ -2871,6 +2905,8 @@ export enum EmbedEvent {
2871
2905
  /**
2872
2906
  * The ThoughtSpot auth session has expired.
2873
2907
  *
2908
+ * @version SDK: 1.4.0 | ThoughtSpot: ts7.sep.cl, 8.4.1.sw
2909
+ *
2874
2910
  * @example
2875
2911
  *```js
2876
2912
  * appEmbed.on(EmbedEvent.AuthExpire, showAuthExpired)
@@ -2924,6 +2960,7 @@ export enum EmbedEvent {
2924
2960
  /**
2925
2961
  * Detects the route change.
2926
2962
  *
2963
+ * @version SDK: 1.7.0 | ThoughtSpot: 8.0.0.cl, 8.4.1.sw
2927
2964
  * @example
2928
2965
  *```js
2929
2966
  * searchEmbed.on(EmbedEvent.RouteChange, payload =>
@@ -2940,7 +2977,7 @@ export enum EmbedEvent {
2940
2977
  /**
2941
2978
  * Emitted when the embed does not have cookie access. This happens
2942
2979
  * when Safari and other Web browsers block third-party cookies
2943
- * are blocked by default. `NoCookieAccess` can trigger
2980
+ * are blocked by default.
2944
2981
  *
2945
2982
  * @example
2946
2983
  *```js
@@ -2983,7 +3020,7 @@ export enum EmbedEvent {
2983
3020
  /**
2984
3021
  * Emitted when the Liveboard shell loads.
2985
3022
  * You can use this event as a hook to trigger
2986
- * other events on the rendered Liveboard.
3023
+ * actions on the rendered Liveboard.
2987
3024
  *
2988
3025
  * @version SDK: 1.9.1 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw
2989
3026
  * @example
@@ -3004,8 +3041,7 @@ export enum EmbedEvent {
3004
3041
  */
3005
3042
  LiveboardRendered = "PinboardRendered",
3006
3043
  /**
3007
- * This can be used to register an event listener which
3008
- * is triggered on all events.
3044
+ * Emits all events.
3009
3045
  *
3010
3046
  * @Version SDK: 1.10.0 | ThoughtSpot: 8.2.0.cl, 8.4.1.sw
3011
3047
  * @example
@@ -3022,13 +3058,13 @@ export enum EmbedEvent {
3022
3058
  * @Version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
3023
3059
  * @example
3024
3060
  *```js
3025
- * //trigger when action starts
3061
+ * //Emit when action starts
3026
3062
  * searchEmbed.on(EmbedEvent.Save, payload => {
3027
3063
  * console.log('Save', payload)
3028
3064
  * }, {
3029
3065
  * start: true
3030
3066
  * })
3031
- * //trigger when action ends
3067
+ * //emit when action ends
3032
3068
  * searchEmbed.on(EmbedEvent.Save, payload => {
3033
3069
  * console.log('Save', payload)
3034
3070
  * })
@@ -3038,7 +3074,7 @@ export enum EmbedEvent {
3038
3074
  /**
3039
3075
  * Emitted when the download action is triggered on an answer
3040
3076
  *
3041
- * **Note**: This event is deprecated in v1.21.0.
3077
+ * **Note**: This event is deprecated in v1.21.0.
3042
3078
  * To fire an event when a download action is initiated on a chart or table,
3043
3079
  * use `EmbedEvent.DownloadAsPng`, `EmbedEvent.DownloadAsPDF`, `EmbedEvent.DownloadAsCSV`,
3044
3080
  * or `EmbedEvent.DownloadAsXLSX`
@@ -3046,7 +3082,7 @@ export enum EmbedEvent {
3046
3082
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
3047
3083
  * @example
3048
3084
  *```js
3049
- * liveboardEmbed.trigger(HostEvent.Download, {
3085
+ * liveboardEmbed.on(EmbedEvent.Download, {
3050
3086
  * vizId: '730496d6-6903-4601-937e-2c691821af3c'
3051
3087
  * })
3052
3088
  *```
@@ -3058,10 +3094,10 @@ export enum EmbedEvent {
3058
3094
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.0.sw
3059
3095
  * @example
3060
3096
  *```js
3061
- * //trigger when action starts
3097
+ * //emit when action starts
3062
3098
  * searchEmbed.on(EmbedEvent.DownloadAsPng, payload => {
3063
3099
  * console.log('download PNG', payload)}, {start: true })
3064
- * //trigger when action ends
3100
+ * //emit when action ends
3065
3101
  * searchEmbed.on(EmbedEvent.DownloadAsPng, payload => {
3066
3102
  * console.log('download PNG', payload)})
3067
3103
  *```
@@ -3073,10 +3109,10 @@ export enum EmbedEvent {
3073
3109
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
3074
3110
  * @example
3075
3111
  *```js
3076
- * //trigger when action starts
3112
+ * //emit when action starts
3077
3113
  * searchEmbed.on(EmbedEvent.DownloadAsPdf, payload => {
3078
3114
  * console.log('download PDF', payload)}, {start: true })
3079
- * //trigger when action ends
3115
+ * //emit when action ends
3080
3116
  * searchEmbed.on(EmbedEvent.DownloadAsPdf, payload => {
3081
3117
  * console.log('download PDF', payload)})
3082
3118
  *```
@@ -3088,10 +3124,10 @@ export enum EmbedEvent {
3088
3124
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
3089
3125
  * @example
3090
3126
  *```js
3091
- * //trigger when action starts
3127
+ * //emit when action starts
3092
3128
  * searchEmbed.on(EmbedEvent.DownloadAsCSV, payload => {
3093
3129
  * console.log('download CSV', payload)}, {start: true })
3094
- * //trigger when action ends
3130
+ * //emit when action ends
3095
3131
  * searchEmbed.on(EmbedEvent.DownloadAsCSV, payload => {
3096
3132
  * console.log('download CSV', payload)})
3097
3133
  *```
@@ -3103,10 +3139,10 @@ export enum EmbedEvent {
3103
3139
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
3104
3140
  * @example
3105
3141
  *```js
3106
- * //trigger when action starts
3142
+ * //emit when action starts
3107
3143
  * searchEmbed.on(EmbedEvent.DownloadAsXlsx, payload => {
3108
3144
  * console.log('download Xlsx', payload)}, { start: true })
3109
- * //trigger when action ends
3145
+ * //emit when action ends
3110
3146
  * searchEmbed.on(EmbedEvent.DownloadAsXlsx, payload => {
3111
3147
  * console.log('download Xlsx', payload)})
3112
3148
  *```
@@ -3118,10 +3154,10 @@ export enum EmbedEvent {
3118
3154
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
3119
3155
  * @example
3120
3156
  *```js
3121
- * //trigger when action starts
3157
+ * //emit when action starts
3122
3158
  * appEmbed.on(EmbedEvent.AnswerDelete, payload => {
3123
3159
  * console.log('delete answer', payload)}, {start: true })
3124
- * //trigger when action is completed
3160
+ * //emit when action is completed
3125
3161
  * appEmbed.on(EmbedEvent.AnswerDelete, payload => {
3126
3162
  * console.log('delete answer', payload)})
3127
3163
  *```
@@ -3133,13 +3169,13 @@ export enum EmbedEvent {
3133
3169
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
3134
3170
  * @example
3135
3171
  *```js
3136
- * //trigger when action starts
3172
+ * //emit when action starts
3137
3173
  * searchEmbed.on(EmbedEvent.Pin, payload => {
3138
3174
  * console.log('pin', payload)
3139
3175
  * }, {
3140
3176
  * start: true
3141
3177
  * })
3142
- * //trigger when action ends
3178
+ * //emit when action ends
3143
3179
  * searchEmbed.on(EmbedEvent.Pin, payload => {
3144
3180
  * console.log('pin', payload)
3145
3181
  * })
@@ -3152,13 +3188,13 @@ export enum EmbedEvent {
3152
3188
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
3153
3189
  * @example
3154
3190
  *```js
3155
- * //trigger when action starts
3191
+ * //emit when action starts
3156
3192
  * searchEmbed.on(EmbedEvent.SpotIQAnalyze, payload => {
3157
3193
  * console.log('SpotIQAnalyze', payload)
3158
3194
  * }, {
3159
3195
  * start: true
3160
3196
  * })
3161
- * //trigger when action ends
3197
+ * //emit when action ends
3162
3198
  * searchEmbed.on(EmbedEvent.SpotIQAnalyze, payload => {
3163
3199
  * console.log('SpotIQ analyze', payload)
3164
3200
  * })
@@ -3171,13 +3207,13 @@ export enum EmbedEvent {
3171
3207
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
3172
3208
  * @example
3173
3209
  *```js
3174
- * //trigger when action starts
3210
+ * //emit when action starts
3175
3211
  * searchEmbed.on(EmbedEvent.Share, payload => {
3176
3212
  * console.log('Share', payload)
3177
3213
  * }, {
3178
3214
  * start: true
3179
3215
  * })
3180
- * //trigger when action ends
3216
+ * //emit when action ends
3181
3217
  * searchEmbed.on(EmbedEvent.Share, payload => {
3182
3218
  * console.log('Share', payload)
3183
3219
  * })
@@ -3252,10 +3288,10 @@ export enum EmbedEvent {
3252
3288
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
3253
3289
  * @example
3254
3290
  *```js
3255
- * //trigger when action starts
3291
+ * //emit when action starts
3256
3292
  * searchEmbed.on(EmbedEvent.ExportTML, payload => {
3257
3293
  * console.log('Export TML', payload)}, { start: true })
3258
- * //trigger when action ends
3294
+ * //emit when action ends
3259
3295
  * searchEmbed.on(EmbedEvent.ExportTML, payload => {
3260
3296
  * console.log('Export TML', payload)})
3261
3297
  *```
@@ -3279,10 +3315,10 @@ export enum EmbedEvent {
3279
3315
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
3280
3316
  * @example
3281
3317
  *```js
3282
- * //trigger when action starts
3318
+ * //emit when action starts
3283
3319
  * appEmbed.on(EmbedEvent.CopyAEdit, payload => {
3284
3320
  * console.log('Copy and edit', payload)}, {start: true })
3285
- * //trigger when action ends
3321
+ * //emit when action ends
3286
3322
  * appEmbed.on(EmbedEvent.CopyAEdit, payload => {
3287
3323
  * console.log('Copy and edit', payload)})
3288
3324
  *```
@@ -3384,7 +3420,7 @@ export enum EmbedEvent {
3384
3420
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
3385
3421
  * @example
3386
3422
  *```js
3387
- * liveboardEmbed.trigger(HostEvent.Present)
3423
+ * liveboardEmbed.on(EmbedEvent.Present)
3388
3424
  *```
3389
3425
  * @example
3390
3426
  *```js
@@ -3400,7 +3436,7 @@ export enum EmbedEvent {
3400
3436
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
3401
3437
  * @example
3402
3438
  *```js
3403
- * liveboardEmbed.trigger(EmbedEvent.Delete,
3439
+ * liveboardEmbed.on(EmbedEvent.Delete,
3404
3440
  * {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
3405
3441
  *```
3406
3442
  */
@@ -3411,7 +3447,7 @@ export enum EmbedEvent {
3411
3447
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
3412
3448
  * @example
3413
3449
  *```js
3414
- * liveboardEmbed.trigger(EmbedEvent.SchedulesList)
3450
+ * liveboardEmbed.on(EmbedEvent.SchedulesList)
3415
3451
  *```
3416
3452
  */
3417
3453
  SchedulesList = "schedule-list",
@@ -3421,7 +3457,7 @@ export enum EmbedEvent {
3421
3457
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
3422
3458
  * @example
3423
3459
  *```js
3424
- * liveboardEmbed.trigger(EmbedEvent.Cancel)
3460
+ * liveboardEmbed.on(EmbedEvent.Cancel)
3425
3461
  *```
3426
3462
  */
3427
3463
  Cancel = "cancel",
@@ -3431,7 +3467,7 @@ export enum EmbedEvent {
3431
3467
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
3432
3468
  * @example
3433
3469
  *```js
3434
- * liveboardEmbed.trigger(EmbedEvent.Explore, {
3470
+ * liveboardEmbed.on(EmbedEvent.Explore, {
3435
3471
  * vizId: '730496d6-6903-4601-937e-2c691821af3c'})
3436
3472
  *```
3437
3473
  */
@@ -3442,7 +3478,7 @@ export enum EmbedEvent {
3442
3478
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
3443
3479
  * @example
3444
3480
  *```js
3445
- * liveboardEmbed.trigger(EmbedEvent.CopyLink, {
3481
+ * liveboardEmbed.on(EmbedEvent.CopyLink, {
3446
3482
  * vizId: '730496d6-6903-4601-937e-2c691821af3c'})
3447
3483
  *```
3448
3484
  */
@@ -3453,7 +3489,7 @@ export enum EmbedEvent {
3453
3489
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.0.sw
3454
3490
  * @example
3455
3491
  *```js
3456
- * liveboardEmbed.trigger(HostEvent.CrossFilterChanged, {
3492
+ * liveboardEmbed.on(EmbedEvent.CrossFilterChanged, {
3457
3493
  * vizId: '730496d6-6903-4601-937e-2c691821af3c'})
3458
3494
  *```
3459
3495
  */
@@ -3477,9 +3513,18 @@ export enum EmbedEvent {
3477
3513
  */
3478
3514
  InsertIntoSlide = "insertInToSlide",
3479
3515
  /**
3480
- * @hidden
3481
3516
  * Emitted when a user changes any filter on a Liveboard.
3517
+ * Returns filter type and name, column name and ID, and runtime
3518
+ * filter details.
3519
+ *
3482
3520
  * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl, 9.5.0.sw
3521
+ * @example
3522
+ *
3523
+ *```js
3524
+ * LiveboardEmbed.on(EmbedEvent.FilterChanged, (payload) => {
3525
+ * console.log('payload', payload);
3526
+ * })
3527
+ *```
3483
3528
  */
3484
3529
  FilterChanged = "filterChanged",
3485
3530
  /**
@@ -4014,7 +4059,7 @@ export enum HostEvent {
4014
4059
  * ```js
4015
4060
  * searchEmbed.trigger(HostEvent.GetTML).then((tml) => {
4016
4061
  * console.log(
4017
- * tml.search_query // TML representation of the search query
4062
+ * tml.answer.search_query // TML representation of the search query
4018
4063
  * );
4019
4064
  * })
4020
4065
  * ```
@@ -4257,7 +4302,7 @@ export enum HostEvent {
4257
4302
  *
4258
4303
  * ```js
4259
4304
  * liveboardEmbed.trigger(HostEvent.UpdateFilters, {
4260
- * filter: { column: 'column name', oper: 'IN', values: [1,2,3], is_mandatory: false }
4305
+ * filter: { column: 'column name', oper: 'IN', values: [1,2,3]}
4261
4306
  * })
4262
4307
  * ```
4263
4308
  * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
@@ -5395,7 +5440,7 @@ export enum Action {
5395
5440
  * disabledActions: [Action.TML] // to disable all TML actions
5396
5441
  * ```
5397
5442
  *
5398
- * @version SDK : 1.28.2 | Thoughtspot: 9.10.5.cl
5443
+ * @version SDK : 1.28.3 | Thoughtspot: 9.12.0.cl
5399
5444
  */
5400
5445
  TML = "tml",
5401
5446
  /**
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thoughtspot/visual-embed-sdk",
3
- "version": "1.28.4",
3
+ "version": "1.28.5",
4
4
  "description": "ThoughtSpot Embed SDK",
5
5
  "module": "lib/src/index.js",
6
6
  "main": "dist/tsembed.js",
@@ -1 +1 @@
1
- {"version":3,"file":"authToken.d.ts","sourceRoot":"","sources":["../../src/authToken.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAWtC,eAAO,MAAM,sBAAsB,gBAAuB,WAAW,KAAG,QAAQ,MAAM,CA2BrF,CAAC;AAyBF;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,QAAO,IAEvC,CAAC"}
1
+ {"version":3,"file":"authToken.d.ts","sourceRoot":"","sources":["../../src/authToken.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAYtC,eAAO,MAAM,sBAAsB,gBAAuB,WAAW,KAAG,QAAQ,MAAM,CA6BrF,CAAC;AA6BF;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,QAAO,IAEvC,CAAC"}
@@ -1,11 +1,14 @@
1
1
  import { fetchAuthTokenService, verifyTokenService } from './utils/authService/authService';
2
+ import { logger } from './utils/logger';
2
3
  const DUPLICATE_TOKEN_ERR = 'Duplicate token, please issue a new token every time getAuthToken callback is called.'
3
4
  + 'See https://developers.thoughtspot.com/docs/?pageid=embed-auth#trusted-auth-embed for more details.';
4
5
  const INVALID_TOKEN_ERR = 'Invalid token received form token callback or authToken endpoint.';
5
6
  let cachedAuthToken = null;
6
7
  // This method can be used to get the authToken using the embedConfig
7
8
  export const getAuthenticationToken = async (embedConfig) => {
8
- if (cachedAuthToken) {
9
+ // Since we don't have token validation enabled , we cannot tell if the
10
+ // cached token is valid or not. So we will always fetch a new token.
11
+ if (cachedAuthToken && !embedConfig.disableTokenVerification) {
9
12
  let isCachedTokenStillValid;
10
13
  try {
11
14
  isCachedTokenStillValid = await validateAuthToken(embedConfig, cachedAuthToken, true);
@@ -31,6 +34,10 @@ export const getAuthenticationToken = async (embedConfig) => {
31
34
  return authToken;
32
35
  };
33
36
  const validateAuthToken = async (embedConfig, authToken, suppressAlert) => {
37
+ if (embedConfig.disableTokenVerification) {
38
+ logger.info('Token verification is disabled. Assuming token is valid.');
39
+ return true;
40
+ }
34
41
  try {
35
42
  const isTokenValid = await verifyTokenService(embedConfig.thoughtSpotHost, authToken);
36
43
  if (isTokenValid)
@@ -1 +1 @@
1
- {"version":3,"file":"authToken.js","sourceRoot":"","sources":["../../src/authToken.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAE5F,MAAM,mBAAmB,GAAG,uFAAuF;MAC7G,qGAAqG,CAAC;AAE5G,MAAM,iBAAiB,GAAG,mEAAmE,CAAC;AAE9F,IAAI,eAAe,GAAkB,IA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G,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;KACrC;IAED,kDAAkD;IAClD,MAAM,iBAAiB,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IAEhD,eAAe,GAAG,SAAS,CAAC;IAC5B,OAAO,SAAS,CAAC;AACrB,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,KAAK,EAC3B,WAAwB,EACxB,SAAiB,EACjB,aAAuB,EACP,EAAE;IAClB,IAAI,WAAW,CAAC,wBAAwB,EAAE;QACtC,MAAM,CAAC,IAAI,CAAC,0DAA0D,CAAC,CAAC;QACxE,OAAO,IAAI,CAAC;KACf;IACD,IAAI;QACA,MAAM,YAAY,GAAG,MAAM,kBAAkB,CAAC,WAAW,CAAC,eAAe,EAAE,SAAS,CAAC,CAAC;QACtF,IAAI,YAAY;YAAE,OAAO,IAAI,CAAC;KACjC;IAAC,MAAM;QACJ,OAAO,KAAK,CAAC;KAChB;IAED,IAAI,eAAe,IAAI,eAAe,KAAK,SAAS,EAAE;QAClD,IAAI,CAAC,WAAW,CAAC,mBAAmB,IAAI,CAAC,aAAa,EAAE;YACpD,oCAAoC;YACpC,KAAK,CAAC,mBAAmB,CAAC,CAAC;SAC9B;QACD,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;KACxC;SAAM;QACH,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;KACtC;AACL,CAAC,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAS,EAAE;IAC3C,eAAe,GAAG,IAAI,CAAC;AAC3B,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=authToken.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authToken.spec.d.ts","sourceRoot":"","sources":["../../src/authToken.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,26 @@
1
+ import { getAuthenticationToken, resetCachedAuthToken } from './authToken';
2
+ import * as authServiceInstance from './utils/authService/authService';
3
+ describe('AuthToken Unit tests', () => {
4
+ test('getAuthenticationToken: When verification is disabled', async () => {
5
+ jest.spyOn(authServiceInstance, 'verifyTokenService');
6
+ const token = await getAuthenticationToken({
7
+ getAuthToken: async () => 'abc3',
8
+ disableTokenVerification: true,
9
+ });
10
+ expect(token).toBe('abc3');
11
+ expect(authServiceInstance.verifyTokenService).not.toBeCalled();
12
+ });
13
+ test.only('getAuthenticationToken: When verification is enabled', async () => {
14
+ resetCachedAuthToken();
15
+ jest.clearAllMocks();
16
+ jest.spyOn(authServiceInstance, 'verifyTokenService').mockImplementation(() => true);
17
+ const token = await getAuthenticationToken({
18
+ thoughtSpotHost: 'test',
19
+ getAuthToken: async () => 'abc2',
20
+ disableTokenVerification: false,
21
+ });
22
+ expect(token).toBe('abc2');
23
+ expect(authServiceInstance.verifyTokenService).toBeCalledWith('test', 'abc2');
24
+ });
25
+ });
26
+ //# sourceMappingURL=authToken.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authToken.spec.js","sourceRoot":"","sources":["../../src/authToken.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,KAAK,mBAAmB,MAAM,iCAAiC,CAAC;AAGvE,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IAClC,IAAI,CAAC,uDAAuD,EAAE,KAAK,IAAI,EAAE;QACrE,IAAI,CAAC,KAAK,CAAC,mBAAmB,EAAE,oBAAoB,CAAC,CAAC;QAEtD,MAAM,KAAK,GAAG,MAAM,sBAAsB,CAAC;YACvC,YAAY,EAAE,KAAK,IAAI,EAAE,CAAC,MAAM;YAChC,wBAAwB,EAAE,IAAI;SAClB,CAAC,CAAC;QAElB,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC3B,MAAM,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC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