@thoughtspot/visual-embed-sdk 1.37.1-spotter-embed → 1.38.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 +2 -2
- package/cjs/src/embed/app.d.ts +43 -3
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +39 -6
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +23 -6
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/base.d.ts.map +1 -1
- package/cjs/src/embed/base.js +7 -0
- package/cjs/src/embed/base.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.d.ts +8 -3
- package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/cjs/src/embed/bodyless-conversation.js +5 -2
- package/cjs/src/embed/bodyless-conversation.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.spec.js +286 -1
- package/cjs/src/embed/bodyless-conversation.spec.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +5 -3
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +3 -2
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +6 -4
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +105 -0
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/index.d.ts +4 -4
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +5 -3
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/react/all-types-export.d.ts +1 -1
- package/cjs/src/react/all-types-export.d.ts.map +1 -1
- package/cjs/src/react/all-types-export.js +2 -1
- package/cjs/src/react/all-types-export.js.map +1 -1
- package/cjs/src/react/index.d.ts +32 -3
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +54 -2
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/react/index.spec.js +94 -0
- package/cjs/src/react/index.spec.js.map +1 -1
- package/cjs/src/types.d.ts +25 -51
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +24 -50
- package/cjs/src/types.js.map +1 -1
- package/dist/{index-DnIvX1FR.js → index-BIcnpmMY.js} +1 -1
- package/dist/src/embed/app.d.ts +43 -3
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/base.d.ts.map +1 -1
- package/dist/src/embed/bodyless-conversation.d.ts +8 -3
- package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +5 -3
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/dist/src/index.d.ts +4 -4
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/react/all-types-export.d.ts +1 -1
- package/dist/src/react/all-types-export.d.ts.map +1 -1
- package/dist/src/react/index.d.ts +32 -3
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +25 -51
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +593 -66
- package/dist/tsembed-react.js +737 -285
- package/dist/tsembed.es.js +132 -64
- package/dist/tsembed.js +276 -284
- package/dist/visual-embed-sdk-react-full.d.ts +194 -145
- package/dist/visual-embed-sdk-react.d.ts +194 -145
- package/dist/visual-embed-sdk.d.ts +82 -61
- package/lib/package.json +2 -2
- package/lib/src/embed/app.d.ts +43 -3
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +38 -5
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +24 -7
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/base.d.ts.map +1 -1
- package/lib/src/embed/base.js +7 -0
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.d.ts +8 -3
- package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/lib/src/embed/bodyless-conversation.js +5 -2
- package/lib/src/embed/bodyless-conversation.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.spec.js +287 -2
- package/lib/src/embed/bodyless-conversation.spec.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +5 -3
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +3 -2
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +6 -4
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +105 -0
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/index.d.ts +4 -4
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +4 -4
- package/lib/src/index.js.map +1 -1
- package/lib/src/react/all-types-export.d.ts +1 -1
- package/lib/src/react/all-types-export.d.ts.map +1 -1
- package/lib/src/react/all-types-export.js +1 -1
- package/lib/src/react/all-types-export.js.map +1 -1
- package/lib/src/react/index.d.ts +32 -3
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +53 -1
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/react/index.spec.js +96 -2
- package/lib/src/react/index.spec.js.map +1 -1
- package/lib/src/types.d.ts +25 -51
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +24 -50
- package/lib/src/types.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +85 -64
- package/package.json +2 -2
- package/src/embed/app.spec.ts +30 -6
- package/src/embed/app.ts +61 -8
- package/src/embed/base.ts +9 -0
- package/src/embed/bodyless-conversation.spec.ts +308 -1
- package/src/embed/bodyless-conversation.ts +13 -3
- package/src/embed/conversation.ts +5 -3
- package/src/embed/ts-embed.spec.ts +130 -0
- package/src/embed/ts-embed.ts +6 -4
- package/src/index.ts +10 -3
- package/src/react/all-types-export.ts +1 -0
- package/src/react/index.spec.tsx +157 -1
- package/src/react/index.tsx +64 -3
- package/src/types.ts +24 -56
- package/cjs/src/pages/embed-test.page.d.ts +0 -8
- package/cjs/src/pages/embed-test.page.d.ts.map +0 -1
- package/cjs/src/pages/embed-test.page.js +0 -20
- package/cjs/src/pages/embed-test.page.js.map +0 -1
- package/cjs/src/pages/home.page.d.ts +0 -6
- package/cjs/src/pages/home.page.d.ts.map +0 -1
- package/cjs/src/pages/home.page.js +0 -12
- package/cjs/src/pages/home.page.js.map +0 -1
- package/cjs/src/pages/login.page.d.ts +0 -15
- package/cjs/src/pages/login.page.d.ts.map +0 -1
- package/cjs/src/pages/login.page.js +0 -22
- package/cjs/src/pages/login.page.js.map +0 -1
- package/cjs/src/tests/auth.test.d.ts +0 -1
- package/cjs/src/tests/auth.test.d.ts.map +0 -1
- package/cjs/src/tests/auth.test.js +0 -1
- package/cjs/src/tests/auth.test.js.map +0 -1
- package/cjs/src/tests/e2e/auth.spec.d.ts +0 -2
- package/cjs/src/tests/e2e/auth.spec.d.ts.map +0 -1
- package/cjs/src/tests/e2e/auth.spec.js +0 -54
- package/cjs/src/tests/e2e/auth.spec.js.map +0 -1
- package/dist/index-Cj4BVGHL.js +0 -7371
- package/dist/index-DUaG1OG2.js +0 -7447
- package/dist/index-Fhk1V_Gw.js +0 -7371
- package/dist/index-OuiZF3zE.js +0 -7371
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.38.0 */
|
|
2
2
|
'use client';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import React__default, { useRef } from 'react';
|
|
@@ -2114,9 +2114,12 @@ var HostEvent;
|
|
|
2114
2114
|
* @example
|
|
2115
2115
|
* ```js
|
|
2116
2116
|
* searchEmbed.trigger(HostEvent.OpenFilter,
|
|
2117
|
-
* { columnId: '<column-GUID>', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE'})
|
|
2117
|
+
* {column: { columnId: '<column-GUID>', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE'}})
|
|
2118
|
+
* ```
|
|
2119
|
+
* @example
|
|
2120
|
+
* ```js
|
|
2118
2121
|
* LiveboardEmbed.trigger(HostEvent.OpenFilter,
|
|
2119
|
-
*
|
|
2122
|
+
* { column: {columnId: '<column-GUID>'}})
|
|
2120
2123
|
* ```
|
|
2121
2124
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
2122
2125
|
*/
|
|
@@ -2725,6 +2728,25 @@ var HostEvent;
|
|
|
2725
2728
|
* }]
|
|
2726
2729
|
* });
|
|
2727
2730
|
* ```
|
|
2731
|
+
* If there are multiple columns with the same name, consider
|
|
2732
|
+
* using `WORKSHEET_NAME::COLUMN_NAME` format.
|
|
2733
|
+
*
|
|
2734
|
+
* @example
|
|
2735
|
+
*
|
|
2736
|
+
* ```js
|
|
2737
|
+
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
2738
|
+
* filters: [{
|
|
2739
|
+
* column: "(Sample) Retail - Apparel::city",
|
|
2740
|
+
* oper: 'IN',
|
|
2741
|
+
* values: ["atlanta"]
|
|
2742
|
+
* },
|
|
2743
|
+
* {
|
|
2744
|
+
* column: "(Sample) Retail - Apparel::Region",
|
|
2745
|
+
* oper: 'IN',
|
|
2746
|
+
* values: ["West","Midwest"]
|
|
2747
|
+
* }]
|
|
2748
|
+
* });
|
|
2749
|
+
* ```
|
|
2728
2750
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
2729
2751
|
*/
|
|
2730
2752
|
HostEvent["UpdateFilters"] = "updateFilters";
|
|
@@ -2934,54 +2956,6 @@ var HostEvent;
|
|
|
2934
2956
|
* @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl
|
|
2935
2957
|
*/
|
|
2936
2958
|
HostEvent["TransformTableVizData"] = "TransformTableVizData";
|
|
2937
|
-
/**
|
|
2938
|
-
* Triggers the table visualization re-render with the updated data.
|
|
2939
|
-
* Includes the following properties:
|
|
2940
|
-
* @param - `columnDataLite` - an array of object containing the
|
|
2941
|
-
* data value modifications retrieved from the `EmbedEvent.TableVizRendered`
|
|
2942
|
-
* payload.For example, { columnDataLite: []}`.
|
|
2943
|
-
*/
|
|
2944
|
-
HostEvent["SpotterSearch"] = "SpotterSearch";
|
|
2945
|
-
/**
|
|
2946
|
-
* Triggers the table visualization re-render with the updated data.
|
|
2947
|
-
* Includes the following properties:
|
|
2948
|
-
* @param - `columnDataLite` - an array of object containing the
|
|
2949
|
-
* data value modifications retrieved from the `EmbedEvent.TableVizRendered`
|
|
2950
|
-
* payload.For example, { columnDataLite: []}`.
|
|
2951
|
-
*/
|
|
2952
|
-
HostEvent["EditLastPrompt"] = "EditLastPrompt";
|
|
2953
|
-
/**
|
|
2954
|
-
* Triggers the table visualization re-render with the updated data.
|
|
2955
|
-
* Includes the following properties:
|
|
2956
|
-
* @param - `columnDataLite` - an array of object containing the
|
|
2957
|
-
* data value modifications retrieved from the `EmbedEvent.TableVizRendered`
|
|
2958
|
-
* payload.For example, { columnDataLite: []}`.
|
|
2959
|
-
*/
|
|
2960
|
-
HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
|
|
2961
|
-
/**
|
|
2962
|
-
* Triggers the table visualization re-render with the updated data.
|
|
2963
|
-
* Includes the following properties:
|
|
2964
|
-
* @param - `columnDataLite` - an array of object containing the
|
|
2965
|
-
* data value modifications retrieved from the `EmbedEvent.TableVizRendered`
|
|
2966
|
-
* payload.For example, { columnDataLite: []}`.
|
|
2967
|
-
*/
|
|
2968
|
-
HostEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
|
|
2969
|
-
/**
|
|
2970
|
-
* Triggers the table visualization re-render with the updated data.
|
|
2971
|
-
* Includes the following properties:
|
|
2972
|
-
* @param - `columnDataLite` - an array of object containing the
|
|
2973
|
-
* data value modifications retrieved from the `EmbedEvent.TableVizRendered`
|
|
2974
|
-
* payload.For example, { columnDataLite: []}`.
|
|
2975
|
-
*/
|
|
2976
|
-
HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
|
|
2977
|
-
/**
|
|
2978
|
-
* Triggers the table visualization re-render with the updated data.
|
|
2979
|
-
* Includes the following properties:
|
|
2980
|
-
* @param - `columnDataLite` - an array of object containing the
|
|
2981
|
-
* data value modifications retrieved from the `EmbedEvent.TableVizRendered`
|
|
2982
|
-
* payload.For example, { columnDataLite: []}`.
|
|
2983
|
-
*/
|
|
2984
|
-
HostEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
|
|
2985
2959
|
})(HostEvent || (HostEvent = {}));
|
|
2986
2960
|
/**
|
|
2987
2961
|
* The different visual modes that the data sources panel within
|
|
@@ -7655,7 +7629,7 @@ class AnswerService {
|
|
|
7655
7629
|
async getTML() {
|
|
7656
7630
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
7657
7631
|
const edoc = object[0].edoc;
|
|
7658
|
-
const YAML = await import('./index-
|
|
7632
|
+
const YAML = await import('./index-BIcnpmMY.js');
|
|
7659
7633
|
const parsedDoc = YAML.parse(edoc);
|
|
7660
7634
|
return {
|
|
7661
7635
|
answer: {
|
|
@@ -15137,6 +15111,13 @@ const prefetch = (url, prefetchFeatures, additionalFlags) => {
|
|
|
15137
15111
|
iFrame.style.width = '0';
|
|
15138
15112
|
iFrame.style.height = '0';
|
|
15139
15113
|
iFrame.style.border = '0';
|
|
15114
|
+
// Make it 'fixed' to keep it in a different stacking context.
|
|
15115
|
+
// This should solve the focus behaviours inside the iframe from
|
|
15116
|
+
// interfering with main body.
|
|
15117
|
+
iFrame.style.position = 'fixed';
|
|
15118
|
+
// Push it out of viewport.
|
|
15119
|
+
iFrame.style.top = '100vh';
|
|
15120
|
+
iFrame.style.left = '100vw';
|
|
15140
15121
|
iFrame.classList.add('prefetchIframe');
|
|
15141
15122
|
iFrame.classList.add(`prefetchIframeNum-${index}`);
|
|
15142
15123
|
document.body.appendChild(iFrame);
|
|
@@ -15368,7 +15349,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
|
|
|
15368
15349
|
return e;
|
|
15369
15350
|
}
|
|
15370
15351
|
|
|
15371
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.
|
|
15352
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.38.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 . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run 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.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":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",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":"^1.1.1",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:"31 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};
|
|
15372
15353
|
|
|
15373
15354
|
/**
|
|
15374
15355
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -15602,11 +15583,13 @@ class TsEmbed {
|
|
|
15602
15583
|
* @param responder
|
|
15603
15584
|
*/
|
|
15604
15585
|
this.updateAuthToken = async (_, responder) => {
|
|
15605
|
-
const {
|
|
15606
|
-
|
|
15607
|
-
|
|
15586
|
+
const { authType } = this.embedConfig;
|
|
15587
|
+
let { autoLogin } = this.embedConfig;
|
|
15588
|
+
// Default autoLogin: true for cookieless if undefined/null, otherwise false
|
|
15589
|
+
autoLogin = autoLogin !== null && autoLogin !== void 0 ? autoLogin : (authType === AuthType.TrustedAuthTokenCookieless);
|
|
15590
|
+
if (autoLogin && authType === AuthType.TrustedAuthTokenCookieless) {
|
|
15608
15591
|
try {
|
|
15609
|
-
authToken = await getAuthenticationToken(this.embedConfig);
|
|
15592
|
+
const authToken = await getAuthenticationToken(this.embedConfig);
|
|
15610
15593
|
responder({
|
|
15611
15594
|
type: EmbedEvent.AuthExpire,
|
|
15612
15595
|
data: { authToken },
|
|
@@ -17086,6 +17069,31 @@ var HomePageSearchBarMode;
|
|
|
17086
17069
|
HomePageSearchBarMode["AI_ANSWER"] = "aiAnswer";
|
|
17087
17070
|
HomePageSearchBarMode["NONE"] = "none";
|
|
17088
17071
|
})(HomePageSearchBarMode || (HomePageSearchBarMode = {}));
|
|
17072
|
+
/**
|
|
17073
|
+
* Define the version of the primary navbar
|
|
17074
|
+
* @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
|
|
17075
|
+
*/
|
|
17076
|
+
var PrimaryNavbarVersion;
|
|
17077
|
+
(function (PrimaryNavbarVersion) {
|
|
17078
|
+
/**
|
|
17079
|
+
* Sliding (v3) introduces a new left-side navigation hub featuring a tab switcher,
|
|
17080
|
+
* along with updates to the top navigation bar.
|
|
17081
|
+
* It serves as the foundational version of the PrimaryNavBar.
|
|
17082
|
+
*/
|
|
17083
|
+
PrimaryNavbarVersion["Sliding"] = "v3";
|
|
17084
|
+
})(PrimaryNavbarVersion || (PrimaryNavbarVersion = {}));
|
|
17085
|
+
/**
|
|
17086
|
+
* Define the version of the home page
|
|
17087
|
+
* @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
|
|
17088
|
+
*/
|
|
17089
|
+
var HomePage;
|
|
17090
|
+
(function (HomePage) {
|
|
17091
|
+
/**
|
|
17092
|
+
* Modular (v2) introduces the updated Modular Home Experience.
|
|
17093
|
+
* It serves as the foundational version of the home page.
|
|
17094
|
+
*/
|
|
17095
|
+
HomePage["Modular"] = "v2";
|
|
17096
|
+
})(HomePage || (HomePage = {}));
|
|
17089
17097
|
/**
|
|
17090
17098
|
* Embeds full ThoughtSpot experience in a host application.
|
|
17091
17099
|
* @group Embed components
|
|
@@ -17140,9 +17148,9 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
17140
17148
|
* embedded Liveboard or visualization.
|
|
17141
17149
|
*/
|
|
17142
17150
|
getEmbedParams() {
|
|
17143
|
-
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false,
|
|
17151
|
+
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
|
|
17144
17152
|
/* eslint-disable-next-line max-len */
|
|
17145
|
-
dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, } = this.viewConfig;
|
|
17153
|
+
dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, } = this.viewConfig;
|
|
17146
17154
|
let params = {};
|
|
17147
17155
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
17148
17156
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -17159,9 +17167,6 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
17159
17167
|
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
17160
17168
|
params[Param.IsUnifiedSearchExperienceEnabled] = isUnifiedSearchExperienceEnabled;
|
|
17161
17169
|
params = this.getBaseQueryParams(params);
|
|
17162
|
-
if (modularHomeExperienceV3) {
|
|
17163
|
-
params[Param.NavigationVersion] = 'v3';
|
|
17164
|
-
}
|
|
17165
17170
|
if (hideObjectSearch) {
|
|
17166
17171
|
params[Param.HideObjectSearch] = !!hideObjectSearch;
|
|
17167
17172
|
}
|
|
@@ -17218,6 +17223,17 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
17218
17223
|
/* eslint-disable-next-line max-len */
|
|
17219
17224
|
params[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
|
|
17220
17225
|
}
|
|
17226
|
+
if (discoveryExperience) {
|
|
17227
|
+
// primaryNavbarVersion v3 will enabled the new left navigation
|
|
17228
|
+
if (discoveryExperience.primaryNavbarVersion === PrimaryNavbarVersion.Sliding) {
|
|
17229
|
+
params[Param.NavigationVersion] = discoveryExperience.primaryNavbarVersion;
|
|
17230
|
+
}
|
|
17231
|
+
// homePage v2 will enable the modular home page
|
|
17232
|
+
// and it will override the modularHomeExperience value
|
|
17233
|
+
if (discoveryExperience.homePage === HomePage.Modular) {
|
|
17234
|
+
params[Param.ModularHomeExperienceEnabled] = true;
|
|
17235
|
+
}
|
|
17236
|
+
}
|
|
17221
17237
|
const queryParams = getQueryParamString(params, true);
|
|
17222
17238
|
return queryParams;
|
|
17223
17239
|
}
|
|
@@ -17659,6 +17675,465 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
17659
17675
|
}
|
|
17660
17676
|
};
|
|
17661
17677
|
|
|
17678
|
+
const createConversation = `
|
|
17679
|
+
mutation CreateConversation($params: Input_convassist_CreateConversationRequest) {
|
|
17680
|
+
ConvAssist__createConversation(request: $params) {
|
|
17681
|
+
convId
|
|
17682
|
+
initialCtx {
|
|
17683
|
+
type
|
|
17684
|
+
tsAnsCtx {
|
|
17685
|
+
sessionId
|
|
17686
|
+
genNo
|
|
17687
|
+
stateKey {
|
|
17688
|
+
transactionId
|
|
17689
|
+
generationNumber
|
|
17690
|
+
}
|
|
17691
|
+
worksheet {
|
|
17692
|
+
worksheetId
|
|
17693
|
+
worksheetName
|
|
17694
|
+
}
|
|
17695
|
+
}
|
|
17696
|
+
}
|
|
17697
|
+
}
|
|
17698
|
+
}
|
|
17699
|
+
`;
|
|
17700
|
+
const sendMessage = `
|
|
17701
|
+
query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
17702
|
+
ConvAssist__sendMessage(request: $params) {
|
|
17703
|
+
responses {
|
|
17704
|
+
timestamp
|
|
17705
|
+
msgId
|
|
17706
|
+
data {
|
|
17707
|
+
asstRespData {
|
|
17708
|
+
tool
|
|
17709
|
+
asstRespText
|
|
17710
|
+
nlsAnsData {
|
|
17711
|
+
sageQuerySuggestions {
|
|
17712
|
+
sageQueryTokens {
|
|
17713
|
+
additions {
|
|
17714
|
+
phrase {
|
|
17715
|
+
isCompletePhrase
|
|
17716
|
+
numTokens
|
|
17717
|
+
phraseType
|
|
17718
|
+
startIndex
|
|
17719
|
+
__typename
|
|
17720
|
+
}
|
|
17721
|
+
tokens {
|
|
17722
|
+
token
|
|
17723
|
+
dataType
|
|
17724
|
+
typeEnum
|
|
17725
|
+
guid
|
|
17726
|
+
tokenMetadata {
|
|
17727
|
+
name
|
|
17728
|
+
__typename
|
|
17729
|
+
}
|
|
17730
|
+
__typename
|
|
17731
|
+
}
|
|
17732
|
+
__typename
|
|
17733
|
+
}
|
|
17734
|
+
phrases {
|
|
17735
|
+
isCompletePhrase
|
|
17736
|
+
numTokens
|
|
17737
|
+
phraseType
|
|
17738
|
+
startIndex
|
|
17739
|
+
__typename
|
|
17740
|
+
}
|
|
17741
|
+
removals {
|
|
17742
|
+
phrase {
|
|
17743
|
+
isCompletePhrase
|
|
17744
|
+
numTokens
|
|
17745
|
+
phraseType
|
|
17746
|
+
startIndex
|
|
17747
|
+
__typename
|
|
17748
|
+
}
|
|
17749
|
+
tokens {
|
|
17750
|
+
token
|
|
17751
|
+
dataType
|
|
17752
|
+
typeEnum
|
|
17753
|
+
guid
|
|
17754
|
+
tokenMetadata {
|
|
17755
|
+
name
|
|
17756
|
+
__typename
|
|
17757
|
+
}
|
|
17758
|
+
__typename
|
|
17759
|
+
}
|
|
17760
|
+
__typename
|
|
17761
|
+
}
|
|
17762
|
+
tokens {
|
|
17763
|
+
token
|
|
17764
|
+
dataType
|
|
17765
|
+
typeEnum
|
|
17766
|
+
guid
|
|
17767
|
+
tokenMetadata {
|
|
17768
|
+
name
|
|
17769
|
+
__typename
|
|
17770
|
+
}
|
|
17771
|
+
__typename
|
|
17772
|
+
}
|
|
17773
|
+
__typename
|
|
17774
|
+
}
|
|
17775
|
+
llmReasoning {
|
|
17776
|
+
assumptions
|
|
17777
|
+
clarifications
|
|
17778
|
+
interpretation
|
|
17779
|
+
__typename
|
|
17780
|
+
}
|
|
17781
|
+
tokens
|
|
17782
|
+
tmlTokens
|
|
17783
|
+
worksheetId
|
|
17784
|
+
tokens
|
|
17785
|
+
description
|
|
17786
|
+
title
|
|
17787
|
+
tmlTokens
|
|
17788
|
+
cached
|
|
17789
|
+
sqlQuery
|
|
17790
|
+
sessionId
|
|
17791
|
+
genNo
|
|
17792
|
+
formulaInfo {
|
|
17793
|
+
name
|
|
17794
|
+
expression
|
|
17795
|
+
__typename
|
|
17796
|
+
}
|
|
17797
|
+
tmlPhrases
|
|
17798
|
+
ambiguousPhrases {
|
|
17799
|
+
alternativePhrases {
|
|
17800
|
+
phraseType
|
|
17801
|
+
token {
|
|
17802
|
+
token
|
|
17803
|
+
dataType
|
|
17804
|
+
typeEnum
|
|
17805
|
+
guid
|
|
17806
|
+
tokenMetadata {
|
|
17807
|
+
name
|
|
17808
|
+
__typename
|
|
17809
|
+
}
|
|
17810
|
+
__typename
|
|
17811
|
+
}
|
|
17812
|
+
__typename
|
|
17813
|
+
}
|
|
17814
|
+
ambiguityType
|
|
17815
|
+
token {
|
|
17816
|
+
token
|
|
17817
|
+
dataType
|
|
17818
|
+
typeEnum
|
|
17819
|
+
guid
|
|
17820
|
+
tokenMetadata {
|
|
17821
|
+
name
|
|
17822
|
+
__typename
|
|
17823
|
+
}
|
|
17824
|
+
__typename
|
|
17825
|
+
}
|
|
17826
|
+
__typename
|
|
17827
|
+
}
|
|
17828
|
+
ambiguousTokens {
|
|
17829
|
+
alternativeTokens {
|
|
17830
|
+
token
|
|
17831
|
+
dataType
|
|
17832
|
+
typeEnum
|
|
17833
|
+
guid
|
|
17834
|
+
tokenMetadata {
|
|
17835
|
+
name
|
|
17836
|
+
deprecatedTableGuid
|
|
17837
|
+
deprecatedTableName
|
|
17838
|
+
isFormula
|
|
17839
|
+
rootTables {
|
|
17840
|
+
created
|
|
17841
|
+
description
|
|
17842
|
+
guid
|
|
17843
|
+
indexVersion
|
|
17844
|
+
modified
|
|
17845
|
+
name
|
|
17846
|
+
__typename
|
|
17847
|
+
}
|
|
17848
|
+
schemaTableUserDefinedName
|
|
17849
|
+
table {
|
|
17850
|
+
created
|
|
17851
|
+
description
|
|
17852
|
+
guid
|
|
17853
|
+
indexVersion
|
|
17854
|
+
modified
|
|
17855
|
+
name
|
|
17856
|
+
__typename
|
|
17857
|
+
}
|
|
17858
|
+
__typename
|
|
17859
|
+
}
|
|
17860
|
+
__typename
|
|
17861
|
+
}
|
|
17862
|
+
ambiguityType
|
|
17863
|
+
token {
|
|
17864
|
+
token
|
|
17865
|
+
dataType
|
|
17866
|
+
typeEnum
|
|
17867
|
+
guid
|
|
17868
|
+
tokenMetadata {
|
|
17869
|
+
name
|
|
17870
|
+
__typename
|
|
17871
|
+
}
|
|
17872
|
+
__typename
|
|
17873
|
+
}
|
|
17874
|
+
__typename
|
|
17875
|
+
}
|
|
17876
|
+
stateKey {
|
|
17877
|
+
transactionId
|
|
17878
|
+
generationNumber
|
|
17879
|
+
transactionId
|
|
17880
|
+
__typename
|
|
17881
|
+
}
|
|
17882
|
+
subQueries {
|
|
17883
|
+
tokens
|
|
17884
|
+
cohortConfig {
|
|
17885
|
+
anchorColumnId
|
|
17886
|
+
cohortAnswerGuid
|
|
17887
|
+
cohortGroupingType
|
|
17888
|
+
cohortGuid
|
|
17889
|
+
cohortType
|
|
17890
|
+
combineNonGroupValues
|
|
17891
|
+
description
|
|
17892
|
+
groupExcludedQueryValues
|
|
17893
|
+
hideExcludedQueryValues
|
|
17894
|
+
isEditable
|
|
17895
|
+
name
|
|
17896
|
+
nullOutputValue
|
|
17897
|
+
returnColumnId
|
|
17898
|
+
__typename
|
|
17899
|
+
}
|
|
17900
|
+
formulas {
|
|
17901
|
+
name
|
|
17902
|
+
expression
|
|
17903
|
+
__typename
|
|
17904
|
+
}
|
|
17905
|
+
__typename
|
|
17906
|
+
}
|
|
17907
|
+
visualizationSuggestion {
|
|
17908
|
+
chartType
|
|
17909
|
+
displayMode
|
|
17910
|
+
axisConfigs {
|
|
17911
|
+
category
|
|
17912
|
+
color
|
|
17913
|
+
hidden
|
|
17914
|
+
size
|
|
17915
|
+
sort
|
|
17916
|
+
x
|
|
17917
|
+
y
|
|
17918
|
+
__typename
|
|
17919
|
+
}
|
|
17920
|
+
usersVizIntentApplied
|
|
17921
|
+
customChartConfigs {
|
|
17922
|
+
dimensions {
|
|
17923
|
+
columns
|
|
17924
|
+
key
|
|
17925
|
+
__typename
|
|
17926
|
+
}
|
|
17927
|
+
key
|
|
17928
|
+
__typename
|
|
17929
|
+
}
|
|
17930
|
+
customChartGuid
|
|
17931
|
+
__typename
|
|
17932
|
+
}
|
|
17933
|
+
tableData {
|
|
17934
|
+
columnDataLite {
|
|
17935
|
+
columnId
|
|
17936
|
+
columnDataType
|
|
17937
|
+
dataValue
|
|
17938
|
+
columnName
|
|
17939
|
+
__typename
|
|
17940
|
+
}
|
|
17941
|
+
__typename
|
|
17942
|
+
}
|
|
17943
|
+
warningType
|
|
17944
|
+
cached
|
|
17945
|
+
__typename
|
|
17946
|
+
}
|
|
17947
|
+
debugInfo {
|
|
17948
|
+
fewShotExamples {
|
|
17949
|
+
chartType
|
|
17950
|
+
id
|
|
17951
|
+
mappingId
|
|
17952
|
+
nlQuery
|
|
17953
|
+
nlQueryConcepts
|
|
17954
|
+
sageQuery
|
|
17955
|
+
scope
|
|
17956
|
+
sql
|
|
17957
|
+
tml
|
|
17958
|
+
__typename
|
|
17959
|
+
}
|
|
17960
|
+
__typename
|
|
17961
|
+
}
|
|
17962
|
+
__typename
|
|
17963
|
+
}
|
|
17964
|
+
__typename
|
|
17965
|
+
}
|
|
17966
|
+
errorData {
|
|
17967
|
+
tool
|
|
17968
|
+
errCode
|
|
17969
|
+
errTxt
|
|
17970
|
+
toolErrCode
|
|
17971
|
+
__typename
|
|
17972
|
+
}
|
|
17973
|
+
__typename
|
|
17974
|
+
}
|
|
17975
|
+
type
|
|
17976
|
+
__typename
|
|
17977
|
+
}
|
|
17978
|
+
prevCtx {
|
|
17979
|
+
genNo
|
|
17980
|
+
sessionId
|
|
17981
|
+
__typename
|
|
17982
|
+
}
|
|
17983
|
+
__typename
|
|
17984
|
+
}
|
|
17985
|
+
}
|
|
17986
|
+
`;
|
|
17987
|
+
|
|
17988
|
+
class Conversation {
|
|
17989
|
+
constructor(thoughtSpotHost, worksheetId) {
|
|
17990
|
+
this.thoughtSpotHost = thoughtSpotHost;
|
|
17991
|
+
this.worksheetId = worksheetId;
|
|
17992
|
+
this.inProgress = null;
|
|
17993
|
+
this.inProgress = this.init();
|
|
17994
|
+
}
|
|
17995
|
+
async init() {
|
|
17996
|
+
const { convId } = await this.createConversation();
|
|
17997
|
+
this.conversationId = convId;
|
|
17998
|
+
}
|
|
17999
|
+
createConversation() {
|
|
18000
|
+
return this.executeQuery(createConversation, {
|
|
18001
|
+
params: {
|
|
18002
|
+
initialCtx: {
|
|
18003
|
+
tsWorksheetCtx: {
|
|
18004
|
+
worksheet: {
|
|
18005
|
+
worksheetId: this.worksheetId,
|
|
18006
|
+
},
|
|
18007
|
+
},
|
|
18008
|
+
type: 'TS_WORKSHEET',
|
|
18009
|
+
},
|
|
18010
|
+
userInfo: {
|
|
18011
|
+
tenantUrl: `${this.thoughtSpotHost}/prism`,
|
|
18012
|
+
},
|
|
18013
|
+
},
|
|
18014
|
+
});
|
|
18015
|
+
}
|
|
18016
|
+
async sendMessage(userMessage) {
|
|
18017
|
+
await this.inProgress;
|
|
18018
|
+
try {
|
|
18019
|
+
const { responses } = await this.executeQuery(sendMessage, {
|
|
18020
|
+
params: {
|
|
18021
|
+
convId: this.conversationId,
|
|
18022
|
+
headers: [],
|
|
18023
|
+
msg: {
|
|
18024
|
+
data: {
|
|
18025
|
+
userCmdData: {
|
|
18026
|
+
cmdText: userMessage,
|
|
18027
|
+
nlsData: {
|
|
18028
|
+
worksheetId: this.worksheetId,
|
|
18029
|
+
questionType: 'ANSWER_SPEC_GENERATION',
|
|
18030
|
+
},
|
|
18031
|
+
},
|
|
18032
|
+
},
|
|
18033
|
+
msgId: crypto.randomUUID(),
|
|
18034
|
+
type: 'USER_COMMAND',
|
|
18035
|
+
},
|
|
18036
|
+
},
|
|
18037
|
+
});
|
|
18038
|
+
const data = responses[0].data;
|
|
18039
|
+
return {
|
|
18040
|
+
data: data.asstRespData.nlsAnsData.sageQuerySuggestions[0],
|
|
18041
|
+
error: null,
|
|
18042
|
+
};
|
|
18043
|
+
}
|
|
18044
|
+
catch (error) {
|
|
18045
|
+
return { error };
|
|
18046
|
+
}
|
|
18047
|
+
}
|
|
18048
|
+
async executeQuery(query, variables) {
|
|
18049
|
+
return graphqlQuery({
|
|
18050
|
+
query,
|
|
18051
|
+
variables,
|
|
18052
|
+
thoughtSpotHost: this.thoughtSpotHost,
|
|
18053
|
+
isCompositeQuery: false,
|
|
18054
|
+
});
|
|
18055
|
+
}
|
|
18056
|
+
}
|
|
18057
|
+
|
|
18058
|
+
class ConversationMessage extends TsEmbed {
|
|
18059
|
+
constructor(container, viewConfig) {
|
|
18060
|
+
viewConfig.embedComponentType = 'bodyless-conversation';
|
|
18061
|
+
super(container, viewConfig);
|
|
18062
|
+
this.viewConfig = viewConfig;
|
|
18063
|
+
}
|
|
18064
|
+
getIframeSrc() {
|
|
18065
|
+
var _a;
|
|
18066
|
+
const { sessionId, genNo, acSessionId, acGenNo, } = this.viewConfig;
|
|
18067
|
+
const path = 'conv-assist-answer';
|
|
18068
|
+
const queryParams = this.getBaseQueryParams();
|
|
18069
|
+
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
18070
|
+
queryParams[Param.isSpotterAgentEmbed] = true;
|
|
18071
|
+
let query = '';
|
|
18072
|
+
const queryParamsString = getQueryParamString(queryParams, true);
|
|
18073
|
+
if (queryParamsString) {
|
|
18074
|
+
query = `?${queryParamsString}`;
|
|
18075
|
+
}
|
|
18076
|
+
const tsPostHashParams = this.getThoughtSpotPostUrlParams({
|
|
18077
|
+
sessionId,
|
|
18078
|
+
genNo,
|
|
18079
|
+
acSessionId,
|
|
18080
|
+
acGenNo,
|
|
18081
|
+
});
|
|
18082
|
+
return `${this.getEmbedBasePath(query)}/embed/${path}${tsPostHashParams}`;
|
|
18083
|
+
}
|
|
18084
|
+
async render() {
|
|
18085
|
+
await super.render();
|
|
18086
|
+
const src = this.getIframeSrc();
|
|
18087
|
+
await this.renderIFrame(src);
|
|
18088
|
+
return this;
|
|
18089
|
+
}
|
|
18090
|
+
}
|
|
18091
|
+
/**
|
|
18092
|
+
* Create a conversation embed, which can be integrated inside
|
|
18093
|
+
* chatbots or other conversational interfaces.
|
|
18094
|
+
* @example
|
|
18095
|
+
* ```js
|
|
18096
|
+
* import { SpotterAgentEmbed } from '@thoughtspot/visual-embed-sdk';
|
|
18097
|
+
*
|
|
18098
|
+
* const conversation = new SpotterAgentEmbed({
|
|
18099
|
+
* worksheetId: 'worksheetId',
|
|
18100
|
+
* });
|
|
18101
|
+
*
|
|
18102
|
+
* const { container, error } = await conversation.sendMessage('show me sales by region');
|
|
18103
|
+
*
|
|
18104
|
+
* // append the container to the DOM
|
|
18105
|
+
* document.body.appendChild(container); // or to any other element
|
|
18106
|
+
* ```
|
|
18107
|
+
* @group Embed components
|
|
18108
|
+
* @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
|
|
18109
|
+
*/
|
|
18110
|
+
let SpotterAgentEmbed$1 = class SpotterAgentEmbed {
|
|
18111
|
+
constructor(viewConfig) {
|
|
18112
|
+
this.viewConfig = viewConfig;
|
|
18113
|
+
const embedConfig = getEmbedConfig();
|
|
18114
|
+
this.conversationService = new Conversation(embedConfig.thoughtSpotHost, viewConfig.worksheetId);
|
|
18115
|
+
}
|
|
18116
|
+
async sendMessage(userMessage) {
|
|
18117
|
+
const { data, error } = await this.conversationService.sendMessage(userMessage);
|
|
18118
|
+
if (error) {
|
|
18119
|
+
return { error };
|
|
18120
|
+
}
|
|
18121
|
+
const container = document.createElement('div');
|
|
18122
|
+
if (this.viewConfig.containerClassName) {
|
|
18123
|
+
container.className = this.viewConfig.containerClassName;
|
|
18124
|
+
}
|
|
18125
|
+
const embed = new ConversationMessage(container, {
|
|
18126
|
+
...this.viewConfig,
|
|
18127
|
+
sessionId: data.sessionId,
|
|
18128
|
+
genNo: data.genNo,
|
|
18129
|
+
acSessionId: data.stateKey.transactionId,
|
|
18130
|
+
acGenNo: data.stateKey.generationNumber,
|
|
18131
|
+
});
|
|
18132
|
+
await embed.render();
|
|
18133
|
+
return { container, viz: embed };
|
|
18134
|
+
}
|
|
18135
|
+
};
|
|
18136
|
+
|
|
17662
18137
|
/**
|
|
17663
18138
|
*
|
|
17664
18139
|
* @param props
|
|
@@ -17715,7 +18190,7 @@ var isUndefined_1 = isUndefined;
|
|
|
17715
18190
|
* });
|
|
17716
18191
|
* conversation.render();
|
|
17717
18192
|
* ```
|
|
17718
|
-
* @version SDK: 1.
|
|
18193
|
+
* @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
|
|
17719
18194
|
*/
|
|
17720
18195
|
let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
|
|
17721
18196
|
constructor(container, viewConfig) {
|
|
@@ -17766,7 +18241,8 @@ let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
|
|
|
17766
18241
|
};
|
|
17767
18242
|
/**
|
|
17768
18243
|
* Embed ThoughtSpot AI Conversation.
|
|
17769
|
-
* @deprecated
|
|
18244
|
+
* @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
|
|
18245
|
+
* Use {@link SpotterEmbed} instead
|
|
17770
18246
|
* @group Embed components
|
|
17771
18247
|
* @example
|
|
17772
18248
|
* ```js
|
|
@@ -18015,7 +18491,8 @@ const PreRenderedSageEmbed = componentFactory(SageEmbed$1, true);
|
|
|
18015
18491
|
const SpotterEmbed = componentFactory(SpotterEmbed$1);
|
|
18016
18492
|
/**
|
|
18017
18493
|
* React component for LLM based conversation BI.
|
|
18018
|
-
* @deprecated
|
|
18494
|
+
* @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
|
|
18495
|
+
* Use {@link SpotterEmbed} instead
|
|
18019
18496
|
* @example
|
|
18020
18497
|
* ```tsx
|
|
18021
18498
|
* function Sage() {
|
|
@@ -18030,6 +18507,56 @@ const SpotterEmbed = componentFactory(SpotterEmbed$1);
|
|
|
18030
18507
|
* ```
|
|
18031
18508
|
*/
|
|
18032
18509
|
const ConversationEmbed = componentFactory(ConversationEmbed$1);
|
|
18510
|
+
/**
|
|
18511
|
+
* React component for SpotterAgent embed, which can be integrated inside
|
|
18512
|
+
* chatbots or other conversational interfaces.
|
|
18513
|
+
* @example
|
|
18514
|
+
* ```tsx
|
|
18515
|
+
* function SpotterAgent() {
|
|
18516
|
+
* const ref = useRef();
|
|
18517
|
+
*
|
|
18518
|
+
* const handleSendMessage = async () => {
|
|
18519
|
+
* const { container, error } = await ref.current.sendMessage('show me sales by region');
|
|
18520
|
+
* if (container) {
|
|
18521
|
+
* document.body.appendChild(container);
|
|
18522
|
+
* }
|
|
18523
|
+
* };
|
|
18524
|
+
*
|
|
18525
|
+
* return (
|
|
18526
|
+
* <div>
|
|
18527
|
+
* <SpotterAgentEmbed ref={ref} worksheetId="worksheetId" />
|
|
18528
|
+
* <button onClick={handleSendMessage}>Send Message</button>
|
|
18529
|
+
* </div>
|
|
18530
|
+
* );
|
|
18531
|
+
* }
|
|
18532
|
+
* ```
|
|
18533
|
+
*/
|
|
18534
|
+
const SpotterAgentEmbed = React__default.forwardRef((props, ref) => {
|
|
18535
|
+
const { className, ...restProps } = props;
|
|
18536
|
+
const serviceRef = useRef(null);
|
|
18537
|
+
useDeepCompareEffect(() => {
|
|
18538
|
+
if (serviceRef.current) {
|
|
18539
|
+
serviceRef.current = null;
|
|
18540
|
+
}
|
|
18541
|
+
const configProps = {
|
|
18542
|
+
...restProps,
|
|
18543
|
+
...(className ? { containerClassName: className } : {})
|
|
18544
|
+
};
|
|
18545
|
+
serviceRef.current = new SpotterAgentEmbed$1(configProps);
|
|
18546
|
+
if (ref) {
|
|
18547
|
+
if (typeof ref === 'function') {
|
|
18548
|
+
ref(serviceRef.current);
|
|
18549
|
+
}
|
|
18550
|
+
else {
|
|
18551
|
+
ref.current = serviceRef.current;
|
|
18552
|
+
}
|
|
18553
|
+
}
|
|
18554
|
+
return () => {
|
|
18555
|
+
serviceRef.current = null;
|
|
18556
|
+
};
|
|
18557
|
+
}, [props]);
|
|
18558
|
+
return null;
|
|
18559
|
+
});
|
|
18033
18560
|
/**
|
|
18034
18561
|
* React component for PreRendered Conversation embed.
|
|
18035
18562
|
*
|
|
@@ -18090,4 +18617,4 @@ function useInit(config) {
|
|
|
18090
18617
|
return ref;
|
|
18091
18618
|
}
|
|
18092
18619
|
|
|
18093
|
-
export { Action, AppEmbed, ConversationEmbed, EmbedEvent, HomeLeftNavItem, HomepageModule, HostEvent, ListPageColumns, LiveboardEmbed, LogLevel, Page, PinboardEmbed, PreRenderedAppEmbed, PreRenderedConversationEmbed, PreRenderedLiveboardEmbed, PreRenderedPinboardEmbed, PreRenderedSageEmbed, PreRenderedSearchBarEmbed, PreRenderedSearchEmbed, RuntimeFilterOp, SageEmbed, SearchBarEmbed, SearchEmbed, SpotterEmbed, getSessionInfo, useEmbedRef, useInit };
|
|
18620
|
+
export { Action, AppEmbed, ConversationEmbed, EmbedEvent, HomeLeftNavItem, HomepageModule, HostEvent, ListPageColumns, LiveboardEmbed, LogLevel, Page, PinboardEmbed, PreRenderedAppEmbed, PreRenderedConversationEmbed, PreRenderedLiveboardEmbed, PreRenderedPinboardEmbed, PreRenderedSageEmbed, PreRenderedSearchBarEmbed, PreRenderedSearchEmbed, RuntimeFilterOp, SageEmbed, SearchBarEmbed, SearchEmbed, SpotterAgentEmbed, SpotterEmbed, getSessionInfo, useEmbedRef, useInit };
|