squarecommonblhelper 1.4.0 → 1.5.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
+ ### v1.5.0
19
+
20
+ - AuthenticationCommonBL:
21
+ - add types for updatePasswordV0
22
+
18
23
  ### v1.4.0
19
24
 
20
25
  - AuthenticationCommonBL:
@@ -32,7 +32,7 @@ declare class AuthenticationCommonBL {
32
32
  }>;
33
33
  updatePasswordV0(accessToken: string, oldPassword: string, newPassword: string): Promise<{
34
34
  message: string | null;
35
- data?: any;
35
+ data: null;
36
36
  log?: any;
37
37
  }>;
38
38
  getUserDetailsV0(accessToken: string): Promise<{
@@ -1,5 +1,5 @@
1
1
  import { fetchJSONData } from "squarecommons";
2
- import { GenerateAccessTokenV0ResponseZ, UpdateUsernameV0ResponseZ, } from "./types/AuthenticationResponses.js";
2
+ import { GenerateAccessTokenV0ResponseZ, UpdatePasswordV0ResponseZ, UpdateUsernameV0ResponseZ, } from "./types/AuthenticationResponses.js";
3
3
  class AuthenticationCommonBL {
4
4
  commonBLBaseURL;
5
5
  constructor(commonBLBaseURL = "http://localhost:10110") {
@@ -104,7 +104,7 @@ class AuthenticationCommonBL {
104
104
  { old_password: oldPassword, new_password: newPassword },
105
105
  // query params
106
106
  undefined);
107
- return data;
107
+ return UpdatePasswordV0ResponseZ.parse(data);
108
108
  }
109
109
  catch (error) {
110
110
  throw error;
@@ -86,4 +86,20 @@ declare const UpdateUsernameV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
86
86
  log?: any;
87
87
  }>;
88
88
  type UpdateUsernameV0Response = z.infer<typeof UpdateUsernameV0ResponseZ>;
89
- export { GenerateAccessTokenV0ResponseZ, GenerateAccessTokenV0Response, UpdateUsernameV0ResponseZ, UpdateUsernameV0Response, };
89
+ declare const UpdatePasswordV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
90
+ data: z.ZodAny;
91
+ message: z.ZodNullable<z.ZodString>;
92
+ log: z.ZodAny;
93
+ }, {
94
+ data: z.ZodNull;
95
+ }>, "strip", z.ZodTypeAny, {
96
+ message: string | null;
97
+ data: null;
98
+ log?: any;
99
+ }, {
100
+ message: string | null;
101
+ data: null;
102
+ log?: any;
103
+ }>;
104
+ type UpdatePasswordV0Response = z.infer<typeof UpdatePasswordV0ResponseZ>;
105
+ export { GenerateAccessTokenV0ResponseZ, GenerateAccessTokenV0Response, UpdateUsernameV0ResponseZ, UpdateUsernameV0Response, UpdatePasswordV0ResponseZ, UpdatePasswordV0Response, };
@@ -15,4 +15,7 @@ const UpdateUsernameV0ResponseZ = APIOutputZ.extend({
15
15
  }),
16
16
  }),
17
17
  });
18
- export { GenerateAccessTokenV0ResponseZ, UpdateUsernameV0ResponseZ, };
18
+ const UpdatePasswordV0ResponseZ = APIOutputZ.extend({
19
+ data: z.null(),
20
+ });
21
+ export { GenerateAccessTokenV0ResponseZ, UpdateUsernameV0ResponseZ, UpdatePasswordV0ResponseZ, };
package/example.js CHANGED
@@ -20,3 +20,10 @@ console.log(
20
20
  "new_username"
21
21
  )
22
22
  );
23
+ console.log(
24
+ await authenticationCommonBL.updatePasswordV0(
25
+ "dummy_access_token",
26
+ "oldPassword",
27
+ "newPassword"
28
+ )
29
+ );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "squarecommonblhelper",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "helper for common bl for my projects.",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",