@thoughtspot/visual-embed-sdk 1.29.1 → 1.30.0-alpha.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 (264) hide show
  1. package/README.md +1 -1
  2. package/cjs/package.json +1 -1
  3. package/cjs/src/auth.d.ts +15 -0
  4. package/cjs/src/auth.d.ts.map +1 -1
  5. package/cjs/src/auth.js +13 -2
  6. package/cjs/src/auth.js.map +1 -1
  7. package/cjs/src/authToken.d.ts +2 -1
  8. package/cjs/src/authToken.d.ts.map +1 -1
  9. package/cjs/src/authToken.js +2 -1
  10. package/cjs/src/authToken.js.map +1 -1
  11. package/cjs/src/config.d.ts +1 -0
  12. package/cjs/src/config.d.ts.map +1 -1
  13. package/cjs/src/config.js +2 -0
  14. package/cjs/src/config.js.map +1 -1
  15. package/cjs/src/embed/app.d.ts +50 -4
  16. package/cjs/src/embed/app.d.ts.map +1 -1
  17. package/cjs/src/embed/app.js +10 -2
  18. package/cjs/src/embed/app.js.map +1 -1
  19. package/cjs/src/embed/base.d.ts +7 -1
  20. package/cjs/src/embed/base.d.ts.map +1 -1
  21. package/cjs/src/embed/base.js +13 -6
  22. package/cjs/src/embed/base.js.map +1 -1
  23. package/cjs/src/embed/base.spec.js +1 -1
  24. package/cjs/src/embed/base.spec.js.map +1 -1
  25. package/cjs/src/embed/embedConfig.d.ts +2 -0
  26. package/cjs/src/embed/embedConfig.d.ts.map +1 -1
  27. package/cjs/src/embed/embedConfig.js +2 -0
  28. package/cjs/src/embed/embedConfig.js.map +1 -1
  29. package/cjs/src/embed/liveboard.d.ts +30 -0
  30. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  31. package/cjs/src/embed/liveboard.js +5 -0
  32. package/cjs/src/embed/liveboard.js.map +1 -1
  33. package/cjs/src/embed/sage.d.ts +18 -2
  34. package/cjs/src/embed/sage.d.ts.map +1 -1
  35. package/cjs/src/embed/sage.js +5 -0
  36. package/cjs/src/embed/sage.js.map +1 -1
  37. package/cjs/src/embed/search-bar.d.ts +11 -0
  38. package/cjs/src/embed/search-bar.d.ts.map +1 -1
  39. package/cjs/src/embed/search-bar.js +2 -0
  40. package/cjs/src/embed/search-bar.js.map +1 -1
  41. package/cjs/src/embed/search.d.ts +34 -5
  42. package/cjs/src/embed/search.d.ts.map +1 -1
  43. package/cjs/src/embed/search.js +7 -4
  44. package/cjs/src/embed/search.js.map +1 -1
  45. package/cjs/src/embed/search.spec.js.map +1 -1
  46. package/cjs/src/embed/ts-embed.d.ts +31 -1
  47. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  48. package/cjs/src/embed/ts-embed.js +37 -6
  49. package/cjs/src/embed/ts-embed.js.map +1 -1
  50. package/cjs/src/embed/ts-embed.spec.js +9 -18
  51. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  52. package/cjs/src/index.d.ts +1 -0
  53. package/cjs/src/index.d.ts.map +1 -1
  54. package/cjs/src/index.js +1 -0
  55. package/cjs/src/index.js.map +1 -1
  56. package/cjs/src/mixpanel-service.d.ts +1 -0
  57. package/cjs/src/mixpanel-service.d.ts.map +1 -1
  58. package/cjs/src/mixpanel-service.js +1 -0
  59. package/cjs/src/mixpanel-service.js.map +1 -1
  60. package/cjs/src/react/index.d.ts +12 -1
  61. package/cjs/src/react/index.d.ts.map +1 -1
  62. package/cjs/src/react/index.js +11 -1
  63. package/cjs/src/react/index.js.map +1 -1
  64. package/cjs/src/react/index.spec.js +2 -14
  65. package/cjs/src/react/index.spec.js.map +1 -1
  66. package/cjs/src/test/test-utils.d.ts +2 -0
  67. package/cjs/src/test/test-utils.d.ts.map +1 -1
  68. package/cjs/src/test/test-utils.js +2 -0
  69. package/cjs/src/test/test-utils.js.map +1 -1
  70. package/cjs/src/tokenizedFetch.d.ts +1 -0
  71. package/cjs/src/tokenizedFetch.d.ts.map +1 -1
  72. package/cjs/src/tokenizedFetch.js +1 -0
  73. package/cjs/src/tokenizedFetch.js.map +1 -1
  74. package/cjs/src/types.d.ts +372 -59
  75. package/cjs/src/types.d.ts.map +1 -1
  76. package/cjs/src/types.js +297 -51
  77. package/cjs/src/types.js.map +1 -1
  78. package/cjs/src/utils/authService/authService.d.ts +1 -0
  79. package/cjs/src/utils/authService/authService.d.ts.map +1 -1
  80. package/cjs/src/utils/authService/authService.js +1 -0
  81. package/cjs/src/utils/authService/authService.js.map +1 -1
  82. package/cjs/src/utils/graphql/answerService/answerService.d.ts +12 -0
  83. package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  84. package/cjs/src/utils/graphql/answerService/answerService.js +12 -0
  85. package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
  86. package/cjs/src/utils/processTrigger.d.ts +1 -0
  87. package/cjs/src/utils/processTrigger.d.ts.map +1 -1
  88. package/cjs/src/utils/processTrigger.js +2 -0
  89. package/cjs/src/utils/processTrigger.js.map +1 -1
  90. package/cjs/src/utils.d.ts +9 -0
  91. package/cjs/src/utils.d.ts.map +1 -1
  92. package/cjs/src/utils.js +11 -0
  93. package/cjs/src/utils.js.map +1 -1
  94. package/dist/src/auth.d.ts +15 -0
  95. package/dist/src/auth.d.ts.map +1 -1
  96. package/dist/src/authToken.d.ts +2 -1
  97. package/dist/src/authToken.d.ts.map +1 -1
  98. package/dist/src/config.d.ts +1 -0
  99. package/dist/src/config.d.ts.map +1 -1
  100. package/dist/src/embed/app.d.ts +50 -4
  101. package/dist/src/embed/app.d.ts.map +1 -1
  102. package/dist/src/embed/base.d.ts +7 -1
  103. package/dist/src/embed/base.d.ts.map +1 -1
  104. package/dist/src/embed/embedConfig.d.ts +2 -0
  105. package/dist/src/embed/embedConfig.d.ts.map +1 -1
  106. package/dist/src/embed/liveboard.d.ts +30 -0
  107. package/dist/src/embed/liveboard.d.ts.map +1 -1
  108. package/dist/src/embed/sage.d.ts +18 -2
  109. package/dist/src/embed/sage.d.ts.map +1 -1
  110. package/dist/src/embed/search-bar.d.ts +11 -0
  111. package/dist/src/embed/search-bar.d.ts.map +1 -1
  112. package/dist/src/embed/search.d.ts +34 -5
  113. package/dist/src/embed/search.d.ts.map +1 -1
  114. package/dist/src/embed/ts-embed.d.ts +31 -1
  115. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  116. package/dist/src/index.d.ts +1 -0
  117. package/dist/src/index.d.ts.map +1 -1
  118. package/dist/src/mixpanel-service.d.ts +1 -0
  119. package/dist/src/mixpanel-service.d.ts.map +1 -1
  120. package/dist/src/react/index.d.ts +12 -1
  121. package/dist/src/react/index.d.ts.map +1 -1
  122. package/dist/src/test/test-utils.d.ts +2 -0
  123. package/dist/src/test/test-utils.d.ts.map +1 -1
  124. package/dist/src/tokenizedFetch.d.ts +1 -0
  125. package/dist/src/tokenizedFetch.d.ts.map +1 -1
  126. package/dist/src/types.d.ts +372 -59
  127. package/dist/src/types.d.ts.map +1 -1
  128. package/dist/src/utils/authService/authService.d.ts +1 -0
  129. package/dist/src/utils/authService/authService.d.ts.map +1 -1
  130. package/dist/src/utils/graphql/answerService/answerService.d.ts +12 -0
  131. package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  132. package/dist/src/utils/processTrigger.d.ts +1 -0
  133. package/dist/src/utils/processTrigger.d.ts.map +1 -1
  134. package/dist/src/utils.d.ts +9 -0
  135. package/dist/src/utils.d.ts.map +1 -1
  136. package/dist/tsembed-react.es.js +7426 -7073
  137. package/dist/tsembed-react.js +7441 -7092
  138. package/dist/tsembed.es.js +8781 -8431
  139. package/dist/tsembed.js +12901 -12559
  140. package/dist/visual-embed-sdk-react-full.d.ts +584 -70
  141. package/dist/visual-embed-sdk-react.d.ts +584 -70
  142. package/dist/visual-embed-sdk.d.ts +572 -69
  143. package/lib/package.json +1 -1
  144. package/lib/src/auth.d.ts +15 -0
  145. package/lib/src/auth.d.ts.map +1 -1
  146. package/lib/src/auth.js +14 -3
  147. package/lib/src/auth.js.map +1 -1
  148. package/lib/src/authToken.d.ts +2 -1
  149. package/lib/src/authToken.d.ts.map +1 -1
  150. package/lib/src/authToken.js +2 -1
  151. package/lib/src/authToken.js.map +1 -1
  152. package/lib/src/config.d.ts +1 -0
  153. package/lib/src/config.d.ts.map +1 -1
  154. package/lib/src/config.js +2 -0
  155. package/lib/src/config.js.map +1 -1
  156. package/lib/src/embed/app.d.ts +50 -4
  157. package/lib/src/embed/app.d.ts.map +1 -1
  158. package/lib/src/embed/app.js +10 -2
  159. package/lib/src/embed/app.js.map +1 -1
  160. package/lib/src/embed/base.d.ts +7 -1
  161. package/lib/src/embed/base.d.ts.map +1 -1
  162. package/lib/src/embed/base.js +12 -5
  163. package/lib/src/embed/base.js.map +1 -1
  164. package/lib/src/embed/base.spec.js +2 -2
  165. package/lib/src/embed/base.spec.js.map +1 -1
  166. package/lib/src/embed/embedConfig.d.ts +2 -0
  167. package/lib/src/embed/embedConfig.d.ts.map +1 -1
  168. package/lib/src/embed/embedConfig.js +2 -0
  169. package/lib/src/embed/embedConfig.js.map +1 -1
  170. package/lib/src/embed/liveboard.d.ts +30 -0
  171. package/lib/src/embed/liveboard.d.ts.map +1 -1
  172. package/lib/src/embed/liveboard.js +6 -1
  173. package/lib/src/embed/liveboard.js.map +1 -1
  174. package/lib/src/embed/sage.d.ts +18 -2
  175. package/lib/src/embed/sage.d.ts.map +1 -1
  176. package/lib/src/embed/sage.js +5 -0
  177. package/lib/src/embed/sage.js.map +1 -1
  178. package/lib/src/embed/search-bar.d.ts +11 -0
  179. package/lib/src/embed/search-bar.d.ts.map +1 -1
  180. package/lib/src/embed/search-bar.js +2 -0
  181. package/lib/src/embed/search-bar.js.map +1 -1
  182. package/lib/src/embed/search.d.ts +34 -5
  183. package/lib/src/embed/search.d.ts.map +1 -1
  184. package/lib/src/embed/search.js +8 -5
  185. package/lib/src/embed/search.js.map +1 -1
  186. package/lib/src/embed/search.spec.js.map +1 -1
  187. package/lib/src/embed/ts-embed.d.ts +31 -1
  188. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  189. package/lib/src/embed/ts-embed.js +40 -9
  190. package/lib/src/embed/ts-embed.js.map +1 -1
  191. package/lib/src/embed/ts-embed.spec.js +9 -18
  192. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  193. package/lib/src/index.d.ts +1 -0
  194. package/lib/src/index.d.ts.map +1 -1
  195. package/lib/src/index.js +1 -0
  196. package/lib/src/index.js.map +1 -1
  197. package/lib/src/mixpanel-service.d.ts +1 -0
  198. package/lib/src/mixpanel-service.d.ts.map +1 -1
  199. package/lib/src/mixpanel-service.js +1 -0
  200. package/lib/src/mixpanel-service.js.map +1 -1
  201. package/lib/src/react/index.d.ts +12 -1
  202. package/lib/src/react/index.d.ts.map +1 -1
  203. package/lib/src/react/index.js +11 -1
  204. package/lib/src/react/index.js.map +1 -1
  205. package/lib/src/react/index.spec.js +3 -15
  206. package/lib/src/react/index.spec.js.map +1 -1
  207. package/lib/src/test/test-utils.d.ts +2 -0
  208. package/lib/src/test/test-utils.d.ts.map +1 -1
  209. package/lib/src/test/test-utils.js +2 -0
  210. package/lib/src/test/test-utils.js.map +1 -1
  211. package/lib/src/tokenizedFetch.d.ts +1 -0
  212. package/lib/src/tokenizedFetch.d.ts.map +1 -1
  213. package/lib/src/tokenizedFetch.js +1 -0
  214. package/lib/src/tokenizedFetch.js.map +1 -1
  215. package/lib/src/types.d.ts +372 -59
  216. package/lib/src/types.d.ts.map +1 -1
  217. package/lib/src/types.js +297 -51
  218. package/lib/src/types.js.map +1 -1
  219. package/lib/src/utils/authService/authService.d.ts +1 -0
  220. package/lib/src/utils/authService/authService.d.ts.map +1 -1
  221. package/lib/src/utils/authService/authService.js +1 -0
  222. package/lib/src/utils/authService/authService.js.map +1 -1
  223. package/lib/src/utils/authService/authService.spec.js +1 -1
  224. package/lib/src/utils/authService/authService.spec.js.map +1 -1
  225. package/lib/src/utils/graphql/answerService/answerService.d.ts +12 -0
  226. package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  227. package/lib/src/utils/graphql/answerService/answerService.js +12 -0
  228. package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
  229. package/lib/src/utils/processTrigger.d.ts +1 -0
  230. package/lib/src/utils/processTrigger.d.ts.map +1 -1
  231. package/lib/src/utils/processTrigger.js +2 -0
  232. package/lib/src/utils/processTrigger.js.map +1 -1
  233. package/lib/src/utils.d.ts +9 -0
  234. package/lib/src/utils.d.ts.map +1 -1
  235. package/lib/src/utils.js +11 -0
  236. package/lib/src/utils.js.map +1 -1
  237. package/lib/src/visual-embed-sdk.d.ts +576 -73
  238. package/package.json +1 -1
  239. package/src/auth.ts +23 -6
  240. package/src/authToken.ts +2 -1
  241. package/src/config.ts +2 -0
  242. package/src/embed/app.ts +63 -16
  243. package/src/embed/base.spec.ts +3 -3
  244. package/src/embed/base.ts +21 -15
  245. package/src/embed/embedConfig.ts +2 -0
  246. package/src/embed/liveboard.ts +38 -1
  247. package/src/embed/sage.ts +18 -2
  248. package/src/embed/search-bar.tsx +11 -0
  249. package/src/embed/search.spec.ts +1 -2
  250. package/src/embed/search.ts +48 -21
  251. package/src/embed/ts-embed.spec.ts +24 -37
  252. package/src/embed/ts-embed.ts +72 -38
  253. package/src/index.ts +1 -0
  254. package/src/mixpanel-service.ts +1 -0
  255. package/src/react/index.spec.tsx +59 -47
  256. package/src/react/index.tsx +12 -1
  257. package/src/test/test-utils.ts +2 -0
  258. package/src/tokenizedFetch.ts +1 -0
  259. package/src/types.ts +377 -65
  260. package/src/utils/authService/authService.spec.ts +4 -4
  261. package/src/utils/authService/authService.ts +1 -0
  262. package/src/utils/graphql/answerService/answerService.ts +12 -0
  263. package/src/utils/processTrigger.ts +2 -0
  264. package/src/utils.ts +11 -0
@@ -4,6 +4,7 @@ let config = {} as EmbedConfig;
4
4
 
5
5
  /**
6
6
  * Gets the configuration embed was initialized with.
7
+ *
7
8
  * @returns {@link EmbedConfig} The configuration embed was initialized with.
8
9
  * @version SDK: 1.19.0 | ThoughtSpot: *
9
10
  * @group Global methods
@@ -13,6 +14,7 @@ export const getEmbedConfig = (): EmbedConfig => config;
13
14
  /**
14
15
  * Sets the configuration embed was initialized with.
15
16
  * And returns the new configuration.
17
+ *
16
18
  * @param newConfig The configuration to set.
17
19
  * @version SDK: 1.27.0 | ThoughtSpot: *
18
20
  * @group Global methods
@@ -4,19 +4,28 @@
4
4
  * Embed a ThoughtSpot Liveboard or visualization
5
5
  * https://developers.thoughtspot.com/docs/?pageid=embed-pinboard
6
6
  * https://developers.thoughtspot.com/docs/?pageid=embed-a-viz
7
+ *
7
8
  * @summary Liveboard & visualization embed
8
9
  * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
9
10
  */
10
11
 
11
12
  import { ERROR_MESSAGE } from '../errors';
12
13
  import {
13
- DOMSelector, EmbedEvent, HostEvent, MessagePayload, Param, ViewConfig,
14
+ EmbedEvent,
15
+ MessagePayload,
16
+ Param,
17
+ RuntimeFilter,
18
+ DOMSelector,
19
+ HostEvent,
20
+ ViewConfig,
14
21
  } from '../types';
15
22
  import { getQueryParamString, isUndefined } from '../utils';
23
+ import { getAuthPromise } from './base';
16
24
  import { V1Embed } from './ts-embed';
17
25
 
18
26
  /**
19
27
  * The configuration for the embedded Liveboard or visualization page view.
28
+ *
20
29
  * @group Embed components
21
30
  */
22
31
  export interface LiveboardViewConfig
@@ -33,7 +42,9 @@ export interface LiveboardViewConfig
33
42
  * visualizations to display on the screen.
34
43
  * Setting `fullHeight` to `false` fetches visualizations
35
44
  * incrementally as users scroll the page to view the charts and tables.
45
+ *
36
46
  * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 7.2.1
47
+ *
37
48
  * @example
38
49
  * ```js
39
50
  * const embed = new LiveboardEmbed('#embed', {
@@ -47,6 +58,7 @@ export interface LiveboardViewConfig
47
58
  * This is the minimum height(in pixels) for a full-height Liveboard.
48
59
  * Setting this height helps resolve issues with empty Liveboards and
49
60
  * other screens navigable from a Liveboard.
61
+ *
50
62
  * @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
51
63
  * @default 500
52
64
  * @example
@@ -61,6 +73,7 @@ export interface LiveboardViewConfig
61
73
  defaultHeight?: number;
62
74
  /**
63
75
  * @Deprecated If set to true, the context menu in visualizations will be enabled.
76
+ *
64
77
  * @example
65
78
  * ```js
66
79
  * const embed = new LiveboardEmbed('#tsEmbed', {
@@ -68,12 +81,14 @@ export interface LiveboardViewConfig
68
81
  * enableVizTransformations:true,
69
82
  * })
70
83
  * ```
84
+ *
71
85
  * @version: SDK: 1.1.0 | ThoughtSpot: 8.1.0.sw
72
86
  */
73
87
  enableVizTransformations?: boolean;
74
88
  /**
75
89
  * The Liveboard to display in the embedded view.
76
90
  * Use either liveboardId or pinboardId to reference the Liveboard to embed.
91
+ *
77
92
  * @version SDK: 1.3.0 | ThoughtSpot ts7.aug.cl, 7.2.1
78
93
  * @example
79
94
  * ```js
@@ -85,12 +100,15 @@ export interface LiveboardViewConfig
85
100
  liveboardId?: string;
86
101
  /**
87
102
  * To support backward compatibility
103
+ *
88
104
  * @hidden
89
105
  */
90
106
  pinboardId?: string;
91
107
  /**
92
108
  * The visualization within the Liveboard to display.
109
+ *
93
110
  * @version SDK: 1.9.1 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
111
+ *
94
112
  * @example
95
113
  * ```js
96
114
  * const embed = new LiveboardEmbed('#embed-container', {
@@ -103,6 +121,7 @@ export interface LiveboardViewConfig
103
121
  /**
104
122
  * If set to true, all filter chips from a
105
123
  * Liveboard page will be read-only (no X buttons)
124
+ *
106
125
  * @version SDK: 1.3.0 | ThoughtSpot ts7.aug.cl, 7.2.1.sw
107
126
  * @example
108
127
  * ```js
@@ -117,7 +136,9 @@ export interface LiveboardViewConfig
117
136
  * Array of visualization IDs which should be visible when the Liveboard
118
137
  * renders. This can be changed by triggering the `SetVisibleVizs`
119
138
  * event.
139
+ *
120
140
  * @version SDK: 1.9.1 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
141
+ *
121
142
  * @example
122
143
  * ```js
123
144
  * const embed = new LiveboardEmbed('#embed-container', {
@@ -131,12 +152,14 @@ export interface LiveboardViewConfig
131
152
  visibleVizs?: string[];
132
153
  /**
133
154
  * To support backward compatibility
155
+ *
134
156
  * @hidden
135
157
  */
136
158
  preventPinboardFilterRemoval?: boolean;
137
159
  /**
138
160
  * Render embedded Liveboards and visualizations in the
139
161
  * new Liveboard experience mode.
162
+ *
140
163
  * @version SDK: 1.14.0 | ThoughtSpot: 8.6.0.cl, 8.8.1-sw
141
164
  * @example
142
165
  * ```js
@@ -150,6 +173,7 @@ export interface LiveboardViewConfig
150
173
  /**
151
174
  * Set a Liveboard tab as an active tab.
152
175
  * Specify the tab ID.
176
+ *
153
177
  * @example
154
178
  * ```js
155
179
  * const embed = new LiveboardEmbed('#tsEmbed', {
@@ -162,7 +186,9 @@ export interface LiveboardViewConfig
162
186
  activeTabId?: string;
163
187
  /**
164
188
  * Show or hide the tab panel of the embedded Liveboard.
189
+ *
165
190
  * @version SDK: 1.25.0 | Thoughtspot: 9.6.0.cl, 9.8.0.sw
191
+ *
166
192
  * @example
167
193
  * ```js
168
194
  * const embed = new LiveboardEmbed('#embed-container', {
@@ -174,6 +200,7 @@ export interface LiveboardViewConfig
174
200
  hideTabPanel?: boolean;
175
201
  /**
176
202
  * Show or hide the Liveboard header.
203
+ *
177
204
  * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
178
205
  * @default false
179
206
  * @example
@@ -189,6 +216,7 @@ export interface LiveboardViewConfig
189
216
  * Show or hide the Liveboard title.
190
217
  * @default false
191
218
  * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
219
+ *
192
220
  * @example
193
221
  * ```js
194
222
  * const embed = new LiveboardEmbed('#embed-container', {
@@ -202,6 +230,7 @@ export interface LiveboardViewConfig
202
230
  * Show or hide the Liveboard description.
203
231
  * @default false
204
232
  * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
233
+ *
205
234
  * @example
206
235
  * ```js
207
236
  * const embed = new LiveboardEmbed('#embed-container', {
@@ -215,6 +244,7 @@ export interface LiveboardViewConfig
215
244
  * Control the position and visibility of
216
245
  * the Liveboard header as the users scroll down the
217
246
  * embedded Liveboard page.
247
+ *
218
248
  * @example
219
249
  * ```js
220
250
  * const embed = new LiveboardEmbed('#embed', {
@@ -227,6 +257,7 @@ export interface LiveboardViewConfig
227
257
  isLiveboardHeaderSticky?: boolean;
228
258
  /**
229
259
  * enable or disable ask sage
260
+ *
230
261
  * @default false
231
262
  * @version SDK: 1.29.0 | Thoughtspot: 9.12.0.cl
232
263
  * @example
@@ -240,9 +271,11 @@ export interface LiveboardViewConfig
240
271
  enableAskSage?: boolean;
241
272
  /**
242
273
  * This flag is used to enable the 2 column layout in liveboard
274
+ *
243
275
  * @type {boolean}
244
276
  * @default false
245
277
  * @version SDK: 1.32.0 | ThoughtSpot:10.1.0.cl
278
+ *
246
279
  * @example
247
280
  * ```js
248
281
  * const embed = new LiveboardEmbed('#embed-container', {
@@ -258,6 +291,7 @@ export interface LiveboardViewConfig
258
291
  * Embed a ThoughtSpot Liveboard or visualization. When rendered it already
259
292
  * waits for the authentication to complete, so you need not wait for
260
293
  * `AuthStatus.SUCCESS`.
294
+ *
261
295
  * @example
262
296
  * ```js
263
297
  * import { .. } from '@thoughtspot/visual-embed-sdk';
@@ -395,6 +429,7 @@ export class LiveboardEmbed extends V1Embed {
395
429
  /**
396
430
  * Set the iframe height as per the computed height received
397
431
  * from the ThoughtSpot app.
432
+ *
398
433
  * @param data The event payload
399
434
  */
400
435
  private updateIFrameHeight = (data: MessagePayload) => {
@@ -448,6 +483,7 @@ export class LiveboardEmbed extends V1Embed {
448
483
 
449
484
  /**
450
485
  * Triggers an event to the embedded app
486
+ *
451
487
  * @param messageType The event type
452
488
  * @param data The payload to send with the message
453
489
  */
@@ -465,6 +501,7 @@ export class LiveboardEmbed extends V1Embed {
465
501
 
466
502
  /**
467
503
  * Render an embedded ThoughtSpot Liveboard or visualization
504
+ *
468
505
  * @param renderOptions An object specifying the Liveboard ID,
469
506
  * visualization ID and the runtime filters.
470
507
  */
package/src/embed/sage.ts CHANGED
@@ -2,6 +2,7 @@
2
2
  * Copyright (c) 2023
3
3
  *
4
4
  * Embed ThoughtSpot Sage
5
+ *
5
6
  * @summary TS Sage embed
6
7
  * @author Mourya Balabhadra <mourya.balabhadra@thoughtspot.com>
7
8
  */
@@ -30,6 +31,7 @@ export interface SearchOptions {
30
31
  /**
31
32
  * The configuration attributes for the embedded Natural language search view. Based on
32
33
  * GPT and LLM.
34
+ *
33
35
  * @version: SDK: 1.23.0 | ThoughtSpot: 9.8.0.cl, 9.8.0.sw
34
36
  * @group Embed components
35
37
  */
@@ -42,6 +44,7 @@ export interface SageViewConfig
42
44
  * If set to true, a list of Liveboard and Answers related
43
45
  * to the natural language search will be shown below the
44
46
  * AI generated answer.
47
+ *
45
48
  * @deprecated Currently Liveboard and Answers related
46
49
  * to the natural language search will not be shown for sage
47
50
  * embed
@@ -49,10 +52,11 @@ export interface SageViewConfig
49
52
  showObjectResults?: boolean;
50
53
  /**
51
54
  * flag used by the TS product tour page to show the blue search bar
52
- * even after the search is completed. This is different from Thoughtspot Embedded
53
- * Sage Embed experience where it mimics closer to the non-embed case.
55
+ * even after the search is completed. This is different from Thoughtspot Embedded Sage Embed
56
+ * experience where it mimics closer to the non-embed case.
54
57
  * The Sample questions container is collapsed when this value is set after
55
58
  * does a search.
59
+ *
56
60
  * @version SDK: 1.26.0 | Thoughtspot: 9.8.0.cl
57
61
  * @hidden
58
62
  */
@@ -60,32 +64,38 @@ export interface SageViewConfig
60
64
  /**
61
65
  * Show or hide the search bar title.
62
66
  * @version SDK: 1.29.0 | Thoughtspot: 9.8.0.cl, 9.8.0.sw
67
+ *
63
68
  * @deprecated Thoughtspot: 9.10.0.cl | search bar doesn't have the title from 9.10.0.cl
64
69
  */
65
70
  hideSearchBarTitle?: boolean;
66
71
  /**
67
72
  * Show or hide the Answer header, that is, the `AI Answer` title
68
73
  * at the top of the Answer page.
74
+ *
69
75
  * @version SDK: 1.26.0 | Thoughtspot: 9.10.0.cl
70
76
  */
71
77
  hideSageAnswerHeader?: boolean;
72
78
  /**
73
79
  * Disable the worksheet selection option.
80
+ *
74
81
  * @version SDK: 1.26.0 | Thoughtspot: 9.8.0.cl, 9.8.0.sw
75
82
  */
76
83
  disableWorksheetChange?: boolean;
77
84
  /**
78
85
  * Hide the worksheet selection panel.
86
+ *
79
87
  * @version SDK: 1.26.0 | Thoughtspot: 9.8.0.cl, 9.8.0.sw
80
88
  */
81
89
  hideWorksheetSelector?: boolean;
82
90
  /**
83
91
  * Show or hide autocomplete suggestions for the search query string.
92
+ *
84
93
  * @version SDK: 1.26.0 | Thoughtspot: 9.8.0.cl, 9.8.0.sw
85
94
  */
86
95
  hideAutocompleteSuggestions?: boolean;
87
96
  /**
88
97
  * Show or hide autocomplete suggestions for the search query string.
98
+ *
89
99
  * @deprecated
90
100
  * Currently, the object suggestions will not be shown for Natural Language Search.
91
101
  * You can use {@link hideAutocompleteSuggestions} instead.
@@ -95,6 +105,7 @@ export interface SageViewConfig
95
105
  * Show or hide sample questions.
96
106
  * The sample questions are autogenerated based on the worksheet
97
107
  * selected for the search operation.
108
+ *
98
109
  * @version SDK: 1.26.0 | Thoughtspot: 9.8.0.cl, 9.8.0.sw
99
110
  */
100
111
  hideSampleQuestions?: boolean;
@@ -112,6 +123,7 @@ export interface SageViewConfig
112
123
  * If it is executed, the focus is placed on the results.
113
124
  * If it’s not executed, the focus is placed at the end of
114
125
  * the token string in the search bar.
126
+ *
115
127
  * @example
116
128
  * ```js
117
129
  * searchOptions: {
@@ -125,6 +137,7 @@ export interface SageViewConfig
125
137
  }
126
138
  /**
127
139
  * Embed ThoughtSpot LLM and GPT-based Natural Language Search component.
140
+ *
128
141
  * @version: SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl, 9.5.1-sw
129
142
  * @group Embed components
130
143
  */
@@ -144,6 +157,7 @@ export class SageEmbed extends V1Embed {
144
157
  /**
145
158
  * Constructs a map of parameters to be passed on to the
146
159
  * embedded Eureka or Sage search page.
160
+ *
147
161
  * @returns {string} query string
148
162
  */
149
163
  protected getEmbedParams(): string {
@@ -177,6 +191,7 @@ export class SageEmbed extends V1Embed {
177
191
  /**
178
192
  * Construct the URL of the embedded ThoughtSpot sage to be
179
193
  * loaded in the iframe
194
+ *
180
195
  * @returns {string} iframe url
181
196
  */
182
197
  public getIFrameSrc(): string {
@@ -202,6 +217,7 @@ export class SageEmbed extends V1Embed {
202
217
 
203
218
  /**
204
219
  * Render the embedded ThoughtSpot Sage
220
+ *
205
221
  * @returns {SageEmbed} Eureka/Sage embed
206
222
  */
207
223
  public async render(): Promise<SageEmbed> {
@@ -21,8 +21,11 @@ export interface SearchBarViewConfig
21
21
  /**
22
22
  * The array of data source GUIDs to set on load.
23
23
  * Only a single data source is supported currently.
24
+ *
24
25
  * @deprecated Use `dataSource` instead
26
+ *
25
27
  * @version: SDK: 1.1.0 | ThoughtSpot: 8.1.1-sw
28
+ *
26
29
  * @example
27
30
  * ```js
28
31
  * const embed = new SearchBarEmbed('#tsEmbed', {
@@ -34,7 +37,9 @@ export interface SearchBarViewConfig
34
37
  dataSources?: string[];
35
38
  /**
36
39
  * Pass the ID of the source to be selected.
40
+ *
37
41
  * @version: SDK: 1.19.0, ThoughtSpot 9.0.0.cl, 9.0.1.sw
42
+ *
38
43
  * @example
39
44
  * ```js
40
45
  * const embed = new SearchBarEmbed('#tsEmbed', {
@@ -46,7 +51,9 @@ export interface SearchBarViewConfig
46
51
  dataSource?: string;
47
52
  /**
48
53
  * Boolean to define if the last selected data source should be used
54
+ *
49
55
  * @version: SDK: 1.24.0, ThoughtSpot 9.5.0.cl, 9.5.0.sw
56
+ *
50
57
  * @example
51
58
  * ```js
52
59
  * const embed = new SearchBarEmbed('#tsEmbed', {
@@ -66,7 +73,9 @@ export interface SearchBarViewConfig
66
73
  * If it is executed, the focus is placed on the results.
67
74
  * If it’s not executed, the focus is placed at the end of
68
75
  * the token string in the search bar.
76
+ *
69
77
  * @version: SDK: 1.2.0 | ThoughtSpot: 9.4.0.sw
78
+ *
70
79
  * @example
71
80
  * ```js
72
81
  * const embed = new SearchBarEmbed('#tsEmbed', {
@@ -83,6 +92,7 @@ export interface SearchBarViewConfig
83
92
 
84
93
  /**
85
94
  * Embed ThoughtSpot search bar
95
+ *
86
96
  * @version: SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1-sw
87
97
  * @group Embed components
88
98
  */
@@ -102,6 +112,7 @@ export class SearchBarEmbed extends TsEmbed {
102
112
  /**
103
113
  * Construct the URL of the embedded ThoughtSpot search to be
104
114
  * loaded in the iframe
115
+ *
105
116
  * @param dataSources A list of data source GUIDs
106
117
  */
107
118
  private getIFrameSrc() {
@@ -490,8 +490,7 @@ describe('Search embed tests', () => {
490
490
  const searchEmbed = new SearchEmbed(getRootEl(), {
491
491
  ...defaultViewConfig,
492
492
  // eslint-disable-next-line max-len
493
- dataPanelCustomGroupsAccordionInitialState:
494
- DataPanelCustomColumnGroupsAccordionState.EXPAND_FIRST,
493
+ dataPanelCustomGroupsAccordionInitialState: DataPanelCustomColumnGroupsAccordionState.EXPAND_FIRST,
495
494
  });
496
495
  searchEmbed.render();
497
496
  await executeAfterWait(() => {
@@ -2,24 +2,29 @@
2
2
  * Copyright (c) 2022
3
3
  *
4
4
  * Embed ThoughtSpot search or a saved answer
5
+ *
5
6
  * @summary Search embed
6
7
  * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
7
8
  */
8
9
 
9
- import { getReleaseVersion } from '../auth';
10
- import { ERROR_MESSAGE } from '../errors';
11
10
  import {
12
- Action, DOMSelector, DataSourceVisualMode, Param, ViewConfig,
11
+ DataSourceVisualMode,
12
+ DOMSelector,
13
+ Param,
14
+ Action,
15
+ ViewConfig,
13
16
  } from '../types';
14
17
  import {
18
+ getQueryParamString,
15
19
  checkReleaseVersionInBeta,
16
20
  getFilterQuery,
17
- getQueryParamString,
18
21
  getRuntimeParameters,
19
22
  } from '../utils';
23
+ import { TsEmbed } from './ts-embed';
24
+ import { ERROR_MESSAGE } from '../errors';
20
25
  import { getAuthPromise } from './base';
26
+ import { getReleaseVersion } from '../auth';
21
27
  import { getEmbedConfig } from './embedConfig';
22
- import { TsEmbed } from './ts-embed';
23
28
 
24
29
  /**
25
30
  * Configuration for search options.
@@ -60,6 +65,7 @@ export enum DataPanelCustomColumnGroupsAccordionState {
60
65
 
61
66
  /**
62
67
  * The configuration attributes for the embedded search view.
68
+ *
63
69
  * @group Embed components
64
70
  */
65
71
  export interface SearchViewConfig
@@ -74,7 +80,9 @@ export interface SearchViewConfig
74
80
  /**
75
81
  * If set to true, the data sources panel is collapsed on load,
76
82
  * but can be expanded manually.
83
+ *
77
84
  * @version: SDK: 1.1.0 | ThoughtSpot: 8.1.0.sw
85
+ *
78
86
  * @example
79
87
  * ```js
80
88
  * const embed = new SearchEmbed('#tsEmbed', {
@@ -86,7 +94,9 @@ export interface SearchViewConfig
86
94
  collapseDataSources?: boolean;
87
95
  /**
88
96
  * Show or hide the data sources panel.
97
+ *
89
98
  * @version: SDK: 1.2.0 | ThoughtSpot: 9.1.0.sw
99
+ *
90
100
  * @example
91
101
  * ```js
92
102
  * const embed = new SearchEmbed('#tsEmbed', {
@@ -100,7 +110,9 @@ export interface SearchViewConfig
100
110
  * Show or hide the charts and tables in search answers.
101
111
  * This attribute can be used to create a custom visualization
102
112
  * using raw answer data.
113
+ *
103
114
  * @version: SDK: 1.2.0 | ThoughtSpot: 9.1.0.sw
115
+ *
104
116
  * @example
105
117
  * ```js
106
118
  * const embed = new SearchEmbed('#tsEmbed', {
@@ -110,13 +122,11 @@ export interface SearchViewConfig
110
122
  * ```
111
123
  */
112
124
  hideResults?: boolean;
113
- /**
114
- * If set to true, expands all the data sources panel.
115
- */
116
- expandAllDataSource?: boolean;
117
125
  /**
118
126
  * If set to true, the Search Assist feature is enabled.
127
+ *
119
128
  * @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl, 8.8.1-sw
129
+ *
120
130
  * @example
121
131
  * ```js
122
132
  * const embed = new SearchEmbed('#tsEmbed', {
@@ -129,7 +139,9 @@ export interface SearchViewConfig
129
139
  /**
130
140
  * If set to true, the tabular view is set as the default
131
141
  * format for presenting search data.
142
+ *
132
143
  * @version: SDK: 1.1.0 | ThoughtSpot: 8.1.0.sw
144
+ *
133
145
  * @example
134
146
  * ```js
135
147
  * const embed = new SearchEmbed('#tsEmbed', {
@@ -141,7 +153,9 @@ export interface SearchViewConfig
141
153
  /**
142
154
  * The array of data source GUIDs to set on load.
143
155
  * Only a single data source is supported currently.
156
+ *
144
157
  * @deprecated Use `dataSource` instead.
158
+ *
145
159
  * @example
146
160
  * ```js
147
161
  * const embed = new SearchEmbed('#tsEmbed', {
@@ -153,7 +167,9 @@ export interface SearchViewConfig
153
167
  dataSources?: string[];
154
168
  /**
155
169
  * The array of data source GUIDs to set on load.
170
+ *
156
171
  * @version: SDK: 1.19.0
172
+ *
157
173
  * @example
158
174
  * ```js
159
175
  * const embed = new SearchEmbed('#tsEmbed', {
@@ -165,6 +181,7 @@ export interface SearchViewConfig
165
181
  dataSource?: string;
166
182
  /**
167
183
  * The initial search query to load the answer with.
184
+ *
168
185
  * @deprecated
169
186
  *
170
187
  * Use {@link searchOptions} instead.
@@ -180,6 +197,7 @@ export interface SearchViewConfig
180
197
  * If it is executed, the focus is placed on the results.
181
198
  * If it’s not executed, the focus is placed at the end of
182
199
  * the token string in the search bar.
200
+ *
183
201
  * @example
184
202
  * ```js
185
203
  * searchOptions: {
@@ -191,7 +209,9 @@ export interface SearchViewConfig
191
209
  searchOptions?: SearchOptions;
192
210
  /**
193
211
  * The GUID of a saved answer to load initially.
212
+ *
194
213
  * @version: SDK: 1.1.0 | ThoughtSpot: 8.1.0.sw
214
+ *
195
215
  * @example
196
216
  * ```js
197
217
  * const embed = new SearchEmbed('#tsEmbed', {
@@ -204,7 +224,9 @@ export interface SearchViewConfig
204
224
  /**
205
225
  * If set to true, the search page will render without the Search Bar
206
226
  * The chart/table should still be visible.
227
+ *
207
228
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.0.sw
229
+ *
208
230
  * @example
209
231
  * ```js
210
232
  * const embed = new SearchEmbed('#tsEmbed', {
@@ -216,8 +238,10 @@ export interface SearchViewConfig
216
238
  hideSearchBar?: boolean;
217
239
  /**
218
240
  * Flag to control Data panel experience
241
+ *
219
242
  * @default false
220
243
  * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
244
+ *
221
245
  * @example
222
246
  * ```js
223
247
  * const embed = new SearchEmbed('#tsEmbed', {
@@ -229,19 +253,23 @@ export interface SearchViewConfig
229
253
  dataPanelV2?: boolean;
230
254
  /**
231
255
  * Flag to set if last selected dataSource should be used
256
+ *
232
257
  * @version: SDK: 1.24.0
233
258
  */
234
259
  useLastSelectedSources?: boolean;
235
260
  /**
236
261
  * To set the initial state of the search bar in case of saved-answers.
262
+ *
237
263
  * @default false
238
264
  * @version SDK: 1.32.0 | Thoughtspot: 10.0.0.cl
239
265
  */
240
266
  collapseSearchBarInitially?: boolean;
241
267
  /**
242
268
  * To enable custom column groups in data panel v2
269
+ *
243
270
  * @version SDK: 1.32.0 | Thoughtspot: 10.0.0.cl
244
271
  * @default false
272
+ *
245
273
  * @example
246
274
  * ```js
247
275
  * const embed = new SearchEmbed('#tsEmbed', {
@@ -253,6 +281,7 @@ export interface SearchViewConfig
253
281
  enableCustomColumnGroups?: boolean;
254
282
  /**
255
283
  * Flag to enable onBeforeSearchExecute Embed Event
284
+ *
256
285
  * @version: SDK: 1.29.0 | Thoughtspot: 10.1.0.cl
257
286
  */
258
287
  isOnBeforeGetVizDataInterceptEnabled?: boolean;
@@ -263,8 +292,10 @@ export interface SearchViewConfig
263
292
  * - EXPAND_ALL: Expand all the accordion initially in data panel v2.
264
293
  * - COLLAPSE_ALL: Collapse all the accordions initially in data panel v2.
265
294
  * - EXPAND_FIRST: Expand the first accordion and collapse the rest.
295
+ *
266
296
  * @version SDK: 1.32.0 | Thoughtspot: 10.0.0.cl
267
297
  * @default DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL
298
+ *
268
299
  * @example
269
300
  * ```js
270
301
  * const embed = new SearchEmbed('#tsEmbed', {
@@ -287,6 +318,7 @@ export const HiddenActionItemByDefaultForSearchEmbed = [
287
318
 
288
319
  /**
289
320
  * Embed ThoughtSpot search
321
+ *
290
322
  * @group Embed components
291
323
  */
292
324
  export class SearchEmbed extends TsEmbed {
@@ -319,7 +351,6 @@ export class SearchEmbed extends TsEmbed {
319
351
  protected getEmbedParams(): string {
320
352
  const {
321
353
  hideResults,
322
- expandAllDataSource,
323
354
  enableSearchAssist,
324
355
  forceTable,
325
356
  searchOptions,
@@ -376,9 +407,7 @@ export class SearchEmbed extends TsEmbed {
376
407
 
377
408
  if (isOnBeforeGetVizDataInterceptEnabled) {
378
409
  /* eslint-disable-next-line max-len */
379
- queryParams[
380
- Param.IsOnBeforeGetVizDataInterceptEnabled
381
- ] = isOnBeforeGetVizDataInterceptEnabled;
410
+ queryParams[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
382
411
  }
383
412
 
384
413
  queryParams[Param.DataPanelV2Enabled] = dataPanelV2;
@@ -392,16 +421,13 @@ export class SearchEmbed extends TsEmbed {
392
421
  queryParams[Param.searchEmbed] = true;
393
422
  queryParams[Param.CollapseSearchBarInitially] = collapseSearchBarInitially;
394
423
  queryParams[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
395
- if (
396
- dataPanelCustomGroupsAccordionInitialState
397
- === DataPanelCustomColumnGroupsAccordionState.COLLAPSE_ALL
424
+ if (dataPanelCustomGroupsAccordionInitialState
425
+ === DataPanelCustomColumnGroupsAccordionState.COLLAPSE_ALL
398
426
  || dataPanelCustomGroupsAccordionInitialState
399
- === DataPanelCustomColumnGroupsAccordionState.EXPAND_FIRST
427
+ === DataPanelCustomColumnGroupsAccordionState.EXPAND_FIRST
400
428
  ) {
401
429
  /* eslint-disable-next-line max-len */
402
- queryParams[
403
- Param.DataPanelCustomGroupsAccordionInitialState
404
- ] = dataPanelCustomGroupsAccordionInitialState;
430
+ queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
405
431
  } else {
406
432
  /* eslint-disable-next-line max-len */
407
433
  queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
@@ -425,6 +451,7 @@ export class SearchEmbed extends TsEmbed {
425
451
  /**
426
452
  * Construct the URL of the embedded ThoughtSpot search to be
427
453
  * loaded in the iframe
454
+ *
428
455
  * @param answerId The GUID of a saved answer
429
456
  * @param dataSources A list of data source GUIDs
430
457
  */
@@ -450,7 +477,7 @@ export class SearchEmbed extends TsEmbed {
450
477
  checkReleaseVersionInBeta(
451
478
  getReleaseVersion(),
452
479
  getEmbedConfig().suppressSearchEmbedBetaWarning
453
- || getEmbedConfig().suppressErrorAlerts,
480
+ || getEmbedConfig().suppressErrorAlerts,
454
481
  )
455
482
  ) {
456
483
  alert(ERROR_MESSAGE.SEARCHEMBED_BETA_WRANING_MESSAGE);