squarecommonblhelper 9.3.0 → 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,21 @@ 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
|
+
|
|
28
|
+
### v9.3.1
|
|
29
|
+
|
|
30
|
+
- AuthenticationCommonBL:
|
|
31
|
+
- fix type of backup_code_details in GetUserDetailsV0ResponseZ.
|
|
32
|
+
|
|
18
33
|
### v9.3.0
|
|
19
34
|
|
|
20
35
|
- AuthenticationCommonBL:
|
package/dist/authentication.d.ts
CHANGED
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;
|
|
@@ -110,15 +110,15 @@ declare const GetUserDetailsV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
110
110
|
backup_code_details: z.ZodNullable<z.ZodObject<{
|
|
111
111
|
total: z.ZodNumber;
|
|
112
112
|
available: z.ZodNumber;
|
|
113
|
-
generated_at: z.
|
|
113
|
+
generated_at: z.ZodString;
|
|
114
114
|
}, "strict", z.ZodTypeAny, {
|
|
115
115
|
total: number;
|
|
116
116
|
available: number;
|
|
117
|
-
generated_at: string
|
|
117
|
+
generated_at: string;
|
|
118
118
|
}, {
|
|
119
119
|
total: number;
|
|
120
120
|
available: number;
|
|
121
|
-
generated_at: string
|
|
121
|
+
generated_at: string;
|
|
122
122
|
}>>;
|
|
123
123
|
}, "strict", z.ZodTypeAny, {
|
|
124
124
|
user_id: string;
|
|
@@ -146,7 +146,7 @@ declare const GetUserDetailsV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
146
146
|
backup_code_details: {
|
|
147
147
|
total: number;
|
|
148
148
|
available: number;
|
|
149
|
-
generated_at: string
|
|
149
|
+
generated_at: string;
|
|
150
150
|
} | null;
|
|
151
151
|
}, {
|
|
152
152
|
user_id: string;
|
|
@@ -174,7 +174,7 @@ declare const GetUserDetailsV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
174
174
|
backup_code_details: {
|
|
175
175
|
total: number;
|
|
176
176
|
available: number;
|
|
177
|
-
generated_at: string
|
|
177
|
+
generated_at: string;
|
|
178
178
|
} | null;
|
|
179
179
|
}>;
|
|
180
180
|
}, "strict", z.ZodTypeAny, {
|
|
@@ -204,7 +204,7 @@ declare const GetUserDetailsV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
204
204
|
backup_code_details: {
|
|
205
205
|
total: number;
|
|
206
206
|
available: number;
|
|
207
|
-
generated_at: string
|
|
207
|
+
generated_at: string;
|
|
208
208
|
} | null;
|
|
209
209
|
};
|
|
210
210
|
}, {
|
|
@@ -234,7 +234,7 @@ declare const GetUserDetailsV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
234
234
|
backup_code_details: {
|
|
235
235
|
total: number;
|
|
236
236
|
available: number;
|
|
237
|
-
generated_at: string
|
|
237
|
+
generated_at: string;
|
|
238
238
|
} | null;
|
|
239
239
|
};
|
|
240
240
|
}>;
|
|
@@ -267,7 +267,7 @@ declare const GetUserDetailsV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
267
267
|
backup_code_details: {
|
|
268
268
|
total: number;
|
|
269
269
|
available: number;
|
|
270
|
-
generated_at: string
|
|
270
|
+
generated_at: string;
|
|
271
271
|
} | null;
|
|
272
272
|
};
|
|
273
273
|
};
|
|
@@ -301,7 +301,7 @@ declare const GetUserDetailsV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
301
301
|
backup_code_details: {
|
|
302
302
|
total: number;
|
|
303
303
|
available: number;
|
|
304
|
-
generated_at: string
|
|
304
|
+
generated_at: string;
|
|
305
305
|
} | null;
|
|
306
306
|
};
|
|
307
307
|
};
|
|
@@ -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, };
|
|
@@ -37,7 +37,7 @@ const GetUserDetailsV0ResponseZ = APIOutputZ.extend({
|
|
|
37
37
|
.strictObject({
|
|
38
38
|
total: z.number(),
|
|
39
39
|
available: z.number(),
|
|
40
|
-
generated_at: z.string()
|
|
40
|
+
generated_at: z.string(),
|
|
41
41
|
})
|
|
42
42
|
.nullable(),
|
|
43
43
|
}),
|
|
@@ -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, };
|