@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.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';
|
|
@@ -3097,6 +3097,7 @@ var Param;
|
|
|
3097
3097
|
Param["ShowSpotterLimitations"] = "showSpotterLimitations";
|
|
3098
3098
|
Param["CoverAndFilterOptionInPDF"] = "coverAndFilterOptionInPDF";
|
|
3099
3099
|
Param["PrimaryAction"] = "primaryAction";
|
|
3100
|
+
Param["isSpotterAgentEmbed"] = "isSpotterAgentEmbed";
|
|
3100
3101
|
})(Param || (Param = {}));
|
|
3101
3102
|
/**
|
|
3102
3103
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -7628,7 +7629,7 @@ class AnswerService {
|
|
|
7628
7629
|
async getTML() {
|
|
7629
7630
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
7630
7631
|
const edoc = object[0].edoc;
|
|
7631
|
-
const YAML = await import('./index-
|
|
7632
|
+
const YAML = await import('./index-BIcnpmMY.js');
|
|
7632
7633
|
const parsedDoc = YAML.parse(edoc);
|
|
7633
7634
|
return {
|
|
7634
7635
|
answer: {
|
|
@@ -15348,7 +15349,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
|
|
|
15348
15349
|
return e;
|
|
15349
15350
|
}
|
|
15350
15351
|
|
|
15351
|
-
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};
|
|
15352
15353
|
|
|
15353
15354
|
/**
|
|
15354
15355
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -17674,6 +17675,465 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
17674
17675
|
}
|
|
17675
17676
|
};
|
|
17676
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
|
+
|
|
17677
18137
|
/**
|
|
17678
18138
|
*
|
|
17679
18139
|
* @param props
|
|
@@ -17722,7 +18182,7 @@ var isUndefined_1 = isUndefined;
|
|
|
17722
18182
|
* @group Embed components
|
|
17723
18183
|
* @example
|
|
17724
18184
|
* ```js
|
|
17725
|
-
* const conversation = new
|
|
18185
|
+
* const conversation = new SpotterEmbed('#tsEmbed', {
|
|
17726
18186
|
* worksheetId: 'worksheetId',
|
|
17727
18187
|
* searchOptions: {
|
|
17728
18188
|
* searchQuery: 'searchQuery',
|
|
@@ -17730,9 +18190,9 @@ var isUndefined_1 = isUndefined;
|
|
|
17730
18190
|
* });
|
|
17731
18191
|
* conversation.render();
|
|
17732
18192
|
* ```
|
|
17733
|
-
* @version SDK: 1.
|
|
18193
|
+
* @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
|
|
17734
18194
|
*/
|
|
17735
|
-
let
|
|
18195
|
+
let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
|
|
17736
18196
|
constructor(container, viewConfig) {
|
|
17737
18197
|
viewConfig.embedComponentType = 'conversation';
|
|
17738
18198
|
super(container, viewConfig);
|
|
@@ -17778,6 +18238,30 @@ let ConversationEmbed$1 = class ConversationEmbed extends TsEmbed {
|
|
|
17778
18238
|
await this.renderIFrame(src);
|
|
17779
18239
|
return this;
|
|
17780
18240
|
}
|
|
18241
|
+
};
|
|
18242
|
+
/**
|
|
18243
|
+
* Embed ThoughtSpot AI Conversation.
|
|
18244
|
+
* @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
|
|
18245
|
+
* Use {@link SpotterEmbed} instead
|
|
18246
|
+
* @group Embed components
|
|
18247
|
+
* @example
|
|
18248
|
+
* ```js
|
|
18249
|
+
* const conversation = new SpotterEmbed('#tsEmbed', {
|
|
18250
|
+
* worksheetId: 'worksheetId',
|
|
18251
|
+
* searchOptions: {
|
|
18252
|
+
* searchQuery: 'searchQuery',
|
|
18253
|
+
* },
|
|
18254
|
+
* });
|
|
18255
|
+
* conversation.render();
|
|
18256
|
+
* ```
|
|
18257
|
+
* @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
|
|
18258
|
+
*/
|
|
18259
|
+
let ConversationEmbed$1 = class ConversationEmbed extends SpotterEmbed$1 {
|
|
18260
|
+
constructor(container, viewConfig) {
|
|
18261
|
+
viewConfig.embedComponentType = 'conversation';
|
|
18262
|
+
super(container, viewConfig);
|
|
18263
|
+
this.viewConfig = viewConfig;
|
|
18264
|
+
}
|
|
17781
18265
|
};
|
|
17782
18266
|
|
|
17783
18267
|
const componentFactory = (EmbedConstructor,
|
|
@@ -17994,6 +18478,24 @@ const PreRenderedSageEmbed = componentFactory(SageEmbed$1, true);
|
|
|
17994
18478
|
* @example
|
|
17995
18479
|
* ```tsx
|
|
17996
18480
|
* function Sage() {
|
|
18481
|
+
* return <SpotterEmbed
|
|
18482
|
+
* worksheetId="<worksheet-id-here>"
|
|
18483
|
+
* searchOptions={{
|
|
18484
|
+
* searchQuery: "<search query to start with>"
|
|
18485
|
+
* }}
|
|
18486
|
+
* ... other view config props or event listeners.
|
|
18487
|
+
* />
|
|
18488
|
+
* }
|
|
18489
|
+
* ```
|
|
18490
|
+
*/
|
|
18491
|
+
const SpotterEmbed = componentFactory(SpotterEmbed$1);
|
|
18492
|
+
/**
|
|
18493
|
+
* React component for LLM based conversation BI.
|
|
18494
|
+
* @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
|
|
18495
|
+
* Use {@link SpotterEmbed} instead
|
|
18496
|
+
* @example
|
|
18497
|
+
* ```tsx
|
|
18498
|
+
* function Sage() {
|
|
17997
18499
|
* return <ConversationEmbed
|
|
17998
18500
|
* worksheetId="<worksheet-id-here>"
|
|
17999
18501
|
* searchOptions={{
|
|
@@ -18005,10 +18507,60 @@ const PreRenderedSageEmbed = componentFactory(SageEmbed$1, true);
|
|
|
18005
18507
|
* ```
|
|
18006
18508
|
*/
|
|
18007
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
|
+
});
|
|
18008
18560
|
/**
|
|
18009
18561
|
* React component for PreRendered Conversation embed.
|
|
18010
18562
|
*
|
|
18011
|
-
* PreRenderedConversationEmbed will preRender the
|
|
18563
|
+
* PreRenderedConversationEmbed will preRender the SpotterEmbed and will be hidden by
|
|
18012
18564
|
* default.
|
|
18013
18565
|
*
|
|
18014
18566
|
* SageEmbed with preRenderId passed will call showPreRender on the embed.
|
|
@@ -18019,11 +18571,11 @@ const ConversationEmbed = componentFactory(ConversationEmbed$1);
|
|
|
18019
18571
|
* }
|
|
18020
18572
|
* ```
|
|
18021
18573
|
* function MyComponent() {
|
|
18022
|
-
* return <
|
|
18574
|
+
* return <SpotterEmbed preRenderId="someId" worksheetId="id" />
|
|
18023
18575
|
* }
|
|
18024
18576
|
* ```
|
|
18025
18577
|
*/
|
|
18026
|
-
const PreRenderedConversationEmbed = componentFactory(
|
|
18578
|
+
const PreRenderedConversationEmbed = componentFactory(SpotterEmbed$1, true);
|
|
18027
18579
|
/**
|
|
18028
18580
|
* Get a reference to the embed component to trigger events on the component.
|
|
18029
18581
|
* @example
|
|
@@ -18065,4 +18617,4 @@ function useInit(config) {
|
|
|
18065
18617
|
return ref;
|
|
18066
18618
|
}
|
|
18067
18619
|
|
|
18068
|
-
export { Action, AppEmbed, ConversationEmbed, EmbedEvent, HomeLeftNavItem, HomepageModule, HostEvent, ListPageColumns, LiveboardEmbed, LogLevel, Page, PinboardEmbed, PreRenderedAppEmbed, PreRenderedConversationEmbed, PreRenderedLiveboardEmbed, PreRenderedPinboardEmbed, PreRenderedSageEmbed, PreRenderedSearchBarEmbed, PreRenderedSearchEmbed, RuntimeFilterOp, SageEmbed, SearchBarEmbed, SearchEmbed, 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 };
|