@thoughtspot/visual-embed-sdk 1.6.0-alpha.2 → 1.6.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.
Files changed (56) hide show
  1. package/dist/src/auth.d.ts +2 -4
  2. package/dist/src/embed/app.d.ts +9 -2
  3. package/dist/src/embed/liveboard.d.ts +19 -19
  4. package/dist/src/embed/liveboard.spec.d.ts +1 -0
  5. package/dist/src/embed/search.d.ts +4 -0
  6. package/dist/src/embed/ts-embed.d.ts +2 -11
  7. package/dist/src/types.d.ts +24 -24
  8. package/dist/tsembed.es.js +82 -68
  9. package/dist/tsembed.js +81 -67
  10. package/lib/package.json +5 -1
  11. package/lib/src/auth.d.ts +2 -4
  12. package/lib/src/auth.js +25 -7
  13. package/lib/src/auth.js.map +1 -1
  14. package/lib/src/embed/app.d.ts +9 -2
  15. package/lib/src/embed/app.js +18 -1
  16. package/lib/src/embed/app.js.map +1 -1
  17. package/lib/src/embed/app.spec.js +31 -0
  18. package/lib/src/embed/app.spec.js.map +1 -1
  19. package/lib/src/embed/events.spec.js +55 -2
  20. package/lib/src/embed/events.spec.js.map +1 -1
  21. package/lib/src/embed/liveboard.d.ts +19 -19
  22. package/lib/src/embed/liveboard.js +12 -13
  23. package/lib/src/embed/liveboard.js.map +1 -1
  24. package/lib/src/embed/liveboard.spec.d.ts +1 -0
  25. package/lib/src/embed/liveboard.spec.js +159 -0
  26. package/lib/src/embed/liveboard.spec.js.map +1 -0
  27. package/lib/src/embed/search.d.ts +4 -0
  28. package/lib/src/embed/search.js +1 -1
  29. package/lib/src/embed/search.js.map +1 -1
  30. package/lib/src/embed/ts-embed.d.ts +2 -11
  31. package/lib/src/embed/ts-embed.js +4 -23
  32. package/lib/src/embed/ts-embed.js.map +1 -1
  33. package/lib/src/embed/ts-embed.spec.js +63 -6
  34. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  35. package/lib/src/types.d.ts +24 -24
  36. package/lib/src/types.js +21 -22
  37. package/lib/src/types.js.map +1 -1
  38. package/lib/src/visual-embed-sdk.d.ts +51 -49
  39. package/package.json +5 -1
  40. package/src/auth.ts +35 -7
  41. package/src/embed/app.spec.ts +40 -0
  42. package/src/embed/app.ts +21 -2
  43. package/src/embed/events.spec.ts +60 -1
  44. package/src/embed/liveboard.spec.ts +199 -0
  45. package/src/embed/liveboard.ts +21 -24
  46. package/src/embed/search.ts +5 -0
  47. package/src/embed/ts-embed.spec.ts +78 -5
  48. package/src/embed/ts-embed.ts +6 -25
  49. package/src/types.ts +24 -24
  50. package/dist/src/embed/pinboard.d.ts +0 -85
  51. package/lib/src/embed/pinboard.d.ts +0 -85
  52. package/lib/src/embed/pinboard.js +0 -107
  53. package/lib/src/embed/pinboard.js.map +0 -1
  54. package/lib/src/utils/fetchAnswers.d.ts +0 -3
  55. package/lib/src/utils/fetchAnswers.js +0 -49
  56. package/lib/src/utils/fetchAnswers.js.map +0 -1
@@ -7,6 +7,7 @@ export declare const SSO_REDIRECTION_MARKER_GUID = "5e16222e-ef02-43e9-9fbd-2422
7
7
  export declare const EndPoints: {
8
8
  AUTH_VERIFICATION: string;
9
9
  SSO_LOGIN_TEMPLATE: (targetUrl: string) => string;
10
+ IODC_LOGIN_TEMPLATE: (targetUrl: string) => string;
10
11
  TOKEN_LOGIN: string;
11
12
  BASIC_LOGIN: string;
12
13
  };
@@ -29,11 +30,8 @@ export declare const doTokenAuth: (embedConfig: EmbedConfig) => Promise<void>;
29
30
  * @param embedConfig The embed configuration
30
31
  */
31
32
  export declare const doBasicAuth: (embedConfig: EmbedConfig) => Promise<void>;
32
- /**
33
- * Perform SAML authentication
34
- * @param embedConfig The embed configuration
35
- */
36
33
  export declare const doSamlAuth: (embedConfig: EmbedConfig) => Promise<void>;
34
+ export declare const doIODCAuth: (embedConfig: EmbedConfig) => Promise<void>;
37
35
  /**
38
36
  * Perform authentication on the ThoughtSpot cluster
39
37
  * @param embedConfig The embed configuration
@@ -67,7 +67,7 @@ export interface AppViewConfig extends ViewConfig {
67
67
  pageId?: Page;
68
68
  /**
69
69
  * This puts a filter tag on the application. All metadata lists in the application, such as
70
- * liveboards and answers, would be filtered by this tag.
70
+ * Liveboards and answers, would be filtered by this tag.
71
71
  */
72
72
  tag?: string;
73
73
  /**
@@ -84,7 +84,7 @@ export declare class AppEmbed extends V1Embed {
84
84
  constructor(domSelector: DOMSelector, viewConfig: AppViewConfig);
85
85
  /**
86
86
  * Constructs a map of parameters to be passed on to the
87
- * embedded liveboard or visualization.
87
+ * embedded Liveboard or visualization.
88
88
  */
89
89
  private getEmbedParams;
90
90
  /**
@@ -103,6 +103,13 @@ export declare class AppEmbed extends V1Embed {
103
103
  * @returns The URL path that the embedded app understands.
104
104
  */
105
105
  private formatPath;
106
+ /**
107
+ * Navigate to particular page for app embed. eg:answers/pinboards/home
108
+ * This is used for embedding answers, pinboards, visualizations and full application only.
109
+ * @param path The string, set to iframe src and navigate to new page
110
+ * eg: appEmbed.navigateToPage('pinboards')
111
+ */
112
+ navigateToPage(path: string): void;
106
113
  /**
107
114
  * Renders the embedded application pages in the ThoughtSpot app.
108
115
  * @param renderOptions An object containing the page ID
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Copyright (c) 2021
3
3
  *
4
- * Embed a ThoughtSpot liveboard or visualization
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
  *
@@ -11,21 +11,21 @@
11
11
  import { DOMSelector } from '../types';
12
12
  import { V1Embed, ViewConfig } from './ts-embed';
13
13
  /**
14
- * The configuration for the embedded liveboard or visualization page view.
14
+ * The configuration for the embedded Liveboard or visualization page view.
15
15
  * @Category Liveboards and Charts
16
16
  */
17
17
  export interface LiveboardViewConfig extends ViewConfig {
18
18
  /**
19
19
  * If set to true, the embedded object container dynamically resizes
20
- * according to the height of the liveboard.
20
+ * according to the height of the Liveboard.
21
21
  */
22
22
  fullHeight?: boolean;
23
23
  /**
24
- * This is the minimum height(in pixels) for a full height liveboard.
25
- * Setting this height helps resolves issues with empty liveboards and
26
- * other screens navigable from a liveboard.
24
+ * This is the minimum height(in pixels) for a full height Liveboard.
25
+ * Setting this height helps resolves issues with empty Liveboards and
26
+ * other screens navigable from a Liveboard.
27
+ * *_since 1.5.0_
27
28
  * @default 500
28
- * * _since 1.5.0_
29
29
  */
30
30
  defaultHeight?: number;
31
31
  /**
@@ -33,7 +33,7 @@ export interface LiveboardViewConfig extends ViewConfig {
33
33
  */
34
34
  enableVizTransformations?: boolean;
35
35
  /**
36
- * The liveboard to display in the embedded view.
36
+ * The Liveboard to display in the embedded view.
37
37
  * Use either of liveboardId or pinboardId to reference the Liveboard to embed.
38
38
  */
39
39
  liveboardId?: string;
@@ -43,12 +43,12 @@ export interface LiveboardViewConfig extends ViewConfig {
43
43
  */
44
44
  pinboardId?: string;
45
45
  /**
46
- * The visualization within the liveboard to display.
46
+ * The visualization within the Liveboard to display.
47
47
  */
48
48
  vizId?: string;
49
49
  /**
50
50
  * If set to true, all filter chips from a
51
- * liveboard page will be read-only (no X buttons)
51
+ * Liveboard page will be read-only (no X buttons)
52
52
  */
53
53
  preventLiveboardFilterRemoval?: boolean;
54
54
  /**
@@ -58,7 +58,7 @@ export interface LiveboardViewConfig extends ViewConfig {
58
58
  preventPinboardFilterRemoval?: boolean;
59
59
  }
60
60
  /**
61
- * Embed a ThoughtSpot liveboard or visualization
61
+ * Embed a ThoughtSpot Liveboard or visualization
62
62
  * @Category Liveboards and Charts
63
63
  */
64
64
  export declare class LiveboardEmbed extends V1Embed {
@@ -67,16 +67,16 @@ export declare class LiveboardEmbed extends V1Embed {
67
67
  constructor(domSelector: DOMSelector, viewConfig: LiveboardViewConfig);
68
68
  /**
69
69
  * Construct a map of params to be passed on to the
70
- * embedded liveboard or visualization.
70
+ * embedded Liveboard or visualization.
71
71
  */
72
72
  private getEmbedParams;
73
73
  /**
74
- * Construct the URL of the embedded ThoughtSpot liveboard or visualization
74
+ * Construct the URL of the embedded ThoughtSpot Liveboard or visualization
75
75
  * to be loaded within the iframe.
76
- * @param liveboardId The GUID of the liveboard.
77
- * @param vizId The optional GUID of a visualization within the liveboard.
76
+ * @param liveboardId The GUID of the Liveboard.
77
+ * @param vizId The optional GUID of a visualization within the Liveboard.
78
78
  * @param runtimeFilters A list of runtime filters to be applied to
79
- * the liveboard or visualization on load.
79
+ * the Liveboard or visualization on load.
80
80
  */
81
81
  private getIFrameSrc;
82
82
  /**
@@ -86,10 +86,10 @@ export declare class LiveboardEmbed extends V1Embed {
86
86
  */
87
87
  private updateIFrameHeight;
88
88
  private embedIframeCenter;
89
- private handleRouteChangeFullHeightLiveboard;
89
+ private setIframeHeightForNonEmbedLiveboard;
90
90
  /**
91
- * Render an embedded ThoughtSpot liveboard or visualization
92
- * @param renderOptions An object specifying the liveboard ID,
91
+ * Render an embedded ThoughtSpot Liveboard or visualization
92
+ * @param renderOptions An object specifying the Liveboard ID,
93
93
  * visualization ID and the runtime filters.
94
94
  */
95
95
  render(): LiveboardEmbed;
@@ -0,0 +1 @@
1
+ export {};
@@ -44,6 +44,10 @@ export interface SearchViewConfig extends ViewConfig {
44
44
  * using raw answer data.
45
45
  */
46
46
  hideResults?: boolean;
47
+ /**
48
+ * If set to true, expands all the data sources panel.
49
+ */
50
+ expandAllDataSource?: boolean;
47
51
  /**
48
52
  * If set to true, the Search Assist feature is enabled.
49
53
  */
@@ -64,7 +64,7 @@ export interface ViewConfig {
64
64
  visibleActions?: Action[];
65
65
  /**
66
66
  * The list of runtime filters to apply to a search answer,
67
- * visualization, or liveboard.
67
+ * visualization, or Liveboard.
68
68
  */
69
69
  runtimeFilters?: RuntimeFilter[];
70
70
  }
@@ -162,7 +162,7 @@ export declare class TsEmbed {
162
162
  protected getBaseQueryParams(): {};
163
163
  /**
164
164
  * Constructs the base URL string to load v1 of the ThoughtSpot app.
165
- * This is used for embedding liveboards, visualizations, and full application.
165
+ * This is used for embedding Liveboards, visualizations, and full application.
166
166
  * @param queryString The query string to append to the URL.
167
167
  * @param isAppEmbed A Boolean parameter to specify if you are embedding
168
168
  * the full application.
@@ -221,15 +221,6 @@ export declare class TsEmbed {
221
221
  * @param callback A callback function
222
222
  */
223
223
  on(messageType: EmbedEvent, callback: MessageCallback): typeof TsEmbed.prototype;
224
- /**
225
- * Navigates users to the specified application page.
226
- * Use this method to navigate users from the embedded
227
- * ThoughtSpot context to a specific page in your app.
228
- * @param path The page path string.
229
- * For example, to navigate users to a liveboard page,
230
- * define the method as navigateToPage('liveboard/&lt;liveboardId&gt;').
231
- */
232
- navigateToPage(path: string): void;
233
224
  /**
234
225
  * Triggers an event on specific Port registered against
235
226
  * for the EmbedEvent
@@ -19,6 +19,10 @@ export declare enum AuthType {
19
19
  * SSO using SAML
20
20
  */
21
21
  SSO = "SSO_SAML",
22
+ /**
23
+ * SSO using IODC
24
+ */
25
+ IODC = "SSO_IODC",
22
26
  /**
23
27
  * Trusted authentication server
24
28
  */
@@ -112,12 +116,13 @@ export interface EmbedConfig {
112
116
  * When there are multiple embeds, queue the render of embed to start
113
117
  * after the previous embed's render is complete. This helps in the load performance
114
118
  * by decreasing the load on the browser.
119
+ * @version 1.5.0 or later
115
120
  * @default false
116
121
  */
117
122
  queueMultiRenders?: boolean;
118
123
  /**
119
124
  * Dynamic CSS Url to be injected in the loaded application.
120
- * _Since: 1.6.0_
125
+ * @version 1.6.0 or later
121
126
  * @default ''
122
127
  */
123
128
  customCssUrl?: string;
@@ -193,7 +198,7 @@ export declare enum RuntimeFilterOp {
193
198
  IN = "IN"
194
199
  }
195
200
  /**
196
- * A filter that can be applied to ThoughtSpot answers, liveboards, or
201
+ * A filter that can be applied to ThoughtSpot answers, Liveboards, or
197
202
  * visualizations at runtime.
198
203
  */
199
204
  export interface RuntimeFilter {
@@ -231,12 +236,12 @@ export declare enum EmbedEvent {
231
236
  */
232
237
  Load = "load",
233
238
  /**
234
- * Data pertaining to answer or liveboard is received
235
- * @return data - The answer or liveboard data
239
+ * Data pertaining to answer or Liveboard is received
240
+ * @return data - The answer or Liveboard data
236
241
  */
237
242
  Data = "data",
238
243
  /**
239
- * Search/answer/liveboard filters have been applied/updated
244
+ * Search/answer/Liveboard filters have been applied/updated
240
245
  * @hidden
241
246
  */
242
247
  FiltersChanged = "filtersChanged",
@@ -259,13 +264,13 @@ export declare enum EmbedEvent {
259
264
  /**
260
265
  * A custom action has been triggered
261
266
  * @return actionId - The id of the custom action
262
- * @return data - The answer or liveboard data
267
+ * @return data - The answer or Liveboard data
263
268
  */
264
269
  CustomAction = "customAction",
265
270
  /**
266
271
  * A double click has been triggered on table/chart
267
272
  * @return ContextMenuInputPoints - data point that is double clicked
268
- * * _since: 1.5.0_
273
+ * @version 1.5.0 or later
269
274
  */
270
275
  VizPointDoubleClick = "vizPointDoubleClick",
271
276
  /**
@@ -283,8 +288,8 @@ export declare enum EmbedEvent {
283
288
  */
284
289
  AuthExpire = "ThoughtspotAuthExpired",
285
290
  /**
286
- * The height of the embedded liveboard or visualization has been computed.
287
- * @return data - The height of the embedded liveboard or visualization
291
+ * The height of the embedded Liveboard or visualization has been computed.
292
+ * @return data - The height of the embedded Liveboard or visualization
288
293
  * @hidden
289
294
  */
290
295
  EmbedHeight = "EMBED_HEIGHT",
@@ -296,7 +301,6 @@ export declare enum EmbedEvent {
296
301
  EmbedIframeCenter = "EmbedIframeCenter",
297
302
  /**
298
303
  * Detects the route change.
299
- * @hidden
300
304
  */
301
305
  RouteChange = "ROUTE_CHANGE",
302
306
  /**
@@ -308,7 +312,7 @@ export declare enum EmbedEvent {
308
312
  * Emitted when the embed does not have cookie access. This
309
313
  * happens on Safari where third-party cookies are blocked by default.
310
314
  *
311
- * @version 1.1.0
315
+ * @version 1.1.0 or later
312
316
  */
313
317
  NoCookieAccess = "noCookieAccess",
314
318
  /**
@@ -319,12 +323,12 @@ export declare enum EmbedEvent {
319
323
  SAMLComplete = "samlComplete",
320
324
  /**
321
325
  * Emitted when any modal is opened in the app
322
- * * _since: 1.6.0_
326
+ * @version 1.6.0 or later
323
327
  */
324
328
  DialogOpen = "dialog-open",
325
329
  /**
326
330
  * Emitted when any modal is closed in the app
327
- * * _since: 1.6.0_
331
+ * @version 1.6.0 or later
328
332
  */
329
333
  DialogClose = "dialog-close"
330
334
  }
@@ -345,7 +349,7 @@ export declare enum HostEvent {
345
349
  * eg. { selectedPoints: []}
346
350
  * @param columnGuid - a string guid of the column to drill by. This is optional,
347
351
  * if not provided it will auto drill by the configured column. \
348
- * * _since: 1.5.0_
352
+ * @version 1.5.0 or later
349
353
  */
350
354
  DrillDown = "triggerDrillDown",
351
355
  /**
@@ -359,10 +363,10 @@ export declare enum HostEvent {
359
363
  */
360
364
  Reload = "reload",
361
365
  /**
362
- * Set the visible Vizs on a pinboard/liveboard.
363
- * @param - an array of ids of vizs to show, the ids not passed
366
+ * Set the visible visualizations on a Liveboard.
367
+ * @param - an array of ids of visualizations to show, the ids not passed
364
368
  * will be hidden.
365
- * _since: 1.6.0_
369
+ * @version 1.6.0 or later
366
370
  */
367
371
  SetVisibleVizs = "SetPinboardVisibleVizs"
368
372
  }
@@ -391,6 +395,7 @@ export declare enum DataSourceVisualMode {
391
395
  export declare enum Param {
392
396
  DataSources = "dataSources",
393
397
  DataSourceMode = "dataSourceMode",
398
+ ExpandAllDataSource = "expandAllDataSource",
394
399
  DisableActions = "disableAction",
395
400
  DisableActionReason = "disableHint",
396
401
  ForceTable = "forceTable",
@@ -416,7 +421,7 @@ export declare enum Param {
416
421
  }
417
422
  /**
418
423
  * The list of actions that can be performed on visual ThoughtSpot
419
- * entities, such as answers and liveboards.
424
+ * entities, such as answers and Liveboards.
420
425
  */
421
426
  export declare enum Action {
422
427
  Save = "save",
@@ -426,11 +431,6 @@ export declare enum Action {
426
431
  MakeACopy = "makeACopy",
427
432
  EditACopy = "editACopy",
428
433
  CopyLink = "embedDocument",
429
- /**
430
- * @hidden
431
- */
432
- PinboardSnapshot = "pinboardSnapshot",
433
- LiveboardSnapshot = "liveboardSnapshot",
434
434
  ResetLayout = "resetLayout",
435
435
  Schedule = "schedule",
436
436
  SchedulesList = "schedule-list",
@@ -467,7 +467,7 @@ export declare enum Action {
467
467
  * @hidden
468
468
  */
469
469
  PinboardInfo = "pinboardInfo",
470
- LiveboardInfo = "liveboardInfo",
470
+ LiveboardInfo = "pinboardInfo",
471
471
  SendAnswerFeedback = "sendFeedback",
472
472
  /**
473
473
  * @deprecated Will be removed in next version