@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-react.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, require('react')) :
|
|
@@ -1719,6 +1719,21 @@
|
|
|
1719
1719
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1720
1720
|
*/
|
|
1721
1721
|
EmbedEvent["OrgSwitched"] = "orgSwitched";
|
|
1722
|
+
/**
|
|
1723
|
+
* Emitted when the user intercepts a URL.
|
|
1724
|
+
*
|
|
1725
|
+
* Supported on all embed types.
|
|
1726
|
+
*
|
|
1727
|
+
* @example
|
|
1728
|
+
* ```js
|
|
1729
|
+
* embed.on(EmbedEvent.ApiIntercept, (payload) => {
|
|
1730
|
+
* console.log('payload', payload);
|
|
1731
|
+
* })
|
|
1732
|
+
* ```
|
|
1733
|
+
*
|
|
1734
|
+
* @version SDK: 1.42.0 | ThoughtSpot: 10.14.0.cl
|
|
1735
|
+
*/
|
|
1736
|
+
EmbedEvent["ApiIntercept"] = "ApiIntercept";
|
|
1722
1737
|
})(exports.EmbedEvent || (exports.EmbedEvent = {}));
|
|
1723
1738
|
/**
|
|
1724
1739
|
* Event types that can be triggered by the host application
|
|
@@ -2484,21 +2499,42 @@
|
|
|
2484
2499
|
*/
|
|
2485
2500
|
HostEvent["Share"] = "share";
|
|
2486
2501
|
/**
|
|
2487
|
-
* Trigger the **Save**
|
|
2502
|
+
* Trigger the **Save** action on a Liveboard, Answer, or Spotter.
|
|
2488
2503
|
* Saves the changes.
|
|
2489
|
-
*
|
|
2504
|
+
*
|
|
2505
|
+
* @param - `vizId` refers to the Spotter Visualization Id used in Spotter embed.
|
|
2506
|
+
* It is required and can be retrieved from the data embed event.
|
|
2507
|
+
*
|
|
2490
2508
|
* @example
|
|
2491
2509
|
* ```js
|
|
2510
|
+
* // Save changes in a Liveboard
|
|
2492
2511
|
* liveboardEmbed.trigger(HostEvent.Save)
|
|
2493
2512
|
* ```
|
|
2513
|
+
*
|
|
2494
2514
|
* ```js
|
|
2515
|
+
* // Save the current Answer in Search embed
|
|
2495
2516
|
* searchEmbed.trigger(HostEvent.Save)
|
|
2496
2517
|
* ```
|
|
2518
|
+
*
|
|
2497
2519
|
* ```js
|
|
2520
|
+
* // Save an Answer in Spotter (requires vizId)
|
|
2498
2521
|
* spotterEmbed.trigger(HostEvent.Save, {
|
|
2499
|
-
*
|
|
2522
|
+
* vizId: "730496d6-6903-4601-937e-2c691821af3c"
|
|
2500
2523
|
* })
|
|
2501
2524
|
* ```
|
|
2525
|
+
*
|
|
2526
|
+
* ```js
|
|
2527
|
+
* // How to get the vizId in Spotter?
|
|
2528
|
+
*
|
|
2529
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId.
|
|
2530
|
+
* let latestSpotterVizId = '';
|
|
2531
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2532
|
+
* latestSpotterVizId = payload.data.id;
|
|
2533
|
+
* });
|
|
2534
|
+
*
|
|
2535
|
+
* spotterEmbed.trigger(HostEvent.Save, { vizId: latestSpotterVizId });
|
|
2536
|
+
* ```
|
|
2537
|
+
*
|
|
2502
2538
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2503
2539
|
*/
|
|
2504
2540
|
HostEvent["Save"] = "save";
|
|
@@ -2982,6 +3018,16 @@
|
|
|
2982
3018
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
2983
3019
|
*/
|
|
2984
3020
|
HostEvent["AskSpotter"] = "AskSpotter";
|
|
3021
|
+
/**
|
|
3022
|
+
* @hidden
|
|
3023
|
+
* Triggers the update of the embed params.
|
|
3024
|
+
*
|
|
3025
|
+
* @example
|
|
3026
|
+
* ```js
|
|
3027
|
+
* liveboardEmbed.trigger(HostEvent.UpdateEmbedParams, viewConfig);
|
|
3028
|
+
* ```
|
|
3029
|
+
*/
|
|
3030
|
+
HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
|
|
2985
3031
|
})(exports.HostEvent || (exports.HostEvent = {}));
|
|
2986
3032
|
/**
|
|
2987
3033
|
* The different visual modes that the data sources panel within
|
|
@@ -3129,6 +3175,7 @@
|
|
|
3129
3175
|
Param["RootMarginForLazyLoad"] = "rootMarginForLazyLoad";
|
|
3130
3176
|
Param["LiveboardXLSXCSVDownload"] = "isLiveboardXLSXCSVDownloadEnabled";
|
|
3131
3177
|
Param["isPNGInScheduledEmailsEnabled"] = "isPNGInScheduledEmailsEnabled";
|
|
3178
|
+
Param["isLinkParametersEnabled"] = "isLinkParametersEnabled";
|
|
3132
3179
|
})(Param || (Param = {}));
|
|
3133
3180
|
/**
|
|
3134
3181
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -4554,7 +4601,29 @@
|
|
|
4554
4601
|
* @version SDK: 1.26.7 | ThoughtSpot Cloud: 9.10.0.cl
|
|
4555
4602
|
*/
|
|
4556
4603
|
LogLevel["TRACE"] = "TRACE";
|
|
4557
|
-
})(exports.LogLevel || (exports.LogLevel = {}));
|
|
4604
|
+
})(exports.LogLevel || (exports.LogLevel = {}));
|
|
4605
|
+
/**
|
|
4606
|
+
* Enum for the type of API intercepted
|
|
4607
|
+
*/
|
|
4608
|
+
var InterceptedApiType;
|
|
4609
|
+
(function (InterceptedApiType) {
|
|
4610
|
+
/**
|
|
4611
|
+
* The apis that are use to get the metadata for the embed
|
|
4612
|
+
*/
|
|
4613
|
+
InterceptedApiType["METADATA"] = "METADATA";
|
|
4614
|
+
/**
|
|
4615
|
+
* The apis that are use to get the data for the embed
|
|
4616
|
+
*/
|
|
4617
|
+
InterceptedApiType["ANSWER_DATA"] = "ANSWER_DATA";
|
|
4618
|
+
/**
|
|
4619
|
+
* This will intercept all the apis
|
|
4620
|
+
*/
|
|
4621
|
+
InterceptedApiType["ALL"] = "ALL";
|
|
4622
|
+
/**
|
|
4623
|
+
* The apis that are use to get the data for the liveboard
|
|
4624
|
+
*/
|
|
4625
|
+
InterceptedApiType["LIVEBOARD_DATA"] = "LIVEBOARD_DATA";
|
|
4626
|
+
})(InterceptedApiType || (InterceptedApiType = {}));
|
|
4558
4627
|
|
|
4559
4628
|
const logFunctions = {
|
|
4560
4629
|
[exports.LogLevel.SILENT]: () => undefined,
|
|
@@ -7317,6 +7386,17 @@
|
|
|
7317
7386
|
|
|
7318
7387
|
var isEmpty_1 = isEmpty$1;
|
|
7319
7388
|
|
|
7389
|
+
var UIPassthroughEvent;
|
|
7390
|
+
(function (UIPassthroughEvent) {
|
|
7391
|
+
UIPassthroughEvent["PinAnswerToLiveboard"] = "addVizToPinboard";
|
|
7392
|
+
UIPassthroughEvent["SaveAnswer"] = "saveAnswer";
|
|
7393
|
+
UIPassthroughEvent["GetDiscoverabilityStatus"] = "getDiscoverabilityStatus";
|
|
7394
|
+
UIPassthroughEvent["GetAvailableUIPassthroughs"] = "getAvailableUiPassthroughs";
|
|
7395
|
+
UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
|
|
7396
|
+
UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
|
|
7397
|
+
UIPassthroughEvent["GetUnsavedAnswerTML"] = "getUnsavedAnswerTML";
|
|
7398
|
+
})(UIPassthroughEvent || (UIPassthroughEvent = {}));
|
|
7399
|
+
|
|
7320
7400
|
const ERROR_MESSAGE = {
|
|
7321
7401
|
INVALID_THOUGHTSPOT_HOST: 'Error parsing ThoughtSpot host. Please provide a valid URL.',
|
|
7322
7402
|
SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND: 'Please select a worksheet to get started',
|
|
@@ -7338,6 +7418,7 @@
|
|
|
7338
7418
|
MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
|
|
7339
7419
|
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',
|
|
7340
7420
|
SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
|
|
7421
|
+
OFFLINE_WARNING: 'Network not Detected. Embed is offline. Please reconnect and refresh',
|
|
7341
7422
|
};
|
|
7342
7423
|
const CUSTOM_ACTIONS_ERROR_MESSAGE = {
|
|
7343
7424
|
INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
|
|
@@ -17400,27 +17481,27 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17400
17481
|
* @param thoughtSpotHost
|
|
17401
17482
|
* @param containerEl
|
|
17402
17483
|
*/
|
|
17403
|
-
function processEventData(type,
|
|
17484
|
+
function processEventData(type, eventData, thoughtSpotHost, containerEl) {
|
|
17404
17485
|
switch (type) {
|
|
17405
17486
|
case exports.EmbedEvent.CustomAction:
|
|
17406
|
-
return processCustomAction(
|
|
17487
|
+
return processCustomAction(eventData, thoughtSpotHost);
|
|
17407
17488
|
case exports.EmbedEvent.AuthInit:
|
|
17408
|
-
return processAuthInit(
|
|
17489
|
+
return processAuthInit(eventData);
|
|
17409
17490
|
case exports.EmbedEvent.NoCookieAccess:
|
|
17410
|
-
return processNoCookieAccess(
|
|
17491
|
+
return processNoCookieAccess(eventData, containerEl);
|
|
17411
17492
|
case exports.EmbedEvent.AuthFailure:
|
|
17412
|
-
return processAuthFailure(
|
|
17493
|
+
return processAuthFailure(eventData, containerEl);
|
|
17413
17494
|
case exports.EmbedEvent.AuthLogout:
|
|
17414
|
-
return processAuthLogout(
|
|
17495
|
+
return processAuthLogout(eventData, containerEl);
|
|
17415
17496
|
case exports.EmbedEvent.ExitPresentMode:
|
|
17416
17497
|
return processExitPresentMode();
|
|
17417
17498
|
case exports.EmbedEvent.CLEAR_INFO_CACHE:
|
|
17418
17499
|
return processClearInfoCache();
|
|
17419
17500
|
}
|
|
17420
|
-
return
|
|
17501
|
+
return eventData;
|
|
17421
17502
|
}
|
|
17422
17503
|
|
|
17423
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.
|
|
17504
|
+
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};
|
|
17424
17505
|
|
|
17425
17506
|
/**
|
|
17426
17507
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -17492,16 +17573,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17492
17573
|
});
|
|
17493
17574
|
}
|
|
17494
17575
|
|
|
17495
|
-
var UIPassthroughEvent;
|
|
17496
|
-
(function (UIPassthroughEvent) {
|
|
17497
|
-
UIPassthroughEvent["PinAnswerToLiveboard"] = "addVizToPinboard";
|
|
17498
|
-
UIPassthroughEvent["SaveAnswer"] = "saveAnswer";
|
|
17499
|
-
UIPassthroughEvent["GetDiscoverabilityStatus"] = "getDiscoverabilityStatus";
|
|
17500
|
-
UIPassthroughEvent["GetAvailableUIPassthroughs"] = "getAvailableUiPassthroughs";
|
|
17501
|
-
UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
|
|
17502
|
-
UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
|
|
17503
|
-
})(UIPassthroughEvent || (UIPassthroughEvent = {}));
|
|
17504
|
-
|
|
17505
17576
|
class HostEventClient {
|
|
17506
17577
|
constructor(iFrame) {
|
|
17507
17578
|
this.iFrame = iFrame;
|
|
@@ -17593,6 +17664,107 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17593
17664
|
}
|
|
17594
17665
|
}
|
|
17595
17666
|
|
|
17667
|
+
const defaultUrls = {
|
|
17668
|
+
[InterceptedApiType.METADATA]: [
|
|
17669
|
+
'/prism/?op=CreateAnswerSession',
|
|
17670
|
+
'/prism/?op=GetV2SourceDetail',
|
|
17671
|
+
],
|
|
17672
|
+
[InterceptedApiType.ANSWER_DATA]: [
|
|
17673
|
+
'/prism/?op=GetChartWithData',
|
|
17674
|
+
'/prism/?op=GetTableWithHeadlineData',
|
|
17675
|
+
],
|
|
17676
|
+
[InterceptedApiType.LIVEBOARD_DATA]: [
|
|
17677
|
+
'/prism/?op=LoadContextBook'
|
|
17678
|
+
],
|
|
17679
|
+
};
|
|
17680
|
+
const formatInterceptUrl = (url) => {
|
|
17681
|
+
const host = getThoughtSpotHost(getEmbedConfig());
|
|
17682
|
+
if (url.startsWith('/'))
|
|
17683
|
+
return `${host}${url}`;
|
|
17684
|
+
return url;
|
|
17685
|
+
};
|
|
17686
|
+
const processInterceptUrls = (interceptUrls) => {
|
|
17687
|
+
let processedUrls = [...interceptUrls];
|
|
17688
|
+
Object.entries(defaultUrls).forEach(([apiType, apiTypeUrls]) => {
|
|
17689
|
+
if (!processedUrls.includes(apiType))
|
|
17690
|
+
return;
|
|
17691
|
+
processedUrls = processedUrls.filter(url => url !== apiType);
|
|
17692
|
+
processedUrls = [...processedUrls, ...apiTypeUrls];
|
|
17693
|
+
});
|
|
17694
|
+
return processedUrls.map(url => formatInterceptUrl(url));
|
|
17695
|
+
};
|
|
17696
|
+
const getInterceptInitData = (embedConfig, viewConfig) => {
|
|
17697
|
+
const enableApiIntercept = (embedConfig.enableApiIntercept || viewConfig.enableApiIntercept) && (viewConfig.enableApiIntercept !== false);
|
|
17698
|
+
if (!enableApiIntercept)
|
|
17699
|
+
return {
|
|
17700
|
+
enableApiIntercept: false,
|
|
17701
|
+
};
|
|
17702
|
+
const combinedUrls = [...(embedConfig.interceptUrls || []), ...(viewConfig.interceptUrls || [])];
|
|
17703
|
+
if (viewConfig.isOnBeforeGetVizDataInterceptEnabled) {
|
|
17704
|
+
combinedUrls.push(InterceptedApiType.ANSWER_DATA);
|
|
17705
|
+
}
|
|
17706
|
+
const shouldInterceptAll = combinedUrls.includes(InterceptedApiType.ALL);
|
|
17707
|
+
const interceptUrls = shouldInterceptAll ? [InterceptedApiType.ALL] : processInterceptUrls(combinedUrls);
|
|
17708
|
+
const interceptTimeout = embedConfig.interceptTimeout || viewConfig.interceptTimeout;
|
|
17709
|
+
return {
|
|
17710
|
+
interceptUrls,
|
|
17711
|
+
interceptTimeout,
|
|
17712
|
+
enableApiIntercept,
|
|
17713
|
+
};
|
|
17714
|
+
};
|
|
17715
|
+
/**
|
|
17716
|
+
*
|
|
17717
|
+
* @param fetchInit
|
|
17718
|
+
*/
|
|
17719
|
+
const parseInterceptData = (eventDataString) => {
|
|
17720
|
+
try {
|
|
17721
|
+
const { input, init } = JSON.parse(eventDataString);
|
|
17722
|
+
init.body = JSON.parse(init.body);
|
|
17723
|
+
const parsedInit = { input, init };
|
|
17724
|
+
return [parsedInit, null];
|
|
17725
|
+
}
|
|
17726
|
+
catch (error) {
|
|
17727
|
+
return [null, error];
|
|
17728
|
+
}
|
|
17729
|
+
};
|
|
17730
|
+
const handleInterceptEvent = async (params) => {
|
|
17731
|
+
var _a, _b, _c, _d, _e;
|
|
17732
|
+
const { eventData, executeEvent, viewConfig, getUnsavedAnswerTml } = params;
|
|
17733
|
+
const [interceptData, bodyParseError] = parseInterceptData(eventData.data);
|
|
17734
|
+
if (bodyParseError) {
|
|
17735
|
+
executeEvent(exports.EmbedEvent.Error, {
|
|
17736
|
+
error: 'Error parsing api intercept body',
|
|
17737
|
+
});
|
|
17738
|
+
logger$3.error('Error parsing request body', bodyParseError);
|
|
17739
|
+
return;
|
|
17740
|
+
}
|
|
17741
|
+
const { input: requestUrl, init } = interceptData;
|
|
17742
|
+
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;
|
|
17743
|
+
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;
|
|
17744
|
+
if (defaultUrls.ANSWER_DATA.includes(requestUrl) && viewConfig.isOnBeforeGetVizDataInterceptEnabled) {
|
|
17745
|
+
const answerTml = await getUnsavedAnswerTml({ sessionId, vizId });
|
|
17746
|
+
executeEvent(exports.EmbedEvent.OnBeforeGetVizDataIntercept, { data: { data: answerTml } });
|
|
17747
|
+
}
|
|
17748
|
+
executeEvent(exports.EmbedEvent.ApiIntercept, interceptData);
|
|
17749
|
+
};
|
|
17750
|
+
const processLegacyInterceptResponse = (payload) => {
|
|
17751
|
+
var _a, _b;
|
|
17752
|
+
const title = (_a = payload === null || payload === void 0 ? void 0 : payload.data) === null || _a === void 0 ? void 0 : _a.errorText;
|
|
17753
|
+
const desc = (_b = payload === null || payload === void 0 ? void 0 : payload.data) === null || _b === void 0 ? void 0 : _b.errorDescription;
|
|
17754
|
+
const payloadToSend = [{
|
|
17755
|
+
data: {},
|
|
17756
|
+
errors: [
|
|
17757
|
+
{
|
|
17758
|
+
errorObj: {
|
|
17759
|
+
title,
|
|
17760
|
+
desc
|
|
17761
|
+
}
|
|
17762
|
+
}
|
|
17763
|
+
],
|
|
17764
|
+
}];
|
|
17765
|
+
return payloadToSend;
|
|
17766
|
+
};
|
|
17767
|
+
|
|
17596
17768
|
/**
|
|
17597
17769
|
* Copyright (c) 2022
|
|
17598
17770
|
*
|
|
@@ -17646,6 +17818,27 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17646
17818
|
*/
|
|
17647
17819
|
this.fullscreenChangeHandler = null;
|
|
17648
17820
|
this.subscribedListeners = {};
|
|
17821
|
+
this.messageEventListener = async (event) => {
|
|
17822
|
+
const eventType = this.getEventType(event);
|
|
17823
|
+
const eventPort = this.getEventPort(event);
|
|
17824
|
+
const eventData = this.formatEventData(event, eventType);
|
|
17825
|
+
if (event.source === this.iFrame.contentWindow) {
|
|
17826
|
+
const processedEventData = await processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.el);
|
|
17827
|
+
const executeEvent = (_eventType, data) => {
|
|
17828
|
+
this.executeCallbacks(_eventType, data, eventPort);
|
|
17829
|
+
};
|
|
17830
|
+
if (eventType === exports.EmbedEvent.ApiIntercept && this.viewConfig.enableApiIntercept) {
|
|
17831
|
+
const getUnsavedAnswerTml = async (props) => {
|
|
17832
|
+
var _a;
|
|
17833
|
+
const response = await this.triggerUIPassThrough(UIPassthroughEvent.GetUnsavedAnswerTML, props);
|
|
17834
|
+
return (_a = response[0]) === null || _a === void 0 ? void 0 : _a.value;
|
|
17835
|
+
};
|
|
17836
|
+
handleInterceptEvent({ eventData: processedEventData, executeEvent, embedConfig: this.embedConfig, viewConfig: this.viewConfig, getUnsavedAnswerTml });
|
|
17837
|
+
return;
|
|
17838
|
+
}
|
|
17839
|
+
this.executeCallbacks(eventType, processedEventData, eventPort);
|
|
17840
|
+
}
|
|
17841
|
+
};
|
|
17649
17842
|
/**
|
|
17650
17843
|
* Send Custom style as part of payload of APP_INIT
|
|
17651
17844
|
* @param _
|
|
@@ -17730,11 +17923,23 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17730
17923
|
this.on(exports.EmbedEvent.AuthInit, authInitHandler, { start: false }, true);
|
|
17731
17924
|
};
|
|
17732
17925
|
this.showPreRenderByDefault = false;
|
|
17926
|
+
this.createEmbedEventResponder = (eventPort, eventType) => {
|
|
17927
|
+
const { enableApiIntercept } = getInterceptInitData(this.embedConfig, this.viewConfig);
|
|
17928
|
+
if (eventType === exports.EmbedEvent.OnBeforeGetVizDataIntercept && enableApiIntercept) {
|
|
17929
|
+
return (payload) => {
|
|
17930
|
+
const payloadToSend = processLegacyInterceptResponse(payload);
|
|
17931
|
+
this.triggerEventOnPort(eventPort, payloadToSend);
|
|
17932
|
+
};
|
|
17933
|
+
}
|
|
17934
|
+
return (payload) => {
|
|
17935
|
+
this.triggerEventOnPort(eventPort, payload);
|
|
17936
|
+
};
|
|
17937
|
+
};
|
|
17733
17938
|
/**
|
|
17734
|
-
|
|
17735
|
-
|
|
17736
|
-
|
|
17737
|
-
|
|
17939
|
+
* @hidden
|
|
17940
|
+
* Internal state to track if the embed container is loaded.
|
|
17941
|
+
* This is used to trigger events after the embed container is loaded.
|
|
17942
|
+
*/
|
|
17738
17943
|
this.isEmbedContainerLoaded = false;
|
|
17739
17944
|
/**
|
|
17740
17945
|
* @hidden
|
|
@@ -17793,10 +17998,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17793
17998
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
|
|
17794
17999
|
...viewConfig,
|
|
17795
18000
|
});
|
|
18001
|
+
const embedConfig = getEmbedConfig();
|
|
18002
|
+
this.embedConfig = embedConfig;
|
|
17796
18003
|
this.hostEventClient = new HostEventClient(this.iFrame);
|
|
17797
18004
|
this.isReadyForRenderPromise = getInitPromise().then(async () => {
|
|
17798
|
-
const embedConfig = getEmbedConfig();
|
|
17799
|
-
this.embedConfig = embedConfig;
|
|
17800
18005
|
if (!embedConfig.authTriggerContainer && !embedConfig.useEventForSAMLPopup) {
|
|
17801
18006
|
this.embedConfig.authTriggerContainer = domSelector;
|
|
17802
18007
|
}
|
|
@@ -17890,39 +18095,61 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17890
18095
|
return eventData;
|
|
17891
18096
|
}
|
|
17892
18097
|
/**
|
|
17893
|
-
*
|
|
17894
|
-
*
|
|
17895
|
-
* embed instance through an identifier contained in the payload,
|
|
17896
|
-
* and executes the registered callbacks accordingly.
|
|
18098
|
+
* Subscribe to network events (online/offline) that should
|
|
18099
|
+
* work regardless of auth status
|
|
17897
18100
|
*/
|
|
17898
|
-
|
|
17899
|
-
this.
|
|
17900
|
-
const messageEventListener = (event) => {
|
|
17901
|
-
const eventType = this.getEventType(event);
|
|
17902
|
-
const eventPort = this.getEventPort(event);
|
|
17903
|
-
const eventData = this.formatEventData(event, eventType);
|
|
17904
|
-
if (event.source === this.iFrame.contentWindow) {
|
|
17905
|
-
this.executeCallbacks(eventType, processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.el), eventPort);
|
|
17906
|
-
}
|
|
17907
|
-
};
|
|
17908
|
-
window.addEventListener('message', messageEventListener);
|
|
18101
|
+
subscribeToNetworkEvents() {
|
|
18102
|
+
this.unsubscribeToNetworkEvents();
|
|
17909
18103
|
const onlineEventListener = (e) => {
|
|
17910
18104
|
this.trigger(exports.HostEvent.Reload);
|
|
17911
18105
|
};
|
|
17912
18106
|
window.addEventListener('online', onlineEventListener);
|
|
17913
18107
|
const offlineEventListener = (e) => {
|
|
17914
|
-
const offlineWarning =
|
|
18108
|
+
const offlineWarning = ERROR_MESSAGE.OFFLINE_WARNING;
|
|
17915
18109
|
this.executeCallbacks(exports.EmbedEvent.Error, {
|
|
17916
18110
|
offlineWarning,
|
|
17917
18111
|
});
|
|
17918
18112
|
logger$3.warn(offlineWarning);
|
|
17919
18113
|
};
|
|
17920
18114
|
window.addEventListener('offline', offlineEventListener);
|
|
17921
|
-
this.subscribedListeners =
|
|
17922
|
-
|
|
17923
|
-
|
|
17924
|
-
|
|
17925
|
-
|
|
18115
|
+
this.subscribedListeners.online = onlineEventListener;
|
|
18116
|
+
this.subscribedListeners.offline = offlineEventListener;
|
|
18117
|
+
}
|
|
18118
|
+
/**
|
|
18119
|
+
* Subscribe to message events that depend on successful iframe setup
|
|
18120
|
+
*/
|
|
18121
|
+
subscribeToMessageEvents() {
|
|
18122
|
+
this.unsubscribeToMessageEvents();
|
|
18123
|
+
window.addEventListener('message', this.messageEventListener);
|
|
18124
|
+
this.subscribedListeners.message = this.messageEventListener;
|
|
18125
|
+
}
|
|
18126
|
+
/**
|
|
18127
|
+
* Adds event listeners for both network and message events.
|
|
18128
|
+
* This maintains backward compatibility with the existing method.
|
|
18129
|
+
* Adds a global event listener to window for "message" events.
|
|
18130
|
+
* ThoughtSpot detects if a particular event is targeted to this
|
|
18131
|
+
* embed instance through an identifier contained in the payload,
|
|
18132
|
+
* and executes the registered callbacks accordingly.
|
|
18133
|
+
*/
|
|
18134
|
+
subscribeToEvents() {
|
|
18135
|
+
this.subscribeToNetworkEvents();
|
|
18136
|
+
this.subscribeToMessageEvents();
|
|
18137
|
+
}
|
|
18138
|
+
unsubscribeToNetworkEvents() {
|
|
18139
|
+
if (this.subscribedListeners.online) {
|
|
18140
|
+
window.removeEventListener('online', this.subscribedListeners.online);
|
|
18141
|
+
delete this.subscribedListeners.online;
|
|
18142
|
+
}
|
|
18143
|
+
if (this.subscribedListeners.offline) {
|
|
18144
|
+
window.removeEventListener('offline', this.subscribedListeners.offline);
|
|
18145
|
+
delete this.subscribedListeners.offline;
|
|
18146
|
+
}
|
|
18147
|
+
}
|
|
18148
|
+
unsubscribeToMessageEvents() {
|
|
18149
|
+
if (this.subscribedListeners.message) {
|
|
18150
|
+
window.removeEventListener('message', this.subscribedListeners.message);
|
|
18151
|
+
delete this.subscribedListeners.message;
|
|
18152
|
+
}
|
|
17926
18153
|
}
|
|
17927
18154
|
unsubscribeToEvents() {
|
|
17928
18155
|
Object.keys(this.subscribedListeners).forEach((key) => {
|
|
@@ -17955,7 +18182,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17955
18182
|
message: customActionsResult.errors,
|
|
17956
18183
|
});
|
|
17957
18184
|
}
|
|
17958
|
-
|
|
18185
|
+
const baseInitData = {
|
|
17959
18186
|
customisations: getCustomisations(this.embedConfig, this.viewConfig),
|
|
17960
18187
|
authToken,
|
|
17961
18188
|
runtimeFilterParams: this.viewConfig.excludeRuntimeFiltersfromURL
|
|
@@ -17973,7 +18200,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17973
18200
|
customVariablesForThirdPartyTools: this.embedConfig.customVariablesForThirdPartyTools || {},
|
|
17974
18201
|
hiddenListColumns: this.viewConfig.hiddenListColumns || [],
|
|
17975
18202
|
customActions: customActionsResult.actions,
|
|
18203
|
+
...getInterceptInitData(this.embedConfig, this.viewConfig),
|
|
17976
18204
|
};
|
|
18205
|
+
return baseInitData;
|
|
17977
18206
|
}
|
|
17978
18207
|
async getAppInitData() {
|
|
17979
18208
|
return this.getDefaultAppInitData();
|
|
@@ -17992,6 +18221,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17992
18221
|
.join('/');
|
|
17993
18222
|
return `${basePath}#`;
|
|
17994
18223
|
}
|
|
18224
|
+
getUpdateEmbedParamsObject() {
|
|
18225
|
+
let queryParams = this.getEmbedParamsObject();
|
|
18226
|
+
queryParams = { ...this.viewConfig, ...queryParams };
|
|
18227
|
+
return queryParams;
|
|
18228
|
+
}
|
|
17995
18229
|
/**
|
|
17996
18230
|
* Common query params set for all the embed modes.
|
|
17997
18231
|
* @param queryParams
|
|
@@ -18141,9 +18375,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18141
18375
|
return path;
|
|
18142
18376
|
}
|
|
18143
18377
|
getEmbedParams() {
|
|
18144
|
-
const queryParams = this.
|
|
18378
|
+
const queryParams = this.getEmbedParamsObject();
|
|
18145
18379
|
return getQueryParamString(queryParams);
|
|
18146
18380
|
}
|
|
18381
|
+
getEmbedParamsObject() {
|
|
18382
|
+
const params = this.getBaseQueryParams();
|
|
18383
|
+
return params;
|
|
18384
|
+
}
|
|
18147
18385
|
getRootIframeSrc() {
|
|
18148
18386
|
const query = this.getEmbedParams();
|
|
18149
18387
|
return this.getEmbedBasePath(query);
|
|
@@ -18214,6 +18452,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18214
18452
|
type: exports.EmbedEvent.Init,
|
|
18215
18453
|
});
|
|
18216
18454
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_START);
|
|
18455
|
+
// Always subscribe to network events, regardless of auth status
|
|
18456
|
+
this.subscribeToNetworkEvents();
|
|
18217
18457
|
return (_a = getAuthPromise()) === null || _a === void 0 ? void 0 : _a.then((isLoggedIn) => {
|
|
18218
18458
|
if (!isLoggedIn) {
|
|
18219
18459
|
this.handleInsertionIntoDOM(this.embedConfig.loginFailedMessage);
|
|
@@ -18256,7 +18496,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18256
18496
|
el.remove();
|
|
18257
18497
|
});
|
|
18258
18498
|
}
|
|
18259
|
-
|
|
18499
|
+
// Subscribe to message events only after successful
|
|
18500
|
+
// auth and iframe setup
|
|
18501
|
+
this.subscribeToMessageEvents();
|
|
18260
18502
|
}).catch((error) => {
|
|
18261
18503
|
nextInQueue();
|
|
18262
18504
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_FAILED, {
|
|
@@ -18389,9 +18631,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18389
18631
|
// When start status is false it trigger only end releated
|
|
18390
18632
|
// payload
|
|
18391
18633
|
|| (!callbackObj.options.start && dataStatus === embedEventStatus.END)) {
|
|
18392
|
-
|
|
18393
|
-
|
|
18394
|
-
});
|
|
18634
|
+
const responder = this.createEmbedEventResponder(eventPort, eventType);
|
|
18635
|
+
callbackObj.callback(data, responder);
|
|
18395
18636
|
}
|
|
18396
18637
|
});
|
|
18397
18638
|
}
|
|
@@ -18576,6 +18817,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18576
18817
|
this.handleError('Host event type is undefined');
|
|
18577
18818
|
return null;
|
|
18578
18819
|
}
|
|
18820
|
+
// Check if iframe exists before triggering -
|
|
18821
|
+
// this prevents the error when auth fails
|
|
18822
|
+
if (!this.iFrame) {
|
|
18823
|
+
logger$3.debug(`Cannot trigger ${messageType} - iframe not available (likely due to auth failure)`);
|
|
18824
|
+
return null;
|
|
18825
|
+
}
|
|
18579
18826
|
// send an empty object, this is needed for liveboard default handlers
|
|
18580
18827
|
return this.hostEventClient.triggerHostEvent(messageType, data);
|
|
18581
18828
|
}
|
|
@@ -18708,7 +18955,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18708
18955
|
return this.preRender(true);
|
|
18709
18956
|
}
|
|
18710
18957
|
this.validatePreRenderViewConfig(this.viewConfig);
|
|
18958
|
+
logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
|
|
18959
|
+
this.executeAfterEmbedContainerLoaded(() => {
|
|
18960
|
+
this.trigger(exports.HostEvent.UpdateEmbedParams, this.getUpdateEmbedParamsObject());
|
|
18961
|
+
});
|
|
18711
18962
|
}
|
|
18963
|
+
this.beforePrerenderVisible();
|
|
18712
18964
|
if (this.el) {
|
|
18713
18965
|
this.syncPreRenderStyle();
|
|
18714
18966
|
if (!this.viewConfig.doNotTrackPreRenderSize) {
|
|
@@ -18725,7 +18977,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18725
18977
|
this.resizeObserver.observe(this.el);
|
|
18726
18978
|
}
|
|
18727
18979
|
}
|
|
18728
|
-
this.beforePrerenderVisible();
|
|
18729
18980
|
removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events']);
|
|
18730
18981
|
this.subscribeToEvents();
|
|
18731
18982
|
// Setup fullscreen change handler for prerendered components
|
|
@@ -18914,15 +19165,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18914
19165
|
this.embedComponentType = 'SearchBarEmbed';
|
|
18915
19166
|
this.viewConfig = viewConfig;
|
|
18916
19167
|
}
|
|
18917
|
-
|
|
18918
|
-
* Construct the URL of the embedded ThoughtSpot search to be
|
|
18919
|
-
* loaded in the iframe
|
|
18920
|
-
* @param dataSources A list of data source GUIDs
|
|
18921
|
-
*/
|
|
18922
|
-
getIFrameSrc() {
|
|
19168
|
+
getEmbedParamsObject() {
|
|
18923
19169
|
var _a;
|
|
18924
19170
|
const { searchOptions, dataSource, dataSources, useLastSelectedSources = false, excludeSearchTokenStringFromURL, } = this.viewConfig;
|
|
18925
|
-
const path = 'search-bar-embed';
|
|
18926
19171
|
const queryParams = this.getBaseQueryParams();
|
|
18927
19172
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
18928
19173
|
if (dataSources && dataSources.length) {
|
|
@@ -18944,6 +19189,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18944
19189
|
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
18945
19190
|
}
|
|
18946
19191
|
queryParams[Param.searchEmbed] = true;
|
|
19192
|
+
return queryParams;
|
|
19193
|
+
}
|
|
19194
|
+
/**
|
|
19195
|
+
* Construct the URL of the embedded ThoughtSpot search to be
|
|
19196
|
+
* loaded in the iframe
|
|
19197
|
+
* @param dataSources A list of data source GUIDs
|
|
19198
|
+
*/
|
|
19199
|
+
getIFrameSrc() {
|
|
19200
|
+
const queryParams = this.getEmbedParamsObject();
|
|
19201
|
+
const path = 'search-bar-embed';
|
|
18947
19202
|
let query = '';
|
|
18948
19203
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
18949
19204
|
if (queryParamsString) {
|
|
@@ -18994,12 +19249,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18994
19249
|
viewConfig.embedComponentType = 'SageEmbed';
|
|
18995
19250
|
super(domSelector, viewConfig);
|
|
18996
19251
|
}
|
|
18997
|
-
|
|
18998
|
-
* Constructs a map of parameters to be passed on to the
|
|
18999
|
-
* embedded Eureka or Sage search page.
|
|
19000
|
-
* @returns {string} query string
|
|
19001
|
-
*/
|
|
19002
|
-
getEmbedParams() {
|
|
19252
|
+
getEmbedParamsObject() {
|
|
19003
19253
|
const { disableWorksheetChange, hideWorksheetSelector, showObjectSuggestions, dataPanelV2, hideSampleQuestions, isProductTour, hideSageAnswerHeader, hideAutocompleteSuggestions, } = this.viewConfig;
|
|
19004
19254
|
const params = this.getBaseQueryParams();
|
|
19005
19255
|
params[Param.DataPanelV2Enabled] = !!dataPanelV2;
|
|
@@ -19014,6 +19264,15 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19014
19264
|
params[Param.HideSampleQuestions] = !!hideSampleQuestions;
|
|
19015
19265
|
params[Param.IsProductTour] = !!isProductTour;
|
|
19016
19266
|
params[Param.HideSageAnswerHeader] = !!hideSageAnswerHeader;
|
|
19267
|
+
return params;
|
|
19268
|
+
}
|
|
19269
|
+
/**
|
|
19270
|
+
* Constructs a map of parameters to be passed on to the
|
|
19271
|
+
* embedded Eureka or Sage search page.
|
|
19272
|
+
* @returns {string} query string
|
|
19273
|
+
*/
|
|
19274
|
+
getEmbedParams() {
|
|
19275
|
+
const params = this.getEmbedParamsObject();
|
|
19017
19276
|
return getQueryParamString(params, true);
|
|
19018
19277
|
}
|
|
19019
19278
|
/**
|
|
@@ -19123,11 +19382,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19123
19382
|
const defaultAppInitData = await super.getAppInitData();
|
|
19124
19383
|
return { ...defaultAppInitData, ...this.getSearchInitData() };
|
|
19125
19384
|
}
|
|
19126
|
-
|
|
19385
|
+
getEmbedParamsObject() {
|
|
19127
19386
|
var _a;
|
|
19128
|
-
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = true, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
|
|
19129
|
-
/* eslint-disable-next-line max-len */
|
|
19130
|
-
dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
|
|
19387
|
+
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = true, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
|
|
19131
19388
|
const queryParams = this.getBaseQueryParams();
|
|
19132
19389
|
queryParams[Param.HideActions] = [
|
|
19133
19390
|
...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
|
|
@@ -19159,8 +19416,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19159
19416
|
if (hideSearchBar) {
|
|
19160
19417
|
queryParams[Param.HideSearchBar] = true;
|
|
19161
19418
|
}
|
|
19162
|
-
|
|
19163
|
-
|
|
19419
|
+
const { enableApiIntercept } = getInterceptInitData(this.embedConfig, this.viewConfig);
|
|
19420
|
+
if (isOnBeforeGetVizDataInterceptEnabled && !enableApiIntercept) {
|
|
19164
19421
|
queryParams[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
19165
19422
|
}
|
|
19166
19423
|
if (!focusSearchBarOnRender) {
|
|
@@ -19173,20 +19430,22 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19173
19430
|
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
19174
19431
|
}
|
|
19175
19432
|
queryParams[Param.searchEmbed] = true;
|
|
19176
|
-
/* eslint-disable-next-line max-len */
|
|
19177
19433
|
queryParams[Param.CollapseSearchBarInitially] = collapseSearchBarInitially || collapseSearchBar;
|
|
19178
19434
|
queryParams[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
19179
19435
|
if (dataPanelCustomGroupsAccordionInitialState
|
|
19180
19436
|
=== DataPanelCustomColumnGroupsAccordionState$1.COLLAPSE_ALL
|
|
19181
19437
|
|| dataPanelCustomGroupsAccordionInitialState
|
|
19182
19438
|
=== DataPanelCustomColumnGroupsAccordionState$1.EXPAND_FIRST) {
|
|
19183
|
-
/* eslint-disable-next-line max-len */
|
|
19184
19439
|
queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
|
|
19185
19440
|
}
|
|
19186
19441
|
else {
|
|
19187
|
-
/* eslint-disable-next-line max-len */
|
|
19188
19442
|
queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL;
|
|
19189
19443
|
}
|
|
19444
|
+
return queryParams;
|
|
19445
|
+
}
|
|
19446
|
+
getEmbedParams() {
|
|
19447
|
+
const { runtimeParameters, runtimeFilters, excludeRuntimeParametersfromURL, excludeRuntimeFiltersfromURL, } = this.viewConfig;
|
|
19448
|
+
const queryParams = this.getEmbedParamsObject();
|
|
19190
19449
|
let query = '';
|
|
19191
19450
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
19192
19451
|
if (queryParamsString) {
|
|
@@ -19419,7 +19678,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19419
19678
|
* embedded Liveboard or visualization.
|
|
19420
19679
|
*/
|
|
19421
19680
|
getEmbedParams() {
|
|
19422
|
-
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 = 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;
|
|
19681
|
+
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 = 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;
|
|
19423
19682
|
let params = {};
|
|
19424
19683
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
19425
19684
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -19472,7 +19731,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19472
19731
|
if (enableAskSage) {
|
|
19473
19732
|
params[Param.enableAskSage] = enableAskSage;
|
|
19474
19733
|
}
|
|
19475
|
-
|
|
19734
|
+
const { enableApiIntercept } = getInterceptInitData(this.embedConfig, this.viewConfig);
|
|
19735
|
+
if (isOnBeforeGetVizDataInterceptEnabled && !enableApiIntercept) {
|
|
19476
19736
|
params[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
19477
19737
|
}
|
|
19478
19738
|
if (homePageSearchBarMode) {
|
|
@@ -19487,6 +19747,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19487
19747
|
if (isPNGInScheduledEmailsEnabled !== undefined) {
|
|
19488
19748
|
params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
|
|
19489
19749
|
}
|
|
19750
|
+
if (isLinkParametersEnabled !== undefined) {
|
|
19751
|
+
params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
|
|
19752
|
+
}
|
|
19490
19753
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
19491
19754
|
params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
|
|
19492
19755
|
params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
|
|
@@ -19834,9 +20097,14 @@ query GetEurekaVizSnapshots(
|
|
|
19834
20097
|
* embedded Liveboard or visualization.
|
|
19835
20098
|
*/
|
|
19836
20099
|
getEmbedParams() {
|
|
20100
|
+
const params = this.getEmbedParamsObject();
|
|
20101
|
+
const queryParams = getQueryParamString(params, true);
|
|
20102
|
+
return queryParams;
|
|
20103
|
+
}
|
|
20104
|
+
getEmbedParamsObject() {
|
|
19837
20105
|
let params = {};
|
|
19838
20106
|
params = this.getBaseQueryParams(params);
|
|
19839
|
-
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;
|
|
20107
|
+
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;
|
|
19840
20108
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
19841
20109
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
19842
20110
|
if (fullHeight === true) {
|
|
@@ -19901,6 +20169,9 @@ query GetEurekaVizSnapshots(
|
|
|
19901
20169
|
if (showSpotterLimitations !== undefined) {
|
|
19902
20170
|
params[Param.ShowSpotterLimitations] = showSpotterLimitations;
|
|
19903
20171
|
}
|
|
20172
|
+
if (isLinkParametersEnabled !== undefined) {
|
|
20173
|
+
params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
|
|
20174
|
+
}
|
|
19904
20175
|
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
19905
20176
|
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
19906
20177
|
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
@@ -19910,8 +20181,8 @@ query GetEurekaVizSnapshots(
|
|
|
19910
20181
|
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
19911
20182
|
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
19912
20183
|
params[Param.LiveboardXLSXCSVDownload] = !!liveboardXLSXCSVDownload;
|
|
19913
|
-
|
|
19914
|
-
return
|
|
20184
|
+
getQueryParamString(params, true);
|
|
20185
|
+
return params;
|
|
19915
20186
|
}
|
|
19916
20187
|
getIframeSuffixSrc(liveboardId, vizId, activeTabId) {
|
|
19917
20188
|
let suffix = `/embed/viz/${liveboardId}`;
|
|
@@ -20469,13 +20740,17 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
20469
20740
|
super(container, viewConfig);
|
|
20470
20741
|
this.viewConfig = viewConfig;
|
|
20471
20742
|
}
|
|
20472
|
-
|
|
20743
|
+
getEmbedParamsObject() {
|
|
20473
20744
|
var _a;
|
|
20474
|
-
const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
|
|
20475
|
-
const path = 'conv-assist-answer';
|
|
20476
20745
|
const queryParams = this.getBaseQueryParams();
|
|
20477
20746
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
20478
20747
|
queryParams[Param.isSpotterAgentEmbed] = true;
|
|
20748
|
+
return queryParams;
|
|
20749
|
+
}
|
|
20750
|
+
getIframeSrc() {
|
|
20751
|
+
const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
|
|
20752
|
+
const path = 'conv-assist-answer';
|
|
20753
|
+
const queryParams = this.getEmbedParamsObject();
|
|
20479
20754
|
let query = '';
|
|
20480
20755
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
20481
20756
|
if (queryParamsString) {
|
|
@@ -20631,9 +20906,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
20631
20906
|
super(container, viewConfig);
|
|
20632
20907
|
this.viewConfig = viewConfig;
|
|
20633
20908
|
}
|
|
20634
|
-
|
|
20909
|
+
getEmbedParamsObject() {
|
|
20635
20910
|
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
20636
|
-
const path = 'insights/conv-assist';
|
|
20637
20911
|
if (!worksheetId) {
|
|
20638
20912
|
this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
|
|
20639
20913
|
}
|
|
@@ -20654,6 +20928,12 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
20654
20928
|
if (!isUndefined_1(hideSampleQuestions)) {
|
|
20655
20929
|
queryParams[Param.HideSampleQuestions] = !!hideSampleQuestions;
|
|
20656
20930
|
}
|
|
20931
|
+
return queryParams;
|
|
20932
|
+
}
|
|
20933
|
+
getIframeSrc() {
|
|
20934
|
+
const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
20935
|
+
const path = 'insights/conv-assist';
|
|
20936
|
+
const queryParams = this.getEmbedParamsObject();
|
|
20657
20937
|
let query = '';
|
|
20658
20938
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
20659
20939
|
if (queryParamsString) {
|