@thoughtspot/visual-embed-sdk 1.32.3 → 1.32.4-dc.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.
Files changed (278) hide show
  1. package/cjs/package.json +3 -3
  2. package/cjs/src/auth.d.ts +0 -1
  3. package/cjs/src/auth.d.ts.map +1 -1
  4. package/cjs/src/auth.js +0 -1
  5. package/cjs/src/auth.js.map +1 -1
  6. package/cjs/src/authToken.d.ts +4 -0
  7. package/cjs/src/authToken.d.ts.map +1 -1
  8. package/cjs/src/authToken.js +4 -0
  9. package/cjs/src/authToken.js.map +1 -1
  10. package/cjs/src/embed/base.d.ts.map +1 -1
  11. package/cjs/src/embed/base.js +5 -6
  12. package/cjs/src/embed/base.js.map +1 -1
  13. package/cjs/src/embed/conversation.d.ts +26 -0
  14. package/cjs/src/embed/conversation.d.ts.map +1 -0
  15. package/cjs/src/embed/conversation.js +70 -0
  16. package/cjs/src/embed/conversation.js.map +1 -0
  17. package/cjs/src/embed/embed.spec.js +0 -19
  18. package/cjs/src/embed/embed.spec.js.map +1 -1
  19. package/cjs/src/embed/liveboard.d.ts +0 -2
  20. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  21. package/cjs/src/embed/liveboard.js.map +1 -1
  22. package/cjs/src/embed/ts-embed.d.ts +3 -2
  23. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  24. package/cjs/src/embed/ts-embed.js +4 -9
  25. package/cjs/src/embed/ts-embed.js.map +1 -1
  26. package/cjs/src/embed/ts-embed.spec.js +0 -9
  27. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  28. package/cjs/src/index.d.ts +2 -1
  29. package/cjs/src/index.d.ts.map +1 -1
  30. package/cjs/src/index.js +3 -1
  31. package/cjs/src/index.js.map +1 -1
  32. package/cjs/src/tokenizedFetch.d.ts +0 -1
  33. package/cjs/src/tokenizedFetch.d.ts.map +1 -1
  34. package/cjs/src/tokenizedFetch.js +0 -1
  35. package/cjs/src/tokenizedFetch.js.map +1 -1
  36. package/cjs/src/types.d.ts +3 -34
  37. package/cjs/src/types.d.ts.map +1 -1
  38. package/cjs/src/types.js +3 -26
  39. package/cjs/src/types.js.map +1 -1
  40. package/cjs/src/utils/answerService/answerService.d.ts +34 -0
  41. package/cjs/src/utils/answerService/answerService.d.ts.map +1 -0
  42. package/cjs/src/utils/answerService/answerService.js +142 -0
  43. package/cjs/src/utils/answerService/answerService.js.map +1 -0
  44. package/cjs/src/utils/answerService/answerService.spec.d.ts +1 -0
  45. package/cjs/src/utils/answerService/answerService.spec.d.ts.map +1 -0
  46. package/cjs/src/utils/answerService/answerService.spec.js +1 -0
  47. package/cjs/src/utils/answerService/answerService.spec.js.map +1 -0
  48. package/cjs/src/utils/answerService/graphql-queries.d.ts +6 -0
  49. package/cjs/src/utils/answerService/graphql-queries.d.ts.map +1 -0
  50. package/cjs/src/utils/answerService/graphql-queries.js +123 -0
  51. package/cjs/src/utils/answerService/graphql-queries.js.map +1 -0
  52. package/cjs/src/utils/answerService.d.ts +10 -0
  53. package/cjs/src/utils/answerService.d.ts.map +1 -0
  54. package/cjs/src/utils/answerService.js +61 -0
  55. package/cjs/src/utils/answerService.js.map +1 -0
  56. package/cjs/src/utils/answerService.spec.d.ts +2 -0
  57. package/cjs/src/utils/answerService.spec.d.ts.map +1 -0
  58. package/cjs/src/utils/answerService.spec.js +31 -0
  59. package/cjs/src/utils/answerService.spec.js.map +1 -0
  60. package/cjs/src/utils/authService/tokenizedAuthService.d.ts +0 -2
  61. package/cjs/src/utils/authService/tokenizedAuthService.d.ts.map +1 -1
  62. package/cjs/src/utils/authService/tokenizedAuthService.js +0 -2
  63. package/cjs/src/utils/authService/tokenizedAuthService.js.map +1 -1
  64. package/cjs/src/utils/authService.d.ts +37 -0
  65. package/cjs/src/utils/authService.d.ts.map +1 -0
  66. package/cjs/src/utils/authService.js +106 -0
  67. package/cjs/src/utils/authService.js.map +1 -0
  68. package/cjs/src/utils/authService.spec.d.ts +2 -0
  69. package/cjs/src/utils/authService.spec.d.ts.map +1 -0
  70. package/cjs/src/utils/authService.spec.js +72 -0
  71. package/cjs/src/utils/authService.spec.js.map +1 -0
  72. package/cjs/src/utils/graphql/answerService/answer-queries.d.ts +1 -0
  73. package/cjs/src/utils/graphql/answerService/answer-queries.d.ts.map +1 -1
  74. package/cjs/src/utils/graphql/answerService/answer-queries.js +9 -2
  75. package/cjs/src/utils/graphql/answerService/answer-queries.js.map +1 -1
  76. package/cjs/src/utils/graphql/answerService/answerService.d.ts +1 -0
  77. package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  78. package/cjs/src/utils/graphql/answerService/answerService.js +4 -0
  79. package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
  80. package/cjs/src/utils/graphql/answerService/answerService.spec.js +35 -0
  81. package/cjs/src/utils/graphql/answerService/answerService.spec.js.map +1 -1
  82. package/cjs/src/utils/graphql/answerService/graphql-queries.d.ts +5 -0
  83. package/cjs/src/utils/graphql/answerService/graphql-queries.d.ts.map +1 -0
  84. package/cjs/src/utils/graphql/answerService/graphql-queries.js +80 -0
  85. package/cjs/src/utils/graphql/answerService/graphql-queries.js.map +1 -0
  86. package/cjs/src/utils/graphql/conversationService/conversation-queries.d.ts +3 -0
  87. package/cjs/src/utils/graphql/conversationService/conversation-queries.d.ts.map +1 -0
  88. package/cjs/src/utils/graphql/conversationService/conversation-queries.js +318 -0
  89. package/cjs/src/utils/graphql/conversationService/conversation-queries.js.map +1 -0
  90. package/cjs/src/utils/graphql/conversationService/conversation-service.d.ts +12 -0
  91. package/cjs/src/utils/graphql/conversationService/conversation-service.d.ts.map +1 -0
  92. package/cjs/src/utils/graphql/conversationService/conversation-service.js +89 -0
  93. package/cjs/src/utils/graphql/conversationService/conversation-service.js.map +1 -0
  94. package/cjs/src/utils/graphql/graphql-request.d.ts.map +1 -1
  95. package/cjs/src/utils/graphql/graphql-request.spec.d.ts +2 -0
  96. package/cjs/src/utils/graphql/graphql-request.spec.d.ts.map +1 -0
  97. package/cjs/src/utils/graphql/graphql-request.spec.js +36 -0
  98. package/cjs/src/utils/graphql/graphql-request.spec.js.map +1 -0
  99. package/cjs/src/utils/graphql/preview-service.d.ts +6 -0
  100. package/cjs/src/utils/graphql/preview-service.d.ts.map +1 -1
  101. package/cjs/src/utils/graphql/preview-service.js +6 -0
  102. package/cjs/src/utils/graphql/preview-service.js.map +1 -1
  103. package/cjs/src/utils/processData.d.ts.map +1 -1
  104. package/cjs/src/utils/processData.js +0 -1
  105. package/cjs/src/utils/processData.js.map +1 -1
  106. package/cjs/src/utils/processTrigger.d.ts +1 -0
  107. package/cjs/src/utils/processTrigger.d.ts.map +1 -1
  108. package/cjs/src/utils/processTrigger.js +3 -3
  109. package/cjs/src/utils/processTrigger.js.map +1 -1
  110. package/cjs/src/utils/processTrigger.spec.js +10 -0
  111. package/cjs/src/utils/processTrigger.spec.js.map +1 -1
  112. package/cjs/src/utils/sessionInfoService.d.ts +0 -4
  113. package/cjs/src/utils/sessionInfoService.d.ts.map +1 -1
  114. package/cjs/src/utils/sessionInfoService.js +0 -4
  115. package/cjs/src/utils/sessionInfoService.js.map +1 -1
  116. package/cjs/src/utils.d.ts.map +1 -1
  117. package/cjs/src/utils.js +1 -5
  118. package/cjs/src/utils.js.map +1 -1
  119. package/dist/assets/main-DT_ac2DB.js +264 -0
  120. package/dist/local/index.html +34 -0
  121. package/dist/src/auth.d.ts +0 -1
  122. package/dist/src/auth.d.ts.map +1 -1
  123. package/dist/src/authToken.d.ts +4 -0
  124. package/dist/src/authToken.d.ts.map +1 -1
  125. package/dist/src/embed/base.d.ts.map +1 -1
  126. package/dist/src/embed/conversation.d.ts +26 -0
  127. package/dist/src/embed/conversation.d.ts.map +1 -0
  128. package/dist/src/embed/liveboard.d.ts +0 -2
  129. package/dist/src/embed/liveboard.d.ts.map +1 -1
  130. package/dist/src/embed/ts-embed.d.ts +3 -2
  131. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  132. package/dist/src/index.d.ts +2 -1
  133. package/dist/src/index.d.ts.map +1 -1
  134. package/dist/src/tokenizedFetch.d.ts +0 -1
  135. package/dist/src/tokenizedFetch.d.ts.map +1 -1
  136. package/dist/src/types.d.ts +3 -34
  137. package/dist/src/types.d.ts.map +1 -1
  138. package/dist/src/utils/authService/tokenizedAuthService.d.ts +0 -2
  139. package/dist/src/utils/authService/tokenizedAuthService.d.ts.map +1 -1
  140. package/dist/src/utils/graphql/answerService/answer-queries.d.ts +1 -0
  141. package/dist/src/utils/graphql/answerService/answer-queries.d.ts.map +1 -1
  142. package/dist/src/utils/graphql/answerService/answerService.d.ts +1 -0
  143. package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  144. package/dist/src/utils/graphql/conversationService/conversation-queries.d.ts +3 -0
  145. package/dist/src/utils/graphql/conversationService/conversation-queries.d.ts.map +1 -0
  146. package/dist/src/utils/graphql/conversationService/conversation-service.d.ts +12 -0
  147. package/dist/src/utils/graphql/conversationService/conversation-service.d.ts.map +1 -0
  148. package/dist/src/utils/graphql/graphql-request.d.ts.map +1 -1
  149. package/dist/src/utils/graphql/graphql-request.spec.d.ts +2 -0
  150. package/dist/src/utils/graphql/graphql-request.spec.d.ts.map +1 -0
  151. package/dist/src/utils/graphql/preview-service.d.ts +6 -0
  152. package/dist/src/utils/graphql/preview-service.d.ts.map +1 -1
  153. package/dist/src/utils/processData.d.ts.map +1 -1
  154. package/dist/src/utils/processTrigger.d.ts +1 -0
  155. package/dist/src/utils/processTrigger.d.ts.map +1 -1
  156. package/dist/src/utils/sessionInfoService.d.ts +0 -4
  157. package/dist/src/utils/sessionInfoService.d.ts.map +1 -1
  158. package/dist/src/utils.d.ts.map +1 -1
  159. package/dist/tsembed-react.es.js +31 -49
  160. package/dist/tsembed-react.js +31 -49
  161. package/dist/tsembed.es.js +495 -56
  162. package/dist/tsembed.js +495 -55
  163. package/dist/visual-embed-sdk-react-full.d.ts +43 -53
  164. package/dist/visual-embed-sdk-react.d.ts +43 -53
  165. package/dist/visual-embed-sdk.d.ts +43 -53
  166. package/lib/package.json +3 -3
  167. package/lib/src/auth.d.ts +0 -1
  168. package/lib/src/auth.d.ts.map +1 -1
  169. package/lib/src/auth.js +0 -1
  170. package/lib/src/auth.js.map +1 -1
  171. package/lib/src/authToken.d.ts +4 -0
  172. package/lib/src/authToken.d.ts.map +1 -1
  173. package/lib/src/authToken.js +4 -0
  174. package/lib/src/authToken.js.map +1 -1
  175. package/lib/src/embed/base.d.ts.map +1 -1
  176. package/lib/src/embed/base.js +5 -6
  177. package/lib/src/embed/base.js.map +1 -1
  178. package/lib/src/embed/conversation.d.ts +26 -0
  179. package/lib/src/embed/conversation.d.ts.map +1 -0
  180. package/lib/src/embed/conversation.js +66 -0
  181. package/lib/src/embed/conversation.js.map +1 -0
  182. package/lib/src/embed/embed.spec.js +0 -19
  183. package/lib/src/embed/embed.spec.js.map +1 -1
  184. package/lib/src/embed/liveboard.d.ts +0 -2
  185. package/lib/src/embed/liveboard.d.ts.map +1 -1
  186. package/lib/src/embed/liveboard.js.map +1 -1
  187. package/lib/src/embed/ts-embed.d.ts +3 -2
  188. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  189. package/lib/src/embed/ts-embed.js +4 -9
  190. package/lib/src/embed/ts-embed.js.map +1 -1
  191. package/lib/src/embed/ts-embed.spec.js +0 -9
  192. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  193. package/lib/src/index.d.ts +2 -1
  194. package/lib/src/index.d.ts.map +1 -1
  195. package/lib/src/index.js +2 -1
  196. package/lib/src/index.js.map +1 -1
  197. package/lib/src/tokenizedFetch.d.ts +0 -1
  198. package/lib/src/tokenizedFetch.d.ts.map +1 -1
  199. package/lib/src/tokenizedFetch.js +0 -1
  200. package/lib/src/tokenizedFetch.js.map +1 -1
  201. package/lib/src/types.d.ts +3 -34
  202. package/lib/src/types.d.ts.map +1 -1
  203. package/lib/src/types.js +3 -26
  204. package/lib/src/types.js.map +1 -1
  205. package/lib/src/utils/authService/tokenizedAuthService.d.ts +0 -2
  206. package/lib/src/utils/authService/tokenizedAuthService.d.ts.map +1 -1
  207. package/lib/src/utils/authService/tokenizedAuthService.js +0 -2
  208. package/lib/src/utils/authService/tokenizedAuthService.js.map +1 -1
  209. package/lib/src/utils/graphql/answerService/answer-queries.d.ts +1 -0
  210. package/lib/src/utils/graphql/answerService/answer-queries.d.ts.map +1 -1
  211. package/lib/src/utils/graphql/answerService/answer-queries.js +8 -1
  212. package/lib/src/utils/graphql/answerService/answer-queries.js.map +1 -1
  213. package/lib/src/utils/graphql/answerService/answerService.d.ts +1 -0
  214. package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  215. package/lib/src/utils/graphql/answerService/answerService.js +4 -0
  216. package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
  217. package/lib/src/utils/graphql/answerService/answerService.spec.js +36 -1
  218. package/lib/src/utils/graphql/answerService/answerService.spec.js.map +1 -1
  219. package/lib/src/utils/graphql/conversationService/conversation-queries.d.ts +3 -0
  220. package/lib/src/utils/graphql/conversationService/conversation-queries.d.ts.map +1 -0
  221. package/lib/src/utils/graphql/conversationService/conversation-queries.js +315 -0
  222. package/lib/src/utils/graphql/conversationService/conversation-queries.js.map +1 -0
  223. package/lib/src/utils/graphql/conversationService/conversation-service.d.ts +12 -0
  224. package/lib/src/utils/graphql/conversationService/conversation-service.d.ts.map +1 -0
  225. package/lib/src/utils/graphql/conversationService/conversation-service.js +84 -0
  226. package/lib/src/utils/graphql/conversationService/conversation-service.js.map +1 -0
  227. package/lib/src/utils/graphql/graphql-request.d.ts.map +1 -1
  228. package/lib/src/utils/graphql/graphql-request.spec.d.ts +2 -0
  229. package/lib/src/utils/graphql/graphql-request.spec.d.ts.map +1 -0
  230. package/lib/src/utils/graphql/graphql-request.spec.js +33 -0
  231. package/lib/src/utils/graphql/graphql-request.spec.js.map +1 -0
  232. package/lib/src/utils/graphql/preview-service.d.ts +6 -0
  233. package/lib/src/utils/graphql/preview-service.d.ts.map +1 -1
  234. package/lib/src/utils/graphql/preview-service.js +6 -0
  235. package/lib/src/utils/graphql/preview-service.js.map +1 -1
  236. package/lib/src/utils/processData.d.ts.map +1 -1
  237. package/lib/src/utils/processData.js +0 -1
  238. package/lib/src/utils/processData.js.map +1 -1
  239. package/lib/src/utils/processTrigger.d.ts +1 -0
  240. package/lib/src/utils/processTrigger.d.ts.map +1 -1
  241. package/lib/src/utils/processTrigger.js +1 -1
  242. package/lib/src/utils/processTrigger.js.map +1 -1
  243. package/lib/src/utils/processTrigger.spec.js +10 -0
  244. package/lib/src/utils/processTrigger.spec.js.map +1 -1
  245. package/lib/src/utils/sessionInfoService.d.ts +0 -4
  246. package/lib/src/utils/sessionInfoService.d.ts.map +1 -1
  247. package/lib/src/utils/sessionInfoService.js +0 -4
  248. package/lib/src/utils/sessionInfoService.js.map +1 -1
  249. package/lib/src/utils.d.ts.map +1 -1
  250. package/lib/src/utils.js +1 -5
  251. package/lib/src/utils.js.map +1 -1
  252. package/lib/src/visual-embed-sdk.d.ts +47 -53
  253. package/package.json +3 -3
  254. package/src/auth.ts +0 -1
  255. package/src/authToken.ts +4 -0
  256. package/src/embed/base.ts +0 -1
  257. package/src/embed/conversation.ts +96 -0
  258. package/src/embed/embed.spec.ts +0 -22
  259. package/src/embed/liveboard.ts +0 -2
  260. package/src/embed/ts-embed.spec.ts +0 -11
  261. package/src/embed/ts-embed.ts +4 -9
  262. package/src/index.ts +3 -0
  263. package/src/tokenizedFetch.ts +0 -1
  264. package/src/types.ts +3 -34
  265. package/src/utils/authService/tokenizedAuthService.ts +0 -2
  266. package/src/utils/graphql/answerService/answer-queries.ts +9 -1
  267. package/src/utils/graphql/answerService/answerService.spec.ts +45 -0
  268. package/src/utils/graphql/answerService/answerService.ts +8 -0
  269. package/src/utils/graphql/conversationService/conversation-queries.ts +315 -0
  270. package/src/utils/graphql/conversationService/conversation-service.ts +93 -0
  271. package/src/utils/graphql/graphql-request.spec.ts +38 -0
  272. package/src/utils/graphql/graphql-request.ts +1 -1
  273. package/src/utils/graphql/preview-service.ts +6 -0
  274. package/src/utils/processData.ts +0 -1
  275. package/src/utils/processTrigger.spec.ts +19 -0
  276. package/src/utils/processTrigger.ts +1 -1
  277. package/src/utils/sessionInfoService.ts +0 -4
  278. package/src/utils.ts +0 -5
@@ -0,0 +1,315 @@
1
+ export const createConversation = `
2
+ mutation CreateConversation($params: Input_convassist_CreateConversationRequest) {
3
+ ConvAssist__createConversation(request: $params) {
4
+ convId
5
+ initialCtx {
6
+ type
7
+ tsAnsCtx {
8
+ sessionId
9
+ genNo
10
+ stateKey {
11
+ transactionId
12
+ generationNumber
13
+ __typename
14
+ }
15
+ worksheet {
16
+ worksheetId
17
+ worksheetName
18
+ __typename
19
+ }
20
+ __typename
21
+ }
22
+ __typename
23
+ }
24
+ __typename
25
+ }
26
+ }
27
+ `;
28
+
29
+ export const sendMessage = `
30
+ query SendMessage($params: Input_convassist_SendMessageRequest) {
31
+ ConvAssist__sendMessage(request: $params) {
32
+ responses {
33
+ timestamp
34
+ msgId
35
+ data {
36
+ asstRespData {
37
+ tool
38
+ asstRespText
39
+ nlsAnsData {
40
+ sageQuerySuggestions {
41
+ sageQueryTokens {
42
+ additions {
43
+ phrase {
44
+ isCompletePhrase
45
+ numTokens
46
+ phraseType
47
+ startIndex
48
+ __typename
49
+ }
50
+ tokens {
51
+ token
52
+ dataType
53
+ typeEnum
54
+ guid
55
+ tokenMetadata {
56
+ name
57
+ __typename
58
+ }
59
+ __typename
60
+ }
61
+ __typename
62
+ }
63
+ phrases {
64
+ isCompletePhrase
65
+ numTokens
66
+ phraseType
67
+ startIndex
68
+ __typename
69
+ }
70
+ removals {
71
+ phrase {
72
+ isCompletePhrase
73
+ numTokens
74
+ phraseType
75
+ startIndex
76
+ __typename
77
+ }
78
+ tokens {
79
+ token
80
+ dataType
81
+ typeEnum
82
+ guid
83
+ tokenMetadata {
84
+ name
85
+ __typename
86
+ }
87
+ __typename
88
+ }
89
+ __typename
90
+ }
91
+ tokens {
92
+ token
93
+ dataType
94
+ typeEnum
95
+ guid
96
+ tokenMetadata {
97
+ name
98
+ __typename
99
+ }
100
+ __typename
101
+ }
102
+ __typename
103
+ }
104
+ llmReasoning {
105
+ assumptions
106
+ clarifications
107
+ interpretation
108
+ __typename
109
+ }
110
+ tokens
111
+ tmlTokens
112
+ worksheetId
113
+ tokens
114
+ description
115
+ title
116
+ tmlTokens
117
+ cached
118
+ sqlQuery
119
+ sessionId
120
+ genNo
121
+ formulaInfo {
122
+ name
123
+ expression
124
+ __typename
125
+ }
126
+ tmlPhrases
127
+ ambiguousPhrases {
128
+ alternativePhrases {
129
+ phraseType
130
+ token {
131
+ token
132
+ dataType
133
+ typeEnum
134
+ guid
135
+ tokenMetadata {
136
+ name
137
+ __typename
138
+ }
139
+ __typename
140
+ }
141
+ __typename
142
+ }
143
+ ambiguityType
144
+ token {
145
+ token
146
+ dataType
147
+ typeEnum
148
+ guid
149
+ tokenMetadata {
150
+ name
151
+ __typename
152
+ }
153
+ __typename
154
+ }
155
+ __typename
156
+ }
157
+ ambiguousTokens {
158
+ alternativeTokens {
159
+ token
160
+ dataType
161
+ typeEnum
162
+ guid
163
+ tokenMetadata {
164
+ name
165
+ deprecatedTableGuid
166
+ deprecatedTableName
167
+ isFormula
168
+ rootTables {
169
+ created
170
+ description
171
+ guid
172
+ indexVersion
173
+ modified
174
+ name
175
+ __typename
176
+ }
177
+ schemaTableUserDefinedName
178
+ table {
179
+ created
180
+ description
181
+ guid
182
+ indexVersion
183
+ modified
184
+ name
185
+ __typename
186
+ }
187
+ __typename
188
+ }
189
+ __typename
190
+ }
191
+ ambiguityType
192
+ token {
193
+ token
194
+ dataType
195
+ typeEnum
196
+ guid
197
+ tokenMetadata {
198
+ name
199
+ __typename
200
+ }
201
+ __typename
202
+ }
203
+ __typename
204
+ }
205
+ stateKey {
206
+ transactionId
207
+ generationNumber
208
+ transactionId
209
+ __typename
210
+ }
211
+ subQueries {
212
+ tokens
213
+ cohortConfig {
214
+ anchorColumnId
215
+ cohortAnswerGuid
216
+ cohortGroupingType
217
+ cohortGuid
218
+ cohortType
219
+ combineNonGroupValues
220
+ description
221
+ groupExcludedQueryValues
222
+ hideExcludedQueryValues
223
+ isEditable
224
+ name
225
+ nullOutputValue
226
+ returnColumnId
227
+ __typename
228
+ }
229
+ formulas {
230
+ name
231
+ expression
232
+ __typename
233
+ }
234
+ __typename
235
+ }
236
+ visualizationSuggestion {
237
+ chartType
238
+ displayMode
239
+ axisConfigs {
240
+ category
241
+ color
242
+ hidden
243
+ size
244
+ sort
245
+ x
246
+ y
247
+ __typename
248
+ }
249
+ usersVizIntentApplied
250
+ customChartConfigs {
251
+ dimensions {
252
+ columns
253
+ key
254
+ __typename
255
+ }
256
+ key
257
+ __typename
258
+ }
259
+ customChartGuid
260
+ __typename
261
+ }
262
+ tableData {
263
+ columnDataLite {
264
+ columnId
265
+ columnDataType
266
+ dataValue
267
+ columnName
268
+ __typename
269
+ }
270
+ __typename
271
+ }
272
+ warningType
273
+ cached
274
+ __typename
275
+ }
276
+ debugInfo {
277
+ fewShotExamples {
278
+ chartType
279
+ id
280
+ mappingId
281
+ nlQuery
282
+ nlQueryConcepts
283
+ sageQuery
284
+ scope
285
+ sql
286
+ tml
287
+ __typename
288
+ }
289
+ __typename
290
+ }
291
+ __typename
292
+ }
293
+ __typename
294
+ }
295
+ errorData {
296
+ tool
297
+ errCode
298
+ errTxt
299
+ toolErrCode
300
+ __typename
301
+ }
302
+ __typename
303
+ }
304
+ type
305
+ __typename
306
+ }
307
+ prevCtx {
308
+ genNo
309
+ sessionId
310
+ __typename
311
+ }
312
+ __typename
313
+ }
314
+ }
315
+ `;
@@ -0,0 +1,93 @@
1
+ import { graphqlQuery } from '../graphql-request';
2
+ import * as queries from './conversation-queries';
3
+
4
+ export class Conversation {
5
+ private conversationId: string;
6
+
7
+ private inProgress = false;
8
+
9
+ constructor(private thoughtSpotHost: string, private worksheetId: string) {
10
+ this.init();
11
+ }
12
+
13
+ async init() {
14
+ try {
15
+ this.inProgress = true;
16
+ const { convId } = await this.createConversation();
17
+ this.conversationId = convId;
18
+ } finally {
19
+ this.inProgress = false;
20
+ }
21
+ }
22
+
23
+ createConversation(): Promise<any> {
24
+ return this.executeQuery(
25
+ queries.createConversation,
26
+ {
27
+ params: {
28
+ initialCtx: {
29
+ tsWorksheetCtx: {
30
+ worksheet: {
31
+ worksheetId: this.worksheetId,
32
+ },
33
+ },
34
+ type: 'TS_WORKSHEET',
35
+ },
36
+ userInfo: {
37
+ tenantUrl: `${this.thoughtSpotHost}/prism`,
38
+ },
39
+ },
40
+ },
41
+ );
42
+ }
43
+
44
+ public async sendMessage(userMessage: string): Promise<any> {
45
+ if (this.inProgress) {
46
+ console.warn('Previous message still in progress');
47
+ return { error: 'Previous message still in progress' };
48
+ }
49
+
50
+ try {
51
+ this.inProgress = true;
52
+ const { responses } = await this.executeQuery(
53
+ queries.sendMessage,
54
+ {
55
+ params: {
56
+ convId: this.conversationId,
57
+ msg: {
58
+ data: {
59
+ userCmdData: {
60
+ cmdText: userMessage,
61
+ nlsData: {
62
+ worksheetId: this.worksheetId,
63
+ },
64
+ },
65
+ },
66
+ msgId: crypto.randomUUID(),
67
+ type: 'USER_COMMAND',
68
+ },
69
+ },
70
+ },
71
+ );
72
+ this.inProgress = false;
73
+ const data = responses[0].data;
74
+ return {
75
+ data: data.asstRespData.nlsAnsData.sageQuerySuggestions[0],
76
+ error: null,
77
+ };
78
+ } catch (error) {
79
+ return { error };
80
+ } finally {
81
+ this.inProgress = false;
82
+ }
83
+ }
84
+
85
+ public async executeQuery(query: string, variables: any) {
86
+ return graphqlQuery({
87
+ query,
88
+ variables,
89
+ thoughtSpotHost: this.thoughtSpotHost,
90
+ isCompositeQuery: false,
91
+ });
92
+ }
93
+ }
@@ -0,0 +1,38 @@
1
+ import 'jest-fetch-mock';
2
+ import { getSourceDetail } from './sourceService';
3
+ import * as tokenizedFetchUtil from '../../tokenizedFetch';
4
+ import { graphqlQuery } from './graphql-request';
5
+
6
+ const getSourceDetailQuery = `
7
+ query GetSourceDetail($ids: [GUID!]!) {
8
+ getSourceDetailById(ids: $ids, type: LOGICAL_TABLE) {
9
+ id
10
+ name
11
+ }
12
+ }
13
+ `;
14
+
15
+ const thoughtSpotHost = 'TSHOST';
16
+
17
+ describe('graphQl tests', () => {
18
+ test('should call tokenizedFetch with correct parameters when graphqlQuery is called', async () => {
19
+ jest.spyOn(tokenizedFetchUtil, 'tokenizedFetch');
20
+
21
+ const details = await graphqlQuery({
22
+ query: getSourceDetailQuery,
23
+ variables: {
24
+ ids: [2],
25
+ },
26
+ thoughtSpotHost,
27
+ });
28
+
29
+ expect(tokenizedFetchUtil.tokenizedFetch).toBeCalledWith('TSHOST/prism/?op=GetSourceDetail', {
30
+ body: '{"operationName":"GetSourceDetail","query":"\\n query GetSourceDetail($ids: [GUID!]!) {\\n getSourceDetailById(ids: $ids, type: LOGICAL_TABLE) {\\n id\\n name\\n }\\n } \\n","variables":{"ids":[2]}}',
31
+ credentials: 'include',
32
+ headers: {
33
+ accept: '*/*', 'accept-language': 'en-us', 'content-type': 'application/json;charset=UTF-8', 'x-requested-by': 'ThoughtSpot',
34
+ },
35
+ method: 'POST',
36
+ });
37
+ });
38
+ });
@@ -19,7 +19,7 @@ export async function graphqlQuery({
19
19
  variables: any,
20
20
  thoughtSpotHost: string,
21
21
  isCompositeQuery?: boolean
22
- }) {
22
+ }): Promise<any> {
23
23
  const operationName = getOperationNameFromQuery(query);
24
24
  try {
25
25
  const response = await tokenizedFetch(`${thoughtSpotHost}/prism/?op=${operationName}`, {
@@ -18,6 +18,12 @@ query GetEurekaVizSnapshots(
18
18
  }
19
19
  `;
20
20
 
21
+ /**
22
+ *
23
+ * @param thoughtSpotHost
24
+ * @param vizId
25
+ * @param liveboardId
26
+ */
21
27
  export async function getPreview(
22
28
  thoughtSpotHost: string,
23
29
  vizId: string,
@@ -32,7 +32,6 @@ export function processCustomAction(e: any, thoughtSpotHost: string) {
32
32
 
33
33
  /**
34
34
  * Responds to AuthInit sent from host signifying successful authentication in host.
35
- *
36
35
  * @param e
37
36
  * @returns {any}
38
37
  */
@@ -67,4 +67,23 @@ describe('Unit test for processTrigger', () => {
67
67
  expect(messageChannelMock.port1.close).toBeCalled();
68
68
  expect(triggerPromise).rejects.toEqual(res.data.error);
69
69
  });
70
+
71
+ test('should close channel.port1 when timeout exceeds TRIGGER_TIMEOUT', async () => {
72
+ const messageType = HostEvent.Search;
73
+ const thoughtSpotHost = 'http://localhost:3000';
74
+ const data = {};
75
+ mockMessageChannel();
76
+
77
+ const triggerPromise = _processTriggerInstance.processTrigger(
78
+ iFrame,
79
+ messageType,
80
+ thoughtSpotHost,
81
+ data,
82
+ );
83
+
84
+ jest.advanceTimersByTime(_processTriggerInstance.TRIGGER_TIMEOUT);
85
+
86
+ expect(messageChannelMock.port1.close).toBeCalled();
87
+ await expect(triggerPromise).resolves.toBeInstanceOf(Error);
88
+ });
70
89
  });
@@ -31,7 +31,7 @@ function postIframeMessage(
31
31
  return iFrame.contentWindow.postMessage(message, thoughtSpotHost, [channel?.port2]);
32
32
  }
33
33
 
34
- const TRIGGER_TIMEOUT = 30000;
34
+ export const TRIGGER_TIMEOUT = 30000;
35
35
 
36
36
  /**
37
37
  *
@@ -19,7 +19,6 @@ let sessionInfo: null | SessionInfo = null;
19
19
  * Returns the session info object and caches it for future use.
20
20
  * Once fetched the session info object is cached and returned from the cache on
21
21
  * subsequent calls.
22
- *
23
22
  * @example ```js
24
23
  * const sessionInfo = await getSessionInfo();
25
24
  * console.log(sessionInfo);
@@ -40,7 +39,6 @@ export async function getSessionInfo(): Promise<SessionInfo> {
40
39
  /**
41
40
  * Returns the cached session info object. If the client is not authenticated the
42
41
  * function will return null.
43
- *
44
42
  * @example ```js
45
43
  * const sessionInfo = getCachedSessionInfo();
46
44
  * if (sessionInfo) {
@@ -58,7 +56,6 @@ export function getCachedSessionInfo(): SessionInfo | null {
58
56
 
59
57
  /**
60
58
  * Processes the session info response and returns the session info object.
61
- *
62
59
  * @param sessionInfoResp {any} Response from the session info API.
63
60
  * @returns {SessionInfo} The session info object.
64
61
  * @example ```js
@@ -87,7 +84,6 @@ export const getSessionDetails = (sessionInfoResp: any): SessionInfo => {
87
84
 
88
85
  /**
89
86
  * Resets the cached session info object and forces a new fetch on the next call.
90
- *
91
87
  * @example ```js
92
88
  * resetCachedSessionInfo();
93
89
  * const sessionInfo = await getSessionInfo();
package/src/utils.ts CHANGED
@@ -206,7 +206,6 @@ export const getCustomisations = (
206
206
  embedConfig: EmbedConfig,
207
207
  viewConfig: ViewConfig,
208
208
  ): CustomisationsInterface => {
209
- const customCssUrlFromEmbedConfig = embedConfig.customCssUrl;
210
209
  const customizationsFromViewConfig = viewConfig.customizations;
211
210
  const customizationsFromEmbedConfig = embedConfig.customizations
212
211
  || ((embedConfig as any).customisations as CustomisationsInterface);
@@ -219,10 +218,6 @@ export const getCustomisations = (
219
218
  ...customizationsFromEmbedConfig?.style?.customCSS,
220
219
  ...customizationsFromViewConfig?.style?.customCSS,
221
220
  },
222
- customCSSUrl:
223
- customizationsFromViewConfig?.style?.customCSSUrl
224
- || customizationsFromEmbedConfig?.style?.customCSSUrl
225
- || customCssUrlFromEmbedConfig,
226
221
  },
227
222
  content: {
228
223
  ...customizationsFromEmbedConfig?.content,