ggez-banking-sdk 0.4.30 → 0.4.32

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.
@@ -4,6 +4,7 @@ declare class ClientHelper {
4
4
  getBrowser(): string | undefined;
5
5
  getBrowserVersion(): string | undefined;
6
6
  getOS(): string | undefined;
7
+ getOSVersion(): string | undefined;
7
8
  getCPU(): string;
8
9
  getUserAgent(): string;
9
10
  getSystemLanguage(): string;
@@ -14,6 +14,9 @@ class ClientHelper {
14
14
  getOS() {
15
15
  return this.clientBrowserData.os.name;
16
16
  }
17
+ getOSVersion() {
18
+ return this.clientBrowserData.os.version;
19
+ }
17
20
  getCPU() {
18
21
  return this.clientBrowserData.cpu.architecture;
19
22
  }
@@ -13,5 +13,9 @@ declare class LocalStorageHelper {
13
13
  set(key: string, value: string): null | undefined;
14
14
  remove(key: string): null | undefined;
15
15
  clear(): void;
16
+ setLocalStorageByUserData(data: UserData): void;
17
+ removeLocalStorageOnSignup(): void;
18
+ removeLocalStorageOnLogout(): void;
19
+ clearLocalStorage(): void;
16
20
  }
17
21
  export { LocalStorageHelper };
@@ -84,5 +84,25 @@ class LocalStorageHelper {
84
84
  clear() {
85
85
  localStorage.clear();
86
86
  }
87
+ // #endregion
88
+ // #region "Utils"
89
+ setLocalStorageByUserData(data) {
90
+ if (data.preferences?.preferred_language_code) {
91
+ this.set("lang", data.preferences.preferred_language_code);
92
+ }
93
+ }
94
+ removeLocalStorageOnSignup() {
95
+ this.remove("promoCode");
96
+ this.remove("promotionData");
97
+ this.remove("referralCode");
98
+ }
99
+ removeLocalStorageOnLogout() {
100
+ this.remove("CUD");
101
+ }
102
+ clearLocalStorage() {
103
+ this.remove("CUD");
104
+ this.remove("currency");
105
+ this.remove("prefixCurrency");
106
+ }
87
107
  }
88
108
  export { LocalStorageHelper };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ggez-banking-sdk",
3
- "version": "0.4.30",
3
+ "version": "0.4.32",
4
4
  "description": "A Node.js package to handle GGEZ Banking API endpoints, Simplify the process of managing CRUD operations with this efficient and easy-to-use package.",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",