@wildix/xbees-connect 1.1.16 → 1.1.20

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.15",
3
+ "version": "1.1.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": "",
@@ -61,6 +61,14 @@ export class Client {
61
61
  iframeId: this.iframeId,
62
62
  });
63
63
  }
64
+ async sendAsyncErrorSafe(data) {
65
+ try {
66
+ return await this.sendAsync(data);
67
+ }
68
+ catch (error) {
69
+ console.debug('send error - type:', error);
70
+ }
71
+ }
64
72
  parseMessage(message) {
65
73
  try {
66
74
  const data = typeof message.data === 'string'
@@ -225,7 +233,7 @@ export class Client {
225
233
  }
226
234
  onSuggestContacts(callback) {
227
235
  // send event to x-bees
228
- void this.sendAsync({
236
+ void this.sendAsyncErrorSafe({
229
237
  type: ClientEventType.CONTACTS_AUTO_SUGGEST_IS_SUPPORTED,
230
238
  });
231
239
  return this.addEventListener(EventType.GET_CONTACTS_AUTO_SUGGEST, (query) => {
@@ -249,7 +257,7 @@ export class Client {
249
257
  }
250
258
  onLookupAndMatchContact(callback) {
251
259
  // send event to x-bees
252
- void this.sendAsync({
260
+ void this.sendAsyncErrorSafe({
253
261
  type: ClientEventType.CONTACT_LOOK_UP_AND_MATCH_IS_SUPPORTED,
254
262
  });
255
263
  return this.addEventListener(EventType.GET_LOOK_UP_AND_MATCH, (query) => {
@@ -21,6 +21,7 @@ export declare class Client implements ConnectClient {
21
21
  private readonly localStorageManager;
22
22
  constructor();
23
23
  private sendAsync;
24
+ private sendAsyncErrorSafe;
24
25
  private parseMessage;
25
26
  private onMessage;
26
27
  ready(platform?: SupportedPlatformVariant | undefined): Promise<ResponseMessage>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wildix/xbees-connect",
3
- "version": "1.1.16",
3
+ "version": "1.1.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": "",
@@ -42,5 +42,5 @@
42
42
  "engines": {
43
43
  "node": ">=16"
44
44
  },
45
- "gitHead": "2f71923d9d094f77d8e41b6ea7a2e7dc4aed9c1b"
45
+ "gitHead": "a2b8416ab3351c9c94fe9165729692f3a60b6df8"
46
46
  }