@wildix/xbees-connect 1.2.20 → 1.2.22

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wildix/xbees-connect",
3
- "version": "1.2.19",
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": "",
@@ -343,9 +343,8 @@ class Client {
343
343
  getFromStorage(key) {
344
344
  return this.localStorageManager.retrieve(key);
345
345
  }
346
- saveToStorage(key, value, sendToXbees = false) {
346
+ saveToStorage(key, value) {
347
347
  this.localStorageManager.save(key, value);
348
- sendToXbees && this.sendToXbeesStorage(key, value);
349
348
  }
350
349
  deleteFromStorage(key) {
351
350
  this.localStorageManager.delete(key);
@@ -378,7 +377,7 @@ class Client {
378
377
  onVisibilityChange(callback) {
379
378
  return this.addEventListener(enums_1.EventType.VISIBILITY, callback);
380
379
  }
381
- sendToXbeesStorage(key, value) {
380
+ saveInXbeesStorage(key, value) {
382
381
  void this.sendAsync({
383
382
  type: enums_1.ClientEventType.SAVE_TO_STORAGE,
384
383
  payload: {
@@ -387,9 +386,9 @@ class Client {
387
386
  },
388
387
  });
389
388
  }
390
- requestFromXbeesStorage(key) {
389
+ getFromXbeesStorage(key) {
391
390
  return this.sendAsync({
392
- type: enums_1.ClientEventType.REQUEST_FROM_STORAGE,
391
+ type: enums_1.ClientEventType.GET_FROM_STORAGE,
393
392
  payload: { key },
394
393
  });
395
394
  }
@@ -41,7 +41,7 @@ var ClientEventType;
41
41
  ClientEventType["SEND_TECHNICAL_SUPPORT_INFORMATION"] = "xBeesSendTechInfo";
42
42
  ClientEventType["USER"] = "xBeesUser";
43
43
  ClientEventType["SAVE_TO_STORAGE"] = "xBeesSaveToStorage";
44
- ClientEventType["REQUEST_FROM_STORAGE"] = "xBeesRequestFromStorage";
44
+ ClientEventType["GET_FROM_STORAGE"] = "xBeesRequestFromStorage";
45
45
  ClientEventType["REMOVE_FROM_STORAGE"] = "xBeesRemoveFromStorage";
46
46
  ClientEventType["AVAILABLE_CONTACT"] = "xBeesAvailableContact";
47
47
  })(ClientEventType || (exports.ClientEventType = ClientEventType = {}));
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wildix/xbees-connect",
3
- "version": "1.2.19",
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": "",
@@ -337,9 +337,8 @@ export class Client {
337
337
  getFromStorage(key) {
338
338
  return this.localStorageManager.retrieve(key);
339
339
  }
340
- saveToStorage(key, value, sendToXbees = false) {
340
+ saveToStorage(key, value) {
341
341
  this.localStorageManager.save(key, value);
342
- sendToXbees && this.sendToXbeesStorage(key, value);
343
342
  }
344
343
  deleteFromStorage(key) {
345
344
  this.localStorageManager.delete(key);
@@ -372,7 +371,7 @@ export class Client {
372
371
  onVisibilityChange(callback) {
373
372
  return this.addEventListener(EventType.VISIBILITY, callback);
374
373
  }
375
- sendToXbeesStorage(key, value) {
374
+ saveInXbeesStorage(key, value) {
376
375
  void this.sendAsync({
377
376
  type: ClientEventType.SAVE_TO_STORAGE,
378
377
  payload: {
@@ -381,9 +380,9 @@ export class Client {
381
380
  },
382
381
  });
383
382
  }
384
- requestFromXbeesStorage(key) {
383
+ getFromXbeesStorage(key) {
385
384
  return this.sendAsync({
386
- type: ClientEventType.REQUEST_FROM_STORAGE,
385
+ type: ClientEventType.GET_FROM_STORAGE,
387
386
  payload: { key },
388
387
  });
389
388
  }
@@ -38,7 +38,7 @@ 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["REQUEST_FROM_STORAGE"] = "xBeesRequestFromStorage";
41
+ ClientEventType["GET_FROM_STORAGE"] = "xBeesRequestFromStorage";
42
42
  ClientEventType["REMOVE_FROM_STORAGE"] = "xBeesRemoveFromStorage";
43
43
  ClientEventType["AVAILABLE_CONTACT"] = "xBeesAvailableContact";
44
44
  })(ClientEventType || (ClientEventType = {}));
@@ -76,7 +76,7 @@ export declare class Client implements ConnectClient {
76
76
  onLookupAndMatchContact(callback: (query: ContactQuery, resolve: LookupAndMatchContactsResolver, reject: Reject) => void): RemoveEventListener;
77
77
  onThemeChange(callback: Callback<EventType.USE_THEME>): RemoveEventListener;
78
78
  getFromStorage<Type>(key: string): Type | null;
79
- saveToStorage<SavingType>(key: string, value: SavingType, sendToXbees?: boolean): void;
79
+ saveToStorage<SavingType>(key: string, value: SavingType): void;
80
80
  deleteFromStorage(key: string): void;
81
81
  onStorage(listener: StorageEventCallback): () => void;
82
82
  onLogout(callback: Callback<EventType.LOGOUT>): RemoveEventListener;
@@ -84,7 +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
- sendToXbeesStorage<SavingType>(key: string, value: SavingType): void;
88
- requestFromXbeesStorage(key: string): Promise<ResponseMessage<ClientEventType.REQUEST_FROM_STORAGE>>;
87
+ saveInXbeesStorage<SavingType>(key: string, value: SavingType): void;
88
+ getFromXbeesStorage(key: string): Promise<ResponseMessage<ClientEventType.GET_FROM_STORAGE>>;
89
89
  removeFromXbeesStorage(key: string): void;
90
90
  }
@@ -36,7 +36,7 @@ export declare enum ClientEventType {
36
36
  SEND_TECHNICAL_SUPPORT_INFORMATION = "xBeesSendTechInfo",
37
37
  USER = "xBeesUser",
38
38
  SAVE_TO_STORAGE = "xBeesSaveToStorage",
39
- REQUEST_FROM_STORAGE = "xBeesRequestFromStorage",
39
+ GET_FROM_STORAGE = "xBeesRequestFromStorage",
40
40
  REMOVE_FROM_STORAGE = "xBeesRemoveFromStorage",
41
41
  AVAILABLE_CONTACT = "xBeesAvailableContact"
42
42
  }
@@ -173,10 +173,10 @@ export interface ConnectClient {
173
173
  onVisibilityChange: (callback: Callback<EventType.VISIBILITY>) => RemoveEventListener;
174
174
  /**
175
175
  * Send data to save in x-bees storage */
176
- sendToXbeesStorage: (key: string, value: string) => void;
176
+ saveInXbeesStorage: (key: string, value: string) => void;
177
177
  /**
178
178
  * Request stored data from x-bees storage */
179
- requestFromXbeesStorage: (key: string) => Promise<ResponseMessage<ClientEventType.REQUEST_FROM_STORAGE>>;
179
+ getFromXbeesStorage: (key: string) => Promise<ResponseMessage<ClientEventType.GET_FROM_STORAGE>>;
180
180
  /**
181
181
  * Remove data from x-bees storage */
182
182
  removeFromXbeesStorage: (key: string) => void;
@@ -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, IPayloadCallStart, IPayloadCallStartedInfo, IPayloadContactMatchResult, IPayloadContactMatchResultNotFound, IPayloadContactResult, IPayloadContextResult, IPayloadConversationResult, IPayloadRequestFromStorage, IPayloadSendAnalytics, IPayloadSentToStorage, IPayloadTechSupport, IPayloadThemeChange, IPayloadToast, IPayloadVersion, IPayloadViewPort } from './Payload';
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 ? IPayloadSentToStorage : T extends ClientEventType.REQUEST_FROM_STORAGE ? IPayloadRequestFromStorage : T extends ClientEventType.REMOVE_FROM_STORAGE ? IPayloadRequestFromStorage : T extends ClientEventType.AVAILABLE_CONTACT ? AvailableContactData | null : 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.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 IPayloadSentToStorage {
57
+ export interface IPayloadSaveToStorage {
58
58
  key: string;
59
59
  value: string;
60
60
  }
61
- export interface IPayloadRequestFromStorage {
61
+ export interface IPayloadGetFromStorage {
62
62
  key: string;
63
63
  }
64
64
  export interface IPayloadTechSupport {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wildix/xbees-connect",
3
- "version": "1.2.20",
3
+ "version": "1.2.22",
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": "d536c20b5bd3d2da698c69dc2ef6e2883a5cf057"
46
+ "gitHead": "357c511a9cc4e181b34b679f1e66dd09fce8dd5b"
47
47
  }