@wildix/xbees-connect 1.2.31-alpha.6 → 1.2.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-cjs/index.js +2 -1
- package/dist-cjs/package.json +1 -1
- package/dist-cjs/src/Client.js +11 -0
- package/dist-cjs/src/enums/index.js +7 -1
- package/dist-cjs/src/helpers/ClientParams.js +2 -0
- package/dist-es/index.js +1 -1
- package/dist-es/package.json +1 -1
- package/dist-es/src/Client.js +11 -0
- package/dist-es/src/enums/index.js +6 -0
- package/dist-es/src/helpers/ClientParams.js +2 -0
- package/dist-types/index.d.ts +1 -1
- package/dist-types/src/Client.d.ts +4 -1
- package/dist-types/src/enums/index.d.ts +7 -2
- package/dist-types/src/helpers/ClientParams.d.ts +2 -0
- package/dist-types/types/Client.d.ts +7 -1
- package/dist-types/types/Event.d.ts +2 -2
- package/dist-types/types/Payload.d.ts +3 -0
- package/package.json +2 -2
package/dist-cjs/index.js
CHANGED
|
@@ -14,13 +14,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.UrlParams = exports.ClientEventType = exports.EventType = void 0;
|
|
17
|
+
exports.UrlParams = exports.StartPage = exports.ClientEventType = exports.EventType = void 0;
|
|
18
18
|
const Client_1 = require("./src/Client");
|
|
19
19
|
var enums_1 = require("./src/enums");
|
|
20
20
|
Object.defineProperty(exports, "EventType", { enumerable: true, get: function () { return enums_1.EventType; } });
|
|
21
21
|
var enums_2 = require("./src/enums");
|
|
22
22
|
Object.defineProperty(exports, "ClientEventType", { enumerable: true, get: function () { return enums_2.ClientEventType; } });
|
|
23
23
|
var enums_3 = require("./src/enums");
|
|
24
|
+
Object.defineProperty(exports, "StartPage", { enumerable: true, get: function () { return enums_3.StartPage; } });
|
|
24
25
|
Object.defineProperty(exports, "UrlParams", { enumerable: true, get: function () { return enums_3.UrlParams; } });
|
|
25
26
|
__exportStar(require("./types"), exports);
|
|
26
27
|
exports.default = Client_1.Client;
|
package/dist-cjs/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildix/xbees-connect",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.32",
|
|
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
|
@@ -49,6 +49,7 @@ class Client {
|
|
|
49
49
|
isParentReactNativeWebView;
|
|
50
50
|
iframeId;
|
|
51
51
|
variant = null;
|
|
52
|
+
startPage = null;
|
|
52
53
|
localStorageManager = LocalStorageManager_1.default.getInstance();
|
|
53
54
|
constructor() {
|
|
54
55
|
const params = (0, getUrlSearchParamsMap_1.getUrlSearchParamsMap)();
|
|
@@ -57,6 +58,7 @@ class Client {
|
|
|
57
58
|
this.userEmail = params.get(enums_1.UrlParams.USER);
|
|
58
59
|
this.referrer = params.get(enums_1.UrlParams.REFERRER);
|
|
59
60
|
this.needAuthorize = params.has(enums_1.UrlParams.AUTHORIZE);
|
|
61
|
+
this.startPage = params.get(enums_1.UrlParams.START_PAGE);
|
|
60
62
|
// @ts-expect-error window.ReactNativeWebView will be provided by ReactNative WebView
|
|
61
63
|
this.isParentReactNativeWebView = !!window.ReactNativeWebView;
|
|
62
64
|
this.worker = this.isParentReactNativeWebView ? new PostMessageControllerNative_1.default() : new PostMessageControllerWeb_1.default();
|
|
@@ -176,6 +178,9 @@ class Client {
|
|
|
176
178
|
getReferrer() {
|
|
177
179
|
return this.referrer;
|
|
178
180
|
}
|
|
181
|
+
getStartPage() {
|
|
182
|
+
return this.startPage;
|
|
183
|
+
}
|
|
179
184
|
isVisible() {
|
|
180
185
|
return this.visible;
|
|
181
186
|
}
|
|
@@ -366,6 +371,12 @@ class Client {
|
|
|
366
371
|
}
|
|
367
372
|
});
|
|
368
373
|
}
|
|
374
|
+
createContactIsSupported(isSupported = true) {
|
|
375
|
+
return this.sendAsync({
|
|
376
|
+
type: enums_1.ClientEventType.CREATE_CONTACT_IS_SUPPORTED,
|
|
377
|
+
payload: { isSupported },
|
|
378
|
+
});
|
|
379
|
+
}
|
|
369
380
|
onThemeChange(callback) {
|
|
370
381
|
return this.addEventListener(enums_1.EventType.USE_THEME, callback);
|
|
371
382
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UrlParams = exports.ClientEventType = exports.EventType = void 0;
|
|
3
|
+
exports.StartPage = exports.UrlParams = exports.ClientEventType = exports.EventType = void 0;
|
|
4
4
|
var EventType;
|
|
5
5
|
(function (EventType) {
|
|
6
6
|
EventType["GET_CONTACTS_AUTO_SUGGEST"] = "xBeesGetContactsAutoSuggest";
|
|
@@ -49,6 +49,7 @@ var ClientEventType;
|
|
|
49
49
|
ClientEventType["REMOVE_FROM_STORAGE"] = "xBeesRemoveFromStorage";
|
|
50
50
|
ClientEventType["AVAILABLE_CONTACT_DATA"] = "xBeesAvailableContactData";
|
|
51
51
|
ClientEventType["DROPDOWN_VISIBILITY"] = "xBeesDropdownVisibility";
|
|
52
|
+
ClientEventType["CREATE_CONTACT_IS_SUPPORTED"] = "xBeesCreateContactIsSupported";
|
|
52
53
|
})(ClientEventType || (exports.ClientEventType = ClientEventType = {}));
|
|
53
54
|
var UrlParams;
|
|
54
55
|
(function (UrlParams) {
|
|
@@ -59,4 +60,9 @@ var UrlParams;
|
|
|
59
60
|
UrlParams["EXTENSION"] = "e";
|
|
60
61
|
UrlParams["REFERRER"] = "r";
|
|
61
62
|
UrlParams["AUTHORIZE"] = "a";
|
|
63
|
+
UrlParams["START_PAGE"] = "sp";
|
|
62
64
|
})(UrlParams || (exports.UrlParams = UrlParams = {}));
|
|
65
|
+
var StartPage;
|
|
66
|
+
(function (StartPage) {
|
|
67
|
+
StartPage["CREATE_CONTACT"] = "createContact";
|
|
68
|
+
})(StartPage || (exports.StartPage = StartPage = {}));
|
|
@@ -17,6 +17,7 @@ class ClientParams {
|
|
|
17
17
|
iframeId;
|
|
18
18
|
variant = null;
|
|
19
19
|
userExtension = null;
|
|
20
|
+
startPage = null;
|
|
20
21
|
constructor() {
|
|
21
22
|
const params = (0, getUrlSearchParamsMap_1.getUrlSearchParamsMap)();
|
|
22
23
|
this.iframeId = params.get(enums_1.UrlParams.ID);
|
|
@@ -26,6 +27,7 @@ class ClientParams {
|
|
|
26
27
|
this.userToken = params.get(enums_1.UrlParams.TOKEN);
|
|
27
28
|
this.referrer = params.get(enums_1.UrlParams.REFERRER);
|
|
28
29
|
this.needAuthorize = params.has(enums_1.UrlParams.AUTHORIZE);
|
|
30
|
+
this.startPage = params.get(enums_1.UrlParams.START_PAGE);
|
|
29
31
|
}
|
|
30
32
|
toString() {
|
|
31
33
|
const { userToken, ...props } = this;
|
package/dist-es/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Client } from './src/Client';
|
|
2
2
|
export { EventType } from './src/enums';
|
|
3
3
|
export { ClientEventType } from './src/enums';
|
|
4
|
-
export { UrlParams } from './src/enums';
|
|
4
|
+
export { StartPage, UrlParams } from './src/enums';
|
|
5
5
|
export * from './types';
|
|
6
6
|
export default Client;
|
package/dist-es/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildix/xbees-connect",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.32",
|
|
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
|
@@ -43,6 +43,7 @@ export class Client {
|
|
|
43
43
|
isParentReactNativeWebView;
|
|
44
44
|
iframeId;
|
|
45
45
|
variant = null;
|
|
46
|
+
startPage = null;
|
|
46
47
|
localStorageManager = LocalStorageManager.getInstance();
|
|
47
48
|
constructor() {
|
|
48
49
|
const params = getUrlSearchParamsMap();
|
|
@@ -51,6 +52,7 @@ export class Client {
|
|
|
51
52
|
this.userEmail = params.get(UrlParams.USER);
|
|
52
53
|
this.referrer = params.get(UrlParams.REFERRER);
|
|
53
54
|
this.needAuthorize = params.has(UrlParams.AUTHORIZE);
|
|
55
|
+
this.startPage = params.get(UrlParams.START_PAGE);
|
|
54
56
|
// @ts-expect-error window.ReactNativeWebView will be provided by ReactNative WebView
|
|
55
57
|
this.isParentReactNativeWebView = !!window.ReactNativeWebView;
|
|
56
58
|
this.worker = this.isParentReactNativeWebView ? new PostMessageControllerNative() : new PostMessageControllerWeb();
|
|
@@ -170,6 +172,9 @@ export class Client {
|
|
|
170
172
|
getReferrer() {
|
|
171
173
|
return this.referrer;
|
|
172
174
|
}
|
|
175
|
+
getStartPage() {
|
|
176
|
+
return this.startPage;
|
|
177
|
+
}
|
|
173
178
|
isVisible() {
|
|
174
179
|
return this.visible;
|
|
175
180
|
}
|
|
@@ -360,6 +365,12 @@ export class Client {
|
|
|
360
365
|
}
|
|
361
366
|
});
|
|
362
367
|
}
|
|
368
|
+
createContactIsSupported(isSupported = true) {
|
|
369
|
+
return this.sendAsync({
|
|
370
|
+
type: ClientEventType.CREATE_CONTACT_IS_SUPPORTED,
|
|
371
|
+
payload: { isSupported },
|
|
372
|
+
});
|
|
373
|
+
}
|
|
363
374
|
onThemeChange(callback) {
|
|
364
375
|
return this.addEventListener(EventType.USE_THEME, callback);
|
|
365
376
|
}
|
|
@@ -46,6 +46,7 @@ export var ClientEventType;
|
|
|
46
46
|
ClientEventType["REMOVE_FROM_STORAGE"] = "xBeesRemoveFromStorage";
|
|
47
47
|
ClientEventType["AVAILABLE_CONTACT_DATA"] = "xBeesAvailableContactData";
|
|
48
48
|
ClientEventType["DROPDOWN_VISIBILITY"] = "xBeesDropdownVisibility";
|
|
49
|
+
ClientEventType["CREATE_CONTACT_IS_SUPPORTED"] = "xBeesCreateContactIsSupported";
|
|
49
50
|
})(ClientEventType || (ClientEventType = {}));
|
|
50
51
|
export var UrlParams;
|
|
51
52
|
(function (UrlParams) {
|
|
@@ -56,4 +57,9 @@ export var UrlParams;
|
|
|
56
57
|
UrlParams["EXTENSION"] = "e";
|
|
57
58
|
UrlParams["REFERRER"] = "r";
|
|
58
59
|
UrlParams["AUTHORIZE"] = "a";
|
|
60
|
+
UrlParams["START_PAGE"] = "sp";
|
|
59
61
|
})(UrlParams || (UrlParams = {}));
|
|
62
|
+
export var StartPage;
|
|
63
|
+
(function (StartPage) {
|
|
64
|
+
StartPage["CREATE_CONTACT"] = "createContact";
|
|
65
|
+
})(StartPage || (StartPage = {}));
|
|
@@ -15,6 +15,7 @@ export default class ClientParams {
|
|
|
15
15
|
iframeId;
|
|
16
16
|
variant = null;
|
|
17
17
|
userExtension = null;
|
|
18
|
+
startPage = null;
|
|
18
19
|
constructor() {
|
|
19
20
|
const params = getUrlSearchParamsMap();
|
|
20
21
|
this.iframeId = params.get(UrlParams.ID);
|
|
@@ -24,6 +25,7 @@ export default class ClientParams {
|
|
|
24
25
|
this.userToken = params.get(UrlParams.TOKEN);
|
|
25
26
|
this.referrer = params.get(UrlParams.REFERRER);
|
|
26
27
|
this.needAuthorize = params.has(UrlParams.AUTHORIZE);
|
|
28
|
+
this.startPage = params.get(UrlParams.START_PAGE);
|
|
27
29
|
}
|
|
28
30
|
toString() {
|
|
29
31
|
const { userToken, ...props } = this;
|
package/dist-types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Client } from './src/Client';
|
|
2
2
|
export { EventType } from './src/enums';
|
|
3
3
|
export { ClientEventType } from './src/enums';
|
|
4
|
-
export { UrlParams } from './src/enums';
|
|
4
|
+
export { StartPage, UrlParams } from './src/enums';
|
|
5
5
|
export * from './types';
|
|
6
6
|
export default Client;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Callback, ConnectClient, Contact, ContactQuery, IPayloadViewPort, LookupAndMatchContactsResolver, Message, Reject, RemoveEventListener, ResponseMessage, StorageEventCallback, SuggestContactsResolver, SupportedPlatformVariant, ToastSeverity, XBeesUser } from '../types';
|
|
2
2
|
import { ReadyExtendedProps } from '../types/Event';
|
|
3
3
|
import { LookupAndMatchBatchContactsResolver } from '../types/Resolver';
|
|
4
|
-
import { ClientEventType, EventType } from './enums';
|
|
4
|
+
import { ClientEventType, EventType, StartPage } from './enums';
|
|
5
5
|
import TechnicalSupport from './helpers/TechnicalSupport';
|
|
6
6
|
/**
|
|
7
7
|
* Client provides functionality of communication between xBees and integrated web applications via iFrame or ReactNative WebView
|
|
@@ -25,6 +25,7 @@ export declare class Client implements ConnectClient {
|
|
|
25
25
|
private readonly isParentReactNativeWebView;
|
|
26
26
|
private readonly iframeId;
|
|
27
27
|
private readonly variant;
|
|
28
|
+
private readonly startPage;
|
|
28
29
|
private readonly localStorageManager;
|
|
29
30
|
constructor();
|
|
30
31
|
private sendAsync;
|
|
@@ -44,6 +45,7 @@ export declare class Client implements ConnectClient {
|
|
|
44
45
|
getPbxDomain(): string;
|
|
45
46
|
getUserExtension(): string | null;
|
|
46
47
|
getReferrer(): string;
|
|
48
|
+
getStartPage(): StartPage | null;
|
|
47
49
|
isVisible(): boolean;
|
|
48
50
|
getBackToAppUrl(): string;
|
|
49
51
|
isDataOnly(): boolean;
|
|
@@ -76,6 +78,7 @@ export declare class Client implements ConnectClient {
|
|
|
76
78
|
onSuggestContacts(callback: (query: string, resolve: SuggestContactsResolver, reject: Reject) => void): RemoveEventListener;
|
|
77
79
|
onLookupAndMatchContact(callback: (query: ContactQuery, resolve: LookupAndMatchContactsResolver, reject: Reject) => void): RemoveEventListener;
|
|
78
80
|
onLookupAndMatchBatchContacts(callback: (query: ContactQuery[], returnResults: LookupAndMatchBatchContactsResolver) => void): RemoveEventListener;
|
|
81
|
+
createContactIsSupported(isSupported?: boolean): Promise<ResponseMessage>;
|
|
79
82
|
onThemeChange(callback: Callback<EventType.USE_THEME>): RemoveEventListener;
|
|
80
83
|
getFromStorage<Type>(key: string): Type | null;
|
|
81
84
|
saveToStorage<SavingType>(key: string, value: SavingType): void;
|
|
@@ -43,7 +43,8 @@ export declare enum ClientEventType {
|
|
|
43
43
|
GET_FROM_STORAGE = "xBeesRequestFromStorage",
|
|
44
44
|
REMOVE_FROM_STORAGE = "xBeesRemoveFromStorage",
|
|
45
45
|
AVAILABLE_CONTACT_DATA = "xBeesAvailableContactData",
|
|
46
|
-
DROPDOWN_VISIBILITY = "xBeesDropdownVisibility"
|
|
46
|
+
DROPDOWN_VISIBILITY = "xBeesDropdownVisibility",
|
|
47
|
+
CREATE_CONTACT_IS_SUPPORTED = "xBeesCreateContactIsSupported"
|
|
47
48
|
}
|
|
48
49
|
export declare enum UrlParams {
|
|
49
50
|
TOKEN = "t",
|
|
@@ -52,5 +53,9 @@ export declare enum UrlParams {
|
|
|
52
53
|
USER = "u",
|
|
53
54
|
EXTENSION = "e",
|
|
54
55
|
REFERRER = "r",
|
|
55
|
-
AUTHORIZE = "a"
|
|
56
|
+
AUTHORIZE = "a",
|
|
57
|
+
START_PAGE = "sp"
|
|
58
|
+
}
|
|
59
|
+
export declare enum StartPage {
|
|
60
|
+
CREATE_CONTACT = "createContact"
|
|
56
61
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { WorkVariants } from '../../types';
|
|
2
|
+
import { StartPage } from '../enums';
|
|
2
3
|
export default class ClientParams {
|
|
3
4
|
private static instance;
|
|
4
5
|
static getInstance(): ClientParams;
|
|
@@ -9,6 +10,7 @@ export default class ClientParams {
|
|
|
9
10
|
readonly iframeId: string;
|
|
10
11
|
readonly variant: WorkVariants | null;
|
|
11
12
|
readonly userExtension: string | null;
|
|
13
|
+
readonly startPage: StartPage | null;
|
|
12
14
|
constructor();
|
|
13
15
|
toString(): string;
|
|
14
16
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ClientEventType, EventType } from '../src/enums';
|
|
1
|
+
import { ClientEventType, EventType, StartPage } from '../src/enums';
|
|
2
2
|
import TechnicalSupport from '../src/helpers/TechnicalSupport';
|
|
3
3
|
import { Callback } from './Callback';
|
|
4
4
|
import { Contact, ContactQuery } from './Contact';
|
|
@@ -36,6 +36,9 @@ export interface ConnectClient {
|
|
|
36
36
|
/**
|
|
37
37
|
* Retrieves url to get back to x-bees app integration */
|
|
38
38
|
getBackToAppUrl: () => string;
|
|
39
|
+
/**
|
|
40
|
+
* Retrieves start page from url */
|
|
41
|
+
getStartPage: () => StartPage | null;
|
|
39
42
|
/**
|
|
40
43
|
* Retrieves the version of xBeesConnect */
|
|
41
44
|
version: () => string;
|
|
@@ -135,6 +138,9 @@ export interface ConnectClient {
|
|
|
135
138
|
/**
|
|
136
139
|
* Starts listen for the events of searching batch contacts info and handle match with the provided callback */
|
|
137
140
|
onLookupAndMatchBatchContacts: (callback: (queries: ContactQuery[], returnResults: LookupAndMatchBatchContactsResolver) => void) => RemoveEventListener;
|
|
141
|
+
/**
|
|
142
|
+
* Send event for indicate if create contact functionality is supported */
|
|
143
|
+
createContactIsSupported: (isSupported?: boolean) => Promise<ResponseMessage>;
|
|
138
144
|
/**
|
|
139
145
|
* Starts listen for the events of starting the call and handle with the provided callback */
|
|
140
146
|
onCallStarted: (callback: Callback<EventType.ADD_CALL>) => RemoveEventListener;
|
|
@@ -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 { IPayloadAutoSuggestResult, IPayloadBatchContactsMatchResult, IPayloadBatchContactsMatchResultError, IPayloadCallStart, IPayloadCallStartedInfo, IPayloadContactMatchResult, IPayloadContactMatchResultNotFound, IPayloadContactResult, IPayloadContextResult, IPayloadConversationResult, IPayloadDropdownVisibility, IPayloadGetFromStorage, IPayloadSaveToStorage, IPayloadSendAnalytics, IPayloadTechSupport, IPayloadThemeChange, IPayloadToast, IPayloadVersion, IPayloadViewPort } from './Payload';
|
|
5
|
+
import { IPayloadAutoSuggestResult, IPayloadBatchContactsMatchResult, IPayloadBatchContactsMatchResultError, IPayloadCallStart, IPayloadCallStartedInfo, IPayloadContactMatchResult, IPayloadContactMatchResultNotFound, IPayloadContactResult, IPayloadContextResult, IPayloadConversationResult, IPayloadCreateContactIsSupported, IPayloadDropdownVisibility, IPayloadGetFromStorage, IPayloadSaveToStorage, IPayloadSendAnalytics, 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 : 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.CREATE_CONTACT_IS_SUPPORTED ? IPayloadCreateContactIsSupported : never;
|
|
9
9
|
export type EventPayloadMap = {
|
|
10
10
|
[EventType.GET_CONTACTS_AUTO_SUGGEST]: string;
|
|
11
11
|
[EventType.GET_LOOK_UP_AND_MATCH]: ContactQuery;
|
|
@@ -50,6 +50,9 @@ export interface IPayloadContactMatchResultNotFound {
|
|
|
50
50
|
export interface IPayloadBatchContactsMatchResultError {
|
|
51
51
|
reason: string;
|
|
52
52
|
}
|
|
53
|
+
export interface IPayloadCreateContactIsSupported {
|
|
54
|
+
isSupported: boolean;
|
|
55
|
+
}
|
|
53
56
|
export interface IPayloadContactResult {
|
|
54
57
|
contact: Contact;
|
|
55
58
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildix/xbees-connect",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.32",
|
|
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": "",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"engines": {
|
|
46
46
|
"node": ">=16"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "e015df52d3098e5f29774d867203c32eae8a8989"
|
|
49
49
|
}
|