@thoughtspot/visual-embed-sdk 1.35.3 → 1.35.4
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/auth.spec.js +12 -0
- package/cjs/src/auth.spec.js.map +1 -1
- package/cjs/src/authToken.spec.js +1 -1
- package/cjs/src/authToken.spec.js.map +1 -1
- package/cjs/src/embed/app.d.ts +1 -1
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +4 -3
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/base.d.ts +1 -1
- package/cjs/src/embed/base.js +1 -1
- package/cjs/src/embed/bodyless-conversation.spec.js +0 -1
- package/cjs/src/embed/bodyless-conversation.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.d.ts +79 -0
- package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -0
- package/cjs/src/embed/hostEventClient/contracts.js +14 -0
- package/cjs/src/embed/hostEventClient/contracts.js.map +1 -0
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts +25 -0
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -0
- package/cjs/src/embed/hostEventClient/host-event-client.js +89 -0
- package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -0
- package/cjs/src/embed/hostEventClient/host-event-client.spec.d.ts +2 -0
- package/cjs/src/embed/hostEventClient/host-event-client.spec.d.ts.map +1 -0
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js +191 -0
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -0
- package/cjs/src/embed/liveboard.d.ts +10 -8
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +3 -3
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +34 -2
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/search.spec.js +11 -0
- package/cjs/src/embed/search.spec.js.map +1 -1
- package/cjs/src/embed/searchEmbed-basic-auth.spec.d.ts +2 -0
- package/cjs/src/embed/searchEmbed-basic-auth.spec.d.ts.map +1 -0
- package/cjs/src/embed/searchEmbed-basic-auth.spec.js +104 -0
- package/cjs/src/embed/searchEmbed-basic-auth.spec.js.map +1 -0
- package/cjs/src/embed/ts-embed.d.ts +21 -4
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +30 -9
- 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 +26 -1
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/hostEventsTypeMapping.d.ts +2 -0
- package/cjs/src/hostEventsTypeMapping.d.ts.map +1 -0
- package/cjs/src/hostEventsTypeMapping.js +4 -0
- package/cjs/src/hostEventsTypeMapping.js.map +1 -0
- package/cjs/src/index.d.ts +2 -1
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +3 -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 +38 -23
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +31 -20
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/embedApi/contracts.d.ts +101 -0
- package/cjs/src/utils/embedApi/contracts.d.ts.map +1 -0
- package/cjs/src/utils/embedApi/contracts.js +17 -0
- package/cjs/src/utils/embedApi/contracts.js.map +1 -0
- package/cjs/src/utils/embedApi/embedApiClient.d.ts +12 -0
- package/cjs/src/utils/embedApi/embedApiClient.d.ts.map +1 -0
- package/cjs/src/utils/embedApi/embedApiClient.js +46 -0
- package/cjs/src/utils/embedApi/embedApiClient.js.map +1 -0
- package/cjs/src/utils/embedApi/processEmbedApi.d.ts +9 -0
- package/cjs/src/utils/embedApi/processEmbedApi.d.ts.map +1 -0
- package/cjs/src/utils/embedApi/processEmbedApi.js +18 -0
- package/cjs/src/utils/embedApi/processEmbedApi.js.map +1 -0
- package/dist/{index-BaGHDCpW.js → index-BBBimG1x.js} +1 -1
- package/dist/index-CENLvayL.js +7370 -0
- package/dist/index-CbltIawo.js +7370 -0
- package/dist/index-CoQfqaHj.js +7370 -0
- package/dist/index-CzwzS0P4.js +7370 -0
- package/dist/index-DFwi_pV_.js +7370 -0
- package/dist/index-DOIjN0N_.js +7370 -0
- package/dist/index-DYBx8SuE.js +7370 -0
- package/dist/index-DaLHJaLd.js +7370 -0
- package/dist/index-nWevLycs.js +7370 -0
- package/dist/src/embed/app.d.ts +1 -1
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/base.d.ts +1 -1
- package/dist/src/embed/hostEventClient/contracts.d.ts +79 -0
- package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -0
- package/dist/src/embed/hostEventClient/host-event-client.d.ts +25 -0
- package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -0
- package/dist/src/embed/hostEventClient/host-event-client.spec.d.ts +2 -0
- package/dist/src/embed/hostEventClient/host-event-client.spec.d.ts.map +1 -0
- package/dist/src/embed/liveboard.d.ts +10 -8
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/searchEmbed-basic-auth.spec.d.ts +2 -0
- package/dist/src/embed/searchEmbed-basic-auth.spec.d.ts.map +1 -0
- package/dist/src/embed/ts-embed.d.ts +21 -4
- 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/hostEventsTypeMapping.d.ts +2 -0
- package/dist/src/hostEventsTypeMapping.d.ts.map +1 -0
- package/dist/src/index.d.ts +2 -1
- 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 +38 -23
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/embedApi/contracts.d.ts +101 -0
- package/dist/src/utils/embedApi/contracts.d.ts.map +1 -0
- package/dist/src/utils/embedApi/embedApiClient.d.ts +12 -0
- package/dist/src/utils/embedApi/embedApiClient.d.ts.map +1 -0
- package/dist/src/utils/embedApi/processEmbedApi.d.ts +9 -0
- package/dist/src/utils/embedApi/processEmbedApi.d.ts.map +1 -0
- package/dist/tsembed-react.es.js +161 -37
- package/dist/tsembed-react.js +160 -36
- package/dist/tsembed.es.js +163 -39
- package/dist/tsembed.js +161 -37
- package/dist/visual-embed-sdk-react-full.d.ts +170 -38
- package/dist/visual-embed-sdk-react.d.ts +170 -38
- package/dist/visual-embed-sdk.d.ts +170 -38
- package/lib/package.json +1 -1
- package/lib/src/auth.spec.js +12 -0
- package/lib/src/auth.spec.js.map +1 -1
- package/lib/src/authToken.spec.js +1 -1
- package/lib/src/authToken.spec.js.map +1 -1
- package/lib/src/embed/app.d.ts +1 -1
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +4 -3
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/base.d.ts +1 -1
- package/lib/src/embed/base.js +1 -1
- package/lib/src/embed/bodyless-conversation.spec.js +0 -1
- package/lib/src/embed/bodyless-conversation.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts +79 -0
- package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -0
- package/lib/src/embed/hostEventClient/contracts.js +11 -0
- package/lib/src/embed/hostEventClient/contracts.js.map +1 -0
- package/lib/src/embed/hostEventClient/host-event-client.d.ts +25 -0
- package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -0
- package/lib/src/embed/hostEventClient/host-event-client.js +85 -0
- package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -0
- package/lib/src/embed/hostEventClient/host-event-client.spec.d.ts +2 -0
- package/lib/src/embed/hostEventClient/host-event-client.spec.d.ts.map +1 -0
- package/lib/src/embed/hostEventClient/host-event-client.spec.js +188 -0
- package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -0
- package/lib/src/embed/liveboard.d.ts +10 -8
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +3 -3
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +34 -2
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/search.spec.js +11 -0
- package/lib/src/embed/search.spec.js.map +1 -1
- package/lib/src/embed/searchEmbed-basic-auth.spec.d.ts +2 -0
- package/lib/src/embed/searchEmbed-basic-auth.spec.d.ts.map +1 -0
- package/lib/src/embed/searchEmbed-basic-auth.spec.js +101 -0
- package/lib/src/embed/searchEmbed-basic-auth.spec.js.map +1 -0
- package/lib/src/embed/ts-embed.d.ts +21 -4
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +30 -9
- 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 +28 -3
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/hostEventsTypeMapping.d.ts +2 -0
- package/lib/src/hostEventsTypeMapping.d.ts.map +1 -0
- package/lib/src/hostEventsTypeMapping.js +2 -0
- package/lib/src/hostEventsTypeMapping.js.map +1 -0
- package/lib/src/index.d.ts +2 -1
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +2 -1
- 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 +38 -23
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +31 -20
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/embedApi/contracts.d.ts +101 -0
- package/lib/src/utils/embedApi/contracts.d.ts.map +1 -0
- package/lib/src/utils/embedApi/contracts.js +14 -0
- package/lib/src/utils/embedApi/contracts.js.map +1 -0
- package/lib/src/utils/embedApi/embedApiClient.d.ts +12 -0
- package/lib/src/utils/embedApi/embedApiClient.d.ts.map +1 -0
- package/lib/src/utils/embedApi/embedApiClient.js +42 -0
- package/lib/src/utils/embedApi/embedApiClient.js.map +1 -0
- package/lib/src/utils/embedApi/processEmbedApi.d.ts +9 -0
- package/lib/src/utils/embedApi/processEmbedApi.d.ts.map +1 -0
- package/lib/src/utils/embedApi/processEmbedApi.js +14 -0
- package/lib/src/utils/embedApi/processEmbedApi.js.map +1 -0
- package/lib/src/visual-embed-sdk.d.ts +181 -38
- package/package.json +1 -1
- package/src/auth.spec.ts +13 -0
- package/src/authToken.spec.ts +1 -1
- package/src/embed/app.ts +7 -4
- package/src/embed/base.ts +1 -1
- package/src/embed/bodyless-conversation.spec.ts +0 -1
- package/src/embed/hostEventClient/contracts.ts +105 -0
- package/src/embed/hostEventClient/host-event-client.spec.ts +254 -0
- package/src/embed/hostEventClient/host-event-client.ts +139 -0
- package/src/embed/liveboard.spec.ts +36 -2
- package/src/embed/liveboard.ts +13 -8
- package/src/embed/search.spec.ts +15 -0
- package/src/embed/ts-embed.spec.ts +40 -1
- package/src/embed/ts-embed.ts +57 -16
- package/src/index.ts +2 -0
- package/src/react/all-types-export.ts +1 -0
- package/src/types.ts +37 -22
package/dist/tsembed.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.35.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.35.4 */
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
@@ -1069,8 +1069,8 @@
|
|
|
1069
1069
|
*
|
|
1070
1070
|
* **Note**: This event is deprecated in v1.21.0.
|
|
1071
1071
|
* To fire an event when a download action is initiated on a chart or table,
|
|
1072
|
-
* use `EmbedEvent.DownloadAsPng`, `EmbedEvent.DownloadAsPDF`,
|
|
1073
|
-
* or `EmbedEvent.DownloadAsXLSX`
|
|
1072
|
+
* use `EmbedEvent.DownloadAsPng`, `EmbedEvent.DownloadAsPDF`,
|
|
1073
|
+
* `EmbedEvent.DownloadAsCSV`, or `EmbedEvent.DownloadAsXLSX`
|
|
1074
1074
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1075
1075
|
* @example
|
|
1076
1076
|
*```js
|
|
@@ -1720,7 +1720,7 @@
|
|
|
1720
1720
|
* @param - autoDrillDown - Optional. If true, the drill down will be
|
|
1721
1721
|
* done automatically on the most popular column.
|
|
1722
1722
|
* @param - vizId [TS >= 9.8.0] - Optional. The GUID of the visualization to drill
|
|
1723
|
-
* in case of a
|
|
1723
|
+
* in case of a Liveboard.
|
|
1724
1724
|
* @example
|
|
1725
1725
|
* ```js
|
|
1726
1726
|
* searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
|
|
@@ -1807,26 +1807,26 @@
|
|
|
1807
1807
|
*/
|
|
1808
1808
|
HostEvent["SetActiveTab"] = "SetActiveTab";
|
|
1809
1809
|
/**
|
|
1810
|
-
*
|
|
1811
|
-
*
|
|
1812
|
-
* filters.
|
|
1810
|
+
* Updates the runtime filters applied on a Liveboard. The filter
|
|
1811
|
+
* attributes passed with this event are appended to the existing runtime
|
|
1812
|
+
* filters applied on a Liveboard.
|
|
1813
|
+
*
|
|
1813
1814
|
* Pass an array of runtime filters with the following attributes:
|
|
1814
1815
|
*
|
|
1815
|
-
* `columnName`
|
|
1816
|
-
* _String_. The name of the column to filter on.
|
|
1816
|
+
* `columnName` - _String_. The name of the column to filter on.
|
|
1817
1817
|
*
|
|
1818
|
-
* `operator`
|
|
1819
|
-
* Runtime filter operator to apply. For information,
|
|
1818
|
+
* `operator` - Runtime filter operator to apply. For more information,
|
|
1820
1819
|
* see link:https://developers.thoughtspot.com/docs/?pageid=runtime-filters#rtOperator[Developer Documentation].
|
|
1821
1820
|
*
|
|
1822
|
-
* `values`
|
|
1823
|
-
*
|
|
1824
|
-
*
|
|
1821
|
+
* `values` - List of operands. Some operators such as EQ and LE allow a
|
|
1822
|
+
* single value, whereas BW and IN accept multiple values.
|
|
1823
|
+
*
|
|
1824
|
+
* **Note**: `HostEvent.UpdateRuntimeFilters` is supported in `LiveboardEmbed`
|
|
1825
|
+
* and `AppEmbed` only. In full application embedding, this event updates
|
|
1826
|
+
* the runtime filters applied on the Liveboard and saved Answer objects.
|
|
1825
1827
|
*
|
|
1826
|
-
* **Note**: `HostEvent.UpdateRuntimeFilters` is not supported in
|
|
1827
|
-
* Search embedding (SearchEmbed) and Natural Language Search
|
|
1828
|
-
* embedding (SageEmbed).
|
|
1829
1828
|
* @param - {@link RuntimeFilter}[] an array of {@link RuntimeFilter} Types.
|
|
1829
|
+
*
|
|
1830
1830
|
* @example
|
|
1831
1831
|
* ```js
|
|
1832
1832
|
* liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
|
|
@@ -2525,7 +2525,7 @@
|
|
|
2525
2525
|
*/
|
|
2526
2526
|
HostEvent["ResetLiveboardPersonalisedView"] = "ResetLiveboardPersonalisedView";
|
|
2527
2527
|
/**
|
|
2528
|
-
* Triggers Update
|
|
2528
|
+
* Triggers an event to Update Parameter values for Answers and Liveboard
|
|
2529
2529
|
* @example
|
|
2530
2530
|
* ```js
|
|
2531
2531
|
* liveboardEmbed.trigger(HostEvent.UpdateParameters, [{
|
|
@@ -2547,13 +2547,23 @@
|
|
|
2547
2547
|
*/
|
|
2548
2548
|
HostEvent["GetParameters"] = "GetParameters";
|
|
2549
2549
|
/**
|
|
2550
|
-
* Triggers update
|
|
2550
|
+
* Triggers an event to update a persoanlised view of a Liveboard
|
|
2551
2551
|
* ```js
|
|
2552
2552
|
* liveboardEmbed.trigger(HostEvent.UpdatePersonalisedView, {viewId: '1234'})
|
|
2553
2553
|
* ```
|
|
2554
2554
|
* @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
|
|
2555
2555
|
*/
|
|
2556
2556
|
HostEvent["UpdatePersonalisedView"] = "UpdatePersonalisedView";
|
|
2557
|
+
/**
|
|
2558
|
+
* Triggers the action to get the current view of the liveboard
|
|
2559
|
+
* @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
|
|
2560
|
+
*/
|
|
2561
|
+
HostEvent["SaveAnswer"] = "saveAnswer";
|
|
2562
|
+
/**
|
|
2563
|
+
* EmbedApi
|
|
2564
|
+
* @hidden
|
|
2565
|
+
*/
|
|
2566
|
+
HostEvent["UIPassthrough"] = "UiPassthrough";
|
|
2557
2567
|
})(exports.HostEvent || (exports.HostEvent = {}));
|
|
2558
2568
|
/**
|
|
2559
2569
|
* The different visual modes that the data sources panel within
|
|
@@ -3533,7 +3543,7 @@
|
|
|
3533
3543
|
*/
|
|
3534
3544
|
Action["ModifySageAnswer"] = "modifySageAnswer";
|
|
3535
3545
|
/**
|
|
3536
|
-
* The **Move to Tab** menu action on visualizations in
|
|
3546
|
+
* The **Move to Tab** menu action on visualizations in Liveboard edit mode.
|
|
3537
3547
|
* Allows moving a visualization to a different tab.
|
|
3538
3548
|
* @example
|
|
3539
3549
|
* ```js
|
|
@@ -3586,7 +3596,8 @@
|
|
|
3586
3596
|
*/
|
|
3587
3597
|
Action["TML"] = "tml";
|
|
3588
3598
|
/**
|
|
3589
|
-
* Action
|
|
3599
|
+
* Action ID for the create Liveboard option on the Liveboard list page
|
|
3600
|
+
* and Pin modal
|
|
3590
3601
|
* @example
|
|
3591
3602
|
* ```js
|
|
3592
3603
|
* hiddenAction: [Action.CreateLiveboard]
|
|
@@ -14435,7 +14446,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
14435
14446
|
/**
|
|
14436
14447
|
* Initializes the Visual Embed SDK globally and perform
|
|
14437
14448
|
* authentication if applicable. This function needs to be called before any ThoughtSpot
|
|
14438
|
-
* component like
|
|
14449
|
+
* component like Liveboard etc can be embedded. But need not wait for AuthEvent.SUCCESS
|
|
14439
14450
|
* to actually embed. That is handled internally.
|
|
14440
14451
|
* @param embedConfig The configuration object containing ThoughtSpot host,
|
|
14441
14452
|
* authentication mechanism and so on.
|
|
@@ -14741,6 +14752,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
14741
14752
|
return e;
|
|
14742
14753
|
}
|
|
14743
14754
|
|
|
14755
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.35.4";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 . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.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 | coveralls","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={algoliasearch:"^4.10.5",classnames:"^2.3.1",dompurify:"^2.3.4",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",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":"^8.2.6","@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":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","eslint-plugin-comment-length":"1.7.3","eslint-plugin-jsdoc":"^46.9.0","fs-extra":"^10.0.0","gh-pages":"^3.1.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0","node-sass":"^8.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","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^5.3.4"};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:"31 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};
|
|
14756
|
+
|
|
14744
14757
|
/**
|
|
14745
14758
|
* Reloads the ThoughtSpot iframe.
|
|
14746
14759
|
* @param iFrame
|
|
@@ -14799,7 +14812,96 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
14799
14812
|
});
|
|
14800
14813
|
}
|
|
14801
14814
|
|
|
14802
|
-
|
|
14815
|
+
exports.UIPassthroughEvent = void 0;
|
|
14816
|
+
(function (UIPassthroughEvent) {
|
|
14817
|
+
UIPassthroughEvent["PinAnswerToLiveboard"] = "addVizToPinboard";
|
|
14818
|
+
UIPassthroughEvent["SaveAnswer"] = "saveAnswer";
|
|
14819
|
+
UIPassthroughEvent["GetDiscoverabilityStatus"] = "getDiscoverabilityStatus";
|
|
14820
|
+
UIPassthroughEvent["GetAvailableUIPassthroughs"] = "getAvailableUIPassthroughs";
|
|
14821
|
+
UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
|
|
14822
|
+
UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
|
|
14823
|
+
})(exports.UIPassthroughEvent || (exports.UIPassthroughEvent = {}));
|
|
14824
|
+
|
|
14825
|
+
class HostEventClient {
|
|
14826
|
+
constructor(iFrame) {
|
|
14827
|
+
this.iFrame = iFrame;
|
|
14828
|
+
}
|
|
14829
|
+
/**
|
|
14830
|
+
* A wrapper over process trigger to
|
|
14831
|
+
* @param {HostEvent} message Host event to send
|
|
14832
|
+
* @param {any} data Data to send with the host event
|
|
14833
|
+
* @returns {Promise<any>} - the response from the process trigger
|
|
14834
|
+
*/
|
|
14835
|
+
async processTrigger(message, data) {
|
|
14836
|
+
if (!this.iFrame) {
|
|
14837
|
+
throw new Error('Iframe element is not set');
|
|
14838
|
+
}
|
|
14839
|
+
const thoughtspotHost = getEmbedConfig().thoughtSpotHost;
|
|
14840
|
+
return processTrigger(this.iFrame, message, thoughtspotHost, data);
|
|
14841
|
+
}
|
|
14842
|
+
async handleHostEventWithParam(apiName, parameters) {
|
|
14843
|
+
var _a, _b, _c, _d;
|
|
14844
|
+
const response = (_b = (_a = (await this.triggerUIPassthroughApi(apiName, parameters))) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.call(_a, (r) => r.error || r.value)[0];
|
|
14845
|
+
if (!response) {
|
|
14846
|
+
const error = `No answer found${parameters.vizId ? ` for vizId: ${parameters.vizId}` : ''}.`;
|
|
14847
|
+
// eslint-disable-next-line no-throw-literal
|
|
14848
|
+
throw { error };
|
|
14849
|
+
}
|
|
14850
|
+
const errors = response.error
|
|
14851
|
+
|| ((_c = response.value) === null || _c === void 0 ? void 0 : _c.errors)
|
|
14852
|
+
|| ((_d = response.value) === null || _d === void 0 ? void 0 : _d.error);
|
|
14853
|
+
if (errors) {
|
|
14854
|
+
// eslint-disable-next-line no-throw-literal
|
|
14855
|
+
throw { error: response.error };
|
|
14856
|
+
}
|
|
14857
|
+
return { ...response.value };
|
|
14858
|
+
}
|
|
14859
|
+
async hostEventFallback(hostEvent, data) {
|
|
14860
|
+
return this.processTrigger(hostEvent, data);
|
|
14861
|
+
}
|
|
14862
|
+
/**
|
|
14863
|
+
* Setter for the iframe element used for host events
|
|
14864
|
+
* @param {HTMLIFrameElement} iFrame - the iframe element to set
|
|
14865
|
+
*/
|
|
14866
|
+
setIframeElement(iFrame) {
|
|
14867
|
+
this.iFrame = iFrame;
|
|
14868
|
+
}
|
|
14869
|
+
async triggerUIPassthroughApi(apiName, parameters) {
|
|
14870
|
+
const res = await this.processTrigger(exports.HostEvent.UIPassthrough, {
|
|
14871
|
+
type: apiName,
|
|
14872
|
+
parameters,
|
|
14873
|
+
});
|
|
14874
|
+
return res;
|
|
14875
|
+
}
|
|
14876
|
+
async handlePinEvent(payload) {
|
|
14877
|
+
if (!payload || !('newVizName' in payload)) {
|
|
14878
|
+
return this.hostEventFallback(exports.HostEvent.Pin, payload);
|
|
14879
|
+
}
|
|
14880
|
+
return this.handleHostEventWithParam(exports.UIPassthroughEvent.PinAnswerToLiveboard, payload);
|
|
14881
|
+
}
|
|
14882
|
+
async handleSaveAnswerEvent(payload) {
|
|
14883
|
+
var _a, _b, _c, _d;
|
|
14884
|
+
if (!payload || !('name' in payload) || !('description' in payload)) {
|
|
14885
|
+
// Save is the fallback for SaveAnswer
|
|
14886
|
+
return this.hostEventFallback(exports.HostEvent.Save, payload);
|
|
14887
|
+
}
|
|
14888
|
+
const data = await this.handleHostEventWithParam(exports.UIPassthroughEvent.SaveAnswer, payload);
|
|
14889
|
+
return {
|
|
14890
|
+
...data,
|
|
14891
|
+
answerId: (_d = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.saveResponse) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.Answer__save) === null || _c === void 0 ? void 0 : _c.answer) === null || _d === void 0 ? void 0 : _d.id,
|
|
14892
|
+
};
|
|
14893
|
+
}
|
|
14894
|
+
async triggerHostEvent(hostEvent, payload) {
|
|
14895
|
+
switch (hostEvent) {
|
|
14896
|
+
case exports.HostEvent.Pin:
|
|
14897
|
+
return this.handlePinEvent(payload);
|
|
14898
|
+
case exports.HostEvent.SaveAnswer:
|
|
14899
|
+
return this.handleSaveAnswerEvent(payload);
|
|
14900
|
+
default:
|
|
14901
|
+
return this.hostEventFallback(hostEvent, payload);
|
|
14902
|
+
}
|
|
14903
|
+
}
|
|
14904
|
+
}
|
|
14803
14905
|
|
|
14804
14906
|
/**
|
|
14805
14907
|
* Copyright (c) 2022
|
|
@@ -14827,6 +14929,14 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
14827
14929
|
* React+GraphQL
|
|
14828
14930
|
*/
|
|
14829
14931
|
class TsEmbed {
|
|
14932
|
+
/**
|
|
14933
|
+
* Setter for the iframe element
|
|
14934
|
+
* @param {HTMLIFrameElement} iFrame HTMLIFrameElement
|
|
14935
|
+
*/
|
|
14936
|
+
setIframeElement(iFrame) {
|
|
14937
|
+
this.iFrame = iFrame;
|
|
14938
|
+
this.hostEventClient.setIframeElement(iFrame);
|
|
14939
|
+
}
|
|
14830
14940
|
constructor(domSelector, viewConfig) {
|
|
14831
14941
|
/**
|
|
14832
14942
|
* The key to store the embed instance in the DOM node
|
|
@@ -14955,6 +15065,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
14955
15065
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
|
|
14956
15066
|
...viewConfig,
|
|
14957
15067
|
});
|
|
15068
|
+
this.hostEventClient = new HostEventClient(this.iFrame);
|
|
14958
15069
|
}
|
|
14959
15070
|
/**
|
|
14960
15071
|
* Throws error encountered during initialization.
|
|
@@ -15275,7 +15386,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15275
15386
|
this.handleInsertionIntoDOM(this.embedConfig.loginFailedMessage);
|
|
15276
15387
|
return;
|
|
15277
15388
|
}
|
|
15278
|
-
this.
|
|
15389
|
+
this.setIframeElement(this.iFrame || this.createIframeEl(url));
|
|
15279
15390
|
this.iFrame.addEventListener('load', () => {
|
|
15280
15391
|
nextInQueue();
|
|
15281
15392
|
const loadTimestamp = Date.now();
|
|
@@ -15334,7 +15445,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15334
15445
|
if (this.preRenderWrapper && this.preRenderChild) {
|
|
15335
15446
|
this.isPreRendered = true;
|
|
15336
15447
|
if (this.preRenderChild instanceof HTMLIFrameElement) {
|
|
15337
|
-
this.
|
|
15448
|
+
this.setIframeElement(this.preRenderChild);
|
|
15338
15449
|
}
|
|
15339
15450
|
this.insertedDomEl = this.preRenderWrapper;
|
|
15340
15451
|
this.isRendered = true;
|
|
@@ -15372,7 +15483,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15372
15483
|
this.preRenderChild = preRenderChild;
|
|
15373
15484
|
this.preRenderWrapper = preRenderWrapper;
|
|
15374
15485
|
if (preRenderChild instanceof HTMLIFrameElement) {
|
|
15375
|
-
this.
|
|
15486
|
+
this.setIframeElement(preRenderChild);
|
|
15376
15487
|
}
|
|
15377
15488
|
this.insertedDomEl = preRenderWrapper;
|
|
15378
15489
|
if (this.showPreRenderByDefault) {
|
|
@@ -15571,10 +15682,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15571
15682
|
}
|
|
15572
15683
|
/**
|
|
15573
15684
|
* Triggers an event to the embedded app
|
|
15574
|
-
* @param messageType The event type
|
|
15575
|
-
* @param data The payload to send with the message
|
|
15685
|
+
* @param {HostEvent} messageType The event type
|
|
15686
|
+
* @param {any} data The payload to send with the message
|
|
15687
|
+
* @returns A promise that resolves with the response from the embedded app
|
|
15576
15688
|
*/
|
|
15577
|
-
trigger(messageType, data
|
|
15689
|
+
async trigger(messageType, data) {
|
|
15578
15690
|
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
|
|
15579
15691
|
if (!this.isRendered) {
|
|
15580
15692
|
this.handleError('Please call render before triggering events');
|
|
@@ -15584,7 +15696,18 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15584
15696
|
this.handleError('Host event type is undefined');
|
|
15585
15697
|
return null;
|
|
15586
15698
|
}
|
|
15587
|
-
return
|
|
15699
|
+
return this.hostEventClient.triggerHostEvent(messageType, data);
|
|
15700
|
+
}
|
|
15701
|
+
/**
|
|
15702
|
+
* Triggers an event to the embedded app, skipping the UI flow.
|
|
15703
|
+
* @param {UIPassthroughEvent} apiName - The name of the API to be triggered.
|
|
15704
|
+
* @param {UIPassthroughRequest} parameters - The parameters to be passed to the API.
|
|
15705
|
+
* @returns {Promise<UIPassthroughRequest>} - A promise that resolves with the response
|
|
15706
|
+
* from the embedded app.
|
|
15707
|
+
*/
|
|
15708
|
+
async triggerUIPassThrough(apiName, parameters) {
|
|
15709
|
+
const response = this.hostEventClient.triggerUIPassthroughApi(apiName, parameters);
|
|
15710
|
+
return response;
|
|
15588
15711
|
}
|
|
15589
15712
|
/**
|
|
15590
15713
|
* Marks the ThoughtSpot object to have been rendered
|
|
@@ -15773,7 +15896,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15773
15896
|
/**
|
|
15774
15897
|
* Returns the answerService which can be used to make arbitrary graphql calls on top
|
|
15775
15898
|
* session.
|
|
15776
|
-
* @param vizId [Optional] to get for a specific viz in case of a
|
|
15899
|
+
* @param vizId [Optional] to get for a specific viz in case of a Liveboard.
|
|
15777
15900
|
* @version SDK: 1.25.0 / ThoughtSpot 9.10.0
|
|
15778
15901
|
*/
|
|
15779
15902
|
async getAnswerService(vizId) {
|
|
@@ -15942,10 +16065,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15942
16065
|
responder({ type: exports.EmbedEvent.EmbedIframeCenter, data: obj });
|
|
15943
16066
|
};
|
|
15944
16067
|
this.setIframeHeightForNonEmbedLiveboard = (data) => {
|
|
15945
|
-
|
|
15946
|
-
|
|
15947
|
-
|
|
16068
|
+
if (data.data.currentPath.startsWith('/embed/viz/')
|
|
16069
|
+
|| data.data.currentPath.startsWith('/embed/insights/viz/')) {
|
|
16070
|
+
return;
|
|
15948
16071
|
}
|
|
16072
|
+
this.setIFrameHeight(this.defaultHeight);
|
|
15949
16073
|
};
|
|
15950
16074
|
if (this.viewConfig.fullHeight === true) {
|
|
15951
16075
|
this.on(exports.EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
|
|
@@ -16398,7 +16522,7 @@ query GetEurekaVizSnapshots(
|
|
|
16398
16522
|
* @param messageType The event type
|
|
16399
16523
|
* @param data The payload to send with the message
|
|
16400
16524
|
*/
|
|
16401
|
-
trigger(messageType, data
|
|
16525
|
+
trigger(messageType, data) {
|
|
16402
16526
|
const dataWithVizId = data;
|
|
16403
16527
|
if (messageType === exports.HostEvent.SetActiveTab) {
|
|
16404
16528
|
this.setActiveTab(data);
|
|
@@ -16437,8 +16561,8 @@ query GetEurekaVizSnapshots(
|
|
|
16437
16561
|
}
|
|
16438
16562
|
}
|
|
16439
16563
|
/**
|
|
16440
|
-
* Returns the full url of the
|
|
16441
|
-
* this
|
|
16564
|
+
* Returns the full url of the Liveboard/visualization which can be used to open
|
|
16565
|
+
* this Liveboard inside the full Thoughtspot application in a new tab.
|
|
16442
16566
|
* @returns url string
|
|
16443
16567
|
*/
|
|
16444
16568
|
getLiveboardUrl() {
|