@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.
- package/cjs/package.json +1 -1
- package/cjs/src/authToken.d.ts.map +1 -1
- package/cjs/src/authToken.js +8 -1
- package/cjs/src/authToken.js.map +1 -1
- package/cjs/src/authToken.spec.d.ts +2 -0
- package/cjs/src/authToken.spec.d.ts.map +1 -0
- package/cjs/src/authToken.spec.js +29 -0
- package/cjs/src/authToken.spec.js.map +1 -0
- package/cjs/src/types.d.ts +93 -48
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +76 -48
- package/cjs/src/types.js.map +1 -1
- package/dist/src/authToken.d.ts.map +1 -1
- package/dist/src/authToken.spec.d.ts +2 -0
- package/dist/src/authToken.spec.d.ts.map +1 -0
- package/dist/src/types.d.ts +93 -48
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +84 -50
- package/dist/tsembed-react.js +84 -50
- package/dist/tsembed.es.js +84 -50
- package/dist/tsembed.js +84 -50
- package/dist/visual-embed-sdk-react-full.d.ts +93 -48
- package/dist/visual-embed-sdk-react.d.ts +93 -48
- package/dist/visual-embed-sdk.d.ts +93 -48
- package/lib/package.json +1 -1
- package/lib/src/authToken.d.ts.map +1 -1
- package/lib/src/authToken.js +8 -1
- package/lib/src/authToken.js.map +1 -1
- package/lib/src/authToken.spec.d.ts +2 -0
- package/lib/src/authToken.spec.d.ts.map +1 -0
- package/lib/src/authToken.spec.js +26 -0
- package/lib/src/authToken.spec.js.map +1 -0
- package/lib/src/types.d.ts +93 -48
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +76 -48
- package/lib/src/types.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +93 -48
- package/package.json +1 -1
- package/src/authToken.spec.ts +31 -0
- package/src/authToken.ts +8 -1
- package/src/types.ts +94 -48
- package/cjs/src/utils/authService/tokenizedAuthService.spec.d.ts +0 -2
- package/cjs/src/utils/authService/tokenizedAuthService.spec.d.ts.map +0 -1
- package/cjs/src/utils/authService/tokenizedAuthService.spec.js +0 -32
- package/cjs/src/utils/authService/tokenizedAuthService.spec.js.map +0 -1
- package/cjs/src/utils/sessionInfoService.d.ts +0 -66
- package/cjs/src/utils/sessionInfoService.d.ts.map +0 -1
- package/cjs/src/utils/sessionInfoService.js +0 -92
- package/cjs/src/utils/sessionInfoService.js.map +0 -1
- package/dist/src/utils/authService/tokenizedAuthService.spec.d.ts +0 -2
- package/dist/src/utils/authService/tokenizedAuthService.spec.d.ts.map +0 -1
- package/dist/src/utils/sessionInfoService.d.ts +0 -66
- package/dist/src/utils/sessionInfoService.d.ts.map +0 -1
- package/lib/src/utils/authService/tokenizedAuthService.spec.d.ts +0 -2
- package/lib/src/utils/authService/tokenizedAuthService.spec.d.ts.map +0 -1
- package/lib/src/utils/authService/tokenizedAuthService.spec.js +0 -29
- package/lib/src/utils/authService/tokenizedAuthService.spec.js.map +0 -1
- package/lib/src/utils/sessionInfoService.d.ts +0 -66
- package/lib/src/utils/sessionInfoService.d.ts.map +0 -1
- package/lib/src/utils/sessionInfoService.js +0 -85
- package/lib/src/utils/sessionInfoService.js.map +0 -1
|
@@ -2047,6 +2047,23 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
2047
2047
|
* @version SDK: 1.28.4 | Thoughtspot: 10.0.0.cl, 9.5.0.sw
|
|
2048
2048
|
*/
|
|
2049
2049
|
currencyFormat?: string;
|
|
2050
|
+
/**
|
|
2051
|
+
* This flag is used to disable the token verification in the SDK.
|
|
2052
|
+
* Enabling this flag will also disable the caching of the token.
|
|
2053
|
+
*
|
|
2054
|
+
* @hidden
|
|
2055
|
+
*
|
|
2056
|
+
* @example
|
|
2057
|
+
* ```js
|
|
2058
|
+
* init({
|
|
2059
|
+
* ...embedConfig,
|
|
2060
|
+
* disableTokenVerification : true
|
|
2061
|
+
* })
|
|
2062
|
+
* ```
|
|
2063
|
+
*
|
|
2064
|
+
* @version SDK: 1.28.5 | Thoughtspot: *
|
|
2065
|
+
*/
|
|
2066
|
+
disableTokenVerification?: boolean;
|
|
2050
2067
|
}
|
|
2051
2068
|
export interface LayoutConfig {
|
|
2052
2069
|
}
|
|
@@ -2697,6 +2714,8 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
2697
2714
|
/**
|
|
2698
2715
|
* Authentication has either succeeded or failed.
|
|
2699
2716
|
*
|
|
2717
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
2718
|
+
*
|
|
2700
2719
|
* @example
|
|
2701
2720
|
*```js
|
|
2702
2721
|
* appEmbed.on(EmbedEvent.AuthInit, payload => {
|
|
@@ -2710,6 +2729,8 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
2710
2729
|
* The embed object container has loaded.
|
|
2711
2730
|
*
|
|
2712
2731
|
* @returns timestamp - The timestamp when the event was generated.
|
|
2732
|
+
*
|
|
2733
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
2713
2734
|
* @example
|
|
2714
2735
|
*```js
|
|
2715
2736
|
* liveboardEmbed.on(EmbedEvent.Load, hideLoader)
|
|
@@ -2724,6 +2745,8 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
2724
2745
|
* Data pertaining to answer or Liveboard is received
|
|
2725
2746
|
*
|
|
2726
2747
|
* @return data - The answer or Liveboard data
|
|
2748
|
+
*
|
|
2749
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
2727
2750
|
* @example
|
|
2728
2751
|
*```js
|
|
2729
2752
|
* liveboardEmbed.on(EmbedEvent.Data, payload => {
|
|
@@ -2742,6 +2765,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
2742
2765
|
/**
|
|
2743
2766
|
* Search query has been updated by the user.
|
|
2744
2767
|
*
|
|
2768
|
+
* @version SDK: 1.4.0 | ThoughtSpot: ts7.sep.cl, 8.4.1.sw
|
|
2745
2769
|
* @example
|
|
2746
2770
|
*```js
|
|
2747
2771
|
* searchEmbed.on(EmbedEvent.QueryChanged, payload => console.log('data', payload))
|
|
@@ -2751,12 +2775,14 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
2751
2775
|
/**
|
|
2752
2776
|
* A drill-down operation has been performed.
|
|
2753
2777
|
*
|
|
2778
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
2779
|
+
*
|
|
2754
2780
|
* @returns additionalFilters - Any additional filters applied
|
|
2755
2781
|
* @returns drillDownColumns - The columns on which drill down was performed
|
|
2756
2782
|
* @returns nonFilteredColumns - The columns that were not filtered
|
|
2757
2783
|
* @example
|
|
2758
2784
|
*```js
|
|
2759
|
-
* searchEmbed.
|
|
2785
|
+
* searchEmbed.on(EmbedEvent.DrillDown, {
|
|
2760
2786
|
* points: {
|
|
2761
2787
|
* clickedPoint,
|
|
2762
2788
|
* selectedPoints: selectedPoint
|
|
@@ -2789,6 +2815,8 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
2789
2815
|
* One or more data sources have been selected.
|
|
2790
2816
|
*
|
|
2791
2817
|
* @returns dataSourceIds - the list of data sources
|
|
2818
|
+
*
|
|
2819
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
2792
2820
|
* @example
|
|
2793
2821
|
* ```js
|
|
2794
2822
|
* searchEmbed.on(EmbedEvent.DataSourceSelected, payload => {
|
|
@@ -2816,6 +2844,8 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
2816
2844
|
* @returns actionId - ID of the custom action
|
|
2817
2845
|
* @returns payload {@link CustomActionPayload} - Response payload with the
|
|
2818
2846
|
* Answer or Liveboard data
|
|
2847
|
+
*
|
|
2848
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
2819
2849
|
* @example
|
|
2820
2850
|
* ```js
|
|
2821
2851
|
* appEmbed.on(EmbedEvent.customAction, payload => {
|
|
@@ -2863,22 +2893,23 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
2863
2893
|
/**
|
|
2864
2894
|
* An error has occurred. This event is fired for the following error types:
|
|
2865
2895
|
*
|
|
2866
|
-
*
|
|
2896
|
+
* `API`: API call failure error.
|
|
2867
2897
|
*
|
|
2868
|
-
*
|
|
2869
|
-
* mode.
|
|
2898
|
+
* `FULLSCREEN`: Error when presenting a Liveboard or visualization in full screen mode.
|
|
2870
2899
|
*
|
|
2871
|
-
*
|
|
2900
|
+
* `SINGLE_VALUE_FILTER`: Error due to multiple values in the single value filter.
|
|
2872
2901
|
*
|
|
2873
|
-
*
|
|
2902
|
+
* `NON_EXIST_FILTER`: Error due to a non-existent filter.
|
|
2874
2903
|
*
|
|
2875
|
-
*
|
|
2904
|
+
* `INVALID_DATE_VALUE`: Invalid date value error.
|
|
2876
2905
|
*
|
|
2877
|
-
*
|
|
2906
|
+
* `INVALID_OPERATOR`: Use of invalid operator during filter application.
|
|
2878
2907
|
*
|
|
2879
|
-
* For more information, see
|
|
2908
|
+
* For more information, see https://developers.thoughtspot.com/docs/events-app-integration#errorType.
|
|
2880
2909
|
*
|
|
2881
2910
|
* @returns error - An error object or message
|
|
2911
|
+
*
|
|
2912
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
2882
2913
|
* @example
|
|
2883
2914
|
* ```js
|
|
2884
2915
|
* // API error
|
|
@@ -2904,6 +2935,9 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
2904
2935
|
* The embedded object has sent an alert.
|
|
2905
2936
|
*
|
|
2906
2937
|
* @returns alert - An alert object
|
|
2938
|
+
*
|
|
2939
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
2940
|
+
*
|
|
2907
2941
|
* @example
|
|
2908
2942
|
* ```js
|
|
2909
2943
|
* searchEmbed.on(EmbedEvent.Alert)
|
|
@@ -2913,6 +2947,8 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
2913
2947
|
/**
|
|
2914
2948
|
* The ThoughtSpot auth session has expired.
|
|
2915
2949
|
*
|
|
2950
|
+
* @version SDK: 1.4.0 | ThoughtSpot: ts7.sep.cl, 8.4.1.sw
|
|
2951
|
+
*
|
|
2916
2952
|
* @example
|
|
2917
2953
|
*```js
|
|
2918
2954
|
* appEmbed.on(EmbedEvent.AuthExpire, showAuthExpired)
|
|
@@ -2966,6 +3002,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
2966
3002
|
/**
|
|
2967
3003
|
* Detects the route change.
|
|
2968
3004
|
*
|
|
3005
|
+
* @version SDK: 1.7.0 | ThoughtSpot: 8.0.0.cl, 8.4.1.sw
|
|
2969
3006
|
* @example
|
|
2970
3007
|
*```js
|
|
2971
3008
|
* searchEmbed.on(EmbedEvent.RouteChange, payload =>
|
|
@@ -2982,7 +3019,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
2982
3019
|
/**
|
|
2983
3020
|
* Emitted when the embed does not have cookie access. This happens
|
|
2984
3021
|
* when Safari and other Web browsers block third-party cookies
|
|
2985
|
-
* are blocked by default.
|
|
3022
|
+
* are blocked by default.
|
|
2986
3023
|
*
|
|
2987
3024
|
* @example
|
|
2988
3025
|
*```js
|
|
@@ -3025,7 +3062,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
3025
3062
|
/**
|
|
3026
3063
|
* Emitted when the Liveboard shell loads.
|
|
3027
3064
|
* You can use this event as a hook to trigger
|
|
3028
|
-
*
|
|
3065
|
+
* actions on the rendered Liveboard.
|
|
3029
3066
|
*
|
|
3030
3067
|
* @version SDK: 1.9.1 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw
|
|
3031
3068
|
* @example
|
|
@@ -3046,8 +3083,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
3046
3083
|
*/
|
|
3047
3084
|
LiveboardRendered = "PinboardRendered",
|
|
3048
3085
|
/**
|
|
3049
|
-
*
|
|
3050
|
-
* is triggered on all events.
|
|
3086
|
+
* Emits all events.
|
|
3051
3087
|
*
|
|
3052
3088
|
* @Version SDK: 1.10.0 | ThoughtSpot: 8.2.0.cl, 8.4.1.sw
|
|
3053
3089
|
* @example
|
|
@@ -3064,13 +3100,13 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
3064
3100
|
* @Version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
3065
3101
|
* @example
|
|
3066
3102
|
*```js
|
|
3067
|
-
* //
|
|
3103
|
+
* //Emit when action starts
|
|
3068
3104
|
* searchEmbed.on(EmbedEvent.Save, payload => {
|
|
3069
3105
|
* console.log('Save', payload)
|
|
3070
3106
|
* }, {
|
|
3071
3107
|
* start: true
|
|
3072
3108
|
* })
|
|
3073
|
-
* //
|
|
3109
|
+
* //emit when action ends
|
|
3074
3110
|
* searchEmbed.on(EmbedEvent.Save, payload => {
|
|
3075
3111
|
* console.log('Save', payload)
|
|
3076
3112
|
* })
|
|
@@ -3080,7 +3116,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
3080
3116
|
/**
|
|
3081
3117
|
* Emitted when the download action is triggered on an answer
|
|
3082
3118
|
*
|
|
3083
|
-
*
|
|
3119
|
+
* **Note**: This event is deprecated in v1.21.0.
|
|
3084
3120
|
* To fire an event when a download action is initiated on a chart or table,
|
|
3085
3121
|
* use `EmbedEvent.DownloadAsPng`, `EmbedEvent.DownloadAsPDF`, `EmbedEvent.DownloadAsCSV`,
|
|
3086
3122
|
* or `EmbedEvent.DownloadAsXLSX`
|
|
@@ -3088,7 +3124,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
3088
3124
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
3089
3125
|
* @example
|
|
3090
3126
|
*```js
|
|
3091
|
-
* liveboardEmbed.
|
|
3127
|
+
* liveboardEmbed.on(EmbedEvent.Download, {
|
|
3092
3128
|
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
3093
3129
|
* })
|
|
3094
3130
|
*```
|
|
@@ -3100,10 +3136,10 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
3100
3136
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.0.sw
|
|
3101
3137
|
* @example
|
|
3102
3138
|
*```js
|
|
3103
|
-
* //
|
|
3139
|
+
* //emit when action starts
|
|
3104
3140
|
* searchEmbed.on(EmbedEvent.DownloadAsPng, payload => {
|
|
3105
3141
|
* console.log('download PNG', payload)}, {start: true })
|
|
3106
|
-
* //
|
|
3142
|
+
* //emit when action ends
|
|
3107
3143
|
* searchEmbed.on(EmbedEvent.DownloadAsPng, payload => {
|
|
3108
3144
|
* console.log('download PNG', payload)})
|
|
3109
3145
|
*```
|
|
@@ -3115,10 +3151,10 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
3115
3151
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
3116
3152
|
* @example
|
|
3117
3153
|
*```js
|
|
3118
|
-
* //
|
|
3154
|
+
* //emit when action starts
|
|
3119
3155
|
* searchEmbed.on(EmbedEvent.DownloadAsPdf, payload => {
|
|
3120
3156
|
* console.log('download PDF', payload)}, {start: true })
|
|
3121
|
-
* //
|
|
3157
|
+
* //emit when action ends
|
|
3122
3158
|
* searchEmbed.on(EmbedEvent.DownloadAsPdf, payload => {
|
|
3123
3159
|
* console.log('download PDF', payload)})
|
|
3124
3160
|
*```
|
|
@@ -3130,10 +3166,10 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
3130
3166
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
3131
3167
|
* @example
|
|
3132
3168
|
*```js
|
|
3133
|
-
* //
|
|
3169
|
+
* //emit when action starts
|
|
3134
3170
|
* searchEmbed.on(EmbedEvent.DownloadAsCSV, payload => {
|
|
3135
3171
|
* console.log('download CSV', payload)}, {start: true })
|
|
3136
|
-
* //
|
|
3172
|
+
* //emit when action ends
|
|
3137
3173
|
* searchEmbed.on(EmbedEvent.DownloadAsCSV, payload => {
|
|
3138
3174
|
* console.log('download CSV', payload)})
|
|
3139
3175
|
*```
|
|
@@ -3145,10 +3181,10 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
3145
3181
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
3146
3182
|
* @example
|
|
3147
3183
|
*```js
|
|
3148
|
-
* //
|
|
3184
|
+
* //emit when action starts
|
|
3149
3185
|
* searchEmbed.on(EmbedEvent.DownloadAsXlsx, payload => {
|
|
3150
3186
|
* console.log('download Xlsx', payload)}, { start: true })
|
|
3151
|
-
* //
|
|
3187
|
+
* //emit when action ends
|
|
3152
3188
|
* searchEmbed.on(EmbedEvent.DownloadAsXlsx, payload => {
|
|
3153
3189
|
* console.log('download Xlsx', payload)})
|
|
3154
3190
|
*```
|
|
@@ -3160,10 +3196,10 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
3160
3196
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
3161
3197
|
* @example
|
|
3162
3198
|
*```js
|
|
3163
|
-
* //
|
|
3199
|
+
* //emit when action starts
|
|
3164
3200
|
* appEmbed.on(EmbedEvent.AnswerDelete, payload => {
|
|
3165
3201
|
* console.log('delete answer', payload)}, {start: true })
|
|
3166
|
-
* //
|
|
3202
|
+
* //emit when action is completed
|
|
3167
3203
|
* appEmbed.on(EmbedEvent.AnswerDelete, payload => {
|
|
3168
3204
|
* console.log('delete answer', payload)})
|
|
3169
3205
|
*```
|
|
@@ -3175,13 +3211,13 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
3175
3211
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
3176
3212
|
* @example
|
|
3177
3213
|
*```js
|
|
3178
|
-
* //
|
|
3214
|
+
* //emit when action starts
|
|
3179
3215
|
* searchEmbed.on(EmbedEvent.Pin, payload => {
|
|
3180
3216
|
* console.log('pin', payload)
|
|
3181
3217
|
* }, {
|
|
3182
3218
|
* start: true
|
|
3183
3219
|
* })
|
|
3184
|
-
* //
|
|
3220
|
+
* //emit when action ends
|
|
3185
3221
|
* searchEmbed.on(EmbedEvent.Pin, payload => {
|
|
3186
3222
|
* console.log('pin', payload)
|
|
3187
3223
|
* })
|
|
@@ -3194,13 +3230,13 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
3194
3230
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
3195
3231
|
* @example
|
|
3196
3232
|
*```js
|
|
3197
|
-
* //
|
|
3233
|
+
* //emit when action starts
|
|
3198
3234
|
* searchEmbed.on(EmbedEvent.SpotIQAnalyze, payload => {
|
|
3199
3235
|
* console.log('SpotIQAnalyze', payload)
|
|
3200
3236
|
* }, {
|
|
3201
3237
|
* start: true
|
|
3202
3238
|
* })
|
|
3203
|
-
* //
|
|
3239
|
+
* //emit when action ends
|
|
3204
3240
|
* searchEmbed.on(EmbedEvent.SpotIQAnalyze, payload => {
|
|
3205
3241
|
* console.log('SpotIQ analyze', payload)
|
|
3206
3242
|
* })
|
|
@@ -3213,13 +3249,13 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
3213
3249
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
3214
3250
|
* @example
|
|
3215
3251
|
*```js
|
|
3216
|
-
* //
|
|
3252
|
+
* //emit when action starts
|
|
3217
3253
|
* searchEmbed.on(EmbedEvent.Share, payload => {
|
|
3218
3254
|
* console.log('Share', payload)
|
|
3219
3255
|
* }, {
|
|
3220
3256
|
* start: true
|
|
3221
3257
|
* })
|
|
3222
|
-
* //
|
|
3258
|
+
* //emit when action ends
|
|
3223
3259
|
* searchEmbed.on(EmbedEvent.Share, payload => {
|
|
3224
3260
|
* console.log('Share', payload)
|
|
3225
3261
|
* })
|
|
@@ -3294,10 +3330,10 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
3294
3330
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
3295
3331
|
* @example
|
|
3296
3332
|
*```js
|
|
3297
|
-
* //
|
|
3333
|
+
* //emit when action starts
|
|
3298
3334
|
* searchEmbed.on(EmbedEvent.ExportTML, payload => {
|
|
3299
3335
|
* console.log('Export TML', payload)}, { start: true })
|
|
3300
|
-
* //
|
|
3336
|
+
* //emit when action ends
|
|
3301
3337
|
* searchEmbed.on(EmbedEvent.ExportTML, payload => {
|
|
3302
3338
|
* console.log('Export TML', payload)})
|
|
3303
3339
|
*```
|
|
@@ -3321,10 +3357,10 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
3321
3357
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
3322
3358
|
* @example
|
|
3323
3359
|
*```js
|
|
3324
|
-
* //
|
|
3360
|
+
* //emit when action starts
|
|
3325
3361
|
* appEmbed.on(EmbedEvent.CopyAEdit, payload => {
|
|
3326
3362
|
* console.log('Copy and edit', payload)}, {start: true })
|
|
3327
|
-
* //
|
|
3363
|
+
* //emit when action ends
|
|
3328
3364
|
* appEmbed.on(EmbedEvent.CopyAEdit, payload => {
|
|
3329
3365
|
* console.log('Copy and edit', payload)})
|
|
3330
3366
|
*```
|
|
@@ -3426,7 +3462,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
3426
3462
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
3427
3463
|
* @example
|
|
3428
3464
|
*```js
|
|
3429
|
-
* liveboardEmbed.
|
|
3465
|
+
* liveboardEmbed.on(EmbedEvent.Present)
|
|
3430
3466
|
*```
|
|
3431
3467
|
* @example
|
|
3432
3468
|
*```js
|
|
@@ -3442,7 +3478,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
3442
3478
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
3443
3479
|
* @example
|
|
3444
3480
|
*```js
|
|
3445
|
-
* liveboardEmbed.
|
|
3481
|
+
* liveboardEmbed.on(EmbedEvent.Delete,
|
|
3446
3482
|
* {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
3447
3483
|
*```
|
|
3448
3484
|
*/
|
|
@@ -3453,7 +3489,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
3453
3489
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
3454
3490
|
* @example
|
|
3455
3491
|
*```js
|
|
3456
|
-
* liveboardEmbed.
|
|
3492
|
+
* liveboardEmbed.on(EmbedEvent.SchedulesList)
|
|
3457
3493
|
*```
|
|
3458
3494
|
*/
|
|
3459
3495
|
SchedulesList = "schedule-list",
|
|
@@ -3463,7 +3499,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
3463
3499
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
3464
3500
|
* @example
|
|
3465
3501
|
*```js
|
|
3466
|
-
* liveboardEmbed.
|
|
3502
|
+
* liveboardEmbed.on(EmbedEvent.Cancel)
|
|
3467
3503
|
*```
|
|
3468
3504
|
*/
|
|
3469
3505
|
Cancel = "cancel",
|
|
@@ -3473,7 +3509,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
3473
3509
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
3474
3510
|
* @example
|
|
3475
3511
|
*```js
|
|
3476
|
-
* liveboardEmbed.
|
|
3512
|
+
* liveboardEmbed.on(EmbedEvent.Explore, {
|
|
3477
3513
|
* vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
3478
3514
|
*```
|
|
3479
3515
|
*/
|
|
@@ -3484,7 +3520,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
3484
3520
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
3485
3521
|
* @example
|
|
3486
3522
|
*```js
|
|
3487
|
-
* liveboardEmbed.
|
|
3523
|
+
* liveboardEmbed.on(EmbedEvent.CopyLink, {
|
|
3488
3524
|
* vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
3489
3525
|
*```
|
|
3490
3526
|
*/
|
|
@@ -3495,7 +3531,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
3495
3531
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.0.sw
|
|
3496
3532
|
* @example
|
|
3497
3533
|
*```js
|
|
3498
|
-
* liveboardEmbed.
|
|
3534
|
+
* liveboardEmbed.on(EmbedEvent.CrossFilterChanged, {
|
|
3499
3535
|
* vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
3500
3536
|
*```
|
|
3501
3537
|
*/
|
|
@@ -3519,9 +3555,18 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
3519
3555
|
*/
|
|
3520
3556
|
InsertIntoSlide = "insertInToSlide",
|
|
3521
3557
|
/**
|
|
3522
|
-
* @hidden
|
|
3523
3558
|
* Emitted when a user changes any filter on a Liveboard.
|
|
3559
|
+
* Returns filter type and name, column name and ID, and runtime
|
|
3560
|
+
* filter details.
|
|
3561
|
+
*
|
|
3524
3562
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl, 9.5.0.sw
|
|
3563
|
+
* @example
|
|
3564
|
+
*
|
|
3565
|
+
*```js
|
|
3566
|
+
* LiveboardEmbed.on(EmbedEvent.FilterChanged, (payload) => {
|
|
3567
|
+
* console.log('payload', payload);
|
|
3568
|
+
* })
|
|
3569
|
+
*```
|
|
3525
3570
|
*/
|
|
3526
3571
|
FilterChanged = "filterChanged",
|
|
3527
3572
|
/**
|
|
@@ -4056,7 +4101,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
4056
4101
|
* ```js
|
|
4057
4102
|
* searchEmbed.trigger(HostEvent.GetTML).then((tml) => {
|
|
4058
4103
|
* console.log(
|
|
4059
|
-
* tml.search_query // TML representation of the search query
|
|
4104
|
+
* tml.answer.search_query // TML representation of the search query
|
|
4060
4105
|
* );
|
|
4061
4106
|
* })
|
|
4062
4107
|
* ```
|
|
@@ -4299,7 +4344,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
4299
4344
|
*
|
|
4300
4345
|
* ```js
|
|
4301
4346
|
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
4302
|
-
* filter: { column: 'column name', oper: 'IN', values: [1,2,3]
|
|
4347
|
+
* filter: { column: 'column name', oper: 'IN', values: [1,2,3]}
|
|
4303
4348
|
* })
|
|
4304
4349
|
* ```
|
|
4305
4350
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
@@ -5437,7 +5482,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
5437
5482
|
* disabledActions: [Action.TML] // to disable all TML actions
|
|
5438
5483
|
* ```
|
|
5439
5484
|
*
|
|
5440
|
-
* @version SDK : 1.28.
|
|
5485
|
+
* @version SDK : 1.28.3 | Thoughtspot: 9.12.0.cl
|
|
5441
5486
|
*/
|
|
5442
5487
|
TML = "tml",
|
|
5443
5488
|
/**
|
package/package.json
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { getAuthenticationToken, resetCachedAuthToken } from './authToken';
|
|
2
|
+
import * as authServiceInstance from './utils/authService/authService';
|
|
3
|
+
import { EmbedConfig } from './types';
|
|
4
|
+
|
|
5
|
+
describe('AuthToken Unit tests', () => {
|
|
6
|
+
test('getAuthenticationToken: When verification is disabled', async () => {
|
|
7
|
+
jest.spyOn(authServiceInstance, 'verifyTokenService');
|
|
8
|
+
|
|
9
|
+
const token = await getAuthenticationToken({
|
|
10
|
+
getAuthToken: async () => 'abc3',
|
|
11
|
+
disableTokenVerification: true,
|
|
12
|
+
} as EmbedConfig);
|
|
13
|
+
|
|
14
|
+
expect(token).toBe('abc3');
|
|
15
|
+
expect(authServiceInstance.verifyTokenService).not.toBeCalled();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
test.only('getAuthenticationToken: When verification is enabled', async () => {
|
|
19
|
+
resetCachedAuthToken();
|
|
20
|
+
jest.clearAllMocks();
|
|
21
|
+
jest.spyOn(authServiceInstance, 'verifyTokenService').mockImplementation(() => true);
|
|
22
|
+
const token = await getAuthenticationToken({
|
|
23
|
+
thoughtSpotHost: 'test',
|
|
24
|
+
getAuthToken: async () => 'abc2',
|
|
25
|
+
disableTokenVerification: false,
|
|
26
|
+
} as EmbedConfig);
|
|
27
|
+
|
|
28
|
+
expect(token).toBe('abc2');
|
|
29
|
+
expect(authServiceInstance.verifyTokenService).toBeCalledWith('test', 'abc2');
|
|
30
|
+
});
|
|
31
|
+
});
|
package/src/authToken.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EmbedConfig } from './types';
|
|
2
2
|
import { fetchAuthTokenService, verifyTokenService } from './utils/authService/authService';
|
|
3
|
+
import { logger } from './utils/logger';
|
|
3
4
|
|
|
4
5
|
const DUPLICATE_TOKEN_ERR = 'Duplicate token, please issue a new token every time getAuthToken callback is called.'
|
|
5
6
|
+ 'See https://developers.thoughtspot.com/docs/?pageid=embed-auth#trusted-auth-embed for more details.';
|
|
@@ -10,7 +11,9 @@ let cachedAuthToken: string | null = null;
|
|
|
10
11
|
|
|
11
12
|
// This method can be used to get the authToken using the embedConfig
|
|
12
13
|
export const getAuthenticationToken = async (embedConfig: EmbedConfig): Promise<string> => {
|
|
13
|
-
if
|
|
14
|
+
// Since we don't have token validation enabled , we cannot tell if the
|
|
15
|
+
// cached token is valid or not. So we will always fetch a new token.
|
|
16
|
+
if (cachedAuthToken && !embedConfig.disableTokenVerification) {
|
|
14
17
|
let isCachedTokenStillValid;
|
|
15
18
|
try {
|
|
16
19
|
isCachedTokenStillValid = await validateAuthToken(embedConfig, cachedAuthToken, true);
|
|
@@ -43,6 +46,10 @@ const validateAuthToken = async (
|
|
|
43
46
|
authToken: string,
|
|
44
47
|
suppressAlert?: boolean,
|
|
45
48
|
): Promise<boolean> => {
|
|
49
|
+
if (embedConfig.disableTokenVerification) {
|
|
50
|
+
logger.info('Token verification is disabled. Assuming token is valid.');
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
46
53
|
try {
|
|
47
54
|
const isTokenValid = await verifyTokenService(embedConfig.thoughtSpotHost, authToken);
|
|
48
55
|
if (isTokenValid) return true;
|