@thoughtspot/visual-embed-sdk 1.35.5-hostEvent.6 → 1.35.5-hostEvent.8
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/cjs/package.json +1 -1
- package/cjs/src/embed/app.d.ts +1 -1
- package/cjs/src/embed/base.d.ts +1 -1
- package/cjs/src/embed/base.js +1 -1
- package/cjs/src/embed/hostEventClient/contracts.d.ts +26 -30
- package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.js +10 -10
- package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts +21 -7
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.js +62 -28
- package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js +43 -39
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +8 -7
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +2 -2
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +4 -2
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +14 -9
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +23 -15
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +4 -4
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/index.d.ts +2 -2
- package/cjs/src/index.js +2 -2
- package/cjs/src/react/all-types-export.d.ts +1 -1
- package/cjs/src/react/all-types-export.js +2 -2
- package/cjs/src/types.d.ts +26 -21
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +20 -19
- package/cjs/src/types.js.map +1 -1
- package/dist/index-DaLHJaLd.js +7370 -0
- package/dist/index-nWevLycs.js +7370 -0
- package/dist/src/embed/app.d.ts +1 -1
- package/dist/src/embed/base.d.ts +1 -1
- package/dist/src/embed/hostEventClient/contracts.d.ts +26 -30
- package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/host-event-client.d.ts +21 -7
- package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +8 -7
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +14 -9
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/react/all-types-export.d.ts +1 -1
- package/dist/src/types.d.ts +26 -21
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +118 -76
- package/dist/tsembed-react.js +117 -75
- package/dist/tsembed.es.js +120 -78
- package/dist/tsembed.js +118 -76
- package/dist/visual-embed-sdk-react-full.d.ts +96 -75
- package/dist/visual-embed-sdk-react.d.ts +96 -75
- package/dist/visual-embed-sdk.d.ts +96 -75
- package/lib/package.json +1 -1
- package/lib/src/embed/app.d.ts +1 -1
- package/lib/src/embed/base.d.ts +1 -1
- package/lib/src/embed/base.js +1 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts +26 -30
- package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.js +9 -9
- package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.d.ts +21 -7
- package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.js +64 -30
- package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.spec.js +43 -40
- package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +8 -7
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +2 -2
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +4 -2
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +14 -9
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +23 -15
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +5 -5
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/index.d.ts +2 -2
- package/lib/src/index.js +2 -2
- package/lib/src/react/all-types-export.d.ts +1 -1
- package/lib/src/react/all-types-export.js +1 -1
- package/lib/src/types.d.ts +26 -21
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +20 -19
- package/lib/src/types.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +99 -78
- package/package.json +1 -1
- package/src/embed/app.ts +1 -1
- package/src/embed/base.ts +1 -1
- package/src/embed/hostEventClient/contracts.ts +43 -32
- package/src/embed/hostEventClient/host-event-client.spec.ts +58 -54
- package/src/embed/hostEventClient/host-event-client.ts +105 -48
- package/src/embed/liveboard.spec.ts +4 -2
- package/src/embed/liveboard.ts +8 -7
- package/src/embed/ts-embed.spec.ts +6 -6
- package/src/embed/ts-embed.ts +39 -28
- package/src/index.ts +2 -2
- package/src/react/all-types-export.ts +1 -1
- package/src/types.ts +26 -21
|
@@ -12,7 +12,7 @@ import EventEmitter from 'eventemitter3';
|
|
|
12
12
|
* @summary ThoughtSpot Visual Embed SDK
|
|
13
13
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
14
14
|
*/
|
|
15
|
-
export { init, logout, prefetch, executeTML, exportTML, executeTMLInput, exportTMLInput, getEmbedConfig as getInitConfig, getSessionInfo, tokenizedFetch, getAnswerFromQuery, createLiveboardWithAnswers, SearchEmbed, SearchBarEmbed, PinboardEmbed, LiveboardEmbed, SageEmbed, AppEmbed, BodylessConversation, BodylessConversationViewConfig, ConversationEmbed, ConversationViewConfig, AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter, AnswerService, SessionInterface, UnderlyingDataPoint, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, ContextMenuTriggerOptions, EmbedConfig, SearchViewConfig, SearchBarViewConfig, LiveboardViewConfig, SageViewConfig, AppViewConfig, PrefetchFeatures, FrameParams, HomeLeftNavItem, HomepageModule, DOMSelector, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, CustomCssVariables, RuntimeParameter, LogLevel, uploadMixpanelEvent, MIXPANEL_EVENT, HomePageSearchBarMode, VizPoint, CustomActionPayload,
|
|
15
|
+
export { init, logout, prefetch, executeTML, exportTML, executeTMLInput, exportTMLInput, getEmbedConfig as getInitConfig, getSessionInfo, tokenizedFetch, getAnswerFromQuery, createLiveboardWithAnswers, SearchEmbed, SearchBarEmbed, PinboardEmbed, LiveboardEmbed, SageEmbed, AppEmbed, BodylessConversation, BodylessConversationViewConfig, ConversationEmbed, ConversationViewConfig, AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter, AnswerService, SessionInterface, UnderlyingDataPoint, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, ContextMenuTriggerOptions, EmbedConfig, SearchViewConfig, SearchBarViewConfig, LiveboardViewConfig, SageViewConfig, AppViewConfig, PrefetchFeatures, FrameParams, HomeLeftNavItem, HomepageModule, DOMSelector, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, CustomCssVariables, RuntimeParameter, LogLevel, uploadMixpanelEvent, MIXPANEL_EVENT, HomePageSearchBarMode, VizPoint, CustomActionPayload, UIPassthroughEvent, };
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Copyright (c) 2022
|
|
@@ -418,7 +418,7 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
|
|
|
418
418
|
*/
|
|
419
419
|
showLiveboardVerifiedBadge?: boolean;
|
|
420
420
|
/**
|
|
421
|
-
* This flag is used to enable/disable hide irrelevant filters in
|
|
421
|
+
* This flag is used to enable/disable hide irrelevant filters in Liveboard tab
|
|
422
422
|
* @type {boolean}
|
|
423
423
|
* @default false
|
|
424
424
|
* @version SDK: 1.36.0 | ThoughtSpot:10.6.0.cl
|
|
@@ -540,7 +540,7 @@ export const prefetch: (url?: string, prefetchFeatures?: PrefetchFeatures[], add
|
|
|
540
540
|
/**
|
|
541
541
|
* Initializes the Visual Embed SDK globally and perform
|
|
542
542
|
* authentication if applicable. This function needs to be called before any ThoughtSpot
|
|
543
|
-
* component like
|
|
543
|
+
* component like Liveboard etc can be embedded. But need not wait for AuthEvent.SUCCESS
|
|
544
544
|
* to actually embed. That is handled internally.
|
|
545
545
|
* @param embedConfig The configuration object containing ThoughtSpot host,
|
|
546
546
|
* authentication mechanism and so on.
|
|
@@ -869,7 +869,7 @@ export interface LiveboardViewConfig extends Omit<ViewConfig, 'hiddenHomepageMod
|
|
|
869
869
|
*/
|
|
870
870
|
enableAskSage?: boolean;
|
|
871
871
|
/**
|
|
872
|
-
* This flag is used to enable the 2 column layout
|
|
872
|
+
* This flag is used to enable the 2 column layout on a Liveboard
|
|
873
873
|
* @type {boolean}
|
|
874
874
|
* @default false
|
|
875
875
|
* @version SDK: 1.32.0 | ThoughtSpot:10.1.0.cl
|
|
@@ -904,7 +904,7 @@ export interface LiveboardViewConfig extends Omit<ViewConfig, 'hiddenHomepageMod
|
|
|
904
904
|
*/
|
|
905
905
|
showPreviewLoader?: boolean;
|
|
906
906
|
/**
|
|
907
|
-
* This flag is used to enable the compact header
|
|
907
|
+
* This flag is used to enable the compact header on a Liveboard
|
|
908
908
|
* @type {boolean}
|
|
909
909
|
* @default false
|
|
910
910
|
* @version SDK: 1.35.0 | ThoughtSpot:10.3.0.cl
|
|
@@ -918,7 +918,7 @@ export interface LiveboardViewConfig extends Omit<ViewConfig, 'hiddenHomepageMod
|
|
|
918
918
|
*/
|
|
919
919
|
isLiveboardCompactHeaderEnabled?: boolean;
|
|
920
920
|
/**
|
|
921
|
-
* This flag is used to show/hide verified
|
|
921
|
+
* This flag is used to show/hide verified icon in the Liveboard compact header
|
|
922
922
|
* @type {boolean}
|
|
923
923
|
* @default true
|
|
924
924
|
* @version SDK: 1.35.0 | ThoughtSpot:10.4.0.cl
|
|
@@ -932,7 +932,8 @@ export interface LiveboardViewConfig extends Omit<ViewConfig, 'hiddenHomepageMod
|
|
|
932
932
|
*/
|
|
933
933
|
showLiveboardVerifiedBadge?: boolean;
|
|
934
934
|
/**
|
|
935
|
-
* This flag is used to show/hide re-verify banner
|
|
935
|
+
* This flag is used to show/hide the re-verify banner
|
|
936
|
+
* in Liveboard compact header
|
|
936
937
|
* @type {boolean}
|
|
937
938
|
* @default true
|
|
938
939
|
* @version SDK: 1.35.0 | ThoughtSpot:10.4.0.cl
|
|
@@ -946,7 +947,7 @@ export interface LiveboardViewConfig extends Omit<ViewConfig, 'hiddenHomepageMod
|
|
|
946
947
|
*/
|
|
947
948
|
showLiveboardReverifyBanner?: boolean;
|
|
948
949
|
/**
|
|
949
|
-
* This flag is used to enable/disable hide irrelevant filters in
|
|
950
|
+
* This flag is used to enable/disable hide irrelevant filters in a Liveboard tab
|
|
950
951
|
* @type {boolean}
|
|
951
952
|
* @default false
|
|
952
953
|
* @version SDK: 1.36.0 | ThoughtSpot:10.6.0.cl
|
|
@@ -1035,8 +1036,8 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
1035
1036
|
render(): Promise<LiveboardEmbed>;
|
|
1036
1037
|
navigateToLiveboard(liveboardId: string, vizId?: string, activeTabId?: string): void;
|
|
1037
1038
|
/**
|
|
1038
|
-
* Returns the full url of the
|
|
1039
|
-
* this
|
|
1039
|
+
* Returns the full url of the Liveboard/visualization which can be used to open
|
|
1040
|
+
* this Liveboard inside the full Thoughtspot application in a new tab.
|
|
1040
1041
|
* @returns url string
|
|
1041
1042
|
*/
|
|
1042
1043
|
getLiveboardUrl(): string;
|
|
@@ -2801,8 +2802,12 @@ export interface ViewConfig {
|
|
|
2801
2802
|
*/
|
|
2802
2803
|
enableCustomColumnGroups?: boolean;
|
|
2803
2804
|
/**
|
|
2804
|
-
*
|
|
2805
|
-
* This
|
|
2805
|
+
* Overrides an Org context for embedding application users.
|
|
2806
|
+
* This parameter allows a user authenticated to one Org to view the
|
|
2807
|
+
* objects from another Org.
|
|
2808
|
+
* The `overrideOrgId` setting is honoured only if the
|
|
2809
|
+
* Per Org URL feature is enabled on your ThoughtSpot instance.
|
|
2810
|
+
*
|
|
2806
2811
|
* @example
|
|
2807
2812
|
* ```js
|
|
2808
2813
|
* const embed = new LiveboardEmbed('#embed', {
|
|
@@ -4059,7 +4064,7 @@ export enum HostEvent {
|
|
|
4059
4064
|
* @param - autoDrillDown - Optional. If true, the drill down will be
|
|
4060
4065
|
* done automatically on the most popular column.
|
|
4061
4066
|
* @param - vizId [TS >= 9.8.0] - Optional. The GUID of the visualization to drill
|
|
4062
|
-
* in case of a
|
|
4067
|
+
* in case of a Liveboard.
|
|
4063
4068
|
* @example
|
|
4064
4069
|
* ```js
|
|
4065
4070
|
* searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
|
|
@@ -4146,26 +4151,26 @@ export enum HostEvent {
|
|
|
4146
4151
|
*/
|
|
4147
4152
|
SetActiveTab = "SetActiveTab",
|
|
4148
4153
|
/**
|
|
4149
|
-
*
|
|
4150
|
-
*
|
|
4151
|
-
* filters.
|
|
4154
|
+
* Updates the runtime filters applied on a Liveboard. The filter
|
|
4155
|
+
* attributes passed with this event are appended to the existing runtime
|
|
4156
|
+
* filters applied on a Liveboard.
|
|
4157
|
+
*
|
|
4152
4158
|
* Pass an array of runtime filters with the following attributes:
|
|
4153
4159
|
*
|
|
4154
|
-
* `columnName`
|
|
4155
|
-
* _String_. The name of the column to filter on.
|
|
4160
|
+
* `columnName` - _String_. The name of the column to filter on.
|
|
4156
4161
|
*
|
|
4157
|
-
* `operator`
|
|
4158
|
-
* Runtime filter operator to apply. For information,
|
|
4162
|
+
* `operator` - Runtime filter operator to apply. For more information,
|
|
4159
4163
|
* see link:https://developers.thoughtspot.com/docs/?pageid=runtime-filters#rtOperator[Developer Documentation].
|
|
4160
4164
|
*
|
|
4161
|
-
* `values`
|
|
4162
|
-
*
|
|
4163
|
-
*
|
|
4165
|
+
* `values` - List of operands. Some operators such as EQ and LE allow a
|
|
4166
|
+
* single value, whereas BW and IN accept multiple values.
|
|
4167
|
+
*
|
|
4168
|
+
* **Note**: `HostEvent.UpdateRuntimeFilters` is supported in `LiveboardEmbed`
|
|
4169
|
+
* and `AppEmbed` only. In full application embedding, this event updates
|
|
4170
|
+
* the runtime filters applied on the Liveboard and saved Answer objects.
|
|
4164
4171
|
*
|
|
4165
|
-
* **Note**: `HostEvent.UpdateRuntimeFilters` is not supported in
|
|
4166
|
-
* Search embedding (SearchEmbed) and Natural Language Search
|
|
4167
|
-
* embedding (SageEmbed).
|
|
4168
4172
|
* @param - {@link RuntimeFilter}[] an array of {@link RuntimeFilter} Types.
|
|
4173
|
+
*
|
|
4169
4174
|
* @example
|
|
4170
4175
|
* ```js
|
|
4171
4176
|
* liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
|
|
@@ -4864,7 +4869,7 @@ export enum HostEvent {
|
|
|
4864
4869
|
*/
|
|
4865
4870
|
ResetLiveboardPersonalisedView = "ResetLiveboardPersonalisedView",
|
|
4866
4871
|
/**
|
|
4867
|
-
* Triggers Update
|
|
4872
|
+
* Triggers an event to Update Parameter values for Answers and Liveboard
|
|
4868
4873
|
* @example
|
|
4869
4874
|
* ```js
|
|
4870
4875
|
* liveboardEmbed.trigger(HostEvent.UpdateParameters, [{
|
|
@@ -4886,7 +4891,7 @@ export enum HostEvent {
|
|
|
4886
4891
|
*/
|
|
4887
4892
|
GetParameters = "GetParameters",
|
|
4888
4893
|
/**
|
|
4889
|
-
* Triggers update
|
|
4894
|
+
* Triggers an event to update a persoanlised view of a Liveboard
|
|
4890
4895
|
* ```js
|
|
4891
4896
|
* liveboardEmbed.trigger(HostEvent.UpdatePersonalisedView, {viewId: '1234'})
|
|
4892
4897
|
* ```
|
|
@@ -4902,7 +4907,7 @@ export enum HostEvent {
|
|
|
4902
4907
|
* EmbedApi
|
|
4903
4908
|
* @hidden
|
|
4904
4909
|
*/
|
|
4905
|
-
|
|
4910
|
+
UIPassthrough = "UiPassthrough"
|
|
4906
4911
|
}
|
|
4907
4912
|
/**
|
|
4908
4913
|
* The different visual modes that the data sources panel within
|
|
@@ -5875,7 +5880,7 @@ export enum Action {
|
|
|
5875
5880
|
*/
|
|
5876
5881
|
ModifySageAnswer = "modifySageAnswer",
|
|
5877
5882
|
/**
|
|
5878
|
-
* The **Move to Tab** menu action on visualizations in
|
|
5883
|
+
* The **Move to Tab** menu action on visualizations in Liveboard edit mode.
|
|
5879
5884
|
* Allows moving a visualization to a different tab.
|
|
5880
5885
|
* @example
|
|
5881
5886
|
* ```js
|
|
@@ -5928,7 +5933,8 @@ export enum Action {
|
|
|
5928
5933
|
*/
|
|
5929
5934
|
TML = "tml",
|
|
5930
5935
|
/**
|
|
5931
|
-
* Action
|
|
5936
|
+
* Action ID for the create Liveboard option on the Liveboard list page
|
|
5937
|
+
* and Pin modal
|
|
5932
5938
|
* @example
|
|
5933
5939
|
* ```js
|
|
5934
5940
|
* hiddenAction: [Action.CreateLiveboard]
|
|
@@ -7061,16 +7067,16 @@ export const getAnswerFromQuery: (query: string, worksheetId: string) => Promise
|
|
|
7061
7067
|
*/
|
|
7062
7068
|
export const createLiveboardWithAnswers: (answers: AnswerService[], name: string) => Promise<any>;
|
|
7063
7069
|
|
|
7064
|
-
export enum
|
|
7065
|
-
|
|
7066
|
-
|
|
7067
|
-
|
|
7068
|
-
|
|
7069
|
-
|
|
7070
|
-
|
|
7070
|
+
export enum UIPassthroughEvent {
|
|
7071
|
+
PinAnswerToLiveboard = "addVizToPinboard",
|
|
7072
|
+
SaveAnswer = "saveAnswer",
|
|
7073
|
+
GetDiscoverabilityStatus = "getDiscoverabilityStatus",
|
|
7074
|
+
GetAvailableUIPassthroughs = "getAvailableUIPassthroughs",
|
|
7075
|
+
GetAnswerConfig = "getAnswerPageConfig",
|
|
7076
|
+
GetLiveboardConfig = "getPinboardPageConfig"
|
|
7071
7077
|
}
|
|
7072
|
-
export type
|
|
7073
|
-
[
|
|
7078
|
+
export type UIPassthroughContractBase = {
|
|
7079
|
+
[UIPassthroughEvent.PinAnswerToLiveboard]: {
|
|
7074
7080
|
request: {
|
|
7075
7081
|
vizId?: string;
|
|
7076
7082
|
newVizName: string;
|
|
@@ -7086,7 +7092,7 @@ export type UiPassthroughContractBase = {
|
|
|
7086
7092
|
vizId: string;
|
|
7087
7093
|
};
|
|
7088
7094
|
};
|
|
7089
|
-
[
|
|
7095
|
+
[UIPassthroughEvent.SaveAnswer]: {
|
|
7090
7096
|
request: {
|
|
7091
7097
|
name: string;
|
|
7092
7098
|
description: string;
|
|
@@ -7095,53 +7101,49 @@ export type UiPassthroughContractBase = {
|
|
|
7095
7101
|
};
|
|
7096
7102
|
response: {
|
|
7097
7103
|
answerId: string;
|
|
7098
|
-
saveResponse
|
|
7104
|
+
saveResponse?: any;
|
|
7099
7105
|
shareResponse?: any;
|
|
7100
|
-
errors?: any;
|
|
7101
7106
|
};
|
|
7102
7107
|
};
|
|
7103
|
-
[
|
|
7108
|
+
[UIPassthroughEvent.GetDiscoverabilityStatus]: {
|
|
7104
7109
|
request: any;
|
|
7105
7110
|
response: {
|
|
7106
7111
|
shouldShowDiscoverability: boolean;
|
|
7107
7112
|
isDiscoverabilityCheckboxUnselectedPerOrg: boolean;
|
|
7108
7113
|
};
|
|
7109
7114
|
};
|
|
7110
|
-
[
|
|
7115
|
+
[UIPassthroughEvent.GetAvailableUIPassthroughs]: {
|
|
7111
7116
|
request: any;
|
|
7112
7117
|
response: {
|
|
7113
7118
|
keys: string[];
|
|
7114
7119
|
};
|
|
7115
7120
|
};
|
|
7116
|
-
[
|
|
7121
|
+
[UIPassthroughEvent.GetAnswerConfig]: {
|
|
7117
7122
|
request: {
|
|
7118
7123
|
vizId?: string;
|
|
7119
7124
|
};
|
|
7120
7125
|
response: any;
|
|
7121
7126
|
};
|
|
7122
|
-
[
|
|
7127
|
+
[UIPassthroughEvent.GetLiveboardConfig]: {
|
|
7123
7128
|
request: any;
|
|
7124
7129
|
response: any;
|
|
7125
7130
|
};
|
|
7126
7131
|
};
|
|
7127
|
-
export type
|
|
7128
|
-
|
|
7129
|
-
|
|
7130
|
-
export type UiPassthroughRequest<T extends keyof UiPassthroughContractBase> = FlattenType<UiPassthroughContractBase[T]['request']>;
|
|
7131
|
-
export type UiPassthroughResponse<T extends keyof UiPassthroughContractBase> = FlattenType<UiPassthroughContractBase[T]['response']>;
|
|
7132
|
-
export type UiPassthroughArrayResponse<ApiName extends keyof UiPassthroughContractBase> = Promise<Array<{
|
|
7132
|
+
export type UIPassthroughRequest<T extends keyof UIPassthroughContractBase> = UIPassthroughContractBase[T]['request'];
|
|
7133
|
+
export type UIPassthroughResponse<T extends keyof UIPassthroughContractBase> = UIPassthroughContractBase[T]['response'];
|
|
7134
|
+
export type UIPassthroughArrayResponse<ApiName extends keyof UIPassthroughContractBase> = Array<{
|
|
7133
7135
|
redId?: string;
|
|
7134
|
-
value?:
|
|
7136
|
+
value?: UIPassthroughResponse<ApiName>;
|
|
7135
7137
|
error?: any;
|
|
7136
|
-
}
|
|
7138
|
+
}>;
|
|
7137
7139
|
export type EmbedApiHostEventMapping = {
|
|
7138
|
-
[HostEvent.Pin]:
|
|
7139
|
-
[HostEvent.SaveAnswer]:
|
|
7140
|
+
[HostEvent.Pin]: UIPassthroughEvent.PinAnswerToLiveboard;
|
|
7141
|
+
[HostEvent.SaveAnswer]: UIPassthroughEvent.SaveAnswer;
|
|
7140
7142
|
};
|
|
7141
|
-
export type HostEventRequest<HostEventT extends HostEvent> = HostEventT extends keyof EmbedApiHostEventMapping ?
|
|
7142
|
-
export type HostEventResponse<HostEventT extends HostEvent> = HostEventT extends keyof EmbedApiHostEventMapping ?
|
|
7143
|
-
|
|
7144
|
-
|
|
7143
|
+
export type HostEventRequest<HostEventT extends HostEvent> = HostEventT extends keyof EmbedApiHostEventMapping ? UIPassthroughRequest<EmbedApiHostEventMapping[HostEventT]> : any;
|
|
7144
|
+
export type HostEventResponse<HostEventT extends HostEvent> = HostEventT extends keyof EmbedApiHostEventMapping ? UIPassthroughResponse<EmbedApiHostEventMapping[HostEventT]> : any;
|
|
7145
|
+
export type TriggerPayload<PayloadT, HostEventT extends HostEvent> = PayloadT | HostEventRequest<HostEventT>;
|
|
7146
|
+
export type TriggerResponse<PayloadT, HostEventT extends HostEvent> = PayloadT extends HostEventRequest<HostEventT> ? HostEventResponse<HostEventT> : any;
|
|
7145
7147
|
|
|
7146
7148
|
/**
|
|
7147
7149
|
*
|
|
@@ -7197,6 +7199,11 @@ export class TsEmbed {
|
|
|
7197
7199
|
* will be rendered.
|
|
7198
7200
|
*/
|
|
7199
7201
|
protected iFrame: HTMLIFrameElement;
|
|
7202
|
+
/**
|
|
7203
|
+
* Setter for the iframe element
|
|
7204
|
+
* @param {HTMLIFrameElement} iFrame HTMLIFrameElement
|
|
7205
|
+
*/
|
|
7206
|
+
protected setIframeElement(iFrame: HTMLIFrameElement): void;
|
|
7200
7207
|
protected viewConfig: ViewConfig;
|
|
7201
7208
|
protected embedConfig: EmbedConfig;
|
|
7202
7209
|
/**
|
|
@@ -7328,19 +7335,19 @@ export class TsEmbed {
|
|
|
7328
7335
|
off(messageType: EmbedEvent, callback: MessageCallback): typeof TsEmbed.prototype;
|
|
7329
7336
|
/**
|
|
7330
7337
|
* Triggers an event to the embedded app
|
|
7331
|
-
* @param messageType The event type
|
|
7332
|
-
* @param data The payload to send with the message
|
|
7338
|
+
* @param {HostEvent} messageType The event type
|
|
7339
|
+
* @param {any} data The payload to send with the message
|
|
7333
7340
|
* @returns A promise that resolves with the response from the embedded app
|
|
7334
7341
|
*/
|
|
7335
|
-
trigger<HostEventT extends HostEvent>(messageType: HostEventT, data?:
|
|
7342
|
+
trigger<HostEventT extends HostEvent, PayloadT>(messageType: HostEventT, data?: TriggerPayload<PayloadT, HostEventT>): Promise<TriggerResponse<PayloadT, HostEventT>>;
|
|
7336
7343
|
/**
|
|
7337
7344
|
* Triggers an event to the embedded app, skipping the UI flow.
|
|
7338
|
-
* @param {
|
|
7339
|
-
* @param {
|
|
7340
|
-
* @returns {Promise<
|
|
7345
|
+
* @param {UIPassthroughEvent} apiName - The name of the API to be triggered.
|
|
7346
|
+
* @param {UIPassthroughRequest} parameters - The parameters to be passed to the API.
|
|
7347
|
+
* @returns {Promise<UIPassthroughRequest>} - A promise that resolves with the response
|
|
7341
7348
|
* from the embedded app.
|
|
7342
7349
|
*/
|
|
7343
|
-
|
|
7350
|
+
triggerUIPassThrough<UIPassthroughEventT extends UIPassthroughEvent>(apiName: UIPassthroughEventT, parameters: UIPassthroughRequest<UIPassthroughEventT>): Promise<UIPassthroughArrayResponse<UIPassthroughEventT>>;
|
|
7344
7351
|
/**
|
|
7345
7352
|
* Marks the ThoughtSpot object to have been rendered
|
|
7346
7353
|
* Needs to be overridden by subclasses to do the actual
|
|
@@ -7414,7 +7421,7 @@ export class TsEmbed {
|
|
|
7414
7421
|
/**
|
|
7415
7422
|
* Returns the answerService which can be used to make arbitrary graphql calls on top
|
|
7416
7423
|
* session.
|
|
7417
|
-
* @param vizId [Optional] to get for a specific viz in case of a
|
|
7424
|
+
* @param vizId [Optional] to get for a specific viz in case of a Liveboard.
|
|
7418
7425
|
* @version SDK: 1.25.0 / ThoughtSpot 9.10.0
|
|
7419
7426
|
*/
|
|
7420
7427
|
getAnswerService(vizId?: string): Promise<AnswerService>;
|
|
@@ -7460,11 +7467,25 @@ export class V1Embed extends TsEmbed {
|
|
|
7460
7467
|
}
|
|
7461
7468
|
|
|
7462
7469
|
export class HostEventClient {
|
|
7463
|
-
|
|
7464
|
-
|
|
7465
|
-
|
|
7466
|
-
|
|
7467
|
-
|
|
7468
|
-
|
|
7470
|
+
iFrame: HTMLIFrameElement;
|
|
7471
|
+
constructor(iFrame?: HTMLIFrameElement);
|
|
7472
|
+
/**
|
|
7473
|
+
* A wrapper over process trigger to
|
|
7474
|
+
* @param {HostEvent} message Host event to send
|
|
7475
|
+
* @param {any} data Data to send with the host event
|
|
7476
|
+
* @returns {Promise<any>} - the response from the process trigger
|
|
7477
|
+
*/
|
|
7478
|
+
protected processTrigger(message: HostEvent, data: any): Promise<any>;
|
|
7479
|
+
handleHostEventWithParam<UIPassthroughEventT extends UIPassthroughEvent>(apiName: UIPassthroughEventT, parameters: UIPassthroughRequest<UIPassthroughEventT>): Promise<UIPassthroughResponse<UIPassthroughEventT>>;
|
|
7480
|
+
hostEventFallback(hostEvent: HostEvent, data: any): Promise<any>;
|
|
7481
|
+
/**
|
|
7482
|
+
* Setter for the iframe element used for host events
|
|
7483
|
+
* @param {HTMLIFrameElement} iFrame - the iframe element to set
|
|
7484
|
+
*/
|
|
7485
|
+
setIframeElement(iFrame: HTMLIFrameElement): void;
|
|
7486
|
+
triggerUIPassthroughApi<UIPassthroughEventT extends UIPassthroughEvent>(apiName: UIPassthroughEventT, parameters: UIPassthroughRequest<UIPassthroughEventT>): Promise<UIPassthroughArrayResponse<UIPassthroughEventT>>;
|
|
7487
|
+
protected handlePinEvent(payload: HostEventRequest<HostEvent.Pin>): Promise<HostEventResponse<HostEvent.Pin>>;
|
|
7488
|
+
protected handleSaveAnswerEvent(payload: HostEventRequest<HostEvent.SaveAnswer>): Promise<any>;
|
|
7489
|
+
triggerHostEvent<HostEventT extends HostEvent, PayloadT>(hostEvent: HostEventT, payload?: TriggerPayload<PayloadT, HostEventT>): Promise<TriggerResponse<PayloadT, HostEventT>>;
|
|
7469
7490
|
}
|
|
7470
7491
|
|
package/lib/package.json
CHANGED
package/lib/src/embed/app.d.ts
CHANGED
|
@@ -404,7 +404,7 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
|
|
|
404
404
|
*/
|
|
405
405
|
showLiveboardVerifiedBadge?: boolean;
|
|
406
406
|
/**
|
|
407
|
-
* This flag is used to enable/disable hide irrelevant filters in
|
|
407
|
+
* This flag is used to enable/disable hide irrelevant filters in Liveboard tab
|
|
408
408
|
* @type {boolean}
|
|
409
409
|
* @default false
|
|
410
410
|
* @version SDK: 1.36.0 | ThoughtSpot:10.6.0.cl
|
package/lib/src/embed/base.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export declare const prefetch: (url?: string, prefetchFeatures?: PrefetchFeature
|
|
|
37
37
|
/**
|
|
38
38
|
* Initializes the Visual Embed SDK globally and perform
|
|
39
39
|
* authentication if applicable. This function needs to be called before any ThoughtSpot
|
|
40
|
-
* component like
|
|
40
|
+
* component like Liveboard etc can be embedded. But need not wait for AuthEvent.SUCCESS
|
|
41
41
|
* to actually embed. That is handled internally.
|
|
42
42
|
* @param embedConfig The configuration object containing ThoughtSpot host,
|
|
43
43
|
* authentication mechanism and so on.
|
package/lib/src/embed/base.js
CHANGED
|
@@ -120,7 +120,7 @@ function backwardCompat(embedConfig) {
|
|
|
120
120
|
/**
|
|
121
121
|
* Initializes the Visual Embed SDK globally and perform
|
|
122
122
|
* authentication if applicable. This function needs to be called before any ThoughtSpot
|
|
123
|
-
* component like
|
|
123
|
+
* component like Liveboard etc can be embedded. But need not wait for AuthEvent.SUCCESS
|
|
124
124
|
* to actually embed. That is handled internally.
|
|
125
125
|
* @param embedConfig The configuration object containing ThoughtSpot host,
|
|
126
126
|
* authentication mechanism and so on.
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { HostEvent } from '../../types';
|
|
2
|
-
export declare enum
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
export declare enum UIPassthroughEvent {
|
|
3
|
+
PinAnswerToLiveboard = "addVizToPinboard",
|
|
4
|
+
SaveAnswer = "saveAnswer",
|
|
5
|
+
GetDiscoverabilityStatus = "getDiscoverabilityStatus",
|
|
6
|
+
GetAvailableUIPassthroughs = "getAvailableUIPassthroughs",
|
|
7
|
+
GetAnswerConfig = "getAnswerPageConfig",
|
|
8
|
+
GetLiveboardConfig = "getPinboardPageConfig"
|
|
9
9
|
}
|
|
10
|
-
export type
|
|
11
|
-
[
|
|
10
|
+
export type UIPassthroughContractBase = {
|
|
11
|
+
[UIPassthroughEvent.PinAnswerToLiveboard]: {
|
|
12
12
|
request: {
|
|
13
13
|
vizId?: string;
|
|
14
14
|
newVizName: string;
|
|
@@ -24,7 +24,7 @@ export type UiPassthroughContractBase = {
|
|
|
24
24
|
vizId: string;
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
|
-
[
|
|
27
|
+
[UIPassthroughEvent.SaveAnswer]: {
|
|
28
28
|
request: {
|
|
29
29
|
name: string;
|
|
30
30
|
description: string;
|
|
@@ -33,51 +33,47 @@ export type UiPassthroughContractBase = {
|
|
|
33
33
|
};
|
|
34
34
|
response: {
|
|
35
35
|
answerId: string;
|
|
36
|
-
saveResponse
|
|
36
|
+
saveResponse?: any;
|
|
37
37
|
shareResponse?: any;
|
|
38
|
-
errors?: any;
|
|
39
38
|
};
|
|
40
39
|
};
|
|
41
|
-
[
|
|
40
|
+
[UIPassthroughEvent.GetDiscoverabilityStatus]: {
|
|
42
41
|
request: any;
|
|
43
42
|
response: {
|
|
44
43
|
shouldShowDiscoverability: boolean;
|
|
45
44
|
isDiscoverabilityCheckboxUnselectedPerOrg: boolean;
|
|
46
45
|
};
|
|
47
46
|
};
|
|
48
|
-
[
|
|
47
|
+
[UIPassthroughEvent.GetAvailableUIPassthroughs]: {
|
|
49
48
|
request: any;
|
|
50
49
|
response: {
|
|
51
50
|
keys: string[];
|
|
52
51
|
};
|
|
53
52
|
};
|
|
54
|
-
[
|
|
53
|
+
[UIPassthroughEvent.GetAnswerConfig]: {
|
|
55
54
|
request: {
|
|
56
55
|
vizId?: string;
|
|
57
56
|
};
|
|
58
57
|
response: any;
|
|
59
58
|
};
|
|
60
|
-
[
|
|
59
|
+
[UIPassthroughEvent.GetLiveboardConfig]: {
|
|
61
60
|
request: any;
|
|
62
61
|
response: any;
|
|
63
62
|
};
|
|
64
63
|
};
|
|
65
|
-
export type
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
export type UiPassthroughRequest<T extends keyof UiPassthroughContractBase> = FlattenType<UiPassthroughContractBase[T]['request']>;
|
|
69
|
-
export type UiPassthroughResponse<T extends keyof UiPassthroughContractBase> = FlattenType<UiPassthroughContractBase[T]['response']>;
|
|
70
|
-
export type UiPassthroughArrayResponse<ApiName extends keyof UiPassthroughContractBase> = Promise<Array<{
|
|
64
|
+
export type UIPassthroughRequest<T extends keyof UIPassthroughContractBase> = UIPassthroughContractBase[T]['request'];
|
|
65
|
+
export type UIPassthroughResponse<T extends keyof UIPassthroughContractBase> = UIPassthroughContractBase[T]['response'];
|
|
66
|
+
export type UIPassthroughArrayResponse<ApiName extends keyof UIPassthroughContractBase> = Array<{
|
|
71
67
|
redId?: string;
|
|
72
|
-
value?:
|
|
68
|
+
value?: UIPassthroughResponse<ApiName>;
|
|
73
69
|
error?: any;
|
|
74
|
-
}
|
|
70
|
+
}>;
|
|
75
71
|
export type EmbedApiHostEventMapping = {
|
|
76
|
-
[HostEvent.Pin]:
|
|
77
|
-
[HostEvent.SaveAnswer]:
|
|
72
|
+
[HostEvent.Pin]: UIPassthroughEvent.PinAnswerToLiveboard;
|
|
73
|
+
[HostEvent.SaveAnswer]: UIPassthroughEvent.SaveAnswer;
|
|
78
74
|
};
|
|
79
|
-
export type HostEventRequest<HostEventT extends HostEvent> = HostEventT extends keyof EmbedApiHostEventMapping ?
|
|
80
|
-
export type HostEventResponse<HostEventT extends HostEvent> = HostEventT extends keyof EmbedApiHostEventMapping ?
|
|
81
|
-
|
|
82
|
-
|
|
75
|
+
export type HostEventRequest<HostEventT extends HostEvent> = HostEventT extends keyof EmbedApiHostEventMapping ? UIPassthroughRequest<EmbedApiHostEventMapping[HostEventT]> : any;
|
|
76
|
+
export type HostEventResponse<HostEventT extends HostEvent> = HostEventT extends keyof EmbedApiHostEventMapping ? UIPassthroughResponse<EmbedApiHostEventMapping[HostEventT]> : any;
|
|
77
|
+
export type TriggerPayload<PayloadT, HostEventT extends HostEvent> = PayloadT | HostEventRequest<HostEventT>;
|
|
78
|
+
export type TriggerResponse<PayloadT, HostEventT extends HostEvent> = PayloadT extends HostEventRequest<HostEventT> ? HostEventResponse<HostEventT> : any;
|
|
83
79
|
//# sourceMappingURL=contracts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../../../src/embed/hostEventClient/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,oBAAY,kBAAkB;IAC5B,
|
|
1
|
+
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../../../src/embed/hostEventClient/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,oBAAY,kBAAkB;IAC5B,oBAAoB,qBAAqB;IACzC,UAAU,eAAe;IACzB,wBAAwB,6BAA6B;IACrD,0BAA0B,+BAA+B;IACzD,eAAe,wBAAwB;IACvC,kBAAkB,0BAA0B;CAC7C;AAGD,MAAM,MAAM,yBAAyB,GAAG;IACtC,CAAC,kBAAkB,CAAC,oBAAoB,CAAC,EAAE;QACzC,OAAO,EAAE;YACP,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,UAAU,EAAE,MAAM,CAAC;YACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;YAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;YACpB,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,eAAe,CAAC,E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
(function (
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
})(
|
|
2
|
+
export var UIPassthroughEvent;
|
|
3
|
+
(function (UIPassthroughEvent) {
|
|
4
|
+
UIPassthroughEvent["PinAnswerToLiveboard"] = "addVizToPinboard";
|
|
5
|
+
UIPassthroughEvent["SaveAnswer"] = "saveAnswer";
|
|
6
|
+
UIPassthroughEvent["GetDiscoverabilityStatus"] = "getDiscoverabilityStatus";
|
|
7
|
+
UIPassthroughEvent["GetAvailableUIPassthroughs"] = "getAvailableUIPassthroughs";
|
|
8
|
+
UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
|
|
9
|
+
UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
|
|
10
|
+
})(UIPassthroughEvent || (UIPassthroughEvent = {}));
|
|
11
11
|
//# sourceMappingURL=contracts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../../../src/embed/hostEventClient/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,CAAN,IAAY,kBAOX;AAPD,WAAY,kBAAkB;IAC5B,
|
|
1
|
+
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../../../src/embed/hostEventClient/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,CAAN,IAAY,kBAOX;AAPD,WAAY,kBAAkB;IAC5B,+DAAyC,CAAA;IACzC,+CAAyB,CAAA;IACzB,2EAAqD,CAAA;IACrD,+EAAyD,CAAA;IACzD,6DAAuC,CAAA;IACvC,kEAA4C,CAAA;AAC9C,CAAC,EAPW,kBAAkB,KAAlB,kBAAkB,QAO7B"}
|
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
import { HostEvent } from '../../types';
|
|
2
|
-
import {
|
|
2
|
+
import { UIPassthroughArrayResponse, UIPassthroughEvent, HostEventRequest, HostEventResponse, UIPassthroughRequest, UIPassthroughResponse, TriggerPayload, TriggerResponse } from './contracts';
|
|
3
3
|
export declare class HostEventClient {
|
|
4
|
-
|
|
5
|
-
constructor(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
iFrame: HTMLIFrameElement;
|
|
5
|
+
constructor(iFrame?: HTMLIFrameElement);
|
|
6
|
+
/**
|
|
7
|
+
* A wrapper over process trigger to
|
|
8
|
+
* @param {HostEvent} message Host event to send
|
|
9
|
+
* @param {any} data Data to send with the host event
|
|
10
|
+
* @returns {Promise<any>} - the response from the process trigger
|
|
11
|
+
*/
|
|
12
|
+
protected processTrigger(message: HostEvent, data: any): Promise<any>;
|
|
13
|
+
handleHostEventWithParam<UIPassthroughEventT extends UIPassthroughEvent>(apiName: UIPassthroughEventT, parameters: UIPassthroughRequest<UIPassthroughEventT>): Promise<UIPassthroughResponse<UIPassthroughEventT>>;
|
|
14
|
+
hostEventFallback(hostEvent: HostEvent, data: any): Promise<any>;
|
|
15
|
+
/**
|
|
16
|
+
* Setter for the iframe element used for host events
|
|
17
|
+
* @param {HTMLIFrameElement} iFrame - the iframe element to set
|
|
18
|
+
*/
|
|
19
|
+
setIframeElement(iFrame: HTMLIFrameElement): void;
|
|
20
|
+
triggerUIPassthroughApi<UIPassthroughEventT extends UIPassthroughEvent>(apiName: UIPassthroughEventT, parameters: UIPassthroughRequest<UIPassthroughEventT>): Promise<UIPassthroughArrayResponse<UIPassthroughEventT>>;
|
|
21
|
+
protected handlePinEvent(payload: HostEventRequest<HostEvent.Pin>): Promise<HostEventResponse<HostEvent.Pin>>;
|
|
22
|
+
protected handleSaveAnswerEvent(payload: HostEventRequest<HostEvent.SaveAnswer>): Promise<any>;
|
|
23
|
+
triggerHostEvent<HostEventT extends HostEvent, PayloadT>(hostEvent: HostEventT, payload?: TriggerPayload<PayloadT, HostEventT>): Promise<TriggerResponse<PayloadT, HostEventT>>;
|
|
10
24
|
}
|
|
11
25
|
//# sourceMappingURL=host-event-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host-event-client.d.ts","sourceRoot":"","sources":["../../../../src/embed/hostEventClient/host-event-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"host-event-client.d.ts","sourceRoot":"","sources":["../../../../src/embed/hostEventClient/host-event-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,OAAO,EACH,0BAA0B,EAC1B,kBAAkB,EAAE,gBAAgB,EAAE,iBAAiB,EACvD,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,EACd,eAAe,EAClB,MAAM,aAAa,CAAC;AAErB,qBAAa,eAAe;IAC1B,MAAM,EAAE,iBAAiB,CAAC;gBAEd,MAAM,CAAC,EAAE,iBAAiB;IAItC;;;;;OAKG;cACa,cAAc,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAc9D,wBAAwB,CAAC,mBAAmB,SAAS,kBAAkB,EAChF,OAAO,EAAE,mBAAmB,EAC5B,UAAU,EAAE,oBAAoB,CAAC,mBAAmB,CAAC,GACtD,OAAO,CAAC,qBAAqB,CAAC,mBAAmB,CAAC,CAAC;IAsBzC,iBAAiB,CAC1B,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,GAAG,GACV,OAAO,CAAC,GAAG,CAAC;IAIf;;;OAGG;IACI,gBAAgB,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI;IAI3C,uBAAuB,CAAC,mBAAmB,SAAS,kBAAkB,EAC/E,OAAO,EAAE,mBAAmB,EAC5B,UAAU,EAAE,oBAAoB,CAAC,mBAAmB,CAAC,GACtD,OAAO,CAAC,0BAA0B,CAAC,mB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