@thoughtspot/visual-embed-sdk 1.17.0-alpha.1 → 1.17.0-alpha.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/dist/src/embed/base.d.ts +1 -1
- package/dist/src/embed/pinboard.d.ts +91 -0
- package/dist/src/embed/ts-embed.d.ts +2 -8
- package/dist/src/test/test-utils.d.ts +4 -0
- package/dist/src/types.d.ts +101 -9
- package/dist/src/utils/plugin.d.ts +0 -0
- package/dist/src/utils.d.ts +7 -1
- package/dist/src/v1/api.d.ts +19 -0
- package/dist/tsembed.es.js +1096 -17069
- package/dist/tsembed.js +1096 -17069
- package/lib/package.json +2 -2
- package/lib/src/auth.js +11 -6
- package/lib/src/auth.js.map +1 -1
- package/lib/src/auth.spec.js +11 -3
- package/lib/src/auth.spec.js.map +1 -1
- package/lib/src/embed/app.spec.js +2 -6
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/base.d.ts +1 -1
- package/lib/src/embed/base.js +24 -6
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/base.spec.js +33 -0
- package/lib/src/embed/base.spec.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +3 -6
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/pinboard.d.ts +91 -0
- package/lib/src/embed/pinboard.js +110 -0
- package/lib/src/embed/pinboard.js.map +1 -0
- package/lib/src/embed/pinboard.spec.js +3 -6
- package/lib/src/embed/pinboard.spec.js.map +1 -1
- package/lib/src/embed/search.spec.js +1 -3
- package/lib/src/embed/search.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +2 -8
- package/lib/src/embed/ts-embed.js +12 -18
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +23 -4
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/react/index.spec.js +2 -2
- package/lib/src/react/index.spec.js.map +1 -1
- package/lib/src/test/test-utils.d.ts +4 -0
- package/lib/src/test/test-utils.js +19 -1
- package/lib/src/test/test-utils.js.map +1 -1
- package/lib/src/types.d.ts +101 -9
- package/lib/src/types.js +86 -7
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/plugin.d.ts +0 -0
- package/lib/src/utils/plugin.js +1 -0
- package/lib/src/utils/plugin.js.map +1 -0
- package/lib/src/utils.d.ts +7 -1
- package/lib/src/utils.js +10 -0
- package/lib/src/utils.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +104 -12
- package/package.json +2 -2
- package/src/auth.spec.ts +11 -3
- package/src/auth.ts +20 -10
- package/src/embed/app.spec.ts +4 -4
- package/src/embed/base.spec.ts +38 -0
- package/src/embed/base.ts +33 -6
- package/src/embed/liveboard.spec.ts +4 -4
- package/src/embed/pinboard.spec.ts +4 -4
- package/src/embed/search.spec.ts +1 -1
- package/src/embed/ts-embed.spec.ts +27 -6
- package/src/embed/ts-embed.ts +16 -18
- package/src/react/index.spec.tsx +2 -2
- package/src/test/test-utils.ts +21 -2
- package/src/types.ts +100 -7
- package/src/utils.ts +12 -0
package/dist/src/embed/base.d.ts
CHANGED
|
@@ -55,5 +55,5 @@ export declare const logout: (doNotDisableAutoLogin?: boolean) => Promise<boolea
|
|
|
55
55
|
* Renders functions in a queue, resolves to next function only after the callback next is called
|
|
56
56
|
* @param fn The function being registered
|
|
57
57
|
*/
|
|
58
|
-
export declare const renderInQueue: (fn: (next?: (val?: any) => void) =>
|
|
58
|
+
export declare const renderInQueue: (fn: (next?: (val?: any) => void) => Promise<any>) => Promise<any>;
|
|
59
59
|
export declare function reset(): void;
|
|
@@ -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
|
+
}
|
|
@@ -144,12 +144,6 @@ export declare class TsEmbed {
|
|
|
144
144
|
private shouldEncodeUrlQueryParams;
|
|
145
145
|
private defaultHiddenActions;
|
|
146
146
|
constructor(domSelector: DOMSelector, viewConfig?: ViewConfig);
|
|
147
|
-
/**
|
|
148
|
-
* Gets a reference to the root DOM node where
|
|
149
|
-
* the embedded content will appear.
|
|
150
|
-
* @param domSelector
|
|
151
|
-
*/
|
|
152
|
-
private getDOMNode;
|
|
153
147
|
/**
|
|
154
148
|
* Throws error encountered during initialization.
|
|
155
149
|
*/
|
|
@@ -214,7 +208,7 @@ export declare class TsEmbed {
|
|
|
214
208
|
* @param url
|
|
215
209
|
* @param frameOptions
|
|
216
210
|
*/
|
|
217
|
-
protected renderIFrame(url: string, frameOptions?: FrameParams):
|
|
211
|
+
protected renderIFrame(url: string, frameOptions?: FrameParams): Promise<any>;
|
|
218
212
|
/**
|
|
219
213
|
* Sets the height of the iframe
|
|
220
214
|
* @param height The height in pixels
|
|
@@ -302,6 +296,6 @@ export declare class V1Embed extends TsEmbed {
|
|
|
302
296
|
* Render the app in an iframe and set up event handlers
|
|
303
297
|
* @param iframeSrc
|
|
304
298
|
*/
|
|
305
|
-
protected renderV1Embed(iframeSrc: string):
|
|
299
|
+
protected renderV1Embed(iframeSrc: string): any;
|
|
306
300
|
on(messageType: EmbedEvent, callback: MessageCallback, options?: MessageOptions): typeof TsEmbed.prototype;
|
|
307
301
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export declare const defaultParamsWithoutHiddenActions: string;
|
|
2
|
+
export declare const defaultParams: string;
|
|
3
|
+
export declare const defaultParamsForPinboardEmbed: string;
|
|
1
4
|
export declare const getDocumentBody: () => string;
|
|
2
5
|
declare type DOMElement = HTMLElement | Document;
|
|
3
6
|
export declare const getRootEl: () => HTMLElement;
|
|
@@ -5,6 +8,7 @@ export declare const getRootEl2: () => HTMLElement;
|
|
|
5
8
|
export declare const getIFrameEl: (container?: DOMElement) => HTMLIFrameElement;
|
|
6
9
|
export declare const getAllIframeEl: () => NodeListOf<HTMLIFrameElement>;
|
|
7
10
|
export declare const getIFrameSrc: (container?: DOMElement) => string;
|
|
11
|
+
export declare const waitFor: (fn: () => boolean) => Promise<void>;
|
|
8
12
|
/**
|
|
9
13
|
* jsdom does not set event source, therefore we do it
|
|
10
14
|
* programmatically and use dispatchEvent instead of the
|
package/dist/src/types.d.ts
CHANGED
|
@@ -15,23 +15,52 @@ export declare enum AuthType {
|
|
|
15
15
|
* No authentication on the SDK. Passthrough to the embedded App. Alias for `Passthrough`.
|
|
16
16
|
*/
|
|
17
17
|
None = "None",
|
|
18
|
+
/**
|
|
19
|
+
* Passthrough SSO to the embedded App within the iframe. Requires least configuration, but may not
|
|
20
|
+
* be supported by all IDPs. This will behave like `None` if SSO is not configured on ThoughtSpot.
|
|
21
|
+
* @version: SDK: 1.15.0 | ThouhgtSpot: 8.8.0.cl
|
|
22
|
+
*/
|
|
23
|
+
EmbeddedSSO = "EmbeddedSSO",
|
|
18
24
|
/**
|
|
19
25
|
* SSO using SAML
|
|
20
|
-
* @deprecated Use {@link
|
|
26
|
+
* @deprecated Use {@link SAMLRedirect} instead
|
|
27
|
+
* @hidden
|
|
21
28
|
*/
|
|
22
29
|
SSO = "SSO_SAML",
|
|
23
30
|
/**
|
|
24
31
|
* SSO using SAML
|
|
32
|
+
* @deprecated Use {@link SAMLRedirect} instead
|
|
33
|
+
* @hidden
|
|
25
34
|
*/
|
|
26
35
|
SAML = "SSO_SAML",
|
|
36
|
+
/**
|
|
37
|
+
* SSO using SAML
|
|
38
|
+
* Will make the host application redirect to the SAML Idp.
|
|
39
|
+
*/
|
|
40
|
+
SAMLRedirect = "SSO_SAML",
|
|
27
41
|
/**
|
|
28
42
|
* SSO using OIDC
|
|
43
|
+
* @hidden
|
|
44
|
+
* @deprecated Use {@link OIDCRedirect} instead
|
|
29
45
|
*/
|
|
30
46
|
OIDC = "SSO_OIDC",
|
|
47
|
+
/**
|
|
48
|
+
* SSO using OIDC
|
|
49
|
+
* Will make the host application redirect to the OIDC Idp.
|
|
50
|
+
*/
|
|
51
|
+
OIDCRedirect = "SSO_OIDC",
|
|
31
52
|
/**
|
|
32
53
|
* Trusted authentication server
|
|
54
|
+
* @hidden
|
|
55
|
+
* @deprecated Use {@link TrustedAuth} instead
|
|
33
56
|
*/
|
|
34
57
|
AuthServer = "AuthServer",
|
|
58
|
+
/**
|
|
59
|
+
* Trusted authentication server, Use you own authentication server
|
|
60
|
+
* which returns a bearer token, generated using the secret_key obtained from
|
|
61
|
+
* ThoughtSpot.
|
|
62
|
+
*/
|
|
63
|
+
TrustedAuthToken = "AuthServer",
|
|
35
64
|
/**
|
|
36
65
|
* Use the ThoughtSpot login API to authenticate to the cluster directly.
|
|
37
66
|
*
|
|
@@ -198,6 +227,20 @@ export interface EmbedConfig {
|
|
|
198
227
|
* @version SDK: 1.17.0 | ThoughtSpot: 8.9.0.cl
|
|
199
228
|
*/
|
|
200
229
|
customisations?: CustomisationsInterface;
|
|
230
|
+
/**
|
|
231
|
+
* For noRedirect SSO Auth, we need a button which the user
|
|
232
|
+
* click to trigger the flow. This is the containing element
|
|
233
|
+
* for that button.
|
|
234
|
+
*
|
|
235
|
+
* @version SDK: 1.17.0 | ThoughtSpot: *
|
|
236
|
+
*/
|
|
237
|
+
authTriggerContainer?: string | HTMLElement;
|
|
238
|
+
/**
|
|
239
|
+
* Text to show in the button which triggers the popup auth flow.
|
|
240
|
+
* Default: "Authorize".
|
|
241
|
+
* @version SDK: 1.17.0 | ThoughtSpot: *
|
|
242
|
+
*/
|
|
243
|
+
authTriggerText?: string;
|
|
201
244
|
}
|
|
202
245
|
/**
|
|
203
246
|
* MessagePayload: Embed event payload: message type, data and status (start/end)
|
|
@@ -624,16 +667,25 @@ export declare enum EmbedEvent {
|
|
|
624
667
|
export declare enum HostEvent {
|
|
625
668
|
/**
|
|
626
669
|
* Trigger a search
|
|
627
|
-
* @param dataSourceIds - The list of data source GUIDs
|
|
628
|
-
* @param searchQuery - The search query
|
|
670
|
+
* @param - dataSourceIds - The list of data source GUIDs
|
|
671
|
+
* @param - searchQuery - The search query
|
|
672
|
+
* @example
|
|
673
|
+
* searchEmbed.trigger(HostEvent.Search, {
|
|
674
|
+
* searchQuery: "[sales] by [item type],
|
|
675
|
+
* "dataSourceIds: ["cd252e5c-b552-49a8-821d-3eadaa049cca"]
|
|
676
|
+
* })
|
|
629
677
|
*/
|
|
630
678
|
Search = "search",
|
|
631
679
|
/**
|
|
632
680
|
* Trigger a drill on certain points by certain column
|
|
633
|
-
* @param points - an object containing selectedPoints/clickedPoints
|
|
681
|
+
* @param - points - an object containing selectedPoints/clickedPoints
|
|
634
682
|
* eg. { selectedPoints: []}
|
|
635
|
-
* @param columnGuid - a string guid of the column to drill by. This is optional,
|
|
683
|
+
* @param - columnGuid - a string guid of the column to drill by. This is optional,
|
|
636
684
|
* if not provided it will auto drill by the configured column.
|
|
685
|
+
* @example searchEmbed.trigger(HostEvent.DrillDown, {
|
|
686
|
+
* points: clickedPointData,
|
|
687
|
+
* autoDrillDown: true,
|
|
688
|
+
* })
|
|
637
689
|
* @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
|
|
638
690
|
*/
|
|
639
691
|
DrillDown = "triggerDrillDown",
|
|
@@ -651,6 +703,8 @@ export declare enum HostEvent {
|
|
|
651
703
|
* Set the visible visualizations on a Liveboard.
|
|
652
704
|
* @param - an array of ids of visualizations to show, the ids not passed
|
|
653
705
|
* will be hidden.
|
|
706
|
+
* @example
|
|
707
|
+
* liveboardEmbed.trigger(HostEvent.SetVisibleVizs, ['730496d6-6903-4601-937e-2c691821af3c', 'd547ec54-2a37-4516-a222-2b06719af726'])
|
|
654
708
|
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1-sw
|
|
655
709
|
*/
|
|
656
710
|
SetVisibleVizs = "SetPinboardVisibleVizs",
|
|
@@ -658,18 +712,25 @@ export declare enum HostEvent {
|
|
|
658
712
|
* Update the runtime filters. The runtime filters passed here are extended
|
|
659
713
|
* on to the existing runtime filters if they exist.
|
|
660
714
|
* @param - {@link RuntimeFilter}[] an array of {@link RuntimeFilter} Types.
|
|
715
|
+
* @example
|
|
716
|
+
* liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
|
|
717
|
+
* {columnName: "state",operator: "EQ",values: ["michigan"]},
|
|
718
|
+
* {columnName: "item type",operator: "EQ",values: ["Jackets"]}
|
|
719
|
+
* ])
|
|
661
720
|
* @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
|
|
662
721
|
*/
|
|
663
722
|
UpdateRuntimeFilters = "UpdateRuntimeFilters",
|
|
664
723
|
/**
|
|
665
724
|
* Navigate to a specific page in App embed without any reload.
|
|
666
725
|
* This is the same as calling `appEmbed.navigateToPage(path, true)`
|
|
667
|
-
* @param path - the path to navigate to (can be a number[1/-1] to go forward/back)
|
|
726
|
+
* @param - path - the path to navigate to (can be a number[1/-1] to go forward/back)
|
|
727
|
+
* @example appEmbed.navigateToPage(-1)
|
|
668
728
|
* @version SDK: 1.12.0 | ThoughtSpot 8.4.0.cl, 8.4.1-sw
|
|
669
729
|
*/
|
|
670
730
|
Navigate = "Navigate",
|
|
671
731
|
/**
|
|
672
732
|
* Gets the current pinboard content.
|
|
733
|
+
* @example liveboardEmbed.trigger(HostEvent.getExportRequestForCurrentPinboard)
|
|
673
734
|
* @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl, 8.8.1-sw
|
|
674
735
|
*/
|
|
675
736
|
getExportRequestForCurrentPinboard = "getExportRequestForCurrentPinboard",
|
|
@@ -677,70 +738,82 @@ export declare enum HostEvent {
|
|
|
677
738
|
* Triggers the Pin action on an embedded object
|
|
678
739
|
* @param - incase of Liveboard embed, takes in an object with vizId as a key
|
|
679
740
|
* can be left empty for search and visualization embeds
|
|
741
|
+
* @example liveboardEmbed.trigger(HostEvent.Pin, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
680
742
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
681
743
|
*/
|
|
682
744
|
Pin = "pin",
|
|
683
745
|
/**
|
|
684
746
|
* Triggers the Show Liveboard details action on a Liveboard
|
|
747
|
+
* @example liveboardEmbed.trigger(HostEvent.LiveboardInfo)
|
|
685
748
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
686
749
|
*/
|
|
687
750
|
LiveboardInfo = "pinboardInfo",
|
|
688
751
|
/**
|
|
689
752
|
* Triggers the Schedule action on a Liveboard
|
|
753
|
+
* @example liveboardEmbed.trigger(HostEvent.Schedule)
|
|
690
754
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
691
755
|
*/
|
|
692
756
|
Schedule = "subscription",
|
|
693
757
|
/**
|
|
694
758
|
* Triggers the Manage schedule action on a Liveboard
|
|
759
|
+
* @example liveboardEmbed.trigger(HostEvent.ScheduleList)
|
|
695
760
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
696
761
|
*/
|
|
697
762
|
SchedulesList = "schedule-list",
|
|
698
763
|
/**
|
|
699
764
|
* Triggers the Export TML action on a Liveboard
|
|
765
|
+
* @example liveboardEmbed.trigger(HostEvent.ExportTML)
|
|
700
766
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
701
767
|
*/
|
|
702
768
|
ExportTML = "exportTSL",
|
|
703
769
|
/**
|
|
704
770
|
* Triggers the Edit TML action on a Liveboard
|
|
771
|
+
* @example liveboardEmbed.trigger(HostEvent.EditTML)
|
|
705
772
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
706
773
|
*/
|
|
707
774
|
EditTML = "editTSL",
|
|
708
775
|
/**
|
|
709
776
|
* Triggers the Update TML action on a Liveboard
|
|
777
|
+
* @example liveboardEmbed.trigger(HostEvent.UpdateTML)
|
|
710
778
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
711
779
|
*/
|
|
712
780
|
UpdateTML = "updateTSL",
|
|
713
781
|
/**
|
|
714
782
|
* Triggers the Download PDF action on a Liveboard
|
|
783
|
+
* @example liveboardEmbed.trigger(HostEvent.DownloadAsPDF)
|
|
715
784
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
716
785
|
*/
|
|
717
786
|
DownloadAsPdf = "downloadAsPdf",
|
|
718
787
|
/**
|
|
719
788
|
* Triggers the Make a copy action on a Liveboard
|
|
789
|
+
* @example liveboardEmbed.trigger(HostEvent.MakeACopy)
|
|
720
790
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
721
791
|
*/
|
|
722
792
|
MakeACopy = "makeACopy",
|
|
723
793
|
/**
|
|
724
794
|
* Triggers the Delete action on a Liveboard
|
|
795
|
+
* @example appEmbed.trigger(HostEvent.Remove)
|
|
725
796
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
726
797
|
*/
|
|
727
798
|
Remove = "delete",
|
|
728
799
|
/**
|
|
729
800
|
* Triggers the Explore action on a visualization
|
|
730
801
|
* @param - an object with vizId as a key
|
|
731
|
-
*
|
|
802
|
+
* @example liveboardEmbed.trigger(HostEvent.Explore, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
732
803
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
733
804
|
*/
|
|
734
805
|
Explore = "explore",
|
|
735
806
|
/**
|
|
736
807
|
* Triggers the Create alert action on a visualization
|
|
737
808
|
* @param - an object with vizId as a key
|
|
809
|
+
* @example liveboardEmbed.trigger(HostEvent.CreateMonitor {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
738
810
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
739
811
|
*/
|
|
740
812
|
CreateMonitor = "createMonitor",
|
|
741
813
|
/**
|
|
742
814
|
* Triggers the Manage alert action on a visualization
|
|
743
815
|
* @param - an object with vizId as a key
|
|
816
|
+
* @example liveboardEmbed.trigger(HostEvent.ManageMonitor, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
744
817
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
745
818
|
*/
|
|
746
819
|
ManageMonitor = "manageMonitor",
|
|
@@ -776,9 +849,26 @@ export declare enum HostEvent {
|
|
|
776
849
|
Present = "present",
|
|
777
850
|
/**
|
|
778
851
|
* Get TML for the current search.
|
|
852
|
+
* @example searchEmbed.trigger(HostEvent.GetTML)
|
|
779
853
|
* @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl
|
|
780
854
|
*/
|
|
781
|
-
GetTML = "getTML"
|
|
855
|
+
GetTML = "getTML",
|
|
856
|
+
/**
|
|
857
|
+
* Triggers the Share action on a liveboard or answer
|
|
858
|
+
* @example
|
|
859
|
+
* liveboardEmbed.trigger(HostEvent.Share)
|
|
860
|
+
* searchEmbed.trigger(HostEvent.Share)
|
|
861
|
+
* @version SDK: 1.18.0 | Thoughtspot: 9.0.0.cl
|
|
862
|
+
*/
|
|
863
|
+
Share = "share",
|
|
864
|
+
/**
|
|
865
|
+
* Trigger the Save action on a liveboard or answer
|
|
866
|
+
* @example
|
|
867
|
+
* liveboardEmbed.trigger(HostEvent.Save)
|
|
868
|
+
* searchEmbed.trigger(HostEvent.Save)
|
|
869
|
+
* @version SDK: 1.18.0 | Thoughtspot: 9.0.0.cl
|
|
870
|
+
*/
|
|
871
|
+
Save = "save"
|
|
782
872
|
}
|
|
783
873
|
/**
|
|
784
874
|
* The different visual modes that the data sources panel within
|
|
@@ -834,7 +924,9 @@ export declare enum Param {
|
|
|
834
924
|
LiveboardV2Enabled = "isPinboardV2Enabled",
|
|
835
925
|
ShowAlerts = "showAlerts",
|
|
836
926
|
Locale = "locale",
|
|
837
|
-
CustomStyle = "customStyle"
|
|
927
|
+
CustomStyle = "customStyle",
|
|
928
|
+
ForceSAMLAutoRedirect = "forceSAMLAutoRedirect",
|
|
929
|
+
AuthType = "authType"
|
|
838
930
|
}
|
|
839
931
|
/**
|
|
840
932
|
* The list of actions that can be performed on visual ThoughtSpot
|
|
File without changes
|
package/dist/src/utils.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @summary Utils
|
|
7
7
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
8
8
|
*/
|
|
9
|
-
import { EmbedConfig, QueryParams, RuntimeFilter, CustomisationsInterface } from './types';
|
|
9
|
+
import { EmbedConfig, QueryParams, RuntimeFilter, CustomisationsInterface, DOMSelector } from './types';
|
|
10
10
|
/**
|
|
11
11
|
* Construct a runtime filters query string from the given filters.
|
|
12
12
|
* Refer to the following docs for more details on runtime filter syntax:
|
|
@@ -44,3 +44,9 @@ export declare const setAttributes: (element: HTMLElement, attributes: {
|
|
|
44
44
|
}) => void;
|
|
45
45
|
export declare const checkReleaseVersionInBeta: (releaseVersion: string, suppressBetaWarning: boolean) => boolean;
|
|
46
46
|
export declare const getCustomisations: (embedConfig: EmbedConfig) => CustomisationsInterface;
|
|
47
|
+
/**
|
|
48
|
+
* Gets a reference to the DOM node given
|
|
49
|
+
* a selector.
|
|
50
|
+
* @param domSelector
|
|
51
|
+
*/
|
|
52
|
+
export declare function getDOMNode(domSelector: DOMSelector): HTMLElement;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright: ThoughtSpot Inc. 2012-2016
|
|
3
|
+
* Author: Shashank Singh (sunny@thoughtspot.com)
|
|
4
|
+
*
|
|
5
|
+
* @fileoverview ThoughtSpot Javascript API for use of ThoughtSpot in external webpages.
|
|
6
|
+
*/
|
|
7
|
+
import { AuthType } from '../types';
|
|
8
|
+
export declare enum Events {
|
|
9
|
+
THOUGHTSPOT_AUTH_EXPIRED = "ThoughtspotAuthExpired",
|
|
10
|
+
EXPORT_VIZ_DATA_TO_PARENT = "exportVizDataToParent",
|
|
11
|
+
ALERT = "alert",
|
|
12
|
+
EXPORT_VIZ_DATA_TO_CHILD = "exportVizDataToChild",
|
|
13
|
+
GET_DATA = "getData"
|
|
14
|
+
}
|
|
15
|
+
declare type Callback = (...args: any[]) => void;
|
|
16
|
+
declare function checkIfLoggedIn(tsHost: string, callback: Callback): void;
|
|
17
|
+
declare function initialize(onInitialized: Callback, onAuthExpiration: Callback, _thoughtspotHost: string, authType: AuthType): void;
|
|
18
|
+
declare function notifyOnAuthExpiration(): void;
|
|
19
|
+
export { initialize, checkIfLoggedIn, notifyOnAuthExpiration };
|