@thoughtspot/visual-embed-sdk 1.35.2 → 1.35.5-hostEvent.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/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/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 +97 -0
- package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -0
- package/cjs/src/embed/hostEventClient/contracts.js +16 -0
- package/cjs/src/embed/hostEventClient/contracts.js.map +1 -0
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts +14 -0
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -0
- package/cjs/src/embed/hostEventClient/host-event-client.js +50 -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 +171 -0
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -0
- package/cjs/src/embed/liveboard.d.ts +2 -1
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +1 -1
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +30 -0
- 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 +13 -1
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +19 -3
- 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 +13 -3
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +12 -2
- 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-CbltIawo.js} +1 -1
- package/dist/index-CzwzS0P4.js +7370 -0
- package/dist/src/embed/hostEventClient/contracts.d.ts +97 -0
- package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -0
- package/dist/src/embed/hostEventClient/host-event-client.d.ts +14 -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 +2 -1
- 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 +13 -1
- 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 +13 -3
- 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 +89 -8
- package/dist/tsembed-react.js +88 -7
- package/dist/tsembed.es.js +90 -9
- package/dist/tsembed.js +88 -7
- package/dist/visual-embed-sdk-react-full.d.ts +134 -6
- package/dist/visual-embed-sdk-react.d.ts +134 -6
- package/dist/visual-embed-sdk.d.ts +134 -6
- 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/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 +97 -0
- package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -0
- package/lib/src/embed/hostEventClient/contracts.js +13 -0
- package/lib/src/embed/hostEventClient/contracts.js.map +1 -0
- package/lib/src/embed/hostEventClient/host-event-client.d.ts +14 -0
- package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -0
- package/lib/src/embed/hostEventClient/host-event-client.js +46 -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 +169 -0
- package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -0
- package/lib/src/embed/liveboard.d.ts +2 -1
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +1 -1
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +30 -0
- 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 +13 -1
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +19 -3
- 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 +13 -3
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +12 -2
- 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 +145 -6
- package/package.json +1 -1
- package/src/auth.spec.ts +13 -0
- package/src/authToken.spec.ts +1 -1
- package/src/embed/bodyless-conversation.spec.ts +0 -1
- package/src/embed/hostEventClient/contracts.ts +108 -0
- package/src/embed/hostEventClient/host-event-client.spec.ts +234 -0
- package/src/embed/hostEventClient/host-event-client.ts +81 -0
- package/src/embed/liveboard.spec.ts +32 -0
- package/src/embed/liveboard.ts +5 -1
- package/src/embed/search.spec.ts +15 -0
- package/src/embed/ts-embed.spec.ts +53 -1
- package/src/embed/ts-embed.ts +29 -5
- package/src/index.ts +2 -0
- package/src/react/all-types-export.ts +1 -0
- package/src/types.ts +12 -2
package/dist/tsembed-react.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.35.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.35.5-hostEvent.1 */
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import React__default from 'react';
|
|
4
4
|
|
|
@@ -1178,8 +1178,8 @@ var EmbedEvent;
|
|
|
1178
1178
|
*
|
|
1179
1179
|
* **Note**: This event is deprecated in v1.21.0.
|
|
1180
1180
|
* To fire an event when a download action is initiated on a chart or table,
|
|
1181
|
-
* use `EmbedEvent.DownloadAsPng`, `EmbedEvent.DownloadAsPDF`,
|
|
1182
|
-
* or `EmbedEvent.DownloadAsXLSX`
|
|
1181
|
+
* use `EmbedEvent.DownloadAsPng`, `EmbedEvent.DownloadAsPDF`,
|
|
1182
|
+
* `EmbedEvent.DownloadAsCSV`, or `EmbedEvent.DownloadAsXLSX`
|
|
1183
1183
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1184
1184
|
* @example
|
|
1185
1185
|
*```js
|
|
@@ -2663,6 +2663,16 @@ var HostEvent;
|
|
|
2663
2663
|
* @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
|
|
2664
2664
|
*/
|
|
2665
2665
|
HostEvent["UpdatePersonalisedView"] = "UpdatePersonalisedView";
|
|
2666
|
+
/**
|
|
2667
|
+
* Triggers the action to get the current view of the liveboard
|
|
2668
|
+
* @version SDK: 1.34.0 | Thoughtspot: 10.6.0.cl
|
|
2669
|
+
*/
|
|
2670
|
+
HostEvent["SaveAnswer"] = "saveAnswer";
|
|
2671
|
+
/**
|
|
2672
|
+
* EmbedApi
|
|
2673
|
+
* @hidden
|
|
2674
|
+
*/
|
|
2675
|
+
HostEvent["UiPassthrough"] = "UiPassthrough";
|
|
2666
2676
|
})(HostEvent || (HostEvent = {}));
|
|
2667
2677
|
/**
|
|
2668
2678
|
* The different visual modes that the data sources panel within
|
|
@@ -7150,7 +7160,7 @@ class AnswerService {
|
|
|
7150
7160
|
async getTML() {
|
|
7151
7161
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
7152
7162
|
const edoc = object[0].edoc;
|
|
7153
|
-
const YAML = await import('./index-
|
|
7163
|
+
const YAML = await import('./index-CzwzS0P4.js');
|
|
7154
7164
|
const parsedDoc = YAML.parse(edoc);
|
|
7155
7165
|
return {
|
|
7156
7166
|
answer: {
|
|
@@ -14493,6 +14503,8 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
|
|
|
14493
14503
|
return e;
|
|
14494
14504
|
}
|
|
14495
14505
|
|
|
14506
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.35.5-hostEvent.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 . --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,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};
|
|
14507
|
+
|
|
14496
14508
|
/**
|
|
14497
14509
|
* Reloads the ThoughtSpot iframe.
|
|
14498
14510
|
* @param iFrame
|
|
@@ -14551,7 +14563,60 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
|
14551
14563
|
});
|
|
14552
14564
|
}
|
|
14553
14565
|
|
|
14554
|
-
var
|
|
14566
|
+
var UiPassthroughEvent;
|
|
14567
|
+
(function (UiPassthroughEvent) {
|
|
14568
|
+
UiPassthroughEvent["addVizToPinboard"] = "addVizToPinboard";
|
|
14569
|
+
UiPassthroughEvent["saveAnswer"] = "saveAnswer";
|
|
14570
|
+
UiPassthroughEvent["getA3AnalysisColumns"] = "getA3AnalysisColumns";
|
|
14571
|
+
UiPassthroughEvent["getDiscoverabilityStatus"] = "getDiscoverabilityStatus";
|
|
14572
|
+
UiPassthroughEvent["getAvailableUiPassthroughs"] = "getAvailableUiPassthroughs";
|
|
14573
|
+
UiPassthroughEvent["getAnswerPageConfig"] = "getAnswerPageConfig";
|
|
14574
|
+
UiPassthroughEvent["getPinboardPageConfig"] = "getPinboardPageConfig";
|
|
14575
|
+
UiPassthroughEvent["UiPassthroughEventNotFound"] = "UiPassthroughEventNotFound";
|
|
14576
|
+
})(UiPassthroughEvent || (UiPassthroughEvent = {}));
|
|
14577
|
+
|
|
14578
|
+
class HostEventClient {
|
|
14579
|
+
constructor(thoughtSpotHost) {
|
|
14580
|
+
this.executeUiPassthroughApi = async (iFrame, apiName, parameters) => {
|
|
14581
|
+
const res = await processTrigger(iFrame, HostEvent.UiPassthrough, this.thoughtSpotHost, {
|
|
14582
|
+
type: apiName,
|
|
14583
|
+
parameters,
|
|
14584
|
+
});
|
|
14585
|
+
return res;
|
|
14586
|
+
};
|
|
14587
|
+
this.handleUiPassthroughForHostEvent = async (iFrame, apiName, parameters) => {
|
|
14588
|
+
var _a, _b, _c;
|
|
14589
|
+
const response = (_b = (_a = (await this.executeUiPassthroughApi(iFrame, 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];
|
|
14590
|
+
if (!response) {
|
|
14591
|
+
const error = `No answer found${parameters.vizId ? ` for vizId: ${parameters.vizId}` : ''}.`;
|
|
14592
|
+
// eslint-disable-next-line no-throw-literal
|
|
14593
|
+
throw { error };
|
|
14594
|
+
}
|
|
14595
|
+
const errors = response.error || ((_c = response.value) === null || _c === void 0 ? void 0 : _c.errors);
|
|
14596
|
+
if (errors) {
|
|
14597
|
+
// eslint-disable-next-line no-throw-literal
|
|
14598
|
+
throw { error: response.error };
|
|
14599
|
+
}
|
|
14600
|
+
return { ...response.value };
|
|
14601
|
+
};
|
|
14602
|
+
this.thoughtSpotHost = thoughtSpotHost;
|
|
14603
|
+
}
|
|
14604
|
+
async hostEventFallback(iFrame, hostEvent, data) {
|
|
14605
|
+
return processTrigger(iFrame, hostEvent, this.thoughtSpotHost, data);
|
|
14606
|
+
}
|
|
14607
|
+
async executeHostEvent(iFrame, hostEvent, payload) {
|
|
14608
|
+
if (hostEvent === HostEvent.Pin && (payload === null || payload === void 0 ? void 0 : payload.newVizName)) {
|
|
14609
|
+
return this.handleUiPassthroughForHostEvent(iFrame, UiPassthroughEvent.addVizToPinboard, payload);
|
|
14610
|
+
}
|
|
14611
|
+
if (hostEvent === HostEvent.SaveAnswer && (payload === null || payload === void 0 ? void 0 : payload.name)) {
|
|
14612
|
+
return this.handleUiPassthroughForHostEvent(iFrame, UiPassthroughEvent.saveAnswer, payload);
|
|
14613
|
+
}
|
|
14614
|
+
// fallback for save answer is Save
|
|
14615
|
+
if (hostEvent === HostEvent.SaveAnswer)
|
|
14616
|
+
hostEvent = HostEvent.Save;
|
|
14617
|
+
return this.hostEventFallback(iFrame, hostEvent, payload);
|
|
14618
|
+
}
|
|
14619
|
+
}
|
|
14555
14620
|
|
|
14556
14621
|
/**
|
|
14557
14622
|
* Copyright (c) 2022
|
|
@@ -14666,6 +14731,17 @@ class TsEmbed {
|
|
|
14666
14731
|
this.on(EmbedEvent.AuthExpire, this.updateAuthToken, { start: false }, true);
|
|
14667
14732
|
};
|
|
14668
14733
|
this.showPreRenderByDefault = false;
|
|
14734
|
+
/**
|
|
14735
|
+
* Triggers an event to the embedded app, skipping the UI flow.
|
|
14736
|
+
* @param {UiPassthroughEvent} apiName - The name of the API to be triggered.
|
|
14737
|
+
* @param {UiPassthroughRequest} parameters - The parameters to be passed to the API.
|
|
14738
|
+
* @returns {Promise<UiPassthroughRequest>} - A promise that resolves with the response
|
|
14739
|
+
* from the embedded app.
|
|
14740
|
+
*/
|
|
14741
|
+
// eslint-disable-next-line arrow-body-style
|
|
14742
|
+
this.triggerUiPassThrough = (apiName, parameters) => {
|
|
14743
|
+
return this.hostEventClient.executeUiPassthroughApi(this.iFrame, apiName, parameters);
|
|
14744
|
+
};
|
|
14669
14745
|
this.validatePreRenderViewConfig = (viewConfig) => {
|
|
14670
14746
|
var _a;
|
|
14671
14747
|
const preRenderAllowedKeys = ['preRenderId', 'vizId', 'liveboardId'];
|
|
@@ -14707,6 +14783,7 @@ class TsEmbed {
|
|
|
14707
14783
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
|
|
14708
14784
|
...viewConfig,
|
|
14709
14785
|
});
|
|
14786
|
+
this.hostEventClient = new HostEventClient(this.embedConfig.thoughtSpotHost);
|
|
14710
14787
|
}
|
|
14711
14788
|
/**
|
|
14712
14789
|
* Throws error encountered during initialization.
|
|
@@ -14981,6 +15058,9 @@ class TsEmbed {
|
|
|
14981
15058
|
setAttributes(iFrame, restParams);
|
|
14982
15059
|
iFrame.style.width = `${width}`;
|
|
14983
15060
|
iFrame.style.height = `${height}`;
|
|
15061
|
+
// Set minimum height to the frame so that,
|
|
15062
|
+
// scaling down on the fullheight doesn't make it too small.
|
|
15063
|
+
iFrame.style.minHeight = `${height}`;
|
|
14984
15064
|
iFrame.style.border = '0';
|
|
14985
15065
|
iFrame.name = 'ThoughtSpot Embedded Analytics';
|
|
14986
15066
|
return iFrame;
|
|
@@ -15322,8 +15402,9 @@ class TsEmbed {
|
|
|
15322
15402
|
* Triggers an event to the embedded app
|
|
15323
15403
|
* @param messageType The event type
|
|
15324
15404
|
* @param data The payload to send with the message
|
|
15405
|
+
* @returns A promise that resolves with the response from the embedded app
|
|
15325
15406
|
*/
|
|
15326
|
-
trigger(messageType, data
|
|
15407
|
+
trigger(messageType, data) {
|
|
15327
15408
|
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
|
|
15328
15409
|
if (!this.isRendered) {
|
|
15329
15410
|
this.handleError('Please call render before triggering events');
|
|
@@ -15333,7 +15414,7 @@ class TsEmbed {
|
|
|
15333
15414
|
this.handleError('Host event type is undefined');
|
|
15334
15415
|
return null;
|
|
15335
15416
|
}
|
|
15336
|
-
return
|
|
15417
|
+
return this.hostEventClient.executeHostEvent(this.iFrame, messageType, data);
|
|
15337
15418
|
}
|
|
15338
15419
|
/**
|
|
15339
15420
|
* Marks the ThoughtSpot object to have been rendered
|
|
@@ -16444,7 +16525,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
16444
16525
|
* @param messageType The event type
|
|
16445
16526
|
* @param data The payload to send with the message
|
|
16446
16527
|
*/
|
|
16447
|
-
trigger(messageType, data
|
|
16528
|
+
trigger(messageType, data) {
|
|
16448
16529
|
const dataWithVizId = data;
|
|
16449
16530
|
if (messageType === HostEvent.SetActiveTab) {
|
|
16450
16531
|
this.setActiveTab(data);
|
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.5-hostEvent.1 */
|
|
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
|
|
@@ -2685,6 +2685,16 @@
|
|
|
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.34.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
|
|
@@ -14515,6 +14525,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
14515
14525
|
return e;
|
|
14516
14526
|
}
|
|
14517
14527
|
|
|
14528
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.35.5-hostEvent.1";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --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};
|
|
14529
|
+
|
|
14518
14530
|
/**
|
|
14519
14531
|
* Reloads the ThoughtSpot iframe.
|
|
14520
14532
|
* @param iFrame
|
|
@@ -14573,7 +14585,60 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
14573
14585
|
});
|
|
14574
14586
|
}
|
|
14575
14587
|
|
|
14576
|
-
var
|
|
14588
|
+
var UiPassthroughEvent;
|
|
14589
|
+
(function (UiPassthroughEvent) {
|
|
14590
|
+
UiPassthroughEvent["addVizToPinboard"] = "addVizToPinboard";
|
|
14591
|
+
UiPassthroughEvent["saveAnswer"] = "saveAnswer";
|
|
14592
|
+
UiPassthroughEvent["getA3AnalysisColumns"] = "getA3AnalysisColumns";
|
|
14593
|
+
UiPassthroughEvent["getDiscoverabilityStatus"] = "getDiscoverabilityStatus";
|
|
14594
|
+
UiPassthroughEvent["getAvailableUiPassthroughs"] = "getAvailableUiPassthroughs";
|
|
14595
|
+
UiPassthroughEvent["getAnswerPageConfig"] = "getAnswerPageConfig";
|
|
14596
|
+
UiPassthroughEvent["getPinboardPageConfig"] = "getPinboardPageConfig";
|
|
14597
|
+
UiPassthroughEvent["UiPassthroughEventNotFound"] = "UiPassthroughEventNotFound";
|
|
14598
|
+
})(UiPassthroughEvent || (UiPassthroughEvent = {}));
|
|
14599
|
+
|
|
14600
|
+
class HostEventClient {
|
|
14601
|
+
constructor(thoughtSpotHost) {
|
|
14602
|
+
this.executeUiPassthroughApi = async (iFrame, apiName, parameters) => {
|
|
14603
|
+
const res = await processTrigger(iFrame, exports.HostEvent.UiPassthrough, this.thoughtSpotHost, {
|
|
14604
|
+
type: apiName,
|
|
14605
|
+
parameters,
|
|
14606
|
+
});
|
|
14607
|
+
return res;
|
|
14608
|
+
};
|
|
14609
|
+
this.handleUiPassthroughForHostEvent = async (iFrame, apiName, parameters) => {
|
|
14610
|
+
var _a, _b, _c;
|
|
14611
|
+
const response = (_b = (_a = (await this.executeUiPassthroughApi(iFrame, 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];
|
|
14612
|
+
if (!response) {
|
|
14613
|
+
const error = `No answer found${parameters.vizId ? ` for vizId: ${parameters.vizId}` : ''}.`;
|
|
14614
|
+
// eslint-disable-next-line no-throw-literal
|
|
14615
|
+
throw { error };
|
|
14616
|
+
}
|
|
14617
|
+
const errors = response.error || ((_c = response.value) === null || _c === void 0 ? void 0 : _c.errors);
|
|
14618
|
+
if (errors) {
|
|
14619
|
+
// eslint-disable-next-line no-throw-literal
|
|
14620
|
+
throw { error: response.error };
|
|
14621
|
+
}
|
|
14622
|
+
return { ...response.value };
|
|
14623
|
+
};
|
|
14624
|
+
this.thoughtSpotHost = thoughtSpotHost;
|
|
14625
|
+
}
|
|
14626
|
+
async hostEventFallback(iFrame, hostEvent, data) {
|
|
14627
|
+
return processTrigger(iFrame, hostEvent, this.thoughtSpotHost, data);
|
|
14628
|
+
}
|
|
14629
|
+
async executeHostEvent(iFrame, hostEvent, payload) {
|
|
14630
|
+
if (hostEvent === exports.HostEvent.Pin && (payload === null || payload === void 0 ? void 0 : payload.newVizName)) {
|
|
14631
|
+
return this.handleUiPassthroughForHostEvent(iFrame, UiPassthroughEvent.addVizToPinboard, payload);
|
|
14632
|
+
}
|
|
14633
|
+
if (hostEvent === exports.HostEvent.SaveAnswer && (payload === null || payload === void 0 ? void 0 : payload.name)) {
|
|
14634
|
+
return this.handleUiPassthroughForHostEvent(iFrame, UiPassthroughEvent.saveAnswer, payload);
|
|
14635
|
+
}
|
|
14636
|
+
// fallback for save answer is Save
|
|
14637
|
+
if (hostEvent === exports.HostEvent.SaveAnswer)
|
|
14638
|
+
hostEvent = exports.HostEvent.Save;
|
|
14639
|
+
return this.hostEventFallback(iFrame, hostEvent, payload);
|
|
14640
|
+
}
|
|
14641
|
+
}
|
|
14577
14642
|
|
|
14578
14643
|
/**
|
|
14579
14644
|
* Copyright (c) 2022
|
|
@@ -14688,6 +14753,17 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
14688
14753
|
this.on(exports.EmbedEvent.AuthExpire, this.updateAuthToken, { start: false }, true);
|
|
14689
14754
|
};
|
|
14690
14755
|
this.showPreRenderByDefault = false;
|
|
14756
|
+
/**
|
|
14757
|
+
* Triggers an event to the embedded app, skipping the UI flow.
|
|
14758
|
+
* @param {UiPassthroughEvent} apiName - The name of the API to be triggered.
|
|
14759
|
+
* @param {UiPassthroughRequest} parameters - The parameters to be passed to the API.
|
|
14760
|
+
* @returns {Promise<UiPassthroughRequest>} - A promise that resolves with the response
|
|
14761
|
+
* from the embedded app.
|
|
14762
|
+
*/
|
|
14763
|
+
// eslint-disable-next-line arrow-body-style
|
|
14764
|
+
this.triggerUiPassThrough = (apiName, parameters) => {
|
|
14765
|
+
return this.hostEventClient.executeUiPassthroughApi(this.iFrame, apiName, parameters);
|
|
14766
|
+
};
|
|
14691
14767
|
this.validatePreRenderViewConfig = (viewConfig) => {
|
|
14692
14768
|
var _a;
|
|
14693
14769
|
const preRenderAllowedKeys = ['preRenderId', 'vizId', 'liveboardId'];
|
|
@@ -14729,6 +14805,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
14729
14805
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
|
|
14730
14806
|
...viewConfig,
|
|
14731
14807
|
});
|
|
14808
|
+
this.hostEventClient = new HostEventClient(this.embedConfig.thoughtSpotHost);
|
|
14732
14809
|
}
|
|
14733
14810
|
/**
|
|
14734
14811
|
* Throws error encountered during initialization.
|
|
@@ -15003,6 +15080,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15003
15080
|
setAttributes(iFrame, restParams);
|
|
15004
15081
|
iFrame.style.width = `${width}`;
|
|
15005
15082
|
iFrame.style.height = `${height}`;
|
|
15083
|
+
// Set minimum height to the frame so that,
|
|
15084
|
+
// scaling down on the fullheight doesn't make it too small.
|
|
15085
|
+
iFrame.style.minHeight = `${height}`;
|
|
15006
15086
|
iFrame.style.border = '0';
|
|
15007
15087
|
iFrame.name = 'ThoughtSpot Embedded Analytics';
|
|
15008
15088
|
return iFrame;
|
|
@@ -15344,8 +15424,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15344
15424
|
* Triggers an event to the embedded app
|
|
15345
15425
|
* @param messageType The event type
|
|
15346
15426
|
* @param data The payload to send with the message
|
|
15427
|
+
* @returns A promise that resolves with the response from the embedded app
|
|
15347
15428
|
*/
|
|
15348
|
-
trigger(messageType, data
|
|
15429
|
+
trigger(messageType, data) {
|
|
15349
15430
|
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
|
|
15350
15431
|
if (!this.isRendered) {
|
|
15351
15432
|
this.handleError('Please call render before triggering events');
|
|
@@ -15355,7 +15436,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15355
15436
|
this.handleError('Host event type is undefined');
|
|
15356
15437
|
return null;
|
|
15357
15438
|
}
|
|
15358
|
-
return
|
|
15439
|
+
return this.hostEventClient.executeHostEvent(this.iFrame, messageType, data);
|
|
15359
15440
|
}
|
|
15360
15441
|
/**
|
|
15361
15442
|
* Marks the ThoughtSpot object to have been rendered
|
|
@@ -16466,7 +16547,7 @@ query GetEurekaVizSnapshots(
|
|
|
16466
16547
|
* @param messageType The event type
|
|
16467
16548
|
* @param data The payload to send with the message
|
|
16468
16549
|
*/
|
|
16469
|
-
trigger(messageType, data
|
|
16550
|
+
trigger(messageType, data) {
|
|
16470
16551
|
const dataWithVizId = data;
|
|
16471
16552
|
if (messageType === exports.HostEvent.SetActiveTab) {
|
|
16472
16553
|
this.setActiveTab(data);
|
package/dist/tsembed.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.35.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.35.5-hostEvent.1 */
|
|
2
2
|
function _mergeNamespaces(n, m) {
|
|
3
3
|
m.forEach(function (e) {
|
|
4
4
|
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
@@ -1063,8 +1063,8 @@ var EmbedEvent;
|
|
|
1063
1063
|
*
|
|
1064
1064
|
* **Note**: This event is deprecated in v1.21.0.
|
|
1065
1065
|
* To fire an event when a download action is initiated on a chart or table,
|
|
1066
|
-
* use `EmbedEvent.DownloadAsPng`, `EmbedEvent.DownloadAsPDF`,
|
|
1067
|
-
* or `EmbedEvent.DownloadAsXLSX`
|
|
1066
|
+
* use `EmbedEvent.DownloadAsPng`, `EmbedEvent.DownloadAsPDF`,
|
|
1067
|
+
* `EmbedEvent.DownloadAsCSV`, or `EmbedEvent.DownloadAsXLSX`
|
|
1068
1068
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1069
1069
|
* @example
|
|
1070
1070
|
*```js
|
|
@@ -2548,6 +2548,16 @@ var HostEvent;
|
|
|
2548
2548
|
* @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
|
|
2549
2549
|
*/
|
|
2550
2550
|
HostEvent["UpdatePersonalisedView"] = "UpdatePersonalisedView";
|
|
2551
|
+
/**
|
|
2552
|
+
* Triggers the action to get the current view of the liveboard
|
|
2553
|
+
* @version SDK: 1.34.0 | Thoughtspot: 10.6.0.cl
|
|
2554
|
+
*/
|
|
2555
|
+
HostEvent["SaveAnswer"] = "saveAnswer";
|
|
2556
|
+
/**
|
|
2557
|
+
* EmbedApi
|
|
2558
|
+
* @hidden
|
|
2559
|
+
*/
|
|
2560
|
+
HostEvent["UiPassthrough"] = "UiPassthrough";
|
|
2551
2561
|
})(HostEvent || (HostEvent = {}));
|
|
2552
2562
|
/**
|
|
2553
2563
|
* The different visual modes that the data sources panel within
|
|
@@ -7049,7 +7059,7 @@ class AnswerService {
|
|
|
7049
7059
|
async getTML() {
|
|
7050
7060
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
7051
7061
|
const edoc = object[0].edoc;
|
|
7052
|
-
const YAML = await import('./index-
|
|
7062
|
+
const YAML = await import('./index-CzwzS0P4.js');
|
|
7053
7063
|
const parsedDoc = YAML.parse(edoc);
|
|
7054
7064
|
return {
|
|
7055
7065
|
answer: {
|
|
@@ -14735,6 +14745,8 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
|
|
|
14735
14745
|
return e;
|
|
14736
14746
|
}
|
|
14737
14747
|
|
|
14748
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.35.5-hostEvent.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 . --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,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};
|
|
14749
|
+
|
|
14738
14750
|
/**
|
|
14739
14751
|
* Reloads the ThoughtSpot iframe.
|
|
14740
14752
|
* @param iFrame
|
|
@@ -14793,7 +14805,60 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
|
14793
14805
|
});
|
|
14794
14806
|
}
|
|
14795
14807
|
|
|
14796
|
-
var
|
|
14808
|
+
var UiPassthroughEvent;
|
|
14809
|
+
(function (UiPassthroughEvent) {
|
|
14810
|
+
UiPassthroughEvent["addVizToPinboard"] = "addVizToPinboard";
|
|
14811
|
+
UiPassthroughEvent["saveAnswer"] = "saveAnswer";
|
|
14812
|
+
UiPassthroughEvent["getA3AnalysisColumns"] = "getA3AnalysisColumns";
|
|
14813
|
+
UiPassthroughEvent["getDiscoverabilityStatus"] = "getDiscoverabilityStatus";
|
|
14814
|
+
UiPassthroughEvent["getAvailableUiPassthroughs"] = "getAvailableUiPassthroughs";
|
|
14815
|
+
UiPassthroughEvent["getAnswerPageConfig"] = "getAnswerPageConfig";
|
|
14816
|
+
UiPassthroughEvent["getPinboardPageConfig"] = "getPinboardPageConfig";
|
|
14817
|
+
UiPassthroughEvent["UiPassthroughEventNotFound"] = "UiPassthroughEventNotFound";
|
|
14818
|
+
})(UiPassthroughEvent || (UiPassthroughEvent = {}));
|
|
14819
|
+
|
|
14820
|
+
class HostEventClient {
|
|
14821
|
+
constructor(thoughtSpotHost) {
|
|
14822
|
+
this.executeUiPassthroughApi = async (iFrame, apiName, parameters) => {
|
|
14823
|
+
const res = await processTrigger(iFrame, HostEvent.UiPassthrough, this.thoughtSpotHost, {
|
|
14824
|
+
type: apiName,
|
|
14825
|
+
parameters,
|
|
14826
|
+
});
|
|
14827
|
+
return res;
|
|
14828
|
+
};
|
|
14829
|
+
this.handleUiPassthroughForHostEvent = async (iFrame, apiName, parameters) => {
|
|
14830
|
+
var _a, _b, _c;
|
|
14831
|
+
const response = (_b = (_a = (await this.executeUiPassthroughApi(iFrame, 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];
|
|
14832
|
+
if (!response) {
|
|
14833
|
+
const error = `No answer found${parameters.vizId ? ` for vizId: ${parameters.vizId}` : ''}.`;
|
|
14834
|
+
// eslint-disable-next-line no-throw-literal
|
|
14835
|
+
throw { error };
|
|
14836
|
+
}
|
|
14837
|
+
const errors = response.error || ((_c = response.value) === null || _c === void 0 ? void 0 : _c.errors);
|
|
14838
|
+
if (errors) {
|
|
14839
|
+
// eslint-disable-next-line no-throw-literal
|
|
14840
|
+
throw { error: response.error };
|
|
14841
|
+
}
|
|
14842
|
+
return { ...response.value };
|
|
14843
|
+
};
|
|
14844
|
+
this.thoughtSpotHost = thoughtSpotHost;
|
|
14845
|
+
}
|
|
14846
|
+
async hostEventFallback(iFrame, hostEvent, data) {
|
|
14847
|
+
return processTrigger(iFrame, hostEvent, this.thoughtSpotHost, data);
|
|
14848
|
+
}
|
|
14849
|
+
async executeHostEvent(iFrame, hostEvent, payload) {
|
|
14850
|
+
if (hostEvent === HostEvent.Pin && (payload === null || payload === void 0 ? void 0 : payload.newVizName)) {
|
|
14851
|
+
return this.handleUiPassthroughForHostEvent(iFrame, UiPassthroughEvent.addVizToPinboard, payload);
|
|
14852
|
+
}
|
|
14853
|
+
if (hostEvent === HostEvent.SaveAnswer && (payload === null || payload === void 0 ? void 0 : payload.name)) {
|
|
14854
|
+
return this.handleUiPassthroughForHostEvent(iFrame, UiPassthroughEvent.saveAnswer, payload);
|
|
14855
|
+
}
|
|
14856
|
+
// fallback for save answer is Save
|
|
14857
|
+
if (hostEvent === HostEvent.SaveAnswer)
|
|
14858
|
+
hostEvent = HostEvent.Save;
|
|
14859
|
+
return this.hostEventFallback(iFrame, hostEvent, payload);
|
|
14860
|
+
}
|
|
14861
|
+
}
|
|
14797
14862
|
|
|
14798
14863
|
/**
|
|
14799
14864
|
* Copyright (c) 2022
|
|
@@ -14908,6 +14973,17 @@ class TsEmbed {
|
|
|
14908
14973
|
this.on(EmbedEvent.AuthExpire, this.updateAuthToken, { start: false }, true);
|
|
14909
14974
|
};
|
|
14910
14975
|
this.showPreRenderByDefault = false;
|
|
14976
|
+
/**
|
|
14977
|
+
* Triggers an event to the embedded app, skipping the UI flow.
|
|
14978
|
+
* @param {UiPassthroughEvent} apiName - The name of the API to be triggered.
|
|
14979
|
+
* @param {UiPassthroughRequest} parameters - The parameters to be passed to the API.
|
|
14980
|
+
* @returns {Promise<UiPassthroughRequest>} - A promise that resolves with the response
|
|
14981
|
+
* from the embedded app.
|
|
14982
|
+
*/
|
|
14983
|
+
// eslint-disable-next-line arrow-body-style
|
|
14984
|
+
this.triggerUiPassThrough = (apiName, parameters) => {
|
|
14985
|
+
return this.hostEventClient.executeUiPassthroughApi(this.iFrame, apiName, parameters);
|
|
14986
|
+
};
|
|
14911
14987
|
this.validatePreRenderViewConfig = (viewConfig) => {
|
|
14912
14988
|
var _a;
|
|
14913
14989
|
const preRenderAllowedKeys = ['preRenderId', 'vizId', 'liveboardId'];
|
|
@@ -14949,6 +15025,7 @@ class TsEmbed {
|
|
|
14949
15025
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
|
|
14950
15026
|
...viewConfig,
|
|
14951
15027
|
});
|
|
15028
|
+
this.hostEventClient = new HostEventClient(this.embedConfig.thoughtSpotHost);
|
|
14952
15029
|
}
|
|
14953
15030
|
/**
|
|
14954
15031
|
* Throws error encountered during initialization.
|
|
@@ -15223,6 +15300,9 @@ class TsEmbed {
|
|
|
15223
15300
|
setAttributes(iFrame, restParams);
|
|
15224
15301
|
iFrame.style.width = `${width}`;
|
|
15225
15302
|
iFrame.style.height = `${height}`;
|
|
15303
|
+
// Set minimum height to the frame so that,
|
|
15304
|
+
// scaling down on the fullheight doesn't make it too small.
|
|
15305
|
+
iFrame.style.minHeight = `${height}`;
|
|
15226
15306
|
iFrame.style.border = '0';
|
|
15227
15307
|
iFrame.name = 'ThoughtSpot Embedded Analytics';
|
|
15228
15308
|
return iFrame;
|
|
@@ -15564,8 +15644,9 @@ class TsEmbed {
|
|
|
15564
15644
|
* Triggers an event to the embedded app
|
|
15565
15645
|
* @param messageType The event type
|
|
15566
15646
|
* @param data The payload to send with the message
|
|
15647
|
+
* @returns A promise that resolves with the response from the embedded app
|
|
15567
15648
|
*/
|
|
15568
|
-
trigger(messageType, data
|
|
15649
|
+
trigger(messageType, data) {
|
|
15569
15650
|
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
|
|
15570
15651
|
if (!this.isRendered) {
|
|
15571
15652
|
this.handleError('Please call render before triggering events');
|
|
@@ -15575,7 +15656,7 @@ class TsEmbed {
|
|
|
15575
15656
|
this.handleError('Host event type is undefined');
|
|
15576
15657
|
return null;
|
|
15577
15658
|
}
|
|
15578
|
-
return
|
|
15659
|
+
return this.hostEventClient.executeHostEvent(this.iFrame, messageType, data);
|
|
15579
15660
|
}
|
|
15580
15661
|
/**
|
|
15581
15662
|
* Marks the ThoughtSpot object to have been rendered
|
|
@@ -16389,7 +16470,7 @@ class LiveboardEmbed extends V1Embed {
|
|
|
16389
16470
|
* @param messageType The event type
|
|
16390
16471
|
* @param data The payload to send with the message
|
|
16391
16472
|
*/
|
|
16392
|
-
trigger(messageType, data
|
|
16473
|
+
trigger(messageType, data) {
|
|
16393
16474
|
const dataWithVizId = data;
|
|
16394
16475
|
if (messageType === HostEvent.SetActiveTab) {
|
|
16395
16476
|
this.setActiveTab(data);
|
|
@@ -17783,4 +17864,4 @@ const createLiveboardWithAnswers = async (answers, name) => {
|
|
|
17783
17864
|
return result;
|
|
17784
17865
|
};
|
|
17785
17866
|
|
|
17786
|
-
export { Action, AnswerService, AppEmbed, AuthEvent, AuthFailureType, AuthStatus, AuthType, BodylessConversation, ContextMenuTriggerOptions, ConversationEmbed, DataSourceVisualMode, EmbedEvent, HomeLeftNavItem, HomePageSearchBarMode, HomepageModule, HostEvent, LiveboardEmbed, LogLevel, MIXPANEL_EVENT, Page, PinboardEmbed, PrefetchFeatures, RuntimeFilterOp, SageEmbed, SearchBarEmbed, SearchEmbed, createLiveboardWithAnswers, executeTML, exportTML, getAnswerFromQuery, getEmbedConfig as getInitConfig, getSessionInfo, init, logout, prefetch, resetCachedAuthToken, tokenizedFetch, uploadMixpanelEvent };
|
|
17867
|
+
export { Action, AnswerService, AppEmbed, AuthEvent, AuthFailureType, AuthStatus, AuthType, BodylessConversation, ContextMenuTriggerOptions, ConversationEmbed, DataSourceVisualMode, EmbedEvent, HomeLeftNavItem, HomePageSearchBarMode, HomepageModule, HostEvent, LiveboardEmbed, LogLevel, MIXPANEL_EVENT, Page, PinboardEmbed, PrefetchFeatures, RuntimeFilterOp, SageEmbed, SearchBarEmbed, SearchEmbed, UiPassthroughEvent, createLiveboardWithAnswers, executeTML, exportTML, getAnswerFromQuery, getEmbedConfig as getInitConfig, getSessionInfo, init, logout, prefetch, resetCachedAuthToken, tokenizedFetch, uploadMixpanelEvent };
|