squarecommonblhelper 9.0.2 → 9.2.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
+ ### v9.2.0
19
+
20
+ - AuthenticationCommonBL:
21
+ - add getUserRecoveryMethodsV0.
22
+
23
+ ### v9.1.0
24
+
25
+ - AuthenticationCommonBL:
26
+ - add email_verification_details in GetUserDetailsV0ResponseZ.
27
+
18
28
  ### v9.0.2
19
29
 
20
30
  - AuthenticationCommonBL:
@@ -39,6 +39,10 @@ declare class AuthenticationCommonBL {
39
39
  active_sessions: number;
40
40
  }[];
41
41
  recovery_methods: Record<string, boolean>;
42
+ email_verification_details: {
43
+ expires_at: string;
44
+ cooldown_reset_at: string;
45
+ } | null;
42
46
  };
43
47
  };
44
48
  log?: any;
@@ -117,5 +121,12 @@ declare class AuthenticationCommonBL {
117
121
  } | null;
118
122
  log?: any;
119
123
  }>;
124
+ getUserRecoveryMethodsV0(username: string): Promise<{
125
+ message: string | null;
126
+ data: {
127
+ main: Record<string, boolean>;
128
+ };
129
+ log?: any;
130
+ }>;
120
131
  }
121
132
  export { AuthenticationCommonBL };
@@ -1,5 +1,5 @@
1
1
  import { fetchFileData, fetchJSONData } from "squarecommons";
2
- import { DeleteUserV0ResponseZ, GenerateAccountBackupCodeV0ResponseZ, GetUserDetailsV0ResponseZ, LogoutAllV0ResponseZ, LogoutAppsV0ResponseZ, sendResetPasswordEmailV0ResponseZ, sendVerificationEmailV0ResponseZ, updateProfileDetailsV0ResponseZ, UpdateUsernameV0ResponseZ, updateUserRecoveryMethodsV0ResponseZ, validateEmailVerificationCodeV0ResponseZ, } from "./types/AuthenticationResponses.js";
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") {
@@ -313,5 +313,26 @@ class AuthenticationCommonBL {
313
313
  throw error;
314
314
  }
315
315
  }
316
+ async getUserRecoveryMethodsV0(username) {
317
+ try {
318
+ const data = await fetchJSONData(
319
+ // base url
320
+ this.commonBLBaseURL,
321
+ // endpoint
322
+ "get_user_recovery_methods/v0",
323
+ // method
324
+ "GET",
325
+ // headers
326
+ undefined,
327
+ // body
328
+ undefined,
329
+ // query params
330
+ { username: username });
331
+ return GetUserRecoveryMethodsV0ResponseZ.parse(data);
332
+ }
333
+ catch (error) {
334
+ throw error;
335
+ }
336
+ }
316
337
  }
317
338
  export { AuthenticationCommonBL };
@@ -95,6 +95,16 @@ declare const GetUserDetailsV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
95
95
  active_sessions: number;
96
96
  }>, "many">;
97
97
  recovery_methods: z.ZodRecord<z.ZodString, z.ZodBoolean>;
98
+ email_verification_details: z.ZodNullable<z.ZodObject<{
99
+ expires_at: z.ZodString;
100
+ cooldown_reset_at: z.ZodString;
101
+ }, "strict", z.ZodTypeAny, {
102
+ expires_at: string;
103
+ cooldown_reset_at: string;
104
+ }, {
105
+ expires_at: string;
106
+ cooldown_reset_at: string;
107
+ }>>;
98
108
  }, "strict", z.ZodTypeAny, {
99
109
  user_id: string;
100
110
  username: string;
@@ -114,6 +124,10 @@ declare const GetUserDetailsV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
114
124
  active_sessions: number;
115
125
  }[];
116
126
  recovery_methods: Record<string, boolean>;
127
+ email_verification_details: {
128
+ expires_at: string;
129
+ cooldown_reset_at: string;
130
+ } | null;
117
131
  }, {
118
132
  user_id: string;
119
133
  username: string;
@@ -133,6 +147,10 @@ declare const GetUserDetailsV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
133
147
  active_sessions: number;
134
148
  }[];
135
149
  recovery_methods: Record<string, boolean>;
150
+ email_verification_details: {
151
+ expires_at: string;
152
+ cooldown_reset_at: string;
153
+ } | null;
136
154
  }>;
137
155
  }, "strict", z.ZodTypeAny, {
138
156
  main: {
@@ -154,6 +172,10 @@ declare const GetUserDetailsV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
154
172
  active_sessions: number;
155
173
  }[];
156
174
  recovery_methods: Record<string, boolean>;
175
+ email_verification_details: {
176
+ expires_at: string;
177
+ cooldown_reset_at: string;
178
+ } | null;
157
179
  };
158
180
  }, {
159
181
  main: {
@@ -175,6 +197,10 @@ declare const GetUserDetailsV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
175
197
  active_sessions: number;
176
198
  }[];
177
199
  recovery_methods: Record<string, boolean>;
200
+ email_verification_details: {
201
+ expires_at: string;
202
+ cooldown_reset_at: string;
203
+ } | null;
178
204
  };
179
205
  }>;
180
206
  }>, "strict", z.ZodTypeAny, {
@@ -199,6 +225,10 @@ declare const GetUserDetailsV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
199
225
  active_sessions: number;
200
226
  }[];
201
227
  recovery_methods: Record<string, boolean>;
228
+ email_verification_details: {
229
+ expires_at: string;
230
+ cooldown_reset_at: string;
231
+ } | null;
202
232
  };
203
233
  };
204
234
  log?: any;
@@ -224,6 +254,10 @@ declare const GetUserDetailsV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
224
254
  active_sessions: number;
225
255
  }[];
226
256
  recovery_methods: Record<string, boolean>;
257
+ email_verification_details: {
258
+ expires_at: string;
259
+ cooldown_reset_at: string;
260
+ } | null;
227
261
  };
228
262
  };
229
263
  log?: any;
@@ -541,4 +575,30 @@ declare const validateEmailVerificationCodeV0ResponseZ: z.ZodObject<z.objectUtil
541
575
  log?: any;
542
576
  }>;
543
577
  type validateEmailVerificationCodeV0Response = z.infer<typeof validateEmailVerificationCodeV0ResponseZ>;
544
- 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, };
578
+ declare const GetUserRecoveryMethodsV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
579
+ data: z.ZodAny;
580
+ message: z.ZodNullable<z.ZodString>;
581
+ log: z.ZodAny;
582
+ }, {
583
+ data: z.ZodObject<{
584
+ main: z.ZodRecord<z.ZodString, z.ZodBoolean>;
585
+ }, "strict", z.ZodTypeAny, {
586
+ main: Record<string, boolean>;
587
+ }, {
588
+ main: Record<string, boolean>;
589
+ }>;
590
+ }>, "strict", z.ZodTypeAny, {
591
+ message: string | null;
592
+ data: {
593
+ main: Record<string, boolean>;
594
+ };
595
+ log?: any;
596
+ }, {
597
+ message: string | null;
598
+ data: {
599
+ main: Record<string, boolean>;
600
+ };
601
+ log?: any;
602
+ }>;
603
+ type GetUserRecoveryMethodsV0Response = z.infer<typeof GetUserRecoveryMethodsV0ResponseZ>;
604
+ 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, };
@@ -29,6 +29,9 @@ const GetUserDetailsV0ResponseZ = APIOutputZ.extend({
29
29
  active_sessions: z.number(),
30
30
  })),
31
31
  recovery_methods: z.record(z.string(), z.boolean()),
32
+ email_verification_details: z
33
+ .strictObject({ expires_at: z.string(), cooldown_reset_at: z.string() })
34
+ .nullable(),
32
35
  }),
33
36
  }),
34
37
  });
@@ -90,4 +93,9 @@ const validateEmailVerificationCodeV0ResponseZ = APIOutputZ.extend({
90
93
  user_profile_email_verified: z.string(),
91
94
  })),
92
95
  });
93
- export { UpdateUsernameV0ResponseZ, GetUserDetailsV0ResponseZ, DeleteUserV0ResponseZ, LogoutAllV0ResponseZ, LogoutAppsV0ResponseZ, GenerateAccountBackupCodeV0ResponseZ, updateProfileDetailsV0ResponseZ, sendResetPasswordEmailV0ResponseZ, RecoveryMethodEnumZ, updateUserRecoveryMethodsV0ResponseZ, sendVerificationEmailV0ResponseZ, validateEmailVerificationCodeV0ResponseZ, };
96
+ const GetUserRecoveryMethodsV0ResponseZ = APIOutputZ.extend({
97
+ data: z.strictObject({
98
+ main: z.record(z.string(), z.boolean()),
99
+ }),
100
+ });
101
+ export { UpdateUsernameV0ResponseZ, GetUserDetailsV0ResponseZ, DeleteUserV0ResponseZ, LogoutAllV0ResponseZ, LogoutAppsV0ResponseZ, GenerateAccountBackupCodeV0ResponseZ, updateProfileDetailsV0ResponseZ, sendResetPasswordEmailV0ResponseZ, RecoveryMethodEnumZ, updateUserRecoveryMethodsV0ResponseZ, sendVerificationEmailV0ResponseZ, validateEmailVerificationCodeV0ResponseZ, GetUserRecoveryMethodsV0ResponseZ, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "squarecommonblhelper",
3
- "version": "9.0.2",
3
+ "version": "9.2.0",
4
4
  "description": "helper for common bl for my projects.",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",