@thoughtspot/visual-embed-sdk 1.32.3 → 1.32.4-dc.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.
Files changed (278) hide show
  1. package/cjs/package.json +1 -1
  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 +41 -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 +0 -1
  23. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  24. package/cjs/src/embed/ts-embed.js +2 -8
  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 +0 -1
  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 +29 -48
  160. package/dist/tsembed-react.js +29 -48
  161. package/dist/tsembed.es.js +466 -55
  162. package/dist/tsembed.js +466 -54
  163. package/dist/visual-embed-sdk-react-full.d.ts +40 -52
  164. package/dist/visual-embed-sdk-react.d.ts +40 -52
  165. package/dist/visual-embed-sdk.d.ts +40 -52
  166. package/lib/package.json +1 -1
  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 +37 -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 +0 -1
  188. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  189. package/lib/src/embed/ts-embed.js +2 -8
  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 +44 -52
  253. package/package.json +1 -1
  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 +57 -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 +0 -8
  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
package/src/types.ts CHANGED
@@ -255,7 +255,6 @@ export interface customCssInterface {
255
255
  * Styles within the {@link CustomisationsInterface}.
256
256
  */
257
257
  export interface CustomStyles {
258
- customCSSUrl?: string;
259
258
  customCSS?: customCssInterface;
260
259
  }
261
260
 
@@ -449,13 +448,6 @@ export interface EmbedConfig {
449
448
  */
450
449
  queueMultiRenders?: boolean;
451
450
 
452
- /**
453
- * Dynamic CSS URL to be injected in the loaded application.
454
- * You would also need to set `style-src` in the CSP settings.
455
- * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
456
- * @default ''
457
- */
458
- customCssUrl?: string;
459
451
  /**
460
452
  * [AuthServer|Basic] Detect if third-party party cookies are enabled by doing an
461
453
  * additional call. This is slower and should be avoided. Listen to the
@@ -2476,28 +2468,23 @@ export enum HostEvent {
2476
2468
  /**
2477
2469
  * Trigger the **Make a copy** action on a Liveboard,
2478
2470
  * visualization, or Answer page.
2479
- *
2480
2471
  * @example
2481
2472
  * ```js
2482
2473
  * liveboardEmbed.trigger(HostEvent.MakeACopy)
2483
2474
  * ```
2484
- *
2485
2475
  * @example
2486
2476
  * ```js
2487
2477
  * liveboardEmbed.trigger(HostEvent.MakeACopy, {
2488
2478
  * vizId: '730496d6-6903-4601-937e-2c691821af3c'})
2489
2479
  * ```
2490
- *
2491
2480
  * @example
2492
2481
  * ```js
2493
2482
  * vizEmbed.trigger(HostEvent.MakeACopy)
2494
2483
  * ```
2495
- *
2496
2484
  * @example
2497
2485
  * ```js
2498
2486
  * searchEmbed.trigger(HostEvent.MakeACopy)
2499
2487
  * ```
2500
- *
2501
2488
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2502
2489
  */
2503
2490
  MakeACopy = 'makeACopy',
@@ -2523,7 +2510,6 @@ export enum HostEvent {
2523
2510
  /**
2524
2511
  * Trigger the **Create alert** action on a KPI chart
2525
2512
  * in a Liveboard or saved Answer.
2526
- *
2527
2513
  * @param - an object with `vizId` as a key
2528
2514
  * @example
2529
2515
  * ```js
@@ -2531,7 +2517,6 @@ export enum HostEvent {
2531
2517
  * vizId: '730496d6-6903-4601-937e-2c691821af3c'
2532
2518
  * })
2533
2519
  * ```
2534
- *
2535
2520
  * @example
2536
2521
  * ```js
2537
2522
  * searchEmbed.trigger(HostEvent.CreateMonitor)
@@ -2542,7 +2527,6 @@ export enum HostEvent {
2542
2527
  /**
2543
2528
  * Trigger the **Manage alerts** action on a KPI chart
2544
2529
  * in a visualization or saved Answer.
2545
- *
2546
2530
  * @param - an object with `vizId` as a key
2547
2531
  * @example
2548
2532
  * ```js
@@ -2550,12 +2534,10 @@ export enum HostEvent {
2550
2534
  * vizId: '730496d6-6903-4601-937e-2c691821af3c'
2551
2535
  * })
2552
2536
  * ```
2553
- *
2554
2537
  * @example
2555
2538
  * ```js
2556
2539
  * searchEmbed.trigger(HostEvent.ManageMonitor)
2557
2540
  * ```
2558
- *
2559
2541
  * @example
2560
2542
  * ```js
2561
2543
  * vizEmbed.trigger(HostEvent.ManageMonitor)
@@ -2953,7 +2935,6 @@ export enum HostEvent {
2953
2935
  /**
2954
2936
  * Get the answer session for a Search or
2955
2937
  * Liveboard visualization.
2956
- *
2957
2938
  * @example
2958
2939
  * ```js
2959
2940
  * const {session} = await embed.trigger(
@@ -2961,12 +2942,10 @@ export enum HostEvent {
2961
2942
  * vizId: '123', // For Liveboard Visualization.
2962
2943
  * })
2963
2944
  * ```
2964
- *
2965
2945
  * @example
2966
2946
  * ```js
2967
2947
  * const {session} = await embed.trigger( HostEvent.GetAnswerSession )
2968
2948
  * ```
2969
- *
2970
2949
  * @version SDK: 1.26.0 | Thoughtspot: 9.10.0.cl
2971
2950
  */
2972
2951
  GetAnswerSession = 'getAnswerSession',
@@ -3080,7 +3059,6 @@ export enum Param {
3080
3059
  ViewPortHeight = 'viewPortHeight',
3081
3060
  ViewPortWidth = 'viewPortWidth',
3082
3061
  VisibleActions = 'visibleAction',
3083
- CustomCSSUrl = 'customCssUrl',
3084
3062
  DisableLoginRedirect = 'disableLoginRedirect',
3085
3063
  visibleVizs = 'pinboardVisibleVizs',
3086
3064
  LiveboardV2Enabled = 'isPinboardV2Enabled',
@@ -3694,7 +3672,6 @@ export enum Action {
3694
3672
  /**
3695
3673
  * @deprecated
3696
3674
  * Reports errors
3697
- *
3698
3675
  * @example
3699
3676
  * ```js
3700
3677
  * disabledActions: [Action.ReportError]
@@ -3924,14 +3901,12 @@ export enum Action {
3924
3901
  * ```js
3925
3902
  * disabledActions: [Action.RequestVerification]
3926
3903
  * ```
3927
- *
3928
3904
  * @version SDK: 1.25.0 | Thoughtspot: 9.6.0.cl
3929
3905
  */
3930
3906
  RequestVerification = 'requestVerification',
3931
3907
  /**
3932
3908
  *
3933
- * Allows users to mark a Liveboard as verified.
3934
- *
3909
+ *Allows users to mark a Liveboard as verified.
3935
3910
  * @example
3936
3911
  * ```js
3937
3912
  * disabledActions: [Action.MarkAsVerified]
@@ -3942,7 +3917,6 @@ export enum Action {
3942
3917
  /**
3943
3918
  * The **Add Tab** action on a Liveboard.
3944
3919
  * Allows adding a new tab to a Liveboard view.
3945
- *
3946
3920
  * @example
3947
3921
  * ```js
3948
3922
  * disabledActions: [Action.AddTab]
@@ -3952,8 +3926,7 @@ export enum Action {
3952
3926
  AddTab = 'addTab',
3953
3927
  /**
3954
3928
  *
3955
- * Initiates contextual change analysis on KPI charts.
3956
- *
3929
+ *Initiates contextual change analysis on KPI charts.
3957
3930
  * @example
3958
3931
  * ```js
3959
3932
  * disabledActions: [Action.EnableContextualChangeAnalysis]
@@ -3967,7 +3940,6 @@ export enum Action {
3967
3940
  * ```js
3968
3941
  * disabledActions: [Action.ShowSageQuery]
3969
3942
  * ```
3970
- *
3971
3943
  * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
3972
3944
  */
3973
3945
  ShowSageQuery = 'showSageQuery',
@@ -3982,8 +3954,7 @@ export enum Action {
3982
3954
  EditSageAnswer = 'editSageAnswer',
3983
3955
  /**
3984
3956
  *
3985
- * This action allows users to send feedback on AI-generated Answers.
3986
- *
3957
+ *This action allows users to send feedback on AI-generated Answers.
3987
3958
  * @example
3988
3959
  * ```js
3989
3960
  * disabledActions: [Action.SageAnswerFeedback]
@@ -4062,7 +4033,6 @@ export enum Action {
4062
4033
  * hiddenAction: [Action.CreateLiveboard]
4063
4034
  * disabledActions: [Action.CreateLiveboard]
4064
4035
  * ```
4065
- *
4066
4036
  * @version SDK: 1.32.0 | Thoughtspot: 10.1.0.cl
4067
4037
  */
4068
4038
  CreateLiveboard = 'createLiveboard',
@@ -4169,7 +4139,6 @@ export enum Action {
4169
4139
 
4170
4140
  /**
4171
4141
  * The **Manage Tags** action on Homepage Favourite Module.
4172
- *
4173
4142
  * @example
4174
4143
  * ```js
4175
4144
  * disabledActions: [Action.ManageTags]
@@ -18,7 +18,6 @@ function tokenizedFailureLoggedFetch(url: string, options: RequestInit = {}): Pr
18
18
 
19
19
  /**
20
20
  * Fetches the session info from the ThoughtSpot server.
21
- *
22
21
  * @param thoughtspotHost
23
22
  * @returns {Promise<any>}
24
23
  * @example
@@ -52,7 +51,6 @@ export async function fetchLogoutService(thoughtSpotHost: string): Promise<any>
52
51
 
53
52
  /**
54
53
  * Is active service to check if the user is logged in.
55
- *
56
54
  * @param thoughtSpotHost
57
55
  * @version SDK: 1.28.4 | ThoughtSpot: *
58
56
  */
@@ -101,7 +101,6 @@ export const getAnswer = `
101
101
  isDiscoverable
102
102
  isHidden
103
103
  modifiedAt
104
- tags
105
104
  }
106
105
  visualizations {
107
106
  ... on TableViz {
@@ -164,3 +163,12 @@ export const addVizToLiveboard = `
164
163
  }
165
164
  }
166
165
  `;
166
+
167
+ export const getSQLQuery = `
168
+ mutation GetSQLQuery($session: BachSessionIdInput!) {
169
+ Answer__getQuery(session: $session) {
170
+ ${bachSessionId}
171
+ sql
172
+ }
173
+ }
174
+ `;
@@ -3,7 +3,9 @@ import { AuthType, RuntimeFilterOp, VizPoint } from '../../../types';
3
3
  import { AnswerService } from './answerService';
4
4
  import {
5
5
  getAnswerData, removeColumns, addFilter, addColumns,
6
+ getSQLQuery,
6
7
  } from './answer-queries';
8
+ import * as queries from './answer-queries';
7
9
  import * as authTokenInstance from '../../../authToken';
8
10
  import * as tokenizedFetch from '../../../tokenizedFetch';
9
11
  import * as embedConfigInstance from '../../../embed/embedConfig';
@@ -34,6 +36,23 @@ describe('Answer service tests', () => {
34
36
  beforeEach(() => {
35
37
  fetchMock.resetMocks();
36
38
  });
39
+
40
+ test('should call executeQuery with correct parameters to add columns', async () => {
41
+ const service = createAnswerService();
42
+ const executeQuerySpy = jest.spyOn(service, 'executeQuery').mockResolvedValue({
43
+ id: { genNo: 2 },
44
+
45
+ });
46
+
47
+ const columnIds = ['col1', 'col2'];
48
+ const result = await service.addColumns(columnIds);
49
+
50
+ expect(executeQuerySpy).toHaveBeenCalledWith(queries.addColumns, {
51
+ columns: columnIds.map((colId) => ({ logicalColumnId: colId })),
52
+ });
53
+ expect(result.id.genNo).toBe(2);
54
+ });
55
+
37
56
  test('Execute query should execute the supplied graphql on the session', async () => {
38
57
  fetchMock.mockResponseOnce(JSON.stringify({
39
58
  data: {
@@ -404,4 +423,30 @@ describe('Answer service tests', () => {
404
423
  }),
405
424
  );
406
425
  });
426
+
427
+ test('Get SQL query should call the right API', async () => {
428
+ fetchMock.mockResponseOnce(JSON.stringify({
429
+ data: {
430
+ Answer__getQuery: {
431
+ id: {},
432
+ sql: 'SELECT * FROM table',
433
+ },
434
+ },
435
+ }));
436
+ const answerService = createAnswerService();
437
+ const sql = await answerService.getSQLQuery();
438
+ expect(fetchMock).toHaveBeenCalledWith(
439
+ 'https://tshost/prism/?op=GetSQLQuery',
440
+ expect.objectContaining({
441
+ body: JSON.stringify({
442
+ operationName: 'GetSQLQuery',
443
+ query: getSQLQuery,
444
+ variables: {
445
+ session: defaultSession,
446
+ },
447
+ }),
448
+ }),
449
+ );
450
+ expect(sql).toBe('SELECT * FROM table');
451
+ });
407
452
  });
@@ -173,6 +173,14 @@ export class AnswerService {
173
173
  );
174
174
  }
175
175
 
176
+ public async getSQLQuery(): Promise<string> {
177
+ const { sql } = await this.executeQuery(
178
+ queries.getSQLQuery,
179
+ {},
180
+ );
181
+ return sql;
182
+ }
183
+
176
184
  /**
177
185
  * Fetch data from the answer.
178
186
  * @param offset
@@ -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
+ }