@thoughtspot/visual-embed-sdk 1.37.1 → 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 +1 -1
- package/cjs/src/embed/bodyless-conversation.d.ts +44 -9
- package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/cjs/src/embed/bodyless-conversation.js +35 -5
- package/cjs/src/embed/bodyless-conversation.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.spec.js +290 -5
- package/cjs/src/embed/bodyless-conversation.spec.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +40 -11
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +29 -4
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +7 -7
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
- 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 -1
- 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 +3 -1
- package/cjs/src/react/all-types-export.js.map +1 -1
- package/cjs/src/react/index.d.ts +53 -5
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +73 -4
- 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 +2 -1
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +1 -0
- package/cjs/src/types.js.map +1 -1
- package/dist/{index-m9UtENc9.js → index-BIcnpmMY.js} +1 -1
- package/dist/src/embed/bodyless-conversation.d.ts +44 -9
- package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +40 -11
- package/dist/src/embed/conversation.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 +53 -5
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +2 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +562 -10
- package/dist/tsembed-react.js +562 -8
- package/dist/tsembed.es.js +65 -11
- package/dist/tsembed.js +71 -15
- package/dist/visual-embed-sdk-react-full.d.ts +184 -72
- package/dist/visual-embed-sdk-react.d.ts +184 -72
- package/dist/visual-embed-sdk.d.ts +87 -22
- package/lib/package.json +1 -1
- package/lib/src/embed/bodyless-conversation.d.ts +44 -9
- package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/lib/src/embed/bodyless-conversation.js +33 -4
- package/lib/src/embed/bodyless-conversation.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.spec.js +292 -7
- package/lib/src/embed/bodyless-conversation.spec.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +40 -11
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +27 -3
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +8 -8
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
- 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 +53 -5
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +73 -4
- 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 +2 -1
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +1 -0
- package/lib/src/types.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +90 -25
- package/package.json +1 -1
- package/src/embed/bodyless-conversation.spec.ts +314 -7
- package/src/embed/bodyless-conversation.ts +53 -8
- package/src/embed/conversation.spec.ts +16 -16
- package/src/embed/conversation.ts +44 -11
- package/src/embed/ts-embed.spec.ts +0 -2
- package/src/index.ts +16 -5
- package/src/react/all-types-export.ts +2 -0
- package/src/react/index.spec.tsx +157 -1
- package/src/react/index.tsx +98 -11
- package/src/types.ts +1 -0
package/dist/tsembed-react.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
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
|
|
@@ -3119,6 +3119,7 @@
|
|
|
3119
3119
|
Param["ShowSpotterLimitations"] = "showSpotterLimitations";
|
|
3120
3120
|
Param["CoverAndFilterOptionInPDF"] = "coverAndFilterOptionInPDF";
|
|
3121
3121
|
Param["PrimaryAction"] = "primaryAction";
|
|
3122
|
+
Param["isSpotterAgentEmbed"] = "isSpotterAgentEmbed";
|
|
3122
3123
|
})(Param || (Param = {}));
|
|
3123
3124
|
/**
|
|
3124
3125
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -15370,7 +15371,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15370
15371
|
return e;
|
|
15371
15372
|
}
|
|
15372
15373
|
|
|
15373
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.
|
|
15374
|
+
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$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 . --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$1,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};
|
|
15374
15375
|
|
|
15375
15376
|
/**
|
|
15376
15377
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -17696,6 +17697,465 @@ query GetEurekaVizSnapshots(
|
|
|
17696
17697
|
}
|
|
17697
17698
|
};
|
|
17698
17699
|
|
|
17700
|
+
const createConversation = `
|
|
17701
|
+
mutation CreateConversation($params: Input_convassist_CreateConversationRequest) {
|
|
17702
|
+
ConvAssist__createConversation(request: $params) {
|
|
17703
|
+
convId
|
|
17704
|
+
initialCtx {
|
|
17705
|
+
type
|
|
17706
|
+
tsAnsCtx {
|
|
17707
|
+
sessionId
|
|
17708
|
+
genNo
|
|
17709
|
+
stateKey {
|
|
17710
|
+
transactionId
|
|
17711
|
+
generationNumber
|
|
17712
|
+
}
|
|
17713
|
+
worksheet {
|
|
17714
|
+
worksheetId
|
|
17715
|
+
worksheetName
|
|
17716
|
+
}
|
|
17717
|
+
}
|
|
17718
|
+
}
|
|
17719
|
+
}
|
|
17720
|
+
}
|
|
17721
|
+
`;
|
|
17722
|
+
const sendMessage = `
|
|
17723
|
+
query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
17724
|
+
ConvAssist__sendMessage(request: $params) {
|
|
17725
|
+
responses {
|
|
17726
|
+
timestamp
|
|
17727
|
+
msgId
|
|
17728
|
+
data {
|
|
17729
|
+
asstRespData {
|
|
17730
|
+
tool
|
|
17731
|
+
asstRespText
|
|
17732
|
+
nlsAnsData {
|
|
17733
|
+
sageQuerySuggestions {
|
|
17734
|
+
sageQueryTokens {
|
|
17735
|
+
additions {
|
|
17736
|
+
phrase {
|
|
17737
|
+
isCompletePhrase
|
|
17738
|
+
numTokens
|
|
17739
|
+
phraseType
|
|
17740
|
+
startIndex
|
|
17741
|
+
__typename
|
|
17742
|
+
}
|
|
17743
|
+
tokens {
|
|
17744
|
+
token
|
|
17745
|
+
dataType
|
|
17746
|
+
typeEnum
|
|
17747
|
+
guid
|
|
17748
|
+
tokenMetadata {
|
|
17749
|
+
name
|
|
17750
|
+
__typename
|
|
17751
|
+
}
|
|
17752
|
+
__typename
|
|
17753
|
+
}
|
|
17754
|
+
__typename
|
|
17755
|
+
}
|
|
17756
|
+
phrases {
|
|
17757
|
+
isCompletePhrase
|
|
17758
|
+
numTokens
|
|
17759
|
+
phraseType
|
|
17760
|
+
startIndex
|
|
17761
|
+
__typename
|
|
17762
|
+
}
|
|
17763
|
+
removals {
|
|
17764
|
+
phrase {
|
|
17765
|
+
isCompletePhrase
|
|
17766
|
+
numTokens
|
|
17767
|
+
phraseType
|
|
17768
|
+
startIndex
|
|
17769
|
+
__typename
|
|
17770
|
+
}
|
|
17771
|
+
tokens {
|
|
17772
|
+
token
|
|
17773
|
+
dataType
|
|
17774
|
+
typeEnum
|
|
17775
|
+
guid
|
|
17776
|
+
tokenMetadata {
|
|
17777
|
+
name
|
|
17778
|
+
__typename
|
|
17779
|
+
}
|
|
17780
|
+
__typename
|
|
17781
|
+
}
|
|
17782
|
+
__typename
|
|
17783
|
+
}
|
|
17784
|
+
tokens {
|
|
17785
|
+
token
|
|
17786
|
+
dataType
|
|
17787
|
+
typeEnum
|
|
17788
|
+
guid
|
|
17789
|
+
tokenMetadata {
|
|
17790
|
+
name
|
|
17791
|
+
__typename
|
|
17792
|
+
}
|
|
17793
|
+
__typename
|
|
17794
|
+
}
|
|
17795
|
+
__typename
|
|
17796
|
+
}
|
|
17797
|
+
llmReasoning {
|
|
17798
|
+
assumptions
|
|
17799
|
+
clarifications
|
|
17800
|
+
interpretation
|
|
17801
|
+
__typename
|
|
17802
|
+
}
|
|
17803
|
+
tokens
|
|
17804
|
+
tmlTokens
|
|
17805
|
+
worksheetId
|
|
17806
|
+
tokens
|
|
17807
|
+
description
|
|
17808
|
+
title
|
|
17809
|
+
tmlTokens
|
|
17810
|
+
cached
|
|
17811
|
+
sqlQuery
|
|
17812
|
+
sessionId
|
|
17813
|
+
genNo
|
|
17814
|
+
formulaInfo {
|
|
17815
|
+
name
|
|
17816
|
+
expression
|
|
17817
|
+
__typename
|
|
17818
|
+
}
|
|
17819
|
+
tmlPhrases
|
|
17820
|
+
ambiguousPhrases {
|
|
17821
|
+
alternativePhrases {
|
|
17822
|
+
phraseType
|
|
17823
|
+
token {
|
|
17824
|
+
token
|
|
17825
|
+
dataType
|
|
17826
|
+
typeEnum
|
|
17827
|
+
guid
|
|
17828
|
+
tokenMetadata {
|
|
17829
|
+
name
|
|
17830
|
+
__typename
|
|
17831
|
+
}
|
|
17832
|
+
__typename
|
|
17833
|
+
}
|
|
17834
|
+
__typename
|
|
17835
|
+
}
|
|
17836
|
+
ambiguityType
|
|
17837
|
+
token {
|
|
17838
|
+
token
|
|
17839
|
+
dataType
|
|
17840
|
+
typeEnum
|
|
17841
|
+
guid
|
|
17842
|
+
tokenMetadata {
|
|
17843
|
+
name
|
|
17844
|
+
__typename
|
|
17845
|
+
}
|
|
17846
|
+
__typename
|
|
17847
|
+
}
|
|
17848
|
+
__typename
|
|
17849
|
+
}
|
|
17850
|
+
ambiguousTokens {
|
|
17851
|
+
alternativeTokens {
|
|
17852
|
+
token
|
|
17853
|
+
dataType
|
|
17854
|
+
typeEnum
|
|
17855
|
+
guid
|
|
17856
|
+
tokenMetadata {
|
|
17857
|
+
name
|
|
17858
|
+
deprecatedTableGuid
|
|
17859
|
+
deprecatedTableName
|
|
17860
|
+
isFormula
|
|
17861
|
+
rootTables {
|
|
17862
|
+
created
|
|
17863
|
+
description
|
|
17864
|
+
guid
|
|
17865
|
+
indexVersion
|
|
17866
|
+
modified
|
|
17867
|
+
name
|
|
17868
|
+
__typename
|
|
17869
|
+
}
|
|
17870
|
+
schemaTableUserDefinedName
|
|
17871
|
+
table {
|
|
17872
|
+
created
|
|
17873
|
+
description
|
|
17874
|
+
guid
|
|
17875
|
+
indexVersion
|
|
17876
|
+
modified
|
|
17877
|
+
name
|
|
17878
|
+
__typename
|
|
17879
|
+
}
|
|
17880
|
+
__typename
|
|
17881
|
+
}
|
|
17882
|
+
__typename
|
|
17883
|
+
}
|
|
17884
|
+
ambiguityType
|
|
17885
|
+
token {
|
|
17886
|
+
token
|
|
17887
|
+
dataType
|
|
17888
|
+
typeEnum
|
|
17889
|
+
guid
|
|
17890
|
+
tokenMetadata {
|
|
17891
|
+
name
|
|
17892
|
+
__typename
|
|
17893
|
+
}
|
|
17894
|
+
__typename
|
|
17895
|
+
}
|
|
17896
|
+
__typename
|
|
17897
|
+
}
|
|
17898
|
+
stateKey {
|
|
17899
|
+
transactionId
|
|
17900
|
+
generationNumber
|
|
17901
|
+
transactionId
|
|
17902
|
+
__typename
|
|
17903
|
+
}
|
|
17904
|
+
subQueries {
|
|
17905
|
+
tokens
|
|
17906
|
+
cohortConfig {
|
|
17907
|
+
anchorColumnId
|
|
17908
|
+
cohortAnswerGuid
|
|
17909
|
+
cohortGroupingType
|
|
17910
|
+
cohortGuid
|
|
17911
|
+
cohortType
|
|
17912
|
+
combineNonGroupValues
|
|
17913
|
+
description
|
|
17914
|
+
groupExcludedQueryValues
|
|
17915
|
+
hideExcludedQueryValues
|
|
17916
|
+
isEditable
|
|
17917
|
+
name
|
|
17918
|
+
nullOutputValue
|
|
17919
|
+
returnColumnId
|
|
17920
|
+
__typename
|
|
17921
|
+
}
|
|
17922
|
+
formulas {
|
|
17923
|
+
name
|
|
17924
|
+
expression
|
|
17925
|
+
__typename
|
|
17926
|
+
}
|
|
17927
|
+
__typename
|
|
17928
|
+
}
|
|
17929
|
+
visualizationSuggestion {
|
|
17930
|
+
chartType
|
|
17931
|
+
displayMode
|
|
17932
|
+
axisConfigs {
|
|
17933
|
+
category
|
|
17934
|
+
color
|
|
17935
|
+
hidden
|
|
17936
|
+
size
|
|
17937
|
+
sort
|
|
17938
|
+
x
|
|
17939
|
+
y
|
|
17940
|
+
__typename
|
|
17941
|
+
}
|
|
17942
|
+
usersVizIntentApplied
|
|
17943
|
+
customChartConfigs {
|
|
17944
|
+
dimensions {
|
|
17945
|
+
columns
|
|
17946
|
+
key
|
|
17947
|
+
__typename
|
|
17948
|
+
}
|
|
17949
|
+
key
|
|
17950
|
+
__typename
|
|
17951
|
+
}
|
|
17952
|
+
customChartGuid
|
|
17953
|
+
__typename
|
|
17954
|
+
}
|
|
17955
|
+
tableData {
|
|
17956
|
+
columnDataLite {
|
|
17957
|
+
columnId
|
|
17958
|
+
columnDataType
|
|
17959
|
+
dataValue
|
|
17960
|
+
columnName
|
|
17961
|
+
__typename
|
|
17962
|
+
}
|
|
17963
|
+
__typename
|
|
17964
|
+
}
|
|
17965
|
+
warningType
|
|
17966
|
+
cached
|
|
17967
|
+
__typename
|
|
17968
|
+
}
|
|
17969
|
+
debugInfo {
|
|
17970
|
+
fewShotExamples {
|
|
17971
|
+
chartType
|
|
17972
|
+
id
|
|
17973
|
+
mappingId
|
|
17974
|
+
nlQuery
|
|
17975
|
+
nlQueryConcepts
|
|
17976
|
+
sageQuery
|
|
17977
|
+
scope
|
|
17978
|
+
sql
|
|
17979
|
+
tml
|
|
17980
|
+
__typename
|
|
17981
|
+
}
|
|
17982
|
+
__typename
|
|
17983
|
+
}
|
|
17984
|
+
__typename
|
|
17985
|
+
}
|
|
17986
|
+
__typename
|
|
17987
|
+
}
|
|
17988
|
+
errorData {
|
|
17989
|
+
tool
|
|
17990
|
+
errCode
|
|
17991
|
+
errTxt
|
|
17992
|
+
toolErrCode
|
|
17993
|
+
__typename
|
|
17994
|
+
}
|
|
17995
|
+
__typename
|
|
17996
|
+
}
|
|
17997
|
+
type
|
|
17998
|
+
__typename
|
|
17999
|
+
}
|
|
18000
|
+
prevCtx {
|
|
18001
|
+
genNo
|
|
18002
|
+
sessionId
|
|
18003
|
+
__typename
|
|
18004
|
+
}
|
|
18005
|
+
__typename
|
|
18006
|
+
}
|
|
18007
|
+
}
|
|
18008
|
+
`;
|
|
18009
|
+
|
|
18010
|
+
class Conversation {
|
|
18011
|
+
constructor(thoughtSpotHost, worksheetId) {
|
|
18012
|
+
this.thoughtSpotHost = thoughtSpotHost;
|
|
18013
|
+
this.worksheetId = worksheetId;
|
|
18014
|
+
this.inProgress = null;
|
|
18015
|
+
this.inProgress = this.init();
|
|
18016
|
+
}
|
|
18017
|
+
async init() {
|
|
18018
|
+
const { convId } = await this.createConversation();
|
|
18019
|
+
this.conversationId = convId;
|
|
18020
|
+
}
|
|
18021
|
+
createConversation() {
|
|
18022
|
+
return this.executeQuery(createConversation, {
|
|
18023
|
+
params: {
|
|
18024
|
+
initialCtx: {
|
|
18025
|
+
tsWorksheetCtx: {
|
|
18026
|
+
worksheet: {
|
|
18027
|
+
worksheetId: this.worksheetId,
|
|
18028
|
+
},
|
|
18029
|
+
},
|
|
18030
|
+
type: 'TS_WORKSHEET',
|
|
18031
|
+
},
|
|
18032
|
+
userInfo: {
|
|
18033
|
+
tenantUrl: `${this.thoughtSpotHost}/prism`,
|
|
18034
|
+
},
|
|
18035
|
+
},
|
|
18036
|
+
});
|
|
18037
|
+
}
|
|
18038
|
+
async sendMessage(userMessage) {
|
|
18039
|
+
await this.inProgress;
|
|
18040
|
+
try {
|
|
18041
|
+
const { responses } = await this.executeQuery(sendMessage, {
|
|
18042
|
+
params: {
|
|
18043
|
+
convId: this.conversationId,
|
|
18044
|
+
headers: [],
|
|
18045
|
+
msg: {
|
|
18046
|
+
data: {
|
|
18047
|
+
userCmdData: {
|
|
18048
|
+
cmdText: userMessage,
|
|
18049
|
+
nlsData: {
|
|
18050
|
+
worksheetId: this.worksheetId,
|
|
18051
|
+
questionType: 'ANSWER_SPEC_GENERATION',
|
|
18052
|
+
},
|
|
18053
|
+
},
|
|
18054
|
+
},
|
|
18055
|
+
msgId: crypto.randomUUID(),
|
|
18056
|
+
type: 'USER_COMMAND',
|
|
18057
|
+
},
|
|
18058
|
+
},
|
|
18059
|
+
});
|
|
18060
|
+
const data = responses[0].data;
|
|
18061
|
+
return {
|
|
18062
|
+
data: data.asstRespData.nlsAnsData.sageQuerySuggestions[0],
|
|
18063
|
+
error: null,
|
|
18064
|
+
};
|
|
18065
|
+
}
|
|
18066
|
+
catch (error) {
|
|
18067
|
+
return { error };
|
|
18068
|
+
}
|
|
18069
|
+
}
|
|
18070
|
+
async executeQuery(query, variables) {
|
|
18071
|
+
return graphqlQuery({
|
|
18072
|
+
query,
|
|
18073
|
+
variables,
|
|
18074
|
+
thoughtSpotHost: this.thoughtSpotHost,
|
|
18075
|
+
isCompositeQuery: false,
|
|
18076
|
+
});
|
|
18077
|
+
}
|
|
18078
|
+
}
|
|
18079
|
+
|
|
18080
|
+
class ConversationMessage extends TsEmbed {
|
|
18081
|
+
constructor(container, viewConfig) {
|
|
18082
|
+
viewConfig.embedComponentType = 'bodyless-conversation';
|
|
18083
|
+
super(container, viewConfig);
|
|
18084
|
+
this.viewConfig = viewConfig;
|
|
18085
|
+
}
|
|
18086
|
+
getIframeSrc() {
|
|
18087
|
+
var _a;
|
|
18088
|
+
const { sessionId, genNo, acSessionId, acGenNo, } = this.viewConfig;
|
|
18089
|
+
const path = 'conv-assist-answer';
|
|
18090
|
+
const queryParams = this.getBaseQueryParams();
|
|
18091
|
+
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
18092
|
+
queryParams[Param.isSpotterAgentEmbed] = true;
|
|
18093
|
+
let query = '';
|
|
18094
|
+
const queryParamsString = getQueryParamString(queryParams, true);
|
|
18095
|
+
if (queryParamsString) {
|
|
18096
|
+
query = `?${queryParamsString}`;
|
|
18097
|
+
}
|
|
18098
|
+
const tsPostHashParams = this.getThoughtSpotPostUrlParams({
|
|
18099
|
+
sessionId,
|
|
18100
|
+
genNo,
|
|
18101
|
+
acSessionId,
|
|
18102
|
+
acGenNo,
|
|
18103
|
+
});
|
|
18104
|
+
return `${this.getEmbedBasePath(query)}/embed/${path}${tsPostHashParams}`;
|
|
18105
|
+
}
|
|
18106
|
+
async render() {
|
|
18107
|
+
await super.render();
|
|
18108
|
+
const src = this.getIframeSrc();
|
|
18109
|
+
await this.renderIFrame(src);
|
|
18110
|
+
return this;
|
|
18111
|
+
}
|
|
18112
|
+
}
|
|
18113
|
+
/**
|
|
18114
|
+
* Create a conversation embed, which can be integrated inside
|
|
18115
|
+
* chatbots or other conversational interfaces.
|
|
18116
|
+
* @example
|
|
18117
|
+
* ```js
|
|
18118
|
+
* import { SpotterAgentEmbed } from '@thoughtspot/visual-embed-sdk';
|
|
18119
|
+
*
|
|
18120
|
+
* const conversation = new SpotterAgentEmbed({
|
|
18121
|
+
* worksheetId: 'worksheetId',
|
|
18122
|
+
* });
|
|
18123
|
+
*
|
|
18124
|
+
* const { container, error } = await conversation.sendMessage('show me sales by region');
|
|
18125
|
+
*
|
|
18126
|
+
* // append the container to the DOM
|
|
18127
|
+
* document.body.appendChild(container); // or to any other element
|
|
18128
|
+
* ```
|
|
18129
|
+
* @group Embed components
|
|
18130
|
+
* @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
|
|
18131
|
+
*/
|
|
18132
|
+
let SpotterAgentEmbed$1 = class SpotterAgentEmbed {
|
|
18133
|
+
constructor(viewConfig) {
|
|
18134
|
+
this.viewConfig = viewConfig;
|
|
18135
|
+
const embedConfig = getEmbedConfig();
|
|
18136
|
+
this.conversationService = new Conversation(embedConfig.thoughtSpotHost, viewConfig.worksheetId);
|
|
18137
|
+
}
|
|
18138
|
+
async sendMessage(userMessage) {
|
|
18139
|
+
const { data, error } = await this.conversationService.sendMessage(userMessage);
|
|
18140
|
+
if (error) {
|
|
18141
|
+
return { error };
|
|
18142
|
+
}
|
|
18143
|
+
const container = document.createElement('div');
|
|
18144
|
+
if (this.viewConfig.containerClassName) {
|
|
18145
|
+
container.className = this.viewConfig.containerClassName;
|
|
18146
|
+
}
|
|
18147
|
+
const embed = new ConversationMessage(container, {
|
|
18148
|
+
...this.viewConfig,
|
|
18149
|
+
sessionId: data.sessionId,
|
|
18150
|
+
genNo: data.genNo,
|
|
18151
|
+
acSessionId: data.stateKey.transactionId,
|
|
18152
|
+
acGenNo: data.stateKey.generationNumber,
|
|
18153
|
+
});
|
|
18154
|
+
await embed.render();
|
|
18155
|
+
return { container, viz: embed };
|
|
18156
|
+
}
|
|
18157
|
+
};
|
|
18158
|
+
|
|
17699
18159
|
/**
|
|
17700
18160
|
*
|
|
17701
18161
|
* @param props
|
|
@@ -17744,7 +18204,7 @@ query GetEurekaVizSnapshots(
|
|
|
17744
18204
|
* @group Embed components
|
|
17745
18205
|
* @example
|
|
17746
18206
|
* ```js
|
|
17747
|
-
* const conversation = new
|
|
18207
|
+
* const conversation = new SpotterEmbed('#tsEmbed', {
|
|
17748
18208
|
* worksheetId: 'worksheetId',
|
|
17749
18209
|
* searchOptions: {
|
|
17750
18210
|
* searchQuery: 'searchQuery',
|
|
@@ -17752,9 +18212,9 @@ query GetEurekaVizSnapshots(
|
|
|
17752
18212
|
* });
|
|
17753
18213
|
* conversation.render();
|
|
17754
18214
|
* ```
|
|
17755
|
-
* @version SDK: 1.
|
|
18215
|
+
* @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
|
|
17756
18216
|
*/
|
|
17757
|
-
let
|
|
18217
|
+
let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
|
|
17758
18218
|
constructor(container, viewConfig) {
|
|
17759
18219
|
viewConfig.embedComponentType = 'conversation';
|
|
17760
18220
|
super(container, viewConfig);
|
|
@@ -17800,6 +18260,30 @@ query GetEurekaVizSnapshots(
|
|
|
17800
18260
|
await this.renderIFrame(src);
|
|
17801
18261
|
return this;
|
|
17802
18262
|
}
|
|
18263
|
+
};
|
|
18264
|
+
/**
|
|
18265
|
+
* Embed ThoughtSpot AI Conversation.
|
|
18266
|
+
* @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
|
|
18267
|
+
* Use {@link SpotterEmbed} instead
|
|
18268
|
+
* @group Embed components
|
|
18269
|
+
* @example
|
|
18270
|
+
* ```js
|
|
18271
|
+
* const conversation = new SpotterEmbed('#tsEmbed', {
|
|
18272
|
+
* worksheetId: 'worksheetId',
|
|
18273
|
+
* searchOptions: {
|
|
18274
|
+
* searchQuery: 'searchQuery',
|
|
18275
|
+
* },
|
|
18276
|
+
* });
|
|
18277
|
+
* conversation.render();
|
|
18278
|
+
* ```
|
|
18279
|
+
* @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
|
|
18280
|
+
*/
|
|
18281
|
+
let ConversationEmbed$1 = class ConversationEmbed extends SpotterEmbed$1 {
|
|
18282
|
+
constructor(container, viewConfig) {
|
|
18283
|
+
viewConfig.embedComponentType = 'conversation';
|
|
18284
|
+
super(container, viewConfig);
|
|
18285
|
+
this.viewConfig = viewConfig;
|
|
18286
|
+
}
|
|
17803
18287
|
};
|
|
17804
18288
|
|
|
17805
18289
|
const componentFactory = (EmbedConstructor,
|
|
@@ -18016,6 +18500,24 @@ query GetEurekaVizSnapshots(
|
|
|
18016
18500
|
* @example
|
|
18017
18501
|
* ```tsx
|
|
18018
18502
|
* function Sage() {
|
|
18503
|
+
* return <SpotterEmbed
|
|
18504
|
+
* worksheetId="<worksheet-id-here>"
|
|
18505
|
+
* searchOptions={{
|
|
18506
|
+
* searchQuery: "<search query to start with>"
|
|
18507
|
+
* }}
|
|
18508
|
+
* ... other view config props or event listeners.
|
|
18509
|
+
* />
|
|
18510
|
+
* }
|
|
18511
|
+
* ```
|
|
18512
|
+
*/
|
|
18513
|
+
const SpotterEmbed = componentFactory(SpotterEmbed$1);
|
|
18514
|
+
/**
|
|
18515
|
+
* React component for LLM based conversation BI.
|
|
18516
|
+
* @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
|
|
18517
|
+
* Use {@link SpotterEmbed} instead
|
|
18518
|
+
* @example
|
|
18519
|
+
* ```tsx
|
|
18520
|
+
* function Sage() {
|
|
18019
18521
|
* return <ConversationEmbed
|
|
18020
18522
|
* worksheetId="<worksheet-id-here>"
|
|
18021
18523
|
* searchOptions={{
|
|
@@ -18027,10 +18529,60 @@ query GetEurekaVizSnapshots(
|
|
|
18027
18529
|
* ```
|
|
18028
18530
|
*/
|
|
18029
18531
|
const ConversationEmbed = componentFactory(ConversationEmbed$1);
|
|
18532
|
+
/**
|
|
18533
|
+
* React component for SpotterAgent embed, which can be integrated inside
|
|
18534
|
+
* chatbots or other conversational interfaces.
|
|
18535
|
+
* @example
|
|
18536
|
+
* ```tsx
|
|
18537
|
+
* function SpotterAgent() {
|
|
18538
|
+
* const ref = useRef();
|
|
18539
|
+
*
|
|
18540
|
+
* const handleSendMessage = async () => {
|
|
18541
|
+
* const { container, error } = await ref.current.sendMessage('show me sales by region');
|
|
18542
|
+
* if (container) {
|
|
18543
|
+
* document.body.appendChild(container);
|
|
18544
|
+
* }
|
|
18545
|
+
* };
|
|
18546
|
+
*
|
|
18547
|
+
* return (
|
|
18548
|
+
* <div>
|
|
18549
|
+
* <SpotterAgentEmbed ref={ref} worksheetId="worksheetId" />
|
|
18550
|
+
* <button onClick={handleSendMessage}>Send Message</button>
|
|
18551
|
+
* </div>
|
|
18552
|
+
* );
|
|
18553
|
+
* }
|
|
18554
|
+
* ```
|
|
18555
|
+
*/
|
|
18556
|
+
const SpotterAgentEmbed = React.forwardRef((props, ref) => {
|
|
18557
|
+
const { className, ...restProps } = props;
|
|
18558
|
+
const serviceRef = React.useRef(null);
|
|
18559
|
+
useDeepCompareEffect(() => {
|
|
18560
|
+
if (serviceRef.current) {
|
|
18561
|
+
serviceRef.current = null;
|
|
18562
|
+
}
|
|
18563
|
+
const configProps = {
|
|
18564
|
+
...restProps,
|
|
18565
|
+
...(className ? { containerClassName: className } : {})
|
|
18566
|
+
};
|
|
18567
|
+
serviceRef.current = new SpotterAgentEmbed$1(configProps);
|
|
18568
|
+
if (ref) {
|
|
18569
|
+
if (typeof ref === 'function') {
|
|
18570
|
+
ref(serviceRef.current);
|
|
18571
|
+
}
|
|
18572
|
+
else {
|
|
18573
|
+
ref.current = serviceRef.current;
|
|
18574
|
+
}
|
|
18575
|
+
}
|
|
18576
|
+
return () => {
|
|
18577
|
+
serviceRef.current = null;
|
|
18578
|
+
};
|
|
18579
|
+
}, [props]);
|
|
18580
|
+
return null;
|
|
18581
|
+
});
|
|
18030
18582
|
/**
|
|
18031
18583
|
* React component for PreRendered Conversation embed.
|
|
18032
18584
|
*
|
|
18033
|
-
* PreRenderedConversationEmbed will preRender the
|
|
18585
|
+
* PreRenderedConversationEmbed will preRender the SpotterEmbed and will be hidden by
|
|
18034
18586
|
* default.
|
|
18035
18587
|
*
|
|
18036
18588
|
* SageEmbed with preRenderId passed will call showPreRender on the embed.
|
|
@@ -18041,11 +18593,11 @@ query GetEurekaVizSnapshots(
|
|
|
18041
18593
|
* }
|
|
18042
18594
|
* ```
|
|
18043
18595
|
* function MyComponent() {
|
|
18044
|
-
* return <
|
|
18596
|
+
* return <SpotterEmbed preRenderId="someId" worksheetId="id" />
|
|
18045
18597
|
* }
|
|
18046
18598
|
* ```
|
|
18047
18599
|
*/
|
|
18048
|
-
const PreRenderedConversationEmbed = componentFactory(
|
|
18600
|
+
const PreRenderedConversationEmbed = componentFactory(SpotterEmbed$1, true);
|
|
18049
18601
|
/**
|
|
18050
18602
|
* Get a reference to the embed component to trigger events on the component.
|
|
18051
18603
|
* @example
|
|
@@ -25503,6 +26055,8 @@ query GetEurekaVizSnapshots(
|
|
|
25503
26055
|
exports.SageEmbed = SageEmbed;
|
|
25504
26056
|
exports.SearchBarEmbed = SearchBarEmbed;
|
|
25505
26057
|
exports.SearchEmbed = SearchEmbed;
|
|
26058
|
+
exports.SpotterAgentEmbed = SpotterAgentEmbed;
|
|
26059
|
+
exports.SpotterEmbed = SpotterEmbed;
|
|
25506
26060
|
exports.getSessionInfo = getSessionInfo;
|
|
25507
26061
|
exports.useEmbedRef = useEmbedRef;
|
|
25508
26062
|
exports.useInit = useInit;
|