@thoughtspot/visual-embed-sdk 1.41.1 → 1.42.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/package.json +9 -9
- package/cjs/src/api-intercept.d.ts +25 -0
- package/cjs/src/api-intercept.d.ts.map +1 -0
- package/cjs/src/api-intercept.js +115 -0
- package/cjs/src/api-intercept.js.map +1 -0
- package/cjs/src/css-variables.d.ts +52 -14
- package/cjs/src/css-variables.d.ts.map +1 -1
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +7 -2
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +20 -0
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.d.ts +1 -0
- package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/cjs/src/embed/bodyless-conversation.js +7 -3
- 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 +7 -2
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.d.ts +11 -1
- package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.js +1 -0
- package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +1 -0
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +10 -2
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +35 -0
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/sage.d.ts +1 -0
- package/cjs/src/embed/sage.d.ts.map +1 -1
- package/cjs/src/embed/sage.js +10 -6
- package/cjs/src/embed/sage.js.map +1 -1
- package/cjs/src/embed/search-bar.d.ts +1 -0
- package/cjs/src/embed/search-bar.d.ts.map +1 -1
- package/cjs/src/embed/search-bar.js +11 -7
- package/cjs/src/embed/search-bar.js.map +1 -1
- package/cjs/src/embed/search.d.ts +1 -0
- package/cjs/src/embed/search.d.ts.map +1 -1
- package/cjs/src/embed/search.js +10 -9
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +21 -4
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +115 -34
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +83 -0
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/errors.d.ts +1 -0
- package/cjs/src/errors.d.ts.map +1 -1
- package/cjs/src/errors.js +1 -0
- package/cjs/src/errors.js.map +1 -1
- package/cjs/src/index.d.ts +2 -2
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +2 -1
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/react/all-types-export.d.ts +1 -1
- package/cjs/src/react/all-types-export.d.ts.map +1 -1
- package/cjs/src/react/all-types-export.js +2 -1
- package/cjs/src/react/all-types-export.js.map +1 -1
- package/cjs/src/react/all-types-export.spec.js +1 -1
- package/cjs/src/react/all-types-export.spec.js.map +1 -1
- package/cjs/src/react/util.js.map +1 -1
- package/cjs/src/react/util.spec.d.ts +2 -0
- package/cjs/src/react/util.spec.d.ts.map +1 -0
- package/cjs/src/react/util.spec.js +78 -0
- package/cjs/src/react/util.spec.js.map +1 -0
- package/cjs/src/types.d.ts +135 -8
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +73 -4
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/processData.d.ts +1 -1
- package/cjs/src/utils/processData.d.ts.map +1 -1
- package/cjs/src/utils/processData.js +8 -8
- package/cjs/src/utils/processData.js.map +1 -1
- package/dist/index-BEzW4MDA.js +7371 -0
- package/dist/{index-DQueHwfQ.js → index-DvNA626T.js} +1 -1
- package/dist/src/api-intercept.d.ts +25 -0
- package/dist/src/api-intercept.d.ts.map +1 -0
- package/dist/src/css-variables.d.ts +52 -14
- package/dist/src/css-variables.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/bodyless-conversation.d.ts +1 -0
- package/dist/src/embed/bodyless-conversation.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/contracts.d.ts +11 -1
- package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +1 -0
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/sage.d.ts +1 -0
- package/dist/src/embed/sage.d.ts.map +1 -1
- package/dist/src/embed/search-bar.d.ts +1 -0
- package/dist/src/embed/search-bar.d.ts.map +1 -1
- package/dist/src/embed/search.d.ts +1 -0
- package/dist/src/embed/search.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +21 -4
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/errors.d.ts +1 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/react/all-types-export.d.ts +1 -1
- package/dist/src/react/all-types-export.d.ts.map +1 -1
- package/dist/src/react/util.spec.d.ts +2 -0
- package/dist/src/react/util.spec.d.ts.map +1 -0
- package/dist/src/types.d.ts +135 -8
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/processData.d.ts +1 -1
- package/dist/src/utils/processData.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +370 -90
- package/dist/tsembed-react.js +369 -89
- package/dist/tsembed.es.js +371 -91
- package/dist/tsembed.js +369 -89
- package/dist/visual-embed-sdk-react-full.d.ts +9431 -9915
- package/dist/visual-embed-sdk-react.d.ts +9301 -9922
- package/dist/visual-embed-sdk.d.ts +9470 -9532
- package/lib/package.json +9 -9
- package/lib/src/api-intercept.d.ts +25 -0
- package/lib/src/api-intercept.d.ts.map +1 -0
- package/lib/src/api-intercept.js +108 -0
- package/lib/src/api-intercept.js.map +1 -0
- package/lib/src/css-variables.d.ts +52 -14
- package/lib/src/css-variables.d.ts.map +1 -1
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +7 -2
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +20 -0
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.d.ts +1 -0
- package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/lib/src/embed/bodyless-conversation.js +7 -3
- 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 +7 -2
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts +11 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.js +1 -0
- package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +1 -0
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +10 -2
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +35 -0
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/sage.d.ts +1 -0
- package/lib/src/embed/sage.d.ts.map +1 -1
- package/lib/src/embed/sage.js +10 -6
- package/lib/src/embed/sage.js.map +1 -1
- package/lib/src/embed/search-bar.d.ts +1 -0
- package/lib/src/embed/search-bar.d.ts.map +1 -1
- package/lib/src/embed/search-bar.js +11 -7
- package/lib/src/embed/search-bar.js.map +1 -1
- package/lib/src/embed/search.d.ts +1 -0
- package/lib/src/embed/search.d.ts.map +1 -1
- package/lib/src/embed/search.js +10 -9
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +21 -4
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +115 -34
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +83 -0
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/errors.d.ts +1 -0
- package/lib/src/errors.d.ts.map +1 -1
- package/lib/src/errors.js +1 -0
- package/lib/src/errors.js.map +1 -1
- package/lib/src/index.d.ts +2 -2
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +2 -2
- package/lib/src/index.js.map +1 -1
- package/lib/src/react/all-types-export.d.ts +1 -1
- package/lib/src/react/all-types-export.d.ts.map +1 -1
- package/lib/src/react/all-types-export.js +1 -1
- package/lib/src/react/all-types-export.js.map +1 -1
- package/lib/src/react/all-types-export.spec.js +1 -1
- package/lib/src/react/all-types-export.spec.js.map +1 -1
- package/lib/src/react/util.js.map +1 -1
- package/lib/src/react/util.spec.d.ts +2 -0
- package/lib/src/react/util.spec.d.ts.map +1 -0
- package/lib/src/react/util.spec.js +76 -0
- package/lib/src/react/util.spec.js.map +1 -0
- package/lib/src/types.d.ts +135 -8
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +72 -3
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/processData.d.ts +1 -1
- package/lib/src/utils/processData.d.ts.map +1 -1
- package/lib/src/utils/processData.js +8 -8
- package/lib/src/utils/processData.js.map +1 -1
- package/package.json +9 -9
- package/src/api-intercept.ts +134 -0
- package/src/css-variables.ts +53 -16
- package/src/embed/app.spec.ts +28 -0
- package/src/embed/app.ts +9 -1
- package/src/embed/bodyless-conversation.ts +8 -3
- package/src/embed/conversation.ts +17 -2
- package/src/embed/hostEventClient/contracts.ts +10 -0
- package/src/embed/liveboard.spec.ts +44 -0
- package/src/embed/liveboard.ts +12 -1
- package/src/embed/sage.ts +14 -9
- package/src/embed/search-bar.tsx +14 -7
- package/src/embed/search.ts +21 -8
- package/src/embed/ts-embed.spec.ts +116 -5
- package/src/embed/ts-embed.ts +152 -50
- package/src/errors.ts +1 -0
- package/src/index.ts +2 -0
- package/src/react/all-types-export.spec.ts +1 -1
- package/src/react/all-types-export.ts +1 -0
- package/src/react/util.spec.tsx +88 -0
- package/src/react/util.ts +3 -3
- package/src/types.ts +195 -64
- package/src/utils/processData.ts +11 -11
- package/lib/src/visual-embed-sdk.d.ts +0 -9779
package/dist/tsembed.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.42.1-alpha.1 */
|
|
2
2
|
'use client';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
@@ -2005,6 +2005,21 @@
|
|
|
2005
2005
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
2006
2006
|
*/
|
|
2007
2007
|
EmbedEvent["OrgSwitched"] = "orgSwitched";
|
|
2008
|
+
/**
|
|
2009
|
+
* Emitted when the user intercepts a URL.
|
|
2010
|
+
*
|
|
2011
|
+
* Supported on all embed types.
|
|
2012
|
+
*
|
|
2013
|
+
* @example
|
|
2014
|
+
* ```js
|
|
2015
|
+
* embed.on(EmbedEvent.ApiIntercept, (payload) => {
|
|
2016
|
+
* console.log('payload', payload);
|
|
2017
|
+
* })
|
|
2018
|
+
* ```
|
|
2019
|
+
*
|
|
2020
|
+
* @version SDK: 1.42.0 | ThoughtSpot: 10.14.0.cl
|
|
2021
|
+
*/
|
|
2022
|
+
EmbedEvent["ApiIntercept"] = "ApiIntercept";
|
|
2008
2023
|
})(exports.EmbedEvent || (exports.EmbedEvent = {}));
|
|
2009
2024
|
/**
|
|
2010
2025
|
* Event types that can be triggered by the host application
|
|
@@ -2770,21 +2785,42 @@
|
|
|
2770
2785
|
*/
|
|
2771
2786
|
HostEvent["Share"] = "share";
|
|
2772
2787
|
/**
|
|
2773
|
-
* Trigger the **Save**
|
|
2788
|
+
* Trigger the **Save** action on a Liveboard, Answer, or Spotter.
|
|
2774
2789
|
* Saves the changes.
|
|
2775
|
-
*
|
|
2790
|
+
*
|
|
2791
|
+
* @param - `vizId` refers to the Spotter Visualization Id used in Spotter embed.
|
|
2792
|
+
* It is required and can be retrieved from the data embed event.
|
|
2793
|
+
*
|
|
2776
2794
|
* @example
|
|
2777
2795
|
* ```js
|
|
2796
|
+
* // Save changes in a Liveboard
|
|
2778
2797
|
* liveboardEmbed.trigger(HostEvent.Save)
|
|
2779
2798
|
* ```
|
|
2799
|
+
*
|
|
2780
2800
|
* ```js
|
|
2801
|
+
* // Save the current Answer in Search embed
|
|
2781
2802
|
* searchEmbed.trigger(HostEvent.Save)
|
|
2782
2803
|
* ```
|
|
2804
|
+
*
|
|
2783
2805
|
* ```js
|
|
2806
|
+
* // Save an Answer in Spotter (requires vizId)
|
|
2784
2807
|
* spotterEmbed.trigger(HostEvent.Save, {
|
|
2785
|
-
*
|
|
2808
|
+
* vizId: "730496d6-6903-4601-937e-2c691821af3c"
|
|
2786
2809
|
* })
|
|
2787
2810
|
* ```
|
|
2811
|
+
*
|
|
2812
|
+
* ```js
|
|
2813
|
+
* // How to get the vizId in Spotter?
|
|
2814
|
+
*
|
|
2815
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId.
|
|
2816
|
+
* let latestSpotterVizId = '';
|
|
2817
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2818
|
+
* latestSpotterVizId = payload.data.id;
|
|
2819
|
+
* });
|
|
2820
|
+
*
|
|
2821
|
+
* spotterEmbed.trigger(HostEvent.Save, { vizId: latestSpotterVizId });
|
|
2822
|
+
* ```
|
|
2823
|
+
*
|
|
2788
2824
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2789
2825
|
*/
|
|
2790
2826
|
HostEvent["Save"] = "save";
|
|
@@ -3268,6 +3304,16 @@
|
|
|
3268
3304
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
3269
3305
|
*/
|
|
3270
3306
|
HostEvent["AskSpotter"] = "AskSpotter";
|
|
3307
|
+
/**
|
|
3308
|
+
* @hidden
|
|
3309
|
+
* Triggers the update of the embed params.
|
|
3310
|
+
*
|
|
3311
|
+
* @example
|
|
3312
|
+
* ```js
|
|
3313
|
+
* liveboardEmbed.trigger(HostEvent.UpdateEmbedParams, viewConfig);
|
|
3314
|
+
* ```
|
|
3315
|
+
*/
|
|
3316
|
+
HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
|
|
3271
3317
|
})(exports.HostEvent || (exports.HostEvent = {}));
|
|
3272
3318
|
/**
|
|
3273
3319
|
* The different visual modes that the data sources panel within
|
|
@@ -3415,6 +3461,7 @@
|
|
|
3415
3461
|
Param["RootMarginForLazyLoad"] = "rootMarginForLazyLoad";
|
|
3416
3462
|
Param["LiveboardXLSXCSVDownload"] = "isLiveboardXLSXCSVDownloadEnabled";
|
|
3417
3463
|
Param["isPNGInScheduledEmailsEnabled"] = "isPNGInScheduledEmailsEnabled";
|
|
3464
|
+
Param["isLinkParametersEnabled"] = "isLinkParametersEnabled";
|
|
3418
3465
|
})(Param || (Param = {}));
|
|
3419
3466
|
/**
|
|
3420
3467
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -4840,7 +4887,29 @@
|
|
|
4840
4887
|
* @version SDK: 1.26.7 | ThoughtSpot Cloud: 9.10.0.cl
|
|
4841
4888
|
*/
|
|
4842
4889
|
LogLevel["TRACE"] = "TRACE";
|
|
4843
|
-
})(exports.LogLevel || (exports.LogLevel = {}));
|
|
4890
|
+
})(exports.LogLevel || (exports.LogLevel = {}));
|
|
4891
|
+
/**
|
|
4892
|
+
* Enum for the type of API intercepted
|
|
4893
|
+
*/
|
|
4894
|
+
exports.InterceptedApiType = void 0;
|
|
4895
|
+
(function (InterceptedApiType) {
|
|
4896
|
+
/**
|
|
4897
|
+
* The apis that are use to get the metadata for the embed
|
|
4898
|
+
*/
|
|
4899
|
+
InterceptedApiType["METADATA"] = "METADATA";
|
|
4900
|
+
/**
|
|
4901
|
+
* The apis that are use to get the data for the embed
|
|
4902
|
+
*/
|
|
4903
|
+
InterceptedApiType["ANSWER_DATA"] = "ANSWER_DATA";
|
|
4904
|
+
/**
|
|
4905
|
+
* This will intercept all the apis
|
|
4906
|
+
*/
|
|
4907
|
+
InterceptedApiType["ALL"] = "ALL";
|
|
4908
|
+
/**
|
|
4909
|
+
* The apis that are use to get the data for the liveboard
|
|
4910
|
+
*/
|
|
4911
|
+
InterceptedApiType["LIVEBOARD_DATA"] = "LIVEBOARD_DATA";
|
|
4912
|
+
})(exports.InterceptedApiType || (exports.InterceptedApiType = {}));
|
|
4844
4913
|
|
|
4845
4914
|
const logFunctions = {
|
|
4846
4915
|
[exports.LogLevel.SILENT]: () => undefined,
|
|
@@ -7186,6 +7255,17 @@
|
|
|
7186
7255
|
|
|
7187
7256
|
var isEmpty_1 = isEmpty$1;
|
|
7188
7257
|
|
|
7258
|
+
exports.UIPassthroughEvent = void 0;
|
|
7259
|
+
(function (UIPassthroughEvent) {
|
|
7260
|
+
UIPassthroughEvent["PinAnswerToLiveboard"] = "addVizToPinboard";
|
|
7261
|
+
UIPassthroughEvent["SaveAnswer"] = "saveAnswer";
|
|
7262
|
+
UIPassthroughEvent["GetDiscoverabilityStatus"] = "getDiscoverabilityStatus";
|
|
7263
|
+
UIPassthroughEvent["GetAvailableUIPassthroughs"] = "getAvailableUiPassthroughs";
|
|
7264
|
+
UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
|
|
7265
|
+
UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
|
|
7266
|
+
UIPassthroughEvent["GetUnsavedAnswerTML"] = "getUnsavedAnswerTML";
|
|
7267
|
+
})(exports.UIPassthroughEvent || (exports.UIPassthroughEvent = {}));
|
|
7268
|
+
|
|
7189
7269
|
const ERROR_MESSAGE = {
|
|
7190
7270
|
INVALID_THOUGHTSPOT_HOST: 'Error parsing ThoughtSpot host. Please provide a valid URL.',
|
|
7191
7271
|
SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND: 'Please select a worksheet to get started',
|
|
@@ -7207,6 +7287,7 @@
|
|
|
7207
7287
|
MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
|
|
7208
7288
|
RENDER_CALLED_BEFORE_INIT: 'Looks like render was called before calling init, the render won\'t start until init is called.\nFor more info check\n1. https://developers.thoughtspot.com/docs/Function_init#_init\n2.https://developers.thoughtspot.com/docs/getting-started#initSdk',
|
|
7209
7289
|
SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
|
|
7290
|
+
OFFLINE_WARNING: 'Network not Detected. Embed is offline. Please reconnect and refresh',
|
|
7210
7291
|
};
|
|
7211
7292
|
const CUSTOM_ACTIONS_ERROR_MESSAGE = {
|
|
7212
7293
|
INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
|
|
@@ -17435,27 +17516,27 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17435
17516
|
* @param thoughtSpotHost
|
|
17436
17517
|
* @param containerEl
|
|
17437
17518
|
*/
|
|
17438
|
-
function processEventData(type,
|
|
17519
|
+
function processEventData(type, eventData, thoughtSpotHost, containerEl) {
|
|
17439
17520
|
switch (type) {
|
|
17440
17521
|
case exports.EmbedEvent.CustomAction:
|
|
17441
|
-
return processCustomAction(
|
|
17522
|
+
return processCustomAction(eventData, thoughtSpotHost);
|
|
17442
17523
|
case exports.EmbedEvent.AuthInit:
|
|
17443
|
-
return processAuthInit(
|
|
17524
|
+
return processAuthInit(eventData);
|
|
17444
17525
|
case exports.EmbedEvent.NoCookieAccess:
|
|
17445
|
-
return processNoCookieAccess(
|
|
17526
|
+
return processNoCookieAccess(eventData, containerEl);
|
|
17446
17527
|
case exports.EmbedEvent.AuthFailure:
|
|
17447
|
-
return processAuthFailure(
|
|
17528
|
+
return processAuthFailure(eventData, containerEl);
|
|
17448
17529
|
case exports.EmbedEvent.AuthLogout:
|
|
17449
|
-
return processAuthLogout(
|
|
17530
|
+
return processAuthLogout(eventData, containerEl);
|
|
17450
17531
|
case exports.EmbedEvent.ExitPresentMode:
|
|
17451
17532
|
return processExitPresentMode();
|
|
17452
17533
|
case exports.EmbedEvent.CLEAR_INFO_CACHE:
|
|
17453
17534
|
return processClearInfoCache();
|
|
17454
17535
|
}
|
|
17455
|
-
return
|
|
17536
|
+
return eventData;
|
|
17456
17537
|
}
|
|
17457
17538
|
|
|
17458
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.
|
|
17539
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.1-alpha.1";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","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","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"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.21","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":"^22.2.3","@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":"^26.6.3","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:"^26.6.3","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.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","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:"32 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};
|
|
17459
17540
|
|
|
17460
17541
|
/**
|
|
17461
17542
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -17527,16 +17608,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17527
17608
|
});
|
|
17528
17609
|
}
|
|
17529
17610
|
|
|
17530
|
-
exports.UIPassthroughEvent = void 0;
|
|
17531
|
-
(function (UIPassthroughEvent) {
|
|
17532
|
-
UIPassthroughEvent["PinAnswerToLiveboard"] = "addVizToPinboard";
|
|
17533
|
-
UIPassthroughEvent["SaveAnswer"] = "saveAnswer";
|
|
17534
|
-
UIPassthroughEvent["GetDiscoverabilityStatus"] = "getDiscoverabilityStatus";
|
|
17535
|
-
UIPassthroughEvent["GetAvailableUIPassthroughs"] = "getAvailableUiPassthroughs";
|
|
17536
|
-
UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
|
|
17537
|
-
UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
|
|
17538
|
-
})(exports.UIPassthroughEvent || (exports.UIPassthroughEvent = {}));
|
|
17539
|
-
|
|
17540
17611
|
class HostEventClient {
|
|
17541
17612
|
constructor(iFrame) {
|
|
17542
17613
|
this.iFrame = iFrame;
|
|
@@ -17628,6 +17699,107 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17628
17699
|
}
|
|
17629
17700
|
}
|
|
17630
17701
|
|
|
17702
|
+
const defaultUrls = {
|
|
17703
|
+
[exports.InterceptedApiType.METADATA]: [
|
|
17704
|
+
'/prism/?op=CreateAnswerSession',
|
|
17705
|
+
'/prism/?op=GetV2SourceDetail',
|
|
17706
|
+
],
|
|
17707
|
+
[exports.InterceptedApiType.ANSWER_DATA]: [
|
|
17708
|
+
'/prism/?op=GetChartWithData',
|
|
17709
|
+
'/prism/?op=GetTableWithHeadlineData',
|
|
17710
|
+
],
|
|
17711
|
+
[exports.InterceptedApiType.LIVEBOARD_DATA]: [
|
|
17712
|
+
'/prism/?op=LoadContextBook'
|
|
17713
|
+
],
|
|
17714
|
+
};
|
|
17715
|
+
const formatInterceptUrl = (url) => {
|
|
17716
|
+
const host = getThoughtSpotHost(getEmbedConfig());
|
|
17717
|
+
if (url.startsWith('/'))
|
|
17718
|
+
return `${host}${url}`;
|
|
17719
|
+
return url;
|
|
17720
|
+
};
|
|
17721
|
+
const processInterceptUrls = (interceptUrls) => {
|
|
17722
|
+
let processedUrls = [...interceptUrls];
|
|
17723
|
+
Object.entries(defaultUrls).forEach(([apiType, apiTypeUrls]) => {
|
|
17724
|
+
if (!processedUrls.includes(apiType))
|
|
17725
|
+
return;
|
|
17726
|
+
processedUrls = processedUrls.filter(url => url !== apiType);
|
|
17727
|
+
processedUrls = [...processedUrls, ...apiTypeUrls];
|
|
17728
|
+
});
|
|
17729
|
+
return processedUrls.map(url => formatInterceptUrl(url));
|
|
17730
|
+
};
|
|
17731
|
+
const getInterceptInitData = (embedConfig, viewConfig) => {
|
|
17732
|
+
const enableApiIntercept = (embedConfig.enableApiIntercept || viewConfig.enableApiIntercept) && (viewConfig.enableApiIntercept !== false);
|
|
17733
|
+
if (!enableApiIntercept)
|
|
17734
|
+
return {
|
|
17735
|
+
enableApiIntercept: false,
|
|
17736
|
+
};
|
|
17737
|
+
const combinedUrls = [...(embedConfig.interceptUrls || []), ...(viewConfig.interceptUrls || [])];
|
|
17738
|
+
if (viewConfig.isOnBeforeGetVizDataInterceptEnabled) {
|
|
17739
|
+
combinedUrls.push(exports.InterceptedApiType.ANSWER_DATA);
|
|
17740
|
+
}
|
|
17741
|
+
const shouldInterceptAll = combinedUrls.includes(exports.InterceptedApiType.ALL);
|
|
17742
|
+
const interceptUrls = shouldInterceptAll ? [exports.InterceptedApiType.ALL] : processInterceptUrls(combinedUrls);
|
|
17743
|
+
const interceptTimeout = embedConfig.interceptTimeout || viewConfig.interceptTimeout;
|
|
17744
|
+
return {
|
|
17745
|
+
interceptUrls,
|
|
17746
|
+
interceptTimeout,
|
|
17747
|
+
enableApiIntercept,
|
|
17748
|
+
};
|
|
17749
|
+
};
|
|
17750
|
+
/**
|
|
17751
|
+
*
|
|
17752
|
+
* @param fetchInit
|
|
17753
|
+
*/
|
|
17754
|
+
const parseInterceptData = (eventDataString) => {
|
|
17755
|
+
try {
|
|
17756
|
+
const { input, init } = JSON.parse(eventDataString);
|
|
17757
|
+
init.body = JSON.parse(init.body);
|
|
17758
|
+
const parsedInit = { input, init };
|
|
17759
|
+
return [parsedInit, null];
|
|
17760
|
+
}
|
|
17761
|
+
catch (error) {
|
|
17762
|
+
return [null, error];
|
|
17763
|
+
}
|
|
17764
|
+
};
|
|
17765
|
+
const handleInterceptEvent = async (params) => {
|
|
17766
|
+
var _a, _b, _c, _d, _e;
|
|
17767
|
+
const { eventData, executeEvent, viewConfig, getUnsavedAnswerTml } = params;
|
|
17768
|
+
const [interceptData, bodyParseError] = parseInterceptData(eventData.data);
|
|
17769
|
+
if (bodyParseError) {
|
|
17770
|
+
executeEvent(exports.EmbedEvent.Error, {
|
|
17771
|
+
error: 'Error parsing api intercept body',
|
|
17772
|
+
});
|
|
17773
|
+
logger$3.error('Error parsing request body', bodyParseError);
|
|
17774
|
+
return;
|
|
17775
|
+
}
|
|
17776
|
+
const { input: requestUrl, init } = interceptData;
|
|
17777
|
+
const sessionId = (_c = (_b = (_a = init === null || init === void 0 ? void 0 : init.body) === null || _a === void 0 ? void 0 : _a.variables) === null || _b === void 0 ? void 0 : _b.session) === null || _c === void 0 ? void 0 : _c.sessionId;
|
|
17778
|
+
const vizId = (_e = (_d = init === null || init === void 0 ? void 0 : init.body) === null || _d === void 0 ? void 0 : _d.variables) === null || _e === void 0 ? void 0 : _e.contextBookId;
|
|
17779
|
+
if (defaultUrls.ANSWER_DATA.includes(requestUrl) && viewConfig.isOnBeforeGetVizDataInterceptEnabled) {
|
|
17780
|
+
const answerTml = await getUnsavedAnswerTml({ sessionId, vizId });
|
|
17781
|
+
executeEvent(exports.EmbedEvent.OnBeforeGetVizDataIntercept, { data: { data: answerTml } });
|
|
17782
|
+
}
|
|
17783
|
+
executeEvent(exports.EmbedEvent.ApiIntercept, interceptData);
|
|
17784
|
+
};
|
|
17785
|
+
const processLegacyInterceptResponse = (payload) => {
|
|
17786
|
+
var _a, _b;
|
|
17787
|
+
const title = (_a = payload === null || payload === void 0 ? void 0 : payload.data) === null || _a === void 0 ? void 0 : _a.errorText;
|
|
17788
|
+
const desc = (_b = payload === null || payload === void 0 ? void 0 : payload.data) === null || _b === void 0 ? void 0 : _b.errorDescription;
|
|
17789
|
+
const payloadToSend = [{
|
|
17790
|
+
data: {},
|
|
17791
|
+
errors: [
|
|
17792
|
+
{
|
|
17793
|
+
errorObj: {
|
|
17794
|
+
title,
|
|
17795
|
+
desc
|
|
17796
|
+
}
|
|
17797
|
+
}
|
|
17798
|
+
],
|
|
17799
|
+
}];
|
|
17800
|
+
return payloadToSend;
|
|
17801
|
+
};
|
|
17802
|
+
|
|
17631
17803
|
/**
|
|
17632
17804
|
* Copyright (c) 2022
|
|
17633
17805
|
*
|
|
@@ -17681,6 +17853,27 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17681
17853
|
*/
|
|
17682
17854
|
this.fullscreenChangeHandler = null;
|
|
17683
17855
|
this.subscribedListeners = {};
|
|
17856
|
+
this.messageEventListener = async (event) => {
|
|
17857
|
+
const eventType = this.getEventType(event);
|
|
17858
|
+
const eventPort = this.getEventPort(event);
|
|
17859
|
+
const eventData = this.formatEventData(event, eventType);
|
|
17860
|
+
if (event.source === this.iFrame.contentWindow) {
|
|
17861
|
+
const processedEventData = await processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.el);
|
|
17862
|
+
const executeEvent = (_eventType, data) => {
|
|
17863
|
+
this.executeCallbacks(_eventType, data, eventPort);
|
|
17864
|
+
};
|
|
17865
|
+
if (eventType === exports.EmbedEvent.ApiIntercept && this.viewConfig.enableApiIntercept) {
|
|
17866
|
+
const getUnsavedAnswerTml = async (props) => {
|
|
17867
|
+
var _a;
|
|
17868
|
+
const response = await this.triggerUIPassThrough(exports.UIPassthroughEvent.GetUnsavedAnswerTML, props);
|
|
17869
|
+
return (_a = response[0]) === null || _a === void 0 ? void 0 : _a.value;
|
|
17870
|
+
};
|
|
17871
|
+
handleInterceptEvent({ eventData: processedEventData, executeEvent, embedConfig: this.embedConfig, viewConfig: this.viewConfig, getUnsavedAnswerTml });
|
|
17872
|
+
return;
|
|
17873
|
+
}
|
|
17874
|
+
this.executeCallbacks(eventType, processedEventData, eventPort);
|
|
17875
|
+
}
|
|
17876
|
+
};
|
|
17684
17877
|
/**
|
|
17685
17878
|
* Send Custom style as part of payload of APP_INIT
|
|
17686
17879
|
* @param _
|
|
@@ -17765,11 +17958,23 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17765
17958
|
this.on(exports.EmbedEvent.AuthInit, authInitHandler, { start: false }, true);
|
|
17766
17959
|
};
|
|
17767
17960
|
this.showPreRenderByDefault = false;
|
|
17961
|
+
this.createEmbedEventResponder = (eventPort, eventType) => {
|
|
17962
|
+
const { enableApiIntercept } = getInterceptInitData(this.embedConfig, this.viewConfig);
|
|
17963
|
+
if (eventType === exports.EmbedEvent.OnBeforeGetVizDataIntercept && enableApiIntercept) {
|
|
17964
|
+
return (payload) => {
|
|
17965
|
+
const payloadToSend = processLegacyInterceptResponse(payload);
|
|
17966
|
+
this.triggerEventOnPort(eventPort, payloadToSend);
|
|
17967
|
+
};
|
|
17968
|
+
}
|
|
17969
|
+
return (payload) => {
|
|
17970
|
+
this.triggerEventOnPort(eventPort, payload);
|
|
17971
|
+
};
|
|
17972
|
+
};
|
|
17768
17973
|
/**
|
|
17769
|
-
|
|
17770
|
-
|
|
17771
|
-
|
|
17772
|
-
|
|
17974
|
+
* @hidden
|
|
17975
|
+
* Internal state to track if the embed container is loaded.
|
|
17976
|
+
* This is used to trigger events after the embed container is loaded.
|
|
17977
|
+
*/
|
|
17773
17978
|
this.isEmbedContainerLoaded = false;
|
|
17774
17979
|
/**
|
|
17775
17980
|
* @hidden
|
|
@@ -17828,10 +18033,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17828
18033
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
|
|
17829
18034
|
...viewConfig,
|
|
17830
18035
|
});
|
|
18036
|
+
const embedConfig = getEmbedConfig();
|
|
18037
|
+
this.embedConfig = embedConfig;
|
|
17831
18038
|
this.hostEventClient = new HostEventClient(this.iFrame);
|
|
17832
18039
|
this.isReadyForRenderPromise = getInitPromise().then(async () => {
|
|
17833
|
-
const embedConfig = getEmbedConfig();
|
|
17834
|
-
this.embedConfig = embedConfig;
|
|
17835
18040
|
if (!embedConfig.authTriggerContainer && !embedConfig.useEventForSAMLPopup) {
|
|
17836
18041
|
this.embedConfig.authTriggerContainer = domSelector;
|
|
17837
18042
|
}
|
|
@@ -17925,39 +18130,61 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17925
18130
|
return eventData;
|
|
17926
18131
|
}
|
|
17927
18132
|
/**
|
|
17928
|
-
*
|
|
17929
|
-
*
|
|
17930
|
-
* embed instance through an identifier contained in the payload,
|
|
17931
|
-
* and executes the registered callbacks accordingly.
|
|
18133
|
+
* Subscribe to network events (online/offline) that should
|
|
18134
|
+
* work regardless of auth status
|
|
17932
18135
|
*/
|
|
17933
|
-
|
|
17934
|
-
this.
|
|
17935
|
-
const messageEventListener = (event) => {
|
|
17936
|
-
const eventType = this.getEventType(event);
|
|
17937
|
-
const eventPort = this.getEventPort(event);
|
|
17938
|
-
const eventData = this.formatEventData(event, eventType);
|
|
17939
|
-
if (event.source === this.iFrame.contentWindow) {
|
|
17940
|
-
this.executeCallbacks(eventType, processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.el), eventPort);
|
|
17941
|
-
}
|
|
17942
|
-
};
|
|
17943
|
-
window.addEventListener('message', messageEventListener);
|
|
18136
|
+
subscribeToNetworkEvents() {
|
|
18137
|
+
this.unsubscribeToNetworkEvents();
|
|
17944
18138
|
const onlineEventListener = (e) => {
|
|
17945
18139
|
this.trigger(exports.HostEvent.Reload);
|
|
17946
18140
|
};
|
|
17947
18141
|
window.addEventListener('online', onlineEventListener);
|
|
17948
18142
|
const offlineEventListener = (e) => {
|
|
17949
|
-
const offlineWarning =
|
|
18143
|
+
const offlineWarning = ERROR_MESSAGE.OFFLINE_WARNING;
|
|
17950
18144
|
this.executeCallbacks(exports.EmbedEvent.Error, {
|
|
17951
18145
|
offlineWarning,
|
|
17952
18146
|
});
|
|
17953
18147
|
logger$3.warn(offlineWarning);
|
|
17954
18148
|
};
|
|
17955
18149
|
window.addEventListener('offline', offlineEventListener);
|
|
17956
|
-
this.subscribedListeners =
|
|
17957
|
-
|
|
17958
|
-
|
|
17959
|
-
|
|
17960
|
-
|
|
18150
|
+
this.subscribedListeners.online = onlineEventListener;
|
|
18151
|
+
this.subscribedListeners.offline = offlineEventListener;
|
|
18152
|
+
}
|
|
18153
|
+
/**
|
|
18154
|
+
* Subscribe to message events that depend on successful iframe setup
|
|
18155
|
+
*/
|
|
18156
|
+
subscribeToMessageEvents() {
|
|
18157
|
+
this.unsubscribeToMessageEvents();
|
|
18158
|
+
window.addEventListener('message', this.messageEventListener);
|
|
18159
|
+
this.subscribedListeners.message = this.messageEventListener;
|
|
18160
|
+
}
|
|
18161
|
+
/**
|
|
18162
|
+
* Adds event listeners for both network and message events.
|
|
18163
|
+
* This maintains backward compatibility with the existing method.
|
|
18164
|
+
* Adds a global event listener to window for "message" events.
|
|
18165
|
+
* ThoughtSpot detects if a particular event is targeted to this
|
|
18166
|
+
* embed instance through an identifier contained in the payload,
|
|
18167
|
+
* and executes the registered callbacks accordingly.
|
|
18168
|
+
*/
|
|
18169
|
+
subscribeToEvents() {
|
|
18170
|
+
this.subscribeToNetworkEvents();
|
|
18171
|
+
this.subscribeToMessageEvents();
|
|
18172
|
+
}
|
|
18173
|
+
unsubscribeToNetworkEvents() {
|
|
18174
|
+
if (this.subscribedListeners.online) {
|
|
18175
|
+
window.removeEventListener('online', this.subscribedListeners.online);
|
|
18176
|
+
delete this.subscribedListeners.online;
|
|
18177
|
+
}
|
|
18178
|
+
if (this.subscribedListeners.offline) {
|
|
18179
|
+
window.removeEventListener('offline', this.subscribedListeners.offline);
|
|
18180
|
+
delete this.subscribedListeners.offline;
|
|
18181
|
+
}
|
|
18182
|
+
}
|
|
18183
|
+
unsubscribeToMessageEvents() {
|
|
18184
|
+
if (this.subscribedListeners.message) {
|
|
18185
|
+
window.removeEventListener('message', this.subscribedListeners.message);
|
|
18186
|
+
delete this.subscribedListeners.message;
|
|
18187
|
+
}
|
|
17961
18188
|
}
|
|
17962
18189
|
unsubscribeToEvents() {
|
|
17963
18190
|
Object.keys(this.subscribedListeners).forEach((key) => {
|
|
@@ -17990,7 +18217,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17990
18217
|
message: customActionsResult.errors,
|
|
17991
18218
|
});
|
|
17992
18219
|
}
|
|
17993
|
-
|
|
18220
|
+
const baseInitData = {
|
|
17994
18221
|
customisations: getCustomisations(this.embedConfig, this.viewConfig),
|
|
17995
18222
|
authToken,
|
|
17996
18223
|
runtimeFilterParams: this.viewConfig.excludeRuntimeFiltersfromURL
|
|
@@ -18008,7 +18235,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18008
18235
|
customVariablesForThirdPartyTools: this.embedConfig.customVariablesForThirdPartyTools || {},
|
|
18009
18236
|
hiddenListColumns: this.viewConfig.hiddenListColumns || [],
|
|
18010
18237
|
customActions: customActionsResult.actions,
|
|
18238
|
+
...getInterceptInitData(this.embedConfig, this.viewConfig),
|
|
18011
18239
|
};
|
|
18240
|
+
return baseInitData;
|
|
18012
18241
|
}
|
|
18013
18242
|
async getAppInitData() {
|
|
18014
18243
|
return this.getDefaultAppInitData();
|
|
@@ -18027,6 +18256,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18027
18256
|
.join('/');
|
|
18028
18257
|
return `${basePath}#`;
|
|
18029
18258
|
}
|
|
18259
|
+
getUpdateEmbedParamsObject() {
|
|
18260
|
+
let queryParams = this.getEmbedParamsObject();
|
|
18261
|
+
queryParams = { ...this.viewConfig, ...queryParams };
|
|
18262
|
+
return queryParams;
|
|
18263
|
+
}
|
|
18030
18264
|
/**
|
|
18031
18265
|
* Common query params set for all the embed modes.
|
|
18032
18266
|
* @param queryParams
|
|
@@ -18176,9 +18410,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18176
18410
|
return path;
|
|
18177
18411
|
}
|
|
18178
18412
|
getEmbedParams() {
|
|
18179
|
-
const queryParams = this.
|
|
18413
|
+
const queryParams = this.getEmbedParamsObject();
|
|
18180
18414
|
return getQueryParamString(queryParams);
|
|
18181
18415
|
}
|
|
18416
|
+
getEmbedParamsObject() {
|
|
18417
|
+
const params = this.getBaseQueryParams();
|
|
18418
|
+
return params;
|
|
18419
|
+
}
|
|
18182
18420
|
getRootIframeSrc() {
|
|
18183
18421
|
const query = this.getEmbedParams();
|
|
18184
18422
|
return this.getEmbedBasePath(query);
|
|
@@ -18249,6 +18487,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18249
18487
|
type: exports.EmbedEvent.Init,
|
|
18250
18488
|
});
|
|
18251
18489
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_START);
|
|
18490
|
+
// Always subscribe to network events, regardless of auth status
|
|
18491
|
+
this.subscribeToNetworkEvents();
|
|
18252
18492
|
return (_a = getAuthPromise()) === null || _a === void 0 ? void 0 : _a.then((isLoggedIn) => {
|
|
18253
18493
|
if (!isLoggedIn) {
|
|
18254
18494
|
this.handleInsertionIntoDOM(this.embedConfig.loginFailedMessage);
|
|
@@ -18291,7 +18531,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18291
18531
|
el.remove();
|
|
18292
18532
|
});
|
|
18293
18533
|
}
|
|
18294
|
-
|
|
18534
|
+
// Subscribe to message events only after successful
|
|
18535
|
+
// auth and iframe setup
|
|
18536
|
+
this.subscribeToMessageEvents();
|
|
18295
18537
|
}).catch((error) => {
|
|
18296
18538
|
nextInQueue();
|
|
18297
18539
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_FAILED, {
|
|
@@ -18424,9 +18666,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18424
18666
|
// When start status is false it trigger only end releated
|
|
18425
18667
|
// payload
|
|
18426
18668
|
|| (!callbackObj.options.start && dataStatus === embedEventStatus.END)) {
|
|
18427
|
-
|
|
18428
|
-
|
|
18429
|
-
});
|
|
18669
|
+
const responder = this.createEmbedEventResponder(eventPort, eventType);
|
|
18670
|
+
callbackObj.callback(data, responder);
|
|
18430
18671
|
}
|
|
18431
18672
|
});
|
|
18432
18673
|
}
|
|
@@ -18611,6 +18852,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18611
18852
|
this.handleError('Host event type is undefined');
|
|
18612
18853
|
return null;
|
|
18613
18854
|
}
|
|
18855
|
+
// Check if iframe exists before triggering -
|
|
18856
|
+
// this prevents the error when auth fails
|
|
18857
|
+
if (!this.iFrame) {
|
|
18858
|
+
logger$3.debug(`Cannot trigger ${messageType} - iframe not available (likely due to auth failure)`);
|
|
18859
|
+
return null;
|
|
18860
|
+
}
|
|
18614
18861
|
// send an empty object, this is needed for liveboard default handlers
|
|
18615
18862
|
return this.hostEventClient.triggerHostEvent(messageType, data);
|
|
18616
18863
|
}
|
|
@@ -18743,7 +18990,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18743
18990
|
return this.preRender(true);
|
|
18744
18991
|
}
|
|
18745
18992
|
this.validatePreRenderViewConfig(this.viewConfig);
|
|
18993
|
+
logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
|
|
18994
|
+
this.executeAfterEmbedContainerLoaded(() => {
|
|
18995
|
+
this.trigger(exports.HostEvent.UpdateEmbedParams, this.getUpdateEmbedParamsObject());
|
|
18996
|
+
});
|
|
18746
18997
|
}
|
|
18998
|
+
this.beforePrerenderVisible();
|
|
18747
18999
|
if (this.el) {
|
|
18748
19000
|
this.syncPreRenderStyle();
|
|
18749
19001
|
if (!this.viewConfig.doNotTrackPreRenderSize) {
|
|
@@ -18760,7 +19012,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18760
19012
|
this.resizeObserver.observe(this.el);
|
|
18761
19013
|
}
|
|
18762
19014
|
}
|
|
18763
|
-
this.beforePrerenderVisible();
|
|
18764
19015
|
removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events']);
|
|
18765
19016
|
this.subscribeToEvents();
|
|
18766
19017
|
// Setup fullscreen change handler for prerendered components
|
|
@@ -19126,7 +19377,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19126
19377
|
* embedded Liveboard or visualization.
|
|
19127
19378
|
*/
|
|
19128
19379
|
getEmbedParams() {
|
|
19129
|
-
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = exports.DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, } = this.viewConfig;
|
|
19380
|
+
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = exports.DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isLinkParametersEnabled, } = this.viewConfig;
|
|
19130
19381
|
let params = {};
|
|
19131
19382
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
19132
19383
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -19179,7 +19430,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19179
19430
|
if (enableAskSage) {
|
|
19180
19431
|
params[Param.enableAskSage] = enableAskSage;
|
|
19181
19432
|
}
|
|
19182
|
-
|
|
19433
|
+
const { enableApiIntercept } = getInterceptInitData(this.embedConfig, this.viewConfig);
|
|
19434
|
+
if (isOnBeforeGetVizDataInterceptEnabled && !enableApiIntercept) {
|
|
19183
19435
|
params[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
19184
19436
|
}
|
|
19185
19437
|
if (homePageSearchBarMode) {
|
|
@@ -19194,6 +19446,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19194
19446
|
if (isPNGInScheduledEmailsEnabled !== undefined) {
|
|
19195
19447
|
params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
|
|
19196
19448
|
}
|
|
19449
|
+
if (isLinkParametersEnabled !== undefined) {
|
|
19450
|
+
params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
|
|
19451
|
+
}
|
|
19197
19452
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
19198
19453
|
params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
|
|
19199
19454
|
params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
|
|
@@ -19541,9 +19796,14 @@ query GetEurekaVizSnapshots(
|
|
|
19541
19796
|
* embedded Liveboard or visualization.
|
|
19542
19797
|
*/
|
|
19543
19798
|
getEmbedParams() {
|
|
19799
|
+
const params = this.getEmbedParamsObject();
|
|
19800
|
+
const queryParams = getQueryParamString(params, true);
|
|
19801
|
+
return queryParams;
|
|
19802
|
+
}
|
|
19803
|
+
getEmbedParamsObject() {
|
|
19544
19804
|
let params = {};
|
|
19545
19805
|
params = this.getBaseQueryParams(params);
|
|
19546
|
-
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, showSpotterLimitations, } = this.viewConfig;
|
|
19806
|
+
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, showSpotterLimitations, isLinkParametersEnabled, } = this.viewConfig;
|
|
19547
19807
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
19548
19808
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
19549
19809
|
if (fullHeight === true) {
|
|
@@ -19608,6 +19868,9 @@ query GetEurekaVizSnapshots(
|
|
|
19608
19868
|
if (showSpotterLimitations !== undefined) {
|
|
19609
19869
|
params[Param.ShowSpotterLimitations] = showSpotterLimitations;
|
|
19610
19870
|
}
|
|
19871
|
+
if (isLinkParametersEnabled !== undefined) {
|
|
19872
|
+
params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
|
|
19873
|
+
}
|
|
19611
19874
|
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
19612
19875
|
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
19613
19876
|
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
@@ -19617,8 +19880,8 @@ query GetEurekaVizSnapshots(
|
|
|
19617
19880
|
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
19618
19881
|
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
19619
19882
|
params[Param.LiveboardXLSXCSVDownload] = !!liveboardXLSXCSVDownload;
|
|
19620
|
-
|
|
19621
|
-
return
|
|
19883
|
+
getQueryParamString(params, true);
|
|
19884
|
+
return params;
|
|
19622
19885
|
}
|
|
19623
19886
|
getIframeSuffixSrc(liveboardId, vizId, activeTabId) {
|
|
19624
19887
|
let suffix = `/embed/viz/${liveboardId}`;
|
|
@@ -19860,11 +20123,9 @@ query GetEurekaVizSnapshots(
|
|
|
19860
20123
|
const defaultAppInitData = await super.getAppInitData();
|
|
19861
20124
|
return { ...defaultAppInitData, ...this.getSearchInitData() };
|
|
19862
20125
|
}
|
|
19863
|
-
|
|
20126
|
+
getEmbedParamsObject() {
|
|
19864
20127
|
var _a;
|
|
19865
|
-
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = true, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
|
|
19866
|
-
/* eslint-disable-next-line max-len */
|
|
19867
|
-
dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
|
|
20128
|
+
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = true, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
|
|
19868
20129
|
const queryParams = this.getBaseQueryParams();
|
|
19869
20130
|
queryParams[Param.HideActions] = [
|
|
19870
20131
|
...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
|
|
@@ -19896,8 +20157,8 @@ query GetEurekaVizSnapshots(
|
|
|
19896
20157
|
if (hideSearchBar) {
|
|
19897
20158
|
queryParams[Param.HideSearchBar] = true;
|
|
19898
20159
|
}
|
|
19899
|
-
|
|
19900
|
-
|
|
20160
|
+
const { enableApiIntercept } = getInterceptInitData(this.embedConfig, this.viewConfig);
|
|
20161
|
+
if (isOnBeforeGetVizDataInterceptEnabled && !enableApiIntercept) {
|
|
19901
20162
|
queryParams[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
19902
20163
|
}
|
|
19903
20164
|
if (!focusSearchBarOnRender) {
|
|
@@ -19910,20 +20171,22 @@ query GetEurekaVizSnapshots(
|
|
|
19910
20171
|
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
19911
20172
|
}
|
|
19912
20173
|
queryParams[Param.searchEmbed] = true;
|
|
19913
|
-
/* eslint-disable-next-line max-len */
|
|
19914
20174
|
queryParams[Param.CollapseSearchBarInitially] = collapseSearchBarInitially || collapseSearchBar;
|
|
19915
20175
|
queryParams[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
19916
20176
|
if (dataPanelCustomGroupsAccordionInitialState
|
|
19917
20177
|
=== DataPanelCustomColumnGroupsAccordionState.COLLAPSE_ALL
|
|
19918
20178
|
|| dataPanelCustomGroupsAccordionInitialState
|
|
19919
20179
|
=== DataPanelCustomColumnGroupsAccordionState.EXPAND_FIRST) {
|
|
19920
|
-
/* eslint-disable-next-line max-len */
|
|
19921
20180
|
queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
|
|
19922
20181
|
}
|
|
19923
20182
|
else {
|
|
19924
|
-
/* eslint-disable-next-line max-len */
|
|
19925
20183
|
queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
|
|
19926
20184
|
}
|
|
20185
|
+
return queryParams;
|
|
20186
|
+
}
|
|
20187
|
+
getEmbedParams() {
|
|
20188
|
+
const { runtimeParameters, runtimeFilters, excludeRuntimeParametersfromURL, excludeRuntimeFiltersfromURL, } = this.viewConfig;
|
|
20189
|
+
const queryParams = this.getEmbedParamsObject();
|
|
19927
20190
|
let query = '';
|
|
19928
20191
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
19929
20192
|
if (queryParamsString) {
|
|
@@ -19979,15 +20242,9 @@ query GetEurekaVizSnapshots(
|
|
|
19979
20242
|
this.embedComponentType = 'SearchBarEmbed';
|
|
19980
20243
|
this.viewConfig = viewConfig;
|
|
19981
20244
|
}
|
|
19982
|
-
|
|
19983
|
-
* Construct the URL of the embedded ThoughtSpot search to be
|
|
19984
|
-
* loaded in the iframe
|
|
19985
|
-
* @param dataSources A list of data source GUIDs
|
|
19986
|
-
*/
|
|
19987
|
-
getIFrameSrc() {
|
|
20245
|
+
getEmbedParamsObject() {
|
|
19988
20246
|
var _a;
|
|
19989
20247
|
const { searchOptions, dataSource, dataSources, useLastSelectedSources = false, excludeSearchTokenStringFromURL, } = this.viewConfig;
|
|
19990
|
-
const path = 'search-bar-embed';
|
|
19991
20248
|
const queryParams = this.getBaseQueryParams();
|
|
19992
20249
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
19993
20250
|
if (dataSources && dataSources.length) {
|
|
@@ -20009,6 +20266,16 @@ query GetEurekaVizSnapshots(
|
|
|
20009
20266
|
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
20010
20267
|
}
|
|
20011
20268
|
queryParams[Param.searchEmbed] = true;
|
|
20269
|
+
return queryParams;
|
|
20270
|
+
}
|
|
20271
|
+
/**
|
|
20272
|
+
* Construct the URL of the embedded ThoughtSpot search to be
|
|
20273
|
+
* loaded in the iframe
|
|
20274
|
+
* @param dataSources A list of data source GUIDs
|
|
20275
|
+
*/
|
|
20276
|
+
getIFrameSrc() {
|
|
20277
|
+
const queryParams = this.getEmbedParamsObject();
|
|
20278
|
+
const path = 'search-bar-embed';
|
|
20012
20279
|
let query = '';
|
|
20013
20280
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
20014
20281
|
if (queryParamsString) {
|
|
@@ -20431,13 +20698,17 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
20431
20698
|
super(container, viewConfig);
|
|
20432
20699
|
this.viewConfig = viewConfig;
|
|
20433
20700
|
}
|
|
20434
|
-
|
|
20701
|
+
getEmbedParamsObject() {
|
|
20435
20702
|
var _a;
|
|
20436
|
-
const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
|
|
20437
|
-
const path = 'conv-assist-answer';
|
|
20438
20703
|
const queryParams = this.getBaseQueryParams();
|
|
20439
20704
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
20440
20705
|
queryParams[Param.isSpotterAgentEmbed] = true;
|
|
20706
|
+
return queryParams;
|
|
20707
|
+
}
|
|
20708
|
+
getIframeSrc() {
|
|
20709
|
+
const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
|
|
20710
|
+
const path = 'conv-assist-answer';
|
|
20711
|
+
const queryParams = this.getEmbedParamsObject();
|
|
20441
20712
|
let query = '';
|
|
20442
20713
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
20443
20714
|
if (queryParamsString) {
|
|
@@ -20598,9 +20869,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
20598
20869
|
super(container, viewConfig);
|
|
20599
20870
|
this.viewConfig = viewConfig;
|
|
20600
20871
|
}
|
|
20601
|
-
|
|
20872
|
+
getEmbedParamsObject() {
|
|
20602
20873
|
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
20603
|
-
const path = 'insights/conv-assist';
|
|
20604
20874
|
if (!worksheetId) {
|
|
20605
20875
|
this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
|
|
20606
20876
|
}
|
|
@@ -20621,6 +20891,12 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
20621
20891
|
if (!isUndefined_1(hideSampleQuestions)) {
|
|
20622
20892
|
queryParams[Param.HideSampleQuestions] = !!hideSampleQuestions;
|
|
20623
20893
|
}
|
|
20894
|
+
return queryParams;
|
|
20895
|
+
}
|
|
20896
|
+
getIframeSrc() {
|
|
20897
|
+
const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
20898
|
+
const path = 'insights/conv-assist';
|
|
20899
|
+
const queryParams = this.getEmbedParamsObject();
|
|
20624
20900
|
let query = '';
|
|
20625
20901
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
20626
20902
|
if (queryParamsString) {
|
|
@@ -20692,12 +20968,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
20692
20968
|
viewConfig.embedComponentType = 'SageEmbed';
|
|
20693
20969
|
super(domSelector, viewConfig);
|
|
20694
20970
|
}
|
|
20695
|
-
|
|
20696
|
-
* Constructs a map of parameters to be passed on to the
|
|
20697
|
-
* embedded Eureka or Sage search page.
|
|
20698
|
-
* @returns {string} query string
|
|
20699
|
-
*/
|
|
20700
|
-
getEmbedParams() {
|
|
20971
|
+
getEmbedParamsObject() {
|
|
20701
20972
|
const { disableWorksheetChange, hideWorksheetSelector, showObjectSuggestions, dataPanelV2, hideSampleQuestions, isProductTour, hideSageAnswerHeader, hideAutocompleteSuggestions, } = this.viewConfig;
|
|
20702
20973
|
const params = this.getBaseQueryParams();
|
|
20703
20974
|
params[Param.DataPanelV2Enabled] = !!dataPanelV2;
|
|
@@ -20712,6 +20983,15 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
20712
20983
|
params[Param.HideSampleQuestions] = !!hideSampleQuestions;
|
|
20713
20984
|
params[Param.IsProductTour] = !!isProductTour;
|
|
20714
20985
|
params[Param.HideSageAnswerHeader] = !!hideSageAnswerHeader;
|
|
20986
|
+
return params;
|
|
20987
|
+
}
|
|
20988
|
+
/**
|
|
20989
|
+
* Constructs a map of parameters to be passed on to the
|
|
20990
|
+
* embedded Eureka or Sage search page.
|
|
20991
|
+
* @returns {string} query string
|
|
20992
|
+
*/
|
|
20993
|
+
getEmbedParams() {
|
|
20994
|
+
const params = this.getEmbedParamsObject();
|
|
20715
20995
|
return getQueryParamString(params, true);
|
|
20716
20996
|
}
|
|
20717
20997
|
/**
|