@thoughtspot/visual-embed-sdk 1.42.1-alpha.1 → 1.42.1-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/package.json +1 -1
- package/cjs/src/api-intercept.d.ts +10 -8
- package/cjs/src/api-intercept.d.ts.map +1 -1
- package/cjs/src/api-intercept.js +12 -12
- package/cjs/src/api-intercept.js.map +1 -1
- package/cjs/src/api-intercept.spec.d.ts +2 -0
- package/cjs/src/api-intercept.spec.d.ts.map +1 -0
- package/cjs/src/api-intercept.spec.js +122 -0
- package/cjs/src/api-intercept.spec.js.map +1 -0
- package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +85 -0
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/dist/index-BCC3Z072.js +7371 -0
- package/dist/src/api-intercept.d.ts +10 -8
- package/dist/src/api-intercept.d.ts.map +1 -1
- package/dist/src/api-intercept.spec.d.ts +2 -0
- package/dist/src/api-intercept.spec.d.ts.map +1 -0
- package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +15 -15
- package/dist/tsembed-react.js +14 -14
- package/dist/tsembed.es.js +15 -15
- package/dist/tsembed.js +14 -14
- package/lib/package.json +1 -1
- package/lib/src/api-intercept.d.ts +10 -8
- package/lib/src/api-intercept.d.ts.map +1 -1
- package/lib/src/api-intercept.js +12 -12
- package/lib/src/api-intercept.js.map +1 -1
- package/lib/src/api-intercept.spec.d.ts +2 -0
- package/lib/src/api-intercept.spec.d.ts.map +1 -0
- package/lib/src/api-intercept.spec.js +119 -0
- package/lib/src/api-intercept.spec.js.map +1 -0
- package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +85 -0
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/package.json +1 -1
- package/src/api-intercept.spec.ts +147 -0
- package/src/api-intercept.ts +4 -4
- package/src/embed/ts-embed.spec.ts +105 -0
|
@@ -14,12 +14,14 @@ export declare const handleInterceptEvent: (params: {
|
|
|
14
14
|
}>;
|
|
15
15
|
}) => Promise<void>;
|
|
16
16
|
export declare const processLegacyInterceptResponse: (payload: any) => {
|
|
17
|
-
data: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}[];
|
|
17
|
+
data: {
|
|
18
|
+
execute: any;
|
|
19
|
+
errors: {
|
|
20
|
+
errorObj: {
|
|
21
|
+
title: any;
|
|
22
|
+
desc: any;
|
|
23
|
+
};
|
|
24
|
+
}[];
|
|
25
|
+
};
|
|
26
|
+
};
|
|
25
27
|
//# sourceMappingURL=api-intercept.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-intercept.d.ts","sourceRoot":"","sources":["api-intercept.ts"],"names":[],"mappings":"AAEA,OAAO,EAAsB,cAAc,EAAE,WAAW,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAwBxG,eAAO,MAAM,mBAAmB,cAAqB,GAAG,iBAGvD,CAAA;AAeD,eAAO,MAAM,oBAAoB,gBAAiB,WAAW,cAAc,cAAc,KAAG,gBAwB3F,CAAA;AAoBD,eAAO,MAAM,oBAAoB;eAA+B,GAAG;8BAA4B,UAAU,QAAQ,GAAG,KAAK,IAAI;iBAAe,WAAW;gBAAc,cAAc;iCAA+B;QAAE,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,QAAQ;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;mBAyBpR,CAAA;AAED,eAAO,MAAM,8BAA8B,YAAa,GAAG
|
|
1
|
+
{"version":3,"file":"api-intercept.d.ts","sourceRoot":"","sources":["api-intercept.ts"],"names":[],"mappings":"AAEA,OAAO,EAAsB,cAAc,EAAE,WAAW,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAwBxG,eAAO,MAAM,mBAAmB,cAAqB,GAAG,iBAGvD,CAAA;AAeD,eAAO,MAAM,oBAAoB,gBAAiB,WAAW,cAAc,cAAc,KAAG,gBAwB3F,CAAA;AAoBD,eAAO,MAAM,oBAAoB;eAA+B,GAAG;8BAA4B,UAAU,QAAQ,GAAG,KAAK,IAAI;iBAAe,WAAW;gBAAc,cAAc;iCAA+B;QAAE,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,QAAQ;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;mBAyBpR,CAAA;AAED,eAAO,MAAM,8BAA8B,YAAa,GAAG;;;;;;;;;;CAkB1D,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-intercept.spec.d.ts","sourceRoot":"","sources":["api-intercept.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ts-embed.spec.d.ts","sourceRoot":"","sources":["ts-embed.spec.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ts-embed.spec.d.ts","sourceRoot":"","sources":["ts-embed.spec.ts"],"names":[],"mappings":"AAsFA,eAAO,MAAM,iCAAiC,QAAgJ,CAAC;AAC/L,eAAO,MAAM,aAAa,QAAmF,CAAC"}
|
package/dist/tsembed-react.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.42.1-alpha.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.42.1-alpha.2 */
|
|
2
2
|
'use client';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import React__default, { useRef, useCallback } from 'react';
|
|
@@ -8306,7 +8306,7 @@ class AnswerService {
|
|
|
8306
8306
|
async getTML() {
|
|
8307
8307
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
8308
8308
|
const edoc = object[0].edoc;
|
|
8309
|
-
const YAML = await import('./index-
|
|
8309
|
+
const YAML = await import('./index-BCC3Z072.js');
|
|
8310
8310
|
const parsedDoc = YAML.parse(edoc);
|
|
8311
8311
|
return {
|
|
8312
8312
|
answer: {
|
|
@@ -17479,7 +17479,7 @@ function processEventData(type, eventData, thoughtSpotHost, containerEl) {
|
|
|
17479
17479
|
return eventData;
|
|
17480
17480
|
}
|
|
17481
17481
|
|
|
17482
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.1-alpha.
|
|
17482
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.1-alpha.2";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"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 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.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^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":"^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":"^8.28.0","@typescript-eslint/parser":"^8.28.0",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","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:"^26.6.3","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":"^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","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};
|
|
17483
17483
|
|
|
17484
17484
|
/**
|
|
17485
17485
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -17726,21 +17726,21 @@ const handleInterceptEvent = async (params) => {
|
|
|
17726
17726
|
executeEvent(EmbedEvent.ApiIntercept, interceptData);
|
|
17727
17727
|
};
|
|
17728
17728
|
const processLegacyInterceptResponse = (payload) => {
|
|
17729
|
-
var _a, _b;
|
|
17729
|
+
var _a, _b, _c;
|
|
17730
17730
|
const title = (_a = payload === null || payload === void 0 ? void 0 : payload.data) === null || _a === void 0 ? void 0 : _a.errorText;
|
|
17731
17731
|
const desc = (_b = payload === null || payload === void 0 ? void 0 : payload.data) === null || _b === void 0 ? void 0 : _b.errorDescription;
|
|
17732
|
-
const payloadToSend =
|
|
17733
|
-
|
|
17734
|
-
|
|
17735
|
-
|
|
17736
|
-
|
|
17737
|
-
|
|
17738
|
-
|
|
17739
|
-
}
|
|
17732
|
+
const payloadToSend = {
|
|
17733
|
+
execute: (_c = payload === null || payload === void 0 ? void 0 : payload.data) === null || _c === void 0 ? void 0 : _c.execute,
|
|
17734
|
+
errors: [
|
|
17735
|
+
{
|
|
17736
|
+
errorObj: {
|
|
17737
|
+
title,
|
|
17738
|
+
desc
|
|
17740
17739
|
}
|
|
17741
|
-
|
|
17742
|
-
|
|
17743
|
-
|
|
17740
|
+
}
|
|
17741
|
+
],
|
|
17742
|
+
};
|
|
17743
|
+
return { data: payloadToSend };
|
|
17744
17744
|
};
|
|
17745
17745
|
|
|
17746
17746
|
/**
|
package/dist/tsembed-react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.42.1-alpha.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.42.1-alpha.2 */
|
|
2
2
|
'use client';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
|
|
@@ -17501,7 +17501,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17501
17501
|
return eventData;
|
|
17502
17502
|
}
|
|
17503
17503
|
|
|
17504
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.1-alpha.
|
|
17504
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.1-alpha.2";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p 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 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.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^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":"^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":"^8.28.0","@typescript-eslint/parser":"^8.28.0",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","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:"^26.6.3","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":"^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","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};
|
|
17505
17505
|
|
|
17506
17506
|
/**
|
|
17507
17507
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -17748,21 +17748,21 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17748
17748
|
executeEvent(exports.EmbedEvent.ApiIntercept, interceptData);
|
|
17749
17749
|
};
|
|
17750
17750
|
const processLegacyInterceptResponse = (payload) => {
|
|
17751
|
-
var _a, _b;
|
|
17751
|
+
var _a, _b, _c;
|
|
17752
17752
|
const title = (_a = payload === null || payload === void 0 ? void 0 : payload.data) === null || _a === void 0 ? void 0 : _a.errorText;
|
|
17753
17753
|
const desc = (_b = payload === null || payload === void 0 ? void 0 : payload.data) === null || _b === void 0 ? void 0 : _b.errorDescription;
|
|
17754
|
-
const payloadToSend =
|
|
17755
|
-
|
|
17756
|
-
|
|
17757
|
-
|
|
17758
|
-
|
|
17759
|
-
|
|
17760
|
-
|
|
17761
|
-
}
|
|
17754
|
+
const payloadToSend = {
|
|
17755
|
+
execute: (_c = payload === null || payload === void 0 ? void 0 : payload.data) === null || _c === void 0 ? void 0 : _c.execute,
|
|
17756
|
+
errors: [
|
|
17757
|
+
{
|
|
17758
|
+
errorObj: {
|
|
17759
|
+
title,
|
|
17760
|
+
desc
|
|
17762
17761
|
}
|
|
17763
|
-
|
|
17764
|
-
|
|
17765
|
-
|
|
17762
|
+
}
|
|
17763
|
+
],
|
|
17764
|
+
};
|
|
17765
|
+
return { data: payloadToSend };
|
|
17766
17766
|
};
|
|
17767
17767
|
|
|
17768
17768
|
/**
|
package/dist/tsembed.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.42.1-alpha.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.42.1-alpha.2 */
|
|
2
2
|
'use client';
|
|
3
3
|
function _mergeNamespaces(n, m) {
|
|
4
4
|
m.forEach(function (e) {
|
|
@@ -8191,7 +8191,7 @@ class AnswerService {
|
|
|
8191
8191
|
async getTML() {
|
|
8192
8192
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
8193
8193
|
const edoc = object[0].edoc;
|
|
8194
|
-
const YAML = await import('./index-
|
|
8194
|
+
const YAML = await import('./index-BCC3Z072.js');
|
|
8195
8195
|
const parsedDoc = YAML.parse(edoc);
|
|
8196
8196
|
return {
|
|
8197
8197
|
answer: {
|
|
@@ -17530,7 +17530,7 @@ function processEventData(type, eventData, thoughtSpotHost, containerEl) {
|
|
|
17530
17530
|
return eventData;
|
|
17531
17531
|
}
|
|
17532
17532
|
|
|
17533
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.1-alpha.
|
|
17533
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.1-alpha.2";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"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 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.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^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":"^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":"^8.28.0","@typescript-eslint/parser":"^8.28.0",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","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:"^26.6.3","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":"^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","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};
|
|
17534
17534
|
|
|
17535
17535
|
/**
|
|
17536
17536
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -17777,21 +17777,21 @@ const handleInterceptEvent = async (params) => {
|
|
|
17777
17777
|
executeEvent(EmbedEvent.ApiIntercept, interceptData);
|
|
17778
17778
|
};
|
|
17779
17779
|
const processLegacyInterceptResponse = (payload) => {
|
|
17780
|
-
var _a, _b;
|
|
17780
|
+
var _a, _b, _c;
|
|
17781
17781
|
const title = (_a = payload === null || payload === void 0 ? void 0 : payload.data) === null || _a === void 0 ? void 0 : _a.errorText;
|
|
17782
17782
|
const desc = (_b = payload === null || payload === void 0 ? void 0 : payload.data) === null || _b === void 0 ? void 0 : _b.errorDescription;
|
|
17783
|
-
const payloadToSend =
|
|
17784
|
-
|
|
17785
|
-
|
|
17786
|
-
|
|
17787
|
-
|
|
17788
|
-
|
|
17789
|
-
|
|
17790
|
-
}
|
|
17783
|
+
const payloadToSend = {
|
|
17784
|
+
execute: (_c = payload === null || payload === void 0 ? void 0 : payload.data) === null || _c === void 0 ? void 0 : _c.execute,
|
|
17785
|
+
errors: [
|
|
17786
|
+
{
|
|
17787
|
+
errorObj: {
|
|
17788
|
+
title,
|
|
17789
|
+
desc
|
|
17791
17790
|
}
|
|
17792
|
-
|
|
17793
|
-
|
|
17794
|
-
|
|
17791
|
+
}
|
|
17792
|
+
],
|
|
17793
|
+
};
|
|
17794
|
+
return { data: payloadToSend };
|
|
17795
17795
|
};
|
|
17796
17796
|
|
|
17797
17797
|
/**
|
package/dist/tsembed.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.42.1-alpha.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.42.1-alpha.2 */
|
|
2
2
|
'use client';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
@@ -17536,7 +17536,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17536
17536
|
return eventData;
|
|
17537
17537
|
}
|
|
17538
17538
|
|
|
17539
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.1-alpha.
|
|
17539
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.1-alpha.2";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p 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 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.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^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":"^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":"^8.28.0","@typescript-eslint/parser":"^8.28.0",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","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:"^26.6.3","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":"^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","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};
|
|
17540
17540
|
|
|
17541
17541
|
/**
|
|
17542
17542
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -17783,21 +17783,21 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17783
17783
|
executeEvent(exports.EmbedEvent.ApiIntercept, interceptData);
|
|
17784
17784
|
};
|
|
17785
17785
|
const processLegacyInterceptResponse = (payload) => {
|
|
17786
|
-
var _a, _b;
|
|
17786
|
+
var _a, _b, _c;
|
|
17787
17787
|
const title = (_a = payload === null || payload === void 0 ? void 0 : payload.data) === null || _a === void 0 ? void 0 : _a.errorText;
|
|
17788
17788
|
const desc = (_b = payload === null || payload === void 0 ? void 0 : payload.data) === null || _b === void 0 ? void 0 : _b.errorDescription;
|
|
17789
|
-
const payloadToSend =
|
|
17790
|
-
|
|
17791
|
-
|
|
17792
|
-
|
|
17793
|
-
|
|
17794
|
-
|
|
17795
|
-
|
|
17796
|
-
}
|
|
17789
|
+
const payloadToSend = {
|
|
17790
|
+
execute: (_c = payload === null || payload === void 0 ? void 0 : payload.data) === null || _c === void 0 ? void 0 : _c.execute,
|
|
17791
|
+
errors: [
|
|
17792
|
+
{
|
|
17793
|
+
errorObj: {
|
|
17794
|
+
title,
|
|
17795
|
+
desc
|
|
17797
17796
|
}
|
|
17798
|
-
|
|
17799
|
-
|
|
17800
|
-
|
|
17797
|
+
}
|
|
17798
|
+
],
|
|
17799
|
+
};
|
|
17800
|
+
return { data: payloadToSend };
|
|
17801
17801
|
};
|
|
17802
17802
|
|
|
17803
17803
|
/**
|
package/lib/package.json
CHANGED
|
@@ -14,12 +14,14 @@ export declare const handleInterceptEvent: (params: {
|
|
|
14
14
|
}>;
|
|
15
15
|
}) => Promise<void>;
|
|
16
16
|
export declare const processLegacyInterceptResponse: (payload: any) => {
|
|
17
|
-
data: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}[];
|
|
17
|
+
data: {
|
|
18
|
+
execute: any;
|
|
19
|
+
errors: {
|
|
20
|
+
errorObj: {
|
|
21
|
+
title: any;
|
|
22
|
+
desc: any;
|
|
23
|
+
};
|
|
24
|
+
}[];
|
|
25
|
+
};
|
|
26
|
+
};
|
|
25
27
|
//# sourceMappingURL=api-intercept.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-intercept.d.ts","sourceRoot":"","sources":["../../src/api-intercept.ts"],"names":[],"mappings":"AAEA,OAAO,EAAsB,cAAc,EAAE,WAAW,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAwBxG,eAAO,MAAM,mBAAmB,cAAqB,GAAG,iBAGvD,CAAA;AAeD,eAAO,MAAM,oBAAoB,gBAAiB,WAAW,cAAc,cAAc,KAAG,gBAwB3F,CAAA;AAoBD,eAAO,MAAM,oBAAoB;eAA+B,GAAG;8BAA4B,UAAU,QAAQ,GAAG,KAAK,IAAI;iBAAe,WAAW;gBAAc,cAAc;iCAA+B;QAAE,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,QAAQ;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;mBAyBpR,CAAA;AAED,eAAO,MAAM,8BAA8B,YAAa,GAAG
|
|
1
|
+
{"version":3,"file":"api-intercept.d.ts","sourceRoot":"","sources":["../../src/api-intercept.ts"],"names":[],"mappings":"AAEA,OAAO,EAAsB,cAAc,EAAE,WAAW,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAwBxG,eAAO,MAAM,mBAAmB,cAAqB,GAAG,iBAGvD,CAAA;AAeD,eAAO,MAAM,oBAAoB,gBAAiB,WAAW,cAAc,cAAc,KAAG,gBAwB3F,CAAA;AAoBD,eAAO,MAAM,oBAAoB;eAA+B,GAAG;8BAA4B,UAAU,QAAQ,GAAG,KAAK,IAAI;iBAAe,WAAW;gBAAc,cAAc;iCAA+B;QAAE,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,QAAQ;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;mBAyBpR,CAAA;AAED,eAAO,MAAM,8BAA8B,YAAa,GAAG;;;;;;;;;;CAkB1D,CAAA"}
|
package/lib/src/api-intercept.js
CHANGED
|
@@ -89,20 +89,20 @@ export const handleInterceptEvent = async (params) => {
|
|
|
89
89
|
executeEvent(EmbedEvent.ApiIntercept, interceptData);
|
|
90
90
|
};
|
|
91
91
|
export const processLegacyInterceptResponse = (payload) => {
|
|
92
|
-
var _a, _b;
|
|
92
|
+
var _a, _b, _c;
|
|
93
93
|
const title = (_a = payload === null || payload === void 0 ? void 0 : payload.data) === null || _a === void 0 ? void 0 : _a.errorText;
|
|
94
94
|
const desc = (_b = payload === null || payload === void 0 ? void 0 : payload.data) === null || _b === void 0 ? void 0 : _b.errorDescription;
|
|
95
|
-
const payloadToSend =
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
95
|
+
const payloadToSend = {
|
|
96
|
+
execute: (_c = payload === null || payload === void 0 ? void 0 : payload.data) === null || _c === void 0 ? void 0 : _c.execute,
|
|
97
|
+
errors: [
|
|
98
|
+
{
|
|
99
|
+
errorObj: {
|
|
100
|
+
title,
|
|
101
|
+
desc
|
|
103
102
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
};
|
|
106
|
+
return { data: payloadToSend };
|
|
107
107
|
};
|
|
108
108
|
//# sourceMappingURL=api-intercept.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-intercept.js","sourceRoot":"","sources":["../../src/api-intercept.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAiD,UAAU,EAAE,MAAM,SAAS,CAAC;AACxG,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAGxC,MAAM,WAAW,GAA0E;IACvF,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EAAE;QAC3B,gCAAgC;QAChC,8BAA8B;KACrB;IACb,CAAC,kBAAkB,CAAC,WAAW,CAAC,EAAE;QAC9B,6BAA6B;QAC7B,qCAAqC;KAC5B;IACb,CAAC,kBAAkB,CAAC,cAAc,CAAC,EAAE;QACjC,4BAA4B;KACnB;CAChB,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,GAAW,EAAE,EAAE;IACvC,MAAM,IAAI,GAAG,kBAAkB,CAAC,cAAc,EAAE,CAAC,CAAC;IAClD,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,GAAG,IAAI,GAAG,GAAG,EAAE,CAAC;IAChD,OAAO,GAAG,CAAC;AACf,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,EAAE,SAAc,EAAE,EAAE;IAExD,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AACtC,CAAC,CAAA;AAMD,MAAM,oBAAoB,GAAG,CAAC,aAA8C,EAAE,EAAE;IAC5E,IAAI,aAAa,GAAG,CAAC,GAAG,aAAa,CAAC,CAAC;IACvC,MAAM,CAAC,OAAO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8B,GAAG,CAAC,OAAY,EAAE,EAAE;;IAE3D,MAAM,KAAK,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,0CAAE,SAAS,CAAC;IACvC,MAAM,IAAI,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,0CAAE,gBAAgB,CAAC;IAE7C,MAAM,aAAa,GAAG;QAClB,OAAO,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,0CAAE,OAAO;QAC/B,MAAM,EAAE;YACJ;gBACI,QAAQ,EAAE;oBACN,KAAK;oBACL,IAAI;iBACP;aACJ;SACJ;KACJ,CAAC;IAEF,OAAO,EAAE,IAAI,EAAG,aAAa,EAAE,CAAC;AACpC,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-intercept.spec.d.ts","sourceRoot":"","sources":["../../src/api-intercept.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { getInterceptInitData, processApiIntercept, handleInterceptEvent, processLegacyInterceptResponse } from './api-intercept';
|
|
2
|
+
import { EmbedEvent, InterceptedApiType } from './types';
|
|
3
|
+
import * as embedCfg from './embed/embedConfig';
|
|
4
|
+
import * as cfg from './config';
|
|
5
|
+
import { logger } from './utils/logger';
|
|
6
|
+
describe('api-intercept', () => {
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
jest.restoreAllMocks();
|
|
9
|
+
jest.clearAllMocks();
|
|
10
|
+
});
|
|
11
|
+
describe('getInterceptInitData', () => {
|
|
12
|
+
test('returns disabled when not enabled in either config', () => {
|
|
13
|
+
const init = getInterceptInitData({}, {});
|
|
14
|
+
expect(init).toEqual({ enableApiIntercept: false });
|
|
15
|
+
});
|
|
16
|
+
test('merges urls and expands api types, formats with host', () => {
|
|
17
|
+
jest.spyOn(embedCfg, 'getEmbedConfig').mockReturnValue({ thoughtSpotHost: 'http://tshost' });
|
|
18
|
+
jest.spyOn(cfg, 'getThoughtSpotHost').mockReturnValue('http://tshost');
|
|
19
|
+
const embedConfig = { enableApiIntercept: true };
|
|
20
|
+
const viewConfig = { interceptUrls: [InterceptedApiType.METADATA, '/custom/path'] };
|
|
21
|
+
const init = getInterceptInitData(embedConfig, viewConfig);
|
|
22
|
+
expect(init.enableApiIntercept).toBe(true);
|
|
23
|
+
expect(init.interceptUrls).toEqual(expect.arrayContaining([
|
|
24
|
+
'http://tshost/prism/?op=CreateAnswerSession',
|
|
25
|
+
'http://tshost/prism/?op=GetV2SourceDetail',
|
|
26
|
+
'http://tshost/custom/path',
|
|
27
|
+
]));
|
|
28
|
+
});
|
|
29
|
+
test('honors InterceptedApiType.ALL and interceptTimeout', () => {
|
|
30
|
+
const embedConfig = { enableApiIntercept: true, interceptTimeout: 2500 };
|
|
31
|
+
const viewConfig = { interceptUrls: [InterceptedApiType.ALL] };
|
|
32
|
+
const init = getInterceptInitData(embedConfig, viewConfig);
|
|
33
|
+
expect(init).toEqual({
|
|
34
|
+
enableApiIntercept: true,
|
|
35
|
+
interceptUrls: [InterceptedApiType.ALL],
|
|
36
|
+
interceptTimeout: 2500,
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
test('legacy flag isOnBeforeGetVizDataInterceptEnabled adds ANSWER_DATA', () => {
|
|
40
|
+
jest.spyOn(embedCfg, 'getEmbedConfig').mockReturnValue({ thoughtSpotHost: 'http://tshost' });
|
|
41
|
+
jest.spyOn(cfg, 'getThoughtSpotHost').mockReturnValue('http://tshost');
|
|
42
|
+
const embedConfig = { enableApiIntercept: true };
|
|
43
|
+
const viewConfig = { isOnBeforeGetVizDataInterceptEnabled: true, interceptUrls: [] };
|
|
44
|
+
const init = getInterceptInitData(embedConfig, viewConfig);
|
|
45
|
+
// Should expand to concrete ANSWER_DATA URLs
|
|
46
|
+
expect(init.interceptUrls).toEqual(expect.arrayContaining([
|
|
47
|
+
'http://tshost/prism/?op=GetChartWithData',
|
|
48
|
+
'http://tshost/prism/?op=GetTableWithHeadlineData',
|
|
49
|
+
]));
|
|
50
|
+
});
|
|
51
|
+
test('viewConfig enableApiIntercept=false overrides embed config', () => {
|
|
52
|
+
const embedConfig = { enableApiIntercept: true };
|
|
53
|
+
const viewConfig = { enableApiIntercept: false };
|
|
54
|
+
const init = getInterceptInitData(embedConfig, viewConfig);
|
|
55
|
+
expect(init).toEqual({ enableApiIntercept: false });
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
describe('processApiIntercept', () => {
|
|
59
|
+
test('parses data JSON string', async () => {
|
|
60
|
+
const result = await processApiIntercept({ data: JSON.stringify({ foo: 'bar' }) });
|
|
61
|
+
expect(result).toEqual({ foo: 'bar' });
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
describe('handleInterceptEvent', () => {
|
|
65
|
+
test('emits error on body parse failure', async () => {
|
|
66
|
+
const executeEvent = jest.fn();
|
|
67
|
+
const loggerErrSpy = jest.spyOn(logger, 'error').mockImplementation(() => undefined);
|
|
68
|
+
await handleInterceptEvent({
|
|
69
|
+
eventData: { data: 'not-a-json' },
|
|
70
|
+
executeEvent,
|
|
71
|
+
embedConfig: {},
|
|
72
|
+
viewConfig: {},
|
|
73
|
+
getUnsavedAnswerTml: jest.fn(),
|
|
74
|
+
});
|
|
75
|
+
expect(executeEvent).toHaveBeenCalledWith(EmbedEvent.Error, { error: 'Error parsing api intercept body' });
|
|
76
|
+
loggerErrSpy.mockReset();
|
|
77
|
+
});
|
|
78
|
+
test('calls getUnsavedAnswerTml and emits legacy + ApiIntercept events when applicable', async () => {
|
|
79
|
+
const executeEvent = jest.fn();
|
|
80
|
+
const getUnsavedAnswerTml = jest.fn().mockResolvedValue({ tml: 'TML_STRING' });
|
|
81
|
+
const eventPayload = {
|
|
82
|
+
input: '/prism/?op=GetChartWithData',
|
|
83
|
+
init: {
|
|
84
|
+
body: JSON.stringify({
|
|
85
|
+
variables: {
|
|
86
|
+
session: { sessionId: 'S1' },
|
|
87
|
+
contextBookId: 'V1',
|
|
88
|
+
},
|
|
89
|
+
}),
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
await handleInterceptEvent({
|
|
93
|
+
eventData: { data: JSON.stringify(eventPayload) },
|
|
94
|
+
executeEvent,
|
|
95
|
+
embedConfig: {},
|
|
96
|
+
viewConfig: { isOnBeforeGetVizDataInterceptEnabled: true },
|
|
97
|
+
getUnsavedAnswerTml,
|
|
98
|
+
});
|
|
99
|
+
expect(getUnsavedAnswerTml).toHaveBeenCalledWith({ sessionId: 'S1', vizId: 'V1' });
|
|
100
|
+
expect(executeEvent).toHaveBeenCalledWith(EmbedEvent.OnBeforeGetVizDataIntercept, { data: { data: { tml: 'TML_STRING' } } });
|
|
101
|
+
expect(executeEvent).toHaveBeenCalledWith(EmbedEvent.ApiIntercept, expect.objectContaining({ input: '/prism/?op=GetChartWithData' }));
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
describe('processLegacyInterceptResponse', () => {
|
|
105
|
+
test('wraps legacy error payload as expected', () => {
|
|
106
|
+
const payload = { data: { errorText: 'Title', errorDescription: 'Desc' } };
|
|
107
|
+
const res = processLegacyInterceptResponse(payload);
|
|
108
|
+
expect(Array.isArray(res)).toBe(true);
|
|
109
|
+
expect(res[0]).toEqual(expect.objectContaining({
|
|
110
|
+
errors: [
|
|
111
|
+
expect.objectContaining({
|
|
112
|
+
errorObj: expect.objectContaining({ title: 'Title', desc: 'Desc' }),
|
|
113
|
+
}),
|
|
114
|
+
],
|
|
115
|
+
}));
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
//# sourceMappingURL=api-intercept.spec.js.map
|