@thoughtspot/visual-embed-sdk 1.32.4-dc.2 → 1.32.4-dc.4
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/conversation.js +2 -2
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/index.d.ts +2 -1
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +3 -1
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/utils/graphql/spotterService/conversation-queries.d.ts +3 -0
- package/cjs/src/utils/graphql/spotterService/conversation-queries.d.ts.map +1 -0
- package/cjs/src/utils/graphql/spotterService/conversation-queries.js +318 -0
- package/cjs/src/utils/graphql/spotterService/conversation-queries.js.map +1 -0
- package/cjs/src/utils/graphql/spotterService/conversation-service.d.ts +12 -0
- package/cjs/src/utils/graphql/spotterService/conversation-service.d.ts.map +1 -0
- package/cjs/src/utils/graphql/spotterService/conversation-service.js +89 -0
- package/cjs/src/utils/graphql/spotterService/conversation-service.js.map +1 -0
- package/cjs/src/utils/graphql/spotterService/nls-answer-queries.d.ts +2 -0
- package/cjs/src/utils/graphql/spotterService/nls-answer-queries.d.ts.map +1 -0
- package/cjs/src/utils/graphql/spotterService/nls-answer-queries.js +403 -0
- package/cjs/src/utils/graphql/spotterService/nls-answer-queries.js.map +1 -0
- package/cjs/src/utils/graphql/spotterService/nls-answer-service.d.ts +9 -0
- package/cjs/src/utils/graphql/spotterService/nls-answer-service.d.ts.map +1 -0
- package/cjs/src/utils/graphql/spotterService/nls-answer-service.js +52 -0
- package/cjs/src/utils/graphql/spotterService/nls-answer-service.js.map +1 -0
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/utils/graphql/spotterService/conversation-queries.d.ts +3 -0
- package/dist/src/utils/graphql/spotterService/conversation-queries.d.ts.map +1 -0
- package/dist/src/utils/graphql/spotterService/conversation-service.d.ts +12 -0
- package/dist/src/utils/graphql/spotterService/conversation-service.d.ts.map +1 -0
- package/dist/src/utils/graphql/spotterService/nls-answer-queries.d.ts +2 -0
- package/dist/src/utils/graphql/spotterService/nls-answer-queries.d.ts.map +1 -0
- package/dist/src/utils/graphql/spotterService/nls-answer-service.d.ts +9 -0
- package/dist/src/utils/graphql/spotterService/nls-answer-service.d.ts.map +1 -0
- package/dist/tsembed-react.es.js +1 -1
- package/dist/tsembed-react.js +1 -1
- package/dist/tsembed.es.js +446 -3
- package/dist/tsembed.js +446 -2
- package/dist/visual-embed-sdk-react-full.d.ts +9 -1
- package/dist/visual-embed-sdk-react.d.ts +9 -1
- package/dist/visual-embed-sdk.d.ts +9 -1
- package/lib/package.json +1 -1
- package/lib/src/embed/conversation.js +2 -2
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/index.d.ts +2 -1
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +2 -1
- package/lib/src/index.js.map +1 -1
- package/lib/src/utils/graphql/spotterService/conversation-queries.d.ts +3 -0
- package/lib/src/utils/graphql/spotterService/conversation-queries.d.ts.map +1 -0
- package/lib/src/utils/graphql/spotterService/conversation-queries.js +315 -0
- package/lib/src/utils/graphql/spotterService/conversation-queries.js.map +1 -0
- package/lib/src/utils/graphql/spotterService/conversation-service.d.ts +12 -0
- package/lib/src/utils/graphql/spotterService/conversation-service.d.ts.map +1 -0
- package/lib/src/utils/graphql/spotterService/conversation-service.js +84 -0
- package/lib/src/utils/graphql/spotterService/conversation-service.js.map +1 -0
- package/lib/src/utils/graphql/spotterService/nls-answer-queries.d.ts +2 -0
- package/lib/src/utils/graphql/spotterService/nls-answer-queries.d.ts.map +1 -0
- package/lib/src/utils/graphql/spotterService/nls-answer-queries.js +400 -0
- package/lib/src/utils/graphql/spotterService/nls-answer-queries.js.map +1 -0
- package/lib/src/utils/graphql/spotterService/nls-answer-service.d.ts +9 -0
- package/lib/src/utils/graphql/spotterService/nls-answer-service.d.ts.map +1 -0
- package/lib/src/utils/graphql/spotterService/nls-answer-service.js +47 -0
- package/lib/src/utils/graphql/spotterService/nls-answer-service.js.map +1 -0
- package/lib/src/visual-embed-sdk.d.ts +13 -1
- package/package.json +1 -1
- package/src/embed/conversation.ts +2 -2
- package/src/index.ts +2 -0
- package/src/utils/graphql/spotterService/nls-answer-queries.ts +399 -0
- package/src/utils/graphql/spotterService/nls-answer-service.ts +55 -0
- /package/src/utils/graphql/{conversationService → spotterService}/conversation-queries.ts +0 -0
- /package/src/utils/graphql/{conversationService → spotterService}/conversation-service.ts +0 -0
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
export const getAnswerSessionFromQuery = `
|
|
2
|
+
query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
3
|
+
queryRequest(request: $params) {
|
|
4
|
+
...eurekaResults
|
|
5
|
+
__typename
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
fragment eurekaResults on eureka_SearchResponse {
|
|
10
|
+
facets {
|
|
11
|
+
facetType
|
|
12
|
+
facetValue
|
|
13
|
+
facetValues {
|
|
14
|
+
id
|
|
15
|
+
resultCount
|
|
16
|
+
name
|
|
17
|
+
__typename
|
|
18
|
+
}
|
|
19
|
+
__typename
|
|
20
|
+
}
|
|
21
|
+
requestIdentifiers {
|
|
22
|
+
apiRequestId
|
|
23
|
+
appActivityId
|
|
24
|
+
__typename
|
|
25
|
+
}
|
|
26
|
+
sageQuerySuggestions {
|
|
27
|
+
llmReasoning {
|
|
28
|
+
assumptions
|
|
29
|
+
clarifications
|
|
30
|
+
interpretation
|
|
31
|
+
__typename
|
|
32
|
+
}
|
|
33
|
+
tokens
|
|
34
|
+
tmlTokens
|
|
35
|
+
worksheetId
|
|
36
|
+
description
|
|
37
|
+
title
|
|
38
|
+
tmlTokens
|
|
39
|
+
formulaInfo {
|
|
40
|
+
name
|
|
41
|
+
expression
|
|
42
|
+
__typename
|
|
43
|
+
}
|
|
44
|
+
tmlPhrases
|
|
45
|
+
ambiguousPhrases {
|
|
46
|
+
alternativePhrases {
|
|
47
|
+
phraseType
|
|
48
|
+
token {
|
|
49
|
+
token
|
|
50
|
+
dataType
|
|
51
|
+
typeEnum
|
|
52
|
+
guid
|
|
53
|
+
tokenMetadata {
|
|
54
|
+
name
|
|
55
|
+
__typename
|
|
56
|
+
}
|
|
57
|
+
__typename
|
|
58
|
+
}
|
|
59
|
+
__typename
|
|
60
|
+
}
|
|
61
|
+
ambiguityType
|
|
62
|
+
token {
|
|
63
|
+
token
|
|
64
|
+
dataType
|
|
65
|
+
typeEnum
|
|
66
|
+
guid
|
|
67
|
+
tokenMetadata {
|
|
68
|
+
name
|
|
69
|
+
__typename
|
|
70
|
+
}
|
|
71
|
+
__typename
|
|
72
|
+
}
|
|
73
|
+
__typename
|
|
74
|
+
}
|
|
75
|
+
ambiguousTokens {
|
|
76
|
+
alternativeTokens {
|
|
77
|
+
token
|
|
78
|
+
dataType
|
|
79
|
+
typeEnum
|
|
80
|
+
guid
|
|
81
|
+
tokenMetadata {
|
|
82
|
+
name
|
|
83
|
+
deprecatedTableGuid
|
|
84
|
+
deprecatedTableName
|
|
85
|
+
isFormula
|
|
86
|
+
rootTables {
|
|
87
|
+
created
|
|
88
|
+
description
|
|
89
|
+
guid
|
|
90
|
+
indexVersion
|
|
91
|
+
modified
|
|
92
|
+
name
|
|
93
|
+
__typename
|
|
94
|
+
}
|
|
95
|
+
schemaTableUserDefinedName
|
|
96
|
+
table {
|
|
97
|
+
created
|
|
98
|
+
description
|
|
99
|
+
guid
|
|
100
|
+
indexVersion
|
|
101
|
+
modified
|
|
102
|
+
name
|
|
103
|
+
__typename
|
|
104
|
+
}
|
|
105
|
+
__typename
|
|
106
|
+
}
|
|
107
|
+
__typename
|
|
108
|
+
}
|
|
109
|
+
ambiguityType
|
|
110
|
+
token {
|
|
111
|
+
token
|
|
112
|
+
dataType
|
|
113
|
+
typeEnum
|
|
114
|
+
guid
|
|
115
|
+
tokenMetadata {
|
|
116
|
+
name
|
|
117
|
+
__typename
|
|
118
|
+
}
|
|
119
|
+
__typename
|
|
120
|
+
}
|
|
121
|
+
__typename
|
|
122
|
+
}
|
|
123
|
+
sessionId
|
|
124
|
+
genNo
|
|
125
|
+
stateKey {
|
|
126
|
+
generationNumber
|
|
127
|
+
transactionId
|
|
128
|
+
__typename
|
|
129
|
+
}
|
|
130
|
+
subQueries {
|
|
131
|
+
tokens
|
|
132
|
+
cohortConfig {
|
|
133
|
+
anchorColumnId
|
|
134
|
+
cohortAnswerGuid
|
|
135
|
+
cohortGroupingType
|
|
136
|
+
cohortGuid
|
|
137
|
+
cohortType
|
|
138
|
+
combineNonGroupValues
|
|
139
|
+
description
|
|
140
|
+
groupExcludedQueryValues
|
|
141
|
+
hideExcludedQueryValues
|
|
142
|
+
isEditable
|
|
143
|
+
name
|
|
144
|
+
nullOutputValue
|
|
145
|
+
returnColumnId
|
|
146
|
+
__typename
|
|
147
|
+
}
|
|
148
|
+
formulas {
|
|
149
|
+
name
|
|
150
|
+
expression
|
|
151
|
+
__typename
|
|
152
|
+
}
|
|
153
|
+
__typename
|
|
154
|
+
}
|
|
155
|
+
visualizationSuggestion {
|
|
156
|
+
chartType
|
|
157
|
+
displayMode
|
|
158
|
+
axisConfigs {
|
|
159
|
+
category
|
|
160
|
+
color
|
|
161
|
+
hidden
|
|
162
|
+
size
|
|
163
|
+
sort
|
|
164
|
+
x
|
|
165
|
+
y
|
|
166
|
+
__typename
|
|
167
|
+
}
|
|
168
|
+
usersVizIntentApplied
|
|
169
|
+
customChartConfigs {
|
|
170
|
+
dimensions {
|
|
171
|
+
columns
|
|
172
|
+
key
|
|
173
|
+
__typename
|
|
174
|
+
}
|
|
175
|
+
key
|
|
176
|
+
__typename
|
|
177
|
+
}
|
|
178
|
+
customChartGuid
|
|
179
|
+
__typename
|
|
180
|
+
}
|
|
181
|
+
tableData {
|
|
182
|
+
columnDataLite {
|
|
183
|
+
columnId
|
|
184
|
+
columnDataType
|
|
185
|
+
dataValue
|
|
186
|
+
columnName
|
|
187
|
+
__typename
|
|
188
|
+
}
|
|
189
|
+
__typename
|
|
190
|
+
}
|
|
191
|
+
warningType
|
|
192
|
+
cached
|
|
193
|
+
warningDetails {
|
|
194
|
+
warningType
|
|
195
|
+
__typename
|
|
196
|
+
}
|
|
197
|
+
__typename
|
|
198
|
+
}
|
|
199
|
+
results {
|
|
200
|
+
objectSecurityInfo {
|
|
201
|
+
objectType
|
|
202
|
+
objectId
|
|
203
|
+
objectIdForDeletionCheck
|
|
204
|
+
objectTypeForDeletionCheck
|
|
205
|
+
isD13ySourced
|
|
206
|
+
offset
|
|
207
|
+
__typename
|
|
208
|
+
}
|
|
209
|
+
searchAnswer {
|
|
210
|
+
...eurekaAnswer
|
|
211
|
+
__typename
|
|
212
|
+
}
|
|
213
|
+
searchPinboardViz {
|
|
214
|
+
answer {
|
|
215
|
+
...eurekaAnswer
|
|
216
|
+
__typename
|
|
217
|
+
}
|
|
218
|
+
pinboardHeader {
|
|
219
|
+
id
|
|
220
|
+
title
|
|
221
|
+
__typename
|
|
222
|
+
}
|
|
223
|
+
__typename
|
|
224
|
+
}
|
|
225
|
+
searchPinboard {
|
|
226
|
+
header {
|
|
227
|
+
...header
|
|
228
|
+
__typename
|
|
229
|
+
}
|
|
230
|
+
usageInfo {
|
|
231
|
+
...usageInfo
|
|
232
|
+
__typename
|
|
233
|
+
}
|
|
234
|
+
answers {
|
|
235
|
+
...eurekaAnswer
|
|
236
|
+
__typename
|
|
237
|
+
}
|
|
238
|
+
vizCount {
|
|
239
|
+
charts
|
|
240
|
+
metrics
|
|
241
|
+
tables
|
|
242
|
+
__typename
|
|
243
|
+
}
|
|
244
|
+
__typename
|
|
245
|
+
}
|
|
246
|
+
snippetInfo {
|
|
247
|
+
titleSnippet {
|
|
248
|
+
snippetString
|
|
249
|
+
highlights {
|
|
250
|
+
start
|
|
251
|
+
end
|
|
252
|
+
__typename
|
|
253
|
+
}
|
|
254
|
+
__typename
|
|
255
|
+
}
|
|
256
|
+
descriptionSnippet {
|
|
257
|
+
snippetString
|
|
258
|
+
highlights {
|
|
259
|
+
start
|
|
260
|
+
end
|
|
261
|
+
__typename
|
|
262
|
+
}
|
|
263
|
+
__typename
|
|
264
|
+
}
|
|
265
|
+
sageQuerySnippet {
|
|
266
|
+
phrase {
|
|
267
|
+
isCompletePhrase
|
|
268
|
+
numTokens
|
|
269
|
+
phraseType
|
|
270
|
+
startIndex
|
|
271
|
+
__typename
|
|
272
|
+
}
|
|
273
|
+
token {
|
|
274
|
+
token
|
|
275
|
+
dataType
|
|
276
|
+
typeEnum
|
|
277
|
+
__typename
|
|
278
|
+
}
|
|
279
|
+
__typename
|
|
280
|
+
}
|
|
281
|
+
sageQuerySnippetWithHighlights {
|
|
282
|
+
highlights {
|
|
283
|
+
start
|
|
284
|
+
end
|
|
285
|
+
__typename
|
|
286
|
+
}
|
|
287
|
+
phraseType
|
|
288
|
+
phraseValue
|
|
289
|
+
__typename
|
|
290
|
+
}
|
|
291
|
+
__typename
|
|
292
|
+
}
|
|
293
|
+
score
|
|
294
|
+
debugInfo
|
|
295
|
+
resultType
|
|
296
|
+
sageQuery
|
|
297
|
+
__typename
|
|
298
|
+
}
|
|
299
|
+
version
|
|
300
|
+
nextPageOffset
|
|
301
|
+
batchSizeRequired
|
|
302
|
+
isFinalPage
|
|
303
|
+
totalResults
|
|
304
|
+
totalFacetResultCount
|
|
305
|
+
errorCode
|
|
306
|
+
debugInfo {
|
|
307
|
+
fewShotExamples {
|
|
308
|
+
chartType
|
|
309
|
+
formulas {
|
|
310
|
+
name
|
|
311
|
+
expression
|
|
312
|
+
__typename
|
|
313
|
+
}
|
|
314
|
+
id
|
|
315
|
+
mappingId
|
|
316
|
+
nlQuery
|
|
317
|
+
nlQueryConcepts
|
|
318
|
+
sageQuery
|
|
319
|
+
scope
|
|
320
|
+
sql
|
|
321
|
+
tml
|
|
322
|
+
feedbackType
|
|
323
|
+
__typename
|
|
324
|
+
}
|
|
325
|
+
__typename
|
|
326
|
+
}
|
|
327
|
+
__typename
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
fragment eurekaAnswer on eureka_AnswerResult {
|
|
331
|
+
header {
|
|
332
|
+
...header
|
|
333
|
+
__typename
|
|
334
|
+
}
|
|
335
|
+
usageInfo {
|
|
336
|
+
...usageInfo
|
|
337
|
+
__typename
|
|
338
|
+
}
|
|
339
|
+
preferredViz {
|
|
340
|
+
...visualizationMetadata
|
|
341
|
+
__typename
|
|
342
|
+
}
|
|
343
|
+
worksheetInfo {
|
|
344
|
+
...worksheetInfo
|
|
345
|
+
__typename
|
|
346
|
+
}
|
|
347
|
+
formatted {
|
|
348
|
+
phrase {
|
|
349
|
+
isCompletePhrase
|
|
350
|
+
numTokens
|
|
351
|
+
phraseType
|
|
352
|
+
startIndex
|
|
353
|
+
__typename
|
|
354
|
+
}
|
|
355
|
+
token {
|
|
356
|
+
token
|
|
357
|
+
typeEnum
|
|
358
|
+
__typename
|
|
359
|
+
}
|
|
360
|
+
__typename
|
|
361
|
+
}
|
|
362
|
+
__typename
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
fragment header on eureka_Header {
|
|
366
|
+
id
|
|
367
|
+
title
|
|
368
|
+
description
|
|
369
|
+
authorGuid
|
|
370
|
+
authorName
|
|
371
|
+
createdOn
|
|
372
|
+
tagIds
|
|
373
|
+
__typename
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
fragment usageInfo on eureka_UsageInfo {
|
|
377
|
+
favouriteCount
|
|
378
|
+
viewCount
|
|
379
|
+
__typename
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
fragment visualizationMetadata on eureka_VisualizationMetadata {
|
|
383
|
+
vizType
|
|
384
|
+
chartType
|
|
385
|
+
vizSnapshotRequestData {
|
|
386
|
+
parentReportbookGuid
|
|
387
|
+
parentType
|
|
388
|
+
version
|
|
389
|
+
vizGuid
|
|
390
|
+
__typename
|
|
391
|
+
}
|
|
392
|
+
__typename
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
fragment worksheetInfo on eureka_WorksheetInfo {
|
|
396
|
+
id
|
|
397
|
+
name
|
|
398
|
+
__typename
|
|
399
|
+
}`;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { getEmbedConfig } from '../../../embed/embedConfig';
|
|
2
|
+
import { SessionInterface, AnswerService } from '../answerService/answerService';
|
|
3
|
+
import { graphqlQuery } from '../graphql-request';
|
|
4
|
+
import * as queries from './nls-answer-queries';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* @param query string
|
|
9
|
+
* @param worksheetId string
|
|
10
|
+
* @returns answerService AnswerService
|
|
11
|
+
*/
|
|
12
|
+
export const getAnswerFromQuery = async (
|
|
13
|
+
query: string,
|
|
14
|
+
worksheetId: string,
|
|
15
|
+
): Promise<AnswerService> => {
|
|
16
|
+
const embedConfig = getEmbedConfig();
|
|
17
|
+
const resp = await graphqlQuery({
|
|
18
|
+
query: queries.getAnswerSessionFromQuery,
|
|
19
|
+
variables: {
|
|
20
|
+
params: {
|
|
21
|
+
facetSelections: [],
|
|
22
|
+
filterSelections: [
|
|
23
|
+
{
|
|
24
|
+
facetType: 'WORKSHEETS',
|
|
25
|
+
facetValue: [
|
|
26
|
+
worksheetId,
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
query,
|
|
31
|
+
worksheetFacetPayload: {
|
|
32
|
+
worksheetId,
|
|
33
|
+
},
|
|
34
|
+
searchOption: 'AI_ANSWER',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
thoughtSpotHost: embedConfig.thoughtSpotHost,
|
|
38
|
+
isCompositeQuery: false,
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const suggestion = resp.sageQuerySuggestions[0];
|
|
42
|
+
const answerSession: SessionInterface = {
|
|
43
|
+
sessionId: suggestion.sessionId,
|
|
44
|
+
genNo: suggestion.genNo,
|
|
45
|
+
acSession: {
|
|
46
|
+
sessionId: suggestion.stateKey.transactionId,
|
|
47
|
+
genNo: suggestion.stateKey.generationNo,
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
return new AnswerService(
|
|
51
|
+
answerSession,
|
|
52
|
+
null,
|
|
53
|
+
embedConfig.thoughtSpotHost,
|
|
54
|
+
);
|
|
55
|
+
};
|
|
File without changes
|
|
File without changes
|