@thoughtspot/visual-embed-sdk 1.15.0 → 1.16.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 (67) hide show
  1. package/dist/src/auth.d.ts +3 -3
  2. package/dist/src/embed/base.d.ts +9 -8
  3. package/dist/src/embed/liveboard.d.ts +4 -1
  4. package/dist/src/embed/search-bar.d.ts +39 -0
  5. package/dist/src/embed/search.d.ts +1 -2
  6. package/dist/src/embed/ts-embed.d.ts +1 -0
  7. package/dist/src/index.d.ts +3 -2
  8. package/dist/src/react/index.d.ts +4 -0
  9. package/dist/src/types.d.ts +6 -0
  10. package/dist/tsembed.es.js +17471 -189
  11. package/dist/tsembed.js +17470 -188
  12. package/lib/package.json +2 -1
  13. package/lib/src/auth.d.ts +3 -3
  14. package/lib/src/auth.js +3 -3
  15. package/lib/src/config.spec.js +9 -1
  16. package/lib/src/config.spec.js.map +1 -1
  17. package/lib/src/embed/base.d.ts +9 -8
  18. package/lib/src/embed/base.js +34 -15
  19. package/lib/src/embed/base.js.map +1 -1
  20. package/lib/src/embed/base.spec.js +23 -2
  21. package/lib/src/embed/base.spec.js.map +1 -1
  22. package/lib/src/embed/liveboard.d.ts +4 -1
  23. package/lib/src/embed/liveboard.js.map +1 -1
  24. package/lib/src/embed/liveboard.spec.js +13 -0
  25. package/lib/src/embed/liveboard.spec.js.map +1 -1
  26. package/lib/src/embed/pinboard.spec.js.map +1 -1
  27. package/lib/src/embed/search-bar.d.ts +39 -0
  28. package/lib/src/embed/search-bar.js +58 -0
  29. package/lib/src/embed/search-bar.js.map +1 -0
  30. package/lib/src/embed/search.d.ts +1 -2
  31. package/lib/src/embed/ts-embed.d.ts +1 -0
  32. package/lib/src/embed/ts-embed.js +1 -0
  33. package/lib/src/embed/ts-embed.js.map +1 -1
  34. package/lib/src/index.d.ts +3 -2
  35. package/lib/src/index.js +4 -3
  36. package/lib/src/index.js.map +1 -1
  37. package/lib/src/react/index.d.ts +4 -0
  38. package/lib/src/react/index.js +2 -0
  39. package/lib/src/react/index.js.map +1 -1
  40. package/lib/src/react/index.spec.js +12 -1
  41. package/lib/src/react/index.spec.js.map +1 -1
  42. package/lib/src/types.d.ts +6 -0
  43. package/lib/src/types.js +7 -0
  44. package/lib/src/types.js.map +1 -1
  45. package/lib/src/utils/authService.js.map +1 -1
  46. package/lib/src/utils/processData.spec.js +1 -3
  47. package/lib/src/utils/processData.spec.js.map +1 -1
  48. package/lib/src/utils/processTrigger.spec.js +16 -0
  49. package/lib/src/utils/processTrigger.spec.js.map +1 -1
  50. package/lib/src/visual-embed-sdk.d.ts +63 -16
  51. package/package.json +2 -1
  52. package/src/auth.ts +3 -3
  53. package/src/config.spec.ts +10 -1
  54. package/src/embed/base.spec.ts +26 -2
  55. package/src/embed/base.ts +42 -15
  56. package/src/embed/liveboard.spec.ts +16 -2
  57. package/src/embed/liveboard.ts +4 -1
  58. package/src/embed/pinboard.spec.ts +1 -2
  59. package/src/embed/search-bar.tsx +88 -0
  60. package/src/embed/search.ts +1 -1
  61. package/src/embed/ts-embed.ts +1 -0
  62. package/src/index.ts +5 -0
  63. package/src/react/index.spec.tsx +34 -1
  64. package/src/react/index.tsx +12 -0
  65. package/src/types.ts +7 -0
  66. package/src/utils/processData.spec.ts +1 -3
  67. package/src/utils/processTrigger.spec.ts +22 -0
@@ -23,15 +23,15 @@ export declare enum AuthStatus {
23
23
  */
24
24
  FAILURE = "FAILURE",
25
25
  /**
26
- * Emits when the SDK succeeds to authenticate
26
+ * Emits when the SDK authenticates successfully
27
27
  */
28
28
  SDK_SUCCESS = "SDK_SUCCESS",
29
29
  /**
30
- * Emits when the App sends a auth success
30
+ * Emits when the app sends an authentication success message
31
31
  */
32
32
  SUCCESS = "SUCCESS",
33
33
  /**
34
- * Emits when there is a logout
34
+ * Emits when a user logs out
35
35
  */
36
36
  LOGOUT = "LOGOUT"
37
37
  }
@@ -7,7 +7,7 @@
7
7
  * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
8
8
  */
9
9
  import EventEmitter from 'eventemitter3';
10
- import { EmbedConfig } from '../types';
10
+ import { EmbedConfig, PrefetchFeatures } from '../types';
11
11
  import { AuthFailureType } from '../auth';
12
12
  export declare let authPromise: Promise<boolean>;
13
13
  export declare const getEmbedConfig: () => EmbedConfig;
@@ -23,23 +23,24 @@ export declare const handleAuth: () => Promise<boolean>;
23
23
  /**
24
24
  * Prefetches static resources from the specified URL. Web browsers can then cache the prefetched resources and serve them from the user's local disk to provide faster access to your app.
25
25
  * @param url The URL provided for prefetch
26
+ * @param prefetchFeatures Specify features which needs to be prefetched.
27
+ * @version SDK: 1.4.0 | ThoughtSpot: ts7.sep.cl, 7.2.1
26
28
  */
27
- export declare const prefetch: (url?: string) => void;
29
+ export declare const prefetch: (url?: string, prefetchFeatures?: PrefetchFeatures[]) => void;
28
30
  /**
29
- * Initialize the ThoughtSpot embed SDK globally and perform
31
+ * Initializes the Visual Embed SDK globally and perform
30
32
  * authentication if applicable.
31
33
  * @param embedConfig The configuration object containing ThoughtSpot host,
32
34
  * authentication mechanism and so on.
33
- *
34
- * eg: authStatus = init(config);
35
+ * example: authStatus = init(config);
35
36
  * authStatus.on(AuthStatus.FAILURE, (reason) => { // do something here });
36
- *
37
- * @returns event emitter which emits events on authentication success, failure and logout. {@link AuthStatus}
37
+ * @returns event emitter which emits events on authentication success, failure and logout. See {@link AuthStatus}
38
+ * @version SDK: 1.0.0 | ThoughtSpot ts7.april.cl, 7.2.1
38
39
  */
39
40
  export declare const init: (embedConfig: EmbedConfig) => EventEmitter;
40
41
  export declare function disableAutoLogin(): void;
41
42
  /**
42
- * Logout from ThoughtSpot. This also sets the autoLogin flag to false, to prevent
43
+ * Logs out from ThoughtSpot. This also sets the autoLogin flag to false, to prevent
43
44
  * the SDK from automatically logging in again.
44
45
  *
45
46
  * You can call the `init` method again to re login, if autoLogin is set to true in this
@@ -18,6 +18,7 @@ export interface LiveboardViewConfig extends ViewConfig {
18
18
  /**
19
19
  * If set to true, the embedded object container dynamically resizes
20
20
  * according to the height of the Liveboard.
21
+ * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 7.2.1
21
22
  */
22
23
  fullHeight?: boolean;
23
24
  /**
@@ -29,12 +30,13 @@ export interface LiveboardViewConfig extends ViewConfig {
29
30
  */
30
31
  defaultHeight?: number;
31
32
  /**
32
- * If set to true, the context menu in visualizations will be enabled.
33
+ * @Deprecated If set to true, the context menu in visualizations will be enabled.
33
34
  */
34
35
  enableVizTransformations?: boolean;
35
36
  /**
36
37
  * The Liveboard to display in the embedded view.
37
38
  * Use either of liveboardId or pinboardId to reference the Liveboard to embed.
39
+ * @version SDK: 1.3.0 | ThoughtSpot ts7.aug.cl, 7.2.1
38
40
  */
39
41
  liveboardId?: string;
40
42
  /**
@@ -49,6 +51,7 @@ export interface LiveboardViewConfig extends ViewConfig {
49
51
  /**
50
52
  * If set to true, all filter chips from a
51
53
  * Liveboard page will be read-only (no X buttons)
54
+ * @version SDK: 1.3.0 | ThoughtSpot ts7.aug.cl, 7.2.1
52
55
  */
53
56
  preventLiveboardFilterRemoval?: boolean;
54
57
  /**
@@ -0,0 +1,39 @@
1
+ import { TsEmbed, ViewConfig } from './ts-embed';
2
+ import { SearchOptions } from './search';
3
+ export interface SearchBarViewConfig extends ViewConfig {
4
+ /**
5
+ * If set to true, hides the data sources panel.
6
+ */
7
+ hideDataSources?: boolean;
8
+ /**
9
+ * The array of data source GUIDs to set on load.
10
+ */
11
+ dataSources?: string[];
12
+ /**
13
+ * Configuration for search options
14
+ */
15
+ searchOptions?: SearchOptions;
16
+ }
17
+ /**
18
+ * Embed ThoughtSpot search bar
19
+ *
20
+ * @Category Search Embed
21
+ * @version: SDK: 1.17.0 | ThoughtSpot: 8.10.0
22
+ */
23
+ export declare class SearchBarEmbed extends TsEmbed {
24
+ /**
25
+ * The view configuration for the embedded ThoughtSpot search bar.
26
+ */
27
+ protected viewConfig: SearchBarViewConfig;
28
+ constructor(domSelector: string, viewConfig: SearchBarViewConfig);
29
+ /**
30
+ * Construct the URL of the embedded ThoughtSpot search to be
31
+ * loaded in the iframe
32
+ * @param dataSources A list of data source GUIDs
33
+ */
34
+ private getIFrameSrc;
35
+ /**
36
+ * Render the embedded ThoughtSpot search
37
+ */
38
+ render(): SearchBarEmbed;
39
+ }
@@ -11,7 +11,7 @@ import { ViewConfig, TsEmbed } from './ts-embed';
11
11
  /**
12
12
  * Configuration for search options
13
13
  */
14
- interface SearchOptions {
14
+ export interface SearchOptions {
15
15
  /**
16
16
  * The tml string to load the answer
17
17
  */
@@ -105,4 +105,3 @@ export declare class SearchEmbed extends TsEmbed {
105
105
  */
106
106
  render(): SearchEmbed;
107
107
  }
108
- export {};
@@ -286,6 +286,7 @@ export declare class TsEmbed {
286
286
  * Get the Post Url Params for THOUGHTSPOT from the current
287
287
  * host app URL.
288
288
  * THOUGHTSPOT URL params starts with a prefix "ts-"
289
+ * @version SDK: 1.14.0 | ThoughtSpot: 8.4.0.cl, 8.4.1-sw
289
290
  */
290
291
  getThoughtSpotPostUrlParams(): string;
291
292
  }
@@ -11,6 +11,7 @@ import { AppEmbed, Page, AppViewConfig } from './embed/app';
11
11
  import { init, prefetch, logout } from './embed/base';
12
12
  import { PinboardEmbed, LiveboardViewConfig, LiveboardEmbed } from './embed/liveboard';
13
13
  import { SearchEmbed, SearchViewConfig } from './embed/search';
14
+ import { SearchBarEmbed, SearchBarViewConfig } from './embed/search-bar';
14
15
  import { AuthFailureType, AuthStatus } from './auth';
15
- import { AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, EmbedConfig } from './types';
16
- export { init, logout, prefetch, SearchEmbed, PinboardEmbed, LiveboardEmbed, AppEmbed, AuthFailureType, AuthStatus, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, EmbedConfig, SearchViewConfig, LiveboardViewConfig, AppViewConfig, };
16
+ import { AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, EmbedConfig, PrefetchFeatures } from './types';
17
+ export { init, logout, prefetch, SearchEmbed, SearchBarEmbed, PinboardEmbed, LiveboardEmbed, AppEmbed, AuthFailureType, AuthStatus, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, EmbedConfig, SearchViewConfig, SearchBarViewConfig, LiveboardViewConfig, AppViewConfig, PrefetchFeatures, };
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { SearchBarViewConfig } from '../embed/search-bar';
2
3
  import { SearchViewConfig } from '../embed/search';
3
4
  import { AppViewConfig } from '../embed/app';
4
5
  import { LiveboardViewConfig } from '../embed/liveboard';
@@ -14,5 +15,8 @@ interface LiveboardProps extends EmbedProps, LiveboardViewConfig {
14
15
  }
15
16
  export declare const LiveboardEmbed: React.ForwardRefExoticComponent<LiveboardProps & React.RefAttributes<TsEmbed>>;
16
17
  export declare const PinboardEmbed: React.ForwardRefExoticComponent<LiveboardProps & React.RefAttributes<TsEmbed>>;
18
+ interface SearchBarEmbedProps extends EmbedProps, SearchBarViewConfig {
19
+ }
20
+ export declare const SearchBarEmbed: React.ForwardRefExoticComponent<SearchBarEmbedProps & React.RefAttributes<TsEmbed>>;
17
21
  export declare const useEmbedRef: () => React.MutableRefObject<TsEmbed>;
18
22
  export {};
@@ -994,4 +994,10 @@ export declare enum OperationType {
994
994
  export interface AnswerServiceType {
995
995
  getAnswer?: (offset: number, batchSize: number) => any;
996
996
  }
997
+ export declare enum PrefetchFeatures {
998
+ FullApp = "FullApp",
999
+ SearchEmbed = "SearchEmbed",
1000
+ LiveboardEmbed = "LiveboardEmbed",
1001
+ VizEmbed = "VizEmbed"
1002
+ }
997
1003
  export {};