@thoughtspot/visual-embed-sdk 1.42.3 → 1.43.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 +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 +0 -5
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +4 -5
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +10 -0
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +2 -2
- package/cjs/src/embed/conversation.js +1 -1
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +17 -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.map +1 -1
- package/cjs/src/embed/liveboard.js +4 -2
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +11 -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 +328 -103
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +265 -85
- 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-SVcLgSqi.js → index-CpkMygsc.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 +0 -5
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +2 -2
- 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.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 +328 -103
- 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 +519 -133
- package/dist/tsembed-react.js +518 -132
- package/dist/tsembed.es.js +2642 -2256
- package/dist/tsembed.js +2640 -2254
- package/dist/visual-embed-sdk-react-full.d.ts +355 -118
- package/dist/visual-embed-sdk-react.d.ts +352 -118
- package/dist/visual-embed-sdk.d.ts +355 -118
- 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 +0 -5
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +4 -5
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +10 -0
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +2 -2
- package/lib/src/embed/conversation.js +1 -1
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +17 -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.map +1 -1
- package/lib/src/embed/liveboard.js +4 -2
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +11 -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 +328 -103
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +264 -84
- 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 +11 -0
- package/src/embed/app.ts +5 -16
- package/src/embed/conversation.spec.ts +22 -0
- package/src/embed/conversation.ts +3 -3
- package/src/embed/hostEventClient/contracts.ts +10 -0
- package/src/embed/liveboard.spec.ts +12 -0
- package/src/embed/liveboard.ts +6 -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 +410 -179
- 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.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.43.1 */
|
|
2
2
|
'use client';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
|
|
@@ -636,7 +636,7 @@
|
|
|
636
636
|
*/
|
|
637
637
|
EmbedEvent["Load"] = "load";
|
|
638
638
|
/**
|
|
639
|
-
* Data pertaining to an Answer or
|
|
639
|
+
* Data pertaining to an Answer, Liveboard or Spotter visualization is received.
|
|
640
640
|
* The event payload includes the raw data of the object.
|
|
641
641
|
* @return data - Answer of Liveboard data
|
|
642
642
|
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
@@ -1055,6 +1055,17 @@
|
|
|
1055
1055
|
*```
|
|
1056
1056
|
*/
|
|
1057
1057
|
EmbedEvent["AnswerDelete"] = "answerDelete";
|
|
1058
|
+
/**
|
|
1059
|
+
* Emitted when the AI Highlights action is triggered on a Liveboard
|
|
1060
|
+
* @version SDK: 1.44.0 | ThoughtSpot: 10.15.0.cl
|
|
1061
|
+
* @example
|
|
1062
|
+
*```js
|
|
1063
|
+
* liveboardEmbed.on(EmbedEvent.AIHighlights, (payload) => {
|
|
1064
|
+
* console.log('AI Highlights', payload);
|
|
1065
|
+
* })
|
|
1066
|
+
*```
|
|
1067
|
+
*/
|
|
1068
|
+
EmbedEvent["AIHighlights"] = "AIHighlights";
|
|
1058
1069
|
/**
|
|
1059
1070
|
* Emitted when a user initiates the Pin action to
|
|
1060
1071
|
* add an Answer to a Liveboard.
|
|
@@ -1485,21 +1496,24 @@
|
|
|
1485
1496
|
|
|
1486
1497
|
* Prerequisite: Set `isOnBeforeGetVizDataInterceptEnabled` to `true`
|
|
1487
1498
|
* for this embed event to get emitted.
|
|
1488
|
-
* @param: payload
|
|
1489
|
-
* @param:
|
|
1499
|
+
* @param:payload The payload received from the embed related to the Data API call.
|
|
1500
|
+
* @param:responder
|
|
1490
1501
|
* Contains elements that lets developers define whether ThoughtSpot
|
|
1491
1502
|
* should run the search, and if not, what error message
|
|
1492
1503
|
* should be shown to the user.
|
|
1493
1504
|
*
|
|
1494
|
-
* execute
|
|
1505
|
+
* `execute` - When execute returns `true`, the search will be run.
|
|
1495
1506
|
* When execute returns `false`, the search will not be executed.
|
|
1496
1507
|
*
|
|
1497
|
-
* error
|
|
1498
|
-
*
|
|
1508
|
+
* `error` - Developers can customize the error message text when `execute`
|
|
1509
|
+
* is `false` using the `errorText` and `errorDescription` parameters in responder.
|
|
1510
|
+
*
|
|
1511
|
+
* `errorText` - The error message text to be shown to the user.
|
|
1512
|
+
* `errorDescription (ThoughtSpot: 10.15.0.cl and above)` - The error description to be shown to the user.
|
|
1499
1513
|
* @version SDK : 1.29.0 | ThoughtSpot: 10.3.0.cl
|
|
1500
1514
|
* @example
|
|
1501
1515
|
*```js
|
|
1502
|
-
* .on(EmbedEvent.OnBeforeGetVizDataIntercept,
|
|
1516
|
+
* embed.on(EmbedEvent.OnBeforeGetVizDataIntercept,
|
|
1503
1517
|
* (payload, responder) => {
|
|
1504
1518
|
* responder({
|
|
1505
1519
|
* data: {
|
|
@@ -1515,7 +1529,7 @@
|
|
|
1515
1529
|
* ```
|
|
1516
1530
|
*
|
|
1517
1531
|
*```js
|
|
1518
|
-
* .on(EmbedEvent.OnBeforeGetVizDataIntercept,
|
|
1532
|
+
* embed.on(EmbedEvent.OnBeforeGetVizDataIntercept,
|
|
1519
1533
|
* (payload, responder) => {
|
|
1520
1534
|
* const query = payload.data.data.answer.search_query
|
|
1521
1535
|
* responder({
|
|
@@ -1526,7 +1540,8 @@
|
|
|
1526
1540
|
* error: {
|
|
1527
1541
|
* //Provide a custom error message to explain to your end user
|
|
1528
1542
|
* // why their search did not run, and which searches are accepted by your custom logic.
|
|
1529
|
-
* errorText: "
|
|
1543
|
+
* errorText: "Error Occurred",
|
|
1544
|
+
* errorDescription: "You can't use this query :" + query + ".
|
|
1530
1545
|
* The 'sales' measures can never be used at the 'county' level.
|
|
1531
1546
|
* Please try another measure, or remove 'county' from your search."
|
|
1532
1547
|
* }
|
|
@@ -1590,17 +1605,17 @@
|
|
|
1590
1605
|
*/
|
|
1591
1606
|
EmbedEvent["TableVizRendered"] = "TableVizRendered";
|
|
1592
1607
|
/**
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1608
|
+
* Emitted when the liveboard is created from pin modal or Liveboard list page.
|
|
1609
|
+
* You can use this event as a hook to trigger
|
|
1610
|
+
* other events on liveboard creation.
|
|
1611
|
+
*
|
|
1612
|
+
* ```js
|
|
1613
|
+
* liveboardEmbed.on(EmbedEvent.CreateLiveboard, (payload) => {
|
|
1614
|
+
* console.log('payload', payload);
|
|
1615
|
+
* })
|
|
1616
|
+
*```
|
|
1617
|
+
* @version SDK : 1.37.0 | ThoughtSpot: 10.8.0.cl
|
|
1618
|
+
*/
|
|
1604
1619
|
EmbedEvent["CreateLiveboard"] = "createLiveboard";
|
|
1605
1620
|
/**
|
|
1606
1621
|
* Emitted when a user creates a Model.
|
|
@@ -1696,6 +1711,17 @@
|
|
|
1696
1711
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1697
1712
|
*/
|
|
1698
1713
|
EmbedEvent["SpotterInit"] = "spotterInit";
|
|
1714
|
+
/**
|
|
1715
|
+
* Emitted when a *Spotter* conversation has been successfully created.
|
|
1716
|
+
* @example
|
|
1717
|
+
* ```js
|
|
1718
|
+
* spotterEmbed.on(EmbedEvent.SpotterLoadComplete, (payload) => {
|
|
1719
|
+
* console.log('payload', payload);
|
|
1720
|
+
* })
|
|
1721
|
+
*```
|
|
1722
|
+
* @version SDK: 1.44.0 | ThoughtSpot: 26.2.0.cl
|
|
1723
|
+
*/
|
|
1724
|
+
EmbedEvent["SpotterLoadComplete"] = "spotterLoadComplete";
|
|
1699
1725
|
/**
|
|
1700
1726
|
* @hidden
|
|
1701
1727
|
* Triggers when the embed listener is ready to receive events.
|
|
@@ -1719,6 +1745,72 @@
|
|
|
1719
1745
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1720
1746
|
*/
|
|
1721
1747
|
EmbedEvent["OrgSwitched"] = "orgSwitched";
|
|
1748
|
+
/**
|
|
1749
|
+
* Emitted when the user intercepts a URL.
|
|
1750
|
+
*
|
|
1751
|
+
* Supported on all embed types.
|
|
1752
|
+
*
|
|
1753
|
+
* @example
|
|
1754
|
+
*
|
|
1755
|
+
* ```js
|
|
1756
|
+
* embed.on(EmbedEvent.ApiIntercept, (payload, responder) => {
|
|
1757
|
+
* console.log('payload', payload);
|
|
1758
|
+
* responder({
|
|
1759
|
+
* data: {
|
|
1760
|
+
* execute: false,
|
|
1761
|
+
* error: {
|
|
1762
|
+
* errorText: 'Error Occurred',
|
|
1763
|
+
* }
|
|
1764
|
+
* }
|
|
1765
|
+
* })
|
|
1766
|
+
* })
|
|
1767
|
+
* ```
|
|
1768
|
+
*
|
|
1769
|
+
* ```js
|
|
1770
|
+
* // We can also send a response for the intercepted api
|
|
1771
|
+
* embed.on(EmbedEvent.ApiIntercept, (payload, responder) => {
|
|
1772
|
+
* console.log('payload', payload);
|
|
1773
|
+
* responder({
|
|
1774
|
+
* data: {
|
|
1775
|
+
* execute: false,
|
|
1776
|
+
* response: {
|
|
1777
|
+
* body: {
|
|
1778
|
+
* data: {
|
|
1779
|
+
* // Some api response
|
|
1780
|
+
* },
|
|
1781
|
+
* }
|
|
1782
|
+
* }
|
|
1783
|
+
* }
|
|
1784
|
+
* })
|
|
1785
|
+
* })
|
|
1786
|
+
*
|
|
1787
|
+
* // here embed will use the response from the responder as the response for the api
|
|
1788
|
+
* ```
|
|
1789
|
+
*
|
|
1790
|
+
* ```js
|
|
1791
|
+
* // We can also send error in response for the intercepted api
|
|
1792
|
+
* embed.on(EmbedEvent.ApiIntercept, (payload, responder) => {
|
|
1793
|
+
* console.log('payload', payload);
|
|
1794
|
+
* responder({
|
|
1795
|
+
* data: {
|
|
1796
|
+
* execute: false,
|
|
1797
|
+
* response: {
|
|
1798
|
+
* body: {
|
|
1799
|
+
* errors: [{
|
|
1800
|
+
* title: 'Error Occurred',
|
|
1801
|
+
* description: 'Error Description',
|
|
1802
|
+
* isUserError: true,
|
|
1803
|
+
* }],
|
|
1804
|
+
* data: {},
|
|
1805
|
+
* },
|
|
1806
|
+
* }
|
|
1807
|
+
* }
|
|
1808
|
+
* })
|
|
1809
|
+
* })
|
|
1810
|
+
* ```
|
|
1811
|
+
* @version SDK: 1.43.0 | ThoughtSpot: 10.15.0.cl
|
|
1812
|
+
*/
|
|
1813
|
+
EmbedEvent["ApiIntercept"] = "ApiIntercept";
|
|
1722
1814
|
})(exports.EmbedEvent || (exports.EmbedEvent = {}));
|
|
1723
1815
|
/**
|
|
1724
1816
|
* Event types that can be triggered by the host application
|
|
@@ -2005,7 +2097,7 @@
|
|
|
2005
2097
|
* the following parameters:
|
|
2006
2098
|
*
|
|
2007
2099
|
* @param
|
|
2008
|
-
* `vizId`- GUID of the saved Answer or visualization to pin to a Liveboard.
|
|
2100
|
+
* `vizId`- GUID of the saved Answer or Spotter visualization ID to pin to a Liveboard.
|
|
2009
2101
|
* Optional when pinning a new chart or table generated from a Search query.
|
|
2010
2102
|
* **Required** in Spotter Embed.
|
|
2011
2103
|
* @param
|
|
@@ -2057,10 +2149,16 @@
|
|
|
2057
2149
|
* ```
|
|
2058
2150
|
* @example
|
|
2059
2151
|
* ```js
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2152
|
+
|
|
2153
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in Pin host event.
|
|
2154
|
+
* let latestSpotterVizId = '';
|
|
2155
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2156
|
+
* latestSpotterVizId = payload.data.id;
|
|
2157
|
+
* });
|
|
2158
|
+
*
|
|
2159
|
+
* spotterEmbed.trigger(HostEvent.Pin, { vizId: latestSpotterVizId });
|
|
2160
|
+
* ```
|
|
2161
|
+
*
|
|
2064
2162
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2065
2163
|
*/
|
|
2066
2164
|
HostEvent["Pin"] = "pin";
|
|
@@ -2135,14 +2233,29 @@
|
|
|
2135
2233
|
* ```
|
|
2136
2234
|
* @example
|
|
2137
2235
|
* ```js
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2236
|
+
|
|
2237
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsPdf host event.
|
|
2238
|
+
* let latestSpotterVizId = '';
|
|
2239
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2240
|
+
* latestSpotterVizId = payload.data.id;
|
|
2241
|
+
* });
|
|
2242
|
+
*
|
|
2243
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsPdf, { vizId: latestSpotterVizId });
|
|
2244
|
+
* ```
|
|
2142
2245
|
*
|
|
2143
2246
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2144
2247
|
*/
|
|
2145
2248
|
HostEvent["DownloadAsPdf"] = "downloadAsPdf";
|
|
2249
|
+
/**
|
|
2250
|
+
* Trigger the **AI Highlights** action on an embedded Liveboard
|
|
2251
|
+
*
|
|
2252
|
+
* @example
|
|
2253
|
+
* ```js
|
|
2254
|
+
* liveboardEmbed.trigger(HostEvent.AIHighlights)
|
|
2255
|
+
* ```
|
|
2256
|
+
* @version SDK: 1.44.0 | ThoughtSpot: 10.15.0.cl
|
|
2257
|
+
*/
|
|
2258
|
+
HostEvent["AIHighlights"] = "AIHighlights";
|
|
2146
2259
|
/**
|
|
2147
2260
|
* Trigger the **Make a copy** action on a Liveboard,
|
|
2148
2261
|
* visualization, or Answer page.
|
|
@@ -2165,9 +2278,13 @@
|
|
|
2165
2278
|
* ```
|
|
2166
2279
|
* @example
|
|
2167
2280
|
* ```js
|
|
2168
|
-
*
|
|
2169
|
-
*
|
|
2170
|
-
*
|
|
2281
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in MakeACopy host event.
|
|
2282
|
+
* let latestSpotterVizId = '';
|
|
2283
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2284
|
+
* latestSpotterVizId = payload.data.id;
|
|
2285
|
+
* });
|
|
2286
|
+
*
|
|
2287
|
+
* spotterEmbed.trigger(HostEvent.MakeACopy, { vizId: latestSpotterVizId });
|
|
2171
2288
|
* ```
|
|
2172
2289
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2173
2290
|
*/
|
|
@@ -2253,15 +2370,7 @@
|
|
|
2253
2370
|
* ```
|
|
2254
2371
|
* @example
|
|
2255
2372
|
* ```js
|
|
2256
|
-
*
|
|
2257
|
-
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2258
|
-
* });
|
|
2259
|
-
* ```
|
|
2260
|
-
* @example
|
|
2261
|
-
* ```js
|
|
2262
|
-
* const editResponse = await spotterEmbed.trigger(HostEvent.Edit, {
|
|
2263
|
-
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2264
|
-
* });
|
|
2373
|
+
* spotterEmbed.trigger(HostEvent.Edit);
|
|
2265
2374
|
* ```
|
|
2266
2375
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2267
2376
|
*/
|
|
@@ -2310,16 +2419,23 @@
|
|
|
2310
2419
|
* );
|
|
2311
2420
|
* })
|
|
2312
2421
|
* ```
|
|
2313
|
-
* @example
|
|
2422
|
+
* * @example
|
|
2314
2423
|
* ```js
|
|
2315
|
-
|
|
2316
|
-
|
|
2424
|
+
|
|
2425
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in Pin host event.
|
|
2426
|
+
* let latestSpotterVizId = '';
|
|
2427
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2428
|
+
* latestSpotterVizId = payload.data.id;
|
|
2429
|
+
* });
|
|
2430
|
+
*
|
|
2431
|
+
* spotterEmbed.trigger(HostEvent.GetTML, {
|
|
2432
|
+
* vizId: latestSpotterVizId
|
|
2317
2433
|
* }).then((tml) => {
|
|
2318
2434
|
* console.log(
|
|
2319
2435
|
* tml.answer.search_query // TML representation of the search query
|
|
2320
2436
|
* );
|
|
2321
2437
|
* })
|
|
2322
|
-
|
|
2438
|
+
* ```
|
|
2323
2439
|
* @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1.sw
|
|
2324
2440
|
* @important
|
|
2325
2441
|
*/
|
|
@@ -2383,7 +2499,7 @@
|
|
|
2383
2499
|
/**
|
|
2384
2500
|
* Trigger the **Download** action on charts in
|
|
2385
2501
|
* the embedded view.
|
|
2386
|
-
* @param - `vizId` refers to the
|
|
2502
|
+
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
|
|
2387
2503
|
* @example
|
|
2388
2504
|
* ```js
|
|
2389
2505
|
* liveboardEmbed.trigger(HostEvent.Download, {vizId:
|
|
@@ -2393,9 +2509,13 @@
|
|
|
2393
2509
|
* embed.trigger(HostEvent.Download)
|
|
2394
2510
|
* ```
|
|
2395
2511
|
* ```js
|
|
2396
|
-
*
|
|
2397
|
-
*
|
|
2398
|
-
*
|
|
2512
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in Download host event.
|
|
2513
|
+
* let latestSpotterVizId = '';
|
|
2514
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2515
|
+
* latestSpotterVizId = payload.data.id;
|
|
2516
|
+
* });
|
|
2517
|
+
*
|
|
2518
|
+
* spotterEmbed.trigger(HostEvent.Download, { vizId: latestSpotterVizId });
|
|
2399
2519
|
* ```
|
|
2400
2520
|
* @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw
|
|
2401
2521
|
* Use {@link DownloadAsPng}
|
|
@@ -2414,9 +2534,13 @@
|
|
|
2414
2534
|
*
|
|
2415
2535
|
* searchEmbed.trigger(HostEvent.DownloadAsPng)
|
|
2416
2536
|
*
|
|
2417
|
-
*
|
|
2418
|
-
*
|
|
2419
|
-
*
|
|
2537
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsPng host event.
|
|
2538
|
+
* let latestSpotterVizId = '';
|
|
2539
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2540
|
+
* latestSpotterVizId = payload.data.id;
|
|
2541
|
+
* });
|
|
2542
|
+
*
|
|
2543
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsPng, { vizId: latestSpotterVizId });
|
|
2420
2544
|
* ```
|
|
2421
2545
|
*
|
|
2422
2546
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
|
|
@@ -2425,7 +2549,7 @@
|
|
|
2425
2549
|
/**
|
|
2426
2550
|
* Trigger the **Download** > **CSV** action on tables in
|
|
2427
2551
|
* the embedded view.
|
|
2428
|
-
* @param - `vizId` refers to the
|
|
2552
|
+
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
|
|
2429
2553
|
* @example
|
|
2430
2554
|
* ```js
|
|
2431
2555
|
* liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId:
|
|
@@ -2438,9 +2562,13 @@
|
|
|
2438
2562
|
* searchEmbed.trigger(HostEvent.DownloadAsCsv)
|
|
2439
2563
|
* ```
|
|
2440
2564
|
* ```js
|
|
2441
|
-
*
|
|
2442
|
-
*
|
|
2443
|
-
*
|
|
2565
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsCsv host event.
|
|
2566
|
+
* let latestSpotterVizId = '';
|
|
2567
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2568
|
+
* latestSpotterVizId = payload.data.id;
|
|
2569
|
+
* });
|
|
2570
|
+
*
|
|
2571
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsCsv, { vizId: latestSpotterVizId });
|
|
2444
2572
|
* ```
|
|
2445
2573
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2446
2574
|
*/
|
|
@@ -2448,7 +2576,7 @@
|
|
|
2448
2576
|
/**
|
|
2449
2577
|
* Trigger the **Download** > **XLSX** action on tables
|
|
2450
2578
|
* in the embedded view.
|
|
2451
|
-
* @param - `vizId` refers to the
|
|
2579
|
+
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
|
|
2452
2580
|
* @example
|
|
2453
2581
|
* ```js
|
|
2454
2582
|
* liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId:
|
|
@@ -2461,9 +2589,13 @@
|
|
|
2461
2589
|
* searchEmbed.trigger(HostEvent.DownloadAsXlsx)
|
|
2462
2590
|
* ```
|
|
2463
2591
|
* ```js
|
|
2464
|
-
*
|
|
2465
|
-
*
|
|
2466
|
-
*
|
|
2592
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsXlsx host event.
|
|
2593
|
+
* let latestSpotterVizId = '';
|
|
2594
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2595
|
+
* latestSpotterVizId = payload.data.id;
|
|
2596
|
+
* });
|
|
2597
|
+
*
|
|
2598
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsXlsx, { vizId: latestSpotterVizId });
|
|
2467
2599
|
* ```
|
|
2468
2600
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2469
2601
|
*/
|
|
@@ -2500,7 +2632,7 @@
|
|
|
2500
2632
|
* ```
|
|
2501
2633
|
*
|
|
2502
2634
|
* ```js
|
|
2503
|
-
* // Save
|
|
2635
|
+
* // Save a Visualization in Spotter (requires vizId)
|
|
2504
2636
|
* spotterEmbed.trigger(HostEvent.Save, {
|
|
2505
2637
|
* vizId: "730496d6-6903-4601-937e-2c691821af3c"
|
|
2506
2638
|
* })
|
|
@@ -2801,15 +2933,21 @@
|
|
|
2801
2933
|
HostEvent["ResetLiveboardPersonalisedView"] = "ResetLiveboardPersonalisedView";
|
|
2802
2934
|
/**
|
|
2803
2935
|
* Triggers an action to update Parameter values on embedded
|
|
2804
|
-
* Answers, Liveboard and Spotter answer in Edit mode.
|
|
2936
|
+
* Answers, Liveboard, and Spotter answer in Edit mode.
|
|
2937
|
+
* @param - `name` - Name of the Parameter
|
|
2938
|
+
* @param - `value` - The value to set for the Parameter.
|
|
2939
|
+
*
|
|
2940
|
+
* Optionally, to control the visibility of the Parameter chip,
|
|
2941
|
+
* use the `isVisibleToUser` attribute when applying an override.
|
|
2805
2942
|
*
|
|
2806
2943
|
* @example
|
|
2807
2944
|
* ```js
|
|
2808
2945
|
* liveboardEmbed.trigger(HostEvent.UpdateParameters, [{
|
|
2809
|
-
*
|
|
2810
|
-
*
|
|
2946
|
+
* name: "Integer Range Param",
|
|
2947
|
+
* value: 10,
|
|
2948
|
+
* isVisibleToUser: false
|
|
2811
2949
|
* }])
|
|
2812
|
-
*
|
|
2950
|
+
* ```
|
|
2813
2951
|
* @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
|
|
2814
2952
|
*/
|
|
2815
2953
|
HostEvent["UpdateParameters"] = "UpdateParameters";
|
|
@@ -2822,11 +2960,13 @@
|
|
|
2822
2960
|
* });
|
|
2823
2961
|
*```
|
|
2824
2962
|
*```js
|
|
2825
|
-
*
|
|
2826
|
-
*
|
|
2827
|
-
*
|
|
2828
|
-
*
|
|
2963
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in GetParameters host event.
|
|
2964
|
+
* let latestSpotterVizId = '';
|
|
2965
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2966
|
+
* latestSpotterVizId = payload.data.id;
|
|
2829
2967
|
* });
|
|
2968
|
+
*
|
|
2969
|
+
* spotterEmbed.trigger(HostEvent.GetParameters, { vizId: latestSpotterVizId });
|
|
2830
2970
|
*```
|
|
2831
2971
|
* @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
|
|
2832
2972
|
*/
|
|
@@ -2856,10 +2996,11 @@
|
|
|
2856
2996
|
* If no parameters are specified, the save action is
|
|
2857
2997
|
* triggered with a modal to prompt users to
|
|
2858
2998
|
* add a name and description for the Answer.
|
|
2859
|
-
* @param -
|
|
2860
|
-
*
|
|
2861
|
-
*
|
|
2862
|
-
* @param - `
|
|
2999
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed
|
|
3000
|
+
* and is required in Spotter embed.
|
|
3001
|
+
* Optional attributes to set Answer properties include:
|
|
3002
|
+
* @param - `name` - Name string for the Answer.
|
|
3003
|
+
* @param - `description` - Description text for the Answer.
|
|
2863
3004
|
* @example
|
|
2864
3005
|
* ```js
|
|
2865
3006
|
* const saveAnswerResponse = await searchEmbed.trigger(HostEvent.SaveAnswer, {
|
|
@@ -2869,11 +3010,13 @@
|
|
|
2869
3010
|
* ```
|
|
2870
3011
|
* @example
|
|
2871
3012
|
* ```js
|
|
2872
|
-
*
|
|
2873
|
-
*
|
|
2874
|
-
*
|
|
2875
|
-
*
|
|
3013
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in SaveAnswer host event.
|
|
3014
|
+
* let latestSpotterVizId = '';
|
|
3015
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
3016
|
+
* latestSpotterVizId = payload.data.id;
|
|
2876
3017
|
* });
|
|
3018
|
+
*
|
|
3019
|
+
* spotterEmbed.trigger(HostEvent.SaveAnswer, { vizId: latestSpotterVizId });
|
|
2877
3020
|
* ```
|
|
2878
3021
|
* @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
|
|
2879
3022
|
*/
|
|
@@ -2957,12 +3100,15 @@
|
|
|
2957
3100
|
HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
|
|
2958
3101
|
/**
|
|
2959
3102
|
* Toggle the visualization to chart or table view.
|
|
2960
|
-
* @param - `vizId ` refers to the
|
|
3103
|
+
* @param - `vizId ` refers to the Visualization ID in Spotter embed and is required.
|
|
2961
3104
|
* @example
|
|
2962
3105
|
* ```js
|
|
2963
|
-
*
|
|
2964
|
-
*
|
|
3106
|
+
* let latestSpotterVizId = '';
|
|
3107
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
3108
|
+
* latestSpotterVizId = payload.data.id;
|
|
2965
3109
|
* });
|
|
3110
|
+
*
|
|
3111
|
+
* spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, { vizId: latestSpotterVizId });
|
|
2966
3112
|
*```
|
|
2967
3113
|
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
2968
3114
|
*/
|
|
@@ -2991,12 +3137,16 @@
|
|
|
2991
3137
|
*/
|
|
2992
3138
|
HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
|
|
2993
3139
|
/**
|
|
2994
|
-
* Trigger the *
|
|
2995
|
-
* @param - `vizId` refers to the
|
|
3140
|
+
* Trigger the *Spotter* action for visualizations present on the liveboard's vizzes.
|
|
3141
|
+
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required.
|
|
2996
3142
|
* @example
|
|
2997
3143
|
* ```js
|
|
2998
|
-
*
|
|
2999
|
-
* {
|
|
3144
|
+
* let latestSpotterVizId = '';
|
|
3145
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
3146
|
+
* latestSpotterVizId = payload.data.id;
|
|
3147
|
+
* });
|
|
3148
|
+
*
|
|
3149
|
+
* spotterEmbed.trigger(HostEvent.AskSpotter, { vizId: latestSpotterVizId });
|
|
3000
3150
|
* ```
|
|
3001
3151
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
3002
3152
|
*/
|
|
@@ -3020,6 +3170,18 @@
|
|
|
3020
3170
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
3021
3171
|
*/
|
|
3022
3172
|
HostEvent["DestroyEmbed"] = "EmbedDestroyed";
|
|
3173
|
+
/** Triggers a create new conversation operation in spotter embed.
|
|
3174
|
+
* @example
|
|
3175
|
+
* ```js
|
|
3176
|
+
* This feature is available only when chat history is enabled on your ThoughtSpot instance.
|
|
3177
|
+
* Contact your admin or ThoughtSpot Support to enable chat history on your instance.
|
|
3178
|
+
* @example
|
|
3179
|
+
* ```js
|
|
3180
|
+
* spotterEmbed.trigger(HostEvent.StartNewSpotterConversation);
|
|
3181
|
+
* ```
|
|
3182
|
+
* @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
|
|
3183
|
+
*/
|
|
3184
|
+
HostEvent["StartNewSpotterConversation"] = "StartNewSpotterConversation";
|
|
3023
3185
|
})(exports.HostEvent || (exports.HostEvent = {}));
|
|
3024
3186
|
/**
|
|
3025
3187
|
* The different visual modes that the data sources panel within
|
|
@@ -4607,7 +4769,25 @@
|
|
|
4607
4769
|
* @version SDK: 1.26.7 | ThoughtSpot Cloud: 9.10.0.cl
|
|
4608
4770
|
*/
|
|
4609
4771
|
LogLevel["TRACE"] = "TRACE";
|
|
4610
|
-
})(exports.LogLevel || (exports.LogLevel = {}));
|
|
4772
|
+
})(exports.LogLevel || (exports.LogLevel = {}));
|
|
4773
|
+
/**
|
|
4774
|
+
* Enum for the type of API intercepted
|
|
4775
|
+
*/
|
|
4776
|
+
var InterceptedApiType;
|
|
4777
|
+
(function (InterceptedApiType) {
|
|
4778
|
+
/**
|
|
4779
|
+
* The apis that are use to get the data for the embed
|
|
4780
|
+
*/
|
|
4781
|
+
InterceptedApiType["AnswerData"] = "AnswerData";
|
|
4782
|
+
/**
|
|
4783
|
+
* This will intercept all the apis
|
|
4784
|
+
*/
|
|
4785
|
+
InterceptedApiType["ALL"] = "ALL";
|
|
4786
|
+
/**
|
|
4787
|
+
* The apis that are use to get the data for the liveboard
|
|
4788
|
+
*/
|
|
4789
|
+
InterceptedApiType["LiveboardData"] = "LiveboardData";
|
|
4790
|
+
})(InterceptedApiType || (InterceptedApiType = {}));
|
|
4611
4791
|
|
|
4612
4792
|
const logFunctions = {
|
|
4613
4793
|
[exports.LogLevel.SILENT]: () => undefined,
|
|
@@ -4645,7 +4825,7 @@
|
|
|
4645
4825
|
canLog(logLevel) {
|
|
4646
4826
|
if (logLevel === exports.LogLevel.SILENT)
|
|
4647
4827
|
return false;
|
|
4648
|
-
if (
|
|
4828
|
+
if (globalLogLevelOverride !== undefined) {
|
|
4649
4829
|
return compareLogLevels(globalLogLevelOverride, logLevel) >= 0;
|
|
4650
4830
|
}
|
|
4651
4831
|
return compareLogLevels(this.logLevel, logLevel) >= 0;
|
|
@@ -7370,6 +7550,17 @@
|
|
|
7370
7550
|
|
|
7371
7551
|
var isEmpty_1 = isEmpty$1;
|
|
7372
7552
|
|
|
7553
|
+
var UIPassthroughEvent;
|
|
7554
|
+
(function (UIPassthroughEvent) {
|
|
7555
|
+
UIPassthroughEvent["PinAnswerToLiveboard"] = "addVizToPinboard";
|
|
7556
|
+
UIPassthroughEvent["SaveAnswer"] = "saveAnswer";
|
|
7557
|
+
UIPassthroughEvent["GetDiscoverabilityStatus"] = "getDiscoverabilityStatus";
|
|
7558
|
+
UIPassthroughEvent["GetAvailableUIPassthroughs"] = "getAvailableUiPassthroughs";
|
|
7559
|
+
UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
|
|
7560
|
+
UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
|
|
7561
|
+
UIPassthroughEvent["GetUnsavedAnswerTML"] = "getUnsavedAnswerTML";
|
|
7562
|
+
})(UIPassthroughEvent || (UIPassthroughEvent = {}));
|
|
7563
|
+
|
|
7373
7564
|
const ERROR_MESSAGE = {
|
|
7374
7565
|
INVALID_THOUGHTSPOT_HOST: 'Error parsing ThoughtSpot host. Please provide a valid URL.',
|
|
7375
7566
|
SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND: 'Please select a Model to get started',
|
|
@@ -17464,27 +17655,27 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17464
17655
|
* @param thoughtSpotHost
|
|
17465
17656
|
* @param containerEl
|
|
17466
17657
|
*/
|
|
17467
|
-
function processEventData(type,
|
|
17658
|
+
function processEventData(type, eventData, thoughtSpotHost, containerEl) {
|
|
17468
17659
|
switch (type) {
|
|
17469
17660
|
case exports.EmbedEvent.CustomAction:
|
|
17470
|
-
return processCustomAction(
|
|
17661
|
+
return processCustomAction(eventData, thoughtSpotHost);
|
|
17471
17662
|
case exports.EmbedEvent.AuthInit:
|
|
17472
|
-
return processAuthInit(
|
|
17663
|
+
return processAuthInit(eventData);
|
|
17473
17664
|
case exports.EmbedEvent.NoCookieAccess:
|
|
17474
|
-
return processNoCookieAccess(
|
|
17665
|
+
return processNoCookieAccess(eventData, containerEl);
|
|
17475
17666
|
case exports.EmbedEvent.AuthFailure:
|
|
17476
|
-
return processAuthFailure(
|
|
17667
|
+
return processAuthFailure(eventData, containerEl);
|
|
17477
17668
|
case exports.EmbedEvent.AuthLogout:
|
|
17478
|
-
return processAuthLogout(
|
|
17669
|
+
return processAuthLogout(eventData, containerEl);
|
|
17479
17670
|
case exports.EmbedEvent.ExitPresentMode:
|
|
17480
17671
|
return processExitPresentMode();
|
|
17481
17672
|
case exports.EmbedEvent.CLEAR_INFO_CACHE:
|
|
17482
17673
|
return processClearInfoCache();
|
|
17483
17674
|
}
|
|
17484
|
-
return
|
|
17675
|
+
return eventData;
|
|
17485
17676
|
}
|
|
17486
17677
|
|
|
17487
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.
|
|
17678
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.43.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 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$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};
|
|
17488
17679
|
|
|
17489
17680
|
/**
|
|
17490
17681
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -17556,16 +17747,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17556
17747
|
});
|
|
17557
17748
|
}
|
|
17558
17749
|
|
|
17559
|
-
var UIPassthroughEvent;
|
|
17560
|
-
(function (UIPassthroughEvent) {
|
|
17561
|
-
UIPassthroughEvent["PinAnswerToLiveboard"] = "addVizToPinboard";
|
|
17562
|
-
UIPassthroughEvent["SaveAnswer"] = "saveAnswer";
|
|
17563
|
-
UIPassthroughEvent["GetDiscoverabilityStatus"] = "getDiscoverabilityStatus";
|
|
17564
|
-
UIPassthroughEvent["GetAvailableUIPassthroughs"] = "getAvailableUiPassthroughs";
|
|
17565
|
-
UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
|
|
17566
|
-
UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
|
|
17567
|
-
})(UIPassthroughEvent || (UIPassthroughEvent = {}));
|
|
17568
|
-
|
|
17569
17750
|
class HostEventClient {
|
|
17570
17751
|
constructor(iFrame) {
|
|
17571
17752
|
this.iFrame = iFrame;
|
|
@@ -17657,6 +17838,174 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17657
17838
|
}
|
|
17658
17839
|
}
|
|
17659
17840
|
|
|
17841
|
+
const DefaultInterceptUrlsMap = {
|
|
17842
|
+
[InterceptedApiType.AnswerData]: [
|
|
17843
|
+
'/prism/?op=GetChartWithData',
|
|
17844
|
+
'/prism/?op=GetTableWithHeadlineData',
|
|
17845
|
+
'/prism/?op=GetTableWithData',
|
|
17846
|
+
],
|
|
17847
|
+
[InterceptedApiType.LiveboardData]: [
|
|
17848
|
+
'/prism/?op=LoadContextBook'
|
|
17849
|
+
],
|
|
17850
|
+
};
|
|
17851
|
+
const formatInterceptUrl = (url) => {
|
|
17852
|
+
const host = getThoughtSpotHost(getEmbedConfig());
|
|
17853
|
+
if (url.startsWith('/'))
|
|
17854
|
+
return `${host}${url}`;
|
|
17855
|
+
return url;
|
|
17856
|
+
};
|
|
17857
|
+
/**
|
|
17858
|
+
* Converts user passed url values to proper urls
|
|
17859
|
+
* [ANSER_DATA] => ['https://host/pris/op?=op']
|
|
17860
|
+
* @param interceptUrls
|
|
17861
|
+
* @returns
|
|
17862
|
+
*/
|
|
17863
|
+
const processInterceptUrls = (interceptUrls) => {
|
|
17864
|
+
let processedUrls = [...interceptUrls];
|
|
17865
|
+
Object.entries(DefaultInterceptUrlsMap).forEach(([apiType, apiTypeUrls]) => {
|
|
17866
|
+
if (!processedUrls.includes(apiType))
|
|
17867
|
+
return;
|
|
17868
|
+
processedUrls = processedUrls.filter(url => url !== apiType);
|
|
17869
|
+
processedUrls = [...processedUrls, ...apiTypeUrls];
|
|
17870
|
+
});
|
|
17871
|
+
return processedUrls.map(url => formatInterceptUrl(url));
|
|
17872
|
+
};
|
|
17873
|
+
/**
|
|
17874
|
+
* Returns the data to be sent to embed to setup intercepts
|
|
17875
|
+
* the urls to intercept, timeout etc
|
|
17876
|
+
* @param viewConfig
|
|
17877
|
+
* @returns
|
|
17878
|
+
*/
|
|
17879
|
+
const getInterceptInitData = (viewConfig) => {
|
|
17880
|
+
const combinedUrls = [...(viewConfig.interceptUrls || [])];
|
|
17881
|
+
if (viewConfig.isOnBeforeGetVizDataInterceptEnabled) {
|
|
17882
|
+
combinedUrls.push(InterceptedApiType.AnswerData);
|
|
17883
|
+
}
|
|
17884
|
+
const shouldInterceptAll = combinedUrls.includes(InterceptedApiType.ALL);
|
|
17885
|
+
const interceptUrls = shouldInterceptAll ? [InterceptedApiType.ALL] : processInterceptUrls(combinedUrls);
|
|
17886
|
+
const interceptTimeout = viewConfig.interceptTimeout;
|
|
17887
|
+
return {
|
|
17888
|
+
interceptUrls,
|
|
17889
|
+
interceptTimeout,
|
|
17890
|
+
};
|
|
17891
|
+
};
|
|
17892
|
+
const parseJson = (jsonString) => {
|
|
17893
|
+
try {
|
|
17894
|
+
const json = JSON.parse(jsonString);
|
|
17895
|
+
return [json, null];
|
|
17896
|
+
}
|
|
17897
|
+
catch (error) {
|
|
17898
|
+
return [null, error];
|
|
17899
|
+
}
|
|
17900
|
+
};
|
|
17901
|
+
/**
|
|
17902
|
+
* Parse the api intercept data and return the parsed data and error if any
|
|
17903
|
+
* Embed returns the input and init from the fetch call
|
|
17904
|
+
*/
|
|
17905
|
+
const parseInterceptData = (eventDataString) => {
|
|
17906
|
+
try {
|
|
17907
|
+
const [parsedData, error] = parseJson(eventDataString);
|
|
17908
|
+
if (error) {
|
|
17909
|
+
return [null, error];
|
|
17910
|
+
}
|
|
17911
|
+
const { input, init } = parsedData;
|
|
17912
|
+
const [parsedBody, bodyParseError] = parseJson(init.body);
|
|
17913
|
+
if (!bodyParseError) {
|
|
17914
|
+
init.body = parsedBody;
|
|
17915
|
+
}
|
|
17916
|
+
const parsedInit = { input, init };
|
|
17917
|
+
return [parsedInit, null];
|
|
17918
|
+
}
|
|
17919
|
+
catch (error) {
|
|
17920
|
+
return [null, error];
|
|
17921
|
+
}
|
|
17922
|
+
};
|
|
17923
|
+
const getUrlType = (url) => {
|
|
17924
|
+
for (const [apiType, apiTypeUrls] of Object.entries(DefaultInterceptUrlsMap)) {
|
|
17925
|
+
if (apiTypeUrls.includes(url))
|
|
17926
|
+
return apiType;
|
|
17927
|
+
}
|
|
17928
|
+
// TODO: have a unknown type maybe ??
|
|
17929
|
+
return InterceptedApiType.ALL;
|
|
17930
|
+
};
|
|
17931
|
+
/**
|
|
17932
|
+
* Handle Api intercept event and simulate legacy onBeforeGetVizDataIntercept event
|
|
17933
|
+
*
|
|
17934
|
+
* embed sends -> ApiIntercept -> we send
|
|
17935
|
+
* ApiIntercept
|
|
17936
|
+
* OnBeforeGetVizDataIntercept (if url is part of DefaultUrlMap.AnswerData)
|
|
17937
|
+
*
|
|
17938
|
+
* @param params
|
|
17939
|
+
* @returns
|
|
17940
|
+
*/
|
|
17941
|
+
const handleInterceptEvent = async (params) => {
|
|
17942
|
+
var _a, _b, _c, _d, _e;
|
|
17943
|
+
const { eventData, executeEvent, viewConfig, getUnsavedAnswerTml } = params;
|
|
17944
|
+
const [interceptData, bodyParseError] = parseInterceptData(eventData.data);
|
|
17945
|
+
if (bodyParseError) {
|
|
17946
|
+
executeEvent(exports.EmbedEvent.Error, {
|
|
17947
|
+
error: 'Error parsing api intercept body',
|
|
17948
|
+
});
|
|
17949
|
+
logger$3.error('Error parsing request body', bodyParseError);
|
|
17950
|
+
return;
|
|
17951
|
+
}
|
|
17952
|
+
const { input: requestUrl, init } = interceptData;
|
|
17953
|
+
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;
|
|
17954
|
+
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;
|
|
17955
|
+
const answerDataUrls = DefaultInterceptUrlsMap[InterceptedApiType.AnswerData];
|
|
17956
|
+
const legacyInterceptEnabled = viewConfig.isOnBeforeGetVizDataInterceptEnabled;
|
|
17957
|
+
const isAnswerDataUrl = answerDataUrls.includes(requestUrl);
|
|
17958
|
+
const sendLegacyIntercept = isAnswerDataUrl && legacyInterceptEnabled;
|
|
17959
|
+
if (sendLegacyIntercept) {
|
|
17960
|
+
const answerTml = await getUnsavedAnswerTml({ sessionId, vizId });
|
|
17961
|
+
// Build the legacy payload for backwards compatibility
|
|
17962
|
+
const legacyPayload = {
|
|
17963
|
+
data: {
|
|
17964
|
+
data: answerTml,
|
|
17965
|
+
status: embedEventStatus.END,
|
|
17966
|
+
type: exports.EmbedEvent.OnBeforeGetVizDataIntercept
|
|
17967
|
+
}
|
|
17968
|
+
};
|
|
17969
|
+
executeEvent(exports.EmbedEvent.OnBeforeGetVizDataIntercept, legacyPayload);
|
|
17970
|
+
}
|
|
17971
|
+
const urlType = getUrlType(requestUrl);
|
|
17972
|
+
executeEvent(exports.EmbedEvent.ApiIntercept, { ...interceptData, urlType });
|
|
17973
|
+
};
|
|
17974
|
+
/**
|
|
17975
|
+
* Support both the legacy and new format of the api intercept response
|
|
17976
|
+
* @param payload
|
|
17977
|
+
* @returns
|
|
17978
|
+
*/
|
|
17979
|
+
const processApiInterceptResponse = (payload) => {
|
|
17980
|
+
var _a;
|
|
17981
|
+
const isLegacyFormat = (_a = payload === null || payload === void 0 ? void 0 : payload.data) === null || _a === void 0 ? void 0 : _a.error;
|
|
17982
|
+
if (isLegacyFormat) {
|
|
17983
|
+
return processLegacyInterceptResponse(payload);
|
|
17984
|
+
}
|
|
17985
|
+
return payload;
|
|
17986
|
+
};
|
|
17987
|
+
const processLegacyInterceptResponse = (payload) => {
|
|
17988
|
+
var _a, _b, _c, _d, _e;
|
|
17989
|
+
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;
|
|
17990
|
+
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;
|
|
17991
|
+
const payloadToSend = {
|
|
17992
|
+
execute: (_e = payload === null || payload === void 0 ? void 0 : payload.data) === null || _e === void 0 ? void 0 : _e.execute,
|
|
17993
|
+
response: {
|
|
17994
|
+
body: {
|
|
17995
|
+
errors: [
|
|
17996
|
+
{
|
|
17997
|
+
title: errorText,
|
|
17998
|
+
description: errorDescription,
|
|
17999
|
+
isUserError: true,
|
|
18000
|
+
},
|
|
18001
|
+
],
|
|
18002
|
+
data: {},
|
|
18003
|
+
},
|
|
18004
|
+
},
|
|
18005
|
+
};
|
|
18006
|
+
return { data: payloadToSend };
|
|
18007
|
+
};
|
|
18008
|
+
|
|
17660
18009
|
/**
|
|
17661
18010
|
* Copyright (c) 2022
|
|
17662
18011
|
*
|
|
@@ -17710,6 +18059,19 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17710
18059
|
*/
|
|
17711
18060
|
this.fullscreenChangeHandler = null;
|
|
17712
18061
|
this.subscribedListeners = {};
|
|
18062
|
+
this.messageEventListener = (event) => {
|
|
18063
|
+
const eventType = this.getEventType(event);
|
|
18064
|
+
const eventPort = this.getEventPort(event);
|
|
18065
|
+
const eventData = this.formatEventData(event, eventType);
|
|
18066
|
+
if (event.source === this.iFrame.contentWindow) {
|
|
18067
|
+
const processedEventData = processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.el);
|
|
18068
|
+
if (eventType === exports.EmbedEvent.ApiIntercept) {
|
|
18069
|
+
this.handleApiInterceptEvent({ eventData, eventPort });
|
|
18070
|
+
return;
|
|
18071
|
+
}
|
|
18072
|
+
this.executeCallbacks(eventType, processedEventData, eventPort);
|
|
18073
|
+
}
|
|
18074
|
+
};
|
|
17713
18075
|
/**
|
|
17714
18076
|
* Send Custom style as part of payload of APP_INIT
|
|
17715
18077
|
* @param _
|
|
@@ -17794,6 +18156,28 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17794
18156
|
this.on(exports.EmbedEvent.AuthInit, authInitHandler, { start: false }, true);
|
|
17795
18157
|
};
|
|
17796
18158
|
this.showPreRenderByDefault = false;
|
|
18159
|
+
/**
|
|
18160
|
+
* We can process the customer given payload before sending it to the embed port
|
|
18161
|
+
* Embed event handler -> responder -> createEmbedEventResponder -> send response
|
|
18162
|
+
* @param eventPort The event port for a specific MessageChannel
|
|
18163
|
+
* @param eventType The event type
|
|
18164
|
+
* @returns
|
|
18165
|
+
*/
|
|
18166
|
+
this.createEmbedEventResponder = (eventPort, eventType) => {
|
|
18167
|
+
const getPayloadToSend = (payload) => {
|
|
18168
|
+
if (eventType === exports.EmbedEvent.OnBeforeGetVizDataIntercept) {
|
|
18169
|
+
return processLegacyInterceptResponse(payload);
|
|
18170
|
+
}
|
|
18171
|
+
if (eventType === exports.EmbedEvent.ApiIntercept) {
|
|
18172
|
+
return processApiInterceptResponse(payload);
|
|
18173
|
+
}
|
|
18174
|
+
return payload;
|
|
18175
|
+
};
|
|
18176
|
+
return (payload) => {
|
|
18177
|
+
const payloadToSend = getPayloadToSend(payload);
|
|
18178
|
+
this.triggerEventOnPort(eventPort, payloadToSend);
|
|
18179
|
+
};
|
|
18180
|
+
};
|
|
17797
18181
|
/**
|
|
17798
18182
|
* @hidden
|
|
17799
18183
|
* Internal state to track if the embed container is loaded.
|
|
@@ -17974,21 +18358,24 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17974
18358
|
this.subscribedListeners.online = onlineEventListener;
|
|
17975
18359
|
this.subscribedListeners.offline = offlineEventListener;
|
|
17976
18360
|
}
|
|
18361
|
+
handleApiInterceptEvent({ eventData, eventPort }) {
|
|
18362
|
+
const executeEvent = (_eventType, data) => {
|
|
18363
|
+
this.executeCallbacks(_eventType, data, eventPort);
|
|
18364
|
+
};
|
|
18365
|
+
const getUnsavedAnswerTml = async (props) => {
|
|
18366
|
+
var _a, _b;
|
|
18367
|
+
const response = await this.triggerUIPassThrough(UIPassthroughEvent.GetUnsavedAnswerTML, props);
|
|
18368
|
+
return (_b = (_a = response.filter((item) => item.value)) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.value;
|
|
18369
|
+
};
|
|
18370
|
+
handleInterceptEvent({ eventData, executeEvent, viewConfig: this.viewConfig, getUnsavedAnswerTml });
|
|
18371
|
+
}
|
|
17977
18372
|
/**
|
|
17978
18373
|
* Subscribe to message events that depend on successful iframe setup
|
|
17979
18374
|
*/
|
|
17980
18375
|
subscribeToMessageEvents() {
|
|
17981
18376
|
this.unsubscribeToMessageEvents();
|
|
17982
|
-
|
|
17983
|
-
|
|
17984
|
-
const eventPort = this.getEventPort(event);
|
|
17985
|
-
const eventData = this.formatEventData(event, eventType);
|
|
17986
|
-
if (event.source === this.iFrame.contentWindow) {
|
|
17987
|
-
this.executeCallbacks(eventType, processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.el), eventPort);
|
|
17988
|
-
}
|
|
17989
|
-
};
|
|
17990
|
-
window.addEventListener('message', messageEventListener);
|
|
17991
|
-
this.subscribedListeners.message = messageEventListener;
|
|
18377
|
+
window.addEventListener('message', this.messageEventListener);
|
|
18378
|
+
this.subscribedListeners.message = this.messageEventListener;
|
|
17992
18379
|
}
|
|
17993
18380
|
/**
|
|
17994
18381
|
* Adds event listeners for both network and message events.
|
|
@@ -18049,7 +18436,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18049
18436
|
message: customActionsResult.errors,
|
|
18050
18437
|
});
|
|
18051
18438
|
}
|
|
18052
|
-
|
|
18439
|
+
const baseInitData = {
|
|
18053
18440
|
customisations: getCustomisations(this.embedConfig, this.viewConfig),
|
|
18054
18441
|
authToken,
|
|
18055
18442
|
runtimeFilterParams: this.viewConfig.excludeRuntimeFiltersfromURL
|
|
@@ -18067,7 +18454,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18067
18454
|
customVariablesForThirdPartyTools: this.embedConfig.customVariablesForThirdPartyTools || {},
|
|
18068
18455
|
hiddenListColumns: this.viewConfig.hiddenListColumns || [],
|
|
18069
18456
|
customActions: customActionsResult.actions,
|
|
18457
|
+
...getInterceptInitData(this.viewConfig),
|
|
18070
18458
|
};
|
|
18459
|
+
return baseInitData;
|
|
18071
18460
|
}
|
|
18072
18461
|
async getAppInitData() {
|
|
18073
18462
|
return this.getDefaultAppInitData();
|
|
@@ -18088,7 +18477,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18088
18477
|
}
|
|
18089
18478
|
getUpdateEmbedParamsObject() {
|
|
18090
18479
|
let queryParams = this.getEmbedParamsObject();
|
|
18091
|
-
queryParams = { ...this.viewConfig, ...queryParams };
|
|
18480
|
+
queryParams = { ...this.viewConfig, ...queryParams, ...this.getAppInitData() };
|
|
18092
18481
|
return queryParams;
|
|
18093
18482
|
}
|
|
18094
18483
|
/**
|
|
@@ -18496,9 +18885,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18496
18885
|
// When start status is false it trigger only end releated
|
|
18497
18886
|
// payload
|
|
18498
18887
|
|| (!callbackObj.options.start && dataStatus === embedEventStatus.END)) {
|
|
18499
|
-
|
|
18500
|
-
|
|
18501
|
-
});
|
|
18888
|
+
const responder = this.createEmbedEventResponder(eventPort, eventType);
|
|
18889
|
+
callbackObj.callback(data, responder);
|
|
18502
18890
|
}
|
|
18503
18891
|
});
|
|
18504
18892
|
}
|
|
@@ -19265,7 +19653,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19265
19653
|
}
|
|
19266
19654
|
getEmbedParamsObject() {
|
|
19267
19655
|
var _a;
|
|
19268
|
-
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = true, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false,
|
|
19656
|
+
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;
|
|
19269
19657
|
const queryParams = this.getBaseQueryParams();
|
|
19270
19658
|
queryParams[Param.HideActions] = [
|
|
19271
19659
|
...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
|
|
@@ -19297,9 +19685,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19297
19685
|
if (hideSearchBar) {
|
|
19298
19686
|
queryParams[Param.HideSearchBar] = true;
|
|
19299
19687
|
}
|
|
19300
|
-
if (isOnBeforeGetVizDataInterceptEnabled) {
|
|
19301
|
-
queryParams[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
19302
|
-
}
|
|
19303
19688
|
if (!focusSearchBarOnRender) {
|
|
19304
19689
|
queryParams[Param.FocusSearchBarOnRender] = focusSearchBarOnRender;
|
|
19305
19690
|
}
|
|
@@ -19558,7 +19943,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19558
19943
|
* embedded Liveboard or visualization.
|
|
19559
19944
|
*/
|
|
19560
19945
|
getEmbedParams() {
|
|
19561
|
-
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,
|
|
19946
|
+
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, } = this.viewConfig;
|
|
19562
19947
|
let params = {};
|
|
19563
19948
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
19564
19949
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -19576,7 +19961,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19576
19961
|
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
19577
19962
|
params[Param.IsUnifiedSearchExperienceEnabled] = isUnifiedSearchExperienceEnabled;
|
|
19578
19963
|
params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF;
|
|
19579
|
-
params[Param.LiveboardXLSXCSVDownload] = !!liveboardXLSXCSVDownload;
|
|
19580
19964
|
params = this.getBaseQueryParams(params);
|
|
19581
19965
|
if (hideObjectSearch) {
|
|
19582
19966
|
params[Param.HideObjectSearch] = !!hideObjectSearch;
|
|
@@ -19612,9 +19996,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19612
19996
|
if (enableAskSage) {
|
|
19613
19997
|
params[Param.enableAskSage] = enableAskSage;
|
|
19614
19998
|
}
|
|
19615
|
-
if (isOnBeforeGetVizDataInterceptEnabled) {
|
|
19616
|
-
params[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
19617
|
-
}
|
|
19618
19999
|
if (homePageSearchBarMode) {
|
|
19619
20000
|
params[Param.HomePageSearchBarMode] = homePageSearchBarMode;
|
|
19620
20001
|
}
|
|
@@ -19624,6 +20005,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19624
20005
|
if (isLiveboardStylingAndGroupingEnabled !== undefined) {
|
|
19625
20006
|
params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
|
|
19626
20007
|
}
|
|
20008
|
+
if (liveboardXLSXCSVDownload !== undefined) {
|
|
20009
|
+
params[Param.LiveboardXLSXCSVDownload] = !!liveboardXLSXCSVDownload;
|
|
20010
|
+
}
|
|
19627
20011
|
if (isPNGInScheduledEmailsEnabled !== undefined) {
|
|
19628
20012
|
params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
|
|
19629
20013
|
}
|
|
@@ -19990,7 +20374,7 @@ query GetEurekaVizSnapshots(
|
|
|
19990
20374
|
getEmbedParamsObject() {
|
|
19991
20375
|
let params = {};
|
|
19992
20376
|
params = this.getBaseQueryParams(params);
|
|
19993
|
-
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
|
|
20377
|
+
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, } = this.viewConfig;
|
|
19994
20378
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
19995
20379
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
19996
20380
|
if (fullHeight === true) {
|
|
@@ -20070,7 +20454,9 @@ query GetEurekaVizSnapshots(
|
|
|
20070
20454
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
20071
20455
|
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
20072
20456
|
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
20073
|
-
|
|
20457
|
+
if (liveboardXLSXCSVDownload !== undefined) {
|
|
20458
|
+
params[Param.LiveboardXLSXCSVDownload] = !!liveboardXLSXCSVDownload;
|
|
20459
|
+
}
|
|
20074
20460
|
getQueryParamString(params, true);
|
|
20075
20461
|
return params;
|
|
20076
20462
|
}
|
|
@@ -20821,7 +21207,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
20821
21207
|
return queryParams;
|
|
20822
21208
|
}
|
|
20823
21209
|
getIframeSrc() {
|
|
20824
|
-
const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, enablePastConversationsSidebar } = this.viewConfig;
|
|
21210
|
+
const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, enablePastConversationsSidebar, } = this.viewConfig;
|
|
20825
21211
|
const path = 'insights/conv-assist';
|
|
20826
21212
|
const queryParams = this.getEmbedParamsObject();
|
|
20827
21213
|
if (!isUndefined_1(enablePastConversationsSidebar)) {
|