@wildix/xbees-connect 1.2.19-alpha.9 → 1.2.21
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/package.json +1 -1
- package/dist-cjs/src/Client.js +12 -6
- package/dist-cjs/src/enums/index.js +3 -2
- package/dist-es/package.json +1 -1
- package/dist-es/src/Client.js +12 -6
- package/dist-es/src/enums/index.js +3 -2
- package/dist-types/src/Client.d.ts +4 -3
- package/dist-types/src/enums/index.d.ts +3 -2
- package/dist-types/types/AvailableContactData.d.ts +4 -0
- package/dist-types/types/Client.d.ts +6 -3
- package/dist-types/types/Event.d.ts +3 -3
- package/dist-types/types/Payload.d.ts +2 -2
- package/dist-types/types/index.d.ts +1 -1
- package/package.json +2 -2
- package/dist-types/types/CachedContact.d.ts +0 -4
- /package/dist-cjs/types/{CachedContact.js → AvailableContactData.js} +0 -0
- /package/dist-es/types/{CachedContact.js → AvailableContactData.js} +0 -0
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.20",
|
|
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
|
@@ -204,8 +204,8 @@ class Client {
|
|
|
204
204
|
getCurrentConversation() {
|
|
205
205
|
return this.sendAsync({ type: enums_1.ClientEventType.CURRENT_CONVERSATION });
|
|
206
206
|
}
|
|
207
|
-
|
|
208
|
-
return this.sendAsync({ type: enums_1.ClientEventType.
|
|
207
|
+
getAvailableContactData() {
|
|
208
|
+
return this.sendAsync({ type: enums_1.ClientEventType.AVAILABLE_CONTACT });
|
|
209
209
|
}
|
|
210
210
|
contactUpdated(query, contact) {
|
|
211
211
|
return this.sendAsync({ type: enums_1.ClientEventType.CONTACT_CREATE_OR_UPDATE, payload: { query, contact } });
|
|
@@ -345,7 +345,7 @@ class Client {
|
|
|
345
345
|
}
|
|
346
346
|
saveToStorage(key, value, sendToXbees = false) {
|
|
347
347
|
this.localStorageManager.save(key, value);
|
|
348
|
-
sendToXbees && this.
|
|
348
|
+
sendToXbees && this.saveInXbeesStorage(key, value);
|
|
349
349
|
}
|
|
350
350
|
deleteFromStorage(key) {
|
|
351
351
|
this.localStorageManager.delete(key);
|
|
@@ -378,7 +378,7 @@ class Client {
|
|
|
378
378
|
onVisibilityChange(callback) {
|
|
379
379
|
return this.addEventListener(enums_1.EventType.VISIBILITY, callback);
|
|
380
380
|
}
|
|
381
|
-
|
|
381
|
+
saveInXbeesStorage(key, value) {
|
|
382
382
|
void this.sendAsync({
|
|
383
383
|
type: enums_1.ClientEventType.SAVE_TO_STORAGE,
|
|
384
384
|
payload: {
|
|
@@ -387,9 +387,15 @@ class Client {
|
|
|
387
387
|
},
|
|
388
388
|
});
|
|
389
389
|
}
|
|
390
|
-
|
|
390
|
+
getFromXbeesStorage(key) {
|
|
391
391
|
return this.sendAsync({
|
|
392
|
-
type: enums_1.ClientEventType.
|
|
392
|
+
type: enums_1.ClientEventType.GET_FROM_STORAGE,
|
|
393
|
+
payload: { key },
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
removeFromXbeesStorage(key) {
|
|
397
|
+
void this.sendAsync({
|
|
398
|
+
type: enums_1.ClientEventType.REMOVE_FROM_STORAGE,
|
|
393
399
|
payload: { key },
|
|
394
400
|
});
|
|
395
401
|
}
|
|
@@ -41,8 +41,9 @@ var ClientEventType;
|
|
|
41
41
|
ClientEventType["SEND_TECHNICAL_SUPPORT_INFORMATION"] = "xBeesSendTechInfo";
|
|
42
42
|
ClientEventType["USER"] = "xBeesUser";
|
|
43
43
|
ClientEventType["SAVE_TO_STORAGE"] = "xBeesSaveToStorage";
|
|
44
|
-
ClientEventType["
|
|
45
|
-
ClientEventType["
|
|
44
|
+
ClientEventType["GET_FROM_STORAGE"] = "xBeesRequestFromStorage";
|
|
45
|
+
ClientEventType["REMOVE_FROM_STORAGE"] = "xBeesRemoveFromStorage";
|
|
46
|
+
ClientEventType["AVAILABLE_CONTACT"] = "xBeesAvailableContact";
|
|
46
47
|
})(ClientEventType || (exports.ClientEventType = ClientEventType = {}));
|
|
47
48
|
var UrlParams;
|
|
48
49
|
(function (UrlParams) {
|
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.20",
|
|
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
|
@@ -198,8 +198,8 @@ export class Client {
|
|
|
198
198
|
getCurrentConversation() {
|
|
199
199
|
return this.sendAsync({ type: ClientEventType.CURRENT_CONVERSATION });
|
|
200
200
|
}
|
|
201
|
-
|
|
202
|
-
return this.sendAsync({ type: ClientEventType.
|
|
201
|
+
getAvailableContactData() {
|
|
202
|
+
return this.sendAsync({ type: ClientEventType.AVAILABLE_CONTACT });
|
|
203
203
|
}
|
|
204
204
|
contactUpdated(query, contact) {
|
|
205
205
|
return this.sendAsync({ type: ClientEventType.CONTACT_CREATE_OR_UPDATE, payload: { query, contact } });
|
|
@@ -339,7 +339,7 @@ export class Client {
|
|
|
339
339
|
}
|
|
340
340
|
saveToStorage(key, value, sendToXbees = false) {
|
|
341
341
|
this.localStorageManager.save(key, value);
|
|
342
|
-
sendToXbees && this.
|
|
342
|
+
sendToXbees && this.saveInXbeesStorage(key, value);
|
|
343
343
|
}
|
|
344
344
|
deleteFromStorage(key) {
|
|
345
345
|
this.localStorageManager.delete(key);
|
|
@@ -372,7 +372,7 @@ export class Client {
|
|
|
372
372
|
onVisibilityChange(callback) {
|
|
373
373
|
return this.addEventListener(EventType.VISIBILITY, callback);
|
|
374
374
|
}
|
|
375
|
-
|
|
375
|
+
saveInXbeesStorage(key, value) {
|
|
376
376
|
void this.sendAsync({
|
|
377
377
|
type: ClientEventType.SAVE_TO_STORAGE,
|
|
378
378
|
payload: {
|
|
@@ -381,9 +381,15 @@ export class Client {
|
|
|
381
381
|
},
|
|
382
382
|
});
|
|
383
383
|
}
|
|
384
|
-
|
|
384
|
+
getFromXbeesStorage(key) {
|
|
385
385
|
return this.sendAsync({
|
|
386
|
-
type: ClientEventType.
|
|
386
|
+
type: ClientEventType.GET_FROM_STORAGE,
|
|
387
|
+
payload: { key },
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
removeFromXbeesStorage(key) {
|
|
391
|
+
void this.sendAsync({
|
|
392
|
+
type: ClientEventType.REMOVE_FROM_STORAGE,
|
|
387
393
|
payload: { key },
|
|
388
394
|
});
|
|
389
395
|
}
|
|
@@ -38,8 +38,9 @@ export var ClientEventType;
|
|
|
38
38
|
ClientEventType["SEND_TECHNICAL_SUPPORT_INFORMATION"] = "xBeesSendTechInfo";
|
|
39
39
|
ClientEventType["USER"] = "xBeesUser";
|
|
40
40
|
ClientEventType["SAVE_TO_STORAGE"] = "xBeesSaveToStorage";
|
|
41
|
-
ClientEventType["
|
|
42
|
-
ClientEventType["
|
|
41
|
+
ClientEventType["GET_FROM_STORAGE"] = "xBeesRequestFromStorage";
|
|
42
|
+
ClientEventType["REMOVE_FROM_STORAGE"] = "xBeesRemoveFromStorage";
|
|
43
|
+
ClientEventType["AVAILABLE_CONTACT"] = "xBeesAvailableContact";
|
|
43
44
|
})(ClientEventType || (ClientEventType = {}));
|
|
44
45
|
export var UrlParams;
|
|
45
46
|
(function (UrlParams) {
|
|
@@ -52,7 +52,7 @@ export declare class Client implements ConnectClient {
|
|
|
52
52
|
getContext(): Promise<Message<ClientEventType.CONTEXT>>;
|
|
53
53
|
getCurrentContact(): Promise<Message<ClientEventType.CURRENT_CONTACT>>;
|
|
54
54
|
getCurrentConversation(): Promise<Message<ClientEventType.CURRENT_CONVERSATION>>;
|
|
55
|
-
|
|
55
|
+
getAvailableContactData(): Promise<Message<ClientEventType.AVAILABLE_CONTACT>>;
|
|
56
56
|
contactUpdated(query: ContactQuery, contact: Contact): Promise<Message<ClientEventType.CONTACT_CREATE_OR_UPDATE>>;
|
|
57
57
|
contactMatchUpdated(query: ContactQuery, contact: Contact): Promise<ResponseMessage<ClientEventType.CONTACT_MATCH_UPDATE>>;
|
|
58
58
|
getThemeMode(): Promise<Message<ClientEventType.THEME_MODE>>;
|
|
@@ -84,6 +84,7 @@ export declare class Client implements ConnectClient {
|
|
|
84
84
|
setIntegrationStorageKey(integrationKey: string): void;
|
|
85
85
|
getTechnicalSupport(): TechnicalSupport;
|
|
86
86
|
onVisibilityChange(callback: Callback<EventType.VISIBILITY>): RemoveEventListener;
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
saveInXbeesStorage<SavingType>(key: string, value: SavingType): void;
|
|
88
|
+
getFromXbeesStorage(key: string): Promise<ResponseMessage<ClientEventType.GET_FROM_STORAGE>>;
|
|
89
|
+
removeFromXbeesStorage(key: string): void;
|
|
89
90
|
}
|
|
@@ -36,8 +36,9 @@ export declare enum ClientEventType {
|
|
|
36
36
|
SEND_TECHNICAL_SUPPORT_INFORMATION = "xBeesSendTechInfo",
|
|
37
37
|
USER = "xBeesUser",
|
|
38
38
|
SAVE_TO_STORAGE = "xBeesSaveToStorage",
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
GET_FROM_STORAGE = "xBeesRequestFromStorage",
|
|
40
|
+
REMOVE_FROM_STORAGE = "xBeesRemoveFromStorage",
|
|
41
|
+
AVAILABLE_CONTACT = "xBeesAvailableContact"
|
|
41
42
|
}
|
|
42
43
|
export declare enum UrlParams {
|
|
43
44
|
TOKEN = "t",
|
|
@@ -77,7 +77,7 @@ export interface ConnectClient {
|
|
|
77
77
|
getCurrentConversation: () => Promise<ResponseMessage<ClientEventType.CURRENT_CONVERSATION>>;
|
|
78
78
|
/**
|
|
79
79
|
* Retrieves contact cached by x-bees */
|
|
80
|
-
|
|
80
|
+
getAvailableContactData: () => Promise<ResponseMessage<ClientEventType.AVAILABLE_CONTACT>>;
|
|
81
81
|
/**
|
|
82
82
|
* Sends notification to x-bees about contact data updated */
|
|
83
83
|
contactUpdated(query: ContactQuery, contact: Contact): Promise<ResponseMessage<ClientEventType.CONTACT_CREATE_OR_UPDATE>>;
|
|
@@ -173,8 +173,11 @@ export interface ConnectClient {
|
|
|
173
173
|
onVisibilityChange: (callback: Callback<EventType.VISIBILITY>) => RemoveEventListener;
|
|
174
174
|
/**
|
|
175
175
|
* Send data to save in x-bees storage */
|
|
176
|
-
|
|
176
|
+
saveInXbeesStorage: (key: string, value: string) => void;
|
|
177
177
|
/**
|
|
178
178
|
* Request stored data from x-bees storage */
|
|
179
|
-
|
|
179
|
+
getFromXbeesStorage: (key: string) => Promise<ResponseMessage<ClientEventType.GET_FROM_STORAGE>>;
|
|
180
|
+
/**
|
|
181
|
+
* Remove data from x-bees storage */
|
|
182
|
+
removeFromXbeesStorage: (key: string) => void;
|
|
180
183
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ClientEventType, EventType } from '../src/enums';
|
|
2
|
-
import {
|
|
2
|
+
import { AvailableContactData } from './AvailableContactData';
|
|
3
3
|
import { ContactQuery } from './Contact';
|
|
4
4
|
import { Message, MessageType } from './Message';
|
|
5
|
-
import { IPayloadAutoSuggestResult, IPayloadCallStart, IPayloadCallStartedInfo, IPayloadContactMatchResult, IPayloadContactMatchResultNotFound, IPayloadContactResult, IPayloadContextResult, IPayloadConversationResult,
|
|
5
|
+
import { IPayloadAutoSuggestResult, IPayloadCallStart, IPayloadCallStartedInfo, IPayloadContactMatchResult, IPayloadContactMatchResultNotFound, IPayloadContactResult, IPayloadContextResult, IPayloadConversationResult, 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.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.VISIBILITY ? boolean : T extends ClientEventType.USER ? XBeesUser : T extends ClientEventType.SAVE_TO_STORAGE ?
|
|
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.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.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 ? AvailableContactData | null : never;
|
|
9
9
|
export type EventPayloadMap = {
|
|
10
10
|
[EventType.GET_CONTACTS_AUTO_SUGGEST]: string;
|
|
11
11
|
[EventType.GET_LOOK_UP_AND_MATCH]: ContactQuery;
|
|
@@ -54,11 +54,11 @@ export interface IPayloadSendAnalytics {
|
|
|
54
54
|
eventName: string;
|
|
55
55
|
params?: Record<string, string>;
|
|
56
56
|
}
|
|
57
|
-
export interface
|
|
57
|
+
export interface IPayloadSaveToStorage {
|
|
58
58
|
key: string;
|
|
59
59
|
value: string;
|
|
60
60
|
}
|
|
61
|
-
export interface
|
|
61
|
+
export interface IPayloadGetFromStorage {
|
|
62
62
|
key: string;
|
|
63
63
|
}
|
|
64
64
|
export interface IPayloadTechSupport {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type {
|
|
1
|
+
export type { AvailableContactData } from './AvailableContactData';
|
|
2
2
|
export type { Callback } from './Callback';
|
|
3
3
|
export type { ConnectClient } from './Client';
|
|
4
4
|
export type { Contact, ContactQuery } from './Contact';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildix/xbees-connect",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.21",
|
|
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": "",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"engines": {
|
|
44
44
|
"node": ">=16"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "4128033f1d6e4deaa7315d5f5e680c840616cebf"
|
|
47
47
|
}
|
|
File without changes
|
|
File without changes
|