ggez-banking-sdk 0.1.128 → 0.1.129

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.
@@ -9,6 +9,8 @@ declare class CookiesHelper {
9
9
  static GetDeviceSecurityCode: () => string;
10
10
  static GetAccessToken: () => string;
11
11
  static SetAccessToken: (accessToken: string) => void;
12
+ static GetJWTToken: () => string;
13
+ static SetJWTToken: (jwtToken: string) => void;
12
14
  static GET: (key: string) => string | undefined;
13
15
  static SET: (key: string, value: string, expires?: Date) => void;
14
16
  static REMOVE: (key: string) => void;
@@ -135,6 +135,31 @@ class CookiesHelper {
135
135
  }
136
136
  };
137
137
  // #endregion
138
+ // #region "JWT Token"
139
+ static GetJWTToken = () => {
140
+ try {
141
+ const IID = this.GetIID();
142
+ const { key, iv } = CipherHelper.GenerateByInstallationID(IID);
143
+ const jwtToken = this.GET("jwt_token");
144
+ const decryptedAccessToken = CipherHelper.Decrypt(jwtToken, key, iv);
145
+ return decryptedAccessToken;
146
+ }
147
+ catch (error) {
148
+ console.error(error);
149
+ }
150
+ };
151
+ static SetJWTToken = (jwtToken) => {
152
+ try {
153
+ const IID = this.GetIID();
154
+ const { key, iv } = CipherHelper.GenerateByInstallationID(IID);
155
+ const encryptedAccessToken = CipherHelper.Encrypt(jwtToken, key, iv);
156
+ this.SET("jwt_token", encryptedAccessToken);
157
+ }
158
+ catch (error) {
159
+ console.error(error);
160
+ }
161
+ };
162
+ // #endregion
138
163
  // #region "Getters & Setters"
139
164
  static GET = (key) => {
140
165
  return Cookies.get(key);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ggez-banking-sdk",
3
- "version": "0.1.128",
3
+ "version": "0.1.129",
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",