@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.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) :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
@@ -1069,8 +1069,8 @@
|
|
|
1069
1069
|
*
|
|
1070
1070
|
* **Note**: This event is deprecated in v1.21.0.
|
|
1071
1071
|
* To fire an event when a download action is initiated on a chart or table,
|
|
1072
|
-
* use `EmbedEvent.DownloadAsPng`, `EmbedEvent.DownloadAsPDF`,
|
|
1073
|
-
* or `EmbedEvent.DownloadAsXLSX`
|
|
1072
|
+
* use `EmbedEvent.DownloadAsPng`, `EmbedEvent.DownloadAsPDF`,
|
|
1073
|
+
* `EmbedEvent.DownloadAsCSV`, or `EmbedEvent.DownloadAsXLSX`
|
|
1074
1074
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1075
1075
|
* @example
|
|
1076
1076
|
*```js
|
|
@@ -2554,6 +2554,16 @@
|
|
|
2554
2554
|
* @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
|
|
2555
2555
|
*/
|
|
2556
2556
|
HostEvent["UpdatePersonalisedView"] = "UpdatePersonalisedView";
|
|
2557
|
+
/**
|
|
2558
|
+
* Triggers the action to get the current view of the liveboard
|
|
2559
|
+
* @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
|
|
2560
|
+
*/
|
|
2561
|
+
HostEvent["SaveAnswer"] = "saveAnswer";
|
|
2562
|
+
/**
|
|
2563
|
+
* EmbedApi
|
|
2564
|
+
* @hidden
|
|
2565
|
+
*/
|
|
2566
|
+
HostEvent["UiPassthrough"] = "UiPassthrough";
|
|
2557
2567
|
})(exports.HostEvent || (exports.HostEvent = {}));
|
|
2558
2568
|
/**
|
|
2559
2569
|
* The different visual modes that the data sources panel within
|
|
@@ -14741,6 +14751,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
14741
14751
|
return e;
|
|
14742
14752
|
}
|
|
14743
14753
|
|
|
14754
|
+
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};
|
|
14755
|
+
|
|
14744
14756
|
/**
|
|
14745
14757
|
* Reloads the ThoughtSpot iframe.
|
|
14746
14758
|
* @param iFrame
|
|
@@ -14799,7 +14811,59 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
14799
14811
|
});
|
|
14800
14812
|
}
|
|
14801
14813
|
|
|
14802
|
-
|
|
14814
|
+
exports.UiPassthroughEvent = void 0;
|
|
14815
|
+
(function (UiPassthroughEvent) {
|
|
14816
|
+
UiPassthroughEvent["addVizToPinboard"] = "addVizToPinboard";
|
|
14817
|
+
UiPassthroughEvent["saveAnswer"] = "saveAnswer";
|
|
14818
|
+
UiPassthroughEvent["getA3AnalysisColumns"] = "getA3AnalysisColumns";
|
|
14819
|
+
UiPassthroughEvent["getDiscoverabilityStatus"] = "getDiscoverabilityStatus";
|
|
14820
|
+
UiPassthroughEvent["getAvailableUiPassthroughs"] = "getAvailableUiPassthroughs";
|
|
14821
|
+
UiPassthroughEvent["getAnswerPageConfig"] = "getAnswerPageConfig";
|
|
14822
|
+
UiPassthroughEvent["getPinboardPageConfig"] = "getPinboardPageConfig";
|
|
14823
|
+
})(exports.UiPassthroughEvent || (exports.UiPassthroughEvent = {}));
|
|
14824
|
+
|
|
14825
|
+
class HostEventClient {
|
|
14826
|
+
constructor(thoughtSpotHost) {
|
|
14827
|
+
this.thoughtSpotHost = thoughtSpotHost;
|
|
14828
|
+
}
|
|
14829
|
+
async executeUiPassthroughApi(iFrame, apiName, parameters) {
|
|
14830
|
+
const res = await processTrigger(iFrame, exports.HostEvent.UiPassthrough, this.thoughtSpotHost, {
|
|
14831
|
+
type: apiName,
|
|
14832
|
+
parameters,
|
|
14833
|
+
});
|
|
14834
|
+
return res;
|
|
14835
|
+
}
|
|
14836
|
+
async handleUiPassthroughForHostEvent(iFrame, apiName, parameters) {
|
|
14837
|
+
var _a, _b, _c;
|
|
14838
|
+
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];
|
|
14839
|
+
if (!response) {
|
|
14840
|
+
const error = `No answer found${parameters.vizId ? ` for vizId: ${parameters.vizId}` : ''}.`;
|
|
14841
|
+
// eslint-disable-next-line no-throw-literal
|
|
14842
|
+
throw { error };
|
|
14843
|
+
}
|
|
14844
|
+
const errors = response.error || ((_c = response.value) === null || _c === void 0 ? void 0 : _c.errors);
|
|
14845
|
+
if (errors) {
|
|
14846
|
+
// eslint-disable-next-line no-throw-literal
|
|
14847
|
+
throw { error: response.error };
|
|
14848
|
+
}
|
|
14849
|
+
return { ...response.value };
|
|
14850
|
+
}
|
|
14851
|
+
async hostEventFallback(iFrame, hostEvent, data) {
|
|
14852
|
+
return processTrigger(iFrame, hostEvent, this.thoughtSpotHost, data);
|
|
14853
|
+
}
|
|
14854
|
+
async executeHostEvent(iFrame, hostEvent, payload) {
|
|
14855
|
+
if (hostEvent === exports.HostEvent.Pin && (payload === null || payload === void 0 ? void 0 : payload.newVizName)) {
|
|
14856
|
+
return this.handleUiPassthroughForHostEvent(iFrame, exports.UiPassthroughEvent.addVizToPinboard, payload);
|
|
14857
|
+
}
|
|
14858
|
+
if (hostEvent === exports.HostEvent.SaveAnswer && (payload === null || payload === void 0 ? void 0 : payload.name)) {
|
|
14859
|
+
return this.handleUiPassthroughForHostEvent(iFrame, exports.UiPassthroughEvent.saveAnswer, payload);
|
|
14860
|
+
}
|
|
14861
|
+
// fallback for save answer is Save
|
|
14862
|
+
if (hostEvent === exports.HostEvent.SaveAnswer)
|
|
14863
|
+
hostEvent = exports.HostEvent.Save;
|
|
14864
|
+
return this.hostEventFallback(iFrame, hostEvent, payload);
|
|
14865
|
+
}
|
|
14866
|
+
}
|
|
14803
14867
|
|
|
14804
14868
|
/**
|
|
14805
14869
|
* Copyright (c) 2022
|
|
@@ -14955,6 +15019,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
14955
15019
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
|
|
14956
15020
|
...viewConfig,
|
|
14957
15021
|
});
|
|
15022
|
+
this.hostEventClient = new HostEventClient(this.embedConfig.thoughtSpotHost);
|
|
14958
15023
|
}
|
|
14959
15024
|
/**
|
|
14960
15025
|
* Throws error encountered during initialization.
|
|
@@ -15573,8 +15638,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15573
15638
|
* Triggers an event to the embedded app
|
|
15574
15639
|
* @param messageType The event type
|
|
15575
15640
|
* @param data The payload to send with the message
|
|
15641
|
+
* @returns A promise that resolves with the response from the embedded app
|
|
15576
15642
|
*/
|
|
15577
|
-
trigger(messageType, data
|
|
15643
|
+
trigger(messageType, data) {
|
|
15578
15644
|
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
|
|
15579
15645
|
if (!this.isRendered) {
|
|
15580
15646
|
this.handleError('Please call render before triggering events');
|
|
@@ -15584,7 +15650,18 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15584
15650
|
this.handleError('Host event type is undefined');
|
|
15585
15651
|
return null;
|
|
15586
15652
|
}
|
|
15587
|
-
return
|
|
15653
|
+
return this.hostEventClient.executeHostEvent(this.iFrame, messageType, data);
|
|
15654
|
+
}
|
|
15655
|
+
/**
|
|
15656
|
+
* Triggers an event to the embedded app, skipping the UI flow.
|
|
15657
|
+
* @param {UiPassthroughEvent} apiName - The name of the API to be triggered.
|
|
15658
|
+
* @param {UiPassthroughRequest} parameters - The parameters to be passed to the API.
|
|
15659
|
+
* @returns {Promise<UiPassthroughRequest>} - A promise that resolves with the response
|
|
15660
|
+
* from the embedded app.
|
|
15661
|
+
*/
|
|
15662
|
+
// eslint-disable-next-line arrow-body-style
|
|
15663
|
+
triggerUiPassThrough(apiName, parameters) {
|
|
15664
|
+
return this.hostEventClient.executeUiPassthroughApi(this.iFrame, apiName, parameters);
|
|
15588
15665
|
}
|
|
15589
15666
|
/**
|
|
15590
15667
|
* Marks the ThoughtSpot object to have been rendered
|
|
@@ -16398,7 +16475,7 @@ query GetEurekaVizSnapshots(
|
|
|
16398
16475
|
* @param messageType The event type
|
|
16399
16476
|
* @param data The payload to send with the message
|
|
16400
16477
|
*/
|
|
16401
|
-
trigger(messageType, data
|
|
16478
|
+
trigger(messageType, data) {
|
|
16402
16479
|
const dataWithVizId = data;
|
|
16403
16480
|
if (messageType === exports.HostEvent.SetActiveTab) {
|
|
16404
16481
|
this.setActiveTab(data);
|
|
@@ -259,7 +259,7 @@ export function useEmbedRef<T extends EmbedComponent>(): React.MutableRefObject<
|
|
|
259
259
|
* @summary ThoughtSpot Visual Embed SDK
|
|
260
260
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
261
261
|
*/
|
|
262
|
-
export { init, logout, prefetch, executeTML, exportTML, executeTMLInput, exportTMLInput, getEmbedConfig as getInitConfig, getSessionInfo, tokenizedFetch, getAnswerFromQuery, createLiveboardWithAnswers, SearchEmbed, SearchBarEmbed, PinboardEmbed, LiveboardEmbed, SageEmbed, AppEmbed, BodylessConversation, BodylessConversationViewConfig, ConversationEmbed, ConversationViewConfig, AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter, AnswerService, SessionInterface, UnderlyingDataPoint, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, ContextMenuTriggerOptions, EmbedConfig, SearchViewConfig, SearchBarViewConfig, LiveboardViewConfig, SageViewConfig, AppViewConfig, PrefetchFeatures, FrameParams, HomeLeftNavItem, HomepageModule, DOMSelector, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, CustomCssVariables, RuntimeParameter, LogLevel, uploadMixpanelEvent, MIXPANEL_EVENT, HomePageSearchBarMode, VizPoint, CustomActionPayload, };
|
|
262
|
+
export { init, logout, prefetch, executeTML, exportTML, executeTMLInput, exportTMLInput, getEmbedConfig as getInitConfig, getSessionInfo, tokenizedFetch, getAnswerFromQuery, createLiveboardWithAnswers, SearchEmbed, SearchBarEmbed, PinboardEmbed, LiveboardEmbed, SageEmbed, AppEmbed, BodylessConversation, BodylessConversationViewConfig, ConversationEmbed, ConversationViewConfig, AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter, AnswerService, SessionInterface, UnderlyingDataPoint, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, ContextMenuTriggerOptions, EmbedConfig, SearchViewConfig, SearchBarViewConfig, LiveboardViewConfig, SageViewConfig, AppViewConfig, PrefetchFeatures, FrameParams, HomeLeftNavItem, HomepageModule, DOMSelector, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, CustomCssVariables, RuntimeParameter, LogLevel, uploadMixpanelEvent, MIXPANEL_EVENT, HomePageSearchBarMode, VizPoint, CustomActionPayload, UiPassthroughEvent, };
|
|
263
263
|
|
|
264
264
|
/**
|
|
265
265
|
* @group Embed components
|
|
@@ -1641,7 +1641,7 @@ export declare class LiveboardEmbed extends V1Embed {
|
|
|
1641
1641
|
* @param messageType The event type
|
|
1642
1642
|
* @param data The payload to send with the message
|
|
1643
1643
|
*/
|
|
1644
|
-
trigger(messageType:
|
|
1644
|
+
trigger<HostEventT extends HostEvent>(messageType: HostEventT, data?: HostEventRequest<HostEventT>): Promise<HostEventResponse<HostEventT>>;
|
|
1645
1645
|
/**
|
|
1646
1646
|
* Render an embedded ThoughtSpot Liveboard or visualization
|
|
1647
1647
|
* @param renderOptions An object specifying the Liveboard ID,
|
|
@@ -3821,8 +3821,8 @@ export declare enum EmbedEvent {
|
|
|
3821
3821
|
*
|
|
3822
3822
|
* **Note**: This event is deprecated in v1.21.0.
|
|
3823
3823
|
* To fire an event when a download action is initiated on a chart or table,
|
|
3824
|
-
* use `EmbedEvent.DownloadAsPng`, `EmbedEvent.DownloadAsPDF`,
|
|
3825
|
-
* or `EmbedEvent.DownloadAsXLSX`
|
|
3824
|
+
* use `EmbedEvent.DownloadAsPng`, `EmbedEvent.DownloadAsPDF`,
|
|
3825
|
+
* `EmbedEvent.DownloadAsCSV`, or `EmbedEvent.DownloadAsXLSX`
|
|
3826
3826
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
3827
3827
|
* @example
|
|
3828
3828
|
*```js
|
|
@@ -5303,7 +5303,17 @@ export declare enum HostEvent {
|
|
|
5303
5303
|
* ```
|
|
5304
5304
|
* @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
|
|
5305
5305
|
*/
|
|
5306
|
-
UpdatePersonalisedView = "UpdatePersonalisedView"
|
|
5306
|
+
UpdatePersonalisedView = "UpdatePersonalisedView",
|
|
5307
|
+
/**
|
|
5308
|
+
* Triggers the action to get the current view of the liveboard
|
|
5309
|
+
* @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
|
|
5310
|
+
*/
|
|
5311
|
+
SaveAnswer = "saveAnswer",
|
|
5312
|
+
/**
|
|
5313
|
+
* EmbedApi
|
|
5314
|
+
* @hidden
|
|
5315
|
+
*/
|
|
5316
|
+
UiPassthrough = "UiPassthrough"
|
|
5307
5317
|
}
|
|
5308
5318
|
/**
|
|
5309
5319
|
* The different visual modes that the data sources panel within
|
|
@@ -7316,6 +7326,96 @@ export declare const getAnswerFromQuery: (query: string, worksheetId: string) =>
|
|
|
7316
7326
|
*/
|
|
7317
7327
|
export declare const createLiveboardWithAnswers: (answers: AnswerService[], name: string) => Promise<any>;
|
|
7318
7328
|
|
|
7329
|
+
export declare enum UiPassthroughEvent {
|
|
7330
|
+
addVizToPinboard = "addVizToPinboard",
|
|
7331
|
+
saveAnswer = "saveAnswer",
|
|
7332
|
+
getA3AnalysisColumns = "getA3AnalysisColumns",
|
|
7333
|
+
getDiscoverabilityStatus = "getDiscoverabilityStatus",
|
|
7334
|
+
getAvailableUiPassthroughs = "getAvailableUiPassthroughs",
|
|
7335
|
+
getAnswerPageConfig = "getAnswerPageConfig",
|
|
7336
|
+
getPinboardPageConfig = "getPinboardPageConfig"
|
|
7337
|
+
}
|
|
7338
|
+
export type UiPassthroughContractBase = {
|
|
7339
|
+
[UiPassthroughEvent.addVizToPinboard]: {
|
|
7340
|
+
request: {
|
|
7341
|
+
vizId?: string;
|
|
7342
|
+
newVizName: string;
|
|
7343
|
+
newVizDescription?: string;
|
|
7344
|
+
pinboardId?: string;
|
|
7345
|
+
tabId?: string;
|
|
7346
|
+
newPinboardName?: string;
|
|
7347
|
+
newTabName?: string;
|
|
7348
|
+
};
|
|
7349
|
+
response: {
|
|
7350
|
+
pinboardId: string;
|
|
7351
|
+
tabId: string;
|
|
7352
|
+
vizId: string;
|
|
7353
|
+
};
|
|
7354
|
+
};
|
|
7355
|
+
[UiPassthroughEvent.saveAnswer]: {
|
|
7356
|
+
request: {
|
|
7357
|
+
name: string;
|
|
7358
|
+
description: string;
|
|
7359
|
+
vizId: string;
|
|
7360
|
+
isDiscoverable?: boolean;
|
|
7361
|
+
};
|
|
7362
|
+
response: {
|
|
7363
|
+
answerId: string;
|
|
7364
|
+
errors?: any;
|
|
7365
|
+
};
|
|
7366
|
+
};
|
|
7367
|
+
[UiPassthroughEvent.getA3AnalysisColumns]: {
|
|
7368
|
+
request: {
|
|
7369
|
+
vizId?: string;
|
|
7370
|
+
};
|
|
7371
|
+
response: {
|
|
7372
|
+
data?: any;
|
|
7373
|
+
errors?: any;
|
|
7374
|
+
};
|
|
7375
|
+
};
|
|
7376
|
+
[UiPassthroughEvent.getDiscoverabilityStatus]: {
|
|
7377
|
+
request: any;
|
|
7378
|
+
response: {
|
|
7379
|
+
shouldShowDiscoverability: boolean;
|
|
7380
|
+
isDiscoverabilityCheckboxUnselectedPerOrg: boolean;
|
|
7381
|
+
};
|
|
7382
|
+
};
|
|
7383
|
+
[UiPassthroughEvent.getAvailableUiPassthroughs]: {
|
|
7384
|
+
request: any;
|
|
7385
|
+
response: {
|
|
7386
|
+
keys: string[];
|
|
7387
|
+
};
|
|
7388
|
+
};
|
|
7389
|
+
[UiPassthroughEvent.getAnswerPageConfig]: {
|
|
7390
|
+
request: {
|
|
7391
|
+
vizId?: string;
|
|
7392
|
+
};
|
|
7393
|
+
response: any;
|
|
7394
|
+
};
|
|
7395
|
+
[UiPassthroughEvent.getPinboardPageConfig]: {
|
|
7396
|
+
request: any;
|
|
7397
|
+
response: any;
|
|
7398
|
+
};
|
|
7399
|
+
};
|
|
7400
|
+
export type FlattenType<T> = T extends infer R ? {
|
|
7401
|
+
[K in keyof R]: R[K];
|
|
7402
|
+
} : never;
|
|
7403
|
+
export type UiPassthroughRequest<T extends keyof UiPassthroughContractBase> = FlattenType<UiPassthroughContractBase[T]['request']>;
|
|
7404
|
+
export type UiPassthroughResponse<T extends keyof UiPassthroughContractBase> = FlattenType<UiPassthroughContractBase[T]['response']>;
|
|
7405
|
+
export type UiPassthroughArrayResponse<ApiName extends keyof UiPassthroughContractBase> = Promise<Array<{
|
|
7406
|
+
redId?: string;
|
|
7407
|
+
value?: UiPassthroughResponse<ApiName>;
|
|
7408
|
+
error?: any;
|
|
7409
|
+
}>>;
|
|
7410
|
+
export type EmbedApiHostEventMapping = {
|
|
7411
|
+
[HostEvent.Pin]: UiPassthroughEvent.addVizToPinboard;
|
|
7412
|
+
[HostEvent.SaveAnswer]: UiPassthroughEvent.saveAnswer;
|
|
7413
|
+
};
|
|
7414
|
+
export type HostEventRequest<HostEventT extends HostEvent> = HostEventT extends keyof EmbedApiHostEventMapping ? FlattenType<UiPassthroughRequest<EmbedApiHostEventMapping[HostEventT]>> : any;
|
|
7415
|
+
export type HostEventResponse<HostEventT extends HostEvent> = HostEventT extends keyof EmbedApiHostEventMapping ? {
|
|
7416
|
+
value?: UiPassthroughResponse<EmbedApiHostEventMapping[HostEventT]>;
|
|
7417
|
+
} : any;
|
|
7418
|
+
|
|
7319
7419
|
/**
|
|
7320
7420
|
*
|
|
7321
7421
|
* @param embedConfig
|
|
@@ -7381,6 +7481,7 @@ export declare class TsEmbed {
|
|
|
7381
7481
|
* A flag that is set to true post render.
|
|
7382
7482
|
*/
|
|
7383
7483
|
protected isRendered: boolean;
|
|
7484
|
+
protected hostEventClient: HostEventClient;
|
|
7384
7485
|
constructor(domSelector: DOMSelector, viewConfig?: ViewConfig);
|
|
7385
7486
|
/**
|
|
7386
7487
|
* Handles errors within the SDK
|
|
@@ -7502,8 +7603,17 @@ export declare class TsEmbed {
|
|
|
7502
7603
|
* Triggers an event to the embedded app
|
|
7503
7604
|
* @param messageType The event type
|
|
7504
7605
|
* @param data The payload to send with the message
|
|
7606
|
+
* @returns A promise that resolves with the response from the embedded app
|
|
7505
7607
|
*/
|
|
7506
|
-
trigger(messageType:
|
|
7608
|
+
trigger<HostEventT extends HostEvent>(messageType: HostEventT, data?: HostEventRequest<HostEventT>): Promise<HostEventResponse<HostEventT>>;
|
|
7609
|
+
/**
|
|
7610
|
+
* Triggers an event to the embedded app, skipping the UI flow.
|
|
7611
|
+
* @param {UiPassthroughEvent} apiName - The name of the API to be triggered.
|
|
7612
|
+
* @param {UiPassthroughRequest} parameters - The parameters to be passed to the API.
|
|
7613
|
+
* @returns {Promise<UiPassthroughRequest>} - A promise that resolves with the response
|
|
7614
|
+
* from the embedded app.
|
|
7615
|
+
*/
|
|
7616
|
+
triggerUiPassThrough<UiPassthroughEventT extends UiPassthroughEvent>(apiName: UiPassthroughEventT, parameters: UiPassthroughRequest<UiPassthroughEventT>): UiPassthroughArrayResponse<UiPassthroughEventT>;
|
|
7507
7617
|
/**
|
|
7508
7618
|
* Marks the ThoughtSpot object to have been rendered
|
|
7509
7619
|
* Needs to be overridden by subclasses to do the actual
|
|
@@ -7622,3 +7732,12 @@ export declare class V1Embed extends TsEmbed {
|
|
|
7622
7732
|
test__executeCallbacks: (eventType: EmbedEvent, data: any, eventPort?: void | MessagePort) => void;
|
|
7623
7733
|
}
|
|
7624
7734
|
|
|
7735
|
+
export declare class HostEventClient {
|
|
7736
|
+
thoughtSpotHost: string;
|
|
7737
|
+
constructor(thoughtSpotHost: string);
|
|
7738
|
+
executeUiPassthroughApi<UiPassthroughEventT extends UiPassthroughEvent>(iFrame: HTMLIFrameElement, apiName: UiPassthroughEventT, parameters: UiPassthroughRequest<UiPassthroughEventT>): UiPassthroughArrayResponse<UiPassthroughEventT>;
|
|
7739
|
+
handleUiPassthroughForHostEvent<UiPassthroughEventT extends UiPassthroughEvent>(iFrame: HTMLIFrameElement, apiName: UiPassthroughEventT, parameters: UiPassthroughRequest<UiPassthroughEventT>): Promise<UiPassthroughResponse<UiPassthroughEventT>>;
|
|
7740
|
+
hostEventFallback(iFrame: HTMLIFrameElement, hostEvent: HostEvent, data: any): Promise<any>;
|
|
7741
|
+
executeHostEvent<T extends HostEvent>(iFrame: HTMLIFrameElement, hostEvent: HostEvent, payload?: HostEventRequest<T>): Promise<HostEventResponse<HostEvent>>;
|
|
7742
|
+
}
|
|
7743
|
+
|
|
@@ -1631,7 +1631,7 @@ export declare class LiveboardEmbed extends V1Embed {
|
|
|
1631
1631
|
* @param messageType The event type
|
|
1632
1632
|
* @param data The payload to send with the message
|
|
1633
1633
|
*/
|
|
1634
|
-
trigger(messageType:
|
|
1634
|
+
trigger<HostEventT extends HostEvent>(messageType: HostEventT, data?: HostEventRequest<HostEventT>): Promise<HostEventResponse<HostEventT>>;
|
|
1635
1635
|
/**
|
|
1636
1636
|
* Render an embedded ThoughtSpot Liveboard or visualization
|
|
1637
1637
|
* @param renderOptions An object specifying the Liveboard ID,
|
|
@@ -1744,7 +1744,7 @@ export declare class ConversationEmbed extends TsEmbed {
|
|
|
1744
1744
|
* @summary ThoughtSpot Visual Embed SDK
|
|
1745
1745
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
1746
1746
|
*/
|
|
1747
|
-
export { init, logout, prefetch, executeTML, exportTML, executeTMLInput, exportTMLInput, getEmbedConfig as getInitConfig, getSessionInfo, tokenizedFetch, getAnswerFromQuery, createLiveboardWithAnswers, SearchEmbed, SearchBarEmbed, PinboardEmbed, LiveboardEmbed, SageEmbed, AppEmbed, BodylessConversation, BodylessConversationViewConfig, ConversationEmbed, ConversationViewConfig, AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter, AnswerService, SessionInterface, UnderlyingDataPoint, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, ContextMenuTriggerOptions, EmbedConfig, SearchViewConfig, SearchBarViewConfig, LiveboardViewConfig, SageViewConfig, AppViewConfig, PrefetchFeatures, FrameParams, HomeLeftNavItem, HomepageModule, DOMSelector, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, CustomCssVariables, RuntimeParameter, LogLevel, uploadMixpanelEvent, MIXPANEL_EVENT, HomePageSearchBarMode, VizPoint, CustomActionPayload, };
|
|
1747
|
+
export { init, logout, prefetch, executeTML, exportTML, executeTMLInput, exportTMLInput, getEmbedConfig as getInitConfig, getSessionInfo, tokenizedFetch, getAnswerFromQuery, createLiveboardWithAnswers, SearchEmbed, SearchBarEmbed, PinboardEmbed, LiveboardEmbed, SageEmbed, AppEmbed, BodylessConversation, BodylessConversationViewConfig, ConversationEmbed, ConversationViewConfig, AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter, AnswerService, SessionInterface, UnderlyingDataPoint, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, ContextMenuTriggerOptions, EmbedConfig, SearchViewConfig, SearchBarViewConfig, LiveboardViewConfig, SageViewConfig, AppViewConfig, PrefetchFeatures, FrameParams, HomeLeftNavItem, HomepageModule, DOMSelector, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, CustomCssVariables, RuntimeParameter, LogLevel, uploadMixpanelEvent, MIXPANEL_EVENT, HomePageSearchBarMode, VizPoint, CustomActionPayload, UiPassthroughEvent, };
|
|
1748
1748
|
|
|
1749
1749
|
/**
|
|
1750
1750
|
* Copyright (c) 2023
|
|
@@ -3413,8 +3413,8 @@ export declare enum EmbedEvent {
|
|
|
3413
3413
|
*
|
|
3414
3414
|
* **Note**: This event is deprecated in v1.21.0.
|
|
3415
3415
|
* To fire an event when a download action is initiated on a chart or table,
|
|
3416
|
-
* use `EmbedEvent.DownloadAsPng`, `EmbedEvent.DownloadAsPDF`,
|
|
3417
|
-
* or `EmbedEvent.DownloadAsXLSX`
|
|
3416
|
+
* use `EmbedEvent.DownloadAsPng`, `EmbedEvent.DownloadAsPDF`,
|
|
3417
|
+
* `EmbedEvent.DownloadAsCSV`, or `EmbedEvent.DownloadAsXLSX`
|
|
3418
3418
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
3419
3419
|
* @example
|
|
3420
3420
|
*```js
|
|
@@ -4895,7 +4895,17 @@ export declare enum HostEvent {
|
|
|
4895
4895
|
* ```
|
|
4896
4896
|
* @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
|
|
4897
4897
|
*/
|
|
4898
|
-
UpdatePersonalisedView = "UpdatePersonalisedView"
|
|
4898
|
+
UpdatePersonalisedView = "UpdatePersonalisedView",
|
|
4899
|
+
/**
|
|
4900
|
+
* Triggers the action to get the current view of the liveboard
|
|
4901
|
+
* @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
|
|
4902
|
+
*/
|
|
4903
|
+
SaveAnswer = "saveAnswer",
|
|
4904
|
+
/**
|
|
4905
|
+
* EmbedApi
|
|
4906
|
+
* @hidden
|
|
4907
|
+
*/
|
|
4908
|
+
UiPassthrough = "UiPassthrough"
|
|
4899
4909
|
}
|
|
4900
4910
|
/**
|
|
4901
4911
|
* The different visual modes that the data sources panel within
|
|
@@ -6301,6 +6311,7 @@ export declare class TsEmbed {
|
|
|
6301
6311
|
* A flag that is set to true post render.
|
|
6302
6312
|
*/
|
|
6303
6313
|
protected isRendered: boolean;
|
|
6314
|
+
protected hostEventClient: HostEventClient;
|
|
6304
6315
|
constructor(domSelector: DOMSelector, viewConfig?: ViewConfig);
|
|
6305
6316
|
/**
|
|
6306
6317
|
* Handles errors within the SDK
|
|
@@ -6422,8 +6433,17 @@ export declare class TsEmbed {
|
|
|
6422
6433
|
* Triggers an event to the embedded app
|
|
6423
6434
|
* @param messageType The event type
|
|
6424
6435
|
* @param data The payload to send with the message
|
|
6436
|
+
* @returns A promise that resolves with the response from the embedded app
|
|
6437
|
+
*/
|
|
6438
|
+
trigger<HostEventT extends HostEvent>(messageType: HostEventT, data?: HostEventRequest<HostEventT>): Promise<HostEventResponse<HostEventT>>;
|
|
6439
|
+
/**
|
|
6440
|
+
* Triggers an event to the embedded app, skipping the UI flow.
|
|
6441
|
+
* @param {UiPassthroughEvent} apiName - The name of the API to be triggered.
|
|
6442
|
+
* @param {UiPassthroughRequest} parameters - The parameters to be passed to the API.
|
|
6443
|
+
* @returns {Promise<UiPassthroughRequest>} - A promise that resolves with the response
|
|
6444
|
+
* from the embedded app.
|
|
6425
6445
|
*/
|
|
6426
|
-
|
|
6446
|
+
triggerUiPassThrough<UiPassthroughEventT extends UiPassthroughEvent>(apiName: UiPassthroughEventT, parameters: UiPassthroughRequest<UiPassthroughEventT>): UiPassthroughArrayResponse<UiPassthroughEventT>;
|
|
6427
6447
|
/**
|
|
6428
6448
|
* Marks the ThoughtSpot object to have been rendered
|
|
6429
6449
|
* Needs to be overridden by subclasses to do the actual
|
|
@@ -6542,6 +6562,96 @@ export declare class V1Embed extends TsEmbed {
|
|
|
6542
6562
|
test__executeCallbacks: (eventType: EmbedEvent, data: any, eventPort?: void | MessagePort) => void;
|
|
6543
6563
|
}
|
|
6544
6564
|
|
|
6565
|
+
export declare enum UiPassthroughEvent {
|
|
6566
|
+
addVizToPinboard = "addVizToPinboard",
|
|
6567
|
+
saveAnswer = "saveAnswer",
|
|
6568
|
+
getA3AnalysisColumns = "getA3AnalysisColumns",
|
|
6569
|
+
getDiscoverabilityStatus = "getDiscoverabilityStatus",
|
|
6570
|
+
getAvailableUiPassthroughs = "getAvailableUiPassthroughs",
|
|
6571
|
+
getAnswerPageConfig = "getAnswerPageConfig",
|
|
6572
|
+
getPinboardPageConfig = "getPinboardPageConfig"
|
|
6573
|
+
}
|
|
6574
|
+
export type UiPassthroughContractBase = {
|
|
6575
|
+
[UiPassthroughEvent.addVizToPinboard]: {
|
|
6576
|
+
request: {
|
|
6577
|
+
vizId?: string;
|
|
6578
|
+
newVizName: string;
|
|
6579
|
+
newVizDescription?: string;
|
|
6580
|
+
pinboardId?: string;
|
|
6581
|
+
tabId?: string;
|
|
6582
|
+
newPinboardName?: string;
|
|
6583
|
+
newTabName?: string;
|
|
6584
|
+
};
|
|
6585
|
+
response: {
|
|
6586
|
+
pinboardId: string;
|
|
6587
|
+
tabId: string;
|
|
6588
|
+
vizId: string;
|
|
6589
|
+
};
|
|
6590
|
+
};
|
|
6591
|
+
[UiPassthroughEvent.saveAnswer]: {
|
|
6592
|
+
request: {
|
|
6593
|
+
name: string;
|
|
6594
|
+
description: string;
|
|
6595
|
+
vizId: string;
|
|
6596
|
+
isDiscoverable?: boolean;
|
|
6597
|
+
};
|
|
6598
|
+
response: {
|
|
6599
|
+
answerId: string;
|
|
6600
|
+
errors?: any;
|
|
6601
|
+
};
|
|
6602
|
+
};
|
|
6603
|
+
[UiPassthroughEvent.getA3AnalysisColumns]: {
|
|
6604
|
+
request: {
|
|
6605
|
+
vizId?: string;
|
|
6606
|
+
};
|
|
6607
|
+
response: {
|
|
6608
|
+
data?: any;
|
|
6609
|
+
errors?: any;
|
|
6610
|
+
};
|
|
6611
|
+
};
|
|
6612
|
+
[UiPassthroughEvent.getDiscoverabilityStatus]: {
|
|
6613
|
+
request: any;
|
|
6614
|
+
response: {
|
|
6615
|
+
shouldShowDiscoverability: boolean;
|
|
6616
|
+
isDiscoverabilityCheckboxUnselectedPerOrg: boolean;
|
|
6617
|
+
};
|
|
6618
|
+
};
|
|
6619
|
+
[UiPassthroughEvent.getAvailableUiPassthroughs]: {
|
|
6620
|
+
request: any;
|
|
6621
|
+
response: {
|
|
6622
|
+
keys: string[];
|
|
6623
|
+
};
|
|
6624
|
+
};
|
|
6625
|
+
[UiPassthroughEvent.getAnswerPageConfig]: {
|
|
6626
|
+
request: {
|
|
6627
|
+
vizId?: string;
|
|
6628
|
+
};
|
|
6629
|
+
response: any;
|
|
6630
|
+
};
|
|
6631
|
+
[UiPassthroughEvent.getPinboardPageConfig]: {
|
|
6632
|
+
request: any;
|
|
6633
|
+
response: any;
|
|
6634
|
+
};
|
|
6635
|
+
};
|
|
6636
|
+
export type FlattenType<T> = T extends infer R ? {
|
|
6637
|
+
[K in keyof R]: R[K];
|
|
6638
|
+
} : never;
|
|
6639
|
+
export type UiPassthroughRequest<T extends keyof UiPassthroughContractBase> = FlattenType<UiPassthroughContractBase[T]['request']>;
|
|
6640
|
+
export type UiPassthroughResponse<T extends keyof UiPassthroughContractBase> = FlattenType<UiPassthroughContractBase[T]['response']>;
|
|
6641
|
+
export type UiPassthroughArrayResponse<ApiName extends keyof UiPassthroughContractBase> = Promise<Array<{
|
|
6642
|
+
redId?: string;
|
|
6643
|
+
value?: UiPassthroughResponse<ApiName>;
|
|
6644
|
+
error?: any;
|
|
6645
|
+
}>>;
|
|
6646
|
+
export type EmbedApiHostEventMapping = {
|
|
6647
|
+
[HostEvent.Pin]: UiPassthroughEvent.addVizToPinboard;
|
|
6648
|
+
[HostEvent.SaveAnswer]: UiPassthroughEvent.saveAnswer;
|
|
6649
|
+
};
|
|
6650
|
+
export type HostEventRequest<HostEventT extends HostEvent> = HostEventT extends keyof EmbedApiHostEventMapping ? FlattenType<UiPassthroughRequest<EmbedApiHostEventMapping[HostEventT]>> : any;
|
|
6651
|
+
export type HostEventResponse<HostEventT extends HostEvent> = HostEventT extends keyof EmbedApiHostEventMapping ? {
|
|
6652
|
+
value?: UiPassthroughResponse<EmbedApiHostEventMapping[HostEventT]>;
|
|
6653
|
+
} : any;
|
|
6654
|
+
|
|
6545
6655
|
export interface executeTMLInput {
|
|
6546
6656
|
metadata_tmls: string[];
|
|
6547
6657
|
import_policy?: 'PARTIAL' | 'ALL_OR_NONE' | 'VALIDATE_ONLY';
|
|
@@ -7622,3 +7732,12 @@ export declare function getAuthenticationToken(embedConfig: EmbedConfig): Promis
|
|
|
7622
7732
|
*/
|
|
7623
7733
|
export declare const resetCachedAuthToken: () => void;
|
|
7624
7734
|
|
|
7735
|
+
export declare class HostEventClient {
|
|
7736
|
+
thoughtSpotHost: string;
|
|
7737
|
+
constructor(thoughtSpotHost: string);
|
|
7738
|
+
executeUiPassthroughApi<UiPassthroughEventT extends UiPassthroughEvent>(iFrame: HTMLIFrameElement, apiName: UiPassthroughEventT, parameters: UiPassthroughRequest<UiPassthroughEventT>): UiPassthroughArrayResponse<UiPassthroughEventT>;
|
|
7739
|
+
handleUiPassthroughForHostEvent<UiPassthroughEventT extends UiPassthroughEvent>(iFrame: HTMLIFrameElement, apiName: UiPassthroughEventT, parameters: UiPassthroughRequest<UiPassthroughEventT>): Promise<UiPassthroughResponse<UiPassthroughEventT>>;
|
|
7740
|
+
hostEventFallback(iFrame: HTMLIFrameElement, hostEvent: HostEvent, data: any): Promise<any>;
|
|
7741
|
+
executeHostEvent<T extends HostEvent>(iFrame: HTMLIFrameElement, hostEvent: HostEvent, payload?: HostEventRequest<T>): Promise<HostEventResponse<HostEvent>>;
|
|
7742
|
+
}
|
|
7743
|
+
|