@thoughtspot/visual-embed-sdk 1.35.3 → 1.35.5-hostEvent.2
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 +91 -0
- package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -0
- package/cjs/src/embed/hostEventClient/contracts.js +15 -0
- package/cjs/src/embed/hostEventClient/contracts.js.map +1 -0
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts +11 -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 +16 -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 +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 +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-BaGHDCpW.js → index-CbltIawo.js} +1 -1
- package/dist/index-CzwzS0P4.js +7370 -0
- package/dist/index-DFwi_pV_.js +7370 -0
- package/dist/src/embed/hostEventClient/contracts.d.ts +91 -0
- package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -0
- package/dist/src/embed/hostEventClient/host-event-client.d.ts +11 -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 +85 -8
- package/dist/tsembed-react.js +84 -7
- package/dist/tsembed.es.js +86 -9
- package/dist/tsembed.js +84 -7
- package/dist/visual-embed-sdk-react-full.d.ts +125 -6
- package/dist/visual-embed-sdk-react.d.ts +125 -6
- package/dist/visual-embed-sdk.d.ts +125 -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 +91 -0
- package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -0
- package/lib/src/embed/hostEventClient/contracts.js +12 -0
- package/lib/src/embed/hostEventClient/contracts.js.map +1 -0
- package/lib/src/embed/hostEventClient/host-event-client.d.ts +11 -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 +16 -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 +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 +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 +136 -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 +102 -0
- package/src/embed/hostEventClient/host-event-client.spec.ts +234 -0
- package/src/embed/hostEventClient/host-event-client.ts +78 -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 +40 -1
- package/src/embed/ts-embed.ts +35 -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.2 */
|
|
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.36.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-DFwi_pV_.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.2";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,59 @@ 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 || (UiPassthroughEvent = {}));
|
|
14576
|
+
|
|
14577
|
+
class HostEventClient {
|
|
14578
|
+
constructor(thoughtSpotHost) {
|
|
14579
|
+
this.thoughtSpotHost = thoughtSpotHost;
|
|
14580
|
+
}
|
|
14581
|
+
async executeUiPassthroughApi(iFrame, apiName, parameters) {
|
|
14582
|
+
const res = await processTrigger(iFrame, HostEvent.UiPassthrough, this.thoughtSpotHost, {
|
|
14583
|
+
type: apiName,
|
|
14584
|
+
parameters,
|
|
14585
|
+
});
|
|
14586
|
+
return res;
|
|
14587
|
+
}
|
|
14588
|
+
async handleUiPassthroughForHostEvent(iFrame, apiName, parameters) {
|
|
14589
|
+
var _a, _b, _c;
|
|
14590
|
+
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];
|
|
14591
|
+
if (!response) {
|
|
14592
|
+
const error = `No answer found${parameters.vizId ? ` for vizId: ${parameters.vizId}` : ''}.`;
|
|
14593
|
+
// eslint-disable-next-line no-throw-literal
|
|
14594
|
+
throw { error };
|
|
14595
|
+
}
|
|
14596
|
+
const errors = response.error || ((_c = response.value) === null || _c === void 0 ? void 0 : _c.errors);
|
|
14597
|
+
if (errors) {
|
|
14598
|
+
// eslint-disable-next-line no-throw-literal
|
|
14599
|
+
throw { error: response.error };
|
|
14600
|
+
}
|
|
14601
|
+
return { ...response.value };
|
|
14602
|
+
}
|
|
14603
|
+
async hostEventFallback(iFrame, hostEvent, data) {
|
|
14604
|
+
return processTrigger(iFrame, hostEvent, this.thoughtSpotHost, data);
|
|
14605
|
+
}
|
|
14606
|
+
async executeHostEvent(iFrame, hostEvent, payload) {
|
|
14607
|
+
if (hostEvent === HostEvent.Pin && (payload === null || payload === void 0 ? void 0 : payload.newVizName)) {
|
|
14608
|
+
return this.handleUiPassthroughForHostEvent(iFrame, UiPassthroughEvent.addVizToPinboard, payload);
|
|
14609
|
+
}
|
|
14610
|
+
if (hostEvent === HostEvent.SaveAnswer && (payload === null || payload === void 0 ? void 0 : payload.name)) {
|
|
14611
|
+
return this.handleUiPassthroughForHostEvent(iFrame, UiPassthroughEvent.saveAnswer, payload);
|
|
14612
|
+
}
|
|
14613
|
+
// fallback for save answer is Save
|
|
14614
|
+
if (hostEvent === HostEvent.SaveAnswer)
|
|
14615
|
+
hostEvent = HostEvent.Save;
|
|
14616
|
+
return this.hostEventFallback(iFrame, hostEvent, payload);
|
|
14617
|
+
}
|
|
14618
|
+
}
|
|
14555
14619
|
|
|
14556
14620
|
/**
|
|
14557
14621
|
* Copyright (c) 2022
|
|
@@ -14707,6 +14771,7 @@ class TsEmbed {
|
|
|
14707
14771
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
|
|
14708
14772
|
...viewConfig,
|
|
14709
14773
|
});
|
|
14774
|
+
this.hostEventClient = new HostEventClient(this.embedConfig.thoughtSpotHost);
|
|
14710
14775
|
}
|
|
14711
14776
|
/**
|
|
14712
14777
|
* Throws error encountered during initialization.
|
|
@@ -15325,8 +15390,9 @@ class TsEmbed {
|
|
|
15325
15390
|
* Triggers an event to the embedded app
|
|
15326
15391
|
* @param messageType The event type
|
|
15327
15392
|
* @param data The payload to send with the message
|
|
15393
|
+
* @returns A promise that resolves with the response from the embedded app
|
|
15328
15394
|
*/
|
|
15329
|
-
trigger(messageType, data
|
|
15395
|
+
trigger(messageType, data) {
|
|
15330
15396
|
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
|
|
15331
15397
|
if (!this.isRendered) {
|
|
15332
15398
|
this.handleError('Please call render before triggering events');
|
|
@@ -15336,7 +15402,18 @@ class TsEmbed {
|
|
|
15336
15402
|
this.handleError('Host event type is undefined');
|
|
15337
15403
|
return null;
|
|
15338
15404
|
}
|
|
15339
|
-
return
|
|
15405
|
+
return this.hostEventClient.executeHostEvent(this.iFrame, messageType, data);
|
|
15406
|
+
}
|
|
15407
|
+
/**
|
|
15408
|
+
* Triggers an event to the embedded app, skipping the UI flow.
|
|
15409
|
+
* @param {UiPassthroughEvent} apiName - The name of the API to be triggered.
|
|
15410
|
+
* @param {UiPassthroughRequest} parameters - The parameters to be passed to the API.
|
|
15411
|
+
* @returns {Promise<UiPassthroughRequest>} - A promise that resolves with the response
|
|
15412
|
+
* from the embedded app.
|
|
15413
|
+
*/
|
|
15414
|
+
// eslint-disable-next-line arrow-body-style
|
|
15415
|
+
triggerUiPassThrough(apiName, parameters) {
|
|
15416
|
+
return this.hostEventClient.executeUiPassthroughApi(this.iFrame, apiName, parameters);
|
|
15340
15417
|
}
|
|
15341
15418
|
/**
|
|
15342
15419
|
* Marks the ThoughtSpot object to have been rendered
|
|
@@ -16447,7 +16524,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
16447
16524
|
* @param messageType The event type
|
|
16448
16525
|
* @param data The payload to send with the message
|
|
16449
16526
|
*/
|
|
16450
|
-
trigger(messageType, data
|
|
16527
|
+
trigger(messageType, data) {
|
|
16451
16528
|
const dataWithVizId = data;
|
|
16452
16529
|
if (messageType === HostEvent.SetActiveTab) {
|
|
16453
16530
|
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.2 */
|
|
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.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
|
|
@@ -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.2";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,59 @@ 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 || (UiPassthroughEvent = {}));
|
|
14598
|
+
|
|
14599
|
+
class HostEventClient {
|
|
14600
|
+
constructor(thoughtSpotHost) {
|
|
14601
|
+
this.thoughtSpotHost = thoughtSpotHost;
|
|
14602
|
+
}
|
|
14603
|
+
async executeUiPassthroughApi(iFrame, apiName, parameters) {
|
|
14604
|
+
const res = await processTrigger(iFrame, exports.HostEvent.UiPassthrough, this.thoughtSpotHost, {
|
|
14605
|
+
type: apiName,
|
|
14606
|
+
parameters,
|
|
14607
|
+
});
|
|
14608
|
+
return res;
|
|
14609
|
+
}
|
|
14610
|
+
async handleUiPassthroughForHostEvent(iFrame, apiName, parameters) {
|
|
14611
|
+
var _a, _b, _c;
|
|
14612
|
+
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];
|
|
14613
|
+
if (!response) {
|
|
14614
|
+
const error = `No answer found${parameters.vizId ? ` for vizId: ${parameters.vizId}` : ''}.`;
|
|
14615
|
+
// eslint-disable-next-line no-throw-literal
|
|
14616
|
+
throw { error };
|
|
14617
|
+
}
|
|
14618
|
+
const errors = response.error || ((_c = response.value) === null || _c === void 0 ? void 0 : _c.errors);
|
|
14619
|
+
if (errors) {
|
|
14620
|
+
// eslint-disable-next-line no-throw-literal
|
|
14621
|
+
throw { error: response.error };
|
|
14622
|
+
}
|
|
14623
|
+
return { ...response.value };
|
|
14624
|
+
}
|
|
14625
|
+
async hostEventFallback(iFrame, hostEvent, data) {
|
|
14626
|
+
return processTrigger(iFrame, hostEvent, this.thoughtSpotHost, data);
|
|
14627
|
+
}
|
|
14628
|
+
async executeHostEvent(iFrame, hostEvent, payload) {
|
|
14629
|
+
if (hostEvent === exports.HostEvent.Pin && (payload === null || payload === void 0 ? void 0 : payload.newVizName)) {
|
|
14630
|
+
return this.handleUiPassthroughForHostEvent(iFrame, UiPassthroughEvent.addVizToPinboard, payload);
|
|
14631
|
+
}
|
|
14632
|
+
if (hostEvent === exports.HostEvent.SaveAnswer && (payload === null || payload === void 0 ? void 0 : payload.name)) {
|
|
14633
|
+
return this.handleUiPassthroughForHostEvent(iFrame, UiPassthroughEvent.saveAnswer, payload);
|
|
14634
|
+
}
|
|
14635
|
+
// fallback for save answer is Save
|
|
14636
|
+
if (hostEvent === exports.HostEvent.SaveAnswer)
|
|
14637
|
+
hostEvent = exports.HostEvent.Save;
|
|
14638
|
+
return this.hostEventFallback(iFrame, hostEvent, payload);
|
|
14639
|
+
}
|
|
14640
|
+
}
|
|
14577
14641
|
|
|
14578
14642
|
/**
|
|
14579
14643
|
* Copyright (c) 2022
|
|
@@ -14729,6 +14793,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
14729
14793
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
|
|
14730
14794
|
...viewConfig,
|
|
14731
14795
|
});
|
|
14796
|
+
this.hostEventClient = new HostEventClient(this.embedConfig.thoughtSpotHost);
|
|
14732
14797
|
}
|
|
14733
14798
|
/**
|
|
14734
14799
|
* Throws error encountered during initialization.
|
|
@@ -15347,8 +15412,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15347
15412
|
* Triggers an event to the embedded app
|
|
15348
15413
|
* @param messageType The event type
|
|
15349
15414
|
* @param data The payload to send with the message
|
|
15415
|
+
* @returns A promise that resolves with the response from the embedded app
|
|
15350
15416
|
*/
|
|
15351
|
-
trigger(messageType, data
|
|
15417
|
+
trigger(messageType, data) {
|
|
15352
15418
|
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
|
|
15353
15419
|
if (!this.isRendered) {
|
|
15354
15420
|
this.handleError('Please call render before triggering events');
|
|
@@ -15358,7 +15424,18 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15358
15424
|
this.handleError('Host event type is undefined');
|
|
15359
15425
|
return null;
|
|
15360
15426
|
}
|
|
15361
|
-
return
|
|
15427
|
+
return this.hostEventClient.executeHostEvent(this.iFrame, messageType, data);
|
|
15428
|
+
}
|
|
15429
|
+
/**
|
|
15430
|
+
* Triggers an event to the embedded app, skipping the UI flow.
|
|
15431
|
+
* @param {UiPassthroughEvent} apiName - The name of the API to be triggered.
|
|
15432
|
+
* @param {UiPassthroughRequest} parameters - The parameters to be passed to the API.
|
|
15433
|
+
* @returns {Promise<UiPassthroughRequest>} - A promise that resolves with the response
|
|
15434
|
+
* from the embedded app.
|
|
15435
|
+
*/
|
|
15436
|
+
// eslint-disable-next-line arrow-body-style
|
|
15437
|
+
triggerUiPassThrough(apiName, parameters) {
|
|
15438
|
+
return this.hostEventClient.executeUiPassthroughApi(this.iFrame, apiName, parameters);
|
|
15362
15439
|
}
|
|
15363
15440
|
/**
|
|
15364
15441
|
* Marks the ThoughtSpot object to have been rendered
|
|
@@ -16469,7 +16546,7 @@ query GetEurekaVizSnapshots(
|
|
|
16469
16546
|
* @param messageType The event type
|
|
16470
16547
|
* @param data The payload to send with the message
|
|
16471
16548
|
*/
|
|
16472
|
-
trigger(messageType, data
|
|
16549
|
+
trigger(messageType, data) {
|
|
16473
16550
|
const dataWithVizId = data;
|
|
16474
16551
|
if (messageType === exports.HostEvent.SetActiveTab) {
|
|
16475
16552
|
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.2 */
|
|
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.36.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-DFwi_pV_.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.2";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,59 @@ 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 || (UiPassthroughEvent = {}));
|
|
14818
|
+
|
|
14819
|
+
class HostEventClient {
|
|
14820
|
+
constructor(thoughtSpotHost) {
|
|
14821
|
+
this.thoughtSpotHost = thoughtSpotHost;
|
|
14822
|
+
}
|
|
14823
|
+
async executeUiPassthroughApi(iFrame, apiName, parameters) {
|
|
14824
|
+
const res = await processTrigger(iFrame, HostEvent.UiPassthrough, this.thoughtSpotHost, {
|
|
14825
|
+
type: apiName,
|
|
14826
|
+
parameters,
|
|
14827
|
+
});
|
|
14828
|
+
return res;
|
|
14829
|
+
}
|
|
14830
|
+
async handleUiPassthroughForHostEvent(iFrame, apiName, parameters) {
|
|
14831
|
+
var _a, _b, _c;
|
|
14832
|
+
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];
|
|
14833
|
+
if (!response) {
|
|
14834
|
+
const error = `No answer found${parameters.vizId ? ` for vizId: ${parameters.vizId}` : ''}.`;
|
|
14835
|
+
// eslint-disable-next-line no-throw-literal
|
|
14836
|
+
throw { error };
|
|
14837
|
+
}
|
|
14838
|
+
const errors = response.error || ((_c = response.value) === null || _c === void 0 ? void 0 : _c.errors);
|
|
14839
|
+
if (errors) {
|
|
14840
|
+
// eslint-disable-next-line no-throw-literal
|
|
14841
|
+
throw { error: response.error };
|
|
14842
|
+
}
|
|
14843
|
+
return { ...response.value };
|
|
14844
|
+
}
|
|
14845
|
+
async hostEventFallback(iFrame, hostEvent, data) {
|
|
14846
|
+
return processTrigger(iFrame, hostEvent, this.thoughtSpotHost, data);
|
|
14847
|
+
}
|
|
14848
|
+
async executeHostEvent(iFrame, hostEvent, payload) {
|
|
14849
|
+
if (hostEvent === HostEvent.Pin && (payload === null || payload === void 0 ? void 0 : payload.newVizName)) {
|
|
14850
|
+
return this.handleUiPassthroughForHostEvent(iFrame, UiPassthroughEvent.addVizToPinboard, payload);
|
|
14851
|
+
}
|
|
14852
|
+
if (hostEvent === HostEvent.SaveAnswer && (payload === null || payload === void 0 ? void 0 : payload.name)) {
|
|
14853
|
+
return this.handleUiPassthroughForHostEvent(iFrame, UiPassthroughEvent.saveAnswer, payload);
|
|
14854
|
+
}
|
|
14855
|
+
// fallback for save answer is Save
|
|
14856
|
+
if (hostEvent === HostEvent.SaveAnswer)
|
|
14857
|
+
hostEvent = HostEvent.Save;
|
|
14858
|
+
return this.hostEventFallback(iFrame, hostEvent, payload);
|
|
14859
|
+
}
|
|
14860
|
+
}
|
|
14797
14861
|
|
|
14798
14862
|
/**
|
|
14799
14863
|
* Copyright (c) 2022
|
|
@@ -14949,6 +15013,7 @@ class TsEmbed {
|
|
|
14949
15013
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
|
|
14950
15014
|
...viewConfig,
|
|
14951
15015
|
});
|
|
15016
|
+
this.hostEventClient = new HostEventClient(this.embedConfig.thoughtSpotHost);
|
|
14952
15017
|
}
|
|
14953
15018
|
/**
|
|
14954
15019
|
* Throws error encountered during initialization.
|
|
@@ -15567,8 +15632,9 @@ class TsEmbed {
|
|
|
15567
15632
|
* Triggers an event to the embedded app
|
|
15568
15633
|
* @param messageType The event type
|
|
15569
15634
|
* @param data The payload to send with the message
|
|
15635
|
+
* @returns A promise that resolves with the response from the embedded app
|
|
15570
15636
|
*/
|
|
15571
|
-
trigger(messageType, data
|
|
15637
|
+
trigger(messageType, data) {
|
|
15572
15638
|
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
|
|
15573
15639
|
if (!this.isRendered) {
|
|
15574
15640
|
this.handleError('Please call render before triggering events');
|
|
@@ -15578,7 +15644,18 @@ class TsEmbed {
|
|
|
15578
15644
|
this.handleError('Host event type is undefined');
|
|
15579
15645
|
return null;
|
|
15580
15646
|
}
|
|
15581
|
-
return
|
|
15647
|
+
return this.hostEventClient.executeHostEvent(this.iFrame, messageType, data);
|
|
15648
|
+
}
|
|
15649
|
+
/**
|
|
15650
|
+
* Triggers an event to the embedded app, skipping the UI flow.
|
|
15651
|
+
* @param {UiPassthroughEvent} apiName - The name of the API to be triggered.
|
|
15652
|
+
* @param {UiPassthroughRequest} parameters - The parameters to be passed to the API.
|
|
15653
|
+
* @returns {Promise<UiPassthroughRequest>} - A promise that resolves with the response
|
|
15654
|
+
* from the embedded app.
|
|
15655
|
+
*/
|
|
15656
|
+
// eslint-disable-next-line arrow-body-style
|
|
15657
|
+
triggerUiPassThrough(apiName, parameters) {
|
|
15658
|
+
return this.hostEventClient.executeUiPassthroughApi(this.iFrame, apiName, parameters);
|
|
15582
15659
|
}
|
|
15583
15660
|
/**
|
|
15584
15661
|
* Marks the ThoughtSpot object to have been rendered
|
|
@@ -16392,7 +16469,7 @@ class LiveboardEmbed extends V1Embed {
|
|
|
16392
16469
|
* @param messageType The event type
|
|
16393
16470
|
* @param data The payload to send with the message
|
|
16394
16471
|
*/
|
|
16395
|
-
trigger(messageType, data
|
|
16472
|
+
trigger(messageType, data) {
|
|
16396
16473
|
const dataWithVizId = data;
|
|
16397
16474
|
if (messageType === HostEvent.SetActiveTab) {
|
|
16398
16475
|
this.setActiveTab(data);
|
|
@@ -17786,4 +17863,4 @@ const createLiveboardWithAnswers = async (answers, name) => {
|
|
|
17786
17863
|
return result;
|
|
17787
17864
|
};
|
|
17788
17865
|
|
|
17789
|
-
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 };
|
|
17866
|
+
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 };
|