@wildix/xbees-connect 1.3.2 → 1.3.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/package.json +4 -4
- package/dist-cjs/index.js +0 -27
- package/dist-cjs/package.json +0 -48
- package/dist-cjs/src/Client.js +0 -485
- package/dist-cjs/src/enums/index.js +0 -73
- package/dist-cjs/src/helpers/ClientParams.js +0 -37
- package/dist-cjs/src/helpers/LocalStorageManager.js +0 -74
- package/dist-cjs/src/helpers/MessageListener.js +0 -85
- package/dist-cjs/src/helpers/PostMessageController.js +0 -48
- package/dist-cjs/src/helpers/PostMessageControllerNative.js +0 -47
- package/dist-cjs/src/helpers/PostMessageControllerWeb.js +0 -36
- package/dist-cjs/src/helpers/TechnicalSupport.js +0 -30
- package/dist-cjs/src/utils/url/getUrlSearchParamsMap.js +0 -7
- package/dist-cjs/types/AvailableContactData.js +0 -2
- package/dist-cjs/types/Callback.js +0 -2
- package/dist-cjs/types/Client.js +0 -2
- package/dist-cjs/types/Contact.js +0 -2
- package/dist-cjs/types/Event.js +0 -3
- package/dist-cjs/types/Json.js +0 -2
- package/dist-cjs/types/Listener.js +0 -2
- package/dist-cjs/types/Message.js +0 -2
- package/dist-cjs/types/MessageSender.js +0 -2
- package/dist-cjs/types/Payload.js +0 -2
- package/dist-cjs/types/Platform.js +0 -9
- package/dist-cjs/types/Resolver.js +0 -2
- package/dist-cjs/types/Storage.js +0 -2
- package/dist-cjs/types/Toast.js +0 -2
- package/dist-cjs/types/WorkVariant.js +0 -2
- package/dist-cjs/types/XBeesUser.js +0 -2
- package/dist-cjs/types/conversation.js +0 -2
- package/dist-cjs/types/index.js +0 -5
- package/dist-es/index.js +0 -6
- package/dist-es/package.json +0 -48
- package/dist-es/src/Client.js +0 -478
- package/dist-es/src/enums/index.js +0 -70
- package/dist-es/src/helpers/ClientParams.js +0 -34
- package/dist-es/src/helpers/LocalStorageManager.js +0 -72
- package/dist-es/src/helpers/MessageListener.js +0 -81
- package/dist-es/src/helpers/PostMessageController.js +0 -42
- package/dist-es/src/helpers/PostMessageControllerNative.js +0 -44
- package/dist-es/src/helpers/PostMessageControllerWeb.js +0 -33
- package/dist-es/src/helpers/TechnicalSupport.js +0 -25
- package/dist-es/src/utils/url/getUrlSearchParamsMap.js +0 -3
- package/dist-es/types/AvailableContactData.js +0 -1
- package/dist-es/types/Callback.js +0 -1
- package/dist-es/types/Client.js +0 -1
- package/dist-es/types/Contact.js +0 -1
- package/dist-es/types/Event.js +0 -1
- package/dist-es/types/Json.js +0 -1
- package/dist-es/types/Listener.js +0 -1
- package/dist-es/types/Message.js +0 -1
- package/dist-es/types/MessageSender.js +0 -1
- package/dist-es/types/Payload.js +0 -1
- package/dist-es/types/Platform.js +0 -6
- package/dist-es/types/Resolver.js +0 -1
- package/dist-es/types/Storage.js +0 -1
- package/dist-es/types/Toast.js +0 -1
- package/dist-es/types/WorkVariant.js +0 -1
- package/dist-es/types/XBeesUser.js +0 -1
- package/dist-es/types/conversation.js +0 -1
- package/dist-es/types/index.js +0 -1
- package/dist-types/index.d.ts +0 -6
- package/dist-types/src/Client.d.ts +0 -116
- package/dist-types/src/enums/index.d.ts +0 -66
- package/dist-types/src/helpers/ClientParams.d.ts +0 -16
- package/dist-types/src/helpers/LocalStorageManager.d.ts +0 -20
- package/dist-types/src/helpers/MessageListener.d.ts +0 -14
- package/dist-types/src/helpers/PostMessageController.d.ts +0 -13
- package/dist-types/src/helpers/PostMessageControllerNative.d.ts +0 -8
- package/dist-types/src/helpers/PostMessageControllerWeb.d.ts +0 -8
- package/dist-types/src/helpers/TechnicalSupport.d.ts +0 -9
- package/dist-types/src/utils/url/getUrlSearchParamsMap.d.ts +0 -1
- package/dist-types/types/AvailableContactData.d.ts +0 -4
- package/dist-types/types/Callback.d.ts +0 -4
- package/dist-types/types/Client.d.ts +0 -222
- package/dist-types/types/Contact.d.ts +0 -24
- package/dist-types/types/Event.d.ts +0 -39
- package/dist-types/types/Json.d.ts +0 -6
- package/dist-types/types/Listener.d.ts +0 -7
- package/dist-types/types/Message.d.ts +0 -14
- package/dist-types/types/MessageSender.d.ts +0 -4
- package/dist-types/types/Payload.d.ts +0 -91
- package/dist-types/types/Platform.d.ts +0 -5
- package/dist-types/types/Resolver.d.ts +0 -5
- package/dist-types/types/Storage.d.ts +0 -1
- package/dist-types/types/Toast.d.ts +0 -1
- package/dist-types/types/WorkVariant.d.ts +0 -3
- package/dist-types/types/XBeesUser.d.ts +0 -7
- package/dist-types/types/conversation.d.ts +0 -4
- package/dist-types/types/index.d.ts +0 -16
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
import { ClientEventType, EventType, StartPage } from '../src/enums';
|
|
2
|
-
import TechnicalSupport from '../src/helpers/TechnicalSupport';
|
|
3
|
-
import { Callback } from './Callback';
|
|
4
|
-
import { Contact, ContactQuery } from './Contact';
|
|
5
|
-
import { ReadyExtendedProps } from './Event';
|
|
6
|
-
import { JSONValue } from './Json';
|
|
7
|
-
import { RemoveEventListener } from './Listener';
|
|
8
|
-
import { ResponseMessage } from './Message';
|
|
9
|
-
import { IPayloadViewPort } from './Payload';
|
|
10
|
-
import { SupportedPlatformVariant } from './Platform';
|
|
11
|
-
import { LookupAndMatchBatchContactsResolver, LookupAndMatchContactsResolver, Reject, SuggestContactsResolver } from './Resolver';
|
|
12
|
-
import { StorageEventCallback } from './Storage';
|
|
13
|
-
import { ToastSeverity } from './Toast';
|
|
14
|
-
import { XBeesUser } from './XBeesUser';
|
|
15
|
-
export interface ConnectClient {
|
|
16
|
-
/**
|
|
17
|
-
* Sends to x-bees signal that iFrame is ready to be shown. iFrame should send it when the application starts and ready */
|
|
18
|
-
ready: (props?: SupportedPlatformVariant | ReadyExtendedProps) => Promise<ResponseMessage>;
|
|
19
|
-
/**
|
|
20
|
-
* Retrieves current pbx token */
|
|
21
|
-
getUserPbxToken: () => string;
|
|
22
|
-
/**
|
|
23
|
-
* Retrieves current user's email */
|
|
24
|
-
getUserEmail: () => string;
|
|
25
|
-
/**
|
|
26
|
-
* Retrieves current user's data */
|
|
27
|
-
getXBeesUser: () => XBeesUser | null;
|
|
28
|
-
/**
|
|
29
|
-
* Retrieves current pbx domain */
|
|
30
|
-
getPbxDomain: () => string;
|
|
31
|
-
/**
|
|
32
|
-
* Retrieves current user's extension */
|
|
33
|
-
getUserExtension: () => string | null;
|
|
34
|
-
/**
|
|
35
|
-
* Retrieves url for x-bees app which uses integration */
|
|
36
|
-
getReferrer: () => string;
|
|
37
|
-
/**
|
|
38
|
-
* Retrieves url to get back to x-bees app integration */
|
|
39
|
-
getBackToAppUrl: () => string;
|
|
40
|
-
/**
|
|
41
|
-
* Retrieves start page from url */
|
|
42
|
-
getStartPage: () => StartPage | null;
|
|
43
|
-
/**
|
|
44
|
-
* Retrieves the version of xBeesConnect */
|
|
45
|
-
version: () => string;
|
|
46
|
-
/**
|
|
47
|
-
* Indicates whether the UI iframe with the integration is currently active */
|
|
48
|
-
isVisible: () => boolean;
|
|
49
|
-
/**
|
|
50
|
-
* Determines x-bees is running on mobile native platform */
|
|
51
|
-
isPlatformNative: () => boolean;
|
|
52
|
-
/**
|
|
53
|
-
* Determines x-bees is running on web browser platform */
|
|
54
|
-
isPlatformWeb: () => boolean;
|
|
55
|
-
/**
|
|
56
|
-
* Determines application is opened as x-bees child in Browser iFrame or Native WebView */
|
|
57
|
-
isOpenedFromXBees: () => boolean;
|
|
58
|
-
/**
|
|
59
|
-
* Determines x-bees is using this connect for messages only and this integration will not be shown on UI */
|
|
60
|
-
isDataOnly: () => boolean;
|
|
61
|
-
/**
|
|
62
|
-
* Determines x-bees is using this connect for show dialog of setup flow */
|
|
63
|
-
isSetupDialog: () => boolean;
|
|
64
|
-
/**
|
|
65
|
-
* Determines x-bees is using this connect for representation on UI and this integration will be shown on UI
|
|
66
|
-
* this opposite to {@link isDataOnly} */
|
|
67
|
-
showsUi: () => boolean;
|
|
68
|
-
/**
|
|
69
|
-
* Determines x-bees is using this connect in fullsize mode */
|
|
70
|
-
isFullsize: () => boolean;
|
|
71
|
-
/**
|
|
72
|
-
* Determines x-bees is using this connect for activation/authorization on UI and this call of integration UI should show
|
|
73
|
-
* dialog which leads to integration be activated
|
|
74
|
-
* */
|
|
75
|
-
isActivationOnly: () => boolean;
|
|
76
|
-
/**
|
|
77
|
-
* Retrieves current x-bees context data */
|
|
78
|
-
getContext: () => Promise<ResponseMessage<ClientEventType.CONTEXT>>;
|
|
79
|
-
/**
|
|
80
|
-
* Retrieves current opened in x-bees contact data */
|
|
81
|
-
getCurrentContact: () => Promise<ResponseMessage<ClientEventType.CURRENT_CONTACT>>;
|
|
82
|
-
/**
|
|
83
|
-
* Retrieves current opened in x-bees conversation data or undefined if the conversation is temporary */
|
|
84
|
-
getCurrentConversation: () => Promise<ResponseMessage<ClientEventType.CURRENT_CONVERSATION>>;
|
|
85
|
-
/**
|
|
86
|
-
* Retrieves available contact data from x-bees */
|
|
87
|
-
getAvailableContactData: () => Promise<ResponseMessage<ClientEventType.AVAILABLE_CONTACT_DATA>>;
|
|
88
|
-
/**
|
|
89
|
-
* Sends notification to x-bees about contact data updated */
|
|
90
|
-
contactUpdated(query: ContactQuery, contact: Contact): Promise<ResponseMessage<ClientEventType.CONTACT_CREATE_OR_UPDATE>>;
|
|
91
|
-
/**
|
|
92
|
-
* Sends notification to x-bees about contact match was updated */
|
|
93
|
-
contactMatchUpdated(query: ContactQuery, contact: Contact): Promise<ResponseMessage<ClientEventType.CONTACT_MATCH_UPDATE>>;
|
|
94
|
-
/**
|
|
95
|
-
* Retrieves current theme mode (light or dark) */
|
|
96
|
-
getThemeMode: () => Promise<ResponseMessage<ClientEventType.THEME_MODE>>;
|
|
97
|
-
/**
|
|
98
|
-
* Retrieves current theme with mode (light or dark) and theme options like typography settings and palette */
|
|
99
|
-
getTheme: () => Promise<ResponseMessage<ClientEventType.THEME>>;
|
|
100
|
-
/**
|
|
101
|
-
* Sends request to x-bees to start a call with the number */
|
|
102
|
-
startCall: (phoneNumber: string) => Promise<ResponseMessage>;
|
|
103
|
-
/**
|
|
104
|
-
* Sends request to x-bees to restart the iFrame, reload with actual params and token */
|
|
105
|
-
reboot: () => Promise<ResponseMessage>;
|
|
106
|
-
/**
|
|
107
|
-
* Sends request to x-bees about current frame size change */
|
|
108
|
-
setViewport: (payload: IPayloadViewPort) => Promise<ResponseMessage>;
|
|
109
|
-
/**
|
|
110
|
-
* Sends request to x-bees to put string to the users clipboard */
|
|
111
|
-
toClipboard: (payload: string) => Promise<ResponseMessage>;
|
|
112
|
-
/**
|
|
113
|
-
* Sends message to x-bees to be shown as a toast with specified severity level */
|
|
114
|
-
showToast: (message: string, severity?: ToastSeverity) => Promise<ResponseMessage>;
|
|
115
|
-
/**
|
|
116
|
-
* pushes to x-bees message that user is authorized and no more actions required */
|
|
117
|
-
isAuthorized: () => Promise<ResponseMessage>;
|
|
118
|
-
/**
|
|
119
|
-
* pushes to x-bees message that user actions required */
|
|
120
|
-
isNotAuthorized: () => Promise<ResponseMessage>;
|
|
121
|
-
/**
|
|
122
|
-
* Starts listen for one of the events of the x-bees and handle with the provided callback */
|
|
123
|
-
addEventListener: <T extends EventType = EventType>(eventName: T, callback: Callback<T>) => RemoveEventListener;
|
|
124
|
-
/**
|
|
125
|
-
* Stops listen for one of the events of the x-bees with this particular callback */
|
|
126
|
-
removeEventListener: <T extends EventType = EventType>(eventName: T, callback: Callback<T>) => void;
|
|
127
|
-
/**
|
|
128
|
-
* Starts listen for the events of changing theme and handle with the provided callback */
|
|
129
|
-
onThemeChange: (callback: Callback<EventType.USE_THEME>) => RemoveEventListener;
|
|
130
|
-
/**
|
|
131
|
-
* Starts listen for the events of changing pbx token and handle with the provided callback */
|
|
132
|
-
onPbxTokenChange: (callback: Callback<EventType.PBX_TOKEN>) => RemoveEventListener;
|
|
133
|
-
/**
|
|
134
|
-
* Retrieves current x-bees token */
|
|
135
|
-
getXBeesToken: () => Promise<ResponseMessage<ClientEventType.TOKEN>>;
|
|
136
|
-
/**
|
|
137
|
-
* Starts listen for the events of searching contacts and handle autosuggestion with the provided callback */
|
|
138
|
-
onSuggestContacts: (callback: (query: string, resolve: SuggestContactsResolver, reject: Reject) => void) => RemoveEventListener;
|
|
139
|
-
/**
|
|
140
|
-
* Starts listen for the events of searching contact info and handle match with the provided callback */
|
|
141
|
-
onLookupAndMatchContact: (callback: (query: ContactQuery, resolve: LookupAndMatchContactsResolver, reject: Reject) => void) => RemoveEventListener;
|
|
142
|
-
/**
|
|
143
|
-
* Starts listen for the events of searching batch contacts info and handle match with the provided callback */
|
|
144
|
-
onLookupAndMatchBatchContacts: (callback: (queries: ContactQuery[], returnResults: LookupAndMatchBatchContactsResolver) => void) => RemoveEventListener;
|
|
145
|
-
/**
|
|
146
|
-
* Send event for indicate if create contact functionality is supported */
|
|
147
|
-
createContactIsSupported: () => Promise<ResponseMessage>;
|
|
148
|
-
/**
|
|
149
|
-
* Send event for indicate if user has no permission to create contact */
|
|
150
|
-
createContactHasNoPermission: () => Promise<ResponseMessage>;
|
|
151
|
-
/**
|
|
152
|
-
* Starts listen for the events of starting the call and handle with the provided callback */
|
|
153
|
-
onCallStarted: (callback: Callback<EventType.ADD_CALL>) => RemoveEventListener;
|
|
154
|
-
/**
|
|
155
|
-
* Starts listen for the events of ending the call and handle with the provided callback */
|
|
156
|
-
onCallEnded: (callback: Callback<EventType.TERMINATE_CALL>) => RemoveEventListener;
|
|
157
|
-
/**
|
|
158
|
-
* Starts listen for redirect query message which fires when user opens app with deeplink to integration */
|
|
159
|
-
onRedirectQuery: (callback: Callback<EventType.REDIRECT_QUERY>) => RemoveEventListener;
|
|
160
|
-
/**
|
|
161
|
-
* Removes particular callback from handling events */
|
|
162
|
-
off: (callback: Callback | StorageEventCallback) => void;
|
|
163
|
-
/**
|
|
164
|
-
* saves data to localStorage */
|
|
165
|
-
saveToStorage: <SavingType>(key: string, value: SavingType) => void;
|
|
166
|
-
/**
|
|
167
|
-
* Retrieves data from localStorage */
|
|
168
|
-
getFromStorage: <Type>(key: string) => Type | null;
|
|
169
|
-
/**
|
|
170
|
-
* Removes data from localStorage */
|
|
171
|
-
deleteFromStorage: (key: string) => void;
|
|
172
|
-
/**
|
|
173
|
-
* Set parent integration key to switch to parent integration localStorage data */
|
|
174
|
-
setIntegrationStorageKey: (integrationKey: string) => void;
|
|
175
|
-
/**
|
|
176
|
-
* listens on localStorage */
|
|
177
|
-
onStorage: (listener: StorageEventCallback) => () => void;
|
|
178
|
-
/**
|
|
179
|
-
* starts listen on logout event and send event to the x-bees about logout able */
|
|
180
|
-
onLogout: (callback: Callback<EventType.LOGOUT>) => RemoveEventListener;
|
|
181
|
-
/**
|
|
182
|
-
* send analytics data to x-bees for track into analytics data */
|
|
183
|
-
sendAnalytics: (eventName: string, params?: Record<string, string>) => void;
|
|
184
|
-
/**
|
|
185
|
-
* special object to provide x-bees technical support */
|
|
186
|
-
getTechnicalSupport: () => TechnicalSupport;
|
|
187
|
-
/**
|
|
188
|
-
* Starts listen for the events of changing iframe activity and handle with the provided callback */
|
|
189
|
-
onVisibilityChange: (callback: Callback<EventType.VISIBILITY>) => RemoveEventListener;
|
|
190
|
-
/**
|
|
191
|
-
* Send data to save in x-bees storage */
|
|
192
|
-
saveInXbeesStorage: <SavingType>(key: string, value: SavingType) => void;
|
|
193
|
-
/**
|
|
194
|
-
* Request stored data from x-bees storage */
|
|
195
|
-
getFromXbeesStorage: (key: string) => Promise<ResponseMessage<ClientEventType.GET_FROM_STORAGE>>;
|
|
196
|
-
/**
|
|
197
|
-
* Remove data from x-bees storage */
|
|
198
|
-
removeFromXbeesStorage: (key: string) => void;
|
|
199
|
-
/**
|
|
200
|
-
* Send to xbees dropdown status when it is actioned for change Webview nestedScrollEnabled (Android)
|
|
201
|
-
*/
|
|
202
|
-
sendDropdownVisibilityEvent: (dropdownVisibilityStatus: boolean) => void;
|
|
203
|
-
/**
|
|
204
|
-
* Send to xbees custom event with eventType and payload
|
|
205
|
-
*/
|
|
206
|
-
sendCustomEvent: ({ type, payload }: {
|
|
207
|
-
type: string;
|
|
208
|
-
payload?: JSONValue;
|
|
209
|
-
}) => void;
|
|
210
|
-
/**
|
|
211
|
-
* Starts listen for the events of contact weight update and handle with the provided callback
|
|
212
|
-
*/
|
|
213
|
-
onContactWeightUpdate: (callback: Callback<EventType.CONTACT_WEIGHT_UPDATE>) => RemoveEventListener;
|
|
214
|
-
/**
|
|
215
|
-
* Starts listen for the events when contact was updated in the daemon and the opened integration should be refreshed
|
|
216
|
-
*/
|
|
217
|
-
onContactRefresh: (callback: Callback<EventType.CONTACT_REFRESH>) => RemoveEventListener;
|
|
218
|
-
/**
|
|
219
|
-
* Starts listen for the events when xbees updates the local storage and callback can consider the new data
|
|
220
|
-
*/
|
|
221
|
-
onStorageUpdated: (callback: Callback<EventType.STORAGE_IS_UPDATED>) => RemoveEventListener;
|
|
222
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export interface ContactShape {
|
|
2
|
-
id: string;
|
|
3
|
-
name: string;
|
|
4
|
-
email?: string;
|
|
5
|
-
phone?: string;
|
|
6
|
-
picture?: string;
|
|
7
|
-
mobileNumber?: string;
|
|
8
|
-
officeNumber?: string;
|
|
9
|
-
faxNumber?: string;
|
|
10
|
-
homeNumber?: string;
|
|
11
|
-
homeMobileNumber?: string;
|
|
12
|
-
extension?: string;
|
|
13
|
-
organization?: string;
|
|
14
|
-
}
|
|
15
|
-
export type Contact = (ContactShape & {
|
|
16
|
-
email: string;
|
|
17
|
-
}) | (ContactShape & {
|
|
18
|
-
phone: string;
|
|
19
|
-
});
|
|
20
|
-
export type ContactQuery = {
|
|
21
|
-
id?: string;
|
|
22
|
-
email?: string;
|
|
23
|
-
phone?: string;
|
|
24
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { ClientEventType, EventType } from '../src/enums';
|
|
2
|
-
import { AvailableContactData } from './AvailableContactData';
|
|
3
|
-
import { ContactQuery } from './Contact';
|
|
4
|
-
import { Message, MessageType } from './Message';
|
|
5
|
-
import { IPayloadAutoSuggestResult, IPayloadBatchContactsMatchResult, IPayloadBatchContactsMatchResultError, IPayloadCallStart, IPayloadCallStartedInfo, IPayloadContactMatchResult, IPayloadContactMatchResultNotFound, IPayloadContactResult, IPayloadContactWeightUpdate, IPayloadContextResult, IPayloadConversationResult, IPayloadCustomEvent, IPayloadDropdownVisibility, IPayloadGetFromStorage, IPayloadSaveToStorage, IPayloadSendAnalytics, IPayloadTechSupport, IPayloadThemeChange, IPayloadToast, IPayloadVersion, IPayloadViewPort } from './Payload';
|
|
6
|
-
import { SupportedPlatformVariant } from './Platform';
|
|
7
|
-
import { XBeesUser } from './XBeesUser';
|
|
8
|
-
export type EventPayload<T extends MessageType> = T extends EventType.GET_CONTACTS_AUTO_SUGGEST ? string : T extends ClientEventType.CONTACTS_AUTO_SUGGEST ? IPayloadAutoSuggestResult : T extends ClientEventType.CONTACT_LOOKUP_AND_MATCH | ClientEventType.CONTACT_CREATE_OR_UPDATE | ClientEventType.CONTACT_MATCH_UPDATE ? IPayloadContactMatchResult : T extends ClientEventType.CONTACT_LOOKUP_AND_MATCH_NOT_FOUND ? IPayloadContactMatchResultNotFound : T extends ClientEventType.LOOKUP_AND_MATCH_BATCH_ERROR ? IPayloadBatchContactsMatchResultError : T extends ClientEventType.CONTEXT ? IPayloadContextResult : T extends ClientEventType.CURRENT_CONTACT ? IPayloadContactResult : T extends ClientEventType.CURRENT_CONVERSATION ? IPayloadConversationResult : T extends EventType.ADD_CALL ? IPayloadCallStartedInfo : T extends ClientEventType.START_CALL ? IPayloadCallStart : T extends ClientEventType.READY ? IPayloadVersion : T extends ClientEventType.VIEW_PORT ? IPayloadViewPort : T extends ClientEventType.THEME ? IPayloadThemeChange : T extends EventType.USE_THEME ? IPayloadThemeChange : T extends ClientEventType.TOAST ? IPayloadToast : T extends ClientEventType.SEND_ANALYTICS ? IPayloadSendAnalytics : T extends ClientEventType.SEND_TECHNICAL_SUPPORT_INFORMATION ? IPayloadTechSupport : T extends EventType.PBX_TOKEN ? string : T extends ClientEventType.TOKEN ? string : T extends ClientEventType.TO_CLIPBOARD ? string : T extends EventType.GET_LOOK_UP_AND_MATCH ? ContactQuery : T extends EventType.GET_LOOK_UP_AND_MATCH_BATCH ? ContactQuery[] : T extends EventType.VISIBILITY ? boolean : T extends ClientEventType.USER ? XBeesUser : T extends ClientEventType.SAVE_TO_STORAGE ? IPayloadSaveToStorage : T extends ClientEventType.GET_FROM_STORAGE ? IPayloadGetFromStorage : T extends ClientEventType.REMOVE_FROM_STORAGE ? IPayloadGetFromStorage : T extends ClientEventType.AVAILABLE_CONTACT_DATA ? AvailableContactData | null : T extends ClientEventType.LOOK_UP_AND_MATCH_BATCH_CONTACTS ? IPayloadBatchContactsMatchResult : T extends ClientEventType.DROPDOWN_VISIBILITY ? IPayloadDropdownVisibility : T extends ClientEventType.CUSTOM_EVENT ? IPayloadCustomEvent : never;
|
|
9
|
-
export type EventPayloadMap = {
|
|
10
|
-
[EventType.GET_CONTACTS_AUTO_SUGGEST]: string;
|
|
11
|
-
[EventType.GET_LOOK_UP_AND_MATCH]: ContactQuery;
|
|
12
|
-
[EventType.GET_LOOK_UP_AND_MATCH_BATCH]: ContactQuery[];
|
|
13
|
-
[EventType.ADD_CALL]: IPayloadCallStartedInfo;
|
|
14
|
-
[EventType.USE_THEME]: IPayloadThemeChange;
|
|
15
|
-
[EventType.PBX_TOKEN]: string;
|
|
16
|
-
[EventType.VISIBILITY]: boolean;
|
|
17
|
-
[EventType.REDIRECT_QUERY]: string;
|
|
18
|
-
[EventType.CONTACT_WEIGHT_UPDATE]: IPayloadContactWeightUpdate;
|
|
19
|
-
[EventType.CONTACT_REFRESH]: string;
|
|
20
|
-
};
|
|
21
|
-
export type EventCallbackMap = {
|
|
22
|
-
[EventType.GET_CONTACTS_AUTO_SUGGEST]: (query: EventPayloadMap[EventType.GET_CONTACTS_AUTO_SUGGEST]) => void;
|
|
23
|
-
[EventType.GET_LOOK_UP_AND_MATCH]: (query: EventPayloadMap[EventType.GET_LOOK_UP_AND_MATCH]) => void;
|
|
24
|
-
[EventType.GET_LOOK_UP_AND_MATCH_BATCH]: (queries: EventPayloadMap[EventType.GET_LOOK_UP_AND_MATCH_BATCH]) => void;
|
|
25
|
-
[EventType.ADD_CALL]: (callStartInfo: EventPayloadMap[EventType.ADD_CALL]) => void;
|
|
26
|
-
[EventType.USE_THEME]: (theme: EventPayloadMap[EventType.USE_THEME]) => void;
|
|
27
|
-
[EventType.PBX_TOKEN]: (token: EventPayloadMap[EventType.PBX_TOKEN]) => void;
|
|
28
|
-
[EventType.VISIBILITY]: (isActive: EventPayloadMap[EventType.VISIBILITY]) => void;
|
|
29
|
-
[EventType.REDIRECT_QUERY]: (query: EventPayloadMap[EventType.REDIRECT_QUERY]) => void;
|
|
30
|
-
[EventType.CONTACT_WEIGHT_UPDATE]: (params: EventPayloadMap[EventType.CONTACT_WEIGHT_UPDATE]) => void;
|
|
31
|
-
[EventType.CONTACT_REFRESH]: (id: EventPayloadMap[EventType.CONTACT_REFRESH]) => void;
|
|
32
|
-
[EventType.STORAGE_IS_UPDATED]: () => void;
|
|
33
|
-
};
|
|
34
|
-
export type RawMessageEvent = MessageEvent<string | Message>;
|
|
35
|
-
export type ReadyExtendedProps = {
|
|
36
|
-
templateId?: string;
|
|
37
|
-
analyticTitle?: string;
|
|
38
|
-
platform?: SupportedPlatformVariant;
|
|
39
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ClientEventType, EventType } from '../src/enums';
|
|
2
|
-
import { EventPayload } from './Event';
|
|
3
|
-
export type MessageType = ClientEventType | EventType;
|
|
4
|
-
export type Message<T extends MessageType = MessageType> = {
|
|
5
|
-
type: T;
|
|
6
|
-
payload?: EventPayload<T>;
|
|
7
|
-
};
|
|
8
|
-
export type MessageIFrameResponse<T extends MessageType = MessageType> = Message<T> & {
|
|
9
|
-
iframeId: string;
|
|
10
|
-
};
|
|
11
|
-
export type ErrorMessage = {
|
|
12
|
-
errorMessage?: string;
|
|
13
|
-
};
|
|
14
|
-
export type ResponseMessage<T extends MessageType = MessageType> = Message<T> & ErrorMessage;
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import ClientParams from '../src/helpers/ClientParams';
|
|
2
|
-
import { Contact, ContactQuery } from './Contact';
|
|
3
|
-
import { Conversation } from './conversation';
|
|
4
|
-
import { JSONArray, JSONObject, JSONValue } from './Json';
|
|
5
|
-
import { SupportedPlatformVariant } from './Platform';
|
|
6
|
-
import { ToastSeverity } from './Toast';
|
|
7
|
-
export interface IPayloadViewPort {
|
|
8
|
-
height: number | string;
|
|
9
|
-
width: number | string;
|
|
10
|
-
}
|
|
11
|
-
export interface IPayloadVersion {
|
|
12
|
-
version: string;
|
|
13
|
-
platform?: SupportedPlatformVariant;
|
|
14
|
-
templateId?: string;
|
|
15
|
-
analyticTitle?: string;
|
|
16
|
-
}
|
|
17
|
-
export interface IPayloadToast {
|
|
18
|
-
severity: ToastSeverity;
|
|
19
|
-
message: string;
|
|
20
|
-
}
|
|
21
|
-
interface ThemeOptions {
|
|
22
|
-
typography?: unknown;
|
|
23
|
-
palette?: unknown;
|
|
24
|
-
}
|
|
25
|
-
export interface IPayloadThemeChange {
|
|
26
|
-
mode: 'light' | 'dark';
|
|
27
|
-
themeOptions?: ThemeOptions;
|
|
28
|
-
}
|
|
29
|
-
export interface IPayloadCallStartedInfo {
|
|
30
|
-
destination: string;
|
|
31
|
-
video: boolean;
|
|
32
|
-
}
|
|
33
|
-
export interface IPayloadCallStart {
|
|
34
|
-
phoneNumber: string;
|
|
35
|
-
}
|
|
36
|
-
export interface IPayloadAutoSuggestResult {
|
|
37
|
-
contacts: Contact[];
|
|
38
|
-
query: string;
|
|
39
|
-
}
|
|
40
|
-
export interface IPayloadContactMatchResult {
|
|
41
|
-
contact: Contact;
|
|
42
|
-
query: ContactQuery;
|
|
43
|
-
}
|
|
44
|
-
export interface IPayloadBatchContactsMatchResult {
|
|
45
|
-
contactResultsMap: [ContactQuery, Contact | null | undefined][];
|
|
46
|
-
}
|
|
47
|
-
export interface IPayloadContactMatchResultNotFound {
|
|
48
|
-
query: ContactQuery;
|
|
49
|
-
}
|
|
50
|
-
export interface IPayloadBatchContactsMatchResultError {
|
|
51
|
-
reason: string;
|
|
52
|
-
}
|
|
53
|
-
export interface IPayloadCreateContactHasPermission {
|
|
54
|
-
hasPermission: boolean;
|
|
55
|
-
}
|
|
56
|
-
export interface IPayloadContactResult {
|
|
57
|
-
contact: Contact;
|
|
58
|
-
}
|
|
59
|
-
export interface IPayloadConversationResult {
|
|
60
|
-
conversation?: Conversation;
|
|
61
|
-
}
|
|
62
|
-
export interface IPayloadContextResult extends IPayloadContactResult, IPayloadConversationResult {
|
|
63
|
-
}
|
|
64
|
-
export interface IPayloadSendAnalytics {
|
|
65
|
-
eventName: string;
|
|
66
|
-
params?: Record<string, string>;
|
|
67
|
-
}
|
|
68
|
-
export interface IPayloadSaveToStorage {
|
|
69
|
-
key: string;
|
|
70
|
-
value: string;
|
|
71
|
-
}
|
|
72
|
-
export interface IPayloadGetFromStorage {
|
|
73
|
-
key: string;
|
|
74
|
-
}
|
|
75
|
-
export interface IPayloadTechSupport {
|
|
76
|
-
'x-iframe-params': ClientParams;
|
|
77
|
-
message: string;
|
|
78
|
-
data?: JSONObject | JSONArray;
|
|
79
|
-
}
|
|
80
|
-
export interface IPayloadDropdownVisibility {
|
|
81
|
-
dropdownVisibilityStatus: boolean;
|
|
82
|
-
}
|
|
83
|
-
export interface IPayloadCustomEvent {
|
|
84
|
-
type: string;
|
|
85
|
-
payload?: JSONValue;
|
|
86
|
-
}
|
|
87
|
-
export interface IPayloadContactWeightUpdate {
|
|
88
|
-
id: string;
|
|
89
|
-
query: ContactQuery;
|
|
90
|
-
}
|
|
91
|
-
export {};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Contact, ContactQuery } from './Contact';
|
|
2
|
-
export type SuggestContactsResolver = (contacts: Contact[]) => void;
|
|
3
|
-
export type LookupAndMatchContactsResolver = (contact: Contact) => void;
|
|
4
|
-
export type LookupAndMatchBatchContactsResolver = (contactResultsMap: Map<ContactQuery, Contact | null | undefined>) => void;
|
|
5
|
-
export type Reject = (reason: string) => void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type StorageEventCallback = (event: StorageEvent) => void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type ToastSeverity = 'INFO' | 'WARNING' | 'ERROR' | 'SUCCESS' | 'NOTICE';
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export type { AvailableContactData } from './AvailableContactData';
|
|
2
|
-
export type { Callback } from './Callback';
|
|
3
|
-
export type { ConnectClient } from './Client';
|
|
4
|
-
export type { Contact, ContactQuery } from './Contact';
|
|
5
|
-
export type { EventPayloadMap, RawMessageEvent } from './Event';
|
|
6
|
-
export type { JSONArray, JSONObject } from './Json';
|
|
7
|
-
export type { Listener, RemoveEventListener } from './Listener';
|
|
8
|
-
export type { Message, MessageIFrameResponse, MessageType, ResponseMessage } from './Message';
|
|
9
|
-
export type { MessageSender } from './MessageSender';
|
|
10
|
-
export type { IPayloadAutoSuggestResult, IPayloadCallStart, IPayloadCallStartedInfo, IPayloadContactMatchResult, IPayloadContactMatchResultNotFound, IPayloadContactResult, IPayloadContextResult, IPayloadConversationResult, IPayloadSendAnalytics, IPayloadTechSupport, IPayloadThemeChange, IPayloadToast, IPayloadVersion, IPayloadViewPort, } from './Payload';
|
|
11
|
-
export { SupportedPlatformVariant } from './Platform';
|
|
12
|
-
export type { LookupAndMatchBatchContactsResolver, LookupAndMatchContactsResolver, Reject, SuggestContactsResolver, } from './Resolver';
|
|
13
|
-
export type { StorageEventCallback } from './Storage';
|
|
14
|
-
export type { ToastSeverity } from './Toast';
|
|
15
|
-
export type { WorkVariants } from './WorkVariant';
|
|
16
|
-
export type { XBeesUser } from './XBeesUser';
|