@thoughtspot/visual-embed-sdk 1.52.1 → 1.52.2-beta
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 +11 -4
- package/cjs/src/contracts/host-event-contracts.d.ts +49 -11
- package/cjs/src/contracts/host-event-contracts.d.ts.map +1 -1
- package/cjs/src/embed/app.d.ts +4 -3
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +1 -1
- 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/auto-frame-renderer.js +1 -1
- package/cjs/src/embed/auto-frame-renderer.js.map +1 -1
- package/cjs/src/embed/auto-frame-renderer.spec.js +24 -13
- package/cjs/src/embed/auto-frame-renderer.spec.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.js +1 -1
- package/cjs/src/embed/bodyless-conversation.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +1 -0
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +4 -4
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +35 -24
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/embedConfig.spec.js +2 -1
- package/cjs/src/embed/embedConfig.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts +2 -2
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.js +16 -10
- package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js +14 -8
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/utils.d.ts +9 -0
- package/cjs/src/embed/hostEventClient/utils.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/utils.js +49 -3
- package/cjs/src/embed/hostEventClient/utils.js.map +1 -1
- package/cjs/src/embed/hostEventClient/utils.spec.js +151 -0
- package/cjs/src/embed/hostEventClient/utils.spec.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +4 -3
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +18 -13
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +2 -1
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/search-bar.js +1 -1
- package/cjs/src/embed/search-bar.js.map +1 -1
- package/cjs/src/embed/search.js +1 -1
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/search.spec.js +20 -0
- package/cjs/src/embed/search.spec.js.map +1 -1
- package/cjs/src/embed/spotter-utils.d.ts +8 -1
- package/cjs/src/embed/spotter-utils.d.ts.map +1 -1
- package/cjs/src/embed/spotter-utils.js +14 -1
- package/cjs/src/embed/spotter-utils.js.map +1 -1
- package/cjs/src/embed/spotter-utils.spec.js +26 -0
- package/cjs/src/embed/spotter-utils.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +3 -0
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +108 -29
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +163 -23
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/errors.js +1 -1
- package/cjs/src/errors.js.map +1 -1
- package/cjs/src/index.d.ts +2 -1
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +3 -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 +45 -22
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +44 -21
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/authService/tokenizedAuthService.spec.js +2 -1
- package/cjs/src/utils/authService/tokenizedAuthService.spec.js.map +1 -1
- package/cjs/src/utils/custom-actions.spec.js +4 -2
- package/cjs/src/utils/custom-actions.spec.js.map +1 -1
- package/cjs/src/utils/filterConverter.d.ts +106 -0
- package/cjs/src/utils/filterConverter.d.ts.map +1 -0
- package/cjs/src/utils/filterConverter.js +215 -0
- package/cjs/src/utils/filterConverter.js.map +1 -0
- package/cjs/src/utils/filterConverter.spec.d.ts +2 -0
- package/cjs/src/utils/filterConverter.spec.d.ts.map +1 -0
- package/cjs/src/utils/filterConverter.spec.js +709 -0
- package/cjs/src/utils/filterConverter.spec.js.map +1 -0
- package/cjs/src/utils/processData.spec.js +2 -1
- package/cjs/src/utils/processData.spec.js.map +1 -1
- package/dist/{index-C1pmYb5H.js → index-CcBYlGo9.js} +1 -1
- package/dist/src/contracts/host-event-contracts.d.ts +49 -11
- package/dist/src/contracts/host-event-contracts.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +4 -3
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +1 -0
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/host-event-client.d.ts +2 -2
- package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/utils.d.ts +9 -0
- package/dist/src/embed/hostEventClient/utils.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +4 -3
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/spotter-utils.d.ts +8 -1
- package/dist/src/embed/spotter-utils.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +3 -0
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -1
- 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 +45 -22
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/filterConverter.d.ts +106 -0
- package/dist/src/utils/filterConverter.d.ts.map +1 -0
- package/dist/src/utils/filterConverter.spec.d.ts +2 -0
- package/dist/src/utils/filterConverter.spec.d.ts.map +1 -0
- package/dist/tsembed-react.es.js +257 -87
- package/dist/tsembed-react.js +256 -86
- package/dist/tsembed.es.js +466 -89
- package/dist/tsembed.js +465 -87
- package/dist/visual-embed-sdk-react-full.d.ts +202 -40
- package/dist/visual-embed-sdk-react.d.ts +108 -40
- package/dist/visual-embed-sdk.d.ts +202 -40
- package/lib/package.json +11 -4
- package/lib/src/contracts/host-event-contracts.d.ts +49 -11
- package/lib/src/contracts/host-event-contracts.d.ts.map +1 -1
- package/lib/src/embed/app.d.ts +4 -3
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +1 -1
- 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/auto-frame-renderer.js +1 -1
- package/lib/src/embed/auto-frame-renderer.js.map +1 -1
- package/lib/src/embed/auto-frame-renderer.spec.js +24 -13
- package/lib/src/embed/auto-frame-renderer.spec.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.js +1 -1
- package/lib/src/embed/bodyless-conversation.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +1 -0
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +5 -5
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +35 -24
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/embedConfig.spec.js +2 -1
- package/lib/src/embed/embedConfig.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.d.ts +2 -2
- package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.js +17 -11
- package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.spec.js +14 -8
- package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/utils.d.ts +9 -0
- package/lib/src/embed/hostEventClient/utils.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/utils.js +47 -2
- package/lib/src/embed/hostEventClient/utils.js.map +1 -1
- package/lib/src/embed/hostEventClient/utils.spec.js +152 -1
- package/lib/src/embed/hostEventClient/utils.spec.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +4 -3
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +18 -13
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +2 -1
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/search-bar.js +1 -1
- package/lib/src/embed/search-bar.js.map +1 -1
- package/lib/src/embed/search.js +1 -1
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/search.spec.js +20 -0
- package/lib/src/embed/search.spec.js.map +1 -1
- package/lib/src/embed/spotter-utils.d.ts +8 -1
- package/lib/src/embed/spotter-utils.d.ts.map +1 -1
- package/lib/src/embed/spotter-utils.js +12 -0
- package/lib/src/embed/spotter-utils.js.map +1 -1
- package/lib/src/embed/spotter-utils.spec.js +27 -1
- package/lib/src/embed/spotter-utils.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +3 -0
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +108 -29
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +164 -24
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/errors.js +1 -1
- package/lib/src/errors.js.map +1 -1
- package/lib/src/index.d.ts +2 -1
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +2 -1
- 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 +45 -22
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +44 -21
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/authService/tokenizedAuthService.spec.js +2 -1
- package/lib/src/utils/authService/tokenizedAuthService.spec.js.map +1 -1
- package/lib/src/utils/custom-actions.spec.js +4 -2
- package/lib/src/utils/custom-actions.spec.js.map +1 -1
- package/lib/src/utils/filterConverter.d.ts +106 -0
- package/lib/src/utils/filterConverter.d.ts.map +1 -0
- package/lib/src/utils/filterConverter.js +210 -0
- package/lib/src/utils/filterConverter.js.map +1 -0
- package/lib/src/utils/filterConverter.spec.d.ts +2 -0
- package/lib/src/utils/filterConverter.spec.d.ts.map +1 -0
- package/lib/src/utils/filterConverter.spec.js +707 -0
- package/lib/src/utils/filterConverter.spec.js.map +1 -0
- package/lib/src/utils/processData.spec.js +2 -1
- package/lib/src/utils/processData.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +202 -40
- package/package.json +11 -4
- package/src/contracts/host-event-contracts.ts +55 -11
- package/src/embed/app.spec.ts +15 -0
- package/src/embed/app.ts +5 -4
- package/src/embed/auto-frame-renderer.spec.ts +24 -13
- package/src/embed/auto-frame-renderer.ts +1 -1
- package/src/embed/bodyless-conversation.ts +1 -1
- package/src/embed/conversation.spec.ts +38 -27
- package/src/embed/conversation.ts +5 -5
- package/src/embed/embedConfig.spec.ts +2 -1
- package/src/embed/hostEventClient/host-event-client.spec.ts +14 -8
- package/src/embed/hostEventClient/host-event-client.ts +18 -10
- package/src/embed/hostEventClient/utils.spec.ts +176 -1
- package/src/embed/hostEventClient/utils.ts +51 -2
- package/src/embed/liveboard.spec.ts +4 -3
- package/src/embed/liveboard.ts +22 -16
- package/src/embed/search-bar.tsx +1 -1
- package/src/embed/search.spec.ts +23 -0
- package/src/embed/search.ts +1 -1
- package/src/embed/spotter-utils.spec.ts +29 -0
- package/src/embed/spotter-utils.ts +16 -0
- package/src/embed/ts-embed.spec.ts +204 -23
- package/src/embed/ts-embed.ts +114 -28
- package/src/errors.ts +1 -1
- package/src/index.ts +10 -0
- package/src/react/all-types-export.ts +4 -0
- package/src/types.ts +44 -21
- package/src/utils/authService/tokenizedAuthService.spec.ts +2 -1
- package/src/utils/custom-actions.spec.ts +4 -2
- package/src/utils/filterConverter.spec.ts +801 -0
- package/src/utils/filterConverter.ts +304 -0
- package/src/utils/processData.spec.ts +2 -1
package/dist/tsembed.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.52.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.52.2-beta */
|
|
2
2
|
'use client';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
@@ -3772,6 +3772,12 @@
|
|
|
3772
3772
|
* ```js
|
|
3773
3773
|
* const data = await liveboardEmbed.trigger(HostEvent.GetFilters);
|
|
3774
3774
|
* console.log('data', data);
|
|
3775
|
+
* // {
|
|
3776
|
+
* // liveboardFilters: [ ... ],
|
|
3777
|
+
* // runtimeFilters: [
|
|
3778
|
+
* // { columnName: "Region", operator: "IN", values: ["West"] }
|
|
3779
|
+
* // ]
|
|
3780
|
+
* // }
|
|
3775
3781
|
* ```
|
|
3776
3782
|
* @example
|
|
3777
3783
|
* ```js
|
|
@@ -3796,9 +3802,9 @@
|
|
|
3796
3802
|
*
|
|
3797
3803
|
* Each filter object must include the following attributes:
|
|
3798
3804
|
*
|
|
3799
|
-
* `
|
|
3805
|
+
* `columnName` - Name of the column to filter on.
|
|
3800
3806
|
*
|
|
3801
|
-
* `
|
|
3807
|
+
* `operator` - Filter operator, for example, EQ, IN, CONTAINS.
|
|
3802
3808
|
* For information about the supported filter operators,
|
|
3803
3809
|
* see link:https://developers.thoughtspot.com/docs/runtime-filters#rtOperator[Developer Documentation].
|
|
3804
3810
|
*
|
|
@@ -3825,8 +3831,8 @@
|
|
|
3825
3831
|
*
|
|
3826
3832
|
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
3827
3833
|
* filter: {
|
|
3828
|
-
*
|
|
3829
|
-
*
|
|
3834
|
+
* columnName: "item type",
|
|
3835
|
+
* operator: "IN",
|
|
3830
3836
|
* values: ["bags","shirts"]
|
|
3831
3837
|
* }
|
|
3832
3838
|
* });
|
|
@@ -3836,8 +3842,8 @@
|
|
|
3836
3842
|
*
|
|
3837
3843
|
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
3838
3844
|
* filter: {
|
|
3839
|
-
*
|
|
3840
|
-
*
|
|
3845
|
+
* columnName: "date",
|
|
3846
|
+
* operator: "EQ",
|
|
3841
3847
|
* values: ["JULY","2023"],
|
|
3842
3848
|
* type: "MONTH_YEAR"
|
|
3843
3849
|
* }
|
|
@@ -3848,18 +3854,18 @@
|
|
|
3848
3854
|
* ```js
|
|
3849
3855
|
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
3850
3856
|
* filters: [{
|
|
3851
|
-
*
|
|
3852
|
-
*
|
|
3857
|
+
* columnName: "Item Type",
|
|
3858
|
+
* operator: 'IN',
|
|
3853
3859
|
* values: ["bags","shirts"]
|
|
3854
3860
|
* },
|
|
3855
3861
|
* {
|
|
3856
|
-
*
|
|
3857
|
-
*
|
|
3862
|
+
* columnName: "Region",
|
|
3863
|
+
* operator: 'IN',
|
|
3858
3864
|
* values: ["West","Midwest"]
|
|
3859
3865
|
* },
|
|
3860
3866
|
* {
|
|
3861
|
-
*
|
|
3862
|
-
*
|
|
3867
|
+
* columnName: "Date",
|
|
3868
|
+
* operator: 'EQ',
|
|
3863
3869
|
* values: ["2023-07-31"],
|
|
3864
3870
|
* type: "EXACT_DATE"
|
|
3865
3871
|
* }]
|
|
@@ -3873,13 +3879,13 @@
|
|
|
3873
3879
|
* ```js
|
|
3874
3880
|
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
3875
3881
|
* filters: [{
|
|
3876
|
-
*
|
|
3877
|
-
*
|
|
3882
|
+
* columnName: "(Sample) Retail - Apparel::city",
|
|
3883
|
+
* operator: 'IN',
|
|
3878
3884
|
* values: ["atlanta"]
|
|
3879
3885
|
* },
|
|
3880
3886
|
* {
|
|
3881
|
-
*
|
|
3882
|
-
*
|
|
3887
|
+
* columnName: "(Sample) Retail - Apparel::Region",
|
|
3888
|
+
* operator: 'IN',
|
|
3883
3889
|
* values: ["West","Midwest"]
|
|
3884
3890
|
* }]
|
|
3885
3891
|
* });
|
|
@@ -3890,8 +3896,8 @@
|
|
|
3890
3896
|
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3891
3897
|
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
3892
3898
|
* filter: {
|
|
3893
|
-
*
|
|
3894
|
-
*
|
|
3899
|
+
* columnName: "item type",
|
|
3900
|
+
* operator: "IN",
|
|
3895
3901
|
* values: ["shoes", "boots"]
|
|
3896
3902
|
* }
|
|
3897
3903
|
* }, ContextType.Liveboard);
|
|
@@ -3901,8 +3907,8 @@
|
|
|
3901
3907
|
* // Scope the filter to a specific Liveboard tab
|
|
3902
3908
|
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
3903
3909
|
* filter: {
|
|
3904
|
-
*
|
|
3905
|
-
*
|
|
3910
|
+
* columnName: "item type",
|
|
3911
|
+
* operator: "IN",
|
|
3906
3912
|
* values: ["bags", "shirts"],
|
|
3907
3913
|
* applicability: {
|
|
3908
3914
|
* level: "TAB",
|
|
@@ -3911,6 +3917,12 @@
|
|
|
3911
3917
|
* }
|
|
3912
3918
|
* });
|
|
3913
3919
|
* ```
|
|
3920
|
+
* Use `columnName` and `operator` - the same spelling as
|
|
3921
|
+
* {@link RuntimeFilter}. The older `column` and `oper` spellings are
|
|
3922
|
+
* deprecated; they are still accepted, but pass only one spelling of each
|
|
3923
|
+
* field, never both. To reapply the filter state captured from
|
|
3924
|
+
* {@link EmbedEvent.FilterChanged}, use `convertFilterChangedToUpdateFiltersPayload`
|
|
3925
|
+
* to convert its payload into the shape expected here.
|
|
3914
3926
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
3915
3927
|
*/
|
|
3916
3928
|
HostEvent["UpdateFilters"] = "updateFilters";
|
|
@@ -4896,7 +4908,6 @@
|
|
|
4896
4908
|
Param["IsStarterPromptsEnabled"] = "enableStarterPrompts";
|
|
4897
4909
|
Param["UpdatedSpotterExperience"] = "updatedSpotterExperience";
|
|
4898
4910
|
Param["SpotterDataSources"] = "spotterDataSources";
|
|
4899
|
-
Param["AnalystId"] = "analystId";
|
|
4900
4911
|
Param["OpenSpotterOnLiveboardByDefault"] = "openSpotterOnLiveboardByDefault";
|
|
4901
4912
|
Param["ShowAnswerEditPanel"] = "showAnswerEditPanel";
|
|
4902
4913
|
})(Param || (Param = {}));
|
|
@@ -7122,6 +7133,18 @@
|
|
|
7122
7133
|
* ```
|
|
7123
7134
|
*/
|
|
7124
7135
|
Action["DeleteCollection"] = "deleteCollection";
|
|
7136
|
+
/**
|
|
7137
|
+
* Controls the visibility of the "Customize homepage" button on the
|
|
7138
|
+
* embedded home page.
|
|
7139
|
+
* @version SDK: 1.55.0 | ThoughtSpot Cloud: 26.12.0.cl
|
|
7140
|
+
* @example
|
|
7141
|
+
* ```js
|
|
7142
|
+
* {
|
|
7143
|
+
* hiddenActions: [Action.CustomizeHomepage],
|
|
7144
|
+
* }
|
|
7145
|
+
* ```
|
|
7146
|
+
*/
|
|
7147
|
+
Action["CustomizeHomepage"] = "customizeHomepage";
|
|
7125
7148
|
})(exports.Action || (exports.Action = {}));
|
|
7126
7149
|
exports.PrefetchFeatures = void 0;
|
|
7127
7150
|
(function (PrefetchFeatures) {
|
|
@@ -7626,7 +7649,7 @@
|
|
|
7626
7649
|
TableContentDensity["Compact"] = "COMPACT";
|
|
7627
7650
|
})(exports.TableContentDensity || (exports.TableContentDensity = {}));
|
|
7628
7651
|
|
|
7629
|
-
var version$1="1.52.
|
|
7652
|
+
var version$1="1.52.2-beta";var pkg = {version:version$1};
|
|
7630
7653
|
|
|
7631
7654
|
const { version } = pkg;
|
|
7632
7655
|
|
|
@@ -7799,7 +7822,7 @@
|
|
|
7799
7822
|
SSR_ENVIRONMENT_ERROR: 'SSR environment detected. This function cannot be called in SSR environment.',
|
|
7800
7823
|
UPDATE_PARAMS_FAILED: 'Failed to update embed parameters',
|
|
7801
7824
|
INVALID_SPOTTER_DOCUMENTATION_URL: 'Invalid spotterDocumentationUrl. Please provide a valid http or https URL.',
|
|
7802
|
-
UPDATEFILTERS_INVALID_PAYLOAD: 'UpdateFilters requires a valid filter or filters array. Expected: { filter: {
|
|
7825
|
+
UPDATEFILTERS_INVALID_PAYLOAD: 'UpdateFilters requires a valid filter or filters array. Expected: { filter: { columnName, operator, values } } or { filters: [{ columnName, operator, values }, ...] }',
|
|
7803
7826
|
DRILLDOWN_INVALID_PAYLOAD: 'DrillDown requires a valid points object. Expected: { points: { clickedPoint?, selectedPoints? }, autoDrillDown?, vizId? }',
|
|
7804
7827
|
UPDATEPARAMETERS_INVALID_PAYLOAD: 'UpdateParameters received an invalid applicability. Expected: { level: LIVEBOARD | TAB | GROUP, targetId } where targetId is required for TAB and GROUP levels',
|
|
7805
7828
|
};
|
|
@@ -21671,7 +21694,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21671
21694
|
const isValidApplicability = (a) => {
|
|
21672
21695
|
if (isUndefined_1(a))
|
|
21673
21696
|
return true;
|
|
21674
|
-
// targetId is not required at LIVEBOARD level, since the filter applies to
|
|
21697
|
+
// targetId is not required at LIVEBOARD level, since the filter applies to
|
|
21698
|
+
// the whole Liveboard
|
|
21675
21699
|
return isPlainObject_1(a)
|
|
21676
21700
|
&& Object.values(exports.ApplicabilityLevel).includes(a.level)
|
|
21677
21701
|
&& (a.level === exports.ApplicabilityLevel.Liveboard || (isString_1(a.targetId) && a.targetId.trim().length > 0));
|
|
@@ -21690,8 +21714,52 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21690
21714
|
const hasValidFilters = Array.isArray(payload.filters) && payload.filters.length > 0 && payload.filters.every(isValidFilter);
|
|
21691
21715
|
return !!(hasValidFilter || hasValidFilters);
|
|
21692
21716
|
}
|
|
21717
|
+
/**
|
|
21718
|
+
* Rewrites one filter's `columnName`/`operator` to `column`/`oper`.
|
|
21719
|
+
*
|
|
21720
|
+
* Callers may use either spelling: `columnName`/`operator` match
|
|
21721
|
+
* {@link RuntimeFilter} and the `EmbedEvent.FilterChanged` payload, so a
|
|
21722
|
+
* converted payload can be replayed as-is. But the payload is forwarded to the
|
|
21723
|
+
* embedded app unchanged, and only `column`/`oper` are known to be understood
|
|
21724
|
+
* there - so the alias must be swapped here, or it would pass validation and
|
|
21725
|
+
* then be silently ignored.
|
|
21726
|
+
*
|
|
21727
|
+
* If a caller supplies both spellings of a field - which TypeScript rejects,
|
|
21728
|
+
* but JavaScript callers can still do - the documented `columnName`/`operator`
|
|
21729
|
+
* wins. Deferring to the deprecated spelling would quietly discard the value
|
|
21730
|
+
* the rest of the SDK tells people to use.
|
|
21731
|
+
* @param filter One entry from the UpdateFilters payload.
|
|
21732
|
+
*/
|
|
21733
|
+
function resolveFilterAliases(filter) {
|
|
21734
|
+
var _a, _b;
|
|
21735
|
+
if (!isPlainObject_1(filter))
|
|
21736
|
+
return filter;
|
|
21737
|
+
const column = (_a = filter.columnName) !== null && _a !== void 0 ? _a : filter.column;
|
|
21738
|
+
const oper = (_b = filter.operator) !== null && _b !== void 0 ? _b : filter.oper;
|
|
21739
|
+
const { columnName, operator, ...rest } = filter;
|
|
21740
|
+
return {
|
|
21741
|
+
...rest,
|
|
21742
|
+
...(isUndefined_1(column) ? {} : { column }),
|
|
21743
|
+
...(isUndefined_1(oper) ? {} : { oper }),
|
|
21744
|
+
};
|
|
21745
|
+
}
|
|
21746
|
+
/**
|
|
21747
|
+
* Rewrites every filter in an UpdateFilters payload to use `column`/`oper`,
|
|
21748
|
+
* whichever spelling the caller supplied. Call after validation.
|
|
21749
|
+
* @param payload The UpdateFilters host event payload.
|
|
21750
|
+
*/
|
|
21751
|
+
function resolveUpdateFiltersAliases(payload) {
|
|
21752
|
+
if (!isPlainObject_1(payload))
|
|
21753
|
+
return payload;
|
|
21754
|
+
return {
|
|
21755
|
+
...payload,
|
|
21756
|
+
...(payload.filter ? { filter: resolveFilterAliases(payload.filter) } : {}),
|
|
21757
|
+
...(Array.isArray(payload.filters) ? { filters: payload.filters.map(resolveFilterAliases) } : {}),
|
|
21758
|
+
};
|
|
21759
|
+
}
|
|
21693
21760
|
function isValidUpdateParametersPayload(payload) {
|
|
21694
|
-
// Only validates the applicability of each parameter (null treated as
|
|
21761
|
+
// Only validates the applicability of each parameter (null treated as
|
|
21762
|
+
// absent); the rest is forwarded as-is for backward compatibility.
|
|
21695
21763
|
if (!Array.isArray(payload))
|
|
21696
21764
|
return true;
|
|
21697
21765
|
return payload.every((p) => {
|
|
@@ -21739,7 +21807,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21739
21807
|
/**
|
|
21740
21808
|
* Maps HostEvent to its corresponding UIPassthroughEvent.
|
|
21741
21809
|
* Includes both custom-handler events (Pin, SaveAnswer, UpdateFilters, DrillDown)
|
|
21742
|
-
* and getter events (GetAnswerSession, GetFilters, etc.) that use
|
|
21810
|
+
* and getter events (GetAnswerSession, GetFilters, etc.) that use
|
|
21811
|
+
* getDataWithPassthroughFallback.
|
|
21743
21812
|
*/
|
|
21744
21813
|
const PASSTHROUGH_MAP = {
|
|
21745
21814
|
// Custom handlers (setters with special logic)
|
|
@@ -21890,17 +21959,21 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21890
21959
|
throwUpdateFiltersValidationError();
|
|
21891
21960
|
}
|
|
21892
21961
|
// The shared contract accepts both current (columnName/operator) and
|
|
21893
|
-
// legacy (column/oper) filter field names
|
|
21894
|
-
//
|
|
21895
|
-
//
|
|
21896
|
-
//
|
|
21897
|
-
|
|
21962
|
+
// legacy (column/oper) filter field names, but only the legacy pair is
|
|
21963
|
+
// understood downstream, so the payload is rewritten before it is
|
|
21964
|
+
// forwarded — otherwise a columnName/operator filter passes validation
|
|
21965
|
+
// here and is then silently ignored by the app. The cast bridges the
|
|
21966
|
+
// UIPassthrough FilterUpdate type, which still declares only the legacy
|
|
21967
|
+
// names.
|
|
21968
|
+
const resolvedPayload = resolveUpdateFiltersAliases(payload);
|
|
21969
|
+
return this.handleHostEventWithParam(exports.UIPassthroughEvent.UpdateFilters, resolvedPayload, context);
|
|
21898
21970
|
}
|
|
21899
21971
|
handleUpdateParametersEvent(payload, context) {
|
|
21900
21972
|
if (!isValidUpdateParametersPayload(payload)) {
|
|
21901
21973
|
throwUpdateParametersValidationError();
|
|
21902
21974
|
}
|
|
21903
|
-
// UpdateParameters has no UI passthrough contract; dispatch over the
|
|
21975
|
+
// UpdateParameters has no UI passthrough contract; dispatch over the
|
|
21976
|
+
// legacy channel
|
|
21904
21977
|
return this.hostEventFallback(exports.HostEvent.UpdateParameters, payload, context);
|
|
21905
21978
|
}
|
|
21906
21979
|
handleDrillDownEvent(payload, context) {
|
|
@@ -21911,8 +21984,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21911
21984
|
}
|
|
21912
21985
|
/**
|
|
21913
21986
|
* Dispatches a host event using the appropriate channel:
|
|
21914
|
-
* 1. If the embedded app supports UI passthrough for this event, use it (custom
|
|
21915
|
-
* 2. Otherwise fall back to the legacy host event channel.
|
|
21987
|
+
* 1. If the embedded app supports UI passthrough for this event, use it (custom
|
|
21988
|
+
* handler or getter). 2. Otherwise fall back to the legacy host event channel.
|
|
21916
21989
|
*
|
|
21917
21990
|
* @param hostEvent - The host event to trigger
|
|
21918
21991
|
* @param payload - Optional payload for the event
|
|
@@ -21921,7 +21994,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21921
21994
|
async triggerHostEvent(hostEvent, payload, context) {
|
|
21922
21995
|
const customHandler = this.customHandlers[hostEvent];
|
|
21923
21996
|
const passthroughEvent = PASSTHROUGH_MAP[hostEvent];
|
|
21924
|
-
// If embedded app supports passthrough but not this event, use legacy
|
|
21997
|
+
// If embedded app supports passthrough but not this event, use legacy
|
|
21998
|
+
// channel
|
|
21925
21999
|
const keys = passthroughEvent ? await this.getAvailableUIPassthroughKeys(context) : [];
|
|
21926
22000
|
if (passthroughEvent && keys.length > 0 && !keys.includes(passthroughEvent)) {
|
|
21927
22001
|
return this.hostEventFallback(hostEvent, payload, context);
|
|
@@ -22131,9 +22205,60 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22131
22205
|
// The container applies UpdateEmbedParams through React state, so a delivered
|
|
22132
22206
|
// post is not the same as the params being in effect.
|
|
22133
22207
|
const UPDATE_EMBED_PARAMS_SETTLE_MS = 200;
|
|
22134
|
-
// The container ignores runtimeFilterParams/runtimeParameterParams unless
|
|
22135
|
-
// null or '' leaves the previous embed's values in place. '&' is
|
|
22208
|
+
// The container ignores runtimeFilterParams/runtimeParameterParams unless
|
|
22209
|
+
// truthy, so null or '' leaves the previous embed's values in place. '&' is
|
|
22210
|
+
// truthy and parses to {}.
|
|
22136
22211
|
const NO_RUNTIME_PARAMS = '&';
|
|
22212
|
+
/**
|
|
22213
|
+
* Query parameters that stay on the iframe `src` while config is excluded from
|
|
22214
|
+
* the URL, which is the default unless the embed sets the
|
|
22215
|
+
* `excludeConfigFromURL` additional flag to `false`. These are the parameters the
|
|
22216
|
+
* application shell needs before it can receive a postMessage at all: the
|
|
22217
|
+
* embed marker, the host application URL used to validate the message origin,
|
|
22218
|
+
* the SDK version, the flags that pick the authentication flow, and the
|
|
22219
|
+
* boot-time settings that would otherwise be applied a frame late (viewport,
|
|
22220
|
+
* log level, locale, formatting and org). Everything else is delivered over
|
|
22221
|
+
* `HostEvent.UpdateEmbedParams`.
|
|
22222
|
+
* @internal
|
|
22223
|
+
*/
|
|
22224
|
+
const BOOTSTRAP_URL_PARAMS = new Set([
|
|
22225
|
+
Param.EmbedApp,
|
|
22226
|
+
Param.HostAppUrl,
|
|
22227
|
+
Param.Version,
|
|
22228
|
+
Param.AuthType,
|
|
22229
|
+
Param.AutoLogin,
|
|
22230
|
+
Param.DisableLoginRedirect,
|
|
22231
|
+
Param.ForceSAMLAutoRedirect,
|
|
22232
|
+
Param.cookieless,
|
|
22233
|
+
Param.preAuthCache,
|
|
22234
|
+
Param.blockNonEmbedFullAppAccess,
|
|
22235
|
+
Param.OverrideOrgId,
|
|
22236
|
+
Param.ViewPortHeight,
|
|
22237
|
+
Param.ViewPortWidth,
|
|
22238
|
+
Param.ClientLogLevel,
|
|
22239
|
+
Param.OverrideNativeConsole,
|
|
22240
|
+
Param.PendoTrackingKey,
|
|
22241
|
+
Param.NumberFormatLocale,
|
|
22242
|
+
Param.DateFormatLocale,
|
|
22243
|
+
Param.CurrencyFormat,
|
|
22244
|
+
Param.Locale,
|
|
22245
|
+
Param.searchEmbed,
|
|
22246
|
+
Param.livedBoardEmbed,
|
|
22247
|
+
Param.isSpotterAgentEmbed,
|
|
22248
|
+
Param.SpotterEnabled,
|
|
22249
|
+
Param.IsFullAppEmbed,
|
|
22250
|
+
Param.IsOnBeforeGetVizDataInterceptEnabled,
|
|
22251
|
+
Param.LinkOverride,
|
|
22252
|
+
Param.EnableLinkOverridesV2,
|
|
22253
|
+
Param.DisableRedirectionLinksInNewTab,
|
|
22254
|
+
Param.OverrideHistoryState,
|
|
22255
|
+
Param.ForceTable,
|
|
22256
|
+
Param.StringIDsUrl,
|
|
22257
|
+
Param.DataSources,
|
|
22258
|
+
Param.ExposeTranslationIDs,
|
|
22259
|
+
Param.IconSpriteUrl,
|
|
22260
|
+
Param.Tag,
|
|
22261
|
+
]);
|
|
22137
22262
|
/**
|
|
22138
22263
|
* The event id map from v2 event names to v1 event id
|
|
22139
22264
|
* v1 events are the classic embed events implemented in Blink v1
|
|
@@ -22330,15 +22455,20 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22330
22455
|
const AUTH_INIT_FALLBACK_DELAY = 1000;
|
|
22331
22456
|
// Wait for 1 second to ensure the embed container is loaded
|
|
22332
22457
|
// This is a workaround to ensure the embed container is loaded
|
|
22333
|
-
// this is needed until all clusters have EmbedListenerReady
|
|
22458
|
+
// this is needed until all clusters have EmbedListenerReady
|
|
22459
|
+
// event
|
|
22334
22460
|
setTimeout(processEmbedContainerReady, AUTH_INIT_FALLBACK_DELAY);
|
|
22335
22461
|
}
|
|
22336
22462
|
else if (source === exports.EmbedEvent.EmbedListenerReady) {
|
|
22337
22463
|
processEmbedContainerReady();
|
|
22464
|
+
if (this.isConfigExcludedFromUrl()) {
|
|
22465
|
+
this.triggerUpdateEmbedParams();
|
|
22466
|
+
}
|
|
22338
22467
|
}
|
|
22339
22468
|
};
|
|
22340
22469
|
// Subclasses that navigate the pre-render on show must await this before
|
|
22341
|
-
// triggering Navigate. Resolves even on failure, so navigation is never
|
|
22470
|
+
// triggering Navigate. Resolves even on failure, so navigation is never
|
|
22471
|
+
// blocked.
|
|
22342
22472
|
this.preRenderParamsApplied = Promise.resolve();
|
|
22343
22473
|
this.hostElement = getDOMNode(domSelector);
|
|
22344
22474
|
this.eventHandlerMap = new Map();
|
|
@@ -22668,8 +22798,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22668
22798
|
...this.viewConfig,
|
|
22669
22799
|
...queryParams,
|
|
22670
22800
|
...appInitData,
|
|
22671
|
-
// A show cycle has no URL to carry these, so the payload always
|
|
22672
|
-
// — including "none", which is the case that leaks the
|
|
22801
|
+
// A show cycle has no URL to carry these, so the payload always
|
|
22802
|
+
// states them — including "none", which is the case that leaks the
|
|
22803
|
+
// previous filters.
|
|
22673
22804
|
runtimeFilterParams: getFilterQuery((_a = this.viewConfig.runtimeFilters) !== null && _a !== void 0 ? _a : []) || NO_RUNTIME_PARAMS,
|
|
22674
22805
|
runtimeParameterParams: getRuntimeParameters((_b = this.viewConfig.runtimeParameters) !== null && _b !== void 0 ? _b : [])
|
|
22675
22806
|
|| NO_RUNTIME_PARAMS,
|
|
@@ -22837,13 +22968,20 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
22837
22968
|
return path;
|
|
22838
22969
|
}
|
|
22839
22970
|
getEmbedParams() {
|
|
22840
|
-
const queryParams = this.
|
|
22971
|
+
const queryParams = this.getUrlQueryParamsObject();
|
|
22841
22972
|
return getQueryParamString(queryParams);
|
|
22842
22973
|
}
|
|
22843
22974
|
getEmbedParamsObject() {
|
|
22844
22975
|
const params = this.getBaseQueryParams();
|
|
22845
22976
|
return params;
|
|
22846
22977
|
}
|
|
22978
|
+
getUrlQueryParamsObject() {
|
|
22979
|
+
const queryParams = this.getEmbedParamsObject();
|
|
22980
|
+
if (!this.isConfigExcludedFromUrl()) {
|
|
22981
|
+
return queryParams;
|
|
22982
|
+
}
|
|
22983
|
+
return Object.fromEntries(Object.entries(queryParams).filter(([key]) => BOOTSTRAP_URL_PARAMS.has(key)));
|
|
22984
|
+
}
|
|
22847
22985
|
getRootIframeSrc() {
|
|
22848
22986
|
const query = this.getEmbedParams();
|
|
22849
22987
|
return this.getEmbedBasePath(query);
|
|
@@ -23396,8 +23534,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23396
23534
|
return;
|
|
23397
23535
|
this.preRenderWrapper[this.embedNodeKey] = this;
|
|
23398
23536
|
}
|
|
23399
|
-
// The flag lives on the wrapper because it describes the iframe: an
|
|
23400
|
-
// hidden when the container announced itself would otherwise
|
|
23537
|
+
// The flag lives on the wrapper because it describes the iframe: an
|
|
23538
|
+
// instance hidden when the container announced itself would otherwise
|
|
23539
|
+
// report false forever.
|
|
23401
23540
|
markEmbedContainerLoaded() {
|
|
23402
23541
|
this.isEmbedContainerLoaded = true;
|
|
23403
23542
|
if (this.preRenderWrapper) {
|
|
@@ -23750,6 +23889,27 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23750
23889
|
this.isRendered = true;
|
|
23751
23890
|
return this.renderIFrame(prerenderFrameSrc);
|
|
23752
23891
|
}
|
|
23892
|
+
isConfigExcludedFromUrl() {
|
|
23893
|
+
var _a, _b, _c;
|
|
23894
|
+
const flag = (_b = (_a = this.viewConfig.additionalFlags) === null || _a === void 0 ? void 0 : _a.excludeConfigFromURL) !== null && _b !== void 0 ? _b : (_c = this.embedConfig.additionalFlags) === null || _c === void 0 ? void 0 : _c.excludeConfigFromURL;
|
|
23895
|
+
// Enabled by default; only an explicit false opts out.
|
|
23896
|
+
return flag !== false && flag !== 'false';
|
|
23897
|
+
}
|
|
23898
|
+
async triggerUpdateEmbedParams() {
|
|
23899
|
+
try {
|
|
23900
|
+
const params = await this.getUpdateEmbedParamsObject();
|
|
23901
|
+
this.trigger(exports.HostEvent.UpdateEmbedParams, params);
|
|
23902
|
+
}
|
|
23903
|
+
catch (error) {
|
|
23904
|
+
logger$3.error(ERROR_MESSAGE.UPDATE_PARAMS_FAILED, error);
|
|
23905
|
+
this.handleError({
|
|
23906
|
+
errorType: exports.ErrorDetailsTypes.API,
|
|
23907
|
+
message: (error === null || error === void 0 ? void 0 : error.message) || ERROR_MESSAGE.UPDATE_PARAMS_FAILED,
|
|
23908
|
+
code: exports.EmbedErrorCodes.UPDATE_PARAMS_FAILED,
|
|
23909
|
+
error: (error === null || error === void 0 ? void 0 : error.message) || error,
|
|
23910
|
+
});
|
|
23911
|
+
}
|
|
23912
|
+
}
|
|
23753
23913
|
beforePrerenderVisible() {
|
|
23754
23914
|
// We can ignore this as its a bit expensive and the newer customers
|
|
23755
23915
|
// have moved on to UpdateEmbedParams supported clusters
|
|
@@ -23760,17 +23920,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23760
23920
|
this.preRenderParamsApplied = new Promise((resolve) => {
|
|
23761
23921
|
this.executeAfterEmbedContainerLoaded(async () => {
|
|
23762
23922
|
try {
|
|
23763
|
-
|
|
23764
|
-
this.trigger(exports.HostEvent.UpdateEmbedParams, params);
|
|
23765
|
-
}
|
|
23766
|
-
catch (error) {
|
|
23767
|
-
logger$3.error(ERROR_MESSAGE.UPDATE_PARAMS_FAILED, error);
|
|
23768
|
-
this.handleError({
|
|
23769
|
-
errorType: exports.ErrorDetailsTypes.API,
|
|
23770
|
-
message: (error === null || error === void 0 ? void 0 : error.message) || ERROR_MESSAGE.UPDATE_PARAMS_FAILED,
|
|
23771
|
-
code: exports.EmbedErrorCodes.UPDATE_PARAMS_FAILED,
|
|
23772
|
-
error: (error === null || error === void 0 ? void 0 : error.message) || error,
|
|
23773
|
-
});
|
|
23923
|
+
await this.triggerUpdateEmbedParams();
|
|
23774
23924
|
}
|
|
23775
23925
|
finally {
|
|
23776
23926
|
setTimeout(resolve, UPDATE_EMBED_PARAMS_SETTLE_MS);
|
|
@@ -23805,8 +23955,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23805
23955
|
if (this.hostElement) {
|
|
23806
23956
|
this.insertedDomEl = this.createPreRenderPlaceholder();
|
|
23807
23957
|
if (this.viewConfig.fullHeight) {
|
|
23808
|
-
// If fullHeight has already sized the wrapper, seed the
|
|
23809
|
-
// with the same height so syncPreRenderStyle gets
|
|
23958
|
+
// If fullHeight has already sized the wrapper, seed the
|
|
23959
|
+
// placeholder with the same height so syncPreRenderStyle gets
|
|
23960
|
+
// an accurate rect.
|
|
23810
23961
|
const existingHeight = this.preRenderWrapper.style.height;
|
|
23811
23962
|
if (existingHeight) {
|
|
23812
23963
|
this.insertedDomEl.style.height = existingHeight;
|
|
@@ -23814,12 +23965,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23814
23965
|
}
|
|
23815
23966
|
const placeHolderId = this.getPreRenderIds().placeHolder;
|
|
23816
23967
|
// Remove any stale placeholder from a previous cycle. It is located
|
|
23817
|
-
// via a subtree-wide querySelector, so it may be nested deeper
|
|
23818
|
-
// direct child (E.g.: with fullHeight the host app can wrap
|
|
23819
|
-
// Element.remove() — which detaches from whatever the real
|
|
23820
|
-
// rather than hostElement.removeChild(), which throws
|
|
23821
|
-
// when the match is not a direct child. Mirrors the
|
|
23822
|
-
// cleanup in
|
|
23968
|
+
// via a subtree-wide querySelector, so it may be nested deeper
|
|
23969
|
+
// than a direct child (E.g.: with fullHeight the host app can wrap
|
|
23970
|
+
// it). Use Element.remove() — which detaches from whatever the real
|
|
23971
|
+
// parent is — rather than hostElement.removeChild(), which throws
|
|
23972
|
+
// NotFoundError when the match is not a direct child. Mirrors the
|
|
23973
|
+
// wrapper/child cleanup in
|
|
23974
|
+
// createPreRenderWrapper()/createPreRenderChild().
|
|
23823
23975
|
(_a = this.hostElement.querySelector(`#${placeHolderId}`)) === null || _a === void 0 ? void 0 : _a.remove();
|
|
23824
23976
|
this.hostElement.appendChild(this.insertedDomEl);
|
|
23825
23977
|
this.syncPreRenderStyle();
|
|
@@ -23851,7 +24003,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
23851
24003
|
if (this.iFrame) {
|
|
23852
24004
|
this.setupFullscreenChangeHandler();
|
|
23853
24005
|
}
|
|
23854
|
-
// Last, so everything above still sees the instance being taken over
|
|
24006
|
+
// Last, so everything above still sees the instance being taken over
|
|
24007
|
+
// from.
|
|
23855
24008
|
this.takeOverPreRender();
|
|
23856
24009
|
return this;
|
|
23857
24010
|
}
|
|
@@ -24138,6 +24291,18 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
24138
24291
|
starterPrompts,
|
|
24139
24292
|
},
|
|
24140
24293
|
};
|
|
24294
|
+
}
|
|
24295
|
+
function buildSpotterAnalystAppInitData(initData, viewConfig) {
|
|
24296
|
+
const { spotterAnalystConfig } = viewConfig;
|
|
24297
|
+
if (!(spotterAnalystConfig === null || spotterAnalystConfig === void 0 ? void 0 : spotterAnalystConfig.analystId))
|
|
24298
|
+
return initData;
|
|
24299
|
+
return {
|
|
24300
|
+
...initData,
|
|
24301
|
+
embedParams: {
|
|
24302
|
+
...(initData.embedParams || {}),
|
|
24303
|
+
spotterAnalystConfig,
|
|
24304
|
+
},
|
|
24305
|
+
};
|
|
24141
24306
|
}
|
|
24142
24307
|
|
|
24143
24308
|
function buildSpotterVizAppInitData(initData, viewConfig) {
|
|
@@ -24335,7 +24500,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
24335
24500
|
* embedded Liveboard or visualization.
|
|
24336
24501
|
*/
|
|
24337
24502
|
getEmbedParams() {
|
|
24338
|
-
const params = this.
|
|
24503
|
+
const params = this.getUrlQueryParamsObject();
|
|
24339
24504
|
return getQueryParamString(params, true);
|
|
24340
24505
|
}
|
|
24341
24506
|
getEmbedParamsObject() {
|
|
@@ -24731,8 +24896,9 @@ query GetEurekaVizSnapshots(
|
|
|
24731
24896
|
* @summary Liveboard & visualization embed
|
|
24732
24897
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
24733
24898
|
*/
|
|
24734
|
-
// Home unmounts the liveboard container, which is how its state gets cleared.
|
|
24735
|
-
// settle window gives the container time to do it before we ask for the
|
|
24899
|
+
// Home unmounts the liveboard container, which is how its state gets cleared.
|
|
24900
|
+
// The settle window gives the container time to do it before we ask for the
|
|
24901
|
+
// liveboard back.
|
|
24736
24902
|
const HOME_ROUTE = 'home';
|
|
24737
24903
|
const HOME_SETTLE_MS = 200;
|
|
24738
24904
|
/**
|
|
@@ -24792,7 +24958,7 @@ query GetEurekaVizSnapshots(
|
|
|
24792
24958
|
* embedded Liveboard or visualization.
|
|
24793
24959
|
*/
|
|
24794
24960
|
getEmbedParams() {
|
|
24795
|
-
const params = this.
|
|
24961
|
+
const params = this.getUrlQueryParamsObject();
|
|
24796
24962
|
const queryParams = getQueryParamString(params, true);
|
|
24797
24963
|
return queryParams;
|
|
24798
24964
|
}
|
|
@@ -25030,21 +25196,24 @@ query GetEurekaVizSnapshots(
|
|
|
25030
25196
|
}
|
|
25031
25197
|
beforePrerenderVisible() {
|
|
25032
25198
|
super.beforePrerenderVisible();
|
|
25033
|
-
// Captured before showPreRender() hands the wrapper over to this
|
|
25034
|
-
// Itself means a hide/show, not a hand-over, so there is
|
|
25199
|
+
// Captured before showPreRender() hands the wrapper over to this
|
|
25200
|
+
// instance. Itself means a hide/show, not a hand-over, so there is
|
|
25201
|
+
// nothing stale to clear.
|
|
25035
25202
|
const previous = this.getPreRenderObj();
|
|
25036
25203
|
const showing = previous === this ? undefined : previous === null || previous === void 0 ? void 0 : previous.currentLiveboardState;
|
|
25037
25204
|
this.executeAfterEmbedContainerLoaded(async () => {
|
|
25038
|
-
// Without this the params callback suspends on its await and
|
|
25039
|
-
// goes out first, so the container loads with the previous
|
|
25205
|
+
// Without this the params callback suspends on its await and
|
|
25206
|
+
// Navigate goes out first, so the container loads with the previous
|
|
25207
|
+
// config's filters.
|
|
25040
25208
|
await this.preRenderParamsApplied;
|
|
25041
25209
|
if (this.isShowingLiveboardRoute(showing)) {
|
|
25042
|
-
// Navigate to the route we are already on is a no-op, so the
|
|
25043
|
-
// keeps its state. Home unmounts the container, which
|
|
25210
|
+
// Navigate to the route we are already on is a no-op, so the
|
|
25211
|
+
// liveboard keeps its state. Home unmounts the container, which
|
|
25212
|
+
// clears it.
|
|
25044
25213
|
this.trigger(exports.HostEvent.Navigate, HOME_ROUTE)
|
|
25045
25214
|
.catch((error) => logger$3.warn('Could not route via home', error));
|
|
25046
|
-
// Not awaited above: the container never acks Navigate, so
|
|
25047
|
-
// only settles on the 30s trigger timeout.
|
|
25215
|
+
// Not awaited above: the container never acks Navigate, so
|
|
25216
|
+
// that promise only settles on the 30s trigger timeout.
|
|
25048
25217
|
await new Promise((resolve) => {
|
|
25049
25218
|
setTimeout(resolve, HOME_SETTLE_MS);
|
|
25050
25219
|
});
|
|
@@ -25058,8 +25227,9 @@ query GetEurekaVizSnapshots(
|
|
|
25058
25227
|
};
|
|
25059
25228
|
});
|
|
25060
25229
|
}
|
|
25061
|
-
// The whole route, not just the liveboard id: the path is built from the
|
|
25062
|
-
// and view too, so a same-liveboard show onto another tab is a
|
|
25230
|
+
// The whole route, not just the liveboard id: the path is built from the
|
|
25231
|
+
// viz, tab and view too, so a same-liveboard show onto another tab is a
|
|
25232
|
+
// real navigation.
|
|
25063
25233
|
isShowingLiveboardRoute(showing) {
|
|
25064
25234
|
if (!(showing === null || showing === void 0 ? void 0 : showing.liveboardId))
|
|
25065
25235
|
return false;
|
|
@@ -25319,7 +25489,7 @@ query GetEurekaVizSnapshots(
|
|
|
25319
25489
|
}
|
|
25320
25490
|
getEmbedParams() {
|
|
25321
25491
|
const { runtimeParameters, runtimeFilters, excludeRuntimeParametersfromURL, excludeRuntimeFiltersfromURL, } = this.viewConfig;
|
|
25322
|
-
const queryParams = this.
|
|
25492
|
+
const queryParams = this.getUrlQueryParamsObject();
|
|
25323
25493
|
let query = '';
|
|
25324
25494
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
25325
25495
|
if (queryParamsString) {
|
|
@@ -25407,7 +25577,7 @@ query GetEurekaVizSnapshots(
|
|
|
25407
25577
|
* @param dataSources A list of data source GUIDs
|
|
25408
25578
|
*/
|
|
25409
25579
|
getIFrameSrc() {
|
|
25410
|
-
const queryParams = this.
|
|
25580
|
+
const queryParams = this.getUrlQueryParamsObject();
|
|
25411
25581
|
const path = 'search-bar-embed';
|
|
25412
25582
|
let query = '';
|
|
25413
25583
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
@@ -25841,7 +26011,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
25841
26011
|
getIframeSrc() {
|
|
25842
26012
|
const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
|
|
25843
26013
|
const path = 'conv-assist-answer';
|
|
25844
|
-
const queryParams = this.
|
|
26014
|
+
const queryParams = this.getUrlQueryParamsObject();
|
|
25845
26015
|
let query = '';
|
|
25846
26016
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
25847
26017
|
if (queryParamsString) {
|
|
@@ -26009,10 +26179,11 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
26009
26179
|
const defaultAppInitData = await super.getAppInitData();
|
|
26010
26180
|
const sidebarInitData = buildSpotterSidebarAppInitData(defaultAppInitData, this.viewConfig, this.handleError.bind(this));
|
|
26011
26181
|
const shareInitData = buildSpotterShareConversationAppInitData(sidebarInitData, this.viewConfig);
|
|
26012
|
-
|
|
26182
|
+
const starterPromptsInitData = buildStarterPromptsAppInitData(shareInitData, this.viewConfig);
|
|
26183
|
+
return buildSpotterAnalystAppInitData(starterPromptsInitData, this.viewConfig);
|
|
26013
26184
|
}
|
|
26014
26185
|
getEmbedParamsObject() {
|
|
26015
|
-
const { searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, updatedSpotterExperience, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, updatedSpotterChatPrompt, showSpotterRadiance, defaultQueryMode, enableStopAnswerGenerationEmbed, spotterChatConfig,
|
|
26186
|
+
const { searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, updatedSpotterExperience, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, updatedSpotterChatPrompt, showSpotterRadiance, defaultQueryMode, enableStopAnswerGenerationEmbed, spotterChatConfig, } = this.viewConfig;
|
|
26016
26187
|
const queryParams = this.getBaseQueryParams();
|
|
26017
26188
|
queryParams[Param.SpotterEnabled] = true;
|
|
26018
26189
|
// Boolean params
|
|
@@ -26025,7 +26196,6 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
26025
26196
|
setParamIfDefined(queryParams, Param.ShowSpotterRadiance, showSpotterRadiance, true);
|
|
26026
26197
|
setParamIfDefined(queryParams, Param.DefaultQueryMode, defaultQueryMode);
|
|
26027
26198
|
setParamIfDefined(queryParams, Param.EnableStopAnswerGenerationEmbed, enableStopAnswerGenerationEmbed, true);
|
|
26028
|
-
setParamIfDefined(queryParams, Param.AnalystId, spotterAnalystConfig === null || spotterAnalystConfig === void 0 ? void 0 : spotterAnalystConfig.analystId);
|
|
26029
26199
|
// Handle spotterChatConfig params
|
|
26030
26200
|
if (spotterChatConfig) {
|
|
26031
26201
|
const { hideToolResponseCardBranding, toolResponseCardBrandingLabel, spotterFileUploadEnabled, spotterFileUploadFileTypes, enableStarterPrompts, } = spotterChatConfig;
|
|
@@ -26049,7 +26219,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
26049
26219
|
const path = sharedConversationId
|
|
26050
26220
|
? `insights/conv-assist/s/${encodeURIComponent(sharedConversationId)}`
|
|
26051
26221
|
: 'insights/conv-assist';
|
|
26052
|
-
const queryParams = this.
|
|
26222
|
+
const queryParams = this.getUrlQueryParamsObject();
|
|
26053
26223
|
let query = '';
|
|
26054
26224
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
26055
26225
|
if (queryParamsString) {
|
|
@@ -26632,6 +26802,213 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
26632
26802
|
return result;
|
|
26633
26803
|
};
|
|
26634
26804
|
|
|
26805
|
+
/**
|
|
26806
|
+
* Copyright (c) 2026
|
|
26807
|
+
*
|
|
26808
|
+
* Utility to convert the payload emitted by `EmbedEvent.FilterChanged`
|
|
26809
|
+
* into the payload shape expected by `HostEvent.UpdateFilters`, so that
|
|
26810
|
+
* the current filter state of a Liveboard can be captured and re-applied
|
|
26811
|
+
* later without having to hand-parse the event payload.
|
|
26812
|
+
* @summary Filter payload converter
|
|
26813
|
+
*/
|
|
26814
|
+
/**
|
|
26815
|
+
* Coerces an epoch/count field to a number, returning `null` when the value is
|
|
26816
|
+
* absent or not a finite number. The payload arrives as JSON from the iframe,
|
|
26817
|
+
* so a missing field can be `null` as well as `undefined`, and `Number(null)`
|
|
26818
|
+
* or `Number('')` would otherwise silently become a valid-looking `0`
|
|
26819
|
+
* (i.e. the Unix epoch, or a zero-length period).
|
|
26820
|
+
* @param value Raw value from the date filter payload.
|
|
26821
|
+
*/
|
|
26822
|
+
function toFiniteNumber(value) {
|
|
26823
|
+
if (isNil_1(value) || value === '')
|
|
26824
|
+
return null;
|
|
26825
|
+
const numericValue = Number(value);
|
|
26826
|
+
return Number.isFinite(numericValue) ? numericValue : null;
|
|
26827
|
+
}
|
|
26828
|
+
const DATE_FILTER_VALUE_EXTRACTORS = {
|
|
26829
|
+
EXACT_DATE: (dateFilter) => {
|
|
26830
|
+
const epoch = toFiniteNumber(dateFilter.epoch);
|
|
26831
|
+
return epoch === null ? [] : [epoch];
|
|
26832
|
+
},
|
|
26833
|
+
EXACT_DATE_RANGE: (dateFilter) => {
|
|
26834
|
+
var _a;
|
|
26835
|
+
const { lowEpoch, highEpoch } = (_a = dateFilter.dateRange) !== null && _a !== void 0 ? _a : {};
|
|
26836
|
+
const low = toFiniteNumber(lowEpoch);
|
|
26837
|
+
const high = toFiniteNumber(highEpoch);
|
|
26838
|
+
return low === null || high === null ? [] : [low, high];
|
|
26839
|
+
},
|
|
26840
|
+
MONTH_YEAR: (dateFilter) => (dateFilter.monthName && dateFilter.yearName
|
|
26841
|
+
? [dateFilter.monthName, dateFilter.yearName]
|
|
26842
|
+
: []),
|
|
26843
|
+
QUARTER_YEAR: (dateFilter) => (dateFilter.quarterName && dateFilter.yearName
|
|
26844
|
+
? [dateFilter.quarterName, dateFilter.yearName]
|
|
26845
|
+
: []),
|
|
26846
|
+
YEAR_ONLY: (dateFilter) => (dateFilter.yearName ? [dateFilter.yearName] : []),
|
|
26847
|
+
LAST_N_PERIOD: (dateFilter) => {
|
|
26848
|
+
const count = toFiniteNumber(dateFilter.number);
|
|
26849
|
+
return count === null ? [] : [count];
|
|
26850
|
+
},
|
|
26851
|
+
NEXT_N_PERIOD: (dateFilter) => {
|
|
26852
|
+
const count = toFiniteNumber(dateFilter.number);
|
|
26853
|
+
return count === null ? [] : [count];
|
|
26854
|
+
},
|
|
26855
|
+
};
|
|
26856
|
+
// Date filter types with no `values` (e.g. TODAY needs no operand).
|
|
26857
|
+
const PERIOD_ONLY_DATE_FILTER_TYPES = new Set([
|
|
26858
|
+
'THIS_PERIOD', 'PERIOD_TO_DATE', 'TODAY', 'YESTERDAY', 'TOMORROW',
|
|
26859
|
+
]);
|
|
26860
|
+
function convertDateFilterToParam(columnName, dateFilterContent) {
|
|
26861
|
+
var _a;
|
|
26862
|
+
const dateFilter = dateFilterContent === null || dateFilterContent === void 0 ? void 0 : dateFilterContent.dateFilter;
|
|
26863
|
+
if (!(dateFilter === null || dateFilter === void 0 ? void 0 : dateFilter.type))
|
|
26864
|
+
return null;
|
|
26865
|
+
let values;
|
|
26866
|
+
const getValues = DATE_FILTER_VALUE_EXTRACTORS[dateFilter.type];
|
|
26867
|
+
if (getValues) {
|
|
26868
|
+
values = getValues(dateFilter);
|
|
26869
|
+
// Required fields (e.g. epoch, yearName) are missing - the source data
|
|
26870
|
+
// can't be reconstructed faithfully, so skip rather than emit a filter
|
|
26871
|
+
// that would clear/corrupt this column when re-applied.
|
|
26872
|
+
if (values.length === 0)
|
|
26873
|
+
return null;
|
|
26874
|
+
}
|
|
26875
|
+
else if (PERIOD_ONLY_DATE_FILTER_TYPES.has(dateFilter.type)) {
|
|
26876
|
+
values = [];
|
|
26877
|
+
}
|
|
26878
|
+
else {
|
|
26879
|
+
// Unrecognized date filter type - skip rather than guess.
|
|
26880
|
+
return null;
|
|
26881
|
+
}
|
|
26882
|
+
const param = {
|
|
26883
|
+
columnName,
|
|
26884
|
+
operator: (_a = dateFilter.op) !== null && _a !== void 0 ? _a : exports.RuntimeFilterOp.EQ,
|
|
26885
|
+
values,
|
|
26886
|
+
type: dateFilter.type,
|
|
26887
|
+
};
|
|
26888
|
+
if (dateFilter.datePeriod) {
|
|
26889
|
+
param.datePeriod = dateFilter.datePeriod;
|
|
26890
|
+
}
|
|
26891
|
+
if (!isNil_1(dateFilter.includeCurrentPeriod)) {
|
|
26892
|
+
param.includeCurrentPeriod = dateFilter.includeCurrentPeriod;
|
|
26893
|
+
}
|
|
26894
|
+
if (dateFilterContent.negate) {
|
|
26895
|
+
param.negate = true;
|
|
26896
|
+
}
|
|
26897
|
+
return param;
|
|
26898
|
+
}
|
|
26899
|
+
function convertFilterContentToParam(columnName, filterContent) {
|
|
26900
|
+
var _a;
|
|
26901
|
+
if (!(filterContent === null || filterContent === void 0 ? void 0 : filterContent.filterType))
|
|
26902
|
+
return null;
|
|
26903
|
+
const values = ((_a = filterContent.value) !== null && _a !== void 0 ? _a : [])
|
|
26904
|
+
.map((value) => value === null || value === void 0 ? void 0 : value.key)
|
|
26905
|
+
.filter((value) => !isNil_1(value));
|
|
26906
|
+
const param = {
|
|
26907
|
+
columnName,
|
|
26908
|
+
operator: filterContent.filterType,
|
|
26909
|
+
values,
|
|
26910
|
+
};
|
|
26911
|
+
if (filterContent.negate) {
|
|
26912
|
+
param.negate = true;
|
|
26913
|
+
}
|
|
26914
|
+
return param;
|
|
26915
|
+
}
|
|
26916
|
+
function convertFilterToParams(columnName, filter) {
|
|
26917
|
+
var _a, _b;
|
|
26918
|
+
const dateParams = ((_a = filter === null || filter === void 0 ? void 0 : filter.dateFilterContent) !== null && _a !== void 0 ? _a : [])
|
|
26919
|
+
.map((dateFilterContent) => convertDateFilterToParam(columnName, dateFilterContent));
|
|
26920
|
+
const contentParams = ((_b = filter === null || filter === void 0 ? void 0 : filter.filterContent) !== null && _b !== void 0 ? _b : [])
|
|
26921
|
+
.map((filterContent) => convertFilterContentToParam(columnName, filterContent));
|
|
26922
|
+
return [...dateParams, ...contentParams]
|
|
26923
|
+
.filter((param) => param !== null);
|
|
26924
|
+
}
|
|
26925
|
+
/**
|
|
26926
|
+
* Runtime filters need no reshaping, but they still come off the wire as JSON,
|
|
26927
|
+
* so a malformed entry is possible. Skip it rather than pass it through: an
|
|
26928
|
+
* entry missing a column, operator or values array fails
|
|
26929
|
+
* `isValidUpdateFiltersPayload`, and that rejects the *whole* `filters` array,
|
|
26930
|
+
* so one bad runtime filter would drop every other converted filter with it.
|
|
26931
|
+
* @param runtimeFilter A runtime filter from the `FilterChanged` payload.
|
|
26932
|
+
*/
|
|
26933
|
+
function convertRuntimeFilterToParam(runtimeFilter) {
|
|
26934
|
+
const { columnName, operator, values } = runtimeFilter !== null && runtimeFilter !== void 0 ? runtimeFilter : {};
|
|
26935
|
+
if (typeof columnName !== 'string' || !columnName)
|
|
26936
|
+
return null;
|
|
26937
|
+
if (typeof operator !== 'string' || !operator)
|
|
26938
|
+
return null;
|
|
26939
|
+
if (!Array.isArray(values))
|
|
26940
|
+
return null;
|
|
26941
|
+
return { columnName, operator, values };
|
|
26942
|
+
}
|
|
26943
|
+
/**
|
|
26944
|
+
* Mirrors `isValidApplicability` in `hostEventClient/utils`: a `TAB` or `GROUP`
|
|
26945
|
+
* scope is meaningless without a `targetId`, and `UpdateFilters` rejects the
|
|
26946
|
+
* whole `filters` array when any entry carries a malformed `applicability`.
|
|
26947
|
+
* @param applicability Scope taken from the `FilterChanged` payload.
|
|
26948
|
+
*/
|
|
26949
|
+
function isUsableApplicability(applicability) {
|
|
26950
|
+
const levels = Object.values(exports.ApplicabilityLevel);
|
|
26951
|
+
if (!levels.includes(applicability.level))
|
|
26952
|
+
return false;
|
|
26953
|
+
if (applicability.level === exports.ApplicabilityLevel.Liveboard)
|
|
26954
|
+
return true;
|
|
26955
|
+
return typeof applicability.targetId === 'string' && applicability.targetId.trim().length > 0;
|
|
26956
|
+
}
|
|
26957
|
+
function convertFilterGroupToParams(filterGroup) {
|
|
26958
|
+
var _a, _b;
|
|
26959
|
+
const columnName = (_a = filterGroup === null || filterGroup === void 0 ? void 0 : filterGroup.columnInfo) === null || _a === void 0 ? void 0 : _a.name;
|
|
26960
|
+
if (!columnName)
|
|
26961
|
+
return [];
|
|
26962
|
+
const { applicability } = filterGroup;
|
|
26963
|
+
// A filter scoped to a tab or group has to keep that scope. Replaying it
|
|
26964
|
+
// without `applicability` would silently widen it to the whole Liveboard,
|
|
26965
|
+
// changing what every other tab shows. If a scope is present but unusable,
|
|
26966
|
+
// skip the filter: widening is worse than dropping, and a malformed
|
|
26967
|
+
// applicability would fail validation for every other filter alongside it.
|
|
26968
|
+
if (!isNil_1(applicability) && !isUsableApplicability(applicability))
|
|
26969
|
+
return [];
|
|
26970
|
+
const params = ((_b = filterGroup.filters) !== null && _b !== void 0 ? _b : [])
|
|
26971
|
+
.flatMap((filter) => convertFilterToParams(columnName, filter));
|
|
26972
|
+
return isNil_1(applicability) ? params : params.map((param) => ({ ...param, applicability }));
|
|
26973
|
+
}
|
|
26974
|
+
/**
|
|
26975
|
+
* Converts the payload emitted by {@link EmbedEvent.FilterChanged} into the
|
|
26976
|
+
* payload shape expected by {@link HostEvent.UpdateFilters}, so the same
|
|
26977
|
+
* filter state can be captured and re-applied later, for example on a
|
|
26978
|
+
* subsequent page load.
|
|
26979
|
+
*
|
|
26980
|
+
* Both the Liveboard filters and the runtime filters present in the
|
|
26981
|
+
* `FilterChanged` payload are included in the returned `filters` array.
|
|
26982
|
+
*
|
|
26983
|
+
* Note: a column with multiple date-filter conditions (e.g. an OR of two
|
|
26984
|
+
* date ranges) is not guaranteed to round-trip losslessly - `HostEvent.UpdateFilters`
|
|
26985
|
+
* treats date filters as replace-not-merge per column, so only the last
|
|
26986
|
+
* converted entry for such a column will apply.
|
|
26987
|
+
* @param filterChangedPayload The filter state carried by the
|
|
26988
|
+
* `EmbedEvent.FilterChanged` callback, which is `payload.data` - the
|
|
26989
|
+
* callback argument is the event envelope, and the filters sit under its
|
|
26990
|
+
* `data` key.
|
|
26991
|
+
* @example
|
|
26992
|
+
* ```js
|
|
26993
|
+
* let savedFilters;
|
|
26994
|
+
* liveboardEmbed.on(EmbedEvent.FilterChanged, (payload) => {
|
|
26995
|
+
* savedFilters = convertFilterChangedToUpdateFiltersPayload(payload.data);
|
|
26996
|
+
* });
|
|
26997
|
+
*
|
|
26998
|
+
* // later, e.g. after a fresh page load
|
|
26999
|
+
* liveboardEmbed.trigger(HostEvent.UpdateFilters, savedFilters);
|
|
27000
|
+
* ```
|
|
27001
|
+
*/
|
|
27002
|
+
function convertFilterChangedToUpdateFiltersPayload(filterChangedPayload) {
|
|
27003
|
+
var _a, _b;
|
|
27004
|
+
const liveboardFilterParams = ((_a = filterChangedPayload === null || filterChangedPayload === void 0 ? void 0 : filterChangedPayload.liveboardFilters) !== null && _a !== void 0 ? _a : [])
|
|
27005
|
+
.flatMap(convertFilterGroupToParams);
|
|
27006
|
+
const runtimeFilterParams = ((_b = filterChangedPayload === null || filterChangedPayload === void 0 ? void 0 : filterChangedPayload.runtimeFilters) !== null && _b !== void 0 ? _b : [])
|
|
27007
|
+
.map(convertRuntimeFilterToParam)
|
|
27008
|
+
.filter((param) => param !== null);
|
|
27009
|
+
return { filters: [...liveboardFilterParams, ...runtimeFilterParams] };
|
|
27010
|
+
}
|
|
27011
|
+
|
|
26635
27012
|
/**
|
|
26636
27013
|
* Starts an automatic renderer that watches the DOM for iframes containing
|
|
26637
27014
|
* the `tsmcp=true` query parameter and replaces them with fully configured
|
|
@@ -26730,7 +27107,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
26730
27107
|
* @returns The constructed URL to use for the ThoughtSpot embed iframe.
|
|
26731
27108
|
*/
|
|
26732
27109
|
getMCPIframeSrc(sourceSrc) {
|
|
26733
|
-
const queryParams = this.
|
|
27110
|
+
const queryParams = this.getUrlQueryParamsObject();
|
|
26734
27111
|
const sourceURL = new URL(sourceSrc);
|
|
26735
27112
|
const existingQueryParams = sourceURL.searchParams;
|
|
26736
27113
|
const existingQueryParamsObject = Object.fromEntries(existingQueryParams);
|
|
@@ -34304,6 +34681,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
34304
34681
|
exports.SearchEmbed = SearchEmbed;
|
|
34305
34682
|
exports.SpotterAgentEmbed = SpotterAgentEmbed;
|
|
34306
34683
|
exports.SpotterEmbed = SpotterEmbed;
|
|
34684
|
+
exports.convertFilterChangedToUpdateFiltersPayload = convertFilterChangedToUpdateFiltersPayload;
|
|
34307
34685
|
exports.createLiveboardWithAnswers = createLiveboardWithAnswers;
|
|
34308
34686
|
exports.executeTML = executeTML;
|
|
34309
34687
|
exports.exportTML = exportTML;
|