squarecommonblhelper 9.2.0 → 9.2.1
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
|
+
### v9.2.1
|
|
19
|
+
|
|
20
|
+
- AuthenticationCommonBL:
|
|
21
|
+
- update type of GetUserDetailsV0ResponseZ and GetUserRecoveryMethodsV0ResponseZ to include RecoveryMethodEnumZ as key instead of random string.
|
|
22
|
+
|
|
18
23
|
### v9.2.0
|
|
19
24
|
|
|
20
25
|
- AuthenticationCommonBL:
|
package/dist/authentication.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ declare class AuthenticationCommonBL {
|
|
|
38
38
|
app_name: string;
|
|
39
39
|
active_sessions: number;
|
|
40
40
|
}[];
|
|
41
|
-
recovery_methods: Record<
|
|
41
|
+
recovery_methods: Partial<Record<"EMAIL" | "BACKUP_CODE", boolean>>;
|
|
42
42
|
email_verification_details: {
|
|
43
43
|
expires_at: string;
|
|
44
44
|
cooldown_reset_at: string;
|
|
@@ -124,7 +124,7 @@ declare class AuthenticationCommonBL {
|
|
|
124
124
|
getUserRecoveryMethodsV0(username: string): Promise<{
|
|
125
125
|
message: string | null;
|
|
126
126
|
data: {
|
|
127
|
-
main: Record<
|
|
127
|
+
main: Partial<Record<"EMAIL" | "BACKUP_CODE", boolean>>;
|
|
128
128
|
};
|
|
129
129
|
log?: any;
|
|
130
130
|
}>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
declare const RecoveryMethodEnumZ: z.ZodEnum<["EMAIL", "BACKUP_CODE"]>;
|
|
3
|
+
type RecoveryMethodEnum = z.infer<typeof RecoveryMethodEnumZ>;
|
|
2
4
|
declare const UpdateUsernameV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
|
|
3
5
|
data: z.ZodAny;
|
|
4
6
|
message: z.ZodNullable<z.ZodString>;
|
|
@@ -94,7 +96,7 @@ declare const GetUserDetailsV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
94
96
|
app_name: string;
|
|
95
97
|
active_sessions: number;
|
|
96
98
|
}>, "many">;
|
|
97
|
-
recovery_methods: z.ZodRecord<z.
|
|
99
|
+
recovery_methods: z.ZodRecord<z.ZodEnum<["EMAIL", "BACKUP_CODE"]>, z.ZodBoolean>;
|
|
98
100
|
email_verification_details: z.ZodNullable<z.ZodObject<{
|
|
99
101
|
expires_at: z.ZodString;
|
|
100
102
|
cooldown_reset_at: z.ZodString;
|
|
@@ -123,7 +125,7 @@ declare const GetUserDetailsV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
123
125
|
app_name: string;
|
|
124
126
|
active_sessions: number;
|
|
125
127
|
}[];
|
|
126
|
-
recovery_methods: Record<
|
|
128
|
+
recovery_methods: Partial<Record<"EMAIL" | "BACKUP_CODE", boolean>>;
|
|
127
129
|
email_verification_details: {
|
|
128
130
|
expires_at: string;
|
|
129
131
|
cooldown_reset_at: string;
|
|
@@ -146,7 +148,7 @@ declare const GetUserDetailsV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
146
148
|
app_name: string;
|
|
147
149
|
active_sessions: number;
|
|
148
150
|
}[];
|
|
149
|
-
recovery_methods: Record<
|
|
151
|
+
recovery_methods: Partial<Record<"EMAIL" | "BACKUP_CODE", boolean>>;
|
|
150
152
|
email_verification_details: {
|
|
151
153
|
expires_at: string;
|
|
152
154
|
cooldown_reset_at: string;
|
|
@@ -171,7 +173,7 @@ declare const GetUserDetailsV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
171
173
|
app_name: string;
|
|
172
174
|
active_sessions: number;
|
|
173
175
|
}[];
|
|
174
|
-
recovery_methods: Record<
|
|
176
|
+
recovery_methods: Partial<Record<"EMAIL" | "BACKUP_CODE", boolean>>;
|
|
175
177
|
email_verification_details: {
|
|
176
178
|
expires_at: string;
|
|
177
179
|
cooldown_reset_at: string;
|
|
@@ -196,7 +198,7 @@ declare const GetUserDetailsV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
196
198
|
app_name: string;
|
|
197
199
|
active_sessions: number;
|
|
198
200
|
}[];
|
|
199
|
-
recovery_methods: Record<
|
|
201
|
+
recovery_methods: Partial<Record<"EMAIL" | "BACKUP_CODE", boolean>>;
|
|
200
202
|
email_verification_details: {
|
|
201
203
|
expires_at: string;
|
|
202
204
|
cooldown_reset_at: string;
|
|
@@ -224,7 +226,7 @@ declare const GetUserDetailsV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
224
226
|
app_name: string;
|
|
225
227
|
active_sessions: number;
|
|
226
228
|
}[];
|
|
227
|
-
recovery_methods: Record<
|
|
229
|
+
recovery_methods: Partial<Record<"EMAIL" | "BACKUP_CODE", boolean>>;
|
|
228
230
|
email_verification_details: {
|
|
229
231
|
expires_at: string;
|
|
230
232
|
cooldown_reset_at: string;
|
|
@@ -253,7 +255,7 @@ declare const GetUserDetailsV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
253
255
|
app_name: string;
|
|
254
256
|
active_sessions: number;
|
|
255
257
|
}[];
|
|
256
|
-
recovery_methods: Record<
|
|
258
|
+
recovery_methods: Partial<Record<"EMAIL" | "BACKUP_CODE", boolean>>;
|
|
257
259
|
email_verification_details: {
|
|
258
260
|
expires_at: string;
|
|
259
261
|
cooldown_reset_at: string;
|
|
@@ -490,8 +492,6 @@ declare const sendResetPasswordEmailV0ResponseZ: z.ZodObject<z.objectUtil.extend
|
|
|
490
492
|
log?: any;
|
|
491
493
|
}>;
|
|
492
494
|
type sendResetPasswordEmailV0Response = z.infer<typeof sendResetPasswordEmailV0ResponseZ>;
|
|
493
|
-
declare const RecoveryMethodEnumZ: z.ZodEnum<["EMAIL", "BACKUP_CODE"]>;
|
|
494
|
-
type RecoveryMethodEnum = z.infer<typeof RecoveryMethodEnumZ>;
|
|
495
495
|
declare const updateUserRecoveryMethodsV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
|
|
496
496
|
data: z.ZodAny;
|
|
497
497
|
message: z.ZodNullable<z.ZodString>;
|
|
@@ -581,22 +581,22 @@ declare const GetUserRecoveryMethodsV0ResponseZ: z.ZodObject<z.objectUtil.extend
|
|
|
581
581
|
log: z.ZodAny;
|
|
582
582
|
}, {
|
|
583
583
|
data: z.ZodObject<{
|
|
584
|
-
main: z.ZodRecord<z.
|
|
584
|
+
main: z.ZodRecord<z.ZodEnum<["EMAIL", "BACKUP_CODE"]>, z.ZodBoolean>;
|
|
585
585
|
}, "strict", z.ZodTypeAny, {
|
|
586
|
-
main: Record<
|
|
586
|
+
main: Partial<Record<"EMAIL" | "BACKUP_CODE", boolean>>;
|
|
587
587
|
}, {
|
|
588
|
-
main: Record<
|
|
588
|
+
main: Partial<Record<"EMAIL" | "BACKUP_CODE", boolean>>;
|
|
589
589
|
}>;
|
|
590
590
|
}>, "strict", z.ZodTypeAny, {
|
|
591
591
|
message: string | null;
|
|
592
592
|
data: {
|
|
593
|
-
main: Record<
|
|
593
|
+
main: Partial<Record<"EMAIL" | "BACKUP_CODE", boolean>>;
|
|
594
594
|
};
|
|
595
595
|
log?: any;
|
|
596
596
|
}, {
|
|
597
597
|
message: string | null;
|
|
598
598
|
data: {
|
|
599
|
-
main: Record<
|
|
599
|
+
main: Partial<Record<"EMAIL" | "BACKUP_CODE", boolean>>;
|
|
600
600
|
};
|
|
601
601
|
log?: any;
|
|
602
602
|
}>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { APIOutputZ } from "squarecommons";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
+
const RecoveryMethodEnumZ = z.enum(["EMAIL", "BACKUP_CODE"]);
|
|
3
4
|
const UpdateUsernameV0ResponseZ = APIOutputZ.extend({
|
|
4
5
|
data: z.strictObject({
|
|
5
6
|
main: z.strictObject({
|
|
@@ -28,7 +29,7 @@ const GetUserDetailsV0ResponseZ = APIOutputZ.extend({
|
|
|
28
29
|
app_name: z.string(),
|
|
29
30
|
active_sessions: z.number(),
|
|
30
31
|
})),
|
|
31
|
-
recovery_methods: z.record(
|
|
32
|
+
recovery_methods: z.record(RecoveryMethodEnumZ, z.boolean()),
|
|
32
33
|
email_verification_details: z
|
|
33
34
|
.strictObject({ expires_at: z.string(), cooldown_reset_at: z.string() })
|
|
34
35
|
.nullable(),
|
|
@@ -76,7 +77,6 @@ const sendResetPasswordEmailV0ResponseZ = APIOutputZ.extend({
|
|
|
76
77
|
cooldown_reset_at: z.string(),
|
|
77
78
|
}),
|
|
78
79
|
});
|
|
79
|
-
const RecoveryMethodEnumZ = z.enum(["EMAIL", "BACKUP_CODE"]);
|
|
80
80
|
const updateUserRecoveryMethodsV0ResponseZ = APIOutputZ.extend({
|
|
81
81
|
data: z.strictObject({
|
|
82
82
|
main: z.array(RecoveryMethodEnumZ),
|
|
@@ -95,7 +95,7 @@ const validateEmailVerificationCodeV0ResponseZ = APIOutputZ.extend({
|
|
|
95
95
|
});
|
|
96
96
|
const GetUserRecoveryMethodsV0ResponseZ = APIOutputZ.extend({
|
|
97
97
|
data: z.strictObject({
|
|
98
|
-
main: z.record(
|
|
98
|
+
main: z.record(RecoveryMethodEnumZ, z.boolean()),
|
|
99
99
|
}),
|
|
100
100
|
});
|
|
101
101
|
export { UpdateUsernameV0ResponseZ, GetUserDetailsV0ResponseZ, DeleteUserV0ResponseZ, LogoutAllV0ResponseZ, LogoutAppsV0ResponseZ, GenerateAccountBackupCodeV0ResponseZ, updateProfileDetailsV0ResponseZ, sendResetPasswordEmailV0ResponseZ, RecoveryMethodEnumZ, updateUserRecoveryMethodsV0ResponseZ, sendVerificationEmailV0ResponseZ, validateEmailVerificationCodeV0ResponseZ, GetUserRecoveryMethodsV0ResponseZ, };
|