@thoughtspot/visual-embed-sdk 1.43.0 → 1.43.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/package.json +1 -1
- package/cjs/src/api-intercept.d.ts +51 -0
- package/cjs/src/api-intercept.d.ts.map +1 -0
- package/cjs/src/api-intercept.js +180 -0
- package/cjs/src/api-intercept.js.map +1 -0
- package/cjs/src/api-intercept.spec.d.ts +2 -0
- package/cjs/src/api-intercept.spec.d.ts.map +1 -0
- package/cjs/src/api-intercept.spec.js +672 -0
- package/cjs/src/api-intercept.spec.js.map +1 -0
- package/cjs/src/css-variables.d.ts +4 -0
- package/cjs/src/css-variables.d.ts.map +1 -1
- package/cjs/src/embed/app.d.ts +0 -5
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +4 -5
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +10 -0
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +2 -2
- package/cjs/src/embed/conversation.js +1 -1
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +17 -0
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.d.ts +11 -1
- package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.js +1 -0
- package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +4 -2
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +11 -0
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/search.d.ts +0 -7
- package/cjs/src/embed/search.d.ts.map +1 -1
- package/cjs/src/embed/search.js +1 -4
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +10 -0
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +56 -15
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +412 -238
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/index.d.ts +2 -2
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +2 -1
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/react/all-types-export.d.ts +1 -1
- package/cjs/src/react/all-types-export.d.ts.map +1 -1
- package/cjs/src/react/all-types-export.js +2 -1
- package/cjs/src/react/all-types-export.js.map +1 -1
- package/cjs/src/types.d.ts +244 -88
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +181 -70
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/logger.d.ts.map +1 -1
- package/cjs/src/utils/logger.js +1 -2
- package/cjs/src/utils/logger.js.map +1 -1
- package/cjs/src/utils/processData.d.ts +1 -1
- package/cjs/src/utils/processData.d.ts.map +1 -1
- package/cjs/src/utils/processData.js +8 -8
- package/cjs/src/utils/processData.js.map +1 -1
- package/cjs/src/utils/processData.spec.js.map +1 -1
- package/dist/{index-HZ94j9Ey.js → index-CpkMygsc.js} +1 -1
- package/dist/src/api-intercept.d.ts +51 -0
- package/dist/src/api-intercept.d.ts.map +1 -0
- package/dist/src/api-intercept.spec.d.ts +2 -0
- package/dist/src/api-intercept.spec.d.ts.map +1 -0
- package/dist/src/css-variables.d.ts +4 -0
- package/dist/src/css-variables.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +0 -5
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +2 -2
- package/dist/src/embed/hostEventClient/contracts.d.ts +11 -1
- package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/search.d.ts +0 -7
- package/dist/src/embed/search.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +10 -0
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/react/all-types-export.d.ts +1 -1
- package/dist/src/react/all-types-export.d.ts.map +1 -1
- package/dist/src/types.d.ts +244 -88
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/logger.d.ts.map +1 -1
- package/dist/src/utils/processData.d.ts +1 -1
- package/dist/src/utils/processData.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +435 -118
- package/dist/tsembed-react.js +434 -117
- package/dist/tsembed.es.js +3577 -3260
- package/dist/tsembed.js +3575 -3258
- package/dist/visual-embed-sdk-react-full.d.ts +271 -103
- package/dist/visual-embed-sdk-react.d.ts +268 -103
- package/dist/visual-embed-sdk.d.ts +271 -103
- package/lib/package.json +1 -1
- package/lib/src/api-intercept.d.ts +51 -0
- package/lib/src/api-intercept.d.ts.map +1 -0
- package/lib/src/api-intercept.js +173 -0
- package/lib/src/api-intercept.js.map +1 -0
- package/lib/src/api-intercept.spec.d.ts +2 -0
- package/lib/src/api-intercept.spec.d.ts.map +1 -0
- package/lib/src/api-intercept.spec.js +669 -0
- package/lib/src/api-intercept.spec.js.map +1 -0
- package/lib/src/css-variables.d.ts +4 -0
- package/lib/src/css-variables.d.ts.map +1 -1
- package/lib/src/embed/app.d.ts +0 -5
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +4 -5
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +10 -0
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +2 -2
- package/lib/src/embed/conversation.js +1 -1
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +17 -0
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts +11 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.js +1 -0
- package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +4 -2
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +11 -0
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/search.d.ts +0 -7
- package/lib/src/embed/search.d.ts.map +1 -1
- package/lib/src/embed/search.js +1 -4
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +10 -0
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +56 -15
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +412 -238
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/index.d.ts +2 -2
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +2 -2
- package/lib/src/index.js.map +1 -1
- package/lib/src/react/all-types-export.d.ts +1 -1
- package/lib/src/react/all-types-export.d.ts.map +1 -1
- package/lib/src/react/all-types-export.js +1 -1
- package/lib/src/react/all-types-export.js.map +1 -1
- package/lib/src/types.d.ts +244 -88
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +180 -69
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/logger.d.ts.map +1 -1
- package/lib/src/utils/logger.js +1 -2
- package/lib/src/utils/logger.js.map +1 -1
- package/lib/src/utils/processData.d.ts +1 -1
- package/lib/src/utils/processData.d.ts.map +1 -1
- package/lib/src/utils/processData.js +8 -8
- package/lib/src/utils/processData.js.map +1 -1
- package/lib/src/utils/processData.spec.js.map +1 -1
- package/package.json +1 -1
- package/src/api-intercept.spec.ts +856 -0
- package/src/api-intercept.ts +204 -0
- package/src/css-variables.ts +5 -0
- package/src/embed/app.spec.ts +11 -0
- package/src/embed/app.ts +5 -16
- package/src/embed/conversation.spec.ts +22 -0
- package/src/embed/conversation.ts +3 -3
- package/src/embed/hostEventClient/contracts.ts +10 -0
- package/src/embed/liveboard.spec.ts +12 -0
- package/src/embed/liveboard.ts +6 -2
- package/src/embed/search.ts +1 -14
- package/src/embed/ts-embed.spec.ts +498 -250
- package/src/embed/ts-embed.ts +80 -32
- package/src/index.ts +2 -0
- package/src/react/all-types-export.ts +1 -0
- package/src/types.ts +327 -165
- package/src/utils/logger.ts +1 -2
- package/src/utils/processData.spec.ts +0 -1
- package/src/utils/processData.ts +10 -11
|
@@ -699,6 +699,10 @@ export interface CustomCssVariables {
|
|
|
699
699
|
* Background color of the summary header in the CCA modal.
|
|
700
700
|
*/
|
|
701
701
|
"--ts-var-cca-modal-summary-header-background"?: string;
|
|
702
|
+
/**
|
|
703
|
+
* Width of the Spotter chat window.
|
|
704
|
+
*/
|
|
705
|
+
"--ts-var-spotter-chat-width"?: string;
|
|
702
706
|
}
|
|
703
707
|
export interface SessionInterface {
|
|
704
708
|
sessionId: string;
|
|
@@ -1541,7 +1545,7 @@ export interface FrameParams {
|
|
|
1541
1545
|
/**
|
|
1542
1546
|
* The common configuration object for an embedded view.
|
|
1543
1547
|
*/
|
|
1544
|
-
export interface BaseViewConfig {
|
|
1548
|
+
export interface BaseViewConfig extends ApiInterceptFlags {
|
|
1545
1549
|
/**
|
|
1546
1550
|
* @hidden
|
|
1547
1551
|
*/
|
|
@@ -2094,7 +2098,7 @@ export interface SearchLiveboardCommonViewConfig {
|
|
|
2094
2098
|
*
|
|
2095
2099
|
* Supported embed types: `SageEmbed`, `AppEmbed`, `SearchBarEmbed`, `LiveboardEmbed`, `SearchEmbed`
|
|
2096
2100
|
* @default true
|
|
2097
|
-
* @version SDK: 1.
|
|
2101
|
+
* @version SDK: 1.41.1 | ThoughtSpot Cloud: 10.14.0.cl
|
|
2098
2102
|
* @example
|
|
2099
2103
|
* ```js
|
|
2100
2104
|
* // Replace <EmbedComponent> with embed component name. For example, SageEmbed, AppEmbed, or SearchBarEmbed
|
|
@@ -2293,26 +2297,27 @@ export interface LiveboardAppEmbedViewConfig {
|
|
|
2293
2297
|
*/
|
|
2294
2298
|
enableAskSage?: boolean;
|
|
2295
2299
|
/**
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2300
|
+
* This flag is used to show or hide checkboxes for including or excluding
|
|
2301
|
+
* the cover and filters pages in the Liveboard PDF.
|
|
2302
|
+
*
|
|
2303
|
+
* Supported embed types: `AppEmbed`, `LiveboardEmbed`
|
|
2304
|
+
* @version SDK: 1.40.0 | ThoughtSpot:10.8.0.cl
|
|
2305
|
+
* @example
|
|
2306
|
+
* ```js
|
|
2307
|
+
* // Replace <EmbedComponent> with embed component name. For example, AppEmbed or LiveboardEmbed
|
|
2308
|
+
* const embed = new <EmbedComponent>('#tsEmbed', {
|
|
2309
|
+
* ... // other embed view config
|
|
2310
|
+
* coverAndFilterOptionInPDF: false,
|
|
2311
|
+
* })
|
|
2312
|
+
* ```
|
|
2313
|
+
*/
|
|
2310
2314
|
coverAndFilterOptionInPDF?: boolean;
|
|
2311
2315
|
/**
|
|
2312
2316
|
* This flag is used to enable or disable the XLSX/CSV download option for Liveboards.
|
|
2317
|
+
* To enable this feature on your instance, contact ThoughtSpot Support.
|
|
2313
2318
|
*
|
|
2314
2319
|
* Supported embed types: `AppEmbed`, `LiveboardEmbed`
|
|
2315
|
-
* @version SDK: 1.41.0 | ThoughtSpot:
|
|
2320
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 26.3.0.cl
|
|
2316
2321
|
* @example
|
|
2317
2322
|
* ```js
|
|
2318
2323
|
* // Replace <EmbedComponent> with embed component name. For example, AppEmbed or LiveboardEmbed
|
|
@@ -3504,21 +3509,24 @@ export declare enum EmbedEvent {
|
|
|
3504
3509
|
|
|
3505
3510
|
* Prerequisite: Set `isOnBeforeGetVizDataInterceptEnabled` to `true`
|
|
3506
3511
|
* for this embed event to get emitted.
|
|
3507
|
-
* @param: payload
|
|
3508
|
-
* @param:
|
|
3512
|
+
* @param:payload The payload received from the embed related to the Data API call.
|
|
3513
|
+
* @param:responder
|
|
3509
3514
|
* Contains elements that lets developers define whether ThoughtSpot
|
|
3510
3515
|
* should run the search, and if not, what error message
|
|
3511
3516
|
* should be shown to the user.
|
|
3512
3517
|
*
|
|
3513
|
-
* execute
|
|
3518
|
+
* `execute` - When execute returns `true`, the search will be run.
|
|
3514
3519
|
* When execute returns `false`, the search will not be executed.
|
|
3515
3520
|
*
|
|
3516
|
-
* error
|
|
3517
|
-
*
|
|
3521
|
+
* `error` - Developers can customize the error message text when `execute`
|
|
3522
|
+
* is `false` using the `errorText` and `errorDescription` parameters in responder.
|
|
3523
|
+
*
|
|
3524
|
+
* `errorText` - The error message text to be shown to the user.
|
|
3525
|
+
* `errorDescription (ThoughtSpot: 10.15.0.cl and above)` - The error description to be shown to the user.
|
|
3518
3526
|
* @version SDK : 1.29.0 | ThoughtSpot: 10.3.0.cl
|
|
3519
3527
|
* @example
|
|
3520
3528
|
*```js
|
|
3521
|
-
* .on(EmbedEvent.OnBeforeGetVizDataIntercept,
|
|
3529
|
+
* embed.on(EmbedEvent.OnBeforeGetVizDataIntercept,
|
|
3522
3530
|
* (payload, responder) => {
|
|
3523
3531
|
* responder({
|
|
3524
3532
|
* data: {
|
|
@@ -3534,7 +3542,7 @@ export declare enum EmbedEvent {
|
|
|
3534
3542
|
* ```
|
|
3535
3543
|
*
|
|
3536
3544
|
*```js
|
|
3537
|
-
* .on(EmbedEvent.OnBeforeGetVizDataIntercept,
|
|
3545
|
+
* embed.on(EmbedEvent.OnBeforeGetVizDataIntercept,
|
|
3538
3546
|
* (payload, responder) => {
|
|
3539
3547
|
* const query = payload.data.data.answer.search_query
|
|
3540
3548
|
* responder({
|
|
@@ -3545,7 +3553,8 @@ export declare enum EmbedEvent {
|
|
|
3545
3553
|
* error: {
|
|
3546
3554
|
* //Provide a custom error message to explain to your end user
|
|
3547
3555
|
* // why their search did not run, and which searches are accepted by your custom logic.
|
|
3548
|
-
* errorText: "
|
|
3556
|
+
* errorText: "Error Occurred",
|
|
3557
|
+
* errorDescription: "You can't use this query :" + query + ".
|
|
3549
3558
|
* The 'sales' measures can never be used at the 'county' level.
|
|
3550
3559
|
* Please try another measure, or remove 'county' from your search."
|
|
3551
3560
|
* }
|
|
@@ -3609,17 +3618,17 @@ export declare enum EmbedEvent {
|
|
|
3609
3618
|
*/
|
|
3610
3619
|
TableVizRendered = "TableVizRendered",
|
|
3611
3620
|
/**
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3621
|
+
* Emitted when the liveboard is created from pin modal or Liveboard list page.
|
|
3622
|
+
* You can use this event as a hook to trigger
|
|
3623
|
+
* other events on liveboard creation.
|
|
3624
|
+
*
|
|
3625
|
+
* ```js
|
|
3626
|
+
* liveboardEmbed.on(EmbedEvent.CreateLiveboard, (payload) => {
|
|
3627
|
+
* console.log('payload', payload);
|
|
3628
|
+
* })
|
|
3629
|
+
*```
|
|
3630
|
+
* @version SDK : 1.37.0 | ThoughtSpot: 10.8.0.cl
|
|
3631
|
+
*/
|
|
3623
3632
|
CreateLiveboard = "createLiveboard",
|
|
3624
3633
|
/**
|
|
3625
3634
|
* Emitted when a user creates a Model.
|
|
@@ -3715,6 +3724,17 @@ export declare enum EmbedEvent {
|
|
|
3715
3724
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
3716
3725
|
*/
|
|
3717
3726
|
SpotterInit = "spotterInit",
|
|
3727
|
+
/**
|
|
3728
|
+
* Emitted when a *Spotter* conversation has been successfully created.
|
|
3729
|
+
* @example
|
|
3730
|
+
* ```js
|
|
3731
|
+
* spotterEmbed.on(EmbedEvent.SpotterLoadComplete, (payload) => {
|
|
3732
|
+
* console.log('payload', payload);
|
|
3733
|
+
* })
|
|
3734
|
+
*```
|
|
3735
|
+
* @version SDK: 1.44.0 | ThoughtSpot: 26.2.0.cl
|
|
3736
|
+
*/
|
|
3737
|
+
SpotterLoadComplete = "spotterLoadComplete",
|
|
3718
3738
|
/**
|
|
3719
3739
|
* @hidden
|
|
3720
3740
|
* Triggers when the embed listener is ready to receive events.
|
|
@@ -3737,7 +3757,73 @@ export declare enum EmbedEvent {
|
|
|
3737
3757
|
* ```
|
|
3738
3758
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
3739
3759
|
*/
|
|
3740
|
-
OrgSwitched = "orgSwitched"
|
|
3760
|
+
OrgSwitched = "orgSwitched",
|
|
3761
|
+
/**
|
|
3762
|
+
* Emitted when the user intercepts a URL.
|
|
3763
|
+
*
|
|
3764
|
+
* Supported on all embed types.
|
|
3765
|
+
*
|
|
3766
|
+
* @example
|
|
3767
|
+
*
|
|
3768
|
+
* ```js
|
|
3769
|
+
* embed.on(EmbedEvent.ApiIntercept, (payload, responder) => {
|
|
3770
|
+
* console.log('payload', payload);
|
|
3771
|
+
* responder({
|
|
3772
|
+
* data: {
|
|
3773
|
+
* execute: false,
|
|
3774
|
+
* error: {
|
|
3775
|
+
* errorText: 'Error Occurred',
|
|
3776
|
+
* }
|
|
3777
|
+
* }
|
|
3778
|
+
* })
|
|
3779
|
+
* })
|
|
3780
|
+
* ```
|
|
3781
|
+
*
|
|
3782
|
+
* ```js
|
|
3783
|
+
* // We can also send a response for the intercepted api
|
|
3784
|
+
* embed.on(EmbedEvent.ApiIntercept, (payload, responder) => {
|
|
3785
|
+
* console.log('payload', payload);
|
|
3786
|
+
* responder({
|
|
3787
|
+
* data: {
|
|
3788
|
+
* execute: false,
|
|
3789
|
+
* response: {
|
|
3790
|
+
* body: {
|
|
3791
|
+
* data: {
|
|
3792
|
+
* // Some api response
|
|
3793
|
+
* },
|
|
3794
|
+
* }
|
|
3795
|
+
* }
|
|
3796
|
+
* }
|
|
3797
|
+
* })
|
|
3798
|
+
* })
|
|
3799
|
+
*
|
|
3800
|
+
* // here embed will use the response from the responder as the response for the api
|
|
3801
|
+
* ```
|
|
3802
|
+
*
|
|
3803
|
+
* ```js
|
|
3804
|
+
* // We can also send error in response for the intercepted api
|
|
3805
|
+
* embed.on(EmbedEvent.ApiIntercept, (payload, responder) => {
|
|
3806
|
+
* console.log('payload', payload);
|
|
3807
|
+
* responder({
|
|
3808
|
+
* data: {
|
|
3809
|
+
* execute: false,
|
|
3810
|
+
* response: {
|
|
3811
|
+
* body: {
|
|
3812
|
+
* errors: [{
|
|
3813
|
+
* title: 'Error Occurred',
|
|
3814
|
+
* description: 'Error Description',
|
|
3815
|
+
* isUserError: true,
|
|
3816
|
+
* }],
|
|
3817
|
+
* data: {},
|
|
3818
|
+
* },
|
|
3819
|
+
* }
|
|
3820
|
+
* }
|
|
3821
|
+
* })
|
|
3822
|
+
* })
|
|
3823
|
+
* ```
|
|
3824
|
+
* @version SDK: 1.43.0 | ThoughtSpot: 10.15.0.cl
|
|
3825
|
+
*/
|
|
3826
|
+
ApiIntercept = "ApiIntercept"
|
|
3741
3827
|
}
|
|
3742
3828
|
/**
|
|
3743
3829
|
* Event types that can be triggered by the host application
|
|
@@ -4204,14 +4290,14 @@ export declare enum HostEvent {
|
|
|
4204
4290
|
* ```
|
|
4205
4291
|
* @example
|
|
4206
4292
|
* ```js
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
|
|
4293
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in MakeACopy host event.
|
|
4294
|
+
* let latestSpotterVizId = '';
|
|
4295
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
4296
|
+
* latestSpotterVizId = payload.data.id;
|
|
4297
|
+
* });
|
|
4298
|
+
*
|
|
4299
|
+
* spotterEmbed.trigger(HostEvent.MakeACopy, { vizId: latestSpotterVizId });
|
|
4300
|
+
* ```
|
|
4215
4301
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
4216
4302
|
*/
|
|
4217
4303
|
MakeACopy = "makeACopy",
|
|
@@ -4435,14 +4521,14 @@ export declare enum HostEvent {
|
|
|
4435
4521
|
* embed.trigger(HostEvent.Download)
|
|
4436
4522
|
* ```
|
|
4437
4523
|
* ```js
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
|
|
4524
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in Download host event.
|
|
4525
|
+
* let latestSpotterVizId = '';
|
|
4526
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
4527
|
+
* latestSpotterVizId = payload.data.id;
|
|
4528
|
+
* });
|
|
4529
|
+
*
|
|
4530
|
+
* spotterEmbed.trigger(HostEvent.Download, { vizId: latestSpotterVizId });
|
|
4531
|
+
* ```
|
|
4446
4532
|
* @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw
|
|
4447
4533
|
* Use {@link DownloadAsPng}
|
|
4448
4534
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
@@ -4460,13 +4546,13 @@ export declare enum HostEvent {
|
|
|
4460
4546
|
*
|
|
4461
4547
|
* searchEmbed.trigger(HostEvent.DownloadAsPng)
|
|
4462
4548
|
*
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4549
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsPng host event.
|
|
4550
|
+
* let latestSpotterVizId = '';
|
|
4551
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
4552
|
+
* latestSpotterVizId = payload.data.id;
|
|
4553
|
+
* });
|
|
4554
|
+
*
|
|
4555
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsPng, { vizId: latestSpotterVizId });
|
|
4470
4556
|
* ```
|
|
4471
4557
|
*
|
|
4472
4558
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
|
|
@@ -4488,13 +4574,13 @@ export declare enum HostEvent {
|
|
|
4488
4574
|
* searchEmbed.trigger(HostEvent.DownloadAsCsv)
|
|
4489
4575
|
* ```
|
|
4490
4576
|
* ```js
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4577
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsCsv host event.
|
|
4578
|
+
* let latestSpotterVizId = '';
|
|
4579
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
4580
|
+
* latestSpotterVizId = payload.data.id;
|
|
4581
|
+
* });
|
|
4582
|
+
*
|
|
4583
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsCsv, { vizId: latestSpotterVizId });
|
|
4498
4584
|
* ```
|
|
4499
4585
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
4500
4586
|
*/
|
|
@@ -4515,13 +4601,13 @@ export declare enum HostEvent {
|
|
|
4515
4601
|
* searchEmbed.trigger(HostEvent.DownloadAsXlsx)
|
|
4516
4602
|
* ```
|
|
4517
4603
|
* ```js
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4604
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsXlsx host event.
|
|
4605
|
+
* let latestSpotterVizId = '';
|
|
4606
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
4607
|
+
* latestSpotterVizId = payload.data.id;
|
|
4608
|
+
* });
|
|
4609
|
+
*
|
|
4610
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsXlsx, { vizId: latestSpotterVizId });
|
|
4525
4611
|
* ```
|
|
4526
4612
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
4527
4613
|
*/
|
|
@@ -4886,13 +4972,13 @@ export declare enum HostEvent {
|
|
|
4886
4972
|
* });
|
|
4887
4973
|
*```
|
|
4888
4974
|
*```js
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4975
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in GetParameters host event.
|
|
4976
|
+
* let latestSpotterVizId = '';
|
|
4977
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
4978
|
+
* latestSpotterVizId = payload.data.id;
|
|
4979
|
+
* });
|
|
4980
|
+
*
|
|
4981
|
+
* spotterEmbed.trigger(HostEvent.GetParameters, { vizId: latestSpotterVizId });
|
|
4896
4982
|
*```
|
|
4897
4983
|
* @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
|
|
4898
4984
|
*/
|
|
@@ -4941,8 +5027,8 @@ export declare enum HostEvent {
|
|
|
4941
5027
|
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
4942
5028
|
* latestSpotterVizId = payload.data.id;
|
|
4943
5029
|
* });
|
|
4944
|
-
|
|
4945
|
-
|
|
5030
|
+
*
|
|
5031
|
+
* spotterEmbed.trigger(HostEvent.SaveAnswer, { vizId: latestSpotterVizId });
|
|
4946
5032
|
* ```
|
|
4947
5033
|
* @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
|
|
4948
5034
|
*/
|
|
@@ -5033,8 +5119,8 @@ export declare enum HostEvent {
|
|
|
5033
5119
|
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
5034
5120
|
* latestSpotterVizId = payload.data.id;
|
|
5035
5121
|
* });
|
|
5036
|
-
|
|
5037
|
-
|
|
5122
|
+
*
|
|
5123
|
+
* spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, { vizId: latestSpotterVizId });
|
|
5038
5124
|
*```
|
|
5039
5125
|
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
5040
5126
|
*/
|
|
@@ -5071,8 +5157,8 @@ export declare enum HostEvent {
|
|
|
5071
5157
|
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
5072
5158
|
* latestSpotterVizId = payload.data.id;
|
|
5073
5159
|
* });
|
|
5074
|
-
|
|
5075
|
-
|
|
5160
|
+
*
|
|
5161
|
+
* spotterEmbed.trigger(HostEvent.AskSpotter, { vizId: latestSpotterVizId });
|
|
5076
5162
|
* ```
|
|
5077
5163
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
5078
5164
|
*/
|
|
@@ -5095,7 +5181,19 @@ export declare enum HostEvent {
|
|
|
5095
5181
|
* ```
|
|
5096
5182
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
5097
5183
|
*/
|
|
5098
|
-
DestroyEmbed = "EmbedDestroyed"
|
|
5184
|
+
DestroyEmbed = "EmbedDestroyed",
|
|
5185
|
+
/** Triggers a create new conversation operation in spotter embed.
|
|
5186
|
+
* @example
|
|
5187
|
+
* ```js
|
|
5188
|
+
* This feature is available only when chat history is enabled on your ThoughtSpot instance.
|
|
5189
|
+
* Contact your admin or ThoughtSpot Support to enable chat history on your instance.
|
|
5190
|
+
* @example
|
|
5191
|
+
* ```js
|
|
5192
|
+
* spotterEmbed.trigger(HostEvent.StartNewSpotterConversation);
|
|
5193
|
+
* ```
|
|
5194
|
+
* @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
|
|
5195
|
+
*/
|
|
5196
|
+
StartNewSpotterConversation = "StartNewSpotterConversation"
|
|
5099
5197
|
}
|
|
5100
5198
|
/**
|
|
5101
5199
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -6560,7 +6658,66 @@ export interface DefaultAppInitData {
|
|
|
6560
6658
|
customVariablesForThirdPartyTools: Record<string, any>;
|
|
6561
6659
|
hiddenListColumns: ListPageColumns[];
|
|
6562
6660
|
customActions: CustomAction[];
|
|
6661
|
+
interceptTimeout: number | undefined;
|
|
6662
|
+
interceptUrls: (string | InterceptedApiType)[];
|
|
6563
6663
|
}
|
|
6664
|
+
declare enum InterceptedApiType {
|
|
6665
|
+
/**
|
|
6666
|
+
* The apis that are use to get the data for the embed
|
|
6667
|
+
*/
|
|
6668
|
+
AnswerData = "AnswerData",
|
|
6669
|
+
/**
|
|
6670
|
+
* This will intercept all the apis
|
|
6671
|
+
*/
|
|
6672
|
+
ALL = "ALL",
|
|
6673
|
+
/**
|
|
6674
|
+
* The apis that are use to get the data for the liveboard
|
|
6675
|
+
*/
|
|
6676
|
+
LiveboardData = "LiveboardData"
|
|
6677
|
+
}
|
|
6678
|
+
export type ApiInterceptFlags = {
|
|
6679
|
+
/**
|
|
6680
|
+
* Flag that allows using `EmbedEvent.OnBeforeGetVizDataIntercept`.
|
|
6681
|
+
*
|
|
6682
|
+
* Can be used for Serach and App Embed from SDK 1.29.0
|
|
6683
|
+
*
|
|
6684
|
+
* @version SDK : 1.43.0 | ThoughtSpot: 10.15.0.cl
|
|
6685
|
+
*/
|
|
6686
|
+
isOnBeforeGetVizDataInterceptEnabled?: boolean;
|
|
6687
|
+
/**
|
|
6688
|
+
* This allows to intercept the urls passed, once intercepted the api will only
|
|
6689
|
+
* run based on the reponse from the responder of ApiIntercept event.
|
|
6690
|
+
*
|
|
6691
|
+
* @example
|
|
6692
|
+
* ```js
|
|
6693
|
+
* const embed = new LiveboardEmbed('#embed', {
|
|
6694
|
+
* ...viewConfig,
|
|
6695
|
+
* enableApiIntercept: true,
|
|
6696
|
+
* interceptUrls: [InterceptedApiType.DATA],
|
|
6697
|
+
* })
|
|
6698
|
+
* ```
|
|
6699
|
+
*
|
|
6700
|
+
* @version SDK : 1.43.0 | ThoughtSpot: 10.15.0.cl
|
|
6701
|
+
*/
|
|
6702
|
+
interceptUrls?: (string | InterceptedApiType)[];
|
|
6703
|
+
/**
|
|
6704
|
+
* The timeout for the intercept, default is 30000ms
|
|
6705
|
+
* the api will error out if the timeout is reached
|
|
6706
|
+
*
|
|
6707
|
+
* @example
|
|
6708
|
+
* ```js
|
|
6709
|
+
* const embed = new LiveboardEmbed('#embed', {
|
|
6710
|
+
* ...viewConfig,
|
|
6711
|
+
* enableApiIntercept: true,
|
|
6712
|
+
* interceptUrls: [InterceptedApiType.ALL],
|
|
6713
|
+
* interceptTimeout: 1000,
|
|
6714
|
+
* })
|
|
6715
|
+
* ```
|
|
6716
|
+
*
|
|
6717
|
+
* @version SDK : 1.43.0 | ThoughtSpot: 10.15.0.cl
|
|
6718
|
+
*/
|
|
6719
|
+
interceptTimeout?: number;
|
|
6720
|
+
};
|
|
6564
6721
|
declare enum AuthFailureType {
|
|
6565
6722
|
SDK = "SDK",
|
|
6566
6723
|
NO_COOKIE_ACCESS = "NO_COOKIE_ACCESS",
|
|
@@ -6656,7 +6813,8 @@ declare enum UIPassthroughEvent {
|
|
|
6656
6813
|
GetDiscoverabilityStatus = "getDiscoverabilityStatus",
|
|
6657
6814
|
GetAvailableUIPassthroughs = "getAvailableUiPassthroughs",
|
|
6658
6815
|
GetAnswerConfig = "getAnswerPageConfig",
|
|
6659
|
-
GetLiveboardConfig = "getPinboardPageConfig"
|
|
6816
|
+
GetLiveboardConfig = "getPinboardPageConfig",
|
|
6817
|
+
GetUnsavedAnswerTML = "getUnsavedAnswerTML"
|
|
6660
6818
|
}
|
|
6661
6819
|
export type UIPassthroughContractBase = {
|
|
6662
6820
|
[UIPassthroughEvent.PinAnswerToLiveboard]: {
|
|
@@ -6711,6 +6869,15 @@ export type UIPassthroughContractBase = {
|
|
|
6711
6869
|
request: any;
|
|
6712
6870
|
response: any;
|
|
6713
6871
|
};
|
|
6872
|
+
[UIPassthroughEvent.GetUnsavedAnswerTML]: {
|
|
6873
|
+
request: {
|
|
6874
|
+
sessionId?: string;
|
|
6875
|
+
vizId?: string;
|
|
6876
|
+
};
|
|
6877
|
+
response: {
|
|
6878
|
+
tml: string;
|
|
6879
|
+
};
|
|
6880
|
+
};
|
|
6714
6881
|
};
|
|
6715
6882
|
export type UIPassthroughRequest<T extends keyof UIPassthroughContractBase> = UIPassthroughContractBase[T]["request"];
|
|
6716
6883
|
export type UIPassthroughResponse<T extends keyof UIPassthroughContractBase> = UIPassthroughContractBase[T]["response"];
|
|
@@ -6866,6 +7033,8 @@ declare class TsEmbed {
|
|
|
6866
7033
|
* work regardless of auth status
|
|
6867
7034
|
*/
|
|
6868
7035
|
private subscribeToNetworkEvents;
|
|
7036
|
+
private handleApiInterceptEvent;
|
|
7037
|
+
private messageEventListener;
|
|
6869
7038
|
/**
|
|
6870
7039
|
* Subscribe to message events that depend on successful iframe setup
|
|
6871
7040
|
*/
|
|
@@ -6952,6 +7121,14 @@ declare class TsEmbed {
|
|
|
6952
7121
|
* @param height The height in pixels
|
|
6953
7122
|
*/
|
|
6954
7123
|
protected setIFrameHeight(height: number | string): void;
|
|
7124
|
+
/**
|
|
7125
|
+
* We can process the customer given payload before sending it to the embed port
|
|
7126
|
+
* Embed event handler -> responder -> createEmbedEventResponder -> send response
|
|
7127
|
+
* @param eventPort The event port for a specific MessageChannel
|
|
7128
|
+
* @param eventType The event type
|
|
7129
|
+
* @returns
|
|
7130
|
+
*/
|
|
7131
|
+
protected createEmbedEventResponder: (eventPort: MessagePort | void, eventType: EmbedEvent) => (payload: any) => void;
|
|
6955
7132
|
/**
|
|
6956
7133
|
* Executes all registered event handlers for a particular event type
|
|
6957
7134
|
* @param eventType The event type
|
|
@@ -7430,13 +7607,6 @@ export interface SearchViewConfig extends SearchLiveboardCommonViewConfig, Omit<
|
|
|
7430
7607
|
* @deprecated Use {@link collapseSearchBar} instead
|
|
7431
7608
|
*/
|
|
7432
7609
|
collapseSearchBarInitially?: boolean;
|
|
7433
|
-
/**
|
|
7434
|
-
* Flag to enable onBeforeSearchExecute Embed Event
|
|
7435
|
-
*
|
|
7436
|
-
* Supported embed types: `SearchEmbed`
|
|
7437
|
-
* @version: SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl
|
|
7438
|
-
*/
|
|
7439
|
-
isOnBeforeGetVizDataInterceptEnabled?: boolean;
|
|
7440
7610
|
/**
|
|
7441
7611
|
* This controls the initial behaviour of custom column groups accordion.
|
|
7442
7612
|
* It takes DataPanelCustomColumnGroupsAccordionState enum values as input.
|
|
@@ -8239,11 +8409,6 @@ export interface AppViewConfig extends AllEmbedViewConfig {
|
|
|
8239
8409
|
* ```
|
|
8240
8410
|
*/
|
|
8241
8411
|
dataPanelCustomGroupsAccordionInitialState?: DataPanelCustomColumnGroupsAccordionState$1;
|
|
8242
|
-
/**
|
|
8243
|
-
* Flag that allows using `EmbedEvent.OnBeforeGetVizDataIntercept`.
|
|
8244
|
-
* @version SDK : 1.29.0 | ThoughtSpot: 10.1.0.cl
|
|
8245
|
-
*/
|
|
8246
|
-
isOnBeforeGetVizDataInterceptEnabled?: boolean;
|
|
8247
8412
|
/**
|
|
8248
8413
|
* Flag to use home page search bar mode
|
|
8249
8414
|
*
|
|
@@ -8937,7 +9102,7 @@ export interface SpotterEmbedViewConfig extends Omit<BaseViewConfig, "primaryAct
|
|
|
8937
9102
|
*
|
|
8938
9103
|
* Supported embed types: `SageEmbed`, `AppEmbed`, `SearchBarEmbed`, `LiveboardEmbed`, `SearchEmbed`
|
|
8939
9104
|
* @default true
|
|
8940
|
-
* @version SDK: 1.
|
|
9105
|
+
* @version SDK: 1.41.1 | ThoughtSpot Cloud: 10.14.0.cl
|
|
8941
9106
|
* @example
|
|
8942
9107
|
* ```js
|
|
8943
9108
|
* // Replace <EmbedComponent> with embed component name. For example, SageEmbed, AppEmbed, or SearchBarEmbed
|
|
@@ -9052,7 +9217,7 @@ export interface SpotterEmbedViewConfig extends Omit<BaseViewConfig, "primaryAct
|
|
|
9052
9217
|
* enablePastConversationsSidebar : true,
|
|
9053
9218
|
* })
|
|
9054
9219
|
* ```
|
|
9055
|
-
* @version SDK: 1.
|
|
9220
|
+
* @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
|
|
9056
9221
|
*/
|
|
9057
9222
|
enablePastConversationsSidebar?: boolean;
|
|
9058
9223
|
}
|