@wildix/xbees-connect 1.1.8 → 1.1.11

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.1.7",
3
+ "version": "1.1.9",
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": "",
@@ -291,4 +291,11 @@ export class Client {
291
291
  onStorage(listener) {
292
292
  return this.localStorageManager.onStorage(listener);
293
293
  }
294
+ onLogout(callback) {
295
+ // send event to x-bees
296
+ void this.sendAsync({
297
+ type: ClientEventType.LOGOUT_IS_SUPPORTED,
298
+ });
299
+ return this.addEventListener(EventType.LOGOUT, callback);
300
+ }
294
301
  }
@@ -7,6 +7,7 @@ export var EventType;
7
7
  EventType["USE_THEME"] = "xBeesUseTheme";
8
8
  EventType["PBX_TOKEN"] = "xBeesPbxToken";
9
9
  EventType["REDIRECT_QUERY"] = "xBeesRedirectQuery";
10
+ EventType["LOGOUT"] = "xBeesLogout";
10
11
  })(EventType || (EventType = {}));
11
12
  export var ClientEventType;
12
13
  (function (ClientEventType) {
@@ -27,6 +28,7 @@ export var ClientEventType;
27
28
  ClientEventType["CONTACT_LOOKUP_AND_MATCH"] = "xBeesContactLookupAndMatch";
28
29
  ClientEventType["CONTACT_LOOKUP_AND_MATCH_NOT_FOUND"] = "xBeesContactLookupAndMatchNotFound";
29
30
  ClientEventType["CONTACT_CREATE_OR_UPDATE"] = "xBeesContactCreateOrUpdate";
31
+ ClientEventType["LOGOUT_IS_SUPPORTED"] = "xBeesLogoutIsSupported";
30
32
  })(ClientEventType || (ClientEventType = {}));
31
33
  export var DeprecatedUrlParams;
32
34
  (function (DeprecatedUrlParams) {
@@ -65,4 +65,5 @@ export declare class Client implements ConnectClient {
65
65
  saveToStorage<SavingType>(key: string, value: SavingType): void;
66
66
  deleteFromStorage(key: string): void;
67
67
  onStorage(listener: StorageEventCallback): () => void;
68
+ onLogout(callback: Callback<EventType.LOGOUT>): RemoveEventListener;
68
69
  }
@@ -5,7 +5,8 @@ export declare enum EventType {
5
5
  TERMINATE_CALL = "xBeesTerminateCall",
6
6
  USE_THEME = "xBeesUseTheme",
7
7
  PBX_TOKEN = "xBeesPbxToken",
8
- REDIRECT_QUERY = "xBeesRedirectQuery"
8
+ REDIRECT_QUERY = "xBeesRedirectQuery",
9
+ LOGOUT = "xBeesLogout"
9
10
  }
10
11
  export declare enum ClientEventType {
11
12
  READY = "xBeesReady",
@@ -24,7 +25,8 @@ export declare enum ClientEventType {
24
25
  CONTACTS_AUTO_SUGGEST = "xBeesContactsAutoSuggest",
25
26
  CONTACT_LOOKUP_AND_MATCH = "xBeesContactLookupAndMatch",
26
27
  CONTACT_LOOKUP_AND_MATCH_NOT_FOUND = "xBeesContactLookupAndMatchNotFound",
27
- CONTACT_CREATE_OR_UPDATE = "xBeesContactCreateOrUpdate"
28
+ CONTACT_CREATE_OR_UPDATE = "xBeesContactCreateOrUpdate",
29
+ LOGOUT_IS_SUPPORTED = "xBeesLogoutIsSupported"
28
30
  }
29
31
  export declare enum DeprecatedUrlParams {
30
32
  TOKEN = "token",
@@ -242,5 +242,8 @@ export interface ConnectClient {
242
242
  /**
243
243
  * listens on localStorage */
244
244
  onStorage: (listener: StorageEventCallback) => () => void;
245
+ /**
246
+ * starts listen on logout event and send event to the xbees about logout able */
247
+ onLogout: (callback: Callback<EventType.LOGOUT>) => RemoveEventListener;
245
248
  }
246
249
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wildix/xbees-connect",
3
- "version": "1.1.8",
3
+ "version": "1.1.11",
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": "",
@@ -42,5 +42,5 @@
42
42
  "engines": {
43
43
  "node": ">=16"
44
44
  },
45
- "gitHead": "8d88b055be175fb25e9e1f6cb1d4ce3878013564"
45
+ "gitHead": "106c5ae830969189ce148276124aca70c8be3325"
46
46
  }