@thoughtspot/visual-embed-sdk 1.35.2 → 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 +33 -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 +38 -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-DoPTJLbd.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 +164 -37
- package/dist/tsembed-react.js +163 -36
- package/dist/tsembed.es.js +166 -39
- package/dist/tsembed.js +164 -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 +33 -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 +40 -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 +53 -1
- package/src/embed/ts-embed.ts +60 -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-react.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, require('react')) :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) :
|
|
@@ -1200,8 +1200,8 @@
|
|
|
1200
1200
|
*
|
|
1201
1201
|
* **Note**: This event is deprecated in v1.21.0.
|
|
1202
1202
|
* To fire an event when a download action is initiated on a chart or table,
|
|
1203
|
-
* use `EmbedEvent.DownloadAsPng`, `EmbedEvent.DownloadAsPDF`,
|
|
1204
|
-
* or `EmbedEvent.DownloadAsXLSX`
|
|
1203
|
+
* use `EmbedEvent.DownloadAsPng`, `EmbedEvent.DownloadAsPDF`,
|
|
1204
|
+
* `EmbedEvent.DownloadAsCSV`, or `EmbedEvent.DownloadAsXLSX`
|
|
1205
1205
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1206
1206
|
* @example
|
|
1207
1207
|
*```js
|
|
@@ -1851,7 +1851,7 @@
|
|
|
1851
1851
|
* @param - autoDrillDown - Optional. If true, the drill down will be
|
|
1852
1852
|
* done automatically on the most popular column.
|
|
1853
1853
|
* @param - vizId [TS >= 9.8.0] - Optional. The GUID of the visualization to drill
|
|
1854
|
-
* in case of a
|
|
1854
|
+
* in case of a Liveboard.
|
|
1855
1855
|
* @example
|
|
1856
1856
|
* ```js
|
|
1857
1857
|
* searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
|
|
@@ -1938,26 +1938,26 @@
|
|
|
1938
1938
|
*/
|
|
1939
1939
|
HostEvent["SetActiveTab"] = "SetActiveTab";
|
|
1940
1940
|
/**
|
|
1941
|
-
*
|
|
1942
|
-
*
|
|
1943
|
-
* filters.
|
|
1941
|
+
* Updates the runtime filters applied on a Liveboard. The filter
|
|
1942
|
+
* attributes passed with this event are appended to the existing runtime
|
|
1943
|
+
* filters applied on a Liveboard.
|
|
1944
|
+
*
|
|
1944
1945
|
* Pass an array of runtime filters with the following attributes:
|
|
1945
1946
|
*
|
|
1946
|
-
* `columnName`
|
|
1947
|
-
* _String_. The name of the column to filter on.
|
|
1947
|
+
* `columnName` - _String_. The name of the column to filter on.
|
|
1948
1948
|
*
|
|
1949
|
-
* `operator`
|
|
1950
|
-
* Runtime filter operator to apply. For information,
|
|
1949
|
+
* `operator` - Runtime filter operator to apply. For more information,
|
|
1951
1950
|
* see link:https://developers.thoughtspot.com/docs/?pageid=runtime-filters#rtOperator[Developer Documentation].
|
|
1952
1951
|
*
|
|
1953
|
-
* `values`
|
|
1954
|
-
*
|
|
1955
|
-
*
|
|
1952
|
+
* `values` - List of operands. Some operators such as EQ and LE allow a
|
|
1953
|
+
* single value, whereas BW and IN accept multiple values.
|
|
1954
|
+
*
|
|
1955
|
+
* **Note**: `HostEvent.UpdateRuntimeFilters` is supported in `LiveboardEmbed`
|
|
1956
|
+
* and `AppEmbed` only. In full application embedding, this event updates
|
|
1957
|
+
* the runtime filters applied on the Liveboard and saved Answer objects.
|
|
1956
1958
|
*
|
|
1957
|
-
* **Note**: `HostEvent.UpdateRuntimeFilters` is not supported in
|
|
1958
|
-
* Search embedding (SearchEmbed) and Natural Language Search
|
|
1959
|
-
* embedding (SageEmbed).
|
|
1960
1959
|
* @param - {@link RuntimeFilter}[] an array of {@link RuntimeFilter} Types.
|
|
1960
|
+
*
|
|
1961
1961
|
* @example
|
|
1962
1962
|
* ```js
|
|
1963
1963
|
* liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
|
|
@@ -2656,7 +2656,7 @@
|
|
|
2656
2656
|
*/
|
|
2657
2657
|
HostEvent["ResetLiveboardPersonalisedView"] = "ResetLiveboardPersonalisedView";
|
|
2658
2658
|
/**
|
|
2659
|
-
* Triggers Update
|
|
2659
|
+
* Triggers an event to Update Parameter values for Answers and Liveboard
|
|
2660
2660
|
* @example
|
|
2661
2661
|
* ```js
|
|
2662
2662
|
* liveboardEmbed.trigger(HostEvent.UpdateParameters, [{
|
|
@@ -2678,13 +2678,23 @@
|
|
|
2678
2678
|
*/
|
|
2679
2679
|
HostEvent["GetParameters"] = "GetParameters";
|
|
2680
2680
|
/**
|
|
2681
|
-
* Triggers update
|
|
2681
|
+
* Triggers an event to update a persoanlised view of a Liveboard
|
|
2682
2682
|
* ```js
|
|
2683
2683
|
* liveboardEmbed.trigger(HostEvent.UpdatePersonalisedView, {viewId: '1234'})
|
|
2684
2684
|
* ```
|
|
2685
2685
|
* @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
|
|
2686
2686
|
*/
|
|
2687
2687
|
HostEvent["UpdatePersonalisedView"] = "UpdatePersonalisedView";
|
|
2688
|
+
/**
|
|
2689
|
+
* Triggers the action to get the current view of the liveboard
|
|
2690
|
+
* @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
|
|
2691
|
+
*/
|
|
2692
|
+
HostEvent["SaveAnswer"] = "saveAnswer";
|
|
2693
|
+
/**
|
|
2694
|
+
* EmbedApi
|
|
2695
|
+
* @hidden
|
|
2696
|
+
*/
|
|
2697
|
+
HostEvent["UIPassthrough"] = "UiPassthrough";
|
|
2688
2698
|
})(exports.HostEvent || (exports.HostEvent = {}));
|
|
2689
2699
|
/**
|
|
2690
2700
|
* The different visual modes that the data sources panel within
|
|
@@ -3664,7 +3674,7 @@
|
|
|
3664
3674
|
*/
|
|
3665
3675
|
Action["ModifySageAnswer"] = "modifySageAnswer";
|
|
3666
3676
|
/**
|
|
3667
|
-
* The **Move to Tab** menu action on visualizations in
|
|
3677
|
+
* The **Move to Tab** menu action on visualizations in Liveboard edit mode.
|
|
3668
3678
|
* Allows moving a visualization to a different tab.
|
|
3669
3679
|
* @example
|
|
3670
3680
|
* ```js
|
|
@@ -3717,7 +3727,8 @@
|
|
|
3717
3727
|
*/
|
|
3718
3728
|
Action["TML"] = "tml";
|
|
3719
3729
|
/**
|
|
3720
|
-
* Action
|
|
3730
|
+
* Action ID for the create Liveboard option on the Liveboard list page
|
|
3731
|
+
* and Pin modal
|
|
3721
3732
|
* @example
|
|
3722
3733
|
* ```js
|
|
3723
3734
|
* hiddenAction: [Action.CreateLiveboard]
|
|
@@ -14515,6 +14526,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
14515
14526
|
return e;
|
|
14516
14527
|
}
|
|
14517
14528
|
|
|
14529
|
+
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};
|
|
14530
|
+
|
|
14518
14531
|
/**
|
|
14519
14532
|
* Reloads the ThoughtSpot iframe.
|
|
14520
14533
|
* @param iFrame
|
|
@@ -14573,7 +14586,96 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
14573
14586
|
});
|
|
14574
14587
|
}
|
|
14575
14588
|
|
|
14576
|
-
var
|
|
14589
|
+
var UIPassthroughEvent;
|
|
14590
|
+
(function (UIPassthroughEvent) {
|
|
14591
|
+
UIPassthroughEvent["PinAnswerToLiveboard"] = "addVizToPinboard";
|
|
14592
|
+
UIPassthroughEvent["SaveAnswer"] = "saveAnswer";
|
|
14593
|
+
UIPassthroughEvent["GetDiscoverabilityStatus"] = "getDiscoverabilityStatus";
|
|
14594
|
+
UIPassthroughEvent["GetAvailableUIPassthroughs"] = "getAvailableUIPassthroughs";
|
|
14595
|
+
UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
|
|
14596
|
+
UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
|
|
14597
|
+
})(UIPassthroughEvent || (UIPassthroughEvent = {}));
|
|
14598
|
+
|
|
14599
|
+
class HostEventClient {
|
|
14600
|
+
constructor(iFrame) {
|
|
14601
|
+
this.iFrame = iFrame;
|
|
14602
|
+
}
|
|
14603
|
+
/**
|
|
14604
|
+
* A wrapper over process trigger to
|
|
14605
|
+
* @param {HostEvent} message Host event to send
|
|
14606
|
+
* @param {any} data Data to send with the host event
|
|
14607
|
+
* @returns {Promise<any>} - the response from the process trigger
|
|
14608
|
+
*/
|
|
14609
|
+
async processTrigger(message, data) {
|
|
14610
|
+
if (!this.iFrame) {
|
|
14611
|
+
throw new Error('Iframe element is not set');
|
|
14612
|
+
}
|
|
14613
|
+
const thoughtspotHost = getEmbedConfig().thoughtSpotHost;
|
|
14614
|
+
return processTrigger(this.iFrame, message, thoughtspotHost, data);
|
|
14615
|
+
}
|
|
14616
|
+
async handleHostEventWithParam(apiName, parameters) {
|
|
14617
|
+
var _a, _b, _c, _d;
|
|
14618
|
+
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];
|
|
14619
|
+
if (!response) {
|
|
14620
|
+
const error = `No answer found${parameters.vizId ? ` for vizId: ${parameters.vizId}` : ''}.`;
|
|
14621
|
+
// eslint-disable-next-line no-throw-literal
|
|
14622
|
+
throw { error };
|
|
14623
|
+
}
|
|
14624
|
+
const errors = response.error
|
|
14625
|
+
|| ((_c = response.value) === null || _c === void 0 ? void 0 : _c.errors)
|
|
14626
|
+
|| ((_d = response.value) === null || _d === void 0 ? void 0 : _d.error);
|
|
14627
|
+
if (errors) {
|
|
14628
|
+
// eslint-disable-next-line no-throw-literal
|
|
14629
|
+
throw { error: response.error };
|
|
14630
|
+
}
|
|
14631
|
+
return { ...response.value };
|
|
14632
|
+
}
|
|
14633
|
+
async hostEventFallback(hostEvent, data) {
|
|
14634
|
+
return this.processTrigger(hostEvent, data);
|
|
14635
|
+
}
|
|
14636
|
+
/**
|
|
14637
|
+
* Setter for the iframe element used for host events
|
|
14638
|
+
* @param {HTMLIFrameElement} iFrame - the iframe element to set
|
|
14639
|
+
*/
|
|
14640
|
+
setIframeElement(iFrame) {
|
|
14641
|
+
this.iFrame = iFrame;
|
|
14642
|
+
}
|
|
14643
|
+
async triggerUIPassthroughApi(apiName, parameters) {
|
|
14644
|
+
const res = await this.processTrigger(exports.HostEvent.UIPassthrough, {
|
|
14645
|
+
type: apiName,
|
|
14646
|
+
parameters,
|
|
14647
|
+
});
|
|
14648
|
+
return res;
|
|
14649
|
+
}
|
|
14650
|
+
async handlePinEvent(payload) {
|
|
14651
|
+
if (!payload || !('newVizName' in payload)) {
|
|
14652
|
+
return this.hostEventFallback(exports.HostEvent.Pin, payload);
|
|
14653
|
+
}
|
|
14654
|
+
return this.handleHostEventWithParam(UIPassthroughEvent.PinAnswerToLiveboard, payload);
|
|
14655
|
+
}
|
|
14656
|
+
async handleSaveAnswerEvent(payload) {
|
|
14657
|
+
var _a, _b, _c, _d;
|
|
14658
|
+
if (!payload || !('name' in payload) || !('description' in payload)) {
|
|
14659
|
+
// Save is the fallback for SaveAnswer
|
|
14660
|
+
return this.hostEventFallback(exports.HostEvent.Save, payload);
|
|
14661
|
+
}
|
|
14662
|
+
const data = await this.handleHostEventWithParam(UIPassthroughEvent.SaveAnswer, payload);
|
|
14663
|
+
return {
|
|
14664
|
+
...data,
|
|
14665
|
+
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,
|
|
14666
|
+
};
|
|
14667
|
+
}
|
|
14668
|
+
async triggerHostEvent(hostEvent, payload) {
|
|
14669
|
+
switch (hostEvent) {
|
|
14670
|
+
case exports.HostEvent.Pin:
|
|
14671
|
+
return this.handlePinEvent(payload);
|
|
14672
|
+
case exports.HostEvent.SaveAnswer:
|
|
14673
|
+
return this.handleSaveAnswerEvent(payload);
|
|
14674
|
+
default:
|
|
14675
|
+
return this.hostEventFallback(hostEvent, payload);
|
|
14676
|
+
}
|
|
14677
|
+
}
|
|
14678
|
+
}
|
|
14577
14679
|
|
|
14578
14680
|
/**
|
|
14579
14681
|
* Copyright (c) 2022
|
|
@@ -14601,6 +14703,14 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
14601
14703
|
* React+GraphQL
|
|
14602
14704
|
*/
|
|
14603
14705
|
class TsEmbed {
|
|
14706
|
+
/**
|
|
14707
|
+
* Setter for the iframe element
|
|
14708
|
+
* @param {HTMLIFrameElement} iFrame HTMLIFrameElement
|
|
14709
|
+
*/
|
|
14710
|
+
setIframeElement(iFrame) {
|
|
14711
|
+
this.iFrame = iFrame;
|
|
14712
|
+
this.hostEventClient.setIframeElement(iFrame);
|
|
14713
|
+
}
|
|
14604
14714
|
constructor(domSelector, viewConfig) {
|
|
14605
14715
|
/**
|
|
14606
14716
|
* The key to store the embed instance in the DOM node
|
|
@@ -14729,6 +14839,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
14729
14839
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
|
|
14730
14840
|
...viewConfig,
|
|
14731
14841
|
});
|
|
14842
|
+
this.hostEventClient = new HostEventClient(this.iFrame);
|
|
14732
14843
|
}
|
|
14733
14844
|
/**
|
|
14734
14845
|
* Throws error encountered during initialization.
|
|
@@ -15003,6 +15114,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15003
15114
|
setAttributes(iFrame, restParams);
|
|
15004
15115
|
iFrame.style.width = `${width}`;
|
|
15005
15116
|
iFrame.style.height = `${height}`;
|
|
15117
|
+
// Set minimum height to the frame so that,
|
|
15118
|
+
// scaling down on the fullheight doesn't make it too small.
|
|
15119
|
+
iFrame.style.minHeight = `${height}`;
|
|
15006
15120
|
iFrame.style.border = '0';
|
|
15007
15121
|
iFrame.name = 'ThoughtSpot Embedded Analytics';
|
|
15008
15122
|
return iFrame;
|
|
@@ -15046,7 +15160,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15046
15160
|
this.handleInsertionIntoDOM(this.embedConfig.loginFailedMessage);
|
|
15047
15161
|
return;
|
|
15048
15162
|
}
|
|
15049
|
-
this.
|
|
15163
|
+
this.setIframeElement(this.iFrame || this.createIframeEl(url));
|
|
15050
15164
|
this.iFrame.addEventListener('load', () => {
|
|
15051
15165
|
nextInQueue();
|
|
15052
15166
|
const loadTimestamp = Date.now();
|
|
@@ -15105,7 +15219,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15105
15219
|
if (this.preRenderWrapper && this.preRenderChild) {
|
|
15106
15220
|
this.isPreRendered = true;
|
|
15107
15221
|
if (this.preRenderChild instanceof HTMLIFrameElement) {
|
|
15108
|
-
this.
|
|
15222
|
+
this.setIframeElement(this.preRenderChild);
|
|
15109
15223
|
}
|
|
15110
15224
|
this.insertedDomEl = this.preRenderWrapper;
|
|
15111
15225
|
this.isRendered = true;
|
|
@@ -15143,7 +15257,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15143
15257
|
this.preRenderChild = preRenderChild;
|
|
15144
15258
|
this.preRenderWrapper = preRenderWrapper;
|
|
15145
15259
|
if (preRenderChild instanceof HTMLIFrameElement) {
|
|
15146
|
-
this.
|
|
15260
|
+
this.setIframeElement(preRenderChild);
|
|
15147
15261
|
}
|
|
15148
15262
|
this.insertedDomEl = preRenderWrapper;
|
|
15149
15263
|
if (this.showPreRenderByDefault) {
|
|
@@ -15342,10 +15456,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15342
15456
|
}
|
|
15343
15457
|
/**
|
|
15344
15458
|
* Triggers an event to the embedded app
|
|
15345
|
-
* @param messageType The event type
|
|
15346
|
-
* @param data The payload to send with the message
|
|
15459
|
+
* @param {HostEvent} messageType The event type
|
|
15460
|
+
* @param {any} data The payload to send with the message
|
|
15461
|
+
* @returns A promise that resolves with the response from the embedded app
|
|
15347
15462
|
*/
|
|
15348
|
-
trigger(messageType, data
|
|
15463
|
+
async trigger(messageType, data) {
|
|
15349
15464
|
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
|
|
15350
15465
|
if (!this.isRendered) {
|
|
15351
15466
|
this.handleError('Please call render before triggering events');
|
|
@@ -15355,7 +15470,18 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15355
15470
|
this.handleError('Host event type is undefined');
|
|
15356
15471
|
return null;
|
|
15357
15472
|
}
|
|
15358
|
-
return
|
|
15473
|
+
return this.hostEventClient.triggerHostEvent(messageType, data);
|
|
15474
|
+
}
|
|
15475
|
+
/**
|
|
15476
|
+
* Triggers an event to the embedded app, skipping the UI flow.
|
|
15477
|
+
* @param {UIPassthroughEvent} apiName - The name of the API to be triggered.
|
|
15478
|
+
* @param {UIPassthroughRequest} parameters - The parameters to be passed to the API.
|
|
15479
|
+
* @returns {Promise<UIPassthroughRequest>} - A promise that resolves with the response
|
|
15480
|
+
* from the embedded app.
|
|
15481
|
+
*/
|
|
15482
|
+
async triggerUIPassThrough(apiName, parameters) {
|
|
15483
|
+
const response = this.hostEventClient.triggerUIPassthroughApi(apiName, parameters);
|
|
15484
|
+
return response;
|
|
15359
15485
|
}
|
|
15360
15486
|
/**
|
|
15361
15487
|
* Marks the ThoughtSpot object to have been rendered
|
|
@@ -15544,7 +15670,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15544
15670
|
/**
|
|
15545
15671
|
* Returns the answerService which can be used to make arbitrary graphql calls on top
|
|
15546
15672
|
* session.
|
|
15547
|
-
* @param vizId [Optional] to get for a specific viz in case of a
|
|
15673
|
+
* @param vizId [Optional] to get for a specific viz in case of a Liveboard.
|
|
15548
15674
|
* @version SDK: 1.25.0 / ThoughtSpot 9.10.0
|
|
15549
15675
|
*/
|
|
15550
15676
|
async getAnswerService(vizId) {
|
|
@@ -16010,10 +16136,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16010
16136
|
responder({ type: exports.EmbedEvent.EmbedIframeCenter, data: obj });
|
|
16011
16137
|
};
|
|
16012
16138
|
this.setIframeHeightForNonEmbedLiveboard = (data) => {
|
|
16013
|
-
|
|
16014
|
-
|
|
16015
|
-
|
|
16139
|
+
if (data.data.currentPath.startsWith('/embed/viz/')
|
|
16140
|
+
|| data.data.currentPath.startsWith('/embed/insights/viz/')) {
|
|
16141
|
+
return;
|
|
16016
16142
|
}
|
|
16143
|
+
this.setIFrameHeight(this.defaultHeight);
|
|
16017
16144
|
};
|
|
16018
16145
|
if (this.viewConfig.fullHeight === true) {
|
|
16019
16146
|
this.on(exports.EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
|
|
@@ -16466,7 +16593,7 @@ query GetEurekaVizSnapshots(
|
|
|
16466
16593
|
* @param messageType The event type
|
|
16467
16594
|
* @param data The payload to send with the message
|
|
16468
16595
|
*/
|
|
16469
|
-
trigger(messageType, data
|
|
16596
|
+
trigger(messageType, data) {
|
|
16470
16597
|
const dataWithVizId = data;
|
|
16471
16598
|
if (messageType === exports.HostEvent.SetActiveTab) {
|
|
16472
16599
|
this.setActiveTab(data);
|
|
@@ -16505,8 +16632,8 @@ query GetEurekaVizSnapshots(
|
|
|
16505
16632
|
}
|
|
16506
16633
|
}
|
|
16507
16634
|
/**
|
|
16508
|
-
* Returns the full url of the
|
|
16509
|
-
* this
|
|
16635
|
+
* Returns the full url of the Liveboard/visualization which can be used to open
|
|
16636
|
+
* this Liveboard inside the full Thoughtspot application in a new tab.
|
|
16510
16637
|
* @returns url string
|
|
16511
16638
|
*/
|
|
16512
16639
|
getLiveboardUrl() {
|