@thoughtspot/visual-embed-sdk 1.45.3 → 1.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/package.json +1 -1
- package/cjs/src/auth.d.ts +35 -2
- package/cjs/src/auth.d.ts.map +1 -1
- package/cjs/src/auth.js +35 -2
- package/cjs/src/auth.js.map +1 -1
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +5 -5
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +87 -119
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +1 -1
- package/cjs/src/types.d.ts +56 -52
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +55 -51
- package/cjs/src/types.js.map +1 -1
- package/dist/{index-BuwECGdm.js → index-BQvLEoxp.js} +1 -1
- package/dist/src/auth.d.ts +35 -2
- package/dist/src/auth.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +1 -1
- package/dist/src/types.d.ts +56 -52
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +98 -61
- package/dist/tsembed-react.js +97 -60
- package/dist/tsembed.es.js +98 -61
- package/dist/tsembed.js +97 -60
- package/dist/visual-embed-sdk-react-full.d.ts +92 -55
- package/dist/visual-embed-sdk-react.d.ts +90 -53
- package/dist/visual-embed-sdk.d.ts +92 -55
- package/lib/package.json +1 -1
- package/lib/src/auth.d.ts +35 -2
- package/lib/src/auth.d.ts.map +1 -1
- package/lib/src/auth.js +35 -2
- package/lib/src/auth.js.map +1 -1
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +5 -5
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +87 -119
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +1 -1
- package/lib/src/types.d.ts +56 -52
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +55 -51
- package/lib/src/types.js.map +1 -1
- package/package.json +1 -1
- package/src/auth.ts +35 -2
- package/src/embed/app.spec.ts +171 -211
- package/src/embed/app.ts +15 -10
- package/src/embed/conversation.ts +1 -1
- package/src/types.ts +57 -53
package/dist/tsembed-react.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.46.0 */
|
|
2
2
|
'use client';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import React__default, { useRef, useCallback } from 'react';
|
|
@@ -1501,65 +1501,69 @@ var EmbedEvent;
|
|
|
1501
1501
|
EmbedEvent["Rename"] = "rename";
|
|
1502
1502
|
/**
|
|
1503
1503
|
*
|
|
1504
|
-
* This event
|
|
1505
|
-
*
|
|
1506
|
-
*
|
|
1507
|
-
*
|
|
1508
|
-
|
|
1509
|
-
*
|
|
1510
|
-
*
|
|
1511
|
-
*
|
|
1504
|
+
* This event allows developers to intercept search execution
|
|
1505
|
+
* and implement logic that decides whether Search Data should return
|
|
1506
|
+
* data or block the search operation.
|
|
1507
|
+
*
|
|
1508
|
+
* **Prerequisite**: Set`isOnBeforeGetVizDataInterceptEnabled` to `true`
|
|
1509
|
+
* to ensure that `EmbedEvent.OnBeforeGetVizDataIntercept` is emitted
|
|
1510
|
+
* when the embedding application user tries to run a search query.
|
|
1511
|
+
*
|
|
1512
|
+
* This framework applies only to `AppEmbed` and `SearchEmbed`.
|
|
1513
|
+
* @param - Includes the following parameters:
|
|
1512
1514
|
* - `payload`: The payload received from the embed related to the Data API call.
|
|
1513
1515
|
* - `responder`: Contains elements that let developers define whether ThoughtSpot
|
|
1514
|
-
*
|
|
1515
|
-
* should be shown to the user.
|
|
1516
|
-
*
|
|
1517
|
-
* `execute` - When `execute` returns `true`, the search will be run.
|
|
1518
|
-
* When `execute` returns `false`, the search will not be executed.
|
|
1516
|
+
* will run or block the search operation, and if blocked, which error message to provide.
|
|
1519
1517
|
*
|
|
1520
|
-
* `
|
|
1521
|
-
*
|
|
1518
|
+
* `execute` - When `execute` returns `true`, the search is run.
|
|
1519
|
+
* When `execute` returns `false`, the search is not executed.
|
|
1522
1520
|
*
|
|
1523
|
-
* `
|
|
1524
|
-
* `
|
|
1521
|
+
* `error` - Developers can customize the user-facing error message when `execute`
|
|
1522
|
+
* is `false` by using the `error` parameters in `responder`.
|
|
1523
|
+
* `errorText` - The error message text shown to the user.
|
|
1525
1524
|
* @version SDK : 1.29.0 | ThoughtSpot: 10.3.0.cl
|
|
1526
1525
|
* @example
|
|
1527
|
-
|
|
1528
|
-
*
|
|
1529
|
-
*
|
|
1530
|
-
*
|
|
1531
|
-
*
|
|
1532
|
-
*
|
|
1533
|
-
*
|
|
1534
|
-
*
|
|
1535
|
-
*
|
|
1536
|
-
*
|
|
1537
|
-
*
|
|
1538
|
-
*
|
|
1539
|
-
*
|
|
1540
|
-
* })
|
|
1526
|
+
*
|
|
1527
|
+
* This example blocks search operation and returns a custom error message:
|
|
1528
|
+
* ```js
|
|
1529
|
+
* embed.on(EmbedEvent.OnBeforeGetVizDataIntercept, (payload, responder) => {
|
|
1530
|
+
* responder({
|
|
1531
|
+
* data: {
|
|
1532
|
+
* execute: false,
|
|
1533
|
+
* error: {
|
|
1534
|
+
* // Provide a custom error message to explain why the search did not run.
|
|
1535
|
+
* errorText: 'This search query cannot be run. Please contact your administrator for more details.',
|
|
1536
|
+
* },
|
|
1537
|
+
* },
|
|
1538
|
+
* });
|
|
1539
|
+
* });
|
|
1541
1540
|
* ```
|
|
1541
|
+
* @example
|
|
1542
1542
|
*
|
|
1543
|
-
|
|
1544
|
-
*
|
|
1545
|
-
*
|
|
1546
|
-
*
|
|
1547
|
-
* responder
|
|
1548
|
-
*
|
|
1549
|
-
*
|
|
1550
|
-
*
|
|
1551
|
-
*
|
|
1552
|
-
*
|
|
1553
|
-
*
|
|
1554
|
-
*
|
|
1555
|
-
*
|
|
1556
|
-
*
|
|
1557
|
-
*
|
|
1558
|
-
*
|
|
1559
|
-
*
|
|
1560
|
-
*
|
|
1561
|
-
*
|
|
1562
|
-
|
|
1543
|
+
* This example allows the search operation to run
|
|
1544
|
+
* unless the query contains both `sales` and `county`,
|
|
1545
|
+
* and returns a custom error message if the query is rejected:
|
|
1546
|
+
* ```js
|
|
1547
|
+
* embed.on(EmbedEvent.OnBeforeGetVizDataIntercept, (payload, responder) => {
|
|
1548
|
+
* // Record the search query submitted by the end user.
|
|
1549
|
+
* const query = payload.data.data.answer.search_query;
|
|
1550
|
+
*
|
|
1551
|
+
* responder({
|
|
1552
|
+
* data: {
|
|
1553
|
+
* // Returns true as long as the query does not include both `sales` and `county`.
|
|
1554
|
+
* execute: !(query.includes('sales') && query.includes('county')),
|
|
1555
|
+
* error: {
|
|
1556
|
+
* // Provide a custom error message when the query is blocked by your logic.
|
|
1557
|
+
* errorText:
|
|
1558
|
+
* "You can't use this query: "
|
|
1559
|
+
* + query
|
|
1560
|
+
* + ". The 'sales' measure can never be used at the 'county' level. "
|
|
1561
|
+
* + "Please try another measure or remove 'county' from your search.",
|
|
1562
|
+
* },
|
|
1563
|
+
* },
|
|
1564
|
+
* });
|
|
1565
|
+
* });
|
|
1566
|
+
* ```
|
|
1563
1567
|
*/
|
|
1564
1568
|
EmbedEvent["OnBeforeGetVizDataIntercept"] = "onBeforeGetVizDataIntercept";
|
|
1565
1569
|
/**
|
|
@@ -9068,7 +9072,7 @@ class AnswerService {
|
|
|
9068
9072
|
async getTML() {
|
|
9069
9073
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
9070
9074
|
const edoc = object[0].edoc;
|
|
9071
|
-
const YAML = await import('./index-
|
|
9075
|
+
const YAML = await import('./index-BQvLEoxp.js');
|
|
9072
9076
|
const parsedDoc = YAML.parse(edoc);
|
|
9073
9077
|
return {
|
|
9074
9078
|
answer: {
|
|
@@ -17506,17 +17510,50 @@ let samlCompletionPromise = null;
|
|
|
17506
17510
|
let releaseVersion = '';
|
|
17507
17511
|
const SSO_REDIRECTION_MARKER_GUID = '5e16222e-ef02-43e9-9fbd-24226bf3ce5b';
|
|
17508
17512
|
/**
|
|
17509
|
-
* Enum for auth failure types.
|
|
17510
|
-
*
|
|
17513
|
+
* Enum for auth failure types.
|
|
17514
|
+
* This value is passed to the listener for {@link AuthStatus.FAILURE}.
|
|
17511
17515
|
* @group Authentication / Init
|
|
17512
17516
|
*/
|
|
17513
17517
|
var AuthFailureType;
|
|
17514
17518
|
(function (AuthFailureType) {
|
|
17519
|
+
/**
|
|
17520
|
+
* Authentication failed in the SDK authentication flow.
|
|
17521
|
+
*
|
|
17522
|
+
* Emitted when `init()` or auto-authentication cannot establish a logged-in session.
|
|
17523
|
+
* For example, this can happen because of an invalid token, an auth request failure,
|
|
17524
|
+
* or an auth promise rejection.
|
|
17525
|
+
*/
|
|
17515
17526
|
AuthFailureType["SDK"] = "SDK";
|
|
17527
|
+
/**
|
|
17528
|
+
* Browser cookie access is blocked for the embedded app.
|
|
17529
|
+
*
|
|
17530
|
+
* Emitted when the iframe reports that required cookies
|
|
17531
|
+
* cannot be read or sent, commonly due to third-party cookie restrictions.
|
|
17532
|
+
*/
|
|
17516
17533
|
AuthFailureType["NO_COOKIE_ACCESS"] = "NO_COOKIE_ACCESS";
|
|
17534
|
+
/**
|
|
17535
|
+
* The current authentication token or session has expired.
|
|
17536
|
+
*
|
|
17537
|
+
* Emitted when the embed receives an auth-expiry signal and starts auth refresh handling.
|
|
17538
|
+
*/
|
|
17517
17539
|
AuthFailureType["EXPIRY"] = "EXPIRY";
|
|
17540
|
+
/**
|
|
17541
|
+
* A generic authentication failure that does not match a more specific type.
|
|
17542
|
+
*
|
|
17543
|
+
* Emitted as a fallback for app-reported auth failures in standard auth flows.
|
|
17544
|
+
*/
|
|
17518
17545
|
AuthFailureType["OTHER"] = "OTHER";
|
|
17546
|
+
/**
|
|
17547
|
+
* The user session timed out due to inactivity.
|
|
17548
|
+
*
|
|
17549
|
+
* Emitted when the app reports an idle-session timeout.
|
|
17550
|
+
*/
|
|
17519
17551
|
AuthFailureType["IDLE_SESSION_TIMEOUT"] = "IDLE_SESSION_TIMEOUT";
|
|
17552
|
+
/**
|
|
17553
|
+
* The app reports that the user is unauthenticated.
|
|
17554
|
+
*
|
|
17555
|
+
* Used primarily to classify unauthenticated failures in Embedded SSO flows.
|
|
17556
|
+
*/
|
|
17520
17557
|
AuthFailureType["UNAUTHENTICATED_FAILURE"] = "UNAUTHENTICATED_FAILURE";
|
|
17521
17558
|
})(AuthFailureType || (AuthFailureType = {}));
|
|
17522
17559
|
/**
|
|
@@ -18327,7 +18364,7 @@ function processEventData(type, eventData, thoughtSpotHost, containerEl) {
|
|
|
18327
18364
|
return eventData;
|
|
18328
18365
|
}
|
|
18329
18366
|
|
|
18330
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.
|
|
18367
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.46.0";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 tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.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 | npx coveralls-next","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={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.23","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":"^11.2.0","@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":"^30.0.0","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^30.2.0","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1","coveralls-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle-generator":"^9.5.1",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^2.0.0",jest:"^30.2.0","jest-environment-jsdom":"^29.7.0","jest-fetch-mock":"^3.0.3",jsdom:"^17.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":"^29.4.6","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};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:"32 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};
|
|
18331
18368
|
|
|
18332
18369
|
class HostEventClient {
|
|
18333
18370
|
constructor(iFrame) {
|
|
@@ -20773,6 +20810,9 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
20773
20810
|
else {
|
|
20774
20811
|
params[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
|
|
20775
20812
|
}
|
|
20813
|
+
if (modularHomeExperience !== undefined) {
|
|
20814
|
+
params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
|
|
20815
|
+
}
|
|
20776
20816
|
// Set navigation to v2 by default to avoid problems like the app
|
|
20777
20817
|
// switcher (9-dot menu) not showing when v3 navigation is turned on
|
|
20778
20818
|
// at the cluster level.
|
|
@@ -20782,9 +20822,6 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
20782
20822
|
// Set homePageVersion to v2 by default to reset the LD flag value
|
|
20783
20823
|
// for the homepageVersion.
|
|
20784
20824
|
params[Param.HomepageVersion] = 'v2';
|
|
20785
|
-
// Set listpageVersion to v2 by default to reset the LD flag value
|
|
20786
|
-
// for the listpageVersion.
|
|
20787
|
-
params[Param.ListPageVersion] = ListPage.List;
|
|
20788
20825
|
if (discoveryExperience) {
|
|
20789
20826
|
// primaryNavbarVersion v3 will enabled the new left navigation
|
|
20790
20827
|
if (discoveryExperience.primaryNavbarVersion === PrimaryNavbarVersion.Sliding) {
|
|
@@ -20803,8 +20840,8 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
20803
20840
|
if (discoveryExperience.homePage === HomePage.ModularWithStylingChanges) {
|
|
20804
20841
|
params[Param.HomepageVersion] = HomePage.ModularWithStylingChanges;
|
|
20805
20842
|
}
|
|
20806
|
-
// listPageVersion
|
|
20807
|
-
if (discoveryExperience.listPageVersion
|
|
20843
|
+
// listPageVersion can be changed to v2 or v3
|
|
20844
|
+
if (discoveryExperience.listPageVersion !== undefined) {
|
|
20808
20845
|
params[Param.ListPageVersion] = discoveryExperience.listPageVersion;
|
|
20809
20846
|
}
|
|
20810
20847
|
}
|
package/dist/tsembed-react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.46.0 */
|
|
2
2
|
'use client';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
|
|
@@ -1523,65 +1523,69 @@
|
|
|
1523
1523
|
EmbedEvent["Rename"] = "rename";
|
|
1524
1524
|
/**
|
|
1525
1525
|
*
|
|
1526
|
-
* This event
|
|
1527
|
-
*
|
|
1528
|
-
*
|
|
1529
|
-
*
|
|
1530
|
-
|
|
1531
|
-
*
|
|
1532
|
-
*
|
|
1533
|
-
*
|
|
1526
|
+
* This event allows developers to intercept search execution
|
|
1527
|
+
* and implement logic that decides whether Search Data should return
|
|
1528
|
+
* data or block the search operation.
|
|
1529
|
+
*
|
|
1530
|
+
* **Prerequisite**: Set`isOnBeforeGetVizDataInterceptEnabled` to `true`
|
|
1531
|
+
* to ensure that `EmbedEvent.OnBeforeGetVizDataIntercept` is emitted
|
|
1532
|
+
* when the embedding application user tries to run a search query.
|
|
1533
|
+
*
|
|
1534
|
+
* This framework applies only to `AppEmbed` and `SearchEmbed`.
|
|
1535
|
+
* @param - Includes the following parameters:
|
|
1534
1536
|
* - `payload`: The payload received from the embed related to the Data API call.
|
|
1535
1537
|
* - `responder`: Contains elements that let developers define whether ThoughtSpot
|
|
1536
|
-
*
|
|
1537
|
-
* should be shown to the user.
|
|
1538
|
-
*
|
|
1539
|
-
* `execute` - When `execute` returns `true`, the search will be run.
|
|
1540
|
-
* When `execute` returns `false`, the search will not be executed.
|
|
1538
|
+
* will run or block the search operation, and if blocked, which error message to provide.
|
|
1541
1539
|
*
|
|
1542
|
-
* `
|
|
1543
|
-
*
|
|
1540
|
+
* `execute` - When `execute` returns `true`, the search is run.
|
|
1541
|
+
* When `execute` returns `false`, the search is not executed.
|
|
1544
1542
|
*
|
|
1545
|
-
* `
|
|
1546
|
-
* `
|
|
1543
|
+
* `error` - Developers can customize the user-facing error message when `execute`
|
|
1544
|
+
* is `false` by using the `error` parameters in `responder`.
|
|
1545
|
+
* `errorText` - The error message text shown to the user.
|
|
1547
1546
|
* @version SDK : 1.29.0 | ThoughtSpot: 10.3.0.cl
|
|
1548
1547
|
* @example
|
|
1549
|
-
|
|
1550
|
-
*
|
|
1551
|
-
*
|
|
1552
|
-
*
|
|
1553
|
-
*
|
|
1554
|
-
*
|
|
1555
|
-
*
|
|
1556
|
-
*
|
|
1557
|
-
*
|
|
1558
|
-
*
|
|
1559
|
-
*
|
|
1560
|
-
*
|
|
1561
|
-
*
|
|
1562
|
-
* })
|
|
1548
|
+
*
|
|
1549
|
+
* This example blocks search operation and returns a custom error message:
|
|
1550
|
+
* ```js
|
|
1551
|
+
* embed.on(EmbedEvent.OnBeforeGetVizDataIntercept, (payload, responder) => {
|
|
1552
|
+
* responder({
|
|
1553
|
+
* data: {
|
|
1554
|
+
* execute: false,
|
|
1555
|
+
* error: {
|
|
1556
|
+
* // Provide a custom error message to explain why the search did not run.
|
|
1557
|
+
* errorText: 'This search query cannot be run. Please contact your administrator for more details.',
|
|
1558
|
+
* },
|
|
1559
|
+
* },
|
|
1560
|
+
* });
|
|
1561
|
+
* });
|
|
1563
1562
|
* ```
|
|
1563
|
+
* @example
|
|
1564
1564
|
*
|
|
1565
|
-
|
|
1566
|
-
*
|
|
1567
|
-
*
|
|
1568
|
-
*
|
|
1569
|
-
* responder
|
|
1570
|
-
*
|
|
1571
|
-
*
|
|
1572
|
-
*
|
|
1573
|
-
*
|
|
1574
|
-
*
|
|
1575
|
-
*
|
|
1576
|
-
*
|
|
1577
|
-
*
|
|
1578
|
-
*
|
|
1579
|
-
*
|
|
1580
|
-
*
|
|
1581
|
-
*
|
|
1582
|
-
*
|
|
1583
|
-
*
|
|
1584
|
-
|
|
1565
|
+
* This example allows the search operation to run
|
|
1566
|
+
* unless the query contains both `sales` and `county`,
|
|
1567
|
+
* and returns a custom error message if the query is rejected:
|
|
1568
|
+
* ```js
|
|
1569
|
+
* embed.on(EmbedEvent.OnBeforeGetVizDataIntercept, (payload, responder) => {
|
|
1570
|
+
* // Record the search query submitted by the end user.
|
|
1571
|
+
* const query = payload.data.data.answer.search_query;
|
|
1572
|
+
*
|
|
1573
|
+
* responder({
|
|
1574
|
+
* data: {
|
|
1575
|
+
* // Returns true as long as the query does not include both `sales` and `county`.
|
|
1576
|
+
* execute: !(query.includes('sales') && query.includes('county')),
|
|
1577
|
+
* error: {
|
|
1578
|
+
* // Provide a custom error message when the query is blocked by your logic.
|
|
1579
|
+
* errorText:
|
|
1580
|
+
* "You can't use this query: "
|
|
1581
|
+
* + query
|
|
1582
|
+
* + ". The 'sales' measure can never be used at the 'county' level. "
|
|
1583
|
+
* + "Please try another measure or remove 'county' from your search.",
|
|
1584
|
+
* },
|
|
1585
|
+
* },
|
|
1586
|
+
* });
|
|
1587
|
+
* });
|
|
1588
|
+
* ```
|
|
1585
1589
|
*/
|
|
1586
1590
|
EmbedEvent["OnBeforeGetVizDataIntercept"] = "onBeforeGetVizDataIntercept";
|
|
1587
1591
|
/**
|
|
@@ -17528,17 +17532,50 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17528
17532
|
let releaseVersion = '';
|
|
17529
17533
|
const SSO_REDIRECTION_MARKER_GUID = '5e16222e-ef02-43e9-9fbd-24226bf3ce5b';
|
|
17530
17534
|
/**
|
|
17531
|
-
* Enum for auth failure types.
|
|
17532
|
-
*
|
|
17535
|
+
* Enum for auth failure types.
|
|
17536
|
+
* This value is passed to the listener for {@link AuthStatus.FAILURE}.
|
|
17533
17537
|
* @group Authentication / Init
|
|
17534
17538
|
*/
|
|
17535
17539
|
var AuthFailureType;
|
|
17536
17540
|
(function (AuthFailureType) {
|
|
17541
|
+
/**
|
|
17542
|
+
* Authentication failed in the SDK authentication flow.
|
|
17543
|
+
*
|
|
17544
|
+
* Emitted when `init()` or auto-authentication cannot establish a logged-in session.
|
|
17545
|
+
* For example, this can happen because of an invalid token, an auth request failure,
|
|
17546
|
+
* or an auth promise rejection.
|
|
17547
|
+
*/
|
|
17537
17548
|
AuthFailureType["SDK"] = "SDK";
|
|
17549
|
+
/**
|
|
17550
|
+
* Browser cookie access is blocked for the embedded app.
|
|
17551
|
+
*
|
|
17552
|
+
* Emitted when the iframe reports that required cookies
|
|
17553
|
+
* cannot be read or sent, commonly due to third-party cookie restrictions.
|
|
17554
|
+
*/
|
|
17538
17555
|
AuthFailureType["NO_COOKIE_ACCESS"] = "NO_COOKIE_ACCESS";
|
|
17556
|
+
/**
|
|
17557
|
+
* The current authentication token or session has expired.
|
|
17558
|
+
*
|
|
17559
|
+
* Emitted when the embed receives an auth-expiry signal and starts auth refresh handling.
|
|
17560
|
+
*/
|
|
17539
17561
|
AuthFailureType["EXPIRY"] = "EXPIRY";
|
|
17562
|
+
/**
|
|
17563
|
+
* A generic authentication failure that does not match a more specific type.
|
|
17564
|
+
*
|
|
17565
|
+
* Emitted as a fallback for app-reported auth failures in standard auth flows.
|
|
17566
|
+
*/
|
|
17540
17567
|
AuthFailureType["OTHER"] = "OTHER";
|
|
17568
|
+
/**
|
|
17569
|
+
* The user session timed out due to inactivity.
|
|
17570
|
+
*
|
|
17571
|
+
* Emitted when the app reports an idle-session timeout.
|
|
17572
|
+
*/
|
|
17541
17573
|
AuthFailureType["IDLE_SESSION_TIMEOUT"] = "IDLE_SESSION_TIMEOUT";
|
|
17574
|
+
/**
|
|
17575
|
+
* The app reports that the user is unauthenticated.
|
|
17576
|
+
*
|
|
17577
|
+
* Used primarily to classify unauthenticated failures in Embedded SSO flows.
|
|
17578
|
+
*/
|
|
17542
17579
|
AuthFailureType["UNAUTHENTICATED_FAILURE"] = "UNAUTHENTICATED_FAILURE";
|
|
17543
17580
|
})(AuthFailureType || (AuthFailureType = {}));
|
|
17544
17581
|
/**
|
|
@@ -18349,7 +18386,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18349
18386
|
return eventData;
|
|
18350
18387
|
}
|
|
18351
18388
|
|
|
18352
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.
|
|
18389
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.46.0";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 tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.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 | npx coveralls-next","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={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.23","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":"^11.2.0","@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":"^30.0.0","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^30.2.0","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1","coveralls-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle-generator":"^9.5.1",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^2.0.0",jest:"^30.2.0","jest-environment-jsdom":"^29.7.0","jest-fetch-mock":"^3.0.3",jsdom:"^17.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":"^29.4.6","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};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:"32 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};
|
|
18353
18390
|
|
|
18354
18391
|
class HostEventClient {
|
|
18355
18392
|
constructor(iFrame) {
|
|
@@ -20795,6 +20832,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
20795
20832
|
else {
|
|
20796
20833
|
params[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
|
|
20797
20834
|
}
|
|
20835
|
+
if (modularHomeExperience !== undefined) {
|
|
20836
|
+
params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
|
|
20837
|
+
}
|
|
20798
20838
|
// Set navigation to v2 by default to avoid problems like the app
|
|
20799
20839
|
// switcher (9-dot menu) not showing when v3 navigation is turned on
|
|
20800
20840
|
// at the cluster level.
|
|
@@ -20804,9 +20844,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
20804
20844
|
// Set homePageVersion to v2 by default to reset the LD flag value
|
|
20805
20845
|
// for the homepageVersion.
|
|
20806
20846
|
params[Param.HomepageVersion] = 'v2';
|
|
20807
|
-
// Set listpageVersion to v2 by default to reset the LD flag value
|
|
20808
|
-
// for the listpageVersion.
|
|
20809
|
-
params[Param.ListPageVersion] = ListPage.List;
|
|
20810
20847
|
if (discoveryExperience) {
|
|
20811
20848
|
// primaryNavbarVersion v3 will enabled the new left navigation
|
|
20812
20849
|
if (discoveryExperience.primaryNavbarVersion === PrimaryNavbarVersion.Sliding) {
|
|
@@ -20825,8 +20862,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
20825
20862
|
if (discoveryExperience.homePage === HomePage.ModularWithStylingChanges) {
|
|
20826
20863
|
params[Param.HomepageVersion] = HomePage.ModularWithStylingChanges;
|
|
20827
20864
|
}
|
|
20828
|
-
// listPageVersion
|
|
20829
|
-
if (discoveryExperience.listPageVersion
|
|
20865
|
+
// listPageVersion can be changed to v2 or v3
|
|
20866
|
+
if (discoveryExperience.listPageVersion !== undefined) {
|
|
20830
20867
|
params[Param.ListPageVersion] = discoveryExperience.listPageVersion;
|
|
20831
20868
|
}
|
|
20832
20869
|
}
|