@thoughtspot/visual-embed-sdk 1.13.0-alpha.1 → 1.13.0-alpha.4

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 (59) hide show
  1. package/dist/src/auth.d.ts +13 -0
  2. package/dist/src/embed/app.d.ts +5 -0
  3. package/dist/src/embed/base.d.ts +1 -0
  4. package/dist/src/embed/ts-embed.d.ts +9 -1
  5. package/dist/src/types.d.ts +191 -6
  6. package/dist/src/utils.d.ts +2 -1
  7. package/dist/tsembed.es.js +222 -8
  8. package/dist/tsembed.js +222 -8
  9. package/lib/package.json +1 -1
  10. package/lib/src/auth.d.ts +13 -0
  11. package/lib/src/auth.js +14 -0
  12. package/lib/src/auth.js.map +1 -1
  13. package/lib/src/auth.spec.js +9 -0
  14. package/lib/src/auth.spec.js.map +1 -1
  15. package/lib/src/config.spec.js +7 -0
  16. package/lib/src/config.spec.js.map +1 -1
  17. package/lib/src/embed/app.d.ts +5 -0
  18. package/lib/src/embed/app.js +1 -1
  19. package/lib/src/embed/app.js.map +1 -1
  20. package/lib/src/embed/app.spec.js +10 -0
  21. package/lib/src/embed/app.spec.js.map +1 -1
  22. package/lib/src/embed/base.d.ts +1 -0
  23. package/lib/src/embed/base.js +10 -0
  24. package/lib/src/embed/base.js.map +1 -1
  25. package/lib/src/embed/base.spec.js +16 -0
  26. package/lib/src/embed/base.spec.js.map +1 -1
  27. package/lib/src/embed/liveboard.js +4 -1
  28. package/lib/src/embed/liveboard.js.map +1 -1
  29. package/lib/src/embed/liveboard.spec.js +3 -2
  30. package/lib/src/embed/liveboard.spec.js.map +1 -1
  31. package/lib/src/embed/pinboard.spec.js +3 -2
  32. package/lib/src/embed/pinboard.spec.js.map +1 -1
  33. package/lib/src/embed/ts-embed.d.ts +9 -1
  34. package/lib/src/embed/ts-embed.js +21 -3
  35. package/lib/src/embed/ts-embed.js.map +1 -1
  36. package/lib/src/embed/ts-embed.spec.js +26 -0
  37. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  38. package/lib/src/types.d.ts +191 -6
  39. package/lib/src/types.js +163 -3
  40. package/lib/src/types.js.map +1 -1
  41. package/lib/src/utils.d.ts +2 -1
  42. package/lib/src/utils.js +9 -0
  43. package/lib/src/utils.js.map +1 -1
  44. package/lib/src/visual-embed-sdk.d.ts +211 -7
  45. package/package.json +2 -2
  46. package/src/auth.spec.ts +10 -0
  47. package/src/auth.ts +14 -0
  48. package/src/config.spec.ts +11 -0
  49. package/src/embed/app.spec.ts +14 -0
  50. package/src/embed/app.ts +6 -0
  51. package/src/embed/base.spec.ts +18 -0
  52. package/src/embed/base.ts +10 -0
  53. package/src/embed/liveboard.spec.ts +4 -2
  54. package/src/embed/liveboard.ts +4 -0
  55. package/src/embed/pinboard.spec.ts +4 -3
  56. package/src/embed/ts-embed.spec.ts +32 -0
  57. package/src/embed/ts-embed.ts +25 -1
  58. package/src/types.ts +189 -3
  59. package/src/utils.ts +18 -1
@@ -132,6 +132,15 @@ const checkReleaseVersionInBeta = (releaseVersion, suppressBetaWarning) => {
132
132
  return !suppressBetaWarning && isBetaVersion;
133
133
  }
134
134
  return false;
135
+ };
136
+ const getCustomisations = (embedConfig) => {
137
+ const { customCssUrl } = embedConfig;
138
+ let { customisations } = embedConfig;
139
+ customisations = customisations || {};
140
+ customisations.style = customisations.style || {};
141
+ customisations.style.customCSSUrl =
142
+ customisations.style.customCSSUrl || customCssUrl;
143
+ return customisations;
135
144
  };
136
145
 
137
146
  /**
@@ -155,8 +164,13 @@ var AuthType;
155
164
  AuthType["None"] = "None";
156
165
  /**
157
166
  * SSO using SAML
167
+ * @deprecated Use {@link SAML} instead
158
168
  */
159
169
  AuthType["SSO"] = "SSO_SAML";
170
+ /**
171
+ * SSO using SAML
172
+ */
173
+ AuthType["SAML"] = "SSO_SAML";
160
174
  /**
161
175
  * SSO using OIDC
162
176
  */
@@ -483,6 +497,65 @@ var EmbedEvent;
483
497
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
484
498
  */
485
499
  EmbedEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
500
+ /**
501
+ *
502
+ */
503
+ EmbedEvent["APP_INIT"] = "appInit";
504
+ /**
505
+ * Emitted when a user clicks Show Liveboard details on a Liveboard
506
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
507
+ */
508
+ EmbedEvent["LiveboardInfo"] = "pinboardInfo";
509
+ /**
510
+ * Emitted when a user clicks on the Favorite icon on a Liveboard
511
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
512
+ */
513
+ EmbedEvent["AddToFavorites"] = "addToFavorites";
514
+ /**
515
+ * Emitted when a user clicks Schedule on a Liveboard
516
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
517
+ */
518
+ EmbedEvent["Schedule"] = "subscription";
519
+ /**
520
+ * Emitted when a user clicks Edit on a Liveboard or visualization
521
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
522
+ */
523
+ EmbedEvent["Edit"] = "edit";
524
+ /**
525
+ * Emitted when a user clicks Make a copy on a Liveboard
526
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
527
+ */
528
+ EmbedEvent["MakeACopy"] = "makeACopy";
529
+ /**
530
+ * Emitted when a user clicks Present on a Liveboard or visualization
531
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
532
+ */
533
+ EmbedEvent["Present"] = "present";
534
+ /**
535
+ * Emitted when a user clicks Delete on a Liveboard
536
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
537
+ */
538
+ EmbedEvent["Delete"] = "delete";
539
+ /**
540
+ * Emitted when a user clicks Manage schedules on a Liveboard
541
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
542
+ */
543
+ EmbedEvent["SchedulesList"] = "schedule-list";
544
+ /**
545
+ * Emitted when a user clicks Cancel in edit mode on a Liveboard
546
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
547
+ */
548
+ EmbedEvent["Cancel"] = "cancel";
549
+ /**
550
+ * Emitted when a user clicks Explore on a visualization
551
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
552
+ */
553
+ EmbedEvent["Explore"] = "explore";
554
+ /**
555
+ * Emitted when a user clicks Copy link action on a visualization
556
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
557
+ */
558
+ EmbedEvent["CopyLink"] = "copyLink";
486
559
  })(EmbedEvent || (EmbedEvent = {}));
487
560
  /**
488
561
  * Event types that can be triggered by the host application
@@ -546,12 +619,106 @@ var HostEvent;
546
619
  */
547
620
  HostEvent["getExportRequestForCurrentPinboard"] = "getExportRequestForCurrentPinboard";
548
621
  /**
549
- * Fires the pin action on an embedded object
550
- * @param - incase of liveboard embed, takes in an object with vizId as a key
551
- * can be left empty for search and viz embeds
622
+ * Triggers the Pin action on an embedded object
623
+ * @param - incase of Liveboard embed, takes in an object with vizId as a key
624
+ * can be left empty for search and visualization embeds
552
625
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
553
626
  */
554
627
  HostEvent["Pin"] = "pin";
628
+ /**
629
+ * Triggers the Show Liveboard details action on a Liveboard
630
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
631
+ */
632
+ HostEvent["LiveboardInfo"] = "pinboardInfo";
633
+ /**
634
+ * Triggers the Schedule action on a Liveboard
635
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
636
+ */
637
+ HostEvent["Schedule"] = "subscription";
638
+ /**
639
+ * Triggers the Manage schedule action on a Liveboard
640
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
641
+ */
642
+ HostEvent["SchedulesList"] = "schedule-list";
643
+ /**
644
+ * Triggers the Export TML action on a Liveboard
645
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
646
+ */
647
+ HostEvent["ExportTML"] = "exportTSL";
648
+ /**
649
+ * Triggers the Edit TML action on a Liveboard
650
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
651
+ */
652
+ HostEvent["EditTML"] = "editTSL";
653
+ /**
654
+ * Triggers the Update TML action on a Liveboard
655
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
656
+ */
657
+ HostEvent["UpdateTML"] = "updateTSL";
658
+ /**
659
+ * Triggers the Download PDF action on a Liveboard
660
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
661
+ */
662
+ HostEvent["DownloadAsPdf"] = "downloadAsPdf";
663
+ /**
664
+ * Triggers the Make a copy action on a Liveboard
665
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
666
+ */
667
+ HostEvent["MakeACopy"] = "makeACopy";
668
+ /**
669
+ * Triggers the Delete action on a Liveboard
670
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
671
+ */
672
+ HostEvent["Remove"] = "delete";
673
+ /**
674
+ * Triggers the Explore action on a visualization
675
+ * @param - an object with vizId as a key
676
+ * eg: {vizId: '730496d6-6903-4601-937e-2c691821af3c'}
677
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
678
+ */
679
+ HostEvent["Explore"] = "explore";
680
+ /**
681
+ * Triggers the Create alert action on a visualization
682
+ * @param - an object with vizId as a key
683
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
684
+ */
685
+ HostEvent["CreateMonitor"] = "createMonitor";
686
+ /**
687
+ * Triggers the Manage alert action on a visualization
688
+ * @param - an object with vizId as a key
689
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
690
+ */
691
+ HostEvent["ManageMonitor"] = "manageMonitor";
692
+ /**
693
+ * Triggers the Edit action on a Liveboard or visualization
694
+ * @param - object - to trigger the action for a specfic visualization in Liveboard embed, pass in vizId as a key
695
+ * @example
696
+ * liveboardEmbed.trigger(HostEvent.Edit)
697
+ * liveboardEmbed.trigger(HostEvent.Edit, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
698
+ * vizEmbed.trigger((HostEvent.Edit)
699
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
700
+ */
701
+ HostEvent["Edit"] = "edit";
702
+ /**
703
+ * Triggers the Copy link action on a Liveboard or visualization
704
+ * @param - object - to trigger the action for a specfic visualization in Liveboard embed, pass in vizId as a key
705
+ * @example
706
+ * liveboardEmbed.trigger(HostEvent.CopyLink)
707
+ * liveboardEmbed.trigger(HostEvent.CopyLink, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
708
+ * vizEmbed.trigger((HostEvent.CopyLink)
709
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
710
+ */
711
+ HostEvent["CopyLink"] = "embedDocument";
712
+ /**
713
+ * Triggers the Present action on a Liveboard or visualization
714
+ * @param - object - to trigger the action for a specfic visualization in Liveboard embed, pass in vizId as a key
715
+ * @example
716
+ * liveboardEmbed.trigger(HostEvent.Present)
717
+ * liveboardEmbed.trigger(HostEvent.Present, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
718
+ * vizEmbed.trigger((HostEvent.Present)
719
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
720
+ */
721
+ HostEvent["Present"] = "present";
555
722
  })(HostEvent || (HostEvent = {}));
556
723
  /**
557
724
  * The different visual modes that the data sources panel within
@@ -600,6 +767,7 @@ var Param;
600
767
  Param["fullHeight"] = "isFullHeightPinboard";
601
768
  Param["livedBoardEmbed"] = "isLiveboardEmbed";
602
769
  Param["searchEmbed"] = "isSearchEmbed";
770
+ Param["vizEmbed"] = "isVizEmbed";
603
771
  Param["Version"] = "sdkVersion";
604
772
  Param["ViewPortHeight"] = "viewPortHeight";
605
773
  Param["ViewPortWidth"] = "viewPortWidth";
@@ -610,6 +778,7 @@ var Param;
610
778
  Param["LiveboardV2Enabled"] = "isPinboardV2Enabled";
611
779
  Param["ShowAlerts"] = "showAlerts";
612
780
  Param["Locale"] = "locale";
781
+ Param["CustomStyle"] = "customStyle";
613
782
  })(Param || (Param = {}));
614
783
  /**
615
784
  * The list of actions that can be performed on visual ThoughtSpot
@@ -7276,8 +7445,21 @@ var AuthFailureType;
7276
7445
  })(AuthFailureType || (AuthFailureType = {}));
7277
7446
  var AuthStatus;
7278
7447
  (function (AuthStatus) {
7448
+ /**
7449
+ * Emits when the SDK fails to authenticate
7450
+ */
7279
7451
  AuthStatus["FAILURE"] = "FAILURE";
7452
+ /**
7453
+ * Emits when the SDK succeeds to authenticate
7454
+ */
7455
+ AuthStatus["SDK_SUCCESS"] = "SDK_SUCCESS";
7456
+ /**
7457
+ * Emits when the App sends a auth success
7458
+ */
7280
7459
  AuthStatus["SUCCESS"] = "SUCCESS";
7460
+ /**
7461
+ * Emits when there is a logout
7462
+ */
7281
7463
  AuthStatus["LOGOUT"] = "LOGOUT";
7282
7464
  })(AuthStatus || (AuthStatus = {}));
7283
7465
  /**
@@ -7479,6 +7661,7 @@ const authenticate = async (embedConfig) => {
7479
7661
  const { authType } = embedConfig;
7480
7662
  switch (authType) {
7481
7663
  case AuthType.SSO:
7664
+ case AuthType.SAML:
7482
7665
  return doSamlAuth(embedConfig);
7483
7666
  case AuthType.OIDC:
7484
7667
  return doOIDCAuth(embedConfig);
@@ -7501,6 +7684,13 @@ let authPromise;
7501
7684
  const getEmbedConfig = () => config;
7502
7685
  const getAuthPromise = () => authPromise;
7503
7686
  let authEE;
7687
+ function notifyAuthSDKSuccess() {
7688
+ if (!authEE) {
7689
+ console.error('SDK not initialized');
7690
+ return;
7691
+ }
7692
+ authEE.emit(AuthStatus.SDK_SUCCESS);
7693
+ }
7504
7694
  function notifyAuthSuccess() {
7505
7695
  if (!authEE) {
7506
7696
  console.error('SDK not initialized');
@@ -7531,6 +7721,9 @@ const handleAuth = () => {
7531
7721
  if (!isLoggedIn) {
7532
7722
  notifyAuthFailure(AuthFailureType.SDK);
7533
7723
  }
7724
+ else {
7725
+ notifyAuthSDKSuccess();
7726
+ }
7534
7727
  }, () => {
7535
7728
  notifyAuthFailure(AuthFailureType.SDK);
7536
7729
  });
@@ -7794,7 +7987,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
7794
7987
  });
7795
7988
  }
7796
7989
 
7797
- var name="@thoughtspot/visual-embed-sdk";var version="1.13.0-alpha.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/**"];var exports={".":"./lib/src/index.js","./react":"./lib/src/react/index.js"};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false",start:"gatsby develop","build:gatsby":"npm run clean:gatsby && gatsby build --prefix-paths","build:gatsby:noprefix":"npm run clean:gatsby && gatsby build","serve:gatsby":"gatsby serve","clean:gatsby":"gatsby clean","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts",build:"rollup -c",watch:"rollup -cw","docs-cmd":"node scripts/gatsby-commands.js",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme","test-sdk":"jest -c jest.config.sdk.js","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs && npx istanbul-merge --out ./coverage/coverage.json ./coverage/docs/coverage-final.json ./coverage/sdk/coverage-final.json && npx istanbul report --include ./coverage/coverage.json --dir ./coverage lcov",posttest:"cat ./coverage/sdk/lcov.info | coveralls",prepublishOnly:"npm run test; npm run tsc; npm run bundle-dts; npm run build","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",eventemitter3:"^4.0.7","html-react-parser":"^1.4.12","mixpanel-browser":"^2.45.0","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","@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/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","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",gatsby:"3.1.0","gatsby-plugin-algolia":"^0.22.2","gatsby-plugin-catch-links":"^3.1.0","gatsby-plugin-env-variables":"^2.1.0","gatsby-plugin-intl":"^0.3.3","gatsby-plugin-manifest":"^3.2.0","gatsby-plugin-output":"^0.1.3","gatsby-plugin-sass":"4.1.0","gatsby-plugin-sitemap":"^4.10.0","gatsby-source-filesystem":"3.1.0","gatsby-transformer-asciidoc":"2.1.0","gatsby-transformer-rehype":"2.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-puppeteer":"^4.4.0",jsdom:"^17.0.0","node-sass":"^4.0.0",prettier:"2.1.2",puppeteer:"^7.0.1",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-neo-theme":"^1.1.0","typedoc-plugin-toc-group":"0.0.5",typescript:"^4.1.0","url-search-params-polyfill":"^8.1.0",util:"^0.12.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","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,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};
7990
+ var name="@thoughtspot/visual-embed-sdk";var version="1.13.0-alpha.4";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/**"];var exports={".":"./lib/src/index.js","./react":"./lib/src/react/index.js"};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false",start:"gatsby develop","build:gatsby":"npm run clean:gatsby && gatsby build --prefix-paths","build:gatsby:noprefix":"npm run clean:gatsby && gatsby build","serve:gatsby":"gatsby serve","clean:gatsby":"gatsby clean","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts",build:"rollup -c",watch:"rollup -cw","docs-cmd":"node scripts/gatsby-commands.js",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme","test-sdk":"jest -c jest.config.sdk.js","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs && npx istanbul-merge --out ./coverage/coverage.json ./coverage/docs/coverage-final.json ./coverage/sdk/coverage-final.json && npx istanbul report --include ./coverage/coverage.json --dir ./coverage lcov",posttest:"cat ./coverage/sdk/lcov.info | coveralls",prepublishOnly:"npm run test; npm run tsc; npm run bundle-dts; npm run build","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",eventemitter3:"^4.0.7","html-react-parser":"^1.4.12","mixpanel-browser":"^2.45.0","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","@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/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","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",gatsby:"3.1.0","gatsby-plugin-algolia":"^0.22.2","gatsby-plugin-catch-links":"^3.1.0","gatsby-plugin-env-variables":"^2.1.0","gatsby-plugin-intl":"^0.3.3","gatsby-plugin-manifest":"^3.2.0","gatsby-plugin-output":"^0.1.3","gatsby-plugin-sass":"4.1.0","gatsby-plugin-sitemap":"^4.10.0","gatsby-source-filesystem":"3.1.0","gatsby-transformer-asciidoc":"2.1.0","gatsby-transformer-rehype":"2.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-puppeteer":"^4.4.0",jsdom:"^17.0.0","node-sass":"^4.0.0",prettier:"2.1.2",puppeteer:"^7.0.1",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-neo-theme":"^1.1.0","typedoc-plugin-toc-group":"0.0.5",typescript:"^4.1.0","url-search-params-polyfill":"^8.1.0",util:"^0.12.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","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,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};
7798
7991
 
7799
7992
  /**
7800
7993
  * Copyright (c) 2022
@@ -7833,6 +8026,21 @@ class TsEmbed {
7833
8026
  */
7834
8027
  this.shouldEncodeUrlQueryParams = false;
7835
8028
  this.defaultHiddenActions = [Action.ReportError];
8029
+ /**
8030
+ * Send Custom style as part of payload of APP_INIT
8031
+ */
8032
+ this.appInitCb = (_, responder) => {
8033
+ responder({
8034
+ type: EmbedEvent.APP_INIT,
8035
+ data: { customisations: getCustomisations(this.embedConfig) },
8036
+ });
8037
+ };
8038
+ /**
8039
+ * Register APP_INIT event and sendback init payload
8040
+ */
8041
+ this.registerAppInit = () => {
8042
+ this.on(EmbedEvent.APP_INIT, this.appInitCb);
8043
+ };
7836
8044
  this.el = this.getDOMNode(domSelector);
7837
8045
  // TODO: handle error
7838
8046
  this.embedConfig = getEmbedConfig();
@@ -7842,6 +8050,7 @@ class TsEmbed {
7842
8050
  this.isError = false;
7843
8051
  this.viewConfig = viewConfig;
7844
8052
  this.shouldEncodeUrlQueryParams = this.embedConfig.shouldEncodeUrlQueryParams;
8053
+ this.registerAppInit();
7845
8054
  }
7846
8055
  /**
7847
8056
  * Gets a reference to the root DOM node where
@@ -7961,6 +8170,7 @@ class TsEmbed {
7961
8170
  this.embedConfig.autoLogin === true) {
7962
8171
  queryParams[Param.DisableLoginRedirect] = true;
7963
8172
  }
8173
+ // TODO remove this
7964
8174
  if (this.embedConfig.customCssUrl) {
7965
8175
  queryParams[Param.CustomCSSUrl] = this.embedConfig.customCssUrl;
7966
8176
  }
@@ -8000,11 +8210,12 @@ class TsEmbed {
8000
8210
  * @param isAppEmbed A Boolean parameter to specify if you are embedding
8001
8211
  * the full application.
8002
8212
  */
8003
- getV1EmbedBasePath(queryString, showPrimaryNavbar = false, disableProfileAndHelp = false, isAppEmbed = false) {
8213
+ getV1EmbedBasePath(queryString, showPrimaryNavbar = false, disableProfileAndHelp = false, isAppEmbed = false, enableSearchAssist = false) {
8004
8214
  const queryStringFrag = queryString ? `&${queryString}` : '';
8005
8215
  const primaryNavParam = `&primaryNavHidden=${!showPrimaryNavbar}`;
8006
8216
  const disableProfileAndHelpParam = `&profileAndHelpInNavBarHidden=${disableProfileAndHelp}`;
8007
- let queryParams = `?embedApp=true${isAppEmbed ? primaryNavParam : ''}${isAppEmbed ? disableProfileAndHelpParam : ''}${queryStringFrag}`;
8217
+ const enableSearchAssistParam = `&${Param.EnableSearchAssist}=${enableSearchAssist}`;
8218
+ let queryParams = `?embedApp=true${isAppEmbed ? primaryNavParam : ''}${isAppEmbed ? disableProfileAndHelpParam : ''}${enableSearchAssist ? enableSearchAssistParam : ''}${queryStringFrag}`;
8008
8219
  if (this.shouldEncodeUrlQueryParams) {
8009
8220
  queryParams = `?base64UrlEncodedFlags=${getEncodedQueryParamsString(queryParams.substr(1))}`;
8010
8221
  }
@@ -8366,7 +8577,7 @@ class AppEmbed extends V1Embed {
8366
8577
  const queryString = [filterQuery, queryParams]
8367
8578
  .filter(Boolean)
8368
8579
  .join('&');
8369
- let url = `${this.getV1EmbedBasePath(queryString, this.viewConfig.showPrimaryNavbar, this.viewConfig.disableProfileAndHelp, true)}/${pageId}`;
8580
+ let url = `${this.getV1EmbedBasePath(queryString, this.viewConfig.showPrimaryNavbar, this.viewConfig.disableProfileAndHelp, true, this.viewConfig.enableSearchAssist)}/${pageId}`;
8370
8581
  const tsPostHashParams = this.getThoughtSpotPostUrlParams();
8371
8582
  url = `${url}${tsPostHashParams}`;
8372
8583
  return url;
@@ -8494,7 +8705,7 @@ class LiveboardEmbed extends V1Embed {
8494
8705
  */
8495
8706
  getEmbedParams() {
8496
8707
  const params = this.getBaseQueryParams();
8497
- const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2 = false, } = this.viewConfig;
8708
+ const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2 = false, vizId, } = this.viewConfig;
8498
8709
  const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval ||
8499
8710
  this.viewConfig.preventPinboardFilterRemoval;
8500
8711
  if (fullHeight === true) {
@@ -8513,6 +8724,9 @@ class LiveboardEmbed extends V1Embed {
8513
8724
  params[Param.visibleVizs] = visibleVizs;
8514
8725
  }
8515
8726
  params[Param.livedBoardEmbed] = true;
8727
+ if (vizId) {
8728
+ params[Param.vizEmbed] = true;
8729
+ }
8516
8730
  params[Param.LiveboardV2Enabled] = liveboardV2;
8517
8731
  const queryParams = getQueryParamString(params, true);
8518
8732
  return queryParams;