@thoughtspot/visual-embed-sdk 1.13.0-alpha.1 → 1.13.0-alpha.4
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/auth.d.ts +13 -0
- package/dist/src/embed/app.d.ts +5 -0
- package/dist/src/embed/base.d.ts +1 -0
- package/dist/src/embed/ts-embed.d.ts +9 -1
- package/dist/src/types.d.ts +191 -6
- package/dist/src/utils.d.ts +2 -1
- package/dist/tsembed.es.js +222 -8
- package/dist/tsembed.js +222 -8
- package/lib/package.json +1 -1
- package/lib/src/auth.d.ts +13 -0
- package/lib/src/auth.js +14 -0
- package/lib/src/auth.js.map +1 -1
- package/lib/src/auth.spec.js +9 -0
- package/lib/src/auth.spec.js.map +1 -1
- package/lib/src/config.spec.js +7 -0
- package/lib/src/config.spec.js.map +1 -1
- package/lib/src/embed/app.d.ts +5 -0
- package/lib/src/embed/app.js +1 -1
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +10 -0
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/base.d.ts +1 -0
- package/lib/src/embed/base.js +10 -0
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/base.spec.js +16 -0
- package/lib/src/embed/base.spec.js.map +1 -1
- package/lib/src/embed/liveboard.js +4 -1
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +3 -2
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/pinboard.spec.js +3 -2
- package/lib/src/embed/pinboard.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +9 -1
- package/lib/src/embed/ts-embed.js +21 -3
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +26 -0
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/types.d.ts +191 -6
- package/lib/src/types.js +163 -3
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils.d.ts +2 -1
- package/lib/src/utils.js +9 -0
- package/lib/src/utils.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +211 -7
- package/package.json +2 -2
- package/src/auth.spec.ts +10 -0
- package/src/auth.ts +14 -0
- package/src/config.spec.ts +11 -0
- package/src/embed/app.spec.ts +14 -0
- package/src/embed/app.ts +6 -0
- package/src/embed/base.spec.ts +18 -0
- package/src/embed/base.ts +10 -0
- package/src/embed/liveboard.spec.ts +4 -2
- package/src/embed/liveboard.ts +4 -0
- package/src/embed/pinboard.spec.ts +4 -3
- package/src/embed/ts-embed.spec.ts +32 -0
- package/src/embed/ts-embed.ts +25 -1
- package/src/types.ts +189 -3
- package/src/utils.ts +18 -1
package/dist/src/auth.d.ts
CHANGED
|
@@ -18,8 +18,21 @@ export declare enum AuthFailureType {
|
|
|
18
18
|
OTHER = "OTHER"
|
|
19
19
|
}
|
|
20
20
|
export declare enum AuthStatus {
|
|
21
|
+
/**
|
|
22
|
+
* Emits when the SDK fails to authenticate
|
|
23
|
+
*/
|
|
21
24
|
FAILURE = "FAILURE",
|
|
25
|
+
/**
|
|
26
|
+
* Emits when the SDK succeeds to authenticate
|
|
27
|
+
*/
|
|
28
|
+
SDK_SUCCESS = "SDK_SUCCESS",
|
|
29
|
+
/**
|
|
30
|
+
* Emits when the App sends a auth success
|
|
31
|
+
*/
|
|
22
32
|
SUCCESS = "SUCCESS",
|
|
33
|
+
/**
|
|
34
|
+
* Emits when there is a logout
|
|
35
|
+
*/
|
|
23
36
|
LOGOUT = "LOGOUT"
|
|
24
37
|
}
|
|
25
38
|
/**
|
package/dist/src/embed/app.d.ts
CHANGED
|
@@ -86,6 +86,11 @@ export interface AppViewConfig extends ViewConfig {
|
|
|
86
86
|
* @hidden
|
|
87
87
|
*/
|
|
88
88
|
liveboardV2?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* If set to true, the Search Assist feature is enabled.
|
|
91
|
+
* @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl
|
|
92
|
+
*/
|
|
93
|
+
enableSearchAssist?: boolean;
|
|
89
94
|
}
|
|
90
95
|
/**
|
|
91
96
|
* Embeds full ThoughtSpot experience in a host application.
|
package/dist/src/embed/base.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { AuthFailureType } from '../auth';
|
|
|
12
12
|
export declare let authPromise: Promise<boolean>;
|
|
13
13
|
export declare const getEmbedConfig: () => EmbedConfig;
|
|
14
14
|
export declare const getAuthPromise: () => Promise<boolean>;
|
|
15
|
+
export declare function notifyAuthSDKSuccess(): void;
|
|
15
16
|
export declare function notifyAuthSuccess(): void;
|
|
16
17
|
export declare function notifyAuthFailure(failureType: AuthFailureType): void;
|
|
17
18
|
export declare function notifyLogout(): void;
|
|
@@ -183,6 +183,14 @@ export declare class TsEmbed {
|
|
|
183
183
|
* and executes the registered callbacks accordingly.
|
|
184
184
|
*/
|
|
185
185
|
private subscribeToEvents;
|
|
186
|
+
/**
|
|
187
|
+
* Send Custom style as part of payload of APP_INIT
|
|
188
|
+
*/
|
|
189
|
+
private appInitCb;
|
|
190
|
+
/**
|
|
191
|
+
* Register APP_INIT event and sendback init payload
|
|
192
|
+
*/
|
|
193
|
+
private registerAppInit;
|
|
186
194
|
/**
|
|
187
195
|
* Constructs the base URL string to load the ThoughtSpot app.
|
|
188
196
|
*/
|
|
@@ -199,7 +207,7 @@ export declare class TsEmbed {
|
|
|
199
207
|
* @param isAppEmbed A Boolean parameter to specify if you are embedding
|
|
200
208
|
* the full application.
|
|
201
209
|
*/
|
|
202
|
-
protected getV1EmbedBasePath(queryString: string, showPrimaryNavbar?: boolean, disableProfileAndHelp?: boolean, isAppEmbed?: boolean): string;
|
|
210
|
+
protected getV1EmbedBasePath(queryString: string, showPrimaryNavbar?: boolean, disableProfileAndHelp?: boolean, isAppEmbed?: boolean, enableSearchAssist?: boolean): string;
|
|
203
211
|
/**
|
|
204
212
|
* Renders the embedded ThoughtSpot app in an iframe and sets up
|
|
205
213
|
* event listeners.
|
package/dist/src/types.d.ts
CHANGED
|
@@ -17,8 +17,13 @@ export declare enum AuthType {
|
|
|
17
17
|
None = "None",
|
|
18
18
|
/**
|
|
19
19
|
* SSO using SAML
|
|
20
|
+
* @deprecated Use {@link SAML} instead
|
|
20
21
|
*/
|
|
21
22
|
SSO = "SSO_SAML",
|
|
23
|
+
/**
|
|
24
|
+
* SSO using SAML
|
|
25
|
+
*/
|
|
26
|
+
SAML = "SSO_SAML",
|
|
22
27
|
/**
|
|
23
28
|
* SSO using OIDC
|
|
24
29
|
*/
|
|
@@ -36,6 +41,26 @@ export declare enum AuthType {
|
|
|
36
41
|
Basic = "Basic"
|
|
37
42
|
}
|
|
38
43
|
export declare type DOMSelector = string | HTMLElement;
|
|
44
|
+
interface customCssInterface {
|
|
45
|
+
variables?: {
|
|
46
|
+
[variableName: string]: string;
|
|
47
|
+
};
|
|
48
|
+
rules_UNSTABLE?: {
|
|
49
|
+
[selector: string]: {
|
|
50
|
+
[declaration: string]: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
interface CustomStyles {
|
|
55
|
+
customCSSUrl?: string;
|
|
56
|
+
customCss?: customCssInterface;
|
|
57
|
+
}
|
|
58
|
+
export interface CustomisationsInterface {
|
|
59
|
+
style: CustomStyles;
|
|
60
|
+
content: {
|
|
61
|
+
[key: string]: string;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
39
64
|
/**
|
|
40
65
|
* The configuration object for embedding ThoughtSpot content.
|
|
41
66
|
* It includes the ThoughtSpot hostname or IP address,
|
|
@@ -167,6 +192,10 @@ export interface EmbedConfig {
|
|
|
167
192
|
* @version SDK: 1.12.0 | ThoughtSpot: *
|
|
168
193
|
*/
|
|
169
194
|
suppressSearchEmbedBetaWarning?: boolean;
|
|
195
|
+
/**
|
|
196
|
+
* Custom style params for embed Config
|
|
197
|
+
*/
|
|
198
|
+
customisations?: CustomisationsInterface;
|
|
170
199
|
}
|
|
171
200
|
/**
|
|
172
201
|
* MessagePayload: Embed event payload: message type, data and status (start/end)
|
|
@@ -521,7 +550,66 @@ export declare enum EmbedEvent {
|
|
|
521
550
|
* Emitted when an answer is switched to a chart or table view
|
|
522
551
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
|
|
523
552
|
*/
|
|
524
|
-
AnswerChartSwitcher = "answerChartSwitcher"
|
|
553
|
+
AnswerChartSwitcher = "answerChartSwitcher",
|
|
554
|
+
/**
|
|
555
|
+
*
|
|
556
|
+
*/
|
|
557
|
+
APP_INIT = "appInit",
|
|
558
|
+
/**
|
|
559
|
+
* Emitted when a user clicks Show Liveboard details on a Liveboard
|
|
560
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
561
|
+
*/
|
|
562
|
+
LiveboardInfo = "pinboardInfo",
|
|
563
|
+
/**
|
|
564
|
+
* Emitted when a user clicks on the Favorite icon on a Liveboard
|
|
565
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
566
|
+
*/
|
|
567
|
+
AddToFavorites = "addToFavorites",
|
|
568
|
+
/**
|
|
569
|
+
* Emitted when a user clicks Schedule on a Liveboard
|
|
570
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
571
|
+
*/
|
|
572
|
+
Schedule = "subscription",
|
|
573
|
+
/**
|
|
574
|
+
* Emitted when a user clicks Edit on a Liveboard or visualization
|
|
575
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
576
|
+
*/
|
|
577
|
+
Edit = "edit",
|
|
578
|
+
/**
|
|
579
|
+
* Emitted when a user clicks Make a copy on a Liveboard
|
|
580
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
581
|
+
*/
|
|
582
|
+
MakeACopy = "makeACopy",
|
|
583
|
+
/**
|
|
584
|
+
* Emitted when a user clicks Present on a Liveboard or visualization
|
|
585
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
586
|
+
*/
|
|
587
|
+
Present = "present",
|
|
588
|
+
/**
|
|
589
|
+
* Emitted when a user clicks Delete on a Liveboard
|
|
590
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
591
|
+
*/
|
|
592
|
+
Delete = "delete",
|
|
593
|
+
/**
|
|
594
|
+
* Emitted when a user clicks Manage schedules on a Liveboard
|
|
595
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
596
|
+
*/
|
|
597
|
+
SchedulesList = "schedule-list",
|
|
598
|
+
/**
|
|
599
|
+
* Emitted when a user clicks Cancel in edit mode on a Liveboard
|
|
600
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
601
|
+
*/
|
|
602
|
+
Cancel = "cancel",
|
|
603
|
+
/**
|
|
604
|
+
* Emitted when a user clicks Explore on a visualization
|
|
605
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
606
|
+
*/
|
|
607
|
+
Explore = "explore",
|
|
608
|
+
/**
|
|
609
|
+
* Emitted when a user clicks Copy link action on a visualization
|
|
610
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
611
|
+
*/
|
|
612
|
+
CopyLink = "copyLink"
|
|
525
613
|
}
|
|
526
614
|
/**
|
|
527
615
|
* Event types that can be triggered by the host application
|
|
@@ -583,12 +671,106 @@ export declare enum HostEvent {
|
|
|
583
671
|
*/
|
|
584
672
|
getExportRequestForCurrentPinboard = "getExportRequestForCurrentPinboard",
|
|
585
673
|
/**
|
|
586
|
-
*
|
|
587
|
-
* @param - incase of
|
|
588
|
-
* can be left empty for search and
|
|
674
|
+
* Triggers the Pin action on an embedded object
|
|
675
|
+
* @param - incase of Liveboard embed, takes in an object with vizId as a key
|
|
676
|
+
* can be left empty for search and visualization embeds
|
|
677
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
678
|
+
*/
|
|
679
|
+
Pin = "pin",
|
|
680
|
+
/**
|
|
681
|
+
* Triggers the Show Liveboard details action on a Liveboard
|
|
682
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
683
|
+
*/
|
|
684
|
+
LiveboardInfo = "pinboardInfo",
|
|
685
|
+
/**
|
|
686
|
+
* Triggers the Schedule action on a Liveboard
|
|
687
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
688
|
+
*/
|
|
689
|
+
Schedule = "subscription",
|
|
690
|
+
/**
|
|
691
|
+
* Triggers the Manage schedule action on a Liveboard
|
|
692
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
693
|
+
*/
|
|
694
|
+
SchedulesList = "schedule-list",
|
|
695
|
+
/**
|
|
696
|
+
* Triggers the Export TML action on a Liveboard
|
|
697
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
698
|
+
*/
|
|
699
|
+
ExportTML = "exportTSL",
|
|
700
|
+
/**
|
|
701
|
+
* Triggers the Edit TML action on a Liveboard
|
|
702
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
703
|
+
*/
|
|
704
|
+
EditTML = "editTSL",
|
|
705
|
+
/**
|
|
706
|
+
* Triggers the Update TML action on a Liveboard
|
|
707
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
708
|
+
*/
|
|
709
|
+
UpdateTML = "updateTSL",
|
|
710
|
+
/**
|
|
711
|
+
* Triggers the Download PDF action on a Liveboard
|
|
712
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
713
|
+
*/
|
|
714
|
+
DownloadAsPdf = "downloadAsPdf",
|
|
715
|
+
/**
|
|
716
|
+
* Triggers the Make a copy action on a Liveboard
|
|
717
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
718
|
+
*/
|
|
719
|
+
MakeACopy = "makeACopy",
|
|
720
|
+
/**
|
|
721
|
+
* Triggers the Delete action on a Liveboard
|
|
722
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
723
|
+
*/
|
|
724
|
+
Remove = "delete",
|
|
725
|
+
/**
|
|
726
|
+
* Triggers the Explore action on a visualization
|
|
727
|
+
* @param - an object with vizId as a key
|
|
728
|
+
* eg: {vizId: '730496d6-6903-4601-937e-2c691821af3c'}
|
|
729
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
730
|
+
*/
|
|
731
|
+
Explore = "explore",
|
|
732
|
+
/**
|
|
733
|
+
* Triggers the Create alert action on a visualization
|
|
734
|
+
* @param - an object with vizId as a key
|
|
735
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
736
|
+
*/
|
|
737
|
+
CreateMonitor = "createMonitor",
|
|
738
|
+
/**
|
|
739
|
+
* Triggers the Manage alert action on a visualization
|
|
740
|
+
* @param - an object with vizId as a key
|
|
741
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
742
|
+
*/
|
|
743
|
+
ManageMonitor = "manageMonitor",
|
|
744
|
+
/**
|
|
745
|
+
* Triggers the Edit action on a Liveboard or visualization
|
|
746
|
+
* @param - object - to trigger the action for a specfic visualization in Liveboard embed, pass in vizId as a key
|
|
747
|
+
* @example
|
|
748
|
+
* liveboardEmbed.trigger(HostEvent.Edit)
|
|
749
|
+
* liveboardEmbed.trigger(HostEvent.Edit, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
750
|
+
* vizEmbed.trigger((HostEvent.Edit)
|
|
751
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
752
|
+
*/
|
|
753
|
+
Edit = "edit",
|
|
754
|
+
/**
|
|
755
|
+
* Triggers the Copy link action on a Liveboard or visualization
|
|
756
|
+
* @param - object - to trigger the action for a specfic visualization in Liveboard embed, pass in vizId as a key
|
|
757
|
+
* @example
|
|
758
|
+
* liveboardEmbed.trigger(HostEvent.CopyLink)
|
|
759
|
+
* liveboardEmbed.trigger(HostEvent.CopyLink, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
760
|
+
* vizEmbed.trigger((HostEvent.CopyLink)
|
|
761
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
762
|
+
*/
|
|
763
|
+
CopyLink = "embedDocument",
|
|
764
|
+
/**
|
|
765
|
+
* Triggers the Present action on a Liveboard or visualization
|
|
766
|
+
* @param - object - to trigger the action for a specfic visualization in Liveboard embed, pass in vizId as a key
|
|
767
|
+
* @example
|
|
768
|
+
* liveboardEmbed.trigger(HostEvent.Present)
|
|
769
|
+
* liveboardEmbed.trigger(HostEvent.Present, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
770
|
+
* vizEmbed.trigger((HostEvent.Present)
|
|
589
771
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
590
772
|
*/
|
|
591
|
-
|
|
773
|
+
Present = "present"
|
|
592
774
|
}
|
|
593
775
|
/**
|
|
594
776
|
* The different visual modes that the data sources panel within
|
|
@@ -633,6 +815,7 @@ export declare enum Param {
|
|
|
633
815
|
fullHeight = "isFullHeightPinboard",
|
|
634
816
|
livedBoardEmbed = "isLiveboardEmbed",
|
|
635
817
|
searchEmbed = "isSearchEmbed",
|
|
818
|
+
vizEmbed = "isVizEmbed",
|
|
636
819
|
Version = "sdkVersion",
|
|
637
820
|
ViewPortHeight = "viewPortHeight",
|
|
638
821
|
ViewPortWidth = "viewPortWidth",
|
|
@@ -642,7 +825,8 @@ export declare enum Param {
|
|
|
642
825
|
visibleVizs = "pinboardVisibleVizs",
|
|
643
826
|
LiveboardV2Enabled = "isPinboardV2Enabled",
|
|
644
827
|
ShowAlerts = "showAlerts",
|
|
645
|
-
Locale = "locale"
|
|
828
|
+
Locale = "locale",
|
|
829
|
+
CustomStyle = "customStyle"
|
|
646
830
|
}
|
|
647
831
|
/**
|
|
648
832
|
* The list of actions that can be performed on visual ThoughtSpot
|
|
@@ -803,3 +987,4 @@ export declare enum OperationType {
|
|
|
803
987
|
export interface AnswerServiceType {
|
|
804
988
|
getAnswer?: (offset: number, batchSize: number) => any;
|
|
805
989
|
}
|
|
990
|
+
export {};
|
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 { QueryParams, RuntimeFilter } from './types';
|
|
9
|
+
import { EmbedConfig, QueryParams, RuntimeFilter, CustomisationsInterface } 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:
|
|
@@ -43,3 +43,4 @@ export declare const setAttributes: (element: HTMLElement, attributes: {
|
|
|
43
43
|
[key: string]: string | number | boolean;
|
|
44
44
|
}) => void;
|
|
45
45
|
export declare const checkReleaseVersionInBeta: (releaseVersion: string, suppressBetaWarning: boolean) => boolean;
|
|
46
|
+
export declare const getCustomisations: (embedConfig: EmbedConfig) => CustomisationsInterface;
|