squarecommonblhelper 9.3.1 → 10.0.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,16 @@ helper for common bl for my projects.
|
|
|
15
15
|
|
|
16
16
|
## changelog
|
|
17
17
|
|
|
18
|
+
### v10.0.0
|
|
19
|
+
|
|
20
|
+
- AuthenticationCommonBL:
|
|
21
|
+
- **breaking change**, rename the following types to match the standard naming convention:
|
|
22
|
+
- UpdateProfileDetailsV0ResponseZ
|
|
23
|
+
- SendResetPasswordEmailV0ResponseZ
|
|
24
|
+
- UpdateUserRecoveryMethodsV0ResponseZ
|
|
25
|
+
- SendVerificationEmailV0ResponseZ
|
|
26
|
+
- ValidateEmailVerificationCodeV0ResponseZ
|
|
27
|
+
|
|
18
28
|
### v9.3.1
|
|
19
29
|
|
|
20
30
|
- AuthenticationCommonBL:
|
package/dist/authentication.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fetchFileData, fetchJSONData } from "squarecommons";
|
|
2
|
-
import { DeleteUserV0ResponseZ, GenerateAccountBackupCodeV0ResponseZ, GetUserDetailsV0ResponseZ, GetUserRecoveryMethodsV0ResponseZ, LogoutAllV0ResponseZ, LogoutAppsV0ResponseZ,
|
|
2
|
+
import { DeleteUserV0ResponseZ, GenerateAccountBackupCodeV0ResponseZ, GetUserDetailsV0ResponseZ, GetUserRecoveryMethodsV0ResponseZ, LogoutAllV0ResponseZ, LogoutAppsV0ResponseZ, SendResetPasswordEmailV0ResponseZ, SendVerificationEmailV0ResponseZ, UpdateProfileDetailsV0ResponseZ, UpdateUsernameV0ResponseZ, UpdateUserRecoveryMethodsV0ResponseZ, ValidateEmailVerificationCodeV0ResponseZ, } from "./types/AuthenticationResponses.js";
|
|
3
3
|
class AuthenticationCommonBL {
|
|
4
4
|
commonBLBaseURL;
|
|
5
5
|
constructor(commonBLBaseURL = "http://localhost:10110") {
|
|
@@ -214,7 +214,7 @@ class AuthenticationCommonBL {
|
|
|
214
214
|
undefined,
|
|
215
215
|
// query params
|
|
216
216
|
queryParams);
|
|
217
|
-
return
|
|
217
|
+
return UpdateProfileDetailsV0ResponseZ.parse(data);
|
|
218
218
|
}
|
|
219
219
|
catch (error) {
|
|
220
220
|
throw error;
|
|
@@ -235,7 +235,7 @@ class AuthenticationCommonBL {
|
|
|
235
235
|
{ username: username },
|
|
236
236
|
// query params
|
|
237
237
|
undefined);
|
|
238
|
-
return
|
|
238
|
+
return SendResetPasswordEmailV0ResponseZ.parse(data);
|
|
239
239
|
}
|
|
240
240
|
catch (error) {
|
|
241
241
|
throw error;
|
|
@@ -265,7 +265,7 @@ class AuthenticationCommonBL {
|
|
|
265
265
|
},
|
|
266
266
|
// query params
|
|
267
267
|
undefined);
|
|
268
|
-
return
|
|
268
|
+
return UpdateUserRecoveryMethodsV0ResponseZ.parse(data);
|
|
269
269
|
}
|
|
270
270
|
catch (error) {
|
|
271
271
|
throw error;
|
|
@@ -286,7 +286,7 @@ class AuthenticationCommonBL {
|
|
|
286
286
|
undefined,
|
|
287
287
|
// query params
|
|
288
288
|
undefined);
|
|
289
|
-
return
|
|
289
|
+
return SendVerificationEmailV0ResponseZ.parse(data);
|
|
290
290
|
}
|
|
291
291
|
catch (error) {
|
|
292
292
|
throw error;
|
|
@@ -307,7 +307,7 @@ class AuthenticationCommonBL {
|
|
|
307
307
|
{ verification_code: verificationCode },
|
|
308
308
|
// query params
|
|
309
309
|
undefined);
|
|
310
|
-
return
|
|
310
|
+
return ValidateEmailVerificationCodeV0ResponseZ.parse(data);
|
|
311
311
|
}
|
|
312
312
|
catch (error) {
|
|
313
313
|
throw error;
|
|
@@ -403,7 +403,7 @@ declare const GenerateAccountBackupCodeV0ResponseZ: z.ZodObject<z.objectUtil.ext
|
|
|
403
403
|
log?: any;
|
|
404
404
|
}>;
|
|
405
405
|
type GenerateAccountBackupCodeV0Response = z.infer<typeof GenerateAccountBackupCodeV0ResponseZ>;
|
|
406
|
-
declare const
|
|
406
|
+
declare const UpdateProfileDetailsV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
|
|
407
407
|
data: z.ZodAny;
|
|
408
408
|
message: z.ZodNullable<z.ZodString>;
|
|
409
409
|
log: z.ZodAny;
|
|
@@ -503,8 +503,8 @@ declare const updateProfileDetailsV0ResponseZ: z.ZodObject<z.objectUtil.extendSh
|
|
|
503
503
|
};
|
|
504
504
|
log?: any;
|
|
505
505
|
}>;
|
|
506
|
-
type
|
|
507
|
-
declare const
|
|
506
|
+
type UpdateProfileDetailsV0Response = z.infer<typeof UpdateProfileDetailsV0ResponseZ>;
|
|
507
|
+
declare const SendResetPasswordEmailV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
|
|
508
508
|
data: z.ZodAny;
|
|
509
509
|
message: z.ZodNullable<z.ZodString>;
|
|
510
510
|
log: z.ZodAny;
|
|
@@ -534,8 +534,8 @@ declare const sendResetPasswordEmailV0ResponseZ: z.ZodObject<z.objectUtil.extend
|
|
|
534
534
|
};
|
|
535
535
|
log?: any;
|
|
536
536
|
}>;
|
|
537
|
-
type
|
|
538
|
-
declare const
|
|
537
|
+
type SendResetPasswordEmailV0Response = z.infer<typeof SendResetPasswordEmailV0ResponseZ>;
|
|
538
|
+
declare const UpdateUserRecoveryMethodsV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
|
|
539
539
|
data: z.ZodAny;
|
|
540
540
|
message: z.ZodNullable<z.ZodString>;
|
|
541
541
|
log: z.ZodAny;
|
|
@@ -560,8 +560,8 @@ declare const updateUserRecoveryMethodsV0ResponseZ: z.ZodObject<z.objectUtil.ext
|
|
|
560
560
|
};
|
|
561
561
|
log?: any;
|
|
562
562
|
}>;
|
|
563
|
-
type
|
|
564
|
-
declare const
|
|
563
|
+
type UpdateUserRecoveryMethodsV0Response = z.infer<typeof UpdateUserRecoveryMethodsV0ResponseZ>;
|
|
564
|
+
declare const SendVerificationEmailV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
|
|
565
565
|
data: z.ZodAny;
|
|
566
566
|
message: z.ZodNullable<z.ZodString>;
|
|
567
567
|
log: z.ZodAny;
|
|
@@ -591,8 +591,8 @@ declare const sendVerificationEmailV0ResponseZ: z.ZodObject<z.objectUtil.extendS
|
|
|
591
591
|
} | null;
|
|
592
592
|
log?: any;
|
|
593
593
|
}>;
|
|
594
|
-
type
|
|
595
|
-
declare const
|
|
594
|
+
type SendVerificationEmailV0Response = z.infer<typeof SendVerificationEmailV0ResponseZ>;
|
|
595
|
+
declare const ValidateEmailVerificationCodeV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
|
|
596
596
|
data: z.ZodAny;
|
|
597
597
|
message: z.ZodNullable<z.ZodString>;
|
|
598
598
|
log: z.ZodAny;
|
|
@@ -617,7 +617,7 @@ declare const validateEmailVerificationCodeV0ResponseZ: z.ZodObject<z.objectUtil
|
|
|
617
617
|
} | null;
|
|
618
618
|
log?: any;
|
|
619
619
|
}>;
|
|
620
|
-
type
|
|
620
|
+
type ValidateEmailVerificationCodeV0Response = z.infer<typeof ValidateEmailVerificationCodeV0ResponseZ>;
|
|
621
621
|
declare const GetUserRecoveryMethodsV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
|
|
622
622
|
data: z.ZodAny;
|
|
623
623
|
message: z.ZodNullable<z.ZodString>;
|
|
@@ -644,4 +644,4 @@ declare const GetUserRecoveryMethodsV0ResponseZ: z.ZodObject<z.objectUtil.extend
|
|
|
644
644
|
log?: any;
|
|
645
645
|
}>;
|
|
646
646
|
type GetUserRecoveryMethodsV0Response = z.infer<typeof GetUserRecoveryMethodsV0ResponseZ>;
|
|
647
|
-
export { UpdateUsernameV0ResponseZ, UpdateUsernameV0Response, GetUserDetailsV0ResponseZ, GetUserDetailsV0Response, DeleteUserV0Response, DeleteUserV0ResponseZ, LogoutAllV0Response, LogoutAllV0ResponseZ, LogoutAppsV0Response, LogoutAppsV0ResponseZ, GenerateAccountBackupCodeV0Response, GenerateAccountBackupCodeV0ResponseZ,
|
|
647
|
+
export { UpdateUsernameV0ResponseZ, UpdateUsernameV0Response, GetUserDetailsV0ResponseZ, GetUserDetailsV0Response, DeleteUserV0Response, DeleteUserV0ResponseZ, LogoutAllV0Response, LogoutAllV0ResponseZ, LogoutAppsV0Response, LogoutAppsV0ResponseZ, GenerateAccountBackupCodeV0Response, GenerateAccountBackupCodeV0ResponseZ, UpdateProfileDetailsV0ResponseZ, UpdateProfileDetailsV0Response, SendResetPasswordEmailV0ResponseZ, SendResetPasswordEmailV0Response, RecoveryMethodEnumZ, RecoveryMethodEnum, UpdateUserRecoveryMethodsV0ResponseZ, UpdateUserRecoveryMethodsV0Response, SendVerificationEmailV0ResponseZ, SendVerificationEmailV0Response, ValidateEmailVerificationCodeV0ResponseZ, ValidateEmailVerificationCodeV0Response, GetUserRecoveryMethodsV0ResponseZ, GetUserRecoveryMethodsV0Response, };
|
|
@@ -60,7 +60,7 @@ const GenerateAccountBackupCodeV0ResponseZ = APIOutputZ.extend({
|
|
|
60
60
|
}),
|
|
61
61
|
}),
|
|
62
62
|
});
|
|
63
|
-
const
|
|
63
|
+
const UpdateProfileDetailsV0ResponseZ = APIOutputZ.extend({
|
|
64
64
|
data: z.strictObject({
|
|
65
65
|
main: z
|
|
66
66
|
.array(z.strictObject({
|
|
@@ -78,24 +78,24 @@ const updateProfileDetailsV0ResponseZ = APIOutputZ.extend({
|
|
|
78
78
|
affected_count: z.number(),
|
|
79
79
|
}),
|
|
80
80
|
});
|
|
81
|
-
const
|
|
81
|
+
const SendResetPasswordEmailV0ResponseZ = APIOutputZ.extend({
|
|
82
82
|
data: z.strictObject({
|
|
83
83
|
expires_at: z.string(),
|
|
84
84
|
cooldown_reset_at: z.string(),
|
|
85
85
|
}),
|
|
86
86
|
});
|
|
87
|
-
const
|
|
87
|
+
const UpdateUserRecoveryMethodsV0ResponseZ = APIOutputZ.extend({
|
|
88
88
|
data: z.strictObject({
|
|
89
89
|
main: z.array(RecoveryMethodEnumZ),
|
|
90
90
|
}),
|
|
91
91
|
});
|
|
92
|
-
const
|
|
92
|
+
const SendVerificationEmailV0ResponseZ = APIOutputZ.extend({
|
|
93
93
|
data: z.nullable(z.strictObject({
|
|
94
94
|
expires_at: z.string(),
|
|
95
95
|
cooldown_reset_at: z.string(),
|
|
96
96
|
})),
|
|
97
97
|
});
|
|
98
|
-
const
|
|
98
|
+
const ValidateEmailVerificationCodeV0ResponseZ = APIOutputZ.extend({
|
|
99
99
|
data: z.nullable(z.strictObject({
|
|
100
100
|
user_profile_email_verified: z.string(),
|
|
101
101
|
})),
|
|
@@ -105,4 +105,4 @@ const GetUserRecoveryMethodsV0ResponseZ = APIOutputZ.extend({
|
|
|
105
105
|
main: z.record(RecoveryMethodEnumZ, z.boolean()),
|
|
106
106
|
}),
|
|
107
107
|
});
|
|
108
|
-
export { UpdateUsernameV0ResponseZ, GetUserDetailsV0ResponseZ, DeleteUserV0ResponseZ, LogoutAllV0ResponseZ, LogoutAppsV0ResponseZ, GenerateAccountBackupCodeV0ResponseZ,
|
|
108
|
+
export { UpdateUsernameV0ResponseZ, GetUserDetailsV0ResponseZ, DeleteUserV0ResponseZ, LogoutAllV0ResponseZ, LogoutAppsV0ResponseZ, GenerateAccountBackupCodeV0ResponseZ, UpdateProfileDetailsV0ResponseZ, SendResetPasswordEmailV0ResponseZ, RecoveryMethodEnumZ, UpdateUserRecoveryMethodsV0ResponseZ, SendVerificationEmailV0ResponseZ, ValidateEmailVerificationCodeV0ResponseZ, GetUserRecoveryMethodsV0ResponseZ, };
|