@mudrichenkoevgeny/shared-foundation 0.0.46

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.
Files changed (4) hide show
  1. package/index.d.ts +823 -0
  2. package/index.js +865 -0
  3. package/index.mjs +865 -0
  4. package/package.json +18 -0
package/index.d.ts ADDED
@@ -0,0 +1,823 @@
1
+ import { z } from 'zod';
2
+
3
+ export type PermissionCode = string & { readonly __brand: 'PermissionCode' };
4
+ export function toPermissionCodeOrNull(value: string | null | undefined): PermissionCode | null;
5
+ export function toPermissionCodeOrThrow(value: string): PermissionCode;
6
+ export const permissionCodeSchema: z.ZodType<PermissionCode>;
7
+
8
+ export type UserId = string & { readonly __brand: 'UserId' };
9
+ export function toUserIdOrNull(value: string | null | undefined): UserId | null;
10
+ export function toUserIdOrThrow(value: string): UserId;
11
+ export const userIdSchema: z.ZodType<UserId>;
12
+
13
+ export type UserIdentifierId = string & { readonly __brand: 'UserIdentifierId' };
14
+ export function toUserIdentifierIdOrNull(value: string | null | undefined): UserIdentifierId | null;
15
+ export function toUserIdentifierIdOrThrow(value: string): UserIdentifierId;
16
+ export const userIdentifierIdSchema: z.ZodType<UserIdentifierId>;
17
+
18
+ export type UserSessionId = string & { readonly __brand: 'UserSessionId' };
19
+ export function toUserSessionIdOrNull(value: string | null | undefined): UserSessionId | null;
20
+ export function toUserSessionIdOrThrow(value: string): UserSessionId;
21
+ export const userSessionIdSchema: z.ZodType<UserSessionId>;
22
+
23
+ export type AuditEventId = string & { readonly __brand: 'AuditEventId' };
24
+ export function toAuditEventIdOrNull(value: string | null | undefined): AuditEventId | null;
25
+ export function toAuditEventIdOrThrow(value: string): AuditEventId;
26
+ export const auditEventIdSchema: z.ZodType<AuditEventId>;
27
+
28
+ export type ClientDeviceId = string & { readonly __brand: 'ClientDeviceId' };
29
+ export function toClientDeviceIdOrNull(value: string | null | undefined): ClientDeviceId | null;
30
+ export function toClientDeviceIdOrThrow(value: string): ClientDeviceId;
31
+ export const clientDeviceIdSchema: z.ZodType<ClientDeviceId>;
32
+
33
+ export declare const ManagementRoutes: {
34
+ readonly BASE_MANAGEMENT_ROUTE: "/management";
35
+ };
36
+
37
+ export declare const ManagementAuditRoutes: {
38
+ readonly BASE_MANAGEMENT_AUDIT_EVENTS_ROUTE: "/management/audit/events";
39
+ readonly GET_AUDIT_EVENTS: "/management/audit/events";
40
+ readonly GET_AUDIT_EVENT: "/management/audit/events/{event_id}";
41
+ };
42
+
43
+ export declare const ManagementSecuritySettingsRoutes: {
44
+ readonly BASE_MANAGEMENT_SECURITY_SETTINGS_ROUTE: "/management/security/settings";
45
+ readonly GET_MANAGEMENT_SECURITY_SETTINGS: "/management/security/settings";
46
+ readonly UPDATE_MANAGEMENT_SECURITY_SETTINGS: "/management/security/settings";
47
+ readonly RESET_MANAGEMENT_SECURITY_SETTINGS: "/management/security/settings/reset";
48
+ };
49
+
50
+ export declare const OpenSecuritySettingsRoutes: {
51
+ readonly GET_OPEN_SECURITY_SETTINGS: "/security/settings";
52
+ };
53
+
54
+ export declare const ManagementGlobalSettingsRoutes: {
55
+ readonly BASE_MANAGEMENT_GLOBAL_SETTINGS_ROUTE: "/management/global-settings";
56
+ readonly GET_MANAGEMENT_GLOBAL_SETTINGS: "/management/global-settings";
57
+ readonly UPDATE_MANAGEMENT_GLOBAL_SETTINGS: "/management/global-settings";
58
+ readonly RESET_MANAGEMENT_GLOBAL_SETTINGS: "/management/global-settings/reset";
59
+ };
60
+
61
+ export declare const OpenGlobalSettingsRoutes: {
62
+ readonly GET_OPEN_GLOBAL_SETTINGS: "/global-settings";
63
+ };
64
+
65
+ export declare const OpenLoginRoutes: {
66
+ readonly BASE_LOGIN_ROUTE: "/auth/login";
67
+ readonly BASE_LOGIN_PHONE_ROUTE: "/auth/login/phone";
68
+ readonly LOGIN_BY_EMAIL: "/auth/login/email";
69
+ readonly LOGIN_BY_PHONE: "/auth/login/phone";
70
+ readonly LOGIN_BY_EXTERNAL_AUTH_PROVIDER: "/auth/login/external-auth-provider";
71
+ readonly LOGIN_BY_TOTP: "/auth/login/totp";
72
+ readonly LOGIN_BY_TOTP_RECOVERY_CODE: "/auth/login/totp-recovery-code";
73
+ readonly SEND_LOGIN_CONFIRMATION_TO_PHONE: "/auth/login/phone/confirmation/send-to-phone";
74
+ };
75
+
76
+ export declare const SelfManagementLoginRoutes: {
77
+ readonly BASE_MANAGEMENT_LOGIN_ROUTE: "/management/auth/login";
78
+ readonly LOGIN_BY_EMAIL: "/management/auth/login/email";
79
+ readonly LOGIN_BY_TOTP: "/management/auth/login/totp";
80
+ readonly LOGIN_BY_TOTP_RECOVERY_CODE: "/management/auth/login/totp-recovery-code";
81
+ };
82
+
83
+ export declare const OpenRegisterRoutes: {
84
+ readonly REGISTER_BY_EMAIL_ROUTE: "/auth/register/email";
85
+ readonly REGISTER_BY_EMAIL: "/auth/register/email";
86
+ readonly SEND_REGISTER_CONFIRMATION_TO_EMAIL: "/auth/register/email/confirmation/send-to-email";
87
+ };
88
+
89
+ export declare const OpenResetPasswordRoutes: {
90
+ readonly BASE_RESET_PASSWORD_ROUTE: "/auth/reset-password";
91
+ readonly RESET_EMAIL_PASSWORD: "/auth/reset-password";
92
+ readonly SEND_RESET_EMAIL_PASSWORD_CONFIRMATION: "/auth/reset-password/send-confirmation";
93
+ };
94
+
95
+ export declare const SelfManagementResetPasswordRoutes: {
96
+ readonly BASE_MANAGEMENT_RESET_PASSWORD_ROUTE: "/management/auth/reset-password";
97
+ readonly RESET_PASSWORD: "/management/auth/reset-password";
98
+ readonly SEND_RESET_PASSWORD_CONFIRMATION: "/management/auth/reset-password/send-confirmation";
99
+ };
100
+
101
+ export declare const OpenUnlockRoutes: {
102
+ readonly BASE_OPEN_UNLOCK_ROUTE: "/auth/unlock";
103
+ readonly UNLOCK_BY_EMAIL_ROUTE: "/auth/unlock/email";
104
+ readonly UNLOCK_BY_PHONE_ROUTE: "/auth/unlock/phone";
105
+ readonly SEND_UNLOCK_EMAIL_CONFIRMATION: "/auth/unlock/email/send-confirmation";
106
+ readonly UNLOCK_BY_EMAIL: "/auth/unlock/email";
107
+ readonly SEND_UNLOCK_PHONE_CONFIRMATION: "/auth/unlock/phone/send-confirmation";
108
+ readonly UNLOCK_BY_PHONE: "/auth/unlock/phone";
109
+ readonly UNLOCK_BY_EXTERNAL_PROVIDER: "/auth/unlock/external-provider";
110
+ };
111
+
112
+ export declare const SelfManagementUnlockRoutes: {
113
+ readonly BASE_SELF_MANAGEMENT_UNLOCK_ROUTE: "/management/auth/unlock";
114
+ readonly UNLOCK_BY_EMAIL_ROUTE: "/management/auth/unlock/email";
115
+ readonly UNLOCK_BY_PHONE_ROUTE: "/management/auth/unlock/phone";
116
+ readonly SEND_UNLOCK_EMAIL_CONFIRMATION: "/management/auth/unlock/email/send-confirmation";
117
+ readonly UNLOCK_BY_EMAIL: "/management/auth/unlock/email";
118
+ readonly SEND_UNLOCK_PHONE_CONFIRMATION: "/management/auth/unlock/phone/send-confirmation";
119
+ readonly UNLOCK_BY_PHONE: "/management/auth/unlock/phone";
120
+ readonly UNLOCK_BY_EXTERNAL_PROVIDER: "/management/auth/unlock/external-provider";
121
+ };
122
+
123
+ export declare const OpenUserSecurityRoutes: {
124
+ readonly BASE_TOTP_ROUTE: "/user/security/totp";
125
+ readonly BASE_RECOVERY_CODES_ROUTE: "/user/security/totp/recovery-codes";
126
+ readonly SETUP_TOTP: "/user/security/totp/setup";
127
+ readonly ENABLE_TOTP: "/user/security/totp/enable";
128
+ readonly DISABLE_TOTP: "/user/security/totp/disable";
129
+ readonly GET_RECOVERY_CODES: "/user/security/totp/recovery-codes";
130
+ readonly REGENERATE_RECOVERY_CODES: "/user/security/totp/recovery-codes/regenerate";
131
+ };
132
+
133
+ export declare const SelfManagementUserSecurityRoutes: {
134
+ readonly BASE_SELF_TOTP_ROUTE: "/management/self/user/security/totp";
135
+ readonly BASE_SELF_RECOVERY_CODES_ROUTE: "/management/self/user/security/totp/recovery-codes";
136
+ readonly SETUP_TOTP: "/management/self/user/security/totp/setup";
137
+ readonly ENABLE_TOTP: "/management/self/user/security/totp/enable";
138
+ readonly DISABLE_TOTP: "/management/self/user/security/totp/disable";
139
+ readonly GET_RECOVERY_CODES: "/management/self/user/security/totp/recovery-codes";
140
+ readonly REGENERATE_RECOVERY_CODES: "/management/self/user/security/totp/recovery-codes/regenerate";
141
+ };
142
+
143
+ export declare const ManagementUserSecurityRoutes: {
144
+ readonly DISABLE_TOTP: "/management/users/{user_id}/security/totp/disable";
145
+ };
146
+
147
+ export declare const OpenIdentifierRoutes: {
148
+ readonly BASE_IDENTIFIER_ROUTE: "/identifier";
149
+ readonly ADD_EMAIL_IDENTIFIER_ROUTE: "/identifier/email";
150
+ readonly BASE_IDENTIFIER_CONFIRMATION_ROUTE: "/identifier/confirmation";
151
+ readonly GET_IDENTIFIER: "/identifier/{user_identifier_id}";
152
+ readonly GET_IDENTIFIERS: "/identifier";
153
+ readonly DELETE_IDENTIFIER: "/identifier/{user_identifier_id}";
154
+ readonly ADD_IDENTIFIER_EMAIL: "/identifier/email";
155
+ readonly ADD_IDENTIFIER_PHONE: "/identifier/phone";
156
+ readonly ADD_IDENTIFIER_EXTERNAL_AUTH_PROVIDER: "/identifier/external-auth-provider";
157
+ readonly SEND_ADD_EMAIL_IDENTIFIER_CONFIRMATION: "/identifier/confirmation/send-to-email";
158
+ readonly SEND_ADD_PHONE_IDENTIFIER_CONFIRMATION: "/identifier/confirmation/send-to-phone";
159
+ readonly IDENTIFIER_EMAIL_CHANGE_PASSWORD: "/identifier/email/password";
160
+ };
161
+
162
+ export declare const SelfManagementIdentifierRoutes: {
163
+ readonly BASE_SELF_IDENTIFIER_ROUTE: "/management/self/identifier";
164
+ readonly GET_IDENTIFIER: "/management/self/identifier/{user_identifier_id}";
165
+ readonly GET_IDENTIFIERS: "/management/self/identifier";
166
+ readonly IDENTIFIER_EMAIL_CHANGE_PASSWORD: "/management/self/identifier/email/password";
167
+ };
168
+
169
+ export declare const ManagementIdentifierRoutes: {
170
+ readonly BASE_MANAGEMENT_IDENTIFIERS_ROUTE: "/management/users/identifiers";
171
+ readonly GET_IDENTIFIERS: "/management/users/identifiers";
172
+ readonly GET_IDENTIFIER: "/management/users/identifiers/{user_identifier_id}";
173
+ readonly DELETE_IDENTIFIER: "/management/users/identifiers/{user_identifier_id}";
174
+ readonly DELETE_IDENTIFIER_PASSWORD: "/management/users/identifiers/{user_identifier_id}/password";
175
+ };
176
+
177
+ export declare const OpenSessionRoutes: {
178
+ readonly BASE_SESSION_ROUTE: "/session";
179
+ readonly LOGOUT: "/session/logout";
180
+ readonly GET_SESSIONS: "/session";
181
+ readonly GET_SESSION: "/session/{session_id}";
182
+ readonly DELETE_SESSION: "/session/{session_id}";
183
+ readonly DELETE_ALL_OTHER_SESSIONS: "/session/delete-others";
184
+ readonly REAUTHENTICATE_SESSION: "/session/reauthenticate";
185
+ };
186
+
187
+ export declare const SelfManagementSessionRoutes: {
188
+ readonly BASE_SELF_SESSION_ROUTE: "/management/self/session";
189
+ readonly LOGOUT: "/management/self/session/logout";
190
+ readonly GET_SESSIONS: "/management/self/session";
191
+ readonly GET_SESSION: "/management/self/session/{session_id}";
192
+ readonly DELETE_SESSION: "/management/self/session/{session_id}";
193
+ readonly DELETE_ALL_OTHER_SESSIONS: "/management/self/session/delete-others";
194
+ readonly REAUTHENTICATE_SESSION: "/management/self/session/reauthenticate";
195
+ };
196
+
197
+ export declare const ManagementSessionRoutes: {
198
+ readonly BASE_MANAGEMENT_SESSIONS_ROUTE: "/management/users/sessions";
199
+ readonly GET_SESSIONS: "/management/users/sessions";
200
+ readonly GET_SESSION: "/management/users/sessions/{session_id}";
201
+ readonly DELETE_SESSION: "/management/users/sessions/{session_id}";
202
+ readonly DELETE_ALL_USER_SESSIONS: "/management/users/sessions/delete-all-for-user/{user_id}";
203
+ };
204
+
205
+ export declare const OpenUserRoutes: {
206
+ readonly BASE_USER_ROUTE: "/user";
207
+ readonly GET_USER: "/user";
208
+ readonly SCHEDULE_DELETION: "/user/schedule-deletion";
209
+ readonly RESTORE_USER: "/user/restore";
210
+ };
211
+
212
+ export declare const SelfManagementUserRoutes: {
213
+ readonly GET_USER: "/management/self/user";
214
+ };
215
+
216
+ export declare const ManagementUserRoutes: {
217
+ readonly CREATE_USER: "/management/users";
218
+ readonly GET_USERS: "/management/users";
219
+ readonly GET_USER: "/management/users/{user_id}";
220
+ readonly UPDATE_USER: "/management/users/{user_id}";
221
+ readonly DELETE_USER: "/management/users/{user_id}";
222
+ };
223
+
224
+ export declare const ManagementAuthSettingsRoutes: {
225
+ readonly BASE_MANAGEMENT_AUTH_SETTINGS_ROUTE: "/management/auth/settings";
226
+ readonly GET_MANAGEMENT_AUTH_SETTINGS: "/management/auth/settings";
227
+ readonly UPDATE_MANAGEMENT_AUTH_SETTINGS: "/management/auth/settings";
228
+ readonly RESET_MANAGEMENT_AUTH_SETTINGS: "/management/auth/settings/reset";
229
+ };
230
+
231
+ export declare const CommonErrorCodes: {
232
+ readonly UNKNOWN: "UNKNOWN";
233
+ readonly INTERNAL: "INTERNAL";
234
+ readonly NOT_FOUND: "NOT_FOUND";
235
+ readonly SERVICE_UNAVAILABLE: "SERVICE_UNAVAILABLE";
236
+ readonly TOO_MANY_REQUESTS: "TOO_MANY_REQUESTS";
237
+ readonly MISSING_REQUIRED_PARAMETER: "MISSING_REQUIRED_PARAMETER";
238
+ readonly INVALID_PARAMETER_VALUE: "INVALID_PARAMETER_VALUE";
239
+ readonly MISSING_REQUIRED_FIELD: "MISSING_REQUIRED_FIELD";
240
+ readonly BLANK_STRING_FIELD: "BLANK_STRING_FIELD";
241
+ readonly EMPTY_COLLECTION_FIELD: "EMPTY_COLLECTION_FIELD";
242
+ readonly INVALID_FIELD_VALUE: "INVALID_FIELD_VALUE";
243
+ readonly BAD_REQUEST: "BAD_REQUEST";
244
+ readonly INVALID_JSON_BODY: "INVALID_JSON_BODY";
245
+ };
246
+
247
+ export declare const CommonErrorArgs: {
248
+ readonly MESSAGE: "message";
249
+ readonly PARAMETER_NAME: "parameterName";
250
+ readonly FIELD_NAME: "fieldName";
251
+ readonly RETRY_AFTER_SECONDS: "retryAfterSeconds";
252
+ readonly RATE_LIMIT_ACTION_CODE: "rateLimitActionCode";
253
+ readonly LIMIT: "limit";
254
+ readonly IDENTIFIER: "identifier";
255
+ readonly RESOURCE: "resource";
256
+ };
257
+
258
+ export declare const SecurityErrorCodes: {
259
+ readonly PASSWORD_TOO_WEAK: "PASSWORD_TOO_WEAK";
260
+ readonly OTP_RETRY_TOO_SOON: "OTP_RETRY_TOO_SOON";
261
+ readonly TOTP_ALREADY_ENABLED: "TOTP_ALREADY_ENABLED";
262
+ readonly TOTP_NOT_ENABLED: "TOTP_NOT_ENABLED";
263
+ readonly MFA_CONFIRMATION_REQUIRED: "MFA_CONFIRMATION_REQUIRED";
264
+ readonly MFA_TOKEN_EXPIRED: "MFA_TOKEN_EXPIRED";
265
+ readonly RECOVERY_CODE_ALREADY_USED: "RECOVERY_CODE_ALREADY_USED";
266
+ readonly INVALID_TOTP_CODE: "INVALID_TOTP_CODE";
267
+ readonly INVALID_MFA_TOKEN: "INVALID_MFA_TOKEN";
268
+ readonly IP_NOT_ALLOWED: "IP_NOT_ALLOWED";
269
+ };
270
+
271
+ export declare const SecurityErrorArgs: {
272
+ readonly PASSWORD_MIN_LENGTH: "passwordMinLength";
273
+ readonly PASSWORD_FAIL_TOO_SHORT: "passwordTooShort";
274
+ readonly PASSWORD_FAIL_NO_LETTER: "passwordNoLetter";
275
+ readonly PASSWORD_FAIL_NO_UPPERCASE: "passwordNoUpperCase";
276
+ readonly PASSWORD_FAIL_NO_LOWERCASE: "passwordNoLowerCase";
277
+ readonly PASSWORD_FAIL_NO_DIGIT: "passwordNoDigit";
278
+ readonly PASSWORD_FAIL_NO_SPECIAL_CHAR: "passwordNoSpecialChar";
279
+ readonly PASSWORD_FAIL_TOO_COMMON: "passwordTooCommon";
280
+ readonly MFA_TOKEN: "mfaToken";
281
+ };
282
+
283
+ export declare const UserErrorCodes: {
284
+ readonly INVALID_ACCESS_TOKEN: "INVALID_ACCESS_TOKEN";
285
+ readonly ACCESS_TOKEN_EXPIRED: "ACCESS_TOKEN_EXPIRED";
286
+ readonly INVALID_REFRESH_TOKEN: "INVALID_REFRESH_TOKEN";
287
+ readonly INVALID_SESSION: "INVALID_SESSION";
288
+ readonly USER_ROLE_NOT_ALLOWED: "USER_ROLE_NOT_ALLOWED";
289
+ readonly USER_MISSING_PERMISSIONS: "USER_MISSING_PERMISSIONS";
290
+ readonly USER_INSUFFICIENT_AUTHORITY_LEVEL: "USER_INSUFFICIENT_AUTHORITY_LEVEL";
291
+ readonly USER_ILLEGAL_ACCOUNT_STATUS: "USER_ILLEGAL_ACCOUNT_STATUS";
292
+ readonly USER_BANNED: "USER_BANNED";
293
+ readonly USER_LOCKED: "USER_LOCKED";
294
+ readonly USER_READ_ONLY: "USER_READ_ONLY";
295
+ readonly USER_SECURITY_HOLD: "USER_SECURITY_HOLD";
296
+ readonly USER_PENDING_DELETION: "USER_PENDING_DELETION";
297
+ readonly USER_FORBIDDEN: "USER_FORBIDDEN";
298
+ readonly USER_NOT_FOUND: "USER_NOT_FOUND";
299
+ readonly INVALID_CREDENTIALS: "INVALID_CREDENTIALS";
300
+ readonly CAN_NOT_DELETE_USER_IDENTIFIER: "CAN_NOT_DELETE_USER_IDENTIFIER";
301
+ readonly CAN_NOT_CREATE_USER_IDENTIFIER: "CAN_NOT_CREATE_USER_IDENTIFIER";
302
+ readonly USER_IDENTIFIER_LIMIT_REACHED: "USER_IDENTIFIER_LIMIT_REACHED";
303
+ readonly TOTAL_USER_IDENTIFIERS_LIMIT_REACHED: "TOTAL_USER_IDENTIFIERS_LIMIT_REACHED";
304
+ readonly WRONG_PASSWORD: "WRONG_PASSWORD";
305
+ readonly WRONG_CONFIRMATION_CODE: "WRONG_CONFIRMATION_CODE";
306
+ readonly EXTERNAL_IDENTIFIER_LINKAGE_FAILED: "EXTERNAL_IDENTIFIER_LINKAGE_FAILED";
307
+ readonly REGISTRATION_DISABLED: "REGISTRATION_DISABLED";
308
+ readonly SELF_SERVICE_UNLOCK_DISABLED: "SELF_SERVICE_UNLOCK_DISABLED";
309
+ readonly EMAIL_NOT_ALLOWED: "EMAIL_NOT_ALLOWED";
310
+ readonly PASSWORD_SETUP_REQUIRED: "PASSWORD_SETUP_REQUIRED";
311
+ readonly USER_IDENTIFIER_PASSWORD_NOT_SUPPORTED: "USER_IDENTIFIER_PASSWORD_NOT_SUPPORTED";
312
+ readonly USER_IDENTIFIER_PASSWORD_NOT_SET: "USER_IDENTIFIER_PASSWORD_NOT_SET";
313
+ };
314
+
315
+ export declare const UserErrorArgs: {
316
+ readonly USER_ID: "userId";
317
+ readonly MAX_NUMBER_OF_IDENTIFIERS: "maxNumberOfIdentifiers";
318
+ readonly USER_AUTH_PROVIDER: "userAuthProvider";
319
+ readonly ACCOUNT_LOCKOUT_TYPE: "accountLockoutType";
320
+ readonly TEMPORARY_LOCKOUT_UNTIL: "temporaryLockoutUntil";
321
+ };
322
+
323
+ export declare const AuditPermissionCode: {
324
+
325
+ };
326
+
327
+ export declare const SecurityPermissionCode: {
328
+
329
+ };
330
+
331
+ export declare const SettingsPermissionCode: {
332
+
333
+ };
334
+
335
+ export declare const AuthSettingsPermissionCode: {
336
+
337
+ };
338
+
339
+ export declare const IdentifierPermissionCode: {
340
+
341
+ };
342
+
343
+ export declare const SessionPermissionCode: {
344
+
345
+ };
346
+
347
+ export declare const UserPermissionCode: {
348
+
349
+ };
350
+
351
+ export const clientTypeSchema: z.ZodType<string>;
352
+ export type ClientType = z.infer<typeof clientTypeSchema>;
353
+
354
+ export const sortOrderSchema: z.ZodType<string>;
355
+ export type SortOrder = z.infer<typeof sortOrderSchema>;
356
+
357
+ export const accountLockoutTypeSchema: z.ZodType<string>;
358
+ export type AccountLockoutType = z.infer<typeof accountLockoutTypeSchema>;
359
+
360
+ export const passwordPolicyFailReasonSchema: z.ZodType<string>;
361
+ export type PasswordPolicyFailReason = z.infer<typeof passwordPolicyFailReasonSchema>;
362
+
363
+ export const auditActorTypeSchema: z.ZodType<string>;
364
+ export type AuditActorType = z.infer<typeof auditActorTypeSchema>;
365
+
366
+ export const auditValueSensitivitySchema: z.ZodType<string>;
367
+ export type AuditValueSensitivity = z.infer<typeof auditValueSensitivitySchema>;
368
+
369
+ export const auditStatusSchema: z.ZodType<string>;
370
+ export type AuditStatus = z.infer<typeof auditStatusSchema>;
371
+
372
+ export const commonAuditResourceTypeSchema: z.ZodType<string>;
373
+ export type CommonAuditResourceType = z.infer<typeof commonAuditResourceTypeSchema>;
374
+
375
+ export const securityAuditResourceTypeSchema: z.ZodType<string>;
376
+ export type SecurityAuditResourceType = z.infer<typeof securityAuditResourceTypeSchema>;
377
+
378
+ export const settingsAuditResourceTypeSchema: z.ZodType<string>;
379
+ export type SettingsAuditResourceType = z.infer<typeof settingsAuditResourceTypeSchema>;
380
+
381
+ export const userAuditResourceTypeSchema: z.ZodType<string>;
382
+ export type UserAuditResourceType = z.infer<typeof userAuditResourceTypeSchema>;
383
+
384
+ export const securityAuditActionTypeSchema: z.ZodType<string>;
385
+ export type SecurityAuditActionType = z.infer<typeof securityAuditActionTypeSchema>;
386
+
387
+ export const settingsAuditActionTypeSchema: z.ZodType<string>;
388
+ export type SettingsAuditActionType = z.infer<typeof settingsAuditActionTypeSchema>;
389
+
390
+ export const userAuditActionTypeSchema: z.ZodType<string>;
391
+ export type UserAuditActionType = z.infer<typeof userAuditActionTypeSchema>;
392
+
393
+ export const userAccountStatusSchema: z.ZodType<string>;
394
+ export type UserAccountStatus = z.infer<typeof userAccountStatusSchema>;
395
+
396
+ export const userRoleSchema: z.ZodType<string>;
397
+ export type UserRole = z.infer<typeof userRoleSchema>;
398
+
399
+ export const userAuthProviderSchema: z.ZodType<string>;
400
+ export type UserAuthProvider = z.infer<typeof userAuthProviderSchema>;
401
+
402
+ export const externalAuthProviderSchema: z.ZodType<string>;
403
+ export type ExternalAuthProvider = z.infer<typeof externalAuthProviderSchema>;
404
+
405
+ export function pagedResultSchema<T extends z.ZodTypeAny>(itemSchema: T): z.ZodObject<{
406
+ items: z.ZodArray<T>;
407
+ totalCount: z.ZodNumber;
408
+ pageNumber: z.ZodNumber;
409
+ pageSize: z.ZodNumber;
410
+ totalPages: z.ZodNumber;
411
+ }>;
412
+
413
+ export interface PagedResult<T> {
414
+ items: T[];
415
+ totalCount: number;
416
+ pageNumber: number;
417
+ pageSize: number;
418
+ totalPages: number;
419
+ }
420
+
421
+ export interface ApiErrorResponse {
422
+ id: UserId;
423
+ code: string;
424
+ message: string;
425
+ args: Record<string, string>;
426
+ }
427
+ export const apiErrorResponseSchema: z.ZodType<ApiErrorResponse>;
428
+
429
+ export interface ClientInfoPayload {
430
+ client_device_info: ClientDeviceInfoPayload;
431
+ user_agent: string | null;
432
+ ip_address: string | null;
433
+ api_version: string | null;
434
+ }
435
+ export const clientInfoPayloadSchema: z.ZodType<ClientInfoPayload>;
436
+
437
+ export interface ClientDeviceInfoPayload {
438
+ client_type: ClientType | null;
439
+ language: string | null;
440
+ device_id: ClientDeviceId | null;
441
+ device_name: string | null;
442
+ app_version: string | null;
443
+ operation_system_version: string | null;
444
+ }
445
+ export const clientDeviceInfoPayloadSchema: z.ZodType<ClientDeviceInfoPayload>;
446
+
447
+ export interface AccountLockoutPolicyPayload {
448
+ max_failed_password_attempts: number;
449
+ max_failed_otp_attempts: number;
450
+ max_failed_totp_attempts: number;
451
+ failed_attempts_window_seconds: number;
452
+ lockout_duration_seconds: number;
453
+ indefinite_lockout_threshold: number;
454
+ is_self_service_unlock_enabled: boolean;
455
+ }
456
+ export const accountLockoutPolicyPayloadSchema: z.ZodType<AccountLockoutPolicyPayload>;
457
+
458
+ export interface IpRestrictionPolicyPayload {
459
+ is_blacklist_enabled: boolean;
460
+ blacklist: string[];
461
+ is_whitelist_enabled: boolean;
462
+ whitelist: string[];
463
+ }
464
+ export const ipRestrictionPolicyPayloadSchema: z.ZodType<IpRestrictionPolicyPayload>;
465
+
466
+ export interface OtpConfirmationPayload {
467
+ retry_after_seconds: number;
468
+ number_of_symbols: number;
469
+ expiration_seconds: number;
470
+ }
471
+ export const otpConfirmationPayloadSchema: z.ZodType<OtpConfirmationPayload>;
472
+
473
+ export interface ManagementPasswordPolicyPayload {
474
+ min_length: number;
475
+ require_letter: boolean;
476
+ require_upper_case: boolean;
477
+ require_lower_case: boolean;
478
+ require_digit: boolean;
479
+ require_special_char: boolean;
480
+ common_passwords: string[];
481
+ }
482
+ export const managementPasswordPolicyPayloadSchema: z.ZodType<ManagementPasswordPolicyPayload>;
483
+
484
+ export interface OpenPasswordPolicyPayload {
485
+ min_length: number;
486
+ require_letter: boolean;
487
+ require_upper_case: boolean;
488
+ require_lower_case: boolean;
489
+ require_digit: boolean;
490
+ require_special_char: boolean;
491
+ }
492
+ export const openPasswordPolicyPayloadSchema: z.ZodType<OpenPasswordPolicyPayload>;
493
+
494
+ export interface ManagementSecuritySettingsPayload {
495
+ recent_authentication_validity_seconds_for_open_user: number;
496
+ recent_authentication_validity_seconds_for_management_user: number;
497
+ management_password_policy: ManagementPasswordPolicyPayload;
498
+ otp_confirmation: OtpConfirmationPayload;
499
+ account_lockout_policy: AccountLockoutPolicyPayload;
500
+ account_lockout_check_interval_seconds: number;
501
+ open_ip_restriction_policy: IpRestrictionPolicyPayload;
502
+ management_ip_restriction_policy: IpRestrictionPolicyPayload;
503
+ expiration_seconds: number;
504
+ max_requests_per_period: number;
505
+ rate_limit_period_seconds: number;
506
+ refresh_token_rotation_grace_period_seconds: number;
507
+ }
508
+ export const managementSecuritySettingsPayloadSchema: z.ZodType<ManagementSecuritySettingsPayload>;
509
+
510
+ export interface OpenSecuritySettingsPayload {
511
+ open_password_policy: OpenPasswordPolicyPayload;
512
+ otp_confirmation: OtpConfirmationPayload;
513
+ }
514
+ export const openSecuritySettingsPayloadSchema: z.ZodType<OpenSecuritySettingsPayload>;
515
+
516
+ export interface TotpRecoveryCodesPayload {
517
+ totp_recovery_codes: string[];
518
+ }
519
+ export const totpRecoveryCodesPayloadSchema: z.ZodType<TotpRecoveryCodesPayload>;
520
+
521
+ export interface TotpSetupPayload {
522
+ totp_secret_key: string;
523
+ totp_otp_auth_url: string;
524
+ mfa_token: string;
525
+ }
526
+ export const totpSetupPayloadSchema: z.ZodType<TotpSetupPayload>;
527
+
528
+ export interface VerifyTotpPayload {
529
+ mfa_token: string;
530
+ totp_code: string;
531
+ }
532
+ export const verifyTotpPayloadSchema: z.ZodType<VerifyTotpPayload>;
533
+
534
+ export interface ManagementGlobalSettingsPayload {
535
+ privacy_policy_url: string | null;
536
+ terms_of_service_url: string | null;
537
+ contact_support_email: string | null;
538
+ min_supported_app_versions: Record<string, string>;
539
+ is_tracing_enabled: boolean;
540
+ is_metrics_enabled: boolean;
541
+ is_verbose_logging_enabled: boolean;
542
+ }
543
+ export const managementGlobalSettingsPayloadSchema: z.ZodType<ManagementGlobalSettingsPayload>;
544
+
545
+ export interface OpenGlobalSettingsPayload {
546
+ privacy_policy_url: string | null;
547
+ terms_of_service_url: string | null;
548
+ contact_support_email: string | null;
549
+ min_supported_app_versions: Record<string, string>;
550
+ }
551
+ export const openGlobalSettingsPayloadSchema: z.ZodType<OpenGlobalSettingsPayload>;
552
+
553
+ export interface AuditEventPayload {
554
+ id: AuditEventId;
555
+ actor_id: UserId | null;
556
+ actor_type: AuditActorType;
557
+ actor_user_role: UserRole | null;
558
+ action: string;
559
+ resource: string;
560
+ resource_id: string | null;
561
+ status: AuditStatus;
562
+ metadata: AuditEventMetadataPayload[];
563
+ message: string | null;
564
+ created_at: number;
565
+ }
566
+ export const auditEventPayloadSchema: z.ZodType<AuditEventPayload>;
567
+
568
+ export interface AuditEventMetadataPayload {
569
+ key: string;
570
+ value: string;
571
+ value_sensitivity: string;
572
+ }
573
+ export const auditEventMetadataPayloadSchema: z.ZodType<AuditEventMetadataPayload>;
574
+
575
+ export interface AuthDataPayload {
576
+ user: UserDetailsPayload;
577
+ session_token: SessionTokenPayload;
578
+ }
579
+ export const authDataPayloadSchema: z.ZodType<AuthDataPayload>;
580
+
581
+ export interface AvailableAuthProvidersPayload {
582
+ primary: string[];
583
+ secondary: string[];
584
+ }
585
+ export const availableAuthProvidersPayloadSchema: z.ZodType<AvailableAuthProvidersPayload>;
586
+
587
+ export interface ManagementAuthSettingsPayload {
588
+ available_auth_providers: AvailableAuthProvidersPayload;
589
+ max_total_identifiers: number;
590
+ max_email_identifiers: number;
591
+ max_phone_identifiers: number;
592
+ max_identifiers_per_external_provider: number;
593
+ max_active_sessions_for_open_user: number;
594
+ max_active_sessions_for_management_user: number;
595
+ access_token_validity_seconds: number;
596
+ refresh_token_validity_seconds: number;
597
+ account_deletion_grace_period_seconds: number;
598
+ account_deletion_check_interval_seconds: number;
599
+ is_registration_enabled: boolean;
600
+ open_email_restriction_policy: EmailRestrictionPolicyPayload;
601
+ management_email_restriction_policy: EmailRestrictionPolicyPayload;
602
+ }
603
+ export const managementAuthSettingsPayloadSchema: z.ZodType<ManagementAuthSettingsPayload>;
604
+
605
+ export interface OpenAuthSettingsPayload {
606
+ available_auth_providers: AvailableAuthProvidersPayload;
607
+ max_total_identifiers: number;
608
+ max_email_identifiers: number;
609
+ max_phone_identifiers: number;
610
+ max_identifiers_per_external_provider: number;
611
+ is_registration_enabled: boolean;
612
+ }
613
+ export const openAuthSettingsPayloadSchema: z.ZodType<OpenAuthSettingsPayload>;
614
+
615
+ export interface ManagementUserConfigurationPayload {
616
+ management_global_settings: ManagementGlobalSettingsPayload;
617
+ management_security_settings: ManagementSecuritySettingsPayload;
618
+ management_auth_settings: ManagementAuthSettingsPayload;
619
+ }
620
+ export const managementUserConfigurationPayloadSchema: z.ZodType<ManagementUserConfigurationPayload>;
621
+
622
+ export interface OpenUserConfigurationPayload {
623
+ open_global_settings: OpenGlobalSettingsPayload;
624
+ open_security_settings: OpenSecuritySettingsPayload;
625
+ open_auth_settings: OpenAuthSettingsPayload;
626
+ }
627
+ export const openUserConfigurationPayloadSchema: z.ZodType<OpenUserConfigurationPayload>;
628
+
629
+ export interface EmailRestrictionPolicyPayload {
630
+ is_blacklist_enabled: boolean;
631
+ blacklist: string[];
632
+ is_whitelist_enabled: boolean;
633
+ whitelist: string[];
634
+ }
635
+ export const emailRestrictionPolicyPayloadSchema: z.ZodType<EmailRestrictionPolicyPayload>;
636
+
637
+ export interface UserIdentifierPayload {
638
+ id: UserIdentifierId;
639
+ user_id: UserId;
640
+ user_auth_provider: UserAuthProvider;
641
+ identifier: string;
642
+ display_name: string;
643
+ external_provider_email: string | null;
644
+ is_sensitive_values_masked: boolean;
645
+ created_at: number;
646
+ updated_at: number | null;
647
+ }
648
+ export const userIdentifierPayloadSchema: z.ZodType<UserIdentifierPayload>;
649
+
650
+ export interface DeletedSessionsPayload {
651
+ deleted_session_ids: string[];
652
+ }
653
+ export const deletedSessionsPayloadSchema: z.ZodType<DeletedSessionsPayload>;
654
+
655
+ export interface UserSessionPayload {
656
+ id: UserSessionId;
657
+ user_id: UserId;
658
+ user_role: UserRole;
659
+ identifier: string;
660
+ identifier_id: UserIdentifierId;
661
+ identifier_display_name: string;
662
+ identifier_auth_provider: UserAuthProvider;
663
+ client_device_info: ClientDeviceInfoPayload;
664
+ user_agent: string | null;
665
+ ip_address: string | null;
666
+ expires_at: number;
667
+ last_accessed_at: number;
668
+ last_reauthenticated_at: number;
669
+ is_sensitive_values_masked: boolean;
670
+ created_at: number;
671
+ updated_at: number | null;
672
+ }
673
+ export const userSessionPayloadSchema: z.ZodType<UserSessionPayload>;
674
+
675
+ export interface RefreshTokenPayload {
676
+ refresh_token: string;
677
+ }
678
+ export const refreshTokenPayloadSchema: z.ZodType<RefreshTokenPayload>;
679
+
680
+ export interface SessionTokenPayload {
681
+ access_token: string;
682
+ refresh_token: string;
683
+ expires_at: number;
684
+ token_type: string;
685
+ session_id: UserSessionId;
686
+ identifier_id: UserIdentifierId;
687
+ }
688
+ export const sessionTokenPayloadSchema: z.ZodType<SessionTokenPayload>;
689
+
690
+ export interface UserDetailsPayload {
691
+ id: UserId;
692
+ role: UserRole;
693
+ account_status: UserAccountStatus;
694
+ account_status_on_restore: UserAccountStatus | null;
695
+ authority_level: number;
696
+ permission_codes: PermissionCode[];
697
+ is_totp_enabled: boolean;
698
+ last_login_at: number | null;
699
+ last_active_at: number | null;
700
+ created_at: number;
701
+ updated_at: number | null;
702
+ scheduled_permanent_deletion_at: number | null;
703
+ account_lockout_type: AccountLockoutType;
704
+ temporary_lockout_until: number | null;
705
+ }
706
+ export const userDetailsPayloadSchema: z.ZodType<UserDetailsPayload>;
707
+
708
+ export interface UserPublicPayload {
709
+ id: UserId;
710
+ role: UserRole;
711
+ account_status: UserAccountStatus;
712
+ }
713
+ export const userPublicPayloadSchema: z.ZodType<UserPublicPayload>;
714
+
715
+ export interface CreateByEmailRequest {
716
+ email: string;
717
+ password: string | null;
718
+ role: UserRole;
719
+ account_status: string;
720
+ authority_level: number;
721
+ permission_codes: PermissionCode[];
722
+ }
723
+ export const createByEmailRequestSchema: z.ZodType<CreateByEmailRequest>;
724
+
725
+ export interface LoginByEmailRequest {
726
+ email: string;
727
+ password: string;
728
+ }
729
+ export const loginByEmailRequestSchema: z.ZodType<LoginByEmailRequest>;
730
+
731
+ export interface LoginByExternalAuthProviderRequest {
732
+ auth_provider: string;
733
+ external_provider_token: string;
734
+ }
735
+ export const loginByExternalAuthProviderRequestSchema: z.ZodType<LoginByExternalAuthProviderRequest>;
736
+
737
+ export interface LoginByPhoneRequest {
738
+ phone_number: string;
739
+ confirmation_code: string;
740
+ }
741
+ export const loginByPhoneRequestSchema: z.ZodType<LoginByPhoneRequest>;
742
+
743
+ export interface ResetPasswordRequest {
744
+ email: string;
745
+ confirmation_code: string;
746
+ new_password: string;
747
+ }
748
+ export const resetPasswordRequestSchema: z.ZodType<ResetPasswordRequest>;
749
+
750
+ export interface SendResetPasswordConfirmationRequest {
751
+ email: string;
752
+ }
753
+ export const sendResetPasswordConfirmationRequestSchema: z.ZodType<SendResetPasswordConfirmationRequest>;
754
+
755
+ export interface RegisterByEmailRequest {
756
+ email: string;
757
+ password: string;
758
+ confirmation_code: string;
759
+ }
760
+ export const registerByEmailRequestSchema: z.ZodType<RegisterByEmailRequest>;
761
+
762
+ export interface UnlockByEmailConfirmationRequest {
763
+ email: string;
764
+ confirmation_code: string;
765
+ }
766
+ export const unlockByEmailConfirmationRequestSchema: z.ZodType<UnlockByEmailConfirmationRequest>;
767
+
768
+ export interface UnlockByExternalAuthProviderRequest {
769
+ auth_provider: string;
770
+ external_provider_token: string;
771
+ }
772
+ export const unlockByExternalAuthProviderRequestSchema: z.ZodType<UnlockByExternalAuthProviderRequest>;
773
+
774
+ export interface UnlockByPhoneConfirmationRequest {
775
+ phone_number: string;
776
+ confirmation_code: string;
777
+ }
778
+ export const unlockByPhoneConfirmationRequestSchema: z.ZodType<UnlockByPhoneConfirmationRequest>;
779
+
780
+ export interface SendConfirmationToEmailRequest {
781
+ email: string;
782
+ }
783
+ export const sendConfirmationToEmailRequestSchema: z.ZodType<SendConfirmationToEmailRequest>;
784
+
785
+ export interface SendConfirmationToPhoneRequest {
786
+ phone_number: string;
787
+ }
788
+ export const sendConfirmationToPhoneRequestSchema: z.ZodType<SendConfirmationToPhoneRequest>;
789
+
790
+ export interface EmailPasswordChangeRequest {
791
+ email: string;
792
+ old_password: string;
793
+ new_password: string;
794
+ }
795
+ export const emailPasswordChangeRequestSchema: z.ZodType<EmailPasswordChangeRequest>;
796
+
797
+ export interface AddUserIdentifierEmailRequest {
798
+ email: string;
799
+ password: string;
800
+ confirmation_code: string;
801
+ }
802
+ export const addUserIdentifierEmailRequestSchema: z.ZodType<AddUserIdentifierEmailRequest>;
803
+
804
+ export interface AddUserIdentifierExternalAuthProviderRequest {
805
+ auth_provider: string;
806
+ external_provider_token: string;
807
+ }
808
+ export const addUserIdentifierExternalAuthProviderRequestSchema: z.ZodType<AddUserIdentifierExternalAuthProviderRequest>;
809
+
810
+ export interface AddUserIdentifierPhoneRequest {
811
+ phone_number: string;
812
+ confirmation_code: string;
813
+ }
814
+ export const addUserIdentifierPhoneRequestSchema: z.ZodType<AddUserIdentifierPhoneRequest>;
815
+
816
+ export interface UpdateUserRequest {
817
+ account_status: UserAccountStatus | null;
818
+ authority_level: number | null;
819
+ permission_codes: PermissionCode[] | null;
820
+ account_lockout_type: AccountLockoutType | null;
821
+ temporary_lockout_until: number | null;
822
+ }
823
+ export const updateUserRequestSchema: z.ZodType<UpdateUserRequest>;