squarecommonblhelper 5.0.0 → 5.1.0

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.
package/README.md CHANGED
@@ -15,6 +15,11 @@ helper for common bl for my projects.
15
15
 
16
16
  ## changelog
17
17
 
18
+ ### v5.1.0
19
+
20
+ - AuthenticationCommonBL:
21
+ - add getUserProfilePhoto
22
+
18
23
  ### v5.0.0
19
24
 
20
25
  - AuthenticationCommonBL:
@@ -54,5 +54,6 @@ declare class AuthenticationCommonBL {
54
54
  data: null;
55
55
  log?: any;
56
56
  }>;
57
+ getUserProfilePhoto(accessToken: string): Promise<Blob>;
57
58
  }
58
59
  export { AuthenticationCommonBL };
@@ -1,4 +1,4 @@
1
- import { fetchJSONData } from "squarecommons";
1
+ import { fetchFileData, fetchJSONData } from "squarecommons";
2
2
  import { DeleteUserV0Z, GetUserDetailsV0ResponseZ, LogoutAllV0Z, LogoutAppsV0Z, UpdatePasswordV0ResponseZ, UpdateUsernameV0ResponseZ, } from "./types/AuthenticationResponses.js";
3
3
  class AuthenticationCommonBL {
4
4
  commonBLBaseURL;
@@ -131,5 +131,26 @@ class AuthenticationCommonBL {
131
131
  throw error;
132
132
  }
133
133
  }
134
+ async getUserProfilePhoto(accessToken) {
135
+ try {
136
+ const data = await fetchFileData(
137
+ // base url
138
+ this.commonBLBaseURL,
139
+ // endpoint
140
+ "get_user_profile_photo/v0",
141
+ // method
142
+ "GET",
143
+ // headers
144
+ { access_token: accessToken },
145
+ // body
146
+ undefined,
147
+ // query params
148
+ undefined);
149
+ return data;
150
+ }
151
+ catch (error) {
152
+ throw error;
153
+ }
154
+ }
134
155
  }
135
156
  export { AuthenticationCommonBL };
@@ -26,7 +26,7 @@ declare const UpdateUsernameV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
26
26
  username: string;
27
27
  };
28
28
  }>;
29
- }>, "strip", z.ZodTypeAny, {
29
+ }>, "strict", z.ZodTypeAny, {
30
30
  message: string | null;
31
31
  data: {
32
32
  main: {
@@ -52,7 +52,7 @@ declare const UpdatePasswordV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
52
52
  log: z.ZodAny;
53
53
  }, {
54
54
  data: z.ZodNull;
55
- }>, "strip", z.ZodTypeAny, {
55
+ }>, "strict", z.ZodTypeAny, {
56
56
  message: string | null;
57
57
  data: null;
58
58
  log?: any;
@@ -176,7 +176,7 @@ declare const GetUserDetailsV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
176
176
  }[];
177
177
  };
178
178
  }>;
179
- }>, "strip", z.ZodTypeAny, {
179
+ }>, "strict", z.ZodTypeAny, {
180
180
  message: string | null;
181
181
  data: {
182
182
  main: {
@@ -228,7 +228,7 @@ declare const DeleteUserV0Z: z.ZodObject<z.objectUtil.extendShape<{
228
228
  log: z.ZodAny;
229
229
  }, {
230
230
  data: z.ZodNull;
231
- }>, "strip", z.ZodTypeAny, {
231
+ }>, "strict", z.ZodTypeAny, {
232
232
  message: string | null;
233
233
  data: null;
234
234
  log?: any;
@@ -244,7 +244,7 @@ declare const LogoutAllV0Z: z.ZodObject<z.objectUtil.extendShape<{
244
244
  log: z.ZodAny;
245
245
  }, {
246
246
  data: z.ZodNull;
247
- }>, "strip", z.ZodTypeAny, {
247
+ }>, "strict", z.ZodTypeAny, {
248
248
  message: string | null;
249
249
  data: null;
250
250
  log?: any;
@@ -260,7 +260,7 @@ declare const LogoutAppsV0Z: z.ZodObject<z.objectUtil.extendShape<{
260
260
  log: z.ZodAny;
261
261
  }, {
262
262
  data: z.ZodNull;
263
- }>, "strip", z.ZodTypeAny, {
263
+ }>, "strict", z.ZodTypeAny, {
264
264
  message: string | null;
265
265
  data: null;
266
266
  log?: any;
@@ -46,7 +46,7 @@ declare const CreateGreetingV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
46
46
  greeting_text: string | null;
47
47
  }[];
48
48
  }>;
49
- }>, "strip", z.ZodTypeAny, {
49
+ }>, "strict", z.ZodTypeAny, {
50
50
  message: string | null;
51
51
  data: {
52
52
  main: {
package/example.js CHANGED
@@ -28,3 +28,4 @@ console.log(await authenticationCommonBL.logoutAllV0("dummy_access_token"));
28
28
  console.log(
29
29
  await authenticationCommonBL.logoutAppsV0("dummy_access_token", ["test"])
30
30
  );
31
+ console.log(await authenticationCommonBL.getProfilePhoto("dummy_access_token"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "squarecommonblhelper",
3
- "version": "5.0.0",
3
+ "version": "5.1.0",
4
4
  "description": "helper for common bl for my projects.",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -34,7 +34,7 @@
34
34
  "node": ">=18.0.0"
35
35
  },
36
36
  "dependencies": {
37
- "squarecommons": "^2.0.0",
37
+ "squarecommons": "^2.2.0",
38
38
  "zod": "^3.24.1"
39
39
  }
40
40
  }