@thoughtspot/visual-embed-sdk 1.43.0 → 1.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/package.json +1 -1
- package/cjs/src/api-intercept.d.ts +51 -0
- package/cjs/src/api-intercept.d.ts.map +1 -0
- package/cjs/src/api-intercept.js +180 -0
- package/cjs/src/api-intercept.js.map +1 -0
- package/cjs/src/api-intercept.spec.d.ts +2 -0
- package/cjs/src/api-intercept.spec.d.ts.map +1 -0
- package/cjs/src/api-intercept.spec.js +672 -0
- package/cjs/src/api-intercept.spec.js.map +1 -0
- package/cjs/src/css-variables.d.ts +4 -0
- package/cjs/src/css-variables.d.ts.map +1 -1
- package/cjs/src/embed/app.d.ts +15 -5
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +7 -5
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +30 -0
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +17 -2
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +5 -2
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +41 -0
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.d.ts +11 -1
- package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.js +1 -0
- package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +15 -0
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +7 -2
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +33 -0
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/search.d.ts +0 -7
- package/cjs/src/embed/search.d.ts.map +1 -1
- package/cjs/src/embed/search.js +1 -4
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +10 -0
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +56 -15
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +412 -238
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/index.d.ts +2 -2
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +2 -1
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/react/all-types-export.d.ts +1 -1
- package/cjs/src/react/all-types-export.d.ts.map +1 -1
- package/cjs/src/react/all-types-export.js +2 -1
- package/cjs/src/react/all-types-export.js.map +1 -1
- package/cjs/src/types.d.ts +246 -89
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +182 -70
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/logger.d.ts.map +1 -1
- package/cjs/src/utils/logger.js +1 -2
- package/cjs/src/utils/logger.js.map +1 -1
- package/cjs/src/utils/processData.d.ts +1 -1
- package/cjs/src/utils/processData.d.ts.map +1 -1
- package/cjs/src/utils/processData.js +8 -8
- package/cjs/src/utils/processData.js.map +1 -1
- package/cjs/src/utils/processData.spec.js.map +1 -1
- package/dist/{index-HZ94j9Ey.js → index-B2QPwxuL.js} +1 -1
- package/dist/src/api-intercept.d.ts +51 -0
- package/dist/src/api-intercept.d.ts.map +1 -0
- package/dist/src/api-intercept.spec.d.ts +2 -0
- package/dist/src/api-intercept.spec.d.ts.map +1 -0
- package/dist/src/css-variables.d.ts +4 -0
- package/dist/src/css-variables.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +15 -5
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +17 -2
- 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 +15 -0
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/search.d.ts +0 -7
- package/dist/src/embed/search.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +10 -0
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/react/all-types-export.d.ts +1 -1
- package/dist/src/react/all-types-export.d.ts.map +1 -1
- package/dist/src/types.d.ts +246 -89
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/logger.d.ts.map +1 -1
- package/dist/src/utils/processData.d.ts +1 -1
- package/dist/src/utils/processData.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +446 -119
- package/dist/tsembed-react.js +445 -118
- package/dist/tsembed.es.js +3588 -3261
- package/dist/tsembed.js +3586 -3259
- package/dist/visual-embed-sdk-react-full.d.ts +316 -103
- package/dist/visual-embed-sdk-react.d.ts +313 -103
- package/dist/visual-embed-sdk.d.ts +316 -103
- package/lib/package.json +1 -1
- package/lib/src/api-intercept.d.ts +51 -0
- package/lib/src/api-intercept.d.ts.map +1 -0
- package/lib/src/api-intercept.js +173 -0
- package/lib/src/api-intercept.js.map +1 -0
- package/lib/src/api-intercept.spec.d.ts +2 -0
- package/lib/src/api-intercept.spec.d.ts.map +1 -0
- package/lib/src/api-intercept.spec.js +669 -0
- package/lib/src/api-intercept.spec.js.map +1 -0
- package/lib/src/css-variables.d.ts +4 -0
- package/lib/src/css-variables.d.ts.map +1 -1
- package/lib/src/embed/app.d.ts +15 -5
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +8 -6
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +30 -0
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +17 -2
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +5 -2
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +41 -0
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts +11 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.js +1 -0
- package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +15 -0
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +7 -2
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +33 -0
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/search.d.ts +0 -7
- package/lib/src/embed/search.d.ts.map +1 -1
- package/lib/src/embed/search.js +1 -4
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +10 -0
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +56 -15
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +412 -238
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/index.d.ts +2 -2
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +2 -2
- package/lib/src/index.js.map +1 -1
- package/lib/src/react/all-types-export.d.ts +1 -1
- package/lib/src/react/all-types-export.d.ts.map +1 -1
- package/lib/src/react/all-types-export.js +1 -1
- package/lib/src/react/all-types-export.js.map +1 -1
- package/lib/src/types.d.ts +246 -89
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +181 -69
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/logger.d.ts.map +1 -1
- package/lib/src/utils/logger.js +1 -2
- package/lib/src/utils/logger.js.map +1 -1
- package/lib/src/utils/processData.d.ts +1 -1
- package/lib/src/utils/processData.d.ts.map +1 -1
- package/lib/src/utils/processData.js +8 -8
- package/lib/src/utils/processData.js.map +1 -1
- package/lib/src/utils/processData.spec.js.map +1 -1
- package/package.json +1 -1
- package/src/api-intercept.spec.ts +856 -0
- package/src/api-intercept.ts +204 -0
- package/src/css-variables.ts +5 -0
- package/src/embed/app.spec.ts +41 -2
- package/src/embed/app.ts +48 -38
- package/src/embed/conversation.spec.ts +54 -0
- package/src/embed/conversation.ts +24 -3
- package/src/embed/hostEventClient/contracts.ts +10 -0
- package/src/embed/liveboard.spec.ts +41 -0
- package/src/embed/liveboard.ts +25 -2
- package/src/embed/search.ts +1 -14
- package/src/embed/ts-embed.spec.ts +498 -250
- package/src/embed/ts-embed.ts +80 -32
- package/src/index.ts +2 -0
- package/src/react/all-types-export.ts +1 -0
- package/src/types.ts +328 -165
- package/src/utils/logger.ts +1 -2
- package/src/utils/processData.spec.ts +0 -1
- package/src/utils/processData.ts +10 -11
package/dist/tsembed-react.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.44.0 */
|
|
2
2
|
'use client';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import React__default, { useRef, useCallback } from 'react';
|
|
@@ -1474,21 +1474,24 @@ var EmbedEvent;
|
|
|
1474
1474
|
|
|
1475
1475
|
* Prerequisite: Set `isOnBeforeGetVizDataInterceptEnabled` to `true`
|
|
1476
1476
|
* for this embed event to get emitted.
|
|
1477
|
-
* @param: payload
|
|
1478
|
-
* @param:
|
|
1477
|
+
* @param:payload The payload received from the embed related to the Data API call.
|
|
1478
|
+
* @param:responder
|
|
1479
1479
|
* Contains elements that lets developers define whether ThoughtSpot
|
|
1480
1480
|
* should run the search, and if not, what error message
|
|
1481
1481
|
* should be shown to the user.
|
|
1482
1482
|
*
|
|
1483
|
-
* execute
|
|
1483
|
+
* `execute` - When execute returns `true`, the search will be run.
|
|
1484
1484
|
* When execute returns `false`, the search will not be executed.
|
|
1485
1485
|
*
|
|
1486
|
-
* error
|
|
1487
|
-
*
|
|
1486
|
+
* `error` - Developers can customize the error message text when `execute`
|
|
1487
|
+
* is `false` using the `errorText` and `errorDescription` parameters in responder.
|
|
1488
|
+
*
|
|
1489
|
+
* `errorText` - The error message text to be shown to the user.
|
|
1490
|
+
* `errorDescription (ThoughtSpot: 10.15.0.cl and above)` - The error description to be shown to the user.
|
|
1488
1491
|
* @version SDK : 1.29.0 | ThoughtSpot: 10.3.0.cl
|
|
1489
1492
|
* @example
|
|
1490
1493
|
*```js
|
|
1491
|
-
* .on(EmbedEvent.OnBeforeGetVizDataIntercept,
|
|
1494
|
+
* embed.on(EmbedEvent.OnBeforeGetVizDataIntercept,
|
|
1492
1495
|
* (payload, responder) => {
|
|
1493
1496
|
* responder({
|
|
1494
1497
|
* data: {
|
|
@@ -1504,7 +1507,7 @@ var EmbedEvent;
|
|
|
1504
1507
|
* ```
|
|
1505
1508
|
*
|
|
1506
1509
|
*```js
|
|
1507
|
-
* .on(EmbedEvent.OnBeforeGetVizDataIntercept,
|
|
1510
|
+
* embed.on(EmbedEvent.OnBeforeGetVizDataIntercept,
|
|
1508
1511
|
* (payload, responder) => {
|
|
1509
1512
|
* const query = payload.data.data.answer.search_query
|
|
1510
1513
|
* responder({
|
|
@@ -1515,7 +1518,8 @@ var EmbedEvent;
|
|
|
1515
1518
|
* error: {
|
|
1516
1519
|
* //Provide a custom error message to explain to your end user
|
|
1517
1520
|
* // why their search did not run, and which searches are accepted by your custom logic.
|
|
1518
|
-
* errorText: "
|
|
1521
|
+
* errorText: "Error Occurred",
|
|
1522
|
+
* errorDescription: "You can't use this query :" + query + ".
|
|
1519
1523
|
* The 'sales' measures can never be used at the 'county' level.
|
|
1520
1524
|
* Please try another measure, or remove 'county' from your search."
|
|
1521
1525
|
* }
|
|
@@ -1579,17 +1583,17 @@ var EmbedEvent;
|
|
|
1579
1583
|
*/
|
|
1580
1584
|
EmbedEvent["TableVizRendered"] = "TableVizRendered";
|
|
1581
1585
|
/**
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1586
|
+
* Emitted when the liveboard is created from pin modal or Liveboard list page.
|
|
1587
|
+
* You can use this event as a hook to trigger
|
|
1588
|
+
* other events on liveboard creation.
|
|
1589
|
+
*
|
|
1590
|
+
* ```js
|
|
1591
|
+
* liveboardEmbed.on(EmbedEvent.CreateLiveboard, (payload) => {
|
|
1592
|
+
* console.log('payload', payload);
|
|
1593
|
+
* })
|
|
1594
|
+
*```
|
|
1595
|
+
* @version SDK : 1.37.0 | ThoughtSpot: 10.8.0.cl
|
|
1596
|
+
*/
|
|
1593
1597
|
EmbedEvent["CreateLiveboard"] = "createLiveboard";
|
|
1594
1598
|
/**
|
|
1595
1599
|
* Emitted when a user creates a Model.
|
|
@@ -1685,6 +1689,17 @@ var EmbedEvent;
|
|
|
1685
1689
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1686
1690
|
*/
|
|
1687
1691
|
EmbedEvent["SpotterInit"] = "spotterInit";
|
|
1692
|
+
/**
|
|
1693
|
+
* Emitted when a *Spotter* conversation has been successfully created.
|
|
1694
|
+
* @example
|
|
1695
|
+
* ```js
|
|
1696
|
+
* spotterEmbed.on(EmbedEvent.SpotterLoadComplete, (payload) => {
|
|
1697
|
+
* console.log('payload', payload);
|
|
1698
|
+
* })
|
|
1699
|
+
*```
|
|
1700
|
+
* @version SDK: 1.44.0 | ThoughtSpot: 26.2.0.cl
|
|
1701
|
+
*/
|
|
1702
|
+
EmbedEvent["SpotterLoadComplete"] = "spotterLoadComplete";
|
|
1688
1703
|
/**
|
|
1689
1704
|
* @hidden
|
|
1690
1705
|
* Triggers when the embed listener is ready to receive events.
|
|
@@ -1708,6 +1723,72 @@ var EmbedEvent;
|
|
|
1708
1723
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1709
1724
|
*/
|
|
1710
1725
|
EmbedEvent["OrgSwitched"] = "orgSwitched";
|
|
1726
|
+
/**
|
|
1727
|
+
* Emitted when the user intercepts a URL.
|
|
1728
|
+
*
|
|
1729
|
+
* Supported on all embed types.
|
|
1730
|
+
*
|
|
1731
|
+
* @example
|
|
1732
|
+
*
|
|
1733
|
+
* ```js
|
|
1734
|
+
* embed.on(EmbedEvent.ApiIntercept, (payload, responder) => {
|
|
1735
|
+
* console.log('payload', payload);
|
|
1736
|
+
* responder({
|
|
1737
|
+
* data: {
|
|
1738
|
+
* execute: false,
|
|
1739
|
+
* error: {
|
|
1740
|
+
* errorText: 'Error Occurred',
|
|
1741
|
+
* }
|
|
1742
|
+
* }
|
|
1743
|
+
* })
|
|
1744
|
+
* })
|
|
1745
|
+
* ```
|
|
1746
|
+
*
|
|
1747
|
+
* ```js
|
|
1748
|
+
* // We can also send a response for the intercepted api
|
|
1749
|
+
* embed.on(EmbedEvent.ApiIntercept, (payload, responder) => {
|
|
1750
|
+
* console.log('payload', payload);
|
|
1751
|
+
* responder({
|
|
1752
|
+
* data: {
|
|
1753
|
+
* execute: false,
|
|
1754
|
+
* response: {
|
|
1755
|
+
* body: {
|
|
1756
|
+
* data: {
|
|
1757
|
+
* // Some api response
|
|
1758
|
+
* },
|
|
1759
|
+
* }
|
|
1760
|
+
* }
|
|
1761
|
+
* }
|
|
1762
|
+
* })
|
|
1763
|
+
* })
|
|
1764
|
+
*
|
|
1765
|
+
* // here embed will use the response from the responder as the response for the api
|
|
1766
|
+
* ```
|
|
1767
|
+
*
|
|
1768
|
+
* ```js
|
|
1769
|
+
* // We can also send error in response for the intercepted api
|
|
1770
|
+
* embed.on(EmbedEvent.ApiIntercept, (payload, responder) => {
|
|
1771
|
+
* console.log('payload', payload);
|
|
1772
|
+
* responder({
|
|
1773
|
+
* data: {
|
|
1774
|
+
* execute: false,
|
|
1775
|
+
* response: {
|
|
1776
|
+
* body: {
|
|
1777
|
+
* errors: [{
|
|
1778
|
+
* title: 'Error Occurred',
|
|
1779
|
+
* description: 'Error Description',
|
|
1780
|
+
* isUserError: true,
|
|
1781
|
+
* }],
|
|
1782
|
+
* data: {},
|
|
1783
|
+
* },
|
|
1784
|
+
* }
|
|
1785
|
+
* }
|
|
1786
|
+
* })
|
|
1787
|
+
* })
|
|
1788
|
+
* ```
|
|
1789
|
+
* @version SDK: 1.43.0 | ThoughtSpot: 10.15.0.cl
|
|
1790
|
+
*/
|
|
1791
|
+
EmbedEvent["ApiIntercept"] = "ApiIntercept";
|
|
1711
1792
|
})(EmbedEvent || (EmbedEvent = {}));
|
|
1712
1793
|
/**
|
|
1713
1794
|
* Event types that can be triggered by the host application
|
|
@@ -2175,14 +2256,14 @@ var HostEvent;
|
|
|
2175
2256
|
* ```
|
|
2176
2257
|
* @example
|
|
2177
2258
|
* ```js
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2259
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in MakeACopy host event.
|
|
2260
|
+
* let latestSpotterVizId = '';
|
|
2261
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2262
|
+
* latestSpotterVizId = payload.data.id;
|
|
2263
|
+
* });
|
|
2264
|
+
*
|
|
2265
|
+
* spotterEmbed.trigger(HostEvent.MakeACopy, { vizId: latestSpotterVizId });
|
|
2266
|
+
* ```
|
|
2186
2267
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2187
2268
|
*/
|
|
2188
2269
|
HostEvent["MakeACopy"] = "makeACopy";
|
|
@@ -2406,14 +2487,14 @@ var HostEvent;
|
|
|
2406
2487
|
* embed.trigger(HostEvent.Download)
|
|
2407
2488
|
* ```
|
|
2408
2489
|
* ```js
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2490
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in Download host event.
|
|
2491
|
+
* let latestSpotterVizId = '';
|
|
2492
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2493
|
+
* latestSpotterVizId = payload.data.id;
|
|
2494
|
+
* });
|
|
2495
|
+
*
|
|
2496
|
+
* spotterEmbed.trigger(HostEvent.Download, { vizId: latestSpotterVizId });
|
|
2497
|
+
* ```
|
|
2417
2498
|
* @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw
|
|
2418
2499
|
* Use {@link DownloadAsPng}
|
|
2419
2500
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
@@ -2431,13 +2512,13 @@ var HostEvent;
|
|
|
2431
2512
|
*
|
|
2432
2513
|
* searchEmbed.trigger(HostEvent.DownloadAsPng)
|
|
2433
2514
|
*
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2515
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsPng host event.
|
|
2516
|
+
* let latestSpotterVizId = '';
|
|
2517
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2518
|
+
* latestSpotterVizId = payload.data.id;
|
|
2519
|
+
* });
|
|
2520
|
+
*
|
|
2521
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsPng, { vizId: latestSpotterVizId });
|
|
2441
2522
|
* ```
|
|
2442
2523
|
*
|
|
2443
2524
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
|
|
@@ -2459,13 +2540,13 @@ var HostEvent;
|
|
|
2459
2540
|
* searchEmbed.trigger(HostEvent.DownloadAsCsv)
|
|
2460
2541
|
* ```
|
|
2461
2542
|
* ```js
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2543
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsCsv host event.
|
|
2544
|
+
* let latestSpotterVizId = '';
|
|
2545
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2546
|
+
* latestSpotterVizId = payload.data.id;
|
|
2547
|
+
* });
|
|
2548
|
+
*
|
|
2549
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsCsv, { vizId: latestSpotterVizId });
|
|
2469
2550
|
* ```
|
|
2470
2551
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2471
2552
|
*/
|
|
@@ -2486,13 +2567,13 @@ var HostEvent;
|
|
|
2486
2567
|
* searchEmbed.trigger(HostEvent.DownloadAsXlsx)
|
|
2487
2568
|
* ```
|
|
2488
2569
|
* ```js
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2570
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsXlsx host event.
|
|
2571
|
+
* let latestSpotterVizId = '';
|
|
2572
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2573
|
+
* latestSpotterVizId = payload.data.id;
|
|
2574
|
+
* });
|
|
2575
|
+
*
|
|
2576
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsXlsx, { vizId: latestSpotterVizId });
|
|
2496
2577
|
* ```
|
|
2497
2578
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2498
2579
|
*/
|
|
@@ -2857,13 +2938,13 @@ var HostEvent;
|
|
|
2857
2938
|
* });
|
|
2858
2939
|
*```
|
|
2859
2940
|
*```js
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2941
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in GetParameters host event.
|
|
2942
|
+
* let latestSpotterVizId = '';
|
|
2943
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2944
|
+
* latestSpotterVizId = payload.data.id;
|
|
2945
|
+
* });
|
|
2946
|
+
*
|
|
2947
|
+
* spotterEmbed.trigger(HostEvent.GetParameters, { vizId: latestSpotterVizId });
|
|
2867
2948
|
*```
|
|
2868
2949
|
* @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
|
|
2869
2950
|
*/
|
|
@@ -2912,8 +2993,8 @@ var HostEvent;
|
|
|
2912
2993
|
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2913
2994
|
* latestSpotterVizId = payload.data.id;
|
|
2914
2995
|
* });
|
|
2915
|
-
|
|
2916
|
-
|
|
2996
|
+
*
|
|
2997
|
+
* spotterEmbed.trigger(HostEvent.SaveAnswer, { vizId: latestSpotterVizId });
|
|
2917
2998
|
* ```
|
|
2918
2999
|
* @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
|
|
2919
3000
|
*/
|
|
@@ -3004,8 +3085,8 @@ var HostEvent;
|
|
|
3004
3085
|
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
3005
3086
|
* latestSpotterVizId = payload.data.id;
|
|
3006
3087
|
* });
|
|
3007
|
-
|
|
3008
|
-
|
|
3088
|
+
*
|
|
3089
|
+
* spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, { vizId: latestSpotterVizId });
|
|
3009
3090
|
*```
|
|
3010
3091
|
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3011
3092
|
*/
|
|
@@ -3042,8 +3123,8 @@ var HostEvent;
|
|
|
3042
3123
|
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
3043
3124
|
* latestSpotterVizId = payload.data.id;
|
|
3044
3125
|
* });
|
|
3045
|
-
|
|
3046
|
-
|
|
3126
|
+
*
|
|
3127
|
+
* spotterEmbed.trigger(HostEvent.AskSpotter, { vizId: latestSpotterVizId });
|
|
3047
3128
|
* ```
|
|
3048
3129
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
3049
3130
|
*/
|
|
@@ -3067,6 +3148,18 @@ var HostEvent;
|
|
|
3067
3148
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
3068
3149
|
*/
|
|
3069
3150
|
HostEvent["DestroyEmbed"] = "EmbedDestroyed";
|
|
3151
|
+
/** Triggers a create new conversation operation in spotter embed.
|
|
3152
|
+
* @example
|
|
3153
|
+
* ```js
|
|
3154
|
+
* This feature is available only when chat history is enabled on your ThoughtSpot instance.
|
|
3155
|
+
* Contact your admin or ThoughtSpot Support to enable chat history on your instance.
|
|
3156
|
+
* @example
|
|
3157
|
+
* ```js
|
|
3158
|
+
* spotterEmbed.trigger(HostEvent.StartNewSpotterConversation);
|
|
3159
|
+
* ```
|
|
3160
|
+
* @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
|
|
3161
|
+
*/
|
|
3162
|
+
HostEvent["StartNewSpotterConversation"] = "StartNewSpotterConversation";
|
|
3070
3163
|
})(HostEvent || (HostEvent = {}));
|
|
3071
3164
|
/**
|
|
3072
3165
|
* The different visual modes that the data sources panel within
|
|
@@ -3219,6 +3312,7 @@ var Param;
|
|
|
3219
3312
|
Param["isCentralizedLiveboardFilterUXEnabled"] = "isCentralizedLiveboardFilterUXEnabled";
|
|
3220
3313
|
Param["isLinkParametersEnabled"] = "isLinkParametersEnabled";
|
|
3221
3314
|
Param["EnablePastConversationsSidebar"] = "enablePastConversationsSidebar";
|
|
3315
|
+
Param["UpdatedSpotterChatPrompt"] = "updatedSpotterChatPrompt";
|
|
3222
3316
|
})(Param || (Param = {}));
|
|
3223
3317
|
/**
|
|
3224
3318
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -4654,7 +4748,25 @@ var LogLevel;
|
|
|
4654
4748
|
* @version SDK: 1.26.7 | ThoughtSpot Cloud: 9.10.0.cl
|
|
4655
4749
|
*/
|
|
4656
4750
|
LogLevel["TRACE"] = "TRACE";
|
|
4657
|
-
})(LogLevel || (LogLevel = {}));
|
|
4751
|
+
})(LogLevel || (LogLevel = {}));
|
|
4752
|
+
/**
|
|
4753
|
+
* Enum for the type of API intercepted
|
|
4754
|
+
*/
|
|
4755
|
+
var InterceptedApiType;
|
|
4756
|
+
(function (InterceptedApiType) {
|
|
4757
|
+
/**
|
|
4758
|
+
* The apis that are use to get the data for the embed
|
|
4759
|
+
*/
|
|
4760
|
+
InterceptedApiType["AnswerData"] = "AnswerData";
|
|
4761
|
+
/**
|
|
4762
|
+
* This will intercept all the apis
|
|
4763
|
+
*/
|
|
4764
|
+
InterceptedApiType["ALL"] = "ALL";
|
|
4765
|
+
/**
|
|
4766
|
+
* The apis that are use to get the data for the liveboard
|
|
4767
|
+
*/
|
|
4768
|
+
InterceptedApiType["LiveboardData"] = "LiveboardData";
|
|
4769
|
+
})(InterceptedApiType || (InterceptedApiType = {}));
|
|
4658
4770
|
|
|
4659
4771
|
const logFunctions = {
|
|
4660
4772
|
[LogLevel.SILENT]: () => undefined,
|
|
@@ -4692,7 +4804,7 @@ class Logger {
|
|
|
4692
4804
|
canLog(logLevel) {
|
|
4693
4805
|
if (logLevel === LogLevel.SILENT)
|
|
4694
4806
|
return false;
|
|
4695
|
-
if (
|
|
4807
|
+
if (globalLogLevelOverride !== undefined) {
|
|
4696
4808
|
return compareLogLevels(globalLogLevelOverride, logLevel) >= 0;
|
|
4697
4809
|
}
|
|
4698
4810
|
return compareLogLevels(this.logLevel, logLevel) >= 0;
|
|
@@ -7417,6 +7529,17 @@ function isEmpty(value) {
|
|
|
7417
7529
|
|
|
7418
7530
|
var isEmpty_1 = isEmpty;
|
|
7419
7531
|
|
|
7532
|
+
var UIPassthroughEvent;
|
|
7533
|
+
(function (UIPassthroughEvent) {
|
|
7534
|
+
UIPassthroughEvent["PinAnswerToLiveboard"] = "addVizToPinboard";
|
|
7535
|
+
UIPassthroughEvent["SaveAnswer"] = "saveAnswer";
|
|
7536
|
+
UIPassthroughEvent["GetDiscoverabilityStatus"] = "getDiscoverabilityStatus";
|
|
7537
|
+
UIPassthroughEvent["GetAvailableUIPassthroughs"] = "getAvailableUiPassthroughs";
|
|
7538
|
+
UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
|
|
7539
|
+
UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
|
|
7540
|
+
UIPassthroughEvent["GetUnsavedAnswerTML"] = "getUnsavedAnswerTML";
|
|
7541
|
+
})(UIPassthroughEvent || (UIPassthroughEvent = {}));
|
|
7542
|
+
|
|
7420
7543
|
const ERROR_MESSAGE = {
|
|
7421
7544
|
INVALID_THOUGHTSPOT_HOST: 'Error parsing ThoughtSpot host. Please provide a valid URL.',
|
|
7422
7545
|
SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND: 'Please select a Model to get started',
|
|
@@ -8348,7 +8471,7 @@ class AnswerService {
|
|
|
8348
8471
|
async getTML() {
|
|
8349
8472
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
8350
8473
|
const edoc = object[0].edoc;
|
|
8351
|
-
const YAML = await import('./index-
|
|
8474
|
+
const YAML = await import('./index-B2QPwxuL.js');
|
|
8352
8475
|
const parsedDoc = YAML.parse(edoc);
|
|
8353
8476
|
return {
|
|
8354
8477
|
answer: {
|
|
@@ -17511,27 +17634,27 @@ function processAuthLogout(e, containerEl) {
|
|
|
17511
17634
|
* @param thoughtSpotHost
|
|
17512
17635
|
* @param containerEl
|
|
17513
17636
|
*/
|
|
17514
|
-
function processEventData(type,
|
|
17637
|
+
function processEventData(type, eventData, thoughtSpotHost, containerEl) {
|
|
17515
17638
|
switch (type) {
|
|
17516
17639
|
case EmbedEvent.CustomAction:
|
|
17517
|
-
return processCustomAction(
|
|
17640
|
+
return processCustomAction(eventData, thoughtSpotHost);
|
|
17518
17641
|
case EmbedEvent.AuthInit:
|
|
17519
|
-
return processAuthInit(
|
|
17642
|
+
return processAuthInit(eventData);
|
|
17520
17643
|
case EmbedEvent.NoCookieAccess:
|
|
17521
|
-
return processNoCookieAccess(
|
|
17644
|
+
return processNoCookieAccess(eventData, containerEl);
|
|
17522
17645
|
case EmbedEvent.AuthFailure:
|
|
17523
|
-
return processAuthFailure(
|
|
17646
|
+
return processAuthFailure(eventData, containerEl);
|
|
17524
17647
|
case EmbedEvent.AuthLogout:
|
|
17525
|
-
return processAuthLogout(
|
|
17648
|
+
return processAuthLogout(eventData, containerEl);
|
|
17526
17649
|
case EmbedEvent.ExitPresentMode:
|
|
17527
17650
|
return processExitPresentMode();
|
|
17528
17651
|
case EmbedEvent.CLEAR_INFO_CACHE:
|
|
17529
17652
|
return processClearInfoCache();
|
|
17530
17653
|
}
|
|
17531
|
-
return
|
|
17654
|
+
return eventData;
|
|
17532
17655
|
}
|
|
17533
17656
|
|
|
17534
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.
|
|
17657
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.44.0";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={".":{"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 is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.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,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};
|
|
17535
17658
|
|
|
17536
17659
|
/**
|
|
17537
17660
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -17603,16 +17726,6 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
|
17603
17726
|
});
|
|
17604
17727
|
}
|
|
17605
17728
|
|
|
17606
|
-
var UIPassthroughEvent;
|
|
17607
|
-
(function (UIPassthroughEvent) {
|
|
17608
|
-
UIPassthroughEvent["PinAnswerToLiveboard"] = "addVizToPinboard";
|
|
17609
|
-
UIPassthroughEvent["SaveAnswer"] = "saveAnswer";
|
|
17610
|
-
UIPassthroughEvent["GetDiscoverabilityStatus"] = "getDiscoverabilityStatus";
|
|
17611
|
-
UIPassthroughEvent["GetAvailableUIPassthroughs"] = "getAvailableUiPassthroughs";
|
|
17612
|
-
UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
|
|
17613
|
-
UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
|
|
17614
|
-
})(UIPassthroughEvent || (UIPassthroughEvent = {}));
|
|
17615
|
-
|
|
17616
17729
|
class HostEventClient {
|
|
17617
17730
|
constructor(iFrame) {
|
|
17618
17731
|
this.iFrame = iFrame;
|
|
@@ -17704,6 +17817,174 @@ class HostEventClient {
|
|
|
17704
17817
|
}
|
|
17705
17818
|
}
|
|
17706
17819
|
|
|
17820
|
+
const DefaultInterceptUrlsMap = {
|
|
17821
|
+
[InterceptedApiType.AnswerData]: [
|
|
17822
|
+
'/prism/?op=GetChartWithData',
|
|
17823
|
+
'/prism/?op=GetTableWithHeadlineData',
|
|
17824
|
+
'/prism/?op=GetTableWithData',
|
|
17825
|
+
],
|
|
17826
|
+
[InterceptedApiType.LiveboardData]: [
|
|
17827
|
+
'/prism/?op=LoadContextBook'
|
|
17828
|
+
],
|
|
17829
|
+
};
|
|
17830
|
+
const formatInterceptUrl = (url) => {
|
|
17831
|
+
const host = getThoughtSpotHost(getEmbedConfig());
|
|
17832
|
+
if (url.startsWith('/'))
|
|
17833
|
+
return `${host}${url}`;
|
|
17834
|
+
return url;
|
|
17835
|
+
};
|
|
17836
|
+
/**
|
|
17837
|
+
* Converts user passed url values to proper urls
|
|
17838
|
+
* [ANSER_DATA] => ['https://host/pris/op?=op']
|
|
17839
|
+
* @param interceptUrls
|
|
17840
|
+
* @returns
|
|
17841
|
+
*/
|
|
17842
|
+
const processInterceptUrls = (interceptUrls) => {
|
|
17843
|
+
let processedUrls = [...interceptUrls];
|
|
17844
|
+
Object.entries(DefaultInterceptUrlsMap).forEach(([apiType, apiTypeUrls]) => {
|
|
17845
|
+
if (!processedUrls.includes(apiType))
|
|
17846
|
+
return;
|
|
17847
|
+
processedUrls = processedUrls.filter(url => url !== apiType);
|
|
17848
|
+
processedUrls = [...processedUrls, ...apiTypeUrls];
|
|
17849
|
+
});
|
|
17850
|
+
return processedUrls.map(url => formatInterceptUrl(url));
|
|
17851
|
+
};
|
|
17852
|
+
/**
|
|
17853
|
+
* Returns the data to be sent to embed to setup intercepts
|
|
17854
|
+
* the urls to intercept, timeout etc
|
|
17855
|
+
* @param viewConfig
|
|
17856
|
+
* @returns
|
|
17857
|
+
*/
|
|
17858
|
+
const getInterceptInitData = (viewConfig) => {
|
|
17859
|
+
const combinedUrls = [...(viewConfig.interceptUrls || [])];
|
|
17860
|
+
if (viewConfig.isOnBeforeGetVizDataInterceptEnabled) {
|
|
17861
|
+
combinedUrls.push(InterceptedApiType.AnswerData);
|
|
17862
|
+
}
|
|
17863
|
+
const shouldInterceptAll = combinedUrls.includes(InterceptedApiType.ALL);
|
|
17864
|
+
const interceptUrls = shouldInterceptAll ? [InterceptedApiType.ALL] : processInterceptUrls(combinedUrls);
|
|
17865
|
+
const interceptTimeout = viewConfig.interceptTimeout;
|
|
17866
|
+
return {
|
|
17867
|
+
interceptUrls,
|
|
17868
|
+
interceptTimeout,
|
|
17869
|
+
};
|
|
17870
|
+
};
|
|
17871
|
+
const parseJson = (jsonString) => {
|
|
17872
|
+
try {
|
|
17873
|
+
const json = JSON.parse(jsonString);
|
|
17874
|
+
return [json, null];
|
|
17875
|
+
}
|
|
17876
|
+
catch (error) {
|
|
17877
|
+
return [null, error];
|
|
17878
|
+
}
|
|
17879
|
+
};
|
|
17880
|
+
/**
|
|
17881
|
+
* Parse the api intercept data and return the parsed data and error if any
|
|
17882
|
+
* Embed returns the input and init from the fetch call
|
|
17883
|
+
*/
|
|
17884
|
+
const parseInterceptData = (eventDataString) => {
|
|
17885
|
+
try {
|
|
17886
|
+
const [parsedData, error] = parseJson(eventDataString);
|
|
17887
|
+
if (error) {
|
|
17888
|
+
return [null, error];
|
|
17889
|
+
}
|
|
17890
|
+
const { input, init } = parsedData;
|
|
17891
|
+
const [parsedBody, bodyParseError] = parseJson(init.body);
|
|
17892
|
+
if (!bodyParseError) {
|
|
17893
|
+
init.body = parsedBody;
|
|
17894
|
+
}
|
|
17895
|
+
const parsedInit = { input, init };
|
|
17896
|
+
return [parsedInit, null];
|
|
17897
|
+
}
|
|
17898
|
+
catch (error) {
|
|
17899
|
+
return [null, error];
|
|
17900
|
+
}
|
|
17901
|
+
};
|
|
17902
|
+
const getUrlType = (url) => {
|
|
17903
|
+
for (const [apiType, apiTypeUrls] of Object.entries(DefaultInterceptUrlsMap)) {
|
|
17904
|
+
if (apiTypeUrls.includes(url))
|
|
17905
|
+
return apiType;
|
|
17906
|
+
}
|
|
17907
|
+
// TODO: have a unknown type maybe ??
|
|
17908
|
+
return InterceptedApiType.ALL;
|
|
17909
|
+
};
|
|
17910
|
+
/**
|
|
17911
|
+
* Handle Api intercept event and simulate legacy onBeforeGetVizDataIntercept event
|
|
17912
|
+
*
|
|
17913
|
+
* embed sends -> ApiIntercept -> we send
|
|
17914
|
+
* ApiIntercept
|
|
17915
|
+
* OnBeforeGetVizDataIntercept (if url is part of DefaultUrlMap.AnswerData)
|
|
17916
|
+
*
|
|
17917
|
+
* @param params
|
|
17918
|
+
* @returns
|
|
17919
|
+
*/
|
|
17920
|
+
const handleInterceptEvent = async (params) => {
|
|
17921
|
+
var _a, _b, _c, _d, _e;
|
|
17922
|
+
const { eventData, executeEvent, viewConfig, getUnsavedAnswerTml } = params;
|
|
17923
|
+
const [interceptData, bodyParseError] = parseInterceptData(eventData.data);
|
|
17924
|
+
if (bodyParseError) {
|
|
17925
|
+
executeEvent(EmbedEvent.Error, {
|
|
17926
|
+
error: 'Error parsing api intercept body',
|
|
17927
|
+
});
|
|
17928
|
+
logger$3.error('Error parsing request body', bodyParseError);
|
|
17929
|
+
return;
|
|
17930
|
+
}
|
|
17931
|
+
const { input: requestUrl, init } = interceptData;
|
|
17932
|
+
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;
|
|
17933
|
+
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;
|
|
17934
|
+
const answerDataUrls = DefaultInterceptUrlsMap[InterceptedApiType.AnswerData];
|
|
17935
|
+
const legacyInterceptEnabled = viewConfig.isOnBeforeGetVizDataInterceptEnabled;
|
|
17936
|
+
const isAnswerDataUrl = answerDataUrls.includes(requestUrl);
|
|
17937
|
+
const sendLegacyIntercept = isAnswerDataUrl && legacyInterceptEnabled;
|
|
17938
|
+
if (sendLegacyIntercept) {
|
|
17939
|
+
const answerTml = await getUnsavedAnswerTml({ sessionId, vizId });
|
|
17940
|
+
// Build the legacy payload for backwards compatibility
|
|
17941
|
+
const legacyPayload = {
|
|
17942
|
+
data: {
|
|
17943
|
+
data: answerTml,
|
|
17944
|
+
status: embedEventStatus.END,
|
|
17945
|
+
type: EmbedEvent.OnBeforeGetVizDataIntercept
|
|
17946
|
+
}
|
|
17947
|
+
};
|
|
17948
|
+
executeEvent(EmbedEvent.OnBeforeGetVizDataIntercept, legacyPayload);
|
|
17949
|
+
}
|
|
17950
|
+
const urlType = getUrlType(requestUrl);
|
|
17951
|
+
executeEvent(EmbedEvent.ApiIntercept, { ...interceptData, urlType });
|
|
17952
|
+
};
|
|
17953
|
+
/**
|
|
17954
|
+
* Support both the legacy and new format of the api intercept response
|
|
17955
|
+
* @param payload
|
|
17956
|
+
* @returns
|
|
17957
|
+
*/
|
|
17958
|
+
const processApiInterceptResponse = (payload) => {
|
|
17959
|
+
var _a;
|
|
17960
|
+
const isLegacyFormat = (_a = payload === null || payload === void 0 ? void 0 : payload.data) === null || _a === void 0 ? void 0 : _a.error;
|
|
17961
|
+
if (isLegacyFormat) {
|
|
17962
|
+
return processLegacyInterceptResponse(payload);
|
|
17963
|
+
}
|
|
17964
|
+
return payload;
|
|
17965
|
+
};
|
|
17966
|
+
const processLegacyInterceptResponse = (payload) => {
|
|
17967
|
+
var _a, _b, _c, _d, _e;
|
|
17968
|
+
const errorText = (_b = (_a = payload === null || payload === void 0 ? void 0 : payload.data) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.errorText;
|
|
17969
|
+
const errorDescription = (_d = (_c = payload === null || payload === void 0 ? void 0 : payload.data) === null || _c === void 0 ? void 0 : _c.error) === null || _d === void 0 ? void 0 : _d.errorDescription;
|
|
17970
|
+
const payloadToSend = {
|
|
17971
|
+
execute: (_e = payload === null || payload === void 0 ? void 0 : payload.data) === null || _e === void 0 ? void 0 : _e.execute,
|
|
17972
|
+
response: {
|
|
17973
|
+
body: {
|
|
17974
|
+
errors: [
|
|
17975
|
+
{
|
|
17976
|
+
title: errorText,
|
|
17977
|
+
description: errorDescription,
|
|
17978
|
+
isUserError: true,
|
|
17979
|
+
},
|
|
17980
|
+
],
|
|
17981
|
+
data: {},
|
|
17982
|
+
},
|
|
17983
|
+
},
|
|
17984
|
+
};
|
|
17985
|
+
return { data: payloadToSend };
|
|
17986
|
+
};
|
|
17987
|
+
|
|
17707
17988
|
/**
|
|
17708
17989
|
* Copyright (c) 2022
|
|
17709
17990
|
*
|
|
@@ -17757,6 +18038,19 @@ class TsEmbed {
|
|
|
17757
18038
|
*/
|
|
17758
18039
|
this.fullscreenChangeHandler = null;
|
|
17759
18040
|
this.subscribedListeners = {};
|
|
18041
|
+
this.messageEventListener = (event) => {
|
|
18042
|
+
const eventType = this.getEventType(event);
|
|
18043
|
+
const eventPort = this.getEventPort(event);
|
|
18044
|
+
const eventData = this.formatEventData(event, eventType);
|
|
18045
|
+
if (event.source === this.iFrame.contentWindow) {
|
|
18046
|
+
const processedEventData = processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.el);
|
|
18047
|
+
if (eventType === EmbedEvent.ApiIntercept) {
|
|
18048
|
+
this.handleApiInterceptEvent({ eventData, eventPort });
|
|
18049
|
+
return;
|
|
18050
|
+
}
|
|
18051
|
+
this.executeCallbacks(eventType, processedEventData, eventPort);
|
|
18052
|
+
}
|
|
18053
|
+
};
|
|
17760
18054
|
/**
|
|
17761
18055
|
* Send Custom style as part of payload of APP_INIT
|
|
17762
18056
|
* @param _
|
|
@@ -17841,6 +18135,28 @@ class TsEmbed {
|
|
|
17841
18135
|
this.on(EmbedEvent.AuthInit, authInitHandler, { start: false }, true);
|
|
17842
18136
|
};
|
|
17843
18137
|
this.showPreRenderByDefault = false;
|
|
18138
|
+
/**
|
|
18139
|
+
* We can process the customer given payload before sending it to the embed port
|
|
18140
|
+
* Embed event handler -> responder -> createEmbedEventResponder -> send response
|
|
18141
|
+
* @param eventPort The event port for a specific MessageChannel
|
|
18142
|
+
* @param eventType The event type
|
|
18143
|
+
* @returns
|
|
18144
|
+
*/
|
|
18145
|
+
this.createEmbedEventResponder = (eventPort, eventType) => {
|
|
18146
|
+
const getPayloadToSend = (payload) => {
|
|
18147
|
+
if (eventType === EmbedEvent.OnBeforeGetVizDataIntercept) {
|
|
18148
|
+
return processLegacyInterceptResponse(payload);
|
|
18149
|
+
}
|
|
18150
|
+
if (eventType === EmbedEvent.ApiIntercept) {
|
|
18151
|
+
return processApiInterceptResponse(payload);
|
|
18152
|
+
}
|
|
18153
|
+
return payload;
|
|
18154
|
+
};
|
|
18155
|
+
return (payload) => {
|
|
18156
|
+
const payloadToSend = getPayloadToSend(payload);
|
|
18157
|
+
this.triggerEventOnPort(eventPort, payloadToSend);
|
|
18158
|
+
};
|
|
18159
|
+
};
|
|
17844
18160
|
/**
|
|
17845
18161
|
* @hidden
|
|
17846
18162
|
* Internal state to track if the embed container is loaded.
|
|
@@ -18021,21 +18337,24 @@ class TsEmbed {
|
|
|
18021
18337
|
this.subscribedListeners.online = onlineEventListener;
|
|
18022
18338
|
this.subscribedListeners.offline = offlineEventListener;
|
|
18023
18339
|
}
|
|
18340
|
+
handleApiInterceptEvent({ eventData, eventPort }) {
|
|
18341
|
+
const executeEvent = (_eventType, data) => {
|
|
18342
|
+
this.executeCallbacks(_eventType, data, eventPort);
|
|
18343
|
+
};
|
|
18344
|
+
const getUnsavedAnswerTml = async (props) => {
|
|
18345
|
+
var _a, _b;
|
|
18346
|
+
const response = await this.triggerUIPassThrough(UIPassthroughEvent.GetUnsavedAnswerTML, props);
|
|
18347
|
+
return (_b = (_a = response.filter((item) => item.value)) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.value;
|
|
18348
|
+
};
|
|
18349
|
+
handleInterceptEvent({ eventData, executeEvent, viewConfig: this.viewConfig, getUnsavedAnswerTml });
|
|
18350
|
+
}
|
|
18024
18351
|
/**
|
|
18025
18352
|
* Subscribe to message events that depend on successful iframe setup
|
|
18026
18353
|
*/
|
|
18027
18354
|
subscribeToMessageEvents() {
|
|
18028
18355
|
this.unsubscribeToMessageEvents();
|
|
18029
|
-
|
|
18030
|
-
|
|
18031
|
-
const eventPort = this.getEventPort(event);
|
|
18032
|
-
const eventData = this.formatEventData(event, eventType);
|
|
18033
|
-
if (event.source === this.iFrame.contentWindow) {
|
|
18034
|
-
this.executeCallbacks(eventType, processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.el), eventPort);
|
|
18035
|
-
}
|
|
18036
|
-
};
|
|
18037
|
-
window.addEventListener('message', messageEventListener);
|
|
18038
|
-
this.subscribedListeners.message = messageEventListener;
|
|
18356
|
+
window.addEventListener('message', this.messageEventListener);
|
|
18357
|
+
this.subscribedListeners.message = this.messageEventListener;
|
|
18039
18358
|
}
|
|
18040
18359
|
/**
|
|
18041
18360
|
* Adds event listeners for both network and message events.
|
|
@@ -18096,7 +18415,7 @@ class TsEmbed {
|
|
|
18096
18415
|
message: customActionsResult.errors,
|
|
18097
18416
|
});
|
|
18098
18417
|
}
|
|
18099
|
-
|
|
18418
|
+
const baseInitData = {
|
|
18100
18419
|
customisations: getCustomisations(this.embedConfig, this.viewConfig),
|
|
18101
18420
|
authToken,
|
|
18102
18421
|
runtimeFilterParams: this.viewConfig.excludeRuntimeFiltersfromURL
|
|
@@ -18114,7 +18433,9 @@ class TsEmbed {
|
|
|
18114
18433
|
customVariablesForThirdPartyTools: this.embedConfig.customVariablesForThirdPartyTools || {},
|
|
18115
18434
|
hiddenListColumns: this.viewConfig.hiddenListColumns || [],
|
|
18116
18435
|
customActions: customActionsResult.actions,
|
|
18436
|
+
...getInterceptInitData(this.viewConfig),
|
|
18117
18437
|
};
|
|
18438
|
+
return baseInitData;
|
|
18118
18439
|
}
|
|
18119
18440
|
async getAppInitData() {
|
|
18120
18441
|
return this.getDefaultAppInitData();
|
|
@@ -18135,7 +18456,7 @@ class TsEmbed {
|
|
|
18135
18456
|
}
|
|
18136
18457
|
getUpdateEmbedParamsObject() {
|
|
18137
18458
|
let queryParams = this.getEmbedParamsObject();
|
|
18138
|
-
queryParams = { ...this.viewConfig, ...queryParams };
|
|
18459
|
+
queryParams = { ...this.viewConfig, ...queryParams, ...this.getAppInitData() };
|
|
18139
18460
|
return queryParams;
|
|
18140
18461
|
}
|
|
18141
18462
|
/**
|
|
@@ -18543,9 +18864,8 @@ class TsEmbed {
|
|
|
18543
18864
|
// When start status is false it trigger only end releated
|
|
18544
18865
|
// payload
|
|
18545
18866
|
|| (!callbackObj.options.start && dataStatus === embedEventStatus.END)) {
|
|
18546
|
-
|
|
18547
|
-
|
|
18548
|
-
});
|
|
18867
|
+
const responder = this.createEmbedEventResponder(eventPort, eventType);
|
|
18868
|
+
callbackObj.callback(data, responder);
|
|
18549
18869
|
}
|
|
18550
18870
|
});
|
|
18551
18871
|
}
|
|
@@ -19312,7 +19632,7 @@ let SearchEmbed$1 = class SearchEmbed extends TsEmbed {
|
|
|
19312
19632
|
}
|
|
19313
19633
|
getEmbedParamsObject() {
|
|
19314
19634
|
var _a;
|
|
19315
|
-
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = true, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false,
|
|
19635
|
+
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = true, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
|
|
19316
19636
|
const queryParams = this.getBaseQueryParams();
|
|
19317
19637
|
queryParams[Param.HideActions] = [
|
|
19318
19638
|
...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
|
|
@@ -19344,9 +19664,6 @@ let SearchEmbed$1 = class SearchEmbed extends TsEmbed {
|
|
|
19344
19664
|
if (hideSearchBar) {
|
|
19345
19665
|
queryParams[Param.HideSearchBar] = true;
|
|
19346
19666
|
}
|
|
19347
|
-
if (isOnBeforeGetVizDataInterceptEnabled) {
|
|
19348
|
-
queryParams[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
19349
|
-
}
|
|
19350
19667
|
if (!focusSearchBarOnRender) {
|
|
19351
19668
|
queryParams[Param.FocusSearchBarOnRender] = focusSearchBarOnRender;
|
|
19352
19669
|
}
|
|
@@ -19605,7 +19922,7 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
19605
19922
|
* embedded Liveboard or visualization.
|
|
19606
19923
|
*/
|
|
19607
19924
|
getEmbedParams() {
|
|
19608
|
-
const { tag, hideTagFilterChips, 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,
|
|
19925
|
+
const { tag, hideTagFilterChips, 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, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, isEnhancedFilterInteractivityEnabled = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, } = this.viewConfig;
|
|
19609
19926
|
let params = {};
|
|
19610
19927
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
19611
19928
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -19623,8 +19940,10 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
19623
19940
|
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
19624
19941
|
params[Param.IsUnifiedSearchExperienceEnabled] = isUnifiedSearchExperienceEnabled;
|
|
19625
19942
|
params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF;
|
|
19626
|
-
params[Param.LiveboardXLSXCSVDownload] = !!liveboardXLSXCSVDownload;
|
|
19627
19943
|
params = this.getBaseQueryParams(params);
|
|
19944
|
+
if (!isUndefined$1(updatedSpotterChatPrompt)) {
|
|
19945
|
+
params[Param.UpdatedSpotterChatPrompt] = !!updatedSpotterChatPrompt;
|
|
19946
|
+
}
|
|
19628
19947
|
if (hideObjectSearch) {
|
|
19629
19948
|
params[Param.HideObjectSearch] = !!hideObjectSearch;
|
|
19630
19949
|
}
|
|
@@ -19659,9 +19978,6 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
19659
19978
|
if (enableAskSage) {
|
|
19660
19979
|
params[Param.enableAskSage] = enableAskSage;
|
|
19661
19980
|
}
|
|
19662
|
-
if (isOnBeforeGetVizDataInterceptEnabled) {
|
|
19663
|
-
params[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
19664
|
-
}
|
|
19665
19981
|
if (homePageSearchBarMode) {
|
|
19666
19982
|
params[Param.HomePageSearchBarMode] = homePageSearchBarMode;
|
|
19667
19983
|
}
|
|
@@ -19671,6 +19987,9 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
19671
19987
|
if (isLiveboardStylingAndGroupingEnabled !== undefined) {
|
|
19672
19988
|
params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
|
|
19673
19989
|
}
|
|
19990
|
+
if (liveboardXLSXCSVDownload !== undefined) {
|
|
19991
|
+
params[Param.LiveboardXLSXCSVDownload] = !!liveboardXLSXCSVDownload;
|
|
19992
|
+
}
|
|
19674
19993
|
if (isPNGInScheduledEmailsEnabled !== undefined) {
|
|
19675
19994
|
params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
|
|
19676
19995
|
}
|
|
@@ -20037,7 +20356,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
20037
20356
|
getEmbedParamsObject() {
|
|
20038
20357
|
let params = {};
|
|
20039
20358
|
params = this.getBaseQueryParams(params);
|
|
20040
|
-
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, isEnhancedFilterInteractivityEnabled = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload
|
|
20359
|
+
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, isEnhancedFilterInteractivityEnabled = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, showSpotterLimitations, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, } = this.viewConfig;
|
|
20041
20360
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
20042
20361
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
20043
20362
|
if (fullHeight === true) {
|
|
@@ -20056,6 +20375,9 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
20056
20375
|
if (preventLiveboardFilterRemoval) {
|
|
20057
20376
|
params[Param.preventLiveboardFilterRemoval] = true;
|
|
20058
20377
|
}
|
|
20378
|
+
if (!isUndefined$1(updatedSpotterChatPrompt)) {
|
|
20379
|
+
params[Param.UpdatedSpotterChatPrompt] = !!updatedSpotterChatPrompt;
|
|
20380
|
+
}
|
|
20059
20381
|
if (visibleVizs) {
|
|
20060
20382
|
params[Param.visibleVizs] = visibleVizs;
|
|
20061
20383
|
}
|
|
@@ -20117,7 +20439,9 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
20117
20439
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
20118
20440
|
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
20119
20441
|
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
20120
|
-
|
|
20442
|
+
if (liveboardXLSXCSVDownload !== undefined) {
|
|
20443
|
+
params[Param.LiveboardXLSXCSVDownload] = !!liveboardXLSXCSVDownload;
|
|
20444
|
+
}
|
|
20121
20445
|
getQueryParamString(params, true);
|
|
20122
20446
|
return params;
|
|
20123
20447
|
}
|
|
@@ -20844,7 +21168,7 @@ let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
|
|
|
20844
21168
|
this.viewConfig = viewConfig;
|
|
20845
21169
|
}
|
|
20846
21170
|
getEmbedParamsObject() {
|
|
20847
|
-
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, enablePastConversationsSidebar, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
21171
|
+
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, enablePastConversationsSidebar, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, updatedSpotterChatPrompt, } = this.viewConfig;
|
|
20848
21172
|
if (!worksheetId) {
|
|
20849
21173
|
this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
|
|
20850
21174
|
}
|
|
@@ -20865,10 +21189,13 @@ let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
|
|
|
20865
21189
|
if (!isUndefined_1(hideSampleQuestions)) {
|
|
20866
21190
|
queryParams[Param.HideSampleQuestions] = !!hideSampleQuestions;
|
|
20867
21191
|
}
|
|
21192
|
+
if (!isUndefined_1(updatedSpotterChatPrompt)) {
|
|
21193
|
+
queryParams[Param.UpdatedSpotterChatPrompt] = !!updatedSpotterChatPrompt;
|
|
21194
|
+
}
|
|
20868
21195
|
return queryParams;
|
|
20869
21196
|
}
|
|
20870
21197
|
getIframeSrc() {
|
|
20871
|
-
const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, enablePastConversationsSidebar } = this.viewConfig;
|
|
21198
|
+
const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, enablePastConversationsSidebar, } = this.viewConfig;
|
|
20872
21199
|
const path = 'insights/conv-assist';
|
|
20873
21200
|
const queryParams = this.getEmbedParamsObject();
|
|
20874
21201
|
if (!isUndefined_1(enablePastConversationsSidebar)) {
|