ggez-banking-sdk 0.1.140 → 0.1.142

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.
@@ -11,13 +11,19 @@ declare class OrganizationClient {
11
11
  message: string;
12
12
  error: any;
13
13
  }>;
14
- CreateOrganizationDocument: (id: number, data: ICreateOrganizationDocumentData) => Promise<{
14
+ CreateOrganizationDocument: ({ id, data, }: {
15
+ id: number;
16
+ data: ICreateOrganizationDocumentData;
17
+ }) => Promise<{
15
18
  data: import("../../types").DocumentData;
16
19
  success: boolean;
17
20
  message: string;
18
21
  error: any;
19
22
  }>;
20
- UpdateOrganization: (id: number, data: IUpdateOrganizationData) => Promise<{
23
+ UpdateOrganization: ({ id, data, }: {
24
+ id: number;
25
+ data: IUpdateOrganizationData;
26
+ }) => Promise<{
21
27
  data: import("../../types").OrganizationData;
22
28
  success: boolean;
23
29
  message: string;
@@ -27,7 +27,7 @@ class OrganizationClient {
27
27
  return ResponseHelper.GetErrorResponse(organization, "CreateOrganization");
28
28
  }
29
29
  };
30
- CreateOrganizationDocument = async (id, data) => {
30
+ CreateOrganizationDocument = async ({ id, data, }) => {
31
31
  try {
32
32
  const documentData = FillCreateOrganizationDocumentData(data);
33
33
  const response = await this.organizationService.createDocument(id, documentData);
@@ -41,7 +41,7 @@ class OrganizationClient {
41
41
  };
42
42
  // #endregion
43
43
  // #region "PUT"
44
- UpdateOrganization = async (id, data) => {
44
+ UpdateOrganization = async ({ id, data, }) => {
45
45
  try {
46
46
  const organizationData = FillUpdateOrganizationData(data, this.userId);
47
47
  const response = await this.organizationService.update(id, organizationData);
@@ -100,6 +100,9 @@ class CookiesHelper {
100
100
  const IID = this.GetIID();
101
101
  const DEK = this.GetDEK();
102
102
  const USR = this.GetUSR();
103
+ if (!DEK || !USR) {
104
+ return "";
105
+ }
103
106
  const { key, iv } = CipherHelper.GenerateByUserID(USR.user_id.toString());
104
107
  const DUID = IID + "." + DEK;
105
108
  const deviceSecurityCode = CipherHelper.Encrypt(DUID, key, iv);
@@ -207,11 +210,23 @@ class CookiesHelper {
207
210
  callback();
208
211
  }
209
212
  break;
213
+ case "access_token":
214
+ const accessToken = this.GetAccessToken();
215
+ if (accessToken != changedCookie.value) {
216
+ callback();
217
+ }
218
+ break;
219
+ case "jwt_token":
220
+ const jwtToken = this.GetJWTToken();
221
+ if (jwtToken != changedCookie.value) {
222
+ callback();
223
+ }
224
+ break;
210
225
  }
211
226
  };
212
227
  static onDeleteHandler = (deleted, callback) => {
213
228
  const deletedCookie = deleted[0];
214
- if (["DEK", "USR", "IID"].includes(deletedCookie.name)) {
229
+ if (["DEK", "USR", "IID", "access_token", "jwt_token"].includes(deletedCookie.name)) {
215
230
  callback();
216
231
  }
217
232
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ggez-banking-sdk",
3
- "version": "0.1.140",
3
+ "version": "0.1.142",
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",