@wildix/xbees-connect 1.1.14 → 1.1.15

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.13",
3
+ "version": "1.1.14",
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": "",
@@ -310,4 +310,7 @@ export class Client {
310
310
  },
311
311
  });
312
312
  }
313
+ setIntegrationStorageKey(integrationKey) {
314
+ this.localStorageManager.setIntegrationKey(integrationKey);
315
+ }
313
316
  }
@@ -8,6 +8,9 @@ class LocalStorageManager {
8
8
  }
9
9
  listeners = new Set();
10
10
  integrationKey = '';
11
+ setIntegrationKey(integrationKey) {
12
+ this.integrationKey = integrationKey;
13
+ }
11
14
  getStorageKey(key) {
12
15
  return !this.integrationKey ? key : `${this.integrationKey}_${key}`;
13
16
  }
@@ -68,4 +68,5 @@ export declare class Client implements ConnectClient {
68
68
  onStorage(listener: StorageEventCallback): () => void;
69
69
  onLogout(callback: Callback<EventType.LOGOUT>): RemoveEventListener;
70
70
  sendAnalytics(eventName: string, params?: Record<string, string>): void;
71
+ setIntegrationStorageKey(integrationKey: string): void;
71
72
  }
@@ -4,6 +4,7 @@ declare class LocalStorageManager {
4
4
  static getInstance(): LocalStorageManager;
5
5
  private listeners;
6
6
  private integrationKey;
7
+ setIntegrationKey(integrationKey: string): void;
7
8
  getStorageKey(key: string): string;
8
9
  getKey(key: string): string;
9
10
  constructor();
@@ -253,6 +253,9 @@ export interface ConnectClient {
253
253
  /**
254
254
  * Removes data from localStorage */
255
255
  deleteFromStorage: (key: string) => void;
256
+ /**
257
+ * Set parent integration key to switch to parent integration localStorage data */
258
+ setIntegrationStorageKey: (integrationKey: string) => void;
256
259
  /**
257
260
  * listens on localStorage */
258
261
  onStorage: (listener: StorageEventCallback) => () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wildix/xbees-connect",
3
- "version": "1.1.14",
3
+ "version": "1.1.15",
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": "4f72ef6a17809a221be833a0a3da7c68f5d5ef14"
45
+ "gitHead": "958f82f41e6fb5ddc73c072cccb4e1635630fd9a"
46
46
  }