@thoughtspot/visual-embed-sdk 1.42.1-alpha.1 → 1.42.1-alpha.3
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 +12 -7
- package/cjs/src/api-intercept.d.ts.map +1 -1
- package/cjs/src/api-intercept.js +8 -5
- 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/index-BaESA9rq.js +7371 -0
- package/dist/src/api-intercept.d.ts +12 -7
- 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 +11 -8
- package/dist/tsembed-react.js +10 -7
- package/dist/tsembed.es.js +11 -8
- package/dist/tsembed.js +10 -7
- package/lib/package.json +1 -1
- package/lib/src/api-intercept.d.ts +12 -7
- package/lib/src/api-intercept.d.ts.map +1 -1
- package/lib/src/api-intercept.js +8 -5
- 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 +14 -11
- package/src/embed/ts-embed.spec.ts +105 -0
|
@@ -14,12 +14,17 @@ 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
|
-
|
|
17
|
+
data: {
|
|
18
|
+
execute: any;
|
|
19
|
+
body: {
|
|
20
|
+
errors: {
|
|
21
|
+
errorObj: {
|
|
22
|
+
title: any;
|
|
23
|
+
desc: any;
|
|
24
|
+
};
|
|
25
|
+
}[];
|
|
22
26
|
};
|
|
23
|
-
|
|
24
|
-
}
|
|
27
|
+
status: number;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
25
30
|
//# 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;;;;;;;;;;;;;CAqB1D,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.3 */
|
|
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-BaESA9rq.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.3";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p 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,11 +17726,12 @@ 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
|
-
|
|
17732
|
+
const payloadToSend = {
|
|
17733
|
+
execute: (_c = payload === null || payload === void 0 ? void 0 : payload.data) === null || _c === void 0 ? void 0 : _c.execute,
|
|
17734
|
+
body: {
|
|
17734
17735
|
errors: [
|
|
17735
17736
|
{
|
|
17736
17737
|
errorObj: {
|
|
@@ -17739,8 +17740,10 @@ const processLegacyInterceptResponse = (payload) => {
|
|
|
17739
17740
|
}
|
|
17740
17741
|
}
|
|
17741
17742
|
],
|
|
17742
|
-
}
|
|
17743
|
-
|
|
17743
|
+
},
|
|
17744
|
+
status: 200,
|
|
17745
|
+
};
|
|
17746
|
+
return { data: payloadToSend };
|
|
17744
17747
|
};
|
|
17745
17748
|
|
|
17746
17749
|
/**
|
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.3 */
|
|
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.3";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p 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,11 +17748,12 @@ 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
|
-
|
|
17754
|
+
const payloadToSend = {
|
|
17755
|
+
execute: (_c = payload === null || payload === void 0 ? void 0 : payload.data) === null || _c === void 0 ? void 0 : _c.execute,
|
|
17756
|
+
body: {
|
|
17756
17757
|
errors: [
|
|
17757
17758
|
{
|
|
17758
17759
|
errorObj: {
|
|
@@ -17761,8 +17762,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17761
17762
|
}
|
|
17762
17763
|
}
|
|
17763
17764
|
],
|
|
17764
|
-
}
|
|
17765
|
-
|
|
17765
|
+
},
|
|
17766
|
+
status: 200,
|
|
17767
|
+
};
|
|
17768
|
+
return { data: payloadToSend };
|
|
17766
17769
|
};
|
|
17767
17770
|
|
|
17768
17771
|
/**
|
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.3 */
|
|
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-BaESA9rq.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.3";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p 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,11 +17777,12 @@ 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
|
-
|
|
17783
|
+
const payloadToSend = {
|
|
17784
|
+
execute: (_c = payload === null || payload === void 0 ? void 0 : payload.data) === null || _c === void 0 ? void 0 : _c.execute,
|
|
17785
|
+
body: {
|
|
17785
17786
|
errors: [
|
|
17786
17787
|
{
|
|
17787
17788
|
errorObj: {
|
|
@@ -17790,8 +17791,10 @@ const processLegacyInterceptResponse = (payload) => {
|
|
|
17790
17791
|
}
|
|
17791
17792
|
}
|
|
17792
17793
|
],
|
|
17793
|
-
}
|
|
17794
|
-
|
|
17794
|
+
},
|
|
17795
|
+
status: 200,
|
|
17796
|
+
};
|
|
17797
|
+
return { data: payloadToSend };
|
|
17795
17798
|
};
|
|
17796
17799
|
|
|
17797
17800
|
/**
|
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.3 */
|
|
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.3";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p 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,11 +17783,12 @@ 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
|
-
|
|
17789
|
+
const payloadToSend = {
|
|
17790
|
+
execute: (_c = payload === null || payload === void 0 ? void 0 : payload.data) === null || _c === void 0 ? void 0 : _c.execute,
|
|
17791
|
+
body: {
|
|
17791
17792
|
errors: [
|
|
17792
17793
|
{
|
|
17793
17794
|
errorObj: {
|
|
@@ -17796,8 +17797,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17796
17797
|
}
|
|
17797
17798
|
}
|
|
17798
17799
|
],
|
|
17799
|
-
}
|
|
17800
|
-
|
|
17800
|
+
},
|
|
17801
|
+
status: 200,
|
|
17802
|
+
};
|
|
17803
|
+
return { data: payloadToSend };
|
|
17801
17804
|
};
|
|
17802
17805
|
|
|
17803
17806
|
/**
|
package/lib/package.json
CHANGED
|
@@ -14,12 +14,17 @@ 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
|
-
|
|
17
|
+
data: {
|
|
18
|
+
execute: any;
|
|
19
|
+
body: {
|
|
20
|
+
errors: {
|
|
21
|
+
errorObj: {
|
|
22
|
+
title: any;
|
|
23
|
+
desc: any;
|
|
24
|
+
};
|
|
25
|
+
}[];
|
|
22
26
|
};
|
|
23
|
-
|
|
24
|
-
}
|
|
27
|
+
status: number;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
25
30
|
//# 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;;;;;;;;;;;;;CAqB1D,CAAA"}
|
package/lib/src/api-intercept.js
CHANGED
|
@@ -89,11 +89,12 @@ 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
|
-
|
|
95
|
+
const payloadToSend = {
|
|
96
|
+
execute: (_c = payload === null || payload === void 0 ? void 0 : payload.data) === null || _c === void 0 ? void 0 : _c.execute,
|
|
97
|
+
body: {
|
|
97
98
|
errors: [
|
|
98
99
|
{
|
|
99
100
|
errorObj: {
|
|
@@ -102,7 +103,9 @@ export const processLegacyInterceptResponse = (payload) => {
|
|
|
102
103
|
}
|
|
103
104
|
}
|
|
104
105
|
],
|
|
105
|
-
}
|
|
106
|
-
|
|
106
|
+
},
|
|
107
|
+
status: 200,
|
|
108
|
+
};
|
|
109
|
+
return { data: payloadToSend };
|
|
107
110
|
};
|
|
108
111
|
//# 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,E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C,UAAU,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;AACzD,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,8BAA8B,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,IAAI,EAAE;YACF,MAAM,EAAE;gBACJ;oBACI,QAAQ,EAAE;wBACN,KAAK;wBACL,IAAI;qBACP;iBACJ;aACJ;SACJ;QACD,MAAM,EAAE,GAAG;KACd,CAAC;IAEF,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;AACnC,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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-intercept.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"version":3,"file":"ts-embed.spec.d.ts","sourceRoot":"","sources":["../../../src/embed/ts-embed.spec.ts"],"names":[],"mappings":"AAsFA,eAAO,MAAM,iCAAiC,QAAgJ,CAAC;AAC/L,eAAO,MAAM,aAAa,QAAmF,CAAC"}
|