@thoughtspot/visual-embed-sdk 1.39.0 → 1.39.2-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 (109) hide show
  1. package/cjs/package.json +1 -1
  2. package/cjs/src/embed/app.d.ts +13 -13
  3. package/cjs/src/embed/app.d.ts.map +1 -1
  4. package/cjs/src/embed/app.js +2 -1
  5. package/cjs/src/embed/app.js.map +1 -1
  6. package/cjs/src/embed/app.spec.js +18 -8
  7. package/cjs/src/embed/app.spec.js.map +1 -1
  8. package/cjs/src/embed/conversation.d.ts +64 -6
  9. package/cjs/src/embed/conversation.d.ts.map +1 -1
  10. package/cjs/src/embed/conversation.js +9 -1
  11. package/cjs/src/embed/conversation.js.map +1 -1
  12. package/cjs/src/embed/conversation.spec.js +130 -0
  13. package/cjs/src/embed/conversation.spec.js.map +1 -1
  14. package/cjs/src/embed/embedConfig.d.ts +49 -4
  15. package/cjs/src/embed/embedConfig.d.ts.map +1 -1
  16. package/cjs/src/embed/embedConfig.js +49 -4
  17. package/cjs/src/embed/embedConfig.js.map +1 -1
  18. package/cjs/src/embed/liveboard.d.ts +2 -19
  19. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  20. package/cjs/src/embed/liveboard.js +3 -5
  21. package/cjs/src/embed/liveboard.js.map +1 -1
  22. package/cjs/src/embed/liveboard.spec.js +12 -11
  23. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  24. package/cjs/src/embed/sage.d.ts +10 -10
  25. package/cjs/src/embed/search.d.ts +4 -4
  26. package/cjs/src/embed/ts-embed.d.ts +5 -0
  27. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  28. package/cjs/src/embed/ts-embed.js +16 -1
  29. package/cjs/src/embed/ts-embed.js.map +1 -1
  30. package/cjs/src/embed/ts-embed.spec.js +164 -0
  31. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  32. package/cjs/src/types.d.ts +41 -8
  33. package/cjs/src/types.d.ts.map +1 -1
  34. package/cjs/src/types.js +23 -6
  35. package/cjs/src/types.js.map +1 -1
  36. package/dist/{index-sSREbWM-.js → index-CmEQfuE3.js} +1 -1
  37. package/dist/index-DeFzsyFF.js +7371 -0
  38. package/dist/index-Dpf0rd6w.js +7371 -0
  39. package/dist/index-UuEbsISo.js +7447 -0
  40. package/dist/src/embed/app.d.ts +13 -13
  41. package/dist/src/embed/app.d.ts.map +1 -1
  42. package/dist/src/embed/conversation.d.ts +64 -6
  43. package/dist/src/embed/conversation.d.ts.map +1 -1
  44. package/dist/src/embed/embedConfig.d.ts +49 -4
  45. package/dist/src/embed/embedConfig.d.ts.map +1 -1
  46. package/dist/src/embed/liveboard.d.ts +2 -19
  47. package/dist/src/embed/liveboard.d.ts.map +1 -1
  48. package/dist/src/embed/sage.d.ts +10 -10
  49. package/dist/src/embed/search.d.ts +4 -4
  50. package/dist/src/embed/ts-embed.d.ts +5 -0
  51. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  52. package/dist/src/types.d.ts +41 -8
  53. package/dist/src/types.d.ts.map +1 -1
  54. package/dist/tsembed-react.es.js +105 -21
  55. package/dist/tsembed-react.js +104 -20
  56. package/dist/tsembed.es.js +105 -21
  57. package/dist/tsembed.js +104 -20
  58. package/dist/visual-embed-sdk-react-full.d.ts +182 -63
  59. package/dist/visual-embed-sdk-react.d.ts +182 -63
  60. package/dist/visual-embed-sdk.d.ts +182 -63
  61. package/lib/package.json +1 -1
  62. package/lib/src/embed/app.d.ts +13 -13
  63. package/lib/src/embed/app.d.ts.map +1 -1
  64. package/lib/src/embed/app.js +2 -1
  65. package/lib/src/embed/app.js.map +1 -1
  66. package/lib/src/embed/app.spec.js +19 -9
  67. package/lib/src/embed/app.spec.js.map +1 -1
  68. package/lib/src/embed/conversation.d.ts +64 -6
  69. package/lib/src/embed/conversation.d.ts.map +1 -1
  70. package/lib/src/embed/conversation.js +10 -2
  71. package/lib/src/embed/conversation.js.map +1 -1
  72. package/lib/src/embed/conversation.spec.js +133 -3
  73. package/lib/src/embed/conversation.spec.js.map +1 -1
  74. package/lib/src/embed/embedConfig.d.ts +49 -4
  75. package/lib/src/embed/embedConfig.d.ts.map +1 -1
  76. package/lib/src/embed/embedConfig.js +49 -4
  77. package/lib/src/embed/embedConfig.js.map +1 -1
  78. package/lib/src/embed/liveboard.d.ts +2 -19
  79. package/lib/src/embed/liveboard.d.ts.map +1 -1
  80. package/lib/src/embed/liveboard.js +3 -5
  81. package/lib/src/embed/liveboard.js.map +1 -1
  82. package/lib/src/embed/liveboard.spec.js +12 -11
  83. package/lib/src/embed/liveboard.spec.js.map +1 -1
  84. package/lib/src/embed/sage.d.ts +10 -10
  85. package/lib/src/embed/search.d.ts +4 -4
  86. package/lib/src/embed/ts-embed.d.ts +5 -0
  87. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  88. package/lib/src/embed/ts-embed.js +16 -1
  89. package/lib/src/embed/ts-embed.js.map +1 -1
  90. package/lib/src/embed/ts-embed.spec.js +164 -0
  91. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  92. package/lib/src/types.d.ts +41 -8
  93. package/lib/src/types.d.ts.map +1 -1
  94. package/lib/src/types.js +23 -6
  95. package/lib/src/types.js.map +1 -1
  96. package/lib/src/visual-embed-sdk.d.ts +183 -64
  97. package/package.json +1 -1
  98. package/src/embed/app.spec.ts +36 -23
  99. package/src/embed/app.ts +15 -13
  100. package/src/embed/conversation.spec.ts +170 -6
  101. package/src/embed/conversation.ts +86 -14
  102. package/src/embed/embedConfig.ts +50 -5
  103. package/src/embed/liveboard.spec.ts +5 -4
  104. package/src/embed/liveboard.ts +4 -24
  105. package/src/embed/sage.ts +10 -10
  106. package/src/embed/search.ts +4 -4
  107. package/src/embed/ts-embed.spec.ts +225 -0
  108. package/src/embed/ts-embed.ts +19 -0
  109. package/src/types.ts +82 -49
package/src/embed/app.ts CHANGED
@@ -136,7 +136,7 @@ export interface AppViewConfig extends AllEmbedViewConfig {
136
136
  *
137
137
  * Supported embed types: `AppEmbed`
138
138
  * @default true
139
- * @version SDK: 1.2.0 | Thoughtspot: 8.4.0.cl
139
+ * @version SDK: 1.2.0 | ThoughtSpot: 8.4.0.cl
140
140
  * @example
141
141
  * ```js
142
142
  * const embed = new AppEmbed('#tsEmbed', {
@@ -158,7 +158,7 @@ export interface AppViewConfig extends AllEmbedViewConfig {
158
158
  *
159
159
  * Supported embed types: `AppEmbed`
160
160
  * @default false
161
- * @version SDK: 1.28.0 | Thoughtspot: 9.12.5.cl
161
+ * @version SDK: 1.28.0 | ThoughtSpot: 9.12.5.cl
162
162
  * @example
163
163
  * ```js
164
164
  * const embed = new AppEmbed('#tsEmbed', {
@@ -174,7 +174,7 @@ export interface AppViewConfig extends AllEmbedViewConfig {
174
174
  *
175
175
  * Supported embed types: `AppEmbed`
176
176
  * @default false
177
- * @version SDK: 1.2.0 | Thoughtspot: 8.4.0.cl
177
+ * @version SDK: 1.2.0 | ThoughtSpot: 8.4.0.cl
178
178
  * @example
179
179
  * ```js
180
180
  * const embed = new AppEmbed('#tsEmbed', {
@@ -257,7 +257,7 @@ export interface AppViewConfig extends AllEmbedViewConfig {
257
257
  * `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl).
258
258
  *
259
259
  * Supported embed types: `AppEmbed`
260
- * @version SDK: 1.28.0 | Thoughtspot: 9.12.5.cl
260
+ * @version SDK: 1.28.0 | ThoughtSpot: 9.12.5.cl
261
261
  * @default false
262
262
  * @example
263
263
  * ```js
@@ -277,7 +277,7 @@ export interface AppViewConfig extends AllEmbedViewConfig {
277
277
  * `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl).
278
278
  *
279
279
  * Supported embed types: `AppEmbed`
280
- * @version SDK: 1.28.0 | Thoughtspot: 9.12.5.cl
280
+ * @version SDK: 1.28.0 | ThoughtSpot: 9.12.5.cl
281
281
  * @default true
282
282
  * @example
283
283
  * ```js
@@ -298,7 +298,7 @@ export interface AppViewConfig extends AllEmbedViewConfig {
298
298
  * you could set the path to `pinboard/<liveboardId>/tab/<tabId>`.
299
299
  *
300
300
  * Supported embed types: `AppEmbed`
301
- * @version SDK: 1.1.0 | Thoughtspot: 9.4.0.cl
301
+ * @version SDK: 1.1.0 | ThoughtSpot: 9.4.0.cl
302
302
  * @example
303
303
  * ```js
304
304
  * const embed = new AppEmbed('#tsEmbed', {
@@ -316,7 +316,7 @@ export interface AppViewConfig extends AllEmbedViewConfig {
316
316
  * path within the app, use the `path` attribute which is more flexible.
317
317
  *
318
318
  * Supported embed types: `AppEmbed`
319
- * @version SDK: 1.1.0 | Thoughtspot: 9.4.0.cl
319
+ * @version SDK: 1.1.0 | ThoughtSpot: 9.4.0.cl
320
320
  * @example
321
321
  * ```js
322
322
  * const embed = new AppEmbed('#tsEmbed', {
@@ -332,7 +332,7 @@ export interface AppViewConfig extends AllEmbedViewConfig {
332
332
  * tag.
333
333
  *
334
334
  * Supported embed types: `AppEmbed`
335
- * @version SDK: 1.1.0 | Thoughtspot: 9.4.0.cl
335
+ * @version SDK: 1.1.0 | ThoughtSpot: 9.4.0.cl
336
336
  * @example
337
337
  * ```js
338
338
  * const embed = new AppEmbed('#tsEmbed', {
@@ -411,7 +411,7 @@ export interface AppViewConfig extends AllEmbedViewConfig {
411
411
  *
412
412
  * Supported embed types: `AppEmbed`
413
413
  * @default false
414
- * @version SDK: 1.28.0 | Thoughtspot: 9.12.5.cl
414
+ * @version SDK: 1.28.0 | ThoughtSpot: 9.12.5.cl
415
415
  * @example
416
416
  * ```js
417
417
  * const embed = new AppEmbed('#tsEmbed', {
@@ -441,7 +441,7 @@ export interface AppViewConfig extends AllEmbedViewConfig {
441
441
  discoveryExperience?: DiscoveryExperience;
442
442
  /**
443
443
  * To set the initial state of the search bar in case of saved-answers.
444
- * @version SDK: 1.32.0 | Thoughtspot: 10.0.0.cl
444
+ * @version SDK: 1.32.0 | ThoughtSpot: 10.0.0.cl
445
445
  * @default false
446
446
  * @deprecated Use {@link collapseSearchBar} instead
447
447
  */
@@ -455,7 +455,7 @@ export interface AppViewConfig extends AllEmbedViewConfig {
455
455
  * - EXPAND_FIRST: Expand the first accordion and collapse the rest.
456
456
  *
457
457
  * Supported embed types: `AppEmbed`
458
- * @version SDK: 1.32.0 | Thoughtspot: 10.0.0.cl
458
+ * @version SDK: 1.32.0 | ThoughtSpot: 10.0.0.cl
459
459
  * @default DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL
460
460
  * @example
461
461
  * ```js
@@ -469,14 +469,14 @@ export interface AppViewConfig extends AllEmbedViewConfig {
469
469
  dataPanelCustomGroupsAccordionInitialState?: DataPanelCustomColumnGroupsAccordionState;
470
470
  /**
471
471
  * Flag that allows using `EmbedEvent.OnBeforeGetVizDataIntercept`.
472
- * @version SDK : 1.29.0 | Thoughtspot : 10.1.0.cl
472
+ * @version SDK : 1.29.0 | ThoughtSpot: 10.1.0.cl
473
473
  */
474
474
  isOnBeforeGetVizDataInterceptEnabled?: boolean;
475
475
  /**
476
476
  * Flag to use home page search bar mode
477
477
  *
478
478
  * Supported embed types: `AppEmbed`
479
- * @version SDK : 1.33.0 | Thoughtspot : 10.3.0.cl
479
+ * @version SDK : 1.33.0 | ThoughtSpot: 10.3.0.cl
480
480
  */
481
481
  homePageSearchBarMode?: HomePageSearchBarMode;
482
482
  /**
@@ -588,6 +588,7 @@ export class AppEmbed extends V1Embed {
588
588
  isUnifiedSearchExperienceEnabled = true,
589
589
  enablePendoHelp = true,
590
590
  discoveryExperience,
591
+ coverAndFilterOptionInPDF = false,
591
592
  isLiveboardStylingAndGroupingEnabled,
592
593
  } = this.viewConfig;
593
594
 
@@ -606,6 +607,7 @@ export class AppEmbed extends V1Embed {
606
607
  params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
607
608
  params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
608
609
  params[Param.IsUnifiedSearchExperienceEnabled] = isUnifiedSearchExperienceEnabled;
610
+ params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF;
609
611
 
610
612
  params = this.getBaseQueryParams(params);
611
613
 
@@ -1,10 +1,8 @@
1
- import {
2
- SpotterEmbed,
3
- SpotterEmbedViewConfig,
4
- } from './conversation';
1
+ import { SpotterEmbed, SpotterEmbedViewConfig, ConversationEmbed } from './conversation';
2
+ import { TsEmbed } from './ts-embed';
5
3
  import * as authInstance from '../auth';
6
- import { init } from '../index';
7
- import { AuthType } from '../types';
4
+ import { Action, init } from '../index';
5
+ import { AuthType, Param, RuntimeFilterOp } from '../types';
8
6
  import {
9
7
  getDocumentBody,
10
8
  getIFrameSrc,
@@ -142,4 +140,170 @@ describe('ConversationEmbed', () => {
142
140
  `http://${thoughtSpotHost}/v2/?${defaultParams}&isSpotterExperienceEnabled=true&enableDataPanelV2=true#/embed/insights/conv-assist?worksheet=worksheetId&query=searchQuery`,
143
141
  );
144
142
  });
143
+
144
+ it('should render the conversation embed with hidden actions of InConversationTraining if set', async () => {
145
+ const viewConfig: SpotterEmbedViewConfig = {
146
+ worksheetId: 'worksheetId',
147
+ searchOptions: {
148
+ searchQuery: 'searchQuery',
149
+ },
150
+ dataPanelV2: true,
151
+ hiddenActions: [Action.InConversationTraining]
152
+ };
153
+
154
+ const conversationEmbed = new SpotterEmbed(getRootEl(), viewConfig);
155
+ await conversationEmbed.render();
156
+ expectUrlMatchesWithParams(
157
+ getIFrameSrc(),
158
+ `http://${thoughtSpotHost}/v2/?${defaultParams}&hideAction=[%22${Action.ReportError}%22,%22${Action.InConversationTraining}%22]&isSpotterExperienceEnabled=true&enableDataPanelV2=true#/embed/insights/conv-assist?worksheet=worksheetId&query=searchQuery`,
159
+ );
160
+ });
161
+
162
+ it('should render the conversation embed with disabled actions of InConversationTraining if set', async () => {
163
+ const disabledReason = 'testing disabled reason';
164
+ const viewConfig: SpotterEmbedViewConfig = {
165
+ worksheetId: 'worksheetId',
166
+ searchOptions: {
167
+ searchQuery: 'searchQuery',
168
+ },
169
+ dataPanelV2: true,
170
+ disabledActions: [Action.InConversationTraining],
171
+ disabledActionReason: disabledReason,
172
+ };
173
+
174
+ const conversationEmbed = new SpotterEmbed(getRootEl(), viewConfig);
175
+ await conversationEmbed.render();
176
+ expectUrlMatchesWithParams(
177
+ getIFrameSrc(),
178
+ `http://${thoughtSpotHost}/v2/?${defaultParams}&${Param.DisableActions}=[%22${Action.InConversationTraining}%22]&${Param.DisableActionReason}=${disabledReason}&isSpotterExperienceEnabled=true&enableDataPanelV2=true#/embed/insights/conv-assist?worksheet=worksheetId&query=searchQuery`,
179
+ );
180
+ });
181
+
182
+ it('should render the conversation embed with runtime filters', async () => {
183
+ const viewConfig: SpotterEmbedViewConfig = {
184
+ worksheetId: 'worksheetId',
185
+ searchOptions: {
186
+ searchQuery: 'searchQuery',
187
+ },
188
+ runtimeFilters: [
189
+ {
190
+ columnName: 'revenue',
191
+ operator: RuntimeFilterOp.EQ,
192
+ values: [1000],
193
+ },
194
+ ],
195
+ };
196
+
197
+ const conversationEmbed = new SpotterEmbed(getRootEl(), viewConfig);
198
+ await conversationEmbed.render();
199
+ expectUrlMatchesWithParams(
200
+ getIFrameSrc(),
201
+ `http://${thoughtSpotHost}/v2/?${defaultParams}&isSpotterExperienceEnabled=true&col1=revenue&op1=EQ&val1=1000#/embed/insights/conv-assist?worksheet=worksheetId&query=searchQuery`,
202
+ );
203
+ });
204
+
205
+ it('should render the conversation embed with runtime parameters', async () => {
206
+ const viewConfig: SpotterEmbedViewConfig = {
207
+ worksheetId: 'worksheetId',
208
+ searchOptions: {
209
+ searchQuery: 'searchQuery',
210
+ },
211
+ runtimeParameters: [
212
+ {
213
+ name: 'Date Range',
214
+ value: '30',
215
+ },
216
+ ],
217
+ };
218
+
219
+ const conversationEmbed = new SpotterEmbed(getRootEl(), viewConfig);
220
+ await conversationEmbed.render();
221
+ expectUrlMatchesWithParams(
222
+ getIFrameSrc(),
223
+ `http://${thoughtSpotHost}/v2/?${defaultParams}&isSpotterExperienceEnabled=true&param1=Date%20Range&paramVal1=30#/embed/insights/conv-assist?worksheet=worksheetId&query=searchQuery`,
224
+ );
225
+ });
226
+
227
+ it('should render the conversation embed with runtime parameters excluded from URL', async () => {
228
+ const viewConfig: SpotterEmbedViewConfig = {
229
+ worksheetId: 'worksheetId',
230
+ searchOptions: {
231
+ searchQuery: 'searchQuery',
232
+ },
233
+ runtimeParameters: [
234
+ {
235
+ name: 'Date Range',
236
+ value: '30',
237
+ },
238
+ {
239
+ name: 'Region',
240
+ value: 'North America',
241
+ },
242
+ ],
243
+ excludeRuntimeParametersfromURL: true,
244
+ };
245
+
246
+ const conversationEmbed = new SpotterEmbed(getRootEl(), viewConfig);
247
+ await conversationEmbed.render();
248
+ expectUrlMatchesWithParams(
249
+ getIFrameSrc(),
250
+ `http://${thoughtSpotHost}/v2/?${defaultParams}&isSpotterExperienceEnabled=true#/embed/insights/conv-assist?worksheet=worksheetId&query=searchQuery`,
251
+ );
252
+ });
253
+
254
+ it('should render the conversation embed with both runtime filters and parameters', async () => {
255
+ const viewConfig: SpotterEmbedViewConfig = {
256
+ worksheetId: 'worksheetId',
257
+ searchOptions: {
258
+ searchQuery: 'searchQuery',
259
+ },
260
+ runtimeParameters: [
261
+ {
262
+ name: 'Date Range',
263
+ value: '30',
264
+ },
265
+ ],
266
+ runtimeFilters: [
267
+ {
268
+ columnName: 'revenue',
269
+ operator: RuntimeFilterOp.EQ,
270
+ values: [1000],
271
+ },
272
+ ],
273
+ excludeRuntimeParametersfromURL: false,
274
+ excludeRuntimeFiltersfromURL: false,
275
+ };
276
+
277
+ const conversationEmbed = new SpotterEmbed(getRootEl(), viewConfig);
278
+ await conversationEmbed.render();
279
+ expectUrlMatchesWithParams(
280
+ getIFrameSrc(),
281
+ `http://${thoughtSpotHost}/v2/?${defaultParams}&isSpotterExperienceEnabled=true&col1=revenue&op1=EQ&val1=1000&param1=Date%20Range&paramVal1=30#/embed/insights/conv-assist?worksheet=worksheetId&query=searchQuery`,
282
+ );
283
+ });
284
+
285
+ it('should ensure deprecated ConversationEmbed class maintains same functionality as SpotterEmbed', async () => {
286
+ const viewConfig: SpotterEmbedViewConfig = {
287
+ worksheetId: 'worksheetId',
288
+ searchOptions: {
289
+ searchQuery: 'searchQuery',
290
+ },
291
+ runtimeParameters: [
292
+ {
293
+ name: 'Date Range',
294
+ value: '30',
295
+ },
296
+ ],
297
+ };
298
+
299
+ // Test with deprecated class
300
+ const conversationEmbed = new ConversationEmbed(getRootEl(), viewConfig);
301
+ await conversationEmbed.render();
302
+
303
+ // Verify it generates the same URL structure as SpotterEmbed
304
+ expectUrlMatchesWithParams(
305
+ getIFrameSrc(),
306
+ `http://${thoughtSpotHost}/v2/?${defaultParams}&isSpotterExperienceEnabled=true&param1=Date%20Range&paramVal1=30#/embed/insights/conv-assist?worksheet=worksheetId&query=searchQuery`,
307
+ );
308
+ });
145
309
  });
@@ -1,10 +1,10 @@
1
1
  import isUndefined from 'lodash/isUndefined';
2
2
  import { ERROR_MESSAGE } from '../errors';
3
- import { Param, BaseViewConfig } from '../types';
3
+ import { Param, BaseViewConfig, RuntimeFilter, RuntimeParameter } from '../types';
4
4
  import { TsEmbed } from './ts-embed';
5
- import { getQueryParamString } from '../utils';
5
+ import { getQueryParamString, getFilterQuery, getRuntimeParameters } from '../utils';
6
6
 
7
- /**
7
+ /**
8
8
  * Configuration for search options
9
9
  */
10
10
  export interface SearchOptions {
@@ -20,7 +20,8 @@ export interface SearchOptions {
20
20
  */
21
21
  export interface SpotterEmbedViewConfig extends Omit<BaseViewConfig, 'primaryAction'> {
22
22
  /**
23
- * The ID of the data source object. For example, Model, View, or Table. Spotter uses this object to query data and generate Answers.
23
+ * The ID of the data source object. For example, Model, View, or Table. Spotter uses
24
+ * this object to query data and generate Answers.
24
25
  */
25
26
  worksheetId: string;
26
27
  /**
@@ -30,7 +31,7 @@ export interface SpotterEmbedViewConfig extends Omit<BaseViewConfig, 'primaryAct
30
31
  /**
31
32
  * disableSourceSelection : Disables data source selection
32
33
  * but still display the selected data source.
33
- *
34
+ *
34
35
  * Supported embed types: `SpotterEmbed`
35
36
  * @example
36
37
  * ```js
@@ -39,12 +40,12 @@ export interface SpotterEmbedViewConfig extends Omit<BaseViewConfig, 'primaryAct
39
40
  * disableSourceSelection : true,
40
41
  * })
41
42
  * ```
42
- * @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
43
+ * @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
43
44
  */
44
45
  disableSourceSelection?: boolean;
45
46
  /**
46
47
  * hideSourceSelection : Hide data source selection
47
- *
48
+ *
48
49
  * Supported embed types: `SpotterEmbed`
49
50
  * @example
50
51
  * ```js
@@ -53,12 +54,12 @@ export interface SpotterEmbedViewConfig extends Omit<BaseViewConfig, 'primaryAct
53
54
  * hideSourceSelection : true,
54
55
  * })
55
56
  * ```
56
- * @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
57
+ * @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
57
58
  */
58
59
  hideSourceSelection?: boolean;
59
60
  /**
60
61
  * Flag to control Data panel experience
61
- *
62
+ *
62
63
  * Supported embed types: `SageEmbed`, `AppEmbed`, `SearchBarEmbed`, `LiveboardEmbed`, `SearchEmbed`
63
64
  * @default false
64
65
  * @version SDK: 1.36.0 | ThoughtSpot Cloud: 10.4.0.cl
@@ -76,7 +77,7 @@ export interface SpotterEmbedViewConfig extends Omit<BaseViewConfig, 'primaryAct
76
77
  * showSpotterLimitations : show limitation text
77
78
  * of the spotter underneath the chat input.
78
79
  * default is false.
79
- *
80
+ *
80
81
  * Supported embed types: `SpotterEmbed`
81
82
  * @example
82
83
  * ```js
@@ -85,13 +86,13 @@ export interface SpotterEmbedViewConfig extends Omit<BaseViewConfig, 'primaryAct
85
86
  * showSpotterLimitations : true,
86
87
  * })
87
88
  * ```
88
- * @version SDK: 1.36.0 | Thoughtspot: 10.5.0.cl
89
+ * @version SDK: 1.36.0 | ThoughtSpot: 10.5.0.cl
89
90
  */
90
91
  showSpotterLimitations?: boolean;
91
92
  /**
92
93
  * hideSampleQuestions : Hide sample questions on
93
94
  * the initial screen of the conversation.
94
- *
95
+ *
95
96
  * Supported embed types: `SpotterEmbed`
96
97
  * @example
97
98
  * ```js
@@ -100,9 +101,66 @@ export interface SpotterEmbedViewConfig extends Omit<BaseViewConfig, 'primaryAct
100
101
  * hideSampleQuestions : true,
101
102
  * })
102
103
  * ```
103
- * @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
104
+ * @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
104
105
  */
105
106
  hideSampleQuestions?: boolean;
107
+ /**
108
+ * The list of runtime filters to apply to a search Answer,
109
+ * visualization, or Liveboard.
110
+ *
111
+ * Supported embed types: `SpotterEmbed`
112
+ * @example
113
+ * ```js
114
+ * const embed = new SpotterEmbed('#tsEmbed', {
115
+ * ... // other embed view config
116
+ * runtimeFilters: [
117
+ * {
118
+ * columnName: 'value',
119
+ * operator: RuntimeFilterOp.EQ,
120
+ * values: ['string' | 123 | true],
121
+ * },
122
+ * ],
123
+ * })
124
+ * ```
125
+ */
126
+ runtimeFilters?: RuntimeFilter[];
127
+ /**
128
+ * Flag to control whether runtime filters should be included in the URL.
129
+ * If true, filters will be passed via app initialization payload instead.
130
+ * If false/undefined, filters will be added to URL (default behavior).
131
+ *
132
+ * Supported embed types: `SpotterEmbed`
133
+ * @default false
134
+ */
135
+ excludeRuntimeFiltersfromURL?: boolean;
136
+ /**
137
+ * The list of runtime parameters to apply to the conversation.
138
+ *
139
+ * Supported embed types: `SpotterEmbed`
140
+ * @example
141
+ * ```js
142
+ * const embed = new SpotterEmbed('#tsEmbed', {
143
+ * ... // other embed view config
144
+ * runtimeParameters: [
145
+ * {
146
+ * name: 'Parameter Name',
147
+ * value: 'Parameter Value',
148
+ * },
149
+ * ],
150
+ * })
151
+ * ```
152
+ */
153
+ runtimeParameters?: RuntimeParameter[];
154
+ /**
155
+ * Flag to control whether runtime parameters should be included in the URL.
156
+ * If true, parameters will be passed via app initialization payload instead.
157
+ * If false/undefined, parameters will be added to URL (default behavior).
158
+ *
159
+ * Supported embed types: `SpotterEmbed`
160
+ * @default false
161
+ *
162
+ */
163
+ excludeRuntimeParametersfromURL?: boolean;
106
164
  }
107
165
 
108
166
  /**
@@ -144,6 +202,10 @@ export class SpotterEmbed extends TsEmbed {
144
202
  dataPanelV2,
145
203
  showSpotterLimitations,
146
204
  hideSampleQuestions,
205
+ runtimeFilters,
206
+ excludeRuntimeFiltersfromURL,
207
+ runtimeParameters,
208
+ excludeRuntimeParametersfromURL,
147
209
  } = this.viewConfig;
148
210
  const path = 'insights/conv-assist';
149
211
  if (!worksheetId) {
@@ -175,11 +237,21 @@ export class SpotterEmbed extends TsEmbed {
175
237
  if (queryParamsString) {
176
238
  query = `?${queryParamsString}`;
177
239
  }
240
+
241
+ const filterQuery = getFilterQuery(runtimeFilters || []);
242
+ if (filterQuery && !excludeRuntimeFiltersfromURL) {
243
+ query += `&${filterQuery}`;
244
+ }
245
+
246
+ const parameterQuery = getRuntimeParameters(runtimeParameters || []);
247
+ if (parameterQuery && !excludeRuntimeParametersfromURL) {
248
+ query += `&${parameterQuery}`;
249
+ }
250
+
178
251
  const tsPostHashParams = this.getThoughtSpotPostUrlParams({
179
252
  worksheet: worksheetId,
180
253
  query: searchOptions?.searchQuery || '',
181
254
  });
182
-
183
255
  return `${this.getEmbedBasePath(query)}/embed/${path}${tsPostHashParams}`;
184
256
  }
185
257
 
@@ -4,9 +4,54 @@ import { EmbedConfig } from '../types';
4
4
  const configKey = 'embedConfig';
5
5
 
6
6
  /**
7
- * Gets the configuration embed was initialized with.
8
- * @returns {@link EmbedConfig} The configuration embed was initialized with.
9
- * @version SDK: 1.19.0 | ThoughtSpot: *
7
+ * Gets the embed configuration settings that were used to
8
+ * initialize the SDK.
9
+ * @returns {@link EmbedConfig}
10
+ *
11
+ * @example
12
+ * ```js
13
+ * import { getInitConfig } from '@thoughtspot/visual-embed-sdk';
14
+ * // Call the getInitConfig method to retrieve the embed configuration
15
+ * const config = getInitConfig();
16
+ * // Log the configuration settings
17
+ * console.log(config);
18
+ * ```
19
+ * Returns the link:https://developers.thoughtspot.com/docs/Interface_EmbedConfig[EmbedConfig]
20
+ * object, which contains the configuration settings used to
21
+ * initialize the SDK, including the following:
22
+ *
23
+ * - `thoughtSpotHost` - ThoughtSpot host URL
24
+ * - `authType`: The authentication method used. For example,
25
+ * `AuthServerCookieless` for `AuthType.TrustedAuthTokenCookieless`
26
+ * - `customizations` - Style, text, and icon customization settings
27
+ * that were applied during the SDK initialization.
28
+ *
29
+ * The following JSON output shows the embed configuration
30
+ * settings returned from the code in the previous example:
31
+ *
32
+ * @example
33
+ * ```json
34
+ * {
35
+ * "thoughtSpotHost": "https://{ThoughtSpot-Host}",
36
+ * "authType": "AuthServerCookieless",
37
+ * "customizations": {
38
+ * "style": {
39
+ * "customCSS": {
40
+ * "variables": {
41
+ * "--ts-var-button--secondary-background": "#7492d5",
42
+ * "--ts-var-button--secondary--hovers-background": "#aac2f8",
43
+ * "--ts-var-root-background": "#f1f4f8"
44
+ * }
45
+ * }
46
+ * }
47
+ * },
48
+ * "loginFailedMessage": "Login failed, please try again",
49
+ * "authTriggerText": "Authorize",
50
+ * "disableTokenVerification": true,
51
+ * "authTriggerContainer": "#your-own-div"
52
+ * }
53
+ * ```
54
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw, and later
10
55
  * @group Global methods
11
56
  */
12
57
  export const getEmbedConfig = (): EmbedConfig => getValueFromWindow(configKey) || ({} as any);
@@ -15,10 +60,10 @@ export const getEmbedConfig = (): EmbedConfig => getValueFromWindow(configKey) |
15
60
  * Sets the configuration embed was initialized with.
16
61
  * And returns the new configuration.
17
62
  * @param newConfig The configuration to set.
18
- * @version SDK: 1.27.0 | ThoughtSpot: *
63
+ * @version SDK: 1.27.0 | ThoughtSpot: 9.8.0.cl, 9.8.1.sw, and later
19
64
  * @group Global methods
20
65
  */
21
66
  export const setEmbedConfig = (newConfig: EmbedConfig) => {
22
67
  storeValueInWindow(configKey, newConfig);
23
68
  return getValueFromWindow(configKey);
24
- };
69
+ };
@@ -347,7 +347,7 @@ describe('Liveboard/viz embed tests', () => {
347
347
  await executeAfterWait(() => {
348
348
  expectUrlMatchesWithParams(
349
349
  getIFrameSrc(),
350
- `http://${thoughtSpotHost}/?embedApp=true${defaultParams}&coverAndFilterOptionInPDF=true${prefixParams}#/embed/viz/${liveboardId}`,
350
+ `http://${thoughtSpotHost}/?embedApp=true${defaultParams}&arePdfCoverFilterPageCheckboxesEnabled=true${prefixParams}#/embed/viz/${liveboardId}`,
351
351
  );
352
352
  });
353
353
  });
@@ -362,7 +362,7 @@ describe('Liveboard/viz embed tests', () => {
362
362
  await executeAfterWait(() => {
363
363
  expectUrlMatchesWithParams(
364
364
  getIFrameSrc(),
365
- `http://${thoughtSpotHost}/?embedApp=true${defaultParams}&coverAndFilterOptionInPDF=false&${prefixParams}#/embed/viz/${liveboardId}`,
365
+ `http://${thoughtSpotHost}/?embedApp=true${defaultParams}&arePdfCoverFilterPageCheckboxesEnabled=false&${prefixParams}#/embed/viz/${liveboardId}`,
366
366
  );
367
367
  });
368
368
  });
@@ -770,8 +770,9 @@ describe('Liveboard/viz embed tests', () => {
770
770
  });
771
771
 
772
772
  let resizeObserverCb: any;
773
- (window as any).ResizeObserver = window.ResizeObserver
774
- || jest.fn().mockImplementation((resizeObserverCbParam: any) => {
773
+ (window as any).ResizeObserver =
774
+ window.ResizeObserver ||
775
+ jest.fn().mockImplementation((resizeObserverCbParam: any) => {
775
776
  resizeObserverCb = resizeObserverCbParam;
776
777
  return {
777
778
  disconnect: jest.fn(),
@@ -192,7 +192,7 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
192
192
  * Show or hide the tab panel of the embedded Liveboard.
193
193
  *
194
194
  * Supported embed types: `LiveboardEmbed`
195
- * @version SDK: 1.25.0 | Thoughtspot: 9.6.0.cl, 9.8.0.sw
195
+ * @version SDK: 1.25.0 | ThoughtSpot: 9.6.0.cl, 9.8.0.sw
196
196
  * @example
197
197
  * ```js
198
198
  * const embed = new LiveboardEmbed('#tsEmbed', {
@@ -269,24 +269,6 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
269
269
  * })
270
270
  */
271
271
  dataSourceId?: string;
272
-
273
- /**
274
- * This flag is for show/hide checkboxes for include or exclude
275
- * cover page and filters in the Liveboard PDF.
276
- *
277
- * Supported embed types: `LiveboardEmbed`
278
- * @version SDK: 1.37.0 | ThoughtSpot:10.8.0.cl
279
- * @default true
280
- * Supported embed types: `LiveboardEmbed`
281
- * @example
282
- * ```js
283
- * const embed = new LiveboardEmbed('#tsEmbed', {
284
- * ... //other embed view config
285
- * coverAndFilterOptionInPDF: false,
286
- * })
287
- * ```
288
- */
289
- coverAndFilterOptionInPDF?: boolean;
290
272
  /**
291
273
  * The list of tab IDs to hide from the embedded.
292
274
  * This Tabs will be hidden from their respective LBs.
@@ -411,7 +393,7 @@ export class LiveboardEmbed extends V1Embed {
411
393
  oAuthPollingInterval,
412
394
  isForceRedirect,
413
395
  dataSourceId,
414
- coverAndFilterOptionInPDF,
396
+ coverAndFilterOptionInPDF = false,
415
397
  isLiveboardStylingAndGroupingEnabled,
416
398
  } = this.viewConfig;
417
399
 
@@ -471,9 +453,6 @@ export class LiveboardEmbed extends V1Embed {
471
453
  params[Param.DataSourceId] = dataSourceId;
472
454
  }
473
455
 
474
- if (coverAndFilterOptionInPDF !== undefined) {
475
- params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
476
- }
477
456
 
478
457
  if (isLiveboardStylingAndGroupingEnabled !== undefined) {
479
458
  params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
@@ -486,6 +465,7 @@ export class LiveboardEmbed extends V1Embed {
486
465
  params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
487
466
  params[Param.DataPanelV2Enabled] = dataPanelV2;
488
467
  params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
468
+ params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
489
469
  const queryParams = getQueryParamString(params, true);
490
470
 
491
471
  return queryParams;
@@ -674,7 +654,7 @@ export class LiveboardEmbed extends V1Embed {
674
654
 
675
655
  /**
676
656
  * Returns the full url of the Liveboard/visualization which can be used to open
677
- * this Liveboard inside the full Thoughtspot application in a new tab.
657
+ * this Liveboard inside the full ThoughtSpot application in a new tab.
678
658
  * @returns url string
679
659
  */
680
660
  public getLiveboardUrl(): string {