squarecommonblhelper 1.7.0 → 1.8.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.8.0
19
+
20
+ - AuthenticationCommonBL:
21
+ - add types for deleteUserV0
22
+
18
23
  ### v1.7.0
19
24
 
20
25
  - AuthenticationCommonBL:
@@ -17,7 +17,7 @@ declare class AuthenticationCommonBL {
17
17
  }>;
18
18
  deleteUserV0(accessToken: string, password: string): Promise<{
19
19
  message: string | null;
20
- data?: any;
20
+ data: null;
21
21
  log?: any;
22
22
  }>;
23
23
  updateUsernameV0(accessToken: string, newUsername: string): Promise<{
@@ -1,5 +1,5 @@
1
1
  import { fetchJSONData } from "squarecommons";
2
- import { GenerateAccessTokenV0ResponseZ, GetUserDetailsV0ResponseZ, LogoutV0Z, UpdatePasswordV0ResponseZ, UpdateUsernameV0ResponseZ, } from "./types/AuthenticationResponses.js";
2
+ import { DeleteUserV0Z, GenerateAccessTokenV0ResponseZ, GetUserDetailsV0ResponseZ, LogoutV0Z, UpdatePasswordV0ResponseZ, UpdateUsernameV0ResponseZ, } from "./types/AuthenticationResponses.js";
3
3
  class AuthenticationCommonBL {
4
4
  commonBLBaseURL;
5
5
  constructor(commonBLBaseURL = "http://localhost:10110") {
@@ -62,7 +62,7 @@ class AuthenticationCommonBL {
62
62
  { password: password },
63
63
  // query params
64
64
  undefined);
65
- return data;
65
+ return DeleteUserV0Z.parse(data);
66
66
  }
67
67
  catch (error) {
68
68
  throw error;
@@ -224,4 +224,20 @@ declare const LogoutV0Z: z.ZodObject<z.objectUtil.extendShape<{
224
224
  log?: any;
225
225
  }>;
226
226
  type LogoutV0 = z.infer<typeof LogoutV0Z>;
227
- export { GenerateAccessTokenV0ResponseZ, GenerateAccessTokenV0Response, UpdateUsernameV0ResponseZ, UpdateUsernameV0Response, UpdatePasswordV0ResponseZ, UpdatePasswordV0Response, GetUserDetailsV0ResponseZ, GetUserDetailsV0Response, LogoutV0, LogoutV0Z, };
227
+ declare const DeleteUserV0Z: z.ZodObject<z.objectUtil.extendShape<{
228
+ data: z.ZodAny;
229
+ message: z.ZodNullable<z.ZodString>;
230
+ log: z.ZodAny;
231
+ }, {
232
+ data: z.ZodNull;
233
+ }>, "strip", z.ZodTypeAny, {
234
+ message: string | null;
235
+ data: null;
236
+ log?: any;
237
+ }, {
238
+ message: string | null;
239
+ data: null;
240
+ log?: any;
241
+ }>;
242
+ type DeleteUserV0 = z.infer<typeof DeleteUserV0Z>;
243
+ export { GenerateAccessTokenV0ResponseZ, GenerateAccessTokenV0Response, UpdateUsernameV0ResponseZ, UpdateUsernameV0Response, UpdatePasswordV0ResponseZ, UpdatePasswordV0Response, GetUserDetailsV0ResponseZ, GetUserDetailsV0Response, LogoutV0, LogoutV0Z, DeleteUserV0, DeleteUserV0Z, };
@@ -36,4 +36,7 @@ const GetUserDetailsV0ResponseZ = APIOutputZ.extend({
36
36
  const LogoutV0Z = APIOutputZ.extend({
37
37
  data: z.null(),
38
38
  });
39
- export { GenerateAccessTokenV0ResponseZ, UpdateUsernameV0ResponseZ, UpdatePasswordV0ResponseZ, GetUserDetailsV0ResponseZ, LogoutV0Z, };
39
+ const DeleteUserV0Z = APIOutputZ.extend({
40
+ data: z.null(),
41
+ });
42
+ export { GenerateAccessTokenV0ResponseZ, UpdateUsernameV0ResponseZ, UpdatePasswordV0ResponseZ, GetUserDetailsV0ResponseZ, LogoutV0Z, DeleteUserV0Z, };
package/example.js CHANGED
@@ -30,4 +30,8 @@ console.log(
30
30
  console.log(
31
31
  await authenticationCommonBL.getUserDetailsV0("dummy_access_token")
32
32
  );
33
- console.log(await authenticationCommonBL.logoutV0("dumm_refresh_token"));
33
+ console.log(await authenticationCommonBL.logoutV0("dummy_refresh_token"));
34
+
35
+ console.log(
36
+ await authenticationCommonBL.deleteUserV0("dummy_access_token", "password")
37
+ );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "squarecommonblhelper",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "description": "helper for common bl for my projects.",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",