@thoughtspot/visual-embed-sdk 1.46.5-beta.1 → 1.46.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/package.json +4 -4
- package/cjs/src/css-variables.d.ts +36 -0
- package/cjs/src/css-variables.d.ts.map +1 -1
- package/cjs/src/embed/app.d.ts +41 -2
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +26 -46
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +36 -69
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +23 -1
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +18 -33
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +129 -97
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.d.ts +31 -0
- package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.js +2 -0
- package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts +18 -0
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.js +69 -9
- package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js +185 -19
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/utils.d.ts +22 -0
- package/cjs/src/embed/hostEventClient/utils.d.ts.map +1 -0
- package/cjs/src/embed/hostEventClient/utils.js +51 -0
- package/cjs/src/embed/hostEventClient/utils.js.map +1 -0
- package/cjs/src/embed/hostEventClient/utils.spec.d.ts +2 -0
- package/cjs/src/embed/hostEventClient/utils.spec.d.ts.map +1 -0
- package/cjs/src/embed/hostEventClient/utils.spec.js +115 -0
- package/cjs/src/embed/hostEventClient/utils.spec.js.map +1 -0
- package/cjs/src/embed/liveboard.d.ts +18 -1
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +9 -11
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +29 -71
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/spotter-utils.d.ts +20 -0
- package/cjs/src/embed/spotter-utils.d.ts.map +1 -0
- package/cjs/src/embed/spotter-utils.js +52 -0
- package/cjs/src/embed/spotter-utils.js.map +1 -0
- package/cjs/src/embed/spotter-utils.spec.d.ts +2 -0
- package/cjs/src/embed/spotter-utils.spec.d.ts.map +1 -0
- package/cjs/src/embed/spotter-utils.spec.js +54 -0
- package/cjs/src/embed/spotter-utils.spec.js.map +1 -0
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +13 -1
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/errors.d.ts +2 -0
- package/cjs/src/errors.d.ts.map +1 -1
- package/cjs/src/errors.js +2 -0
- package/cjs/src/errors.js.map +1 -1
- package/cjs/src/types.d.ts +102 -1
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +101 -0
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils.d.ts +0 -9
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +1 -10
- package/cjs/src/utils.js.map +1 -1
- package/dist/index-ChNydfIz.js +7371 -0
- package/dist/index-DGV_zh53.js +7371 -0
- package/dist/src/css-variables.d.ts +36 -0
- package/dist/src/css-variables.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +41 -2
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +23 -1
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/contracts.d.ts +31 -0
- package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/host-event-client.d.ts +18 -0
- package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/utils.d.ts +22 -0
- package/dist/src/embed/hostEventClient/utils.d.ts.map +1 -0
- package/dist/src/embed/hostEventClient/utils.spec.d.ts +2 -0
- package/dist/src/embed/hostEventClient/utils.spec.d.ts.map +1 -0
- package/dist/src/embed/liveboard.d.ts +18 -1
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/spotter-utils.d.ts +20 -0
- package/dist/src/embed/spotter-utils.d.ts.map +1 -0
- package/dist/src/embed/spotter-utils.spec.d.ts +2 -0
- package/dist/src/embed/spotter-utils.spec.d.ts.map +1 -0
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/errors.d.ts +2 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/types.d.ts +102 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils.d.ts +0 -9
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +324 -110
- package/dist/tsembed-react.js +323 -109
- package/dist/tsembed.es.js +324 -110
- package/dist/tsembed.js +323 -109
- package/dist/visual-embed-sdk-react-full.d.ts +266 -3
- package/dist/visual-embed-sdk-react.d.ts +266 -3
- package/dist/visual-embed-sdk.d.ts +266 -3
- package/lib/package.json +4 -4
- package/lib/src/css-variables.d.ts +36 -0
- package/lib/src/css-variables.d.ts.map +1 -1
- package/lib/src/embed/app.d.ts +41 -2
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +28 -48
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +36 -69
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +23 -1
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +19 -34
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +131 -99
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts +31 -0
- package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.js +2 -0
- package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.d.ts +18 -0
- package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.js +69 -9
- package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.spec.js +185 -19
- package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/utils.d.ts +22 -0
- package/lib/src/embed/hostEventClient/utils.d.ts.map +1 -0
- package/lib/src/embed/hostEventClient/utils.js +43 -0
- package/lib/src/embed/hostEventClient/utils.js.map +1 -0
- package/lib/src/embed/hostEventClient/utils.spec.d.ts +2 -0
- package/lib/src/embed/hostEventClient/utils.spec.d.ts.map +1 -0
- package/lib/src/embed/hostEventClient/utils.spec.js +113 -0
- package/lib/src/embed/hostEventClient/utils.spec.js.map +1 -0
- package/lib/src/embed/liveboard.d.ts +18 -1
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +9 -11
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +29 -71
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/spotter-utils.d.ts +20 -0
- package/lib/src/embed/spotter-utils.d.ts.map +1 -0
- package/lib/src/embed/spotter-utils.js +47 -0
- package/lib/src/embed/spotter-utils.js.map +1 -0
- package/lib/src/embed/spotter-utils.spec.d.ts +2 -0
- package/lib/src/embed/spotter-utils.spec.d.ts.map +1 -0
- package/lib/src/embed/spotter-utils.spec.js +52 -0
- package/lib/src/embed/spotter-utils.spec.js.map +1 -0
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +13 -1
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/errors.d.ts +2 -0
- package/lib/src/errors.d.ts.map +1 -1
- package/lib/src/errors.js +2 -0
- package/lib/src/errors.js.map +1 -1
- package/lib/src/types.d.ts +102 -1
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +101 -0
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils.d.ts +0 -9
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +0 -8
- package/lib/src/utils.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +266 -3
- package/package.json +4 -4
- package/src/css-variables.ts +45 -0
- package/src/embed/app.spec.ts +51 -92
- package/src/embed/app.ts +60 -64
- package/src/embed/conversation.spec.ts +150 -119
- package/src/embed/conversation.ts +30 -54
- package/src/embed/hostEventClient/contracts.ts +31 -0
- package/src/embed/hostEventClient/host-event-client.spec.ts +260 -19
- package/src/embed/hostEventClient/host-event-client.ts +87 -11
- package/src/embed/hostEventClient/utils.spec.ts +137 -0
- package/src/embed/hostEventClient/utils.ts +61 -0
- package/src/embed/liveboard.spec.ts +38 -93
- package/src/embed/liveboard.ts +28 -10
- package/src/embed/spotter-utils.spec.ts +56 -0
- package/src/embed/spotter-utils.ts +65 -0
- package/src/embed/ts-embed.ts +15 -1
- package/src/errors.ts +2 -0
- package/src/types.ts +104 -0
- package/src/utils.ts +0 -14
package/dist/tsembed-react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.46.5
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.46.5 */
|
|
2
2
|
'use client';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
|
|
@@ -1083,6 +1083,17 @@
|
|
|
1083
1083
|
* ```
|
|
1084
1084
|
*/
|
|
1085
1085
|
EmbedEvent["DownloadAsXlsx"] = "downloadAsXlsx";
|
|
1086
|
+
/**
|
|
1087
|
+
* Emitted when the Download Liveboard as Continuous PDF action is triggered
|
|
1088
|
+
* on a Liveboard.
|
|
1089
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
1090
|
+
* @example
|
|
1091
|
+
* ```js
|
|
1092
|
+
* liveboardEmbed.on(EmbedEvent.DownloadLiveboardAsContinuousPDF, payload => {
|
|
1093
|
+
* console.log('download liveboard as continuous PDF', payload)})
|
|
1094
|
+
* ```
|
|
1095
|
+
*/
|
|
1096
|
+
EmbedEvent["DownloadLiveboardAsContinuousPDF"] = "downloadLiveboardAsContinuousPDF";
|
|
1086
1097
|
/**
|
|
1087
1098
|
* Emitted when an Answer is deleted in the app
|
|
1088
1099
|
* Use start:true to subscribe to when delete is initiated, or end:true to subscribe
|
|
@@ -2611,6 +2622,18 @@
|
|
|
2611
2622
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2612
2623
|
*/
|
|
2613
2624
|
HostEvent["DownloadAsPdf"] = "downloadAsPdf";
|
|
2625
|
+
/**
|
|
2626
|
+
* Trigger the **Download Liveboard as Continuous PDF** action on an
|
|
2627
|
+
* embedded Liveboard.
|
|
2628
|
+
*
|
|
2629
|
+
* @example
|
|
2630
|
+
* ```js
|
|
2631
|
+
* liveboardEmbed.trigger(HostEvent.DownloadLiveboardAsContinuousPDF)
|
|
2632
|
+
* ```
|
|
2633
|
+
*
|
|
2634
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
2635
|
+
*/
|
|
2636
|
+
HostEvent["DownloadLiveboardAsContinuousPDF"] = "downloadLiveboardAsContinuousPDF";
|
|
2614
2637
|
/**
|
|
2615
2638
|
* Trigger the **AI Highlights** action on an embedded Liveboard
|
|
2616
2639
|
*
|
|
@@ -2837,6 +2860,20 @@
|
|
|
2837
2860
|
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2838
2861
|
* }, ContextType.Liveboard);
|
|
2839
2862
|
* ```
|
|
2863
|
+
* @example
|
|
2864
|
+
* ```js
|
|
2865
|
+
* // Copy link from liveboard context
|
|
2866
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2867
|
+
* liveboardEmbed.trigger(HostEvent.CopyLink, {}, ContextType.Liveboard);
|
|
2868
|
+
* ```
|
|
2869
|
+
* @example
|
|
2870
|
+
* ```js
|
|
2871
|
+
* // Copy link from liveboard visualization context
|
|
2872
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2873
|
+
* liveboardEmbed.trigger(HostEvent.CopyLink, {
|
|
2874
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2875
|
+
* }, ContextType.Liveboard);
|
|
2876
|
+
* ```
|
|
2840
2877
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2841
2878
|
*/
|
|
2842
2879
|
HostEvent["CopyLink"] = "embedDocument";
|
|
@@ -2868,6 +2905,20 @@
|
|
|
2868
2905
|
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2869
2906
|
* liveboardEmbed.trigger(HostEvent.Present, {}, ContextType.Liveboard);
|
|
2870
2907
|
* ```
|
|
2908
|
+
* @example
|
|
2909
|
+
* ```js
|
|
2910
|
+
* // Present from liveboard visualization context
|
|
2911
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2912
|
+
* liveboardEmbed.trigger(HostEvent.Present, {
|
|
2913
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2914
|
+
* }, ContextType.Liveboard);
|
|
2915
|
+
* ```
|
|
2916
|
+
* @example
|
|
2917
|
+
* ```js
|
|
2918
|
+
* // Present from liveboard context
|
|
2919
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2920
|
+
* liveboardEmbed.trigger(HostEvent.Present, {}, ContextType.Liveboard);
|
|
2921
|
+
* ```
|
|
2871
2922
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2872
2923
|
*/
|
|
2873
2924
|
HostEvent["Present"] = "present";
|
|
@@ -4165,6 +4216,7 @@
|
|
|
4165
4216
|
Param["IsLazyLoadingForEmbedEnabled"] = "isLazyLoadingForEmbedEnabled";
|
|
4166
4217
|
Param["RootMarginForLazyLoad"] = "rootMarginForLazyLoad";
|
|
4167
4218
|
Param["isPNGInScheduledEmailsEnabled"] = "isPNGInScheduledEmailsEnabled";
|
|
4219
|
+
Param["IsWYSIWYGLiveboardPDFEnabled"] = "isWYSIWYGLiveboardPDFEnabled";
|
|
4168
4220
|
Param["isLiveboardXLSXCSVDownloadEnabled"] = "isLiveboardXLSXCSVDownloadEnabled";
|
|
4169
4221
|
Param["isGranularXLSXCSVSchedulesEnabled"] = "isGranularXLSXCSVSchedulesEnabled";
|
|
4170
4222
|
Param["isCentralizedLiveboardFilterUXEnabled"] = "isCentralizedLiveboardFilterUXEnabled";
|
|
@@ -4509,6 +4561,16 @@
|
|
|
4509
4561
|
* @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
|
|
4510
4562
|
*/
|
|
4511
4563
|
Action["DownloadLiveboard"] = "downloadLiveboard";
|
|
4564
|
+
/**
|
|
4565
|
+
* The **Download Liveboard as Continuous PDF** menu action on a Liveboard.
|
|
4566
|
+
* Allows downloading the entire Liveboard as a continuous PDF.
|
|
4567
|
+
* @example
|
|
4568
|
+
* ```js
|
|
4569
|
+
* disabledActions: [Action.DownloadLiveboardAsContinuousPDF]
|
|
4570
|
+
* ```
|
|
4571
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
4572
|
+
*/
|
|
4573
|
+
Action["DownloadLiveboardAsContinuousPDF"] = "downloadLiveboardAsContinuousPDF";
|
|
4512
4574
|
/**
|
|
4513
4575
|
* @hidden
|
|
4514
4576
|
*/
|
|
@@ -5726,6 +5788,39 @@
|
|
|
5726
5788
|
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
5727
5789
|
*/
|
|
5728
5790
|
Action["SpotterDocs"] = "spotterDocs";
|
|
5791
|
+
/**
|
|
5792
|
+
* Controls visibility and disable state of the connector resources
|
|
5793
|
+
* section in the Spotter chat interface.
|
|
5794
|
+
* @example
|
|
5795
|
+
* ```js
|
|
5796
|
+
* hiddenActions: [Action.SpotterChatConnectorResources]
|
|
5797
|
+
* disabledActions: [Action.SpotterChatConnectorResources]
|
|
5798
|
+
* ```
|
|
5799
|
+
* @version SDK: 1.48.0 | ThoughtSpot Cloud: 26.5.0.cl
|
|
5800
|
+
*/
|
|
5801
|
+
Action["SpotterChatConnectorResources"] = "spotterChatConnectorResources";
|
|
5802
|
+
/**
|
|
5803
|
+
* Controls visibility and disable state of the connectors
|
|
5804
|
+
* in the Spotter chat interface.
|
|
5805
|
+
* @example
|
|
5806
|
+
* ```js
|
|
5807
|
+
* hiddenActions: [Action.SpotterChatConnectors]
|
|
5808
|
+
* disabledActions: [Action.SpotterChatConnectors]
|
|
5809
|
+
* ```
|
|
5810
|
+
* @version SDK: 1.48.0 | ThoughtSpot Cloud: 26.5.0.cl
|
|
5811
|
+
*/
|
|
5812
|
+
Action["SpotterChatConnectors"] = "spotterChatConnectors";
|
|
5813
|
+
/**
|
|
5814
|
+
* Controls visibility and disable state of the mode switcher
|
|
5815
|
+
* in the Spotter chat interface.
|
|
5816
|
+
* @example
|
|
5817
|
+
* ```js
|
|
5818
|
+
* hiddenActions: [Action.SpotterChatModeSwitcher]
|
|
5819
|
+
* disabledActions: [Action.SpotterChatModeSwitcher]
|
|
5820
|
+
* ```
|
|
5821
|
+
* @version SDK: 1.48.0 | ThoughtSpot Cloud: 26.5.0.cl
|
|
5822
|
+
*/
|
|
5823
|
+
Action["SpotterChatModeSwitcher"] = "spotterChatModeSwitcher";
|
|
5729
5824
|
/**
|
|
5730
5825
|
* The **Include current period** checkbox for date filters.
|
|
5731
5826
|
* Controls the visibility and availability of the option to include
|
|
@@ -6019,6 +6114,12 @@
|
|
|
6019
6114
|
EmbedErrorCodes["UPDATE_PARAMS_FAILED"] = "UPDATE_PARAMS_FAILED";
|
|
6020
6115
|
/** Invalid URL provided in configuration */
|
|
6021
6116
|
EmbedErrorCodes["INVALID_URL"] = "INVALID_URL";
|
|
6117
|
+
/** Host event payload validation failed */
|
|
6118
|
+
EmbedErrorCodes["HOST_EVENT_VALIDATION"] = "HOST_EVENT_VALIDATION";
|
|
6119
|
+
/** UpdateFilters payload is invalid - missing or malformed filter/filters */
|
|
6120
|
+
EmbedErrorCodes["UPDATEFILTERS_INVALID_PAYLOAD"] = "UPDATEFILTERS_INVALID_PAYLOAD";
|
|
6121
|
+
/** DrillDown payload is invalid - missing or malformed points */
|
|
6122
|
+
EmbedErrorCodes["DRILLDOWN_INVALID_PAYLOAD"] = "DRILLDOWN_INVALID_PAYLOAD";
|
|
6022
6123
|
})(EmbedErrorCodes || (EmbedErrorCodes = {}));
|
|
6023
6124
|
/**
|
|
6024
6125
|
* Context types for specifying the page context when triggering host events.
|
|
@@ -6180,6 +6281,8 @@
|
|
|
6180
6281
|
SSR_ENVIRONMENT_ERROR: 'SSR environment detected. This function cannot be called in SSR environment.',
|
|
6181
6282
|
UPDATE_PARAMS_FAILED: 'Failed to update embed parameters',
|
|
6182
6283
|
INVALID_SPOTTER_DOCUMENTATION_URL: 'Invalid spotterDocumentationUrl. Please provide a valid http or https URL.',
|
|
6284
|
+
UPDATEFILTERS_INVALID_PAYLOAD: 'UpdateFilters requires a valid filter or filters array. Expected: { filter: { column, oper, values } } or { filters: [{ column, oper, values }, ...] }',
|
|
6285
|
+
DRILLDOWN_INVALID_PAYLOAD: 'DrillDown requires a valid points object. Expected: { points: { clickedPoint?, selectedPoints? }, autoDrillDown?, vizId? }',
|
|
6183
6286
|
};
|
|
6184
6287
|
const CUSTOM_ACTIONS_ERROR_MESSAGE = {
|
|
6185
6288
|
INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
|
|
@@ -6683,14 +6786,6 @@
|
|
|
6683
6786
|
return [false, error instanceof Error ? error : new Error(String(error))];
|
|
6684
6787
|
}
|
|
6685
6788
|
};
|
|
6686
|
-
/**
|
|
6687
|
-
* Resolves enablePastConversationsSidebar with
|
|
6688
|
-
* spotterSidebarConfig taking precedence over the
|
|
6689
|
-
* standalone flag.
|
|
6690
|
-
*/
|
|
6691
|
-
const resolveEnablePastConversationsSidebar = (params) => (params.spotterSidebarConfigValue !== undefined
|
|
6692
|
-
? params.spotterSidebarConfigValue
|
|
6693
|
-
: params.standaloneValue);
|
|
6694
6789
|
/**
|
|
6695
6790
|
* Sets a query parameter if the value is defined.
|
|
6696
6791
|
* @param queryParams - The query params object to modify
|
|
@@ -8987,6 +9082,8 @@
|
|
|
8987
9082
|
UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
|
|
8988
9083
|
UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
|
|
8989
9084
|
UIPassthroughEvent["GetUnsavedAnswerTML"] = "getUnsavedAnswerTML";
|
|
9085
|
+
UIPassthroughEvent["UpdateFilters"] = "updateFilters";
|
|
9086
|
+
UIPassthroughEvent["Drilldown"] = "drillDown";
|
|
8990
9087
|
UIPassthroughEvent["GetAnswerSession"] = "getAnswerSession";
|
|
8991
9088
|
UIPassthroughEvent["GetFilters"] = "getFilters";
|
|
8992
9089
|
UIPassthroughEvent["GetIframeUrl"] = "getIframeUrl";
|
|
@@ -19228,10 +19325,60 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19228
19325
|
return eventData;
|
|
19229
19326
|
}
|
|
19230
19327
|
|
|
19231
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.46.5
|
|
19328
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.46.5";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js && node dts-config/wrap-ambient-module.mjs","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | npx coveralls-next || echo 'Warning: Coveralls upload failed but not breaking the build.'","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.23","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^11.2.0","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^30.0.0","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^30.2.0","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1","coveralls-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle-generator":"^9.5.1",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^2.0.0",jest:"^30.2.0","jest-environment-jsdom":"^29.7.0","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.59.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^29.4.6","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"34 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
|
|
19329
|
+
|
|
19330
|
+
function isValidUpdateFiltersPayload(payload) {
|
|
19331
|
+
if (!payload)
|
|
19332
|
+
return false;
|
|
19333
|
+
const isValidFilter = (f) => !!f && typeof f.column === 'string' && typeof f.oper === 'string' && Array.isArray(f.values);
|
|
19334
|
+
const hasValidFilter = payload.filter && isValidFilter(payload.filter);
|
|
19335
|
+
const hasValidFilters = Array.isArray(payload.filters) && payload.filters.length > 0 && payload.filters.every(isValidFilter);
|
|
19336
|
+
return !!(hasValidFilter || hasValidFilters);
|
|
19337
|
+
}
|
|
19338
|
+
function isValidDrillDownPayload(payload) {
|
|
19339
|
+
if (!payload)
|
|
19340
|
+
return false;
|
|
19341
|
+
const points = payload.points;
|
|
19342
|
+
if (!points || typeof points !== 'object')
|
|
19343
|
+
return false;
|
|
19344
|
+
const hasClickedPoint = 'clickedPoint' in points && points.clickedPoint != null;
|
|
19345
|
+
const hasSelectedPoints = Array.isArray(points.selectedPoints) && points.selectedPoints.length > 0;
|
|
19346
|
+
return hasClickedPoint || hasSelectedPoints;
|
|
19347
|
+
}
|
|
19348
|
+
function createValidationError(message) {
|
|
19349
|
+
const err = new Error(message);
|
|
19350
|
+
err.isValidationError = true;
|
|
19351
|
+
err.embedErrorDetails = {
|
|
19352
|
+
type: exports.EmbedEvent.Error,
|
|
19353
|
+
data: {
|
|
19354
|
+
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
19355
|
+
message,
|
|
19356
|
+
code: EmbedErrorCodes.HOST_EVENT_VALIDATION,
|
|
19357
|
+
error: message
|
|
19358
|
+
},
|
|
19359
|
+
status: embedEventStatus.END
|
|
19360
|
+
};
|
|
19361
|
+
throw err;
|
|
19362
|
+
}
|
|
19363
|
+
function throwUpdateFiltersValidationError() {
|
|
19364
|
+
createValidationError(ERROR_MESSAGE.UPDATEFILTERS_INVALID_PAYLOAD);
|
|
19365
|
+
}
|
|
19366
|
+
function throwDrillDownValidationError() {
|
|
19367
|
+
createValidationError(ERROR_MESSAGE.DRILLDOWN_INVALID_PAYLOAD);
|
|
19368
|
+
}
|
|
19232
19369
|
|
|
19233
|
-
/**
|
|
19234
|
-
|
|
19370
|
+
/**
|
|
19371
|
+
* Maps HostEvent to its corresponding UIPassthroughEvent.
|
|
19372
|
+
* Includes both custom-handler events (Pin, SaveAnswer, UpdateFilters, DrillDown)
|
|
19373
|
+
* and getter events (GetAnswerSession, GetFilters, etc.) that use getDataWithPassthroughFallback.
|
|
19374
|
+
*/
|
|
19375
|
+
const PASSTHROUGH_MAP = {
|
|
19376
|
+
// Custom handlers (setters with special logic)
|
|
19377
|
+
[exports.HostEvent.Pin]: UIPassthroughEvent.PinAnswerToLiveboard,
|
|
19378
|
+
[exports.HostEvent.SaveAnswer]: UIPassthroughEvent.SaveAnswer,
|
|
19379
|
+
[exports.HostEvent.UpdateFilters]: UIPassthroughEvent.UpdateFilters,
|
|
19380
|
+
[exports.HostEvent.DrillDown]: UIPassthroughEvent.Drilldown,
|
|
19381
|
+
// Getters (use getDataWithPassthroughFallback)
|
|
19235
19382
|
[exports.HostEvent.GetAnswerSession]: UIPassthroughEvent.GetAnswerSession,
|
|
19236
19383
|
[exports.HostEvent.GetFilters]: UIPassthroughEvent.GetFilters,
|
|
19237
19384
|
[exports.HostEvent.GetIframeUrl]: UIPassthroughEvent.GetIframeUrl,
|
|
@@ -19242,10 +19389,14 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19242
19389
|
};
|
|
19243
19390
|
class HostEventClient {
|
|
19244
19391
|
constructor(iFrame) {
|
|
19392
|
+
/** Cached list of available UI passthrough keys from the embedded app */
|
|
19393
|
+
this.availablePassthroughKeysCache = null;
|
|
19245
19394
|
this.iFrame = iFrame;
|
|
19246
19395
|
this.customHandlers = {
|
|
19247
19396
|
[exports.HostEvent.Pin]: (p, c) => this.handlePinEvent(p, c),
|
|
19248
19397
|
[exports.HostEvent.SaveAnswer]: (p, c) => this.handleSaveAnswerEvent(p, c),
|
|
19398
|
+
[exports.HostEvent.UpdateFilters]: (p, c) => this.handleUpdateFiltersEvent(p, c),
|
|
19399
|
+
[exports.HostEvent.DrillDown]: (p, c) => this.handleDrillDownEvent(p, c),
|
|
19249
19400
|
};
|
|
19250
19401
|
}
|
|
19251
19402
|
/**
|
|
@@ -19308,6 +19459,26 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19308
19459
|
setIframeElement(iFrame) {
|
|
19309
19460
|
this.iFrame = iFrame;
|
|
19310
19461
|
}
|
|
19462
|
+
/**
|
|
19463
|
+
* Fetches the list of available UI passthrough keys from the embedded app.
|
|
19464
|
+
* Result is cached for the session. Returns empty array on failure.
|
|
19465
|
+
*/
|
|
19466
|
+
async getAvailableUIPassthroughKeys(context) {
|
|
19467
|
+
var _a, _b;
|
|
19468
|
+
if (this.availablePassthroughKeysCache !== null) {
|
|
19469
|
+
return this.availablePassthroughKeysCache;
|
|
19470
|
+
}
|
|
19471
|
+
try {
|
|
19472
|
+
const response = await this.triggerUIPassthroughApi(UIPassthroughEvent.GetAvailableUIPassthroughs, {}, context);
|
|
19473
|
+
const matched = (_a = response === null || response === void 0 ? void 0 : response.find) === null || _a === void 0 ? void 0 : _a.call(response, (r) => r.value && !r.error);
|
|
19474
|
+
const keys = (_b = matched === null || matched === void 0 ? void 0 : matched.value) === null || _b === void 0 ? void 0 : _b.keys;
|
|
19475
|
+
this.availablePassthroughKeysCache = Array.isArray(keys) ? keys : [];
|
|
19476
|
+
return this.availablePassthroughKeysCache;
|
|
19477
|
+
}
|
|
19478
|
+
catch {
|
|
19479
|
+
return [];
|
|
19480
|
+
}
|
|
19481
|
+
}
|
|
19311
19482
|
async triggerUIPassthroughApi(apiName, parameters, context) {
|
|
19312
19483
|
const res = await this.processTrigger(exports.HostEvent.UIPassthrough, {
|
|
19313
19484
|
type: apiName,
|
|
@@ -19343,16 +19514,41 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19343
19514
|
answerId: (_d = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.saveResponse) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.Answer__save) === null || _c === void 0 ? void 0 : _c.answer) === null || _d === void 0 ? void 0 : _d.id,
|
|
19344
19515
|
};
|
|
19345
19516
|
}
|
|
19517
|
+
handleUpdateFiltersEvent(payload, context) {
|
|
19518
|
+
if (!isValidUpdateFiltersPayload(payload)) {
|
|
19519
|
+
throwUpdateFiltersValidationError();
|
|
19520
|
+
}
|
|
19521
|
+
return this.handleHostEventWithParam(UIPassthroughEvent.UpdateFilters, payload, context);
|
|
19522
|
+
}
|
|
19523
|
+
handleDrillDownEvent(payload, context) {
|
|
19524
|
+
if (!isValidDrillDownPayload(payload)) {
|
|
19525
|
+
throwDrillDownValidationError();
|
|
19526
|
+
}
|
|
19527
|
+
return this.handleHostEventWithParam(UIPassthroughEvent.Drilldown, payload, context);
|
|
19528
|
+
}
|
|
19529
|
+
/**
|
|
19530
|
+
* Dispatches a host event using the appropriate channel:
|
|
19531
|
+
* 1. If the embedded app supports UI passthrough for this event, use it (custom handler or getter).
|
|
19532
|
+
* 2. Otherwise fall back to the legacy host event channel.
|
|
19533
|
+
*
|
|
19534
|
+
* @param hostEvent - The host event to trigger
|
|
19535
|
+
* @param payload - Optional payload for the event
|
|
19536
|
+
* @param context - Optional context (e.g. vizId) for scoped operations
|
|
19537
|
+
*/
|
|
19346
19538
|
async triggerHostEvent(hostEvent, payload, context) {
|
|
19347
19539
|
const customHandler = this.customHandlers[hostEvent];
|
|
19348
|
-
|
|
19349
|
-
|
|
19350
|
-
|
|
19351
|
-
|
|
19352
|
-
|
|
19353
|
-
return this.getDataWithPassthroughFallback(passthroughEvent, hostEvent, payload, context);
|
|
19540
|
+
const passthroughEvent = PASSTHROUGH_MAP[hostEvent];
|
|
19541
|
+
// If embedded app supports passthrough but not this event, use legacy channel
|
|
19542
|
+
const keys = passthroughEvent ? await this.getAvailableUIPassthroughKeys(context) : [];
|
|
19543
|
+
if (passthroughEvent && keys.length > 0 && !keys.includes(passthroughEvent)) {
|
|
19544
|
+
return this.hostEventFallback(hostEvent, payload, context);
|
|
19354
19545
|
}
|
|
19355
|
-
|
|
19546
|
+
// Custom handler (setters) > getter passthrough > legacy fallback
|
|
19547
|
+
return (customHandler
|
|
19548
|
+
? customHandler(payload, context)
|
|
19549
|
+
: passthroughEvent
|
|
19550
|
+
? this.getDataWithPassthroughFallback(passthroughEvent, hostEvent, payload, context)
|
|
19551
|
+
: this.hostEventFallback(hostEvent, payload, context));
|
|
19356
19552
|
}
|
|
19357
19553
|
}
|
|
19358
19554
|
|
|
@@ -20686,7 +20882,19 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
20686
20882
|
return null;
|
|
20687
20883
|
}
|
|
20688
20884
|
// send an empty object, this is needed for liveboard default handlers
|
|
20689
|
-
return this.hostEventClient.triggerHostEvent(messageType, data, context)
|
|
20885
|
+
return this.hostEventClient.triggerHostEvent(messageType, data, context).catch((err) => {
|
|
20886
|
+
var _a;
|
|
20887
|
+
if (err === null || err === void 0 ? void 0 : err.isValidationError) {
|
|
20888
|
+
const errorDetails = (_a = err.embedErrorDetails) !== null && _a !== void 0 ? _a : {
|
|
20889
|
+
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
20890
|
+
message: err.message || ERROR_MESSAGE.UPDATEFILTERS_INVALID_PAYLOAD,
|
|
20891
|
+
code: EmbedErrorCodes.UPDATEFILTERS_INVALID_PAYLOAD,
|
|
20892
|
+
error: err.message,
|
|
20893
|
+
};
|
|
20894
|
+
this.handleError(errorDetails);
|
|
20895
|
+
}
|
|
20896
|
+
throw err;
|
|
20897
|
+
});
|
|
20690
20898
|
}
|
|
20691
20899
|
/**
|
|
20692
20900
|
* Triggers an event to the embedded app, skipping the UI flow.
|
|
@@ -21428,6 +21636,50 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21428
21636
|
}
|
|
21429
21637
|
};
|
|
21430
21638
|
|
|
21639
|
+
/**
|
|
21640
|
+
* Resolves enablePastConversationsSidebar with
|
|
21641
|
+
* spotterSidebarConfig taking precedence over the
|
|
21642
|
+
* standalone flag.
|
|
21643
|
+
*/
|
|
21644
|
+
const resolveEnablePastConversationsSidebar = (params) => (params.spotterSidebarConfigValue !== undefined
|
|
21645
|
+
? params.spotterSidebarConfigValue
|
|
21646
|
+
: params.standaloneValue);
|
|
21647
|
+
function buildSpotterSidebarAppInitData(defaultAppInitData, viewConfig, handleError) {
|
|
21648
|
+
const { spotterSidebarConfig, enablePastConversationsSidebar } = viewConfig;
|
|
21649
|
+
const resolvedEnablePastConversations = resolveEnablePastConversationsSidebar({
|
|
21650
|
+
spotterSidebarConfigValue: spotterSidebarConfig === null || spotterSidebarConfig === void 0 ? void 0 : spotterSidebarConfig.enablePastConversationsSidebar,
|
|
21651
|
+
standaloneValue: enablePastConversationsSidebar,
|
|
21652
|
+
});
|
|
21653
|
+
const hasConfig = spotterSidebarConfig || resolvedEnablePastConversations !== undefined;
|
|
21654
|
+
if (!hasConfig)
|
|
21655
|
+
return defaultAppInitData;
|
|
21656
|
+
const resolvedSidebarConfig = {
|
|
21657
|
+
...spotterSidebarConfig,
|
|
21658
|
+
...(resolvedEnablePastConversations !== undefined && {
|
|
21659
|
+
enablePastConversationsSidebar: resolvedEnablePastConversations,
|
|
21660
|
+
}),
|
|
21661
|
+
};
|
|
21662
|
+
if (resolvedSidebarConfig.spotterDocumentationUrl !== undefined) {
|
|
21663
|
+
const [isValid, validationError] = validateHttpUrl(resolvedSidebarConfig.spotterDocumentationUrl);
|
|
21664
|
+
if (!isValid) {
|
|
21665
|
+
handleError({
|
|
21666
|
+
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
21667
|
+
message: ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
|
|
21668
|
+
code: EmbedErrorCodes.INVALID_URL,
|
|
21669
|
+
error: (validationError === null || validationError === void 0 ? void 0 : validationError.message) || ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
|
|
21670
|
+
});
|
|
21671
|
+
delete resolvedSidebarConfig.spotterDocumentationUrl;
|
|
21672
|
+
}
|
|
21673
|
+
}
|
|
21674
|
+
return {
|
|
21675
|
+
...defaultAppInitData,
|
|
21676
|
+
embedParams: {
|
|
21677
|
+
...(defaultAppInitData.embedParams || {}),
|
|
21678
|
+
spotterSidebarConfig: resolvedSidebarConfig,
|
|
21679
|
+
},
|
|
21680
|
+
};
|
|
21681
|
+
}
|
|
21682
|
+
|
|
21431
21683
|
/**
|
|
21432
21684
|
* Copyright (c) 2022
|
|
21433
21685
|
*
|
|
@@ -21557,7 +21809,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21557
21809
|
this.defaultHeight = 500;
|
|
21558
21810
|
this.sendFullHeightLazyLoadData = () => {
|
|
21559
21811
|
const data = calculateVisibleElementData(this.iFrame);
|
|
21560
|
-
this
|
|
21812
|
+
// this should be fired only if the lazyLoadingForFullHeight and fullHeight are true
|
|
21813
|
+
if (this.viewConfig.lazyLoadingForFullHeight && this.viewConfig.fullHeight) {
|
|
21814
|
+
this.trigger(exports.HostEvent.VisibleEmbedCoordinates, data);
|
|
21815
|
+
}
|
|
21561
21816
|
};
|
|
21562
21817
|
/**
|
|
21563
21818
|
* This is a handler for the RequestVisibleEmbedCoordinates event.
|
|
@@ -21570,22 +21825,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21570
21825
|
const visibleCoordinatesData = calculateVisibleElementData(this.iFrame);
|
|
21571
21826
|
responder({ type: exports.EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
|
|
21572
21827
|
};
|
|
21573
|
-
this.HEIGHT_CHANAGE_THRESHOLD = 30;
|
|
21574
21828
|
/**
|
|
21575
21829
|
* Set the iframe height as per the computed height received
|
|
21576
21830
|
* from the ThoughtSpot app.
|
|
21577
21831
|
* @param data The event payload
|
|
21578
21832
|
*/
|
|
21579
21833
|
this.updateIFrameHeight = (data) => {
|
|
21580
|
-
|
|
21581
|
-
const currentHeight = this.iFrame.getBoundingClientRect().height;
|
|
21582
|
-
const heightToSet = Math.max(data.data, this.defaultHeight);
|
|
21583
|
-
const heightChange = Math.abs(heightToSet - currentHeight);
|
|
21584
|
-
if (heightChange < this.HEIGHT_CHANAGE_THRESHOLD) {
|
|
21585
|
-
logger$3.info('Height change is less than the threshold, skipping height update', { heightChange, heightToSet, currentHeight });
|
|
21586
|
-
return;
|
|
21587
|
-
}
|
|
21588
|
-
this.setIFrameHeight(heightToSet);
|
|
21834
|
+
this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
|
|
21589
21835
|
this.sendFullHeightLazyLoadData();
|
|
21590
21836
|
};
|
|
21591
21837
|
this.embedIframeCenter = (data, responder) => {
|
|
@@ -21619,12 +21865,28 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21619
21865
|
this.on(exports.EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
|
|
21620
21866
|
}
|
|
21621
21867
|
}
|
|
21868
|
+
/**
|
|
21869
|
+
* Extends the default APP_INIT payload with `embedParams.spotterSidebarConfig`
|
|
21870
|
+
* so the conv-assist app can read sidebar configuration on initialisation.
|
|
21871
|
+
*
|
|
21872
|
+
* Precedence for `enablePastConversationsSidebar`:
|
|
21873
|
+
* `spotterSidebarConfig.enablePastConversationsSidebar` wins over the
|
|
21874
|
+
* deprecated top-level `enablePastConversationsSidebar` flag; if the former
|
|
21875
|
+
* is absent the latter is used as a fallback.
|
|
21876
|
+
*
|
|
21877
|
+
* An invalid `spotterDocumentationUrl` triggers a validation error and is
|
|
21878
|
+
* excluded from the payload rather than forwarded to the app.
|
|
21879
|
+
*/
|
|
21880
|
+
async getAppInitData() {
|
|
21881
|
+
const defaultAppInitData = await super.getAppInitData();
|
|
21882
|
+
return buildSpotterSidebarAppInitData(defaultAppInitData, this.viewConfig, this.handleError.bind(this));
|
|
21883
|
+
}
|
|
21622
21884
|
/**
|
|
21623
21885
|
* Constructs a map of parameters to be passed on to the
|
|
21624
21886
|
* embedded Liveboard or visualization.
|
|
21625
21887
|
*/
|
|
21626
21888
|
getEmbedParams() {
|
|
21627
|
-
const { tag, hideTagFilterChips, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled = false, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, isEnhancedFilterInteractivityEnabled = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled = false, isGranularXLSXCSVSchedulesEnabled = false, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt,
|
|
21889
|
+
const { tag, hideTagFilterChips, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled = false, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, isEnhancedFilterInteractivityEnabled = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled = false, isGranularXLSXCSVSchedulesEnabled = false, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, spotterChatConfig, minimumHeight, isThisPeriodInDateFiltersEnabled, enableHomepageAnnouncement = false, isContinuousLiveboardPDFEnabled, } = this.viewConfig;
|
|
21628
21890
|
let params = {};
|
|
21629
21891
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
21630
21892
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -21648,39 +21910,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21648
21910
|
if (!isUndefined(updatedSpotterChatPrompt)) {
|
|
21649
21911
|
params[Param.UpdatedSpotterChatPrompt] = !!updatedSpotterChatPrompt;
|
|
21650
21912
|
}
|
|
21651
|
-
const resolvedEnablePastConversationsSidebar = resolveEnablePastConversationsSidebar({
|
|
21652
|
-
spotterSidebarConfigValue: spotterSidebarConfig === null || spotterSidebarConfig === void 0 ? void 0 : spotterSidebarConfig.enablePastConversationsSidebar,
|
|
21653
|
-
standaloneValue: this.viewConfig.enablePastConversationsSidebar,
|
|
21654
|
-
});
|
|
21655
|
-
setParamIfDefined(params, Param.EnablePastConversationsSidebar, resolvedEnablePastConversationsSidebar, true);
|
|
21656
|
-
// Handle spotterSidebarConfig params
|
|
21657
|
-
if (spotterSidebarConfig) {
|
|
21658
|
-
const { spotterSidebarTitle, spotterSidebarDefaultExpanded, spotterChatRenameLabel, spotterChatDeleteLabel, spotterDeleteConversationModalTitle, spotterPastConversationAlertMessage, spotterDocumentationUrl, spotterBestPracticesLabel, spotterConversationsBatchSize, spotterNewChatButtonTitle, } = spotterSidebarConfig;
|
|
21659
|
-
setParamIfDefined(params, Param.SpotterSidebarDefaultExpanded, spotterSidebarDefaultExpanded, true);
|
|
21660
|
-
setParamIfDefined(params, Param.SpotterSidebarTitle, spotterSidebarTitle);
|
|
21661
|
-
setParamIfDefined(params, Param.SpotterChatRenameLabel, spotterChatRenameLabel);
|
|
21662
|
-
setParamIfDefined(params, Param.SpotterChatDeleteLabel, spotterChatDeleteLabel);
|
|
21663
|
-
setParamIfDefined(params, Param.SpotterDeleteConversationModalTitle, spotterDeleteConversationModalTitle);
|
|
21664
|
-
setParamIfDefined(params, Param.SpotterPastConversationAlertMessage, spotterPastConversationAlertMessage);
|
|
21665
|
-
setParamIfDefined(params, Param.SpotterBestPracticesLabel, spotterBestPracticesLabel);
|
|
21666
|
-
setParamIfDefined(params, Param.SpotterConversationsBatchSize, spotterConversationsBatchSize);
|
|
21667
|
-
setParamIfDefined(params, Param.SpotterNewChatButtonTitle, spotterNewChatButtonTitle);
|
|
21668
|
-
// URL param with validation
|
|
21669
|
-
if (spotterDocumentationUrl !== undefined) {
|
|
21670
|
-
const [isValid, validationError] = validateHttpUrl(spotterDocumentationUrl);
|
|
21671
|
-
if (isValid) {
|
|
21672
|
-
params[Param.SpotterDocumentationUrl] = spotterDocumentationUrl;
|
|
21673
|
-
}
|
|
21674
|
-
else {
|
|
21675
|
-
this.handleError({
|
|
21676
|
-
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
21677
|
-
message: ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
|
|
21678
|
-
code: EmbedErrorCodes.INVALID_URL,
|
|
21679
|
-
error: (validationError === null || validationError === void 0 ? void 0 : validationError.message) || ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
|
|
21680
|
-
});
|
|
21681
|
-
}
|
|
21682
|
-
}
|
|
21683
|
-
}
|
|
21684
21913
|
// Handle spotterChatConfig params
|
|
21685
21914
|
if (spotterChatConfig) {
|
|
21686
21915
|
const { hideToolResponseCardBranding, toolResponseCardBrandingLabel, } = spotterChatConfig;
|
|
@@ -21756,6 +21985,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
21756
21985
|
if (enableHomepageAnnouncement !== undefined) {
|
|
21757
21986
|
params[Param.EnableHomepageAnnouncement] = enableHomepageAnnouncement;
|
|
21758
21987
|
}
|
|
21988
|
+
if (isContinuousLiveboardPDFEnabled !== undefined) {
|
|
21989
|
+
params[Param.IsWYSIWYGLiveboardPDFEnabled] = isContinuousLiveboardPDFEnabled;
|
|
21990
|
+
}
|
|
21759
21991
|
this.defaultHeight = minimumHeight || this.defaultHeight;
|
|
21760
21992
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
21761
21993
|
params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
|
|
@@ -22031,7 +22263,10 @@ query GetEurekaVizSnapshots(
|
|
|
22031
22263
|
this.defaultHeight = 500;
|
|
22032
22264
|
this.sendFullHeightLazyLoadData = () => {
|
|
22033
22265
|
const data = calculateVisibleElementData(this.iFrame);
|
|
22034
|
-
this
|
|
22266
|
+
// this should be fired only if the lazyLoadingForFullHeight and fullHeight are true
|
|
22267
|
+
if (this.viewConfig.lazyLoadingForFullHeight && this.viewConfig.fullHeight) {
|
|
22268
|
+
this.trigger(exports.HostEvent.VisibleEmbedCoordinates, data);
|
|
22269
|
+
}
|
|
22035
22270
|
};
|
|
22036
22271
|
/**
|
|
22037
22272
|
* This is a handler for the RequestVisibleEmbedCoordinates event.
|
|
@@ -22044,21 +22279,13 @@ query GetEurekaVizSnapshots(
|
|
|
22044
22279
|
const visibleCoordinatesData = calculateVisibleElementData(this.iFrame);
|
|
22045
22280
|
responder({ type: exports.EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
|
|
22046
22281
|
};
|
|
22047
|
-
this.HEIGHT_CHANAGE_THRESHOLD = 30;
|
|
22048
22282
|
/**
|
|
22049
22283
|
* Set the iframe height as per the computed height received
|
|
22050
22284
|
* from the ThoughtSpot app.
|
|
22051
22285
|
* @param data The event payload
|
|
22052
22286
|
*/
|
|
22053
22287
|
this.updateIFrameHeight = (data) => {
|
|
22054
|
-
|
|
22055
|
-
const heightToSet = Math.max(data.data, this.defaultHeight);
|
|
22056
|
-
const heightChange = Math.abs(heightToSet - currentHeight);
|
|
22057
|
-
if (heightChange < this.HEIGHT_CHANAGE_THRESHOLD) {
|
|
22058
|
-
logger$3.info('Height change is less than the threshold, skipping height update', { heightChange, heightToSet, currentHeight });
|
|
22059
|
-
return;
|
|
22060
|
-
}
|
|
22061
|
-
this.setIFrameHeight(heightToSet);
|
|
22288
|
+
this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
|
|
22062
22289
|
this.sendFullHeightLazyLoadData();
|
|
22063
22290
|
};
|
|
22064
22291
|
this.embedIframeCenter = (data, responder) => {
|
|
@@ -22119,7 +22346,7 @@ query GetEurekaVizSnapshots(
|
|
|
22119
22346
|
getEmbedParamsObject() {
|
|
22120
22347
|
let params = {};
|
|
22121
22348
|
params = this.getBaseQueryParams(params);
|
|
22122
|
-
const { enableVizTransformations, fullHeight, defaultHeight, minimumHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled = false, isEnhancedFilterInteractivityEnabled = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled = false, isGranularXLSXCSVSchedulesEnabled = false, showSpotterLimitations, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, spotterChatConfig, isThisPeriodInDateFiltersEnabled, } = this.viewConfig;
|
|
22349
|
+
const { enableVizTransformations, fullHeight, defaultHeight, minimumHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled = false, isEnhancedFilterInteractivityEnabled = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled = false, isGranularXLSXCSVSchedulesEnabled = false, showSpotterLimitations, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, spotterChatConfig, isThisPeriodInDateFiltersEnabled, isContinuousLiveboardPDFEnabled, } = this.viewConfig;
|
|
22123
22350
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
22124
22351
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
22125
22352
|
if (fullHeight === true) {
|
|
@@ -22208,6 +22435,9 @@ query GetEurekaVizSnapshots(
|
|
|
22208
22435
|
if (isThisPeriodInDateFiltersEnabled !== undefined) {
|
|
22209
22436
|
params[Param.IsThisPeriodInDateFiltersEnabled] = isThisPeriodInDateFiltersEnabled;
|
|
22210
22437
|
}
|
|
22438
|
+
if (isContinuousLiveboardPDFEnabled !== undefined) {
|
|
22439
|
+
params[Param.IsWYSIWYGLiveboardPDFEnabled] = isContinuousLiveboardPDFEnabled;
|
|
22440
|
+
}
|
|
22211
22441
|
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
22212
22442
|
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
22213
22443
|
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
@@ -22955,14 +23185,24 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
22955
23185
|
super(container, viewConfig);
|
|
22956
23186
|
this.viewConfig = viewConfig;
|
|
22957
23187
|
}
|
|
23188
|
+
/**
|
|
23189
|
+
* Extends the default APP_INIT payload with `embedParams.spotterSidebarConfig`
|
|
23190
|
+
* so the conv-assist app can read sidebar configuration on initialisation.
|
|
23191
|
+
*
|
|
23192
|
+
* Precedence for `enablePastConversationsSidebar`:
|
|
23193
|
+
* `spotterSidebarConfig.enablePastConversationsSidebar` wins over the
|
|
23194
|
+
* deprecated top-level `enablePastConversationsSidebar` flag; if the former
|
|
23195
|
+
* is absent the latter is used as a fallback.
|
|
23196
|
+
*
|
|
23197
|
+
* An invalid `spotterDocumentationUrl` triggers a validation error and is
|
|
23198
|
+
* excluded from the payload rather than forwarded to the app.
|
|
23199
|
+
*/
|
|
23200
|
+
async getAppInitData() {
|
|
23201
|
+
const defaultAppInitData = await super.getAppInitData();
|
|
23202
|
+
return buildSpotterSidebarAppInitData(defaultAppInitData, this.viewConfig, this.handleError.bind(this));
|
|
23203
|
+
}
|
|
22958
23204
|
getEmbedParamsObject() {
|
|
22959
|
-
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, updatedSpotterChatPrompt,
|
|
22960
|
-
// Extract sidebar config properties
|
|
22961
|
-
const { enablePastConversationsSidebar: sidebarEnablePastConversationsSidebar, spotterSidebarTitle, spotterSidebarDefaultExpanded, spotterChatRenameLabel, spotterChatDeleteLabel, spotterDeleteConversationModalTitle, spotterPastConversationAlertMessage, spotterDocumentationUrl, spotterBestPracticesLabel, spotterConversationsBatchSize, spotterNewChatButtonTitle, } = spotterSidebarConfig || {};
|
|
22962
|
-
const resolvedEnablePastConversationsSidebar = resolveEnablePastConversationsSidebar({
|
|
22963
|
-
spotterSidebarConfigValue: sidebarEnablePastConversationsSidebar,
|
|
22964
|
-
standaloneValue: this.viewConfig.enablePastConversationsSidebar,
|
|
22965
|
-
});
|
|
23205
|
+
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, updatedSpotterChatPrompt, spotterChatConfig, } = this.viewConfig;
|
|
22966
23206
|
if (!worksheetId) {
|
|
22967
23207
|
this.handleError({
|
|
22968
23208
|
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
@@ -22980,32 +23220,6 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
22980
23220
|
setParamIfDefined(queryParams, Param.ShowSpotterLimitations, showSpotterLimitations, true);
|
|
22981
23221
|
setParamIfDefined(queryParams, Param.HideSampleQuestions, hideSampleQuestions, true);
|
|
22982
23222
|
setParamIfDefined(queryParams, Param.UpdatedSpotterChatPrompt, updatedSpotterChatPrompt, true);
|
|
22983
|
-
setParamIfDefined(queryParams, Param.EnablePastConversationsSidebar, resolvedEnablePastConversationsSidebar, true);
|
|
22984
|
-
setParamIfDefined(queryParams, Param.SpotterSidebarDefaultExpanded, spotterSidebarDefaultExpanded, true);
|
|
22985
|
-
// String params
|
|
22986
|
-
setParamIfDefined(queryParams, Param.SpotterSidebarTitle, spotterSidebarTitle);
|
|
22987
|
-
setParamIfDefined(queryParams, Param.SpotterChatRenameLabel, spotterChatRenameLabel);
|
|
22988
|
-
setParamIfDefined(queryParams, Param.SpotterChatDeleteLabel, spotterChatDeleteLabel);
|
|
22989
|
-
setParamIfDefined(queryParams, Param.SpotterDeleteConversationModalTitle, spotterDeleteConversationModalTitle);
|
|
22990
|
-
setParamIfDefined(queryParams, Param.SpotterPastConversationAlertMessage, spotterPastConversationAlertMessage);
|
|
22991
|
-
setParamIfDefined(queryParams, Param.SpotterBestPracticesLabel, spotterBestPracticesLabel);
|
|
22992
|
-
setParamIfDefined(queryParams, Param.SpotterConversationsBatchSize, spotterConversationsBatchSize);
|
|
22993
|
-
setParamIfDefined(queryParams, Param.SpotterNewChatButtonTitle, spotterNewChatButtonTitle);
|
|
22994
|
-
// URL param with validation
|
|
22995
|
-
if (spotterDocumentationUrl !== undefined) {
|
|
22996
|
-
const [isValid, validationError] = validateHttpUrl(spotterDocumentationUrl);
|
|
22997
|
-
if (isValid) {
|
|
22998
|
-
queryParams[Param.SpotterDocumentationUrl] = spotterDocumentationUrl;
|
|
22999
|
-
}
|
|
23000
|
-
else {
|
|
23001
|
-
this.handleError({
|
|
23002
|
-
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
23003
|
-
message: ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
|
|
23004
|
-
code: EmbedErrorCodes.INVALID_URL,
|
|
23005
|
-
error: (validationError === null || validationError === void 0 ? void 0 : validationError.message) || ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
|
|
23006
|
-
});
|
|
23007
|
-
}
|
|
23008
|
-
}
|
|
23009
23223
|
// Handle spotterChatConfig params
|
|
23010
23224
|
if (spotterChatConfig) {
|
|
23011
23225
|
const { hideToolResponseCardBranding, toolResponseCardBrandingLabel, } = spotterChatConfig;
|