@thoughtspot/visual-embed-sdk 1.35.3 → 1.35.5-hostEvent.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/cjs/package.json +1 -1
  2. package/cjs/src/auth.spec.js +12 -0
  3. package/cjs/src/auth.spec.js.map +1 -1
  4. package/cjs/src/authToken.spec.js +1 -1
  5. package/cjs/src/authToken.spec.js.map +1 -1
  6. package/cjs/src/embed/bodyless-conversation.spec.js +0 -1
  7. package/cjs/src/embed/bodyless-conversation.spec.js.map +1 -1
  8. package/cjs/src/embed/hostEventClient/contracts.d.ts +97 -0
  9. package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -0
  10. package/cjs/src/embed/hostEventClient/contracts.js +16 -0
  11. package/cjs/src/embed/hostEventClient/contracts.js.map +1 -0
  12. package/cjs/src/embed/hostEventClient/host-event-client.d.ts +14 -0
  13. package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -0
  14. package/cjs/src/embed/hostEventClient/host-event-client.js +50 -0
  15. package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -0
  16. package/cjs/src/embed/hostEventClient/host-event-client.spec.d.ts +2 -0
  17. package/cjs/src/embed/hostEventClient/host-event-client.spec.d.ts.map +1 -0
  18. package/cjs/src/embed/hostEventClient/host-event-client.spec.js +171 -0
  19. package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -0
  20. package/cjs/src/embed/liveboard.d.ts +2 -1
  21. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  22. package/cjs/src/embed/liveboard.js +1 -1
  23. package/cjs/src/embed/liveboard.js.map +1 -1
  24. package/cjs/src/embed/liveboard.spec.js +30 -0
  25. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  26. package/cjs/src/embed/search.spec.js +11 -0
  27. package/cjs/src/embed/search.spec.js.map +1 -1
  28. package/cjs/src/embed/searchEmbed-basic-auth.spec.d.ts +2 -0
  29. package/cjs/src/embed/searchEmbed-basic-auth.spec.d.ts.map +1 -0
  30. package/cjs/src/embed/searchEmbed-basic-auth.spec.js +104 -0
  31. package/cjs/src/embed/searchEmbed-basic-auth.spec.js.map +1 -0
  32. package/cjs/src/embed/ts-embed.d.ts +13 -1
  33. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  34. package/cjs/src/embed/ts-embed.js +16 -3
  35. package/cjs/src/embed/ts-embed.js.map +1 -1
  36. package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
  37. package/cjs/src/embed/ts-embed.spec.js +26 -1
  38. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  39. package/cjs/src/hostEventsTypeMapping.d.ts +2 -0
  40. package/cjs/src/hostEventsTypeMapping.d.ts.map +1 -0
  41. package/cjs/src/hostEventsTypeMapping.js +4 -0
  42. package/cjs/src/hostEventsTypeMapping.js.map +1 -0
  43. package/cjs/src/index.d.ts +2 -1
  44. package/cjs/src/index.d.ts.map +1 -1
  45. package/cjs/src/index.js +3 -1
  46. package/cjs/src/index.js.map +1 -1
  47. package/cjs/src/react/all-types-export.d.ts +1 -1
  48. package/cjs/src/react/all-types-export.d.ts.map +1 -1
  49. package/cjs/src/react/all-types-export.js +2 -1
  50. package/cjs/src/react/all-types-export.js.map +1 -1
  51. package/cjs/src/types.d.ts +13 -3
  52. package/cjs/src/types.d.ts.map +1 -1
  53. package/cjs/src/types.js +12 -2
  54. package/cjs/src/types.js.map +1 -1
  55. package/cjs/src/utils/embedApi/contracts.d.ts +101 -0
  56. package/cjs/src/utils/embedApi/contracts.d.ts.map +1 -0
  57. package/cjs/src/utils/embedApi/contracts.js +17 -0
  58. package/cjs/src/utils/embedApi/contracts.js.map +1 -0
  59. package/cjs/src/utils/embedApi/embedApiClient.d.ts +12 -0
  60. package/cjs/src/utils/embedApi/embedApiClient.d.ts.map +1 -0
  61. package/cjs/src/utils/embedApi/embedApiClient.js +46 -0
  62. package/cjs/src/utils/embedApi/embedApiClient.js.map +1 -0
  63. package/cjs/src/utils/embedApi/processEmbedApi.d.ts +9 -0
  64. package/cjs/src/utils/embedApi/processEmbedApi.d.ts.map +1 -0
  65. package/cjs/src/utils/embedApi/processEmbedApi.js +18 -0
  66. package/cjs/src/utils/embedApi/processEmbedApi.js.map +1 -0
  67. package/dist/{index-BaGHDCpW.js → index-CbltIawo.js} +1 -1
  68. package/dist/index-CzwzS0P4.js +7370 -0
  69. package/dist/src/embed/hostEventClient/contracts.d.ts +97 -0
  70. package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -0
  71. package/dist/src/embed/hostEventClient/host-event-client.d.ts +14 -0
  72. package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -0
  73. package/dist/src/embed/hostEventClient/host-event-client.spec.d.ts +2 -0
  74. package/dist/src/embed/hostEventClient/host-event-client.spec.d.ts.map +1 -0
  75. package/dist/src/embed/liveboard.d.ts +2 -1
  76. package/dist/src/embed/liveboard.d.ts.map +1 -1
  77. package/dist/src/embed/searchEmbed-basic-auth.spec.d.ts +2 -0
  78. package/dist/src/embed/searchEmbed-basic-auth.spec.d.ts.map +1 -0
  79. package/dist/src/embed/ts-embed.d.ts +13 -1
  80. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  81. package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
  82. package/dist/src/hostEventsTypeMapping.d.ts +2 -0
  83. package/dist/src/hostEventsTypeMapping.d.ts.map +1 -0
  84. package/dist/src/index.d.ts +2 -1
  85. package/dist/src/index.d.ts.map +1 -1
  86. package/dist/src/react/all-types-export.d.ts +1 -1
  87. package/dist/src/react/all-types-export.d.ts.map +1 -1
  88. package/dist/src/types.d.ts +13 -3
  89. package/dist/src/types.d.ts.map +1 -1
  90. package/dist/src/utils/embedApi/contracts.d.ts +101 -0
  91. package/dist/src/utils/embedApi/contracts.d.ts.map +1 -0
  92. package/dist/src/utils/embedApi/embedApiClient.d.ts +12 -0
  93. package/dist/src/utils/embedApi/embedApiClient.d.ts.map +1 -0
  94. package/dist/src/utils/embedApi/processEmbedApi.d.ts +9 -0
  95. package/dist/src/utils/embedApi/processEmbedApi.d.ts.map +1 -0
  96. package/dist/tsembed-react.es.js +86 -8
  97. package/dist/tsembed-react.js +85 -7
  98. package/dist/tsembed.es.js +87 -9
  99. package/dist/tsembed.js +85 -7
  100. package/dist/visual-embed-sdk-react-full.d.ts +134 -6
  101. package/dist/visual-embed-sdk-react.d.ts +134 -6
  102. package/dist/visual-embed-sdk.d.ts +134 -6
  103. package/lib/package.json +1 -1
  104. package/lib/src/auth.spec.js +12 -0
  105. package/lib/src/auth.spec.js.map +1 -1
  106. package/lib/src/authToken.spec.js +1 -1
  107. package/lib/src/authToken.spec.js.map +1 -1
  108. package/lib/src/embed/bodyless-conversation.spec.js +0 -1
  109. package/lib/src/embed/bodyless-conversation.spec.js.map +1 -1
  110. package/lib/src/embed/hostEventClient/contracts.d.ts +97 -0
  111. package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -0
  112. package/lib/src/embed/hostEventClient/contracts.js +13 -0
  113. package/lib/src/embed/hostEventClient/contracts.js.map +1 -0
  114. package/lib/src/embed/hostEventClient/host-event-client.d.ts +14 -0
  115. package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -0
  116. package/lib/src/embed/hostEventClient/host-event-client.js +46 -0
  117. package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -0
  118. package/lib/src/embed/hostEventClient/host-event-client.spec.d.ts +2 -0
  119. package/lib/src/embed/hostEventClient/host-event-client.spec.d.ts.map +1 -0
  120. package/lib/src/embed/hostEventClient/host-event-client.spec.js +169 -0
  121. package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -0
  122. package/lib/src/embed/liveboard.d.ts +2 -1
  123. package/lib/src/embed/liveboard.d.ts.map +1 -1
  124. package/lib/src/embed/liveboard.js +1 -1
  125. package/lib/src/embed/liveboard.js.map +1 -1
  126. package/lib/src/embed/liveboard.spec.js +30 -0
  127. package/lib/src/embed/liveboard.spec.js.map +1 -1
  128. package/lib/src/embed/search.spec.js +11 -0
  129. package/lib/src/embed/search.spec.js.map +1 -1
  130. package/lib/src/embed/searchEmbed-basic-auth.spec.d.ts +2 -0
  131. package/lib/src/embed/searchEmbed-basic-auth.spec.d.ts.map +1 -0
  132. package/lib/src/embed/searchEmbed-basic-auth.spec.js +101 -0
  133. package/lib/src/embed/searchEmbed-basic-auth.spec.js.map +1 -0
  134. package/lib/src/embed/ts-embed.d.ts +13 -1
  135. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  136. package/lib/src/embed/ts-embed.js +16 -3
  137. package/lib/src/embed/ts-embed.js.map +1 -1
  138. package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
  139. package/lib/src/embed/ts-embed.spec.js +28 -3
  140. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  141. package/lib/src/hostEventsTypeMapping.d.ts +2 -0
  142. package/lib/src/hostEventsTypeMapping.d.ts.map +1 -0
  143. package/lib/src/hostEventsTypeMapping.js +2 -0
  144. package/lib/src/hostEventsTypeMapping.js.map +1 -0
  145. package/lib/src/index.d.ts +2 -1
  146. package/lib/src/index.d.ts.map +1 -1
  147. package/lib/src/index.js +2 -1
  148. package/lib/src/index.js.map +1 -1
  149. package/lib/src/react/all-types-export.d.ts +1 -1
  150. package/lib/src/react/all-types-export.d.ts.map +1 -1
  151. package/lib/src/react/all-types-export.js +1 -1
  152. package/lib/src/react/all-types-export.js.map +1 -1
  153. package/lib/src/types.d.ts +13 -3
  154. package/lib/src/types.d.ts.map +1 -1
  155. package/lib/src/types.js +12 -2
  156. package/lib/src/types.js.map +1 -1
  157. package/lib/src/utils/embedApi/contracts.d.ts +101 -0
  158. package/lib/src/utils/embedApi/contracts.d.ts.map +1 -0
  159. package/lib/src/utils/embedApi/contracts.js +14 -0
  160. package/lib/src/utils/embedApi/contracts.js.map +1 -0
  161. package/lib/src/utils/embedApi/embedApiClient.d.ts +12 -0
  162. package/lib/src/utils/embedApi/embedApiClient.d.ts.map +1 -0
  163. package/lib/src/utils/embedApi/embedApiClient.js +42 -0
  164. package/lib/src/utils/embedApi/embedApiClient.js.map +1 -0
  165. package/lib/src/utils/embedApi/processEmbedApi.d.ts +9 -0
  166. package/lib/src/utils/embedApi/processEmbedApi.d.ts.map +1 -0
  167. package/lib/src/utils/embedApi/processEmbedApi.js +14 -0
  168. package/lib/src/utils/embedApi/processEmbedApi.js.map +1 -0
  169. package/lib/src/visual-embed-sdk.d.ts +145 -6
  170. package/package.json +1 -1
  171. package/src/auth.spec.ts +13 -0
  172. package/src/authToken.spec.ts +1 -1
  173. package/src/embed/bodyless-conversation.spec.ts +0 -1
  174. package/src/embed/hostEventClient/contracts.ts +108 -0
  175. package/src/embed/hostEventClient/host-event-client.spec.ts +234 -0
  176. package/src/embed/hostEventClient/host-event-client.ts +81 -0
  177. package/src/embed/liveboard.spec.ts +32 -0
  178. package/src/embed/liveboard.ts +5 -1
  179. package/src/embed/search.spec.ts +15 -0
  180. package/src/embed/ts-embed.spec.ts +40 -1
  181. package/src/embed/ts-embed.ts +26 -5
  182. package/src/index.ts +2 -0
  183. package/src/react/all-types-export.ts +1 -0
  184. package/src/types.ts +12 -2
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.35.3 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.35.5-hostEvent.1 */
2
2
  import * as React from 'react';
3
3
  import React__default from 'react';
4
4
 
@@ -1178,8 +1178,8 @@ var EmbedEvent;
1178
1178
  *
1179
1179
  * **Note**: This event is deprecated in v1.21.0.
1180
1180
  * To fire an event when a download action is initiated on a chart or table,
1181
- * use `EmbedEvent.DownloadAsPng`, `EmbedEvent.DownloadAsPDF`, `EmbedEvent.DownloadAsCSV`,
1182
- * or `EmbedEvent.DownloadAsXLSX`
1181
+ * use `EmbedEvent.DownloadAsPng`, `EmbedEvent.DownloadAsPDF`,
1182
+ * `EmbedEvent.DownloadAsCSV`, or `EmbedEvent.DownloadAsXLSX`
1183
1183
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1184
1184
  * @example
1185
1185
  *```js
@@ -2663,6 +2663,16 @@ var HostEvent;
2663
2663
  * @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
2664
2664
  */
2665
2665
  HostEvent["UpdatePersonalisedView"] = "UpdatePersonalisedView";
2666
+ /**
2667
+ * Triggers the action to get the current view of the liveboard
2668
+ * @version SDK: 1.34.0 | Thoughtspot: 10.6.0.cl
2669
+ */
2670
+ HostEvent["SaveAnswer"] = "saveAnswer";
2671
+ /**
2672
+ * EmbedApi
2673
+ * @hidden
2674
+ */
2675
+ HostEvent["UiPassthrough"] = "UiPassthrough";
2666
2676
  })(HostEvent || (HostEvent = {}));
2667
2677
  /**
2668
2678
  * The different visual modes that the data sources panel within
@@ -7150,7 +7160,7 @@ class AnswerService {
7150
7160
  async getTML() {
7151
7161
  const { object } = await this.executeQuery(getAnswerTML, {});
7152
7162
  const edoc = object[0].edoc;
7153
- const YAML = await import('./index-BaGHDCpW.js');
7163
+ const YAML = await import('./index-CzwzS0P4.js');
7154
7164
  const parsedDoc = YAML.parse(edoc);
7155
7165
  return {
7156
7166
  answer: {
@@ -14493,6 +14503,8 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
14493
14503
  return e;
14494
14504
  }
14495
14505
 
14506
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.35.5-hostEvent.1";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",dompurify:"^2.3.4",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","eslint-plugin-comment-length":"1.7.3","eslint-plugin-jsdoc":"^46.9.0","fs-extra":"^10.0.0","gh-pages":"^3.1.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^5.3.4"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
14507
+
14496
14508
  /**
14497
14509
  * Reloads the ThoughtSpot iframe.
14498
14510
  * @param iFrame
@@ -14551,7 +14563,60 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
14551
14563
  });
14552
14564
  }
14553
14565
 
14554
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.35.3";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};
14566
+ var UiPassthroughEvent;
14567
+ (function (UiPassthroughEvent) {
14568
+ UiPassthroughEvent["addVizToPinboard"] = "addVizToPinboard";
14569
+ UiPassthroughEvent["saveAnswer"] = "saveAnswer";
14570
+ UiPassthroughEvent["getA3AnalysisColumns"] = "getA3AnalysisColumns";
14571
+ UiPassthroughEvent["getDiscoverabilityStatus"] = "getDiscoverabilityStatus";
14572
+ UiPassthroughEvent["getAvailableUiPassthroughs"] = "getAvailableUiPassthroughs";
14573
+ UiPassthroughEvent["getAnswerPageConfig"] = "getAnswerPageConfig";
14574
+ UiPassthroughEvent["getPinboardPageConfig"] = "getPinboardPageConfig";
14575
+ UiPassthroughEvent["UiPassthroughEventNotFound"] = "UiPassthroughEventNotFound";
14576
+ })(UiPassthroughEvent || (UiPassthroughEvent = {}));
14577
+
14578
+ class HostEventClient {
14579
+ constructor(thoughtSpotHost) {
14580
+ this.executeUiPassthroughApi = async (iFrame, apiName, parameters) => {
14581
+ const res = await processTrigger(iFrame, HostEvent.UiPassthrough, this.thoughtSpotHost, {
14582
+ type: apiName,
14583
+ parameters,
14584
+ });
14585
+ return res;
14586
+ };
14587
+ this.handleUiPassthroughForHostEvent = async (iFrame, apiName, parameters) => {
14588
+ var _a, _b, _c;
14589
+ const response = (_b = (_a = (await this.executeUiPassthroughApi(iFrame, apiName, parameters))) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.call(_a, (r) => r.error || r.value)[0];
14590
+ if (!response) {
14591
+ const error = `No answer found${parameters.vizId ? ` for vizId: ${parameters.vizId}` : ''}.`;
14592
+ // eslint-disable-next-line no-throw-literal
14593
+ throw { error };
14594
+ }
14595
+ const errors = response.error || ((_c = response.value) === null || _c === void 0 ? void 0 : _c.errors);
14596
+ if (errors) {
14597
+ // eslint-disable-next-line no-throw-literal
14598
+ throw { error: response.error };
14599
+ }
14600
+ return { ...response.value };
14601
+ };
14602
+ this.thoughtSpotHost = thoughtSpotHost;
14603
+ }
14604
+ async hostEventFallback(iFrame, hostEvent, data) {
14605
+ return processTrigger(iFrame, hostEvent, this.thoughtSpotHost, data);
14606
+ }
14607
+ async executeHostEvent(iFrame, hostEvent, payload) {
14608
+ if (hostEvent === HostEvent.Pin && (payload === null || payload === void 0 ? void 0 : payload.newVizName)) {
14609
+ return this.handleUiPassthroughForHostEvent(iFrame, UiPassthroughEvent.addVizToPinboard, payload);
14610
+ }
14611
+ if (hostEvent === HostEvent.SaveAnswer && (payload === null || payload === void 0 ? void 0 : payload.name)) {
14612
+ return this.handleUiPassthroughForHostEvent(iFrame, UiPassthroughEvent.saveAnswer, payload);
14613
+ }
14614
+ // fallback for save answer is Save
14615
+ if (hostEvent === HostEvent.SaveAnswer)
14616
+ hostEvent = HostEvent.Save;
14617
+ return this.hostEventFallback(iFrame, hostEvent, payload);
14618
+ }
14619
+ }
14555
14620
 
14556
14621
  /**
14557
14622
  * Copyright (c) 2022
@@ -14666,6 +14731,17 @@ class TsEmbed {
14666
14731
  this.on(EmbedEvent.AuthExpire, this.updateAuthToken, { start: false }, true);
14667
14732
  };
14668
14733
  this.showPreRenderByDefault = false;
14734
+ /**
14735
+ * Triggers an event to the embedded app, skipping the UI flow.
14736
+ * @param {UiPassthroughEvent} apiName - The name of the API to be triggered.
14737
+ * @param {UiPassthroughRequest} parameters - The parameters to be passed to the API.
14738
+ * @returns {Promise<UiPassthroughRequest>} - A promise that resolves with the response
14739
+ * from the embedded app.
14740
+ */
14741
+ // eslint-disable-next-line arrow-body-style
14742
+ this.triggerUiPassThrough = (apiName, parameters) => {
14743
+ return this.hostEventClient.executeUiPassthroughApi(this.iFrame, apiName, parameters);
14744
+ };
14669
14745
  this.validatePreRenderViewConfig = (viewConfig) => {
14670
14746
  var _a;
14671
14747
  const preRenderAllowedKeys = ['preRenderId', 'vizId', 'liveboardId'];
@@ -14707,6 +14783,7 @@ class TsEmbed {
14707
14783
  uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
14708
14784
  ...viewConfig,
14709
14785
  });
14786
+ this.hostEventClient = new HostEventClient(this.embedConfig.thoughtSpotHost);
14710
14787
  }
14711
14788
  /**
14712
14789
  * Throws error encountered during initialization.
@@ -15325,8 +15402,9 @@ class TsEmbed {
15325
15402
  * Triggers an event to the embedded app
15326
15403
  * @param messageType The event type
15327
15404
  * @param data The payload to send with the message
15405
+ * @returns A promise that resolves with the response from the embedded app
15328
15406
  */
15329
- trigger(messageType, data = {}) {
15407
+ trigger(messageType, data) {
15330
15408
  uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
15331
15409
  if (!this.isRendered) {
15332
15410
  this.handleError('Please call render before triggering events');
@@ -15336,7 +15414,7 @@ class TsEmbed {
15336
15414
  this.handleError('Host event type is undefined');
15337
15415
  return null;
15338
15416
  }
15339
- return processTrigger(this.iFrame, messageType, this.thoughtSpotHost, data);
15417
+ return this.hostEventClient.executeHostEvent(this.iFrame, messageType, data);
15340
15418
  }
15341
15419
  /**
15342
15420
  * Marks the ThoughtSpot object to have been rendered
@@ -16447,7 +16525,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
16447
16525
  * @param messageType The event type
16448
16526
  * @param data The payload to send with the message
16449
16527
  */
16450
- trigger(messageType, data = {}) {
16528
+ trigger(messageType, data) {
16451
16529
  const dataWithVizId = data;
16452
16530
  if (messageType === HostEvent.SetActiveTab) {
16453
16531
  this.setActiveTab(data);
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.35.3 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.35.5-hostEvent.1 */
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
4
4
  typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) :
@@ -1200,8 +1200,8 @@
1200
1200
  *
1201
1201
  * **Note**: This event is deprecated in v1.21.0.
1202
1202
  * To fire an event when a download action is initiated on a chart or table,
1203
- * use `EmbedEvent.DownloadAsPng`, `EmbedEvent.DownloadAsPDF`, `EmbedEvent.DownloadAsCSV`,
1204
- * or `EmbedEvent.DownloadAsXLSX`
1203
+ * use `EmbedEvent.DownloadAsPng`, `EmbedEvent.DownloadAsPDF`,
1204
+ * `EmbedEvent.DownloadAsCSV`, or `EmbedEvent.DownloadAsXLSX`
1205
1205
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1206
1206
  * @example
1207
1207
  *```js
@@ -2685,6 +2685,16 @@
2685
2685
  * @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
2686
2686
  */
2687
2687
  HostEvent["UpdatePersonalisedView"] = "UpdatePersonalisedView";
2688
+ /**
2689
+ * Triggers the action to get the current view of the liveboard
2690
+ * @version SDK: 1.34.0 | Thoughtspot: 10.6.0.cl
2691
+ */
2692
+ HostEvent["SaveAnswer"] = "saveAnswer";
2693
+ /**
2694
+ * EmbedApi
2695
+ * @hidden
2696
+ */
2697
+ HostEvent["UiPassthrough"] = "UiPassthrough";
2688
2698
  })(exports.HostEvent || (exports.HostEvent = {}));
2689
2699
  /**
2690
2700
  * The different visual modes that the data sources panel within
@@ -14515,6 +14525,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14515
14525
  return e;
14516
14526
  }
14517
14527
 
14528
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.35.5-hostEvent.1";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",dompurify:"^2.3.4",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","eslint-plugin-comment-length":"1.7.3","eslint-plugin-jsdoc":"^46.9.0","fs-extra":"^10.0.0","gh-pages":"^3.1.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^5.3.4"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
14529
+
14518
14530
  /**
14519
14531
  * Reloads the ThoughtSpot iframe.
14520
14532
  * @param iFrame
@@ -14573,7 +14585,60 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14573
14585
  });
14574
14586
  }
14575
14587
 
14576
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.35.3";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};
14588
+ var UiPassthroughEvent;
14589
+ (function (UiPassthroughEvent) {
14590
+ UiPassthroughEvent["addVizToPinboard"] = "addVizToPinboard";
14591
+ UiPassthroughEvent["saveAnswer"] = "saveAnswer";
14592
+ UiPassthroughEvent["getA3AnalysisColumns"] = "getA3AnalysisColumns";
14593
+ UiPassthroughEvent["getDiscoverabilityStatus"] = "getDiscoverabilityStatus";
14594
+ UiPassthroughEvent["getAvailableUiPassthroughs"] = "getAvailableUiPassthroughs";
14595
+ UiPassthroughEvent["getAnswerPageConfig"] = "getAnswerPageConfig";
14596
+ UiPassthroughEvent["getPinboardPageConfig"] = "getPinboardPageConfig";
14597
+ UiPassthroughEvent["UiPassthroughEventNotFound"] = "UiPassthroughEventNotFound";
14598
+ })(UiPassthroughEvent || (UiPassthroughEvent = {}));
14599
+
14600
+ class HostEventClient {
14601
+ constructor(thoughtSpotHost) {
14602
+ this.executeUiPassthroughApi = async (iFrame, apiName, parameters) => {
14603
+ const res = await processTrigger(iFrame, exports.HostEvent.UiPassthrough, this.thoughtSpotHost, {
14604
+ type: apiName,
14605
+ parameters,
14606
+ });
14607
+ return res;
14608
+ };
14609
+ this.handleUiPassthroughForHostEvent = async (iFrame, apiName, parameters) => {
14610
+ var _a, _b, _c;
14611
+ const response = (_b = (_a = (await this.executeUiPassthroughApi(iFrame, apiName, parameters))) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.call(_a, (r) => r.error || r.value)[0];
14612
+ if (!response) {
14613
+ const error = `No answer found${parameters.vizId ? ` for vizId: ${parameters.vizId}` : ''}.`;
14614
+ // eslint-disable-next-line no-throw-literal
14615
+ throw { error };
14616
+ }
14617
+ const errors = response.error || ((_c = response.value) === null || _c === void 0 ? void 0 : _c.errors);
14618
+ if (errors) {
14619
+ // eslint-disable-next-line no-throw-literal
14620
+ throw { error: response.error };
14621
+ }
14622
+ return { ...response.value };
14623
+ };
14624
+ this.thoughtSpotHost = thoughtSpotHost;
14625
+ }
14626
+ async hostEventFallback(iFrame, hostEvent, data) {
14627
+ return processTrigger(iFrame, hostEvent, this.thoughtSpotHost, data);
14628
+ }
14629
+ async executeHostEvent(iFrame, hostEvent, payload) {
14630
+ if (hostEvent === exports.HostEvent.Pin && (payload === null || payload === void 0 ? void 0 : payload.newVizName)) {
14631
+ return this.handleUiPassthroughForHostEvent(iFrame, UiPassthroughEvent.addVizToPinboard, payload);
14632
+ }
14633
+ if (hostEvent === exports.HostEvent.SaveAnswer && (payload === null || payload === void 0 ? void 0 : payload.name)) {
14634
+ return this.handleUiPassthroughForHostEvent(iFrame, UiPassthroughEvent.saveAnswer, payload);
14635
+ }
14636
+ // fallback for save answer is Save
14637
+ if (hostEvent === exports.HostEvent.SaveAnswer)
14638
+ hostEvent = exports.HostEvent.Save;
14639
+ return this.hostEventFallback(iFrame, hostEvent, payload);
14640
+ }
14641
+ }
14577
14642
 
14578
14643
  /**
14579
14644
  * Copyright (c) 2022
@@ -14688,6 +14753,17 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14688
14753
  this.on(exports.EmbedEvent.AuthExpire, this.updateAuthToken, { start: false }, true);
14689
14754
  };
14690
14755
  this.showPreRenderByDefault = false;
14756
+ /**
14757
+ * Triggers an event to the embedded app, skipping the UI flow.
14758
+ * @param {UiPassthroughEvent} apiName - The name of the API to be triggered.
14759
+ * @param {UiPassthroughRequest} parameters - The parameters to be passed to the API.
14760
+ * @returns {Promise<UiPassthroughRequest>} - A promise that resolves with the response
14761
+ * from the embedded app.
14762
+ */
14763
+ // eslint-disable-next-line arrow-body-style
14764
+ this.triggerUiPassThrough = (apiName, parameters) => {
14765
+ return this.hostEventClient.executeUiPassthroughApi(this.iFrame, apiName, parameters);
14766
+ };
14691
14767
  this.validatePreRenderViewConfig = (viewConfig) => {
14692
14768
  var _a;
14693
14769
  const preRenderAllowedKeys = ['preRenderId', 'vizId', 'liveboardId'];
@@ -14729,6 +14805,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14729
14805
  uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
14730
14806
  ...viewConfig,
14731
14807
  });
14808
+ this.hostEventClient = new HostEventClient(this.embedConfig.thoughtSpotHost);
14732
14809
  }
14733
14810
  /**
14734
14811
  * Throws error encountered during initialization.
@@ -15347,8 +15424,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15347
15424
  * Triggers an event to the embedded app
15348
15425
  * @param messageType The event type
15349
15426
  * @param data The payload to send with the message
15427
+ * @returns A promise that resolves with the response from the embedded app
15350
15428
  */
15351
- trigger(messageType, data = {}) {
15429
+ trigger(messageType, data) {
15352
15430
  uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
15353
15431
  if (!this.isRendered) {
15354
15432
  this.handleError('Please call render before triggering events');
@@ -15358,7 +15436,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15358
15436
  this.handleError('Host event type is undefined');
15359
15437
  return null;
15360
15438
  }
15361
- return processTrigger(this.iFrame, messageType, this.thoughtSpotHost, data);
15439
+ return this.hostEventClient.executeHostEvent(this.iFrame, messageType, data);
15362
15440
  }
15363
15441
  /**
15364
15442
  * Marks the ThoughtSpot object to have been rendered
@@ -16469,7 +16547,7 @@ query GetEurekaVizSnapshots(
16469
16547
  * @param messageType The event type
16470
16548
  * @param data The payload to send with the message
16471
16549
  */
16472
- trigger(messageType, data = {}) {
16550
+ trigger(messageType, data) {
16473
16551
  const dataWithVizId = data;
16474
16552
  if (messageType === exports.HostEvent.SetActiveTab) {
16475
16553
  this.setActiveTab(data);
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.35.3 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.35.5-hostEvent.1 */
2
2
  function _mergeNamespaces(n, m) {
3
3
  m.forEach(function (e) {
4
4
  e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
@@ -1063,8 +1063,8 @@ var EmbedEvent;
1063
1063
  *
1064
1064
  * **Note**: This event is deprecated in v1.21.0.
1065
1065
  * To fire an event when a download action is initiated on a chart or table,
1066
- * use `EmbedEvent.DownloadAsPng`, `EmbedEvent.DownloadAsPDF`, `EmbedEvent.DownloadAsCSV`,
1067
- * or `EmbedEvent.DownloadAsXLSX`
1066
+ * use `EmbedEvent.DownloadAsPng`, `EmbedEvent.DownloadAsPDF`,
1067
+ * `EmbedEvent.DownloadAsCSV`, or `EmbedEvent.DownloadAsXLSX`
1068
1068
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1069
1069
  * @example
1070
1070
  *```js
@@ -2548,6 +2548,16 @@ var HostEvent;
2548
2548
  * @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
2549
2549
  */
2550
2550
  HostEvent["UpdatePersonalisedView"] = "UpdatePersonalisedView";
2551
+ /**
2552
+ * Triggers the action to get the current view of the liveboard
2553
+ * @version SDK: 1.34.0 | Thoughtspot: 10.6.0.cl
2554
+ */
2555
+ HostEvent["SaveAnswer"] = "saveAnswer";
2556
+ /**
2557
+ * EmbedApi
2558
+ * @hidden
2559
+ */
2560
+ HostEvent["UiPassthrough"] = "UiPassthrough";
2551
2561
  })(HostEvent || (HostEvent = {}));
2552
2562
  /**
2553
2563
  * The different visual modes that the data sources panel within
@@ -7049,7 +7059,7 @@ class AnswerService {
7049
7059
  async getTML() {
7050
7060
  const { object } = await this.executeQuery(getAnswerTML, {});
7051
7061
  const edoc = object[0].edoc;
7052
- const YAML = await import('./index-BaGHDCpW.js');
7062
+ const YAML = await import('./index-CzwzS0P4.js');
7053
7063
  const parsedDoc = YAML.parse(edoc);
7054
7064
  return {
7055
7065
  answer: {
@@ -14735,6 +14745,8 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
14735
14745
  return e;
14736
14746
  }
14737
14747
 
14748
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.35.5-hostEvent.1";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",dompurify:"^2.3.4",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","eslint-plugin-comment-length":"1.7.3","eslint-plugin-jsdoc":"^46.9.0","fs-extra":"^10.0.0","gh-pages":"^3.1.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^5.3.4"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
14749
+
14738
14750
  /**
14739
14751
  * Reloads the ThoughtSpot iframe.
14740
14752
  * @param iFrame
@@ -14793,7 +14805,60 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
14793
14805
  });
14794
14806
  }
14795
14807
 
14796
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.35.3";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};
14808
+ var UiPassthroughEvent;
14809
+ (function (UiPassthroughEvent) {
14810
+ UiPassthroughEvent["addVizToPinboard"] = "addVizToPinboard";
14811
+ UiPassthroughEvent["saveAnswer"] = "saveAnswer";
14812
+ UiPassthroughEvent["getA3AnalysisColumns"] = "getA3AnalysisColumns";
14813
+ UiPassthroughEvent["getDiscoverabilityStatus"] = "getDiscoverabilityStatus";
14814
+ UiPassthroughEvent["getAvailableUiPassthroughs"] = "getAvailableUiPassthroughs";
14815
+ UiPassthroughEvent["getAnswerPageConfig"] = "getAnswerPageConfig";
14816
+ UiPassthroughEvent["getPinboardPageConfig"] = "getPinboardPageConfig";
14817
+ UiPassthroughEvent["UiPassthroughEventNotFound"] = "UiPassthroughEventNotFound";
14818
+ })(UiPassthroughEvent || (UiPassthroughEvent = {}));
14819
+
14820
+ class HostEventClient {
14821
+ constructor(thoughtSpotHost) {
14822
+ this.executeUiPassthroughApi = async (iFrame, apiName, parameters) => {
14823
+ const res = await processTrigger(iFrame, HostEvent.UiPassthrough, this.thoughtSpotHost, {
14824
+ type: apiName,
14825
+ parameters,
14826
+ });
14827
+ return res;
14828
+ };
14829
+ this.handleUiPassthroughForHostEvent = async (iFrame, apiName, parameters) => {
14830
+ var _a, _b, _c;
14831
+ const response = (_b = (_a = (await this.executeUiPassthroughApi(iFrame, apiName, parameters))) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.call(_a, (r) => r.error || r.value)[0];
14832
+ if (!response) {
14833
+ const error = `No answer found${parameters.vizId ? ` for vizId: ${parameters.vizId}` : ''}.`;
14834
+ // eslint-disable-next-line no-throw-literal
14835
+ throw { error };
14836
+ }
14837
+ const errors = response.error || ((_c = response.value) === null || _c === void 0 ? void 0 : _c.errors);
14838
+ if (errors) {
14839
+ // eslint-disable-next-line no-throw-literal
14840
+ throw { error: response.error };
14841
+ }
14842
+ return { ...response.value };
14843
+ };
14844
+ this.thoughtSpotHost = thoughtSpotHost;
14845
+ }
14846
+ async hostEventFallback(iFrame, hostEvent, data) {
14847
+ return processTrigger(iFrame, hostEvent, this.thoughtSpotHost, data);
14848
+ }
14849
+ async executeHostEvent(iFrame, hostEvent, payload) {
14850
+ if (hostEvent === HostEvent.Pin && (payload === null || payload === void 0 ? void 0 : payload.newVizName)) {
14851
+ return this.handleUiPassthroughForHostEvent(iFrame, UiPassthroughEvent.addVizToPinboard, payload);
14852
+ }
14853
+ if (hostEvent === HostEvent.SaveAnswer && (payload === null || payload === void 0 ? void 0 : payload.name)) {
14854
+ return this.handleUiPassthroughForHostEvent(iFrame, UiPassthroughEvent.saveAnswer, payload);
14855
+ }
14856
+ // fallback for save answer is Save
14857
+ if (hostEvent === HostEvent.SaveAnswer)
14858
+ hostEvent = HostEvent.Save;
14859
+ return this.hostEventFallback(iFrame, hostEvent, payload);
14860
+ }
14861
+ }
14797
14862
 
14798
14863
  /**
14799
14864
  * Copyright (c) 2022
@@ -14908,6 +14973,17 @@ class TsEmbed {
14908
14973
  this.on(EmbedEvent.AuthExpire, this.updateAuthToken, { start: false }, true);
14909
14974
  };
14910
14975
  this.showPreRenderByDefault = false;
14976
+ /**
14977
+ * Triggers an event to the embedded app, skipping the UI flow.
14978
+ * @param {UiPassthroughEvent} apiName - The name of the API to be triggered.
14979
+ * @param {UiPassthroughRequest} parameters - The parameters to be passed to the API.
14980
+ * @returns {Promise<UiPassthroughRequest>} - A promise that resolves with the response
14981
+ * from the embedded app.
14982
+ */
14983
+ // eslint-disable-next-line arrow-body-style
14984
+ this.triggerUiPassThrough = (apiName, parameters) => {
14985
+ return this.hostEventClient.executeUiPassthroughApi(this.iFrame, apiName, parameters);
14986
+ };
14911
14987
  this.validatePreRenderViewConfig = (viewConfig) => {
14912
14988
  var _a;
14913
14989
  const preRenderAllowedKeys = ['preRenderId', 'vizId', 'liveboardId'];
@@ -14949,6 +15025,7 @@ class TsEmbed {
14949
15025
  uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
14950
15026
  ...viewConfig,
14951
15027
  });
15028
+ this.hostEventClient = new HostEventClient(this.embedConfig.thoughtSpotHost);
14952
15029
  }
14953
15030
  /**
14954
15031
  * Throws error encountered during initialization.
@@ -15567,8 +15644,9 @@ class TsEmbed {
15567
15644
  * Triggers an event to the embedded app
15568
15645
  * @param messageType The event type
15569
15646
  * @param data The payload to send with the message
15647
+ * @returns A promise that resolves with the response from the embedded app
15570
15648
  */
15571
- trigger(messageType, data = {}) {
15649
+ trigger(messageType, data) {
15572
15650
  uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
15573
15651
  if (!this.isRendered) {
15574
15652
  this.handleError('Please call render before triggering events');
@@ -15578,7 +15656,7 @@ class TsEmbed {
15578
15656
  this.handleError('Host event type is undefined');
15579
15657
  return null;
15580
15658
  }
15581
- return processTrigger(this.iFrame, messageType, this.thoughtSpotHost, data);
15659
+ return this.hostEventClient.executeHostEvent(this.iFrame, messageType, data);
15582
15660
  }
15583
15661
  /**
15584
15662
  * Marks the ThoughtSpot object to have been rendered
@@ -16392,7 +16470,7 @@ class LiveboardEmbed extends V1Embed {
16392
16470
  * @param messageType The event type
16393
16471
  * @param data The payload to send with the message
16394
16472
  */
16395
- trigger(messageType, data = {}) {
16473
+ trigger(messageType, data) {
16396
16474
  const dataWithVizId = data;
16397
16475
  if (messageType === HostEvent.SetActiveTab) {
16398
16476
  this.setActiveTab(data);
@@ -17786,4 +17864,4 @@ const createLiveboardWithAnswers = async (answers, name) => {
17786
17864
  return result;
17787
17865
  };
17788
17866
 
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 };
17867
+ export { Action, AnswerService, AppEmbed, AuthEvent, AuthFailureType, AuthStatus, AuthType, BodylessConversation, ContextMenuTriggerOptions, ConversationEmbed, DataSourceVisualMode, EmbedEvent, HomeLeftNavItem, HomePageSearchBarMode, HomepageModule, HostEvent, LiveboardEmbed, LogLevel, MIXPANEL_EVENT, Page, PinboardEmbed, PrefetchFeatures, RuntimeFilterOp, SageEmbed, SearchBarEmbed, SearchEmbed, UiPassthroughEvent, createLiveboardWithAnswers, executeTML, exportTML, getAnswerFromQuery, getEmbedConfig as getInitConfig, getSessionInfo, init, logout, prefetch, resetCachedAuthToken, tokenizedFetch, uploadMixpanelEvent };