@thoughtspot/visual-embed-sdk 1.29.2 → 1.30.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.
- package/cjs/package.json +1 -1
- package/cjs/src/authToken.d.ts +1 -1
- package/cjs/src/authToken.js +1 -1
- package/cjs/src/embed/app.d.ts +1 -4
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +2 -2
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/base.d.ts +1 -1
- package/cjs/src/embed/base.d.ts.map +1 -1
- package/cjs/src/embed/base.js +6 -6
- package/cjs/src/embed/base.js.map +1 -1
- package/cjs/src/embed/search.d.ts +1 -5
- package/cjs/src/embed/search.d.ts.map +1 -1
- package/cjs/src/embed/search.js +4 -4
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/search.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +9 -18
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/types.d.ts +21 -54
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +20 -47
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.d.ts +2 -2
- package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.js +2 -2
- package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.spec.js +43 -0
- package/cjs/src/utils/graphql/answerService/answerService.spec.js.map +1 -1
- package/cjs/src/utils/graphql/graphql-request.d.ts.map +1 -1
- package/cjs/src/utils/graphql/graphql-request.js +2 -1
- package/cjs/src/utils/graphql/graphql-request.js.map +1 -1
- package/dist/src/authToken.d.ts +1 -1
- package/dist/src/embed/app.d.ts +1 -4
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/base.d.ts +1 -1
- package/dist/src/embed/base.d.ts.map +1 -1
- package/dist/src/embed/search.d.ts +1 -5
- package/dist/src/embed/search.d.ts.map +1 -1
- package/dist/src/types.d.ts +21 -54
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/graphql/answerService/answerService.d.ts +2 -2
- package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/dist/src/utils/graphql/graphql-request.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +26 -53
- package/dist/tsembed-react.js +26 -53
- package/dist/tsembed.es.js +1563 -1590
- package/dist/tsembed.js +3139 -3166
- package/dist/visual-embed-sdk-react-full.d.ts +24 -64
- package/dist/visual-embed-sdk-react.d.ts +24 -64
- package/dist/visual-embed-sdk.d.ts +24 -64
- package/lib/package.json +1 -1
- package/lib/src/authToken.d.ts +1 -1
- package/lib/src/authToken.js +1 -1
- package/lib/src/embed/app.d.ts +1 -4
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +2 -2
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/base.d.ts +1 -1
- package/lib/src/embed/base.d.ts.map +1 -1
- package/lib/src/embed/base.js +5 -5
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/search.d.ts +1 -5
- package/lib/src/embed/search.d.ts.map +1 -1
- package/lib/src/embed/search.js +5 -5
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/search.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +9 -18
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/types.d.ts +21 -54
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +20 -47
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.d.ts +2 -2
- package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.js +2 -2
- package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.spec.js +44 -1
- package/lib/src/utils/graphql/answerService/answerService.spec.js.map +1 -1
- package/lib/src/utils/graphql/graphql-request.d.ts.map +1 -1
- package/lib/src/utils/graphql/graphql-request.js +2 -1
- package/lib/src/utils/graphql/graphql-request.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +27 -67
- package/package.json +1 -1
- package/src/authToken.ts +1 -1
- package/src/embed/app.ts +14 -16
- package/src/embed/base.ts +14 -15
- package/src/embed/search.spec.ts +1 -2
- package/src/embed/search.ts +15 -21
- package/src/embed/ts-embed.spec.ts +24 -37
- package/src/types.ts +26 -60
- package/src/utils/graphql/answerService/answerService.spec.ts +53 -1
- package/src/utils/graphql/answerService/answerService.ts +2 -2
- package/src/utils/graphql/graphql-request.ts +2 -1
|
@@ -38,7 +38,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
|
|
|
38
38
|
* @module
|
|
39
39
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
40
40
|
*/
|
|
41
|
-
import { DOMSelector,
|
|
41
|
+
import { DOMSelector, ViewConfig, MessagePayload } from '@thoughtspot/visual-embed-sdk/types';
|
|
42
42
|
import { V1Embed } from '@thoughtspot/visual-embed-sdk/embed/ts-embed';
|
|
43
43
|
/**
|
|
44
44
|
* Pages within the ThoughtSpot app that can be embedded.
|
|
@@ -117,7 +117,6 @@ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
|
|
|
117
117
|
* nav-bars are visible, this flag will only hide the homepage left nav-bar.
|
|
118
118
|
* The showPrimaryNavbar flag takes precedence over the hideHomepageLeftNav.
|
|
119
119
|
*
|
|
120
|
-
*
|
|
121
120
|
* **Note**: This option does not apply to the classic homepage.
|
|
122
121
|
* To access the updated modular homepage, set
|
|
123
122
|
* `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl).
|
|
@@ -150,7 +149,6 @@ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
|
|
|
150
149
|
* Control the visibility of the application switcher button on the nav-bar.
|
|
151
150
|
* By default, the application switcher is shown.
|
|
152
151
|
*
|
|
153
|
-
*
|
|
154
152
|
* **Note**: This option does not apply to the classic homepage.
|
|
155
153
|
* To access the updated modular homepage, set
|
|
156
154
|
* `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl).
|
|
@@ -169,7 +167,6 @@ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
|
|
|
169
167
|
* Control the visibility of the Org switcher button on the nav-bar.
|
|
170
168
|
* By default, the Org switcher button is shown.
|
|
171
169
|
*
|
|
172
|
-
*
|
|
173
170
|
* **Note**: This option does not apply to the classic homepage.
|
|
174
171
|
* To access the updated modular homepage, set
|
|
175
172
|
* `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl).
|
|
@@ -460,8 +457,8 @@ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
|
|
|
460
457
|
}
|
|
461
458
|
|
|
462
459
|
declare module '@thoughtspot/visual-embed-sdk/embed/base' {
|
|
463
|
-
import { AuthEventEmitter, notifyAuthFailure, notifyAuthSDKSuccess, notifyAuthSuccess, notifyLogout } from '@thoughtspot/visual-embed-sdk/auth';
|
|
464
460
|
import { EmbedConfig, PrefetchFeatures } from '@thoughtspot/visual-embed-sdk/types';
|
|
461
|
+
import { notifyAuthFailure, notifyAuthSDKSuccess, notifyAuthSuccess, notifyLogout, AuthEventEmitter } from '@thoughtspot/visual-embed-sdk/auth';
|
|
465
462
|
export interface executeTMLInput {
|
|
466
463
|
metadata_tmls: string[];
|
|
467
464
|
import_policy?: 'PARTIAL' | 'ALL_OR_NONE' | 'VALIDATE_ONLY';
|
|
@@ -895,7 +892,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/search' {
|
|
|
895
892
|
* @summary Search embed
|
|
896
893
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
897
894
|
*/
|
|
898
|
-
import {
|
|
895
|
+
import { DOMSelector, Action, ViewConfig } from '@thoughtspot/visual-embed-sdk/types';
|
|
899
896
|
import { TsEmbed } from '@thoughtspot/visual-embed-sdk/embed/ts-embed';
|
|
900
897
|
/**
|
|
901
898
|
* Configuration for search options.
|
|
@@ -976,10 +973,6 @@ declare module '@thoughtspot/visual-embed-sdk/embed/search' {
|
|
|
976
973
|
* ```
|
|
977
974
|
*/
|
|
978
975
|
hideResults?: boolean;
|
|
979
|
-
/**
|
|
980
|
-
* If set to true, expands all the data sources panel.
|
|
981
|
-
*/
|
|
982
|
-
expandAllDataSource?: boolean;
|
|
983
976
|
/**
|
|
984
977
|
* If set to true, the Search Assist feature is enabled.
|
|
985
978
|
* @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl, 8.8.1-sw
|
|
@@ -1569,7 +1562,6 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
1569
1562
|
* .then((data) => data.token);
|
|
1570
1563
|
* }
|
|
1571
1564
|
* });
|
|
1572
|
-
* });
|
|
1573
1565
|
* ```
|
|
1574
1566
|
*/
|
|
1575
1567
|
TrustedAuthToken = "AuthServer",
|
|
@@ -1940,7 +1932,6 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
1940
1932
|
/**
|
|
1941
1933
|
* Pendo API key to enable Pendo tracking to your own subscription, the key
|
|
1942
1934
|
* is added as an additional key to the embed, as per this link:https://support.pendo.io/hc/en-us/articles/360032201951-Send-data-to-multiple-subscriptions[document].
|
|
1943
|
-
*
|
|
1944
1935
|
* @version SDK: 1.27.0 | ThoughtSpot: 9.8.0.cl
|
|
1945
1936
|
*/
|
|
1946
1937
|
pendoTrackingKey?: string;
|
|
@@ -2290,8 +2281,6 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
2290
2281
|
* Hide the home page modules
|
|
2291
2282
|
* For example: hiddenHomepageModules = [HomepageModule.MyLibrary]
|
|
2292
2283
|
*
|
|
2293
|
-
*
|
|
2294
|
-
*
|
|
2295
2284
|
* **Note**: This option does not apply to the classic homepage.
|
|
2296
2285
|
* To access the updated modular homepage, set
|
|
2297
2286
|
* `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl).
|
|
@@ -2309,7 +2298,6 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
2309
2298
|
* reordering the home page modules
|
|
2310
2299
|
* eg: reorderedHomepageModules = [HomepageModule.MyLibrary, HomepageModule.Watchlist]
|
|
2311
2300
|
*
|
|
2312
|
-
*
|
|
2313
2301
|
* **Note**: This option does not apply to the classic homepage.
|
|
2314
2302
|
* To access the updated modular homepage, set
|
|
2315
2303
|
* `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl).
|
|
@@ -2353,8 +2341,6 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
2353
2341
|
* })
|
|
2354
2342
|
* ```
|
|
2355
2343
|
*
|
|
2356
|
-
*
|
|
2357
|
-
*
|
|
2358
2344
|
* **Note**: This option does not apply to the classic homepage.
|
|
2359
2345
|
* To access the updated modular homepage, set
|
|
2360
2346
|
* `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl).
|
|
@@ -2517,7 +2503,11 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
2517
2503
|
/**
|
|
2518
2504
|
* Is included in this list of values
|
|
2519
2505
|
*/
|
|
2520
|
-
IN = "IN"
|
|
2506
|
+
IN = "IN",
|
|
2507
|
+
/**
|
|
2508
|
+
* Is not included in this list of values
|
|
2509
|
+
*/
|
|
2510
|
+
NOT_IN = "NOT_IN"
|
|
2521
2511
|
}
|
|
2522
2512
|
/**
|
|
2523
2513
|
* Home page module that can be hidden.
|
|
@@ -2784,20 +2774,14 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
2784
2774
|
/**
|
|
2785
2775
|
* An error has occurred. This event is fired for the following error types:
|
|
2786
2776
|
*
|
|
2787
|
-
* `API
|
|
2788
|
-
*
|
|
2789
|
-
* `
|
|
2790
|
-
*
|
|
2791
|
-
*
|
|
2792
|
-
* `
|
|
2793
|
-
*
|
|
2794
|
-
* `NON_EXIST_FILTER`: Error due to a non-existent filter.
|
|
2777
|
+
* `API` - API call failure error.
|
|
2778
|
+
* `FULLSCREEN` - Error when presenting a Liveboard or visualization in full screen
|
|
2779
|
+
* mode. `SINGLE_VALUE_FILTER` - Error due to multiple values in the single value
|
|
2780
|
+
* filter. `NON_EXIST_FILTER` - Error due to a non-existent filter.
|
|
2781
|
+
* `INVALID_DATE_VALUE` - Invalid date value error.
|
|
2782
|
+
* `INVALID_OPERATOR` - Use of invalid operator during filter application.
|
|
2795
2783
|
*
|
|
2796
|
-
*
|
|
2797
|
-
*
|
|
2798
|
-
* `INVALID_OPERATOR`: Use of invalid operator during filter application.
|
|
2799
|
-
*
|
|
2800
|
-
* For more information, see https://developers.thoughtspot.com/docs/events-app-integration#errorType.
|
|
2784
|
+
* For more information, see https://developers.thoughtspot.com/docs/events-app-integration#errorType
|
|
2801
2785
|
* @returns error - An error object or message
|
|
2802
2786
|
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
2803
2787
|
* @example
|
|
@@ -2897,7 +2881,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
2897
2881
|
/**
|
|
2898
2882
|
* Emitted when the embed does not have cookie access. This happens
|
|
2899
2883
|
* when Safari and other Web browsers block third-party cookies
|
|
2900
|
-
* are blocked by default.
|
|
2884
|
+
* are blocked by default. `NoCookieAccess` can trigger
|
|
2901
2885
|
* @example
|
|
2902
2886
|
*```js
|
|
2903
2887
|
* appEmbed.on(EmbedEvent.NoCookieAccess)
|
|
@@ -2936,7 +2920,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
2936
2920
|
/**
|
|
2937
2921
|
* Emitted when the Liveboard shell loads.
|
|
2938
2922
|
* You can use this event as a hook to trigger
|
|
2939
|
-
*
|
|
2923
|
+
* other events on the rendered Liveboard.
|
|
2940
2924
|
* @version SDK: 1.9.1 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw
|
|
2941
2925
|
* @example
|
|
2942
2926
|
*```js
|
|
@@ -2987,7 +2971,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
2987
2971
|
/**
|
|
2988
2972
|
* Emitted when the download action is triggered on an answer
|
|
2989
2973
|
*
|
|
2990
|
-
* **Note**:
|
|
2974
|
+
* **Note**: This event is deprecated in v1.21.0.
|
|
2991
2975
|
* To fire an event when a download action is initiated on a chart or table,
|
|
2992
2976
|
* use `EmbedEvent.DownloadAsPng`, `EmbedEvent.DownloadAsPDF`, `EmbedEvent.DownloadAsCSV`,
|
|
2993
2977
|
* or `EmbedEvent.DownloadAsXLSX`
|
|
@@ -3064,7 +3048,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
3064
3048
|
* //emit when action starts
|
|
3065
3049
|
* appEmbed.on(EmbedEvent.AnswerDelete, payload => {
|
|
3066
3050
|
* console.log('delete answer', payload)}, {start: true })
|
|
3067
|
-
* //
|
|
3051
|
+
* //trigger when action is completed
|
|
3068
3052
|
* appEmbed.on(EmbedEvent.AnswerDelete, payload => {
|
|
3069
3053
|
* console.log('delete answer', payload)})
|
|
3070
3054
|
*```
|
|
@@ -3162,7 +3146,6 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
3162
3146
|
/**
|
|
3163
3147
|
* Emitted when a user clicks the **Update TML** action on
|
|
3164
3148
|
* embedded Liveboard.
|
|
3165
|
-
*
|
|
3166
3149
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
3167
3150
|
* @example
|
|
3168
3151
|
*```js
|
|
@@ -3174,7 +3157,6 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
3174
3157
|
/**
|
|
3175
3158
|
* Emitted when a user clicks the **Edit TML** action
|
|
3176
3159
|
* on an embedded Liveboard.
|
|
3177
|
-
*
|
|
3178
3160
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
3179
3161
|
* @example
|
|
3180
3162
|
*```js
|
|
@@ -3374,7 +3356,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
3374
3356
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.0.sw
|
|
3375
3357
|
* @example
|
|
3376
3358
|
*```js
|
|
3377
|
-
* liveboardEmbed.
|
|
3359
|
+
* liveboardEmbed.trigger(HostEvent.CrossFilterChanged, {
|
|
3378
3360
|
* vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
3379
3361
|
*```
|
|
3380
3362
|
*/
|
|
@@ -3407,13 +3389,6 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
3407
3389
|
* })
|
|
3408
3390
|
*
|
|
3409
3391
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl, 9.5.0.sw
|
|
3410
|
-
* @example
|
|
3411
|
-
*
|
|
3412
|
-
*```js
|
|
3413
|
-
* LiveboardEmbed.on(EmbedEvent.FilterChanged, (payload) => {
|
|
3414
|
-
* console.log('payload', payload);
|
|
3415
|
-
* })
|
|
3416
|
-
*```
|
|
3417
3392
|
*/
|
|
3418
3393
|
FilterChanged = "filterChanged",
|
|
3419
3394
|
/**
|
|
@@ -3651,8 +3626,8 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
3651
3626
|
* _String_. The name of the column to filter on.
|
|
3652
3627
|
*
|
|
3653
3628
|
* `operator`
|
|
3654
|
-
*
|
|
3655
|
-
*
|
|
3629
|
+
* Runtime filter operator to apply. For information,
|
|
3630
|
+
* see link:https://developers.thoughtspot.com/docs/?pageid=runtime-filters#rtOperator[Developer Documentation].
|
|
3656
3631
|
*
|
|
3657
3632
|
* `values`
|
|
3658
3633
|
* List of operands. Some operators such as EQ, LE allow a single value, whereas
|
|
@@ -3782,20 +3757,16 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
3782
3757
|
/**
|
|
3783
3758
|
* Trigger the **Export TML** action on an embedded Liveboard or
|
|
3784
3759
|
* Answer.
|
|
3785
|
-
*
|
|
3786
3760
|
* @example
|
|
3787
3761
|
* ```js
|
|
3788
3762
|
* liveboardEmbed.trigger(HostEvent.ExportTML)
|
|
3789
3763
|
* ```
|
|
3790
|
-
*
|
|
3791
3764
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
3792
3765
|
*/
|
|
3793
3766
|
ExportTML = "exportTSL",
|
|
3794
3767
|
/**
|
|
3795
3768
|
* Trigger the **Edit TML** action on an embedded Liveboard or
|
|
3796
3769
|
* saved Answers in the full application embedding.
|
|
3797
|
-
*
|
|
3798
|
-
*
|
|
3799
3770
|
* @example
|
|
3800
3771
|
* ```js
|
|
3801
3772
|
* liveboardEmbed.trigger(HostEvent.EditTML)
|
|
@@ -3818,7 +3789,6 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
3818
3789
|
*
|
|
3819
3790
|
* **NOTE**: The **Download** > **PDF** action is available on
|
|
3820
3791
|
* visualizations and Answers if the data is in tabular format.
|
|
3821
|
-
*
|
|
3822
3792
|
* @example
|
|
3823
3793
|
* ```js
|
|
3824
3794
|
* liveboardEmbed.trigger(HostEvent.DownloadAsPdf)
|
|
@@ -3890,15 +3860,12 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
3890
3860
|
* on a Liveboard.
|
|
3891
3861
|
*
|
|
3892
3862
|
* This event is not supported in visualization embed and search embed.
|
|
3893
|
-
*
|
|
3894
3863
|
* @param - object - To trigger the action for a specific visualization
|
|
3895
3864
|
* in Liveboard embed, pass in `vizId` as a key.
|
|
3896
|
-
*
|
|
3897
3865
|
* @example
|
|
3898
3866
|
* ```js
|
|
3899
3867
|
* liveboardEmbed.trigger(HostEvent.Edit)
|
|
3900
3868
|
* ```
|
|
3901
|
-
* @example
|
|
3902
3869
|
* ```js
|
|
3903
3870
|
* liveboardEmbed.trigger(HostEvent.Edit, {vizId:
|
|
3904
3871
|
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
@@ -4161,7 +4128,6 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
4161
4128
|
/**
|
|
4162
4129
|
* Get details of filters applied on the Liveboard.
|
|
4163
4130
|
* Returns arrays containing Liveboard filter and runtime filter elements.
|
|
4164
|
-
*
|
|
4165
4131
|
* @example
|
|
4166
4132
|
* ```js
|
|
4167
4133
|
* const data = await liveboardEmbed.trigger(HostEvent.GetFilters);
|
|
@@ -4188,7 +4154,6 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
4188
4154
|
* `values` - An array of one or several values. The value definition on the
|
|
4189
4155
|
* data type you choose to filter on. For a complete list of supported data types,
|
|
4190
4156
|
* see link:https://developers.thoughtspot.com/docs/runtime-filters#_supported_data_types[Developer Documentation].
|
|
4191
|
-
*
|
|
4192
4157
|
* @example
|
|
4193
4158
|
* ```js
|
|
4194
4159
|
*
|
|
@@ -4506,7 +4471,6 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
4506
4471
|
* The **Save as View** action on the Answer
|
|
4507
4472
|
* page. Saves an Answer as a View object in the full
|
|
4508
4473
|
* application embedding mode.
|
|
4509
|
-
*
|
|
4510
4474
|
* @example
|
|
4511
4475
|
* ```js
|
|
4512
4476
|
* disabledActions: [Action.SaveAsView]
|
|
@@ -4710,13 +4674,10 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
4710
4674
|
DownloadAsPng = "downloadAsPng",
|
|
4711
4675
|
/**
|
|
4712
4676
|
*
|
|
4713
|
-
*
|
|
4714
|
-
*
|
|
4677
|
+
*The **Download PDF** action that downloads a Liveboard,
|
|
4678
|
+
*visualization, or Answer as a PDF file.
|
|
4715
4679
|
*
|
|
4716
4680
|
*
|
|
4717
|
-
* **NOTE**: The **Download** > **PDF** action is available on
|
|
4718
|
-
* visualizations and Answers if the data is in tabular format.
|
|
4719
|
-
*
|
|
4720
4681
|
***NOTE**: The **Download** > **PDF** action is available on
|
|
4721
4682
|
*visualizations and Answers if the data is in tabular format.
|
|
4722
4683
|
* @example
|
|
@@ -4966,7 +4927,6 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
4966
4927
|
/**
|
|
4967
4928
|
* The **Delete** action for Answers in the full application
|
|
4968
4929
|
* embedding mode.
|
|
4969
|
-
*
|
|
4970
4930
|
* @example
|
|
4971
4931
|
* ```js
|
|
4972
4932
|
* disabledActions: [Action.AnswerDelete]
|
|
@@ -6080,14 +6040,14 @@ declare module '@thoughtspot/visual-embed-sdk/utils/graphql/answerService/answer
|
|
|
6080
6040
|
* ```js
|
|
6081
6041
|
* embed.on(EmbedEvent.Data, async (e) => {
|
|
6082
6042
|
* const service = await embed.getAnswerService();
|
|
6083
|
-
* await service.
|
|
6043
|
+
* await service.addColumnsByName([
|
|
6084
6044
|
* "col name 1",
|
|
6085
6045
|
* "col name 2"
|
|
6086
6046
|
* ]);
|
|
6087
6047
|
* console.log(await service.fetchData());
|
|
6088
6048
|
* });
|
|
6089
6049
|
*/
|
|
6090
|
-
|
|
6050
|
+
addColumnsByName(columnNames: string[]): Promise<any>;
|
|
6091
6051
|
/**
|
|
6092
6052
|
* Add a filter to the answer.
|
|
6093
6053
|
* @param columnName
|
|
@@ -6228,7 +6188,7 @@ declare module '@thoughtspot/visual-embed-sdk/authToken' {
|
|
|
6228
6188
|
* ```js
|
|
6229
6189
|
* resetCachedAuthToken();
|
|
6230
6190
|
* ```
|
|
6231
|
-
* @version SDK: 1.28.
|
|
6191
|
+
* @version SDK: 1.28.0 | ThoughtSpot: *
|
|
6232
6192
|
* @group Authentication / Init
|
|
6233
6193
|
*/
|
|
6234
6194
|
export const resetCachedAuthToken: () => void;
|
package/package.json
CHANGED
package/src/authToken.ts
CHANGED
|
@@ -74,7 +74,7 @@ const validateAuthToken = async (
|
|
|
74
74
|
* ```js
|
|
75
75
|
* resetCachedAuthToken();
|
|
76
76
|
* ```
|
|
77
|
-
* @version SDK: 1.28.
|
|
77
|
+
* @version SDK: 1.28.0 | ThoughtSpot: *
|
|
78
78
|
* @group Authentication / Init
|
|
79
79
|
*/
|
|
80
80
|
export const resetCachedAuthToken = (): void => {
|
package/src/embed/app.ts
CHANGED
|
@@ -8,11 +8,16 @@
|
|
|
8
8
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
import { logger } from '../utils/logger';
|
|
12
|
+
import { getQueryParamString } from '../utils';
|
|
11
13
|
import {
|
|
12
|
-
|
|
14
|
+
Param,
|
|
15
|
+
DOMSelector,
|
|
16
|
+
HostEvent,
|
|
17
|
+
ViewConfig,
|
|
18
|
+
EmbedEvent,
|
|
19
|
+
MessagePayload,
|
|
13
20
|
} from '../types';
|
|
14
|
-
import { getQueryParamString } from '../utils';
|
|
15
|
-
import { logger } from '../utils/logger';
|
|
16
21
|
import { V1Embed } from './ts-embed';
|
|
17
22
|
|
|
18
23
|
/**
|
|
@@ -95,7 +100,6 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
|
|
|
95
100
|
* nav-bars are visible, this flag will only hide the homepage left nav-bar.
|
|
96
101
|
* The showPrimaryNavbar flag takes precedence over the hideHomepageLeftNav.
|
|
97
102
|
*
|
|
98
|
-
*
|
|
99
103
|
* **Note**: This option does not apply to the classic homepage.
|
|
100
104
|
* To access the updated modular homepage, set
|
|
101
105
|
* `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl).
|
|
@@ -128,7 +132,6 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
|
|
|
128
132
|
* Control the visibility of the application switcher button on the nav-bar.
|
|
129
133
|
* By default, the application switcher is shown.
|
|
130
134
|
*
|
|
131
|
-
*
|
|
132
135
|
* **Note**: This option does not apply to the classic homepage.
|
|
133
136
|
* To access the updated modular homepage, set
|
|
134
137
|
* `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl).
|
|
@@ -147,7 +150,6 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
|
|
|
147
150
|
* Control the visibility of the Org switcher button on the nav-bar.
|
|
148
151
|
* By default, the Org switcher button is shown.
|
|
149
152
|
*
|
|
150
|
-
*
|
|
151
153
|
* **Note**: This option does not apply to the classic homepage.
|
|
152
154
|
* To access the updated modular homepage, set
|
|
153
155
|
* `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl).
|
|
@@ -443,6 +445,7 @@ export class AppEmbed extends V1Embed {
|
|
|
443
445
|
isOnBeforeGetVizDataInterceptEnabled = false,
|
|
444
446
|
/* eslint-disable-next-line max-len */
|
|
445
447
|
dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL,
|
|
448
|
+
|
|
446
449
|
} = this.viewConfig;
|
|
447
450
|
|
|
448
451
|
let params = {};
|
|
@@ -487,9 +490,7 @@ export class AppEmbed extends V1Embed {
|
|
|
487
490
|
|
|
488
491
|
if (isOnBeforeGetVizDataInterceptEnabled) {
|
|
489
492
|
/* eslint-disable-next-line max-len */
|
|
490
|
-
params[
|
|
491
|
-
Param.IsOnBeforeGetVizDataInterceptEnabled
|
|
492
|
-
] = isOnBeforeGetVizDataInterceptEnabled;
|
|
493
|
+
params[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
493
494
|
}
|
|
494
495
|
|
|
495
496
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
@@ -497,16 +498,13 @@ export class AppEmbed extends V1Embed {
|
|
|
497
498
|
params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
|
|
498
499
|
params[Param.CollapseSearchBarInitially] = collapseSearchBarInitially;
|
|
499
500
|
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
500
|
-
if (
|
|
501
|
-
|
|
502
|
-
=== DataPanelCustomColumnGroupsAccordionState.COLLAPSE_ALL
|
|
501
|
+
if (dataPanelCustomGroupsAccordionInitialState
|
|
502
|
+
=== DataPanelCustomColumnGroupsAccordionState.COLLAPSE_ALL
|
|
503
503
|
|| dataPanelCustomGroupsAccordionInitialState
|
|
504
|
-
|
|
504
|
+
=== DataPanelCustomColumnGroupsAccordionState.EXPAND_FIRST
|
|
505
505
|
) {
|
|
506
506
|
/* eslint-disable-next-line max-len */
|
|
507
|
-
params[
|
|
508
|
-
Param.DataPanelCustomGroupsAccordionInitialState
|
|
509
|
-
] = dataPanelCustomGroupsAccordionInitialState;
|
|
507
|
+
params[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
|
|
510
508
|
} else {
|
|
511
509
|
/* eslint-disable-next-line max-len */
|
|
512
510
|
params[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
|
package/src/embed/base.ts
CHANGED
|
@@ -8,29 +8,28 @@
|
|
|
8
8
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
9
9
|
*/
|
|
10
10
|
import EventEmitter from 'eventemitter3';
|
|
11
|
-
import
|
|
11
|
+
import { resetCachedAuthToken } from '../authToken';
|
|
12
|
+
import { logger, setGlobalLogLevelOverride } from '../utils/logger';
|
|
13
|
+
import { tokenizedFetch } from '../tokenizedFetch';
|
|
14
|
+
import { EndPoints } from '../utils/authService/authService';
|
|
15
|
+
import { getThoughtSpotHost } from '../config';
|
|
12
16
|
import {
|
|
13
|
-
|
|
14
|
-
|
|
17
|
+
AuthType, EmbedConfig, LogLevel, PrefetchFeatures,
|
|
18
|
+
} from '../types';
|
|
19
|
+
import {
|
|
20
|
+
authenticate,
|
|
21
|
+
logout as _logout,
|
|
15
22
|
AuthFailureType,
|
|
16
23
|
AuthStatus,
|
|
17
|
-
|
|
18
|
-
authenticate,
|
|
24
|
+
AuthEvent,
|
|
19
25
|
notifyAuthFailure,
|
|
20
26
|
notifyAuthSDKSuccess,
|
|
21
27
|
notifyAuthSuccess,
|
|
22
28
|
notifyLogout,
|
|
23
29
|
setAuthEE,
|
|
30
|
+
AuthEventEmitter,
|
|
24
31
|
} from '../auth';
|
|
25
|
-
import {
|
|
26
|
-
import { getThoughtSpotHost } from '../config';
|
|
27
|
-
import { MIXPANEL_EVENT, uploadMixpanelEvent } from '../mixpanel-service';
|
|
28
|
-
import { tokenizedFetch } from '../tokenizedFetch';
|
|
29
|
-
import {
|
|
30
|
-
AuthType, EmbedConfig, LogLevel, PrefetchFeatures,
|
|
31
|
-
} from '../types';
|
|
32
|
-
import { EndPoints } from '../utils/authService/authService';
|
|
33
|
-
import { logger, setGlobalLogLevelOverride } from '../utils/logger';
|
|
32
|
+
import { uploadMixpanelEvent, MIXPANEL_EVENT } from '../mixpanel-service';
|
|
34
33
|
import { getEmbedConfig, setEmbedConfig } from './embedConfig';
|
|
35
34
|
|
|
36
35
|
const CONFIG_DEFAULTS: Partial<EmbedConfig> = {
|
|
@@ -250,7 +249,7 @@ export const renderInQueue = (fn: (next?: (val?: any) => void) => Promise<any>):
|
|
|
250
249
|
return renderQueue;
|
|
251
250
|
}
|
|
252
251
|
// Sending an empty function to keep it consistent with the above usage.
|
|
253
|
-
return fn(() => {}); // eslint-disable-line @typescript-eslint/no-empty-function
|
|
252
|
+
return fn(() => { }); // eslint-disable-line @typescript-eslint/no-empty-function
|
|
254
253
|
};
|
|
255
254
|
|
|
256
255
|
/**
|
package/src/embed/search.spec.ts
CHANGED
|
@@ -490,8 +490,7 @@ describe('Search embed tests', () => {
|
|
|
490
490
|
const searchEmbed = new SearchEmbed(getRootEl(), {
|
|
491
491
|
...defaultViewConfig,
|
|
492
492
|
// eslint-disable-next-line max-len
|
|
493
|
-
dataPanelCustomGroupsAccordionInitialState:
|
|
494
|
-
DataPanelCustomColumnGroupsAccordionState.EXPAND_FIRST,
|
|
493
|
+
dataPanelCustomGroupsAccordionInitialState: DataPanelCustomColumnGroupsAccordionState.EXPAND_FIRST,
|
|
495
494
|
});
|
|
496
495
|
searchEmbed.render();
|
|
497
496
|
await executeAfterWait(() => {
|
package/src/embed/search.ts
CHANGED
|
@@ -6,20 +6,24 @@
|
|
|
6
6
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { getReleaseVersion } from '../auth';
|
|
10
|
-
import { ERROR_MESSAGE } from '../errors';
|
|
11
9
|
import {
|
|
12
|
-
|
|
10
|
+
DataSourceVisualMode,
|
|
11
|
+
DOMSelector,
|
|
12
|
+
Param,
|
|
13
|
+
Action,
|
|
14
|
+
ViewConfig,
|
|
13
15
|
} from '../types';
|
|
14
16
|
import {
|
|
17
|
+
getQueryParamString,
|
|
15
18
|
checkReleaseVersionInBeta,
|
|
16
19
|
getFilterQuery,
|
|
17
|
-
getQueryParamString,
|
|
18
20
|
getRuntimeParameters,
|
|
19
21
|
} from '../utils';
|
|
22
|
+
import { TsEmbed } from './ts-embed';
|
|
23
|
+
import { ERROR_MESSAGE } from '../errors';
|
|
20
24
|
import { getAuthPromise } from './base';
|
|
25
|
+
import { getReleaseVersion } from '../auth';
|
|
21
26
|
import { getEmbedConfig } from './embedConfig';
|
|
22
|
-
import { TsEmbed } from './ts-embed';
|
|
23
27
|
|
|
24
28
|
/**
|
|
25
29
|
* Configuration for search options.
|
|
@@ -110,10 +114,6 @@ export interface SearchViewConfig
|
|
|
110
114
|
* ```
|
|
111
115
|
*/
|
|
112
116
|
hideResults?: boolean;
|
|
113
|
-
/**
|
|
114
|
-
* If set to true, expands all the data sources panel.
|
|
115
|
-
*/
|
|
116
|
-
expandAllDataSource?: boolean;
|
|
117
117
|
/**
|
|
118
118
|
* If set to true, the Search Assist feature is enabled.
|
|
119
119
|
* @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl, 8.8.1-sw
|
|
@@ -319,7 +319,6 @@ export class SearchEmbed extends TsEmbed {
|
|
|
319
319
|
protected getEmbedParams(): string {
|
|
320
320
|
const {
|
|
321
321
|
hideResults,
|
|
322
|
-
expandAllDataSource,
|
|
323
322
|
enableSearchAssist,
|
|
324
323
|
forceTable,
|
|
325
324
|
searchOptions,
|
|
@@ -376,9 +375,7 @@ export class SearchEmbed extends TsEmbed {
|
|
|
376
375
|
|
|
377
376
|
if (isOnBeforeGetVizDataInterceptEnabled) {
|
|
378
377
|
/* eslint-disable-next-line max-len */
|
|
379
|
-
queryParams[
|
|
380
|
-
Param.IsOnBeforeGetVizDataInterceptEnabled
|
|
381
|
-
] = isOnBeforeGetVizDataInterceptEnabled;
|
|
378
|
+
queryParams[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
382
379
|
}
|
|
383
380
|
|
|
384
381
|
queryParams[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
@@ -392,16 +389,13 @@ export class SearchEmbed extends TsEmbed {
|
|
|
392
389
|
queryParams[Param.searchEmbed] = true;
|
|
393
390
|
queryParams[Param.CollapseSearchBarInitially] = collapseSearchBarInitially;
|
|
394
391
|
queryParams[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
395
|
-
if (
|
|
396
|
-
|
|
397
|
-
=== DataPanelCustomColumnGroupsAccordionState.COLLAPSE_ALL
|
|
392
|
+
if (dataPanelCustomGroupsAccordionInitialState
|
|
393
|
+
=== DataPanelCustomColumnGroupsAccordionState.COLLAPSE_ALL
|
|
398
394
|
|| dataPanelCustomGroupsAccordionInitialState
|
|
399
|
-
|
|
395
|
+
=== DataPanelCustomColumnGroupsAccordionState.EXPAND_FIRST
|
|
400
396
|
) {
|
|
401
397
|
/* eslint-disable-next-line max-len */
|
|
402
|
-
queryParams[
|
|
403
|
-
Param.DataPanelCustomGroupsAccordionInitialState
|
|
404
|
-
] = dataPanelCustomGroupsAccordionInitialState;
|
|
398
|
+
queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
|
|
405
399
|
} else {
|
|
406
400
|
/* eslint-disable-next-line max-len */
|
|
407
401
|
queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
|
|
@@ -450,7 +444,7 @@ export class SearchEmbed extends TsEmbed {
|
|
|
450
444
|
checkReleaseVersionInBeta(
|
|
451
445
|
getReleaseVersion(),
|
|
452
446
|
getEmbedConfig().suppressSearchEmbedBetaWarning
|
|
453
|
-
|
|
447
|
+
|| getEmbedConfig().suppressErrorAlerts,
|
|
454
448
|
)
|
|
455
449
|
) {
|
|
456
450
|
alert(ERROR_MESSAGE.SEARCHEMBED_BETA_WRANING_MESSAGE);
|