@thoughtspot/visual-embed-sdk 1.32.4-dc.5 → 1.32.4-dc.7

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 (72) hide show
  1. package/cjs/package.json +4 -3
  2. package/cjs/src/embed/base.d.ts +2 -0
  3. package/cjs/src/embed/base.d.ts.map +1 -1
  4. package/cjs/src/embed/base.js +2 -0
  5. package/cjs/src/embed/base.js.map +1 -1
  6. package/cjs/src/index.d.ts +2 -1
  7. package/cjs/src/index.d.ts.map +1 -1
  8. package/cjs/src/index.js +3 -1
  9. package/cjs/src/index.js.map +1 -1
  10. package/cjs/src/utils/graphql/answerService/answer-queries.d.ts +1 -0
  11. package/cjs/src/utils/graphql/answerService/answer-queries.d.ts.map +1 -1
  12. package/cjs/src/utils/graphql/answerService/answer-queries.js +24 -1
  13. package/cjs/src/utils/graphql/answerService/answer-queries.js.map +1 -1
  14. package/cjs/src/utils/graphql/answerService/answerService.d.ts +2 -0
  15. package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  16. package/cjs/src/utils/graphql/answerService/answerService.js +34 -8
  17. package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
  18. package/cjs/src/utils/liveboardService/liveboardService.d.ts +3 -0
  19. package/cjs/src/utils/liveboardService/liveboardService.d.ts.map +1 -0
  20. package/cjs/src/utils/liveboardService/liveboardService.js +45 -0
  21. package/cjs/src/utils/liveboardService/liveboardService.js.map +1 -0
  22. package/dist/src/embed/base.d.ts +2 -0
  23. package/dist/src/embed/base.d.ts.map +1 -1
  24. package/dist/src/index.d.ts +2 -1
  25. package/dist/src/index.d.ts.map +1 -1
  26. package/dist/src/utils/graphql/answerService/answer-queries.d.ts +1 -0
  27. package/dist/src/utils/graphql/answerService/answer-queries.d.ts.map +1 -1
  28. package/dist/src/utils/graphql/answerService/answerService.d.ts +2 -0
  29. package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  30. package/dist/src/utils/liveboardService/liveboardService.d.ts +3 -0
  31. package/dist/src/utils/liveboardService/liveboardService.d.ts.map +1 -0
  32. package/dist/tsembed-react.es.js +74 -10
  33. package/dist/tsembed-react.js +74 -10
  34. package/dist/tsembed.es.js +115 -11
  35. package/dist/tsembed.js +115 -10
  36. package/dist/visual-embed-sdk-react-full.d.ts +7 -1
  37. package/dist/visual-embed-sdk-react.d.ts +7 -1
  38. package/dist/visual-embed-sdk.d.ts +7 -1
  39. package/lib/package.json +4 -3
  40. package/lib/src/embed/base.d.ts +2 -0
  41. package/lib/src/embed/base.d.ts.map +1 -1
  42. package/lib/src/embed/base.js +2 -0
  43. package/lib/src/embed/base.js.map +1 -1
  44. package/lib/src/index.d.ts +2 -1
  45. package/lib/src/index.d.ts.map +1 -1
  46. package/lib/src/index.js +2 -1
  47. package/lib/src/index.js.map +1 -1
  48. package/lib/src/utils/graphql/answerService/answer-queries.d.ts +1 -0
  49. package/lib/src/utils/graphql/answerService/answer-queries.d.ts.map +1 -1
  50. package/lib/src/utils/graphql/answerService/answer-queries.js +23 -0
  51. package/lib/src/utils/graphql/answerService/answer-queries.js.map +1 -1
  52. package/lib/src/utils/graphql/answerService/answerService.d.ts +2 -0
  53. package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  54. package/lib/src/utils/graphql/answerService/answerService.js +34 -8
  55. package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
  56. package/lib/src/utils/liveboardService/liveboardService.d.ts +3 -0
  57. package/lib/src/utils/liveboardService/liveboardService.d.ts.map +1 -0
  58. package/lib/src/utils/liveboardService/liveboardService.js +41 -0
  59. package/lib/src/utils/liveboardService/liveboardService.js.map +1 -0
  60. package/lib/src/visual-embed-sdk.d.ts +11 -1
  61. package/package.json +4 -3
  62. package/src/embed/base.ts +2 -0
  63. package/src/index.ts +2 -0
  64. package/src/utils/graphql/answerService/answer-queries.ts +24 -0
  65. package/src/utils/graphql/answerService/answerService.ts +49 -10
  66. package/src/utils/liveboardService/liveboardService.ts +51 -0
  67. package/dist/assets/main-DT_ac2DB.js +0 -264
  68. package/dist/local/index.html +0 -34
  69. package/dist/src/utils/graphql/conversationService/conversation-queries.d.ts +0 -3
  70. package/dist/src/utils/graphql/conversationService/conversation-queries.d.ts.map +0 -1
  71. package/dist/src/utils/graphql/conversationService/conversation-service.d.ts +0 -12
  72. package/dist/src/utils/graphql/conversationService/conversation-service.d.ts.map +0 -1
@@ -6450,6 +6450,7 @@ const getAnswer = `
6450
6450
  }
6451
6451
  visualizations {
6452
6452
  ... on TableViz {
6453
+ id
6453
6454
  columns {
6454
6455
  column {
6455
6456
  id
@@ -6461,6 +6462,9 @@ const getAnswer = `
6461
6462
  }
6462
6463
  }
6463
6464
  }
6465
+ ... on ChartViz {
6466
+ id
6467
+ }
6464
6468
  }
6465
6469
  }
6466
6470
  }
@@ -6492,6 +6496,21 @@ const getAnswerData = `
6492
6496
  }
6493
6497
  }
6494
6498
  `;
6499
+ const addVizToLiveboard = `
6500
+ mutation AddVizToLiveboard(liveboardId: GUID!, session: BachSessionIdInput!, tabId: GUID, vizId: GUID!) {
6501
+ Answer__addVizToPinboard(
6502
+ pinboardId: liveboardId
6503
+
6504
+ session: $session
6505
+
6506
+ tabId: $tabId
6507
+
6508
+ vizId: $vizId
6509
+ ) {
6510
+ ${bachSessionId}
6511
+ }
6512
+ }
6513
+ `;
6495
6514
  const getSQLQuery = `
6496
6515
  mutation GetSQLQuery($session: BachSessionIdInput!) {
6497
6516
  Answer__getQuery(session: $session) {
@@ -6499,7 +6518,26 @@ const getSQLQuery = `
6499
6518
  sql
6500
6519
  }
6501
6520
  }
6502
- `;
6521
+ `;
6522
+ const getAnswerTML = `
6523
+ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies: Boolean, $formatType: EDocFormatType, $exportPermissions: Boolean, $exportFqn: Boolean) {
6524
+ UnsavedAnswer_getTML(
6525
+ session: $session
6526
+ exportDependencies: $exportDependencies
6527
+ formatType: $formatType
6528
+ exportPermissions: $exportPermissions
6529
+ exportFqn: $exportFqn
6530
+ ) {
6531
+ zipFile
6532
+ object {
6533
+ edoc
6534
+ name
6535
+ type
6536
+ __typename
6537
+ }
6538
+ __typename
6539
+ }
6540
+ }`;
6503
6541
 
6504
6542
  // eslint-disable-next-line no-shadow
6505
6543
  var OperationType;
@@ -6547,19 +6585,14 @@ class AnswerService {
6547
6585
  this.thoughtSpotHost = thoughtSpotHost;
6548
6586
  this.selectedPoints = selectedPoints;
6549
6587
  this.session = removeTypename(session);
6550
- if (!answer) {
6551
- this.answer = this.executeQuery(getAnswer, {}).then((data) => data === null || data === void 0 ? void 0 : data.answer);
6552
- }
6553
- else {
6554
- this.answer = answer;
6555
- }
6588
+ this.answer = answer;
6556
6589
  }
6557
6590
  /**
6558
6591
  * Get the details about the source used in the answer.
6559
6592
  * This can be used to get the list of all columns in the data source for example.
6560
6593
  */
6561
6594
  async getSourceDetail() {
6562
- const sourceId = (await this.answer).sources[0].header.guid;
6595
+ const sourceId = (await this.getAnswer()).sources[0].header.guid;
6563
6596
  return getSourceDetail(this.thoughtSpotHost, sourceId);
6564
6597
  }
6565
6598
  /**
@@ -6751,9 +6784,30 @@ class AnswerService {
6751
6784
  getSession() {
6752
6785
  return this.session;
6753
6786
  }
6754
- getAnswer() {
6787
+ async getAnswer() {
6788
+ if (this.answer) {
6789
+ return this.answer;
6790
+ }
6791
+ this.answer = this.executeQuery(getAnswer, {}).then((data) => data === null || data === void 0 ? void 0 : data.answer);
6755
6792
  return this.answer;
6756
6793
  }
6794
+ async getTML() {
6795
+ const { object } = await this.executeQuery(getAnswerTML, {});
6796
+ const edoc = object[0].edoc;
6797
+ const YAML = await import(
6798
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
6799
+ // @ts-ignore
6800
+ 'https://cdn.skypack.dev/pin/yaml@v2.5.1-LhrxfZlDiReVYvv4kH95/mode=imports,min/optimized/yaml.js');
6801
+ return YAML.parse(edoc);
6802
+ }
6803
+ async addDisplayedVizToLiveboard(liveboardId) {
6804
+ const { displayMode, visualizations } = await this.getAnswer();
6805
+ const viz = getDisplayedViz(visualizations, displayMode);
6806
+ return this.executeQuery(addVizToLiveboard, {
6807
+ liveboardId,
6808
+ vizId: viz.id,
6809
+ });
6810
+ }
6757
6811
  }
6758
6812
  /**
6759
6813
  *
@@ -6815,6 +6869,16 @@ function getSelectedPointsForUnderlyingDataQuery(selectedPoints) {
6815
6869
  p.selectedAttributes.forEach(addPointFromColVal);
6816
6870
  });
6817
6871
  return underlyingDataPoint;
6872
+ }
6873
+ function getDisplayedViz(visualizations, displayMode) {
6874
+ if (displayMode === 'CHART_MODE') {
6875
+ return visualizations.find(
6876
+ // eslint-disable-next-line no-underscore-dangle
6877
+ (viz) => viz.__typename === 'ChartViz');
6878
+ }
6879
+ return visualizations.find(
6880
+ // eslint-disable-next-line no-underscore-dangle
6881
+ (viz) => viz.__typename === 'TableViz');
6818
6882
  }
6819
6883
 
6820
6884
  /**
@@ -13950,7 +14014,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
13950
14014
  });
13951
14015
  }
13952
14016
 
13953
- var name="@thoughtspot/visual-embed-sdk";var version="1.32.4-dc.5";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 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 dc","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","eslint-plugin-comment-length":"^0.9.2","eslint-plugin-jsdoc":"^46.9.0",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"^2.45.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.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/mixpanel-browser":"^2.35.6","@types/lodash":"^4.17.0","@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","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","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:"2.30.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,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.js",limit:"48 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};
14017
+ var name="@thoughtspot/visual-embed-sdk";var version="1.32.4-dc.7";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 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 dc","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","eslint-plugin-comment-length":"^0.9.2","eslint-plugin-jsdoc":"^46.9.0",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"^2.45.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","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","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:"2.30.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,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.js",limit:"48 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};
13954
14018
 
13955
14019
  /**
13956
14020
  * Copyright (c) 2022
@@ -6362,6 +6362,7 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
6362
6362
  }
6363
6363
  visualizations {
6364
6364
  ... on TableViz {
6365
+ id
6365
6366
  columns {
6366
6367
  column {
6367
6368
  id
@@ -6373,6 +6374,9 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
6373
6374
  }
6374
6375
  }
6375
6376
  }
6377
+ ... on ChartViz {
6378
+ id
6379
+ }
6376
6380
  }
6377
6381
  }
6378
6382
  }
@@ -6403,6 +6407,21 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
6403
6407
  }
6404
6408
  }
6405
6409
  }
6410
+ `;
6411
+ const addVizToLiveboard = `
6412
+ mutation AddVizToLiveboard(liveboardId: GUID!, session: BachSessionIdInput!, tabId: GUID, vizId: GUID!) {
6413
+ Answer__addVizToPinboard(
6414
+ pinboardId: liveboardId
6415
+
6416
+ session: $session
6417
+
6418
+ tabId: $tabId
6419
+
6420
+ vizId: $vizId
6421
+ ) {
6422
+ ${bachSessionId}
6423
+ }
6424
+ }
6406
6425
  `;
6407
6426
  const getSQLQuery = `
6408
6427
  mutation GetSQLQuery($session: BachSessionIdInput!) {
@@ -6411,7 +6430,26 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
6411
6430
  sql
6412
6431
  }
6413
6432
  }
6414
- `;
6433
+ `;
6434
+ const getAnswerTML = `
6435
+ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies: Boolean, $formatType: EDocFormatType, $exportPermissions: Boolean, $exportFqn: Boolean) {
6436
+ UnsavedAnswer_getTML(
6437
+ session: $session
6438
+ exportDependencies: $exportDependencies
6439
+ formatType: $formatType
6440
+ exportPermissions: $exportPermissions
6441
+ exportFqn: $exportFqn
6442
+ ) {
6443
+ zipFile
6444
+ object {
6445
+ edoc
6446
+ name
6447
+ type
6448
+ __typename
6449
+ }
6450
+ __typename
6451
+ }
6452
+ }`;
6415
6453
 
6416
6454
  // eslint-disable-next-line no-shadow
6417
6455
  var OperationType;
@@ -6459,19 +6497,14 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
6459
6497
  this.thoughtSpotHost = thoughtSpotHost;
6460
6498
  this.selectedPoints = selectedPoints;
6461
6499
  this.session = removeTypename(session);
6462
- if (!answer) {
6463
- this.answer = this.executeQuery(getAnswer, {}).then((data) => data === null || data === void 0 ? void 0 : data.answer);
6464
- }
6465
- else {
6466
- this.answer = answer;
6467
- }
6500
+ this.answer = answer;
6468
6501
  }
6469
6502
  /**
6470
6503
  * Get the details about the source used in the answer.
6471
6504
  * This can be used to get the list of all columns in the data source for example.
6472
6505
  */
6473
6506
  async getSourceDetail() {
6474
- const sourceId = (await this.answer).sources[0].header.guid;
6507
+ const sourceId = (await this.getAnswer()).sources[0].header.guid;
6475
6508
  return getSourceDetail(this.thoughtSpotHost, sourceId);
6476
6509
  }
6477
6510
  /**
@@ -6663,9 +6696,30 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
6663
6696
  getSession() {
6664
6697
  return this.session;
6665
6698
  }
6666
- getAnswer() {
6699
+ async getAnswer() {
6700
+ if (this.answer) {
6701
+ return this.answer;
6702
+ }
6703
+ this.answer = this.executeQuery(getAnswer, {}).then((data) => data === null || data === void 0 ? void 0 : data.answer);
6667
6704
  return this.answer;
6668
6705
  }
6706
+ async getTML() {
6707
+ const { object } = await this.executeQuery(getAnswerTML, {});
6708
+ const edoc = object[0].edoc;
6709
+ const YAML = await import(
6710
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
6711
+ // @ts-ignore
6712
+ 'https://cdn.skypack.dev/pin/yaml@v2.5.1-LhrxfZlDiReVYvv4kH95/mode=imports,min/optimized/yaml.js');
6713
+ return YAML.parse(edoc);
6714
+ }
6715
+ async addDisplayedVizToLiveboard(liveboardId) {
6716
+ const { displayMode, visualizations } = await this.getAnswer();
6717
+ const viz = getDisplayedViz(visualizations, displayMode);
6718
+ return this.executeQuery(addVizToLiveboard, {
6719
+ liveboardId,
6720
+ vizId: viz.id,
6721
+ });
6722
+ }
6669
6723
  }
6670
6724
  /**
6671
6725
  *
@@ -6727,6 +6781,16 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
6727
6781
  p.selectedAttributes.forEach(addPointFromColVal);
6728
6782
  });
6729
6783
  return underlyingDataPoint;
6784
+ }
6785
+ function getDisplayedViz(visualizations, displayMode) {
6786
+ if (displayMode === 'CHART_MODE') {
6787
+ return visualizations.find(
6788
+ // eslint-disable-next-line no-underscore-dangle
6789
+ (viz) => viz.__typename === 'ChartViz');
6790
+ }
6791
+ return visualizations.find(
6792
+ // eslint-disable-next-line no-underscore-dangle
6793
+ (viz) => viz.__typename === 'TableViz');
6730
6794
  }
6731
6795
 
6732
6796
  /**
@@ -13862,7 +13926,7 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
13862
13926
  });
13863
13927
  }
13864
13928
 
13865
- var name="@thoughtspot/visual-embed-sdk";var version="1.32.4-dc.5";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 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 dc","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","eslint-plugin-comment-length":"^0.9.2","eslint-plugin-jsdoc":"^46.9.0",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"^2.45.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.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/mixpanel-browser":"^2.35.6","@types/lodash":"^4.17.0","@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","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","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:"2.30.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,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.js",limit:"48 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};
13929
+ var name="@thoughtspot/visual-embed-sdk";var version="1.32.4-dc.7";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 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 dc","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","eslint-plugin-comment-length":"^0.9.2","eslint-plugin-jsdoc":"^46.9.0",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"^2.45.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","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","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:"2.30.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,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.js",limit:"48 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};
13866
13930
 
13867
13931
  /**
13868
13932
  * Copyright (c) 2022
@@ -6350,6 +6350,7 @@ const getAnswer = `
6350
6350
  }
6351
6351
  visualizations {
6352
6352
  ... on TableViz {
6353
+ id
6353
6354
  columns {
6354
6355
  column {
6355
6356
  id
@@ -6361,6 +6362,9 @@ const getAnswer = `
6361
6362
  }
6362
6363
  }
6363
6364
  }
6365
+ ... on ChartViz {
6366
+ id
6367
+ }
6364
6368
  }
6365
6369
  }
6366
6370
  }
@@ -6392,6 +6396,21 @@ const getAnswerData = `
6392
6396
  }
6393
6397
  }
6394
6398
  `;
6399
+ const addVizToLiveboard = `
6400
+ mutation AddVizToLiveboard(liveboardId: GUID!, session: BachSessionIdInput!, tabId: GUID, vizId: GUID!) {
6401
+ Answer__addVizToPinboard(
6402
+ pinboardId: liveboardId
6403
+
6404
+ session: $session
6405
+
6406
+ tabId: $tabId
6407
+
6408
+ vizId: $vizId
6409
+ ) {
6410
+ ${bachSessionId}
6411
+ }
6412
+ }
6413
+ `;
6395
6414
  const getSQLQuery = `
6396
6415
  mutation GetSQLQuery($session: BachSessionIdInput!) {
6397
6416
  Answer__getQuery(session: $session) {
@@ -6399,7 +6418,26 @@ const getSQLQuery = `
6399
6418
  sql
6400
6419
  }
6401
6420
  }
6402
- `;
6421
+ `;
6422
+ const getAnswerTML = `
6423
+ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies: Boolean, $formatType: EDocFormatType, $exportPermissions: Boolean, $exportFqn: Boolean) {
6424
+ UnsavedAnswer_getTML(
6425
+ session: $session
6426
+ exportDependencies: $exportDependencies
6427
+ formatType: $formatType
6428
+ exportPermissions: $exportPermissions
6429
+ exportFqn: $exportFqn
6430
+ ) {
6431
+ zipFile
6432
+ object {
6433
+ edoc
6434
+ name
6435
+ type
6436
+ __typename
6437
+ }
6438
+ __typename
6439
+ }
6440
+ }`;
6403
6441
 
6404
6442
  // eslint-disable-next-line no-shadow
6405
6443
  var OperationType;
@@ -6447,19 +6485,14 @@ class AnswerService {
6447
6485
  this.thoughtSpotHost = thoughtSpotHost;
6448
6486
  this.selectedPoints = selectedPoints;
6449
6487
  this.session = removeTypename(session);
6450
- if (!answer) {
6451
- this.answer = this.executeQuery(getAnswer, {}).then((data) => data === null || data === void 0 ? void 0 : data.answer);
6452
- }
6453
- else {
6454
- this.answer = answer;
6455
- }
6488
+ this.answer = answer;
6456
6489
  }
6457
6490
  /**
6458
6491
  * Get the details about the source used in the answer.
6459
6492
  * This can be used to get the list of all columns in the data source for example.
6460
6493
  */
6461
6494
  async getSourceDetail() {
6462
- const sourceId = (await this.answer).sources[0].header.guid;
6495
+ const sourceId = (await this.getAnswer()).sources[0].header.guid;
6463
6496
  return getSourceDetail(this.thoughtSpotHost, sourceId);
6464
6497
  }
6465
6498
  /**
@@ -6651,9 +6684,30 @@ class AnswerService {
6651
6684
  getSession() {
6652
6685
  return this.session;
6653
6686
  }
6654
- getAnswer() {
6687
+ async getAnswer() {
6688
+ if (this.answer) {
6689
+ return this.answer;
6690
+ }
6691
+ this.answer = this.executeQuery(getAnswer, {}).then((data) => data === null || data === void 0 ? void 0 : data.answer);
6655
6692
  return this.answer;
6656
6693
  }
6694
+ async getTML() {
6695
+ const { object } = await this.executeQuery(getAnswerTML, {});
6696
+ const edoc = object[0].edoc;
6697
+ const YAML = await import(
6698
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
6699
+ // @ts-ignore
6700
+ 'https://cdn.skypack.dev/pin/yaml@v2.5.1-LhrxfZlDiReVYvv4kH95/mode=imports,min/optimized/yaml.js');
6701
+ return YAML.parse(edoc);
6702
+ }
6703
+ async addDisplayedVizToLiveboard(liveboardId) {
6704
+ const { displayMode, visualizations } = await this.getAnswer();
6705
+ const viz = getDisplayedViz(visualizations, displayMode);
6706
+ return this.executeQuery(addVizToLiveboard, {
6707
+ liveboardId,
6708
+ vizId: viz.id,
6709
+ });
6710
+ }
6657
6711
  }
6658
6712
  /**
6659
6713
  *
@@ -6715,6 +6769,16 @@ function getSelectedPointsForUnderlyingDataQuery(selectedPoints) {
6715
6769
  p.selectedAttributes.forEach(addPointFromColVal);
6716
6770
  });
6717
6771
  return underlyingDataPoint;
6772
+ }
6773
+ function getDisplayedViz(visualizations, displayMode) {
6774
+ if (displayMode === 'CHART_MODE') {
6775
+ return visualizations.find(
6776
+ // eslint-disable-next-line no-underscore-dangle
6777
+ (viz) => viz.__typename === 'ChartViz');
6778
+ }
6779
+ return visualizations.find(
6780
+ // eslint-disable-next-line no-underscore-dangle
6781
+ (viz) => viz.__typename === 'TableViz');
6718
6782
  }
6719
6783
 
6720
6784
  /**
@@ -13912,6 +13976,7 @@ const renderInQueue = (fn) => {
13912
13976
  /**
13913
13977
  * Imports TML representation of the metadata objects into ThoughtSpot.
13914
13978
  * @param data
13979
+ * @returns Promise
13915
13980
  * @example
13916
13981
  * ```js
13917
13982
  * executeTML({
@@ -13968,6 +14033,7 @@ const executeTML = async (data) => {
13968
14033
  * Exports TML representation of the metadata objects from ThoughtSpot in JSON or YAML
13969
14034
  * format.
13970
14035
  * @param data
14036
+ * @returns Promise
13971
14037
  * @example
13972
14038
  * ```js
13973
14039
  exportTML({
@@ -14183,7 +14249,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
14183
14249
  });
14184
14250
  }
14185
14251
 
14186
- var name="@thoughtspot/visual-embed-sdk";var version="1.32.4-dc.5";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 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 dc","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","eslint-plugin-comment-length":"^0.9.2","eslint-plugin-jsdoc":"^46.9.0",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"^2.45.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.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/mixpanel-browser":"^2.35.6","@types/lodash":"^4.17.0","@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","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","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:"2.30.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,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.js",limit:"48 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};
14252
+ var name="@thoughtspot/visual-embed-sdk";var version="1.32.4-dc.7";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 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 dc","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","eslint-plugin-comment-length":"^0.9.2","eslint-plugin-jsdoc":"^46.9.0",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"^2.45.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","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","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:"2.30.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,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.js",limit:"48 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};
14187
14253
 
14188
14254
  /**
14189
14255
  * Copyright (c) 2022
@@ -16991,4 +17057,42 @@ const getAnswerFromQuery = async (query, worksheetId) => {
16991
17057
  return new AnswerService(answerSession, null, embedConfig.thoughtSpotHost);
16992
17058
  };
16993
17059
 
16994
- export { Action, AnswerService, AppEmbed, AuthEvent, AuthFailureType, AuthStatus, AuthType, ContextMenuTriggerOptions, Conversation$1 as Conversation, DataSourceVisualMode, EmbedEvent, HomeLeftNavItem, HomepageModule, HostEvent, LiveboardEmbed, LogLevel, MIXPANEL_EVENT, Page, PinboardEmbed, PrefetchFeatures, RuntimeFilterOp, SageEmbed, SearchBarEmbed, SearchEmbed, executeTML, exportTML, getAnswerFromQuery, getEmbedConfig as getInitConfig, getSessionInfo, init, logout$1 as logout, prefetch, resetCachedAuthToken, tokenizedFetch, uploadMixpanelEvent };
17060
+ const createLiveboardWithAnswers = async (answers, name) => {
17061
+ const { thoughtSpotHost, authType } = getEmbedConfig();
17062
+ const resp = await tokenizedFetch(`${thoughtSpotHost}/api/rest/2.0/metadata/search`, {
17063
+ method: 'POST',
17064
+ credentials: 'include',
17065
+ body: JSON.stringify({
17066
+ metadata: [{
17067
+ type: 'LIVEBOARD',
17068
+ identifier: name,
17069
+ }],
17070
+ }),
17071
+ });
17072
+ const lbList = await resp.json();
17073
+ const liveboardId = lbList[0];
17074
+ const answerTMLs = await Promise.all(answers.map((a) => a.getTML()));
17075
+ const lbTml = {
17076
+ liveboard: {
17077
+ name,
17078
+ guid: liveboardId,
17079
+ visualizations: answerTMLs.map((tml, idx) => ({
17080
+ id: `Viz_${idx}`,
17081
+ answer: tml,
17082
+ })),
17083
+ layout: {
17084
+ tiles: answerTMLs.map((tml, idx) => ({
17085
+ visualization_id: `Viz_${idx}`,
17086
+ size: 'MEDIUM_SMALL',
17087
+ })),
17088
+ },
17089
+ },
17090
+ };
17091
+ const result = await executeTML({
17092
+ metadata_tmls: [JSON.stringify(lbTml)],
17093
+ import_policy: 'ALL_OR_NONE',
17094
+ });
17095
+ return result;
17096
+ };
17097
+
17098
+ export { Action, AnswerService, AppEmbed, AuthEvent, AuthFailureType, AuthStatus, AuthType, ContextMenuTriggerOptions, Conversation$1 as Conversation, DataSourceVisualMode, EmbedEvent, HomeLeftNavItem, HomepageModule, HostEvent, LiveboardEmbed, LogLevel, MIXPANEL_EVENT, Page, PinboardEmbed, PrefetchFeatures, RuntimeFilterOp, SageEmbed, SearchBarEmbed, SearchEmbed, createLiveboardWithAnswers, executeTML, exportTML, getAnswerFromQuery, getEmbedConfig as getInitConfig, getSessionInfo, init, logout$1 as logout, prefetch, resetCachedAuthToken, tokenizedFetch, uploadMixpanelEvent };