@thoughtspot/visual-embed-sdk 1.14.0-alpha.0 → 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/CHANGELOG.md +7 -5
  2. package/dist/src/embed/app.d.ts +4 -3
  3. package/dist/src/embed/base.d.ts +1 -1
  4. package/dist/src/embed/liveboard.d.ts +6 -8
  5. package/dist/src/embed/pinboard.d.ts +91 -0
  6. package/dist/src/embed/search.d.ts +5 -1
  7. package/dist/src/embed/ts-embed.d.ts +4 -4
  8. package/dist/src/types.d.ts +83 -76
  9. package/dist/src/utils/authService.d.ts +1 -0
  10. package/dist/src/utils/plugin.d.ts +0 -0
  11. package/dist/src/v1/api.d.ts +19 -0
  12. package/dist/tsembed.es.js +98 -73
  13. package/dist/tsembed.js +98 -73
  14. package/lib/package.json +1 -1
  15. package/lib/src/auth.js +8 -2
  16. package/lib/src/auth.js.map +1 -1
  17. package/lib/src/auth.spec.js +18 -0
  18. package/lib/src/auth.spec.js.map +1 -1
  19. package/lib/src/embed/app.d.ts +4 -3
  20. package/lib/src/embed/app.js +2 -1
  21. package/lib/src/embed/app.js.map +1 -1
  22. package/lib/src/embed/base.d.ts +1 -1
  23. package/lib/src/embed/base.js +1 -1
  24. package/lib/src/embed/liveboard.d.ts +6 -8
  25. package/lib/src/embed/liveboard.js.map +1 -1
  26. package/lib/src/embed/pinboard.d.ts +91 -0
  27. package/lib/src/embed/pinboard.js +110 -0
  28. package/lib/src/embed/pinboard.js.map +1 -0
  29. package/lib/src/embed/search.d.ts +5 -1
  30. package/lib/src/embed/search.js +1 -1
  31. package/lib/src/embed/search.js.map +1 -1
  32. package/lib/src/embed/ts-embed.d.ts +4 -4
  33. package/lib/src/types.d.ts +83 -76
  34. package/lib/src/types.js +73 -68
  35. package/lib/src/types.js.map +1 -1
  36. package/lib/src/utils/authService.d.ts +1 -0
  37. package/lib/src/utils/authService.js +13 -0
  38. package/lib/src/utils/authService.js.map +1 -1
  39. package/lib/src/utils/authService.spec.js +15 -1
  40. package/lib/src/utils/authService.spec.js.map +1 -1
  41. package/lib/src/utils/plugin.d.ts +0 -0
  42. package/lib/src/utils/plugin.js +1 -0
  43. package/lib/src/utils/plugin.js.map +1 -0
  44. package/lib/src/visual-embed-sdk.d.ts +103 -93
  45. package/package.json +1 -1
  46. package/src/auth.spec.ts +39 -0
  47. package/src/auth.ts +11 -5
  48. package/src/embed/app.ts +4 -3
  49. package/src/embed/base.ts +1 -1
  50. package/src/embed/liveboard.ts +6 -8
  51. package/src/embed/search.ts +6 -1
  52. package/src/embed/ts-embed.ts +4 -4
  53. package/src/types.ts +84 -76
  54. package/src/utils/authService.spec.ts +21 -0
  55. package/src/utils/authService.ts +20 -0
package/CHANGELOG.md CHANGED
@@ -6,12 +6,10 @@ This project follows Semantic Versioning.
6
6
  ## Unreleased
7
7
 
8
8
  ### New Features
9
- - Set of new Host events to drive interactions on the embed programmatically
10
-
9
+ - Set of new Host events to drive interactions on the embed programatically
11
10
  ## 1.13.0 (07-19-2022)
12
11
  - Release to support TS version 8.5.0.cl
13
12
  - Please check the full list of changes [here](https://developers.thoughtspot.com/docs/?pageid=embed-sdk-changelog)
14
-
15
13
  ## 1.12.1 (06-21-2022)
16
14
  ### Fixed
17
15
  - Search embed beta warning check for TS cloud releases
@@ -23,6 +21,10 @@ This project follows Semantic Versioning.
23
21
  ### Fixed
24
22
  - Typescript build that was affecting some Angular project configurations
25
23
 
24
+ ## 1.11.2 (06-10-2022)
25
+ ### Fixed
26
+ - Typescript build that was affecting some Angular project configurations
27
+
26
28
  ## 1.11.1 (05-30-2022)
27
29
  ### Fixed
28
30
  - Whitelabeling - new [action](https://developers.thoughtspot.com/docs/typedoc/enums/Action.html#ReportError) for the ability to turn off TS specific error reporting by end users.
@@ -71,12 +73,12 @@ This project follows Semantic Versioning.
71
73
 
72
74
  ## 1.9.3 (03-22-2022)
73
75
 
74
- ### New Features
76
+ ### New Features
75
77
  - `disableLoginRedirect` option in `EmbedConfig`
76
78
 
77
79
  ## 1.9.2 (03-17-2022)
78
80
 
79
- ### New Features
81
+ ### New Features
80
82
  - Ability to trigger events on React components
81
83
  - Added new `useEmbedRef` hook, check README for usage.
82
84
 
@@ -82,13 +82,13 @@ export interface AppViewConfig extends ViewConfig {
82
82
  * Render liveboards using the new v2 rendering mode
83
83
  * This is a transient flag which is primarily meant for internal use
84
84
  * @default false
85
- * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
85
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
86
86
  * @hidden
87
87
  */
88
88
  liveboardV2?: boolean;
89
89
  /**
90
90
  * If set to true, the Search Assist feature is enabled.
91
- * @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl
91
+ * @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl, 8.8.1-sw
92
92
  */
93
93
  enableSearchAssist?: boolean;
94
94
  }
@@ -126,7 +126,8 @@ export declare class AppEmbed extends V1Embed {
126
126
  * @param path string | number The string, set to iframe src and navigate to new page
127
127
  * eg: appEmbed.navigateToPage('pinboards')
128
128
  * When used with `noReload` this can also be a number like 1/-1 to go forward/back.
129
- * @param noReload boolean Trigger the navigation without reloading the page (version: 1.12.0 | 8.4.0.cl)
129
+ * @param noReload boolean Trigger the navigation without reloading the page
130
+ * @version SDK: 1.12.0 | ThoughtSpot: 8.4.0.cl, 8.4.1-sw
130
131
  */
131
132
  navigateToPage(path: string | number, noReload?: boolean): void;
132
133
  /**
@@ -47,7 +47,7 @@ export declare function disableAutoLogin(): void;
47
47
  *
48
48
  * @param doNotDisableAutoLogin This flag when passed will not disable autoLogin
49
49
  * @returns Promise which resolves when logout completes.
50
- * @version SDK: 1.10.1 | ThoughtSpot: *
50
+ * @version SDK: 1.10.1 | ThoughtSpot: 8.2.0.cl, 8.4.1-sw
51
51
  */
52
52
  export declare const logout: (doNotDisableAutoLogin?: boolean) => Promise<boolean>;
53
53
  /**
@@ -24,7 +24,7 @@ export interface LiveboardViewConfig extends ViewConfig {
24
24
  * This is the minimum height(in pixels) for a full height Liveboard.
25
25
  * Setting this height helps resolves issues with empty Liveboards and
26
26
  * other screens navigable from a Liveboard.
27
- * @version 1.5.0 or later
27
+ * @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
28
28
  * @default 500
29
29
  */
30
30
  defaultHeight?: number;
@@ -38,7 +38,7 @@ export interface LiveboardViewConfig extends ViewConfig {
38
38
  */
39
39
  liveboardId?: string;
40
40
  /**
41
- * To support backward compatibilty
41
+ * To support backward compatibility
42
42
  * @hidden
43
43
  */
44
44
  pinboardId?: string;
@@ -55,7 +55,7 @@ export interface LiveboardViewConfig extends ViewConfig {
55
55
  * Array of viz ids which should be visible when the liveboard
56
56
  * first renders. This can be changed by triggering the "SetVisibleVizs"
57
57
  * event.
58
- * @version 1.9.1 or later
58
+ * @version SDK: 1.9.1 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
59
59
  */
60
60
  visibleVizs?: string[];
61
61
  /**
@@ -64,16 +64,14 @@ export interface LiveboardViewConfig extends ViewConfig {
64
64
  */
65
65
  preventPinboardFilterRemoval?: boolean;
66
66
  /**
67
- * Render embedded liveboards and visualizations using the new v2 rendering mode
68
- * This is a transient flag which is primarily meant for internal use
67
+ * Render embedded Liveboards and visualizations in the new Liveboard experience mode
69
68
  * @default false
70
- * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
71
- * @hidden
69
+ * @version SDK: 1.14.0 | ThoughtSpot: 8.6.0.cl, 8.8.1-sw
72
70
  */
73
71
  liveboardV2?: boolean;
74
72
  /**
75
73
  * Tab Id of the Liveboard that is supposed to be active
76
- * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
74
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
77
75
  */
78
76
  activeTabId?: string;
79
77
  }
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Copyright (c) 2021
3
+ *
4
+ * Embed a ThoughtSpot pinboard or visualization
5
+ * https://developers.thoughtspot.com/docs/?pageid=embed-pinboard
6
+ * https://developers.thoughtspot.com/docs/?pageid=embed-a-viz
7
+ *
8
+ * @summary Pinboard & visualization embed
9
+ * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
10
+ */
11
+ import { DOMSelector } from '../types';
12
+ import { V1Embed, ViewConfig } from './ts-embed';
13
+ /**
14
+ * The configuration for the embedded pinboard or visualization page view.
15
+ * @Category Pinboards and Charts
16
+ */
17
+ export interface PinboardViewConfig extends ViewConfig {
18
+ /**
19
+ * If set to true, the embedded object container dynamically resizes
20
+ * according to the height of the pinboard.
21
+ */
22
+ fullHeight?: boolean;
23
+ /**
24
+ * This is the minimum height(in pixels) for a full height pinboard.
25
+ * Setting this height helps resolves issues with empty pinboards and
26
+ * other screens navigable from a pinboard.
27
+ * @default 500
28
+ * * _since 1.5.0_
29
+ */
30
+ defaultHeight?: number;
31
+ /**
32
+ * If set to true, the context menu in visualizations will be enabled.
33
+ */
34
+ enableVizTransformations?: boolean;
35
+ /**
36
+ * The pinboard to display in the embedded view.
37
+ */
38
+ pinboardId: string;
39
+ /**
40
+ * The visualization within the pinboard to display.
41
+ */
42
+ vizId?: string;
43
+ /**
44
+ * If set to true, all filter chips from a
45
+ * pinboard page will be read-only (no X buttons)
46
+ */
47
+ preventPinboardFilterRemoval?: boolean;
48
+ /**
49
+ * An array of vizids which should be visible when this pinboard loads.
50
+ * The ids not in this array are hidden from the pinboard.
51
+ * _since: 1.6.0_
52
+ */
53
+ pinboardVisibleVizs?: string[];
54
+ }
55
+ /**
56
+ * Embed a ThoughtSpot pinboard or visualization
57
+ * @Category Pinboards and Charts
58
+ */
59
+ export declare class PinboardEmbed extends V1Embed {
60
+ protected viewConfig: PinboardViewConfig;
61
+ private defaultHeight;
62
+ constructor(domSelector: DOMSelector, viewConfig: PinboardViewConfig);
63
+ /**
64
+ * Construct a map of params to be passed on to the
65
+ * embedded pinboard or visualization.
66
+ */
67
+ private getEmbedParams;
68
+ /**
69
+ * Construct the URL of the embedded ThoughtSpot pinboard or visualization
70
+ * to be loaded within the iframe.
71
+ * @param pinboardId The GUID of the pinboard.
72
+ * @param vizId The optional GUID of a visualization within the pinboard.
73
+ * @param runtimeFilters A list of runtime filters to be applied to
74
+ * the pinboard or visualization on load.
75
+ */
76
+ private getIFrameSrc;
77
+ /**
78
+ * Set the iframe height as per the computed height received
79
+ * from the ThoughtSpot app.
80
+ * @param data The event payload
81
+ */
82
+ private updateIFrameHeight;
83
+ private embedIframeCenter;
84
+ private handleRouteChangeFullHeightPinboard;
85
+ /**
86
+ * Render an embedded ThoughtSpot pinboard or visualization
87
+ * @param renderOptions An object specifying the pinboard ID,
88
+ * visualization ID and the runtime filters.
89
+ */
90
+ render(): PinboardEmbed;
91
+ }
@@ -44,9 +44,13 @@ 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
- * @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl
53
+ * @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl, 8.8.1-sw
50
54
  */
51
55
  enableSearchAssist?: boolean;
52
56
  /**
@@ -68,12 +68,12 @@ export interface ViewConfig {
68
68
  /**
69
69
  * The list of actions to display from the primary menu, more menu
70
70
  * (...), and the contextual menu.
71
- * @version 1.6.0 or later
71
+ * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1-sw
72
72
  */
73
73
  visibleActions?: Action[];
74
74
  /**
75
75
  * Show alert messages and toast messages in the embedded view.
76
- * @version 1.11.0 | ThoughtSpot: 8.3.0.cl
76
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
77
77
  */
78
78
  showAlerts?: boolean;
79
79
  /**
@@ -83,7 +83,7 @@ export interface ViewConfig {
83
83
  runtimeFilters?: RuntimeFilter[];
84
84
  /**
85
85
  * The locale/language to use for the embedded view.
86
- * @version 1.9.4 or later
86
+ * @version SDK: 1.9.4 | ThoughtSpot 8.1.0.cl, 8.4.1-sw
87
87
  */
88
88
  locale?: string;
89
89
  /**
@@ -93,7 +93,7 @@ export interface ViewConfig {
93
93
  * Warning: This option is for advanced use only and is used internally
94
94
  * to control embed behavior in non-regular ways. We do not publish the
95
95
  * list of supported keys and values associated with each.
96
- * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl
96
+ * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
97
97
  */
98
98
  additionalFlags?: {
99
99
  [key: string]: string | number | boolean;