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
package/dist/authentication.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ declare class AuthenticationCommonBL {
|
|
|
17
17
|
}>;
|
|
18
18
|
deleteUserV0(accessToken: string, password: string): Promise<{
|
|
19
19
|
message: string | null;
|
|
20
|
-
data
|
|
20
|
+
data: null;
|
|
21
21
|
log?: any;
|
|
22
22
|
}>;
|
|
23
23
|
updateUsernameV0(accessToken: string, newUsername: string): Promise<{
|
package/dist/authentication.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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("
|
|
33
|
+
console.log(await authenticationCommonBL.logoutV0("dummy_refresh_token"));
|
|
34
|
+
|
|
35
|
+
console.log(
|
|
36
|
+
await authenticationCommonBL.deleteUserV0("dummy_access_token", "password")
|
|
37
|
+
);
|