@wildix/xbees-connect 1.3.16-beta.1 → 1.3.17-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/README.md +8 -4
- package/dist-cjs/package.json +1 -1
- package/dist-cjs/src/Client.js +12 -5
- package/dist-cjs/src/enums/index.js +1 -1
- package/dist-cjs/src/helpers/ClientParams.js +0 -2
- package/dist-es/package.json +1 -1
- package/dist-es/src/Client.js +12 -5
- package/dist-es/src/enums/index.js +1 -1
- package/dist-es/src/helpers/ClientParams.js +0 -2
- package/dist-types/src/Client.d.ts +2 -3
- package/dist-types/src/enums/index.d.ts +2 -2
- package/dist-types/src/helpers/ClientParams.d.ts +0 -1
- package/dist-types/types/Client.d.ts +6 -4
- package/dist-types/types/Event.d.ts +2 -2
- package/dist-types/types/Payload.d.ts +4 -1
- package/dist-types/types/index.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -182,10 +182,6 @@ Returns `true` when the integration is launched in fullsize mode (`f`).
|
|
|
182
182
|
|
|
183
183
|
Returns `true` when the integration is opened for activation/authorization purposes only (URL contains the `authorize` parameter).
|
|
184
184
|
|
|
185
|
-
#### `isCloudBackendEnabled(): boolean`
|
|
186
|
-
|
|
187
|
-
Returns `true` when cloud backend is enabled for this integration. Reads the `cbi` URL parameter at construction time (`cbi=1` → `true`, `cbi=0` or missing → `false`).
|
|
188
|
-
|
|
189
185
|
---
|
|
190
186
|
|
|
191
187
|
### Context
|
|
@@ -520,6 +516,14 @@ Tells x-bees which chat or conversation should be opened (brought into focus). T
|
|
|
520
516
|
client.setChatToOpen('chat_id');
|
|
521
517
|
```
|
|
522
518
|
|
|
519
|
+
#### `getChannelsByEmailOrPhone(payload: IPayloadGetChannelsByEmailOrPhone): Promise<ResponseMessage>`
|
|
520
|
+
|
|
521
|
+
Asks x-bees to look up chat channels for an email address or phone number. The integration sends `ClientEventType.GET_CHANNELS_BY_EMAIL_OR_PHONE` (`xBeesGetChannelsByEmailOrPhone`) with payload `{ value, type }`, where `type` is `'email'` or `'phone'`. Resolves with a `ResponseMessage` whose payload contains the matching channels returned by x-bees.
|
|
522
|
+
|
|
523
|
+
```ts
|
|
524
|
+
const { payload } = await client.getChannelsByEmailOrPhone({ value: 'user@example.com', type: 'email' });
|
|
525
|
+
```
|
|
526
|
+
|
|
523
527
|
---
|
|
524
528
|
|
|
525
529
|
### Technical support
|
package/dist-cjs/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildix/xbees-connect",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.17-alpha.1",
|
|
4
4
|
"description": "This library provides easy communication between x-bees and integrated web applications",
|
|
5
5
|
"author": "dimitri.chernykh <dimitri.chernykh@wildix.com>",
|
|
6
6
|
"homepage": "",
|
package/dist-cjs/src/Client.js
CHANGED
|
@@ -52,7 +52,6 @@ class Client {
|
|
|
52
52
|
variant = null;
|
|
53
53
|
startPage = null;
|
|
54
54
|
product = null;
|
|
55
|
-
cloudBackendEnabled;
|
|
56
55
|
localStorageManager = LocalStorageManager_1.default.getInstance();
|
|
57
56
|
constructor() {
|
|
58
57
|
const params = (0, getUrlSearchParamsMap_1.getUrlSearchParamsMap)();
|
|
@@ -63,7 +62,6 @@ class Client {
|
|
|
63
62
|
this.needAuthorize = params.has(enums_1.UrlParams.AUTHORIZE);
|
|
64
63
|
this.startPage = params.get(enums_1.UrlParams.START_PAGE);
|
|
65
64
|
this.product = params.get(enums_1.UrlParams.PRODUCT);
|
|
66
|
-
this.cloudBackendEnabled = params.get(enums_1.UrlParams.CLOUD_BACKEND_ENABLED) === '1';
|
|
67
65
|
this.integrationId = params.get(enums_1.UrlParams.ID)?.split('-')[0] ?? '';
|
|
68
66
|
// @ts-expect-error window.ReactNativeWebView will be provided by ReactNative WebView
|
|
69
67
|
this.isParentReactNativeWebView = !!window.ReactNativeWebView;
|
|
@@ -241,9 +239,6 @@ class Client {
|
|
|
241
239
|
isActivationOnly() {
|
|
242
240
|
return this.needAuthorize;
|
|
243
241
|
}
|
|
244
|
-
isCloudBackendEnabled() {
|
|
245
|
-
return this.cloudBackendEnabled;
|
|
246
|
-
}
|
|
247
242
|
getContext() {
|
|
248
243
|
return this.sendAsync({ type: enums_1.ClientEventType.CONTEXT });
|
|
249
244
|
}
|
|
@@ -551,6 +546,18 @@ class Client {
|
|
|
551
546
|
payload: { chatId },
|
|
552
547
|
});
|
|
553
548
|
}
|
|
549
|
+
getChannelsByEmailOrPhone(payload) {
|
|
550
|
+
if (!payload?.value?.trim()) {
|
|
551
|
+
return Promise.reject(new Error('`value` is required'));
|
|
552
|
+
}
|
|
553
|
+
if (payload.type !== 'email' && payload.type !== 'phone') {
|
|
554
|
+
return Promise.reject(new Error('`type` must be "email" or "phone"'));
|
|
555
|
+
}
|
|
556
|
+
return this.sendAsync({
|
|
557
|
+
type: enums_1.ClientEventType.GET_CHANNELS_BY_EMAIL_OR_PHONE,
|
|
558
|
+
payload,
|
|
559
|
+
});
|
|
560
|
+
}
|
|
554
561
|
onContactWeightUpdate(callback) {
|
|
555
562
|
return this.addEventListener(enums_1.EventType.CONTACT_WEIGHT_UPDATE, callback);
|
|
556
563
|
}
|
|
@@ -58,6 +58,7 @@ var ClientEventType;
|
|
|
58
58
|
ClientEventType["DROPDOWN_VISIBILITY"] = "xBeesDropdownVisibility";
|
|
59
59
|
ClientEventType["CUSTOM_EVENT"] = "xBeesCustomEvent";
|
|
60
60
|
ClientEventType["SET_CHAT_TO_OPEN"] = "xBeesSetChatToOpen";
|
|
61
|
+
ClientEventType["GET_CHANNELS_BY_EMAIL_OR_PHONE"] = "xBeesGetChannelsByEmailOrPhone";
|
|
61
62
|
ClientEventType["CREATE_CONTACT_IS_SUPPORTED"] = "xBeesCreateContactIsSupported";
|
|
62
63
|
ClientEventType["CREATE_CONTACT_HAS_NO_PERMISSION"] = "xBeesCreateContactHasNoPermission";
|
|
63
64
|
ClientEventType["INTEGRATION_PROXY_RESPONSE"] = "xBeesIntegrationProxyResponse";
|
|
@@ -74,7 +75,6 @@ var UrlParams;
|
|
|
74
75
|
UrlParams["AUTHORIZE"] = "a";
|
|
75
76
|
UrlParams["START_PAGE"] = "sp";
|
|
76
77
|
UrlParams["PRODUCT"] = "p";
|
|
77
|
-
UrlParams["CLOUD_BACKEND_ENABLED"] = "cbi";
|
|
78
78
|
})(UrlParams || (exports.UrlParams = UrlParams = {}));
|
|
79
79
|
var StartPage;
|
|
80
80
|
(function (StartPage) {
|
|
@@ -19,7 +19,6 @@ class ClientParams {
|
|
|
19
19
|
userExtension = null;
|
|
20
20
|
startPage = null;
|
|
21
21
|
product = null;
|
|
22
|
-
cloudBackendEnabled;
|
|
23
22
|
constructor() {
|
|
24
23
|
const params = (0, getUrlSearchParamsMap_1.getUrlSearchParamsMap)();
|
|
25
24
|
this.iframeId = params.get(enums_1.UrlParams.ID);
|
|
@@ -31,7 +30,6 @@ class ClientParams {
|
|
|
31
30
|
this.needAuthorize = params.has(enums_1.UrlParams.AUTHORIZE);
|
|
32
31
|
this.startPage = params.get(enums_1.UrlParams.START_PAGE);
|
|
33
32
|
this.product = params.get(enums_1.UrlParams.PRODUCT);
|
|
34
|
-
this.cloudBackendEnabled = params.get(enums_1.UrlParams.CLOUD_BACKEND_ENABLED) === '1';
|
|
35
33
|
}
|
|
36
34
|
toString() {
|
|
37
35
|
const { userToken, ...props } = this;
|
package/dist-es/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildix/xbees-connect",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.17-alpha.1",
|
|
4
4
|
"description": "This library provides easy communication between x-bees and integrated web applications",
|
|
5
5
|
"author": "dimitri.chernykh <dimitri.chernykh@wildix.com>",
|
|
6
6
|
"homepage": "",
|
package/dist-es/src/Client.js
CHANGED
|
@@ -46,7 +46,6 @@ export class Client {
|
|
|
46
46
|
variant = null;
|
|
47
47
|
startPage = null;
|
|
48
48
|
product = null;
|
|
49
|
-
cloudBackendEnabled;
|
|
50
49
|
localStorageManager = LocalStorageManager.getInstance();
|
|
51
50
|
constructor() {
|
|
52
51
|
const params = getUrlSearchParamsMap();
|
|
@@ -57,7 +56,6 @@ export class Client {
|
|
|
57
56
|
this.needAuthorize = params.has(UrlParams.AUTHORIZE);
|
|
58
57
|
this.startPage = params.get(UrlParams.START_PAGE);
|
|
59
58
|
this.product = params.get(UrlParams.PRODUCT);
|
|
60
|
-
this.cloudBackendEnabled = params.get(UrlParams.CLOUD_BACKEND_ENABLED) === '1';
|
|
61
59
|
this.integrationId = params.get(UrlParams.ID)?.split('-')[0] ?? '';
|
|
62
60
|
// @ts-expect-error window.ReactNativeWebView will be provided by ReactNative WebView
|
|
63
61
|
this.isParentReactNativeWebView = !!window.ReactNativeWebView;
|
|
@@ -235,9 +233,6 @@ export class Client {
|
|
|
235
233
|
isActivationOnly() {
|
|
236
234
|
return this.needAuthorize;
|
|
237
235
|
}
|
|
238
|
-
isCloudBackendEnabled() {
|
|
239
|
-
return this.cloudBackendEnabled;
|
|
240
|
-
}
|
|
241
236
|
getContext() {
|
|
242
237
|
return this.sendAsync({ type: ClientEventType.CONTEXT });
|
|
243
238
|
}
|
|
@@ -545,6 +540,18 @@ export class Client {
|
|
|
545
540
|
payload: { chatId },
|
|
546
541
|
});
|
|
547
542
|
}
|
|
543
|
+
getChannelsByEmailOrPhone(payload) {
|
|
544
|
+
if (!payload?.value?.trim()) {
|
|
545
|
+
return Promise.reject(new Error('`value` is required'));
|
|
546
|
+
}
|
|
547
|
+
if (payload.type !== 'email' && payload.type !== 'phone') {
|
|
548
|
+
return Promise.reject(new Error('`type` must be "email" or "phone"'));
|
|
549
|
+
}
|
|
550
|
+
return this.sendAsync({
|
|
551
|
+
type: ClientEventType.GET_CHANNELS_BY_EMAIL_OR_PHONE,
|
|
552
|
+
payload,
|
|
553
|
+
});
|
|
554
|
+
}
|
|
548
555
|
onContactWeightUpdate(callback) {
|
|
549
556
|
return this.addEventListener(EventType.CONTACT_WEIGHT_UPDATE, callback);
|
|
550
557
|
}
|
|
@@ -55,6 +55,7 @@ export var ClientEventType;
|
|
|
55
55
|
ClientEventType["DROPDOWN_VISIBILITY"] = "xBeesDropdownVisibility";
|
|
56
56
|
ClientEventType["CUSTOM_EVENT"] = "xBeesCustomEvent";
|
|
57
57
|
ClientEventType["SET_CHAT_TO_OPEN"] = "xBeesSetChatToOpen";
|
|
58
|
+
ClientEventType["GET_CHANNELS_BY_EMAIL_OR_PHONE"] = "xBeesGetChannelsByEmailOrPhone";
|
|
58
59
|
ClientEventType["CREATE_CONTACT_IS_SUPPORTED"] = "xBeesCreateContactIsSupported";
|
|
59
60
|
ClientEventType["CREATE_CONTACT_HAS_NO_PERMISSION"] = "xBeesCreateContactHasNoPermission";
|
|
60
61
|
ClientEventType["INTEGRATION_PROXY_RESPONSE"] = "xBeesIntegrationProxyResponse";
|
|
@@ -71,7 +72,6 @@ export var UrlParams;
|
|
|
71
72
|
UrlParams["AUTHORIZE"] = "a";
|
|
72
73
|
UrlParams["START_PAGE"] = "sp";
|
|
73
74
|
UrlParams["PRODUCT"] = "p";
|
|
74
|
-
UrlParams["CLOUD_BACKEND_ENABLED"] = "cbi";
|
|
75
75
|
})(UrlParams || (UrlParams = {}));
|
|
76
76
|
export var StartPage;
|
|
77
77
|
(function (StartPage) {
|
|
@@ -17,7 +17,6 @@ export default class ClientParams {
|
|
|
17
17
|
userExtension = null;
|
|
18
18
|
startPage = null;
|
|
19
19
|
product = null;
|
|
20
|
-
cloudBackendEnabled;
|
|
21
20
|
constructor() {
|
|
22
21
|
const params = getUrlSearchParamsMap();
|
|
23
22
|
this.iframeId = params.get(UrlParams.ID);
|
|
@@ -29,7 +28,6 @@ export default class ClientParams {
|
|
|
29
28
|
this.needAuthorize = params.has(UrlParams.AUTHORIZE);
|
|
30
29
|
this.startPage = params.get(UrlParams.START_PAGE);
|
|
31
30
|
this.product = params.get(UrlParams.PRODUCT);
|
|
32
|
-
this.cloudBackendEnabled = params.get(UrlParams.CLOUD_BACKEND_ENABLED) === '1';
|
|
33
31
|
}
|
|
34
32
|
toString() {
|
|
35
33
|
const { userToken, ...props } = this;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Callback, ConnectClient, Contact, ContactQuery, IntegrationProxyRequest, IPayloadViewPort, LookupAndMatchContactsResolver, Message, Reject, RemoveEventListener, ResponseMessage, StorageEventCallback, SuggestContactsResolver, SupportedPlatformVariant, ToastSeverity, XBeesUser } from '../types';
|
|
1
|
+
import { Callback, ConnectClient, Contact, ContactQuery, IntegrationProxyRequest, IPayloadGetChannelsByEmailOrPhone, IPayloadViewPort, LookupAndMatchContactsResolver, Message, Reject, RemoveEventListener, ResponseMessage, StorageEventCallback, SuggestContactsResolver, SupportedPlatformVariant, ToastSeverity, XBeesUser } from '../types';
|
|
2
2
|
import { ReadyExtendedProps } from '../types/Event';
|
|
3
3
|
import { JSONValue } from '../types/Json';
|
|
4
4
|
import { IntegrationProxyRequestResolver, LookupAndMatchBatchContactsResolver } from '../types/Resolver';
|
|
@@ -29,7 +29,6 @@ export declare class Client implements ConnectClient {
|
|
|
29
29
|
private readonly variant;
|
|
30
30
|
private readonly startPage;
|
|
31
31
|
private readonly product;
|
|
32
|
-
private readonly cloudBackendEnabled;
|
|
33
32
|
private readonly localStorageManager;
|
|
34
33
|
constructor();
|
|
35
34
|
private sendAsync;
|
|
@@ -67,7 +66,6 @@ export declare class Client implements ConnectClient {
|
|
|
67
66
|
showsUi(): boolean;
|
|
68
67
|
isFullsize(): boolean;
|
|
69
68
|
isActivationOnly(): boolean;
|
|
70
|
-
isCloudBackendEnabled(): boolean;
|
|
71
69
|
getContext(): Promise<Message<ClientEventType.CONTEXT>>;
|
|
72
70
|
getCurrentContact(): Promise<Message<ClientEventType.CURRENT_CONTACT>>;
|
|
73
71
|
getCurrentConversation(): Promise<Message<ClientEventType.CURRENT_CONVERSATION>>;
|
|
@@ -122,6 +120,7 @@ export declare class Client implements ConnectClient {
|
|
|
122
120
|
* @param chatId - Conversation or chat identifier in x-bees.
|
|
123
121
|
*/
|
|
124
122
|
setChatToOpen(chatId: string): void;
|
|
123
|
+
getChannelsByEmailOrPhone(payload: IPayloadGetChannelsByEmailOrPhone): Promise<ResponseMessage>;
|
|
125
124
|
onContactWeightUpdate(callback: Callback<EventType.CONTACT_WEIGHT_UPDATE>): RemoveEventListener;
|
|
126
125
|
onContactRefresh(callback: Callback<EventType.CONTACT_REFRESH>): RemoveEventListener;
|
|
127
126
|
/**
|
|
@@ -53,6 +53,7 @@ export declare enum ClientEventType {
|
|
|
53
53
|
DROPDOWN_VISIBILITY = "xBeesDropdownVisibility",
|
|
54
54
|
CUSTOM_EVENT = "xBeesCustomEvent",
|
|
55
55
|
SET_CHAT_TO_OPEN = "xBeesSetChatToOpen",
|
|
56
|
+
GET_CHANNELS_BY_EMAIL_OR_PHONE = "xBeesGetChannelsByEmailOrPhone",
|
|
56
57
|
CREATE_CONTACT_IS_SUPPORTED = "xBeesCreateContactIsSupported",
|
|
57
58
|
CREATE_CONTACT_HAS_NO_PERMISSION = "xBeesCreateContactHasNoPermission",
|
|
58
59
|
INTEGRATION_PROXY_RESPONSE = "xBeesIntegrationProxyResponse",
|
|
@@ -67,8 +68,7 @@ export declare enum UrlParams {
|
|
|
67
68
|
REFERRER = "r",
|
|
68
69
|
AUTHORIZE = "a",
|
|
69
70
|
START_PAGE = "sp",
|
|
70
|
-
PRODUCT = "p"
|
|
71
|
-
CLOUD_BACKEND_ENABLED = "cbi"
|
|
71
|
+
PRODUCT = "p"
|
|
72
72
|
}
|
|
73
73
|
export declare enum StartPage {
|
|
74
74
|
CREATE_CONTACT = "createContact"
|
|
@@ -6,7 +6,7 @@ import { ReadyExtendedProps } from './Event';
|
|
|
6
6
|
import { JSONValue } from './Json';
|
|
7
7
|
import { RemoveEventListener } from './Listener';
|
|
8
8
|
import { ResponseMessage } from './Message';
|
|
9
|
-
import { IntegrationProxyRequest, IPayloadViewPort } from './Payload';
|
|
9
|
+
import { IntegrationProxyRequest, IPayloadGetChannelsByEmailOrPhone, IPayloadViewPort } from './Payload';
|
|
10
10
|
import { SupportedPlatformVariant } from './Platform';
|
|
11
11
|
import { IntegrationProxyRequestResolver, LookupAndMatchBatchContactsResolver, LookupAndMatchContactsResolver, Reject, SuggestContactsResolver } from './Resolver';
|
|
12
12
|
import { StorageEventCallback } from './Storage';
|
|
@@ -79,9 +79,6 @@ export interface ConnectClient {
|
|
|
79
79
|
* dialog which leads to integration be activated
|
|
80
80
|
* */
|
|
81
81
|
isActivationOnly: () => boolean;
|
|
82
|
-
/**
|
|
83
|
-
* Determines whether cloud backend is enabled for this integration (URL parameter `cbi=1`). */
|
|
84
|
-
isCloudBackendEnabled: () => boolean;
|
|
85
82
|
/**
|
|
86
83
|
* Retrieves current x-bees context data */
|
|
87
84
|
getContext: () => Promise<ResponseMessage<ClientEventType.CONTEXT>>;
|
|
@@ -237,6 +234,11 @@ export interface ConnectClient {
|
|
|
237
234
|
* @param chatId - Conversation or chat identifier in x-bees.
|
|
238
235
|
*/
|
|
239
236
|
setChatToOpen: (chatId: string) => void;
|
|
237
|
+
/**
|
|
238
|
+
* Asks x-bees to look up chat channels for an email address or phone number.
|
|
239
|
+
* @param payload - Contact identifier: `value` (email or phone value) and `type` (`'email'` or `'phone'`).
|
|
240
|
+
*/
|
|
241
|
+
getChannelsByEmailOrPhone: (payload: IPayloadGetChannelsByEmailOrPhone) => Promise<ResponseMessage>;
|
|
240
242
|
/**
|
|
241
243
|
* Starts listen for the events of contact weight update and handle with the provided callback
|
|
242
244
|
*/
|
|
@@ -2,10 +2,10 @@ import { ClientEventType, EventType } from '../src/enums';
|
|
|
2
2
|
import { AvailableContactData } from './AvailableContactData';
|
|
3
3
|
import { ContactQuery } from './Contact';
|
|
4
4
|
import { Message, MessageType } from './Message';
|
|
5
|
-
import { IntegrationProxyRequest, IntegrationProxyResponse, IPayloadAutoSuggestResult, IPayloadBatchContactsMatchResult, IPayloadBatchContactsMatchResultError, IPayloadCallStart, IPayloadCallStartedInfo, IPayloadCancelRedirectToEntityPage, IPayloadContactMatchResult, IPayloadContactMatchResultNotFound, IPayloadContactResult, IPayloadContactWeightUpdate, IPayloadContextResult, IPayloadConversationResult, IPayloadCustomEvent,
|
|
5
|
+
import { IntegrationProxyRequest, IntegrationProxyResponse, IPayloadAutoSuggestResult, IPayloadBatchContactsMatchResult, IPayloadBatchContactsMatchResultError, IPayloadCallStart, IPayloadCallStartedInfo, IPayloadCancelRedirectToEntityPage, IPayloadContactMatchResult, IPayloadContactMatchResultNotFound, IPayloadContactResult, IPayloadContactWeightUpdate, IPayloadContextResult, IPayloadConversationResult, IPayloadCustomEvent, IPayloadDaemonCallFinished, IPayloadDaemonCallStarted, IPayloadDropdownVisibility, IPayloadGetChannelsByEmailOrPhone, IPayloadGetFromStorage, IPayloadSaveToStorage, IPayloadSendAnalytics, IPayloadSetChatToOpen, IPayloadStartRedirectToEntityPage, IPayloadTechSupport, IPayloadThemeChange, IPayloadToast, IPayloadVersion, IPayloadViewPort } from './Payload';
|
|
6
6
|
import { SupportedPlatformVariant } from './Platform';
|
|
7
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 : T extends ClientEventType.SET_CHAT_TO_OPEN ? IPayloadSetChatToOpen : T extends EventType.START_REDIRECT_TO_ENTITY_PAGE ? IPayloadStartRedirectToEntityPage : T extends EventType.CANCEL_REDIRECT_TO_ENTITY_PAGE ? IPayloadCancelRedirectToEntityPage : T extends EventType.GET_INTEGRATION_PROXY_REQUEST ? IntegrationProxyRequest : T extends ClientEventType.INTEGRATION_PROXY_RESPONSE ? IntegrationProxyResponse : T extends ClientEventType.INTEGRATION_PROXY_REQUEST_IS_SUPPORTED ? undefined : T extends EventType.DAEMON_CALL_SESSION_STARTED ? IPayloadDaemonCallStarted : T extends EventType.DAEMON_CALL_SESSION_FINISHED ? IPayloadDaemonCallFinished : never;
|
|
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 : T extends ClientEventType.SET_CHAT_TO_OPEN ? IPayloadSetChatToOpen : T extends ClientEventType.GET_CHANNELS_BY_EMAIL_OR_PHONE ? IPayloadGetChannelsByEmailOrPhone : T extends EventType.START_REDIRECT_TO_ENTITY_PAGE ? IPayloadStartRedirectToEntityPage : T extends EventType.CANCEL_REDIRECT_TO_ENTITY_PAGE ? IPayloadCancelRedirectToEntityPage : T extends EventType.GET_INTEGRATION_PROXY_REQUEST ? IntegrationProxyRequest : T extends ClientEventType.INTEGRATION_PROXY_RESPONSE ? IntegrationProxyResponse : T extends ClientEventType.INTEGRATION_PROXY_REQUEST_IS_SUPPORTED ? undefined : T extends EventType.DAEMON_CALL_SESSION_STARTED ? IPayloadDaemonCallStarted : T extends EventType.DAEMON_CALL_SESSION_FINISHED ? IPayloadDaemonCallFinished : never;
|
|
9
9
|
export type EventPayloadMap = {
|
|
10
10
|
[EventType.GET_CONTACTS_AUTO_SUGGEST]: string;
|
|
11
11
|
[EventType.GET_LOOK_UP_AND_MATCH]: ContactQuery;
|
|
@@ -97,10 +97,13 @@ export interface IPayloadCustomEvent {
|
|
|
97
97
|
type: string;
|
|
98
98
|
payload?: JSONValue;
|
|
99
99
|
}
|
|
100
|
-
/** Payload for the integration → x-bees message that requests opening a chat by id (`ClientEventType.SET_CHAT_TO_OPEN`). */
|
|
101
100
|
export interface IPayloadSetChatToOpen {
|
|
102
101
|
chatId: string;
|
|
103
102
|
}
|
|
103
|
+
export interface IPayloadGetChannelsByEmailOrPhone {
|
|
104
|
+
value: string;
|
|
105
|
+
type: 'email' | 'phone';
|
|
106
|
+
}
|
|
104
107
|
export interface IPayloadContactWeightUpdate {
|
|
105
108
|
id: string;
|
|
106
109
|
query: ContactQuery;
|
|
@@ -7,7 +7,7 @@ export type { JSONArray, JSONObject } from './Json';
|
|
|
7
7
|
export type { Listener, RemoveEventListener } from './Listener';
|
|
8
8
|
export type { Message, MessageIFrameResponse, MessageType, ResponseMessage } from './Message';
|
|
9
9
|
export type { MessageSender } from './MessageSender';
|
|
10
|
-
export type { IntegrationProxyErrorCode, IntegrationProxyRequest, IntegrationProxyResponse, IPayloadAutoSuggestResult, IPayloadCallStart, IPayloadCallStartedInfo, IPayloadCancelRedirectToEntityPage, IPayloadContactMatchResult, IPayloadContactMatchResultNotFound, IPayloadContactResult, IPayloadContextResult, IPayloadConversationResult, IPayloadDaemonCallFinished, IPayloadDaemonCallStarted, IPayloadSendAnalytics, IPayloadSetChatToOpen, IPayloadStartRedirectToEntityPage, IPayloadTechSupport, IPayloadThemeChange, IPayloadToast, IPayloadVersion, IPayloadViewPort, } from './Payload';
|
|
10
|
+
export type { IntegrationProxyErrorCode, IntegrationProxyRequest, IntegrationProxyResponse, IPayloadAutoSuggestResult, IPayloadCallStart, IPayloadCallStartedInfo, IPayloadCancelRedirectToEntityPage, IPayloadContactMatchResult, IPayloadContactMatchResultNotFound, IPayloadContactResult, IPayloadContextResult, IPayloadConversationResult, IPayloadDaemonCallFinished, IPayloadDaemonCallStarted, IPayloadGetChannelsByEmailOrPhone, IPayloadSendAnalytics, IPayloadSetChatToOpen, IPayloadStartRedirectToEntityPage, IPayloadTechSupport, IPayloadThemeChange, IPayloadToast, IPayloadVersion, IPayloadViewPort, } from './Payload';
|
|
11
11
|
export { SupportedPlatformVariant } from './Platform';
|
|
12
12
|
export type { IntegrationProxyRequestResolver, LookupAndMatchBatchContactsResolver, LookupAndMatchContactsResolver, Reject, SuggestContactsResolver, } from './Resolver';
|
|
13
13
|
export type { StorageEventCallback } from './Storage';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildix/xbees-connect",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.17-alpha.2",
|
|
4
4
|
"description": "This library provides easy communication between x-bees and integrated web applications",
|
|
5
5
|
"author": "dimitri.chernykh <dimitri.chernykh@wildix.com>",
|
|
6
6
|
"homepage": "",
|