@thoughtspot/visual-embed-sdk 1.46.0 → 1.46.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/cjs/package.json +2 -2
- package/cjs/src/auth.d.ts +29 -4
- package/cjs/src/auth.d.ts.map +1 -1
- package/cjs/src/auth.js +30 -5
- package/cjs/src/auth.js.map +1 -1
- package/cjs/src/css-variables.d.ts +17 -17
- package/cjs/src/embed/app.d.ts +61 -33
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +11 -4
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +34 -1
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/base.d.ts +2 -2
- package/cjs/src/embed/base.js +2 -2
- package/cjs/src/embed/bodyless-conversation.d.ts +5 -5
- package/cjs/src/embed/bodyless-conversation.js +4 -4
- package/cjs/src/embed/conversation.d.ts +43 -30
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +10 -11
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +27 -0
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +42 -36
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +3 -3
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +1 -1
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/sage.d.ts +5 -5
- package/cjs/src/embed/sage.js +1 -1
- package/cjs/src/embed/search-bar.d.ts +7 -7
- package/cjs/src/embed/search-bar.js +1 -1
- package/cjs/src/embed/search.d.ts +16 -14
- package/cjs/src/embed/search.d.ts.map +1 -1
- package/cjs/src/embed/search.js +3 -2
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +4 -4
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +13 -7
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +35 -0
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/react/index.d.ts +15 -15
- package/cjs/src/react/index.js +12 -12
- package/cjs/src/tokenizedFetch.d.ts +1 -1
- package/cjs/src/tokenizedFetch.js +1 -1
- package/cjs/src/types.d.ts +653 -276
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +274 -208
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.d.ts +4 -2
- package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.js +6 -4
- package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.spec.js +55 -0
- package/cjs/src/utils/graphql/answerService/answerService.spec.js.map +1 -1
- package/cjs/src/utils.d.ts +9 -0
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +10 -1
- package/cjs/src/utils.js.map +1 -1
- package/dist/{index-BQvLEoxp.js → index-DkizS4xM.js} +1 -1
- package/dist/src/auth.d.ts +29 -4
- package/dist/src/auth.d.ts.map +1 -1
- package/dist/src/css-variables.d.ts +17 -17
- package/dist/src/embed/app.d.ts +61 -33
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/base.d.ts +2 -2
- package/dist/src/embed/bodyless-conversation.d.ts +5 -5
- package/dist/src/embed/conversation.d.ts +43 -30
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +42 -36
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/sage.d.ts +5 -5
- package/dist/src/embed/search-bar.d.ts +7 -7
- package/dist/src/embed/search.d.ts +16 -14
- package/dist/src/embed/search.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +4 -4
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/react/index.d.ts +15 -15
- package/dist/src/tokenizedFetch.d.ts +1 -1
- package/dist/src/types.d.ts +653 -276
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/graphql/answerService/answerService.d.ts +4 -2
- package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/dist/src/utils.d.ts +9 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +383 -290
- package/dist/tsembed-react.js +382 -289
- package/dist/tsembed.es.js +375 -282
- package/dist/tsembed.js +374 -281
- package/dist/visual-embed-sdk-react-full.d.ts +880 -431
- package/dist/visual-embed-sdk-react.d.ts +873 -427
- package/dist/visual-embed-sdk.d.ts +879 -430
- package/lib/package.json +2 -2
- package/lib/src/auth.d.ts +29 -4
- package/lib/src/auth.d.ts.map +1 -1
- package/lib/src/auth.js +30 -5
- package/lib/src/auth.js.map +1 -1
- package/lib/src/css-variables.d.ts +17 -17
- package/lib/src/embed/app.d.ts +61 -33
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +12 -5
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +34 -1
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/base.d.ts +2 -2
- package/lib/src/embed/base.js +2 -2
- package/lib/src/embed/bodyless-conversation.d.ts +5 -5
- package/lib/src/embed/bodyless-conversation.js +4 -4
- package/lib/src/embed/conversation.d.ts +43 -30
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +11 -11
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +27 -0
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +42 -36
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +3 -3
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +1 -1
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/sage.d.ts +5 -5
- package/lib/src/embed/sage.js +1 -1
- package/lib/src/embed/search-bar.d.ts +7 -7
- package/lib/src/embed/search-bar.js +1 -1
- package/lib/src/embed/search.d.ts +16 -14
- package/lib/src/embed/search.d.ts.map +1 -1
- package/lib/src/embed/search.js +3 -2
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +4 -4
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +13 -7
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +35 -0
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/react/index.d.ts +15 -15
- package/lib/src/react/index.js +12 -12
- package/lib/src/tokenizedFetch.d.ts +1 -1
- package/lib/src/tokenizedFetch.js +1 -1
- package/lib/src/types.d.ts +653 -276
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +274 -208
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.d.ts +4 -2
- package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.js +5 -3
- package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.spec.js +55 -0
- package/lib/src/utils/graphql/answerService/answerService.spec.js.map +1 -1
- package/lib/src/utils.d.ts +9 -0
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +8 -0
- package/lib/src/utils.js.map +1 -1
- package/package.json +2 -2
- package/src/auth.ts +30 -5
- package/src/css-variables.ts +17 -17
- package/src/embed/app.spec.ts +46 -1
- package/src/embed/app.ts +73 -36
- package/src/embed/base.ts +2 -2
- package/src/embed/bodyless-conversation.ts +5 -5
- package/src/embed/conversation.spec.ts +37 -0
- package/src/embed/conversation.ts +55 -38
- package/src/embed/liveboard.spec.ts +1 -1
- package/src/embed/liveboard.ts +42 -36
- package/src/embed/sage.ts +5 -5
- package/src/embed/search-bar.tsx +7 -7
- package/src/embed/search.ts +16 -14
- package/src/embed/ts-embed.spec.ts +42 -0
- package/src/embed/ts-embed.ts +12 -7
- package/src/react/index.tsx +15 -15
- package/src/tokenizedFetch.ts +1 -1
- package/src/types.ts +652 -275
- package/src/utils/graphql/answerService/answerService.spec.ts +62 -0
- package/src/utils/graphql/answerService/answerService.ts +6 -3
- package/src/utils.ts +14 -0
package/src/embed/liveboard.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Copyright (c) 2022
|
|
3
3
|
*
|
|
4
4
|
* Embed a ThoughtSpot Liveboard or visualization
|
|
5
|
-
* https://developers.thoughtspot.com/docs
|
|
6
|
-
* https://developers.thoughtspot.com/docs
|
|
5
|
+
* https://developers.thoughtspot.com/docs/embed-liveboard
|
|
6
|
+
* https://developers.thoughtspot.com/docs/embed-a-viz
|
|
7
7
|
* @summary Liveboard & visualization embed
|
|
8
8
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
9
9
|
*/
|
|
@@ -49,9 +49,9 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
49
49
|
* Setting `fullHeight` to `false` fetches visualizations
|
|
50
50
|
* incrementally as users scroll the page to view the charts and tables.
|
|
51
51
|
*
|
|
52
|
-
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 7.2.1
|
|
53
52
|
*
|
|
54
53
|
* Supported embed types: `LiveboardEmbed`
|
|
54
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 7.2.1
|
|
55
55
|
* @example
|
|
56
56
|
* ```js
|
|
57
57
|
* const embed = new LiveboardEmbed('#embed', {
|
|
@@ -62,14 +62,14 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
62
62
|
*/
|
|
63
63
|
fullHeight?: boolean;
|
|
64
64
|
/**
|
|
65
|
-
* This is the minimum height(in pixels) for a full-height Liveboard.
|
|
65
|
+
* This is the minimum height (in pixels) for a full-height Liveboard.
|
|
66
66
|
* Setting this height helps resolve issues with empty Liveboards and
|
|
67
67
|
* other screens navigable from a Liveboard.
|
|
68
68
|
*
|
|
69
69
|
* Supported embed types: `LiveboardEmbed`
|
|
70
70
|
* @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
|
|
71
|
-
* @default 500
|
|
72
71
|
* @deprecated Use `minimumHeight` instead.
|
|
72
|
+
* @default 500
|
|
73
73
|
* @example
|
|
74
74
|
* ```js
|
|
75
75
|
* const embed = new LiveboardEmbed('#embed', {
|
|
@@ -98,7 +98,9 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
98
98
|
*/
|
|
99
99
|
minimumHeight?: number;
|
|
100
100
|
/**
|
|
101
|
-
*
|
|
101
|
+
* If set to true, the context menu in visualizations will be enabled.
|
|
102
|
+
* @version SDK: 1.1.0 | ThoughtSpot: 8.1.0.sw
|
|
103
|
+
* @deprecated this option is deprecated.
|
|
102
104
|
* @example
|
|
103
105
|
* ```js
|
|
104
106
|
* const embed = new LiveboardEmbed('#tsEmbed', {
|
|
@@ -106,7 +108,6 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
106
108
|
* enableVizTransformations:true,
|
|
107
109
|
* })
|
|
108
110
|
* ```
|
|
109
|
-
* @version: SDK: 1.1.0 | ThoughtSpot: 8.1.0.sw
|
|
110
111
|
*/
|
|
111
112
|
enableVizTransformations?: boolean;
|
|
112
113
|
/**
|
|
@@ -119,8 +120,9 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
119
120
|
* ```js
|
|
120
121
|
* const embed = new LiveboardEmbed('#tsEmbed', {
|
|
121
122
|
* ... //other embed view config
|
|
122
|
-
* liveboardId:id of liveboard,
|
|
123
|
+
* liveboardId:'id of liveboard',
|
|
123
124
|
* })
|
|
125
|
+
* ```
|
|
124
126
|
*/
|
|
125
127
|
liveboardId?: string;
|
|
126
128
|
/**
|
|
@@ -173,6 +175,7 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
173
175
|
* 'f547ec54-2a37-4516-a222-2b06719af726'
|
|
174
176
|
* ]
|
|
175
177
|
* })
|
|
178
|
+
* ```
|
|
176
179
|
*/
|
|
177
180
|
visibleVizs?: string[];
|
|
178
181
|
/**
|
|
@@ -200,6 +203,7 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
200
203
|
* Specify the tab ID.
|
|
201
204
|
*
|
|
202
205
|
* Supported embed types: `LiveboardEmbed`
|
|
206
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
203
207
|
* @example
|
|
204
208
|
* ```js
|
|
205
209
|
* const embed = new LiveboardEmbed('#tsEmbed', {
|
|
@@ -207,7 +211,6 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
207
211
|
* activeTabId:'id-1234',
|
|
208
212
|
* })
|
|
209
213
|
* ```
|
|
210
|
-
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
211
214
|
*/
|
|
212
215
|
activeTabId?: string;
|
|
213
216
|
/**
|
|
@@ -216,6 +219,7 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
216
219
|
* that includes specific filter selections.
|
|
217
220
|
*
|
|
218
221
|
* Supported embed types: `LiveboardEmbed`
|
|
222
|
+
* @version SDK: 1.46.0 | ThoughtSpot: 26.4.0.cl
|
|
219
223
|
* @example
|
|
220
224
|
* ```js
|
|
221
225
|
* const embed = new LiveboardEmbed('#tsEmbed', {
|
|
@@ -224,7 +228,6 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
224
228
|
* activeTabId: 'tab-guid',
|
|
225
229
|
* })
|
|
226
230
|
* ```
|
|
227
|
-
* @version SDK: 1.46.0 | ThoughtSpot: 26.4.0.cl
|
|
228
231
|
*/
|
|
229
232
|
personalizedViewId?: string;
|
|
230
233
|
/**
|
|
@@ -245,13 +248,14 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
245
248
|
* Show a preview image of the visualization before the visualization loads.
|
|
246
249
|
* Only works for visualizations embeds with a viz id.
|
|
247
250
|
*
|
|
248
|
-
* Also, viz
|
|
251
|
+
* Also, viz snapshot should be enabled in the ThoughtSpot instance.
|
|
249
252
|
* Contact ThoughtSpot support to enable this feature.
|
|
250
253
|
*
|
|
251
|
-
* Since
|
|
254
|
+
* Since this will show preview images, be careful that it may show
|
|
252
255
|
* undesired data to the user when using row level security.
|
|
253
256
|
*
|
|
254
257
|
* Supported embed types: `LiveboardEmbed`
|
|
258
|
+
* @version SDK: 1.32.0 | ThoughtSpot: 10.0.0.cl
|
|
255
259
|
* @example
|
|
256
260
|
* ```js
|
|
257
261
|
* const embed = new LiveboardEmbed('#tsEmbed', {
|
|
@@ -261,7 +265,6 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
261
265
|
* });
|
|
262
266
|
* embed.render();
|
|
263
267
|
* ```
|
|
264
|
-
* @version SDK: 1.32.0 | ThoughtSpot: 10.0.0.cl
|
|
265
268
|
*/
|
|
266
269
|
showPreviewLoader?: boolean;
|
|
267
270
|
/**
|
|
@@ -269,13 +272,14 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
269
272
|
*
|
|
270
273
|
* Supported embed types: `LiveboardEmbed`
|
|
271
274
|
* @hidden
|
|
272
|
-
* @version SDK: 1.35.0 | ThoughtSpot:10.6.0.cl
|
|
275
|
+
* @version SDK: 1.35.0 | ThoughtSpot: 10.6.0.cl
|
|
273
276
|
* @example
|
|
274
277
|
* ```js
|
|
275
278
|
* const embed = new LiveboardEmbed('#tsEmbed', {
|
|
276
279
|
* ... //other embed view config
|
|
277
|
-
* oAuthPollingInterval:
|
|
280
|
+
* oAuthPollingInterval: 30000,
|
|
278
281
|
* })
|
|
282
|
+
* ```
|
|
279
283
|
*/
|
|
280
284
|
oAuthPollingInterval?: number;
|
|
281
285
|
|
|
@@ -284,36 +288,39 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
284
288
|
*
|
|
285
289
|
* Supported embed types: `LiveboardEmbed`
|
|
286
290
|
* @hidden
|
|
287
|
-
* @version SDK: 1.35.0 | ThoughtSpot:10.6.0.cl
|
|
291
|
+
* @version SDK: 1.35.0 | ThoughtSpot: 10.6.0.cl
|
|
288
292
|
* @example
|
|
289
293
|
* ```js
|
|
290
294
|
* const embed = new LiveboardEmbed('#tsEmbed', {
|
|
291
295
|
* ... //other embed view config
|
|
292
296
|
* isForceRedirect: false,
|
|
293
297
|
* })
|
|
298
|
+
* ```
|
|
294
299
|
*/
|
|
295
300
|
isForceRedirect?: boolean;
|
|
296
301
|
|
|
297
302
|
/**
|
|
298
303
|
* The source connection ID for authentication.
|
|
299
|
-
* @hidden
|
|
300
|
-
* @version SDK: 1.35.0 | ThoughtSpot:10.6.0.cl
|
|
301
304
|
*
|
|
302
305
|
* Supported embed types: `LiveboardEmbed`
|
|
306
|
+
* @hidden
|
|
307
|
+
* @version SDK: 1.35.0 | ThoughtSpot: 10.6.0.cl
|
|
303
308
|
* @example
|
|
304
309
|
* ```js
|
|
305
310
|
* const embed = new LiveboardEmbed('#tsEmbed', {
|
|
306
311
|
* ... //other embed view config
|
|
307
312
|
* dataSourceId: '',
|
|
308
313
|
* })
|
|
314
|
+
* ```
|
|
309
315
|
*/
|
|
310
316
|
dataSourceId?: string;
|
|
311
317
|
/**
|
|
312
|
-
* The list of tab IDs to hide from the embedded.
|
|
313
|
-
*
|
|
314
|
-
* Use this to hide
|
|
318
|
+
* The list of tab IDs to hide from the embedded Liveboard.
|
|
319
|
+
* These tabs will be hidden from their respective Liveboards.
|
|
320
|
+
* Use this to hide a tab ID.
|
|
315
321
|
*
|
|
316
322
|
* Supported embed types: `LiveboardEmbed`
|
|
323
|
+
* @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 10.1.0.sw
|
|
317
324
|
* @example
|
|
318
325
|
* ```js
|
|
319
326
|
* const embed = new LiveboardEmbed('#tsEmbed', {
|
|
@@ -324,7 +331,6 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
324
331
|
* ]
|
|
325
332
|
* });
|
|
326
333
|
* ```
|
|
327
|
-
* @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 10.1.0.sw
|
|
328
334
|
*/
|
|
329
335
|
hiddenTabs?: string[];
|
|
330
336
|
/**
|
|
@@ -348,7 +354,8 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
348
354
|
*/
|
|
349
355
|
visibleTabs?: string[];
|
|
350
356
|
/**
|
|
351
|
-
* This flag is used to enable/disable the styling and grouping in a Liveboard
|
|
357
|
+
* This flag is used to enable/disable the styling and grouping in a Liveboard. Use {@link isLiveboardMasterpiecesEnabled} instead.
|
|
358
|
+
* @deprecated This flag is deprecated.
|
|
352
359
|
*
|
|
353
360
|
* Supported embed types: `LiveboardEmbed`, `AppEmbed`
|
|
354
361
|
* @type {boolean}
|
|
@@ -414,6 +421,9 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
414
421
|
/**
|
|
415
422
|
* This flag is used to enable the full height lazy load data.
|
|
416
423
|
*
|
|
424
|
+
* @type {boolean}
|
|
425
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.12.0.cl
|
|
426
|
+
* @default false
|
|
417
427
|
* @example
|
|
418
428
|
* ```js
|
|
419
429
|
* const embed = new LiveboardEmbed('#embed-container', {
|
|
@@ -422,33 +432,29 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
422
432
|
* lazyLoadingForFullHeight: true,
|
|
423
433
|
* })
|
|
424
434
|
* ```
|
|
425
|
-
*
|
|
426
|
-
* @type {boolean}
|
|
427
|
-
* @default false
|
|
428
|
-
* @version SDK: 1.40.0 | ThoughtSpot:10.12.0.cl
|
|
429
435
|
*/
|
|
430
436
|
lazyLoadingForFullHeight?: boolean;
|
|
431
437
|
/**
|
|
432
438
|
* The margin to be used for lazy loading.
|
|
433
439
|
*
|
|
434
440
|
* For example, if the margin is set to '10px',
|
|
435
|
-
* the visualization will be loaded 10px before
|
|
441
|
+
* the visualization will be loaded 10px before its top edge is visible in the
|
|
436
442
|
* viewport.
|
|
437
443
|
*
|
|
438
444
|
* The format is similar to CSS margin.
|
|
439
445
|
*
|
|
446
|
+
* @type {string}
|
|
447
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.12.0.cl
|
|
440
448
|
* @example
|
|
441
449
|
* ```js
|
|
442
450
|
* const embed = new LiveboardEmbed('#embed-container', {
|
|
443
451
|
* // ...other options
|
|
444
452
|
* fullHeight: true,
|
|
445
453
|
* lazyLoadingForFullHeight: true,
|
|
446
|
-
* // Using 0px, the visualization will be only loaded when
|
|
454
|
+
* // Using 0px, the visualization will be only loaded when it's visible in the viewport.
|
|
447
455
|
* lazyLoadingMargin: '0px',
|
|
448
456
|
* })
|
|
449
457
|
* ```
|
|
450
|
-
* @type {string}
|
|
451
|
-
* @version SDK: 1.40.0 | ThoughtSpot:10.12.0.cl
|
|
452
458
|
*/
|
|
453
459
|
lazyLoadingMargin?: string;
|
|
454
460
|
/**
|
|
@@ -456,6 +462,8 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
456
462
|
* of the spotter underneath the chat input.
|
|
457
463
|
* default is false.
|
|
458
464
|
*
|
|
465
|
+
* @type {boolean}
|
|
466
|
+
* @version SDK: 1.41.1 | ThoughtSpot: 10.5.0.cl
|
|
459
467
|
* @example
|
|
460
468
|
* ```js
|
|
461
469
|
* const embed = new LiveboardEmbed('#embed-container', {
|
|
@@ -463,14 +471,13 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
463
471
|
* showSpotterLimitations: true,
|
|
464
472
|
* })
|
|
465
473
|
* ```
|
|
466
|
-
* @type {boolean}
|
|
467
|
-
* @version SDK: 1.41.1 | ThoughtSpot: 10.5.0.cl
|
|
468
474
|
*/
|
|
469
475
|
showSpotterLimitations?: boolean;
|
|
470
476
|
/**
|
|
471
477
|
* updatedSpotterChatPrompt : Controls the updated spotter chat prompt.
|
|
472
478
|
*
|
|
473
479
|
* Supported embed types: `LiveboardEmbed`
|
|
480
|
+
* @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
|
|
474
481
|
* @default false
|
|
475
482
|
* @example
|
|
476
483
|
* ```js
|
|
@@ -479,7 +486,6 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
479
486
|
* updatedSpotterChatPrompt : true,
|
|
480
487
|
* })
|
|
481
488
|
* ```
|
|
482
|
-
* @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
|
|
483
489
|
*/
|
|
484
490
|
updatedSpotterChatPrompt?: boolean;
|
|
485
491
|
/**
|
|
@@ -487,6 +493,7 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
487
493
|
* branding in tool response cards.
|
|
488
494
|
*
|
|
489
495
|
* Supported embed types: `LiveboardEmbed`
|
|
496
|
+
* @version SDK: 1.46.0 | ThoughtSpot: 26.4.0.cl
|
|
490
497
|
* @example
|
|
491
498
|
* ```js
|
|
492
499
|
* const embed = new LiveboardEmbed('#tsEmbed', {
|
|
@@ -497,7 +504,6 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
497
504
|
* },
|
|
498
505
|
* })
|
|
499
506
|
* ```
|
|
500
|
-
* @version SDK: 1.46.0 | ThoughtSpot: 26.4.0.cl
|
|
501
507
|
*/
|
|
502
508
|
spotterChatConfig?: SpotterChatViewConfig;
|
|
503
509
|
}
|
|
@@ -506,6 +512,7 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
506
512
|
* Embed a ThoughtSpot Liveboard or visualization. When rendered it already
|
|
507
513
|
* waits for the authentication to complete, so you need not wait for
|
|
508
514
|
* `AuthStatus.SUCCESS`.
|
|
515
|
+
* @group Embed components
|
|
509
516
|
* @example
|
|
510
517
|
* ```js
|
|
511
518
|
* import { .. } from '@thoughtspot/visual-embed-sdk';
|
|
@@ -515,7 +522,6 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
515
522
|
* // .. other params here.
|
|
516
523
|
* })
|
|
517
524
|
* ```
|
|
518
|
-
* @group Embed components
|
|
519
525
|
*/
|
|
520
526
|
export class LiveboardEmbed extends V1Embed {
|
|
521
527
|
protected viewConfig: LiveboardViewConfig;
|
package/src/embed/sage.ts
CHANGED
|
@@ -30,7 +30,7 @@ export interface SearchOptions {
|
|
|
30
30
|
/**
|
|
31
31
|
* The configuration attributes for the embedded Natural language search view. Based on
|
|
32
32
|
* GPT and LLM.
|
|
33
|
-
* @version
|
|
33
|
+
* @version SDK: 1.23.0 | ThoughtSpot: 9.8.0.cl, 9.8.0.sw
|
|
34
34
|
*
|
|
35
35
|
* Note: This embed will be deprecated from SDK: 1.40.0 | ThoughtSpot: 10.13.0.cl
|
|
36
36
|
* @group Embed components
|
|
@@ -85,14 +85,14 @@ export interface SageViewConfig
|
|
|
85
85
|
hideAutocompleteSuggestions?: boolean;
|
|
86
86
|
/**
|
|
87
87
|
* Show or hide autocomplete suggestions for the search query string.
|
|
88
|
+
* You can use {@link hideAutocompleteSuggestions} instead.
|
|
88
89
|
* @deprecated
|
|
89
90
|
* Currently, the object suggestions will not be shown for Natural Language Search.
|
|
90
|
-
* You can use {@link hideAutocompleteSuggestions} instead.
|
|
91
91
|
*/
|
|
92
92
|
showObjectSuggestions?: boolean;
|
|
93
93
|
/**
|
|
94
94
|
* Show or hide sample questions.
|
|
95
|
-
* The sample questions are autogenerated based on the data
|
|
95
|
+
* The sample questions are autogenerated based on the data model
|
|
96
96
|
* selected for the search operation.
|
|
97
97
|
*
|
|
98
98
|
* Supported embed types: `SageEmbed`
|
|
@@ -122,6 +122,7 @@ export interface SageViewConfig
|
|
|
122
122
|
* the token string in the search bar.
|
|
123
123
|
*
|
|
124
124
|
* Supported embed types: `SageEmbed`
|
|
125
|
+
* @version SDK: 1.26.0 | ThoughtSpot: 9.8.0.cl, 9.8.0.sw
|
|
125
126
|
* @example
|
|
126
127
|
* ```js
|
|
127
128
|
* searchOptions: {
|
|
@@ -129,13 +130,12 @@ export interface SageViewConfig
|
|
|
129
130
|
* executeSearch: true,
|
|
130
131
|
* }
|
|
131
132
|
* ```
|
|
132
|
-
* @version SDK: 1.26.0 | ThoughtSpot: 9.8.0.cl, 9.8.0.sw
|
|
133
133
|
*/
|
|
134
134
|
searchOptions?: SearchOptions;
|
|
135
135
|
}
|
|
136
136
|
/**
|
|
137
137
|
* Embed ThoughtSpot LLM and GPT-based Natural Language Search component.
|
|
138
|
-
* @version
|
|
138
|
+
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl, 9.5.1-sw
|
|
139
139
|
*
|
|
140
140
|
* Note: This embed will be deprecated from SDK: 1.40.0 | ThoughtSpot: 10.13.0.cl
|
|
141
141
|
* @group Embed components
|
package/src/embed/search-bar.tsx
CHANGED
|
@@ -12,8 +12,8 @@ export interface SearchBarViewConfig extends BaseViewConfig, SearchLiveboardComm
|
|
|
12
12
|
* Only a single data source is supported currently.
|
|
13
13
|
*
|
|
14
14
|
* Supported embed types: `SearchBarEmbed`
|
|
15
|
+
* @version SDK: 1.1.0 | ThoughtSpot: 8.1.1-sw
|
|
15
16
|
* @deprecated Use `dataSource` instead
|
|
16
|
-
* @version: SDK: 1.1.0 | ThoughtSpot: 8.1.1-sw
|
|
17
17
|
* @example
|
|
18
18
|
* ```js
|
|
19
19
|
* const embed = new SearchBarEmbed('#tsEmbed', {
|
|
@@ -27,7 +27,7 @@ export interface SearchBarViewConfig extends BaseViewConfig, SearchLiveboardComm
|
|
|
27
27
|
* Pass the ID of the source to be selected.
|
|
28
28
|
*
|
|
29
29
|
* Supported embed types: `SearchBarEmbed`
|
|
30
|
-
* @version
|
|
30
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
31
31
|
* @example
|
|
32
32
|
* ```js
|
|
33
33
|
* const embed = new SearchBarEmbed('#tsEmbed', {
|
|
@@ -41,7 +41,7 @@ export interface SearchBarViewConfig extends BaseViewConfig, SearchLiveboardComm
|
|
|
41
41
|
* Boolean to define if the last selected data source should be used
|
|
42
42
|
*
|
|
43
43
|
* Supported embed types: `SearchBarEmbed`
|
|
44
|
-
* @version
|
|
44
|
+
* @version SDK: 1.24.0 | ThoughtSpot: 9.5.0.cl, 9.5.0.sw
|
|
45
45
|
* @example
|
|
46
46
|
* ```js
|
|
47
47
|
* const embed = new SearchBarEmbed('#tsEmbed', {
|
|
@@ -63,7 +63,7 @@ export interface SearchBarViewConfig extends BaseViewConfig, SearchLiveboardComm
|
|
|
63
63
|
* the token string in the search bar.
|
|
64
64
|
*
|
|
65
65
|
* Supported embed types: `SearchBarEmbed`
|
|
66
|
-
* @version
|
|
66
|
+
* @version SDK: 1.2.0 | ThoughtSpot: 9.4.0.sw
|
|
67
67
|
* @example
|
|
68
68
|
* ```js
|
|
69
69
|
* const embed = new SearchBarEmbed('#tsEmbed', {
|
|
@@ -81,10 +81,10 @@ export interface SearchBarViewConfig extends BaseViewConfig, SearchLiveboardComm
|
|
|
81
81
|
* If set to true, the search token string is not appended to the URL.
|
|
82
82
|
*
|
|
83
83
|
* Supported embed types: `SearchBarEmbed`
|
|
84
|
-
* @version
|
|
84
|
+
* @version SDK: 1.35.7 | ThoughtSpot: 10.8.0.cl
|
|
85
85
|
* @example
|
|
86
86
|
* ```js
|
|
87
|
-
* const embed = new
|
|
87
|
+
* const embed = new SearchBarEmbed('#tsEmbed', {
|
|
88
88
|
* searchOptions: {
|
|
89
89
|
* searchTokenString: '[quantity purchased] [region]',
|
|
90
90
|
* executeSearch: true,
|
|
@@ -102,7 +102,7 @@ export interface SearchAppInitData extends DefaultAppInitData {
|
|
|
102
102
|
|
|
103
103
|
/**
|
|
104
104
|
* Embed ThoughtSpot search bar
|
|
105
|
-
* @version
|
|
105
|
+
* @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1-sw
|
|
106
106
|
* @group Embed components
|
|
107
107
|
*/
|
|
108
108
|
export class SearchBarEmbed extends TsEmbed {
|
package/src/embed/search.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2022
|
|
3
3
|
*
|
|
4
|
-
* Embed ThoughtSpot search or a saved answer
|
|
4
|
+
* Embed ThoughtSpot search or a saved answer.
|
|
5
|
+
* https://developers.thoughtspot.com/docs/search-embed
|
|
5
6
|
* @summary Search embed
|
|
6
7
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
7
8
|
*/
|
|
@@ -47,7 +48,7 @@ export interface SearchOptions {
|
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
/**
|
|
50
|
-
* Define the initial state
|
|
51
|
+
* Define the initial state of column custom group accordions
|
|
51
52
|
* in data panel v2.
|
|
52
53
|
*/
|
|
53
54
|
export enum DataPanelCustomColumnGroupsAccordionState {
|
|
@@ -76,7 +77,7 @@ export interface SearchViewConfig
|
|
|
76
77
|
* but can be expanded manually.
|
|
77
78
|
*
|
|
78
79
|
* Supported embed types: `SearchEmbed`
|
|
79
|
-
* @version
|
|
80
|
+
* @version SDK: 1.1.0 | ThoughtSpot: 8.1.0.sw
|
|
80
81
|
* @example
|
|
81
82
|
* ```js
|
|
82
83
|
* const embed = new SearchEmbed('#tsEmbed', {
|
|
@@ -91,7 +92,7 @@ export interface SearchViewConfig
|
|
|
91
92
|
* but can be expanded manually.
|
|
92
93
|
*
|
|
93
94
|
* Supported embed types: `SearchEmbed`
|
|
94
|
-
* @version
|
|
95
|
+
* @version SDK: 1.34.0 | ThoughtSpot: 10.3.0.cl
|
|
95
96
|
* @example
|
|
96
97
|
* ```js
|
|
97
98
|
* const embed = new SearchEmbed('#tsEmbed', {
|
|
@@ -105,7 +106,7 @@ export interface SearchViewConfig
|
|
|
105
106
|
* Show or hide the data sources panel.
|
|
106
107
|
*
|
|
107
108
|
* Supported embed types: `SearchEmbed`
|
|
108
|
-
* @version
|
|
109
|
+
* @version SDK: 1.2.0 | ThoughtSpot: 9.1.0.sw
|
|
109
110
|
* @example
|
|
110
111
|
* ```js
|
|
111
112
|
* const embed = new SearchEmbed('#tsEmbed', {
|
|
@@ -121,7 +122,7 @@ export interface SearchViewConfig
|
|
|
121
122
|
* using raw answer data.
|
|
122
123
|
*
|
|
123
124
|
* Supported embed types: `SearchEmbed`
|
|
124
|
-
* @version
|
|
125
|
+
* @version SDK: 1.2.0 | ThoughtSpot: 9.1.0.sw
|
|
125
126
|
* @example
|
|
126
127
|
* ```js
|
|
127
128
|
* const embed = new SearchEmbed('#tsEmbed', {
|
|
@@ -150,7 +151,7 @@ export interface SearchViewConfig
|
|
|
150
151
|
* format for presenting search data.
|
|
151
152
|
*
|
|
152
153
|
* Supported embed types: `SearchEmbed`
|
|
153
|
-
* @version
|
|
154
|
+
* @version SDK: 1.1.0 | ThoughtSpot: 8.1.0.sw
|
|
154
155
|
* @example
|
|
155
156
|
* ```js
|
|
156
157
|
* const embed = new SearchEmbed('#tsEmbed', {
|
|
@@ -163,6 +164,7 @@ export interface SearchViewConfig
|
|
|
163
164
|
/**
|
|
164
165
|
* The array of data source GUIDs to set on load.
|
|
165
166
|
* Only a single data source is supported currently.
|
|
167
|
+
* Use {@link dataSource} instead.
|
|
166
168
|
* @deprecated Use `dataSource` instead.
|
|
167
169
|
*
|
|
168
170
|
* Supported embed types: `SearchEmbed`
|
|
@@ -176,10 +178,10 @@ export interface SearchViewConfig
|
|
|
176
178
|
*/
|
|
177
179
|
dataSources?: string[];
|
|
178
180
|
/**
|
|
179
|
-
* The
|
|
181
|
+
* The data source GUID to set on load.
|
|
180
182
|
*
|
|
181
183
|
* Supported embed types: `SearchEmbed`
|
|
182
|
-
* @version
|
|
184
|
+
* @version SDK: 1.19.0
|
|
183
185
|
* @example
|
|
184
186
|
* ```js
|
|
185
187
|
* const embed = new SearchEmbed('#tsEmbed', {
|
|
@@ -191,9 +193,9 @@ export interface SearchViewConfig
|
|
|
191
193
|
dataSource?: string;
|
|
192
194
|
/**
|
|
193
195
|
* The initial search query to load the answer with.
|
|
196
|
+
* Use {@link searchOptions} instead.
|
|
194
197
|
* @deprecated
|
|
195
198
|
*
|
|
196
|
-
* Use {@link searchOptions} instead.
|
|
197
199
|
*/
|
|
198
200
|
searchQuery?: string;
|
|
199
201
|
/**
|
|
@@ -222,7 +224,7 @@ export interface SearchViewConfig
|
|
|
222
224
|
* If set to true, the search token string is not appended to the URL.
|
|
223
225
|
*
|
|
224
226
|
* Supported embed types: `SearchEmbed`
|
|
225
|
-
* @version
|
|
227
|
+
* @version SDK: 1.35.7 | ThoughtSpot: 10.8.0.cl
|
|
226
228
|
* @example
|
|
227
229
|
* ```js
|
|
228
230
|
* const embed = new SearchEmbed('#tsEmbed', {
|
|
@@ -239,7 +241,7 @@ export interface SearchViewConfig
|
|
|
239
241
|
* The GUID of a saved answer to load initially.
|
|
240
242
|
*
|
|
241
243
|
* Supported embed types: `SearchEmbed`
|
|
242
|
-
* @version
|
|
244
|
+
* @version SDK: 1.1.0 | ThoughtSpot: 8.1.0.sw
|
|
243
245
|
* @example
|
|
244
246
|
* ```js
|
|
245
247
|
* const embed = new SearchEmbed('#tsEmbed', {
|
|
@@ -268,14 +270,14 @@ export interface SearchViewConfig
|
|
|
268
270
|
* Flag to set if last selected dataSource should be used
|
|
269
271
|
*
|
|
270
272
|
* Supported embed types: `SearchEmbed`
|
|
271
|
-
* @version
|
|
273
|
+
* @version SDK: 1.24.0
|
|
272
274
|
*/
|
|
273
275
|
useLastSelectedSources?: boolean;
|
|
274
276
|
/**
|
|
275
277
|
* To set the initial state of the search bar in case of saved-answers.
|
|
276
|
-
* @default false
|
|
277
278
|
* @version SDK: 1.32.0 | ThoughtSpot: 10.0.0.cl
|
|
278
279
|
* @deprecated Use {@link collapseSearchBar} instead
|
|
280
|
+
* @default false
|
|
279
281
|
*/
|
|
280
282
|
collapseSearchBarInitially?: boolean;
|
|
281
283
|
/**
|
|
@@ -2034,6 +2034,36 @@ describe('Unit test case for ts embed', () => {
|
|
|
2034
2034
|
+ `&locale=ja-JP${defaultParamsPost}#/home`,
|
|
2035
2035
|
);
|
|
2036
2036
|
});
|
|
2037
|
+
it('Sets both params when enableLinkOverridesV2 is set', async () => {
|
|
2038
|
+
const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
|
|
2039
|
+
frameParams: {
|
|
2040
|
+
width: '100%',
|
|
2041
|
+
height: '100%',
|
|
2042
|
+
},
|
|
2043
|
+
liveboardId: 'test-lb',
|
|
2044
|
+
enableLinkOverridesV2: true,
|
|
2045
|
+
});
|
|
2046
|
+
await liveboardEmbed.render();
|
|
2047
|
+
expectUrlMatchesWithParams(
|
|
2048
|
+
getIFrameSrc(),
|
|
2049
|
+
`http://${thoughtSpotHost}/?embedApp=true&${defaultParamsForPinboardEmbed}&enableLinkOverridesV2=true&linkOverride=true${defaultParamsPost}#/embed/viz/test-lb`,
|
|
2050
|
+
);
|
|
2051
|
+
});
|
|
2052
|
+
it('Sets only linkOverride when enableLinkOverridesV2 is not set', async () => {
|
|
2053
|
+
const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
|
|
2054
|
+
frameParams: {
|
|
2055
|
+
width: '100%',
|
|
2056
|
+
height: '100%',
|
|
2057
|
+
},
|
|
2058
|
+
liveboardId: 'test-lb',
|
|
2059
|
+
linkOverride: true,
|
|
2060
|
+
});
|
|
2061
|
+
await liveboardEmbed.render();
|
|
2062
|
+
expectUrlMatchesWithParams(
|
|
2063
|
+
getIFrameSrc(),
|
|
2064
|
+
`http://${thoughtSpotHost}/?embedApp=true&${defaultParamsForPinboardEmbed}&linkOverride=true${defaultParamsPost}#/embed/viz/test-lb`,
|
|
2065
|
+
);
|
|
2066
|
+
});
|
|
2037
2067
|
it('Sets the iconSprite url', async () => {
|
|
2038
2068
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2039
2069
|
frameParams: {
|
|
@@ -4513,4 +4543,16 @@ describe('ShowPreRender with UpdateEmbedParams', () => {
|
|
|
4513
4543
|
|
|
4514
4544
|
handleErrorSpy.mockRestore();
|
|
4515
4545
|
});
|
|
4546
|
+
|
|
4547
|
+
test('should set allow "local-network-access" correctly on the iframe', async () => {
|
|
4548
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
4549
|
+
frameParams: { width: '100%', height: '100%' },
|
|
4550
|
+
});
|
|
4551
|
+
await appEmbed.render();
|
|
4552
|
+
const iframe = getIFrameEl();
|
|
4553
|
+
expect(iframe.allow).toContain('local-network-access');
|
|
4554
|
+
expect(iframe.allow).toContain('fullscreen');
|
|
4555
|
+
expect(iframe.allow).toContain('clipboard-read');
|
|
4556
|
+
expect(iframe.allow).toContain('clipboard-write');
|
|
4557
|
+
});
|
|
4516
4558
|
});
|
package/src/embed/ts-embed.ts
CHANGED
|
@@ -83,7 +83,7 @@ import { getHostEventsConfig } from '../utils';
|
|
|
83
83
|
const { version } = pkgInfo;
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
|
-
* Global prefix for all
|
|
86
|
+
* Global prefix for all ThoughtSpot postHash Params.
|
|
87
87
|
*/
|
|
88
88
|
export const THOUGHTSPOT_PARAM_PREFIX = 'ts-';
|
|
89
89
|
const TS_EMBED_ID = '_thoughtspot-embed';
|
|
@@ -174,9 +174,9 @@ export class TsEmbed {
|
|
|
174
174
|
private isPreRendered: boolean;
|
|
175
175
|
|
|
176
176
|
/**
|
|
177
|
-
* Should we encode URL Query Params using base64 encoding which
|
|
177
|
+
* Should we encode URL Query Params using base64 encoding which ThoughtSpot
|
|
178
178
|
* will generate for embedding. This provides additional security to
|
|
179
|
-
*
|
|
179
|
+
* ThoughtSpot clusters against Cross site scripting attacks.
|
|
180
180
|
* @default false
|
|
181
181
|
*/
|
|
182
182
|
private shouldEncodeUrlQueryParams = false;
|
|
@@ -699,6 +699,7 @@ export class TsEmbed {
|
|
|
699
699
|
customizations,
|
|
700
700
|
contextMenuTrigger,
|
|
701
701
|
linkOverride,
|
|
702
|
+
enableLinkOverridesV2,
|
|
702
703
|
insertInToSlide,
|
|
703
704
|
disableRedirectionLinksInNewTab,
|
|
704
705
|
overrideOrgId,
|
|
@@ -786,8 +787,12 @@ export class TsEmbed {
|
|
|
786
787
|
if (locale !== undefined) {
|
|
787
788
|
queryParams[Param.Locale] = locale;
|
|
788
789
|
}
|
|
789
|
-
|
|
790
|
-
|
|
790
|
+
// TODO: Once V2 is stable, send both flags when
|
|
791
|
+
// linkOverride is true (remove the else-if).
|
|
792
|
+
if (enableLinkOverridesV2) {
|
|
793
|
+
queryParams[Param.EnableLinkOverridesV2] = true;
|
|
794
|
+
queryParams[Param.LinkOverride] = true;
|
|
795
|
+
} else if (linkOverride) {
|
|
791
796
|
queryParams[Param.LinkOverride] = linkOverride;
|
|
792
797
|
}
|
|
793
798
|
if (insertInToSlide) {
|
|
@@ -867,7 +872,7 @@ export class TsEmbed {
|
|
|
867
872
|
iFrame.mozallowfullscreen = true;
|
|
868
873
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
869
874
|
// @ts-ignore
|
|
870
|
-
iFrame.allow = 'clipboard-read; clipboard-write; fullscreen;';
|
|
875
|
+
iFrame.allow = 'clipboard-read; clipboard-write; fullscreen; local-network-access;';
|
|
871
876
|
|
|
872
877
|
const frameParams = this.viewConfig.frameParams;
|
|
873
878
|
const { height: frameHeight, width: frameWidth, ...restParams } = frameParams || {};
|
|
@@ -1751,7 +1756,7 @@ export class TsEmbed {
|
|
|
1751
1756
|
* Returns the answerService which can be used to make arbitrary graphql calls on top
|
|
1752
1757
|
* session.
|
|
1753
1758
|
* @param vizId [Optional] to get for a specific viz in case of a Liveboard.
|
|
1754
|
-
* @version SDK: 1.25.0
|
|
1759
|
+
* @version SDK: 1.25.0 | ThoughtSpot: 9.10.0
|
|
1755
1760
|
*/
|
|
1756
1761
|
public async getAnswerService(vizId?: string): Promise<AnswerService> {
|
|
1757
1762
|
const { session } = await this.trigger(HostEvent.GetAnswerSession, vizId ? { vizId } : {});
|