@thoughtspot/visual-embed-sdk 1.37.1-spotter-embed → 1.38.0-alpha.1
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/README.md +1 -1
- 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 +40 -7
- 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/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +21 -10
- package/cjs/src/embed/liveboard.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-Cj4BVGHL.js → index-DeFzsyFF.js} +1 -1
- package/dist/{index-DnIvX1FR.js → index-NZYq1Tu3.js} +1 -2
- 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/liveboard.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 +614 -77
- package/dist/tsembed-react.js +758 -296
- package/dist/tsembed.es.js +153 -75
- package/dist/tsembed.js +297 -295
- 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 +39 -6
- 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/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +21 -10
- package/lib/src/embed/liveboard.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 +62 -9
- 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/liveboard.ts +25 -10
- 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-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-alpha.1 */
|
|
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-DeFzsyFF.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-alpha.1";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","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
|
|
@@ -17110,7 +17118,7 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
17110
17118
|
responder({ type: EmbedEvent.EmbedIframeCenter, data: obj });
|
|
17111
17119
|
};
|
|
17112
17120
|
this.setIframeHeightForNonEmbedLiveboard = (data) => {
|
|
17113
|
-
const { height: frameHeight
|
|
17121
|
+
const { height: frameHeight } = this.viewConfig.frameParams || {};
|
|
17114
17122
|
const liveboardRelatedRoutes = [
|
|
17115
17123
|
'/pinboard/',
|
|
17116
17124
|
'/insights/pinboard/',
|
|
@@ -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
|
}
|
|
@@ -17397,12 +17413,6 @@ const addPreviewStylesIfNotPresent = () => {
|
|
|
17397
17413
|
* @summary Liveboard & visualization embed
|
|
17398
17414
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
17399
17415
|
*/
|
|
17400
|
-
const liveboardHeightWhitelistedRoutes = [
|
|
17401
|
-
'/embed/viz/',
|
|
17402
|
-
'/embed/insights/viz/',
|
|
17403
|
-
'/tsl-editor/PINBOARD_ANSWER_BOOK/',
|
|
17404
|
-
'/import-tsl/PINBOARD_ANSWER_BOOK/',
|
|
17405
|
-
];
|
|
17406
17416
|
/**
|
|
17407
17417
|
* Embed a ThoughtSpot Liveboard or visualization. When rendered it already
|
|
17408
17418
|
* waits for the authentication to complete, so you need not wait for
|
|
@@ -17419,7 +17429,6 @@ const liveboardHeightWhitelistedRoutes = [
|
|
|
17419
17429
|
* @group Embed components
|
|
17420
17430
|
*/
|
|
17421
17431
|
let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
17422
|
-
// eslint-disable-next-line no-useless-constructor
|
|
17423
17432
|
constructor(domSelector, viewConfig) {
|
|
17424
17433
|
viewConfig.embedComponentType = 'LiveboardEmbed';
|
|
17425
17434
|
super(domSelector, viewConfig);
|
|
@@ -17437,13 +17446,30 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
17437
17446
|
responder({ type: EmbedEvent.EmbedIframeCenter, data: obj });
|
|
17438
17447
|
};
|
|
17439
17448
|
this.setIframeHeightForNonEmbedLiveboard = (data) => {
|
|
17440
|
-
const
|
|
17441
|
-
|
|
17449
|
+
const { height: frameHeight } = this.viewConfig.frameParams || {};
|
|
17450
|
+
const liveboardRelatedRoutes = [
|
|
17451
|
+
'/pinboard/',
|
|
17452
|
+
'/insights/pinboard/',
|
|
17453
|
+
'/schedules/',
|
|
17454
|
+
'/embed/viz/',
|
|
17455
|
+
'/embed/insights/viz/',
|
|
17456
|
+
'/liveboard/',
|
|
17457
|
+
'/insights/liveboard/',
|
|
17458
|
+
'/tsl-editor/PINBOARD_ANSWER_BOOK/',
|
|
17459
|
+
'/import-tsl/PINBOARD_ANSWER_BOOK/',
|
|
17460
|
+
];
|
|
17461
|
+
if (liveboardRelatedRoutes.some((path) => data.data.currentPath.startsWith(path))) {
|
|
17462
|
+
// Ignore the height reset of the frame, if the navigation is
|
|
17463
|
+
// only within the liveboard page.
|
|
17442
17464
|
return;
|
|
17443
17465
|
}
|
|
17444
|
-
this.setIFrameHeight(this.defaultHeight);
|
|
17466
|
+
this.setIFrameHeight(frameHeight || this.defaultHeight);
|
|
17445
17467
|
};
|
|
17446
17468
|
if (this.viewConfig.fullHeight === true) {
|
|
17469
|
+
if (this.viewConfig.vizId) {
|
|
17470
|
+
logger$3.warn('Full height is currently only supported for Liveboard embeds.' +
|
|
17471
|
+
'Using full height with vizId might lead to unexpected behavior.');
|
|
17472
|
+
}
|
|
17447
17473
|
this.on(EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
|
|
17448
17474
|
this.on(EmbedEvent.EmbedHeight, this.updateIFrameHeight);
|
|
17449
17475
|
this.on(EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
|
|
@@ -17659,6 +17685,465 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
17659
17685
|
}
|
|
17660
17686
|
};
|
|
17661
17687
|
|
|
17688
|
+
const createConversation = `
|
|
17689
|
+
mutation CreateConversation($params: Input_convassist_CreateConversationRequest) {
|
|
17690
|
+
ConvAssist__createConversation(request: $params) {
|
|
17691
|
+
convId
|
|
17692
|
+
initialCtx {
|
|
17693
|
+
type
|
|
17694
|
+
tsAnsCtx {
|
|
17695
|
+
sessionId
|
|
17696
|
+
genNo
|
|
17697
|
+
stateKey {
|
|
17698
|
+
transactionId
|
|
17699
|
+
generationNumber
|
|
17700
|
+
}
|
|
17701
|
+
worksheet {
|
|
17702
|
+
worksheetId
|
|
17703
|
+
worksheetName
|
|
17704
|
+
}
|
|
17705
|
+
}
|
|
17706
|
+
}
|
|
17707
|
+
}
|
|
17708
|
+
}
|
|
17709
|
+
`;
|
|
17710
|
+
const sendMessage = `
|
|
17711
|
+
query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
17712
|
+
ConvAssist__sendMessage(request: $params) {
|
|
17713
|
+
responses {
|
|
17714
|
+
timestamp
|
|
17715
|
+
msgId
|
|
17716
|
+
data {
|
|
17717
|
+
asstRespData {
|
|
17718
|
+
tool
|
|
17719
|
+
asstRespText
|
|
17720
|
+
nlsAnsData {
|
|
17721
|
+
sageQuerySuggestions {
|
|
17722
|
+
sageQueryTokens {
|
|
17723
|
+
additions {
|
|
17724
|
+
phrase {
|
|
17725
|
+
isCompletePhrase
|
|
17726
|
+
numTokens
|
|
17727
|
+
phraseType
|
|
17728
|
+
startIndex
|
|
17729
|
+
__typename
|
|
17730
|
+
}
|
|
17731
|
+
tokens {
|
|
17732
|
+
token
|
|
17733
|
+
dataType
|
|
17734
|
+
typeEnum
|
|
17735
|
+
guid
|
|
17736
|
+
tokenMetadata {
|
|
17737
|
+
name
|
|
17738
|
+
__typename
|
|
17739
|
+
}
|
|
17740
|
+
__typename
|
|
17741
|
+
}
|
|
17742
|
+
__typename
|
|
17743
|
+
}
|
|
17744
|
+
phrases {
|
|
17745
|
+
isCompletePhrase
|
|
17746
|
+
numTokens
|
|
17747
|
+
phraseType
|
|
17748
|
+
startIndex
|
|
17749
|
+
__typename
|
|
17750
|
+
}
|
|
17751
|
+
removals {
|
|
17752
|
+
phrase {
|
|
17753
|
+
isCompletePhrase
|
|
17754
|
+
numTokens
|
|
17755
|
+
phraseType
|
|
17756
|
+
startIndex
|
|
17757
|
+
__typename
|
|
17758
|
+
}
|
|
17759
|
+
tokens {
|
|
17760
|
+
token
|
|
17761
|
+
dataType
|
|
17762
|
+
typeEnum
|
|
17763
|
+
guid
|
|
17764
|
+
tokenMetadata {
|
|
17765
|
+
name
|
|
17766
|
+
__typename
|
|
17767
|
+
}
|
|
17768
|
+
__typename
|
|
17769
|
+
}
|
|
17770
|
+
__typename
|
|
17771
|
+
}
|
|
17772
|
+
tokens {
|
|
17773
|
+
token
|
|
17774
|
+
dataType
|
|
17775
|
+
typeEnum
|
|
17776
|
+
guid
|
|
17777
|
+
tokenMetadata {
|
|
17778
|
+
name
|
|
17779
|
+
__typename
|
|
17780
|
+
}
|
|
17781
|
+
__typename
|
|
17782
|
+
}
|
|
17783
|
+
__typename
|
|
17784
|
+
}
|
|
17785
|
+
llmReasoning {
|
|
17786
|
+
assumptions
|
|
17787
|
+
clarifications
|
|
17788
|
+
interpretation
|
|
17789
|
+
__typename
|
|
17790
|
+
}
|
|
17791
|
+
tokens
|
|
17792
|
+
tmlTokens
|
|
17793
|
+
worksheetId
|
|
17794
|
+
tokens
|
|
17795
|
+
description
|
|
17796
|
+
title
|
|
17797
|
+
tmlTokens
|
|
17798
|
+
cached
|
|
17799
|
+
sqlQuery
|
|
17800
|
+
sessionId
|
|
17801
|
+
genNo
|
|
17802
|
+
formulaInfo {
|
|
17803
|
+
name
|
|
17804
|
+
expression
|
|
17805
|
+
__typename
|
|
17806
|
+
}
|
|
17807
|
+
tmlPhrases
|
|
17808
|
+
ambiguousPhrases {
|
|
17809
|
+
alternativePhrases {
|
|
17810
|
+
phraseType
|
|
17811
|
+
token {
|
|
17812
|
+
token
|
|
17813
|
+
dataType
|
|
17814
|
+
typeEnum
|
|
17815
|
+
guid
|
|
17816
|
+
tokenMetadata {
|
|
17817
|
+
name
|
|
17818
|
+
__typename
|
|
17819
|
+
}
|
|
17820
|
+
__typename
|
|
17821
|
+
}
|
|
17822
|
+
__typename
|
|
17823
|
+
}
|
|
17824
|
+
ambiguityType
|
|
17825
|
+
token {
|
|
17826
|
+
token
|
|
17827
|
+
dataType
|
|
17828
|
+
typeEnum
|
|
17829
|
+
guid
|
|
17830
|
+
tokenMetadata {
|
|
17831
|
+
name
|
|
17832
|
+
__typename
|
|
17833
|
+
}
|
|
17834
|
+
__typename
|
|
17835
|
+
}
|
|
17836
|
+
__typename
|
|
17837
|
+
}
|
|
17838
|
+
ambiguousTokens {
|
|
17839
|
+
alternativeTokens {
|
|
17840
|
+
token
|
|
17841
|
+
dataType
|
|
17842
|
+
typeEnum
|
|
17843
|
+
guid
|
|
17844
|
+
tokenMetadata {
|
|
17845
|
+
name
|
|
17846
|
+
deprecatedTableGuid
|
|
17847
|
+
deprecatedTableName
|
|
17848
|
+
isFormula
|
|
17849
|
+
rootTables {
|
|
17850
|
+
created
|
|
17851
|
+
description
|
|
17852
|
+
guid
|
|
17853
|
+
indexVersion
|
|
17854
|
+
modified
|
|
17855
|
+
name
|
|
17856
|
+
__typename
|
|
17857
|
+
}
|
|
17858
|
+
schemaTableUserDefinedName
|
|
17859
|
+
table {
|
|
17860
|
+
created
|
|
17861
|
+
description
|
|
17862
|
+
guid
|
|
17863
|
+
indexVersion
|
|
17864
|
+
modified
|
|
17865
|
+
name
|
|
17866
|
+
__typename
|
|
17867
|
+
}
|
|
17868
|
+
__typename
|
|
17869
|
+
}
|
|
17870
|
+
__typename
|
|
17871
|
+
}
|
|
17872
|
+
ambiguityType
|
|
17873
|
+
token {
|
|
17874
|
+
token
|
|
17875
|
+
dataType
|
|
17876
|
+
typeEnum
|
|
17877
|
+
guid
|
|
17878
|
+
tokenMetadata {
|
|
17879
|
+
name
|
|
17880
|
+
__typename
|
|
17881
|
+
}
|
|
17882
|
+
__typename
|
|
17883
|
+
}
|
|
17884
|
+
__typename
|
|
17885
|
+
}
|
|
17886
|
+
stateKey {
|
|
17887
|
+
transactionId
|
|
17888
|
+
generationNumber
|
|
17889
|
+
transactionId
|
|
17890
|
+
__typename
|
|
17891
|
+
}
|
|
17892
|
+
subQueries {
|
|
17893
|
+
tokens
|
|
17894
|
+
cohortConfig {
|
|
17895
|
+
anchorColumnId
|
|
17896
|
+
cohortAnswerGuid
|
|
17897
|
+
cohortGroupingType
|
|
17898
|
+
cohortGuid
|
|
17899
|
+
cohortType
|
|
17900
|
+
combineNonGroupValues
|
|
17901
|
+
description
|
|
17902
|
+
groupExcludedQueryValues
|
|
17903
|
+
hideExcludedQueryValues
|
|
17904
|
+
isEditable
|
|
17905
|
+
name
|
|
17906
|
+
nullOutputValue
|
|
17907
|
+
returnColumnId
|
|
17908
|
+
__typename
|
|
17909
|
+
}
|
|
17910
|
+
formulas {
|
|
17911
|
+
name
|
|
17912
|
+
expression
|
|
17913
|
+
__typename
|
|
17914
|
+
}
|
|
17915
|
+
__typename
|
|
17916
|
+
}
|
|
17917
|
+
visualizationSuggestion {
|
|
17918
|
+
chartType
|
|
17919
|
+
displayMode
|
|
17920
|
+
axisConfigs {
|
|
17921
|
+
category
|
|
17922
|
+
color
|
|
17923
|
+
hidden
|
|
17924
|
+
size
|
|
17925
|
+
sort
|
|
17926
|
+
x
|
|
17927
|
+
y
|
|
17928
|
+
__typename
|
|
17929
|
+
}
|
|
17930
|
+
usersVizIntentApplied
|
|
17931
|
+
customChartConfigs {
|
|
17932
|
+
dimensions {
|
|
17933
|
+
columns
|
|
17934
|
+
key
|
|
17935
|
+
__typename
|
|
17936
|
+
}
|
|
17937
|
+
key
|
|
17938
|
+
__typename
|
|
17939
|
+
}
|
|
17940
|
+
customChartGuid
|
|
17941
|
+
__typename
|
|
17942
|
+
}
|
|
17943
|
+
tableData {
|
|
17944
|
+
columnDataLite {
|
|
17945
|
+
columnId
|
|
17946
|
+
columnDataType
|
|
17947
|
+
dataValue
|
|
17948
|
+
columnName
|
|
17949
|
+
__typename
|
|
17950
|
+
}
|
|
17951
|
+
__typename
|
|
17952
|
+
}
|
|
17953
|
+
warningType
|
|
17954
|
+
cached
|
|
17955
|
+
__typename
|
|
17956
|
+
}
|
|
17957
|
+
debugInfo {
|
|
17958
|
+
fewShotExamples {
|
|
17959
|
+
chartType
|
|
17960
|
+
id
|
|
17961
|
+
mappingId
|
|
17962
|
+
nlQuery
|
|
17963
|
+
nlQueryConcepts
|
|
17964
|
+
sageQuery
|
|
17965
|
+
scope
|
|
17966
|
+
sql
|
|
17967
|
+
tml
|
|
17968
|
+
__typename
|
|
17969
|
+
}
|
|
17970
|
+
__typename
|
|
17971
|
+
}
|
|
17972
|
+
__typename
|
|
17973
|
+
}
|
|
17974
|
+
__typename
|
|
17975
|
+
}
|
|
17976
|
+
errorData {
|
|
17977
|
+
tool
|
|
17978
|
+
errCode
|
|
17979
|
+
errTxt
|
|
17980
|
+
toolErrCode
|
|
17981
|
+
__typename
|
|
17982
|
+
}
|
|
17983
|
+
__typename
|
|
17984
|
+
}
|
|
17985
|
+
type
|
|
17986
|
+
__typename
|
|
17987
|
+
}
|
|
17988
|
+
prevCtx {
|
|
17989
|
+
genNo
|
|
17990
|
+
sessionId
|
|
17991
|
+
__typename
|
|
17992
|
+
}
|
|
17993
|
+
__typename
|
|
17994
|
+
}
|
|
17995
|
+
}
|
|
17996
|
+
`;
|
|
17997
|
+
|
|
17998
|
+
class Conversation {
|
|
17999
|
+
constructor(thoughtSpotHost, worksheetId) {
|
|
18000
|
+
this.thoughtSpotHost = thoughtSpotHost;
|
|
18001
|
+
this.worksheetId = worksheetId;
|
|
18002
|
+
this.inProgress = null;
|
|
18003
|
+
this.inProgress = this.init();
|
|
18004
|
+
}
|
|
18005
|
+
async init() {
|
|
18006
|
+
const { convId } = await this.createConversation();
|
|
18007
|
+
this.conversationId = convId;
|
|
18008
|
+
}
|
|
18009
|
+
createConversation() {
|
|
18010
|
+
return this.executeQuery(createConversation, {
|
|
18011
|
+
params: {
|
|
18012
|
+
initialCtx: {
|
|
18013
|
+
tsWorksheetCtx: {
|
|
18014
|
+
worksheet: {
|
|
18015
|
+
worksheetId: this.worksheetId,
|
|
18016
|
+
},
|
|
18017
|
+
},
|
|
18018
|
+
type: 'TS_WORKSHEET',
|
|
18019
|
+
},
|
|
18020
|
+
userInfo: {
|
|
18021
|
+
tenantUrl: `${this.thoughtSpotHost}/prism`,
|
|
18022
|
+
},
|
|
18023
|
+
},
|
|
18024
|
+
});
|
|
18025
|
+
}
|
|
18026
|
+
async sendMessage(userMessage) {
|
|
18027
|
+
await this.inProgress;
|
|
18028
|
+
try {
|
|
18029
|
+
const { responses } = await this.executeQuery(sendMessage, {
|
|
18030
|
+
params: {
|
|
18031
|
+
convId: this.conversationId,
|
|
18032
|
+
headers: [],
|
|
18033
|
+
msg: {
|
|
18034
|
+
data: {
|
|
18035
|
+
userCmdData: {
|
|
18036
|
+
cmdText: userMessage,
|
|
18037
|
+
nlsData: {
|
|
18038
|
+
worksheetId: this.worksheetId,
|
|
18039
|
+
questionType: 'ANSWER_SPEC_GENERATION',
|
|
18040
|
+
},
|
|
18041
|
+
},
|
|
18042
|
+
},
|
|
18043
|
+
msgId: crypto.randomUUID(),
|
|
18044
|
+
type: 'USER_COMMAND',
|
|
18045
|
+
},
|
|
18046
|
+
},
|
|
18047
|
+
});
|
|
18048
|
+
const data = responses[0].data;
|
|
18049
|
+
return {
|
|
18050
|
+
data: data.asstRespData.nlsAnsData.sageQuerySuggestions[0],
|
|
18051
|
+
error: null,
|
|
18052
|
+
};
|
|
18053
|
+
}
|
|
18054
|
+
catch (error) {
|
|
18055
|
+
return { error };
|
|
18056
|
+
}
|
|
18057
|
+
}
|
|
18058
|
+
async executeQuery(query, variables) {
|
|
18059
|
+
return graphqlQuery({
|
|
18060
|
+
query,
|
|
18061
|
+
variables,
|
|
18062
|
+
thoughtSpotHost: this.thoughtSpotHost,
|
|
18063
|
+
isCompositeQuery: false,
|
|
18064
|
+
});
|
|
18065
|
+
}
|
|
18066
|
+
}
|
|
18067
|
+
|
|
18068
|
+
class ConversationMessage extends TsEmbed {
|
|
18069
|
+
constructor(container, viewConfig) {
|
|
18070
|
+
viewConfig.embedComponentType = 'bodyless-conversation';
|
|
18071
|
+
super(container, viewConfig);
|
|
18072
|
+
this.viewConfig = viewConfig;
|
|
18073
|
+
}
|
|
18074
|
+
getIframeSrc() {
|
|
18075
|
+
var _a;
|
|
18076
|
+
const { sessionId, genNo, acSessionId, acGenNo, } = this.viewConfig;
|
|
18077
|
+
const path = 'conv-assist-answer';
|
|
18078
|
+
const queryParams = this.getBaseQueryParams();
|
|
18079
|
+
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
18080
|
+
queryParams[Param.isSpotterAgentEmbed] = true;
|
|
18081
|
+
let query = '';
|
|
18082
|
+
const queryParamsString = getQueryParamString(queryParams, true);
|
|
18083
|
+
if (queryParamsString) {
|
|
18084
|
+
query = `?${queryParamsString}`;
|
|
18085
|
+
}
|
|
18086
|
+
const tsPostHashParams = this.getThoughtSpotPostUrlParams({
|
|
18087
|
+
sessionId,
|
|
18088
|
+
genNo,
|
|
18089
|
+
acSessionId,
|
|
18090
|
+
acGenNo,
|
|
18091
|
+
});
|
|
18092
|
+
return `${this.getEmbedBasePath(query)}/embed/${path}${tsPostHashParams}`;
|
|
18093
|
+
}
|
|
18094
|
+
async render() {
|
|
18095
|
+
await super.render();
|
|
18096
|
+
const src = this.getIframeSrc();
|
|
18097
|
+
await this.renderIFrame(src);
|
|
18098
|
+
return this;
|
|
18099
|
+
}
|
|
18100
|
+
}
|
|
18101
|
+
/**
|
|
18102
|
+
* Create a conversation embed, which can be integrated inside
|
|
18103
|
+
* chatbots or other conversational interfaces.
|
|
18104
|
+
* @example
|
|
18105
|
+
* ```js
|
|
18106
|
+
* import { SpotterAgentEmbed } from '@thoughtspot/visual-embed-sdk';
|
|
18107
|
+
*
|
|
18108
|
+
* const conversation = new SpotterAgentEmbed({
|
|
18109
|
+
* worksheetId: 'worksheetId',
|
|
18110
|
+
* });
|
|
18111
|
+
*
|
|
18112
|
+
* const { container, error } = await conversation.sendMessage('show me sales by region');
|
|
18113
|
+
*
|
|
18114
|
+
* // append the container to the DOM
|
|
18115
|
+
* document.body.appendChild(container); // or to any other element
|
|
18116
|
+
* ```
|
|
18117
|
+
* @group Embed components
|
|
18118
|
+
* @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
|
|
18119
|
+
*/
|
|
18120
|
+
let SpotterAgentEmbed$1 = class SpotterAgentEmbed {
|
|
18121
|
+
constructor(viewConfig) {
|
|
18122
|
+
this.viewConfig = viewConfig;
|
|
18123
|
+
const embedConfig = getEmbedConfig();
|
|
18124
|
+
this.conversationService = new Conversation(embedConfig.thoughtSpotHost, viewConfig.worksheetId);
|
|
18125
|
+
}
|
|
18126
|
+
async sendMessage(userMessage) {
|
|
18127
|
+
const { data, error } = await this.conversationService.sendMessage(userMessage);
|
|
18128
|
+
if (error) {
|
|
18129
|
+
return { error };
|
|
18130
|
+
}
|
|
18131
|
+
const container = document.createElement('div');
|
|
18132
|
+
if (this.viewConfig.containerClassName) {
|
|
18133
|
+
container.className = this.viewConfig.containerClassName;
|
|
18134
|
+
}
|
|
18135
|
+
const embed = new ConversationMessage(container, {
|
|
18136
|
+
...this.viewConfig,
|
|
18137
|
+
sessionId: data.sessionId,
|
|
18138
|
+
genNo: data.genNo,
|
|
18139
|
+
acSessionId: data.stateKey.transactionId,
|
|
18140
|
+
acGenNo: data.stateKey.generationNumber,
|
|
18141
|
+
});
|
|
18142
|
+
await embed.render();
|
|
18143
|
+
return { container, viz: embed };
|
|
18144
|
+
}
|
|
18145
|
+
};
|
|
18146
|
+
|
|
17662
18147
|
/**
|
|
17663
18148
|
*
|
|
17664
18149
|
* @param props
|
|
@@ -17715,7 +18200,7 @@ var isUndefined_1 = isUndefined;
|
|
|
17715
18200
|
* });
|
|
17716
18201
|
* conversation.render();
|
|
17717
18202
|
* ```
|
|
17718
|
-
* @version SDK: 1.
|
|
18203
|
+
* @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
|
|
17719
18204
|
*/
|
|
17720
18205
|
let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
|
|
17721
18206
|
constructor(container, viewConfig) {
|
|
@@ -17766,7 +18251,8 @@ let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
|
|
|
17766
18251
|
};
|
|
17767
18252
|
/**
|
|
17768
18253
|
* Embed ThoughtSpot AI Conversation.
|
|
17769
|
-
* @deprecated
|
|
18254
|
+
* @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
|
|
18255
|
+
* Use {@link SpotterEmbed} instead
|
|
17770
18256
|
* @group Embed components
|
|
17771
18257
|
* @example
|
|
17772
18258
|
* ```js
|
|
@@ -18015,7 +18501,8 @@ const PreRenderedSageEmbed = componentFactory(SageEmbed$1, true);
|
|
|
18015
18501
|
const SpotterEmbed = componentFactory(SpotterEmbed$1);
|
|
18016
18502
|
/**
|
|
18017
18503
|
* React component for LLM based conversation BI.
|
|
18018
|
-
* @deprecated
|
|
18504
|
+
* @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
|
|
18505
|
+
* Use {@link SpotterEmbed} instead
|
|
18019
18506
|
* @example
|
|
18020
18507
|
* ```tsx
|
|
18021
18508
|
* function Sage() {
|
|
@@ -18030,6 +18517,56 @@ const SpotterEmbed = componentFactory(SpotterEmbed$1);
|
|
|
18030
18517
|
* ```
|
|
18031
18518
|
*/
|
|
18032
18519
|
const ConversationEmbed = componentFactory(ConversationEmbed$1);
|
|
18520
|
+
/**
|
|
18521
|
+
* React component for SpotterAgent embed, which can be integrated inside
|
|
18522
|
+
* chatbots or other conversational interfaces.
|
|
18523
|
+
* @example
|
|
18524
|
+
* ```tsx
|
|
18525
|
+
* function SpotterAgent() {
|
|
18526
|
+
* const ref = useRef();
|
|
18527
|
+
*
|
|
18528
|
+
* const handleSendMessage = async () => {
|
|
18529
|
+
* const { container, error } = await ref.current.sendMessage('show me sales by region');
|
|
18530
|
+
* if (container) {
|
|
18531
|
+
* document.body.appendChild(container);
|
|
18532
|
+
* }
|
|
18533
|
+
* };
|
|
18534
|
+
*
|
|
18535
|
+
* return (
|
|
18536
|
+
* <div>
|
|
18537
|
+
* <SpotterAgentEmbed ref={ref} worksheetId="worksheetId" />
|
|
18538
|
+
* <button onClick={handleSendMessage}>Send Message</button>
|
|
18539
|
+
* </div>
|
|
18540
|
+
* );
|
|
18541
|
+
* }
|
|
18542
|
+
* ```
|
|
18543
|
+
*/
|
|
18544
|
+
const SpotterAgentEmbed = React__default.forwardRef((props, ref) => {
|
|
18545
|
+
const { className, ...restProps } = props;
|
|
18546
|
+
const serviceRef = useRef(null);
|
|
18547
|
+
useDeepCompareEffect(() => {
|
|
18548
|
+
if (serviceRef.current) {
|
|
18549
|
+
serviceRef.current = null;
|
|
18550
|
+
}
|
|
18551
|
+
const configProps = {
|
|
18552
|
+
...restProps,
|
|
18553
|
+
...(className ? { containerClassName: className } : {})
|
|
18554
|
+
};
|
|
18555
|
+
serviceRef.current = new SpotterAgentEmbed$1(configProps);
|
|
18556
|
+
if (ref) {
|
|
18557
|
+
if (typeof ref === 'function') {
|
|
18558
|
+
ref(serviceRef.current);
|
|
18559
|
+
}
|
|
18560
|
+
else {
|
|
18561
|
+
ref.current = serviceRef.current;
|
|
18562
|
+
}
|
|
18563
|
+
}
|
|
18564
|
+
return () => {
|
|
18565
|
+
serviceRef.current = null;
|
|
18566
|
+
};
|
|
18567
|
+
}, [props]);
|
|
18568
|
+
return null;
|
|
18569
|
+
});
|
|
18033
18570
|
/**
|
|
18034
18571
|
* React component for PreRendered Conversation embed.
|
|
18035
18572
|
*
|
|
@@ -18090,4 +18627,4 @@ function useInit(config) {
|
|
|
18090
18627
|
return ref;
|
|
18091
18628
|
}
|
|
18092
18629
|
|
|
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 };
|
|
18630
|
+
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 };
|