@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.es.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
|
import * as React from 'react';
|
|
4
4
|
import React__default, { useRef, useCallback } from 'react';
|
|
@@ -614,7 +614,7 @@ var EmbedEvent;
|
|
|
614
614
|
*/
|
|
615
615
|
EmbedEvent["Load"] = "load";
|
|
616
616
|
/**
|
|
617
|
-
* Data pertaining to an Answer or
|
|
617
|
+
* Data pertaining to an Answer, Liveboard or Spotter visualization is received.
|
|
618
618
|
* The event payload includes the raw data of the object.
|
|
619
619
|
* @return data - Answer of Liveboard data
|
|
620
620
|
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
@@ -1033,6 +1033,17 @@ var EmbedEvent;
|
|
|
1033
1033
|
*```
|
|
1034
1034
|
*/
|
|
1035
1035
|
EmbedEvent["AnswerDelete"] = "answerDelete";
|
|
1036
|
+
/**
|
|
1037
|
+
* Emitted when the AI Highlights action is triggered on a Liveboard
|
|
1038
|
+
* @version SDK: 1.44.0 | ThoughtSpot: 10.15.0.cl
|
|
1039
|
+
* @example
|
|
1040
|
+
*```js
|
|
1041
|
+
* liveboardEmbed.on(EmbedEvent.AIHighlights, (payload) => {
|
|
1042
|
+
* console.log('AI Highlights', payload);
|
|
1043
|
+
* })
|
|
1044
|
+
*```
|
|
1045
|
+
*/
|
|
1046
|
+
EmbedEvent["AIHighlights"] = "AIHighlights";
|
|
1036
1047
|
/**
|
|
1037
1048
|
* Emitted when a user initiates the Pin action to
|
|
1038
1049
|
* add an Answer to a Liveboard.
|
|
@@ -1463,21 +1474,24 @@ var EmbedEvent;
|
|
|
1463
1474
|
|
|
1464
1475
|
* Prerequisite: Set `isOnBeforeGetVizDataInterceptEnabled` to `true`
|
|
1465
1476
|
* for this embed event to get emitted.
|
|
1466
|
-
* @param: payload
|
|
1467
|
-
* @param:
|
|
1477
|
+
* @param:payload The payload received from the embed related to the Data API call.
|
|
1478
|
+
* @param:responder
|
|
1468
1479
|
* Contains elements that lets developers define whether ThoughtSpot
|
|
1469
1480
|
* should run the search, and if not, what error message
|
|
1470
1481
|
* should be shown to the user.
|
|
1471
1482
|
*
|
|
1472
|
-
* execute
|
|
1483
|
+
* `execute` - When execute returns `true`, the search will be run.
|
|
1473
1484
|
* When execute returns `false`, the search will not be executed.
|
|
1474
1485
|
*
|
|
1475
|
-
* error
|
|
1476
|
-
*
|
|
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.
|
|
1477
1491
|
* @version SDK : 1.29.0 | ThoughtSpot: 10.3.0.cl
|
|
1478
1492
|
* @example
|
|
1479
1493
|
*```js
|
|
1480
|
-
* .on(EmbedEvent.OnBeforeGetVizDataIntercept,
|
|
1494
|
+
* embed.on(EmbedEvent.OnBeforeGetVizDataIntercept,
|
|
1481
1495
|
* (payload, responder) => {
|
|
1482
1496
|
* responder({
|
|
1483
1497
|
* data: {
|
|
@@ -1493,7 +1507,7 @@ var EmbedEvent;
|
|
|
1493
1507
|
* ```
|
|
1494
1508
|
*
|
|
1495
1509
|
*```js
|
|
1496
|
-
* .on(EmbedEvent.OnBeforeGetVizDataIntercept,
|
|
1510
|
+
* embed.on(EmbedEvent.OnBeforeGetVizDataIntercept,
|
|
1497
1511
|
* (payload, responder) => {
|
|
1498
1512
|
* const query = payload.data.data.answer.search_query
|
|
1499
1513
|
* responder({
|
|
@@ -1504,7 +1518,8 @@ var EmbedEvent;
|
|
|
1504
1518
|
* error: {
|
|
1505
1519
|
* //Provide a custom error message to explain to your end user
|
|
1506
1520
|
* // why their search did not run, and which searches are accepted by your custom logic.
|
|
1507
|
-
* errorText: "
|
|
1521
|
+
* errorText: "Error Occurred",
|
|
1522
|
+
* errorDescription: "You can't use this query :" + query + ".
|
|
1508
1523
|
* The 'sales' measures can never be used at the 'county' level.
|
|
1509
1524
|
* Please try another measure, or remove 'county' from your search."
|
|
1510
1525
|
* }
|
|
@@ -1568,17 +1583,17 @@ var EmbedEvent;
|
|
|
1568
1583
|
*/
|
|
1569
1584
|
EmbedEvent["TableVizRendered"] = "TableVizRendered";
|
|
1570
1585
|
/**
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
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
|
+
*/
|
|
1582
1597
|
EmbedEvent["CreateLiveboard"] = "createLiveboard";
|
|
1583
1598
|
/**
|
|
1584
1599
|
* Emitted when a user creates a Model.
|
|
@@ -1674,6 +1689,17 @@ var EmbedEvent;
|
|
|
1674
1689
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1675
1690
|
*/
|
|
1676
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";
|
|
1677
1703
|
/**
|
|
1678
1704
|
* @hidden
|
|
1679
1705
|
* Triggers when the embed listener is ready to receive events.
|
|
@@ -1697,6 +1723,72 @@ var EmbedEvent;
|
|
|
1697
1723
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1698
1724
|
*/
|
|
1699
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";
|
|
1700
1792
|
})(EmbedEvent || (EmbedEvent = {}));
|
|
1701
1793
|
/**
|
|
1702
1794
|
* Event types that can be triggered by the host application
|
|
@@ -1983,7 +2075,7 @@ var HostEvent;
|
|
|
1983
2075
|
* the following parameters:
|
|
1984
2076
|
*
|
|
1985
2077
|
* @param
|
|
1986
|
-
* `vizId`- GUID of the saved Answer or visualization to pin to a Liveboard.
|
|
2078
|
+
* `vizId`- GUID of the saved Answer or Spotter visualization ID to pin to a Liveboard.
|
|
1987
2079
|
* Optional when pinning a new chart or table generated from a Search query.
|
|
1988
2080
|
* **Required** in Spotter Embed.
|
|
1989
2081
|
* @param
|
|
@@ -2035,10 +2127,16 @@ var HostEvent;
|
|
|
2035
2127
|
* ```
|
|
2036
2128
|
* @example
|
|
2037
2129
|
* ```js
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2130
|
+
|
|
2131
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in Pin host event.
|
|
2132
|
+
* let latestSpotterVizId = '';
|
|
2133
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2134
|
+
* latestSpotterVizId = payload.data.id;
|
|
2135
|
+
* });
|
|
2136
|
+
*
|
|
2137
|
+
* spotterEmbed.trigger(HostEvent.Pin, { vizId: latestSpotterVizId });
|
|
2138
|
+
* ```
|
|
2139
|
+
*
|
|
2042
2140
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2043
2141
|
*/
|
|
2044
2142
|
HostEvent["Pin"] = "pin";
|
|
@@ -2113,14 +2211,29 @@ var HostEvent;
|
|
|
2113
2211
|
* ```
|
|
2114
2212
|
* @example
|
|
2115
2213
|
* ```js
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2214
|
+
|
|
2215
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsPdf host event.
|
|
2216
|
+
* let latestSpotterVizId = '';
|
|
2217
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2218
|
+
* latestSpotterVizId = payload.data.id;
|
|
2219
|
+
* });
|
|
2220
|
+
*
|
|
2221
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsPdf, { vizId: latestSpotterVizId });
|
|
2222
|
+
* ```
|
|
2120
2223
|
*
|
|
2121
2224
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2122
2225
|
*/
|
|
2123
2226
|
HostEvent["DownloadAsPdf"] = "downloadAsPdf";
|
|
2227
|
+
/**
|
|
2228
|
+
* Trigger the **AI Highlights** action on an embedded Liveboard
|
|
2229
|
+
*
|
|
2230
|
+
* @example
|
|
2231
|
+
* ```js
|
|
2232
|
+
* liveboardEmbed.trigger(HostEvent.AIHighlights)
|
|
2233
|
+
* ```
|
|
2234
|
+
* @version SDK: 1.44.0 | ThoughtSpot: 10.15.0.cl
|
|
2235
|
+
*/
|
|
2236
|
+
HostEvent["AIHighlights"] = "AIHighlights";
|
|
2124
2237
|
/**
|
|
2125
2238
|
* Trigger the **Make a copy** action on a Liveboard,
|
|
2126
2239
|
* visualization, or Answer page.
|
|
@@ -2143,9 +2256,13 @@ var HostEvent;
|
|
|
2143
2256
|
* ```
|
|
2144
2257
|
* @example
|
|
2145
2258
|
* ```js
|
|
2146
|
-
*
|
|
2147
|
-
*
|
|
2148
|
-
*
|
|
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 });
|
|
2149
2266
|
* ```
|
|
2150
2267
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2151
2268
|
*/
|
|
@@ -2231,15 +2348,7 @@ var HostEvent;
|
|
|
2231
2348
|
* ```
|
|
2232
2349
|
* @example
|
|
2233
2350
|
* ```js
|
|
2234
|
-
*
|
|
2235
|
-
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2236
|
-
* });
|
|
2237
|
-
* ```
|
|
2238
|
-
* @example
|
|
2239
|
-
* ```js
|
|
2240
|
-
* const editResponse = await spotterEmbed.trigger(HostEvent.Edit, {
|
|
2241
|
-
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2242
|
-
* });
|
|
2351
|
+
* spotterEmbed.trigger(HostEvent.Edit);
|
|
2243
2352
|
* ```
|
|
2244
2353
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2245
2354
|
*/
|
|
@@ -2288,16 +2397,23 @@ var HostEvent;
|
|
|
2288
2397
|
* );
|
|
2289
2398
|
* })
|
|
2290
2399
|
* ```
|
|
2291
|
-
* @example
|
|
2400
|
+
* * @example
|
|
2292
2401
|
* ```js
|
|
2293
|
-
|
|
2294
|
-
|
|
2402
|
+
|
|
2403
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in Pin host event.
|
|
2404
|
+
* let latestSpotterVizId = '';
|
|
2405
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2406
|
+
* latestSpotterVizId = payload.data.id;
|
|
2407
|
+
* });
|
|
2408
|
+
*
|
|
2409
|
+
* spotterEmbed.trigger(HostEvent.GetTML, {
|
|
2410
|
+
* vizId: latestSpotterVizId
|
|
2295
2411
|
* }).then((tml) => {
|
|
2296
2412
|
* console.log(
|
|
2297
2413
|
* tml.answer.search_query // TML representation of the search query
|
|
2298
2414
|
* );
|
|
2299
2415
|
* })
|
|
2300
|
-
|
|
2416
|
+
* ```
|
|
2301
2417
|
* @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1.sw
|
|
2302
2418
|
* @important
|
|
2303
2419
|
*/
|
|
@@ -2361,7 +2477,7 @@ var HostEvent;
|
|
|
2361
2477
|
/**
|
|
2362
2478
|
* Trigger the **Download** action on charts in
|
|
2363
2479
|
* the embedded view.
|
|
2364
|
-
* @param - `vizId` refers to the
|
|
2480
|
+
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
|
|
2365
2481
|
* @example
|
|
2366
2482
|
* ```js
|
|
2367
2483
|
* liveboardEmbed.trigger(HostEvent.Download, {vizId:
|
|
@@ -2371,9 +2487,13 @@ var HostEvent;
|
|
|
2371
2487
|
* embed.trigger(HostEvent.Download)
|
|
2372
2488
|
* ```
|
|
2373
2489
|
* ```js
|
|
2374
|
-
*
|
|
2375
|
-
*
|
|
2376
|
-
*
|
|
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 });
|
|
2377
2497
|
* ```
|
|
2378
2498
|
* @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw
|
|
2379
2499
|
* Use {@link DownloadAsPng}
|
|
@@ -2392,9 +2512,13 @@ var HostEvent;
|
|
|
2392
2512
|
*
|
|
2393
2513
|
* searchEmbed.trigger(HostEvent.DownloadAsPng)
|
|
2394
2514
|
*
|
|
2395
|
-
*
|
|
2396
|
-
*
|
|
2397
|
-
*
|
|
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 });
|
|
2398
2522
|
* ```
|
|
2399
2523
|
*
|
|
2400
2524
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
|
|
@@ -2403,7 +2527,7 @@ var HostEvent;
|
|
|
2403
2527
|
/**
|
|
2404
2528
|
* Trigger the **Download** > **CSV** action on tables in
|
|
2405
2529
|
* the embedded view.
|
|
2406
|
-
* @param - `vizId` refers to the
|
|
2530
|
+
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
|
|
2407
2531
|
* @example
|
|
2408
2532
|
* ```js
|
|
2409
2533
|
* liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId:
|
|
@@ -2416,9 +2540,13 @@ var HostEvent;
|
|
|
2416
2540
|
* searchEmbed.trigger(HostEvent.DownloadAsCsv)
|
|
2417
2541
|
* ```
|
|
2418
2542
|
* ```js
|
|
2419
|
-
*
|
|
2420
|
-
*
|
|
2421
|
-
*
|
|
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 });
|
|
2422
2550
|
* ```
|
|
2423
2551
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2424
2552
|
*/
|
|
@@ -2426,7 +2554,7 @@ var HostEvent;
|
|
|
2426
2554
|
/**
|
|
2427
2555
|
* Trigger the **Download** > **XLSX** action on tables
|
|
2428
2556
|
* in the embedded view.
|
|
2429
|
-
* @param - `vizId` refers to the
|
|
2557
|
+
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
|
|
2430
2558
|
* @example
|
|
2431
2559
|
* ```js
|
|
2432
2560
|
* liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId:
|
|
@@ -2439,9 +2567,13 @@ var HostEvent;
|
|
|
2439
2567
|
* searchEmbed.trigger(HostEvent.DownloadAsXlsx)
|
|
2440
2568
|
* ```
|
|
2441
2569
|
* ```js
|
|
2442
|
-
*
|
|
2443
|
-
*
|
|
2444
|
-
*
|
|
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 });
|
|
2445
2577
|
* ```
|
|
2446
2578
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2447
2579
|
*/
|
|
@@ -2478,7 +2610,7 @@ var HostEvent;
|
|
|
2478
2610
|
* ```
|
|
2479
2611
|
*
|
|
2480
2612
|
* ```js
|
|
2481
|
-
* // Save
|
|
2613
|
+
* // Save a Visualization in Spotter (requires vizId)
|
|
2482
2614
|
* spotterEmbed.trigger(HostEvent.Save, {
|
|
2483
2615
|
* vizId: "730496d6-6903-4601-937e-2c691821af3c"
|
|
2484
2616
|
* })
|
|
@@ -2779,15 +2911,21 @@ var HostEvent;
|
|
|
2779
2911
|
HostEvent["ResetLiveboardPersonalisedView"] = "ResetLiveboardPersonalisedView";
|
|
2780
2912
|
/**
|
|
2781
2913
|
* Triggers an action to update Parameter values on embedded
|
|
2782
|
-
* Answers, Liveboard and Spotter answer in Edit mode.
|
|
2914
|
+
* Answers, Liveboard, and Spotter answer in Edit mode.
|
|
2915
|
+
* @param - `name` - Name of the Parameter
|
|
2916
|
+
* @param - `value` - The value to set for the Parameter.
|
|
2917
|
+
*
|
|
2918
|
+
* Optionally, to control the visibility of the Parameter chip,
|
|
2919
|
+
* use the `isVisibleToUser` attribute when applying an override.
|
|
2783
2920
|
*
|
|
2784
2921
|
* @example
|
|
2785
2922
|
* ```js
|
|
2786
2923
|
* liveboardEmbed.trigger(HostEvent.UpdateParameters, [{
|
|
2787
|
-
*
|
|
2788
|
-
*
|
|
2924
|
+
* name: "Integer Range Param",
|
|
2925
|
+
* value: 10,
|
|
2926
|
+
* isVisibleToUser: false
|
|
2789
2927
|
* }])
|
|
2790
|
-
*
|
|
2928
|
+
* ```
|
|
2791
2929
|
* @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
|
|
2792
2930
|
*/
|
|
2793
2931
|
HostEvent["UpdateParameters"] = "UpdateParameters";
|
|
@@ -2800,11 +2938,13 @@ var HostEvent;
|
|
|
2800
2938
|
* });
|
|
2801
2939
|
*```
|
|
2802
2940
|
*```js
|
|
2803
|
-
*
|
|
2804
|
-
*
|
|
2805
|
-
*
|
|
2806
|
-
*
|
|
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;
|
|
2807
2945
|
* });
|
|
2946
|
+
*
|
|
2947
|
+
* spotterEmbed.trigger(HostEvent.GetParameters, { vizId: latestSpotterVizId });
|
|
2808
2948
|
*```
|
|
2809
2949
|
* @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
|
|
2810
2950
|
*/
|
|
@@ -2834,10 +2974,11 @@ var HostEvent;
|
|
|
2834
2974
|
* If no parameters are specified, the save action is
|
|
2835
2975
|
* triggered with a modal to prompt users to
|
|
2836
2976
|
* add a name and description for the Answer.
|
|
2837
|
-
* @param -
|
|
2838
|
-
*
|
|
2839
|
-
*
|
|
2840
|
-
* @param - `
|
|
2977
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed
|
|
2978
|
+
* and is required in Spotter embed.
|
|
2979
|
+
* Optional attributes to set Answer properties include:
|
|
2980
|
+
* @param - `name` - Name string for the Answer.
|
|
2981
|
+
* @param - `description` - Description text for the Answer.
|
|
2841
2982
|
* @example
|
|
2842
2983
|
* ```js
|
|
2843
2984
|
* const saveAnswerResponse = await searchEmbed.trigger(HostEvent.SaveAnswer, {
|
|
@@ -2847,11 +2988,13 @@ var HostEvent;
|
|
|
2847
2988
|
* ```
|
|
2848
2989
|
* @example
|
|
2849
2990
|
* ```js
|
|
2850
|
-
*
|
|
2851
|
-
*
|
|
2852
|
-
*
|
|
2853
|
-
*
|
|
2991
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in SaveAnswer host event.
|
|
2992
|
+
* let latestSpotterVizId = '';
|
|
2993
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2994
|
+
* latestSpotterVizId = payload.data.id;
|
|
2854
2995
|
* });
|
|
2996
|
+
*
|
|
2997
|
+
* spotterEmbed.trigger(HostEvent.SaveAnswer, { vizId: latestSpotterVizId });
|
|
2855
2998
|
* ```
|
|
2856
2999
|
* @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
|
|
2857
3000
|
*/
|
|
@@ -2935,12 +3078,15 @@ var HostEvent;
|
|
|
2935
3078
|
HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
|
|
2936
3079
|
/**
|
|
2937
3080
|
* Toggle the visualization to chart or table view.
|
|
2938
|
-
* @param - `vizId ` refers to the
|
|
3081
|
+
* @param - `vizId ` refers to the Visualization ID in Spotter embed and is required.
|
|
2939
3082
|
* @example
|
|
2940
3083
|
* ```js
|
|
2941
|
-
*
|
|
2942
|
-
*
|
|
3084
|
+
* let latestSpotterVizId = '';
|
|
3085
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
3086
|
+
* latestSpotterVizId = payload.data.id;
|
|
2943
3087
|
* });
|
|
3088
|
+
*
|
|
3089
|
+
* spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, { vizId: latestSpotterVizId });
|
|
2944
3090
|
*```
|
|
2945
3091
|
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
2946
3092
|
*/
|
|
@@ -2969,12 +3115,16 @@ var HostEvent;
|
|
|
2969
3115
|
*/
|
|
2970
3116
|
HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
|
|
2971
3117
|
/**
|
|
2972
|
-
* Trigger the *
|
|
2973
|
-
* @param - `vizId` refers to the
|
|
3118
|
+
* Trigger the *Spotter* action for visualizations present on the liveboard's vizzes.
|
|
3119
|
+
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required.
|
|
2974
3120
|
* @example
|
|
2975
3121
|
* ```js
|
|
2976
|
-
*
|
|
2977
|
-
* {
|
|
3122
|
+
* let latestSpotterVizId = '';
|
|
3123
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
3124
|
+
* latestSpotterVizId = payload.data.id;
|
|
3125
|
+
* });
|
|
3126
|
+
*
|
|
3127
|
+
* spotterEmbed.trigger(HostEvent.AskSpotter, { vizId: latestSpotterVizId });
|
|
2978
3128
|
* ```
|
|
2979
3129
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
2980
3130
|
*/
|
|
@@ -2998,6 +3148,18 @@ var HostEvent;
|
|
|
2998
3148
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
2999
3149
|
*/
|
|
3000
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";
|
|
3001
3163
|
})(HostEvent || (HostEvent = {}));
|
|
3002
3164
|
/**
|
|
3003
3165
|
* The different visual modes that the data sources panel within
|
|
@@ -4585,7 +4747,25 @@ var LogLevel;
|
|
|
4585
4747
|
* @version SDK: 1.26.7 | ThoughtSpot Cloud: 9.10.0.cl
|
|
4586
4748
|
*/
|
|
4587
4749
|
LogLevel["TRACE"] = "TRACE";
|
|
4588
|
-
})(LogLevel || (LogLevel = {}));
|
|
4750
|
+
})(LogLevel || (LogLevel = {}));
|
|
4751
|
+
/**
|
|
4752
|
+
* Enum for the type of API intercepted
|
|
4753
|
+
*/
|
|
4754
|
+
var InterceptedApiType;
|
|
4755
|
+
(function (InterceptedApiType) {
|
|
4756
|
+
/**
|
|
4757
|
+
* The apis that are use to get the data for the embed
|
|
4758
|
+
*/
|
|
4759
|
+
InterceptedApiType["AnswerData"] = "AnswerData";
|
|
4760
|
+
/**
|
|
4761
|
+
* This will intercept all the apis
|
|
4762
|
+
*/
|
|
4763
|
+
InterceptedApiType["ALL"] = "ALL";
|
|
4764
|
+
/**
|
|
4765
|
+
* The apis that are use to get the data for the liveboard
|
|
4766
|
+
*/
|
|
4767
|
+
InterceptedApiType["LiveboardData"] = "LiveboardData";
|
|
4768
|
+
})(InterceptedApiType || (InterceptedApiType = {}));
|
|
4589
4769
|
|
|
4590
4770
|
const logFunctions = {
|
|
4591
4771
|
[LogLevel.SILENT]: () => undefined,
|
|
@@ -4623,7 +4803,7 @@ class Logger {
|
|
|
4623
4803
|
canLog(logLevel) {
|
|
4624
4804
|
if (logLevel === LogLevel.SILENT)
|
|
4625
4805
|
return false;
|
|
4626
|
-
if (
|
|
4806
|
+
if (globalLogLevelOverride !== undefined) {
|
|
4627
4807
|
return compareLogLevels(globalLogLevelOverride, logLevel) >= 0;
|
|
4628
4808
|
}
|
|
4629
4809
|
return compareLogLevels(this.logLevel, logLevel) >= 0;
|
|
@@ -7348,6 +7528,17 @@ function isEmpty(value) {
|
|
|
7348
7528
|
|
|
7349
7529
|
var isEmpty_1 = isEmpty;
|
|
7350
7530
|
|
|
7531
|
+
var UIPassthroughEvent;
|
|
7532
|
+
(function (UIPassthroughEvent) {
|
|
7533
|
+
UIPassthroughEvent["PinAnswerToLiveboard"] = "addVizToPinboard";
|
|
7534
|
+
UIPassthroughEvent["SaveAnswer"] = "saveAnswer";
|
|
7535
|
+
UIPassthroughEvent["GetDiscoverabilityStatus"] = "getDiscoverabilityStatus";
|
|
7536
|
+
UIPassthroughEvent["GetAvailableUIPassthroughs"] = "getAvailableUiPassthroughs";
|
|
7537
|
+
UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
|
|
7538
|
+
UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
|
|
7539
|
+
UIPassthroughEvent["GetUnsavedAnswerTML"] = "getUnsavedAnswerTML";
|
|
7540
|
+
})(UIPassthroughEvent || (UIPassthroughEvent = {}));
|
|
7541
|
+
|
|
7351
7542
|
const ERROR_MESSAGE = {
|
|
7352
7543
|
INVALID_THOUGHTSPOT_HOST: 'Error parsing ThoughtSpot host. Please provide a valid URL.',
|
|
7353
7544
|
SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND: 'Please select a Model to get started',
|
|
@@ -8279,7 +8470,7 @@ class AnswerService {
|
|
|
8279
8470
|
async getTML() {
|
|
8280
8471
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
8281
8472
|
const edoc = object[0].edoc;
|
|
8282
|
-
const YAML = await import('./index-
|
|
8473
|
+
const YAML = await import('./index-CpkMygsc.js');
|
|
8283
8474
|
const parsedDoc = YAML.parse(edoc);
|
|
8284
8475
|
return {
|
|
8285
8476
|
answer: {
|
|
@@ -17442,27 +17633,27 @@ function processAuthLogout(e, containerEl) {
|
|
|
17442
17633
|
* @param thoughtSpotHost
|
|
17443
17634
|
* @param containerEl
|
|
17444
17635
|
*/
|
|
17445
|
-
function processEventData(type,
|
|
17636
|
+
function processEventData(type, eventData, thoughtSpotHost, containerEl) {
|
|
17446
17637
|
switch (type) {
|
|
17447
17638
|
case EmbedEvent.CustomAction:
|
|
17448
|
-
return processCustomAction(
|
|
17639
|
+
return processCustomAction(eventData, thoughtSpotHost);
|
|
17449
17640
|
case EmbedEvent.AuthInit:
|
|
17450
|
-
return processAuthInit(
|
|
17641
|
+
return processAuthInit(eventData);
|
|
17451
17642
|
case EmbedEvent.NoCookieAccess:
|
|
17452
|
-
return processNoCookieAccess(
|
|
17643
|
+
return processNoCookieAccess(eventData, containerEl);
|
|
17453
17644
|
case EmbedEvent.AuthFailure:
|
|
17454
|
-
return processAuthFailure(
|
|
17645
|
+
return processAuthFailure(eventData, containerEl);
|
|
17455
17646
|
case EmbedEvent.AuthLogout:
|
|
17456
|
-
return processAuthLogout(
|
|
17647
|
+
return processAuthLogout(eventData, containerEl);
|
|
17457
17648
|
case EmbedEvent.ExitPresentMode:
|
|
17458
17649
|
return processExitPresentMode();
|
|
17459
17650
|
case EmbedEvent.CLEAR_INFO_CACHE:
|
|
17460
17651
|
return processClearInfoCache();
|
|
17461
17652
|
}
|
|
17462
|
-
return
|
|
17653
|
+
return eventData;
|
|
17463
17654
|
}
|
|
17464
17655
|
|
|
17465
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.
|
|
17656
|
+
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={".":{"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};
|
|
17466
17657
|
|
|
17467
17658
|
/**
|
|
17468
17659
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -17534,16 +17725,6 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
|
17534
17725
|
});
|
|
17535
17726
|
}
|
|
17536
17727
|
|
|
17537
|
-
var UIPassthroughEvent;
|
|
17538
|
-
(function (UIPassthroughEvent) {
|
|
17539
|
-
UIPassthroughEvent["PinAnswerToLiveboard"] = "addVizToPinboard";
|
|
17540
|
-
UIPassthroughEvent["SaveAnswer"] = "saveAnswer";
|
|
17541
|
-
UIPassthroughEvent["GetDiscoverabilityStatus"] = "getDiscoverabilityStatus";
|
|
17542
|
-
UIPassthroughEvent["GetAvailableUIPassthroughs"] = "getAvailableUiPassthroughs";
|
|
17543
|
-
UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
|
|
17544
|
-
UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
|
|
17545
|
-
})(UIPassthroughEvent || (UIPassthroughEvent = {}));
|
|
17546
|
-
|
|
17547
17728
|
class HostEventClient {
|
|
17548
17729
|
constructor(iFrame) {
|
|
17549
17730
|
this.iFrame = iFrame;
|
|
@@ -17635,6 +17816,174 @@ class HostEventClient {
|
|
|
17635
17816
|
}
|
|
17636
17817
|
}
|
|
17637
17818
|
|
|
17819
|
+
const DefaultInterceptUrlsMap = {
|
|
17820
|
+
[InterceptedApiType.AnswerData]: [
|
|
17821
|
+
'/prism/?op=GetChartWithData',
|
|
17822
|
+
'/prism/?op=GetTableWithHeadlineData',
|
|
17823
|
+
'/prism/?op=GetTableWithData',
|
|
17824
|
+
],
|
|
17825
|
+
[InterceptedApiType.LiveboardData]: [
|
|
17826
|
+
'/prism/?op=LoadContextBook'
|
|
17827
|
+
],
|
|
17828
|
+
};
|
|
17829
|
+
const formatInterceptUrl = (url) => {
|
|
17830
|
+
const host = getThoughtSpotHost(getEmbedConfig());
|
|
17831
|
+
if (url.startsWith('/'))
|
|
17832
|
+
return `${host}${url}`;
|
|
17833
|
+
return url;
|
|
17834
|
+
};
|
|
17835
|
+
/**
|
|
17836
|
+
* Converts user passed url values to proper urls
|
|
17837
|
+
* [ANSER_DATA] => ['https://host/pris/op?=op']
|
|
17838
|
+
* @param interceptUrls
|
|
17839
|
+
* @returns
|
|
17840
|
+
*/
|
|
17841
|
+
const processInterceptUrls = (interceptUrls) => {
|
|
17842
|
+
let processedUrls = [...interceptUrls];
|
|
17843
|
+
Object.entries(DefaultInterceptUrlsMap).forEach(([apiType, apiTypeUrls]) => {
|
|
17844
|
+
if (!processedUrls.includes(apiType))
|
|
17845
|
+
return;
|
|
17846
|
+
processedUrls = processedUrls.filter(url => url !== apiType);
|
|
17847
|
+
processedUrls = [...processedUrls, ...apiTypeUrls];
|
|
17848
|
+
});
|
|
17849
|
+
return processedUrls.map(url => formatInterceptUrl(url));
|
|
17850
|
+
};
|
|
17851
|
+
/**
|
|
17852
|
+
* Returns the data to be sent to embed to setup intercepts
|
|
17853
|
+
* the urls to intercept, timeout etc
|
|
17854
|
+
* @param viewConfig
|
|
17855
|
+
* @returns
|
|
17856
|
+
*/
|
|
17857
|
+
const getInterceptInitData = (viewConfig) => {
|
|
17858
|
+
const combinedUrls = [...(viewConfig.interceptUrls || [])];
|
|
17859
|
+
if (viewConfig.isOnBeforeGetVizDataInterceptEnabled) {
|
|
17860
|
+
combinedUrls.push(InterceptedApiType.AnswerData);
|
|
17861
|
+
}
|
|
17862
|
+
const shouldInterceptAll = combinedUrls.includes(InterceptedApiType.ALL);
|
|
17863
|
+
const interceptUrls = shouldInterceptAll ? [InterceptedApiType.ALL] : processInterceptUrls(combinedUrls);
|
|
17864
|
+
const interceptTimeout = viewConfig.interceptTimeout;
|
|
17865
|
+
return {
|
|
17866
|
+
interceptUrls,
|
|
17867
|
+
interceptTimeout,
|
|
17868
|
+
};
|
|
17869
|
+
};
|
|
17870
|
+
const parseJson = (jsonString) => {
|
|
17871
|
+
try {
|
|
17872
|
+
const json = JSON.parse(jsonString);
|
|
17873
|
+
return [json, null];
|
|
17874
|
+
}
|
|
17875
|
+
catch (error) {
|
|
17876
|
+
return [null, error];
|
|
17877
|
+
}
|
|
17878
|
+
};
|
|
17879
|
+
/**
|
|
17880
|
+
* Parse the api intercept data and return the parsed data and error if any
|
|
17881
|
+
* Embed returns the input and init from the fetch call
|
|
17882
|
+
*/
|
|
17883
|
+
const parseInterceptData = (eventDataString) => {
|
|
17884
|
+
try {
|
|
17885
|
+
const [parsedData, error] = parseJson(eventDataString);
|
|
17886
|
+
if (error) {
|
|
17887
|
+
return [null, error];
|
|
17888
|
+
}
|
|
17889
|
+
const { input, init } = parsedData;
|
|
17890
|
+
const [parsedBody, bodyParseError] = parseJson(init.body);
|
|
17891
|
+
if (!bodyParseError) {
|
|
17892
|
+
init.body = parsedBody;
|
|
17893
|
+
}
|
|
17894
|
+
const parsedInit = { input, init };
|
|
17895
|
+
return [parsedInit, null];
|
|
17896
|
+
}
|
|
17897
|
+
catch (error) {
|
|
17898
|
+
return [null, error];
|
|
17899
|
+
}
|
|
17900
|
+
};
|
|
17901
|
+
const getUrlType = (url) => {
|
|
17902
|
+
for (const [apiType, apiTypeUrls] of Object.entries(DefaultInterceptUrlsMap)) {
|
|
17903
|
+
if (apiTypeUrls.includes(url))
|
|
17904
|
+
return apiType;
|
|
17905
|
+
}
|
|
17906
|
+
// TODO: have a unknown type maybe ??
|
|
17907
|
+
return InterceptedApiType.ALL;
|
|
17908
|
+
};
|
|
17909
|
+
/**
|
|
17910
|
+
* Handle Api intercept event and simulate legacy onBeforeGetVizDataIntercept event
|
|
17911
|
+
*
|
|
17912
|
+
* embed sends -> ApiIntercept -> we send
|
|
17913
|
+
* ApiIntercept
|
|
17914
|
+
* OnBeforeGetVizDataIntercept (if url is part of DefaultUrlMap.AnswerData)
|
|
17915
|
+
*
|
|
17916
|
+
* @param params
|
|
17917
|
+
* @returns
|
|
17918
|
+
*/
|
|
17919
|
+
const handleInterceptEvent = async (params) => {
|
|
17920
|
+
var _a, _b, _c, _d, _e;
|
|
17921
|
+
const { eventData, executeEvent, viewConfig, getUnsavedAnswerTml } = params;
|
|
17922
|
+
const [interceptData, bodyParseError] = parseInterceptData(eventData.data);
|
|
17923
|
+
if (bodyParseError) {
|
|
17924
|
+
executeEvent(EmbedEvent.Error, {
|
|
17925
|
+
error: 'Error parsing api intercept body',
|
|
17926
|
+
});
|
|
17927
|
+
logger$3.error('Error parsing request body', bodyParseError);
|
|
17928
|
+
return;
|
|
17929
|
+
}
|
|
17930
|
+
const { input: requestUrl, init } = interceptData;
|
|
17931
|
+
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;
|
|
17932
|
+
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;
|
|
17933
|
+
const answerDataUrls = DefaultInterceptUrlsMap[InterceptedApiType.AnswerData];
|
|
17934
|
+
const legacyInterceptEnabled = viewConfig.isOnBeforeGetVizDataInterceptEnabled;
|
|
17935
|
+
const isAnswerDataUrl = answerDataUrls.includes(requestUrl);
|
|
17936
|
+
const sendLegacyIntercept = isAnswerDataUrl && legacyInterceptEnabled;
|
|
17937
|
+
if (sendLegacyIntercept) {
|
|
17938
|
+
const answerTml = await getUnsavedAnswerTml({ sessionId, vizId });
|
|
17939
|
+
// Build the legacy payload for backwards compatibility
|
|
17940
|
+
const legacyPayload = {
|
|
17941
|
+
data: {
|
|
17942
|
+
data: answerTml,
|
|
17943
|
+
status: embedEventStatus.END,
|
|
17944
|
+
type: EmbedEvent.OnBeforeGetVizDataIntercept
|
|
17945
|
+
}
|
|
17946
|
+
};
|
|
17947
|
+
executeEvent(EmbedEvent.OnBeforeGetVizDataIntercept, legacyPayload);
|
|
17948
|
+
}
|
|
17949
|
+
const urlType = getUrlType(requestUrl);
|
|
17950
|
+
executeEvent(EmbedEvent.ApiIntercept, { ...interceptData, urlType });
|
|
17951
|
+
};
|
|
17952
|
+
/**
|
|
17953
|
+
* Support both the legacy and new format of the api intercept response
|
|
17954
|
+
* @param payload
|
|
17955
|
+
* @returns
|
|
17956
|
+
*/
|
|
17957
|
+
const processApiInterceptResponse = (payload) => {
|
|
17958
|
+
var _a;
|
|
17959
|
+
const isLegacyFormat = (_a = payload === null || payload === void 0 ? void 0 : payload.data) === null || _a === void 0 ? void 0 : _a.error;
|
|
17960
|
+
if (isLegacyFormat) {
|
|
17961
|
+
return processLegacyInterceptResponse(payload);
|
|
17962
|
+
}
|
|
17963
|
+
return payload;
|
|
17964
|
+
};
|
|
17965
|
+
const processLegacyInterceptResponse = (payload) => {
|
|
17966
|
+
var _a, _b, _c, _d, _e;
|
|
17967
|
+
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;
|
|
17968
|
+
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;
|
|
17969
|
+
const payloadToSend = {
|
|
17970
|
+
execute: (_e = payload === null || payload === void 0 ? void 0 : payload.data) === null || _e === void 0 ? void 0 : _e.execute,
|
|
17971
|
+
response: {
|
|
17972
|
+
body: {
|
|
17973
|
+
errors: [
|
|
17974
|
+
{
|
|
17975
|
+
title: errorText,
|
|
17976
|
+
description: errorDescription,
|
|
17977
|
+
isUserError: true,
|
|
17978
|
+
},
|
|
17979
|
+
],
|
|
17980
|
+
data: {},
|
|
17981
|
+
},
|
|
17982
|
+
},
|
|
17983
|
+
};
|
|
17984
|
+
return { data: payloadToSend };
|
|
17985
|
+
};
|
|
17986
|
+
|
|
17638
17987
|
/**
|
|
17639
17988
|
* Copyright (c) 2022
|
|
17640
17989
|
*
|
|
@@ -17688,6 +18037,19 @@ class TsEmbed {
|
|
|
17688
18037
|
*/
|
|
17689
18038
|
this.fullscreenChangeHandler = null;
|
|
17690
18039
|
this.subscribedListeners = {};
|
|
18040
|
+
this.messageEventListener = (event) => {
|
|
18041
|
+
const eventType = this.getEventType(event);
|
|
18042
|
+
const eventPort = this.getEventPort(event);
|
|
18043
|
+
const eventData = this.formatEventData(event, eventType);
|
|
18044
|
+
if (event.source === this.iFrame.contentWindow) {
|
|
18045
|
+
const processedEventData = processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.el);
|
|
18046
|
+
if (eventType === EmbedEvent.ApiIntercept) {
|
|
18047
|
+
this.handleApiInterceptEvent({ eventData, eventPort });
|
|
18048
|
+
return;
|
|
18049
|
+
}
|
|
18050
|
+
this.executeCallbacks(eventType, processedEventData, eventPort);
|
|
18051
|
+
}
|
|
18052
|
+
};
|
|
17691
18053
|
/**
|
|
17692
18054
|
* Send Custom style as part of payload of APP_INIT
|
|
17693
18055
|
* @param _
|
|
@@ -17772,6 +18134,28 @@ class TsEmbed {
|
|
|
17772
18134
|
this.on(EmbedEvent.AuthInit, authInitHandler, { start: false }, true);
|
|
17773
18135
|
};
|
|
17774
18136
|
this.showPreRenderByDefault = false;
|
|
18137
|
+
/**
|
|
18138
|
+
* We can process the customer given payload before sending it to the embed port
|
|
18139
|
+
* Embed event handler -> responder -> createEmbedEventResponder -> send response
|
|
18140
|
+
* @param eventPort The event port for a specific MessageChannel
|
|
18141
|
+
* @param eventType The event type
|
|
18142
|
+
* @returns
|
|
18143
|
+
*/
|
|
18144
|
+
this.createEmbedEventResponder = (eventPort, eventType) => {
|
|
18145
|
+
const getPayloadToSend = (payload) => {
|
|
18146
|
+
if (eventType === EmbedEvent.OnBeforeGetVizDataIntercept) {
|
|
18147
|
+
return processLegacyInterceptResponse(payload);
|
|
18148
|
+
}
|
|
18149
|
+
if (eventType === EmbedEvent.ApiIntercept) {
|
|
18150
|
+
return processApiInterceptResponse(payload);
|
|
18151
|
+
}
|
|
18152
|
+
return payload;
|
|
18153
|
+
};
|
|
18154
|
+
return (payload) => {
|
|
18155
|
+
const payloadToSend = getPayloadToSend(payload);
|
|
18156
|
+
this.triggerEventOnPort(eventPort, payloadToSend);
|
|
18157
|
+
};
|
|
18158
|
+
};
|
|
17775
18159
|
/**
|
|
17776
18160
|
* @hidden
|
|
17777
18161
|
* Internal state to track if the embed container is loaded.
|
|
@@ -17952,21 +18336,24 @@ class TsEmbed {
|
|
|
17952
18336
|
this.subscribedListeners.online = onlineEventListener;
|
|
17953
18337
|
this.subscribedListeners.offline = offlineEventListener;
|
|
17954
18338
|
}
|
|
18339
|
+
handleApiInterceptEvent({ eventData, eventPort }) {
|
|
18340
|
+
const executeEvent = (_eventType, data) => {
|
|
18341
|
+
this.executeCallbacks(_eventType, data, eventPort);
|
|
18342
|
+
};
|
|
18343
|
+
const getUnsavedAnswerTml = async (props) => {
|
|
18344
|
+
var _a, _b;
|
|
18345
|
+
const response = await this.triggerUIPassThrough(UIPassthroughEvent.GetUnsavedAnswerTML, props);
|
|
18346
|
+
return (_b = (_a = response.filter((item) => item.value)) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.value;
|
|
18347
|
+
};
|
|
18348
|
+
handleInterceptEvent({ eventData, executeEvent, viewConfig: this.viewConfig, getUnsavedAnswerTml });
|
|
18349
|
+
}
|
|
17955
18350
|
/**
|
|
17956
18351
|
* Subscribe to message events that depend on successful iframe setup
|
|
17957
18352
|
*/
|
|
17958
18353
|
subscribeToMessageEvents() {
|
|
17959
18354
|
this.unsubscribeToMessageEvents();
|
|
17960
|
-
|
|
17961
|
-
|
|
17962
|
-
const eventPort = this.getEventPort(event);
|
|
17963
|
-
const eventData = this.formatEventData(event, eventType);
|
|
17964
|
-
if (event.source === this.iFrame.contentWindow) {
|
|
17965
|
-
this.executeCallbacks(eventType, processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.el), eventPort);
|
|
17966
|
-
}
|
|
17967
|
-
};
|
|
17968
|
-
window.addEventListener('message', messageEventListener);
|
|
17969
|
-
this.subscribedListeners.message = messageEventListener;
|
|
18355
|
+
window.addEventListener('message', this.messageEventListener);
|
|
18356
|
+
this.subscribedListeners.message = this.messageEventListener;
|
|
17970
18357
|
}
|
|
17971
18358
|
/**
|
|
17972
18359
|
* Adds event listeners for both network and message events.
|
|
@@ -18027,7 +18414,7 @@ class TsEmbed {
|
|
|
18027
18414
|
message: customActionsResult.errors,
|
|
18028
18415
|
});
|
|
18029
18416
|
}
|
|
18030
|
-
|
|
18417
|
+
const baseInitData = {
|
|
18031
18418
|
customisations: getCustomisations(this.embedConfig, this.viewConfig),
|
|
18032
18419
|
authToken,
|
|
18033
18420
|
runtimeFilterParams: this.viewConfig.excludeRuntimeFiltersfromURL
|
|
@@ -18045,7 +18432,9 @@ class TsEmbed {
|
|
|
18045
18432
|
customVariablesForThirdPartyTools: this.embedConfig.customVariablesForThirdPartyTools || {},
|
|
18046
18433
|
hiddenListColumns: this.viewConfig.hiddenListColumns || [],
|
|
18047
18434
|
customActions: customActionsResult.actions,
|
|
18435
|
+
...getInterceptInitData(this.viewConfig),
|
|
18048
18436
|
};
|
|
18437
|
+
return baseInitData;
|
|
18049
18438
|
}
|
|
18050
18439
|
async getAppInitData() {
|
|
18051
18440
|
return this.getDefaultAppInitData();
|
|
@@ -18066,7 +18455,7 @@ class TsEmbed {
|
|
|
18066
18455
|
}
|
|
18067
18456
|
getUpdateEmbedParamsObject() {
|
|
18068
18457
|
let queryParams = this.getEmbedParamsObject();
|
|
18069
|
-
queryParams = { ...this.viewConfig, ...queryParams };
|
|
18458
|
+
queryParams = { ...this.viewConfig, ...queryParams, ...this.getAppInitData() };
|
|
18070
18459
|
return queryParams;
|
|
18071
18460
|
}
|
|
18072
18461
|
/**
|
|
@@ -18474,9 +18863,8 @@ class TsEmbed {
|
|
|
18474
18863
|
// When start status is false it trigger only end releated
|
|
18475
18864
|
// payload
|
|
18476
18865
|
|| (!callbackObj.options.start && dataStatus === embedEventStatus.END)) {
|
|
18477
|
-
|
|
18478
|
-
|
|
18479
|
-
});
|
|
18866
|
+
const responder = this.createEmbedEventResponder(eventPort, eventType);
|
|
18867
|
+
callbackObj.callback(data, responder);
|
|
18480
18868
|
}
|
|
18481
18869
|
});
|
|
18482
18870
|
}
|
|
@@ -19243,7 +19631,7 @@ let SearchEmbed$1 = class SearchEmbed extends TsEmbed {
|
|
|
19243
19631
|
}
|
|
19244
19632
|
getEmbedParamsObject() {
|
|
19245
19633
|
var _a;
|
|
19246
|
-
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = true, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false,
|
|
19634
|
+
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;
|
|
19247
19635
|
const queryParams = this.getBaseQueryParams();
|
|
19248
19636
|
queryParams[Param.HideActions] = [
|
|
19249
19637
|
...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
|
|
@@ -19275,9 +19663,6 @@ let SearchEmbed$1 = class SearchEmbed extends TsEmbed {
|
|
|
19275
19663
|
if (hideSearchBar) {
|
|
19276
19664
|
queryParams[Param.HideSearchBar] = true;
|
|
19277
19665
|
}
|
|
19278
|
-
if (isOnBeforeGetVizDataInterceptEnabled) {
|
|
19279
|
-
queryParams[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
19280
|
-
}
|
|
19281
19666
|
if (!focusSearchBarOnRender) {
|
|
19282
19667
|
queryParams[Param.FocusSearchBarOnRender] = focusSearchBarOnRender;
|
|
19283
19668
|
}
|
|
@@ -19536,7 +19921,7 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
19536
19921
|
* embedded Liveboard or visualization.
|
|
19537
19922
|
*/
|
|
19538
19923
|
getEmbedParams() {
|
|
19539
|
-
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,
|
|
19924
|
+
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;
|
|
19540
19925
|
let params = {};
|
|
19541
19926
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
19542
19927
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -19554,7 +19939,6 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
19554
19939
|
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
19555
19940
|
params[Param.IsUnifiedSearchExperienceEnabled] = isUnifiedSearchExperienceEnabled;
|
|
19556
19941
|
params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF;
|
|
19557
|
-
params[Param.LiveboardXLSXCSVDownload] = !!liveboardXLSXCSVDownload;
|
|
19558
19942
|
params = this.getBaseQueryParams(params);
|
|
19559
19943
|
if (hideObjectSearch) {
|
|
19560
19944
|
params[Param.HideObjectSearch] = !!hideObjectSearch;
|
|
@@ -19590,9 +19974,6 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
19590
19974
|
if (enableAskSage) {
|
|
19591
19975
|
params[Param.enableAskSage] = enableAskSage;
|
|
19592
19976
|
}
|
|
19593
|
-
if (isOnBeforeGetVizDataInterceptEnabled) {
|
|
19594
|
-
params[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
19595
|
-
}
|
|
19596
19977
|
if (homePageSearchBarMode) {
|
|
19597
19978
|
params[Param.HomePageSearchBarMode] = homePageSearchBarMode;
|
|
19598
19979
|
}
|
|
@@ -19602,6 +19983,9 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
19602
19983
|
if (isLiveboardStylingAndGroupingEnabled !== undefined) {
|
|
19603
19984
|
params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
|
|
19604
19985
|
}
|
|
19986
|
+
if (liveboardXLSXCSVDownload !== undefined) {
|
|
19987
|
+
params[Param.LiveboardXLSXCSVDownload] = !!liveboardXLSXCSVDownload;
|
|
19988
|
+
}
|
|
19605
19989
|
if (isPNGInScheduledEmailsEnabled !== undefined) {
|
|
19606
19990
|
params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
|
|
19607
19991
|
}
|
|
@@ -19968,7 +20352,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
19968
20352
|
getEmbedParamsObject() {
|
|
19969
20353
|
let params = {};
|
|
19970
20354
|
params = this.getBaseQueryParams(params);
|
|
19971
|
-
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
|
|
20355
|
+
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;
|
|
19972
20356
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
19973
20357
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
19974
20358
|
if (fullHeight === true) {
|
|
@@ -20048,7 +20432,9 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
20048
20432
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
20049
20433
|
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
20050
20434
|
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
20051
|
-
|
|
20435
|
+
if (liveboardXLSXCSVDownload !== undefined) {
|
|
20436
|
+
params[Param.LiveboardXLSXCSVDownload] = !!liveboardXLSXCSVDownload;
|
|
20437
|
+
}
|
|
20052
20438
|
getQueryParamString(params, true);
|
|
20053
20439
|
return params;
|
|
20054
20440
|
}
|
|
@@ -20799,7 +21185,7 @@ let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
|
|
|
20799
21185
|
return queryParams;
|
|
20800
21186
|
}
|
|
20801
21187
|
getIframeSrc() {
|
|
20802
|
-
const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, enablePastConversationsSidebar } = this.viewConfig;
|
|
21188
|
+
const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, enablePastConversationsSidebar, } = this.viewConfig;
|
|
20803
21189
|
const path = 'insights/conv-assist';
|
|
20804
21190
|
const queryParams = this.getEmbedParamsObject();
|
|
20805
21191
|
if (!isUndefined_1(enablePastConversationsSidebar)) {
|