ggez-banking-sdk 0.1.108 → 0.1.109

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.
@@ -7,6 +7,8 @@ declare class CookiesHelper {
7
7
  static GetUSR: () => USR;
8
8
  static SetUSR: (deviceId: string, userId: string) => void;
9
9
  static GetDeviceSecurityCode: () => string;
10
+ static GetAccessToken: () => string;
11
+ static SetAccessToken: (accessToken: string) => void;
10
12
  static GET: (key: string) => string | undefined;
11
13
  static SET: (key: string, value: string, expires?: Date) => void;
12
14
  static REMOVE: (key: string) => void;
@@ -110,6 +110,31 @@ class CookiesHelper {
110
110
  }
111
111
  };
112
112
  // #endregion
113
+ // #region "Access Token"
114
+ static GetAccessToken = () => {
115
+ try {
116
+ const IID = this.GetIID();
117
+ const { key, iv } = CipherHelper.GenerateByInstallationID(IID);
118
+ const accessToken = this.GET("access_token");
119
+ const decryptedAccessToken = CipherHelper.Decrypt(accessToken, key, iv);
120
+ return decryptedAccessToken;
121
+ }
122
+ catch (error) {
123
+ console.error(error);
124
+ }
125
+ };
126
+ static SetAccessToken = (accessToken) => {
127
+ try {
128
+ const IID = this.GetIID();
129
+ const { key, iv } = CipherHelper.GenerateByInstallationID(IID);
130
+ const encryptedAccessToken = CipherHelper.Encrypt(accessToken, key, iv);
131
+ this.SET("access_token", encryptedAccessToken);
132
+ }
133
+ catch (error) {
134
+ console.error(error);
135
+ }
136
+ };
137
+ // #endregion
113
138
  // #region "Getters & Setters"
114
139
  static GET = (key) => {
115
140
  return Cookies.get(key);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ggez-banking-sdk",
3
- "version": "0.1.108",
3
+ "version": "0.1.109",
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",