@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;
|
|
@@ -1538,7 +1542,7 @@ export interface FrameParams {
|
|
|
1538
1542
|
/**
|
|
1539
1543
|
* The common configuration object for an embedded view.
|
|
1540
1544
|
*/
|
|
1541
|
-
export interface BaseViewConfig {
|
|
1545
|
+
export interface BaseViewConfig extends ApiInterceptFlags {
|
|
1542
1546
|
/**
|
|
1543
1547
|
* @hidden
|
|
1544
1548
|
*/
|
|
@@ -2091,7 +2095,7 @@ export interface SearchLiveboardCommonViewConfig {
|
|
|
2091
2095
|
*
|
|
2092
2096
|
* Supported embed types: `SageEmbed`, `AppEmbed`, `SearchBarEmbed`, `LiveboardEmbed`, `SearchEmbed`
|
|
2093
2097
|
* @default true
|
|
2094
|
-
* @version SDK: 1.
|
|
2098
|
+
* @version SDK: 1.41.1 | ThoughtSpot Cloud: 10.14.0.cl
|
|
2095
2099
|
* @example
|
|
2096
2100
|
* ```js
|
|
2097
2101
|
* // Replace <EmbedComponent> with embed component name. For example, SageEmbed, AppEmbed, or SearchBarEmbed
|
|
@@ -2290,26 +2294,27 @@ export interface LiveboardAppEmbedViewConfig {
|
|
|
2290
2294
|
*/
|
|
2291
2295
|
enableAskSage?: boolean;
|
|
2292
2296
|
/**
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2297
|
+
* This flag is used to show or hide checkboxes for including or excluding
|
|
2298
|
+
* the cover and filters pages in the Liveboard PDF.
|
|
2299
|
+
*
|
|
2300
|
+
* Supported embed types: `AppEmbed`, `LiveboardEmbed`
|
|
2301
|
+
* @version SDK: 1.40.0 | ThoughtSpot:10.8.0.cl
|
|
2302
|
+
* @example
|
|
2303
|
+
* ```js
|
|
2304
|
+
* // Replace <EmbedComponent> with embed component name. For example, AppEmbed or LiveboardEmbed
|
|
2305
|
+
* const embed = new <EmbedComponent>('#tsEmbed', {
|
|
2306
|
+
* ... // other embed view config
|
|
2307
|
+
* coverAndFilterOptionInPDF: false,
|
|
2308
|
+
* })
|
|
2309
|
+
* ```
|
|
2310
|
+
*/
|
|
2307
2311
|
coverAndFilterOptionInPDF?: boolean;
|
|
2308
2312
|
/**
|
|
2309
2313
|
* This flag is used to enable or disable the XLSX/CSV download option for Liveboards.
|
|
2314
|
+
* To enable this feature on your instance, contact ThoughtSpot Support.
|
|
2310
2315
|
*
|
|
2311
2316
|
* Supported embed types: `AppEmbed`, `LiveboardEmbed`
|
|
2312
|
-
* @version SDK: 1.41.0 | ThoughtSpot:
|
|
2317
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 26.3.0.cl
|
|
2313
2318
|
* @example
|
|
2314
2319
|
* ```js
|
|
2315
2320
|
* // Replace <EmbedComponent> with embed component name. For example, AppEmbed or LiveboardEmbed
|
|
@@ -3489,21 +3494,24 @@ export declare enum EmbedEvent {
|
|
|
3489
3494
|
|
|
3490
3495
|
* Prerequisite: Set `isOnBeforeGetVizDataInterceptEnabled` to `true`
|
|
3491
3496
|
* for this embed event to get emitted.
|
|
3492
|
-
* @param: payload
|
|
3493
|
-
* @param:
|
|
3497
|
+
* @param:payload The payload received from the embed related to the Data API call.
|
|
3498
|
+
* @param:responder
|
|
3494
3499
|
* Contains elements that lets developers define whether ThoughtSpot
|
|
3495
3500
|
* should run the search, and if not, what error message
|
|
3496
3501
|
* should be shown to the user.
|
|
3497
3502
|
*
|
|
3498
|
-
* execute
|
|
3503
|
+
* `execute` - When execute returns `true`, the search will be run.
|
|
3499
3504
|
* When execute returns `false`, the search will not be executed.
|
|
3500
3505
|
*
|
|
3501
|
-
* error
|
|
3502
|
-
*
|
|
3506
|
+
* `error` - Developers can customize the error message text when `execute`
|
|
3507
|
+
* is `false` using the `errorText` and `errorDescription` parameters in responder.
|
|
3508
|
+
*
|
|
3509
|
+
* `errorText` - The error message text to be shown to the user.
|
|
3510
|
+
* `errorDescription (ThoughtSpot: 10.15.0.cl and above)` - The error description to be shown to the user.
|
|
3503
3511
|
* @version SDK : 1.29.0 | ThoughtSpot: 10.3.0.cl
|
|
3504
3512
|
* @example
|
|
3505
3513
|
*```js
|
|
3506
|
-
* .on(EmbedEvent.OnBeforeGetVizDataIntercept,
|
|
3514
|
+
* embed.on(EmbedEvent.OnBeforeGetVizDataIntercept,
|
|
3507
3515
|
* (payload, responder) => {
|
|
3508
3516
|
* responder({
|
|
3509
3517
|
* data: {
|
|
@@ -3519,7 +3527,7 @@ export declare enum EmbedEvent {
|
|
|
3519
3527
|
* ```
|
|
3520
3528
|
*
|
|
3521
3529
|
*```js
|
|
3522
|
-
* .on(EmbedEvent.OnBeforeGetVizDataIntercept,
|
|
3530
|
+
* embed.on(EmbedEvent.OnBeforeGetVizDataIntercept,
|
|
3523
3531
|
* (payload, responder) => {
|
|
3524
3532
|
* const query = payload.data.data.answer.search_query
|
|
3525
3533
|
* responder({
|
|
@@ -3530,7 +3538,8 @@ export declare enum EmbedEvent {
|
|
|
3530
3538
|
* error: {
|
|
3531
3539
|
* //Provide a custom error message to explain to your end user
|
|
3532
3540
|
* // why their search did not run, and which searches are accepted by your custom logic.
|
|
3533
|
-
* errorText: "
|
|
3541
|
+
* errorText: "Error Occurred",
|
|
3542
|
+
* errorDescription: "You can't use this query :" + query + ".
|
|
3534
3543
|
* The 'sales' measures can never be used at the 'county' level.
|
|
3535
3544
|
* Please try another measure, or remove 'county' from your search."
|
|
3536
3545
|
* }
|
|
@@ -3594,17 +3603,17 @@ export declare enum EmbedEvent {
|
|
|
3594
3603
|
*/
|
|
3595
3604
|
TableVizRendered = "TableVizRendered",
|
|
3596
3605
|
/**
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3606
|
+
* Emitted when the liveboard is created from pin modal or Liveboard list page.
|
|
3607
|
+
* You can use this event as a hook to trigger
|
|
3608
|
+
* other events on liveboard creation.
|
|
3609
|
+
*
|
|
3610
|
+
* ```js
|
|
3611
|
+
* liveboardEmbed.on(EmbedEvent.CreateLiveboard, (payload) => {
|
|
3612
|
+
* console.log('payload', payload);
|
|
3613
|
+
* })
|
|
3614
|
+
*```
|
|
3615
|
+
* @version SDK : 1.37.0 | ThoughtSpot: 10.8.0.cl
|
|
3616
|
+
*/
|
|
3608
3617
|
CreateLiveboard = "createLiveboard",
|
|
3609
3618
|
/**
|
|
3610
3619
|
* Emitted when a user creates a Model.
|
|
@@ -3700,6 +3709,17 @@ export declare enum EmbedEvent {
|
|
|
3700
3709
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
3701
3710
|
*/
|
|
3702
3711
|
SpotterInit = "spotterInit",
|
|
3712
|
+
/**
|
|
3713
|
+
* Emitted when a *Spotter* conversation has been successfully created.
|
|
3714
|
+
* @example
|
|
3715
|
+
* ```js
|
|
3716
|
+
* spotterEmbed.on(EmbedEvent.SpotterLoadComplete, (payload) => {
|
|
3717
|
+
* console.log('payload', payload);
|
|
3718
|
+
* })
|
|
3719
|
+
*```
|
|
3720
|
+
* @version SDK: 1.44.0 | ThoughtSpot: 26.2.0.cl
|
|
3721
|
+
*/
|
|
3722
|
+
SpotterLoadComplete = "spotterLoadComplete",
|
|
3703
3723
|
/**
|
|
3704
3724
|
* @hidden
|
|
3705
3725
|
* Triggers when the embed listener is ready to receive events.
|
|
@@ -3722,7 +3742,73 @@ export declare enum EmbedEvent {
|
|
|
3722
3742
|
* ```
|
|
3723
3743
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
3724
3744
|
*/
|
|
3725
|
-
OrgSwitched = "orgSwitched"
|
|
3745
|
+
OrgSwitched = "orgSwitched",
|
|
3746
|
+
/**
|
|
3747
|
+
* Emitted when the user intercepts a URL.
|
|
3748
|
+
*
|
|
3749
|
+
* Supported on all embed types.
|
|
3750
|
+
*
|
|
3751
|
+
* @example
|
|
3752
|
+
*
|
|
3753
|
+
* ```js
|
|
3754
|
+
* embed.on(EmbedEvent.ApiIntercept, (payload, responder) => {
|
|
3755
|
+
* console.log('payload', payload);
|
|
3756
|
+
* responder({
|
|
3757
|
+
* data: {
|
|
3758
|
+
* execute: false,
|
|
3759
|
+
* error: {
|
|
3760
|
+
* errorText: 'Error Occurred',
|
|
3761
|
+
* }
|
|
3762
|
+
* }
|
|
3763
|
+
* })
|
|
3764
|
+
* })
|
|
3765
|
+
* ```
|
|
3766
|
+
*
|
|
3767
|
+
* ```js
|
|
3768
|
+
* // We can also send a response for the intercepted api
|
|
3769
|
+
* embed.on(EmbedEvent.ApiIntercept, (payload, responder) => {
|
|
3770
|
+
* console.log('payload', payload);
|
|
3771
|
+
* responder({
|
|
3772
|
+
* data: {
|
|
3773
|
+
* execute: false,
|
|
3774
|
+
* response: {
|
|
3775
|
+
* body: {
|
|
3776
|
+
* data: {
|
|
3777
|
+
* // Some api response
|
|
3778
|
+
* },
|
|
3779
|
+
* }
|
|
3780
|
+
* }
|
|
3781
|
+
* }
|
|
3782
|
+
* })
|
|
3783
|
+
* })
|
|
3784
|
+
*
|
|
3785
|
+
* // here embed will use the response from the responder as the response for the api
|
|
3786
|
+
* ```
|
|
3787
|
+
*
|
|
3788
|
+
* ```js
|
|
3789
|
+
* // We can also send error in response for the intercepted api
|
|
3790
|
+
* embed.on(EmbedEvent.ApiIntercept, (payload, responder) => {
|
|
3791
|
+
* console.log('payload', payload);
|
|
3792
|
+
* responder({
|
|
3793
|
+
* data: {
|
|
3794
|
+
* execute: false,
|
|
3795
|
+
* response: {
|
|
3796
|
+
* body: {
|
|
3797
|
+
* errors: [{
|
|
3798
|
+
* title: 'Error Occurred',
|
|
3799
|
+
* description: 'Error Description',
|
|
3800
|
+
* isUserError: true,
|
|
3801
|
+
* }],
|
|
3802
|
+
* data: {},
|
|
3803
|
+
* },
|
|
3804
|
+
* }
|
|
3805
|
+
* }
|
|
3806
|
+
* })
|
|
3807
|
+
* })
|
|
3808
|
+
* ```
|
|
3809
|
+
* @version SDK: 1.43.0 | ThoughtSpot: 10.15.0.cl
|
|
3810
|
+
*/
|
|
3811
|
+
ApiIntercept = "ApiIntercept"
|
|
3726
3812
|
}
|
|
3727
3813
|
/**
|
|
3728
3814
|
* Event types that can be triggered by the host application
|
|
@@ -4189,14 +4275,14 @@ export declare enum HostEvent {
|
|
|
4189
4275
|
* ```
|
|
4190
4276
|
* @example
|
|
4191
4277
|
* ```js
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4278
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in MakeACopy host event.
|
|
4279
|
+
* let latestSpotterVizId = '';
|
|
4280
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
4281
|
+
* latestSpotterVizId = payload.data.id;
|
|
4282
|
+
* });
|
|
4283
|
+
*
|
|
4284
|
+
* spotterEmbed.trigger(HostEvent.MakeACopy, { vizId: latestSpotterVizId });
|
|
4285
|
+
* ```
|
|
4200
4286
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
4201
4287
|
*/
|
|
4202
4288
|
MakeACopy = "makeACopy",
|
|
@@ -4420,14 +4506,14 @@ export declare enum HostEvent {
|
|
|
4420
4506
|
* embed.trigger(HostEvent.Download)
|
|
4421
4507
|
* ```
|
|
4422
4508
|
* ```js
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
|
|
4509
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in Download host event.
|
|
4510
|
+
* let latestSpotterVizId = '';
|
|
4511
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
4512
|
+
* latestSpotterVizId = payload.data.id;
|
|
4513
|
+
* });
|
|
4514
|
+
*
|
|
4515
|
+
* spotterEmbed.trigger(HostEvent.Download, { vizId: latestSpotterVizId });
|
|
4516
|
+
* ```
|
|
4431
4517
|
* @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw
|
|
4432
4518
|
* Use {@link DownloadAsPng}
|
|
4433
4519
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
@@ -4445,13 +4531,13 @@ export declare enum HostEvent {
|
|
|
4445
4531
|
*
|
|
4446
4532
|
* searchEmbed.trigger(HostEvent.DownloadAsPng)
|
|
4447
4533
|
*
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4534
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsPng host event.
|
|
4535
|
+
* let latestSpotterVizId = '';
|
|
4536
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
4537
|
+
* latestSpotterVizId = payload.data.id;
|
|
4538
|
+
* });
|
|
4539
|
+
*
|
|
4540
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsPng, { vizId: latestSpotterVizId });
|
|
4455
4541
|
* ```
|
|
4456
4542
|
*
|
|
4457
4543
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
|
|
@@ -4473,13 +4559,13 @@ export declare enum HostEvent {
|
|
|
4473
4559
|
* searchEmbed.trigger(HostEvent.DownloadAsCsv)
|
|
4474
4560
|
* ```
|
|
4475
4561
|
* ```js
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4562
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsCsv host event.
|
|
4563
|
+
* let latestSpotterVizId = '';
|
|
4564
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
4565
|
+
* latestSpotterVizId = payload.data.id;
|
|
4566
|
+
* });
|
|
4567
|
+
*
|
|
4568
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsCsv, { vizId: latestSpotterVizId });
|
|
4483
4569
|
* ```
|
|
4484
4570
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
4485
4571
|
*/
|
|
@@ -4500,13 +4586,13 @@ export declare enum HostEvent {
|
|
|
4500
4586
|
* searchEmbed.trigger(HostEvent.DownloadAsXlsx)
|
|
4501
4587
|
* ```
|
|
4502
4588
|
* ```js
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4589
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsXlsx host event.
|
|
4590
|
+
* let latestSpotterVizId = '';
|
|
4591
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
4592
|
+
* latestSpotterVizId = payload.data.id;
|
|
4593
|
+
* });
|
|
4594
|
+
*
|
|
4595
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsXlsx, { vizId: latestSpotterVizId });
|
|
4510
4596
|
* ```
|
|
4511
4597
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
4512
4598
|
*/
|
|
@@ -4871,13 +4957,13 @@ export declare enum HostEvent {
|
|
|
4871
4957
|
* });
|
|
4872
4958
|
*```
|
|
4873
4959
|
*```js
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
|
|
4879
|
-
|
|
4880
|
-
|
|
4960
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in GetParameters host event.
|
|
4961
|
+
* let latestSpotterVizId = '';
|
|
4962
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
4963
|
+
* latestSpotterVizId = payload.data.id;
|
|
4964
|
+
* });
|
|
4965
|
+
*
|
|
4966
|
+
* spotterEmbed.trigger(HostEvent.GetParameters, { vizId: latestSpotterVizId });
|
|
4881
4967
|
*```
|
|
4882
4968
|
* @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
|
|
4883
4969
|
*/
|
|
@@ -4926,8 +5012,8 @@ export declare enum HostEvent {
|
|
|
4926
5012
|
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
4927
5013
|
* latestSpotterVizId = payload.data.id;
|
|
4928
5014
|
* });
|
|
4929
|
-
|
|
4930
|
-
|
|
5015
|
+
*
|
|
5016
|
+
* spotterEmbed.trigger(HostEvent.SaveAnswer, { vizId: latestSpotterVizId });
|
|
4931
5017
|
* ```
|
|
4932
5018
|
* @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
|
|
4933
5019
|
*/
|
|
@@ -5018,8 +5104,8 @@ export declare enum HostEvent {
|
|
|
5018
5104
|
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
5019
5105
|
* latestSpotterVizId = payload.data.id;
|
|
5020
5106
|
* });
|
|
5021
|
-
|
|
5022
|
-
|
|
5107
|
+
*
|
|
5108
|
+
* spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, { vizId: latestSpotterVizId });
|
|
5023
5109
|
*```
|
|
5024
5110
|
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
5025
5111
|
*/
|
|
@@ -5056,8 +5142,8 @@ export declare enum HostEvent {
|
|
|
5056
5142
|
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
5057
5143
|
* latestSpotterVizId = payload.data.id;
|
|
5058
5144
|
* });
|
|
5059
|
-
|
|
5060
|
-
|
|
5145
|
+
*
|
|
5146
|
+
* spotterEmbed.trigger(HostEvent.AskSpotter, { vizId: latestSpotterVizId });
|
|
5061
5147
|
* ```
|
|
5062
5148
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
5063
5149
|
*/
|
|
@@ -5080,7 +5166,19 @@ export declare enum HostEvent {
|
|
|
5080
5166
|
* ```
|
|
5081
5167
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
5082
5168
|
*/
|
|
5083
|
-
DestroyEmbed = "EmbedDestroyed"
|
|
5169
|
+
DestroyEmbed = "EmbedDestroyed",
|
|
5170
|
+
/** Triggers a create new conversation operation in spotter embed.
|
|
5171
|
+
* @example
|
|
5172
|
+
* ```js
|
|
5173
|
+
* This feature is available only when chat history is enabled on your ThoughtSpot instance.
|
|
5174
|
+
* Contact your admin or ThoughtSpot Support to enable chat history on your instance.
|
|
5175
|
+
* @example
|
|
5176
|
+
* ```js
|
|
5177
|
+
* spotterEmbed.trigger(HostEvent.StartNewSpotterConversation);
|
|
5178
|
+
* ```
|
|
5179
|
+
* @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
|
|
5180
|
+
*/
|
|
5181
|
+
StartNewSpotterConversation = "StartNewSpotterConversation"
|
|
5084
5182
|
}
|
|
5085
5183
|
/**
|
|
5086
5184
|
* The different visual modes that the data sources panel within
|
|
@@ -6566,7 +6664,69 @@ export interface DefaultAppInitData {
|
|
|
6566
6664
|
customVariablesForThirdPartyTools: Record<string, any>;
|
|
6567
6665
|
hiddenListColumns: ListPageColumns[];
|
|
6568
6666
|
customActions: CustomAction[];
|
|
6667
|
+
interceptTimeout: number | undefined;
|
|
6668
|
+
interceptUrls: (string | InterceptedApiType)[];
|
|
6669
|
+
}
|
|
6670
|
+
/**
|
|
6671
|
+
* Enum for the type of API intercepted
|
|
6672
|
+
*/
|
|
6673
|
+
export declare enum InterceptedApiType {
|
|
6674
|
+
/**
|
|
6675
|
+
* The apis that are use to get the data for the embed
|
|
6676
|
+
*/
|
|
6677
|
+
AnswerData = "AnswerData",
|
|
6678
|
+
/**
|
|
6679
|
+
* This will intercept all the apis
|
|
6680
|
+
*/
|
|
6681
|
+
ALL = "ALL",
|
|
6682
|
+
/**
|
|
6683
|
+
* The apis that are use to get the data for the liveboard
|
|
6684
|
+
*/
|
|
6685
|
+
LiveboardData = "LiveboardData"
|
|
6569
6686
|
}
|
|
6687
|
+
export type ApiInterceptFlags = {
|
|
6688
|
+
/**
|
|
6689
|
+
* Flag that allows using `EmbedEvent.OnBeforeGetVizDataIntercept`.
|
|
6690
|
+
*
|
|
6691
|
+
* Can be used for Serach and App Embed from SDK 1.29.0
|
|
6692
|
+
*
|
|
6693
|
+
* @version SDK : 1.43.0 | ThoughtSpot: 10.15.0.cl
|
|
6694
|
+
*/
|
|
6695
|
+
isOnBeforeGetVizDataInterceptEnabled?: boolean;
|
|
6696
|
+
/**
|
|
6697
|
+
* This allows to intercept the urls passed, once intercepted the api will only
|
|
6698
|
+
* run based on the reponse from the responder of ApiIntercept event.
|
|
6699
|
+
*
|
|
6700
|
+
* @example
|
|
6701
|
+
* ```js
|
|
6702
|
+
* const embed = new LiveboardEmbed('#embed', {
|
|
6703
|
+
* ...viewConfig,
|
|
6704
|
+
* enableApiIntercept: true,
|
|
6705
|
+
* interceptUrls: [InterceptedApiType.DATA],
|
|
6706
|
+
* })
|
|
6707
|
+
* ```
|
|
6708
|
+
*
|
|
6709
|
+
* @version SDK : 1.43.0 | ThoughtSpot: 10.15.0.cl
|
|
6710
|
+
*/
|
|
6711
|
+
interceptUrls?: (string | InterceptedApiType)[];
|
|
6712
|
+
/**
|
|
6713
|
+
* The timeout for the intercept, default is 30000ms
|
|
6714
|
+
* the api will error out if the timeout is reached
|
|
6715
|
+
*
|
|
6716
|
+
* @example
|
|
6717
|
+
* ```js
|
|
6718
|
+
* const embed = new LiveboardEmbed('#embed', {
|
|
6719
|
+
* ...viewConfig,
|
|
6720
|
+
* enableApiIntercept: true,
|
|
6721
|
+
* interceptUrls: [InterceptedApiType.ALL],
|
|
6722
|
+
* interceptTimeout: 1000,
|
|
6723
|
+
* })
|
|
6724
|
+
* ```
|
|
6725
|
+
*
|
|
6726
|
+
* @version SDK : 1.43.0 | ThoughtSpot: 10.15.0.cl
|
|
6727
|
+
*/
|
|
6728
|
+
interceptTimeout?: number;
|
|
6729
|
+
};
|
|
6570
6730
|
/**
|
|
6571
6731
|
* Enum for auth failure types. This is the parameter passed to the listner
|
|
6572
6732
|
* of {@link AuthStatus.FAILURE}.
|
|
@@ -6675,7 +6835,8 @@ export declare enum UIPassthroughEvent {
|
|
|
6675
6835
|
GetDiscoverabilityStatus = "getDiscoverabilityStatus",
|
|
6676
6836
|
GetAvailableUIPassthroughs = "getAvailableUiPassthroughs",
|
|
6677
6837
|
GetAnswerConfig = "getAnswerPageConfig",
|
|
6678
|
-
GetLiveboardConfig = "getPinboardPageConfig"
|
|
6838
|
+
GetLiveboardConfig = "getPinboardPageConfig",
|
|
6839
|
+
GetUnsavedAnswerTML = "getUnsavedAnswerTML"
|
|
6679
6840
|
}
|
|
6680
6841
|
export type UIPassthroughContractBase = {
|
|
6681
6842
|
[UIPassthroughEvent.PinAnswerToLiveboard]: {
|
|
@@ -6730,6 +6891,15 @@ export type UIPassthroughContractBase = {
|
|
|
6730
6891
|
request: any;
|
|
6731
6892
|
response: any;
|
|
6732
6893
|
};
|
|
6894
|
+
[UIPassthroughEvent.GetUnsavedAnswerTML]: {
|
|
6895
|
+
request: {
|
|
6896
|
+
sessionId?: string;
|
|
6897
|
+
vizId?: string;
|
|
6898
|
+
};
|
|
6899
|
+
response: {
|
|
6900
|
+
tml: string;
|
|
6901
|
+
};
|
|
6902
|
+
};
|
|
6733
6903
|
};
|
|
6734
6904
|
export type UIPassthroughRequest<T extends keyof UIPassthroughContractBase> = UIPassthroughContractBase[T]["request"];
|
|
6735
6905
|
export type UIPassthroughResponse<T extends keyof UIPassthroughContractBase> = UIPassthroughContractBase[T]["response"];
|
|
@@ -6885,6 +7055,8 @@ declare class TsEmbed {
|
|
|
6885
7055
|
* work regardless of auth status
|
|
6886
7056
|
*/
|
|
6887
7057
|
private subscribeToNetworkEvents;
|
|
7058
|
+
private handleApiInterceptEvent;
|
|
7059
|
+
private messageEventListener;
|
|
6888
7060
|
/**
|
|
6889
7061
|
* Subscribe to message events that depend on successful iframe setup
|
|
6890
7062
|
*/
|
|
@@ -6971,6 +7143,14 @@ declare class TsEmbed {
|
|
|
6971
7143
|
* @param height The height in pixels
|
|
6972
7144
|
*/
|
|
6973
7145
|
protected setIFrameHeight(height: number | string): void;
|
|
7146
|
+
/**
|
|
7147
|
+
* We can process the customer given payload before sending it to the embed port
|
|
7148
|
+
* Embed event handler -> responder -> createEmbedEventResponder -> send response
|
|
7149
|
+
* @param eventPort The event port for a specific MessageChannel
|
|
7150
|
+
* @param eventType The event type
|
|
7151
|
+
* @returns
|
|
7152
|
+
*/
|
|
7153
|
+
protected createEmbedEventResponder: (eventPort: MessagePort | void, eventType: EmbedEvent) => (payload: any) => void;
|
|
6974
7154
|
/**
|
|
6975
7155
|
* Executes all registered event handlers for a particular event type
|
|
6976
7156
|
* @param eventType The event type
|
|
@@ -7449,13 +7629,6 @@ export interface SearchViewConfig extends SearchLiveboardCommonViewConfig, Omit<
|
|
|
7449
7629
|
* @deprecated Use {@link collapseSearchBar} instead
|
|
7450
7630
|
*/
|
|
7451
7631
|
collapseSearchBarInitially?: boolean;
|
|
7452
|
-
/**
|
|
7453
|
-
* Flag to enable onBeforeSearchExecute Embed Event
|
|
7454
|
-
*
|
|
7455
|
-
* Supported embed types: `SearchEmbed`
|
|
7456
|
-
* @version: SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl
|
|
7457
|
-
*/
|
|
7458
|
-
isOnBeforeGetVizDataInterceptEnabled?: boolean;
|
|
7459
7632
|
/**
|
|
7460
7633
|
* This controls the initial behaviour of custom column groups accordion.
|
|
7461
7634
|
* It takes DataPanelCustomColumnGroupsAccordionState enum values as input.
|
|
@@ -8262,11 +8435,6 @@ export interface AppViewConfig extends AllEmbedViewConfig {
|
|
|
8262
8435
|
* ```
|
|
8263
8436
|
*/
|
|
8264
8437
|
dataPanelCustomGroupsAccordionInitialState?: DataPanelCustomColumnGroupsAccordionState$1;
|
|
8265
|
-
/**
|
|
8266
|
-
* Flag that allows using `EmbedEvent.OnBeforeGetVizDataIntercept`.
|
|
8267
|
-
* @version SDK : 1.29.0 | ThoughtSpot: 10.1.0.cl
|
|
8268
|
-
*/
|
|
8269
|
-
isOnBeforeGetVizDataInterceptEnabled?: boolean;
|
|
8270
8438
|
/**
|
|
8271
8439
|
* Flag to use home page search bar mode
|
|
8272
8440
|
*
|
|
@@ -8965,7 +9133,7 @@ export interface SpotterEmbedViewConfig extends Omit<BaseViewConfig, "primaryAct
|
|
|
8965
9133
|
*
|
|
8966
9134
|
* Supported embed types: `SageEmbed`, `AppEmbed`, `SearchBarEmbed`, `LiveboardEmbed`, `SearchEmbed`
|
|
8967
9135
|
* @default true
|
|
8968
|
-
* @version SDK: 1.
|
|
9136
|
+
* @version SDK: 1.41.1 | ThoughtSpot Cloud: 10.14.0.cl
|
|
8969
9137
|
* @example
|
|
8970
9138
|
* ```js
|
|
8971
9139
|
* // Replace <EmbedComponent> with embed component name. For example, SageEmbed, AppEmbed, or SearchBarEmbed
|
|
@@ -9080,7 +9248,7 @@ export interface SpotterEmbedViewConfig extends Omit<BaseViewConfig, "primaryAct
|
|
|
9080
9248
|
* enablePastConversationsSidebar : true,
|
|
9081
9249
|
* })
|
|
9082
9250
|
* ```
|
|
9083
|
-
* @version SDK: 1.
|
|
9251
|
+
* @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
|
|
9084
9252
|
*/
|
|
9085
9253
|
enablePastConversationsSidebar?: boolean;
|
|
9086
9254
|
}
|